@nivaro/react 0.3.138 → 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 (88) hide show
  1. package/dist/components/InlineGridField.js +95 -92
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +36 -2
  5. package/dist/shared/components/AudienceConfirmPanel.js +19 -19
  6. package/dist/shared/components/BroadcastView.js +213 -211
  7. package/dist/shared/components/CollectionBrowserView.js +2677 -2658
  8. package/dist/shared/components/ConfigHistory.js +45 -45
  9. package/dist/shared/components/ConformanceView.js +110 -110
  10. package/dist/shared/components/DataTable.js +51 -51
  11. package/dist/shared/components/FilePreviewLightbox.js +26 -25
  12. package/dist/shared/components/ItemEditForm.js +3038 -3027
  13. package/dist/shared/components/LiveCount.js +27 -23
  14. package/dist/shared/components/LiveTraceView.js +62 -61
  15. package/dist/shared/components/PageRenderer.js +422 -410
  16. package/dist/shared/components/ProfileView.js +199 -199
  17. package/dist/shared/components/QualityRulesView.js +70 -70
  18. package/dist/shared/components/QueryTable.js +131 -130
  19. package/dist/shared/components/RecordGraph.js +98 -98
  20. package/dist/shared/components/RecordReadView.js +287 -288
  21. package/dist/shared/components/ReportView.js +1279 -1259
  22. package/dist/shared/components/SlaRulesView.js +73 -74
  23. package/dist/shared/components/WidgetSlot.js +73 -73
  24. package/dist/shared/components/ai/AiChart.js +36 -32
  25. package/dist/shared/components/ai/AiMarkdown.js +136 -129
  26. package/dist/shared/components/ai/TaskDo.js +87 -87
  27. package/dist/shared/components/ai/answer-formats.js +37 -30
  28. package/dist/shared/components/ai/call-log/format.js +17 -16
  29. package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
  30. package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
  32. package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
  33. package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
  34. package/dist/shared/components/bulk/bulk-field-options.js +10 -10
  35. package/dist/shared/components/cbv/column-totals.js +53 -51
  36. package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
  37. package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
  38. package/dist/shared/components/command-center/announce.js +7 -6
  39. package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
  40. package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
  41. package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
  42. package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
  43. package/dist/shared/components/imports/RunDetailSheet.js +1 -1
  44. package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
  45. package/dist/shared/components/integrations/console/EventsView.js +35 -35
  46. package/dist/shared/components/integrations/console/FirefightView.js +15 -14
  47. package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
  48. package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
  49. package/dist/shared/components/integrations/console/SignalCard.js +67 -67
  50. package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
  51. package/dist/shared/components/item-edit/ChangesTray.js +88 -74
  52. package/dist/shared/components/item-edit/FilePickerField.js +123 -123
  53. package/dist/shared/components/item-edit/GroupSection.js +301 -292
  54. package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
  55. package/dist/shared/components/item-edit/InlineGridField.js +45 -36
  56. package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
  57. package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
  58. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
  59. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
  60. package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
  61. package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
  62. package/dist/shared/components/ops-report/format.js +37 -36
  63. package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
  64. package/dist/shared/components/panels/RevisionsPanel.js +306 -305
  65. package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
  66. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
  67. package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
  68. package/dist/shared/components/pipeline/TeamsView.js +189 -130
  69. package/dist/shared/components/profile/AgentsPanel.js +6 -6
  70. package/dist/shared/components/profile/DelegationCard.js +13 -12
  71. package/dist/shared/components/profile/PersonActivity.js +48 -48
  72. package/dist/shared/components/profile/PersonExtras.js +107 -107
  73. package/dist/shared/components/profile/PersonWeek.js +9 -9
  74. package/dist/shared/components/queue/QueueBulkBar.js +19 -18
  75. package/dist/shared/components/queue/QueueBulkMove.js +21 -20
  76. package/dist/shared/components/queue/QueueItemSheet.js +136 -131
  77. package/dist/shared/components/queue/QueueWorklist.js +671 -670
  78. package/dist/shared/components/queue/worklist-helpers.js +36 -21
  79. package/dist/shared/components/support/RequestList.js +121 -121
  80. package/dist/shared/components/support/SupportAnalytics.js +29 -29
  81. package/dist/shared/lib/activity-sentence.js +316 -278
  82. package/dist/shared/lib/format-value.js +5 -4
  83. package/dist/shared/lib/number-format.js +87 -0
  84. package/dist/shared/lib/number-kind.js +133 -0
  85. package/dist/shared/lib/utils.js +24 -20
  86. package/dist/shared/lib/watch-list.js +1 -1
  87. package/dist/shared/lib/widget-value-format.js +26 -12
  88. package/package.json +1 -1
@@ -1,20 +1,22 @@
1
- import { jsxs as i, jsx as t, Fragment as m } from "react/jsx-runtime";
2
- import { useQuery as k } from "@tanstack/react-query";
3
- import { ListChecks as x, ChevronDown as w, RotateCcw as p } from "lucide-react";
4
- import { useState as v } from "react";
5
- import { useOptionalNivaroClient as y } from "../../context.js";
6
- import { get as N } from "../../lib/commands.js";
7
- import { cn as u, choiceLabel as C } from "../../lib/utils.js";
8
- import { Popover as _, PopoverTrigger as $, PopoverContent as S } from "../ui/popover.js";
9
- import { RelationCell as f } from "./GroupSection.js";
10
- const L = {
1
+ import { jsxs as o, jsx as t, Fragment as m } from "react/jsx-runtime";
2
+ import { useQuery as y } from "@tanstack/react-query";
3
+ import { ListChecks as k, ChevronDown as v, RotateCcw as p } from "lucide-react";
4
+ import { useState as C } from "react";
5
+ import { useOptionalNivaroClient as N } from "../../context.js";
6
+ import { get as w } from "../../lib/commands.js";
7
+ import { formatFieldNumber as _ } from "../../lib/number-format.js";
8
+ import { cn as f, choiceLabel as $ } from "../../lib/utils.js";
9
+ import { Popover as S, PopoverTrigger as O, PopoverContent as L } from "../ui/popover.js";
10
+ import { RelationCell as u } from "./GroupSection.js";
11
+ import { numberKindOf as R } from "../../lib/number-kind.js";
12
+ const j = {
11
13
  field: "Changed",
12
14
  row: "New line",
13
15
  edit: "Line edited",
14
16
  delete: "Line removed",
15
17
  link: "Linked",
16
18
  unlink: "Unlinked"
17
- }, O = {
19
+ }, T = {
18
20
  field: "bg-amber-400",
19
21
  row: "bg-emerald-500",
20
22
  edit: "bg-amber-400",
@@ -29,16 +31,16 @@ const L = {
29
31
  const n = e.id;
30
32
  if (n != null) return `#${String(n)}`;
31
33
  try {
32
- const a = JSON.stringify(e);
33
- return a.length > 40 ? `${a.slice(0, 40)}…` : a;
34
+ const i = JSON.stringify(e);
35
+ return i.length > 40 ? `${i.slice(0, 40)}…` : i;
34
36
  } catch {
35
37
  return String(e);
36
38
  }
37
39
  }
38
- const o = String(e).replace(/<[^>]+>/g, "").trim();
39
- return o.length > 48 ? `${o.slice(0, 48)}…` : o;
40
+ const s = String(e).replace(/<[^>]+>/g, "").trim();
41
+ return s.length > 48 ? `${s.slice(0, 48)}…` : s;
40
42
  };
41
- function R(e) {
43
+ function q(e) {
42
44
  if (!(e != null && e.options)) return {};
43
45
  if (typeof e.options == "object") return e.options;
44
46
  try {
@@ -47,102 +49,107 @@ function R(e) {
47
49
  return {};
48
50
  }
49
51
  }
50
- function T({ target: e }) {
51
- const o = y(), n = e.collection === "nivaro_files" || e.collection === "directus_files", { data: a } = k({
52
+ function A({ target: e }) {
53
+ const s = N(), n = e.collection === "nivaro_files" || e.collection === "directus_files", { data: i } = y({
52
54
  queryKey: ["nvr-tray-file", String(e.id)],
53
- queryFn: () => o.request(
54
- N(`/files/${e.id}/meta`)
55
+ queryFn: () => s.request(
56
+ w(`/files/${e.id}/meta`)
55
57
  ).then((c) => c.data).catch(() => null),
56
- enabled: !!o && n && e.id != null,
58
+ enabled: !!s && n && e.id != null,
57
59
  staleTime: 3e5,
58
60
  retry: !1
59
61
  });
60
- return n ? /* @__PURE__ */ t(m, { children: (a == null ? void 0 : a.title) || (a == null ? void 0 : a.filename_download) || `#${String(e.id)}` }) : e.collection === "nivaro_users" || e.collection === "directus_users" ? /* @__PURE__ */ t(f, { relCollection: "nivaro_users", id: e.id, className: "" }) : /* @__PURE__ */ t(f, { relCollection: e.collection, id: e.id, className: "" });
62
+ return n ? /* @__PURE__ */ t(m, { children: (i == null ? void 0 : i.title) || (i == null ? void 0 : i.filename_download) || `#${String(e.id)}` }) : e.collection === "nivaro_users" || e.collection === "directus_users" ? /* @__PURE__ */ t(u, { relCollection: "nivaro_users", id: e.id, className: "" }) : /* @__PURE__ */ t(u, { relCollection: e.collection, id: e.id, className: "" });
61
63
  }
62
64
  function b({
63
65
  collection: e,
64
- field: o,
66
+ field: s,
65
67
  value: n
66
68
  }) {
67
- const a = y(), { data: c } = k({
69
+ const i = N(), { data: c } = y({
68
70
  queryKey: ["nvr-tray-collection", e],
69
- queryFn: () => a.request(N(`/collections/${e}`)).then((s) => {
71
+ queryFn: () => i.request(w(`/collections/${e}`)).then((d) => {
70
72
  var r, l;
71
- return { fields: ((r = s.data) == null ? void 0 : r.fields) ?? [], relations: ((l = s.data) == null ? void 0 : l.relations) ?? [] };
73
+ return { fields: ((r = d.data) == null ? void 0 : r.fields) ?? [], relations: ((l = d.data) == null ? void 0 : l.relations) ?? [] };
72
74
  }),
73
- enabled: !!a && !!e && !!o,
75
+ enabled: !!i && !!e && !!s,
74
76
  staleTime: 3e5
75
77
  });
76
78
  if (n == null || n === "") return /* @__PURE__ */ t(m, { children: g(n) });
77
- if (c && o) {
78
- const s = c.relations.find(
79
- (d) => d.many_collection === e && d.many_field === o && !d.junction_field
79
+ if (c && s) {
80
+ const d = c.relations.find(
81
+ (a) => a.many_collection === e && a.many_field === s && !a.junction_field
80
82
  );
81
- if (s != null && s.one_collection) {
82
- const d = typeof n == "object" && !Array.isArray(n) ? n.id : n;
83
- if (d != null && d !== "")
84
- return /* @__PURE__ */ t(f, { relCollection: s.one_collection, id: d, className: "" });
83
+ if (d != null && d.one_collection) {
84
+ const a = typeof n == "object" && !Array.isArray(n) ? n.id : n;
85
+ if (a != null && a !== "")
86
+ return /* @__PURE__ */ t(u, { relCollection: d.one_collection, id: a, className: "" });
85
87
  }
86
- const r = c.fields.find((d) => d.field === o), l = R(r).choices;
88
+ const r = c.fields.find((a) => a.field === s), l = q(r).choices;
87
89
  if (Array.isArray(l)) {
88
- const d = l.find(
90
+ const a = l.find(
89
91
  (h) => typeof h == "string" ? h === String(n) : String(h.value) === String(n)
90
92
  );
91
- if (d)
92
- return /* @__PURE__ */ t(m, { children: C(typeof d == "string" ? d : d.text ?? String(n)) });
93
+ if (a)
94
+ return /* @__PURE__ */ t(m, { children: $(typeof a == "string" ? a : a.text ?? String(n)) });
95
+ }
96
+ const x = r ? R(r) : null;
97
+ if (r && x && x !== "plain" && typeof n != "object") {
98
+ const a = _(n, r);
99
+ if (a) return /* @__PURE__ */ t(m, { children: a });
93
100
  }
94
101
  }
95
102
  return /* @__PURE__ */ t(m, { children: g(n) });
96
103
  }
97
- function V({
104
+ function Y({
98
105
  items: e,
99
- onRevertAll: o,
106
+ onRevertAll: s,
100
107
  saving: n
101
108
  }) {
102
- const [a, c] = v(!1);
109
+ const [i, c] = C(!1);
103
110
  if (e.length === 0) return null;
104
- const s = e.length;
105
- return /* @__PURE__ */ i(_, { open: a, onOpenChange: c, children: [
106
- /* @__PURE__ */ t($, { asChild: !0, children: /* @__PURE__ */ i(
111
+ const d = e.length;
112
+ return /* @__PURE__ */ o(S, { open: i, onOpenChange: c, children: [
113
+ /* @__PURE__ */ t(O, { asChild: !0, children: /* @__PURE__ */ o(
107
114
  "button",
108
115
  {
109
116
  type: "button",
110
117
  "data-changes-tray": !0,
111
- "aria-label": `${s} unsaved change${s === 1 ? "" : "s"} — review`,
118
+ "aria-label": `${d} unsaved change${d === 1 ? "" : "s"} — review`,
112
119
  className: "inline-flex h-9 shrink-0 items-center gap-1.5 self-center rounded-md border border-amber-300 bg-amber-50 px-3 text-[12px] font-medium leading-none text-amber-900 transition-colors hover:bg-amber-100 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100 dark:hover:bg-amber-500/20",
113
120
  children: [
114
- /* @__PURE__ */ t(x, { className: "h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-300" }),
115
- /* @__PURE__ */ i("span", { className: "tabular-nums", children: [
116
- s,
121
+ /* @__PURE__ */ t(k, { className: "h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-300" }),
122
+ /* @__PURE__ */ o("span", { className: "tabular-nums", children: [
123
+ d,
117
124
  " change",
118
- s === 1 ? "" : "s"
125
+ d === 1 ? "" : "s"
119
126
  ] }),
120
127
  /* @__PURE__ */ t(
121
- w,
128
+ v,
122
129
  {
123
- className: u(
130
+ className: f(
124
131
  "h-3 w-3 shrink-0 text-amber-500 transition-transform",
125
- a && "rotate-180"
132
+ i && "rotate-180"
126
133
  )
127
134
  }
128
135
  )
129
136
  ]
130
137
  }
131
138
  ) }),
132
- /* @__PURE__ */ i(S, { align: "end", sideOffset: 6, className: "w-[440px] max-w-[92vw] p-0", children: [
133
- /* @__PURE__ */ i("div", { className: "flex items-center gap-2 border-b border-slate-200 px-3 py-2 dark:border-border", children: [
134
- /* @__PURE__ */ t(x, { className: "h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400" }),
135
- /* @__PURE__ */ i("span", { className: "min-w-0 flex-1 text-[12px] font-semibold text-slate-800 dark:text-slate-100", children: [
136
- s,
139
+ /* @__PURE__ */ o(L, { align: "end", sideOffset: 6, className: "w-[440px] max-w-[92vw] p-0", children: [
140
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-2 border-b border-slate-200 px-3 py-2 dark:border-border", children: [
141
+ /* @__PURE__ */ t(k, { className: "h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400" }),
142
+ /* @__PURE__ */ o("span", { className: "min-w-0 flex-1 text-[12px] font-semibold text-slate-800 dark:text-slate-100", children: [
143
+ d,
137
144
  " unsaved change",
138
- s === 1 ? "" : "s",
145
+ d === 1 ? "" : "s",
139
146
  /* @__PURE__ */ t("span", { className: "ml-1.5 font-normal text-slate-500 dark:text-slate-400", children: n ? "saving…" : "not saved yet" })
140
147
  ] }),
141
- o && /* @__PURE__ */ i(
148
+ s && /* @__PURE__ */ o(
142
149
  "button",
143
150
  {
144
151
  type: "button",
145
- onClick: o,
152
+ onClick: s,
146
153
  disabled: n,
147
154
  className: "inline-flex h-6 shrink-0 items-center gap-1 rounded-md border border-amber-300 px-2 text-[11px] font-medium text-amber-800 hover:bg-amber-50 disabled:opacity-40 dark:border-amber-500/40 dark:text-amber-200 dark:hover:bg-amber-500/15",
148
155
  children: [
@@ -152,13 +159,13 @@ function V({
152
159
  }
153
160
  )
154
161
  ] }),
155
- /* @__PURE__ */ t("ul", { className: "max-h-[320px] divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: e.map((r) => /* @__PURE__ */ i(
162
+ /* @__PURE__ */ t("ul", { className: "max-h-[320px] divide-y divide-slate-100 overflow-y-auto dark:divide-border", children: e.map((r) => /* @__PURE__ */ o(
156
163
  "li",
157
164
  {
158
165
  className: "flex flex-wrap items-center gap-2 px-3 py-1.5 text-[11.5px] text-slate-800 dark:text-slate-100",
159
166
  children: [
160
- /* @__PURE__ */ t("span", { className: u("h-1.5 w-1.5 shrink-0 rounded-full", O[r.kind]) }),
161
- /* @__PURE__ */ i(
167
+ /* @__PURE__ */ t("span", { className: f("h-1.5 w-1.5 shrink-0 rounded-full", T[r.kind]) }),
168
+ /* @__PURE__ */ o(
162
169
  "button",
163
170
  {
164
171
  type: "button",
@@ -167,21 +174,28 @@ function V({
167
174
  (l = r.onJump) == null || l.call(r), r.onJump && c(!1);
168
175
  },
169
176
  disabled: !r.onJump,
170
- className: u(
177
+ className: f(
171
178
  "min-w-0 flex-1 text-left",
172
179
  r.onJump && "hover:underline decoration-dotted underline-offset-2"
173
180
  ),
174
181
  children: [
175
182
  /* @__PURE__ */ t("span", { className: "font-medium", children: r.label }),
176
- r.location && /* @__PURE__ */ i("span", { className: "ml-1 text-slate-500 dark:text-slate-400", children: [
183
+ r.location && /* @__PURE__ */ o("span", { className: "ml-1 text-slate-500 dark:text-slate-400", children: [
177
184
  "· ",
178
185
  r.location
179
186
  ] }),
180
- /* @__PURE__ */ t("span", { className: "ml-2 block truncate text-slate-600 dark:text-slate-300", children: r.linkTarget ? /* @__PURE__ */ i(m, { children: [
187
+ /* @__PURE__ */ t("span", { className: "ml-2 block truncate text-slate-600 dark:text-slate-300", children: r.linkTarget ? /* @__PURE__ */ o(m, { children: [
181
188
  "+ ",
182
- /* @__PURE__ */ t(T, { target: r.linkTarget })
183
- ] }) : r.detail ?? /* @__PURE__ */ i(m, { children: [
184
- /* @__PURE__ */ t("span", { className: "line-through opacity-60", children: /* @__PURE__ */ t(b, { collection: r.collection, field: r.field, value: r.from }) }),
189
+ /* @__PURE__ */ t(A, { target: r.linkTarget })
190
+ ] }) : r.detail ?? /* @__PURE__ */ o(m, { children: [
191
+ /* @__PURE__ */ t("span", { className: "line-through opacity-60", children: /* @__PURE__ */ t(
192
+ b,
193
+ {
194
+ collection: r.collection,
195
+ field: r.field,
196
+ value: r.from
197
+ }
198
+ ) }),
185
199
  " ",
186
200
  "→",
187
201
  " ",
@@ -190,7 +204,7 @@ function V({
190
204
  ]
191
205
  }
192
206
  ),
193
- /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-slate-100 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-slate-600 dark:bg-slate-700/60 dark:text-slate-300", children: L[r.kind] }),
207
+ /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-slate-100 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-slate-600 dark:bg-slate-700/60 dark:text-slate-300", children: j[r.kind] }),
194
208
  /* @__PURE__ */ t(
195
209
  "button",
196
210
  {
@@ -203,15 +217,15 @@ function V({
203
217
  children: /* @__PURE__ */ t(p, { className: "h-3 w-3" })
204
218
  }
205
219
  ),
206
- r.cells && r.cells.length > 0 && /* @__PURE__ */ t("ul", { className: "ml-3.5 w-full space-y-0.5 border-l border-slate-200 pl-2 dark:border-border", children: r.cells.map((l) => /* @__PURE__ */ i(
220
+ r.cells && r.cells.length > 0 && /* @__PURE__ */ t("ul", { className: "ml-3.5 w-full space-y-0.5 border-l border-slate-200 pl-2 dark:border-border", children: r.cells.map((l) => /* @__PURE__ */ o(
207
221
  "li",
208
222
  {
209
223
  "data-change-cell": l.field,
210
224
  className: "flex items-center gap-2 text-[11px] text-slate-700 dark:text-slate-200",
211
225
  children: [
212
- /* @__PURE__ */ i("span", { className: "min-w-0 flex-1 truncate", children: [
226
+ /* @__PURE__ */ o("span", { className: "min-w-0 flex-1 truncate", children: [
213
227
  /* @__PURE__ */ t("span", { className: "font-medium", children: l.label }),
214
- /* @__PURE__ */ i("span", { className: "ml-2 text-slate-600 dark:text-slate-300", children: [
228
+ /* @__PURE__ */ o("span", { className: "ml-2 text-slate-600 dark:text-slate-300", children: [
215
229
  /* @__PURE__ */ t("span", { className: "line-through opacity-60", children: /* @__PURE__ */ t(
216
230
  b,
217
231
  {
@@ -250,5 +264,5 @@ function V({
250
264
  ] });
251
265
  }
252
266
  export {
253
- V as ChangesTray
267
+ Y as ChangesTray
254
268
  };