@lumerahq/ui 0.12.0-dev.1 → 0.12.0-dev.2

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 CHANGED
@@ -69,12 +69,14 @@ import { AuditLog } from '@lumerahq/ui';
69
69
  />;
70
70
  ```
71
71
 
72
- The component includes collection, date/time, event, and actor filters; lazy
73
- before/after details; pagination; and CSV export. It also supports controlled
72
+ The component includes collection, date/time, event, and actor filters with
73
+ visible active-filter chips; lazy before/after details; pagination; and CSV
74
+ export with filename/count/truncation feedback. It also supports controlled
74
75
  filters, column and density options, record navigation callbacks, and custom
75
- loading, empty, and error states. If a selected collection has auditing turned
76
- off, existing history remains visible and the component shows a warning that
77
- future changes will not be recorded.
76
+ loading, empty, and error states. Friendly collection labels are used in both
77
+ the collection column and activity text. If a selected collection has auditing
78
+ turned off, existing history remains visible and the component shows a warning
79
+ that future changes will not be recorded.
78
80
 
79
81
  ### Assistant Chat
80
82
 
@@ -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 auditLogDetailValue, e as auditLogActorLabel, n as normalizeRecordAuditCollections, f as normalizeAuditLogFilterState, A as AUDIT_LOG_MAX_COLLECTIONS, b as useAuditLog, h as fetchRecordAuditLogCsv, i as normalizeAuditLogExportLimit, c as useAutomationRun } from "./use-automation-run-D2HediFL.js";
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-DmMpzFCS.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";
@@ -24041,7 +24041,7 @@ var lr = (e) => {
24041
24041
  for (; t > 0 && e[t - 1] === `
24042
24042
  `; ) t--;
24043
24043
  return e.slice(0, t);
24044
- }, cr = lazy(() => import("./highlighted-body-OFNGDK62-Dttr28i2.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
24044
+ }, cr = lazy(() => import("./highlighted-body-OFNGDK62-DzatZiEq.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
24045
24045
  let i = y2(), d2 = useMemo(() => lr(e), [e]), c2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
24046
24046
  `).map((p2) => [{ content: p2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
24047
24047
  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 +24403,7 @@ var vo = ({ children: e, className: t, showControls: o, showCopy: n = true, show
24403
24403
  let l = y2(), i = o && n, d2 = o && r, c2 = o && s2, p2 = i || d2 || c2;
24404
24404
  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
24405
  };
24406
- var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-BxahFUxz.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
24406
+ var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-BPtfcw6Y.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
24407
24407
  function qe(e, t) {
24408
24408
  if (!(e != null && e.position || t != null && t.position)) return true;
24409
24409
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -29550,6 +29550,7 @@ const systemFieldKeys = /* @__PURE__ */ new Set([
29550
29550
  "external_id",
29551
29551
  "lm_provenance"
29552
29552
  ]);
29553
+ const identityFieldKeys = /* @__PURE__ */ new Set(["collection", "collection_id", "record_id"]);
29553
29554
  const fieldKey = (field) => field.key?.trim().toLowerCase() || field.label.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
29554
29555
  const displayFields = (fields, fieldLabels, showSystemFields) => {
29555
29556
  if (!fields) return null;
@@ -29580,6 +29581,25 @@ function FieldList({ fields }) {
29580
29581
  `${field.key || field.label}-${index2}`
29581
29582
  )) });
29582
29583
  }
29584
+ function FieldGroups({ fields }) {
29585
+ const groups = [
29586
+ { title: "Changed fields", fields: [] },
29587
+ { title: "Record identity", fields: [] },
29588
+ { title: "System/debug fields", fields: [] },
29589
+ { title: "Other details", fields: [] }
29590
+ ];
29591
+ for (const field of fields) {
29592
+ const key = fieldKey(field);
29593
+ if (field.changed || field.value.includes("→")) groups[0].fields.push(field);
29594
+ else if (identityFieldKeys.has(key)) groups[1].fields.push(field);
29595
+ else if (systemFieldKeys.has(key)) groups[2].fields.push(field);
29596
+ else groups[3].fields.push(field);
29597
+ }
29598
+ return /* @__PURE__ */ jsx("div", { className: "grid gap-4", children: groups.filter((group) => group.fields.length > 0).map((group) => /* @__PURE__ */ jsxs("section", { className: "min-w-0", children: [
29599
+ /* @__PURE__ */ jsx("p", { className: "mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: group.title }),
29600
+ /* @__PURE__ */ jsx(FieldList, { fields: group.fields })
29601
+ ] }, group.title)) });
29602
+ }
29583
29603
  function SnapshotSide({ label, fields }) {
29584
29604
  return /* @__PURE__ */ jsxs("div", { className: "min-w-0 rounded-xl border bg-background p-3", children: [
29585
29605
  /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
@@ -29589,6 +29609,7 @@ function SnapshotSide({ label, fields }) {
29589
29609
  function AuditLogEntry({
29590
29610
  entry,
29591
29611
  collectionLabel,
29612
+ activityCollectionLabel,
29592
29613
  density,
29593
29614
  showCollectionColumn,
29594
29615
  showActorColumn,
@@ -29607,33 +29628,26 @@ function AuditLogEntry({
29607
29628
  staleTime: Number.POSITIVE_INFINITY,
29608
29629
  retry: false
29609
29630
  });
29610
- const detailFields = displayFields(entry.details, fieldLabels, true) ?? [];
29631
+ const detailFields = displayFields(entry.details, fieldLabels, showSystemFields) ?? [];
29611
29632
  const recordHref = getRecordHref?.(entry)?.trim();
29612
29633
  const rowPadding = density === "comfortable" ? "py-4" : void 0;
29634
+ const summary = activityCollectionLabel ? auditLogSummaryWithCollectionLabel(entry, activityCollectionLabel) : entry.summary;
29613
29635
  const recordAction = recordHref ? /* @__PURE__ */ jsxs(
29614
29636
  "a",
29615
29637
  {
29616
29638
  href: recordHref,
29617
- className: buttonVariants({ variant: "ghost", size: "icon-sm" }),
29639
+ className: buttonVariants({ variant: "ghost", size: "xs", className: "text-xs" }),
29618
29640
  title: "Open record",
29619
29641
  onClick: () => onRecordClick?.(entry),
29620
29642
  children: [
29621
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Open record" }),
29622
- /* @__PURE__ */ jsx(ExternalLink, { "aria-hidden": true })
29643
+ /* @__PURE__ */ jsx(ExternalLink, { "aria-hidden": true }),
29644
+ /* @__PURE__ */ jsx("span", { children: "Open record" })
29623
29645
  ]
29624
29646
  }
29625
- ) : onRecordClick ? /* @__PURE__ */ jsx(
29626
- Button2,
29627
- {
29628
- type: "button",
29629
- variant: "ghost",
29630
- size: "icon-sm",
29631
- "aria-label": "Open record",
29632
- title: "Open record",
29633
- onClick: () => onRecordClick(entry),
29634
- children: /* @__PURE__ */ jsx(ExternalLink, {})
29635
- }
29636
- ) : null;
29647
+ ) : onRecordClick ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "ghost", size: "xs", title: "Open record", onClick: () => onRecordClick(entry), children: [
29648
+ /* @__PURE__ */ jsx(ExternalLink, {}),
29649
+ "Open record"
29650
+ ] }) : null;
29637
29651
  return /* @__PURE__ */ jsxs(Fragment, { children: [
29638
29652
  /* @__PURE__ */ jsxs(TableRow, { "aria-expanded": expanded, children: [
29639
29653
  /* @__PURE__ */ jsx(TableCell, { className: cn$2("text-xs text-muted-foreground", rowPadding), children: /* @__PURE__ */ jsx("time", { dateTime: entry.occurred_at, title: new Date(entry.occurred_at).toLocaleString(), children: relativeTime(entry.occurred_at) }) }),
@@ -29647,7 +29661,7 @@ function AuditLogEntry({
29647
29661
  ) : null,
29648
29662
  /* @__PURE__ */ jsx(TableCell, { className: cn$2("min-w-64 whitespace-normal", rowPadding), children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2.5", children: [
29649
29663
  /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn$2("mt-1.5 size-2 shrink-0 rounded-full", markerStyles[entry.event]) }),
29650
- /* @__PURE__ */ jsx("span", { children: entry.summary.map((segment, index2) => /* @__PURE__ */ jsxs("span", { children: [
29664
+ /* @__PURE__ */ jsx("span", { children: summary.map((segment, index2) => /* @__PURE__ */ jsxs("span", { children: [
29651
29665
  index2 > 0 ? " " : "",
29652
29666
  /* @__PURE__ */ jsx("span", { className: segment.emphasis === "strong" ? "font-semibold" : void 0, children: segment.text })
29653
29667
  ] }, `${segment.text}-${index2}`)) })
@@ -29677,7 +29691,7 @@ function AuditLogEntry({
29677
29691
  colSpan: columnCount,
29678
29692
  className: cn$2("bg-muted/20 whitespace-normal", density === "comfortable" ? "p-5" : "p-4"),
29679
29693
  children: [
29680
- detailFields.length > 0 ? /* @__PURE__ */ jsx(FieldList, { fields: detailFields }) : null,
29694
+ detailFields.length > 0 ? /* @__PURE__ */ jsx(FieldGroups, { fields: detailFields }) : null,
29681
29695
  entry.has_snapshot ? /* @__PURE__ */ jsxs("div", { className: cn$2(detailFields.length > 0 && "mt-4 border-t pt-4"), children: [
29682
29696
  /* @__PURE__ */ jsx("p", { className: "mb-3 text-sm font-medium", children: "Before and after" }),
29683
29697
  snapshotQuery.isLoading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 py-4 text-sm text-muted-foreground", children: [
@@ -30518,6 +30532,51 @@ const MenuGroupLabel = /* @__PURE__ */ React.forwardRef(function MenuGroupLabelC
30518
30532
  });
30519
30533
  });
30520
30534
  if (process.env.NODE_ENV !== "production") MenuGroupLabel.displayName = "MenuGroupLabel";
30535
+ const MenuItem = /* @__PURE__ */ React.forwardRef(function MenuItem2(componentProps, forwardedRef) {
30536
+ const {
30537
+ render,
30538
+ className,
30539
+ id: idProp,
30540
+ label,
30541
+ nativeButton = false,
30542
+ disabled = false,
30543
+ closeOnClick = true,
30544
+ ...elementProps
30545
+ } = componentProps;
30546
+ const listItem2 = useCompositeListItem({
30547
+ label
30548
+ });
30549
+ const menuPositionerContext = useMenuPositionerContext(true);
30550
+ const id = useBaseUiId(idProp);
30551
+ const {
30552
+ store
30553
+ } = useMenuRootContext();
30554
+ const highlighted = store.useState("isActive", listItem2.index);
30555
+ const itemProps = store.useState("itemProps");
30556
+ const {
30557
+ getItemProps,
30558
+ itemRef
30559
+ } = useMenuItem({
30560
+ closeOnClick,
30561
+ disabled,
30562
+ highlighted,
30563
+ id,
30564
+ store,
30565
+ nativeButton,
30566
+ nodeId: menuPositionerContext?.nodeId,
30567
+ itemMetadata: REGULAR_ITEM
30568
+ });
30569
+ const state = React.useMemo(() => ({
30570
+ disabled,
30571
+ highlighted
30572
+ }), [disabled, highlighted]);
30573
+ return useRenderElement("div", componentProps, {
30574
+ state,
30575
+ props: [itemProps, elementProps, getItemProps],
30576
+ ref: [itemRef, forwardedRef, listItem2.ref]
30577
+ });
30578
+ });
30579
+ if (process.env.NODE_ENV !== "production") MenuItem.displayName = "MenuItem";
30521
30580
  const EMPTY = 0;
30522
30581
  class Timeout {
30523
30582
  static create() {
@@ -39681,6 +39740,26 @@ function DropdownMenuLabel({
39681
39740
  }
39682
39741
  );
39683
39742
  }
39743
+ function DropdownMenuItem({
39744
+ className,
39745
+ inset,
39746
+ variant = "default",
39747
+ ...props
39748
+ }) {
39749
+ return /* @__PURE__ */ jsx(
39750
+ MenuItem,
39751
+ {
39752
+ "data-slot": "dropdown-menu-item",
39753
+ "data-inset": inset,
39754
+ "data-variant": variant,
39755
+ className: cn$2(
39756
+ "group/dropdown-menu-item relative flex cursor-default items-center gap-2.5 rounded-2xl px-3 py-2 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
39757
+ className
39758
+ ),
39759
+ ...props
39760
+ }
39761
+ );
39762
+ }
39684
39763
  function DropdownMenuCheckboxItem({
39685
39764
  className,
39686
39765
  children: children2,
@@ -39713,6 +39792,16 @@ function DropdownMenuCheckboxItem({
39713
39792
  }
39714
39793
  );
39715
39794
  }
39795
+ function DropdownMenuSeparator({ className, ...props }) {
39796
+ return /* @__PURE__ */ jsx(
39797
+ Separator$1,
39798
+ {
39799
+ "data-slot": "dropdown-menu-separator",
39800
+ className: cn$2("-mx-1.5 my-1.5 h-px bg-border/50", className),
39801
+ ...props
39802
+ }
39803
+ );
39804
+ }
39716
39805
  let FieldControlDataAttributes = /* @__PURE__ */ (function(FieldControlDataAttributes2) {
39717
39806
  FieldControlDataAttributes2["disabled"] = "data-disabled";
39718
39807
  FieldControlDataAttributes2["valid"] = "data-valid";
@@ -42068,6 +42157,18 @@ const dateTimeInputValue = (value) => {
42068
42157
  const local = new Date(parsed.getTime() - parsed.getTimezoneOffset() * 6e4);
42069
42158
  return local.toISOString().slice(0, 16);
42070
42159
  };
42160
+ const formatDateTime = (value) => {
42161
+ if (!value) return "";
42162
+ const parsed = new Date(value);
42163
+ if (Number.isNaN(parsed.getTime())) return value;
42164
+ return new Intl.DateTimeFormat(void 0, {
42165
+ month: "short",
42166
+ day: "numeric",
42167
+ year: "numeric",
42168
+ hour: "numeric",
42169
+ minute: "2-digit"
42170
+ }).format(parsed);
42171
+ };
42071
42172
  const filenameFor = (collections) => {
42072
42173
  const prefix = collections.length === 1 ? collections[0] : "record";
42073
42174
  const safePrefix = prefix.trim().replace(/[^a-zA-Z0-9_-]+/g, "-") || "record";
@@ -42083,11 +42184,48 @@ const downloadCsv = (filename, csv) => {
42083
42184
  link2.remove();
42084
42185
  setTimeout(() => URL.revokeObjectURL(url), 0);
42085
42186
  };
42086
- const defaultState = (icon, title, description) => /* @__PURE__ */ jsxs("div", { children: [
42187
+ const defaultState = (icon, title, description, action) => /* @__PURE__ */ jsxs("div", { children: [
42087
42188
  icon,
42088
42189
  /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: title }),
42089
- /* @__PURE__ */ jsx("p", { className: "mx-auto mt-1 max-w-sm text-xs text-muted-foreground", children: description })
42190
+ /* @__PURE__ */ jsx("p", { className: "mx-auto mt-1 max-w-sm text-xs text-muted-foreground", children: description }),
42191
+ action ? /* @__PURE__ */ jsx("div", { className: "mt-3 flex justify-center gap-2", children: action }) : null
42090
42192
  ] });
42193
+ const errorCopyFor = (status) => {
42194
+ if (status === 400) {
42195
+ return {
42196
+ title: "Current filters could not be applied",
42197
+ description: "The audit API rejected the current filter values. Reset filters or adjust the date range."
42198
+ };
42199
+ }
42200
+ if (status === 401) {
42201
+ return {
42202
+ title: "Session is not authorized",
42203
+ description: "Refresh the app and sign in again before loading audit activity."
42204
+ };
42205
+ }
42206
+ if (status === 403) {
42207
+ return {
42208
+ title: "Activity is not available",
42209
+ description: "You need read access to every selected collection."
42210
+ };
42211
+ }
42212
+ if (status === 404) {
42213
+ return {
42214
+ title: "Selected collection was not found",
42215
+ description: "Check the selected collection names or reset filters."
42216
+ };
42217
+ }
42218
+ if (status && status >= 500) {
42219
+ return {
42220
+ title: "Audit endpoint is unavailable",
42221
+ description: "Refresh activity. If it still fails, the audit service may be down."
42222
+ };
42223
+ }
42224
+ return {
42225
+ title: "Could not reach audit activity",
42226
+ description: "Refresh activity or reset filters and try again."
42227
+ };
42228
+ };
42091
42229
  function AuditLog({
42092
42230
  collections,
42093
42231
  collectionLabels,
@@ -42155,7 +42293,9 @@ function AuditLog({
42155
42293
  );
42156
42294
  }, [auditLog.entries]);
42157
42295
  const hasFilters = selectedCollections.length !== availableCollections.length || Boolean(filterState.event || filterState.actor || filterState.since || filterState.until);
42296
+ const hasDateFilter = Boolean(filterState.since || filterState.until);
42158
42297
  const status = auditLog.error?.status;
42298
+ const errorCopy = errorCopyFor(status);
42159
42299
  const exportMessage = exportStatus.key === filterKey ? exportStatus.message : "";
42160
42300
  const selectedActor = actorOptions.find(([actorID2]) => actorID2 === actor)?.[1];
42161
42301
  const selectedActorLabel = actor === "all" ? "All actors" : selectedActor ? auditLogActorLabel(selectedActor) : "Selected actor";
@@ -42177,16 +42317,59 @@ function AuditLog({
42177
42317
  });
42178
42318
  };
42179
42319
  const resetFilters = () => setFilters(normalizeAuditLogFilterState(availableCollections));
42320
+ const resetFiltersFromPointer = () => resetFilters();
42321
+ const filterChips = [];
42322
+ if (selectedCollections.length !== availableCollections.length) {
42323
+ const labels = selectedCollections.map(labelForCollection);
42324
+ filterChips.push({
42325
+ key: "collections",
42326
+ label: `Collections: ${labels.length <= 2 ? labels.join(", ") : `${labels.length} collections`}`,
42327
+ onClear: () => setFilters({ ...filterState, collections: availableCollections, actor: void 0 })
42328
+ });
42329
+ }
42330
+ if (filterState.since) {
42331
+ filterChips.push({
42332
+ key: "since",
42333
+ label: `From ${formatDateTime(filterState.since)}`,
42334
+ onClear: () => setFilters({ ...filterState, since: void 0 })
42335
+ });
42336
+ }
42337
+ if (filterState.until) {
42338
+ filterChips.push({
42339
+ key: "until",
42340
+ label: `Until ${formatDateTime(filterState.until)}`,
42341
+ onClear: () => setFilters({ ...filterState, until: void 0 })
42342
+ });
42343
+ }
42344
+ if (filterState.event) {
42345
+ filterChips.push({
42346
+ key: "event",
42347
+ label: `Event: ${filterState.event[0].toUpperCase()}${filterState.event.slice(1)}`,
42348
+ onClear: () => setFilters({ ...filterState, event: void 0 })
42349
+ });
42350
+ }
42351
+ if (filterState.actor) {
42352
+ filterChips.push({
42353
+ key: "actor",
42354
+ label: `Actor: ${selectedActorLabel}`,
42355
+ onClear: () => setFilters({ ...filterState, actor: void 0 })
42356
+ });
42357
+ }
42358
+ const filterSummary = filterChips.map((chip) => chip.label).join("; ") || "No filters applied";
42180
42359
  const handleExport = async () => {
42181
42360
  const limit = normalizeAuditLogExportLimit(exportMaxRows);
42182
42361
  setIsExporting(true);
42183
42362
  setExportStatus({ key: filterKey, message: "" });
42184
42363
  try {
42185
- const result = await fetchRecordAuditLogCsv({ collections: selectedCollections, ...requestFilters }, limit);
42186
- downloadCsv(exportFilename?.trim() || filenameFor(selectedCollections), result.csv);
42364
+ const result = await fetchRecordAuditLogCsv({ collections: selectedCollections, ...requestFilters }, limit, {
42365
+ collectionLabels
42366
+ });
42367
+ const filename = exportFilename?.trim() || filenameFor(selectedCollections);
42368
+ downloadCsv(filename, result.csv);
42369
+ const rowText = `${result.count.toLocaleString()} ${result.count === 1 ? "row" : "rows"}`;
42187
42370
  setExportStatus({
42188
42371
  key: filterKey,
42189
- message: result.truncated ? `Exported the first ${limit.toLocaleString()} entries.` : `Exported ${result.count.toLocaleString()} ${result.count === 1 ? "entry" : "entries"}.`
42372
+ message: `${filename}: exported ${rowText}; ${result.truncated ? `truncated to first ${limit.toLocaleString()} rows` : "not truncated"}; ${hasFilters ? `filters: ${filterSummary}` : "no filters applied"}.`
42190
42373
  });
42191
42374
  } catch {
42192
42375
  setExportStatus({ key: filterKey, message: "Could not export the activity. Try again." });
@@ -42244,22 +42427,31 @@ function AuditLog({
42244
42427
  ]
42245
42428
  }
42246
42429
  ),
42247
- /* @__PURE__ */ jsx(DropdownMenuContent, { align: "start", className: "w-64", children: /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
42248
- /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Select collections" }),
42249
- availableCollections.map((collection) => {
42250
- const checked = selectedCollections.includes(collection);
42251
- return /* @__PURE__ */ jsx(
42252
- DropdownMenuCheckboxItem,
42253
- {
42254
- checked,
42255
- disabled: checked && selectedCollections.length === 1,
42256
- onCheckedChange: (value) => toggleCollection(collection, value === true),
42257
- children: /* @__PURE__ */ jsx("span", { className: "truncate", title: collection, children: labelForCollection(collection) })
42258
- },
42259
- collection
42260
- );
42261
- })
42262
- ] }) })
42430
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", className: "w-64", children: [
42431
+ /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
42432
+ /* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Select collections" }),
42433
+ availableCollections.map((collection) => {
42434
+ const checked = selectedCollections.includes(collection);
42435
+ return /* @__PURE__ */ jsx(
42436
+ DropdownMenuCheckboxItem,
42437
+ {
42438
+ checked,
42439
+ disabled: checked && selectedCollections.length === 1,
42440
+ onCheckedChange: (value) => toggleCollection(collection, value === true),
42441
+ children: /* @__PURE__ */ jsx("span", { className: "truncate", title: collection, children: labelForCollection(collection) })
42442
+ },
42443
+ collection
42444
+ );
42445
+ })
42446
+ ] }),
42447
+ hasFilters ? /* @__PURE__ */ jsxs(Fragment, { children: [
42448
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
42449
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: resetFilters, children: [
42450
+ /* @__PURE__ */ jsx(FunnelX, {}),
42451
+ "Reset filters"
42452
+ ] })
42453
+ ] }) : null
42454
+ ] })
42263
42455
  ] })
42264
42456
  ] }) : null,
42265
42457
  /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
@@ -42331,11 +42523,45 @@ function AuditLog({
42331
42523
  )
42332
42524
  ] }),
42333
42525
  /* @__PURE__ */ jsx("span", { className: "mb-2 text-[11px] text-muted-foreground", children: "Dates use local time" }),
42334
- hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "ghost", size: "sm", className: "mb-px", onClick: resetFilters, children: [
42335
- /* @__PURE__ */ jsx(FunnelX, {}),
42336
- " Reset filters"
42337
- ] }) : null
42526
+ hasFilters ? /* @__PURE__ */ jsxs(
42527
+ Button2,
42528
+ {
42529
+ type: "button",
42530
+ variant: "ghost",
42531
+ size: "sm",
42532
+ className: "mb-px",
42533
+ onPointerDown: resetFiltersFromPointer,
42534
+ onClick: resetFilters,
42535
+ children: [
42536
+ /* @__PURE__ */ jsx(FunnelX, {}),
42537
+ " Reset filters"
42538
+ ]
42539
+ }
42540
+ ) : null
42338
42541
  ] }),
42542
+ filterChips.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b bg-muted/10 px-5 py-2 text-xs", children: [
42543
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground", children: "Active filters" }),
42544
+ filterChips.map((chip) => /* @__PURE__ */ jsxs(
42545
+ "span",
42546
+ {
42547
+ className: "inline-flex h-6 max-w-full items-center gap-1 rounded-full border bg-background px-2 text-foreground",
42548
+ children: [
42549
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: chip.label }),
42550
+ /* @__PURE__ */ jsx(
42551
+ "button",
42552
+ {
42553
+ type: "button",
42554
+ className: "rounded-full text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:outline-none",
42555
+ "aria-label": `Clear ${chip.label}`,
42556
+ onClick: chip.onClear,
42557
+ children: /* @__PURE__ */ jsx(X$2, { className: "size-3" })
42558
+ }
42559
+ )
42560
+ ]
42561
+ },
42562
+ chip.key
42563
+ ))
42564
+ ] }) : null,
42339
42565
  disabledCollections.length > 0 && !auditLog.error ? /* @__PURE__ */ jsxs("div", { className: "flex gap-2 border-b bg-amber-50 px-5 py-2.5 text-xs text-amber-950", role: "status", children: [
42340
42566
  /* @__PURE__ */ jsx(CircleAlert, { className: "mt-0.5 size-4 shrink-0" }),
42341
42567
  /* @__PURE__ */ jsxs("p", { children: [
@@ -42350,7 +42576,7 @@ function AuditLog({
42350
42576
  showCollectionColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Collection" }) : null,
42351
42577
  /* @__PURE__ */ jsx(TableHead, { className: "text-xs text-muted-foreground", children: "Activity" }),
42352
42578
  showActorColumn ? /* @__PURE__ */ jsx(TableHead, { className: "w-48 text-xs text-muted-foreground", children: "Actor" }) : null,
42353
- /* @__PURE__ */ jsx(TableHead, { className: getRecordHref || onRecordClick ? "w-20" : "w-12", children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Actions" }) })
42579
+ /* @__PURE__ */ jsx(TableHead, { className: getRecordHref || onRecordClick ? "w-36" : "w-12", children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Actions" }) })
42354
42580
  ] }) }),
42355
42581
  /* @__PURE__ */ jsx(TableBody, { children: auditLog.isLoading ? loadingState !== void 0 ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: loadingState }) }) : [0, 1, 2].map((item) => /* @__PURE__ */ jsxs(TableRow, { children: [
42356
42582
  /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" }) }),
@@ -42360,17 +42586,32 @@ function AuditLog({
42360
42586
  /* @__PURE__ */ jsx(TableCell, {})
42361
42587
  ] }, item)) : configurationError || auditLog.error ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: auditLog.error && errorState ? errorState(auditLog.error) : defaultState(
42362
42588
  /* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
42363
- configurationError ? "Audit log is not configured" : status === 403 ? "Activity is not available" : "Could not load activity",
42364
- configurationError || (status === 403 ? "You need read access to every selected collection." : "Refresh the activity to try again.")
42589
+ configurationError ? "Audit log is not configured" : errorCopy.title,
42590
+ configurationError || `${errorCopy.description} Filters: ${filterSummary}.`,
42591
+ configurationError ? void 0 : /* @__PURE__ */ jsxs(Fragment, { children: [
42592
+ hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "outline", size: "sm", onClick: resetFilters, children: [
42593
+ /* @__PURE__ */ jsx(FunnelX, {}),
42594
+ " Reset filters"
42595
+ ] }) : null,
42596
+ /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "ghost", size: "sm", onClick: () => void auditLog.refresh(), children: [
42597
+ /* @__PURE__ */ jsx(RefreshCw, {}),
42598
+ " Refresh"
42599
+ ] })
42600
+ ] })
42365
42601
  ) }) }) : auditLog.entries.length === 0 ? /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan: columnCount, className: "h-48 whitespace-normal text-center", children: emptyState ?? defaultState(
42366
42602
  /* @__PURE__ */ jsx(History, { className: "mx-auto mb-3 size-8 text-muted-foreground/60" }),
42367
- "No activity to show",
42368
- disabledCollections.length > 0 ? "Auditing is off, and no existing changes match the current filters." : "No changes match the current filters."
42603
+ hasDateFilter ? "No activity in this date range" : hasFilters ? "No activity matches these filters" : "No activity to show",
42604
+ hasDateFilter ? "Try expanding the date range or reset filters." : disabledCollections.length > 0 ? "Auditing is off, and no existing changes match the current filters." : hasFilters ? "Try removing a filter or reset filters." : "No record changes have been logged yet.",
42605
+ hasFilters ? /* @__PURE__ */ jsxs(Button2, { type: "button", variant: "outline", size: "sm", onClick: resetFilters, children: [
42606
+ /* @__PURE__ */ jsx(FunnelX, {}),
42607
+ " Reset filters"
42608
+ ] }) : void 0
42369
42609
  ) }) }) : auditLog.entries.map((entry) => /* @__PURE__ */ jsx(
42370
42610
  AuditLogEntry,
42371
42611
  {
42372
42612
  entry,
42373
42613
  collectionLabel: labelForCollection(auditLogDetailValue(entry, "Collection")),
42614
+ activityCollectionLabel: collectionLabels?.[auditLogDetailValue(entry, "Collection")]?.trim(),
42374
42615
  density,
42375
42616
  showCollectionColumn,
42376
42617
  showActorColumn,
@@ -1 +1 @@
1
- {"version":3,"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AAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC;IACzC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA4FF,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,gBAAgB,EAChB,OAAO,EAAE,iBAAiB,EAC1B,cAAc,EACd,eAAe,EACf,QAAa,EACb,aAAa,EACb,cAAc,EACd,KAAkB,EAClB,OAAmB,EACnB,oBAA2B,EAC3B,eAAsB,EACtB,gBAAuB,EACvB,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,GACV,EAAE,aAAa,2CAwef"}
@@ -3,6 +3,7 @@ import { AuditLogEntry as AuditLogEntryData } from '../../lib/audit-log';
3
3
  type AuditLogEntryProps = {
4
4
  entry: AuditLogEntryData;
5
5
  collectionLabel: string;
6
+ activityCollectionLabel?: string;
6
7
  density: AuditLogDensity;
7
8
  showCollectionColumn: boolean;
8
9
  showActorColumn: boolean;
@@ -12,6 +13,6 @@ type AuditLogEntryProps = {
12
13
  getRecordHref?: (entry: AuditLogEntryData) => string | undefined;
13
14
  onRecordClick?: (entry: AuditLogEntryData) => void;
14
15
  };
15
- export declare function AuditLogEntry({ entry, collectionLabel, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, columnCount, getRecordHref, onRecordClick, }: AuditLogEntryProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function AuditLogEntry({ entry, collectionLabel, activityCollectionLabel, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, columnCount, getRecordHref, onRecordClick, }: AuditLogEntryProps): import("react/jsx-runtime").JSX.Element;
16
17
  export {};
17
18
  //# 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,iCAAi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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,eAAe,EACf,uBAAuB,EACvB,OAAO,EACP,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,GACd,EAAE,kBAAkB,2CA4HpB"}
@@ -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-gFscQDNL.js";
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-B0IaPMZs.js";
2
2
  export {
3
3
  A as AgentChat,
4
4
  a as ArtifactCard,
@@ -1,4 +1,4 @@
1
- import { t as R$1, L as Li, v as At } from "./RecordSheet-gFscQDNL.js";
1
+ import { t as R$1, L as Li, v as At } from "./RecordSheet-B0IaPMZs.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 }) => {
@@ -1,4 +1,4 @@
1
- import { u, a, b, c } from "../use-automation-run-D2HediFL.js";
1
+ import { u, a, b, c } from "../use-automation-run-DmMpzFCS.js";
2
2
  import { u as u2, a as a2, b as b2, c as c2, d, e } from "../use-sql-table-DWHMqSIq.js";
3
3
  export {
4
4
  u as useAgentChat,
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-gFscQDNL.js";
2
- import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-D2HediFL.js";
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-B0IaPMZs.js";
2
+ import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-DmMpzFCS.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";
@@ -75,6 +75,9 @@ export type RecordAuditLogCsvResult = {
75
75
  count: number;
76
76
  truncated: boolean;
77
77
  };
78
+ export type AuditLogCsvOptions = {
79
+ collectionLabels?: Readonly<Record<string, string>>;
80
+ };
78
81
  export declare const normalizeAuditLogPageSize: (value?: number) => number;
79
82
  export declare const normalizeAuditLogExportLimit: (value?: number) => number;
80
83
  export declare const auditLogActorLabel: (actor: AuditLogActor) => string;
@@ -84,5 +87,6 @@ export declare function normalizeAuditLogFilterState(collections: readonly strin
84
87
  /** Build a request scoped to one or more user-defined collections. */
85
88
  export declare function buildRecordAuditLogPath(params: ListRecordAuditLogParams): string;
86
89
  export declare const auditLogDetailValue: (entry: AuditLogEntry, label: string) => string;
87
- export declare function buildAuditLogCsv(entries: AuditLogEntry[]): string;
90
+ export declare function auditLogSummaryWithCollectionLabel(entry: AuditLogEntry, collectionLabel: string): AuditLogSummarySegment[];
91
+ export declare function buildAuditLogCsv(entries: AuditLogEntry[], options?: AuditLogCsvOptions): string;
88
92
  //# sourceMappingURL=audit-log-core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit-log-core.d.ts","sourceRoot":"","sources":["../../src/lib/audit-log-core.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,E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,EAAE,CAUxF;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,GAAE,OAAO,CAAC,mBAAmB,CAAM,GACzC,mBAAmB,CAcrB;AAED,sEAAsE;AACtE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM,CAqBhF;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,aAAa,EAAE,OAAO,MAAM,KAAG,MACP,CAAC;AAEpE,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,aAAa,EACpB,eAAe,EAAE,MAAM,GACtB,sBAAsB,EAAE,CAe1B;AAaD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAkBnG"}
@@ -1,7 +1,7 @@
1
- import { AuditLogListResponse, AuditLogSnapshotResponse, AuditLogStore, ListRecordAuditLogParams, RecordAuditLogCsvResult } from './audit-log-core';
2
- export { AUDIT_LOG_EXPORT_LIMIT, AUDIT_LOG_MAX_COLLECTIONS, type AuditLogActor, type AuditLogCollectionStatus, type AuditLogEntry, type AuditLogEvent, type AuditLogField, type AuditLogFilterState, type AuditLogFilters, type AuditLogListResponse, auditLogActorLabel, auditLogDetailValue, normalizeAuditLogExportLimit, normalizeAuditLogFilterState, normalizeAuditLogPageSize, normalizeRecordAuditCollections, } from './audit-log-core';
1
+ import { AuditLogCsvOptions, AuditLogListResponse, AuditLogSnapshotResponse, AuditLogStore, ListRecordAuditLogParams, RecordAuditLogCsvResult } from './audit-log-core';
2
+ export { AUDIT_LOG_EXPORT_LIMIT, AUDIT_LOG_MAX_COLLECTIONS, type AuditLogActor, type AuditLogCollectionStatus, type AuditLogCsvOptions, type AuditLogEntry, type AuditLogEvent, type AuditLogField, type AuditLogFilterState, type AuditLogFilters, type AuditLogListResponse, auditLogActorLabel, auditLogDetailValue, auditLogSummaryWithCollectionLabel, normalizeAuditLogExportLimit, normalizeAuditLogFilterState, normalizeAuditLogPageSize, normalizeRecordAuditCollections, } from './audit-log-core';
3
3
  export declare function listRecordAuditLog(params: ListRecordAuditLogParams): Promise<AuditLogListResponse>;
4
4
  export declare function getRecordAuditLogSnapshot(id: string, store: AuditLogStore): Promise<AuditLogSnapshotResponse>;
5
5
  /** Fetch the current filtered feed page-by-page, capped defensively at 10,000 rows. */
6
- export declare function fetchRecordAuditLogCsv(params: Omit<ListRecordAuditLogParams, 'cursor' | 'limit'>, maxRows?: number): Promise<RecordAuditLogCsvResult>;
6
+ export declare function fetchRecordAuditLogCsv(params: Omit<ListRecordAuditLogParams, 'cursor' | 'limit'>, maxRows?: number, options?: AuditLogCsvOptions): Promise<RecordAuditLogCsvResult>;
7
7
  //# sourceMappingURL=audit-log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/lib/audit-log.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAGlB,KAAK,wBAAwB,EAE7B,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,kBAAkB,CAAC;AAE1B,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAExG;AAED,wBAAsB,yBAAyB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,wBAAwB,CAAC,CASnH;AAED,uFAAuF;AACvF,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,OAAO,CAAC,EAC1D,OAAO,SAAyB,GAC/B,OAAO,CAAC,uBAAuB,CAAC,CA2BlC"}
1
+ {"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/lib/audit-log.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAGlB,KAAK,wBAAwB,EAE7B,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,kCAAkC,EAClC,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,kBAAkB,CAAC;AAE1B,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAExG;AAED,wBAAsB,yBAAyB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,wBAAwB,CAAC,CASnH;AAED,uFAAuF;AACvF,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,OAAO,CAAC,EAC1D,OAAO,SAAyB,EAChC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,uBAAuB,CAAC,CA2BlC"}
@@ -0,0 +1,4 @@
1
+ import { s } from "./RecordSheet-B0IaPMZs.js";
2
+ export {
3
+ s as Mermaid
4
+ };
package/dist/ui.css CHANGED
@@ -1087,6 +1087,10 @@
1087
1087
  width: calc(var(--spacing) * 32);
1088
1088
  }
1089
1089
 
1090
+ .w-36 {
1091
+ width: calc(var(--spacing) * 36);
1092
+ }
1093
+
1090
1094
  .w-48 {
1091
1095
  width: calc(var(--spacing) * 48);
1092
1096
  }
@@ -1848,7 +1852,17 @@
1848
1852
  }
1849
1853
  }
1850
1854
 
1851
- .bg-muted, .bg-muted\/20 {
1855
+ .bg-muted, .bg-muted\/10 {
1856
+ background-color: var(--muted);
1857
+ }
1858
+
1859
+ @supports (color: color-mix(in lab, red, red)) {
1860
+ .bg-muted\/10 {
1861
+ background-color: color-mix(in oklab, var(--muted) 10%, transparent);
1862
+ }
1863
+ }
1864
+
1865
+ .bg-muted\/20 {
1852
1866
  background-color: var(--muted);
1853
1867
  }
1854
1868
 
@@ -3201,6 +3215,16 @@
3201
3215
  }
3202
3216
  }
3203
3217
 
3218
+ .focus-visible\:ring-ring\/40:focus-visible {
3219
+ --tw-ring-color: var(--ring);
3220
+ }
3221
+
3222
+ @supports (color: color-mix(in lab, red, red)) {
3223
+ .focus-visible\:ring-ring\/40:focus-visible {
3224
+ --tw-ring-color: color-mix(in oklab, var(--ring) 40%, transparent);
3225
+ }
3226
+ }
3227
+
3204
3228
  .focus-visible\:ring-ring\/50:focus-visible {
3205
3229
  --tw-ring-color: var(--ring);
3206
3230
  }
@@ -3211,6 +3235,11 @@
3211
3235
  }
3212
3236
  }
3213
3237
 
3238
+ .focus-visible\:outline-none:focus-visible {
3239
+ --tw-outline-style: none;
3240
+ outline-style: none;
3241
+ }
3242
+
3214
3243
  .active\:scale-95:active {
3215
3244
  --tw-scale-x: 95%;
3216
3245
  --tw-scale-y: 95%;
@@ -1004,11 +1004,30 @@ function buildRecordAuditLogPath(params) {
1004
1004
  if (params.until?.trim()) query.set("until", params.until.trim());
1005
1005
  return `/audit-log?${query.toString()}`;
1006
1006
  }
1007
- const summaryText = (entry) => entry.summary.map((segment) => segment.text).join(" ");
1008
1007
  const auditLogDetailValue = (entry, label) => entry.details.find((field) => field.label === label)?.value ?? "";
1008
+ function auditLogSummaryWithCollectionLabel(entry, collectionLabel) {
1009
+ const label = collectionLabel.trim();
1010
+ if (!label) return entry.summary;
1011
+ const recordSegment = entry.summary.find((segment) => segment.emphasis === "strong");
1012
+ const suffixSegments = entry.summary.filter(
1013
+ (segment) => segment.emphasis === "none" && /^\(.+\)$/.test(segment.text.trim())
1014
+ );
1015
+ const eventLabel = entry.event[0].toUpperCase() + entry.event.slice(1);
1016
+ return [
1017
+ { text: `${eventLabel} ${label}`, emphasis: "none" },
1018
+ ...recordSegment ? [recordSegment] : [],
1019
+ ...suffixSegments
1020
+ ];
1021
+ }
1022
+ const summaryText = (entry, options = {}) => {
1023
+ const collection = auditLogDetailValue(entry, "Collection");
1024
+ const collectionLabel = collection ? options.collectionLabels?.[collection]?.trim() : "";
1025
+ const summary = collectionLabel ? auditLogSummaryWithCollectionLabel(entry, collectionLabel) : entry.summary;
1026
+ return summary.map((segment) => segment.text).join(" ");
1027
+ };
1009
1028
  const protectSpreadsheetCell = (value) => /^[\t\r ]*[=+\-@]/.test(value) ? `'${value}` : value;
1010
1029
  const csvCell = (value) => `"${protectSpreadsheetCell(value).replaceAll('"', '""')}"`;
1011
- function buildAuditLogCsv(entries) {
1030
+ function buildAuditLogCsv(entries, options = {}) {
1012
1031
  const rows = entries.map(
1013
1032
  (entry) => [
1014
1033
  entry.occurred_at,
@@ -1017,7 +1036,7 @@ function buildAuditLogCsv(entries) {
1017
1036
  entry.actor.type,
1018
1037
  entry.event,
1019
1038
  auditLogDetailValue(entry, "Record ID"),
1020
- summaryText(entry)
1039
+ summaryText(entry, options)
1021
1040
  ].map(csvCell).join(",")
1022
1041
  );
1023
1042
  return [
@@ -1038,7 +1057,7 @@ async function getRecordAuditLogSnapshot(id, store) {
1038
1057
  { method: "GET" }
1039
1058
  );
1040
1059
  }
1041
- async function fetchRecordAuditLogCsv(params, maxRows = AUDIT_LOG_EXPORT_LIMIT) {
1060
+ async function fetchRecordAuditLogCsv(params, maxRows = AUDIT_LOG_EXPORT_LIMIT, options = {}) {
1042
1061
  const limit = normalizeAuditLogExportLimit(maxRows);
1043
1062
  const entries = [];
1044
1063
  let cursor = "";
@@ -1061,7 +1080,7 @@ async function fetchRecordAuditLogCsv(params, maxRows = AUDIT_LOG_EXPORT_LIMIT)
1061
1080
  }
1062
1081
  cursor = nextCursor;
1063
1082
  }
1064
- return { csv: buildAuditLogCsv(entries), count: entries.length, truncated };
1083
+ return { csv: buildAuditLogCsv(entries, options), count: entries.length, truncated };
1065
1084
  }
1066
1085
  function useAuditLog(collections, filters = {}, options = {}) {
1067
1086
  const normalizedCollections = normalizeRecordAuditCollections(collections);
@@ -1240,12 +1259,13 @@ export {
1240
1259
  useAgentChatSessions as a,
1241
1260
  useAuditLog as b,
1242
1261
  useAutomationRun as c,
1243
- auditLogDetailValue as d,
1244
- auditLogActorLabel as e,
1245
- normalizeAuditLogFilterState as f,
1262
+ auditLogSummaryWithCollectionLabel as d,
1263
+ auditLogDetailValue as e,
1264
+ auditLogActorLabel as f,
1246
1265
  getRecordAuditLogSnapshot as g,
1247
- fetchRecordAuditLogCsv as h,
1248
- normalizeAuditLogExportLimit as i,
1266
+ normalizeAuditLogFilterState as h,
1267
+ fetchRecordAuditLogCsv as i,
1268
+ normalizeAuditLogExportLimit as j,
1249
1269
  normalizeRecordAuditCollections as n,
1250
1270
  useAgentChat as u
1251
1271
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/ui",
3
- "version": "0.12.0-dev.1",
3
+ "version": "0.12.0-dev.2",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -1,4 +0,0 @@
1
- import { s } from "./RecordSheet-gFscQDNL.js";
2
- export {
3
- s as Mermaid
4
- };