@ai-matrx/content-ir-react 0.16.0 → 0.16.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/dist/react.cjs CHANGED
@@ -194,11 +194,13 @@ function sameValue(a, b) {
194
194
  if (typeof a === "object" || typeof b === "object") return safeJson(a) === safeJson(b);
195
195
  return false;
196
196
  }
197
- function itemChanges(item, current) {
197
+ function itemChanges(item, current, options = {}) {
198
198
  const out = [];
199
+ const titleColumn = options.titleColumn ?? null;
199
200
  for (const [key, raw] of Object.entries(item)) {
200
201
  if (NOT_A_CHANGE.has(key)) continue;
201
- const change = { key, label: fieldLabel(key), ...describeValue(raw) };
202
+ const label = key === titleColumn ? "Title" : fieldLabel(key);
203
+ const change = { key, label, ...describeValue(raw) };
202
204
  if (current && Object.prototype.hasOwnProperty.call(current, key)) {
203
205
  change.before = describeValue(current[key]);
204
206
  change.same = sameValue(current[key], raw);
@@ -773,7 +775,7 @@ function TargetRow({
773
775
  isUpdate ? host.readRecord : void 0,
774
776
  isUpdate ? { noun: directive.noun, id: recordId } : null
775
777
  );
776
- const changes = isUpdate ? itemChanges(item, current.values) : [];
778
+ const changes = isUpdate ? itemChanges(item, current.values, { titleColumn: (0, import_content_ir5.nounTitleColumn)(directive.noun, host.nouns) }) : [];
777
779
  const name = host.renderRecord ? host.renderRecord({ noun: directive.noun, id: recordId, fallback, context: "row" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "truncate font-medium text-foreground", children: fallback });
778
780
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "py-1 text-xs", "data-directive-target": recordId, children: [
779
781
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [