@nivaro/react 0.3.110 → 0.3.112

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 +170 -2
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3097 -2972
  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/TipLayer.js +61 -54
  10. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  11. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  12. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  13. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  14. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  15. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  16. package/dist/shared/components/cbv/ColumnHeaderMenu.js +113 -0
  17. package/dist/shared/components/cbv/column-totals.js +66 -0
  18. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  19. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  20. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  21. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  22. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  23. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  24. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  25. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  26. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  27. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  28. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  29. package/dist/shared/components/item-edit/InlineTableField.js +3064 -2882
  30. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  31. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  32. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  33. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  34. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  35. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  36. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  37. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  38. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  39. package/dist/shared/components/item-edit/grid-search.js +345 -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/BlockedMove.js +73 -0
  48. package/dist/shared/components/panels/CommentPanel.js +265 -252
  49. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  50. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  51. package/dist/shared/components/panels/PipelinePanel.js +1573 -1475
  52. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  53. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  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,168 @@
1
+ import { jsxs as i, jsx as l } from "react/jsx-runtime";
2
+ import { useQuery as g } from "@tanstack/react-query";
3
+ import { CopyCheck as k, ExternalLink as N } from "lucide-react";
4
+ import { useMemo as v } from "react";
5
+ import { useNivaroClient as w, useDrilldown as O, useItemNavigation as C } from "../../context.js";
6
+ import { useDebounced as q } from "../../hooks/useDebounced.js";
7
+ import { get as x } from "../../lib/commands.js";
8
+ import { cn as j } from "../../lib/utils.js";
9
+ const D = 600, S = (c, n) => ((c == null ? void 0 : c.trim()) || n.replace(/_/g, " ")).toLowerCase();
10
+ function E(c, n) {
11
+ const e = {};
12
+ for (const a of c) {
13
+ const t = n[a];
14
+ typeof t == "string" && t.trim().length >= 2 && (e[a] = t.trim());
15
+ }
16
+ return Object.keys(e).length ? JSON.stringify(e) : "";
17
+ }
18
+ function K(c) {
19
+ const n = w(), { collection: e, enabled: a } = c, r = g({
20
+ queryKey: ["duplicate-check-config", e],
21
+ enabled: a && !!e,
22
+ staleTime: 5 * 6e4,
23
+ retry: !1,
24
+ queryFn: () => n.request(x(`/duplicates/${e}`)).then((o) => o.data).catch(() => null)
25
+ }).data, s = r != null && r.enabled ? r.fields : [], m = E(s, c.draft), d = q(m, D), u = g({
26
+ queryKey: ["duplicate-check", e, d],
27
+ enabled: a && !!e && !!d && s.length > 0,
28
+ staleTime: 3e4,
29
+ retry: !1,
30
+ queryFn: () => n.request(
31
+ x(`/duplicates/${e}/check`, { values: d })
32
+ ).then((o) => o.data).catch(() => null)
33
+ }).data;
34
+ return v(() => {
35
+ const o = {};
36
+ if (!a || !e || !u || !d) return o;
37
+ const y = m ? JSON.parse(m) : {}, b = JSON.parse(d);
38
+ for (const [f, h] of Object.entries(u.matches ?? {}))
39
+ !(h != null && h.length) || y[f] !== b[f] || (o[f] = {
40
+ collection: e,
41
+ noun: S(u.label, e),
42
+ matches: h,
43
+ blocks: u.block_exact === !0
44
+ });
45
+ return o;
46
+ }, [a, e, u, d, m]);
47
+ }
48
+ function U(c, n) {
49
+ if (c === n) return !0;
50
+ const e = Object.keys(c);
51
+ if (e.length !== Object.keys(n).length) return !1;
52
+ for (const a of e) {
53
+ const t = c[a], r = n[a];
54
+ if (!r || t.blocks !== r.blocks || t.matches.length !== r.matches.length) return !1;
55
+ for (let s = 0; s < t.matches.length; s++)
56
+ if (t.matches[s].id !== r.matches[s].id || t.matches[s].match !== r.matches[s].match)
57
+ return !1;
58
+ }
59
+ return !0;
60
+ }
61
+ function p({
62
+ collection: c,
63
+ match: n,
64
+ children: e,
65
+ className: a
66
+ }) {
67
+ const t = O(), r = C(), s = j(
68
+ "rounded-sm underline decoration-current/40 underline-offset-2 hover:decoration-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
69
+ a
70
+ );
71
+ return t ? /* @__PURE__ */ l(
72
+ "button",
73
+ {
74
+ type: "button",
75
+ className: s,
76
+ onClick: () => t.open({ collection: c, itemId: n.id, title: n.label }),
77
+ children: e
78
+ }
79
+ ) : /* @__PURE__ */ l(
80
+ "a",
81
+ {
82
+ href: r.urlFor({ collection: c, itemId: n.id }),
83
+ target: "_blank",
84
+ rel: "noopener noreferrer",
85
+ className: s,
86
+ children: e
87
+ }
88
+ );
89
+ }
90
+ function $({ field: c, hint: n }) {
91
+ const e = n.matches.filter((t) => t.match === "exact"), a = n.matches.filter((t) => t.match === "close");
92
+ return !e.length && !a.length ? null : /* @__PURE__ */ i("div", { "data-duplicate-notice": c, className: "space-y-0.5 text-[11.5px] leading-snug", children: [
93
+ e.length > 0 && /* @__PURE__ */ i(
94
+ "p",
95
+ {
96
+ "data-duplicate-kind": "exact",
97
+ className: "flex flex-wrap items-baseline gap-x-1 text-amber-700 dark:text-amber-400",
98
+ children: [
99
+ /* @__PURE__ */ l(k, { className: "h-3 w-3 shrink-0 translate-y-[1px]", "aria-hidden": !0 }),
100
+ /* @__PURE__ */ l("span", { children: "Already exists:" }),
101
+ e.slice(0, 3).map((t, r) => /* @__PURE__ */ i("span", { children: [
102
+ /* @__PURE__ */ l(p, { collection: n.collection, match: t, className: "font-medium", children: t.label }),
103
+ r < Math.min(e.length, 3) - 1 ? "," : ""
104
+ ] }, t.id)),
105
+ /* @__PURE__ */ i("span", { className: "text-amber-700/80 dark:text-amber-400/80", children: [
106
+ "(",
107
+ n.noun,
108
+ ")"
109
+ ] }),
110
+ /* @__PURE__ */ l("span", { "aria-hidden": !0, children: "—" }),
111
+ /* @__PURE__ */ i(
112
+ p,
113
+ {
114
+ collection: n.collection,
115
+ match: e[0],
116
+ className: "inline-flex items-center gap-0.5 font-medium",
117
+ children: [
118
+ "Open",
119
+ /* @__PURE__ */ l(N, { className: "h-2.5 w-2.5", "aria-hidden": !0 })
120
+ ]
121
+ }
122
+ ),
123
+ n.blocks && /* @__PURE__ */ l("span", { className: "basis-full pl-4 text-amber-700/90 dark:text-amber-400/90", children: "Saving a copy is not allowed here — open the existing one instead." })
124
+ ]
125
+ }
126
+ ),
127
+ a.length > 0 && /* @__PURE__ */ i(
128
+ "p",
129
+ {
130
+ "data-duplicate-kind": "close",
131
+ className: "flex flex-wrap items-baseline gap-x-1 text-slate-500 dark:text-muted-foreground",
132
+ children: [
133
+ e.length === 0 && /* @__PURE__ */ l(k, { className: "h-3 w-3 shrink-0 translate-y-[1px] opacity-70", "aria-hidden": !0 }),
134
+ /* @__PURE__ */ l("span", { className: e.length > 0 ? "pl-4" : void 0, children: "Similar:" }),
135
+ a.slice(0, 3).map((t, r) => /* @__PURE__ */ i("span", { children: [
136
+ /* @__PURE__ */ l(
137
+ p,
138
+ {
139
+ collection: n.collection,
140
+ match: t,
141
+ className: "text-slate-700 dark:text-foreground",
142
+ children: t.label
143
+ }
144
+ ),
145
+ r < Math.min(a.length, 3) - 1 ? "," : ""
146
+ ] }, t.id)),
147
+ a.length > 3 && /* @__PURE__ */ i("span", { children: [
148
+ "+",
149
+ a.length - 3,
150
+ " more"
151
+ ] }),
152
+ /* @__PURE__ */ i("span", { children: [
153
+ "(",
154
+ n.noun,
155
+ ") — check it is not the same one"
156
+ ] })
157
+ ]
158
+ }
159
+ )
160
+ ] });
161
+ }
162
+ export {
163
+ D as DUPLICATE_DEBOUNCE_MS,
164
+ $ as DuplicateNotice,
165
+ U as duplicateHintsEqual,
166
+ K as useDuplicateCheck,
167
+ E as watchedValues
168
+ };