@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
@@ -1,31 +1,31 @@
1
1
  import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
- import { ArrowRight as k, ArrowLeft as g, Workflow as w, LayoutTemplate as y } from "lucide-react";
3
- import { useState as b, useRef as v, useCallback as d, useEffect as u } from "react";
4
- import { titleCase as f, formatRelative as C, formatDateTime as _ } from "../../lib/utils.js";
5
- import { Popover as P, PopoverAnchor as $, PopoverContent as L } from "../ui/popover.js";
2
+ import { AlertTriangle as b, ArrowRight as k, ArrowLeft as w, Workflow as y, LayoutTemplate as v } from "lucide-react";
3
+ import { useState as C, useRef as _, useCallback as d, useEffect as u } from "react";
4
+ import { formatNumber as h, titleCase as f, formatRelative as P, formatDateTime as $ } from "../../lib/utils.js";
5
+ import { Popover as A, PopoverAnchor as S, PopoverContent as E } from "../ui/popover.js";
6
6
  import { Skeleton as c } from "../ui/skeleton.js";
7
- import { useCollectionSummary as S } from "./directory-data.js";
8
- const A = 400, E = 150, h = 6;
9
- function I(s, t = A) {
10
- const [n, i] = b(!1), r = v(null), e = d(() => {
11
- r.current && clearTimeout(r.current), r.current = null;
7
+ import { useCollectionSummary as L } from "./directory-data.js";
8
+ const T = 400, O = 150, N = 6;
9
+ function U(s, e = T) {
10
+ const [n, i] = C(!1), o = _(null), t = d(() => {
11
+ o.current && clearTimeout(o.current), o.current = null;
12
12
  }, []), m = d(() => {
13
- s && (e(), r.current = setTimeout(() => i(!0), t));
14
- }, [s, e, t]), o = d(() => {
15
- e(), r.current = setTimeout(() => i(!1), E);
16
- }, [e]), p = d(() => {
17
- e(), i(!1);
18
- }, [e]);
19
- return u(() => e, [e]), u(() => {
20
- s || p();
21
- }, [s, p]), { open: n, show: m, hide: o, cancel: e, close: p };
13
+ s && (t(), o.current = setTimeout(() => i(!0), e));
14
+ }, [s, t, e]), p = d(() => {
15
+ t(), o.current = setTimeout(() => i(!1), O);
16
+ }, [t]), r = d(() => {
17
+ t(), i(!1);
18
+ }, [t]);
19
+ return u(() => t, [t]), u(() => {
20
+ s || r();
21
+ }, [s, r]), { open: n, show: m, hide: p, cancel: t, close: r };
22
22
  }
23
- function N({ items: s }) {
23
+ function g({ items: s }) {
24
24
  if (s.length === 0)
25
25
  return /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-400 dark:text-slate-500", children: "None" });
26
- const t = s.slice(0, h), n = s.slice(h);
26
+ const e = s.slice(0, N), n = s.slice(N);
27
27
  return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1", children: [
28
- t.map((i) => /* @__PURE__ */ a(
28
+ e.map((i) => /* @__PURE__ */ a(
29
29
  "span",
30
30
  {
31
31
  "data-tip": i.tip,
@@ -47,131 +47,158 @@ function N({ items: s }) {
47
47
  )
48
48
  ] });
49
49
  }
50
- function x({ icon: s, children: t }) {
50
+ function x({ icon: s, children: e }) {
51
51
  return /* @__PURE__ */ l("p", { className: "mb-1 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500", children: [
52
52
  s,
53
- t
53
+ e
54
54
  ] });
55
55
  }
56
- function O({ collection: s }) {
57
- const { data: t, isLoading: n, isError: i } = S(s, !0);
56
+ function j({ flag: s }) {
57
+ return /* @__PURE__ */ l(
58
+ "div",
59
+ {
60
+ "data-heavy-list-note": !0,
61
+ className: "flex gap-2 rounded-md bg-amber-50 px-2 py-1.5 text-[11.5px] leading-snug text-amber-800 ring-1 ring-inset ring-amber-200 dark:bg-amber-400/10 dark:text-amber-200 dark:ring-amber-400/25",
62
+ children: [
63
+ /* @__PURE__ */ a(b, { className: "mt-px h-3.5 w-3.5 shrink-0", "aria-hidden": "true" }),
64
+ /* @__PURE__ */ l("div", { className: "min-w-0", children: [
65
+ /* @__PURE__ */ a("p", { className: "font-medium", children: "Heavy list columns" }),
66
+ /* @__PURE__ */ a("ul", { className: "mt-0.5 space-y-px", children: s.fields.map((e) => /* @__PURE__ */ l("li", { children: [
67
+ e.label,
68
+ ": up to ",
69
+ h(e.max),
70
+ " per record (avg",
71
+ " ",
72
+ h(Math.round(e.avg)),
73
+ ")"
74
+ ] }, e.field)) }),
75
+ /* @__PURE__ */ a("p", { className: "mt-0.5 text-amber-700/90 dark:text-amber-300/80", children: "The list opens on them. Fix it in Data model → Collection Browser." })
76
+ ] })
77
+ ]
78
+ }
79
+ );
80
+ }
81
+ function D({ collection: s }) {
82
+ const { data: e, isLoading: n, isError: i } = L(s, !0);
58
83
  if (n)
59
84
  return /* @__PURE__ */ l("div", { className: "space-y-2", role: "status", "aria-busy": "true", "aria-label": "Loading summary", children: [
60
85
  /* @__PURE__ */ a(c, { className: "h-3 w-24" }),
61
- [0, 1, 2, 3, 4].map((e) => /* @__PURE__ */ l("div", { className: "flex justify-between gap-4", children: [
86
+ [0, 1, 2, 3, 4].map((t) => /* @__PURE__ */ l("div", { className: "flex justify-between gap-4", children: [
62
87
  /* @__PURE__ */ a(c, { className: "h-3 w-32" }),
63
88
  /* @__PURE__ */ a(c, { className: "h-3 w-12" })
64
- ] }, e)),
89
+ ] }, t)),
65
90
  /* @__PURE__ */ a(c, { className: "h-3 w-20" }),
66
91
  /* @__PURE__ */ a(c, { className: "h-4 w-full" })
67
92
  ] });
68
- if (i || !t)
93
+ if (i || !e)
69
94
  return /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "Couldn't load this collection's summary." });
70
- const r = Math.max(0, t.field_count - t.fields.length);
95
+ const o = Math.max(0, e.field_count - e.fields.length);
71
96
  return /* @__PURE__ */ l("div", { className: "space-y-3", children: [
72
97
  /* @__PURE__ */ l("div", { children: [
73
98
  /* @__PURE__ */ l(x, { children: [
74
- t.field_count,
99
+ e.field_count,
75
100
  " field",
76
- t.field_count === 1 ? "" : "s"
101
+ e.field_count === 1 ? "" : "s"
77
102
  ] }),
78
- t.fields.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-400 dark:text-slate-500", children: "No fields yet" }) : /* @__PURE__ */ a("ul", { className: "space-y-0.5", children: t.fields.slice(0, 8).map((e) => /* @__PURE__ */ l("li", { className: "flex items-baseline justify-between gap-3 text-[12px]", children: [
103
+ e.fields.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-400 dark:text-slate-500", children: "No fields yet" }) : /* @__PURE__ */ a("ul", { className: "space-y-0.5", children: e.fields.slice(0, 8).map((t) => /* @__PURE__ */ l("li", { className: "flex items-baseline justify-between gap-3 text-[12px]", children: [
79
104
  /* @__PURE__ */ a(
80
105
  "span",
81
106
  {
82
107
  className: "truncate text-slate-700 dark:text-slate-200",
83
- "data-tip": e.label !== e.field ? e.field : void 0,
84
- children: e.label || e.field
108
+ "data-tip": t.label !== t.field ? t.field : void 0,
109
+ children: t.label || t.field
85
110
  }
86
111
  ),
87
- /* @__PURE__ */ a("span", { className: "shrink-0 font-mono text-[10px] text-slate-400 dark:text-slate-500", children: e.type })
88
- ] }, e.field)) }),
89
- r > 0 && /* @__PURE__ */ l("p", { className: "mt-0.5 text-[11px] text-slate-400 dark:text-slate-500", children: [
112
+ /* @__PURE__ */ a("span", { className: "shrink-0 font-mono text-[10px] text-slate-400 dark:text-slate-500", children: t.type })
113
+ ] }, t.field)) }),
114
+ o > 0 && /* @__PURE__ */ l("p", { className: "mt-0.5 text-[11px] text-slate-400 dark:text-slate-500", children: [
90
115
  "and ",
91
- r,
116
+ o,
92
117
  " more"
93
118
  ] })
94
119
  ] }),
