@nivaro/react 0.3.111 → 0.3.113

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 (77) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +207 -3
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3133 -2954
  6. package/dist/shared/components/CollectionImportBanner.js +135 -0
  7. package/dist/shared/components/ItemEditForm.js +2235 -2218
  8. package/dist/shared/components/JobsTray.js +54 -47
  9. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  10. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  11. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  12. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  13. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  14. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  15. package/dist/shared/components/cbv/ColumnHeaderMenu.js +130 -0
  16. package/dist/shared/components/cbv/column-totals.js +163 -0
  17. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  18. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  19. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  20. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  21. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  22. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  23. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  24. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  25. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  26. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  27. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  28. package/dist/shared/components/item-edit/InlineTableField.js +3002 -2825
  29. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  30. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  31. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  32. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  33. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  34. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  35. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  36. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  37. package/dist/shared/components/item-edit/UserChip.js +262 -239
  38. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  39. package/dist/shared/components/item-edit/grid-search.js +375 -0
  40. package/dist/shared/components/item-edit/render-stability.js +61 -54
  41. package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
  42. package/dist/shared/components/ops-report/DigestSections.js +163 -144
  43. package/dist/shared/components/ops-report/drill.js +97 -97
  44. package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
  45. package/dist/shared/components/panels/AddendumPanel.js +92 -91
  46. package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
  47. package/dist/shared/components/panels/CommentPanel.js +265 -252
  48. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  49. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  50. package/dist/shared/components/panels/PipelinePanel.js +1440 -1397
  51. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  52. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  53. package/dist/shared/components/panels/StandInReason.js +69 -0
  54. package/dist/shared/components/pipeline/FieldPicker.js +41 -40
  55. package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
  56. package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
  57. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
  58. package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
  59. package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
  60. package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
  61. package/dist/shared/components/profile/PersonHeader.js +29 -29
  62. package/dist/shared/components/profile/PersonProfile.js +30 -28
  63. package/dist/shared/components/profile/SlowScreensCard.js +286 -0
  64. package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
  65. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
  66. package/dist/shared/components/support/TicketDetailSheet.js +25 -16
  67. package/dist/shared/components/support/TicketSlowScreens.js +32 -0
  68. package/dist/shared/lib/activity-sentence.js +224 -178
  69. package/dist/shared/lib/collection-import-banner.js +27 -0
  70. package/dist/shared/lib/crash-report.js +112 -0
  71. package/dist/shared/lib/export-runs.js +99 -0
  72. package/dist/shared/lib/jobs-tray.js +89 -67
  73. package/dist/shared/lib/list-link.js +76 -69
  74. package/dist/shared/lib/nav-trail.js +180 -76
  75. package/dist/shared/lib/query-keys.js +26 -0
  76. package/dist/shared/lib/view-as.js +16 -11
  77. package/package.json +1 -1
