@nivaro/react 0.3.139 → 0.3.140

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 (87) hide show
  1. package/dist/components/InlineGridField.js +95 -92
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +36 -2
  4. package/dist/shared/components/AudienceConfirmPanel.js +19 -19
  5. package/dist/shared/components/BroadcastView.js +213 -211
  6. package/dist/shared/components/CollectionBrowserView.js +2677 -2658
  7. package/dist/shared/components/ConfigHistory.js +45 -45
  8. package/dist/shared/components/ConformanceView.js +110 -110
  9. package/dist/shared/components/DataTable.js +51 -51
  10. package/dist/shared/components/FilePreviewLightbox.js +26 -25
  11. package/dist/shared/components/ItemEditForm.js +3038 -3027
  12. package/dist/shared/components/LiveCount.js +27 -23
  13. package/dist/shared/components/LiveTraceView.js +62 -61
  14. package/dist/shared/components/PageRenderer.js +422 -410
  15. package/dist/shared/components/ProfileView.js +199 -199
  16. package/dist/shared/components/QualityRulesView.js +70 -70
  17. package/dist/shared/components/QueryTable.js +131 -130
  18. package/dist/shared/components/RecordGraph.js +98 -98
  19. package/dist/shared/components/RecordReadView.js +287 -288
  20. package/dist/shared/components/ReportView.js +1279 -1259
  21. package/dist/shared/components/SlaRulesView.js +73 -74
  22. package/dist/shared/components/WidgetSlot.js +73 -73
  23. package/dist/shared/components/ai/AiChart.js +36 -32
  24. package/dist/shared/components/ai/AiMarkdown.js +136 -129
  25. package/dist/shared/components/ai/TaskDo.js +87 -87
  26. package/dist/shared/components/ai/answer-formats.js +37 -30
  27. package/dist/shared/components/ai/call-log/format.js +17 -16
  28. package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
  29. package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
  31. package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
  32. package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
  33. package/dist/shared/components/bulk/bulk-field-options.js +10 -10
  34. package/dist/shared/components/cbv/column-totals.js +53 -51
  35. package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
  37. package/dist/shared/components/command-center/announce.js +7 -6
  38. package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
  39. package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
  40. package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
  41. package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
  42. package/dist/shared/components/imports/RunDetailSheet.js +1 -1
  43. package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
  44. package/dist/shared/components/integrations/console/EventsView.js +35 -35
  45. package/dist/shared/components/integrations/console/FirefightView.js +15 -14
  46. package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
  47. package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
  48. package/dist/shared/components/integrations/console/SignalCard.js +67 -67
  49. package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
  50. package/dist/shared/components/item-edit/ChangesTray.js +88 -74
  51. package/dist/shared/components/item-edit/FilePickerField.js +123 -123
  52. package/dist/shared/components/item-edit/GroupSection.js +301 -292
  53. package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
  54. package/dist/shared/components/item-edit/InlineGridField.js +45 -36
  55. package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
  56. package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
  57. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
  58. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
  59. package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
  60. package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
  61. package/dist/shared/components/ops-report/format.js +37 -36
  62. package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
  63. package/dist/shared/components/panels/RevisionsPanel.js +306 -305
  64. package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
  65. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
  66. package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
  67. package/dist/shared/components/pipeline/TeamsView.js +189 -130
  68. package/dist/shared/components/profile/AgentsPanel.js +6 -6
  69. package/dist/shared/components/profile/DelegationCard.js +13 -12
  70. package/dist/shared/components/profile/PersonActivity.js +48 -48
  71. package/dist/shared/components/profile/PersonExtras.js +107 -107
  72. package/dist/shared/components/profile/PersonWeek.js +9 -9
  73. package/dist/shared/components/queue/QueueBulkBar.js +19 -18
  74. package/dist/shared/components/queue/QueueBulkMove.js +21 -20
  75. package/dist/shared/components/queue/QueueItemSheet.js +136 -131
  76. package/dist/shared/components/queue/QueueWorklist.js +671 -670
  77. package/dist/shared/components/queue/worklist-helpers.js +36 -21
  78. package/dist/shared/components/support/RequestList.js +121 -121
  79. package/dist/shared/components/support/SupportAnalytics.js +29 -29
  80. package/dist/shared/lib/activity-sentence.js +251 -229
  81. package/dist/shared/lib/format-value.js +5 -4
  82. package/dist/shared/lib/number-format.js +87 -0
  83. package/dist/shared/lib/number-kind.js +133 -0
  84. package/dist/shared/lib/utils.js +24 -20
  85. package/dist/shared/lib/watch-list.js +1 -1
  86. package/dist/shared/lib/widget-value-format.js +26 -12
  87. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { jsxs as s, Fragment as H, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as s, Fragment as U, jsx as t } from "react/jsx-runtime";
