@nivaro/react 0.3.16 → 0.3.18

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 (28) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +51 -1
  4. package/dist/index.js +243 -240
  5. package/dist/shared/components/CollectionBrowserView.js +439 -438
  6. package/dist/shared/components/ItemEditForm.js +3758 -3708
  7. package/dist/shared/components/ProfileView.js +38 -23
  8. package/dist/shared/components/RecordReadView.js +452 -430
  9. package/dist/shared/components/bulk/BulkActionButtons.js +113 -106
  10. package/dist/shared/components/chat/ChannelArchive.js +16 -17
  11. package/dist/shared/components/chat/ChatAnalyticsView.js +2 -2
  12. package/dist/shared/components/chat/ChatPanel.js +992 -930
  13. package/dist/shared/components/chat/Composer.js +307 -303
  14. package/dist/shared/components/chat/chat-core.js +8 -4
  15. package/dist/shared/components/chat/chat-drafts.js +60 -43
  16. package/dist/shared/components/item-edit/InlineTableField.js +159 -158
  17. package/dist/shared/components/item-edit/RecordLiveSync.js +169 -155
  18. package/dist/shared/components/item-edit/RelationCombobox.js +274 -247
  19. package/dist/shared/components/item-edit/RowHistorySheet.js +62 -62
  20. package/dist/shared/components/item-edit/picker-search.js +28 -0
  21. package/dist/shared/components/panels/RevisionsPanel.js +268 -260
  22. package/dist/shared/components/pipeline/PipelineEditorView.js +1672 -1568
  23. package/dist/shared/components/profile/BrowserPushCard.js +135 -89
  24. package/dist/shared/components/profile/push-failure.js +76 -0
  25. package/dist/shared/lib/display-prefs.js +90 -0
  26. package/dist/shared/lib/request-gate.js +140 -127
  27. package/dist/shared/lib/theme-accents.js +21 -16
  28. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
- import { jsx as a, jsxs as c, Fragment as Z } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as c, Fragment as X } from "react/jsx-runtime";
2
2
  import { useQueryClient as Ke, useQuery as ne } from "@tanstack/react-query";
3
3
  import { RotateCcw as we, ChevronDown as ee } from "lucide-react";
4
- import { useMemo as $, useState as te, useEffect as Re, Fragment as be } from "react";
4
+ import { useMemo as _, useState as te, useEffect as Re, Fragment as be } from "react";
5
5
  import { get as L } from "../../lib/commands.js";
6
6
  import { numericIntlOptions as Ne } from "../../lib/format-value.js";
7
7
  import { htmlToText as Je } from "../../lib/sanitize-html.js";
8
8
  import { formatDateTime as ke, formatRelative as ve, cn as j, titleCase as Pe, formatDate as Ve } from "../../lib/utils.js";
9
9
  import { Sheet as He, SheetContent as Qe, SheetHeader as We, SheetTitle as Ue } from "../ui/sheet.js";
10
10
  import { applyDisplayTemplate as Se, SYSTEM_FIELDS as Ye } from "./helpers.js";
