@lumerahq/ui 0.12.0-dev.2 → 0.12.0-dev.3
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/README.md +11 -5
- package/dist/{RecordSheet-B0IaPMZs.js → RecordSheet-DknloKD2.js} +120 -41
- package/dist/components/audit-log/AuditLog.d.ts +3 -1
- package/dist/components/audit-log/AuditLog.d.ts.map +1 -1
- package/dist/components/audit-log/AuditLogEntry.d.ts +2 -1
- package/dist/components/audit-log/AuditLogEntry.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{highlighted-body-OFNGDK62-DzatZiEq.js → highlighted-body-OFNGDK62-BLfYHDYi.js} +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/audit-log-core.d.ts +1 -0
- package/dist/lib/audit-log-core.d.ts.map +1 -1
- package/dist/mermaid-GHXKKRXX-2xNwWUyn.js +4 -0
- package/dist/ui.css +19 -4
- package/dist/{use-automation-run-DmMpzFCS.js → use-automation-run-B2iPUXiG.js} +11 -7
- package/package.json +1 -1
- package/dist/mermaid-GHXKKRXX-BPtfcw6Y.js +0 -4
package/README.md
CHANGED
|
@@ -63,6 +63,10 @@ import { AuditLog } from '@lumerahq/ui';
|
|
|
63
63
|
finance__invoices: 'Invoices',
|
|
64
64
|
finance__payments: 'Payments',
|
|
65
65
|
}}
|
|
66
|
+
activityNouns={{
|
|
67
|
+
finance__invoices: 'invoice',
|
|
68
|
+
finance__payments: 'payment',
|
|
69
|
+
}}
|
|
66
70
|
fieldLabels={{ customer_id: 'Customer' }}
|
|
67
71
|
showSystemFields={false}
|
|
68
72
|
exportFilename="finance-activity.csv"
|
|
@@ -70,11 +74,13 @@ import { AuditLog } from '@lumerahq/ui';
|
|
|
70
74
|
```
|
|
71
75
|
|
|
72
76
|
The component includes collection, date/time, event, and actor filters with
|
|
73
|
-
visible active-filter chips
|
|
74
|
-
export with filename/count/truncation feedback. It also
|
|
75
|
-
filters, column and density options, record navigation
|
|
76
|
-
loading, empty, and error states. Friendly collection
|
|
77
|
-
the collection column and
|
|
77
|
+
visible active-filter chips, quick date presets, lazy before/after details,
|
|
78
|
+
pagination, and CSV export with filename/count/truncation feedback. It also
|
|
79
|
+
supports controlled filters, column and density options, record navigation
|
|
80
|
+
callbacks, and custom loading, empty, and error states. Friendly collection
|
|
81
|
+
labels are used in the collection column and CSV export. Optional
|
|
82
|
+
`activityNouns` make activity text read naturally, for example "Updated
|
|
83
|
+
invoice" instead of "Updated Invoices". If a selected collection has auditing
|
|
78
84
|
turned off, existing history remains visible and the component shows a warning
|
|
79
85
|
that future changes will not be recorded.
|
|
80
86
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import React__default, { useContext, createContext, forwardRef, createElement, memo, useId as useId$1, useTransition, useMemo, useRef, useEffect, useState, cloneElement, isValidElement, useCallback, Suspense, lazy, Fragment as Fragment$1, useLayoutEffect } from "react";
|
|
4
|
-
import { u as useAgentChat, a as useAgentChatSessions, g as getRecordAuditLogSnapshot, d as auditLogSummaryWithCollectionLabel, e as auditLogDetailValue, f as auditLogActorLabel, n as normalizeRecordAuditCollections, h as normalizeAuditLogFilterState, A as AUDIT_LOG_MAX_COLLECTIONS, b as useAuditLog, i as fetchRecordAuditLogCsv, j as normalizeAuditLogExportLimit, c as useAutomationRun } from "./use-automation-run-
|
|
4
|
+
import { u as useAgentChat, a as useAgentChatSessions, g as getRecordAuditLogSnapshot, d as auditLogSummaryWithCollectionLabel, e as auditLogDetailValue, f as auditLogActorLabel, n as normalizeRecordAuditCollections, h as normalizeAuditLogFilterState, A as AUDIT_LOG_MAX_COLLECTIONS, b as useAuditLog, i as fetchRecordAuditLogCsv, j as normalizeAuditLogExportLimit, c as useAutomationRun } from "./use-automation-run-B2iPUXiG.js";
|
|
5
5
|
import { t as twMerge, p as clsx, o as cn$2, a as formatCellValue$2 } from "./formatters-D4T821Dv.js";
|
|
6
6
|
import { f as getDownloadUrl, t as pbSql, p as parentApiRequest, d as parentApiStream, B as BridgeError, z as automationStatuses, L as getAutomationRunFileDownloadUrl, R as listAutomationRunFiles } from "./automations-EgDXJ43_.js";
|
|
7
7
|
import * as ReactDOM from "react-dom";
|
|
@@ -86,24 +86,24 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
86
86
|
Component.displayName = toPascalCase(iconName);
|
|
87
87
|
return Component;
|
|
88
88
|
};
|
|
89
|
-
const __iconNode$
|
|
89
|
+
const __iconNode$L = [
|
|
90
90
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
91
91
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
92
92
|
];
|
|
93
|
-
const ArrowDown = createLucideIcon("arrow-down", __iconNode$
|
|
94
|
-
const __iconNode$
|
|
93
|
+
const ArrowDown = createLucideIcon("arrow-down", __iconNode$L);
|
|
94
|
+
const __iconNode$K = [
|
|
95
95
|
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
96
96
|
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
97
97
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
98
98
|
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
99
99
|
];
|
|
100
|
-
const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$
|
|
101
|
-
const __iconNode$
|
|
100
|
+
const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$K);
|
|
101
|
+
const __iconNode$J = [
|
|
102
102
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
103
103
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
104
104
|
];
|
|
105
|
-
const ArrowUp = createLucideIcon("arrow-up", __iconNode$
|
|
106
|
-
const __iconNode$
|
|
105
|
+
const ArrowUp = createLucideIcon("arrow-up", __iconNode$J);
|
|
106
|
+
const __iconNode$I = [
|
|
107
107
|
["path", { d: "M12 8V4H8", key: "hb8ula" }],
|
|
108
108
|
["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
|
|
109
109
|
["path", { d: "M2 14h2", key: "vft8re" }],
|
|
@@ -111,8 +111,8 @@ const __iconNode$H = [
|
|
|
111
111
|
["path", { d: "M15 13v2", key: "1xurst" }],
|
|
112
112
|
["path", { d: "M9 13v2", key: "rq6x2g" }]
|
|
113
113
|
];
|
|
114
|
-
const Bot = createLucideIcon("bot", __iconNode$
|
|
115
|
-
const __iconNode$
|
|
114
|
+
const Bot = createLucideIcon("bot", __iconNode$I);
|
|
115
|
+
const __iconNode$H = [
|
|
116
116
|
["path", { d: "M12 18V5", key: "adv99a" }],
|
|
117
117
|
["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
|
|
118
118
|
["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
|
|
@@ -122,7 +122,16 @@ const __iconNode$G = [
|
|
|
122
122
|
["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
|
|
123
123
|
["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
|
|
124
124
|
];
|
|
125
|
-
const Brain = createLucideIcon("brain", __iconNode$
|
|
125
|
+
const Brain = createLucideIcon("brain", __iconNode$H);
|
|
126
|
+
const __iconNode$G = [
|
|
127
|
+
["path", { d: "M16 14v2.2l1.6 1", key: "fo4ql5" }],
|
|
128
|
+
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
129
|
+
["path", { d: "M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5", key: "1osxxc" }],
|
|
130
|
+
["path", { d: "M3 10h5", key: "r794hk" }],
|
|
131
|
+
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
132
|
+
["circle", { cx: "16", cy: "16", r: "6", key: "qoo3c4" }]
|
|
133
|
+
];
|
|
134
|
+
const CalendarClock = createLucideIcon("calendar-clock", __iconNode$G);
|
|
126
135
|
const __iconNode$F = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
127
136
|
const Check = createLucideIcon("check", __iconNode$F);
|
|
128
137
|
const __iconNode$E = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
@@ -24041,7 +24050,7 @@ var lr = (e) => {
|
|
|
24041
24050
|
for (; t > 0 && e[t - 1] === `
|
|
24042
24051
|
`; ) t--;
|
|
24043
24052
|
return e.slice(0, t);
|
|
24044
|
-
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-
|
|
24053
|
+
}, cr = lazy(() => import("./highlighted-body-OFNGDK62-BLfYHDYi.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
|
|
24045
24054
|
let i = y2(), d2 = useMemo(() => lr(e), [e]), c2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
|
|
24046
24055
|
`).map((p2) => [{ content: p2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
|
|
24047
24056
|
return jsx(nt.Provider, { value: { code: e }, children: jsxs(ot, { isIncomplete: r, language: t, children: [jsx(rt, { language: t }), n ? jsx("div", { className: i("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"), children: jsx("div", { className: i("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"), "data-streamdown": "code-block-actions", children: n }) }) : null, jsx(Suspense, { fallback: jsx(At, { className: o, language: t, lineNumbers: a, result: c2, startLine: s2, ...l }), children: jsx(cr, { className: o, code: d2, language: t, lineNumbers: a, raw: c2, startLine: s2, ...l }) })] }) });
|
|
@@ -24403,7 +24412,7 @@ var vo = ({ children: e, className: t, showControls: o, showCopy: n = true, show
|
|
|
24403
24412
|
let l = y2(), i = o && n, d2 = o && r, c2 = o && s2, p2 = i || d2 || c2;
|
|
24404
24413
|
return jsxs("div", { className: l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"), "data-streamdown": "table-wrapper", children: [p2 ? jsxs("div", { className: l("flex items-center justify-end gap-1"), children: [i ? jsx(Te, {}) : null, d2 ? jsx(Pe, {}) : null, c2 ? jsx(Co, { showCopy: i, showDownload: d2, children: e }) : null] }) : null, jsx("div", { className: l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"), children: jsx("table", { className: l("w-full divide-y divide-border", t), "data-streamdown": "table", ...a, children: e }) })] });
|
|
24405
24414
|
};
|
|
24406
|
-
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-
|
|
24415
|
+
var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-2xNwWUyn.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
|
|
24407
24416
|
function qe(e, t) {
|
|
24408
24417
|
if (!(e != null && e.position || t != null && t.position)) return true;
|
|
24409
24418
|
if (!(e != null && e.position && (t != null && t.position))) return false;
|
|
@@ -29552,11 +29561,18 @@ const systemFieldKeys = /* @__PURE__ */ new Set([
|
|
|
29552
29561
|
]);
|
|
29553
29562
|
const identityFieldKeys = /* @__PURE__ */ new Set(["collection", "collection_id", "record_id"]);
|
|
29554
29563
|
const fieldKey = (field) => field.key?.trim().toLowerCase() || field.label.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
29555
|
-
const displayFields = (fields, fieldLabels, showSystemFields) => {
|
|
29564
|
+
const displayFields = (fields, fieldLabels, showSystemFields, options = {}) => {
|
|
29556
29565
|
if (!fields) return null;
|
|
29557
29566
|
return fields.filter((field) => showSystemFields || !systemFieldKeys.has(fieldKey(field))).map((field) => {
|
|
29558
|
-
const
|
|
29559
|
-
|
|
29567
|
+
const key = fieldKey(field);
|
|
29568
|
+
const friendlyCollection = key === "collection" && options.collectionLabel?.trim() && options.collectionApiName?.trim() ? {
|
|
29569
|
+
...field,
|
|
29570
|
+
value: options.collectionLabel.trim(),
|
|
29571
|
+
secondary: options.collectionLabel.trim() === options.collectionApiName.trim() ? field.secondary : options.collectionApiName.trim(),
|
|
29572
|
+
mono: false
|
|
29573
|
+
} : field;
|
|
29574
|
+
const label = field.key && fieldLabels?.[field.key] || fieldLabels?.[field.label] || fieldLabels?.[key];
|
|
29575
|
+
return label?.trim() ? { ...friendlyCollection, label: label.trim() } : friendlyCollection;
|
|
29560
29576
|
});
|
|
29561
29577
|
};
|
|
29562
29578
|
function FieldValue({ field }) {
|
|
@@ -29608,6 +29624,7 @@ function SnapshotSide({ label, fields }) {
|
|
|
29608
29624
|
}
|
|
29609
29625
|
function AuditLogEntry({
|
|
29610
29626
|
entry,
|
|
29627
|
+
collectionApiName,
|
|
29611
29628
|
collectionLabel,
|
|
29612
29629
|
activityCollectionLabel,
|
|
29613
29630
|
density,
|
|
@@ -29628,7 +29645,7 @@ function AuditLogEntry({
|
|
|
29628
29645
|
staleTime: Number.POSITIVE_INFINITY,
|
|
29629
29646
|
retry: false
|
|
29630
29647
|
});
|
|
29631
|
-
const detailFields = displayFields(entry.details, fieldLabels, showSystemFields) ?? [];
|
|
29648
|
+
const detailFields = displayFields(entry.details, fieldLabels, showSystemFields, { collectionApiName, collectionLabel }) ?? [];
|
|
29632
29649
|
const recordHref = getRecordHref?.(entry)?.trim();
|
|
29633
29650
|
const rowPadding = density === "comfortable" ? "py-4" : void 0;
|
|
29634
29651
|
const summary = activityCollectionLabel ? auditLogSummaryWithCollectionLabel(entry, activityCollectionLabel) : entry.summary;
|
|
@@ -42229,6 +42246,7 @@ const errorCopyFor = (status) => {
|
|
|
42229
42246
|
function AuditLog({
|
|
42230
42247
|
collections,
|
|
42231
42248
|
collectionLabels,
|
|
42249
|
+
activityNouns,
|
|
42232
42250
|
filters: controlledFilters,
|
|
42233
42251
|
defaultFilters,
|
|
42234
42252
|
onFiltersChange,
|
|
@@ -42267,7 +42285,7 @@ function AuditLog({
|
|
|
42267
42285
|
const fromDateTime = dateTimeInputValue(filterState.since);
|
|
42268
42286
|
const untilDateTime = dateTimeInputValue(filterState.until);
|
|
42269
42287
|
const [isExporting, setIsExporting] = useState(false);
|
|
42270
|
-
const [exportStatus, setExportStatus] = useState({ key: "", message: "" });
|
|
42288
|
+
const [exportStatus, setExportStatus] = useState({ key: "", message: "", tone: "success" });
|
|
42271
42289
|
const requestFilters = useMemo(
|
|
42272
42290
|
() => ({
|
|
42273
42291
|
event: filterState.event,
|
|
@@ -42282,6 +42300,7 @@ function AuditLog({
|
|
|
42282
42300
|
const auditLog = useAuditLog(selectedCollections, requestFilters, { pageSize, enabled: !configurationError });
|
|
42283
42301
|
const columnCount = 3 + Number(showCollectionColumn) + Number(showActorColumn);
|
|
42284
42302
|
const labelForCollection = (collection) => collectionLabels?.[collection]?.trim() || collection;
|
|
42303
|
+
const activityLabelForCollection = (collection) => activityNouns?.[collection]?.trim() || collectionLabels?.[collection]?.trim();
|
|
42285
42304
|
const actorOptions = useMemo(() => {
|
|
42286
42305
|
const actors = /* @__PURE__ */ new Map();
|
|
42287
42306
|
for (const entry of auditLog.entries) {
|
|
@@ -42296,7 +42315,7 @@ function AuditLog({
|
|
|
42296
42315
|
const hasDateFilter = Boolean(filterState.since || filterState.until);
|
|
42297
42316
|
const status = auditLog.error?.status;
|
|
42298
42317
|
const errorCopy = errorCopyFor(status);
|
|
42299
|
-
const
|
|
42318
|
+
const exportStatusForFilters = exportStatus.key === filterKey && exportStatus.message ? exportStatus : null;
|
|
42300
42319
|
const selectedActor = actorOptions.find(([actorID2]) => actorID2 === actor)?.[1];
|
|
42301
42320
|
const selectedActorLabel = actor === "all" ? "All actors" : selectedActor ? auditLogActorLabel(selectedActor) : "Selected actor";
|
|
42302
42321
|
const disabledCollections = auditLog.collectionStatus.filter((collection) => !collection.audit_enabled).map((collection) => labelForCollection(collection.name));
|
|
@@ -42318,6 +42337,24 @@ function AuditLog({
|
|
|
42318
42337
|
};
|
|
42319
42338
|
const resetFilters = () => setFilters(normalizeAuditLogFilterState(availableCollections));
|
|
42320
42339
|
const resetFiltersFromPointer = () => resetFilters();
|
|
42340
|
+
const applyDatePreset = (preset) => {
|
|
42341
|
+
if (preset === "clear") {
|
|
42342
|
+
setFilters({ ...filterState, since: void 0, until: void 0 });
|
|
42343
|
+
return;
|
|
42344
|
+
}
|
|
42345
|
+
const now = /* @__PURE__ */ new Date();
|
|
42346
|
+
if (preset === "today") {
|
|
42347
|
+
const start = new Date(now);
|
|
42348
|
+
start.setHours(0, 0, 0, 0);
|
|
42349
|
+
const end = new Date(now);
|
|
42350
|
+
end.setHours(23, 59, 59, 999);
|
|
42351
|
+
setFilters({ ...filterState, since: start.toISOString(), until: end.toISOString() });
|
|
42352
|
+
return;
|
|
42353
|
+
}
|
|
42354
|
+
const hours = preset === "last-24-hours" ? 24 : 24 * 7;
|
|
42355
|
+
const since = new Date(now.getTime() - hours * 60 * 60 * 1e3);
|
|
42356
|
+
setFilters({ ...filterState, since: since.toISOString(), until: void 0 });
|
|
42357
|
+
};
|
|
42321
42358
|
const filterChips = [];
|
|
42322
42359
|
if (selectedCollections.length !== availableCollections.length) {
|
|
42323
42360
|
const labels = selectedCollections.map(labelForCollection);
|
|
@@ -42359,20 +42396,22 @@ function AuditLog({
|
|
|
42359
42396
|
const handleExport = async () => {
|
|
42360
42397
|
const limit = normalizeAuditLogExportLimit(exportMaxRows);
|
|
42361
42398
|
setIsExporting(true);
|
|
42362
|
-
setExportStatus({ key: filterKey, message: "" });
|
|
42399
|
+
setExportStatus({ key: filterKey, message: "", tone: "success" });
|
|
42363
42400
|
try {
|
|
42364
42401
|
const result = await fetchRecordAuditLogCsv({ collections: selectedCollections, ...requestFilters }, limit, {
|
|
42365
|
-
collectionLabels
|
|
42402
|
+
collectionLabels,
|
|
42403
|
+
activityNouns
|
|
42366
42404
|
});
|
|
42367
42405
|
const filename = exportFilename?.trim() || filenameFor(selectedCollections);
|
|
42368
42406
|
downloadCsv(filename, result.csv);
|
|
42369
42407
|
const rowText = `${result.count.toLocaleString()} ${result.count === 1 ? "row" : "rows"}`;
|
|
42370
42408
|
setExportStatus({
|
|
42371
42409
|
key: filterKey,
|
|
42410
|
+
tone: "success",
|
|
42372
42411
|
message: `${filename}: exported ${rowText}; ${result.truncated ? `truncated to first ${limit.toLocaleString()} rows` : "not truncated"}; ${hasFilters ? `filters: ${filterSummary}` : "no filters applied"}.`
|
|
42373
42412
|
});
|
|
42374
42413
|
} catch {
|
|
42375
|
-
setExportStatus({ key: filterKey, message: "Could not export the activity. Try again." });
|
|
42414
|
+
setExportStatus({ key: filterKey, message: "Could not export the activity. Try again.", tone: "error" });
|
|
42376
42415
|
} finally {
|
|
42377
42416
|
setIsExporting(false);
|
|
42378
42417
|
}
|
|
@@ -42413,6 +42452,21 @@ function AuditLog({
|
|
|
42413
42452
|
)
|
|
42414
42453
|
] })
|
|
42415
42454
|
] }),
|
|
42455
|
+
exportStatusForFilters ? /* @__PURE__ */ jsxs(
|
|
42456
|
+
"div",
|
|
42457
|
+
{
|
|
42458
|
+
className: cn$2(
|
|
42459
|
+
"flex gap-2 border-b px-5 py-2.5 text-xs",
|
|
42460
|
+
exportStatusForFilters.tone === "success" ? "bg-emerald-50 text-emerald-950" : "bg-rose-50 text-rose-950"
|
|
42461
|
+
),
|
|
42462
|
+
role: "status",
|
|
42463
|
+
"aria-live": "polite",
|
|
42464
|
+
children: [
|
|
42465
|
+
exportStatusForFilters.tone === "success" ? /* @__PURE__ */ jsx(CircleCheck, { className: "mt-0.5 size-4 shrink-0" }) : /* @__PURE__ */ jsx(CircleAlert, { className: "mt-0.5 size-4 shrink-0" }),
|
|
42466
|
+
/* @__PURE__ */ jsx("p", { children: exportStatusForFilters.message })
|
|
42467
|
+
]
|
|
42468
|
+
}
|
|
42469
|
+
) : null,
|
|
42416
42470
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-end gap-2 border-b bg-muted/20 px-5 py-3", children: [
|
|
42417
42471
|
availableCollections.length > 1 ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42418
42472
|
/* @__PURE__ */ jsx(Label, { className: "text-xs text-muted-foreground", children: "Collections" }),
|
|
@@ -42486,6 +42540,28 @@ function AuditLog({
|
|
|
42486
42540
|
}
|
|
42487
42541
|
)
|
|
42488
42542
|
] }),
|
|
42543
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42544
|
+
/* @__PURE__ */ jsx(Label, { className: "text-xs text-muted-foreground", children: "Date presets" }),
|
|
42545
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
42546
|
+
/* @__PURE__ */ jsxs(
|
|
42547
|
+
DropdownMenuTrigger,
|
|
42548
|
+
{
|
|
42549
|
+
render: /* @__PURE__ */ jsx(Button2, { type: "button", variant: "outline", size: "sm", className: "w-[10rem] justify-start" }),
|
|
42550
|
+
children: [
|
|
42551
|
+
/* @__PURE__ */ jsx(CalendarClock, {}),
|
|
42552
|
+
"Quick range"
|
|
42553
|
+
]
|
|
42554
|
+
}
|
|
42555
|
+
),
|
|
42556
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", children: [
|
|
42557
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("last-24-hours"), children: "Last 24 hours" }),
|
|
42558
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("last-7-days"), children: "Last 7 days" }),
|
|
42559
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("today"), children: "Today" }),
|
|
42560
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
42561
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("clear"), children: "Clear date range" })
|
|
42562
|
+
] })
|
|
42563
|
+
] })
|
|
42564
|
+
] }),
|
|
42489
42565
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
42490
42566
|
/* @__PURE__ */ jsx(Label, { htmlFor: eventID, className: "text-xs text-muted-foreground", children: "Event" }),
|
|
42491
42567
|
/* @__PURE__ */ jsxs(
|
|
@@ -42606,23 +42682,27 @@ function AuditLog({
|
|
|
42606
42682
|
/* @__PURE__ */ jsx(FunnelX, {}),
|
|
42607
42683
|
" Reset filters"
|
|
42608
42684
|
] }) : void 0
|
|
42609
|
-
) }) }) : auditLog.entries.map((entry) =>
|
|
42610
|
-
|
|
42611
|
-
|
|
42612
|
-
|
|
42613
|
-
|
|
42614
|
-
|
|
42615
|
-
|
|
42616
|
-
|
|
42617
|
-
|
|
42618
|
-
|
|
42619
|
-
|
|
42620
|
-
|
|
42621
|
-
|
|
42622
|
-
|
|
42623
|
-
|
|
42624
|
-
|
|
42625
|
-
|
|
42685
|
+
) }) }) : auditLog.entries.map((entry) => {
|
|
42686
|
+
const collectionApiName = auditLogDetailValue(entry, "Collection");
|
|
42687
|
+
return /* @__PURE__ */ jsx(
|
|
42688
|
+
AuditLogEntry,
|
|
42689
|
+
{
|
|
42690
|
+
entry,
|
|
42691
|
+
collectionApiName,
|
|
42692
|
+
collectionLabel: labelForCollection(collectionApiName),
|
|
42693
|
+
activityCollectionLabel: activityLabelForCollection(collectionApiName),
|
|
42694
|
+
density,
|
|
42695
|
+
showCollectionColumn,
|
|
42696
|
+
showActorColumn,
|
|
42697
|
+
showSystemFields,
|
|
42698
|
+
fieldLabels,
|
|
42699
|
+
columnCount,
|
|
42700
|
+
getRecordHref,
|
|
42701
|
+
onRecordClick
|
|
42702
|
+
},
|
|
42703
|
+
entry.id
|
|
42704
|
+
);
|
|
42705
|
+
}) })
|
|
42626
42706
|
] }),
|
|
42627
42707
|
auditLog.hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center border-t p-4", children: /* @__PURE__ */ jsxs(
|
|
42628
42708
|
Button2,
|
|
@@ -42637,8 +42717,7 @@ function AuditLog({
|
|
|
42637
42717
|
"Load more"
|
|
42638
42718
|
]
|
|
42639
42719
|
}
|
|
42640
|
-
) }) : null
|
|
42641
|
-
/* @__PURE__ */ jsx("p", { className: "min-h-7 px-5 py-1 text-right text-[11px] text-muted-foreground", "aria-live": "polite", children: exportMessage })
|
|
42720
|
+
) }) : null
|
|
42642
42721
|
] });
|
|
42643
42722
|
}
|
|
42644
42723
|
function RunDownloadAction({ run }) {
|
|
@@ -8,6 +8,8 @@ export type AuditLogProps = {
|
|
|
8
8
|
collections: readonly string[];
|
|
9
9
|
/** Friendly display names keyed by collection API name. */
|
|
10
10
|
collectionLabels?: Readonly<Record<string, string>>;
|
|
11
|
+
/** Singular activity nouns keyed by collection API name, e.g. "invoice" or "payment". */
|
|
12
|
+
activityNouns?: Readonly<Record<string, string>>;
|
|
11
13
|
/** Controlled filter state. */
|
|
12
14
|
filters?: AuditLogFilterState;
|
|
13
15
|
/** Initial filters when the component manages its own state. */
|
|
@@ -45,5 +47,5 @@ export type AuditLogProps = {
|
|
|
45
47
|
/** Optional classes for the outer container. */
|
|
46
48
|
className?: string;
|
|
47
49
|
};
|
|
48
|
-
export declare function AuditLog({ collections, collectionLabels, filters: controlledFilters, defaultFilters, onFiltersChange, pageSize, exportMaxRows, exportFilename, title, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, getRecordHref, onRecordClick, loadingState, emptyState, errorState, className, }: AuditLogProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function AuditLog({ collections, collectionLabels, activityNouns, filters: controlledFilters, defaultFilters, onFiltersChange, pageSize, exportMaxRows, exportFilename, title, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, getRecordHref, onRecordClick, loadingState, emptyState, errorState, className, }: AuditLogProps): import("react/jsx-runtime").JSX.Element;
|
|
49
51
|
//# sourceMappingURL=AuditLog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLog.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,SAAS,EAA4B,MAAM,OAAO,CAAC;AAmBjE,OAAO,EAGL,KAAK,aAAa,IAAI,iBAAiB,EAEvC,KAAK,mBAAmB,IAAI,uBAAuB,EAOpD,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,CAAC;AACxD,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG;IAC1B,8EAA8E;IAC9E,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,2DAA2D;IAC3D,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,yFAAyF;IACzF,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,+BAA+B;IAC/B,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC9C,iFAAiF;IACjF,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACzD,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,cAAc,CAAC,EAAE,MA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
3
3
|
type AuditLogEntryProps = {
|
|
4
4
|
entry: AuditLogEntryData;
|
|
5
|
+
collectionApiName: string;
|
|
5
6
|
collectionLabel: string;
|
|
6
7
|
activityCollectionLabel?: string;
|
|
7
8
|
density: AuditLogDensity;
|
|
@@ -13,6 +14,6 @@ type AuditLogEntryProps = {
|
|
|
13
14
|
getRecordHref?: (entry: AuditLogEntryData) => string | undefined;
|
|
14
15
|
onRecordClick?: (entry: AuditLogEntryData) => void;
|
|
15
16
|
};
|
|
16
|
-
export declare function AuditLogEntry({ entry, collectionLabel, activityCollectionLabel, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, columnCount, getRecordHref, onRecordClick, }: AuditLogEntryProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function AuditLogEntry({ entry, collectionApiName, collectionLabel, activityCollectionLabel, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, columnCount, getRecordHref, onRecordClick, }: AuditLogEntryProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
18
19
|
//# sourceMappingURL=AuditLogEntry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuditLogEntry.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLogEntry.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,EACL,KAAK,aAAa,IAAI,iBAAiB,EAMxC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"AuditLogEntry.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLogEntry.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,EACL,KAAK,aAAa,IAAI,iBAAiB,EAMxC,MAAM,iBAAiB,CAAC;AA4JzB,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,OAAO,EAAE,eAAe,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,MAAM,GAAG,SAAS,CAAC;IACjE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,OAAO,EACP,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,GACd,EAAE,kBAAkB,2CA6HpB"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "../RecordSheet-
|
|
1
|
+
import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "../RecordSheet-DknloKD2.js";
|
|
2
2
|
export {
|
|
3
3
|
A as AgentChat,
|
|
4
4
|
a as ArtifactCard,
|
package/dist/{highlighted-body-OFNGDK62-DzatZiEq.js → highlighted-body-OFNGDK62-BLfYHDYi.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as R$1, L as Li, v as At } from "./RecordSheet-
|
|
1
|
+
import { t as R$1, L as Li, v as At } from "./RecordSheet-DknloKD2.js";
|
|
2
2
|
import { useContext, useState, useEffect } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
var R = ({ code: s, language: e, raw: t, className: h, startLine: d, lineNumbers: m, ...p }) => {
|
package/dist/hooks/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "./RecordSheet-
|
|
2
|
-
import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-
|
|
1
|
+
import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "./RecordSheet-DknloKD2.js";
|
|
2
|
+
import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-B2iPUXiG.js";
|
|
3
3
|
import { u as u3, a as a3, b as b3, c as c3, d as d2, e as e2 } from "./use-sql-table-DWHMqSIq.js";
|
|
4
4
|
import { B, E, z, b as b4, A as A2, C, D as D2, c as c4, F, G, H, I, g as g2, J, K, L, f as f2, M, O, N, a as a4, h as h2, P, i as i2, Q, R as R2, S, T as T2, U, o as o2, p as p2, d as d3, j as j2, k as k2, l as l2, m as m2, n as n2, q as q2, r as r2, t, u as u4, v, w as w2, V, W, e as e3, x, s, y } from "./automations-EgDXJ43_.js";
|
|
5
5
|
import { o as o3, f as f3, a as a5, b as b5, c as c5, d as d4, e as e4, g as g3, h as h3, i as i3, j as j3, k as k3, l as l3, m as m3, n as n3, s as s2 } from "./formatters-D4T821Dv.js";
|
|
@@ -77,6 +77,7 @@ export type RecordAuditLogCsvResult = {
|
|
|
77
77
|
};
|
|
78
78
|
export type AuditLogCsvOptions = {
|
|
79
79
|
collectionLabels?: Readonly<Record<string, string>>;
|
|
80
|
+
activityNouns?: Readonly<Record<string, string>>;
|
|
80
81
|
};
|
|
81
82
|
export declare const normalizeAuditLogPageSize: (value?: number) => number;
|
|
82
83
|
export declare const normalizeAuditLogExportLimit: (value?: number) => number;
|
|
@@ -1 +1 @@
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ANGED
|
@@ -112,13 +112,16 @@
|
|
|
112
112
|
--color-emerald-500: oklch(69.6% .17 162.48);
|
|
113
113
|
--color-emerald-600: oklch(59.6% .145 163.225);
|
|
114
114
|
--color-emerald-800: oklch(43.2% .095 166.913);
|
|
115
|
+
--color-emerald-950: oklch(26.2% .051 172.552);
|
|
115
116
|
--color-sky-500: oklch(68.5% .169 237.323);
|
|
116
117
|
--color-blue-50: oklch(97% .014 254.604);
|
|
117
118
|
--color-blue-200: oklch(88.2% .059 254.128);
|
|
118
119
|
--color-blue-600: oklch(54.6% .245 262.881);
|
|
119
120
|
--color-blue-800: oklch(42.4% .199 265.638);
|
|
121
|
+
--color-rose-50: oklch(96.9% .015 12.422);
|
|
120
122
|
--color-rose-100: oklch(94.1% .03 12.58);
|
|
121
123
|
--color-rose-500: oklch(64.5% .246 16.439);
|
|
124
|
+
--color-rose-950: oklch(27.1% .105 12.094);
|
|
122
125
|
--color-slate-500: oklch(55.4% .046 257.417);
|
|
123
126
|
--color-slate-800: oklch(27.9% .041 260.031);
|
|
124
127
|
--color-black: #000;
|
|
@@ -991,10 +994,6 @@
|
|
|
991
994
|
min-height: calc(var(--spacing) * 0);
|
|
992
995
|
}
|
|
993
996
|
|
|
994
|
-
.min-h-7 {
|
|
995
|
-
min-height: calc(var(--spacing) * 7);
|
|
996
|
-
}
|
|
997
|
-
|
|
998
997
|
.min-h-9 {
|
|
999
998
|
min-height: calc(var(--spacing) * 9);
|
|
1000
999
|
}
|
|
@@ -1111,6 +1110,10 @@
|
|
|
1111
1110
|
width: 8.5rem;
|
|
1112
1111
|
}
|
|
1113
1112
|
|
|
1113
|
+
.w-\[10rem\] {
|
|
1114
|
+
width: 10rem;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1114
1117
|
.w-\[11rem\] {
|
|
1115
1118
|
width: 11rem;
|
|
1116
1119
|
}
|
|
@@ -1920,6 +1923,10 @@
|
|
|
1920
1923
|
background-color: var(--color-red-50);
|
|
1921
1924
|
}
|
|
1922
1925
|
|
|
1926
|
+
.bg-rose-50 {
|
|
1927
|
+
background-color: var(--color-rose-50);
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1923
1930
|
.bg-rose-500 {
|
|
1924
1931
|
background-color: var(--color-rose-500);
|
|
1925
1932
|
}
|
|
@@ -2343,6 +2350,10 @@
|
|
|
2343
2350
|
color: var(--color-emerald-800);
|
|
2344
2351
|
}
|
|
2345
2352
|
|
|
2353
|
+
.text-emerald-950 {
|
|
2354
|
+
color: var(--color-emerald-950);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2346
2357
|
.text-foreground, .text-foreground\/80 {
|
|
2347
2358
|
color: var(--foreground);
|
|
2348
2359
|
}
|
|
@@ -2437,6 +2448,10 @@
|
|
|
2437
2448
|
color: var(--color-rose-100);
|
|
2438
2449
|
}
|
|
2439
2450
|
|
|
2451
|
+
.text-rose-950 {
|
|
2452
|
+
color: var(--color-rose-950);
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2440
2455
|
.text-secondary-foreground {
|
|
2441
2456
|
color: var(--secondary-foreground);
|
|
2442
2457
|
}
|
|
@@ -1019,28 +1019,32 @@ function auditLogSummaryWithCollectionLabel(entry, collectionLabel) {
|
|
|
1019
1019
|
...suffixSegments
|
|
1020
1020
|
];
|
|
1021
1021
|
}
|
|
1022
|
+
const collectionLabelFor = (collection, options = {}) => options.collectionLabels?.[collection]?.trim() || collection;
|
|
1023
|
+
const activityLabelFor = (collection, options = {}) => options.activityNouns?.[collection]?.trim() || options.collectionLabels?.[collection]?.trim() || "";
|
|
1022
1024
|
const summaryText = (entry, options = {}) => {
|
|
1023
1025
|
const collection = auditLogDetailValue(entry, "Collection");
|
|
1024
|
-
const collectionLabel = collection ? options
|
|
1026
|
+
const collectionLabel = collection ? activityLabelFor(collection, options) : "";
|
|
1025
1027
|
const summary = collectionLabel ? auditLogSummaryWithCollectionLabel(entry, collectionLabel) : entry.summary;
|
|
1026
1028
|
return summary.map((segment) => segment.text).join(" ");
|
|
1027
1029
|
};
|
|
1028
1030
|
const protectSpreadsheetCell = (value) => /^[\t\r ]*[=+\-@]/.test(value) ? `'${value}` : value;
|
|
1029
1031
|
const csvCell = (value) => `"${protectSpreadsheetCell(value).replaceAll('"', '""')}"`;
|
|
1030
1032
|
function buildAuditLogCsv(entries, options = {}) {
|
|
1031
|
-
const rows = entries.map(
|
|
1032
|
-
(entry)
|
|
1033
|
+
const rows = entries.map((entry) => {
|
|
1034
|
+
const collectionApiName = auditLogDetailValue(entry, "Collection");
|
|
1035
|
+
return [
|
|
1033
1036
|
entry.occurred_at,
|
|
1034
|
-
|
|
1037
|
+
collectionApiName ? collectionLabelFor(collectionApiName, options) : "",
|
|
1038
|
+
collectionApiName,
|
|
1035
1039
|
auditLogActorLabel(entry.actor),
|
|
1036
1040
|
entry.actor.type,
|
|
1037
1041
|
entry.event,
|
|
1038
1042
|
auditLogDetailValue(entry, "Record ID"),
|
|
1039
1043
|
summaryText(entry, options)
|
|
1040
|
-
].map(csvCell).join(",")
|
|
1041
|
-
);
|
|
1044
|
+
].map(csvCell).join(",");
|
|
1045
|
+
});
|
|
1042
1046
|
return [
|
|
1043
|
-
["time", "
|
|
1047
|
+
["time", "collection_label", "collection_api_name", "actor", "actor_type", "event", "record_id", "summary"].map(csvCell).join(","),
|
|
1044
1048
|
...rows
|
|
1045
1049
|
].join("\n");
|
|
1046
1050
|
}
|
package/package.json
CHANGED