@@ -0,0 +1,135 @@
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { useQueryClient as I, useQuery as C } from "@tanstack/react-query";
3
+ import { FileUp as S, CheckCircle2 as T, TriangleAlert as D, X as q } from "lucide-react";
4
+ import { useState as b, useEffect as A } from "react";
5
+ import { useNivaroClient as E, useItemEditAuth as Q } from "../context.js";
6
+ import { importBannerState as _, runningTitle as j, formatElapsed as B, rowsText as F } from "../lib/collection-import-banner.js";
7
+ import { get as K } from "../lib/commands.js";
8
+ import { useLiveEvent as L } from "../lib/live.js";
9
+ function P({
10
+ collection: n,
11
+ scope: o = "list",
12
+ className: d
13
+ }) {
14
+ const p = E(), f = I(), { isAdmin: g } = Q(), x = ["collection-import-runs", n], { data: k } = C({
15
+ queryKey: x,
16
+ enabled: !!n,
17
+ staleTime: 15e3,
18
+ queryFn: async () => (await p.request(
19
+ K("/staged-imports/collection-runs", { collection: n })
20
+ )).data ?? [],
21
+ refetchInterval: (r) => {
22
+ var h;
23
+ return (h = r.state.data) != null && h.some(($) => $.status === "running") ? 3e4 : !1;
24
+ },
25
+ retry: !1
26
+ });
27
+ L(
28
+ "import:collection",
29
+ () => void f.invalidateQueries({ queryKey: ["collection-import-runs", n] }),
30
+ { match: (r) => (r == null ? void 0 : r.collection) === n, enabled: !!n }
31
+ );
32
+ const [w, v] = b(() => /* @__PURE__ */ new Set()), [y, l] = b(() => Date.now()), e = _(k, y, w), m = (e == null ? void 0 : e.kind) === "running";
33
+ if (A(() => {
34
+ if (!m) return;
35
+ l(Date.now());
36
+ const r = setInterval(() => l(Date.now()), 1e3);
37
+ return () => clearInterval(r);
38
+ }, [m]), !e) return null;
39
+ const N = o === "record" ? "this record" : "the list";
40
+ if (e.kind === "running")
41
+ return /* @__PURE__ */ i(
42
+ "div",
43
+ {
44
+ "data-collection-importing": !0,
45
+ role: "status",
46
+ className: `rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10 ${d ?? ""}`,
47
+ children: [
48
+ /* @__PURE__ */ t("style", { children: `
49
+ @keyframes nvr-import-indeterminate {
50
+ 0% { left: -35%; width: 35%; }
51
+ 60% { left: 55%; width: 45%; }
52
+ 100% { left: 105%; width: 30%; }
53
+ }
54
+ [data-collection-importing] .nvr-import-bar::after {
55
+ content: ''; position: absolute; top: 0; bottom: 0; border-radius: 9999px;
56
+ background: rgb(245 158 11);
57
+ animation: nvr-import-indeterminate 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
58
+ }
59
+ @media (prefers-reduced-motion: reduce) {
60
+ [data-collection-importing] .nvr-import-bar::after { animation: none; left: 0; width: 100%; opacity: 0.45; }
61
+ }
62
+ ` }),
63
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
64
+ /* @__PURE__ */ t(S, { className: "h-4 w-4 shrink-0 animate-pulse text-amber-500" }),
65
+ /* @__PURE__ */ i("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: [
66
+ /* @__PURE__ */ t("span", { className: "font-semibold", children: j(e.runs) }),
67
+ " — it writes",
68
+ " ",
69
+ o === "record" ? "this collection's records" : "these records",
70
+ " all at once when it finishes, so ",
71
+ N,
72
+ " may change then."
73
+ ] }),
74
+ e.elapsedSeconds != null && /* @__PURE__ */ t(
75
+ "span",
76
+ {
77
+ className: "shrink-0 font-mono text-[11.5px] tabular-nums text-amber-700 dark:text-amber-300",
78
+ "data-tip": "Time since the import started",
79
+ children: B(e.elapsedSeconds)
80
+ }
81
+ )
82
+ ] }),
83
+ /* @__PURE__ */ t(
84
+ "div",
85
+ {
86
+ className: "nvr-import-bar relative mt-2 h-1 overflow-hidden rounded-full bg-amber-200/70 dark:bg-amber-500/20",
87
+ role: "progressbar",
88
+ "aria-label": "Import progress",
89
+ "aria-busy": "true"
90
+ }
91
+ )
92
+ ]
93
+ }
94
+ );
95
+ const s = e.run, c = s.finished_at ? new Date(s.finished_at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) : null, a = e.kind === "completed", u = a ? F(s.rows) : null;
96
+ return /* @__PURE__ */ i(
97
+ "div",
98
+ {
99
+ "data-collection-import-ended": e.kind,
100
+ role: "status",
101
+ className: `flex items-center gap-3 rounded-lg border px-3.5 py-2.5 ${a ? "border-emerald-300 bg-emerald-50 dark:border-emerald-500/40 dark:bg-emerald-500/10" : "border-rose-300 bg-rose-50 dark:border-rose-500/40 dark:bg-rose-500/10"} ${d ?? ""}`,
102
+ children: [
103
+ a ? /* @__PURE__ */ t(T, { className: "h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400" }) : /* @__PURE__ */ t(D, { className: "h-4 w-4 shrink-0 text-rose-600 dark:text-rose-400" }),
104
+ /* @__PURE__ */ i(
105
+ "p",
106
+ {
107
+ className: `min-w-0 flex-1 text-[12px] ${a ? "text-emerald-800 dark:text-emerald-300" : "text-rose-800 dark:text-rose-300"}`,
108
+ children: [
109
+ /* @__PURE__ */ i("span", { className: "font-semibold", children: [
110
+ s.label,
111
+ " import ",
112
+ a ? "finished" : "failed"
113
+ ] }),
114
+ c ? ` at ${c}` : "",
115
+ a ? ` — ${u ? `${u}. ` : ""}Its changes are showing here.` : ` — what it would have changed may be missing here. ${g ? "The reason is in the Import Console." : "An administrator can see the reason."}`
116
+ ]
117
+ }
118
+ ),
119
+ /* @__PURE__ */ t(
120
+ "button",
121
+ {
122
+ type: "button",
123
+ onClick: () => v((r) => new Set(r).add(s.run_id)),
124
+ "aria-label": "Dismiss",
125
+ className: `shrink-0 rounded p-1 ${a ? "text-emerald-700 hover:bg-emerald-100 dark:text-emerald-300 dark:hover:bg-emerald-500/10" : "text-rose-700 hover:bg-rose-100 dark:text-rose-300 dark:hover:bg-rose-500/10"}`,
126
+ children: /* @__PURE__ */ t(q, { className: "h-3.5 w-3.5" })
127
+ }
128
+ )
129
+ ]
130
+ }
131
+ );
132
+ }
133
+ export {
134
+ P as CollectionImportBanner
135
+ };