11
- function Ge(f) {
11
+ function Ze(f) {
12
12
  const { data: x } = ne({
13
13
  queryKey: ["nvr-machine-markers"],
14
14
  queryFn: () => f.request(L("/comments/machine-markers")).then((b) => b.data ?? []),
@@ -17,17 +17,17 @@ function Ge(f) {
17
17
  });
18
18
  return x ?? [];
19
19
  }
20
- function Xe(f) {
20
+ function Ge(f) {
21
21
  const x = String(f ?? "").trim();
22
22
  if (!/^import:/i.test(x)) return null;
23
23
  const b = x.slice(7), k = b.lastIndexOf(":"), v = (k >= 0 ? b.slice(0, k) : b).trim() || "a file", N = k >= 0 ? b.slice(k + 1).trim() : "", S = /^run-(\d+)$/i.exec(N);
24
24
  return { template: v, fileId: S || !N ? null : N, runId: S ? Number(S[1]) : null };
25
25
  }
26
- function Ze(f, x = []) {
26
+ function Xe(f, x = []) {
27
27
  var N, S;
28
28
  const b = String(f ?? "").trim();
29
29
  if (!b) return { kind: "none", text: "" };
30
- const k = Xe(b);
30
+ const k = Ge(b);
31
31
  if (k) return { kind: "machine", text: `Imported via ${k.template}`, fileId: k.fileId };
32
32
  const v = b.toLowerCase();
33
33
  for (const O of x) {
@@ -66,22 +66,22 @@ function ft({
66
66
  m2oDisplays: P,
67
67
  client: M,
68
68
  allowRestore: re,
69
- onRestore: _e,
70
- mode: $e = "row",
69
+ onRestore: $e,
70
+ mode: _e = "row",
71
71
  rowLabel: z,
72
72
  focusRevisionId: A = null,
73
73
  truncated: je = !1,
74
74
  onRestoreAllTo: se,
75
75
  restoringAll: oe = !1
76
76
  }) {
77
- const ie = Ke(), ae = Ge(M), y = $e === "timeline", le = $(() => new Map(S.map((e) => [e.field, e])), [S]), V = $(() => {
77
+ const ie = Ke(), ae = Ze(M), y = _e === "timeline", le = _(() => new Map(S.map((e) => [e.field, e])), [S]), V = _(() => {
78
78
  const e = new Map(D);
79
79
  for (const t of E) {
80
80
  const n = t.many_field;
81
81
  !n || t.many_collection !== q || t.junction_field || !t.one_collection || e.has(n) || e.set(n, t);
82
82
  }
83
83
  return e;
84
- }, [D, E, q]), H = $(() => {
84
+ }, [D, E, q]), H = _(() => {
85
85
  const e = /* @__PURE__ */ new Map();
86
86
  return O.forEach((t, n) => e.set(t.field, n)), S.forEach((t, n) => {
87
87
  e.has(t.field) || e.set(t.field, O.length + n);
@@ -90,36 +90,36 @@ function ft({
90
90
  const n = [...e].sort((o, l) => o.id - l.id), r = [];
91
91
  let s = null;
92
92
  for (const o of n) {
93
- const l = [o.first_name, o.last_name].filter(Boolean).join(" ") || o.user_email || "System", u = String(o.action ?? "").toLowerCase(), d = u === "create" ? "create" : u === "update" ? "update" : u === "delete" ? "delete" : "other", i = o.data ?? {}, p = [], m = [];
93
+ const l = [o.first_name, o.last_name].filter(Boolean).join(" ") || o.user_email || "System", u = String(o.action ?? "").toLowerCase(), d = u === "create" ? "create" : u === "update" ? "update" : u === "delete" ? "delete" : "other", i = o.data ?? {}, h = [], m = [];
94
94
  if (d === "delete") {
95
95
  const g = s ?? i;
96
- for (const [h, C] of Object.entries(g))
97
- !Q(h) || I(C) || m.push({ field: h, value: C });
96
+ for (const [p, C] of Object.entries(g))
97
+ !Q(p) || I(C) || m.push({ field: p, value: C });
98
98
  } else if (d === "create" || !s)
99
- for (const [g, h] of Object.entries(i))
100
- !Q(g) || I(h) || m.push({ field: g, value: h });
99
+ for (const [g, p] of Object.entries(i))
100
+ !Q(g) || I(p) || m.push({ field: g, value: p });
101
101
  else {
102
102
  const g = o.delta ? Object.keys(o.delta) : Object.keys(i);
103
- for (const h of g) {
104
- if (!Q(h)) continue;
105
- const C = o.delta ? o.delta[h] : i[h], ye = s[h];
106
- tt(ye, C) || p.push({ field: h, before: ye, after: C });
103
+ for (const p of g) {
104
+ if (!Q(p)) continue;
105
+ const C = o.delta ? o.delta[p] : i[p], ye = s[p];
106
+ tt(ye, C) || h.push({ field: p, before: ye, after: C });
107
107
  }
108
108
  }
109
- const w = (g, h) => (H.get(g) ?? 9999) - (H.get(h) ?? 9999);
110
- p.sort((g, h) => w(g.field, h.field)), m.sort((g, h) => w(g.field, h.field)), r.push({
109
+ const w = (g, p) => (H.get(g) ?? 9999) - (H.get(p) ?? 9999);
110
+ h.sort((g, p) => w(g.field, p.field)), m.sort((g, p) => w(g.field, p.field)), r.push({
111
111
  rev: o,
112
112
  kind: d,
113
113
  who: l,
114
- changes: p,
114
+ changes: h,
115
115
  snapshot: m,
116
- provenance: Ze(o.comment, ae),
116
+ provenance: Xe(o.comment, ae),
117
117
  row: t,
118
118
  before: s
119
119
  }), d !== "delete" && Object.keys(i).length > 0 && (s = i);
120
120
  }
121
121
  return r.reverse();
122
- }, _ = $(() => {
122
+ }, $ = _(() => {
123
123
  if (!y) return de(v, null);
124
124
  const e = /* @__PURE__ */ new Map();
125
125
  for (const n of v) {
@@ -134,9 +134,9 @@ function ft({
134
134
  );
135
135
  }
136
136
  return t.sort((n, r) => r.rev.id - n.rev.id), t;
137
- }, [v, H, F, y, z, ae]), B = $(() => {
137
+ }, [v, H, F, y, z, ae]), B = _(() => {
138
138
  if (!y)
139
- return _.map((n) => ({
139
+ return $.map((n) => ({
140
140
  key: n.rev.id,
141
141
  versions: [n],
142
142
  who: n.who,
@@ -144,7 +144,7 @@ function ft({
144
144
  }));
145
145
  const e = [];
146
146
  let t = null;
147
- for (const n of _) {
147
+ for (const n of $) {
148
148
  const r = n.rev.timestamp ? new Date(n.rev.timestamp).getTime() : NaN, s = t != null && t.lastAt ? new Date(t.lastAt).getTime() : NaN;
149
149
  t && t.who === n.who && Number.isFinite(r) && Number.isFinite(s) && Math.abs(s - r) <= 5e3 && !t.versions.some((l) => {
150
150
  var u, d;
@@ -158,7 +158,7 @@ function ft({
158
158
  }, e.push(t));
159
159
  }
160
160
  return e;
161
- }, [_, y]), K = $(() => {
161
+ }, [$, y]), K = _(() => {
162
162
  const e = /* @__PURE__ */ new Map();
163
163
  for (const t of E)
164
164
  t.one_collection === q && t.one_field && e.set(t.one_field, t);
@@ -170,7 +170,7 @@ function ft({
170
170
  if (e.junction_field && n[e.junction_field] != null) return String(n[e.junction_field]);
171
171
  const r = Object.keys(n).filter((s) => s !== "id" && s !== e.many_field);
172
172
  return r.length === 1 && n[r[0]] != null && typeof n[r[0]] != "object" ? String(n[r[0]]) : n.id != null ? String(n.id) : null;
173
- }, R = $(() => {
173
+ }, R = _(() => {
174
174
  const e = /* @__PURE__ */ new Map(), t = (n, r) => {
175
175
  if (!Array.isArray(r)) return;
176
176
  const s = K.get(n);
@@ -182,13 +182,13 @@ function ft({
182
182
  }
183
183
  o.size && e.set(n, o);
184
184
  };
185
- for (const n of _) {
185
+ for (const n of $) {
186
186
  for (const r of n.changes)
187
187
  t(r.field, r.before), t(r.field, r.after);
188
188
  for (const r of n.snapshot) t(r.field, r.value);
189
189
  }
190
190
  return e;
191
- }, [_, K]), Oe = $(
191
+ }, [$, K]), Oe = _(
192
192
  () => [...R.entries()].map(([e, t]) => `${e}:${[...t].sort().join(",")}`).sort().join("|"),
193
193
  [R]
194
194
  ), { data: Te = {} } = ne({
@@ -212,7 +212,7 @@ function ft({
212
212
  } else
213
213
  o = s.many_collection ?? null;
214
214
  if (!o) return;
215
- const l = await t(o).catch(() => null), u = (l == null ? void 0 : l.display_template) ?? void 0, d = u ? [...u.matchAll(/\{\{([\w.]+)\}\}/g)].map((m) => m[1]) : [], i = d.some((m) => m.includes(".")) ? ["id", ...d].join(",") : void 0, p = await M.request(
215
+ const l = await t(o).catch(() => null), u = (l == null ? void 0 : l.display_template) ?? void 0, d = u ? [...u.matchAll(/\{\{([\w.]+)\}\}/g)].map((m) => m[1]) : [], i = d.some((m) => m.includes(".")) ? ["id", ...d].join(",") : void 0, h = await M.request(
216
216
  L(`/items/${o}`, {
217
217
  filter: JSON.stringify({ id: { _in: [...r] } }),
218
218
  limit: r.size,
@@ -220,7 +220,7 @@ function ft({
220
220
  })
221
221
  ).then((m) => m.data ?? []).catch(() => []);
222
222
  e[n] = {};
223
- for (const m of p) {
223
+ for (const m of h) {
224
224
  const w = u ? Se(u, m) : "";
225
225
  e[n][String(m.id)] = w || String(m.name ?? m.title ?? m.label ?? m.short_name ?? m.id ?? "");
226
226
  }
@@ -229,7 +229,7 @@ function ft({
229
229
  },
230
230
  enabled: f && R.size > 0,
231
231
  staleTime: 5 * 6e4
232
- }), J = $(() => {
232
+ }), J = _(() => {
233
233
  const e = /* @__PURE__ */ new Map(), t = (n, r) => {
234
234
  var l;
235
235
  if (I(r) || typeof r == "object") return;
@@ -238,13 +238,13 @@ function ft({
238
238
  const o = e.get(s.one_collection) ?? /* @__PURE__ */ new Set();
239
239
  o.add(String(r)), e.set(s.one_collection, o);
240
240
  };
241
- for (const n of _) {
241
+ for (const n of $) {
242
242
  for (const r of n.changes)
243
243
  t(r.field, r.before), t(r.field, r.after);
244
244
  for (const r of n.snapshot) t(r.field, r.value);
245
245
  }
246
246
  return e;
247
- }, [_, V, P]), Ie = $(
247
+ }, [$, V, P]), Ie = _(
248
248
  () => [...J.entries()].map(([e, t]) => `${e}:${[...t].sort().join(",")}`).sort().join("|"),
249
249
  [J]
250
250
  ), { data: Fe = {} } = ne({
@@ -290,15 +290,15 @@ function ft({
290
290
  const i = K.get(e);
291
291
  if (i) {
292
292
  const m = t.map((w) => {
293
- var h;
293
+ var p;
294
294
  const g = ce(i, w);
295
- return g == null ? null : ((h = Te[e]) == null ? void 0 : h[g]) ?? `#${g}`;
295
+ return g == null ? null : ((p = Te[e]) == null ? void 0 : p[g]) ?? `#${g}`;
296
296
  }).filter((w) => !!w);
297
297
  return m.length ? { text: m.join(", ") } : { text: "—" };
298
298
  }
299
- if (t.every((p) => p == null || typeof p != "object"))
299
+ if (t.every((h) => h == null || typeof h != "object"))
300
300
  return {
301
- text: t.filter((p) => p != null).map(String).join(", ") || "—"
301
+ text: t.filter((h) => h != null).map(String).join(", ") || "—"
302
302
  };
303
303
  }
304
304
  if (typeof t == "object") return { text: JSON.stringify(t), mono: !0 };
@@ -313,7 +313,7 @@ function ft({
313
313
  };
314
314
  if (/^(date|dateTime|datetime|timestamp)$/i.test(o)) {
315
315
  const i = String(t);
316
- return { text: /^\d{4}-\d{2}-\d{2}$/.test(i) ? Ve(i) : ke(i), mono: !0 };
316
+ return { text: /^date$/i.test(o) || /^\d{4}-\d{2}-\d{2}(?:T00:00:00(?:\.0+)?Z)?$/.test(i) ? Ve(i) : ke(i), mono: !0 };
317
317
  }
318
318
  if (typeof t == "number" || /^(integer|decimal|float|bigInteger|money)$/i.test(o) && Number.isFinite(Number(t)))
319
319
  return { text: Number(t).toLocaleString("en-US", Ne(r)), mono: !0 };
@@ -362,10 +362,10 @@ function ft({
362
362
  };
363
363
  }, he = (e) => {
364
364
  const t = qe.has(e.rev.id), n = 6, r = t ? e.snapshot : e.snapshot.slice(0, n), s = e.snapshot.length - r.length;
365
- return /* @__PURE__ */ c(Z, { children: [
365
+ return /* @__PURE__ */ c(X, { children: [
366
366
  e.provenance.kind === "machine" && /* @__PURE__ */ c("p", { className: "mt-0.5 text-[11.5px] text-muted-foreground", children: [
367
367
  e.provenance.text,
368
- e.provenance.fileId && /* @__PURE__ */ c(Z, { children: [
368
+ e.provenance.fileId && /* @__PURE__ */ c(X, { children: [
369
369
  " · ",
370
370
  /* @__PURE__ */ a(
371
371
  "a",
@@ -414,7 +414,7 @@ function ft({
414
414
  ] })
415
415
  ] }, o.field);
416
416
  }) }),
417
- e.snapshot.length > 0 && /* @__PURE__ */ c(Z, { children: [
417
+ e.snapshot.length > 0 && /* @__PURE__ */ c(X, { children: [
418
418
  /* @__PURE__ */ a(
419
419
  "dl",
420
420
  {
@@ -465,17 +465,17 @@ function ft({
465
465
  )
466
466
  ] })
467
467
  ] });
468
- }, pe = (e, t) => re ? e.kind === "delete" ? e.snapshot.length > 0 : t && !y || y && ze(e) ? !1 : Object.keys(e.rev.data ?? {}).length > 0 : !1, G = $(() => {
468
+ }, pe = (e, t) => re ? e.kind === "delete" ? e.snapshot.length > 0 : t && !y || y && ze(e) ? !1 : Object.keys(e.rev.data ?? {}).length > 0 : !1, Z = _(() => {
469
469
  var t;
470
470
  const e = /* @__PURE__ */ new Map();
471
- for (const n of _) {
471
+ for (const n of $) {
472
472
  const r = ((t = n.row) == null ? void 0 : t.itemId) ?? "";
473
473
  e.has(r) || e.set(r, n.rev.id);
474
474
  }
475
475
  return e;
476
- }, [_]), ze = (e) => {
476
+ }, [$]), ze = (e) => {
477
477
  var t;
478
- return G.get(((t = e.row) == null ? void 0 : t.itemId) ?? "") === e.rev.id;
478
+ return Z.get(((t = e.row) == null ? void 0 : t.itemId) ?? "") === e.rev.id;
479
479
  }, ge = (e, t) => {
480
480
  var s;
481
481
  if (!pe(e, t)) return null;
@@ -484,7 +484,7 @@ function ft({
484
484
  "button",
485
485
  {
486
486
  type: "button",
487
- onClick: () => _e(r, { ...Ee(e), rowDeleted: n }),
487
+ onClick: () => $e(r, { ...Ee(e), rowDeleted: n }),
488
488
  className: "ml-auto inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors duration-150 hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
489
489
  "data-tip": n ? "Open a new line pre-filled with these values — nothing is saved until you save the line" : "Load this version into the row editor — nothing is saved until you save the row",
490
490
  children: [
@@ -504,14 +504,14 @@ function ft({
504
504
  }
505
505
  ),
506
506
  !n && /* @__PURE__ */ a("span", { className: "absolute bottom-[-24px] top-[11px] w-px bg-border" })
507
- ] }), X = _.length, Be = y ? `${X} ${X === 1 ? "version" : "versions"} across ${G.size} ${G.size === 1 ? "line" : "lines"}` : `${v.length} ${v.length === 1 ? "version" : "versions"}`;
507
+ ] }), G = $.length, Be = y ? `${G} ${G === 1 ? "version" : "versions"} across ${Z.size} ${Z.size === 1 ? "line" : "lines"}` : `${v.length} ${v.length === 1 ? "version" : "versions"}`;
508
508
  return /* @__PURE__ */ a(He, { open: f, onOpenChange: x, children: /* @__PURE__ */ c(Qe, { className: "flex w-[560px] flex-col gap-0 p-0 sm:max-w-[560px]", children: [
509
509
  /* @__PURE__ */ c(We, { className: "shrink-0 border-b border-border px-6 pb-4 pt-5 text-left", children: [
510
510
  /* @__PURE__ */ a(Ue, { className: "text-[14px] font-semibold", children: y ? "Lines timeline" : "Row history" }),
511
511
  /* @__PURE__ */ c("p", { className: "mt-0.5 flex min-w-0 items-baseline gap-2 text-[12px] text-muted-foreground", children: [
512
512
  /* @__PURE__ */ a("span", { className: "shrink-0 font-medium text-foreground", children: b }),
513
513
  k && /* @__PURE__ */ a("span", { className: "truncate", children: k }),
514
- !N && X > 0 && /* @__PURE__ */ a("span", { className: "ml-auto shrink-0 tabular-nums", children: Be })
514
+ !N && G > 0 && /* @__PURE__ */ a("span", { className: "ml-auto shrink-0 tabular-nums", children: Be })
515
515
  ] }),
516
516
  je && !N && /* @__PURE__ */ a("p", { className: "mt-1 text-[11px] text-amber-700 dark:text-amber-400", children: "Showing the newest versions only — older history was not loaded." })
517
517
  ] }),
@@ -522,7 +522,7 @@ function ft({
522
522
  /* @__PURE__ */ a("div", { className: "h-3 w-40 rounded bg-[hsl(var(--nvr-skeleton))]" }),
523
523
  /* @__PURE__ */ a("div", { className: "h-3 w-48 rounded bg-[hsl(var(--nvr-skeleton))]" })
524
524
  ] })
525
- ] }, e)) }) : _.length === 0 ? /* @__PURE__ */ c("div", { className: "rounded-lg border border-dashed border-border px-4 py-8 text-center", children: [
525
+ ] }, e)) }) : $.length === 0 ? /* @__PURE__ */ c("div", { className: "rounded-lg border border-dashed border-border px-4 py-8 text-center", children: [
526
526
  /* @__PURE__ */ a("p", { className: "text-[13px] font-medium text-foreground", children: "No history yet" }),
527
527
  /* @__PURE__ */ a("p", { className: "mt-1 text-[12px] text-muted-foreground", children: y ? "Every line added, changed or removed on this record will be listed here." : "Every save of this line will be listed here with what changed." })
528
528
  ] }) : /* @__PURE__ */ a("ol", { className: "relative", children: B.map((e, t) => {
@@ -542,7 +542,7 @@ function ft({
542
542
  }
543
543
  ) : null;
544
544
  if (!o) {
545
- const i = e.versions[0], p = n;
545
+ const i = e.versions[0], h = n;
546
546
  return /* @__PURE__ */ c(
547
547
  "li",
548
548
  {
@@ -553,7 +553,7 @@ function ft({
553
553
  ),
554
554
  style: { animationDelay: `${Math.min(t, 8) * 30}ms` },
555
555
  children: [
556
- xe(p, i.kind, r),
556
+ xe(h, i.kind, r),
557
557
  /* @__PURE__ */ c("div", { className: "min-w-0", children: [
558
558
  /* @__PURE__ */ c("div", { className: "flex flex-wrap items-baseline gap-x-1.5 gap-y-0.5 text-[12.5px] leading-5", children: [
559
559
  /* @__PURE__ */ a("span", { className: "font-semibold text-foreground", children: i.who }),
@@ -564,9 +564,9 @@ function ft({
564
564
  ] }),
565
565
  /* @__PURE__ */ a("span", { className: "text-muted-foreground", children: "·" }),
566
566
  /* @__PURE__ */ a("span", { className: "text-muted-foreground", "data-tip": s || void 0, children: i.rev.timestamp ? ve(i.rev.timestamp) : "" }),
567
- p && !y && /* @__PURE__ */ a("span", { className: "ml-auto rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-medium text-[#0b7ea6] dark:text-nvr-cyan", children: "Current" }),
568
- (pe(i, p) || u) && /* @__PURE__ */ c("span", { className: "ml-auto inline-flex items-center gap-1", children: [
569
- ge(i, p),
567
+ h && !y && /* @__PURE__ */ a("span", { className: "ml-auto rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-medium text-[#0b7ea6] dark:text-nvr-cyan", children: "Current" }),
568
+ (pe(i, h) || u) && /* @__PURE__ */ c("span", { className: "ml-auto inline-flex items-center gap-1", children: [
569
+ ge(i, h),
570
570
  y && u
571
571
  ] })
572
572
  ] }),
@@ -608,7 +608,7 @@ function ft({
608
608
  }
609
609
  ) : /* @__PURE__ */ c("ol", { className: "mt-2 space-y-3 border-l border-border pl-3", children: [
610
610
  e.versions.map((i) => {
611
- var p, m;
611
+ var h, m;
612
612
  return /* @__PURE__ */ c(
613
613
  "li",
614
614
  {
@@ -626,7 +626,7 @@ function ft({
626
626
  "font-medium",
627
627
  i.kind === "delete" ? "text-red-600 dark:text-red-400" : i.kind === "create" ? "text-emerald-700 dark:text-emerald-400" : "text-foreground"
628
628
  ),
629
- children: ((p = i.row) == null ? void 0 : p.title) ?? "Line"
629
+ children: ((h = i.row) == null ? void 0 : h.title) ?? "Line"
630
630
  }
631
631
  ),
632
632
  /* @__PURE__ */ a("span", { className: "text-muted-foreground", children: i.kind === "create" ? "added" : i.kind === "delete" ? "deleted" : i.changes.length === 0 ? "saved" : `${i.changes.map((w) => T(w.field)).slice(0, 3).join(
@@ -668,7 +668,7 @@ function ft({
668
668
  }
669
669
  export {
670
670
  ft as RowHistorySheet,
671
- Xe as parseImportStamp,
672
- Ze as provenanceOf,
673
- Ge as useMachineMarkers
671
+ Ge as parseImportStamp,
672
+ Xe as provenanceOf,
673
+ Ze as useMachineMarkers
674
674
  };
@@ -0,0 +1,28 @@
1
+ import { useState as c, useRef as i, useEffect as s } from "react";
2
+ import { matchesAllTokens as a } from "../../lib/utils.js";
3
+ function S(t, n, r = 300) {
4
+ const [e, o] = c(t), f = i(!1);
5
+ return s(() => {
6
+ if (t === e) {
7
+ f.current = !1;
8
+ return;
9
+ }
10
+ if (!t) {
11
+ o("");
12
+ return;
13
+ }
14
+ if (n) {
15
+ f.current = !0;
16
+ return;
17
+ }
18
+ const u = setTimeout(() => o(t), f.current ? 0 : r);
19
+ return () => clearTimeout(u);
20
+ }, [t, e, n, r]), e;
21
+ }
22
+ function T(t, n, r, e) {
23
+ return e || !r.trim() ? t : t.filter((o) => a(n(o), r));
24
+ }
25
+ export {
26
+ T as narrowLocally,
27
+ S as useLatestSearch
28
+ };