95
120
  /* @__PURE__ */ l("div", { children: [
96
121
  /* @__PURE__ */ a(x, { icon: /* @__PURE__ */ a(k, { className: "h-2.5 w-2.5" }), children: "Points to" }),
97
122
  /* @__PURE__ */ a(
98
- N,
123
+ g,
99
124
  {
100
- items: t.relations_out.map((e) => ({
101
- key: `${e.field}:${e.collection}`,
102
- label: f(e.collection),
103
- tip: `${e.field} → ${e.collection}`
125
+ items: e.relations_out.map((t) => ({
126
+ key: `${t.field}:${t.collection}`,
127
+ label: f(t.collection),
128
+ tip: `${t.field} → ${t.collection}`
104
129
  }))
105
130
  }
106
131
  )
107
132
  ] }),
108
133
  /* @__PURE__ */ l("div", { children: [
109
- /* @__PURE__ */ a(x, { icon: /* @__PURE__ */ a(g, { className: "h-2.5 w-2.5" }), children: "Used by" }),
134
+ /* @__PURE__ */ a(x, { icon: /* @__PURE__ */ a(w, { className: "h-2.5 w-2.5" }), children: "Used by" }),
110
135
  /* @__PURE__ */ a(
111
- N,
136
+ g,
112
137
  {
113
- items: t.relations_in.map((e) => ({
114
- key: `${e.collection}:${e.field}`,
115
- label: f(e.collection),
116
- tip: `${e.collection}.${e.field}`
138
+ items: e.relations_in.map((t) => ({
139
+ key: `${t.collection}:${t.field}`,
140
+ label: f(t.collection),
141
+ tip: `${t.collection}.${t.field}`
117
142
  }))
118
143
  }
119
144
  )
120
145
  ] }),
121
- (t.pipeline || t.forms > 0) && /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-slate-600 dark:text-slate-300", children: [
122
- t.pipeline && /* @__PURE__ */ l("span", { className: "inline-flex min-w-0 items-center gap-1", children: [
123
- /* @__PURE__ */ a(w, { className: "h-3 w-3 shrink-0 text-slate-400 dark:text-slate-500" }),
124
- /* @__PURE__ */ a("span", { className: "truncate", children: t.pipeline })
125
- ] }),
126
- t.forms > 0 && /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1", children: [
146
+ (e.pipeline || e.forms > 0) && /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-slate-600 dark:text-slate-300", children: [
147
+ e.pipeline && /* @__PURE__ */ l("span", { className: "inline-flex min-w-0 items-center gap-1", children: [
127
148
  /* @__PURE__ */ a(y, { className: "h-3 w-3 shrink-0 text-slate-400 dark:text-slate-500" }),
128
- t.forms,
149
+ /* @__PURE__ */ a("span", { className: "truncate", children: e.pipeline })
150
+ ] }),
151
+ e.forms > 0 && /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1", children: [
152
+ /* @__PURE__ */ a(v, { className: "h-3 w-3 shrink-0 text-slate-400 dark:text-slate-500" }),
153
+ e.forms,
129
154
  " form",
130
- t.forms === 1 ? "" : "s"
155
+ e.forms === 1 ? "" : "s"
131
156
  ] })
132
157
  ] }),
