@nivaro/react 0.3.35 → 0.3.37

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.
Files changed (106) hide show
  1. package/dist/components/slots/CommentsSlot.js +44 -36
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +13 -4
  5. package/dist/shared/components/AgentBadge.js +26 -0
  6. package/dist/shared/components/AgentQuestionsCard.js +198 -0
  7. package/dist/shared/components/ItemEditForm.js +3329 -3263
  8. package/dist/shared/components/McpConnectionScope.js +480 -0
  9. package/dist/shared/components/MyWorkView.js +223 -208
  10. package/dist/shared/components/RecordReadView.js +620 -572
  11. package/dist/shared/components/chat/ChatPanel.js +683 -671
  12. package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
  13. package/dist/shared/components/imports/ImportConsole.js +106 -104
  14. package/dist/shared/components/imports/RunDetailSheet.js +11 -10
  15. package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
  16. package/dist/shared/components/item-edit/FormTour.js +279 -0
  17. package/dist/shared/components/item-edit/GroupSection.js +377 -360
  18. package/dist/shared/components/item-edit/PersonalDefaultControl.js +80 -63
  19. package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
  20. package/dist/shared/components/item-edit/form-density.js +36 -0
  21. package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
  22. package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
  23. package/dist/shared/components/layout-editor/AddPanel.js +349 -192
  24. package/dist/shared/components/layout-editor/DesignNode.js +146 -131
  25. package/dist/shared/components/layout-editor/EditorCanvas.js +25 -17
  26. package/dist/shared/components/layout-editor/EditorTopBar.js +268 -206
  27. package/dist/shared/components/layout-editor/LayoutEditor.js +810 -731
  28. package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
  29. package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
  30. package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
  31. package/dist/shared/components/layout-editor/add-target.js +54 -43
  32. package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
  33. package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
  34. package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
  35. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +379 -185
  36. package/dist/shared/components/layout-editor/dnd/TrashZone.js +96 -0
  37. package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
  38. package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
  39. package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
  40. package/dist/shared/components/layout-editor/dnd/node.js +115 -105
  41. package/dist/shared/components/layout-editor/dnd/rail-drop.js +4 -4
  42. package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
  43. package/dist/shared/components/layout-editor/dnd/trash-drop.js +58 -0
  44. package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
  45. package/dist/shared/components/layout-editor/even-row.js +86 -0
  46. package/dist/shared/components/layout-editor/field-list.js +99 -0
  47. package/dist/shared/components/layout-editor/format-painter.js +102 -0
  48. package/dist/shared/components/layout-editor/grid-guides.js +15 -13
  49. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
  50. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
  51. package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
  52. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
  53. package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
  54. package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
  55. package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
  56. package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
  57. package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
  58. package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
  59. package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
  60. package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
  61. package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
  62. package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
  63. package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
  64. package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
  65. package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
  66. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
  67. package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
  68. package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
  69. package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
  70. package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
  71. package/dist/shared/components/layout-editor/panel-frame.js +1 -1
  72. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  73. package/dist/shared/components/layout-editor/personal-default-marks.js +40 -0
  74. package/dist/shared/components/layout-editor/pin.js +37 -19
  75. package/dist/shared/components/layout-editor/place-clip.js +257 -0
  76. package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
  77. package/dist/shared/components/layout-editor/preview/PreviewPanes.js +149 -118
  78. package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
  79. package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
  80. package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
  81. package/dist/shared/components/layout-editor/removed-log.js +151 -0
  82. package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
  83. package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
  84. package/dist/shared/components/layout-editor/revert-element.js +140 -0
  85. package/dist/shared/components/layout-editor/section-structure.js +193 -170
  86. package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
  87. package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
  88. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
  89. package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
  90. package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
  91. package/dist/shared/components/layout-editor/shortcuts.js +21 -16
  92. package/dist/shared/components/layout-editor/structure-ops.js +221 -195
  93. package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
  94. package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
  95. package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
  96. package/dist/shared/components/panels/CommentPanel.js +47 -45
  97. package/dist/shared/components/panels/RevisionsPanel.js +66 -64
  98. package/dist/shared/components/panels/TaskPanel.js +395 -332
  99. package/dist/shared/components/profile/AgentsPanel.js +196 -147
  100. package/dist/shared/components/profile/ConnectionRollback.js +329 -0
  101. package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
  102. package/dist/shared/lib/entry-config.js +22 -22
  103. package/dist/shared/lib/form-usage-beacon.js +91 -55
  104. package/dist/shared/lib/layout-lint.js +530 -284
  105. package/dist/shared/lib/layout-resolve.js +58 -44
  106. package/package.json +1 -1
