@object-ui/plugin-detail 5.0.2 → 5.1.1
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 +164 -0
- package/README.md +74 -0
- package/dist/index.js +1397 -984
- package/dist/index.umd.cjs +3 -3
- package/dist/packages/plugin-detail/src/ActivityTimeline.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/ConcurrentUpdateDialog.d.ts +43 -0
- package/dist/packages/plugin-detail/src/ConcurrentUpdateDialog.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/DetailSection.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/DetailView.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/HeaderHighlight.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/RecordActivityTimeline.d.ts +11 -1
- package/dist/packages/plugin-detail/src/RecordActivityTimeline.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/RecordChatterPanel.d.ts +17 -0
- package/dist/packages/plugin-detail/src/RecordChatterPanel.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/RichTextCommentInput.d.ts +7 -0
- package/dist/packages/plugin-detail/src/RichTextCommentInput.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/index.d.ts +4 -1
- package/dist/packages/plugin-detail/src/index.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/renderers/record-chatter.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/renderers/record-details.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/renderers/record-reference-rail.d.ts +25 -0
- package/dist/packages/plugin-detail/src/renderers/record-reference-rail.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/synth/buildDefaultPageSchema.d.ts +14 -1
- package/dist/packages/plugin-detail/src/synth/buildDefaultPageSchema.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/useDetailTranslation.d.ts.map +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
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
|
-
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, Avatar as f, AvatarFallback as p, AvatarImage as m, Badge as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Collapsible as x, CollapsibleContent as S, CollapsibleTrigger as C,
|
|
5
|
-
import { Activity as
|
|
6
|
-
import { SchemaRenderer as
|
|
7
|
-
import { BooleanField as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { useFieldPermissions as
|
|
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, Avatar as f, AvatarFallback as p, AvatarImage as m, Badge as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Collapsible as x, CollapsibleContent as S, CollapsibleTrigger as C, DataEmptyState as w, Input as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Sheet as j, SheetContent as M, SheetHeader as N, SheetTitle as P, Skeleton as F, Tabs as I, TabsContent as L, TabsList as ee, TabsTrigger as R, Tooltip as z, TooltipContent as B, TooltipProvider as te, TooltipTrigger as V, buttonVariants as H, cn as U, useIsMobile as ne } from "@object-ui/components";
|
|
5
|
+
import { Activity as W, AlertTriangle as re, ArrowLeft as G, ArrowRight as ie, ArrowRightLeft as ae, ArrowUpDown as oe, AtSign as K, Bell as se, BellOff as ce, Bold as le, Calendar as q, Check as ue, CheckSquare as de, ChevronDown as fe, ChevronLeft as pe, ChevronRight as me, ChevronsLeft as he, ChevronsRight as ge, Code as J, Columns2 as _e, Copy as ve, Edit as Y, ExternalLink as ye, Eye as X, EyeOff as be, File as xe, FileArchive as Se, FileText as Ce, History as we, Image as Te, Inbox as Ee, Italic as De, Link as Oe, List as ke, Loader2 as Ae, Lock as je, Mail as Me, MessageSquare as Ne, Network as Pe, PanelRightClose as Fe, PanelRightOpen as Ie, Paperclip as Le, Phone as Re, Pin as ze, Plus as Be, PlusCircle as Ve, RotateCcw as He, Rows3 as Ue, Search as We, Send as Ge, SmilePlus as Ke, Star as qe, Trash2 as Je, Upload as Ye, X as Xe, Zap as Ze, icons as Qe } from "lucide-react";
|
|
6
|
+
import { SchemaRenderer as $e, useActionEngine as et, useDiscussionContext as tt, useHighlightFieldNames as nt, useObjectTranslation as rt, useRecordContext as it, useRegisterHighlightFields as at, useSafeFieldLabel as ot } from "@object-ui/react";
|
|
7
|
+
import { BooleanField as st, SelectField as ct, getCellRenderer as lt, humanizeLabel as ut, resolveCellRendererType as dt } from "@object-ui/fields";
|
|
8
|
+
import { Fragment as ft, jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
9
|
+
import { useFieldPermissions as pt, usePermissions as mt } from "@object-ui/permissions";
|
|
10
|
+
import { Link as ht, useParams as gt } from "react-router-dom";
|
|
10
11
|
//#region src/autoLayout.ts
|
|
11
|
-
var
|
|
12
|
+
var _t = new Set([
|
|
12
13
|
"textarea",
|
|
13
14
|
"markdown",
|
|
14
15
|
"html",
|
|
@@ -20,36 +21,36 @@ var ft = new Set([
|
|
|
20
21
|
"field:grid",
|
|
21
22
|
"field:rich-text"
|
|
22
23
|
]);
|
|
23
|
-
function
|
|
24
|
-
return
|
|
24
|
+
function vt(e) {
|
|
25
|
+
return _t.has(e);
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function yt(e, t) {
|
|
27
28
|
let n;
|
|
28
29
|
return n = e <= 3 ? 1 : 2, t !== void 0 && t < 640 ? Math.min(n, 1) : n;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
return t <= 1 ? e : e.map((e) => e.span === void 0 && e.type &&
|
|
31
|
+
function bt(e, t) {
|
|
32
|
+
return t <= 1 ? e : e.map((e) => e.span === void 0 && e.type && vt(e.type) ? {
|
|
32
33
|
...e,
|
|
33
34
|
span: t
|
|
34
35
|
} : e);
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function xt(e, t, n) {
|
|
37
38
|
if (t !== void 0) return {
|
|
38
|
-
fields:
|
|
39
|
+
fields: bt(e, t),
|
|
39
40
|
columns: t
|
|
40
41
|
};
|
|
41
|
-
let r =
|
|
42
|
+
let r = yt(e.length, n);
|
|
42
43
|
return {
|
|
43
|
-
fields:
|
|
44
|
+
fields: bt(e, r),
|
|
44
45
|
columns: r
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
48
|
//#endregion
|
|
48
49
|
//#region src/useDetailTranslation.ts
|
|
49
|
-
function
|
|
50
|
+
function St(e, t) {
|
|
50
51
|
return function() {
|
|
51
52
|
try {
|
|
52
|
-
let n =
|
|
53
|
+
let n = rt();
|
|
53
54
|
return n.t(t) === t ? { t: (t, n) => {
|
|
54
55
|
let r = e[t] || t;
|
|
55
56
|
if (n) for (let [e, t] of Object.entries(n)) r = r.replace(`{{${e}}}`, String(t));
|
|
@@ -64,7 +65,7 @@ function _t(e, t) {
|
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
var
|
|
68
|
+
var Ct = {
|
|
68
69
|
"detail.back": "Back",
|
|
69
70
|
"detail.edit": "Edit",
|
|
70
71
|
"detail.editInline": "Edit",
|
|
@@ -177,50 +178,59 @@ var vt = {
|
|
|
177
178
|
"detail.closeDiscussion": "Close discussion panel",
|
|
178
179
|
"detail.subscribeAriaLabel": "Subscribe to notifications",
|
|
179
180
|
"detail.unsubscribeAriaLabel": "Unsubscribe from notifications",
|
|
180
|
-
"detail.clearSearch": "Clear search"
|
|
181
|
-
|
|
181
|
+
"detail.clearSearch": "Clear search",
|
|
182
|
+
"detail.concurrentUpdateTitle": "This record was modified by someone else",
|
|
183
|
+
"detail.concurrentUpdateDescription": "Another user saved a newer version of {{field}} while you were editing. To prevent silently overwriting their change, please choose how to resolve the conflict.",
|
|
184
|
+
"detail.concurrentUpdateYourEdit": "Your edit",
|
|
185
|
+
"detail.concurrentUpdateCurrentValue": "Current value",
|
|
186
|
+
"detail.concurrentUpdateUpdatedBy": "Updated by {{name}}",
|
|
187
|
+
"detail.concurrentUpdateUpdatedAt": "Updated at {{when}}",
|
|
188
|
+
"detail.concurrentUpdateReload": "Reload latest",
|
|
189
|
+
"detail.concurrentUpdateOverwrite": "Overwrite anyway",
|
|
190
|
+
"detail.concurrentUpdateCancel": "Cancel"
|
|
191
|
+
}, $ = St(Ct, "detail.back");
|
|
182
192
|
//#endregion
|
|
183
193
|
//#region src/DetailSection.tsx
|
|
184
|
-
function
|
|
194
|
+
function wt(e, t) {
|
|
185
195
|
return !e || e <= 1 || t <= 1 ? "" : t === 2 ? e >= 2 ? "md:col-span-2" : "" : e === 2 ? "md:col-span-2" : e >= 3 ? "md:col-span-2 lg:col-span-3" : "";
|
|
186
196
|
}
|
|
187
|
-
var
|
|
188
|
-
let [l, u] = n.useState(e.defaultCollapsed ?? !1), [d, f] = n.useState(null), [p, m] = n.useState(void 0), [
|
|
197
|
+
var Tt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, isEditing: o = !1, onFieldChange: s, virtualScroll: c }) => {
|
|
198
|
+
let [l, u] = n.useState(e.defaultCollapsed ?? !1), [d, f] = n.useState(null), [p, m] = n.useState(void 0), [h, w] = n.useState(!1), { t: T } = $(), { fieldLabel: E, translateOptions: D } = ot(), O = n.useCallback((e, t) => {
|
|
189
199
|
let n = t == null ? "" : String(t);
|
|
190
200
|
navigator.clipboard.writeText(n).then(() => {
|
|
191
201
|
f(e), setTimeout(() => f(null), 2e3);
|
|
192
202
|
});
|
|
193
|
-
}, []),
|
|
203
|
+
}, []), k = n.useCallback((e) => {
|
|
194
204
|
let n = t?.[e.name] ?? e.value;
|
|
195
205
|
return n == null || n === "";
|
|
196
|
-
}, [t]),
|
|
197
|
-
if (I.length === 0 &&
|
|
198
|
-
let { fields: L, columns:
|
|
206
|
+
}, [t]), A = n.useMemo(() => e.fields.filter(k).length, [e.fields, k]), j = ne(), M = j ? 3 : 4, N = j ? .2 : .25, P = e.fields.length - A, F = !e.hideEmpty && !o && e.fields.length >= M && A / e.fields.length >= N && P > 0, I = !h && (e.hideEmpty || F) ? e.fields.filter((e) => !k(e)) : e.fields;
|
|
207
|
+
if (I.length === 0 && A === e.fields.length) return null;
|
|
208
|
+
let { fields: L, columns: ee } = xt(I, e.columns), R = (e) => {
|
|
199
209
|
let n = t?.[e.name] ?? e.value;
|
|
200
|
-
if (e.render) return /* @__PURE__ */ Z(
|
|
210
|
+
if (e.render) return /* @__PURE__ */ Z($e, {
|
|
201
211
|
schema: e.render,
|
|
202
212
|
data: {
|
|
203
213
|
...t,
|
|
204
214
|
value: n
|
|
205
215
|
}
|
|
206
216
|
});
|
|
207
|
-
let r =
|
|
217
|
+
let r = wt(e.span, ee), c = i?.fields?.[e.name], l = { ...e };
|
|
208
218
|
if (c) {
|
|
209
219
|
!e.type && c.type && (l.type = c.type), c.options && !l.options && (l.options = c.options), c.currency && !l.currency && (l.currency = c.currency), c.precision !== void 0 && l.precision === void 0 && (l.precision = c.precision), c.format && !l.format && (l.format = c.format);
|
|
210
220
|
let t = c.reference_to || c.reference;
|
|
211
221
|
t && !l.reference_to && (l.reference_to = t), c.reference_field && !l.reference_field && (l.reference_field = c.reference_field);
|
|
212
222
|
}
|
|
213
|
-
a && Array.isArray(l.options) && l.options.length > 0 && (l.options =
|
|
223
|
+
a && Array.isArray(l.options) && l.options.length > 0 && (l.options = D(a, e.name, l.options));
|
|
214
224
|
let u = (() => {
|
|
215
225
|
if (n == null || n === "") return /* @__PURE__ */ Z("span", {
|
|
216
226
|
className: "text-muted-foreground/60 text-sm select-none",
|
|
217
|
-
"aria-label":
|
|
218
|
-
title:
|
|
227
|
+
"aria-label": T("detail.noValue", { defaultValue: "No value" }),
|
|
228
|
+
title: T("detail.noValue", { defaultValue: "No value" }),
|
|
219
229
|
children: "—"
|
|
220
230
|
});
|
|
221
|
-
let t =
|
|
231
|
+
let t = dt(l) || e.type;
|
|
222
232
|
if (t) {
|
|
223
|
-
let e =
|
|
233
|
+
let e = lt(t);
|
|
224
234
|
if (e) return /* @__PURE__ */ Z(e, {
|
|
225
235
|
value: n,
|
|
226
236
|
field: l
|
|
@@ -229,20 +239,20 @@ var bt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
229
239
|
return String(n);
|
|
230
240
|
})(), f = n != null && n !== "", p = d === e.name;
|
|
231
241
|
return /* @__PURE__ */ Q("div", {
|
|
232
|
-
className:
|
|
242
|
+
className: U("space-y-1.5 group", r),
|
|
233
243
|
children: [/* @__PURE__ */ Z("div", {
|
|
234
244
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
|
|
235
|
-
children:
|
|
245
|
+
children: E(a || "", e.name, e.label || e.name)
|
|
236
246
|
}), o && !e.readonly ? /* @__PURE__ */ Z("div", {
|
|
237
247
|
className: "min-h-[44px] sm:min-h-0",
|
|
238
248
|
children: (() => {
|
|
239
249
|
let t = l.type || e.type;
|
|
240
|
-
if (t === "select" && Array.isArray(l.options) && l.options.length > 0) return /* @__PURE__ */ Z(
|
|
250
|
+
if (t === "select" && Array.isArray(l.options) && l.options.length > 0) return /* @__PURE__ */ Z(ct, {
|
|
241
251
|
field: l,
|
|
242
252
|
value: n == null ? "" : String(n),
|
|
243
253
|
onChange: (t) => s?.(e.name, t)
|
|
244
254
|
});
|
|
245
|
-
if (t === "boolean") return /* @__PURE__ */ Z(
|
|
255
|
+
if (t === "boolean") return /* @__PURE__ */ Z(st, {
|
|
246
256
|
field: l,
|
|
247
257
|
value: !!n,
|
|
248
258
|
onChange: (t) => s?.(e.name, t)
|
|
@@ -267,68 +277,68 @@ var bt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
267
277
|
});
|
|
268
278
|
})()
|
|
269
279
|
}) : /* @__PURE__ */ Q("div", {
|
|
270
|
-
className:
|
|
271
|
-
onClick: f ? () =>
|
|
280
|
+
className: U("flex items-start justify-between gap-2 min-h-[44px] sm:min-h-0 rounded-md", f && "cursor-pointer active:bg-muted/60 transition-colors"),
|
|
281
|
+
onClick: f ? () => O(e.name, n) : void 0,
|
|
272
282
|
onKeyDown: f ? (t) => {
|
|
273
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
283
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), O(e.name, n));
|
|
274
284
|
} : void 0,
|
|
275
285
|
role: f ? "button" : void 0,
|
|
276
286
|
tabIndex: f ? 0 : void 0,
|
|
277
287
|
children: [/* @__PURE__ */ Z("div", {
|
|
278
288
|
className: "text-sm flex-1 break-words py-1",
|
|
279
289
|
children: u
|
|
280
|
-
}), f && /* @__PURE__ */ Z(
|
|
290
|
+
}), f && /* @__PURE__ */ Z(te, { children: /* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
281
291
|
asChild: !0,
|
|
282
292
|
children: /* @__PURE__ */ Z(g, {
|
|
283
293
|
variant: "ghost",
|
|
284
294
|
size: "icon",
|
|
285
295
|
className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",
|
|
286
296
|
onClick: (t) => {
|
|
287
|
-
t.stopPropagation(),
|
|
297
|
+
t.stopPropagation(), O(e.name, n);
|
|
288
298
|
},
|
|
289
|
-
children: p ? /* @__PURE__ */ Z(
|
|
299
|
+
children: p ? /* @__PURE__ */ Z(ue, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Z(ve, { className: "h-3 w-3" })
|
|
290
300
|
})
|
|
291
|
-
}), /* @__PURE__ */ Z(
|
|
301
|
+
}), /* @__PURE__ */ Z(B, { children: T(p ? "detail.copied" : "detail.copyToClipboard") })] }) })]
|
|
292
302
|
})]
|
|
293
303
|
}, e.name);
|
|
294
|
-
},
|
|
304
|
+
}, H = c?.enabled === !0, W = c?.batchSize ?? 20;
|
|
295
305
|
n.useEffect(() => {
|
|
296
|
-
if (!
|
|
306
|
+
if (!H) {
|
|
297
307
|
m(void 0);
|
|
298
308
|
return;
|
|
299
309
|
}
|
|
300
|
-
if (L.length <=
|
|
310
|
+
if (L.length <= W) {
|
|
301
311
|
m(void 0);
|
|
302
312
|
return;
|
|
303
313
|
}
|
|
304
|
-
m(
|
|
314
|
+
m(W);
|
|
305
315
|
let e = setTimeout(() => m(void 0), 100);
|
|
306
316
|
return () => clearTimeout(e);
|
|
307
317
|
}, [
|
|
308
|
-
|
|
318
|
+
H,
|
|
309
319
|
L.length,
|
|
310
|
-
|
|
320
|
+
W
|
|
311
321
|
]);
|
|
312
|
-
let
|
|
313
|
-
className:
|
|
314
|
-
children:
|
|
322
|
+
let re = p === void 0 ? L : L.slice(0, p), G = A > 0 && (e.hideEmpty || F), ie = /* @__PURE__ */ Q(ft, { children: [/* @__PURE__ */ Z("div", {
|
|
323
|
+
className: U("grid gap-3 sm:gap-4", ee === 1 ? "grid-cols-1" : ee === 2 ? "grid-cols-1 md:grid-cols-2" : "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),
|
|
324
|
+
children: re.map(R)
|
|
315
325
|
}), G && /* @__PURE__ */ Z("div", {
|
|
316
326
|
className: "mt-3 -ml-2",
|
|
317
327
|
children: /* @__PURE__ */ Q(g, {
|
|
318
328
|
type: "button",
|
|
319
329
|
variant: "ghost",
|
|
320
330
|
size: "sm",
|
|
321
|
-
onClick: () =>
|
|
331
|
+
onClick: () => w((e) => !e),
|
|
322
332
|
className: "h-7 px-2 text-xs text-muted-foreground hover:text-foreground",
|
|
323
|
-
children: [Z(
|
|
324
|
-
count:
|
|
325
|
-
defaultValue: `Show ${
|
|
333
|
+
children: [Z(h ? be : X, { className: "h-3.5 w-3.5 mr-1.5" }), h ? T("detail.hideEmptyFields", { defaultValue: "Hide empty fields" }) : T("detail.showEmptyFields", {
|
|
334
|
+
count: A,
|
|
335
|
+
defaultValue: `Show ${A} empty field${A === 1 ? "" : "s"}`
|
|
326
336
|
})]
|
|
327
337
|
})
|
|
328
338
|
})] });
|
|
329
339
|
return !e.title && !e.collapsible && e.showBorder === !1 ? /* @__PURE__ */ Z("div", {
|
|
330
|
-
className:
|
|
331
|
-
children:
|
|
340
|
+
className: U(r),
|
|
341
|
+
children: ie
|
|
332
342
|
}) : e.collapsible ? /* @__PURE__ */ Z(x, {
|
|
333
343
|
open: !l,
|
|
334
344
|
onOpenChange: (e) => u(!e),
|
|
@@ -336,42 +346,34 @@ var bt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
336
346
|
children: /* @__PURE__ */ Q(_, { children: [/* @__PURE__ */ Z(C, {
|
|
337
347
|
asChild: !0,
|
|
338
348
|
children: /* @__PURE__ */ Q(y, {
|
|
339
|
-
className:
|
|
349
|
+
className: U("py-3 px-4 sm:py-4 sm:px-6 cursor-pointer hover:bg-muted/50 transition-colors", e.headerColor && `bg-${e.headerColor}`),
|
|
340
350
|
children: [/* @__PURE__ */ Q(b, {
|
|
341
|
-
className: "flex items-center justify-between",
|
|
351
|
+
className: "flex items-center justify-between text-base font-semibold tracking-tight",
|
|
342
352
|
children: [/* @__PURE__ */ Q("div", {
|
|
343
353
|
className: "flex items-center gap-2",
|
|
344
|
-
children: [
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}),
|
|
349
|
-
/* @__PURE__ */ Z("span", { children: e.title }),
|
|
350
|
-
e.fields && /* @__PURE__ */ Z(h, {
|
|
351
|
-
variant: "secondary",
|
|
352
|
-
className: "ml-2 text-xs",
|
|
353
|
-
children: e.fields.length
|
|
354
|
-
})
|
|
355
|
-
]
|
|
354
|
+
children: [e.icon && /* @__PURE__ */ Z("span", {
|
|
355
|
+
className: "text-muted-foreground",
|
|
356
|
+
children: e.icon
|
|
357
|
+
}), /* @__PURE__ */ Z("span", { children: e.title })]
|
|
356
358
|
}), /* @__PURE__ */ Z("div", {
|
|
357
359
|
className: "flex items-center gap-2",
|
|
358
|
-
children: Z(l ?
|
|
360
|
+
children: Z(l ? me : fe, { className: "h-4 w-4 text-muted-foreground" })
|
|
359
361
|
})]
|
|
360
362
|
}), e.description && !l && /* @__PURE__ */ Z("p", {
|
|
361
|
-
className: "text-
|
|
363
|
+
className: "text-xs text-muted-foreground mt-1",
|
|
362
364
|
children: e.description
|
|
363
365
|
})]
|
|
364
366
|
})
|
|
365
367
|
}), /* @__PURE__ */ Z(S, { children: /* @__PURE__ */ Z(v, {
|
|
366
|
-
className: "pt-
|
|
367
|
-
children:
|
|
368
|
+
className: "pt-3 sm:pt-4 px-3 sm:px-6 pb-4 sm:pb-5",
|
|
369
|
+
children: ie
|
|
368
370
|
}) })] })
|
|
369
371
|
}) : /* @__PURE__ */ Q(_, {
|
|
370
|
-
className:
|
|
372
|
+
className: U(e.showBorder === !1 ? "border-none shadow-none" : "", r),
|
|
371
373
|
children: [e.title && /* @__PURE__ */ Q(y, {
|
|
372
|
-
className:
|
|
374
|
+
className: U("py-3 px-4 sm:py-4 sm:px-6", e.headerColor && `bg-${e.headerColor}`),
|
|
373
375
|
children: [/* @__PURE__ */ Z(b, {
|
|
374
|
-
className: "flex items-center justify-between",
|
|
376
|
+
className: "flex items-center justify-between text-base font-semibold tracking-tight",
|
|
375
377
|
children: /* @__PURE__ */ Q("div", {
|
|
376
378
|
className: "flex items-center gap-2",
|
|
377
379
|
children: [e.icon && /* @__PURE__ */ Z("span", {
|
|
@@ -380,23 +382,23 @@ var bt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
380
382
|
}), /* @__PURE__ */ Z("span", { children: e.title })]
|
|
381
383
|
})
|
|
382
384
|
}), e.description && /* @__PURE__ */ Z("p", {
|
|
383
|
-
className: "text-
|
|
385
|
+
className: "text-xs text-muted-foreground mt-1",
|
|
384
386
|
children: e.description
|
|
385
387
|
})]
|
|
386
388
|
}), /* @__PURE__ */ Z(v, {
|
|
387
|
-
className: "pt-
|
|
388
|
-
children:
|
|
389
|
+
className: "pt-3 sm:pt-4 px-3 sm:px-6 pb-4 sm:pb-5",
|
|
390
|
+
children: ie
|
|
389
391
|
})]
|
|
390
392
|
});
|
|
391
|
-
},
|
|
393
|
+
}, Et = ({ tabs: e, data: t, className: r }) => {
|
|
392
394
|
let [i, a] = n.useState(e[0]?.key), o = e.filter((e) => typeof e.visible == "boolean" ? e.visible : (e.visible, !0));
|
|
393
|
-
return /* @__PURE__ */ Q(
|
|
395
|
+
return /* @__PURE__ */ Q(I, {
|
|
394
396
|
value: i,
|
|
395
397
|
onValueChange: a,
|
|
396
398
|
className: r,
|
|
397
|
-
children: [/* @__PURE__ */ Z(
|
|
399
|
+
children: [/* @__PURE__ */ Z(ee, {
|
|
398
400
|
className: "w-full justify-start border-b rounded-none bg-transparent p-0",
|
|
399
|
-
children: o.map((e) => /* @__PURE__ */ Z(
|
|
401
|
+
children: o.map((e) => /* @__PURE__ */ Z(R, {
|
|
400
402
|
value: e.key,
|
|
401
403
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
402
404
|
children: /* @__PURE__ */ Q("div", {
|
|
@@ -412,18 +414,18 @@ var bt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
412
414
|
]
|
|
413
415
|
})
|
|
414
416
|
}, e.key))
|
|
415
|
-
}), o.map((e) => /* @__PURE__ */ Z(
|
|
417
|
+
}), o.map((e) => /* @__PURE__ */ Z(L, {
|
|
416
418
|
value: e.key,
|
|
417
419
|
className: "mt-4",
|
|
418
420
|
children: /* @__PURE__ */ Z(n.Suspense, {
|
|
419
421
|
fallback: null,
|
|
420
422
|
children: Array.isArray(e.content) ? /* @__PURE__ */ Z("div", {
|
|
421
423
|
className: "space-y-4",
|
|
422
|
-
children: e.content.map((e, n) => /* @__PURE__ */ Z(
|
|
424
|
+
children: e.content.map((e, n) => /* @__PURE__ */ Z($e, {
|
|
423
425
|
schema: e,
|
|
424
426
|
data: t
|
|
425
427
|
}, n))
|
|
426
|
-
}) : /* @__PURE__ */ Z(
|
|
428
|
+
}) : /* @__PURE__ */ Z($e, {
|
|
427
429
|
schema: e.content,
|
|
428
430
|
data: t
|
|
429
431
|
})
|
|
@@ -433,13 +435,13 @@ var bt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
433
435
|
};
|
|
434
436
|
//#endregion
|
|
435
437
|
//#region src/RelatedList.tsx
|
|
436
|
-
function
|
|
437
|
-
return e &&
|
|
438
|
+
function Dt(e) {
|
|
439
|
+
return e && Qe[e.split(/[-_\s]/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] || Ee;
|
|
438
440
|
}
|
|
439
|
-
var
|
|
440
|
-
let R = f !== void 0, z = f ?? [], [B,
|
|
441
|
+
var Ot = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className: x, dataSource: S, objectName: C, onNew: w, onViewAll: E, onRowEdit: D, onRowDelete: O, onRowClick: k, maxColumns: A = 6, pageSize: j, sortable: M = !1, filterable: N = !1, collapsible: P = !1, defaultCollapsed: F = !1, referenceField: I, parentId: L, icon: ee }) => {
|
|
442
|
+
let R = f !== void 0, z = f ?? [], [B, te] = n.useState(z), [V, H] = n.useState(() => !!r && !R), [W, re] = n.useState(0), [G, ie] = n.useState(null), [ae, K] = n.useState("asc"), [se, ce] = n.useState(""), [le, q] = n.useState(null), [ue, de] = n.useState(F), [he, ge] = n.useState({}), { t: J } = $(), { fieldLabel: _e } = ot();
|
|
441
443
|
n.useEffect(() => {
|
|
442
|
-
R &&
|
|
444
|
+
R && te(f ?? []);
|
|
443
445
|
}, [f, R]), n.useEffect(() => {
|
|
444
446
|
r && S?.getObjectSchema && !m?.length && S.getObjectSchema(r).then(q).catch((e) => {
|
|
445
447
|
console.warn(`[RelatedList] Failed to fetch schema for ${r}:`, e);
|
|
@@ -450,32 +452,32 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
450
452
|
m
|
|
451
453
|
]), n.useEffect(() => {
|
|
452
454
|
if (r && !R) {
|
|
453
|
-
if (!(
|
|
454
|
-
r && (
|
|
455
|
+
if (!(I && L != null && L !== "")) {
|
|
456
|
+
r && (L == null || L === "") && !I && console.warn(`[RelatedList] "${r}" has no referenceField/parentId — refusing to fetch all rows. Pass relationshipField + parentId to scope the query.`), te([]), H(!1);
|
|
455
457
|
return;
|
|
456
458
|
}
|
|
457
|
-
|
|
458
|
-
let e = { [
|
|
459
|
+
H(!0);
|
|
460
|
+
let e = { [I]: L };
|
|
459
461
|
if (S && typeof S.find == "function") S.find(r, { $filter: e }).then((e) => {
|
|
460
|
-
|
|
462
|
+
te(Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []), H(!1);
|
|
461
463
|
}).catch((e) => {
|
|
462
|
-
console.error("Failed to fetch related data:", e),
|
|
464
|
+
console.error("Failed to fetch related data:", e), H(!1);
|
|
463
465
|
});
|
|
464
466
|
else {
|
|
465
|
-
let e = new URLSearchParams({ [`filter[${
|
|
467
|
+
let e = new URLSearchParams({ [`filter[${I}]`]: String(L) }).toString();
|
|
466
468
|
fetch(`${r}?${e}`).then((e) => e.json()).then((e) => {
|
|
467
|
-
|
|
469
|
+
te(Array.isArray(e) ? e : e?.data || []);
|
|
468
470
|
}).catch((e) => {
|
|
469
471
|
console.error("Failed to fetch related data:", e);
|
|
470
|
-
}).finally(() =>
|
|
472
|
+
}).finally(() => H(!1));
|
|
471
473
|
}
|
|
472
474
|
}
|
|
473
475
|
}, [
|
|
474
476
|
r,
|
|
475
477
|
R,
|
|
476
478
|
S,
|
|
477
|
-
|
|
478
|
-
|
|
479
|
+
I,
|
|
480
|
+
L
|
|
479
481
|
]), n.useEffect(() => {
|
|
480
482
|
if (!S?.find || !le?.fields || !B.length) return;
|
|
481
483
|
let e = le.fields, t = [];
|
|
@@ -530,40 +532,40 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
530
532
|
le,
|
|
531
533
|
B
|
|
532
534
|
]);
|
|
533
|
-
let
|
|
535
|
+
let ve = n.useMemo(() => {
|
|
534
536
|
if (!se) return B;
|
|
535
537
|
let e = se.toLowerCase();
|
|
536
538
|
return B.filter((t) => Object.values(t).some((t) => t != null && String(t).toLowerCase().includes(e)));
|
|
537
|
-
}, [B, se]),
|
|
539
|
+
}, [B, se]), Y = n.useMemo(() => G ? [...ve].sort((e, t) => {
|
|
538
540
|
let n = e[G], r = t[G];
|
|
539
541
|
if (n == null && r == null) return 0;
|
|
540
542
|
if (n == null) return 1;
|
|
541
543
|
if (r == null) return -1;
|
|
542
544
|
let i = String(n).localeCompare(String(r), void 0, { numeric: !0 });
|
|
543
|
-
return
|
|
544
|
-
}) :
|
|
545
|
-
|
|
545
|
+
return ae === "asc" ? i : -i;
|
|
546
|
+
}) : ve, [
|
|
547
|
+
ve,
|
|
546
548
|
G,
|
|
547
|
-
|
|
548
|
-
]),
|
|
549
|
+
ae
|
|
550
|
+
]), X = j && j > 0 ? j : 0, be = X ? Math.max(1, Math.ceil(Y.length / X)) : 1, xe = X ? Y.slice(W * X, (W + 1) * X) : Y;
|
|
549
551
|
n.useEffect(() => {
|
|
550
552
|
re(0);
|
|
551
553
|
}, [
|
|
552
554
|
se,
|
|
553
555
|
G,
|
|
554
|
-
|
|
556
|
+
ae
|
|
555
557
|
]);
|
|
556
|
-
let
|
|
557
|
-
G === e ? K((e) => e === "asc" ? "desc" : "asc") : (
|
|
558
|
-
}, [G]), [
|
|
558
|
+
let Se = n.useCallback((e) => {
|
|
559
|
+
G === e ? K((e) => e === "asc" ? "desc" : "asc") : (ie(e), K("asc"));
|
|
560
|
+
}, [G]), [Ce, we] = n.useState(null), Te = n.useCallback((e) => {
|
|
559
561
|
we(e);
|
|
560
562
|
}, []), Ee = n.useCallback(() => {
|
|
561
|
-
|
|
562
|
-
}, [
|
|
563
|
+
Ce && O?.(Ce), we(null);
|
|
564
|
+
}, [Ce, O]), De = mt(), Oe = n.useMemo(() => {
|
|
563
565
|
let e = C || r || "", t = (t) => !De?.isLoaded || !e ? t : t.filter((t) => {
|
|
564
566
|
let n = t?.accessorKey || t?.field || t?.name;
|
|
565
567
|
return n ? De.checkField(e, String(n), "read") : !0;
|
|
566
|
-
}), i = (e) =>
|
|
568
|
+
}), i = (e) => I ? e.filter((e) => (e?.accessorKey || e?.field || e?.name) !== I) : e, a = (e) => e == null || typeof e == "string" && e.trim() === "" || Array.isArray(e) && e.length === 0, o = (e) => B.length ? e.filter((e) => {
|
|
567
569
|
let t = e?.accessorKey || e?.field || e?.name;
|
|
568
570
|
return t ? B.some((e) => !a(e?.[t])) : !0;
|
|
569
571
|
}) : e;
|
|
@@ -585,7 +587,7 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
585
587
|
"label",
|
|
586
588
|
"code",
|
|
587
589
|
"number"
|
|
588
|
-
], u = Object.entries(le.fields).filter(([e, t]) => !(e.startsWith("_") || e === "id" || e ===
|
|
590
|
+
], u = Object.entries(le.fields).filter(([e, t]) => !(e.startsWith("_") || e === "id" || e === I || t?.hidden || t?.type && c.has(t.type) || De?.isLoaded && s && !De.checkField(s, e, "read")));
|
|
589
591
|
return u.sort(([e, t], [n, r]) => {
|
|
590
592
|
let i = l.indexOf(e), a = l.indexOf(n), o = i >= 0 ? i : 100, s = a >= 0 ? a : 100;
|
|
591
593
|
if (o !== s) return o - s;
|
|
@@ -594,10 +596,10 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
594
596
|
}), o(u.map(([e, t]) => {
|
|
595
597
|
let r = {
|
|
596
598
|
accessorKey: e,
|
|
597
|
-
header:
|
|
599
|
+
header: _e(s, e, t.label || e)
|
|
598
600
|
};
|
|
599
601
|
if (t.type) {
|
|
600
|
-
let i =
|
|
602
|
+
let i = lt(dt({
|
|
601
603
|
type: t.type,
|
|
602
604
|
format: t.format
|
|
603
605
|
}) || t.type);
|
|
@@ -629,19 +631,19 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
629
631
|
le,
|
|
630
632
|
C,
|
|
631
633
|
r,
|
|
632
|
-
|
|
633
|
-
|
|
634
|
+
_e,
|
|
635
|
+
I,
|
|
634
636
|
B,
|
|
635
637
|
A,
|
|
636
638
|
he,
|
|
637
639
|
De
|
|
638
|
-
]), ke = !!D || !!O, Ae =
|
|
640
|
+
]), ke = !!D || !!O, Ae = ne(), je = n.useMemo(() => {
|
|
639
641
|
if (p) return p;
|
|
640
642
|
if (Ae && (t === "grid" || t === "table")) {
|
|
641
643
|
let e = Oe[0]?.accessorKey || Oe[0]?.field || Oe[0]?.name, t = Oe.slice(1, 4).map((e) => e.accessorKey || e.field || e.name).filter(Boolean);
|
|
642
644
|
return {
|
|
643
645
|
type: "object-gallery",
|
|
644
|
-
data:
|
|
646
|
+
data: xe,
|
|
645
647
|
objectName: r,
|
|
646
648
|
gallery: {
|
|
647
649
|
titleField: e || "name",
|
|
@@ -655,10 +657,10 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
655
657
|
case "grid":
|
|
656
658
|
case "table": return {
|
|
657
659
|
type: "data-table",
|
|
658
|
-
data:
|
|
660
|
+
data: xe,
|
|
659
661
|
columns: Oe,
|
|
660
662
|
pagination: !1,
|
|
661
|
-
pageSize:
|
|
663
|
+
pageSize: X || 10,
|
|
662
664
|
searchable: !1,
|
|
663
665
|
exportable: !1,
|
|
664
666
|
rowActions: ke,
|
|
@@ -668,7 +670,7 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
668
670
|
};
|
|
669
671
|
case "list": return {
|
|
670
672
|
type: "data-list",
|
|
671
|
-
data:
|
|
673
|
+
data: xe
|
|
672
674
|
};
|
|
673
675
|
default: return {
|
|
674
676
|
type: "div",
|
|
@@ -677,10 +679,10 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
677
679
|
}
|
|
678
680
|
}, [
|
|
679
681
|
t,
|
|
680
|
-
|
|
682
|
+
xe,
|
|
681
683
|
Oe,
|
|
682
684
|
p,
|
|
683
|
-
|
|
685
|
+
X,
|
|
684
686
|
ke,
|
|
685
687
|
D,
|
|
686
688
|
O,
|
|
@@ -688,30 +690,30 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
688
690
|
k,
|
|
689
691
|
Ae,
|
|
690
692
|
r
|
|
691
|
-
]), Me = P ? "cursor-pointer select-none" : void 0, Ne = P ? () =>
|
|
693
|
+
]), Me = P ? "cursor-pointer select-none" : void 0, Ne = P ? () => de((e) => !e) : void 0, Pe = Dt(ee), Fe = !V && B.length === 0, Ie = N;
|
|
692
694
|
return /* @__PURE__ */ Q(_, {
|
|
693
|
-
className:
|
|
695
|
+
className: U("shadow-none border-border/60 bg-transparent", Fe && "bg-muted/10", x),
|
|
694
696
|
children: [
|
|
695
697
|
/* @__PURE__ */ Z(y, {
|
|
696
|
-
className:
|
|
698
|
+
className: U("py-3 px-4 sm:py-3 min-h-12 sm:min-h-0", Me),
|
|
697
699
|
onClick: Ne,
|
|
698
700
|
children: /* @__PURE__ */ Q(b, {
|
|
699
701
|
className: "flex items-center justify-between gap-2 text-sm font-semibold",
|
|
700
702
|
children: [/* @__PURE__ */ Q("div", {
|
|
701
703
|
className: "flex items-center gap-2 min-w-0",
|
|
702
704
|
children: [
|
|
703
|
-
P && Z(
|
|
705
|
+
P && Z(ue ? me : fe, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
|
|
704
706
|
/* @__PURE__ */ Z(Pe, {
|
|
705
707
|
className: "h-4 w-4 text-muted-foreground shrink-0",
|
|
706
708
|
"aria-hidden": !0
|
|
707
709
|
}),
|
|
708
710
|
/* @__PURE__ */ Z("span", {
|
|
709
|
-
className:
|
|
711
|
+
className: U("truncate", Fe && "text-muted-foreground font-medium"),
|
|
710
712
|
children: e
|
|
711
713
|
}),
|
|
712
714
|
/* @__PURE__ */ Z(h, {
|
|
713
715
|
variant: "secondary",
|
|
714
|
-
className:
|
|
716
|
+
className: U("text-xs font-normal h-5 px-1.5", B.length === 0 && "bg-muted text-muted-foreground"),
|
|
715
717
|
"aria-label": `${B.length} records`,
|
|
716
718
|
children: B.length
|
|
717
719
|
}),
|
|
@@ -722,24 +724,24 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
722
724
|
]
|
|
723
725
|
}), /* @__PURE__ */ Z("div", {
|
|
724
726
|
className: "flex items-center gap-1 shrink-0",
|
|
725
|
-
children:
|
|
727
|
+
children: w && /* @__PURE__ */ Q(g, {
|
|
726
728
|
variant: Fe ? "ghost" : "outline",
|
|
727
729
|
size: "sm",
|
|
728
730
|
onClick: (e) => {
|
|
729
|
-
e.stopPropagation(),
|
|
731
|
+
e.stopPropagation(), w();
|
|
730
732
|
},
|
|
731
733
|
className: "gap-1 h-9 sm:h-7 text-xs shadow-none",
|
|
732
|
-
children: [/* @__PURE__ */ Z(
|
|
734
|
+
children: [/* @__PURE__ */ Z(Be, { className: "h-3.5 w-3.5" }), J("detail.new")]
|
|
733
735
|
})
|
|
734
736
|
})]
|
|
735
737
|
})
|
|
736
738
|
}),
|
|
737
|
-
!
|
|
738
|
-
className:
|
|
739
|
+
!ue && !Fe && /* @__PURE__ */ Q(v, {
|
|
740
|
+
className: U("pt-0 pb-4 px-4"),
|
|
739
741
|
children: [
|
|
740
742
|
Ie && /* @__PURE__ */ Z("div", {
|
|
741
743
|
className: "mb-3",
|
|
742
|
-
children: /* @__PURE__ */ Z(
|
|
744
|
+
children: /* @__PURE__ */ Z(T, {
|
|
743
745
|
placeholder: J("detail.filterPlaceholder"),
|
|
744
746
|
value: se,
|
|
745
747
|
onChange: (e) => ce(e.target.value),
|
|
@@ -756,20 +758,20 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
756
758
|
variant: r ? "secondary" : "ghost",
|
|
757
759
|
size: "sm",
|
|
758
760
|
className: "gap-1 h-7 text-xs",
|
|
759
|
-
onClick: () =>
|
|
761
|
+
onClick: () => Se(t),
|
|
760
762
|
children: [
|
|
761
|
-
/* @__PURE__ */ Z(
|
|
763
|
+
/* @__PURE__ */ Z(oe, { className: "h-3 w-3" }),
|
|
762
764
|
n,
|
|
763
|
-
r && (
|
|
765
|
+
r && (ae === "asc" ? " ↑" : " ↓")
|
|
764
766
|
]
|
|
765
767
|
}, t);
|
|
766
768
|
})
|
|
767
769
|
}),
|
|
768
|
-
|
|
770
|
+
V ? /* @__PURE__ */ Z("div", {
|
|
769
771
|
className: "flex items-center justify-center py-6 text-muted-foreground text-sm",
|
|
770
772
|
children: J("detail.loading")
|
|
771
|
-
}) : /* @__PURE__ */ Z(
|
|
772
|
-
|
|
773
|
+
}) : /* @__PURE__ */ Z($e, { schema: je }),
|
|
774
|
+
X > 0 && Y.length > X && /* @__PURE__ */ Q("div", {
|
|
773
775
|
className: "flex items-center justify-between mt-3 pt-3 border-t",
|
|
774
776
|
children: [
|
|
775
777
|
/* @__PURE__ */ Q(g, {
|
|
@@ -778,26 +780,26 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
778
780
|
className: "h-7 text-xs gap-1",
|
|
779
781
|
disabled: W === 0,
|
|
780
782
|
onClick: () => re((e) => Math.max(0, e - 1)),
|
|
781
|
-
children: [/* @__PURE__ */ Z(
|
|
783
|
+
children: [/* @__PURE__ */ Z(pe, { className: "h-3 w-3" }), J("detail.previousPage")]
|
|
782
784
|
}),
|
|
783
785
|
/* @__PURE__ */ Z("span", {
|
|
784
786
|
className: "text-xs text-muted-foreground",
|
|
785
787
|
children: J("detail.pageOf", {
|
|
786
788
|
current: W + 1,
|
|
787
|
-
total:
|
|
789
|
+
total: be
|
|
788
790
|
})
|
|
789
791
|
}),
|
|
790
792
|
/* @__PURE__ */ Q(g, {
|
|
791
793
|
variant: "outline",
|
|
792
794
|
size: "sm",
|
|
793
795
|
className: "h-7 text-xs gap-1",
|
|
794
|
-
disabled: W >=
|
|
795
|
-
onClick: () => re((e) => Math.min(
|
|
796
|
-
children: [J("detail.nextPage"), /* @__PURE__ */ Z(
|
|
796
|
+
disabled: W >= be - 1,
|
|
797
|
+
onClick: () => re((e) => Math.min(be - 1, e + 1)),
|
|
798
|
+
children: [J("detail.nextPage"), /* @__PURE__ */ Z(me, { className: "h-3 w-3" })]
|
|
797
799
|
})
|
|
798
800
|
]
|
|
799
801
|
}),
|
|
800
|
-
E && !Fe &&
|
|
802
|
+
E && !Fe && X > 0 && Y.length > X && /* @__PURE__ */ Z("div", {
|
|
801
803
|
className: "mt-3 pt-3 border-t flex justify-center",
|
|
802
804
|
children: /* @__PURE__ */ Q("button", {
|
|
803
805
|
type: "button",
|
|
@@ -805,13 +807,13 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
805
807
|
e.stopPropagation(), E();
|
|
806
808
|
},
|
|
807
809
|
className: "text-xs text-muted-foreground hover:text-foreground inline-flex items-center gap-1 transition-colors",
|
|
808
|
-
children: [J("detail.viewAll"), /* @__PURE__ */ Z(
|
|
810
|
+
children: [J("detail.viewAll"), /* @__PURE__ */ Z(ye, { className: "h-3 w-3" })]
|
|
809
811
|
})
|
|
810
812
|
})
|
|
811
813
|
]
|
|
812
814
|
}),
|
|
813
815
|
/* @__PURE__ */ Z(i, {
|
|
814
|
-
open:
|
|
816
|
+
open: Ce !== null,
|
|
815
817
|
onOpenChange: (e) => {
|
|
816
818
|
e || we(null);
|
|
817
819
|
},
|
|
@@ -823,10 +825,10 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
823
825
|
})
|
|
824
826
|
]
|
|
825
827
|
});
|
|
826
|
-
},
|
|
828
|
+
}, kt = ({ group: e, data: t, className: r, objectSchema: i, objectName: a, isEditing: o = !1, onFieldChange: s }) => {
|
|
827
829
|
let c = e.collapsible ?? !0, [l, u] = n.useState(e.defaultCollapsed ?? !1), d = /* @__PURE__ */ Z("div", {
|
|
828
830
|
className: "space-y-3 sm:space-y-4",
|
|
829
|
-
children: e.sections.map((e, n) => /* @__PURE__ */ Z(
|
|
831
|
+
children: e.sections.map((e, n) => /* @__PURE__ */ Z(Tt, {
|
|
830
832
|
section: e,
|
|
831
833
|
data: t,
|
|
832
834
|
objectSchema: i,
|
|
@@ -845,7 +847,7 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
845
847
|
children: /* @__PURE__ */ Q("div", {
|
|
846
848
|
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",
|
|
847
849
|
children: [
|
|
848
|
-
Z(l ?
|
|
850
|
+
Z(l ? me : fe, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
849
851
|
e.icon && /* @__PURE__ */ Z("span", {
|
|
850
852
|
className: "text-muted-foreground",
|
|
851
853
|
children: e.icon
|
|
@@ -867,7 +869,7 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
867
869
|
}) })
|
|
868
870
|
]
|
|
869
871
|
}) : /* @__PURE__ */ Q("div", {
|
|
870
|
-
className:
|
|
872
|
+
className: U("space-y-3", r),
|
|
871
873
|
children: [
|
|
872
874
|
/* @__PURE__ */ Q("div", {
|
|
873
875
|
className: "flex items-center gap-2 pb-2 border-b",
|
|
@@ -886,18 +888,18 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
886
888
|
d
|
|
887
889
|
]
|
|
888
890
|
});
|
|
889
|
-
},
|
|
890
|
-
let { fieldLabel: a } =
|
|
891
|
+
}, At = ({ fields: e, data: t, className: n, objectName: r, objectSchema: i }) => {
|
|
892
|
+
let { fieldLabel: a } = ot();
|
|
891
893
|
if (!e.length || !t) return null;
|
|
892
894
|
let o = e.filter((e) => {
|
|
893
895
|
let n = t?.[e.name];
|
|
894
896
|
return n != null && n !== "";
|
|
895
897
|
});
|
|
896
898
|
return o.length === 0 ? null : /* @__PURE__ */ Z("section", {
|
|
897
|
-
className:
|
|
899
|
+
className: U("@container border-b border-border/60 pb-4", n),
|
|
898
900
|
"aria-label": "Record highlights",
|
|
899
901
|
children: /* @__PURE__ */ Z("div", {
|
|
900
|
-
className:
|
|
902
|
+
className: U("flex flex-wrap gap-x-8 gap-y-3"),
|
|
901
903
|
children: o.map((e) => {
|
|
902
904
|
let n = t[e.name], o = i?.fields?.[e.name], s = e.type || o?.type, c = {
|
|
903
905
|
name: e.name,
|
|
@@ -907,7 +909,7 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
907
909
|
...o?.currency && { currency: o.currency },
|
|
908
910
|
...o?.precision !== void 0 && { precision: o.precision },
|
|
909
911
|
...o?.format && { format: o.format }
|
|
910
|
-
}, l =
|
|
912
|
+
}, l = lt(dt(c) || s || "text"), u = s === "number" || s === "integer" || s === "currency" || s === "percent" || s === "decimal";
|
|
911
913
|
return /* @__PURE__ */ Q("div", {
|
|
912
914
|
className: "flex min-w-[8rem] max-w-[16rem] basis-[10rem] flex-col gap-0.5",
|
|
913
915
|
children: [/* @__PURE__ */ Q("span", {
|
|
@@ -917,7 +919,7 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
917
919
|
children: e.icon
|
|
918
920
|
}), a(r || "", e.name, e.label)]
|
|
919
921
|
}), /* @__PURE__ */ Z("span", {
|
|
920
|
-
className: "block min-w-0 truncate text-sm font-semibold",
|
|
922
|
+
className: U("block min-w-0 truncate", u ? "text-xl md:text-2xl font-semibold leading-tight tabular-nums tracking-tight" : "text-sm font-semibold"),
|
|
921
923
|
children: /* @__PURE__ */ Z(l, {
|
|
922
924
|
value: n,
|
|
923
925
|
field: c
|
|
@@ -930,7 +932,7 @@ var Ct = ({ title: e, type: t, api: r, data: f, schema: p, columns: m, className
|
|
|
930
932
|
};
|
|
931
933
|
//#endregion
|
|
932
934
|
//#region src/RecordComments.tsx
|
|
933
|
-
function
|
|
935
|
+
function jt(e) {
|
|
934
936
|
try {
|
|
935
937
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
936
938
|
if (r < 1) return "just now";
|
|
@@ -943,7 +945,7 @@ function Et(e) {
|
|
|
943
945
|
return e;
|
|
944
946
|
}
|
|
945
947
|
}
|
|
946
|
-
var
|
|
948
|
+
var Mt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, className: a }) => {
|
|
947
949
|
let { t: o } = $(), [s, c] = n.useState(""), [l, u] = n.useState(!1), [d, f] = n.useState(""), p = n.useCallback(async () => {
|
|
948
950
|
let e = s.trim();
|
|
949
951
|
if (!(!e || !t)) {
|
|
@@ -961,11 +963,11 @@ var Dt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
|
|
|
961
963
|
return e.text.toLowerCase().includes(t) || e.author.toLowerCase().includes(t);
|
|
962
964
|
}) : e].sort((e, t) => e.pinned && !t.pinned ? -1 : !e.pinned && t.pinned ? 1 : 0), [e, d]);
|
|
963
965
|
return /* @__PURE__ */ Q(_, {
|
|
964
|
-
className:
|
|
966
|
+
className: U("", a),
|
|
965
967
|
children: [/* @__PURE__ */ Z(y, { children: /* @__PURE__ */ Q(b, {
|
|
966
968
|
className: "flex items-center gap-2 text-base",
|
|
967
969
|
children: [
|
|
968
|
-
/* @__PURE__ */ Z(
|
|
970
|
+
/* @__PURE__ */ Z(Ne, { className: "h-4 w-4" }),
|
|
969
971
|
o("detail.comments"),
|
|
970
972
|
/* @__PURE__ */ Q("span", {
|
|
971
973
|
className: "text-sm font-normal text-muted-foreground",
|
|
@@ -984,7 +986,7 @@ var Dt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
|
|
|
984
986
|
children: /* @__PURE__ */ Q("div", {
|
|
985
987
|
className: "relative flex-1",
|
|
986
988
|
children: [
|
|
987
|
-
/* @__PURE__ */ Z(
|
|
989
|
+
/* @__PURE__ */ Z(We, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
|
|
988
990
|
/* @__PURE__ */ Z("input", {
|
|
989
991
|
className: "w-full rounded-md border border-input bg-background pl-8 pr-8 py-1.5 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
990
992
|
placeholder: o("detail.searchComments"),
|
|
@@ -997,7 +999,7 @@ var Dt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
|
|
|
997
999
|
onClick: () => f(""),
|
|
998
1000
|
"aria-label": o("detail.clearSearch"),
|
|
999
1001
|
type: "button",
|
|
1000
|
-
children: /* @__PURE__ */ Z(
|
|
1002
|
+
children: /* @__PURE__ */ Z(Xe, { className: "h-3.5 w-3.5" })
|
|
1001
1003
|
})
|
|
1002
1004
|
]
|
|
1003
1005
|
})
|
|
@@ -1017,7 +1019,7 @@ var Dt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
|
|
|
1017
1019
|
onClick: p,
|
|
1018
1020
|
disabled: !s.trim() || l,
|
|
1019
1021
|
className: "shrink-0 self-end",
|
|
1020
|
-
children: /* @__PURE__ */ Z(
|
|
1022
|
+
children: /* @__PURE__ */ Z(Ge, { className: "h-4 w-4" })
|
|
1021
1023
|
})]
|
|
1022
1024
|
}),
|
|
1023
1025
|
h.length === 0 ? /* @__PURE__ */ Z("p", {
|
|
@@ -1026,7 +1028,7 @@ var Dt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
|
|
|
1026
1028
|
}) : /* @__PURE__ */ Z("div", {
|
|
1027
1029
|
className: "space-y-3",
|
|
1028
1030
|
children: h.map((e) => /* @__PURE__ */ Q("div", {
|
|
1029
|
-
className:
|
|
1031
|
+
className: U("flex gap-3", e.pinned && "bg-muted/40 rounded-md p-2 -mx-2"),
|
|
1030
1032
|
children: [/* @__PURE__ */ Z("div", {
|
|
1031
1033
|
className: "shrink-0",
|
|
1032
1034
|
children: e.avatarUrl ? /* @__PURE__ */ Z("img", {
|
|
@@ -1049,11 +1051,11 @@ var Dt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
|
|
|
1049
1051
|
}),
|
|
1050
1052
|
/* @__PURE__ */ Z("span", {
|
|
1051
1053
|
className: "text-xs text-muted-foreground",
|
|
1052
|
-
children:
|
|
1054
|
+
children: jt(e.createdAt)
|
|
1053
1055
|
}),
|
|
1054
1056
|
e.pinned && /* @__PURE__ */ Q("span", {
|
|
1055
1057
|
className: "text-xs text-amber-600 flex items-center gap-0.5",
|
|
1056
|
-
children: [/* @__PURE__ */ Z(
|
|
1058
|
+
children: [/* @__PURE__ */ Z(ze, { className: "h-3 w-3" }), o("detail.pinned")]
|
|
1057
1059
|
})
|
|
1058
1060
|
]
|
|
1059
1061
|
}),
|
|
@@ -1066,7 +1068,7 @@ var Dt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
|
|
|
1066
1068
|
className: "mt-1 text-xs text-muted-foreground hover:text-foreground flex items-center gap-1",
|
|
1067
1069
|
onClick: () => r(e.id),
|
|
1068
1070
|
"aria-label": e.pinned ? o("detail.unpin") : o("detail.pin"),
|
|
1069
|
-
children: [/* @__PURE__ */ Z(
|
|
1071
|
+
children: [/* @__PURE__ */ Z(ze, { className: "h-3 w-3" }), e.pinned ? o("detail.unpin") : o("detail.pin")]
|
|
1070
1072
|
})
|
|
1071
1073
|
]
|
|
1072
1074
|
})]
|
|
@@ -1075,20 +1077,20 @@ var Dt = ({ comments: e, onAddComment: t, onTogglePin: r, searchable: i = !1, cl
|
|
|
1075
1077
|
]
|
|
1076
1078
|
})]
|
|
1077
1079
|
});
|
|
1078
|
-
},
|
|
1079
|
-
field_change:
|
|
1080
|
-
create:
|
|
1081
|
-
delete:
|
|
1082
|
-
comment:
|
|
1083
|
-
status_change:
|
|
1084
|
-
},
|
|
1080
|
+
}, Nt = {
|
|
1081
|
+
field_change: Y,
|
|
1082
|
+
create: Ve,
|
|
1083
|
+
delete: Je,
|
|
1084
|
+
comment: Ne,
|
|
1085
|
+
status_change: ae
|
|
1086
|
+
}, Pt = {
|
|
1085
1087
|
field_change: "bg-blue-100 text-blue-600",
|
|
1086
1088
|
create: "bg-green-100 text-green-600",
|
|
1087
1089
|
delete: "bg-red-100 text-red-600",
|
|
1088
1090
|
comment: "bg-purple-100 text-purple-600",
|
|
1089
1091
|
status_change: "bg-amber-100 text-amber-600"
|
|
1090
1092
|
};
|
|
1091
|
-
function
|
|
1093
|
+
function Ft(e) {
|
|
1092
1094
|
try {
|
|
1093
1095
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
1094
1096
|
if (r < 1) return "just now";
|
|
@@ -1101,24 +1103,24 @@ function At(e) {
|
|
|
1101
1103
|
return e;
|
|
1102
1104
|
}
|
|
1103
1105
|
}
|
|
1104
|
-
function
|
|
1106
|
+
function It(e) {
|
|
1105
1107
|
return e.description ? e.description : e.type === "field_change" && e.field ? `Changed ${e.field.charAt(0).toUpperCase() + e.field.slice(1).replace(/_/g, " ")} from "${e.oldValue == null ? "(empty)" : String(e.oldValue)}" to "${e.newValue == null ? "(empty)" : String(e.newValue)}"` : e.type === "create" ? "Created this record" : e.type === "delete" ? "Deleted this record" : e.type === "status_change" && e.field ? `Changed status to "${e.newValue == null ? "(empty)" : String(e.newValue)}"` : "Updated record";
|
|
1106
1108
|
}
|
|
1107
|
-
var
|
|
1109
|
+
var Lt = {
|
|
1108
1110
|
all: "All",
|
|
1109
1111
|
field_change: "Field Changes",
|
|
1110
1112
|
create: "Creates",
|
|
1111
1113
|
delete: "Deletes",
|
|
1112
1114
|
comment: "Comments",
|
|
1113
1115
|
status_change: "Status Changes"
|
|
1114
|
-
},
|
|
1116
|
+
}, Rt = ({ activities: e, filterable: t = !1, defaultFilter: r = "all", className: i }) => {
|
|
1115
1117
|
let [a, o] = n.useState(r), s = n.useMemo(() => a === "all" ? e : e.filter((e) => e.type === a), [e, a]);
|
|
1116
1118
|
return /* @__PURE__ */ Q(_, {
|
|
1117
|
-
className:
|
|
1119
|
+
className: U("", i),
|
|
1118
1120
|
children: [/* @__PURE__ */ Z(y, { children: /* @__PURE__ */ Q(b, {
|
|
1119
1121
|
className: "flex items-center gap-2 text-base",
|
|
1120
1122
|
children: [
|
|
1121
|
-
/* @__PURE__ */ Z(
|
|
1123
|
+
/* @__PURE__ */ Z(W, { className: "h-4 w-4" }),
|
|
1122
1124
|
"Activity",
|
|
1123
1125
|
/* @__PURE__ */ Q("span", {
|
|
1124
1126
|
className: "text-sm font-normal text-muted-foreground",
|
|
@@ -1133,26 +1135,26 @@ var Mt = {
|
|
|
1133
1135
|
className: "flex flex-wrap gap-1.5 mb-4",
|
|
1134
1136
|
role: "group",
|
|
1135
1137
|
"aria-label": "Activity type filter",
|
|
1136
|
-
children: Object.keys(
|
|
1138
|
+
children: Object.keys(Lt).map((e) => /* @__PURE__ */ Q("button", {
|
|
1137
1139
|
type: "button",
|
|
1138
|
-
className:
|
|
1140
|
+
className: U("inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors", a === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground hover:bg-muted/80"),
|
|
1139
1141
|
onClick: () => o(e),
|
|
1140
1142
|
"aria-pressed": a === e,
|
|
1141
|
-
children: [e !== "all" && n.createElement(
|
|
1143
|
+
children: [e !== "all" && n.createElement(Nt[e] || Y, { className: "h-3 w-3" }), Lt[e]]
|
|
1142
1144
|
}, e))
|
|
1143
|
-
}), s.length === 0 ? /* @__PURE__ */ Z(
|
|
1144
|
-
|
|
1145
|
-
|
|
1145
|
+
}), s.length === 0 ? /* @__PURE__ */ Z(w, {
|
|
1146
|
+
title: "No activity recorded",
|
|
1147
|
+
className: "py-6"
|
|
1146
1148
|
}) : /* @__PURE__ */ Q("div", {
|
|
1147
1149
|
className: "relative",
|
|
1148
1150
|
children: [/* @__PURE__ */ Z("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Z("div", {
|
|
1149
1151
|
className: "space-y-4",
|
|
1150
1152
|
children: s.map((e) => {
|
|
1151
|
-
let t =
|
|
1153
|
+
let t = Nt[e.type] || Y;
|
|
1152
1154
|
return /* @__PURE__ */ Q("div", {
|
|
1153
1155
|
className: "flex gap-3 relative",
|
|
1154
1156
|
children: [/* @__PURE__ */ Z("div", {
|
|
1155
|
-
className:
|
|
1157
|
+
className: U("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10", Pt[e.type] || "bg-gray-100 text-gray-600"),
|
|
1156
1158
|
children: /* @__PURE__ */ Z(t, { className: "h-3.5 w-3.5" })
|
|
1157
1159
|
}), /* @__PURE__ */ Q("div", {
|
|
1158
1160
|
className: "flex-1 min-w-0 pt-1",
|
|
@@ -1166,12 +1168,12 @@ var Mt = {
|
|
|
1166
1168
|
" ",
|
|
1167
1169
|
/* @__PURE__ */ Z("span", {
|
|
1168
1170
|
className: "text-muted-foreground",
|
|
1169
|
-
children:
|
|
1171
|
+
children: It(e)
|
|
1170
1172
|
})
|
|
1171
1173
|
]
|
|
1172
1174
|
}), /* @__PURE__ */ Z("p", {
|
|
1173
1175
|
className: "text-xs text-muted-foreground mt-0.5",
|
|
1174
|
-
children:
|
|
1176
|
+
children: Ft(e.timestamp)
|
|
1175
1177
|
})]
|
|
1176
1178
|
})]
|
|
1177
1179
|
}, e.id);
|
|
@@ -1179,7 +1181,7 @@ var Mt = {
|
|
|
1179
1181
|
})]
|
|
1180
1182
|
})] })]
|
|
1181
1183
|
});
|
|
1182
|
-
},
|
|
1184
|
+
}, zt = {
|
|
1183
1185
|
create: "default",
|
|
1184
1186
|
update: "secondary",
|
|
1185
1187
|
delete: "destructive",
|
|
@@ -1191,12 +1193,12 @@ var Mt = {
|
|
|
1191
1193
|
export: "outline",
|
|
1192
1194
|
import: "outline"
|
|
1193
1195
|
};
|
|
1194
|
-
function
|
|
1196
|
+
function Bt(e) {
|
|
1195
1197
|
if (!e) return "";
|
|
1196
1198
|
let t = e instanceof Date ? e : new Date(e);
|
|
1197
1199
|
return Number.isNaN(t.getTime()) ? String(e) : t.toLocaleString();
|
|
1198
1200
|
}
|
|
1199
|
-
var
|
|
1201
|
+
var Vt = [
|
|
1200
1202
|
[60, "second"],
|
|
1201
1203
|
[60, "minute"],
|
|
1202
1204
|
[24, "hour"],
|
|
@@ -1205,27 +1207,27 @@ var It = [
|
|
|
1205
1207
|
[12, "month"],
|
|
1206
1208
|
[Infinity, "year"]
|
|
1207
1209
|
];
|
|
1208
|
-
function
|
|
1210
|
+
function Ht(e, t) {
|
|
1209
1211
|
if (!e) return "";
|
|
1210
1212
|
let n = e instanceof Date ? e : new Date(e);
|
|
1211
1213
|
if (Number.isNaN(n.getTime())) return String(e);
|
|
1212
1214
|
let r = (n.getTime() - Date.now()) / 1e3;
|
|
1213
|
-
for (let [n, i] of
|
|
1215
|
+
for (let [n, i] of Vt) {
|
|
1214
1216
|
if (Math.abs(r) < n) try {
|
|
1215
1217
|
return new Intl.RelativeTimeFormat(t, { numeric: "auto" }).format(Math.round(r), i);
|
|
1216
1218
|
} catch {
|
|
1217
|
-
return
|
|
1219
|
+
return Bt(e);
|
|
1218
1220
|
}
|
|
1219
1221
|
r /= n;
|
|
1220
1222
|
}
|
|
1221
|
-
return
|
|
1223
|
+
return Bt(e);
|
|
1222
1224
|
}
|
|
1223
|
-
function
|
|
1225
|
+
function Ut(e) {
|
|
1224
1226
|
if (!e) return "?";
|
|
1225
1227
|
let t = e.trim().split(/\s+/).filter(Boolean).slice(0, 2);
|
|
1226
1228
|
return t.length === 0 ? "?" : t.map((e) => e.charAt(0).toUpperCase()).join("");
|
|
1227
1229
|
}
|
|
1228
|
-
function
|
|
1230
|
+
function Wt(e) {
|
|
1229
1231
|
if (e == null || e === "") return "—";
|
|
1230
1232
|
if (typeof e == "string") return e;
|
|
1231
1233
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
@@ -1235,25 +1237,25 @@ function zt(e) {
|
|
|
1235
1237
|
return String(e);
|
|
1236
1238
|
}
|
|
1237
1239
|
}
|
|
1238
|
-
function
|
|
1240
|
+
function Gt({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
1239
1241
|
return t ? /* @__PURE__ */ Z("div", {
|
|
1240
|
-
className:
|
|
1242
|
+
className: U("space-y-3", r),
|
|
1241
1243
|
children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ Q("div", {
|
|
1242
1244
|
className: "flex items-start gap-3",
|
|
1243
|
-
children: [/* @__PURE__ */ Z(
|
|
1245
|
+
children: [/* @__PURE__ */ Z(F, { className: "h-8 w-8 rounded-full" }), /* @__PURE__ */ Q("div", {
|
|
1244
1246
|
className: "flex-1 space-y-2",
|
|
1245
|
-
children: [/* @__PURE__ */ Z(
|
|
1247
|
+
children: [/* @__PURE__ */ Z(F, { className: "h-4 w-1/3" }), /* @__PURE__ */ Z(F, { className: "h-3 w-1/2" })]
|
|
1246
1248
|
})]
|
|
1247
1249
|
}, t))
|
|
1248
1250
|
}) : !e || e.length === 0 ? /* @__PURE__ */ Z("div", {
|
|
1249
|
-
className:
|
|
1251
|
+
className: U("flex items-center justify-center rounded-md border border-dashed py-10 text-sm text-muted-foreground", r),
|
|
1250
1252
|
children: n ?? "No history yet"
|
|
1251
|
-
}) : /* @__PURE__ */ Z(
|
|
1253
|
+
}) : /* @__PURE__ */ Z(te, {
|
|
1252
1254
|
delayDuration: 150,
|
|
1253
1255
|
children: /* @__PURE__ */ Z("ol", {
|
|
1254
|
-
className:
|
|
1256
|
+
className: U("space-y-4", r),
|
|
1255
1257
|
children: e.map((e, t) => {
|
|
1256
|
-
let n = (e.action ?? "").toLowerCase(), r =
|
|
1258
|
+
let n = (e.action ?? "").toLowerCase(), r = zt[n] ?? "outline", a = typeof e.user_name == "string" && e.user_name.trim() || "Unknown user", o = Bt(e.created_at), s = Ht(e.created_at, i), c = typeof e.user_avatar == "string" ? e.user_avatar : void 0;
|
|
1257
1259
|
return /* @__PURE__ */ Q("li", {
|
|
1258
1260
|
className: "flex items-start gap-3",
|
|
1259
1261
|
children: [/* @__PURE__ */ Q(f, {
|
|
@@ -1263,7 +1265,7 @@ function Bt({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1263
1265
|
alt: a
|
|
1264
1266
|
}) : null, /* @__PURE__ */ Z(p, {
|
|
1265
1267
|
className: "text-[10px] font-medium",
|
|
1266
|
-
children:
|
|
1268
|
+
children: Ut(e.user_name)
|
|
1267
1269
|
})]
|
|
1268
1270
|
}), /* @__PURE__ */ Q("div", {
|
|
1269
1271
|
className: "min-w-0 flex-1",
|
|
@@ -1280,14 +1282,14 @@ function Bt({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1280
1282
|
className: "text-[10px] uppercase tracking-wide",
|
|
1281
1283
|
children: e.action
|
|
1282
1284
|
}),
|
|
1283
|
-
o && /* @__PURE__ */ Q(
|
|
1285
|
+
o && /* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1284
1286
|
asChild: !0,
|
|
1285
1287
|
children: /* @__PURE__ */ Z("span", {
|
|
1286
1288
|
className: "text-xs text-muted-foreground cursor-help",
|
|
1287
1289
|
"aria-label": o,
|
|
1288
1290
|
children: s || o
|
|
1289
1291
|
})
|
|
1290
|
-
}), /* @__PURE__ */ Z(
|
|
1292
|
+
}), /* @__PURE__ */ Z(B, { children: o })] })
|
|
1291
1293
|
]
|
|
1292
1294
|
}),
|
|
1293
1295
|
e.summary && /* @__PURE__ */ Z("p", {
|
|
@@ -1314,7 +1316,7 @@ function Bt({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1314
1316
|
": ",
|
|
1315
1317
|
/* @__PURE__ */ Z("span", {
|
|
1316
1318
|
className: "text-foreground",
|
|
1317
|
-
children:
|
|
1319
|
+
children: Wt(e.to)
|
|
1318
1320
|
})
|
|
1319
1321
|
]
|
|
1320
1322
|
}, e.field))
|
|
@@ -1331,12 +1333,12 @@ function Bt({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1331
1333
|
": ",
|
|
1332
1334
|
/* @__PURE__ */ Z("span", {
|
|
1333
1335
|
className: "line-through opacity-70",
|
|
1334
|
-
children:
|
|
1336
|
+
children: Wt(e.from)
|
|
1335
1337
|
}),
|
|
1336
1338
|
" → ",
|
|
1337
1339
|
/* @__PURE__ */ Z("span", {
|
|
1338
1340
|
className: "text-foreground",
|
|
1339
|
-
children:
|
|
1341
|
+
children: Wt(e.to)
|
|
1340
1342
|
})
|
|
1341
1343
|
]
|
|
1342
1344
|
}, e.field))
|
|
@@ -1350,13 +1352,13 @@ function Bt({ entries: e, loading: t, emptyText: n, className: r, locale: i }) {
|
|
|
1350
1352
|
}
|
|
1351
1353
|
//#endregion
|
|
1352
1354
|
//#region src/RecordMetaFooter.tsx
|
|
1353
|
-
var
|
|
1355
|
+
var Kt = {
|
|
1354
1356
|
createdAt: "created_at",
|
|
1355
1357
|
createdBy: "created_by",
|
|
1356
1358
|
updatedAt: "updated_at",
|
|
1357
1359
|
updatedBy: "updated_by"
|
|
1358
1360
|
};
|
|
1359
|
-
function
|
|
1361
|
+
function qt(e) {
|
|
1360
1362
|
if (!e) return null;
|
|
1361
1363
|
if (e instanceof Date) return isNaN(e.getTime()) ? null : e;
|
|
1362
1364
|
if (typeof e == "string" || typeof e == "number") {
|
|
@@ -1365,7 +1367,7 @@ function Ht(e) {
|
|
|
1365
1367
|
}
|
|
1366
1368
|
return null;
|
|
1367
1369
|
}
|
|
1368
|
-
function
|
|
1370
|
+
function Jt(e, t) {
|
|
1369
1371
|
let n = Date.now() - e.getTime(), r = Math.max(0, Math.floor(n / 1e3));
|
|
1370
1372
|
if (r < 60) return t("detail.justNow");
|
|
1371
1373
|
let i = Math.floor(r / 60);
|
|
@@ -1373,7 +1375,7 @@ function Ut(e, t) {
|
|
|
1373
1375
|
let a = Math.floor(i / 60);
|
|
1374
1376
|
return a < 24 ? t("detail.hoursAgo", { count: a }) : t("detail.daysAgo", { count: Math.floor(a / 24) });
|
|
1375
1377
|
}
|
|
1376
|
-
function
|
|
1378
|
+
function Yt(e) {
|
|
1377
1379
|
try {
|
|
1378
1380
|
return new Intl.DateTimeFormat(void 0, {
|
|
1379
1381
|
dateStyle: "medium",
|
|
@@ -1383,16 +1385,16 @@ function Wt(e) {
|
|
|
1383
1385
|
return e.toISOString();
|
|
1384
1386
|
}
|
|
1385
1387
|
}
|
|
1386
|
-
var
|
|
1388
|
+
var Xt = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
1387
1389
|
if (e == null || e === "") return null;
|
|
1388
1390
|
let r = t?.fields?.[n], i = r?.reference_to || r?.reference, a = {
|
|
1389
1391
|
name: n,
|
|
1390
1392
|
type: r?.type || (i ? "lookup" : "text"),
|
|
1391
1393
|
...i && { reference_to: i },
|
|
1392
1394
|
...r?.reference_field && { reference_field: r.reference_field }
|
|
1393
|
-
}, o =
|
|
1395
|
+
}, o = dt(a) || a.type;
|
|
1394
1396
|
if (o) {
|
|
1395
|
-
let t =
|
|
1397
|
+
let t = lt(o);
|
|
1396
1398
|
if (t) return /* @__PURE__ */ Z("span", {
|
|
1397
1399
|
className: "inline-flex items-center [&_a]:text-inherit [&_a]:hover:underline",
|
|
1398
1400
|
children: /* @__PURE__ */ Z(t, {
|
|
@@ -1402,20 +1404,20 @@ var Gt = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
|
1402
1404
|
});
|
|
1403
1405
|
}
|
|
1404
1406
|
return /* @__PURE__ */ Z("span", { children: String(e) });
|
|
1405
|
-
},
|
|
1407
|
+
}, Zt = ({ label: e, user: t, date: n, objectSchema: r, userField: i, t: a }) => {
|
|
1406
1408
|
if (!t && !n) return null;
|
|
1407
|
-
let o = n ? /* @__PURE__ */ Z(
|
|
1409
|
+
let o = n ? /* @__PURE__ */ Z(te, {
|
|
1408
1410
|
delayDuration: 200,
|
|
1409
|
-
children: /* @__PURE__ */ Q(
|
|
1411
|
+
children: /* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1410
1412
|
asChild: !0,
|
|
1411
1413
|
children: /* @__PURE__ */ Z("time", {
|
|
1412
1414
|
dateTime: n.toISOString(),
|
|
1413
1415
|
className: "cursor-default underline decoration-dotted decoration-muted-foreground/40 underline-offset-2",
|
|
1414
|
-
children:
|
|
1416
|
+
children: Jt(n, a)
|
|
1415
1417
|
})
|
|
1416
|
-
}), /* @__PURE__ */ Z(
|
|
1418
|
+
}), /* @__PURE__ */ Z(B, {
|
|
1417
1419
|
side: "top",
|
|
1418
|
-
children:
|
|
1420
|
+
children: Yt(n)
|
|
1419
1421
|
})] })
|
|
1420
1422
|
}) : null;
|
|
1421
1423
|
return /* @__PURE__ */ Q("span", {
|
|
@@ -1425,7 +1427,7 @@ var Gt = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
|
1425
1427
|
className: "text-muted-foreground/70",
|
|
1426
1428
|
children: e
|
|
1427
1429
|
}),
|
|
1428
|
-
t ? /* @__PURE__ */ Z(
|
|
1430
|
+
t ? /* @__PURE__ */ Z(Xt, {
|
|
1429
1431
|
value: t,
|
|
1430
1432
|
objectSchema: r,
|
|
1431
1433
|
fieldName: i
|
|
@@ -1437,31 +1439,31 @@ var Gt = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
|
1437
1439
|
o
|
|
1438
1440
|
]
|
|
1439
1441
|
});
|
|
1440
|
-
},
|
|
1442
|
+
}, Qt = ({ data: e, objectSchema: t, objectName: n, className: r }) => {
|
|
1441
1443
|
let { t: i } = $();
|
|
1442
1444
|
if (!e) return null;
|
|
1443
|
-
let a =
|
|
1445
|
+
let a = qt(e[Kt.createdAt]), o = qt(e[Kt.updatedAt]), s = e[Kt.createdBy], c = e[Kt.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));
|
|
1444
1446
|
return !l && !d ? null : /* @__PURE__ */ Q("div", {
|
|
1445
|
-
className:
|
|
1447
|
+
className: U("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),
|
|
1446
1448
|
"data-testid": "record-meta-footer",
|
|
1447
|
-
children: [l && /* @__PURE__ */ Z(
|
|
1449
|
+
children: [l && /* @__PURE__ */ Z(Zt, {
|
|
1448
1450
|
label: i("detail.createdBy"),
|
|
1449
1451
|
user: s,
|
|
1450
1452
|
date: a,
|
|
1451
1453
|
objectSchema: t,
|
|
1452
|
-
userField:
|
|
1454
|
+
userField: Kt.createdBy,
|
|
1453
1455
|
t: i
|
|
1454
|
-
}), d && /* @__PURE__ */ Z(
|
|
1456
|
+
}), d && /* @__PURE__ */ Z(Zt, {
|
|
1455
1457
|
label: i("detail.updatedBy"),
|
|
1456
1458
|
user: c,
|
|
1457
1459
|
date: o,
|
|
1458
1460
|
objectSchema: t,
|
|
1459
|
-
userField:
|
|
1461
|
+
userField: Kt.updatedBy,
|
|
1460
1462
|
t: i
|
|
1461
1463
|
})]
|
|
1462
1464
|
});
|
|
1463
|
-
},
|
|
1464
|
-
function
|
|
1465
|
+
}, $t = 5;
|
|
1466
|
+
function en(e, t, n, r) {
|
|
1465
1467
|
if (e && typeof e == "object") {
|
|
1466
1468
|
if (t.primaryField) {
|
|
1467
1469
|
let n = e[t.primaryField];
|
|
@@ -1508,10 +1510,10 @@ function Yt(e, t, n, r) {
|
|
|
1508
1510
|
}
|
|
1509
1511
|
return r;
|
|
1510
1512
|
}
|
|
1511
|
-
var
|
|
1512
|
-
let [v, y] = n.useState(e.data), [b, x] = n.useState(!e.data && !!(e.api && e.resourceId || r && e.objectName && e.resourceId)), [S, C] = n.useState(!1), w = m ?? S, [T, E] = n.useState(!1), [D, O] = n.useState({}), [k, A] = n.useState(!1), [j, M] = n.useState(null), [N,
|
|
1513
|
-
if (!
|
|
1514
|
-
let t = (t) =>
|
|
1513
|
+
var tn = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBack: s, inlineEdit: c = !1, onFieldSave: l, discussionSlot: u, rightRail: d, objectLabel: f, onDataLoaded: p, isFavorite: m, onToggleFavorite: _ }) => {
|
|
1514
|
+
let [v, y] = n.useState(e.data), [b, x] = n.useState(!e.data && !!(e.api && e.resourceId || r && e.objectName && e.resourceId)), [S, C] = n.useState(!1), w = m ?? S, [T, E] = n.useState(!1), [D, O] = n.useState({}), [k, A] = n.useState(!1), [j, M] = n.useState(null), [N, P] = n.useState(null), [H, W] = n.useState(!1), [re, ie] = n.useState(0), [ae, oe] = n.useState(!1), { t: K } = $(), { fieldOptionLabel: se } = ot(), ce = ne(), le = mt(), q = n.useMemo(() => {
|
|
1515
|
+
if (!le?.isLoaded || !e.objectName) return e;
|
|
1516
|
+
let t = (t) => le.checkField(e.objectName, t, "read"), n = (e) => e && e.filter((e) => {
|
|
1515
1517
|
let n = typeof e == "string" ? e : e?.name;
|
|
1516
1518
|
return !n || t(n);
|
|
1517
1519
|
});
|
|
@@ -1524,11 +1526,11 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1524
1526
|
})),
|
|
1525
1527
|
summaryFields: n(e.summaryFields)
|
|
1526
1528
|
};
|
|
1527
|
-
}, [e,
|
|
1529
|
+
}, [e, le]);
|
|
1528
1530
|
n.useEffect(() => {
|
|
1529
1531
|
v && p && p(v);
|
|
1530
1532
|
}, [v, p]);
|
|
1531
|
-
let
|
|
1533
|
+
let de = n.useMemo(() => {
|
|
1532
1534
|
if (q.summaryFields && q.summaryFields.length > 0) return [];
|
|
1533
1535
|
let e = [...q.sections?.flatMap((e) => e.fields) || [], ...q.fields || []], t = {};
|
|
1534
1536
|
for (let n of e) t[n.name] || (t[n.name] = n);
|
|
@@ -1554,24 +1556,24 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1554
1556
|
q.fields,
|
|
1555
1557
|
N,
|
|
1556
1558
|
v
|
|
1557
|
-
]),
|
|
1559
|
+
]), fe = q.summaryFields && q.summaryFields.length > 0 ? q.summaryFields : de, he = n.useCallback(() => {
|
|
1558
1560
|
q.resourceId && navigator.clipboard.writeText(String(q.resourceId)).then(() => {
|
|
1559
|
-
|
|
1561
|
+
W(!0), setTimeout(() => W(!1), 1500);
|
|
1560
1562
|
});
|
|
1561
1563
|
}, [q.resourceId]);
|
|
1562
1564
|
n.useEffect(() => {
|
|
1563
1565
|
let e = !0;
|
|
1564
1566
|
if (q.data) return y(q.data), x(!1), r?.getObjectSchema && q.objectName && r.getObjectSchema(q.objectName).then((t) => {
|
|
1565
|
-
e &&
|
|
1567
|
+
e && P(t);
|
|
1566
1568
|
}).catch(() => {}), () => {
|
|
1567
1569
|
e = !1;
|
|
1568
1570
|
};
|
|
1569
1571
|
if (r && q.objectName && q.resourceId) {
|
|
1570
|
-
x(!0),
|
|
1572
|
+
x(!0), P(null), y(null);
|
|
1571
1573
|
let n = q.objectName, i = q.resourceId, a = `${n}-`, o = [...q.sections?.flatMap((e) => e.fields) || [], ...q.fields || []];
|
|
1572
1574
|
(r.getObjectSchema ? r.getObjectSchema(n).catch(() => null) : Promise.resolve(null)).then((s) => {
|
|
1573
1575
|
if (!e) return;
|
|
1574
|
-
|
|
1576
|
+
P(s);
|
|
1575
1577
|
let c = t(s?.fields, o), l = c.length > 0 ? { $expand: c } : void 0, u = l ? r.findOne(n, i, l) : r.findOne(n, i), d = () => {
|
|
1576
1578
|
let t = String(i), o = t.startsWith(a) ? t.slice(a.length) : `${a}${t}`;
|
|
1577
1579
|
return (l ? r.findOne(n, o, l) : r.findOne(n, o)).then((t) => {
|
|
@@ -1609,17 +1611,17 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1609
1611
|
r,
|
|
1610
1612
|
q.sections,
|
|
1611
1613
|
q.fields,
|
|
1612
|
-
|
|
1614
|
+
re
|
|
1613
1615
|
]);
|
|
1614
|
-
let
|
|
1616
|
+
let ge = n.useCallback(() => {
|
|
1615
1617
|
if (s) s();
|
|
1616
1618
|
else if (q.onNavigate) {
|
|
1617
1619
|
let e = q.backUrl || (q.objectName ? `/${q.objectName}` : "/");
|
|
1618
1620
|
q.onNavigate(e, { replace: !0 });
|
|
1619
1621
|
} else q.backUrl ? window.location.href = q.backUrl : window.history.back();
|
|
1620
|
-
}, [s, q]),
|
|
1622
|
+
}, [s, q]), J = n.useCallback(() => {
|
|
1621
1623
|
a ? a() : q.onNavigate && q.editUrl ? q.onNavigate(q.editUrl) : q.onNavigate && q.objectName && q.resourceId ? q.onNavigate(`/${q.objectName}/${q.resourceId}/edit`) : q.editUrl && (window.location.href = q.editUrl);
|
|
1622
|
-
}, [a, q]),
|
|
1624
|
+
}, [a, q]), _e = n.useCallback(async () => {
|
|
1623
1625
|
if (!r?.cancelPendingApproval || !q.objectName || !q.resourceId) {
|
|
1624
1626
|
M(K("detail.cancelApprovalUnavailable"));
|
|
1625
1627
|
return;
|
|
@@ -1630,7 +1632,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1630
1632
|
let e = await r.findOne(String(q.objectName), String(q.resourceId));
|
|
1631
1633
|
e && y(e);
|
|
1632
1634
|
} catch {}
|
|
1633
|
-
|
|
1635
|
+
ie((e) => e + 1);
|
|
1634
1636
|
try {
|
|
1635
1637
|
window.dispatchEvent(new CustomEvent("objectui:record-changed", { detail: {
|
|
1636
1638
|
objectName: String(q.objectName),
|
|
@@ -1649,10 +1651,10 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1649
1651
|
q.objectName,
|
|
1650
1652
|
q.resourceId,
|
|
1651
1653
|
K
|
|
1652
|
-
]),
|
|
1654
|
+
]), ye = n.useCallback(() => {
|
|
1653
1655
|
let e = q.deleteConfirmation || K("detail.deleteConfirmation");
|
|
1654
1656
|
window.confirm(e) && (o?.(), q.onNavigate && q.objectName && q.onNavigate(`/${q.objectName}`, { replace: !0 }));
|
|
1655
|
-
}, [o, q]),
|
|
1657
|
+
}, [o, q]), X = n.useCallback(() => {
|
|
1656
1658
|
navigator.share && q.objectName && q.resourceId ? navigator.share({
|
|
1657
1659
|
title: q.title || K("detail.details"),
|
|
1658
1660
|
text: `${q.objectName} #${q.resourceId}`,
|
|
@@ -1660,14 +1662,14 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1660
1662
|
}).catch((e) => console.log("Share failed:", e)) : navigator.clipboard.writeText(window.location.href).then(() => {
|
|
1661
1663
|
console.log("Link copied to clipboard");
|
|
1662
1664
|
});
|
|
1663
|
-
}, [q]),
|
|
1665
|
+
}, [q]), be = n.useCallback(() => {
|
|
1664
1666
|
let e = !w;
|
|
1665
1667
|
_ && _(e), m === void 0 && C(e);
|
|
1666
1668
|
}, [
|
|
1667
1669
|
w,
|
|
1668
1670
|
m,
|
|
1669
1671
|
_
|
|
1670
|
-
]),
|
|
1672
|
+
]), xe = n.useCallback(async () => {
|
|
1671
1673
|
if (T) {
|
|
1672
1674
|
let e = Object.entries(D);
|
|
1673
1675
|
if (e.length > 0) {
|
|
@@ -1694,9 +1696,9 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1694
1696
|
D,
|
|
1695
1697
|
v,
|
|
1696
1698
|
l
|
|
1697
|
-
]),
|
|
1699
|
+
]), Se = n.useCallback(() => {
|
|
1698
1700
|
O({}), E(!1), M(null);
|
|
1699
|
-
}, []),
|
|
1701
|
+
}, []), Ce = n.useCallback((e, t) => {
|
|
1700
1702
|
O((n) => ({
|
|
1701
1703
|
...n,
|
|
1702
1704
|
[e]: t
|
|
@@ -1709,7 +1711,20 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1709
1711
|
n === "INPUT" || n === "TEXTAREA" || t.target?.isContentEditable || (t.key === "ArrowLeft" && e.currentIndex > 0 ? (t.preventDefault(), e.onNavigate(e.recordIds[e.currentIndex - 1])) : t.key === "ArrowRight" && e.currentIndex < e.recordIds.length - 1 && (t.preventDefault(), e.onNavigate(e.recordIds[e.currentIndex + 1])));
|
|
1710
1712
|
};
|
|
1711
1713
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
1712
|
-
}, [q.recordNavigation])
|
|
1714
|
+
}, [q.recordNavigation]), n.useEffect(() => {
|
|
1715
|
+
if (!c || q.showHeader !== !1) return;
|
|
1716
|
+
let e = "objectui:record:inline-edit-toggle", t = (e) => {
|
|
1717
|
+
let t = e.detail;
|
|
1718
|
+
t?.recordId && q.recordId && t.recordId !== q.recordId || t?.objectName && q.objectName && t.objectName !== q.objectName || xe();
|
|
1719
|
+
};
|
|
1720
|
+
return window.addEventListener(e, t), () => window.removeEventListener(e, t);
|
|
1721
|
+
}, [
|
|
1722
|
+
c,
|
|
1723
|
+
q.showHeader,
|
|
1724
|
+
q.recordId,
|
|
1725
|
+
q.objectName,
|
|
1726
|
+
xe
|
|
1727
|
+
]);
|
|
1713
1728
|
let we = n.useMemo(() => q.related ?? [], [q.related]), Te = n.useMemo(() => {
|
|
1714
1729
|
let e = [];
|
|
1715
1730
|
return e.push({
|
|
@@ -1717,21 +1732,21 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1717
1732
|
label: K("detail.share"),
|
|
1718
1733
|
icon: "share-2",
|
|
1719
1734
|
type: "script",
|
|
1720
|
-
onClick:
|
|
1735
|
+
onClick: X
|
|
1721
1736
|
}), q.showEdit && e.push({
|
|
1722
1737
|
name: "sys_edit_mobile",
|
|
1723
1738
|
label: K("detail.edit"),
|
|
1724
1739
|
icon: "edit",
|
|
1725
1740
|
type: "script",
|
|
1726
1741
|
className: "sm:hidden",
|
|
1727
|
-
onClick:
|
|
1742
|
+
onClick: J
|
|
1728
1743
|
}), c && e.push({
|
|
1729
1744
|
name: "sys_toggle_inline_edit_mobile",
|
|
1730
1745
|
label: K(T ? "detail.save" : "detail.editInline"),
|
|
1731
1746
|
icon: "edit",
|
|
1732
1747
|
type: "script",
|
|
1733
1748
|
className: "sm:hidden",
|
|
1734
|
-
onClick:
|
|
1749
|
+
onClick: xe
|
|
1735
1750
|
}), q.showDelete && e.push({
|
|
1736
1751
|
name: "sys_delete",
|
|
1737
1752
|
label: K("detail.delete"),
|
|
@@ -1739,7 +1754,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1739
1754
|
type: "script",
|
|
1740
1755
|
variant: "destructive",
|
|
1741
1756
|
tags: ["separator-before"],
|
|
1742
|
-
onClick:
|
|
1757
|
+
onClick: ye
|
|
1743
1758
|
}), e;
|
|
1744
1759
|
}, [
|
|
1745
1760
|
K,
|
|
@@ -1747,10 +1762,10 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1747
1762
|
q.showDelete,
|
|
1748
1763
|
c,
|
|
1749
1764
|
T,
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1765
|
+
X,
|
|
1766
|
+
J,
|
|
1767
|
+
xe,
|
|
1768
|
+
ye
|
|
1754
1769
|
]), Ee = n.useMemo(() => {
|
|
1755
1770
|
let e = q.actions ?? [];
|
|
1756
1771
|
if (Te.length === 0) return e;
|
|
@@ -1773,14 +1788,14 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1773
1788
|
}), n;
|
|
1774
1789
|
}, [q.actions, Te]);
|
|
1775
1790
|
return b || q.loading ? /* @__PURE__ */ Q("div", {
|
|
1776
|
-
className:
|
|
1791
|
+
className: U("space-y-4", i),
|
|
1777
1792
|
children: [
|
|
1778
|
-
/* @__PURE__ */ Z(
|
|
1779
|
-
/* @__PURE__ */ Z(
|
|
1780
|
-
/* @__PURE__ */ Z(
|
|
1793
|
+
/* @__PURE__ */ Z(F, { className: "h-10 w-full" }),
|
|
1794
|
+
/* @__PURE__ */ Z(F, { className: "h-64 w-full" }),
|
|
1795
|
+
/* @__PURE__ */ Z(F, { className: "h-48 w-full" })
|
|
1781
1796
|
]
|
|
1782
1797
|
}) : !v && !q.data ? /* @__PURE__ */ Q("div", {
|
|
1783
|
-
className:
|
|
1798
|
+
className: U("flex flex-col items-center justify-center py-16 text-center", i),
|
|
1784
1799
|
children: [
|
|
1785
1800
|
/* @__PURE__ */ Z("p", {
|
|
1786
1801
|
className: "text-lg font-semibold",
|
|
@@ -1793,37 +1808,37 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1793
1808
|
(q.showBack ?? !0) && /* @__PURE__ */ Q(g, {
|
|
1794
1809
|
variant: "outline",
|
|
1795
1810
|
size: "sm",
|
|
1796
|
-
onClick:
|
|
1811
|
+
onClick: ge,
|
|
1797
1812
|
className: "mt-4 gap-2",
|
|
1798
|
-
children: [/* @__PURE__ */ Z(
|
|
1813
|
+
children: [/* @__PURE__ */ Z(G, { className: "h-4 w-4" }), K("detail.goBack")]
|
|
1799
1814
|
})
|
|
1800
1815
|
]
|
|
1801
|
-
}) : /* @__PURE__ */ Z(
|
|
1802
|
-
className:
|
|
1816
|
+
}) : /* @__PURE__ */ Z(te, { children: /* @__PURE__ */ Q("div", {
|
|
1817
|
+
className: U("space-y-6", i),
|
|
1803
1818
|
children: [
|
|
1804
1819
|
q.showHeader !== !1 && /* @__PURE__ */ Q("div", {
|
|
1805
1820
|
className: "flex flex-col sm:flex-row items-start justify-between gap-3 sm:gap-4 pb-4 border-b",
|
|
1806
1821
|
children: [/* @__PURE__ */ Q("div", {
|
|
1807
1822
|
className: "flex items-start gap-2 sm:gap-3 flex-1 min-w-0",
|
|
1808
|
-
children: [(q.showBack ?? !0) && /* @__PURE__ */ Q(
|
|
1823
|
+
children: [(q.showBack ?? !0) && /* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1809
1824
|
asChild: !0,
|
|
1810
1825
|
children: /* @__PURE__ */ Z(g, {
|
|
1811
1826
|
variant: "ghost",
|
|
1812
1827
|
size: "icon",
|
|
1813
|
-
onClick:
|
|
1828
|
+
onClick: ge,
|
|
1814
1829
|
className: "shrink-0 mt-1",
|
|
1815
|
-
children: /* @__PURE__ */ Z(
|
|
1830
|
+
children: /* @__PURE__ */ Z(G, { className: "h-4 w-4" })
|
|
1816
1831
|
})
|
|
1817
|
-
}), /* @__PURE__ */ Z(
|
|
1832
|
+
}), /* @__PURE__ */ Z(B, { children: K("detail.back") })] }), /* @__PURE__ */ Q("div", {
|
|
1818
1833
|
className: "flex-1 min-w-0",
|
|
1819
1834
|
children: [/* @__PURE__ */ Q("div", {
|
|
1820
1835
|
className: "flex items-center gap-2 flex-wrap",
|
|
1821
1836
|
children: [
|
|
1822
1837
|
/* @__PURE__ */ Z("h1", {
|
|
1823
1838
|
className: "text-xl sm:text-2xl font-bold truncate",
|
|
1824
|
-
children:
|
|
1839
|
+
children: en(v, q, N, K("detail.details"))
|
|
1825
1840
|
}),
|
|
1826
|
-
|
|
1841
|
+
fe.map((e) => {
|
|
1827
1842
|
let t = v?.[e];
|
|
1828
1843
|
if (t == null || t === "") return null;
|
|
1829
1844
|
let n = (q.sections || []).flatMap((e) => e.fields).concat(q.fields || []).find((t) => t.name === e), r = N?.fields?.[e], i = n?.type || r?.type, a = String(t), o = null;
|
|
@@ -1879,24 +1894,24 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1879
1894
|
}), a]
|
|
1880
1895
|
}, e);
|
|
1881
1896
|
}),
|
|
1882
|
-
/* @__PURE__ */ Q(
|
|
1897
|
+
/* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1883
1898
|
asChild: !0,
|
|
1884
1899
|
children: /* @__PURE__ */ Z(g, {
|
|
1885
1900
|
variant: "ghost",
|
|
1886
1901
|
size: "icon",
|
|
1887
1902
|
className: "h-6 w-6 shrink-0",
|
|
1888
|
-
onClick:
|
|
1903
|
+
onClick: be,
|
|
1889
1904
|
"aria-label": K(w ? "detail.removeFromFavorites" : "detail.addToFavorites"),
|
|
1890
|
-
children: w ? /* @__PURE__ */ Z(
|
|
1905
|
+
children: w ? /* @__PURE__ */ Z(qe, { className: "h-4 w-4 fill-yellow-400 text-yellow-400" }) : /* @__PURE__ */ Z(qe, { className: "h-4 w-4 text-muted-foreground" })
|
|
1891
1906
|
})
|
|
1892
|
-
}), /* @__PURE__ */ Z(
|
|
1907
|
+
}), /* @__PURE__ */ Z(B, { children: K(w ? "detail.removeFromFavorites" : "detail.addToFavorites") })] })
|
|
1893
1908
|
]
|
|
1894
1909
|
}), q.objectName && /* @__PURE__ */ Q("p", {
|
|
1895
1910
|
className: "text-sm text-muted-foreground mt-1 flex items-center gap-1",
|
|
1896
1911
|
children: [/* @__PURE__ */ Z("span", {
|
|
1897
1912
|
className: "font-medium",
|
|
1898
1913
|
children: f || q.objectName
|
|
1899
|
-
}), q.resourceId && /* @__PURE__ */ Q(
|
|
1914
|
+
}), q.resourceId && /* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1900
1915
|
asChild: !0,
|
|
1901
1916
|
children: /* @__PURE__ */ Z(g, {
|
|
1902
1917
|
variant: "ghost",
|
|
@@ -1904,9 +1919,9 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1904
1919
|
className: "h-5 w-5 shrink-0 text-muted-foreground/60 hover:text-foreground",
|
|
1905
1920
|
onClick: he,
|
|
1906
1921
|
"aria-label": K("detail.copyRecordId", { defaultValue: "Copy record ID" }),
|
|
1907
|
-
children:
|
|
1922
|
+
children: H ? /* @__PURE__ */ Z(ue, { className: "h-3 w-3 text-green-600" }) : /* @__PURE__ */ Z(ve, { className: "h-3 w-3" })
|
|
1908
1923
|
})
|
|
1909
|
-
}), /* @__PURE__ */ Z(
|
|
1924
|
+
}), /* @__PURE__ */ Z(B, { children: H ? K("detail.copied", { defaultValue: "Copied" }) : K("detail.copyRecordId", { defaultValue: "Copy record ID" }) })] })]
|
|
1910
1925
|
})]
|
|
1911
1926
|
})]
|
|
1912
1927
|
}), /* @__PURE__ */ Q("div", {
|
|
@@ -1915,7 +1930,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1915
1930
|
q.recordNavigation && /* @__PURE__ */ Q("div", {
|
|
1916
1931
|
className: "flex items-center gap-1 mr-2",
|
|
1917
1932
|
children: [
|
|
1918
|
-
/* @__PURE__ */ Q(
|
|
1933
|
+
/* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1919
1934
|
asChild: !0,
|
|
1920
1935
|
children: /* @__PURE__ */ Z(g, {
|
|
1921
1936
|
variant: "outline",
|
|
@@ -1926,9 +1941,9 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1926
1941
|
let e = q.recordNavigation;
|
|
1927
1942
|
e.currentIndex > 0 && e.onNavigate(e.recordIds[e.currentIndex - 1]);
|
|
1928
1943
|
},
|
|
1929
|
-
children: /* @__PURE__ */ Z(
|
|
1944
|
+
children: /* @__PURE__ */ Z(pe, { className: "h-4 w-4" })
|
|
1930
1945
|
})
|
|
1931
|
-
}), /* @__PURE__ */ Z(
|
|
1946
|
+
}), /* @__PURE__ */ Z(B, { children: K("detail.previousRecord") })] }),
|
|
1932
1947
|
/* @__PURE__ */ Z("span", {
|
|
1933
1948
|
className: "text-xs text-muted-foreground whitespace-nowrap px-1",
|
|
1934
1949
|
children: K("detail.recordOf", {
|
|
@@ -1936,7 +1951,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1936
1951
|
total: q.recordNavigation.recordIds.length
|
|
1937
1952
|
})
|
|
1938
1953
|
}),
|
|
1939
|
-
/* @__PURE__ */ Q(
|
|
1954
|
+
/* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1940
1955
|
asChild: !0,
|
|
1941
1956
|
children: /* @__PURE__ */ Z(g, {
|
|
1942
1957
|
variant: "outline",
|
|
@@ -1947,63 +1962,63 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1947
1962
|
let e = q.recordNavigation;
|
|
1948
1963
|
e.currentIndex < e.recordIds.length - 1 && e.onNavigate(e.recordIds[e.currentIndex + 1]);
|
|
1949
1964
|
},
|
|
1950
|
-
children: /* @__PURE__ */ Z(
|
|
1965
|
+
children: /* @__PURE__ */ Z(me, { className: "h-4 w-4" })
|
|
1951
1966
|
})
|
|
1952
|
-
}), /* @__PURE__ */ Z(
|
|
1967
|
+
}), /* @__PURE__ */ Z(B, { children: K("detail.nextRecord") })] })
|
|
1953
1968
|
]
|
|
1954
1969
|
}),
|
|
1955
|
-
c && /* @__PURE__ */ Q(
|
|
1970
|
+
c && /* @__PURE__ */ Q(ft, { children: [T && /* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1956
1971
|
asChild: !0,
|
|
1957
1972
|
children: /* @__PURE__ */ Q(g, {
|
|
1958
1973
|
variant: "ghost",
|
|
1959
1974
|
size: "sm",
|
|
1960
|
-
onClick:
|
|
1975
|
+
onClick: Se,
|
|
1961
1976
|
className: "gap-2 hidden sm:inline-flex",
|
|
1962
|
-
children: [/* @__PURE__ */ Z(
|
|
1977
|
+
children: [/* @__PURE__ */ Z(Xe, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
|
|
1963
1978
|
className: "hidden sm:inline",
|
|
1964
1979
|
children: K("detail.cancel")
|
|
1965
1980
|
})]
|
|
1966
1981
|
})
|
|
1967
|
-
}), /* @__PURE__ */ Z(
|
|
1982
|
+
}), /* @__PURE__ */ Z(B, { children: K("detail.cancelEdit") })] }), /* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1968
1983
|
asChild: !0,
|
|
1969
1984
|
children: /* @__PURE__ */ Z(g, {
|
|
1970
1985
|
variant: T ? "default" : "outline",
|
|
1971
1986
|
size: "sm",
|
|
1972
|
-
onClick:
|
|
1987
|
+
onClick: xe,
|
|
1973
1988
|
className: "gap-2 hidden sm:inline-flex",
|
|
1974
|
-
children: T ? /* @__PURE__ */ Q(
|
|
1989
|
+
children: T ? /* @__PURE__ */ Q(ft, { children: [/* @__PURE__ */ Z(ue, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
|
|
1975
1990
|
className: "hidden sm:inline",
|
|
1976
1991
|
children: K("detail.save")
|
|
1977
|
-
})] }) : /* @__PURE__ */ Q(
|
|
1992
|
+
})] }) : /* @__PURE__ */ Q(ft, { children: [/* @__PURE__ */ Z(Y, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
|
|
1978
1993
|
className: "hidden sm:inline",
|
|
1979
1994
|
children: K("detail.editInline")
|
|
1980
1995
|
})] })
|
|
1981
1996
|
})
|
|
1982
|
-
}), /* @__PURE__ */ Z(
|
|
1983
|
-
q.showEdit && /* @__PURE__ */ Q(
|
|
1997
|
+
}), /* @__PURE__ */ Z(B, { children: K(T ? "detail.saveChanges" : "detail.editFieldsInline") })] })] }),
|
|
1998
|
+
q.showEdit && /* @__PURE__ */ Q(z, { children: [/* @__PURE__ */ Z(V, {
|
|
1984
1999
|
asChild: !0,
|
|
1985
2000
|
children: /* @__PURE__ */ Q(g, {
|
|
1986
2001
|
variant: "default",
|
|
1987
|
-
onClick:
|
|
2002
|
+
onClick: J,
|
|
1988
2003
|
className: "gap-2 hidden sm:inline-flex",
|
|
1989
|
-
children: [/* @__PURE__ */ Z(
|
|
2004
|
+
children: [/* @__PURE__ */ Z(Y, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
|
|
1990
2005
|
className: "hidden sm:inline",
|
|
1991
2006
|
children: K("detail.edit")
|
|
1992
2007
|
})]
|
|
1993
2008
|
})
|
|
1994
|
-
}), /* @__PURE__ */ Z(
|
|
1995
|
-
Ee.map((e, t) => /* @__PURE__ */ Z(
|
|
2009
|
+
}), /* @__PURE__ */ Z(B, { children: K("detail.editRecord") })] }),
|
|
2010
|
+
Ee.map((e, t) => /* @__PURE__ */ Z($e, {
|
|
1996
2011
|
schema: e,
|
|
1997
2012
|
data: v
|
|
1998
2013
|
}, `header-action-${t}`))
|
|
1999
2014
|
]
|
|
2000
2015
|
})]
|
|
2001
2016
|
}),
|
|
2002
|
-
q.header && /* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z(
|
|
2017
|
+
q.header && /* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z($e, {
|
|
2003
2018
|
schema: q.header,
|
|
2004
2019
|
data: v
|
|
2005
2020
|
}) }),
|
|
2006
|
-
q.highlightFields && q.highlightFields.length > 0 && /* @__PURE__ */ Z(
|
|
2021
|
+
q.highlightFields && q.highlightFields.length > 0 && /* @__PURE__ */ Z(At, {
|
|
2007
2022
|
fields: q.highlightFields,
|
|
2008
2023
|
data: v,
|
|
2009
2024
|
objectName: q.objectName,
|
|
@@ -2011,41 +2026,41 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2011
2026
|
}),
|
|
2012
2027
|
c && q.showHeader === !1 && (() => {
|
|
2013
2028
|
let e = v?.approval_status, t = e === "pending" || e === "in_approval";
|
|
2014
|
-
return /* @__PURE__ */ Q("div", {
|
|
2029
|
+
return !T && !k && !j && !t ? null : /* @__PURE__ */ Q("div", {
|
|
2015
2030
|
className: "flex flex-col items-end gap-1",
|
|
2016
2031
|
children: [/* @__PURE__ */ Q("div", {
|
|
2017
2032
|
className: "flex items-center justify-end gap-2",
|
|
2018
2033
|
children: [
|
|
2019
|
-
t && !T && /* @__PURE__ */ Q(
|
|
2034
|
+
t && !T && /* @__PURE__ */ Q(ft, { children: [/* @__PURE__ */ Q("span", {
|
|
2020
2035
|
role: "status",
|
|
2021
2036
|
className: "inline-flex items-center gap-1 rounded-md border border-amber-300 bg-amber-50 px-2 py-1 text-xs text-amber-800",
|
|
2022
2037
|
title: K("detail.lockedTooltip"),
|
|
2023
|
-
children: [/* @__PURE__ */ Z(
|
|
2038
|
+
children: [/* @__PURE__ */ Z(je, { className: "h-3 w-3" }), /* @__PURE__ */ Z("span", { children: K("detail.lockedByApproval") })]
|
|
2024
2039
|
}), r?.cancelPendingApproval && /* @__PURE__ */ Q(g, {
|
|
2025
2040
|
variant: "outline",
|
|
2026
2041
|
size: "sm",
|
|
2027
|
-
onClick:
|
|
2042
|
+
onClick: _e,
|
|
2028
2043
|
disabled: ae,
|
|
2029
2044
|
className: "gap-2 border-amber-300 text-amber-800 hover:bg-amber-50",
|
|
2030
2045
|
title: K("detail.cancelApprovalTooltip"),
|
|
2031
|
-
children: [/* @__PURE__ */ Z(
|
|
2046
|
+
children: [/* @__PURE__ */ Z(Xe, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", { children: K(ae ? "detail.cancelApprovalInFlight" : "detail.cancelApproval") })]
|
|
2032
2047
|
})] }),
|
|
2033
2048
|
T && /* @__PURE__ */ Q(g, {
|
|
2034
2049
|
variant: "ghost",
|
|
2035
2050
|
size: "sm",
|
|
2036
|
-
onClick:
|
|
2051
|
+
onClick: Se,
|
|
2037
2052
|
className: "gap-2",
|
|
2038
2053
|
disabled: k,
|
|
2039
|
-
children: [/* @__PURE__ */ Z(
|
|
2054
|
+
children: [/* @__PURE__ */ Z(Xe, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", { children: K("detail.cancel") })]
|
|
2040
2055
|
}),
|
|
2041
2056
|
/* @__PURE__ */ Q(g, {
|
|
2042
2057
|
variant: T ? "default" : "outline",
|
|
2043
2058
|
size: "sm",
|
|
2044
|
-
onClick:
|
|
2059
|
+
onClick: xe,
|
|
2045
2060
|
className: "gap-2",
|
|
2046
2061
|
disabled: k || t && !T,
|
|
2047
2062
|
title: t && !T ? K("detail.lockedTooltip") : void 0,
|
|
2048
|
-
children: [Z(T ?
|
|
2063
|
+
children: [Z(T ? ue : Y, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", { children: K(k ? "detail.saving" : T ? "detail.save" : "detail.editFieldsInline") })]
|
|
2049
2064
|
})
|
|
2050
2065
|
]
|
|
2051
2066
|
}), j && /* @__PURE__ */ Z("div", {
|
|
@@ -2059,7 +2074,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2059
2074
|
let e = we.length > 0, t = !!q.activities && q.activities.length > 0, n = !!u, i = !!q.history, a = /* @__PURE__ */ Q("div", {
|
|
2060
2075
|
className: "space-y-3 sm:space-y-4",
|
|
2061
2076
|
children: [
|
|
2062
|
-
q.sectionGroups && q.sectionGroups.length > 0 && q.sectionGroups.map((e, t) => /* @__PURE__ */ Z(
|
|
2077
|
+
q.sectionGroups && q.sectionGroups.length > 0 && q.sectionGroups.map((e, t) => /* @__PURE__ */ Z(kt, {
|
|
2063
2078
|
group: e,
|
|
2064
2079
|
data: {
|
|
2065
2080
|
...v,
|
|
@@ -2068,9 +2083,9 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2068
2083
|
objectSchema: N,
|
|
2069
2084
|
objectName: q.objectName,
|
|
2070
2085
|
isEditing: T,
|
|
2071
|
-
onFieldChange:
|
|
2086
|
+
onFieldChange: Ce
|
|
2072
2087
|
}, t)),
|
|
2073
|
-
q.sections && q.sections.length > 0 && q.sections.map((e, t) => /* @__PURE__ */ Z(
|
|
2088
|
+
q.sections && q.sections.length > 0 && q.sections.map((e, t) => /* @__PURE__ */ Z(Tt, {
|
|
2074
2089
|
section: e,
|
|
2075
2090
|
data: {
|
|
2076
2091
|
...v,
|
|
@@ -2079,9 +2094,9 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2079
2094
|
objectSchema: N,
|
|
2080
2095
|
objectName: q.objectName,
|
|
2081
2096
|
isEditing: T,
|
|
2082
|
-
onFieldChange:
|
|
2097
|
+
onFieldChange: Ce
|
|
2083
2098
|
}, t)),
|
|
2084
|
-
q.fields && q.fields.length > 0 && !q.sections?.length && /* @__PURE__ */ Z(
|
|
2099
|
+
q.fields && q.fields.length > 0 && !q.sections?.length && /* @__PURE__ */ Z(Tt, {
|
|
2085
2100
|
section: {
|
|
2086
2101
|
fields: q.fields,
|
|
2087
2102
|
columns: q.columns
|
|
@@ -2093,9 +2108,9 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2093
2108
|
objectSchema: N,
|
|
2094
2109
|
objectName: q.objectName,
|
|
2095
2110
|
isEditing: T,
|
|
2096
|
-
onFieldChange:
|
|
2111
|
+
onFieldChange: Ce
|
|
2097
2112
|
}),
|
|
2098
|
-
q.comments && /* @__PURE__ */ Z(
|
|
2113
|
+
q.comments && /* @__PURE__ */ Z(Mt, {
|
|
2099
2114
|
comments: q.comments,
|
|
2100
2115
|
onAddComment: q.onAddComment
|
|
2101
2116
|
})
|
|
@@ -2104,19 +2119,19 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2104
2119
|
return !e && !t && !n && !i ? /* @__PURE__ */ Z("div", {
|
|
2105
2120
|
className: "mt-2",
|
|
2106
2121
|
children: a
|
|
2107
|
-
}) : /* @__PURE__ */ Q(
|
|
2122
|
+
}) : /* @__PURE__ */ Q(I, {
|
|
2108
2123
|
defaultValue: "details",
|
|
2109
2124
|
className: "w-full",
|
|
2110
2125
|
children: [
|
|
2111
|
-
/* @__PURE__ */ Q(
|
|
2126
|
+
/* @__PURE__ */ Q(ee, {
|
|
2112
2127
|
className: "w-full justify-start border-b rounded-none bg-transparent p-0",
|
|
2113
2128
|
children: [
|
|
2114
|
-
/* @__PURE__ */ Z(
|
|
2129
|
+
/* @__PURE__ */ Z(R, {
|
|
2115
2130
|
value: "details",
|
|
2116
2131
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
2117
2132
|
children: K("detail.details")
|
|
2118
2133
|
}),
|
|
2119
|
-
e && /* @__PURE__ */ Z(
|
|
2134
|
+
e && /* @__PURE__ */ Z(R, {
|
|
2120
2135
|
value: "related",
|
|
2121
2136
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
2122
2137
|
children: /* @__PURE__ */ Q("span", {
|
|
@@ -2128,7 +2143,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2128
2143
|
})]
|
|
2129
2144
|
})
|
|
2130
2145
|
}),
|
|
2131
|
-
t && /* @__PURE__ */ Z(
|
|
2146
|
+
t && /* @__PURE__ */ Z(R, {
|
|
2132
2147
|
value: "activity",
|
|
2133
2148
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
2134
2149
|
children: /* @__PURE__ */ Q("span", {
|
|
@@ -2140,12 +2155,12 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2140
2155
|
})]
|
|
2141
2156
|
})
|
|
2142
2157
|
}),
|
|
2143
|
-
n && /* @__PURE__ */ Z(
|
|
2158
|
+
n && /* @__PURE__ */ Z(R, {
|
|
2144
2159
|
value: "discussion",
|
|
2145
2160
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
2146
2161
|
children: K("detail.discussion", { defaultValue: "Discussion" })
|
|
2147
2162
|
}),
|
|
2148
|
-
i && /* @__PURE__ */ Z(
|
|
2163
|
+
i && /* @__PURE__ */ Z(R, {
|
|
2149
2164
|
value: "history",
|
|
2150
2165
|
className: "relative rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",
|
|
2151
2166
|
children: /* @__PURE__ */ Q("span", {
|
|
@@ -2159,17 +2174,17 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2159
2174
|
})
|
|
2160
2175
|
]
|
|
2161
2176
|
}),
|
|
2162
|
-
/* @__PURE__ */ Z(
|
|
2177
|
+
/* @__PURE__ */ Z(L, {
|
|
2163
2178
|
value: "details",
|
|
2164
2179
|
className: "mt-4",
|
|
2165
2180
|
children: a
|
|
2166
2181
|
}),
|
|
2167
|
-
e && /* @__PURE__ */ Z(
|
|
2182
|
+
e && /* @__PURE__ */ Z(L, {
|
|
2168
2183
|
value: "related",
|
|
2169
2184
|
className: "mt-4",
|
|
2170
2185
|
children: /* @__PURE__ */ Z("div", {
|
|
2171
2186
|
className: "space-y-3",
|
|
2172
|
-
children: we.map((e, t) => /* @__PURE__ */ Z(
|
|
2187
|
+
children: we.map((e, t) => /* @__PURE__ */ Z(Ot, {
|
|
2173
2188
|
title: e.title,
|
|
2174
2189
|
type: e.type,
|
|
2175
2190
|
api: e.api,
|
|
@@ -2185,25 +2200,25 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2185
2200
|
onRowEdit: e.onRowEdit,
|
|
2186
2201
|
onRowDelete: e.onRowDelete,
|
|
2187
2202
|
collapsible: !0,
|
|
2188
|
-
defaultCollapsed:
|
|
2189
|
-
pageSize:
|
|
2203
|
+
defaultCollapsed: ce && t > 0,
|
|
2204
|
+
pageSize: $t
|
|
2190
2205
|
}, t))
|
|
2191
2206
|
})
|
|
2192
2207
|
}),
|
|
2193
|
-
t && /* @__PURE__ */ Z(
|
|
2208
|
+
t && /* @__PURE__ */ Z(L, {
|
|
2194
2209
|
value: "activity",
|
|
2195
2210
|
className: "mt-4",
|
|
2196
|
-
children: /* @__PURE__ */ Z(
|
|
2211
|
+
children: /* @__PURE__ */ Z(Rt, { activities: q.activities })
|
|
2197
2212
|
}),
|
|
2198
|
-
n && /* @__PURE__ */ Z(
|
|
2213
|
+
n && /* @__PURE__ */ Z(L, {
|
|
2199
2214
|
value: "discussion",
|
|
2200
2215
|
className: "mt-4",
|
|
2201
2216
|
children: u
|
|
2202
2217
|
}),
|
|
2203
|
-
i && /* @__PURE__ */ Z(
|
|
2218
|
+
i && /* @__PURE__ */ Z(L, {
|
|
2204
2219
|
value: "history",
|
|
2205
2220
|
className: "mt-4",
|
|
2206
|
-
children: /* @__PURE__ */ Z(
|
|
2221
|
+
children: /* @__PURE__ */ Z(Gt, {
|
|
2207
2222
|
entries: q.history.entries,
|
|
2208
2223
|
loading: q.history.loading,
|
|
2209
2224
|
emptyText: q.history.emptyText ?? K("detail.historyEmpty", { defaultValue: "No history yet" })
|
|
@@ -2211,10 +2226,10 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2211
2226
|
})
|
|
2212
2227
|
]
|
|
2213
2228
|
});
|
|
2214
|
-
})() : /* @__PURE__ */ Q(
|
|
2229
|
+
})() : /* @__PURE__ */ Q(ft, { children: [
|
|
2215
2230
|
q.sectionGroups && q.sectionGroups.length > 0 && /* @__PURE__ */ Z("div", {
|
|
2216
2231
|
className: "space-y-3 sm:space-y-4",
|
|
2217
|
-
children: q.sectionGroups.map((e, t) => /* @__PURE__ */ Z(
|
|
2232
|
+
children: q.sectionGroups.map((e, t) => /* @__PURE__ */ Z(kt, {
|
|
2218
2233
|
group: e,
|
|
2219
2234
|
data: {
|
|
2220
2235
|
...v,
|
|
@@ -2223,12 +2238,12 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2223
2238
|
objectSchema: N,
|
|
2224
2239
|
objectName: q.objectName,
|
|
2225
2240
|
isEditing: T,
|
|
2226
|
-
onFieldChange:
|
|
2241
|
+
onFieldChange: Ce
|
|
2227
2242
|
}, t))
|
|
2228
2243
|
}),
|
|
2229
2244
|
q.sections && q.sections.length > 0 && /* @__PURE__ */ Z("div", {
|
|
2230
2245
|
className: "space-y-3 sm:space-y-4",
|
|
2231
|
-
children: q.sections.map((e, t) => /* @__PURE__ */ Z(
|
|
2246
|
+
children: q.sections.map((e, t) => /* @__PURE__ */ Z(Tt, {
|
|
2232
2247
|
section: e,
|
|
2233
2248
|
data: {
|
|
2234
2249
|
...v,
|
|
@@ -2237,10 +2252,10 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2237
2252
|
objectSchema: N,
|
|
2238
2253
|
objectName: q.objectName,
|
|
2239
2254
|
isEditing: T,
|
|
2240
|
-
onFieldChange:
|
|
2255
|
+
onFieldChange: Ce
|
|
2241
2256
|
}, t))
|
|
2242
2257
|
}),
|
|
2243
|
-
q.fields && q.fields.length > 0 && !q.sections?.length && /* @__PURE__ */ Z(
|
|
2258
|
+
q.fields && q.fields.length > 0 && !q.sections?.length && /* @__PURE__ */ Z(Tt, {
|
|
2244
2259
|
section: {
|
|
2245
2260
|
fields: q.fields,
|
|
2246
2261
|
columns: q.columns
|
|
@@ -2252,9 +2267,9 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2252
2267
|
objectSchema: N,
|
|
2253
2268
|
objectName: q.objectName,
|
|
2254
2269
|
isEditing: T,
|
|
2255
|
-
onFieldChange:
|
|
2270
|
+
onFieldChange: Ce
|
|
2256
2271
|
}),
|
|
2257
|
-
q.tabs && q.tabs.length > 0 && /* @__PURE__ */ Z(
|
|
2272
|
+
q.tabs && q.tabs.length > 0 && /* @__PURE__ */ Z(Et, {
|
|
2258
2273
|
tabs: q.tabs,
|
|
2259
2274
|
data: v
|
|
2260
2275
|
}),
|
|
@@ -2263,7 +2278,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2263
2278
|
children: [/* @__PURE__ */ Z("h2", {
|
|
2264
2279
|
className: "text-lg font-semibold",
|
|
2265
2280
|
children: K("detail.related")
|
|
2266
|
-
}), we.map((e, t) => /* @__PURE__ */ Z(
|
|
2281
|
+
}), we.map((e, t) => /* @__PURE__ */ Z(Ot, {
|
|
2267
2282
|
title: e.title,
|
|
2268
2283
|
type: e.type,
|
|
2269
2284
|
api: e.api,
|
|
@@ -2279,17 +2294,17 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2279
2294
|
onRowEdit: e.onRowEdit,
|
|
2280
2295
|
onRowDelete: e.onRowDelete,
|
|
2281
2296
|
collapsible: !0,
|
|
2282
|
-
defaultCollapsed:
|
|
2283
|
-
pageSize:
|
|
2297
|
+
defaultCollapsed: ce && t > 0,
|
|
2298
|
+
pageSize: $t
|
|
2284
2299
|
}, t))]
|
|
2285
2300
|
}),
|
|
2286
|
-
q.comments && /* @__PURE__ */ Z(
|
|
2301
|
+
q.comments && /* @__PURE__ */ Z(Mt, {
|
|
2287
2302
|
comments: q.comments,
|
|
2288
2303
|
onAddComment: q.onAddComment
|
|
2289
2304
|
}),
|
|
2290
|
-
q.activities && q.activities.length > 0 && /* @__PURE__ */ Z(
|
|
2305
|
+
q.activities && q.activities.length > 0 && /* @__PURE__ */ Z(Rt, { activities: q.activities })
|
|
2291
2306
|
] }),
|
|
2292
|
-
/* @__PURE__ */ Z(
|
|
2307
|
+
/* @__PURE__ */ Z(Qt, {
|
|
2293
2308
|
data: {
|
|
2294
2309
|
...v,
|
|
2295
2310
|
...D
|
|
@@ -2297,13 +2312,137 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2297
2312
|
objectSchema: N,
|
|
2298
2313
|
objectName: q.objectName
|
|
2299
2314
|
}),
|
|
2300
|
-
q.footer && /* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z(
|
|
2315
|
+
q.footer && /* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z($e, {
|
|
2301
2316
|
schema: q.footer,
|
|
2302
2317
|
data: v
|
|
2303
2318
|
}) })
|
|
2304
2319
|
]
|
|
2305
2320
|
}) });
|
|
2306
|
-
},
|
|
2321
|
+
}, nn = (e) => {
|
|
2322
|
+
if (e == null) return "—";
|
|
2323
|
+
if (typeof e == "string") return e.length > 0 ? e : "\"\"";
|
|
2324
|
+
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
2325
|
+
try {
|
|
2326
|
+
return JSON.stringify(e);
|
|
2327
|
+
} catch {
|
|
2328
|
+
return String(e);
|
|
2329
|
+
}
|
|
2330
|
+
}, rn = (e) => {
|
|
2331
|
+
if (typeof e != "string" || e.length === 0) return null;
|
|
2332
|
+
let t = /\d{4}-\d{2}-\d{2}[ T]/.test(e) ? e.replace(" ", "T") : e, n = new Date(t);
|
|
2333
|
+
if (Number.isNaN(n.getTime())) return null;
|
|
2334
|
+
try {
|
|
2335
|
+
return n.toLocaleString();
|
|
2336
|
+
} catch {
|
|
2337
|
+
return n.toISOString();
|
|
2338
|
+
}
|
|
2339
|
+
}, an = ({ open: e, conflict: t, onReload: n, onOverwrite: r, onCancel: a, busy: o = !1 }) => {
|
|
2340
|
+
let { t: f } = $(), p = t?.label || t?.field || "", m = t ? nn(t.pendingValue) : "", h = t ? nn(t.currentValue) : "", g = t?.currentRecord ?? {}, _ = (() => {
|
|
2341
|
+
let e = [g.updated_by_name, g.updated_by_label];
|
|
2342
|
+
for (let t of e) if (typeof t == "string" && t.length > 0) return t;
|
|
2343
|
+
let t = g.updated_by;
|
|
2344
|
+
return typeof t != "string" || t.length === 0 || t.length >= 16 && !/\s/.test(t) && /^[A-Za-z0-9_-]+$/.test(t) ? null : t;
|
|
2345
|
+
})(), v = rn(g.updated_at ?? t?.currentVersion), [y, b] = f("detail.concurrentUpdateDescription", { field: "{{field}}" }).split("{{field}}");
|
|
2346
|
+
return /* @__PURE__ */ Z(i, {
|
|
2347
|
+
open: e,
|
|
2348
|
+
onOpenChange: (e) => {
|
|
2349
|
+
!e && !o && a();
|
|
2350
|
+
},
|
|
2351
|
+
children: /* @__PURE__ */ Q(s, {
|
|
2352
|
+
className: "max-w-lg",
|
|
2353
|
+
children: [
|
|
2354
|
+
/* @__PURE__ */ Z(u, { children: /* @__PURE__ */ Q("div", {
|
|
2355
|
+
className: "flex items-start gap-3",
|
|
2356
|
+
children: [/* @__PURE__ */ Z("span", {
|
|
2357
|
+
className: "inline-flex h-9 w-9 flex-none items-center justify-center rounded-full bg-amber-100 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300",
|
|
2358
|
+
"aria-hidden": "true",
|
|
2359
|
+
children: /* @__PURE__ */ Z(re, { className: "h-5 w-5" })
|
|
2360
|
+
}), /* @__PURE__ */ Q("div", {
|
|
2361
|
+
className: "flex-1",
|
|
2362
|
+
children: [/* @__PURE__ */ Z(d, { children: f("detail.concurrentUpdateTitle") }), /* @__PURE__ */ Q(c, {
|
|
2363
|
+
className: "mt-1",
|
|
2364
|
+
children: [
|
|
2365
|
+
y,
|
|
2366
|
+
/* @__PURE__ */ Z("strong", {
|
|
2367
|
+
className: "font-semibold",
|
|
2368
|
+
children: p
|
|
2369
|
+
}),
|
|
2370
|
+
b
|
|
2371
|
+
]
|
|
2372
|
+
})]
|
|
2373
|
+
})]
|
|
2374
|
+
}) }),
|
|
2375
|
+
/* @__PURE__ */ Q("div", {
|
|
2376
|
+
className: "space-y-2 text-sm",
|
|
2377
|
+
children: [/* @__PURE__ */ Q("div", {
|
|
2378
|
+
className: "rounded-md border border-amber-200/70 bg-amber-50/60 p-3 dark:border-amber-500/30 dark:bg-amber-500/10",
|
|
2379
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
2380
|
+
className: "text-xs font-medium uppercase tracking-wide text-amber-800 dark:text-amber-300",
|
|
2381
|
+
children: f("detail.concurrentUpdateYourEdit")
|
|
2382
|
+
}), /* @__PURE__ */ Z("div", {
|
|
2383
|
+
className: "mt-1 break-all font-mono text-foreground",
|
|
2384
|
+
children: m
|
|
2385
|
+
})]
|
|
2386
|
+
}), /* @__PURE__ */ Q("div", {
|
|
2387
|
+
className: "rounded-md border border-sky-200/70 bg-sky-50/60 p-3 dark:border-sky-500/30 dark:bg-sky-500/10",
|
|
2388
|
+
children: [/* @__PURE__ */ Q("div", {
|
|
2389
|
+
className: "flex items-baseline justify-between gap-2",
|
|
2390
|
+
children: [/* @__PURE__ */ Z("div", {
|
|
2391
|
+
className: "text-xs font-medium uppercase tracking-wide text-sky-800 dark:text-sky-300",
|
|
2392
|
+
children: f("detail.concurrentUpdateCurrentValue")
|
|
2393
|
+
}), (_ || v) && /* @__PURE__ */ Q("div", {
|
|
2394
|
+
className: "text-[11px] text-muted-foreground",
|
|
2395
|
+
children: [
|
|
2396
|
+
_ && /* @__PURE__ */ Z("span", { children: f("detail.concurrentUpdateUpdatedBy", { name: _ }) }),
|
|
2397
|
+
_ && v && /* @__PURE__ */ Z("span", { children: " · " }),
|
|
2398
|
+
v && /* @__PURE__ */ Z("span", { children: f("detail.concurrentUpdateUpdatedAt", { when: v }) })
|
|
2399
|
+
]
|
|
2400
|
+
})]
|
|
2401
|
+
}), /* @__PURE__ */ Z("div", {
|
|
2402
|
+
className: "mt-1 break-all font-mono text-foreground",
|
|
2403
|
+
children: h
|
|
2404
|
+
})]
|
|
2405
|
+
})]
|
|
2406
|
+
}),
|
|
2407
|
+
/* @__PURE__ */ Q(l, {
|
|
2408
|
+
className: "gap-2 sm:gap-2",
|
|
2409
|
+
children: [
|
|
2410
|
+
/* @__PURE__ */ Z("button", {
|
|
2411
|
+
type: "button",
|
|
2412
|
+
disabled: o,
|
|
2413
|
+
onClick: a,
|
|
2414
|
+
className: U(H({ variant: "ghost" }), "mt-2 sm:mt-0"),
|
|
2415
|
+
children: f("detail.concurrentUpdateCancel")
|
|
2416
|
+
}),
|
|
2417
|
+
/* @__PURE__ */ Z("button", {
|
|
2418
|
+
type: "button",
|
|
2419
|
+
disabled: o,
|
|
2420
|
+
onClick: r,
|
|
2421
|
+
className: U(H({ variant: "outline" }), "mt-2 sm:mt-0 text-destructive border-destructive/40 hover:bg-destructive/10 hover:text-destructive"),
|
|
2422
|
+
children: f("detail.concurrentUpdateOverwrite")
|
|
2423
|
+
}),
|
|
2424
|
+
/* @__PURE__ */ Z("button", {
|
|
2425
|
+
type: "button",
|
|
2426
|
+
disabled: o,
|
|
2427
|
+
onClick: n,
|
|
2428
|
+
autoFocus: !0,
|
|
2429
|
+
className: U(H({ variant: "default" }), "mt-2 sm:mt-0"),
|
|
2430
|
+
children: f("detail.concurrentUpdateReload")
|
|
2431
|
+
})
|
|
2432
|
+
]
|
|
2433
|
+
})
|
|
2434
|
+
]
|
|
2435
|
+
})
|
|
2436
|
+
});
|
|
2437
|
+
};
|
|
2438
|
+
function on(e) {
|
|
2439
|
+
if (!e || typeof e != "object") return !1;
|
|
2440
|
+
let t = e;
|
|
2441
|
+
return t.code === "CONCURRENT_UPDATE" || t.name === "ConcurrentUpdateError";
|
|
2442
|
+
}
|
|
2443
|
+
//#endregion
|
|
2444
|
+
//#region src/renderers/record-details.tsx
|
|
2445
|
+
var sn = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field || e.name) || null, cn = (e) => {
|
|
2307
2446
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
2308
2447
|
return {
|
|
2309
2448
|
designer: {
|
|
@@ -2313,8 +2452,8 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2313
2452
|
},
|
|
2314
2453
|
rest: i
|
|
2315
2454
|
};
|
|
2316
|
-
},
|
|
2317
|
-
let i =
|
|
2455
|
+
}, ln = ({ schema: e = {}, className: t, ...n }) => {
|
|
2456
|
+
let i = it(), { designer: a } = cn(n);
|
|
2318
2457
|
if (!i) return /* @__PURE__ */ Z("div", {
|
|
2319
2458
|
className: t,
|
|
2320
2459
|
"data-record-details-placeholder": !0,
|
|
@@ -2324,8 +2463,8 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2324
2463
|
children: "record:details — bind a record to preview"
|
|
2325
2464
|
})
|
|
2326
2465
|
});
|
|
2327
|
-
let o = e.layout === "inline" || e.layout === "compact" ? "horizontal" : "vertical", s = i.objectName || "", c =
|
|
2328
|
-
if (
|
|
2466
|
+
let o = e.layout === "inline" || e.layout === "compact" ? "horizontal" : "vertical", s = i.objectName || "", c = mt(), { readableFields: l } = pt(s), { sectionLabel: u } = ot(), d = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
|
|
2467
|
+
if (d.length > 0 && s && !d.every((e) => c.can(s, e))) return /* @__PURE__ */ Z("div", {
|
|
2329
2468
|
className: t,
|
|
2330
2469
|
...a,
|
|
2331
2470
|
role: "status",
|
|
@@ -2335,20 +2474,20 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2335
2474
|
children: "Insufficient permissions to view details."
|
|
2336
2475
|
})
|
|
2337
2476
|
});
|
|
2338
|
-
let
|
|
2339
|
-
if (!e || !
|
|
2340
|
-
let t = e.map(
|
|
2477
|
+
let f = e.enforceFieldSecurity === !0, p = Array.isArray(e.redactFields) ? e.redactFields : [], m = (e) => {
|
|
2478
|
+
if (!e || !f && p.length === 0) return e;
|
|
2479
|
+
let t = e.map(sn).filter((e) => !!e), n = new Set((f && s ? l(t) : t).filter((e) => !p.includes(e)));
|
|
2341
2480
|
return e.filter((e) => {
|
|
2342
|
-
let t =
|
|
2481
|
+
let t = sn(e);
|
|
2343
2482
|
return t ? n.has(t) : !0;
|
|
2344
2483
|
});
|
|
2345
|
-
},
|
|
2484
|
+
}, h = (e) => typeof e == "string" ? { name: e } : e && typeof e == "object" && !e.name && e.field ? {
|
|
2346
2485
|
...e,
|
|
2347
2486
|
name: e.field
|
|
2348
|
-
} : e,
|
|
2349
|
-
for (let e of
|
|
2350
|
-
let
|
|
2351
|
-
|
|
2487
|
+
} : e, g = (e) => Array.isArray(e) ? e.map(h) : e, _ = nt(), v = new Set((Array.isArray(e.hideFields) ? e.hideFields : []).map((e) => typeof e == "string" ? e : sn(e)).filter((e) => !!e));
|
|
2488
|
+
for (let e of _) v.add(e);
|
|
2489
|
+
let y = i.objectSchema, b = i.data ?? {}, x = [
|
|
2490
|
+
y?.primaryField,
|
|
2352
2491
|
"name",
|
|
2353
2492
|
"full_name",
|
|
2354
2493
|
"title",
|
|
@@ -2356,62 +2495,125 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2356
2495
|
"display_name",
|
|
2357
2496
|
"label"
|
|
2358
2497
|
].filter((e) => typeof e == "string" && e.length > 0);
|
|
2359
|
-
for (let e of
|
|
2360
|
-
|
|
2498
|
+
for (let e of x) if (b[e] !== void 0 && b[e] !== null && b[e] !== "") {
|
|
2499
|
+
v.add(e);
|
|
2361
2500
|
break;
|
|
2362
2501
|
}
|
|
2363
|
-
let
|
|
2364
|
-
let t =
|
|
2365
|
-
return t ? !
|
|
2366
|
-
}),
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2502
|
+
let S = (e) => !e || v.size === 0 ? e : e.filter((e) => {
|
|
2503
|
+
let t = sn(e);
|
|
2504
|
+
return t ? !v.has(t) : !0;
|
|
2505
|
+
}), C = S(g(m(e.fields))), w = Array.isArray(e.sections) ? e.sections.map((e) => {
|
|
2506
|
+
let t = e.title ?? e.label, n = e.name && s ? u(s, e.name, t ?? e.name) : t;
|
|
2507
|
+
return {
|
|
2508
|
+
...e,
|
|
2509
|
+
title: n,
|
|
2510
|
+
showBorder: e.showBorder ?? !!n,
|
|
2511
|
+
hideEmpty: e.hideEmpty ?? !0,
|
|
2512
|
+
fields: S(g(m(e.fields)))
|
|
2513
|
+
};
|
|
2514
|
+
}) : e.sections, T = e.inlineEdit ?? !0, [E, D] = r.useState(null), [O, k] = r.useState(!1), A = r.useCallback((t) => {
|
|
2515
|
+
let n = [...Array.isArray(e.fields) ? e.fields : [], ...(Array.isArray(e.sections) ? e.sections : []).flatMap((e) => Array.isArray(e?.fields) ? e.fields : [])];
|
|
2516
|
+
for (let e of n) if ((typeof e == "string" ? e : e?.name || e?.field) === t) return typeof e == "object" ? e?.label : void 0;
|
|
2517
|
+
}, [e.fields, e.sections]), j = r.useCallback(async (e, t) => {
|
|
2373
2518
|
let n = i.dataSource, r = i.recordId, a = i.objectName;
|
|
2374
|
-
if (!
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2519
|
+
if (!n || !r || !a) return;
|
|
2520
|
+
let o = typeof i.data?.updated_at == "string" ? i.data.updated_at : void 0, s = o ? { ifMatch: o } : void 0;
|
|
2521
|
+
try {
|
|
2522
|
+
if (typeof n.update == "function") await n.update(a, r, { [e]: t }, s);
|
|
2523
|
+
else if (typeof n.updateOne == "function") await n.updateOne(a, r, { [e]: t }, s);
|
|
2524
|
+
else if (typeof n.patch == "function") await n.patch(a, r, { [e]: t }, s);
|
|
2378
2525
|
else {
|
|
2379
2526
|
console.warn("[record:details] DataSource exposes no update/updateOne/patch method; cannot persist inline edit");
|
|
2380
2527
|
return;
|
|
2381
2528
|
}
|
|
2382
2529
|
typeof i.refresh == "function" && await i.refresh();
|
|
2530
|
+
} catch (n) {
|
|
2531
|
+
if (on(n)) {
|
|
2532
|
+
let r = n.currentRecord ?? null;
|
|
2533
|
+
throw D({
|
|
2534
|
+
field: e,
|
|
2535
|
+
label: A(e),
|
|
2536
|
+
pendingValue: t,
|
|
2537
|
+
currentValue: r ? r[e] : void 0,
|
|
2538
|
+
currentVersion: n.currentVersion,
|
|
2539
|
+
currentRecord: r
|
|
2540
|
+
}), n;
|
|
2541
|
+
}
|
|
2542
|
+
throw console.error("[record:details] Inline-edit save failed", n), n;
|
|
2543
|
+
}
|
|
2544
|
+
}, [
|
|
2545
|
+
i.dataSource,
|
|
2546
|
+
i.recordId,
|
|
2547
|
+
i.objectName,
|
|
2548
|
+
i.data,
|
|
2549
|
+
i.refresh,
|
|
2550
|
+
A
|
|
2551
|
+
]), M = r.useCallback(() => {
|
|
2552
|
+
D(null), k(!1);
|
|
2553
|
+
}, []), N = r.useCallback(async () => {
|
|
2554
|
+
k(!0);
|
|
2555
|
+
try {
|
|
2556
|
+
typeof i.refresh == "function" && await i.refresh();
|
|
2557
|
+
} finally {
|
|
2558
|
+
M();
|
|
2559
|
+
}
|
|
2560
|
+
}, [i.refresh, M]), P = r.useCallback(async () => {
|
|
2561
|
+
if (!E) {
|
|
2562
|
+
M();
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
let e = i.dataSource, t = i.recordId, n = i.objectName;
|
|
2566
|
+
if (!e || !t || !n) {
|
|
2567
|
+
M();
|
|
2568
|
+
return;
|
|
2569
|
+
}
|
|
2570
|
+
k(!0);
|
|
2571
|
+
try {
|
|
2572
|
+
let r = E.currentVersion ? { ifMatch: E.currentVersion } : void 0;
|
|
2573
|
+
typeof e.update == "function" ? await e.update(n, t, { [E.field]: E.pendingValue }, r) : typeof e.updateOne == "function" ? await e.updateOne(n, t, { [E.field]: E.pendingValue }, r) : typeof e.patch == "function" && await e.patch(n, t, { [E.field]: E.pendingValue }, r), typeof i.refresh == "function" && await i.refresh();
|
|
2383
2574
|
} catch (e) {
|
|
2384
|
-
|
|
2575
|
+
console.error("[record:details] Overwrite-on-conflict failed", e);
|
|
2576
|
+
} finally {
|
|
2577
|
+
M();
|
|
2385
2578
|
}
|
|
2386
2579
|
}, [
|
|
2580
|
+
E,
|
|
2387
2581
|
i.dataSource,
|
|
2388
2582
|
i.recordId,
|
|
2389
2583
|
i.objectName,
|
|
2390
|
-
i.refresh
|
|
2391
|
-
|
|
2584
|
+
i.refresh,
|
|
2585
|
+
M
|
|
2586
|
+
]), F = {
|
|
2392
2587
|
type: "detail-view",
|
|
2393
2588
|
objectName: i.objectName,
|
|
2394
2589
|
resourceId: i.recordId,
|
|
2395
2590
|
data: i.data,
|
|
2396
2591
|
layout: o,
|
|
2397
2592
|
columns: e.columns,
|
|
2398
|
-
sections:
|
|
2399
|
-
fields:
|
|
2593
|
+
sections: w,
|
|
2594
|
+
fields: C,
|
|
2400
2595
|
showBack: !1,
|
|
2401
2596
|
showHeader: e.showHeader ?? !1,
|
|
2402
|
-
inlineEdit:
|
|
2597
|
+
inlineEdit: T
|
|
2403
2598
|
};
|
|
2404
|
-
return /* @__PURE__ */
|
|
2599
|
+
return /* @__PURE__ */ Q("div", {
|
|
2405
2600
|
className: t,
|
|
2406
2601
|
...a,
|
|
2407
|
-
children: /* @__PURE__ */ Z(
|
|
2408
|
-
schema:
|
|
2602
|
+
children: [/* @__PURE__ */ Z(tn, {
|
|
2603
|
+
schema: F,
|
|
2409
2604
|
dataSource: i.dataSource,
|
|
2410
|
-
inlineEdit:
|
|
2411
|
-
onFieldSave:
|
|
2412
|
-
})
|
|
2605
|
+
inlineEdit: T,
|
|
2606
|
+
onFieldSave: j
|
|
2607
|
+
}), /* @__PURE__ */ Z(an, {
|
|
2608
|
+
open: !!E,
|
|
2609
|
+
conflict: E,
|
|
2610
|
+
busy: O,
|
|
2611
|
+
onCancel: M,
|
|
2612
|
+
onReload: N,
|
|
2613
|
+
onOverwrite: P
|
|
2614
|
+
})]
|
|
2413
2615
|
});
|
|
2414
|
-
},
|
|
2616
|
+
}, un = (e) => typeof e == "string" ? e : e && typeof e == "object" && (e.field || e.name || e.key) || null, dn = (e) => {
|
|
2415
2617
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
2416
2618
|
return {
|
|
2417
2619
|
designer: {
|
|
@@ -2421,11 +2623,11 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2421
2623
|
},
|
|
2422
2624
|
rest: i
|
|
2423
2625
|
};
|
|
2424
|
-
},
|
|
2425
|
-
let r =
|
|
2626
|
+
}, fn = ({ schema: e = {}, className: t, ...n }) => {
|
|
2627
|
+
let r = it(), { designer: i } = dn(n), a = ot(), o = e.objectName, s = o && a.objectLabel ? a.objectLabel({
|
|
2426
2628
|
name: o,
|
|
2427
|
-
label:
|
|
2428
|
-
}) : o ?
|
|
2629
|
+
label: ut(o)
|
|
2630
|
+
}) : o ? ut(o) : "", c = e.title || s || "Related";
|
|
2429
2631
|
if (!o) return /* @__PURE__ */ Z("div", {
|
|
2430
2632
|
className: t,
|
|
2431
2633
|
...i,
|
|
@@ -2434,7 +2636,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2434
2636
|
children: "record:related_list — missing objectName"
|
|
2435
2637
|
})
|
|
2436
2638
|
});
|
|
2437
|
-
let l =
|
|
2639
|
+
let l = mt(), { readableFields: u } = pt(o), d = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
|
|
2438
2640
|
if (d.length > 0 && !d.every((e) => l.can(o, e))) return /* @__PURE__ */ Z("div", {
|
|
2439
2641
|
className: t,
|
|
2440
2642
|
...i,
|
|
@@ -2447,16 +2649,16 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2447
2649
|
});
|
|
2448
2650
|
let f = e.enforceFieldSecurity === !0, p = Array.isArray(e.redactFields) ? e.redactFields : [], m = Array.isArray(e.columns) ? e.columns : [], h = m;
|
|
2449
2651
|
if (f || p.length > 0) {
|
|
2450
|
-
let e = m.map(
|
|
2652
|
+
let e = m.map(un).filter((e) => !!e), t = new Set((f ? u(e) : e).filter((e) => !p.includes(e)));
|
|
2451
2653
|
h = m.filter((e) => {
|
|
2452
|
-
let n =
|
|
2654
|
+
let n = un(e);
|
|
2453
2655
|
return n ? t.has(n) : !0;
|
|
2454
2656
|
});
|
|
2455
2657
|
}
|
|
2456
2658
|
return /* @__PURE__ */ Z("div", {
|
|
2457
2659
|
className: t,
|
|
2458
2660
|
...i,
|
|
2459
|
-
children: /* @__PURE__ */ Z(
|
|
2661
|
+
children: /* @__PURE__ */ Z(Ot, {
|
|
2460
2662
|
title: c,
|
|
2461
2663
|
type: "table",
|
|
2462
2664
|
api: o,
|
|
@@ -2468,7 +2670,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2468
2670
|
dataSource: r?.dataSource
|
|
2469
2671
|
})
|
|
2470
2672
|
});
|
|
2471
|
-
},
|
|
2673
|
+
}, pn = (e) => {
|
|
2472
2674
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
2473
2675
|
return {
|
|
2474
2676
|
designer: {
|
|
@@ -2478,8 +2680,8 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2478
2680
|
},
|
|
2479
2681
|
rest: i
|
|
2480
2682
|
};
|
|
2481
|
-
},
|
|
2482
|
-
let i =
|
|
2683
|
+
}, mn = ({ schema: e = {}, className: t, ...n }) => {
|
|
2684
|
+
let i = it(), { designer: a } = pn(n), o = i?.objectName || "", s = mt(), { readableFields: c } = pt(o), l = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
|
|
2483
2685
|
if (l.length > 0 && o && !l.every((e) => s.can(o, e))) return /* @__PURE__ */ Z("div", {
|
|
2484
2686
|
className: t,
|
|
2485
2687
|
...a,
|
|
@@ -2496,20 +2698,20 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2496
2698
|
icon: e?.icon,
|
|
2497
2699
|
type: e?.type
|
|
2498
2700
|
}).filter((e) => typeof e.name == "string" && e.name.length > 0), d = e.enforceFieldSecurity === !0, f = Array.isArray(e.redactFields) ? e.redactFields : [], p = d && o ? new Set(c(u.map((e) => e.name))) : null, m = u.filter((e) => !(f.includes(e.name) || p && !p.has(e.name)));
|
|
2499
|
-
return
|
|
2701
|
+
return at(r.useId(), m.map((e) => e.name)), /* @__PURE__ */ Z("div", {
|
|
2500
2702
|
className: t,
|
|
2501
2703
|
...a,
|
|
2502
|
-
children: /* @__PURE__ */ Z(
|
|
2704
|
+
children: /* @__PURE__ */ Z(At, {
|
|
2503
2705
|
fields: m,
|
|
2504
2706
|
data: i?.data,
|
|
2505
2707
|
objectName: i?.objectName,
|
|
2506
2708
|
objectSchema: i?.objectSchema
|
|
2507
2709
|
})
|
|
2508
2710
|
});
|
|
2509
|
-
},
|
|
2711
|
+
}, hn = ({ change: e, className: t }) => {
|
|
2510
2712
|
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));
|
|
2511
2713
|
return /* @__PURE__ */ Q("div", {
|
|
2512
|
-
className:
|
|
2714
|
+
className: U("flex items-center gap-1.5 text-sm flex-wrap", t),
|
|
2513
2715
|
children: [
|
|
2514
2716
|
/* @__PURE__ */ Z("span", {
|
|
2515
2717
|
className: "font-medium text-foreground",
|
|
@@ -2519,29 +2721,29 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2519
2721
|
className: "text-muted-foreground line-through",
|
|
2520
2722
|
children: r
|
|
2521
2723
|
}),
|
|
2522
|
-
/* @__PURE__ */ Z(
|
|
2724
|
+
/* @__PURE__ */ Z(ie, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
|
|
2523
2725
|
/* @__PURE__ */ Z("span", {
|
|
2524
2726
|
className: "text-foreground",
|
|
2525
2727
|
children: i
|
|
2526
2728
|
})
|
|
2527
2729
|
]
|
|
2528
2730
|
});
|
|
2529
|
-
},
|
|
2731
|
+
}, gn = [
|
|
2530
2732
|
"👍",
|
|
2531
2733
|
"❤️",
|
|
2532
2734
|
"🎉",
|
|
2533
2735
|
"😂",
|
|
2534
2736
|
"😮",
|
|
2535
2737
|
"😢"
|
|
2536
|
-
],
|
|
2738
|
+
], _n = ({ reactions: e, onToggleReaction: t, emojiOptions: r = gn, className: i }) => {
|
|
2537
2739
|
let [a, o] = n.useState(!1), s = n.useCallback((e) => {
|
|
2538
2740
|
t?.(e), o(!1);
|
|
2539
2741
|
}, [t]);
|
|
2540
2742
|
return /* @__PURE__ */ Q("div", {
|
|
2541
|
-
className:
|
|
2743
|
+
className: U("flex items-center gap-1 flex-wrap", i),
|
|
2542
2744
|
children: [e.map((e) => /* @__PURE__ */ Q("button", {
|
|
2543
2745
|
type: "button",
|
|
2544
|
-
className:
|
|
2746
|
+
className: U("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs border transition-colors", e.reacted ? "bg-primary/10 border-primary/30 text-primary" : "bg-muted border-border text-muted-foreground hover:bg-muted/80"),
|
|
2545
2747
|
onClick: () => s(e.emoji),
|
|
2546
2748
|
disabled: !t,
|
|
2547
2749
|
"aria-label": `${e.emoji} ${e.count} reaction${e.count === 1 ? "" : "s"}`,
|
|
@@ -2554,7 +2756,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2554
2756
|
className: "h-6 w-6",
|
|
2555
2757
|
onClick: () => o(!a),
|
|
2556
2758
|
"aria-label": "Add reaction",
|
|
2557
|
-
children: /* @__PURE__ */ Z(
|
|
2759
|
+
children: /* @__PURE__ */ Z(Ke, { className: "h-3.5 w-3.5" })
|
|
2558
2760
|
}), a && /* @__PURE__ */ Z("div", {
|
|
2559
2761
|
className: "absolute bottom-full mb-1 left-0 bg-popover border rounded-md shadow-md z-50 p-1.5 flex gap-1",
|
|
2560
2762
|
role: "listbox",
|
|
@@ -2573,7 +2775,7 @@ var Xt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
2573
2775
|
};
|
|
2574
2776
|
//#endregion
|
|
2575
2777
|
//#region src/ThreadedReplies.tsx
|
|
2576
|
-
function
|
|
2778
|
+
function vn(e) {
|
|
2577
2779
|
try {
|
|
2578
2780
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
2579
2781
|
if (r < 1) return "just now";
|
|
@@ -2586,7 +2788,7 @@ function ln(e) {
|
|
|
2586
2788
|
return e;
|
|
2587
2789
|
}
|
|
2588
2790
|
}
|
|
2589
|
-
var
|
|
2791
|
+
var yn = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, className: a }) => {
|
|
2590
2792
|
let { t: o } = $(), [s, c] = n.useState(!1), [l, u] = n.useState(""), [d, f] = n.useState(!1), p = n.useCallback(async () => {
|
|
2591
2793
|
let t = l.trim();
|
|
2592
2794
|
if (!(!t || !r)) {
|
|
@@ -2605,7 +2807,7 @@ var un = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
2605
2807
|
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), p());
|
|
2606
2808
|
}, [p]);
|
|
2607
2809
|
return t.length === 0 && !i ? null : /* @__PURE__ */ Q("div", {
|
|
2608
|
-
className:
|
|
2810
|
+
className: U("ml-10 mt-1", a),
|
|
2609
2811
|
children: [
|
|
2610
2812
|
t.length > 0 && /* @__PURE__ */ Q("button", {
|
|
2611
2813
|
type: "button",
|
|
@@ -2613,8 +2815,8 @@ var un = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
2613
2815
|
onClick: () => c(!s),
|
|
2614
2816
|
"aria-expanded": s,
|
|
2615
2817
|
children: [
|
|
2616
|
-
Z(s ?
|
|
2617
|
-
/* @__PURE__ */ Z(
|
|
2818
|
+
Z(s ? fe : me, { className: "h-3 w-3" }),
|
|
2819
|
+
/* @__PURE__ */ Z(Ne, { className: "h-3 w-3" }),
|
|
2618
2820
|
/* @__PURE__ */ Z("span", { children: t.length === 1 ? o("detail.replyCount", { count: t.length }) : o("detail.replyCountPlural", { count: t.length }) })
|
|
2619
2821
|
]
|
|
2620
2822
|
}),
|
|
@@ -2641,7 +2843,7 @@ var un = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
2641
2843
|
children: e.actor
|
|
2642
2844
|
}), /* @__PURE__ */ Z("span", {
|
|
2643
2845
|
className: "text-[10px] text-muted-foreground",
|
|
2644
|
-
children:
|
|
2846
|
+
children: vn(e.createdAt)
|
|
2645
2847
|
})]
|
|
2646
2848
|
}), /* @__PURE__ */ Z("p", {
|
|
2647
2849
|
className: "text-xs whitespace-pre-wrap break-words",
|
|
@@ -2666,12 +2868,12 @@ var un = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
2666
2868
|
onClick: p,
|
|
2667
2869
|
disabled: !l.trim() || d,
|
|
2668
2870
|
"aria-label": "Send reply",
|
|
2669
|
-
children: /* @__PURE__ */ Z(
|
|
2871
|
+
children: /* @__PURE__ */ Z(Ge, { className: "h-3 w-3" })
|
|
2670
2872
|
})]
|
|
2671
2873
|
})
|
|
2672
2874
|
]
|
|
2673
2875
|
});
|
|
2674
|
-
},
|
|
2876
|
+
}, bn = ({ subscription: e, onToggle: t, className: r }) => {
|
|
2675
2877
|
let { t: i } = $(), [a, o] = n.useState(!1), s = n.useCallback(async () => {
|
|
2676
2878
|
if (t) {
|
|
2677
2879
|
o(!0);
|
|
@@ -2685,22 +2887,291 @@ var un = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
2685
2887
|
return /* @__PURE__ */ Z(g, {
|
|
2686
2888
|
variant: "ghost",
|
|
2687
2889
|
size: "icon",
|
|
2688
|
-
className:
|
|
2890
|
+
className: U("h-8 w-8", r),
|
|
2689
2891
|
onClick: s,
|
|
2690
2892
|
disabled: a || !t,
|
|
2691
2893
|
"aria-label": e.subscribed ? i("detail.unsubscribeAriaLabel") : i("detail.subscribeAriaLabel"),
|
|
2692
2894
|
title: e.subscribed ? i("detail.subscribedTooltip") : i("detail.unsubscribedTooltip"),
|
|
2693
|
-
children: e.subscribed ? /* @__PURE__ */ Z(
|
|
2895
|
+
children: e.subscribed ? /* @__PURE__ */ Z(se, { className: "h-4 w-4 text-primary" }) : /* @__PURE__ */ Z(ce, { className: "h-4 w-4 text-muted-foreground" })
|
|
2896
|
+
});
|
|
2897
|
+
};
|
|
2898
|
+
//#endregion
|
|
2899
|
+
//#region src/RichTextCommentInput.tsx
|
|
2900
|
+
function xn(e) {
|
|
2901
|
+
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/>");
|
|
2902
|
+
return t = t.replace(/(<li[^>]*>.*?<\/li>(?:<br\/>)?)+/g, (e) => `<ul class="my-1">${e.replace(/<br\/>/g, "")}</ul>`), t;
|
|
2903
|
+
}
|
|
2904
|
+
var Sn = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], placeholder: a, className: o, disabled: s = !1, extraSlot: c, canSubmitEmpty: l = !1 }) => {
|
|
2905
|
+
let { t: u } = $(), [d, f] = n.useState(!1), [p, m] = n.useState(!1), [h, _] = n.useState(""), [v, y] = n.useState(0), b = n.useRef(null), x = n.useMemo(() => {
|
|
2906
|
+
if (!h) return i;
|
|
2907
|
+
let e = h.toLowerCase();
|
|
2908
|
+
return i.filter((t) => t.label.toLowerCase().includes(e));
|
|
2909
|
+
}, [h, i]), S = n.useCallback((n, r = "") => {
|
|
2910
|
+
let i = b.current;
|
|
2911
|
+
if (!i) return;
|
|
2912
|
+
let a = i.selectionStart, o = i.selectionEnd, s = e.slice(a, o);
|
|
2913
|
+
t(e.slice(0, a) + n + s + r + e.slice(o)), requestAnimationFrame(() => {
|
|
2914
|
+
i.focus();
|
|
2915
|
+
let e = a + n.length + s.length;
|
|
2916
|
+
i.setSelectionRange(e, e);
|
|
2917
|
+
});
|
|
2918
|
+
}, [e, t]), C = n.useCallback(() => S("**", "**"), [S]), w = n.useCallback(() => S("*", "*"), [S]), T = n.useCallback(() => S("\n- ", ""), [S]), E = n.useCallback(() => S("`", "`"), [S]), D = n.useCallback(() => {
|
|
2919
|
+
S("@", ""), m(!0), _(""), y(0);
|
|
2920
|
+
}, [S]), O = n.useCallback((n) => {
|
|
2921
|
+
let r = b.current;
|
|
2922
|
+
if (!r) return;
|
|
2923
|
+
let i = r.selectionStart, a = e.slice(0, i).lastIndexOf("@");
|
|
2924
|
+
a !== -1 && t(e.slice(0, a) + `@${n.label} ` + e.slice(i)), m(!1), _(""), requestAnimationFrame(() => r.focus());
|
|
2925
|
+
}, [e, t]), k = n.useCallback((e) => {
|
|
2926
|
+
let n = e.target.value;
|
|
2927
|
+
t(n);
|
|
2928
|
+
let r = e.target.selectionStart, i = n.slice(0, r), a = i.lastIndexOf("@");
|
|
2929
|
+
if (a !== -1) {
|
|
2930
|
+
let e = i.slice(a + 1), t = a > 0 ? i[a - 1] : " ";
|
|
2931
|
+
if (/\s/.test(t) && !/\s/.test(e)) {
|
|
2932
|
+
m(!0), _(e), y(0);
|
|
2933
|
+
return;
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
m(!1);
|
|
2937
|
+
}, [t]), A = n.useCallback((e) => {
|
|
2938
|
+
if (p && x.length > 0) {
|
|
2939
|
+
if (e.key === "ArrowDown") {
|
|
2940
|
+
e.preventDefault(), y((e) => e < x.length - 1 ? e + 1 : 0);
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
if (e.key === "ArrowUp") {
|
|
2944
|
+
e.preventDefault(), y((e) => e > 0 ? e - 1 : x.length - 1);
|
|
2945
|
+
return;
|
|
2946
|
+
}
|
|
2947
|
+
if (e.key === "Enter" || e.key === "Tab") {
|
|
2948
|
+
e.preventDefault(), O(x[v]);
|
|
2949
|
+
return;
|
|
2950
|
+
}
|
|
2951
|
+
if (e.key === "Escape") {
|
|
2952
|
+
m(!1);
|
|
2953
|
+
return;
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), r?.());
|
|
2957
|
+
}, [
|
|
2958
|
+
p,
|
|
2959
|
+
x,
|
|
2960
|
+
v,
|
|
2961
|
+
O,
|
|
2962
|
+
r
|
|
2963
|
+
]);
|
|
2964
|
+
return /* @__PURE__ */ Q("div", {
|
|
2965
|
+
className: U("border rounded-md", o),
|
|
2966
|
+
children: [
|
|
2967
|
+
/* @__PURE__ */ Q("div", {
|
|
2968
|
+
className: "flex items-center gap-0.5 px-2 py-1.5 border-b bg-muted/30",
|
|
2969
|
+
children: [
|
|
2970
|
+
/* @__PURE__ */ Z(g, {
|
|
2971
|
+
variant: "ghost",
|
|
2972
|
+
size: "icon",
|
|
2973
|
+
className: "h-7 w-7",
|
|
2974
|
+
onClick: C,
|
|
2975
|
+
disabled: s || d,
|
|
2976
|
+
title: u("detail.bold"),
|
|
2977
|
+
children: /* @__PURE__ */ Z(le, { className: "h-3.5 w-3.5" })
|
|
2978
|
+
}),
|
|
2979
|
+
/* @__PURE__ */ Z(g, {
|
|
2980
|
+
variant: "ghost",
|
|
2981
|
+
size: "icon",
|
|
2982
|
+
className: "h-7 w-7",
|
|
2983
|
+
onClick: w,
|
|
2984
|
+
disabled: s || d,
|
|
2985
|
+
title: u("detail.italic"),
|
|
2986
|
+
children: /* @__PURE__ */ Z(De, { className: "h-3.5 w-3.5" })
|
|
2987
|
+
}),
|
|
2988
|
+
/* @__PURE__ */ Z(g, {
|
|
2989
|
+
variant: "ghost",
|
|
2990
|
+
size: "icon",
|
|
2991
|
+
className: "h-7 w-7",
|
|
2992
|
+
onClick: T,
|
|
2993
|
+
disabled: s || d,
|
|
2994
|
+
title: u("detail.listFormat"),
|
|
2995
|
+
children: /* @__PURE__ */ Z(ke, { className: "h-3.5 w-3.5" })
|
|
2996
|
+
}),
|
|
2997
|
+
/* @__PURE__ */ Z(g, {
|
|
2998
|
+
variant: "ghost",
|
|
2999
|
+
size: "icon",
|
|
3000
|
+
className: "h-7 w-7",
|
|
3001
|
+
onClick: E,
|
|
3002
|
+
disabled: s || d,
|
|
3003
|
+
title: u("detail.inlineCode"),
|
|
3004
|
+
children: /* @__PURE__ */ Z(J, { className: "h-3.5 w-3.5" })
|
|
3005
|
+
}),
|
|
3006
|
+
/* @__PURE__ */ Z(g, {
|
|
3007
|
+
variant: "ghost",
|
|
3008
|
+
size: "icon",
|
|
3009
|
+
className: "h-7 w-7",
|
|
3010
|
+
onClick: D,
|
|
3011
|
+
disabled: s || d,
|
|
3012
|
+
title: u("detail.mentionSomeone"),
|
|
3013
|
+
children: /* @__PURE__ */ Z(K, { className: "h-3.5 w-3.5" })
|
|
3014
|
+
}),
|
|
3015
|
+
/* @__PURE__ */ Z("div", { className: "flex-1" }),
|
|
3016
|
+
/* @__PURE__ */ Z(g, {
|
|
3017
|
+
variant: "ghost",
|
|
3018
|
+
size: "icon",
|
|
3019
|
+
className: "h-7 w-7",
|
|
3020
|
+
onClick: () => f(!d),
|
|
3021
|
+
title: u(d ? "detail.edit" : "detail.preview"),
|
|
3022
|
+
children: Z(d ? Y : X, { className: "h-3.5 w-3.5" })
|
|
3023
|
+
}),
|
|
3024
|
+
r && /* @__PURE__ */ Z(g, {
|
|
3025
|
+
variant: "ghost",
|
|
3026
|
+
size: "icon",
|
|
3027
|
+
className: "h-7 w-7",
|
|
3028
|
+
onClick: r,
|
|
3029
|
+
disabled: s || !l && !e.trim(),
|
|
3030
|
+
title: u("detail.submitComment"),
|
|
3031
|
+
children: /* @__PURE__ */ Z(Ge, { className: "h-3.5 w-3.5" })
|
|
3032
|
+
})
|
|
3033
|
+
]
|
|
3034
|
+
}),
|
|
3035
|
+
/* @__PURE__ */ Z("div", {
|
|
3036
|
+
className: "relative",
|
|
3037
|
+
children: d ? /* @__PURE__ */ Z("div", {
|
|
3038
|
+
className: "min-h-[80px] px-3 py-2 text-sm prose prose-sm max-w-none",
|
|
3039
|
+
dangerouslySetInnerHTML: { __html: xn(e) }
|
|
3040
|
+
}) : /* @__PURE__ */ Q(ft, { children: [/* @__PURE__ */ Z("textarea", {
|
|
3041
|
+
ref: b,
|
|
3042
|
+
className: "w-full min-h-[80px] px-3 py-2 text-sm bg-transparent resize-none focus:outline-none placeholder:text-muted-foreground",
|
|
3043
|
+
placeholder: a ?? u("detail.writeComment"),
|
|
3044
|
+
value: e,
|
|
3045
|
+
onChange: k,
|
|
3046
|
+
onKeyDown: A,
|
|
3047
|
+
disabled: s
|
|
3048
|
+
}), p && x.length > 0 && /* @__PURE__ */ Z("div", {
|
|
3049
|
+
className: "absolute left-2 bottom-full mb-1 w-56 bg-popover border rounded-md shadow-md z-50 max-h-40 overflow-y-auto",
|
|
3050
|
+
children: x.map((e, t) => /* @__PURE__ */ Q("button", {
|
|
3051
|
+
type: "button",
|
|
3052
|
+
className: U("w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-accent transition-colors", t === v && "bg-accent"),
|
|
3053
|
+
onMouseDown: (t) => {
|
|
3054
|
+
t.preventDefault(), O(e);
|
|
3055
|
+
},
|
|
3056
|
+
children: [e.avatarUrl ? /* @__PURE__ */ Z("img", {
|
|
3057
|
+
src: e.avatarUrl,
|
|
3058
|
+
alt: e.label,
|
|
3059
|
+
className: "h-5 w-5 rounded-full object-cover"
|
|
3060
|
+
}) : /* @__PURE__ */ Z("div", {
|
|
3061
|
+
className: "h-5 w-5 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium",
|
|
3062
|
+
children: e.label.charAt(0).toUpperCase()
|
|
3063
|
+
}), /* @__PURE__ */ Z("span", { children: e.label })]
|
|
3064
|
+
}, e.id))
|
|
3065
|
+
})] })
|
|
3066
|
+
}),
|
|
3067
|
+
c && /* @__PURE__ */ Z("div", {
|
|
3068
|
+
className: "border-t px-2 py-2 bg-muted/20",
|
|
3069
|
+
children: c
|
|
3070
|
+
})
|
|
3071
|
+
]
|
|
3072
|
+
});
|
|
3073
|
+
};
|
|
3074
|
+
//#endregion
|
|
3075
|
+
//#region src/CommentAttachment.tsx
|
|
3076
|
+
function Cn(e) {
|
|
3077
|
+
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
3078
|
+
}
|
|
3079
|
+
function wn(e) {
|
|
3080
|
+
return e.startsWith("image/");
|
|
3081
|
+
}
|
|
3082
|
+
function Tn(e) {
|
|
3083
|
+
return wn(e) ? Te : e.includes("pdf") || e.includes("document") || e.includes("text") ? Ce : e.includes("zip") || e.includes("archive") || e.includes("compressed") ? Se : xe;
|
|
3084
|
+
}
|
|
3085
|
+
var En = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a = !1 }) => {
|
|
3086
|
+
let { t: o } = $(), [s, c] = n.useState(!1), l = n.useRef(null), u = n.useCallback((e) => {
|
|
3087
|
+
e.preventDefault(), e.stopPropagation(), c(!0);
|
|
3088
|
+
}, []), d = n.useCallback((e) => {
|
|
3089
|
+
e.preventDefault(), e.stopPropagation(), c(!1);
|
|
3090
|
+
}, []), f = n.useCallback((e) => {
|
|
3091
|
+
e.preventDefault(), e.stopPropagation(), c(!1), t && e.dataTransfer.files.length > 0 && t(e.dataTransfer.files);
|
|
3092
|
+
}, [t]), p = n.useCallback((e) => {
|
|
3093
|
+
t && e.target.files && e.target.files.length > 0 && (t(e.target.files), e.target.value = "");
|
|
3094
|
+
}, [t]);
|
|
3095
|
+
return /* @__PURE__ */ Q("div", {
|
|
3096
|
+
className: U("space-y-2", i),
|
|
3097
|
+
children: [t && !a && /* @__PURE__ */ Q("div", {
|
|
3098
|
+
className: U("border-2 border-dashed rounded-md px-4 py-3 text-center transition-colors cursor-pointer", s ? "border-primary bg-primary/5" : "border-muted-foreground/25 hover:border-muted-foreground/40"),
|
|
3099
|
+
onDragOver: u,
|
|
3100
|
+
onDragLeave: d,
|
|
3101
|
+
onDrop: f,
|
|
3102
|
+
onClick: () => l.current?.click(),
|
|
3103
|
+
role: "button",
|
|
3104
|
+
tabIndex: 0,
|
|
3105
|
+
onKeyDown: (e) => {
|
|
3106
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), l.current?.click());
|
|
3107
|
+
},
|
|
3108
|
+
children: [
|
|
3109
|
+
/* @__PURE__ */ Z(Ye, { className: "h-5 w-5 mx-auto text-muted-foreground mb-1" }),
|
|
3110
|
+
/* @__PURE__ */ Z("p", {
|
|
3111
|
+
className: "text-xs text-muted-foreground",
|
|
3112
|
+
children: o("detail.dropFilesToUpload")
|
|
3113
|
+
}),
|
|
3114
|
+
/* @__PURE__ */ Z("input", {
|
|
3115
|
+
ref: l,
|
|
3116
|
+
type: "file",
|
|
3117
|
+
multiple: !0,
|
|
3118
|
+
className: "hidden",
|
|
3119
|
+
onChange: p
|
|
3120
|
+
})
|
|
3121
|
+
]
|
|
3122
|
+
}), e.length > 0 && /* @__PURE__ */ Q("div", {
|
|
3123
|
+
className: "space-y-1.5",
|
|
3124
|
+
children: [/* @__PURE__ */ Q("div", {
|
|
3125
|
+
className: "flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
3126
|
+
children: [/* @__PURE__ */ Z(Le, { className: "h-3 w-3" }), /* @__PURE__ */ Z("span", { children: e.length === 1 ? o("detail.attachmentCount", { count: e.length }) : o("detail.attachmentCountPlural", { count: e.length }) })]
|
|
3127
|
+
}), /* @__PURE__ */ Z("div", {
|
|
3128
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-2",
|
|
3129
|
+
children: e.map((e) => {
|
|
3130
|
+
let t = wn(e.type), n = Tn(e.type);
|
|
3131
|
+
return /* @__PURE__ */ Q("div", {
|
|
3132
|
+
className: "flex items-center gap-2 rounded-md border px-2.5 py-2 bg-muted/30 group",
|
|
3133
|
+
children: [
|
|
3134
|
+
t && (e.thumbnailUrl || e.url) ? /* @__PURE__ */ Z("img", {
|
|
3135
|
+
src: e.thumbnailUrl || e.url,
|
|
3136
|
+
alt: e.name,
|
|
3137
|
+
className: "h-10 w-10 rounded object-cover shrink-0"
|
|
3138
|
+
}) : /* @__PURE__ */ Z("div", {
|
|
3139
|
+
className: "h-10 w-10 rounded bg-muted flex items-center justify-center shrink-0",
|
|
3140
|
+
children: /* @__PURE__ */ Z(n, { className: "h-5 w-5 text-muted-foreground" })
|
|
3141
|
+
}),
|
|
3142
|
+
/* @__PURE__ */ Q("div", {
|
|
3143
|
+
className: "flex-1 min-w-0",
|
|
3144
|
+
children: [/* @__PURE__ */ Z("p", {
|
|
3145
|
+
className: "text-xs font-medium truncate",
|
|
3146
|
+
children: e.name
|
|
3147
|
+
}), /* @__PURE__ */ Z("p", {
|
|
3148
|
+
className: "text-[10px] text-muted-foreground",
|
|
3149
|
+
children: Cn(e.size)
|
|
3150
|
+
})]
|
|
3151
|
+
}),
|
|
3152
|
+
r && !a && /* @__PURE__ */ Z(g, {
|
|
3153
|
+
variant: "ghost",
|
|
3154
|
+
size: "icon",
|
|
3155
|
+
className: "h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
3156
|
+
onClick: () => r(e.id),
|
|
3157
|
+
title: o("detail.removeAttachment"),
|
|
3158
|
+
children: /* @__PURE__ */ Z(Xe, { className: "h-3.5 w-3.5" })
|
|
3159
|
+
})
|
|
3160
|
+
]
|
|
3161
|
+
}, e.id);
|
|
3162
|
+
})
|
|
3163
|
+
})]
|
|
3164
|
+
})]
|
|
2694
3165
|
});
|
|
2695
|
-
},
|
|
2696
|
-
comment:
|
|
2697
|
-
field_change:
|
|
2698
|
-
task:
|
|
2699
|
-
event:
|
|
2700
|
-
system:
|
|
2701
|
-
email:
|
|
2702
|
-
call:
|
|
2703
|
-
},
|
|
3166
|
+
}, Dn = {
|
|
3167
|
+
comment: Ne,
|
|
3168
|
+
field_change: Y,
|
|
3169
|
+
task: de,
|
|
3170
|
+
event: q,
|
|
3171
|
+
system: Ze,
|
|
3172
|
+
email: Me,
|
|
3173
|
+
call: Re
|
|
3174
|
+
}, On = {
|
|
2704
3175
|
comment: "bg-purple-100 text-purple-600",
|
|
2705
3176
|
field_change: "bg-blue-100 text-blue-600",
|
|
2706
3177
|
task: "bg-green-100 text-green-600",
|
|
@@ -2709,7 +3180,7 @@ var un = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
2709
3180
|
email: "bg-indigo-100 text-indigo-600",
|
|
2710
3181
|
call: "bg-teal-100 text-teal-600"
|
|
2711
3182
|
};
|
|
2712
|
-
function
|
|
3183
|
+
function kn(e) {
|
|
2713
3184
|
return [
|
|
2714
3185
|
{
|
|
2715
3186
|
value: "all",
|
|
@@ -2729,7 +3200,7 @@ function mn(e) {
|
|
|
2729
3200
|
}
|
|
2730
3201
|
];
|
|
2731
3202
|
}
|
|
2732
|
-
function
|
|
3203
|
+
function An(e) {
|
|
2733
3204
|
try {
|
|
2734
3205
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
2735
3206
|
if (r < 1) return "just now";
|
|
@@ -2742,7 +3213,7 @@ function hn(e) {
|
|
|
2742
3213
|
return e;
|
|
2743
3214
|
}
|
|
2744
3215
|
}
|
|
2745
|
-
function
|
|
3216
|
+
function jn(e, t) {
|
|
2746
3217
|
switch (t) {
|
|
2747
3218
|
case "comments_only": return e.filter((e) => e.type === "comment");
|
|
2748
3219
|
case "changes_only": return e.filter((e) => e.type === "field_change");
|
|
@@ -2750,41 +3221,55 @@ function gn(e, t) {
|
|
|
2750
3221
|
default: return e;
|
|
2751
3222
|
}
|
|
2752
3223
|
}
|
|
2753
|
-
var
|
|
2754
|
-
let { t:
|
|
2755
|
-
if (!
|
|
3224
|
+
var Mn = ({ 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: p = !1, mentionSuggestions: m, onUploadAttachments: h, titleLabel: _, emptyLabel: v, className: y }) => {
|
|
3225
|
+
let { t: b } = $(), [x, S] = n.useState("all"), [C, T] = n.useState(""), [j, M] = n.useState(!1), [N, P] = n.useState(!1), [F, I] = n.useState([]), [L, ee] = n.useState(!1), R = r ?? x, z = t?.showFilterToggle !== !1, B = t?.showCommentInput !== !1 && !!c, te = t?.enableReactions ?? !1, V = t?.enableThreading ?? !1, H = t?.showSubscriptionToggle ?? !1, ne = n.useMemo(() => jn(e, R), [e, R]), re = n.useMemo(() => V ? ne.filter((e) => !e.parentId) : ne, [ne, V]), G = n.useMemo(() => {
|
|
3226
|
+
if (!V) return /* @__PURE__ */ new Map();
|
|
2756
3227
|
let e = /* @__PURE__ */ new Map();
|
|
2757
|
-
for (let t of
|
|
3228
|
+
for (let t of ne) if (t.parentId) {
|
|
2758
3229
|
let n = e.get(t.parentId) ?? [];
|
|
2759
3230
|
n.push(t), e.set(t.parentId, n);
|
|
2760
3231
|
}
|
|
2761
3232
|
return e;
|
|
2762
|
-
}, [
|
|
2763
|
-
i ? i(e) :
|
|
2764
|
-
}, [i]),
|
|
2765
|
-
let e =
|
|
2766
|
-
if (!(!e
|
|
2767
|
-
|
|
3233
|
+
}, [ne, V]), ie = n.useCallback((e) => {
|
|
3234
|
+
i ? i(e) : S(e);
|
|
3235
|
+
}, [i]), ae = n.useCallback(async () => {
|
|
3236
|
+
let e = C.trim();
|
|
3237
|
+
if (c && !(!e && F.length === 0)) {
|
|
3238
|
+
M(!0);
|
|
2768
3239
|
try {
|
|
2769
|
-
await c(e),
|
|
3240
|
+
await c(e, F.length > 0 ? F : void 0), T(""), I([]);
|
|
2770
3241
|
} finally {
|
|
2771
|
-
|
|
3242
|
+
M(!1);
|
|
2772
3243
|
}
|
|
2773
3244
|
}
|
|
2774
|
-
}, [
|
|
2775
|
-
|
|
2776
|
-
|
|
3245
|
+
}, [
|
|
3246
|
+
C,
|
|
3247
|
+
F,
|
|
3248
|
+
c
|
|
3249
|
+
]), oe = n.useCallback(async (e) => {
|
|
3250
|
+
if (!(!h || e.length === 0)) {
|
|
3251
|
+
ee(!0);
|
|
3252
|
+
try {
|
|
3253
|
+
let t = await h(e);
|
|
3254
|
+
Array.isArray(t) && t.length > 0 && I((e) => [...e, ...t]);
|
|
3255
|
+
} finally {
|
|
3256
|
+
ee(!1);
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
}, [h]), K = n.useCallback((e) => {
|
|
3260
|
+
I((t) => t.filter((t) => t.id !== e));
|
|
3261
|
+
}, []), se = n.useCallback(async () => {
|
|
2777
3262
|
if (o) {
|
|
2778
|
-
|
|
3263
|
+
P(!0);
|
|
2779
3264
|
try {
|
|
2780
3265
|
await o();
|
|
2781
3266
|
} finally {
|
|
2782
|
-
|
|
3267
|
+
P(!1);
|
|
2783
3268
|
}
|
|
2784
3269
|
}
|
|
2785
3270
|
}, [o]);
|
|
2786
3271
|
return /* @__PURE__ */ Q("section", {
|
|
2787
|
-
className:
|
|
3272
|
+
className: U("border-t border-border/60 pt-5", y),
|
|
2788
3273
|
"aria-label": "Discussion",
|
|
2789
3274
|
children: [/* @__PURE__ */ Z("header", {
|
|
2790
3275
|
className: "mb-4",
|
|
@@ -2793,20 +3278,20 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
2793
3278
|
children: [/* @__PURE__ */ Q("h2", {
|
|
2794
3279
|
className: "flex items-center gap-2 text-base font-semibold leading-none tracking-tight",
|
|
2795
3280
|
children: [
|
|
2796
|
-
/* @__PURE__ */ Z(
|
|
2797
|
-
|
|
3281
|
+
/* @__PURE__ */ Z(W, { className: "h-4 w-4" }),
|
|
3282
|
+
_ ?? b("detail.activity"),
|
|
2798
3283
|
/* @__PURE__ */ Q("span", {
|
|
2799
3284
|
className: "text-sm font-normal text-muted-foreground",
|
|
2800
3285
|
children: [
|
|
2801
3286
|
"(",
|
|
2802
|
-
|
|
3287
|
+
ne.length,
|
|
2803
3288
|
")"
|
|
2804
3289
|
]
|
|
2805
3290
|
})
|
|
2806
3291
|
]
|
|
2807
3292
|
}), /* @__PURE__ */ Z("div", {
|
|
2808
3293
|
className: "flex items-center gap-1",
|
|
2809
|
-
children:
|
|
3294
|
+
children: H && d && /* @__PURE__ */ Z(bn, {
|
|
2810
3295
|
subscription: d,
|
|
2811
3296
|
onToggle: f
|
|
2812
3297
|
})
|
|
@@ -2815,53 +3300,53 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
2815
3300
|
}), /* @__PURE__ */ Q("div", {
|
|
2816
3301
|
className: "space-y-4",
|
|
2817
3302
|
children: [
|
|
2818
|
-
|
|
3303
|
+
z && /* @__PURE__ */ Z("div", {
|
|
2819
3304
|
className: "flex items-center gap-2",
|
|
2820
|
-
children: /* @__PURE__ */ Q(
|
|
2821
|
-
value:
|
|
2822
|
-
onValueChange: (e) =>
|
|
2823
|
-
children: [/* @__PURE__ */ Z(
|
|
2824
|
-
"aria-label":
|
|
3305
|
+
children: /* @__PURE__ */ Q(E, {
|
|
3306
|
+
value: R,
|
|
3307
|
+
onValueChange: (e) => ie(e),
|
|
3308
|
+
children: [/* @__PURE__ */ Z(k, {
|
|
3309
|
+
"aria-label": b("detail.filterActivity"),
|
|
2825
3310
|
className: "h-8 w-auto min-w-[140px] py-1 text-sm",
|
|
2826
|
-
children: /* @__PURE__ */ Z(
|
|
2827
|
-
}), /* @__PURE__ */ Z(
|
|
3311
|
+
children: /* @__PURE__ */ Z(A, {})
|
|
3312
|
+
}), /* @__PURE__ */ Z(D, { children: kn(b).map((e) => /* @__PURE__ */ Z(O, {
|
|
2828
3313
|
value: e.value,
|
|
2829
3314
|
children: e.label
|
|
2830
3315
|
}, e.value)) })]
|
|
2831
3316
|
})
|
|
2832
3317
|
}),
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
})
|
|
3318
|
+
B && /* @__PURE__ */ Z(Sn, {
|
|
3319
|
+
value: C,
|
|
3320
|
+
onChange: T,
|
|
3321
|
+
onSubmit: ae,
|
|
3322
|
+
mentionSuggestions: m,
|
|
3323
|
+
placeholder: b("detail.leaveCommentPlaceholder"),
|
|
3324
|
+
disabled: j,
|
|
3325
|
+
canSubmitEmpty: F.length > 0,
|
|
3326
|
+
extraSlot: h ? /* @__PURE__ */ Z(En, {
|
|
3327
|
+
attachments: F,
|
|
3328
|
+
onUpload: oe,
|
|
3329
|
+
onRemove: K,
|
|
3330
|
+
readOnly: j || L
|
|
3331
|
+
}) : F.length > 0 ? /* @__PURE__ */ Z(En, {
|
|
3332
|
+
attachments: F,
|
|
3333
|
+
onRemove: K,
|
|
3334
|
+
readOnly: j
|
|
3335
|
+
}) : void 0
|
|
2851
3336
|
}),
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
3337
|
+
ne.length === 0 ? p ? null : /* @__PURE__ */ Z(w, {
|
|
3338
|
+
title: v ?? b("detail.noActivity"),
|
|
3339
|
+
className: "py-6"
|
|
2855
3340
|
}) : /* @__PURE__ */ Q("div", {
|
|
2856
3341
|
className: "relative",
|
|
2857
3342
|
children: [/* @__PURE__ */ Z("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Z("div", {
|
|
2858
3343
|
className: "space-y-4",
|
|
2859
|
-
children:
|
|
2860
|
-
let t =
|
|
3344
|
+
children: re.map((e) => {
|
|
3345
|
+
let t = Dn[e.type] || Ze, n = On[e.type] || "bg-gray-100 text-gray-600", r = G.get(e.id) ?? [];
|
|
2861
3346
|
return /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Q("div", {
|
|
2862
3347
|
className: "flex gap-3 relative",
|
|
2863
3348
|
children: [/* @__PURE__ */ Z("div", {
|
|
2864
|
-
className:
|
|
3349
|
+
className: U("shrink-0 h-8 w-8 rounded-full flex items-center justify-center z-10", n),
|
|
2865
3350
|
children: e.actorAvatarUrl ? /* @__PURE__ */ Z("img", {
|
|
2866
3351
|
src: e.actorAvatarUrl,
|
|
2867
3352
|
alt: e.actor,
|
|
@@ -2879,19 +3364,19 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
2879
3364
|
}),
|
|
2880
3365
|
e.source && /* @__PURE__ */ Z("span", {
|
|
2881
3366
|
className: "text-xs text-muted-foreground",
|
|
2882
|
-
children:
|
|
3367
|
+
children: b("detail.via", { source: e.source })
|
|
2883
3368
|
}),
|
|
2884
3369
|
/* @__PURE__ */ Z("span", {
|
|
2885
3370
|
className: "text-xs text-muted-foreground",
|
|
2886
|
-
children:
|
|
3371
|
+
children: An(e.createdAt)
|
|
2887
3372
|
}),
|
|
2888
3373
|
e.edited && /* @__PURE__ */ Z("span", {
|
|
2889
3374
|
className: "text-xs text-muted-foreground italic",
|
|
2890
|
-
children:
|
|
3375
|
+
children: b("detail.edited")
|
|
2891
3376
|
}),
|
|
2892
3377
|
e.pinned && /* @__PURE__ */ Q("span", {
|
|
2893
3378
|
className: "text-xs text-amber-600",
|
|
2894
|
-
children: ["📌 ",
|
|
3379
|
+
children: ["📌 ", b("detail.pinned")]
|
|
2895
3380
|
})
|
|
2896
3381
|
]
|
|
2897
3382
|
}),
|
|
@@ -2901,25 +3386,25 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
2901
3386
|
}),
|
|
2902
3387
|
e.type === "field_change" && e.fieldChanges && /* @__PURE__ */ Z("div", {
|
|
2903
3388
|
className: "space-y-1 mt-1",
|
|
2904
|
-
children: e.fieldChanges.map((e, t) => /* @__PURE__ */ Z(
|
|
3389
|
+
children: e.fieldChanges.map((e, t) => /* @__PURE__ */ Z(hn, { change: e }, t))
|
|
2905
3390
|
}),
|
|
2906
|
-
|
|
3391
|
+
te && e.reactions && e.reactions.length > 0 && /* @__PURE__ */ Z("div", {
|
|
2907
3392
|
className: "mt-1.5",
|
|
2908
|
-
children: /* @__PURE__ */ Z(
|
|
3393
|
+
children: /* @__PURE__ */ Z(_n, {
|
|
2909
3394
|
reactions: e.reactions,
|
|
2910
3395
|
onToggleReaction: u ? (t) => u(e.id, t) : void 0
|
|
2911
3396
|
})
|
|
2912
3397
|
}),
|
|
2913
|
-
|
|
3398
|
+
te && (!e.reactions || e.reactions.length === 0) && u && /* @__PURE__ */ Z("div", {
|
|
2914
3399
|
className: "mt-1.5",
|
|
2915
|
-
children: /* @__PURE__ */ Z(
|
|
3400
|
+
children: /* @__PURE__ */ Z(_n, {
|
|
2916
3401
|
reactions: [],
|
|
2917
3402
|
onToggleReaction: (t) => u(e.id, t)
|
|
2918
3403
|
})
|
|
2919
3404
|
})
|
|
2920
3405
|
]
|
|
2921
3406
|
})]
|
|
2922
|
-
}),
|
|
3407
|
+
}), V && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ Z(yn, {
|
|
2923
3408
|
parentItem: e,
|
|
2924
3409
|
replies: r,
|
|
2925
3410
|
onAddReply: l,
|
|
@@ -2933,16 +3418,16 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
2933
3418
|
children: /* @__PURE__ */ Q(g, {
|
|
2934
3419
|
variant: "ghost",
|
|
2935
3420
|
size: "sm",
|
|
2936
|
-
onClick:
|
|
2937
|
-
disabled:
|
|
2938
|
-
"aria-label":
|
|
2939
|
-
children: [
|
|
3421
|
+
onClick: se,
|
|
3422
|
+
disabled: N,
|
|
3423
|
+
"aria-label": b("detail.loadMore"),
|
|
3424
|
+
children: [N ? /* @__PURE__ */ Z(Ae, { className: "h-4 w-4 animate-spin mr-1" }) : /* @__PURE__ */ Z(fe, { className: "h-4 w-4 mr-1" }), b("detail.loadMore")]
|
|
2940
3425
|
})
|
|
2941
3426
|
})
|
|
2942
3427
|
]
|
|
2943
3428
|
})]
|
|
2944
3429
|
});
|
|
2945
|
-
},
|
|
3430
|
+
}, Nn = (e) => {
|
|
2946
3431
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
2947
3432
|
return {
|
|
2948
3433
|
designer: {
|
|
@@ -2952,54 +3437,54 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
2952
3437
|
},
|
|
2953
3438
|
rest: i
|
|
2954
3439
|
};
|
|
2955
|
-
},
|
|
2956
|
-
|
|
2957
|
-
let { designer: r } =
|
|
3440
|
+
}, Pn = ({ schema: e = {}, className: t, ...n }) => {
|
|
3441
|
+
it();
|
|
3442
|
+
let { designer: r } = Nn(n);
|
|
2958
3443
|
return /* @__PURE__ */ Z("div", {
|
|
2959
3444
|
className: t,
|
|
2960
3445
|
...r,
|
|
2961
|
-
children: /* @__PURE__ */ Z(
|
|
3446
|
+
children: /* @__PURE__ */ Z(Mn, {
|
|
2962
3447
|
items: [],
|
|
2963
3448
|
config: e
|
|
2964
3449
|
})
|
|
2965
3450
|
});
|
|
2966
|
-
},
|
|
2967
|
-
let
|
|
2968
|
-
return
|
|
2969
|
-
className:
|
|
3451
|
+
}, 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: p = !1, mentionSuggestions: m, onUploadAttachments: h, className: _ }) => {
|
|
3452
|
+
let v = e?.position ?? "right", y = e?.width ?? "360px", b = e?.collapsible ?? !0, x = p && t.length === 0 || (e?.defaultCollapsed ?? !1), { t: S } = $(), [C, w] = n.useState(x);
|
|
3453
|
+
return v === "right" || v === "left" ? C && b ? /* @__PURE__ */ Z("div", {
|
|
3454
|
+
className: U("flex items-start pt-4", v === "right" ? "border-l" : "border-r", _),
|
|
2970
3455
|
children: /* @__PURE__ */ Z(g, {
|
|
2971
3456
|
variant: "ghost",
|
|
2972
3457
|
size: "icon",
|
|
2973
3458
|
className: "h-8 w-8 mx-1",
|
|
2974
|
-
onClick: () =>
|
|
2975
|
-
"aria-label":
|
|
2976
|
-
children: /* @__PURE__ */ Z(
|
|
3459
|
+
onClick: () => w(!1),
|
|
3460
|
+
"aria-label": S("detail.openDiscussion"),
|
|
3461
|
+
children: /* @__PURE__ */ Z(Ie, { className: "h-4 w-4" })
|
|
2977
3462
|
})
|
|
2978
3463
|
}) : /* @__PURE__ */ Q("div", {
|
|
2979
|
-
className:
|
|
3464
|
+
className: U("flex flex-col overflow-hidden", v === "right" ? "border-l" : "border-r", _),
|
|
2980
3465
|
style: {
|
|
2981
|
-
width:
|
|
2982
|
-
minWidth:
|
|
3466
|
+
width: y,
|
|
3467
|
+
minWidth: y
|
|
2983
3468
|
},
|
|
2984
3469
|
children: [/* @__PURE__ */ Q("div", {
|
|
2985
3470
|
className: "flex items-center justify-between px-4 py-3 border-b",
|
|
2986
3471
|
children: [/* @__PURE__ */ Q("div", {
|
|
2987
3472
|
className: "flex items-center gap-2",
|
|
2988
|
-
children: [/* @__PURE__ */ Z(
|
|
3473
|
+
children: [/* @__PURE__ */ Z(Ne, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
|
|
2989
3474
|
className: "text-sm font-medium",
|
|
2990
|
-
children:
|
|
3475
|
+
children: S("detail.discussion")
|
|
2991
3476
|
})]
|
|
2992
|
-
}),
|
|
3477
|
+
}), b && /* @__PURE__ */ Z(g, {
|
|
2993
3478
|
variant: "ghost",
|
|
2994
3479
|
size: "icon",
|
|
2995
3480
|
className: "h-7 w-7",
|
|
2996
|
-
onClick: () =>
|
|
2997
|
-
"aria-label":
|
|
2998
|
-
children: /* @__PURE__ */ Z(
|
|
3481
|
+
onClick: () => w(!0),
|
|
3482
|
+
"aria-label": S("detail.closeDiscussion"),
|
|
3483
|
+
children: /* @__PURE__ */ Z(Xe, { className: "h-3.5 w-3.5" })
|
|
2999
3484
|
})]
|
|
3000
3485
|
}), /* @__PURE__ */ Z("div", {
|
|
3001
3486
|
className: "flex-1 overflow-y-auto",
|
|
3002
|
-
children: /* @__PURE__ */ Z(
|
|
3487
|
+
children: /* @__PURE__ */ Z(Mn, {
|
|
3003
3488
|
items: t,
|
|
3004
3489
|
config: e?.feed,
|
|
3005
3490
|
hasMore: r,
|
|
@@ -3013,33 +3498,35 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3013
3498
|
filterMode: d,
|
|
3014
3499
|
onFilterChange: f,
|
|
3015
3500
|
collapseWhenEmpty: p,
|
|
3016
|
-
|
|
3017
|
-
|
|
3501
|
+
mentionSuggestions: m,
|
|
3502
|
+
onUploadAttachments: h,
|
|
3503
|
+
titleLabel: S("detail.discussion"),
|
|
3504
|
+
emptyLabel: S("detail.noCommentsYet"),
|
|
3018
3505
|
className: "border-0 shadow-none"
|
|
3019
3506
|
})
|
|
3020
3507
|
})]
|
|
3021
3508
|
}) : /* @__PURE__ */ Z("div", {
|
|
3022
|
-
className:
|
|
3023
|
-
children:
|
|
3509
|
+
className: U("", _),
|
|
3510
|
+
children: b && C ? /* @__PURE__ */ Q(g, {
|
|
3024
3511
|
variant: "ghost",
|
|
3025
3512
|
className: "w-full justify-start gap-2 text-muted-foreground",
|
|
3026
|
-
onClick: () =>
|
|
3027
|
-
"aria-label":
|
|
3028
|
-
children: [/* @__PURE__ */ Z(
|
|
3029
|
-
}) : /* @__PURE__ */ Q("div", { children: [
|
|
3513
|
+
onClick: () => w(!1),
|
|
3514
|
+
"aria-label": S("detail.showDiscussion", { count: t.length }),
|
|
3515
|
+
children: [/* @__PURE__ */ Z(Ne, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", { children: S("detail.showDiscussion", { count: t.length }) })]
|
|
3516
|
+
}) : /* @__PURE__ */ Q("div", { children: [b && /* @__PURE__ */ Q("div", {
|
|
3030
3517
|
className: "flex items-center justify-between mb-2",
|
|
3031
3518
|
children: [/* @__PURE__ */ Q("div", {
|
|
3032
3519
|
className: "flex items-center gap-2 text-sm font-medium",
|
|
3033
|
-
children: [/* @__PURE__ */ Z(
|
|
3520
|
+
children: [/* @__PURE__ */ Z(Ne, { className: "h-4 w-4" }), S("detail.discussion")]
|
|
3034
3521
|
}), /* @__PURE__ */ Z(g, {
|
|
3035
3522
|
variant: "ghost",
|
|
3036
3523
|
size: "icon",
|
|
3037
3524
|
className: "h-7 w-7",
|
|
3038
|
-
onClick: () =>
|
|
3039
|
-
"aria-label":
|
|
3040
|
-
children: /* @__PURE__ */ Z(
|
|
3525
|
+
onClick: () => w(!0),
|
|
3526
|
+
"aria-label": S("detail.hideDiscussion"),
|
|
3527
|
+
children: /* @__PURE__ */ Z(Fe, { className: "h-3.5 w-3.5" })
|
|
3041
3528
|
})]
|
|
3042
|
-
}), /* @__PURE__ */ Z(
|
|
3529
|
+
}), /* @__PURE__ */ Z(Mn, {
|
|
3043
3530
|
items: t,
|
|
3044
3531
|
config: e?.feed,
|
|
3045
3532
|
hasMore: r,
|
|
@@ -3053,11 +3540,13 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3053
3540
|
filterMode: d,
|
|
3054
3541
|
onFilterChange: f,
|
|
3055
3542
|
collapseWhenEmpty: p,
|
|
3056
|
-
|
|
3057
|
-
|
|
3543
|
+
mentionSuggestions: m,
|
|
3544
|
+
onUploadAttachments: h,
|
|
3545
|
+
titleLabel: S("detail.discussion"),
|
|
3546
|
+
emptyLabel: S("detail.noCommentsYet")
|
|
3058
3547
|
})] })
|
|
3059
3548
|
});
|
|
3060
|
-
},
|
|
3549
|
+
}, In = (e) => {
|
|
3061
3550
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
3062
3551
|
return {
|
|
3063
3552
|
designer: {
|
|
@@ -3067,9 +3556,9 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3067
3556
|
},
|
|
3068
3557
|
rest: i
|
|
3069
3558
|
};
|
|
3070
|
-
},
|
|
3071
|
-
|
|
3072
|
-
let r =
|
|
3559
|
+
}, Ln = ({ schema: e = {}, className: t, ...n }) => {
|
|
3560
|
+
it();
|
|
3561
|
+
let r = tt(), { designer: i } = In(n), a = {
|
|
3073
3562
|
position: "bottom",
|
|
3074
3563
|
collapsible: !1,
|
|
3075
3564
|
feed: {
|
|
@@ -3082,15 +3571,17 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3082
3571
|
return /* @__PURE__ */ Z("div", {
|
|
3083
3572
|
className: t,
|
|
3084
3573
|
...i,
|
|
3085
|
-
children: /* @__PURE__ */ Z(
|
|
3574
|
+
children: /* @__PURE__ */ Z(Fn, {
|
|
3086
3575
|
items: r?.items || [],
|
|
3087
3576
|
config: a,
|
|
3088
3577
|
onAddComment: r?.onAddComment,
|
|
3089
3578
|
onAddReply: r?.onAddReply,
|
|
3090
|
-
onToggleReaction: r?.onToggleReaction
|
|
3579
|
+
onToggleReaction: r?.onToggleReaction,
|
|
3580
|
+
mentionSuggestions: r?.mentionSuggestions,
|
|
3581
|
+
onUploadAttachments: r?.onUploadAttachments
|
|
3091
3582
|
})
|
|
3092
3583
|
});
|
|
3093
|
-
},
|
|
3584
|
+
}, Rn = (e) => {
|
|
3094
3585
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
3095
3586
|
return {
|
|
3096
3587
|
designer: {
|
|
@@ -3100,8 +3591,8 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3100
3591
|
},
|
|
3101
3592
|
rest: i
|
|
3102
3593
|
};
|
|
3103
|
-
},
|
|
3104
|
-
let i =
|
|
3594
|
+
}, zn = ({ schema: e = {}, className: t, ...n }) => {
|
|
3595
|
+
let i = it(), { translateOptions: a } = ot(), { designer: o } = Rn(n), s = Array.isArray(e.stages) ? e.stages : [], c = e.statusField, l = r.useMemo(() => {
|
|
3105
3596
|
if (s.length === 0 || !c || !i?.objectName) return s;
|
|
3106
3597
|
let e = a(i.objectName, c, s);
|
|
3107
3598
|
return Array.isArray(e) && e.length === s.length ? e : s;
|
|
@@ -3123,7 +3614,7 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3123
3614
|
if (l.length !== 1) return e === 0 ? "polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%)" : e === t ? "polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%)" : "polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%)";
|
|
3124
3615
|
}, p = l.length - 1;
|
|
3125
3616
|
return /* @__PURE__ */ Q("div", {
|
|
3126
|
-
className:
|
|
3617
|
+
className: U("w-full", t),
|
|
3127
3618
|
...o,
|
|
3128
3619
|
children: [/* @__PURE__ */ Z("div", {
|
|
3129
3620
|
className: "hidden sm:flex w-full items-stretch",
|
|
@@ -3138,7 +3629,7 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3138
3629
|
clipPath: i,
|
|
3139
3630
|
WebkitClipPath: i
|
|
3140
3631
|
} : void 0,
|
|
3141
|
-
className:
|
|
3632
|
+
className: U("relative flex-1 min-w-0 px-5 py-2 text-xs font-medium text-center", t > 0 && "-ml-2", l.length === 1 && "rounded-md border", r && "bg-primary text-primary-foreground shadow-sm ring-1 ring-primary/40", n && "bg-muted text-muted-foreground", !r && !n && "bg-background text-foreground/70 border border-border/60"),
|
|
3142
3633
|
children: /* @__PURE__ */ Q("span", {
|
|
3143
3634
|
className: "inline-flex items-center gap-1.5 truncate",
|
|
3144
3635
|
style: {
|
|
@@ -3161,7 +3652,7 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3161
3652
|
return /* @__PURE__ */ Z("div", {
|
|
3162
3653
|
role: "listitem",
|
|
3163
3654
|
"aria-current": r ? "step" : void 0,
|
|
3164
|
-
className:
|
|
3655
|
+
className: U("shrink-0 px-3 py-1.5 rounded-full text-xs font-medium border whitespace-nowrap", r && "bg-primary text-primary-foreground border-primary shadow-sm ring-1 ring-primary/40", n && "bg-muted text-muted-foreground border-transparent", !r && !n && "bg-background text-foreground/70 border-border/60"),
|
|
3165
3656
|
children: /* @__PURE__ */ Q("span", {
|
|
3166
3657
|
className: "inline-flex items-center gap-1",
|
|
3167
3658
|
children: [n && /* @__PURE__ */ Z("span", {
|
|
@@ -3173,7 +3664,7 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3173
3664
|
})
|
|
3174
3665
|
})]
|
|
3175
3666
|
});
|
|
3176
|
-
},
|
|
3667
|
+
}, Bn = (e) => {
|
|
3177
3668
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
3178
3669
|
return {
|
|
3179
3670
|
designer: {
|
|
@@ -3183,8 +3674,8 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3183
3674
|
},
|
|
3184
3675
|
rest: i
|
|
3185
3676
|
};
|
|
3186
|
-
},
|
|
3187
|
-
let r =
|
|
3677
|
+
}, Vn = ({ schema: e = {}, className: t, ...n }) => {
|
|
3678
|
+
let r = it(), { designer: i } = Bn(n), a = mt(), o = Array.isArray(e.actions) ? e.actions : Array.isArray(e.properties?.actions) ? e.properties.actions : [], s = r?.objectName || "", c = Array.isArray(e.requiredPermissions) ? e.requiredPermissions : [];
|
|
3188
3679
|
if (c.length > 0 && s && !c.every((e) => a.can(s, e))) return /* @__PURE__ */ Z("div", {
|
|
3189
3680
|
className: t,
|
|
3190
3681
|
...i,
|
|
@@ -3195,7 +3686,7 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3195
3686
|
children: "Insufficient permissions to view quick actions."
|
|
3196
3687
|
})
|
|
3197
3688
|
});
|
|
3198
|
-
let l = e.location || "record_header", { getActionsForLocation: u, executeAction: d } =
|
|
3689
|
+
let l = e.location || "record_header", { getActionsForLocation: u, executeAction: d } = et({
|
|
3199
3690
|
actions: o,
|
|
3200
3691
|
context: {
|
|
3201
3692
|
record: r?.data,
|
|
@@ -3213,7 +3704,7 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3213
3704
|
});
|
|
3214
3705
|
let p = e.align || "end", m = p === "start" ? "justify-start" : p === "center" ? "justify-center" : "justify-end";
|
|
3215
3706
|
return /* @__PURE__ */ Z("div", {
|
|
3216
|
-
className:
|
|
3707
|
+
className: U("flex flex-wrap items-center gap-2", l === "record_header" && !e.inline && "-mt-12 sm:-mt-14 mb-2 relative z-10", m, t),
|
|
3217
3708
|
role: "toolbar",
|
|
3218
3709
|
"aria-label": e.aria?.label || "Quick actions",
|
|
3219
3710
|
...i,
|
|
@@ -3234,7 +3725,7 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3234
3725
|
}, t.name || `qa-${n}`);
|
|
3235
3726
|
})
|
|
3236
3727
|
});
|
|
3237
|
-
},
|
|
3728
|
+
}, Hn = (e) => {
|
|
3238
3729
|
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
3239
3730
|
return {
|
|
3240
3731
|
designer: {
|
|
@@ -3244,18 +3735,143 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3244
3735
|
},
|
|
3245
3736
|
rest: i
|
|
3246
3737
|
};
|
|
3247
|
-
},
|
|
3248
|
-
let { designer: r } =
|
|
3738
|
+
}, Un = ({ schema: e = {}, className: t, ...n }) => {
|
|
3739
|
+
let { designer: r } = Hn(n), i = Array.isArray(e.entries) ? e.entries : Array.isArray(e.properties?.entries) ? e.properties.entries : [], a = e.loading ?? e.properties?.loading ?? !1, o = e.emptyText ?? e.properties?.emptyText;
|
|
3249
3740
|
return /* @__PURE__ */ Z("div", {
|
|
3250
3741
|
className: t,
|
|
3251
3742
|
...r,
|
|
3252
|
-
children: /* @__PURE__ */ Z(
|
|
3743
|
+
children: /* @__PURE__ */ Z(Gt, {
|
|
3253
3744
|
entries: i,
|
|
3254
3745
|
loading: a,
|
|
3255
3746
|
emptyText: o
|
|
3256
3747
|
})
|
|
3257
3748
|
});
|
|
3258
|
-
},
|
|
3749
|
+
}, Wn = (e) => {
|
|
3750
|
+
let { "data-obj-id": t, "data-obj-type": n, style: r, ...i } = e || {};
|
|
3751
|
+
return {
|
|
3752
|
+
designer: {
|
|
3753
|
+
"data-obj-id": t,
|
|
3754
|
+
"data-obj-type": n,
|
|
3755
|
+
style: r
|
|
3756
|
+
},
|
|
3757
|
+
rest: i
|
|
3758
|
+
};
|
|
3759
|
+
}, Gn = (e) => e.replace(/[_-]+/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()).trim(), Kn = (e) => e?.name || e?.title || e?.subject || e?.label || e?.id || "—", qn = ({ schema: e = {}, className: t, ...n }) => {
|
|
3760
|
+
let i = it(), a = ot(), { t: o } = $(), { designer: s } = Wn(n), c = gt().appName, l = Array.isArray(e.entries) ? e.entries : Array.isArray(e.properties?.entries) ? e.properties.entries : [], u = i?.recordId, d = i?.dataSource, [f, p] = r.useState({});
|
|
3761
|
+
return r.useEffect(() => {
|
|
3762
|
+
if (!d?.find || !u || l.length === 0) return;
|
|
3763
|
+
let e = !1;
|
|
3764
|
+
return l.forEach((t) => {
|
|
3765
|
+
let n = t.objectName;
|
|
3766
|
+
p((e) => ({
|
|
3767
|
+
...e,
|
|
3768
|
+
[n]: {
|
|
3769
|
+
loading: !0,
|
|
3770
|
+
total: 0,
|
|
3771
|
+
items: e[n]?.items || []
|
|
3772
|
+
}
|
|
3773
|
+
})), d.find(t.objectName, {
|
|
3774
|
+
$filter: { [t.relationshipField]: u },
|
|
3775
|
+
$top: t.limit ?? 3,
|
|
3776
|
+
$count: !0
|
|
3777
|
+
}).then((t) => {
|
|
3778
|
+
if (e) return;
|
|
3779
|
+
let r = Array.isArray(t) ? t : t?.data || [], i = typeof t?.total == "number" ? t.total : typeof t?.count == "number" ? t.count : r.length;
|
|
3780
|
+
p((e) => ({
|
|
3781
|
+
...e,
|
|
3782
|
+
[n]: {
|
|
3783
|
+
loading: !1,
|
|
3784
|
+
total: i,
|
|
3785
|
+
items: r
|
|
3786
|
+
}
|
|
3787
|
+
}));
|
|
3788
|
+
}).catch((t) => {
|
|
3789
|
+
e || p((e) => ({
|
|
3790
|
+
...e,
|
|
3791
|
+
[n]: {
|
|
3792
|
+
loading: !1,
|
|
3793
|
+
total: 0,
|
|
3794
|
+
items: [],
|
|
3795
|
+
error: String(t?.message || t)
|
|
3796
|
+
}
|
|
3797
|
+
}));
|
|
3798
|
+
});
|
|
3799
|
+
}), () => {
|
|
3800
|
+
e = !0;
|
|
3801
|
+
};
|
|
3802
|
+
}, [
|
|
3803
|
+
d,
|
|
3804
|
+
u,
|
|
3805
|
+
JSON.stringify(l.map((e) => `${e.objectName}:${e.relationshipField}:${e.limit ?? 3}`))
|
|
3806
|
+
]), l.length === 0 ? null : /* @__PURE__ */ Z("div", {
|
|
3807
|
+
className: U("flex flex-col gap-3", e.className, t),
|
|
3808
|
+
...s,
|
|
3809
|
+
children: l.map((e) => {
|
|
3810
|
+
let t = e.objectName, n = f[t] || {
|
|
3811
|
+
loading: !0,
|
|
3812
|
+
total: 0,
|
|
3813
|
+
items: []
|
|
3814
|
+
};
|
|
3815
|
+
return /* @__PURE__ */ Q(_, {
|
|
3816
|
+
className: "overflow-hidden",
|
|
3817
|
+
children: [/* @__PURE__ */ Q(y, {
|
|
3818
|
+
className: "flex flex-row items-center justify-between gap-2 py-3 px-4 space-y-0 border-b",
|
|
3819
|
+
children: [/* @__PURE__ */ Z(b, {
|
|
3820
|
+
className: "text-sm font-semibold tracking-tight truncate",
|
|
3821
|
+
children: e.title || (a?.objectLabel ? a.objectLabel({
|
|
3822
|
+
name: e.objectName,
|
|
3823
|
+
label: Gn(e.objectName)
|
|
3824
|
+
}) : Gn(e.objectName))
|
|
3825
|
+
}), /* @__PURE__ */ Q("div", {
|
|
3826
|
+
className: "flex items-center gap-2 shrink-0",
|
|
3827
|
+
children: [!n.loading && /* @__PURE__ */ Z(h, {
|
|
3828
|
+
variant: "secondary",
|
|
3829
|
+
className: "tabular-nums",
|
|
3830
|
+
children: n.total
|
|
3831
|
+
}), c && u && /* @__PURE__ */ Z(ht, {
|
|
3832
|
+
to: `/apps/${c}/${e.objectName}?filter%5B${e.relationshipField}%5D=${encodeURIComponent(String(u))}`,
|
|
3833
|
+
className: "text-[11px] font-medium text-muted-foreground hover:text-foreground transition-colors",
|
|
3834
|
+
title: o("detail.viewAll", { defaultValue: "View all" }),
|
|
3835
|
+
children: o("detail.viewAll", { defaultValue: "View all" })
|
|
3836
|
+
})]
|
|
3837
|
+
})]
|
|
3838
|
+
}), /* @__PURE__ */ Z(v, {
|
|
3839
|
+
className: "p-0",
|
|
3840
|
+
children: n.loading ? /* @__PURE__ */ Q("div", {
|
|
3841
|
+
className: "space-y-1.5 p-3",
|
|
3842
|
+
children: [
|
|
3843
|
+
/* @__PURE__ */ Z(F, { className: "h-3.5 w-4/5" }),
|
|
3844
|
+
/* @__PURE__ */ Z(F, { className: "h-3.5 w-3/5" }),
|
|
3845
|
+
/* @__PURE__ */ Z(F, { className: "h-3.5 w-2/3" })
|
|
3846
|
+
]
|
|
3847
|
+
}) : n.items.length === 0 ? /* @__PURE__ */ Z("p", {
|
|
3848
|
+
className: "px-4 py-3 text-xs text-muted-foreground",
|
|
3849
|
+
children: o("detail.noRecords")
|
|
3850
|
+
}) : /* @__PURE__ */ Z("ul", {
|
|
3851
|
+
className: "divide-y",
|
|
3852
|
+
children: n.items.map((t) => {
|
|
3853
|
+
let n = t.id || t._id, r = Kn(t), i = n ? `../${e.objectName}/record/${encodeURIComponent(String(n))}` : void 0;
|
|
3854
|
+
return /* @__PURE__ */ Z("li", {
|
|
3855
|
+
className: "px-4 py-2",
|
|
3856
|
+
children: i ? /* @__PURE__ */ Q(ht, {
|
|
3857
|
+
to: i,
|
|
3858
|
+
className: "group flex items-center justify-between gap-2 text-xs hover:text-foreground text-muted-foreground transition-colors",
|
|
3859
|
+
children: [/* @__PURE__ */ Z("span", {
|
|
3860
|
+
className: "truncate",
|
|
3861
|
+
children: r
|
|
3862
|
+
}), /* @__PURE__ */ Z(me, { className: "h-3 w-3 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity" })]
|
|
3863
|
+
}) : /* @__PURE__ */ Z("span", {
|
|
3864
|
+
className: "block truncate text-xs text-muted-foreground",
|
|
3865
|
+
children: r
|
|
3866
|
+
})
|
|
3867
|
+
}, String(n || r));
|
|
3868
|
+
})
|
|
3869
|
+
})
|
|
3870
|
+
})]
|
|
3871
|
+
}, t);
|
|
3872
|
+
})
|
|
3873
|
+
});
|
|
3874
|
+
}, Jn = new Set([
|
|
3259
3875
|
"id",
|
|
3260
3876
|
"_id",
|
|
3261
3877
|
"__v",
|
|
@@ -3270,15 +3886,15 @@ var _n = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3270
3886
|
"owner_id",
|
|
3271
3887
|
"deleted_at",
|
|
3272
3888
|
"is_deleted"
|
|
3273
|
-
]),
|
|
3274
|
-
function
|
|
3889
|
+
]), Yn = 480, Xn = 95;
|
|
3890
|
+
function Zn({ 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 = Jn, onFieldSave: f, onDelete: p, resizable: m = !0, fullPageHref: h }) {
|
|
3275
3891
|
let { t: g } = $(), _ = `objectui.drawerWidth.${a}`, [v, y] = r.useState(() => {
|
|
3276
3892
|
if (typeof window > "u" || !m) return null;
|
|
3277
3893
|
try {
|
|
3278
3894
|
let e = window.localStorage.getItem(_);
|
|
3279
3895
|
if (e) {
|
|
3280
3896
|
let t = parseInt(e, 10);
|
|
3281
|
-
if (Number.isFinite(t) && t >=
|
|
3897
|
+
if (Number.isFinite(t) && t >= Yn) return t;
|
|
3282
3898
|
}
|
|
3283
3899
|
} catch {}
|
|
3284
3900
|
return null;
|
|
@@ -3300,7 +3916,7 @@ function Mn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
|
|
|
3300
3916
|
let n = (e) => {
|
|
3301
3917
|
let t = S.current;
|
|
3302
3918
|
if (!t) return;
|
|
3303
|
-
let n = t.startX - e.clientX, r = typeof window < "u" ? window.innerWidth *
|
|
3919
|
+
let n = t.startX - e.clientX, r = typeof window < "u" ? window.innerWidth * Xn / 100 : 1600, i = Math.min(r, Math.max(Yn, t.startWidth + n));
|
|
3304
3920
|
y(Math.round(i));
|
|
3305
3921
|
}, r = () => {
|
|
3306
3922
|
S.current, S.current = null, window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", r), window.removeEventListener("pointercancel", r);
|
|
@@ -3332,12 +3948,12 @@ function Mn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
|
|
|
3332
3948
|
description: t.description
|
|
3333
3949
|
};
|
|
3334
3950
|
});
|
|
3335
|
-
return /* @__PURE__ */ Z(
|
|
3951
|
+
return /* @__PURE__ */ Z(j, {
|
|
3336
3952
|
open: e,
|
|
3337
3953
|
onOpenChange: (e) => {
|
|
3338
3954
|
e || t();
|
|
3339
3955
|
},
|
|
3340
|
-
children: /* @__PURE__ */ Q(
|
|
3956
|
+
children: /* @__PURE__ */ Q(M, {
|
|
3341
3957
|
side: "right",
|
|
3342
3958
|
className: "w-full overflow-y-auto p-0 sm:!max-w-none",
|
|
3343
3959
|
style: x,
|
|
@@ -3350,13 +3966,13 @@ function Mn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
|
|
|
3350
3966
|
onPointerDown: C,
|
|
3351
3967
|
className: "hidden sm:block absolute left-0 top-0 h-full w-1.5 cursor-col-resize select-none bg-transparent hover:bg-primary/30 active:bg-primary/50 transition-colors z-10"
|
|
3352
3968
|
}),
|
|
3353
|
-
/* @__PURE__ */ Z(
|
|
3969
|
+
/* @__PURE__ */ Z(N, {
|
|
3354
3970
|
className: "sr-only",
|
|
3355
|
-
children: /* @__PURE__ */ Z(
|
|
3971
|
+
children: /* @__PURE__ */ Z(P, { children: n })
|
|
3356
3972
|
}),
|
|
3357
3973
|
/* @__PURE__ */ Z("div", {
|
|
3358
3974
|
className: "px-6 pt-6 pb-6",
|
|
3359
|
-
children: /* @__PURE__ */ Z(
|
|
3975
|
+
children: /* @__PURE__ */ Z(tn, {
|
|
3360
3976
|
dataSource: s,
|
|
3361
3977
|
inlineEdit: !0,
|
|
3362
3978
|
schema: {
|
|
@@ -3399,15 +4015,15 @@ function Mn({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
|
|
|
3399
4015
|
})
|
|
3400
4016
|
});
|
|
3401
4017
|
}
|
|
3402
|
-
function
|
|
4018
|
+
function Qn(e, t) {
|
|
3403
4019
|
if (typeof window > "u") return null;
|
|
3404
4020
|
let n = window.location.pathname, r = `/${e}`, i = n.indexOf(r);
|
|
3405
4021
|
return `${i >= 0 ? n.slice(0, i) : n.replace(/\/$/, "")}/${e}/record/${encodeURIComponent(String(t))}`;
|
|
3406
4022
|
}
|
|
3407
4023
|
//#endregion
|
|
3408
4024
|
//#region src/InlineCreateRelated.tsx
|
|
3409
|
-
var
|
|
3410
|
-
let [l, u] = n.useState(!1), [d, f] = n.useState("create"), [p, m] = n.useState({}), [h, x] = n.useState(""), [S, C] = n.useState(s), [
|
|
4025
|
+
var $n = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, onLinkRecord: a, onSearch: o, existingRecords: s = [], className: c }) => {
|
|
4026
|
+
let [l, u] = n.useState(!1), [d, f] = n.useState("create"), [p, m] = n.useState({}), [h, x] = n.useState(""), [S, C] = n.useState(s), [w, E] = n.useState(!1), [D, O] = n.useState(!1), k = n.useMemo(() => {
|
|
3411
4027
|
if (!h.trim()) return S;
|
|
3412
4028
|
let e = h.toLowerCase();
|
|
3413
4029
|
return S.filter((t) => t.label.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e));
|
|
@@ -3452,7 +4068,7 @@ var Pn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
3452
4068
|
}
|
|
3453
4069
|
}, [a]), P = n.useMemo(() => r.filter((e) => e.required).every((e) => p[e.name]?.toString().trim()), [r, p]);
|
|
3454
4070
|
return l ? /* @__PURE__ */ Q(_, {
|
|
3455
|
-
className:
|
|
4071
|
+
className: U("", c),
|
|
3456
4072
|
children: [/* @__PURE__ */ Z(y, {
|
|
3457
4073
|
className: "pb-3",
|
|
3458
4074
|
children: /* @__PURE__ */ Q(b, {
|
|
@@ -3466,26 +4082,26 @@ var Pn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
3466
4082
|
size: "icon",
|
|
3467
4083
|
className: "h-6 w-6",
|
|
3468
4084
|
onClick: () => u(!1),
|
|
3469
|
-
children: /* @__PURE__ */ Z(
|
|
4085
|
+
children: /* @__PURE__ */ Z(Xe, { className: "h-3.5 w-3.5" })
|
|
3470
4086
|
})]
|
|
3471
4087
|
})
|
|
3472
|
-
}), /* @__PURE__ */ Z(v, { children: /* @__PURE__ */ Q(
|
|
4088
|
+
}), /* @__PURE__ */ Z(v, { children: /* @__PURE__ */ Q(I, {
|
|
3473
4089
|
value: d,
|
|
3474
4090
|
onValueChange: f,
|
|
3475
4091
|
children: [
|
|
3476
|
-
/* @__PURE__ */ Q(
|
|
4092
|
+
/* @__PURE__ */ Q(ee, {
|
|
3477
4093
|
className: "mb-3 w-full",
|
|
3478
|
-
children: [i && /* @__PURE__ */ Q(
|
|
4094
|
+
children: [i && /* @__PURE__ */ Q(R, {
|
|
3479
4095
|
value: "create",
|
|
3480
4096
|
className: "flex-1 gap-1.5",
|
|
3481
|
-
children: [/* @__PURE__ */ Z(
|
|
3482
|
-
}), a && /* @__PURE__ */ Q(
|
|
4097
|
+
children: [/* @__PURE__ */ Z(Be, { className: "h-3.5 w-3.5" }), "Create New"]
|
|
4098
|
+
}), a && /* @__PURE__ */ Q(R, {
|
|
3483
4099
|
value: "link",
|
|
3484
4100
|
className: "flex-1 gap-1.5",
|
|
3485
|
-
children: [/* @__PURE__ */ Z(
|
|
4101
|
+
children: [/* @__PURE__ */ Z(Oe, { className: "h-3.5 w-3.5" }), "Link Existing"]
|
|
3486
4102
|
})]
|
|
3487
4103
|
}),
|
|
3488
|
-
i && /* @__PURE__ */ Q(
|
|
4104
|
+
i && /* @__PURE__ */ Q(L, {
|
|
3489
4105
|
value: "create",
|
|
3490
4106
|
className: "space-y-3 mt-0",
|
|
3491
4107
|
children: [r.map((e) => /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Q("label", {
|
|
@@ -3494,7 +4110,7 @@ var Pn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
3494
4110
|
className: "text-destructive ml-0.5",
|
|
3495
4111
|
children: "*"
|
|
3496
4112
|
})]
|
|
3497
|
-
}), /* @__PURE__ */ Z(
|
|
4113
|
+
}), /* @__PURE__ */ Z(T, {
|
|
3498
4114
|
type: e.type === "number" ? "number" : e.type === "date" ? "date" : "text",
|
|
3499
4115
|
placeholder: e.placeholder || `Enter ${e.label.toLowerCase()}`,
|
|
3500
4116
|
value: p[e.name] || "",
|
|
@@ -3510,18 +4126,18 @@ var Pn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
3510
4126
|
}), /* @__PURE__ */ Q(g, {
|
|
3511
4127
|
size: "sm",
|
|
3512
4128
|
onClick: M,
|
|
3513
|
-
disabled: !P ||
|
|
4129
|
+
disabled: !P || w,
|
|
3514
4130
|
className: "gap-1.5",
|
|
3515
|
-
children: [
|
|
4131
|
+
children: [w && /* @__PURE__ */ Z(Ae, { className: "h-3.5 w-3.5 animate-spin" }), "Create"]
|
|
3516
4132
|
})]
|
|
3517
4133
|
})]
|
|
3518
4134
|
}),
|
|
3519
|
-
a && /* @__PURE__ */ Q(
|
|
4135
|
+
a && /* @__PURE__ */ Q(L, {
|
|
3520
4136
|
value: "link",
|
|
3521
4137
|
className: "space-y-3 mt-0",
|
|
3522
4138
|
children: [/* @__PURE__ */ Q("div", {
|
|
3523
4139
|
className: "relative",
|
|
3524
|
-
children: [/* @__PURE__ */ Z(
|
|
4140
|
+
children: [/* @__PURE__ */ Z(We, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }), /* @__PURE__ */ Z(T, {
|
|
3525
4141
|
placeholder: `Search ${e}…`,
|
|
3526
4142
|
value: h,
|
|
3527
4143
|
onChange: (e) => A(e.target.value),
|
|
@@ -3531,7 +4147,7 @@ var Pn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
3531
4147
|
className: "max-h-48 overflow-y-auto space-y-1",
|
|
3532
4148
|
children: D ? /* @__PURE__ */ Q("div", {
|
|
3533
4149
|
className: "flex items-center justify-center py-4 text-sm text-muted-foreground",
|
|
3534
|
-
children: [/* @__PURE__ */ Z(
|
|
4150
|
+
children: [/* @__PURE__ */ Z(Ae, { className: "h-4 w-4 animate-spin mr-2" }), "Searching…"]
|
|
3535
4151
|
}) : k.length === 0 ? /* @__PURE__ */ Z("p", {
|
|
3536
4152
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
3537
4153
|
children: h ? "No records found" : "Type to search records"
|
|
@@ -3539,7 +4155,7 @@ var Pn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
3539
4155
|
type: "button",
|
|
3540
4156
|
className: "w-full text-left px-3 py-2 rounded-md hover:bg-accent text-sm transition-colors",
|
|
3541
4157
|
onClick: () => N(e.id),
|
|
3542
|
-
disabled:
|
|
4158
|
+
disabled: w,
|
|
3543
4159
|
children: [/* @__PURE__ */ Z("span", {
|
|
3544
4160
|
className: "font-medium",
|
|
3545
4161
|
children: e.label
|
|
@@ -3553,7 +4169,7 @@ var Pn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
3553
4169
|
]
|
|
3554
4170
|
}) })]
|
|
3555
4171
|
}) : /* @__PURE__ */ Q("div", {
|
|
3556
|
-
className:
|
|
4172
|
+
className: U("flex gap-2", c),
|
|
3557
4173
|
children: [i && /* @__PURE__ */ Q(g, {
|
|
3558
4174
|
variant: "outline",
|
|
3559
4175
|
size: "sm",
|
|
@@ -3562,7 +4178,7 @@ var Pn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
3562
4178
|
},
|
|
3563
4179
|
className: "gap-1.5",
|
|
3564
4180
|
children: [
|
|
3565
|
-
/* @__PURE__ */ Z(
|
|
4181
|
+
/* @__PURE__ */ Z(Be, { className: "h-3.5 w-3.5" }),
|
|
3566
4182
|
"New ",
|
|
3567
4183
|
e
|
|
3568
4184
|
]
|
|
@@ -3573,182 +4189,13 @@ var Pn = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
3573
4189
|
f("link"), u(!0);
|
|
3574
4190
|
},
|
|
3575
4191
|
className: "gap-1.5",
|
|
3576
|
-
children: [/* @__PURE__ */ Z(
|
|
3577
|
-
})]
|
|
3578
|
-
});
|
|
3579
|
-
};
|
|
3580
|
-
//#endregion
|
|
3581
|
-
//#region src/RichTextCommentInput.tsx
|
|
3582
|
-
function Fn(e) {
|
|
3583
|
-
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/>");
|
|
3584
|
-
return t = t.replace(/(<li[^>]*>.*?<\/li>(?:<br\/>)?)+/g, (e) => `<ul class="my-1">${e.replace(/<br\/>/g, "")}</ul>`), t;
|
|
3585
|
-
}
|
|
3586
|
-
var In = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], placeholder: a, className: o, disabled: s = !1 }) => {
|
|
3587
|
-
let { t: c } = $(), [l, u] = n.useState(!1), [d, f] = n.useState(!1), [p, m] = n.useState(""), [h, _] = n.useState(0), v = n.useRef(null), y = n.useMemo(() => {
|
|
3588
|
-
if (!p) return i;
|
|
3589
|
-
let e = p.toLowerCase();
|
|
3590
|
-
return i.filter((t) => t.label.toLowerCase().includes(e));
|
|
3591
|
-
}, [p, i]), b = n.useCallback((n, r = "") => {
|
|
3592
|
-
let i = v.current;
|
|
3593
|
-
if (!i) return;
|
|
3594
|
-
let a = i.selectionStart, o = i.selectionEnd, s = e.slice(a, o);
|
|
3595
|
-
t(e.slice(0, a) + n + s + r + e.slice(o)), requestAnimationFrame(() => {
|
|
3596
|
-
i.focus();
|
|
3597
|
-
let e = a + n.length + s.length;
|
|
3598
|
-
i.setSelectionRange(e, e);
|
|
3599
|
-
});
|
|
3600
|
-
}, [e, t]), x = n.useCallback(() => b("**", "**"), [b]), S = n.useCallback(() => b("*", "*"), [b]), C = n.useCallback(() => b("\n- ", ""), [b]), w = n.useCallback(() => b("`", "`"), [b]), T = n.useCallback(() => {
|
|
3601
|
-
b("@", ""), f(!0), m(""), _(0);
|
|
3602
|
-
}, [b]), E = n.useCallback((n) => {
|
|
3603
|
-
let r = v.current;
|
|
3604
|
-
if (!r) return;
|
|
3605
|
-
let i = r.selectionStart, a = e.slice(0, i).lastIndexOf("@");
|
|
3606
|
-
a !== -1 && t(e.slice(0, a) + `@${n.label} ` + e.slice(i)), f(!1), m(""), requestAnimationFrame(() => r.focus());
|
|
3607
|
-
}, [e, t]), D = n.useCallback((e) => {
|
|
3608
|
-
let n = e.target.value;
|
|
3609
|
-
t(n);
|
|
3610
|
-
let r = e.target.selectionStart, i = n.slice(0, r), a = i.lastIndexOf("@");
|
|
3611
|
-
if (a !== -1) {
|
|
3612
|
-
let e = i.slice(a + 1), t = a > 0 ? i[a - 1] : " ";
|
|
3613
|
-
if (/\s/.test(t) && !/\s/.test(e)) {
|
|
3614
|
-
f(!0), m(e), _(0);
|
|
3615
|
-
return;
|
|
3616
|
-
}
|
|
3617
|
-
}
|
|
3618
|
-
f(!1);
|
|
3619
|
-
}, [t]), O = n.useCallback((e) => {
|
|
3620
|
-
if (d && y.length > 0) {
|
|
3621
|
-
if (e.key === "ArrowDown") {
|
|
3622
|
-
e.preventDefault(), _((e) => e < y.length - 1 ? e + 1 : 0);
|
|
3623
|
-
return;
|
|
3624
|
-
}
|
|
3625
|
-
if (e.key === "ArrowUp") {
|
|
3626
|
-
e.preventDefault(), _((e) => e > 0 ? e - 1 : y.length - 1);
|
|
3627
|
-
return;
|
|
3628
|
-
}
|
|
3629
|
-
if (e.key === "Enter" || e.key === "Tab") {
|
|
3630
|
-
e.preventDefault(), E(y[h]);
|
|
3631
|
-
return;
|
|
3632
|
-
}
|
|
3633
|
-
if (e.key === "Escape") {
|
|
3634
|
-
f(!1);
|
|
3635
|
-
return;
|
|
3636
|
-
}
|
|
3637
|
-
}
|
|
3638
|
-
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), r?.());
|
|
3639
|
-
}, [
|
|
3640
|
-
d,
|
|
3641
|
-
y,
|
|
3642
|
-
h,
|
|
3643
|
-
E,
|
|
3644
|
-
r
|
|
3645
|
-
]);
|
|
3646
|
-
return /* @__PURE__ */ Q("div", {
|
|
3647
|
-
className: H("border rounded-md", o),
|
|
3648
|
-
children: [/* @__PURE__ */ Q("div", {
|
|
3649
|
-
className: "flex items-center gap-0.5 px-2 py-1.5 border-b bg-muted/30",
|
|
3650
|
-
children: [
|
|
3651
|
-
/* @__PURE__ */ Z(g, {
|
|
3652
|
-
variant: "ghost",
|
|
3653
|
-
size: "icon",
|
|
3654
|
-
className: "h-7 w-7",
|
|
3655
|
-
onClick: x,
|
|
3656
|
-
disabled: s || l,
|
|
3657
|
-
title: c("detail.bold"),
|
|
3658
|
-
children: /* @__PURE__ */ Z(K, { className: "h-3.5 w-3.5" })
|
|
3659
|
-
}),
|
|
3660
|
-
/* @__PURE__ */ Z(g, {
|
|
3661
|
-
variant: "ghost",
|
|
3662
|
-
size: "icon",
|
|
3663
|
-
className: "h-7 w-7",
|
|
3664
|
-
onClick: S,
|
|
3665
|
-
disabled: s || l,
|
|
3666
|
-
title: c("detail.italic"),
|
|
3667
|
-
children: /* @__PURE__ */ Z(we, { className: "h-3.5 w-3.5" })
|
|
3668
|
-
}),
|
|
3669
|
-
/* @__PURE__ */ Z(g, {
|
|
3670
|
-
variant: "ghost",
|
|
3671
|
-
size: "icon",
|
|
3672
|
-
className: "h-7 w-7",
|
|
3673
|
-
onClick: C,
|
|
3674
|
-
disabled: s || l,
|
|
3675
|
-
title: c("detail.listFormat"),
|
|
3676
|
-
children: /* @__PURE__ */ Z(Ee, { className: "h-3.5 w-3.5" })
|
|
3677
|
-
}),
|
|
3678
|
-
/* @__PURE__ */ Z(g, {
|
|
3679
|
-
variant: "ghost",
|
|
3680
|
-
size: "icon",
|
|
3681
|
-
className: "h-7 w-7",
|
|
3682
|
-
onClick: w,
|
|
3683
|
-
disabled: s || l,
|
|
3684
|
-
title: c("detail.inlineCode"),
|
|
3685
|
-
children: /* @__PURE__ */ Z(me, { className: "h-3.5 w-3.5" })
|
|
3686
|
-
}),
|
|
3687
|
-
/* @__PURE__ */ Z(g, {
|
|
3688
|
-
variant: "ghost",
|
|
3689
|
-
size: "icon",
|
|
3690
|
-
className: "h-7 w-7",
|
|
3691
|
-
onClick: T,
|
|
3692
|
-
disabled: s || l,
|
|
3693
|
-
title: c("detail.mentionSomeone"),
|
|
3694
|
-
children: /* @__PURE__ */ Z(G, { className: "h-3.5 w-3.5" })
|
|
3695
|
-
}),
|
|
3696
|
-
/* @__PURE__ */ Z("div", { className: "flex-1" }),
|
|
3697
|
-
/* @__PURE__ */ Z(g, {
|
|
3698
|
-
variant: "ghost",
|
|
3699
|
-
size: "icon",
|
|
3700
|
-
className: "h-7 w-7",
|
|
3701
|
-
onClick: () => u(!l),
|
|
3702
|
-
title: c(l ? "detail.edit" : "detail.preview"),
|
|
3703
|
-
children: Z(l ? J : ve, { className: "h-3.5 w-3.5" })
|
|
3704
|
-
}),
|
|
3705
|
-
r && /* @__PURE__ */ Z(g, {
|
|
3706
|
-
variant: "ghost",
|
|
3707
|
-
size: "icon",
|
|
3708
|
-
className: "h-7 w-7",
|
|
3709
|
-
onClick: r,
|
|
3710
|
-
disabled: s || !e.trim(),
|
|
3711
|
-
title: c("detail.submitComment"),
|
|
3712
|
-
children: /* @__PURE__ */ Z(He, { className: "h-3.5 w-3.5" })
|
|
3713
|
-
})
|
|
3714
|
-
]
|
|
3715
|
-
}), /* @__PURE__ */ Z("div", {
|
|
3716
|
-
className: "relative",
|
|
3717
|
-
children: l ? /* @__PURE__ */ Z("div", {
|
|
3718
|
-
className: "min-h-[80px] px-3 py-2 text-sm prose prose-sm max-w-none",
|
|
3719
|
-
dangerouslySetInnerHTML: { __html: Fn(e) }
|
|
3720
|
-
}) : /* @__PURE__ */ Q(lt, { children: [/* @__PURE__ */ Z("textarea", {
|
|
3721
|
-
ref: v,
|
|
3722
|
-
className: "w-full min-h-[80px] px-3 py-2 text-sm bg-transparent resize-none focus:outline-none placeholder:text-muted-foreground",
|
|
3723
|
-
placeholder: a ?? c("detail.writeComment"),
|
|
3724
|
-
value: e,
|
|
3725
|
-
onChange: D,
|
|
3726
|
-
onKeyDown: O,
|
|
3727
|
-
disabled: s
|
|
3728
|
-
}), d && y.length > 0 && /* @__PURE__ */ Z("div", {
|
|
3729
|
-
className: "absolute left-2 bottom-full mb-1 w-56 bg-popover border rounded-md shadow-md z-50 max-h-40 overflow-y-auto",
|
|
3730
|
-
children: y.map((e, t) => /* @__PURE__ */ Q("button", {
|
|
3731
|
-
type: "button",
|
|
3732
|
-
className: H("w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-accent transition-colors", t === h && "bg-accent"),
|
|
3733
|
-
onMouseDown: (t) => {
|
|
3734
|
-
t.preventDefault(), E(e);
|
|
3735
|
-
},
|
|
3736
|
-
children: [e.avatarUrl ? /* @__PURE__ */ Z("img", {
|
|
3737
|
-
src: e.avatarUrl,
|
|
3738
|
-
alt: e.label,
|
|
3739
|
-
className: "h-5 w-5 rounded-full object-cover"
|
|
3740
|
-
}) : /* @__PURE__ */ Z("div", {
|
|
3741
|
-
className: "h-5 w-5 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium",
|
|
3742
|
-
children: e.label.charAt(0).toUpperCase()
|
|
3743
|
-
}), /* @__PURE__ */ Z("span", { children: e.label })]
|
|
3744
|
-
}, e.id))
|
|
3745
|
-
})] })
|
|
4192
|
+
children: [/* @__PURE__ */ Z(Oe, { className: "h-3.5 w-3.5" }), "Link Existing"]
|
|
3746
4193
|
})]
|
|
3747
4194
|
});
|
|
3748
4195
|
};
|
|
3749
4196
|
//#endregion
|
|
3750
4197
|
//#region src/DiffView.tsx
|
|
3751
|
-
function
|
|
4198
|
+
function er(e, t) {
|
|
3752
4199
|
if (e == null) return ["(empty)"];
|
|
3753
4200
|
switch (t) {
|
|
3754
4201
|
case "json": try {
|
|
@@ -3767,7 +4214,7 @@ function Ln(e, t) {
|
|
|
3767
4214
|
default: return String(e).split("\n");
|
|
3768
4215
|
}
|
|
3769
4216
|
}
|
|
3770
|
-
function
|
|
4217
|
+
function tr(e, t) {
|
|
3771
4218
|
let n = [], r = Math.max(e.length, t.length);
|
|
3772
4219
|
for (let i = 0; i < r; i++) {
|
|
3773
4220
|
let r = i < e.length ? e[i] : void 0, a = i < t.length ? t[i] : void 0;
|
|
@@ -3784,16 +4231,16 @@ function Rn(e, t) {
|
|
|
3784
4231
|
}
|
|
3785
4232
|
return n;
|
|
3786
4233
|
}
|
|
3787
|
-
var
|
|
4234
|
+
var nr = {
|
|
3788
4235
|
added: "bg-green-50 text-green-800 dark:bg-green-950/30 dark:text-green-300",
|
|
3789
4236
|
removed: "bg-red-50 text-red-800 dark:bg-red-950/30 dark:text-red-300",
|
|
3790
4237
|
unchanged: "text-muted-foreground"
|
|
3791
|
-
},
|
|
4238
|
+
}, rr = {
|
|
3792
4239
|
added: "+",
|
|
3793
4240
|
removed: "-",
|
|
3794
4241
|
unchanged: " "
|
|
3795
|
-
},
|
|
3796
|
-
let { t: s } = $(), [c, l] = n.useState(a), u = n.useMemo(() =>
|
|
4242
|
+
}, ir = ({ oldValue: e, newValue: t, fieldName: r, fieldType: i = "string", mode: a = "unified", className: o }) => {
|
|
4243
|
+
let { t: s } = $(), [c, l] = n.useState(a), u = n.useMemo(() => er(e, i), [e, i]), d = n.useMemo(() => er(t, i), [t, i]), f = n.useMemo(() => tr(u, d), [u, d]), p = f.some((e) => e.type !== "unchanged"), m = n.useMemo(() => {
|
|
3797
4244
|
if (c !== "side-by-side") return [];
|
|
3798
4245
|
let e = [], t = 0;
|
|
3799
4246
|
for (; t < f.length;) {
|
|
@@ -3819,7 +4266,7 @@ var zn = {
|
|
|
3819
4266
|
return e;
|
|
3820
4267
|
}, [c, f]);
|
|
3821
4268
|
return /* @__PURE__ */ Q(_, {
|
|
3822
|
-
className:
|
|
4269
|
+
className: U("overflow-hidden", o),
|
|
3823
4270
|
children: [/* @__PURE__ */ Z(y, {
|
|
3824
4271
|
className: "pb-2",
|
|
3825
4272
|
children: /* @__PURE__ */ Q(b, {
|
|
@@ -3835,14 +4282,14 @@ var zn = {
|
|
|
3835
4282
|
className: "h-7 w-7",
|
|
3836
4283
|
onClick: () => l("unified"),
|
|
3837
4284
|
title: s("detail.unifiedDiff"),
|
|
3838
|
-
children: /* @__PURE__ */ Z(
|
|
4285
|
+
children: /* @__PURE__ */ Z(Ue, { className: "h-3.5 w-3.5" })
|
|
3839
4286
|
}), /* @__PURE__ */ Z(g, {
|
|
3840
4287
|
variant: c === "side-by-side" ? "secondary" : "ghost",
|
|
3841
4288
|
size: "icon",
|
|
3842
4289
|
className: "h-7 w-7",
|
|
3843
4290
|
onClick: () => l("side-by-side"),
|
|
3844
4291
|
title: s("detail.sideBySideDiff"),
|
|
3845
|
-
children: /* @__PURE__ */ Z(
|
|
4292
|
+
children: /* @__PURE__ */ Z(_e, { className: "h-3.5 w-3.5" })
|
|
3846
4293
|
})]
|
|
3847
4294
|
})]
|
|
3848
4295
|
})
|
|
@@ -3851,10 +4298,10 @@ var zn = {
|
|
|
3851
4298
|
children: p ? c === "unified" ? /* @__PURE__ */ Z("div", {
|
|
3852
4299
|
className: "font-mono text-xs overflow-x-auto",
|
|
3853
4300
|
children: f.map((e, t) => /* @__PURE__ */ Q("div", {
|
|
3854
|
-
className:
|
|
4301
|
+
className: U("px-4 py-0.5 whitespace-pre-wrap border-l-2", nr[e.type], e.type === "added" && "border-l-green-500", e.type === "removed" && "border-l-red-500", e.type === "unchanged" && "border-l-transparent"),
|
|
3855
4302
|
children: [/* @__PURE__ */ Z("span", {
|
|
3856
4303
|
className: "select-none mr-2 inline-block w-3 text-center opacity-60",
|
|
3857
|
-
children:
|
|
4304
|
+
children: rr[e.type]
|
|
3858
4305
|
}), e.value]
|
|
3859
4306
|
}, t))
|
|
3860
4307
|
}) : /* @__PURE__ */ Z("div", {
|
|
@@ -3871,10 +4318,10 @@ var zn = {
|
|
|
3871
4318
|
children: s("detail.currentVersion")
|
|
3872
4319
|
}),
|
|
3873
4320
|
m.map((e, t) => /* @__PURE__ */ Q(n.Fragment, { children: [/* @__PURE__ */ Z("div", {
|
|
3874
|
-
className:
|
|
4321
|
+
className: U("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ? nr[e.left.type] : "bg-muted/20"),
|
|
3875
4322
|
children: e.left?.value ?? ""
|
|
3876
4323
|
}), /* @__PURE__ */ Z("div", {
|
|
3877
|
-
className:
|
|
4324
|
+
className: U("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ? nr[e.right.type] : "bg-muted/20"),
|
|
3878
4325
|
children: e.right?.value ?? ""
|
|
3879
4326
|
})] }, t))
|
|
3880
4327
|
]
|
|
@@ -3885,7 +4332,7 @@ var zn = {
|
|
|
3885
4332
|
})
|
|
3886
4333
|
})]
|
|
3887
4334
|
});
|
|
3888
|
-
},
|
|
4335
|
+
}, ar = ({ currentIndex: e, totalRecords: t, recordIds: r, onNavigate: i, onSearch: a, className: o }) => {
|
|
3889
4336
|
let { t: s } = $(), [c, l] = n.useState(""), [u, d] = n.useState(!1), f = n.useRef(null), p = e > 0, m = e > 0, h = e < t - 1, _ = e < t - 1, v = n.useCallback(() => {
|
|
3890
4337
|
p && i(r[0]);
|
|
3891
4338
|
}, [
|
|
@@ -3953,7 +4400,7 @@ var zn = {
|
|
|
3953
4400
|
i,
|
|
3954
4401
|
a
|
|
3955
4402
|
]), /* @__PURE__ */ Q("div", {
|
|
3956
|
-
className:
|
|
4403
|
+
className: U("flex items-center gap-1.5", o),
|
|
3957
4404
|
children: [
|
|
3958
4405
|
/* @__PURE__ */ Z(g, {
|
|
3959
4406
|
variant: "outline",
|
|
@@ -3962,7 +4409,7 @@ var zn = {
|
|
|
3962
4409
|
disabled: !p,
|
|
3963
4410
|
onClick: v,
|
|
3964
4411
|
title: s("detail.firstRecord"),
|
|
3965
|
-
children: /* @__PURE__ */ Z(
|
|
4412
|
+
children: /* @__PURE__ */ Z(he, { className: "h-4 w-4" })
|
|
3966
4413
|
}),
|
|
3967
4414
|
/* @__PURE__ */ Z(g, {
|
|
3968
4415
|
variant: "outline",
|
|
@@ -3971,7 +4418,7 @@ var zn = {
|
|
|
3971
4418
|
disabled: !m,
|
|
3972
4419
|
onClick: y,
|
|
3973
4420
|
title: s("detail.previousRecordKey"),
|
|
3974
|
-
children: /* @__PURE__ */ Z(
|
|
4421
|
+
children: /* @__PURE__ */ Z(pe, { className: "h-4 w-4" })
|
|
3975
4422
|
}),
|
|
3976
4423
|
/* @__PURE__ */ Z("span", {
|
|
3977
4424
|
className: "text-xs text-muted-foreground whitespace-nowrap px-1.5 tabular-nums",
|
|
@@ -3987,7 +4434,7 @@ var zn = {
|
|
|
3987
4434
|
disabled: !h,
|
|
3988
4435
|
onClick: b,
|
|
3989
4436
|
title: s("detail.nextRecordKey"),
|
|
3990
|
-
children: /* @__PURE__ */ Z(
|
|
4437
|
+
children: /* @__PURE__ */ Z(me, { className: "h-4 w-4" })
|
|
3991
4438
|
}),
|
|
3992
4439
|
/* @__PURE__ */ Z(g, {
|
|
3993
4440
|
variant: "outline",
|
|
@@ -3996,18 +4443,18 @@ var zn = {
|
|
|
3996
4443
|
disabled: !_,
|
|
3997
4444
|
onClick: x,
|
|
3998
4445
|
title: s("detail.lastRecord"),
|
|
3999
|
-
children: /* @__PURE__ */ Z(
|
|
4446
|
+
children: /* @__PURE__ */ Z(ge, { className: "h-4 w-4" })
|
|
4000
4447
|
}),
|
|
4001
|
-
a && /* @__PURE__ */ Q(
|
|
4448
|
+
a && /* @__PURE__ */ Q(ft, { children: [/* @__PURE__ */ Z(g, {
|
|
4002
4449
|
variant: u ? "secondary" : "ghost",
|
|
4003
4450
|
size: "icon",
|
|
4004
4451
|
className: "h-8 w-8",
|
|
4005
4452
|
onClick: C,
|
|
4006
4453
|
title: s("detail.searchWhileNavigating"),
|
|
4007
|
-
children: /* @__PURE__ */ Z(
|
|
4454
|
+
children: /* @__PURE__ */ Z(We, { className: "h-4 w-4" })
|
|
4008
4455
|
}), u && /* @__PURE__ */ Z("div", {
|
|
4009
4456
|
className: "relative",
|
|
4010
|
-
children: /* @__PURE__ */ Z(
|
|
4457
|
+
children: /* @__PURE__ */ Z(T, {
|
|
4011
4458
|
ref: f,
|
|
4012
4459
|
type: "text",
|
|
4013
4460
|
placeholder: s("detail.searchRecords"),
|
|
@@ -4018,18 +4465,18 @@ var zn = {
|
|
|
4018
4465
|
})] })
|
|
4019
4466
|
]
|
|
4020
4467
|
});
|
|
4021
|
-
},
|
|
4468
|
+
}, or = 28, sr = [
|
|
4022
4469
|
"fill-primary stroke-primary",
|
|
4023
4470
|
"fill-blue-500 stroke-blue-500",
|
|
4024
4471
|
"fill-emerald-500 stroke-emerald-500",
|
|
4025
4472
|
"fill-amber-500 stroke-amber-500"
|
|
4026
|
-
],
|
|
4473
|
+
], cr = [
|
|
4027
4474
|
"fill-primary-foreground",
|
|
4028
4475
|
"fill-white",
|
|
4029
4476
|
"fill-white",
|
|
4030
4477
|
"fill-white"
|
|
4031
4478
|
];
|
|
4032
|
-
function
|
|
4479
|
+
function lr(e, t, n, r, i) {
|
|
4033
4480
|
let a = [], o = [], s = /* @__PURE__ */ new Set(), c = r / 2, l = i / 2;
|
|
4034
4481
|
a.push({
|
|
4035
4482
|
id: e.id,
|
|
@@ -4093,10 +4540,10 @@ function Kn(e, t, n, r, i) {
|
|
|
4093
4540
|
edges: o
|
|
4094
4541
|
};
|
|
4095
4542
|
}
|
|
4096
|
-
function
|
|
4543
|
+
function ur(e, t = 6) {
|
|
4097
4544
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
4098
4545
|
}
|
|
4099
|
-
var
|
|
4546
|
+
var dr = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, className: a }) => {
|
|
4100
4547
|
let o = n.useRef(null), [s, c] = n.useState({
|
|
4101
4548
|
width: 500,
|
|
4102
4549
|
height: 400
|
|
@@ -4117,20 +4564,20 @@ var Jn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
|
|
|
4117
4564
|
});
|
|
4118
4565
|
return n.observe(t), () => n.disconnect();
|
|
4119
4566
|
}, []);
|
|
4120
|
-
let { nodes: d, edges: f } = n.useMemo(() =>
|
|
4567
|
+
let { nodes: d, edges: f } = n.useMemo(() => lr(e, t, r, s.width, s.height), [
|
|
4121
4568
|
e,
|
|
4122
4569
|
t,
|
|
4123
4570
|
r,
|
|
4124
4571
|
s
|
|
4125
4572
|
]);
|
|
4126
4573
|
return /* @__PURE__ */ Q(_, {
|
|
4127
|
-
className:
|
|
4574
|
+
className: U("overflow-hidden", a),
|
|
4128
4575
|
children: [/* @__PURE__ */ Z(y, {
|
|
4129
4576
|
className: "pb-2",
|
|
4130
4577
|
children: /* @__PURE__ */ Q(b, {
|
|
4131
4578
|
className: "flex items-center gap-2 text-base",
|
|
4132
4579
|
children: [
|
|
4133
|
-
/* @__PURE__ */ Z(
|
|
4580
|
+
/* @__PURE__ */ Z(Pe, { className: "h-4 w-4" }),
|
|
4134
4581
|
"Relationships",
|
|
4135
4582
|
/* @__PURE__ */ Q("span", {
|
|
4136
4583
|
className: "text-sm font-normal text-muted-foreground",
|
|
@@ -4159,9 +4606,9 @@ var Jn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
|
|
|
4159
4606
|
strokeWidth: 1.5,
|
|
4160
4607
|
strokeOpacity: .5
|
|
4161
4608
|
}, `edge-${t}`)), d.map((e) => {
|
|
4162
|
-
let t = l === e.id, n =
|
|
4609
|
+
let t = l === e.id, n = sr[Math.min(e.level, sr.length - 1)], r = cr[Math.min(e.level, cr.length - 1)], a = e.level === 0 ? or + 6 : or;
|
|
4163
4610
|
return /* @__PURE__ */ Q("g", {
|
|
4164
|
-
className:
|
|
4611
|
+
className: U("cursor-pointer transition-transform", i && "hover:opacity-80"),
|
|
4165
4612
|
onClick: () => i?.(e.id),
|
|
4166
4613
|
onMouseEnter: () => u(e.id),
|
|
4167
4614
|
onMouseLeave: () => u(null),
|
|
@@ -4180,8 +4627,8 @@ var Jn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
|
|
|
4180
4627
|
y: e.y,
|
|
4181
4628
|
textAnchor: "middle",
|
|
4182
4629
|
dominantBaseline: "central",
|
|
4183
|
-
className:
|
|
4184
|
-
children:
|
|
4630
|
+
className: U("text-[10px] font-medium pointer-events-none", r),
|
|
4631
|
+
children: ur(e.label)
|
|
4185
4632
|
}),
|
|
4186
4633
|
e.type && /* @__PURE__ */ Z("text", {
|
|
4187
4634
|
x: e.x,
|
|
@@ -4190,7 +4637,7 @@ var Jn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
|
|
|
4190
4637
|
className: "fill-muted-foreground text-[9px] pointer-events-none",
|
|
4191
4638
|
children: e.type
|
|
4192
4639
|
}),
|
|
4193
|
-
t && /* @__PURE__ */ Q(
|
|
4640
|
+
t && /* @__PURE__ */ Q(ft, { children: [/* @__PURE__ */ Z("rect", {
|
|
4194
4641
|
x: e.x - 50,
|
|
4195
4642
|
y: e.y - a - 28,
|
|
4196
4643
|
width: 100,
|
|
@@ -4214,101 +4661,8 @@ var Jn = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
|
|
|
4214
4661
|
});
|
|
4215
4662
|
};
|
|
4216
4663
|
//#endregion
|
|
4217
|
-
//#region src/CommentAttachment.tsx
|
|
4218
|
-
function Yn(e) {
|
|
4219
|
-
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
4220
|
-
}
|
|
4221
|
-
function Xn(e) {
|
|
4222
|
-
return e.startsWith("image/");
|
|
4223
|
-
}
|
|
4224
|
-
function Zn(e) {
|
|
4225
|
-
return Xn(e) ? Ce : e.includes("pdf") || e.includes("document") || e.includes("text") ? xe : e.includes("zip") || e.includes("archive") || e.includes("compressed") ? Y : be;
|
|
4226
|
-
}
|
|
4227
|
-
var Qn = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a = !1 }) => {
|
|
4228
|
-
let { t: o } = $(), [s, c] = n.useState(!1), l = n.useRef(null), u = n.useCallback((e) => {
|
|
4229
|
-
e.preventDefault(), e.stopPropagation(), c(!0);
|
|
4230
|
-
}, []), d = n.useCallback((e) => {
|
|
4231
|
-
e.preventDefault(), e.stopPropagation(), c(!1);
|
|
4232
|
-
}, []), f = n.useCallback((e) => {
|
|
4233
|
-
e.preventDefault(), e.stopPropagation(), c(!1), t && e.dataTransfer.files.length > 0 && t(e.dataTransfer.files);
|
|
4234
|
-
}, [t]), p = n.useCallback((e) => {
|
|
4235
|
-
t && e.target.files && e.target.files.length > 0 && (t(e.target.files), e.target.value = "");
|
|
4236
|
-
}, [t]);
|
|
4237
|
-
return /* @__PURE__ */ Q("div", {
|
|
4238
|
-
className: H("space-y-2", i),
|
|
4239
|
-
children: [t && !a && /* @__PURE__ */ Q("div", {
|
|
4240
|
-
className: H("border-2 border-dashed rounded-md px-4 py-3 text-center transition-colors cursor-pointer", s ? "border-primary bg-primary/5" : "border-muted-foreground/25 hover:border-muted-foreground/40"),
|
|
4241
|
-
onDragOver: u,
|
|
4242
|
-
onDragLeave: d,
|
|
4243
|
-
onDrop: f,
|
|
4244
|
-
onClick: () => l.current?.click(),
|
|
4245
|
-
role: "button",
|
|
4246
|
-
tabIndex: 0,
|
|
4247
|
-
onKeyDown: (e) => {
|
|
4248
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), l.current?.click());
|
|
4249
|
-
},
|
|
4250
|
-
children: [
|
|
4251
|
-
/* @__PURE__ */ Z(Ke, { className: "h-5 w-5 mx-auto text-muted-foreground mb-1" }),
|
|
4252
|
-
/* @__PURE__ */ Z("p", {
|
|
4253
|
-
className: "text-xs text-muted-foreground",
|
|
4254
|
-
children: o("detail.dropFilesToUpload")
|
|
4255
|
-
}),
|
|
4256
|
-
/* @__PURE__ */ Z("input", {
|
|
4257
|
-
ref: l,
|
|
4258
|
-
type: "file",
|
|
4259
|
-
multiple: !0,
|
|
4260
|
-
className: "hidden",
|
|
4261
|
-
onChange: p
|
|
4262
|
-
})
|
|
4263
|
-
]
|
|
4264
|
-
}), e.length > 0 && /* @__PURE__ */ Q("div", {
|
|
4265
|
-
className: "space-y-1.5",
|
|
4266
|
-
children: [/* @__PURE__ */ Q("div", {
|
|
4267
|
-
className: "flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
4268
|
-
children: [/* @__PURE__ */ Z(Pe, { className: "h-3 w-3" }), /* @__PURE__ */ Z("span", { children: e.length === 1 ? o("detail.attachmentCount", { count: e.length }) : o("detail.attachmentCountPlural", { count: e.length }) })]
|
|
4269
|
-
}), /* @__PURE__ */ Z("div", {
|
|
4270
|
-
className: "grid grid-cols-1 sm:grid-cols-2 gap-2",
|
|
4271
|
-
children: e.map((e) => {
|
|
4272
|
-
let t = Xn(e.type), n = Zn(e.type);
|
|
4273
|
-
return /* @__PURE__ */ Q("div", {
|
|
4274
|
-
className: "flex items-center gap-2 rounded-md border px-2.5 py-2 bg-muted/30 group",
|
|
4275
|
-
children: [
|
|
4276
|
-
t && (e.thumbnailUrl || e.url) ? /* @__PURE__ */ Z("img", {
|
|
4277
|
-
src: e.thumbnailUrl || e.url,
|
|
4278
|
-
alt: e.name,
|
|
4279
|
-
className: "h-10 w-10 rounded object-cover shrink-0"
|
|
4280
|
-
}) : /* @__PURE__ */ Z("div", {
|
|
4281
|
-
className: "h-10 w-10 rounded bg-muted flex items-center justify-center shrink-0",
|
|
4282
|
-
children: /* @__PURE__ */ Z(n, { className: "h-5 w-5 text-muted-foreground" })
|
|
4283
|
-
}),
|
|
4284
|
-
/* @__PURE__ */ Q("div", {
|
|
4285
|
-
className: "flex-1 min-w-0",
|
|
4286
|
-
children: [/* @__PURE__ */ Z("p", {
|
|
4287
|
-
className: "text-xs font-medium truncate",
|
|
4288
|
-
children: e.name
|
|
4289
|
-
}), /* @__PURE__ */ Z("p", {
|
|
4290
|
-
className: "text-[10px] text-muted-foreground",
|
|
4291
|
-
children: Yn(e.size)
|
|
4292
|
-
})]
|
|
4293
|
-
}),
|
|
4294
|
-
r && !a && /* @__PURE__ */ Z(g, {
|
|
4295
|
-
variant: "ghost",
|
|
4296
|
-
size: "icon",
|
|
4297
|
-
className: "h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
4298
|
-
onClick: () => r(e.id),
|
|
4299
|
-
title: o("detail.removeAttachment"),
|
|
4300
|
-
children: /* @__PURE__ */ Z(qe, { className: "h-3.5 w-3.5" })
|
|
4301
|
-
})
|
|
4302
|
-
]
|
|
4303
|
-
}, e.id);
|
|
4304
|
-
})
|
|
4305
|
-
})]
|
|
4306
|
-
})]
|
|
4307
|
-
});
|
|
4308
|
-
};
|
|
4309
|
-
//#endregion
|
|
4310
4664
|
//#region src/PointInTimeRestore.tsx
|
|
4311
|
-
function
|
|
4665
|
+
function fr(e) {
|
|
4312
4666
|
try {
|
|
4313
4667
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
4314
4668
|
if (r < 1) return "just now";
|
|
@@ -4319,7 +4673,7 @@ function $n(e) {
|
|
|
4319
4673
|
return e;
|
|
4320
4674
|
}
|
|
4321
4675
|
}
|
|
4322
|
-
var
|
|
4676
|
+
var pr = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
4323
4677
|
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 () => {
|
|
4324
4678
|
if (!(!d || !r)) {
|
|
4325
4679
|
if (!s) {
|
|
@@ -4342,13 +4696,13 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4342
4696
|
c(!1);
|
|
4343
4697
|
}, []);
|
|
4344
4698
|
return /* @__PURE__ */ Q(_, {
|
|
4345
|
-
className:
|
|
4699
|
+
className: U("", i),
|
|
4346
4700
|
children: [/* @__PURE__ */ Z(y, {
|
|
4347
4701
|
className: "pb-3",
|
|
4348
4702
|
children: /* @__PURE__ */ Q(b, {
|
|
4349
4703
|
className: "flex items-center gap-2 text-base",
|
|
4350
4704
|
children: [
|
|
4351
|
-
/* @__PURE__ */ Z(
|
|
4705
|
+
/* @__PURE__ */ Z(we, { className: "h-4 w-4" }),
|
|
4352
4706
|
"Revision History",
|
|
4353
4707
|
/* @__PURE__ */ Q("span", {
|
|
4354
4708
|
className: "text-sm font-normal text-muted-foreground",
|
|
@@ -4375,13 +4729,13 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4375
4729
|
let t = e.id === a;
|
|
4376
4730
|
return /* @__PURE__ */ Q("button", {
|
|
4377
4731
|
type: "button",
|
|
4378
|
-
className:
|
|
4732
|
+
className: U("w-full text-left flex items-start gap-3 py-2 px-2 rounded-md transition-colors relative", t ? "bg-accent" : "hover:bg-accent/50"),
|
|
4379
4733
|
onClick: () => {
|
|
4380
4734
|
o(e.id), c(!1);
|
|
4381
4735
|
},
|
|
4382
4736
|
children: [/* @__PURE__ */ Z("div", {
|
|
4383
|
-
className:
|
|
4384
|
-
children: t && /* @__PURE__ */ Z(
|
|
4737
|
+
className: U("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"),
|
|
4738
|
+
children: t && /* @__PURE__ */ Z(me, { className: "h-3 w-3 text-primary-foreground" })
|
|
4385
4739
|
}), /* @__PURE__ */ Q("div", {
|
|
4386
4740
|
className: "flex-1 min-w-0",
|
|
4387
4741
|
children: [/* @__PURE__ */ Q("div", {
|
|
@@ -4391,7 +4745,7 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4391
4745
|
children: e.user
|
|
4392
4746
|
}), /* @__PURE__ */ Z("span", {
|
|
4393
4747
|
className: "text-xs text-muted-foreground",
|
|
4394
|
-
children:
|
|
4748
|
+
children: fr(e.timestamp)
|
|
4395
4749
|
})]
|
|
4396
4750
|
}), /* @__PURE__ */ Q("p", {
|
|
4397
4751
|
className: "text-xs text-muted-foreground mt-0.5",
|
|
@@ -4413,7 +4767,7 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4413
4767
|
children: [
|
|
4414
4768
|
/* @__PURE__ */ Q("div", {
|
|
4415
4769
|
className: "flex items-center gap-2 text-sm font-medium",
|
|
4416
|
-
children: [/* @__PURE__ */ Z(
|
|
4770
|
+
children: [/* @__PURE__ */ Z(X, { className: "h-4 w-4 text-muted-foreground" }), "Revision Preview"]
|
|
4417
4771
|
}),
|
|
4418
4772
|
/* @__PURE__ */ Z("div", {
|
|
4419
4773
|
className: "space-y-2",
|
|
@@ -4429,7 +4783,7 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4429
4783
|
className: "line-through text-red-600 dark:text-red-400 truncate max-w-[120px]",
|
|
4430
4784
|
children: e.oldValue == null ? "(empty)" : String(e.oldValue)
|
|
4431
4785
|
}),
|
|
4432
|
-
/* @__PURE__ */ Z(
|
|
4786
|
+
/* @__PURE__ */ Z(me, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
|
|
4433
4787
|
/* @__PURE__ */ Z("span", {
|
|
4434
4788
|
className: "text-green-600 dark:text-green-400 truncate max-w-[120px]",
|
|
4435
4789
|
children: e.newValue == null ? "(empty)" : String(e.newValue)
|
|
@@ -4459,12 +4813,12 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4459
4813
|
}),
|
|
4460
4814
|
r && /* @__PURE__ */ Z("div", {
|
|
4461
4815
|
className: "pt-1 space-y-2",
|
|
4462
|
-
children: s ? /* @__PURE__ */ Q(
|
|
4816
|
+
children: s ? /* @__PURE__ */ Q(ft, { children: [/* @__PURE__ */ Q("p", {
|
|
4463
4817
|
className: "text-xs text-amber-600 dark:text-amber-400",
|
|
4464
4818
|
children: [
|
|
4465
4819
|
"This will restore the record to its state at",
|
|
4466
4820
|
" ",
|
|
4467
|
-
|
|
4821
|
+
fr(d.timestamp),
|
|
4468
4822
|
". Continue?"
|
|
4469
4823
|
]
|
|
4470
4824
|
}), /* @__PURE__ */ Q("div", {
|
|
@@ -4475,7 +4829,7 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4475
4829
|
className: "gap-1.5 flex-1",
|
|
4476
4830
|
onClick: f,
|
|
4477
4831
|
disabled: l,
|
|
4478
|
-
children: [/* @__PURE__ */ Z(
|
|
4832
|
+
children: [/* @__PURE__ */ Z(He, { className: "h-3.5 w-3.5" }), l ? "Restoring…" : "Confirm Restore"]
|
|
4479
4833
|
}), /* @__PURE__ */ Z(g, {
|
|
4480
4834
|
variant: "ghost",
|
|
4481
4835
|
size: "sm",
|
|
@@ -4488,14 +4842,14 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4488
4842
|
size: "sm",
|
|
4489
4843
|
className: "w-full gap-1.5",
|
|
4490
4844
|
onClick: f,
|
|
4491
|
-
children: [/* @__PURE__ */ Z(
|
|
4845
|
+
children: [/* @__PURE__ */ Z(He, { className: "h-3.5 w-3.5" }), "Restore to this point"]
|
|
4492
4846
|
})
|
|
4493
4847
|
})
|
|
4494
4848
|
]
|
|
4495
4849
|
})]
|
|
4496
4850
|
}) })]
|
|
4497
4851
|
});
|
|
4498
|
-
},
|
|
4852
|
+
}, mr = ({ onSubmit: e, placeholder: t = "Leave a comment…", disabled: r = !1, className: i }) => {
|
|
4499
4853
|
let [a, o] = n.useState(""), [s, c] = n.useState(!1), l = n.useCallback(async () => {
|
|
4500
4854
|
let t = a.trim();
|
|
4501
4855
|
if (t) {
|
|
@@ -4510,7 +4864,7 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4510
4864
|
e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), l());
|
|
4511
4865
|
}, [l]);
|
|
4512
4866
|
return /* @__PURE__ */ Q("div", {
|
|
4513
|
-
className:
|
|
4867
|
+
className: U("flex gap-2", i),
|
|
4514
4868
|
children: [/* @__PURE__ */ Z("textarea", {
|
|
4515
4869
|
className: "flex-1 min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-none",
|
|
4516
4870
|
placeholder: t,
|
|
@@ -4525,24 +4879,24 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4525
4879
|
disabled: !a.trim() || s || r,
|
|
4526
4880
|
className: "shrink-0 self-end",
|
|
4527
4881
|
"aria-label": "Submit comment",
|
|
4528
|
-
children: /* @__PURE__ */ Z(
|
|
4882
|
+
children: /* @__PURE__ */ Z(Ge, { className: "h-4 w-4" })
|
|
4529
4883
|
})]
|
|
4530
4884
|
});
|
|
4531
|
-
},
|
|
4885
|
+
}, hr = ({ query: e, suggestions: t, onSelect: r, visible: i = !0, activeIndex: a = 0, className: o }) => {
|
|
4532
4886
|
let s = n.useMemo(() => {
|
|
4533
4887
|
if (!e) return t;
|
|
4534
4888
|
let n = e.toLowerCase();
|
|
4535
4889
|
return t.filter((e) => e.name.toLowerCase().includes(n) || e.id.toLowerCase().includes(n));
|
|
4536
4890
|
}, [e, t]);
|
|
4537
4891
|
return !i || s.length === 0 ? null : /* @__PURE__ */ Z("div", {
|
|
4538
|
-
className:
|
|
4892
|
+
className: U("bg-popover border rounded-md shadow-md z-50 max-h-48 overflow-y-auto w-56", o),
|
|
4539
4893
|
role: "listbox",
|
|
4540
4894
|
"aria-label": "Mention suggestions",
|
|
4541
4895
|
children: s.map((e, t) => /* @__PURE__ */ Q("button", {
|
|
4542
4896
|
type: "button",
|
|
4543
4897
|
role: "option",
|
|
4544
4898
|
"aria-selected": t === a,
|
|
4545
|
-
className:
|
|
4899
|
+
className: U("w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 hover:bg-accent transition-colors", t === a && "bg-accent"),
|
|
4546
4900
|
onMouseDown: (t) => {
|
|
4547
4901
|
t.preventDefault(), r(e);
|
|
4548
4902
|
},
|
|
@@ -4570,7 +4924,7 @@ var er = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
4570
4924
|
}, e.id))
|
|
4571
4925
|
});
|
|
4572
4926
|
};
|
|
4573
|
-
function
|
|
4927
|
+
function gr(e, t, n) {
|
|
4574
4928
|
return {
|
|
4575
4929
|
type: e.type,
|
|
4576
4930
|
id: e.id,
|
|
@@ -4581,10 +4935,10 @@ function rr(e, t, n) {
|
|
|
4581
4935
|
}
|
|
4582
4936
|
//#endregion
|
|
4583
4937
|
//#region src/synth/buildDefaultPageSchema.ts
|
|
4584
|
-
function
|
|
4938
|
+
function _r(e) {
|
|
4585
4939
|
return e == null ? [] : Array.isArray(e) ? e.filter((e) => e != null) : [e];
|
|
4586
4940
|
}
|
|
4587
|
-
function
|
|
4941
|
+
function vr(e) {
|
|
4588
4942
|
if (!e) return null;
|
|
4589
4943
|
if (e.stageField) return e.stageField;
|
|
4590
4944
|
let t = e.fields || {};
|
|
@@ -4600,7 +4954,7 @@ function ar(e) {
|
|
|
4600
4954
|
}
|
|
4601
4955
|
return null;
|
|
4602
4956
|
}
|
|
4603
|
-
function
|
|
4957
|
+
function yr(e, t) {
|
|
4604
4958
|
if (!e || !t) return null;
|
|
4605
4959
|
let n = e.fields?.[t]?.options;
|
|
4606
4960
|
return !Array.isArray(n) || n.length === 0 ? null : n.map((e) => ({
|
|
@@ -4608,7 +4962,7 @@ function or(e, t) {
|
|
|
4608
4962
|
label: e.label
|
|
4609
4963
|
}));
|
|
4610
4964
|
}
|
|
4611
|
-
function
|
|
4965
|
+
function br(e, t, n = 4) {
|
|
4612
4966
|
if (!e) return [];
|
|
4613
4967
|
if (Array.isArray(e.highlightFields) && e.highlightFields.length > 0) return e.highlightFields.slice(0, n);
|
|
4614
4968
|
let r = new Set([
|
|
@@ -4642,28 +4996,62 @@ function sr(e, t, n = 4) {
|
|
|
4642
4996
|
"priority",
|
|
4643
4997
|
"industry",
|
|
4644
4998
|
"phone",
|
|
4645
|
-
"email"
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4999
|
+
"email",
|
|
5000
|
+
"close_date",
|
|
5001
|
+
"due_date",
|
|
5002
|
+
"start_date",
|
|
5003
|
+
"expected_close_date",
|
|
5004
|
+
"account",
|
|
5005
|
+
"account_id",
|
|
5006
|
+
"contact",
|
|
5007
|
+
"contact_id"
|
|
5008
|
+
], a = new Set([
|
|
5009
|
+
"currency",
|
|
5010
|
+
"number",
|
|
5011
|
+
"integer",
|
|
5012
|
+
"decimal",
|
|
5013
|
+
"percent",
|
|
5014
|
+
"date",
|
|
5015
|
+
"datetime",
|
|
5016
|
+
"time",
|
|
5017
|
+
"reference",
|
|
5018
|
+
"lookup",
|
|
5019
|
+
"user",
|
|
5020
|
+
"owner",
|
|
5021
|
+
"select",
|
|
5022
|
+
"enum",
|
|
5023
|
+
"multiselect",
|
|
5024
|
+
"status",
|
|
5025
|
+
"email",
|
|
5026
|
+
"phone",
|
|
5027
|
+
"url",
|
|
5028
|
+
"text",
|
|
5029
|
+
"string"
|
|
5030
|
+
]), o = [], s = e.fields || {};
|
|
5031
|
+
for (let e of i) if (e in s && !r.has(e) && o.push(e), o.length >= n) return o;
|
|
5032
|
+
for (let e of Object.keys(s)) {
|
|
5033
|
+
if (o.includes(e) || r.has(e)) continue;
|
|
5034
|
+
let t = s[e]?.type;
|
|
5035
|
+
if (!(t && !a.has(t)) && (o.push(e), o.length >= n)) break;
|
|
5036
|
+
}
|
|
5037
|
+
return o;
|
|
4650
5038
|
}
|
|
4651
|
-
function
|
|
5039
|
+
function xr(e, t = {}) {
|
|
4652
5040
|
return {
|
|
4653
5041
|
type: "page:header",
|
|
4654
5042
|
recordChrome: t.recordChrome !== !1,
|
|
4655
5043
|
...Array.isArray(t.actions) && t.actions.length > 0 ? { actions: t.actions } : {}
|
|
4656
5044
|
};
|
|
4657
5045
|
}
|
|
4658
|
-
function
|
|
5046
|
+
function Sr(e, t) {
|
|
4659
5047
|
return !Array.isArray(t) || t.length === 0 ? null : {
|
|
4660
5048
|
type: "record:quick_actions",
|
|
4661
5049
|
actions: t,
|
|
4662
5050
|
location: "record_header"
|
|
4663
5051
|
};
|
|
4664
5052
|
}
|
|
4665
|
-
function
|
|
4666
|
-
let n = t.statusField ??
|
|
5053
|
+
function Cr(e, t = {}) {
|
|
5054
|
+
let n = t.statusField ?? vr(e), r = t.stages ?? (n ? yr(e, n) : null), i = t.highlightFields ?? br(e, n), a = [];
|
|
4667
5055
|
return !t.hideHighlights && i.length > 0 && a.push({
|
|
4668
5056
|
type: "record:highlights",
|
|
4669
5057
|
fields: i
|
|
@@ -4673,19 +5061,19 @@ function ur(e, t = {}) {
|
|
|
4673
5061
|
stages: r
|
|
4674
5062
|
}), a;
|
|
4675
5063
|
}
|
|
4676
|
-
function
|
|
5064
|
+
function wr(e, t, n) {
|
|
4677
5065
|
return {
|
|
4678
5066
|
type: "record:details",
|
|
4679
5067
|
sections: t,
|
|
4680
5068
|
...n && n.length > 0 ? { hideFields: n } : {}
|
|
4681
5069
|
};
|
|
4682
5070
|
}
|
|
4683
|
-
function
|
|
4684
|
-
let n = t.statusField ??
|
|
5071
|
+
function Tr(e, t = {}) {
|
|
5072
|
+
let n = t.statusField ?? vr(e), r = t.highlightFields ?? br(e, n), i = [{
|
|
4685
5073
|
label: "Details",
|
|
4686
|
-
children: [
|
|
5074
|
+
children: [wr(e, t.sections, r)]
|
|
4687
5075
|
}];
|
|
4688
|
-
return Array.isArray(t.related) && t.related.length > 0 && i.push({
|
|
5076
|
+
return !t.hideRelatedTab && Array.isArray(t.related) && t.related.length > 0 && i.push({
|
|
4689
5077
|
label: "Related",
|
|
4690
5078
|
children: t.related.map((e) => ({
|
|
4691
5079
|
type: "record:related_list",
|
|
@@ -4712,55 +5100,75 @@ function fr(e, t = {}) {
|
|
|
4712
5100
|
items: i
|
|
4713
5101
|
};
|
|
4714
5102
|
}
|
|
4715
|
-
function
|
|
5103
|
+
function Er() {
|
|
4716
5104
|
return { type: "record:discussion" };
|
|
4717
5105
|
}
|
|
4718
|
-
function
|
|
5106
|
+
function Dr(e, t = {}) {
|
|
4719
5107
|
let n = t.slots || {}, r = [];
|
|
4720
|
-
|
|
5108
|
+
"header" in n && n.header !== void 0 ? r.push(..._r(n.header)) : r.push(xr(e, {
|
|
4721
5109
|
recordChrome: t.recordChrome,
|
|
4722
5110
|
actions: t.headerActions
|
|
4723
|
-
})), "actions" in n && n.actions !== void 0 && r.push(...
|
|
5111
|
+
})), "actions" in n && n.actions !== void 0 && r.push(..._r(n.actions)), "highlights" in n && n.highlights !== void 0 ? r.push(..._r(n.highlights)) : r.push(...Cr(e, {
|
|
4724
5112
|
highlightFields: t.highlightFields,
|
|
4725
5113
|
statusField: t.statusField,
|
|
4726
5114
|
stages: t.stages,
|
|
4727
5115
|
hideHighlights: t.hideHighlights,
|
|
4728
5116
|
hidePath: t.hidePath
|
|
4729
|
-
}))
|
|
5117
|
+
}));
|
|
5118
|
+
let i = !t.hideReferenceRail && Array.isArray(t.related) && t.related.length >= 2, a = t.hideRelatedTab ?? i;
|
|
5119
|
+
if ("tabs" in n && n.tabs !== void 0) r.push(..._r(n.tabs));
|
|
4730
5120
|
else if ("details" in n && n.details !== void 0) {
|
|
4731
|
-
let i =
|
|
5121
|
+
let i = _r(n.details), o = Tr(e, {
|
|
4732
5122
|
sections: t.sections,
|
|
4733
5123
|
related: t.related,
|
|
4734
5124
|
showActivity: t.showActivity,
|
|
4735
5125
|
history: t.history,
|
|
4736
5126
|
highlightFields: t.highlightFields,
|
|
4737
|
-
statusField: t.statusField
|
|
5127
|
+
statusField: t.statusField,
|
|
5128
|
+
hideRelatedTab: a
|
|
4738
5129
|
});
|
|
4739
|
-
Array.isArray(
|
|
4740
|
-
...
|
|
5130
|
+
Array.isArray(o.items) && o.items.length > 0 && (o.items[0] = {
|
|
5131
|
+
...o.items[0],
|
|
4741
5132
|
children: i
|
|
4742
|
-
}), r.push(
|
|
4743
|
-
} else r.push(
|
|
5133
|
+
}), r.push(o);
|
|
5134
|
+
} else r.push(Tr(e, {
|
|
4744
5135
|
sections: t.sections,
|
|
4745
5136
|
related: t.related,
|
|
4746
5137
|
showActivity: t.showActivity,
|
|
4747
5138
|
history: t.history,
|
|
4748
5139
|
highlightFields: t.highlightFields,
|
|
4749
|
-
statusField: t.statusField
|
|
5140
|
+
statusField: t.statusField,
|
|
5141
|
+
hideRelatedTab: a
|
|
4750
5142
|
}));
|
|
4751
|
-
|
|
5143
|
+
"discussion" in n && n.discussion !== void 0 ? r.push(..._r(n.discussion)) : t.hideDiscussion || r.push(Er());
|
|
5144
|
+
let o = [{
|
|
5145
|
+
name: "main",
|
|
5146
|
+
width: "full",
|
|
5147
|
+
components: r
|
|
5148
|
+
}];
|
|
5149
|
+
return i && o.push({
|
|
5150
|
+
name: "aside",
|
|
5151
|
+
width: "small",
|
|
5152
|
+
className: "hidden xl:flex flex-col gap-4",
|
|
5153
|
+
components: [{
|
|
5154
|
+
type: "record:reference_rail",
|
|
5155
|
+
entries: t.related.map((e) => ({
|
|
5156
|
+
objectName: e.objectName,
|
|
5157
|
+
relationshipField: e.relationshipField,
|
|
5158
|
+
title: e.title,
|
|
5159
|
+
icon: e.icon,
|
|
5160
|
+
limit: 3
|
|
5161
|
+
}))
|
|
5162
|
+
}]
|
|
5163
|
+
}), {
|
|
4752
5164
|
type: "record",
|
|
4753
5165
|
pageType: "record",
|
|
4754
5166
|
object: e?.name,
|
|
4755
5167
|
template: "full-width",
|
|
4756
|
-
regions:
|
|
4757
|
-
name: "main",
|
|
4758
|
-
width: "full",
|
|
4759
|
-
components: r
|
|
4760
|
-
}]
|
|
5168
|
+
regions: o
|
|
4761
5169
|
};
|
|
4762
5170
|
}
|
|
4763
|
-
e.register("detail-view",
|
|
5171
|
+
e.register("detail-view", tn, {
|
|
4764
5172
|
namespace: "plugin-detail",
|
|
4765
5173
|
label: "Detail View",
|
|
4766
5174
|
category: "Views",
|
|
@@ -4890,7 +5298,7 @@ e.register("detail-view", Xt, {
|
|
|
4890
5298
|
tabs: [],
|
|
4891
5299
|
related: []
|
|
4892
5300
|
}
|
|
4893
|
-
}), e.register("detail-section",
|
|
5301
|
+
}), e.register("detail-section", Tt, {
|
|
4894
5302
|
namespace: "plugin-detail",
|
|
4895
5303
|
label: "Detail Section",
|
|
4896
5304
|
category: "Detail Components",
|
|
@@ -4941,7 +5349,7 @@ e.register("detail-view", Xt, {
|
|
|
4941
5349
|
label: "Header Color"
|
|
4942
5350
|
}
|
|
4943
5351
|
]
|
|
4944
|
-
}), e.register("related-list",
|
|
5352
|
+
}), e.register("related-list", Ot, {
|
|
4945
5353
|
namespace: "plugin-detail",
|
|
4946
5354
|
label: "Related List",
|
|
4947
5355
|
category: "Detail Components",
|
|
@@ -4988,7 +5396,7 @@ e.register("detail-view", Xt, {
|
|
|
4988
5396
|
label: "Columns"
|
|
4989
5397
|
}
|
|
4990
5398
|
]
|
|
4991
|
-
}), e.register("detail",
|
|
5399
|
+
}), e.register("detail", tn, {
|
|
4992
5400
|
namespace: "view",
|
|
4993
5401
|
category: "view",
|
|
4994
5402
|
label: "Detail",
|
|
@@ -5011,51 +5419,56 @@ e.register("detail-view", Xt, {
|
|
|
5011
5419
|
label: "Fields"
|
|
5012
5420
|
}
|
|
5013
5421
|
]
|
|
5014
|
-
}), e.register("record:details",
|
|
5422
|
+
}), e.register("record:details", ln, {
|
|
5015
5423
|
namespace: "record",
|
|
5016
5424
|
category: "record",
|
|
5017
5425
|
label: "Record Details",
|
|
5018
5426
|
icon: "FileText"
|
|
5019
|
-
}), e.register("record:related_list",
|
|
5427
|
+
}), e.register("record:related_list", fn, {
|
|
5020
5428
|
namespace: "record",
|
|
5021
5429
|
category: "record",
|
|
5022
5430
|
label: "Related List",
|
|
5023
5431
|
icon: "List"
|
|
5024
|
-
}), e.register("record:highlights",
|
|
5432
|
+
}), e.register("record:highlights", mn, {
|
|
5025
5433
|
namespace: "record",
|
|
5026
5434
|
category: "record",
|
|
5027
5435
|
label: "Highlights Panel",
|
|
5028
5436
|
icon: "Star"
|
|
5029
|
-
}), e.register("record:activity",
|
|
5437
|
+
}), e.register("record:activity", Pn, {
|
|
5030
5438
|
namespace: "record",
|
|
5031
5439
|
category: "record",
|
|
5032
5440
|
label: "Activity Timeline",
|
|
5033
5441
|
icon: "Activity"
|
|
5034
|
-
}), e.register("record:chatter",
|
|
5442
|
+
}), e.register("record:chatter", Ln, {
|
|
5035
5443
|
namespace: "record",
|
|
5036
5444
|
category: "record",
|
|
5037
5445
|
label: "Chatter Feed",
|
|
5038
5446
|
icon: "MessageSquare"
|
|
5039
|
-
}), e.register("record:discussion",
|
|
5447
|
+
}), e.register("record:discussion", Ln, {
|
|
5040
5448
|
namespace: "record",
|
|
5041
5449
|
category: "record",
|
|
5042
5450
|
label: "Discussion",
|
|
5043
5451
|
icon: "MessageSquare"
|
|
5044
|
-
}), e.register("record:path",
|
|
5452
|
+
}), e.register("record:path", zn, {
|
|
5045
5453
|
namespace: "record",
|
|
5046
5454
|
category: "record",
|
|
5047
5455
|
label: "Path / Stepper",
|
|
5048
5456
|
icon: "GitBranch"
|
|
5049
|
-
}), e.register("record:quick_actions",
|
|
5457
|
+
}), e.register("record:quick_actions", Vn, {
|
|
5050
5458
|
namespace: "record",
|
|
5051
5459
|
category: "record",
|
|
5052
5460
|
label: "Quick Actions",
|
|
5053
5461
|
icon: "Zap"
|
|
5054
|
-
}), e.register("record:history",
|
|
5462
|
+
}), e.register("record:history", Un, {
|
|
5055
5463
|
namespace: "record",
|
|
5056
5464
|
category: "record",
|
|
5057
5465
|
label: "History Timeline",
|
|
5058
5466
|
icon: "Clock"
|
|
5467
|
+
}), e.register("record:reference_rail", qn, {
|
|
5468
|
+
namespace: "record",
|
|
5469
|
+
category: "record",
|
|
5470
|
+
label: "Reference Rail",
|
|
5471
|
+
icon: "PanelRight"
|
|
5059
5472
|
});
|
|
5060
5473
|
//#endregion
|
|
5061
|
-
export {
|
|
5474
|
+
export { Rt as ActivityTimeline, En as CommentAttachment, mr as CommentInput, an as ConcurrentUpdateDialog, Ct as DETAIL_DEFAULT_TRANSLATIONS, Tt as DetailSection, Et as DetailTabs, tn as DetailView, ir as DiffView, hn as FieldChangeItem, At as HeaderHighlight, Gt as HistoryTimeline, $n as InlineCreateRelated, hr as MentionAutocomplete, pr as PointInTimeRestore, _n as ReactionPicker, Pn as RecordActivityRenderer, Mn as RecordActivityTimeline, Fn as RecordChatterPanel, Ln as RecordChatterRenderer, Mt as RecordComments, Zn as RecordDetailDrawer, ln as RecordDetailsRenderer, mn as RecordHighlightsRenderer, Un as RecordHistoryRenderer, Qt as RecordMetaFooter, ar as RecordNavigationEnhanced, zn as RecordPathRenderer, Vn as RecordQuickActionsRenderer, qn as RecordReferenceRailRenderer, fn as RecordRelatedListRenderer, Ot as RelatedList, dr as RelationshipGraph, Sn as RichTextCommentInput, kt as SectionGroup, bn as SubscriptionToggle, yn as ThreadedReplies, bt as applyAutoSpan, xt as applyDetailAutoLayout, Sr as buildDefaultActions, wr as buildDefaultDetails, Er as buildDefaultDiscussion, xr as buildDefaultHeader, Cr as buildDefaultHighlights, Dr as buildDefaultPageSchema, Tr as buildDefaultTabs, gr as createMentionFromSuggestion, St as createSafeTranslationHook, br as deriveHighlightFields, Qn as deriveRecordPageHref, yr as deriveStages, vr as detectStatusField, yt as inferDetailColumns, on as isConcurrentUpdateError, vt as isWideFieldType, $ as useDetailTranslation };
|