133
- /* @__PURE__ */ a("p", { className: "border-t border-slate-100 pt-2 text-[11px] text-slate-500 dark:border-white/[0.06] dark:text-slate-400", children: t.last_edit ? /* @__PURE__ */ l("span", { "data-tip": _(t.last_edit.at), children: [
158
+ /* @__PURE__ */ a("p", { className: "border-t border-slate-100 pt-2 text-[11px] text-slate-500 dark:border-white/[0.06] dark:text-slate-400", children: e.last_edit ? /* @__PURE__ */ l("span", { "data-tip": $(e.last_edit.at), children: [
134
159
  "Edited ",
135
- C(t.last_edit.at),
136
- t.last_edit.user ? ` by ${t.last_edit.user}` : ""
160
+ P(e.last_edit.at),
161
+ e.last_edit.user ? ` by ${e.last_edit.user}` : ""
137
162
  ] }) : "No edits in the last 90 days" })
138
163
  ] });
139
164
  }
140
- function Y({
165
+ function W({
141
166
  collection: s,
142
- title: t,
143
- open: n,
144
- onClose: i,
145
- onCardEnter: r,
146
- onCardLeave: e,
147
- children: m
167
+ title: e,
168
+ heavyList: n,
169
+ open: i,
170
+ onClose: o,
171
+ onCardEnter: t,
172
+ onCardLeave: m,
173
+ children: p
148
174
  }) {
149
- return /* @__PURE__ */ l(P, { open: n, onOpenChange: (o) => !o && i(), children: [
150
- /* @__PURE__ */ a($, { asChild: !0, children: m }),
151
- n && /* @__PURE__ */ l(
152
- L,
175
+ return /* @__PURE__ */ l(A, { open: i, onOpenChange: (r) => !r && o(), children: [
176
+ /* @__PURE__ */ a(S, { asChild: !0, children: p }),
177
+ i && /* @__PURE__ */ l(
178
+ E,
153
179
  {
154
180
  side: "right",
155
181
  align: "start",
156
182
  sideOffset: 12,
157
183
  collisionPadding: 12,
158
184
  avoidCollisions: !0,
159
- onOpenAutoFocus: (o) => o.preventDefault(),
160
- onCloseAutoFocus: (o) => o.preventDefault(),
161
- onPointerEnter: r,
162
- onPointerLeave: e,
163
- onClick: (o) => o.stopPropagation(),
164
- "aria-label": `${t} summary`,
185
+ onOpenAutoFocus: (r) => r.preventDefault(),
186
+ onCloseAutoFocus: (r) => r.preventDefault(),
187
+ onPointerEnter: t,
188
+ onPointerLeave: m,
189
+ onClick: (r) => r.stopPropagation(),
190
+ "aria-label": `${e} summary`,
165
191
  className: "w-[320px] p-3 motion-reduce:animate-none",
166
192
  children: [
167
- /* @__PURE__ */ a("p", { className: "mb-2 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: t }),
168
- /* @__PURE__ */ a(O, { collection: s })
193
+ /* @__PURE__ */ a("p", { className: "mb-2 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: e }),
194
+ n && n.fields.length > 0 && /* @__PURE__ */ a("div", { className: "mb-2.5", children: /* @__PURE__ */ a(j, { flag: n }) }),
195
+ /* @__PURE__ */ a(D, { collection: s })
169
196
  ]
170
197
  }
171
198
  )
172
199
  ] });
173
200
  }
174
201
  export {
175
- Y as CollectionHoverCard,
176
- I as useHoverIntent
202
+ W as CollectionHoverCard,
203
+ U as useHoverIntent
177
204
  };