2
2
  import { Search as Nt, Pin as wt, ChevronDown as _t, Inbox as Ot, ChevronsUpDown as me, ChevronUp as St, X as he, Check as $t, CalendarDays as zt } from "lucide-react";
3
3
  import Et, { useState as z, useMemo as Ze, useRef as be, useEffect as re, useLayoutEffect as Ct } from "react";
4
4
  import { parseDateFilter as Ie, describeDateFilter as Mt, DATE_FILTER_OPS as Tt, formatDateFilter as At } from "../lib/date-filter.js";
@@ -7,7 +7,7 @@ import { parseNumberFilter as Ke, describeNumberFilter as Vt, NUMBER_FILTER_OPS
7
7
  import { ROW_SURFACE_SELECTED as Ft, ROW_SURFACE as Lt, ROW_SURFACE_HOVER as Rt } from "../lib/row-surface.js";
8
8
  import { fitPins as qt } from "../lib/table-pins.js";
9
9
  import { useBelowMd as Ht } from "../lib/use-below-md.js";
10
- import { cn as h, formatNumber as Q } from "../lib/utils.js";
10
+ import { cn as h, formatNumber as R } from "../lib/utils.js";
11
11
  import { CellCopyLayer as Ut } from "./CellCopyLayer.js";
12
12
  import { EmptyState as Dt } from "./EmptyState.js";
13
13
  import { HScrollProxy as Jt } from "./HScrollProxy.js";
@@ -16,7 +16,7 @@ import { TableSkeletonRows as Qt } from "./Skeletons.js";
16
16
  import { Button as de } from "./ui/button.js";
17
17
  import { Checkbox as Pe } from "./ui/checkbox.js";
18
18
  import { Command as Yt, CommandInput as Zt, CommandList as It, CommandEmpty as Kt, CommandItem as Pt } from "./ui/command.js";
19
- import { Input as R } from "./ui/input.js";
19
+ import { Input as q } from "./ui/input.js";
20
20
  import { Popover as ue, PopoverTrigger as fe, PopoverContent as xe } from "./ui/popover.js";
21
21
  import { Select as Gt, SelectTrigger as er, SelectValue as tr, SelectContent as rr, SelectItem as Ge } from "./ui/select.js";
22
22
  import { Table as et, TableHeader as tt, TableRow as Y, TableHead as Z, TableBody as rt, TableCell as ce } from "./ui/table.js";
@@ -235,7 +235,7 @@ function dr({
235
235
  className: "h-7 flex-1 rounded border border-slate-200 bg-background px-1 text-[12px] dark:border-border"
236
236
  }
237
237
  ),
238
- p === "between" && /* @__PURE__ */ s(H, { children: [
238
+ p === "between" && /* @__PURE__ */ s(U, { children: [
239
239
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "to" }),
240
240
  /* @__PURE__ */ t(
241
241
  "input",
@@ -291,7 +291,7 @@ function cr({
291
291
  /* @__PURE__ */ t("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: d }),
292
292
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
293
293
  /* @__PURE__ */ t(
294
- R,
294
+ q,
295
295
  {
296
296
  type: "number",
297
297
  "aria-label": `Minimum ${d}`,
@@ -303,7 +303,7 @@ function cr({
303
303
  ),
304
304
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "–" }),
305
305
  /* @__PURE__ */ t(
306
- R,
306
+ q,
307
307
  {
308
308
  type: "number",
309
309
  "aria-label": `Maximum ${d}`,
@@ -372,7 +372,7 @@ function or({
372
372
  )) }),
373
373
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
374
374
  /* @__PURE__ */ t(
375
- R,
375
+ q,
376
376
  {
377
377
  type: "number",
378
378
  value: w,
@@ -382,10 +382,10 @@ function or({
382
382
  className: "h-7 text-[12px]"
383
383
  }
384
384
  ),
385
- p === "between" && /* @__PURE__ */ s(H, { children: [
385
+ p === "between" && /* @__PURE__ */ s(U, { children: [
386
386
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: "–" }),
387
387
  /* @__PURE__ */ t(
388
- R,
388
+ q,
389
389
  {
390
390
  type: "number",
391
391
  value: x,
@@ -410,7 +410,7 @@ function lt({
410
410
  let N;
411
411
  if (r.type === "text")
412
412
  N = /* @__PURE__ */ t(
413
- R,
413
+ q,
414
414
  {
415
415
  className: h("h-8 border-slate-200 bg-slate-50", w, g),
416
416
  placeholder: r.placeholder,
@@ -461,7 +461,7 @@ function lt({
461
461
  const [x, u] = p.split(":");
462
462
  N = /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
463
463
  /* @__PURE__ */ t(
464
- R,
464
+ q,
465
465
  {
466
466
  type: "number",
467
467
  className: h(
@@ -476,7 +476,7 @@ function lt({
476
476
  ),
477
477
  /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-400", children: "–" }),
478
478
  /* @__PURE__ */ t(
479
- R,
479
+ q,
480
480
  {
481
481
  type: "number",
482
482
  className: h(
@@ -525,7 +525,7 @@ function lt({
525
525
  className: "[&_button]:!border-amber-400 [&_input]:!border-amber-400 dark:[&_button]:!border-amber-500/60 dark:[&_input]:!border-amber-500/60",
526
526
  children: N
527
527
  }
528
- ) : /* @__PURE__ */ t(H, { children: N });
528
+ ) : /* @__PURE__ */ t(U, { children: N });
529
529
  }
530
530
  function nt(r) {
531
531
  return r.placeholder.replace(/^Search\s+/i, "").replace(/[…]|\.{3}$/g, "");
@@ -590,9 +590,9 @@ function jr({
590
590
  rowTitle: _e,
591
591
  enterKey: pt,
592
592
  rowGroups: V,
593
- collapsedGroups: U,
593
+ collapsedGroups: D,
594
594
  onToggleGroup: Oe,
595
- onRowFocus: D,
595
+ onRowFocus: J,
596
596
  activeRowKey: ne,
597
597
  rowAriaLabel: Se,
598
598
  totalsRow: P
@@ -603,20 +603,20 @@ function jr({
603
603
  if (!_ || !v) return r;
604
604
  const e = new Set(Fe), l = ($) => v[$] === "right" && !e.has($), i = r.filter(($) => v[$.key] === "left"), E = r.filter(($) => l($.key)), W = r.filter(($) => v[$.key] !== "left" && !l($.key));
605
605
  return [...i, ...W, ...E];
606
- }, [r, v, _, Fe]), Le = be({}), q = be(null);
607
- jt(q);
606
+ }, [r, v, _, Fe]), Le = be({}), H = be(null);
607
+ jt(H);
608
608
  const Re = be(null), qe = !p && (V ? V.length === 0 : d.length === 0), [He, ut] = z(null);
609
609
  re(() => {
610
- const e = q.current;
610
+ const e = H.current;
611
611
  if (!qe || !e) return;
612
612
  const l = () => ut(e.clientWidth);
613
613
  if (l(), typeof ResizeObserver > "u") return;
614
614
  const i = new ResizeObserver(l);
615
615
  return i.observe(e), () => i.disconnect();
616
616
  }, [qe]);
617
- const [ee, ft] = z({}), [, xt] = z(0), $e = Ht(), J = le && $e ? void 0 : st;
617
+ const [ee, ft] = z({}), [, xt] = z(0), $e = Ht(), X = le && $e ? void 0 : st;
618
618
  re(() => {
619
- const e = q.current;
619
+ const e = H.current;
620
620
  if (!_ || !e || typeof ResizeObserver > "u") return;
621
621
  const l = new ResizeObserver(() => xt(e.clientWidth));
622
622
  return l.observe(e), () => l.disconnect();
@@ -631,7 +631,7 @@ function jr({
631
631
  const E = (f) => {
632
632
  var Ye;
633
633
  i ?? (i = [
634
- ...((Ye = q.current) == null ? void 0 : Ye.querySelectorAll("tbody td[data-dt-col]")) ?? []
634
+ ...((Ye = H.current) == null ? void 0 : Ye.querySelectorAll("tbody td[data-dt-col]")) ?? []
635
635
  ]);
636
636
  const B = i.filter((te) => te.dataset.dtCol === f);
637
637
  if (B.length === 0) return !1;
@@ -647,14 +647,14 @@ function jr({
647
647
  W,
648
648
  e,
649
649
  l,
650
- ((Qe = q.current) == null ? void 0 : Qe.clientWidth) ?? 0,
650
+ ((Qe = H.current) == null ? void 0 : Qe.clientWidth) ?? 0,
651
651
  {
652
652
  compact: $e,
653
653
  rightShare: ot,
654
654
  rank: ve ? (f) => E(f) ? -1e6 : ve(f) : void 0
655
655
  }
656
- ), X = ve && !$e ? W.filter((f) => !y.includes(f)) : [];
657
- ht((f) => f.join("|") === X.join("|") ? f : X);
656
+ ), Q = ve && !$e ? W.filter((f) => !y.includes(f)) : [];
657
+ ht((f) => f.join("|") === Q.join("|") ? f : Q);
658
658
  const ie = {};
659
659
  let De = l;
660
660
  $.forEach((f, B) => {
@@ -692,11 +692,11 @@ function jr({
692
692
  for (const l of m ?? []) e.set(l.key, l);
693
693
  return e;
694
694
  }, [m]), kt = bt && ((m == null ? void 0 : m.length) ?? 0) > 0, vt = (() => {
695
- if (!D) return null;
696
- const e = V ? V.flatMap((i) => U != null && U.has(i.key) ? [] : i.rows) : d, l = (i, E) => o ? o(i, E) : String(E);
695
+ if (!J) return null;
696
+ const e = V ? V.flatMap((i) => D != null && D.has(i.key) ? [] : i.rows) : d, l = (i, E) => o ? o(i, E) : String(E);
697
697
  return ne && e.some((i, E) => l(i, E) === ne) ? ne : e.length > 0 ? l(e[0], 0) : null;
698
698
  })(), Ue = (e, l) => {
699
- const i = o ? o(e, l) : String(l), E = (j == null ? void 0 : j.includes(i)) ?? !1, W = !!D, $ = W && i === vt;
699
+ const i = o ? o(e, l) : String(l), E = (j == null ? void 0 : j.includes(i)) ?? !1, W = !!J, $ = W && i === vt;
700
700
  return /* @__PURE__ */ s(
701
701
  Y,
702
702
  {
@@ -706,7 +706,7 @@ function jr({
706
706
  // their own local group, and claiming the unnamed one here would
707
707
  // make those reveal on row hover instead.
708
708
  "group/row nvr-row-enter border-slate-100 transition-colors duration-150",
709
- D && "focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-nvr-cyan",
709
+ J && "focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-nvr-cyan",
710
710
  // Pinned: opaque surface AND opaque hover (the base row's hover:bg-muted/50 is
711
711
  // translucent, so the pinned cells would go see-through under the pointer).
712
712
  (A || _) && `${Lt} ${Rt}`,
@@ -727,7 +727,7 @@ function jr({
727
727
  "aria-current": $ && ne === i ? "true" : void 0,
728
728
  "aria-label": Se == null ? void 0 : Se(e),
729
729
  onFocus: (y) => {
730
- y.target === y.currentTarget && (D == null || D(e));
730
+ y.target === y.currentTarget && (J == null || J(e));
731
731
  },
732
732
  onKeyDown: (y) => {
733
733
  y.key !== "Enter" || y.target !== y.currentTarget || !O || (y.preventDefault(), O(e));
@@ -743,12 +743,12 @@ function jr({
743
743
  (A || _) && "sticky left-0 z-[1] min-w-[40px] bg-inherit"
744
744
  ),
745
745
  onClick: (y) => {
746
- y.stopPropagation(), M(E ? (j == null ? void 0 : j.filter((X) => X !== i)) ?? [] : [...j ?? [], i]);
746
+ y.stopPropagation(), M(E ? (j == null ? void 0 : j.filter((Q) => Q !== i)) ?? [] : [...j ?? [], i]);
747
747
  },
748
748
  children: /* @__PURE__ */ t(Pe, { checked: E, "aria-label": "Select row" })
749
749
  }
750
750
  ),
751
- L.map((y, X) => /* @__PURE__ */ t(
751
+ L.map((y, Q) => /* @__PURE__ */ t(
752
752
  ce,
753
753
  {
754
754
  "data-dt-col": y.key,
@@ -757,7 +757,7 @@ function jr({
757
757
  "px-3",
758
758
  ge === "compact" ? "py-1" : "py-2",
759
759
  ct && "whitespace-nowrap",
760
- !_ && A && X === 0 && h(
760
+ !_ && A && Q === 0 && h(
761
761
  "sticky z-[1] border-r border-slate-100 bg-inherit dark:border-border",
762
762
  M ? "left-[39px]" : "left-0"
763
763
  ),
@@ -773,7 +773,7 @@ function jr({
773
773
  i
774
774
  );
775
775
  };
776
- return /* @__PURE__ */ s(H, { children: [
776
+ return /* @__PURE__ */ s(U, { children: [
777
777
  /* @__PURE__ */ t(Ut, {}),
778
778
  w && N && /* @__PURE__ */ s(
779
779
  "div",
@@ -809,7 +809,7 @@ function jr({
809
809
  K !== void 0 && /* @__PURE__ */ s("div", { className: "relative min-w-0 max-w-full", children: [
810
810
  /* @__PURE__ */ t(Nt, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
811
811
  /* @__PURE__ */ t(
812
- R,
812
+ q,
813
813
  {
814
814
  className: "h-8 w-56 max-w-full border-slate-200 bg-slate-50 pl-8 text-[13px]",
815
815
  placeholder: ae,
@@ -840,7 +840,7 @@ function jr({
840
840
  "data-skeleton": "table",
841
841
  "aria-busy": "true",
842
842
  className: h(le && "min-h-0 flex-1 overflow-hidden"),
843
- style: J ? { minHeight: J } : void 0,
843
+ style: X ? { minHeight: X } : void 0,
844
844
  children: /* @__PURE__ */ s(et, { className: "border-separate border-spacing-0", children: [
845
845
  /* @__PURE__ */ t(tt, { children: /* @__PURE__ */ s(Y, { className: "border-b border-slate-200 hover:bg-transparent", children: [
846
846
  M && /* @__PURE__ */ t(Z, { className: "h-9 w-9 border-b border-slate-200 bg-slate-50 px-3 py-0 dark:border-border dark:bg-muted" }),
@@ -869,11 +869,11 @@ function jr({
869
869
  ] })
870
870
  }
871
871
  )
872
- ) : /* @__PURE__ */ s(H, { children: [
872
+ ) : /* @__PURE__ */ s(U, { children: [
873
873
  /* @__PURE__ */ t(
874
874
  "div",
875
875
  {
876
- ref: q,
876
+ ref: H,
877
877
  "data-stale": g ? "" : void 0,
878
878
  "aria-busy": g || void 0,
879
879
  className: h(
@@ -886,7 +886,7 @@ function jr({
886
886
  // horizontal scroll cannot bleed through it.
887
887
  le && "min-h-0 flex-1 overflow-y-auto [&_thead_th]:sticky [&_thead_th]:top-0 [&_thead_th]:z-[5] [&_thead_th.left-0]:z-[6] [&_thead_th.dt-pinned]:z-[6]"
888
888
  ),
889
- style: J ? { minHeight: J } : void 0,
889
+ style: X ? { minHeight: X } : void 0,
890
890
  children: /* @__PURE__ */ s(
891
891
  et,
892
892
  {
@@ -956,7 +956,7 @@ function jr({
956
956
  /* @__PURE__ */ t(at, { field: e.key, sort: u })
957
957
  ]
958
958
  }
959
- ) : /* @__PURE__ */ s(H, { children: [
959
+ ) : /* @__PURE__ */ s(U, { children: [
960
960
  e.header,
961
961
  !pe(e.header).trim() && /* @__PURE__ */ t("span", { className: "sr-only", children: oe(e) }),
962
962
  e.sortable && k && /* @__PURE__ */ t(at, { field: e.key, sort: u })
@@ -1033,7 +1033,7 @@ function jr({
1033
1033
  ] }),
1034
1034
  /* @__PURE__ */ s(rt, { className: "tabular-nums", children: [
1035
1035
  V ? V.map((e) => {
1036
- const l = (U == null ? void 0 : U.has(e.key)) ?? !1;
1036
+ const l = (D == null ? void 0 : D.has(e.key)) ?? !1;
1037
1037
  return /* @__PURE__ */ s(Et.Fragment, { children: [
1038
1038
  /* @__PURE__ */ t(
1039
1039
  Y,
@@ -1070,7 +1070,7 @@ function jr({
1070
1070
  {
1071
1071
  colSpan: r.length + (M ? 1 : 0),
1072
1072
  className: "nvr-fade-in p-0 text-center align-middle text-[13px] text-slate-400",
1073
- style: J ? { height: Math.max(96, J - 56) } : void 0,
1073
+ style: X ? { height: Math.max(96, X - 56) } : void 0,
1074
1074
  children: /* @__PURE__ */ t(
1075
1075
  "div",
1076
1076
  {
@@ -1125,7 +1125,7 @@ function jr({
1125
1125
  )
1126
1126
  }
1127
1127
  ),
1128
- Ae && /* @__PURE__ */ t(Jt, { scrollerRef: q }),
1128
+ Ae && /* @__PURE__ */ t(Jt, { scrollerRef: H }),
1129
1129
  it,
1130
1130
  !V && c > n && /* @__PURE__ */ s(
1131
1131
  "div",
@@ -1137,15 +1137,15 @@ function jr({
1137
1137
  Xt,
1138
1138
  {
1139
1139
  className: "w-full",
1140
- range: /* @__PURE__ */ s(H, { children: [
1140
+ range: /* @__PURE__ */ s(U, { children: [
1141
1141
  /* @__PURE__ */ s("span", { className: "font-semibold text-slate-700 dark:text-slate-200", children: [
1142
- Q(je),
1142
+ R(je),
1143
1143
  "–",
1144
- Q(Ve)
1144
+ R(Ve)
1145
1145
  ] }),
1146
1146
  " ",
1147
1147
  "of ",
1148
- Q(c)
1148
+ R(c)
1149
1149
  ] }),
1150
1150
  prevDisabled: b <= 1,
1151
1151
  nextDisabled: b >= G,
@@ -1154,11 +1154,11 @@ function jr({
1154
1154
  }
1155
1155
  ),
1156
1156
  /* @__PURE__ */ s("p", { className: "hidden text-[12px] text-slate-400 md:block", children: [
1157
- Q(je),
1157
+ R(je),
1158
1158
  "–",
1159
- Q(Ve),
1159
+ R(Ve),
1160
1160
  " of ",
1161
- Q(c),
1161
+ R(c),
1162
1162
  " records"
1163
1163
  ] }),
1164
1164
  /* @__PURE__ */ s("div", { className: "hidden items-center gap-1 md:flex", children: [
@@ -1187,9 +1187,9 @@ function jr({
1187
1187
  }
1188
1188
  ),
1189
1189
  /* @__PURE__ */ s("span", { className: "px-2 text-[12px] text-slate-400", children: [
1190
- b,
1190
+ R(b),
1191
1191
  " / ",
1192
- G
1192
+ R(G)
1193
1193
  ] }),
1194
1194
  /* @__PURE__ */ t(
1195
1195
  de,
@@ -1,10 +1,11 @@
1
1
  import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
- import { Download as b, ChevronLeft as k, ChevronRight as P, RefreshCw as C, X as $ } from "lucide-react";
2
+ import { Download as b, ChevronLeft as k, ChevronRight as P, RefreshCw as C, X as z } from "lucide-react";
3
3
  import { useEffect as L } from "react";
4
- import { createPortal as z } from "react-dom";
5
- import { useParentDraft as D } from "../context.js";
6
- import { useNewerFile as E, versionedUrl as F } from "../lib/newer-file.js";
7
- const W = /* @__PURE__ */ new Set([
4
+ import { createPortal as D } from "react-dom";
5
+ import { useParentDraft as E } from "../context.js";
6
+ import { useNewerFile as W, versionedUrl as $ } from "../lib/newer-file.js";
7
+ import { formatFileSize as j } from "../lib/utils.js";
8
+ const A = /* @__PURE__ */ new Set([
8
9
  "text/plain",
9
10
  "text/csv",
10
11
  "text/tab-separated-values",
@@ -16,17 +17,17 @@ function f(e) {
16
17
  return String(e ?? "").split(";")[0].trim().toLowerCase();
17
18
  }
18
19
  function v(e) {
19
- return W.has(f(e));
20
+ return A.has(f(e));
20
21
  }
21
- function I(e) {
22
+ function B(e) {
22
23
  if (!e) return !1;
23
24
  const l = f(e);
24
25
  return l.startsWith("image/") || l === "application/pdf" || l.startsWith("video/") || l.startsWith("audio/") || v(l);
25
26
  }
26
- function j(e) {
27
- return e == null || !Number.isFinite(e) ? null : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
27
+ function F(e) {
28
+ return e == null || !Number.isFinite(e) ? null : j(e);
28
29
  }
29
- function X({
30
+ function U({
30
31
  file: e,
31
32
  onClose: l,
32
33
  record: g,
@@ -34,20 +35,20 @@ function X({
34
35
  nav: i
35
36
  }) {
36
37
  var p;
37
- const n = D(), x = (p = n == null ? void 0 : n.draft) == null ? void 0 : p.id, N = g ?? (n != null && n.collection && x != null && !n.isNew ? { collection: n.collection, itemId: String(x) } : null), { current: o, newer: m, showNewer: y } = E(e.id, N), r = o ? {
38
+ const n = E(), x = (p = n == null ? void 0 : n.draft) == null ? void 0 : p.id, N = g ?? (n != null && n.collection && x != null && !n.isNew ? { collection: n.collection, itemId: String(x) } : null), { current: o, newer: u, showNewer: y } = W(e.id, N), r = o ? {
38
39
  ...e,
39
- url: F(e.url, o),
40
+ url: $(e.url, o),
40
41
  name: o.filename_download || o.title || e.name,
41
42
  type: o.type ?? e.type,
42
43
  size: o.filesize != null ? Number(o.filesize) : e.size
43
44
  } : e;
44
45
  L(() => {
45
- const u = (d) => {
46
- d.key === "Escape" ? (d.stopPropagation(), l()) : i && i.count > 1 && (d.key === "ArrowLeft" || d.key === "ArrowRight") && (d.stopPropagation(), d.preventDefault(), d.key === "ArrowLeft" ? i.onPrev() : i.onNext());
46
+ const d = (m) => {
47
+ m.key === "Escape" ? (m.stopPropagation(), l()) : i && i.count > 1 && (m.key === "ArrowLeft" || m.key === "ArrowRight") && (m.stopPropagation(), m.preventDefault(), m.key === "ArrowLeft" ? i.onPrev() : i.onNext());
47
48
  };
48
- return window.addEventListener("keydown", u, !0), () => window.removeEventListener("keydown", u, !0);
49
+ return window.addEventListener("keydown", d, !0), () => window.removeEventListener("keydown", d, !0);
49
50
  }, [l, i]);
50
- const a = r.type ?? "", w = j(r.size);
51
+ const a = r.type ?? "", w = F(r.size);
51
52
  let c;
52
53
  return a.startsWith("image/") ? c = /* @__PURE__ */ t(
53
54
  "img",
@@ -89,7 +90,7 @@ function X({
89
90
  ]
90
91
  }
91
92
  )
92
- ] }), z(
93
+ ] }), D(
93
94
  // biome-ignore lint/a11y/useKeyWithClickEvents: Escape handled globally above
94
95
  /* @__PURE__ */ s(
95
96
  "div",
@@ -102,7 +103,7 @@ function X({
102
103
  "div",
103
104
  {
104
105
  className: "flex flex-wrap items-center gap-x-3 gap-y-2 px-4 py-2.5",
105
- onClick: (u) => u.stopPropagation(),
106
+ onClick: (d) => d.stopPropagation(),
106
107
  onKeyDown: () => {
107
108
  },
108
109
  children: [
@@ -146,14 +147,14 @@ function X({
146
147
  }
147
148
  )
148
149
  ] }),
149
- m.kind === "newer" && /* @__PURE__ */ s(
150
+ u.kind === "newer" && /* @__PURE__ */ s(
150
151
  "p",
151
152
  {
152
153
  role: "status",
153
154
  "data-file-newer": !0,
154
155
  className: "nvr-fade-in flex shrink-0 items-center gap-2 rounded-md bg-white/10 py-1 pr-1 pl-2.5 text-[12px] text-white/90 max-sm:order-last max-sm:w-full max-sm:justify-between",
155
156
  children: [
156
- /* @__PURE__ */ t("span", { className: "min-w-0 truncate sm:max-w-[42vw]", children: m.renamed && !m.replaced ? `Renamed to ${m.renamed}` : "A newer version of this file exists" }),
157
+ /* @__PURE__ */ t("span", { className: "min-w-0 truncate sm:max-w-[42vw]", children: u.renamed && !u.replaced ? `Renamed to ${u.renamed}` : "A newer version of this file exists" }),
157
158
  /* @__PURE__ */ s(
158
159
  "button",
159
160
  {
@@ -169,7 +170,7 @@ function X({
169
170
  ]
170
171
  }
171
172
  ),
172
- m.kind === "gone" && /* @__PURE__ */ t(
173
+ u.kind === "gone" && /* @__PURE__ */ t(
173
174
  "p",
174
175
  {
175
176
  role: "status",
@@ -194,7 +195,7 @@ function X({
194
195
  onClick: l,
195
196
  title: "Close (Esc)",
196
197
  className: "rounded p-1.5 text-white/80 hover:bg-white/10 hover:text-white",
197
- children: /* @__PURE__ */ t($, { className: "h-4 w-4" })
198
+ children: /* @__PURE__ */ t(z, { className: "h-4 w-4" })
198
199
  }
199
200
  )
200
201
  ]
@@ -204,7 +205,7 @@ function X({
204
205
  "div",
205
206
  {
206
207
  className: "flex min-h-0 flex-1 items-center justify-center p-4 pt-0",
207
- onClick: (u) => u.stopPropagation(),
208
+ onClick: (d) => d.stopPropagation(),
208
209
  onKeyDown: () => {
209
210
  },
210
211
  children: c
@@ -217,6 +218,6 @@ function X({
217
218
  );
218
219
  }
219
220
  export {
220
- X as FilePreviewLightbox,
221
- I as canPreviewFile
221
+ U as FilePreviewLightbox,
222
+ B as canPreviewFile
222
223
  };