@@ -8,16 +8,17 @@ import { get as q, post as K } from "../../lib/commands.js";
8
8
  import { useLiveRecordQueries as Ae } from "../../lib/live.js";
9
9
  import { restoreSkippedNote as re } from "../../lib/restore-skipped.js";
10
10
  import { cn as _, titleCase as oe, toLocalDateString as $e } from "../../lib/utils.js";
11
- import { RelatedItemLabel as Le } from "../item-edit/RelationCombobox.js";
11
+ import { AgentBadge as Le } from "../AgentBadge.js";
12
+ import { RelatedItemLabel as Oe } from "../item-edit/RelationCombobox.js";
12
13
  import { UserAvatar as ce } from "../UserAvatar.js";
13
14
  import { Button as M } from "../ui/button.js";
14
- import { Sheet as Oe, SheetTrigger as qe, SheetContent as De, SheetHeader as Fe, SheetTitle as Ee } from "../ui/sheet.js";
15
- import { Skeleton as Be } from "../ui/skeleton.js";
16
- import { IntegrationActivitySection as Pe } from "./IntegrationActivitySection.js";
17
- const Y = (e) => e.id != null && (e.action === "create" || e.action === "update" || e.action === "delete" || e.action === "restore"), Ie = (e) => !Y(e), $ = (e) => {
15
+ import { Sheet as qe, SheetTrigger as De, SheetContent as Fe, SheetHeader as Ee, SheetTitle as Be } from "../ui/sheet.js";
16
+ import { Skeleton as Pe } from "../ui/skeleton.js";
17
+ import { IntegrationActivitySection as Ie } from "./IntegrationActivitySection.js";
18
+ const Y = (e) => e.id != null && (e.action === "create" || e.action === "update" || e.action === "delete" || e.action === "restore"), Ke = (e) => !Y(e), $ = (e) => {
18
19
  var r;
19
20
  return e.id != null ? `r${e.id}` : `e${((r = e.event) == null ? void 0 : r.history_id) ?? ""}-${e.activity ?? ""}-${e.timestamp ?? ""}`;
20
- }, Ke = /* @__PURE__ */ new Set([
21
+ }, Me = /* @__PURE__ */ new Set([
21
22
  "id",
22
23
  "created",
23
24
  "changed",
@@ -57,7 +58,7 @@ function me(e, r) {
57
58
  for (const n of (i == null ? void 0 : i.fields) ?? [])
58
59
  n.field.startsWith("__") || d.set(n.field, {
59
60
  label: n.label || oe(n.field.replace(/_/g, " ")),
60
- system: Ke.has(n.field),
61
+ system: Me.has(n.field),
61
62
  // layout_assigned is only stamped when the collection HAS an active
62
63
  // layout — absent means there's no layout to be off of.
63
64
  onLayout: n.layout_assigned !== !1,
@@ -75,7 +76,7 @@ function g(e, r) {
75
76
  onLayout: !1
76
77
  };
77
78
  }
78
- function Me({ map: e, field: r }) {
79
+ function Ue({ map: e, field: r }) {
79
80
  const a = g(e, r);
80
81
  return /* @__PURE__ */ t(
81
82
  "span",
@@ -87,11 +88,11 @@ function Me({ map: e, field: r }) {
87
88
  }
88
89
  );
89
90
  }
90
- const se = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/, Ue = /^\d{4}-\d{2}-\d{2}(?:T00:00:00(?:\.0+)?Z)?$/;
91
- function Ve(e, r = !1) {
91
+ const se = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/, Ve = /^\d{4}-\d{2}-\d{2}(?:T00:00:00(?:\.0+)?Z)?$/;
92
+ function We(e, r = !1) {
92
93
  if (e == null || e === "") return "";
93
94
  if (typeof e == "boolean") return e ? "Yes" : "No";
94
- if (typeof e == "string" && (Ue.test(e) || r && se.test(e)))
95
+ if (typeof e == "string" && (Ve.test(e) || r && se.test(e)))
95
96
  return $e(e);
96
97
  if (typeof e == "string" && se.test(e)) {
97
98
  const a = new Date(e);
@@ -102,7 +103,7 @@ function Ve(e, r = !1) {
102
103
  function U(e) {
103
104
  return e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e);
104
105
  }
105
- function We({ collection: e, id: r }) {
106
+ function ze({ collection: e, id: r }) {
106
107
  const a = D(), { data: i } = B({
107
108
  queryKey: ["col-meta", e],
108
109
  queryFn: () => a.request(q(`/collections/${e}`)).then((d) => d.data),
@@ -110,7 +111,7 @@ function We({ collection: e, id: r }) {
110
111
  retry: !1
111
112
  });
112
113
  return /* @__PURE__ */ t("span", { title: `${e} #${String(r)}`, children: /* @__PURE__ */ t(
113
- Le,
114
+ Oe,
114
115
  {
115
116
  collection: e,
116
117
  id: r,
@@ -118,7 +119,7 @@ function We({ collection: e, id: r }) {
118
119
  }
119
120
  ) });
120
121
  }
121
- function ze(e) {
122
+ function He(e) {
122
123
  return X(e).join(" ");
123
124
  }
124
125
  const ne = 160;
@@ -127,7 +128,7 @@ function le({
127
128
  tone: r,
128
129
  dateOnly: a
129
130
  }) {
130
- const [i, d] = k(!1), o = Ve(e, a);
131
+ const [i, d] = k(!1), o = We(e, a);
131
132
  if (o === "")
132
133
  return /* @__PURE__ */ t("span", { className: "text-[11.5px] italic text-slate-300 dark:text-slate-600", children: "empty" });
133
134
  const n = o.length > ne, s = i || !n ? o : `${o.slice(0, ne)}…`;
@@ -158,7 +159,7 @@ function I(e) {
158
159
  }
159
160
  return null;
160
161
  }
161
- function He({
162
+ function Je({
162
163
  before: e,
163
164
  after: r
164
165
  }) {
@@ -178,7 +179,7 @@ function He({
178
179
  s !== void 0 ? /* @__PURE__ */ t("span", { className: "text-emerald-700 dark:text-emerald-400", children: d(s) }) : /* @__PURE__ */ t("span", { className: "italic text-slate-400", children: " (removed)" })
179
180
  ] }, o)) });
180
181
  }
181
- function Je({ field: e, ctl: r }) {
182
+ function Qe({ field: e, ctl: r }) {
182
183
  return r.confirmField === e ? /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1", "data-revert-field-confirm": e, children: [
183
184
  /* @__PURE__ */ t("span", { className: "text-[10.5px] text-slate-500", children: "Revert?" }),
184
185
  /* @__PURE__ */ t(
@@ -221,7 +222,7 @@ function G(e) {
221
222
  function X(e) {
222
223
  return String(e ?? "").replace(/<[^>]*>/g, " ").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").split(/\s+/).filter(Boolean);
223
224
  }
224
- function Qe(e, r) {
225
+ function Ye(e, r) {
225
226
  const i = X(e).slice(0, 600), d = X(r).slice(0, 600), o = i.length, n = d.length, s = Array.from({ length: o + 1 }, () => new Array(n + 1).fill(0));
226
227
  for (let y = o - 1; y >= 0; y--)
227
228
  for (let c = n - 1; c >= 0; c--)
@@ -237,8 +238,8 @@ function Qe(e, r) {
237
238
  for (; h < n; ) x("ins", d[h++]);
238
239
  return m;
239
240
  }
240
- function Ye({ before: e, after: r }) {
241
- const a = Qe(e, r);
241
+ function Ge({ before: e, after: r }) {
242
+ const a = Ye(e, r);
242
243
  return /* @__PURE__ */ t("p", { className: "whitespace-pre-wrap break-words text-[12px] leading-relaxed text-slate-700 dark:text-slate-300", children: a.map(
243
244
  (i, d) => i.type === "same" ? (
244
245
  // biome-ignore lint/suspicious/noArrayIndexKey: static segment list
@@ -275,12 +276,12 @@ function Ye({ before: e, after: r }) {
275
276
  )
276
277
  ) });
277
278
  }
278
- const Ge = {
279
+ const Xe = {
279
280
  added: "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400",
280
281
  removed: "bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400",
281
282
  changed: "bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-400"
282
283
  };
283
- function Xe(e, r, a) {
284
+ function Ze(e, r, a) {
284
285
  const i = Array.from(/* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(r)])), d = (s) => s == null || s === "", o = i.map((s) => {
285
286
  const m = !(s in e) || d(e[s]), x = !(s in r) || d(r[s]);
286
287
  if (m && x) return null;
@@ -305,9 +306,9 @@ function O({
305
306
  meta: r,
306
307
  tone: a
307
308
  }) {
308
- return e == null || e === "" ? /* @__PURE__ */ t("span", { className: "text-[11.5px] italic text-slate-300 dark:text-slate-600", children: "empty" }) : r.relatedCollection && (typeof e == "string" || typeof e == "number") ? /* @__PURE__ */ t("span", { className: "break-words text-[12px] leading-relaxed text-slate-700 dark:text-slate-300", children: /* @__PURE__ */ t(We, { collection: r.relatedCollection, id: e }) }) : G(e) ? /* @__PURE__ */ t(le, { value: ze(e), tone: a }) : /* @__PURE__ */ t(le, { value: e, tone: a, dateOnly: r.dateOnly });
309
+ return e == null || e === "" ? /* @__PURE__ */ t("span", { className: "text-[11.5px] italic text-slate-300 dark:text-slate-600", children: "empty" }) : r.relatedCollection && (typeof e == "string" || typeof e == "number") ? /* @__PURE__ */ t("span", { className: "break-words text-[12px] leading-relaxed text-slate-700 dark:text-slate-300", children: /* @__PURE__ */ t(ze, { collection: r.relatedCollection, id: e }) }) : G(e) ? /* @__PURE__ */ t(le, { value: He(e), tone: a }) : /* @__PURE__ */ t(le, { value: e, tone: a, dateOnly: r.dateOnly });
309
310
  }
310
- function Ze({
311
+ function et({
311
312
  row: e,
312
313
  meta: r,
313
314
  fieldRevert: a,
@@ -325,21 +326,21 @@ function Ze({
325
326
  "data-field-row": e.field,
326
327
  children: [
327
328
  /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
328
- /* @__PURE__ */ t(Me, { map: r, field: e.field }),
329
+ /* @__PURE__ */ t(Ue, { map: r, field: e.field }),
329
330
  e.status !== "unchanged" && !d && /* @__PURE__ */ t(
330
331
  "span",
331
332
  {
332
333
  className: _(
333
334
  "rounded px-1 py-px text-[9px] font-semibold uppercase tracking-wide",
334
- Ge[e.status]
335
+ Xe[e.status]
335
336
  ),
336
337
  children: e.status === "added" ? "set" : e.status
337
338
  }
338
339
  ),
339
- (e.status === "changed" || i === "changes" && e.status === "added") && a && e.field !== "id" && /* @__PURE__ */ t("span", { className: "ml-auto shrink-0", children: /* @__PURE__ */ t(Je, { field: e.field, ctl: a }) })
340
+ (e.status === "changed" || i === "changes" && e.status === "added") && a && e.field !== "id" && /* @__PURE__ */ t("span", { className: "ml-auto shrink-0", children: /* @__PURE__ */ t(Qe, { field: e.field, ctl: a }) })
340
341
  ] }),
341
- /* @__PURE__ */ t("div", { className: "mt-1", children: o ? /* @__PURE__ */ t("div", { "data-richtext-diff": !0, children: /* @__PURE__ */ t(Ye, { before: e.before, after: e.after }) }) : n ? /* @__PURE__ */ t(
342
- He,
342
+ /* @__PURE__ */ t("div", { className: "mt-1", children: o ? /* @__PURE__ */ t("div", { "data-richtext-diff": !0, children: /* @__PURE__ */ t(Ge, { before: e.before, after: e.after }) }) : n ? /* @__PURE__ */ t(
343
+ Je,
343
344
  {
344
345
  before: I(e.before),
345
346
  after: I(e.after)
@@ -353,7 +354,7 @@ function Ze({
353
354
  }
354
355
  );
355
356
  }
356
- function et({
357
+ function tt({
357
358
  before: e,
358
359
  after: r,
359
360
  meta: a,
@@ -361,7 +362,7 @@ function et({
361
362
  mode: d,
362
363
  hideStatusChips: o
363
364
  }) {
364
- const [n, s] = k(!1), m = j(() => Xe(e, r, a), [e, r, a]), x = d === "changes" ? m.filter((u) => u.status !== "unchanged") : m, p = n ? x : x.filter((u) => !u.system), h = x.length - p.length;
365
+ const [n, s] = k(!1), m = j(() => Ze(e, r, a), [e, r, a]), x = d === "changes" ? m.filter((u) => u.status !== "unchanged") : m, p = n ? x : x.filter((u) => !u.system), h = x.length - p.length;
365
366
  if (x.length === 0)
366
367
  return /* @__PURE__ */ t("p", { className: "px-3 py-3 text-[12px] text-slate-400", children: d === "changes" ? "No field changes recorded." : "No snapshot data available." });
367
368
  const y = p.findIndex(
@@ -376,7 +377,7 @@ function et({
376
377
  /* @__PURE__ */ t("p", { className: "text-[10.5px] text-slate-400", children: "Not on the form — written automatically by rules, computed fields or integrations." })
377
378
  ] }),
378
379
  /* @__PURE__ */ t(
379
- Ze,
380
+ et,
380
381
  {
381
382
  row: u,
382
383
  meta: a,
@@ -413,7 +414,7 @@ function et({
413
414
  )
414
415
  ] });
415
416
  }
416
- const tt = {
417
+ const at = {
417
418
  create: "bg-emerald-500",
418
419
  restore: "bg-emerald-500",
419
420
  update: "bg-nvr-cyan",
@@ -423,10 +424,10 @@ function E(e) {
423
424
  var r;
424
425
  return e.first_name || e.last_name ? [e.first_name, e.last_name].filter(Boolean).join(" ") : e.user_email ?? ((r = e.user_id) == null ? void 0 : r.slice(0, 8)) ?? "System";
425
426
  }
426
- function at(e, r, a) {
427
+ function rt(e, r, a) {
427
428
  return e.action === "create" ? "created this record" : e.action === "restore" ? "restored this record from trash" : e.action === "delete" ? "deleted this record" : r > 0 ? `changed ${r} field${r === 1 ? "" : "s"}` : a > 0 ? "updated system fields" : "saved this record";
428
429
  }
429
- function rt({ revision: e, isLast: r }) {
430
+ function st({ revision: e, isLast: r }) {
430
431
  var m, x, p;
431
432
  const a = e.event, i = (a == null ? void 0 : a.source) === "auto" || !e.user_id && (a == null ? void 0 : a.kind) === "transition", d = !i && ((m = a == null ? void 0 : a.on_behalf_of) != null && m.name) ? a.on_behalf_of.name : null, o = i ? "Automatic rule" : d ? `${E(e)}, for ${d}` : E(e);
432
433
  let n;
@@ -547,7 +548,7 @@ function rt({ revision: e, isLast: r }) {
547
548
  }
548
549
  );
549
550
  }
550
- function st({
551
+ function nt({
551
552
  revision: e,
552
553
  previousData: r,
553
554
  meta: a,
@@ -612,7 +613,7 @@ function st({
612
613
  {
613
614
  className: _(
614
615
  "absolute left-[11px] top-[18px] h-2.5 w-2.5 rounded-full ring-4 ring-white dark:ring-card",
615
- tt[e.action ?? ""] ?? "bg-slate-300"
616
+ at[e.action ?? ""] ?? "bg-slate-300"
616
617
  ),
617
618
  "aria-hidden": !0
618
619
  }
@@ -642,8 +643,9 @@ function st({
642
643
  /* @__PURE__ */ l("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: [
643
644
  /* @__PURE__ */ t("span", { className: "font-medium", children: E(e) }),
644
645
  " ",
645
- /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-slate-400", children: at(e, N, A) })
646
+ /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-slate-400", children: rt(e, N, A) })
646
647
  ] }),
648
+ /* @__PURE__ */ t(Le, { label: e.via_agent }),
647
649
  /* @__PURE__ */ t(
648
650
  "span",
649
651
  {
@@ -730,9 +732,9 @@ function st({
730
732
  ))
731
733
  ] })
732
734
  ] }),
733
- c && /* @__PURE__ */ t(ot, { revisionId: e.id ?? "" }),
735
+ c && /* @__PURE__ */ t(ct, { revisionId: e.id ?? "" }),
734
736
  /* @__PURE__ */ t(
735
- et,
737
+ tt,
736
738
  {
737
739
  before: P,
738
740
  after: ee,
@@ -761,7 +763,7 @@ function st({
761
763
  ] })
762
764
  ] });
763
765
  }
764
- function nt({ data: e, meta: r }) {
766
+ function lt({ data: e, meta: r }) {
765
767
  const [a, i] = k(null), [d, o] = k(""), [n, s] = k(""), [m, x] = k(""), p = j(() => {
766
768
  if (!d || !e) return null;
767
769
  const c = (/* @__PURE__ */ new Date(`${d}T23:59:59`)).getTime();
@@ -953,7 +955,7 @@ function nt({ data: e, meta: r }) {
953
955
  ] })
954
956
  ] });
955
957
  }
956
- function lt(e) {
958
+ function it(e) {
957
959
  return e ? new Date(e).toLocaleDateString([], {
958
960
  weekday: "short",
959
961
  month: "short",
@@ -961,7 +963,7 @@ function lt(e) {
961
963
  year: "numeric"
962
964
  }) : "Unknown date";
963
965
  }
964
- function it({
966
+ function dt({
965
967
  collection: e,
966
968
  item: r,
967
969
  onRollback: a,
@@ -983,23 +985,23 @@ function it({
983
985
  }, [n]), h = (n == null ? void 0 : n.length) ?? 0, y = j(() => (n ?? []).filter(Y), [n]), c = j(() => {
984
986
  const u = [];
985
987
  for (const b of n ?? []) {
986
- const v = lt(b.timestamp), w = u[u.length - 1];
988
+ const v = it(b.timestamp), w = u[u.length - 1];
987
989
  w && w.day === v ? w.revisions.push(b) : u.push({ day: v, revisions: [b] });
988
990
  }
989
991
  return u;
990
992
  }, [n]);
991
- return s ? /* @__PURE__ */ t("div", { className: "space-y-2 pt-3", children: [1, 2, 3, 4].map((u) => /* @__PURE__ */ t(Be, { className: "h-11 rounded-md" }, u)) }) : h === 0 ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center py-16 text-center", children: [
993
+ return s ? /* @__PURE__ */ t("div", { className: "space-y-2 pt-3", children: [1, 2, 3, 4].map((u) => /* @__PURE__ */ t(Pe, { className: "h-11 rounded-md" }, u)) }) : h === 0 ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center py-16 text-center", children: [
992
994
  /* @__PURE__ */ t(Q, { className: "mb-2 h-8 w-8 text-slate-300 dark:text-slate-600" }),
993
995
  /* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-600 dark:text-slate-300", children: "No history yet" }),
994
996
  /* @__PURE__ */ t("p", { className: "mt-1 max-w-[38ch] text-[12px] text-slate-400", children: "Every save records who changed what — the trail will appear here." })
995
997
  ] }) : /* @__PURE__ */ l("div", { className: "space-y-3 pt-3", children: [
996
- /* @__PURE__ */ t(nt, { data: y, meta: o }),
997
- y.length >= 3 && /* @__PURE__ */ t(ct, { revisions: y, meta: o }),
998
+ /* @__PURE__ */ t(lt, { data: y, meta: o }),
999
+ y.length >= 3 && /* @__PURE__ */ t(mt, { revisions: y, meta: o }),
998
1000
  /* @__PURE__ */ t("div", { children: c.map((u) => /* @__PURE__ */ l("div", { children: [
999
1001
  /* @__PURE__ */ t("div", { className: "sticky top-0 z-10 -mx-6 border-b border-slate-100 bg-white px-6 py-1.5 dark:border-border/60 dark:bg-card", children: /* @__PURE__ */ t("span", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: u.day }) }),
1000
1002
  u.revisions.map((b) => {
1001
1003
  const v = (n ?? []).indexOf(b), w = v === ((n == null ? void 0 : n.length) ?? 1) - 1;
1002
- if (Ie(b))
1004
+ if (Ke(b))
1003
1005
  return /* @__PURE__ */ l(
1004
1006
  "div",
1005
1007
  {
@@ -1009,7 +1011,7 @@ function it({
1009
1011
  ),
1010
1012
  children: [
1011
1013
  p.has($(b)) && /* @__PURE__ */ t(ie, {}),
1012
- /* @__PURE__ */ t(rt, { revision: b, isLast: w })
1014
+ /* @__PURE__ */ t(st, { revision: b, isLast: w })
1013
1015
  ]
1014
1016
  },
1015
1017
  $(b)
@@ -1025,7 +1027,7 @@ function it({
1025
1027
  children: [
1026
1028
  p.has($(b)) && /* @__PURE__ */ t(ie, {}),
1027
1029
  /* @__PURE__ */ t(
1028
- st,
1030
+ nt,
1029
1031
  {
1030
1032
  revision: b,
1031
1033
  previousData: (S == null ? void 0 : S.data) ?? null,
@@ -1056,7 +1058,7 @@ function ie() {
1056
1058
  )
1057
1059
  );
1058
1060
  }
1059
- function Tt({
1061
+ function jt({
1060
1062
  collection: e,
1061
1063
  item: r,
1062
1064
  onRollback: a,
@@ -1066,8 +1068,8 @@ function Tt({
1066
1068
  onOpenChange: n,
1067
1069
  compact: s
1068
1070
  }) {
1069
- return /* @__PURE__ */ l(Oe, { open: o, onOpenChange: n, children: [
1070
- !(o !== void 0) && /* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ l(
1071
+ return /* @__PURE__ */ l(qe, { open: o, onOpenChange: n, children: [
1072
+ !(o !== void 0) && /* @__PURE__ */ t(De, { asChild: !0, children: /* @__PURE__ */ l(
1071
1073
  M,
1072
1074
  {
1073
1075
  variant: s ? "ghost" : "outline",
@@ -1081,18 +1083,18 @@ function Tt({
1081
1083
  ]
1082
1084
  }
1083
1085
  ) }),
1084
- /* @__PURE__ */ t(De, { className: "w-[720px] overflow-y-auto p-0 sm:max-w-[92vw]", children: /* @__PURE__ */ l("div", { className: "p-6", children: [
1085
- /* @__PURE__ */ l(Fe, { children: [
1086
- /* @__PURE__ */ l(Ee, { className: "flex items-center gap-2 text-base", children: [
1086
+ /* @__PURE__ */ t(Fe, { className: "w-[720px] overflow-y-auto p-0 sm:max-w-[92vw]", children: /* @__PURE__ */ l("div", { className: "p-6", children: [
1087
+ /* @__PURE__ */ l(Ee, { children: [
1088
+ /* @__PURE__ */ l(Be, { className: "flex items-center gap-2 text-base", children: [
1087
1089
  /* @__PURE__ */ t(Q, { className: "h-4 w-4 text-slate-400" }),
1088
1090
  "Revision history"
1089
1091
  ] }),
1090
1092
  /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "Who changed what, when — expand any entry to see the exact values, revert a single field, or restore the whole version." })
1091
1093
  ] }),
1092
- /* @__PURE__ */ t(dt, { collection: e, item: r }),
1093
- /* @__PURE__ */ t(Pe, { collection: e, item: String(r) }),
1094
+ /* @__PURE__ */ t(ot, { collection: e, item: r }),
1095
+ /* @__PURE__ */ t(Ie, { collection: e, item: String(r) }),
1094
1096
  /* @__PURE__ */ t(
1095
- it,
1097
+ dt,
1096
1098
  {
1097
1099
  collection: e,
1098
1100
  item: r,
@@ -1103,7 +1105,7 @@ function Tt({
1103
1105
  ] }) })
1104
1106
  ] });
1105
1107
  }
1106
- function dt({ collection: e, item: r }) {
1108
+ function ot({ collection: e, item: r }) {
1107
1109
  const a = D(), i = me(e, !0), [d, o] = k(""), [n, s] = k(""), { data: m, isFetching: x } = B({
1108
1110
  queryKey: ["rev-value-search", e, r, n],
1109
1111
  queryFn: () => a.request(q("/revisions/value-search", { collection: e, item: r, q: n })).then((p) => p.data),
@@ -1164,7 +1166,7 @@ function dt({ collection: e, item: r }) {
1164
1166
  ] }) })
1165
1167
  ] });
1166
1168
  }
1167
- function ot({ revisionId: e }) {
1169
+ function ct({ revisionId: e }) {
1168
1170
  const r = D(), a = Z(), [i, d] = k(""), { data: o = [] } = B({
1169
1171
  queryKey: ["revision-notes", String(e)],
1170
1172
  queryFn: () => r.request(q("/comments", { collection: "nivaro_revisions", item: String(e) })).then((s) => s.data ?? []).catch(() => []),
@@ -1220,7 +1222,7 @@ function ot({ revisionId: e }) {
1220
1222
  )
1221
1223
  ] });
1222
1224
  }
1223
- function ct({
1225
+ function mt({
1224
1226
  revisions: e,
1225
1227
  meta: r
1226
1228
  }) {
@@ -1280,6 +1282,6 @@ function ct({
1280
1282
  ] });
1281
1283
  }
1282
1284
  export {
1283
- Tt as RevisionsPanel,
1284
- Ve as displayValue
1285
+ jt as RevisionsPanel,
1286
+ We as displayValue
1285
1287
  };