@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.js CHANGED
@@ -154,11 +154,13 @@ function sameValue(a, b) {
154
154
  if (typeof a === "object" || typeof b === "object") return safeJson(a) === safeJson(b);
155
155
  return false;
156
156
  }
157
- function itemChanges(item, current) {
157
+ function itemChanges(item, current, options = {}) {
158
158
  const out = [];
159
+ const titleColumn = options.titleColumn ?? null;
159
160
  for (const [key, raw] of Object.entries(item)) {
160
161
  if (NOT_A_CHANGE.has(key)) continue;
161
- const change = { key, label: fieldLabel(key), ...describeValue(raw) };
162
+ const label = key === titleColumn ? "Title" : fieldLabel(key);
163
+ const change = { key, label, ...describeValue(raw) };
162
164
  if (current && Object.prototype.hasOwnProperty.call(current, key)) {
163
165
  change.before = describeValue(current[key]);
164
166
  change.same = sameValue(current[key], raw);
@@ -743,7 +745,7 @@ function TargetRow({
743
745
  isUpdate ? host.readRecord : void 0,
744
746
  isUpdate ? { noun: directive.noun, id: recordId } : null
745
747
  );
746
- const changes = isUpdate ? itemChanges(item, current.values) : [];
748
+ const changes = isUpdate ? itemChanges(item, current.values, { titleColumn: nounTitleColumn(directive.noun, host.nouns) }) : [];
747
749
  const name = host.renderRecord ? host.renderRecord({ noun: directive.noun, id: recordId, fallback, context: "row" }) : /* @__PURE__ */ jsx7("span", { className: "truncate font-medium text-foreground", children: fallback });
748
750
  return /* @__PURE__ */ jsxs5("div", { className: "py-1 text-xs", "data-directive-target": recordId, children: [
749
751
  /* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 items-center gap-2", children: [