@ai-matrx/records-ui 0.116.84 → 0.116.85
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 +5 -0
- package/dist/index.cjs +29 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2977,6 +2977,16 @@ function sourceWords(source, nameOf = () => void 0) {
|
|
|
2977
2977
|
if (kind2) return `${humanizeIdentifier2(kind2)}${note ? `: ${note}` : ""}.`;
|
|
2978
2978
|
return note;
|
|
2979
2979
|
}
|
|
2980
|
+
function agentWords(actor, changes = []) {
|
|
2981
|
+
const kinds = new Set(
|
|
2982
|
+
changes.map((c) => c.source && typeof c.source.kind === "string" ? c.source.kind : null).filter(Boolean)
|
|
2983
|
+
);
|
|
2984
|
+
const who = kinds.has("enrichment") || kinds.has("ai") ? "an AI column" : kinds.has("import") ? "an import" : kinds.has("form") ? "a form" : "an assistant";
|
|
2985
|
+
const obo = actor.on_behalf_of ?? null;
|
|
2986
|
+
const forName = obo?.name ?? (obo ? "a person" : actor.name ?? "a person");
|
|
2987
|
+
const startedBy = obo && actor.user_id && obo.user_id && actor.user_id !== obo.user_id ? actor.name ?? "somebody else" : null;
|
|
2988
|
+
return { who, forName, startedBy };
|
|
2989
|
+
}
|
|
2980
2990
|
|
|
2981
2991
|
// src/Enrich.tsx
|
|
2982
2992
|
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
@@ -15841,7 +15851,7 @@ function VersionRow({
|
|
|
15841
15851
|
},
|
|
15842
15852
|
children: [
|
|
15843
15853
|
/* @__PURE__ */ jsxs50("span", { className: "flex min-w-0 items-baseline gap-1.5", children: [
|
|
15844
|
-
/* @__PURE__ */ jsx57(Who, { actor: entry.actor }),
|
|
15854
|
+
/* @__PURE__ */ jsx57(Who, { actor: entry.actor, changes: entry.changes }),
|
|
15845
15855
|
/* @__PURE__ */ jsx57("span", { className: "shrink-0 text-muted-foreground", children: verbWords(operationWords(entry.operation_label)) }),
|
|
15846
15856
|
entry.undoable ? /* @__PURE__ */ jsx57(Badge4, { variant: "secondary", className: "min-w-0 shrink truncate text-[10px]", title: "part of a bigger change", children: "part of a bigger change" }) : null,
|
|
15847
15857
|
/* @__PURE__ */ jsxs50("span", { className: "ml-auto flex shrink-0 items-baseline gap-1.5 whitespace-nowrap text-muted-foreground", children: [
|
|
@@ -15916,16 +15926,20 @@ function VersionRow({
|
|
|
15916
15926
|
)
|
|
15917
15927
|
);
|
|
15918
15928
|
}
|
|
15919
|
-
function Who({ actor }) {
|
|
15929
|
+
function Who({ actor, changes }) {
|
|
15920
15930
|
const name = actor.name ?? (actor.kind === "system" ? "the platform" : "somebody");
|
|
15921
15931
|
if (actor.kind === "agent") {
|
|
15922
15932
|
return /* @__PURE__ */ jsxs50("span", { className: "shrink-0", children: [
|
|
15923
15933
|
/* @__PURE__ */ jsx57(Badge4, { variant: "outline", className: "mr-1 text-[10px]", children: "agent" }),
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
",
|
|
15927
|
-
|
|
15928
|
-
|
|
15934
|
+
(() => {
|
|
15935
|
+
const said = agentWords(actor, changes);
|
|
15936
|
+
return /* @__PURE__ */ jsxs50("span", { className: "text-muted-foreground", children: [
|
|
15937
|
+
said.who,
|
|
15938
|
+
", for ",
|
|
15939
|
+
/* @__PURE__ */ jsx57("strong", { className: "font-medium text-foreground", children: said.forName }),
|
|
15940
|
+
said.startedBy ? ` \xB7 started by ${said.startedBy}` : null
|
|
15941
|
+
] });
|
|
15942
|
+
})(),
|
|
15929
15943
|
actor.approved_by ? /* @__PURE__ */ jsxs50("span", { className: "text-muted-foreground", children: [
|
|
15930
15944
|
" \xB7 approved by ",
|
|
15931
15945
|
actor.approved_by.name ?? "a person"
|
|
@@ -16140,7 +16154,10 @@ function FormulaHistoryList({ recordId, fieldKey, label, onClose, className }) {
|
|
|
16140
16154
|
"Formula v",
|
|
16141
16155
|
row.formula_version
|
|
16142
16156
|
] }),
|
|
16143
|
-
/* @__PURE__ */ jsx58("span", { className: "shrink-0 text-muted-foreground", children: row.actor.kind === "agent" ?
|
|
16157
|
+
/* @__PURE__ */ jsx58("span", { className: "shrink-0 text-muted-foreground", children: row.actor.kind === "agent" ? (() => {
|
|
16158
|
+
const said = agentWords(row.actor, []);
|
|
16159
|
+
return `${said.who}, for ${said.forName}${said.startedBy ? ` \xB7 started by ${said.startedBy}` : ""}`;
|
|
16160
|
+
})() : row.actor.name ?? (row.actor.kind === "system" ? "the platform" : "somebody") }),
|
|
16144
16161
|
/* @__PURE__ */ jsx58("span", { className: "w-28 shrink-0 whitespace-nowrap text-right text-muted-foreground", title: new Date(row.occurred_at).toLocaleString(), children: whenText(row.occurred_at) })
|
|
16145
16162
|
] }, `${row.record_version}-${row.formula_version}-${i}`)) })
|
|
16146
16163
|
] });
|
|
@@ -16272,8 +16289,10 @@ function FieldValueHistory({
|
|
|
16272
16289
|
] }),
|
|
16273
16290
|
/* @__PURE__ */ jsx59("span", { className: "shrink-0 text-muted-foreground", children: row.actor.kind === "agent" ? /* @__PURE__ */ jsxs52(Fragment21, { children: [
|
|
16274
16291
|
/* @__PURE__ */ jsx59(Badge6, { variant: "outline", className: "mr-1 text-[10px]", children: "agent" }),
|
|
16275
|
-
|
|
16276
|
-
|
|
16292
|
+
(() => {
|
|
16293
|
+
const said2 = agentWords(row.actor, []);
|
|
16294
|
+
return `${said2.who}, for ${said2.forName}${said2.startedBy ? ` \xB7 started by ${said2.startedBy}` : ""}`;
|
|
16295
|
+
})(),
|
|
16277
16296
|
row.actor.approved_by ? ` \xB7 approved by ${row.actor.approved_by.name ?? "a person"}` : null
|
|
16278
16297
|
] }) : row.actor.name ?? (row.actor.kind === "system" ? "the platform" : "somebody") }),
|
|
16279
16298
|
/* @__PURE__ */ jsx59(
|