@nivaro/react 0.3.139 → 0.3.141

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 (100) 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 +39 -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 +2702 -2671
  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 +3475 -3458
  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/RowPresence.js +83 -76
  23. package/dist/shared/components/SlaRulesView.js +73 -74
  24. package/dist/shared/components/UnseenDot.js +183 -22
  25. package/dist/shared/components/WidgetSlot.js +73 -73
  26. package/dist/shared/components/ai/AiChart.js +36 -32
  27. package/dist/shared/components/ai/AiMarkdown.js +136 -129
  28. package/dist/shared/components/ai/TaskDo.js +87 -87
  29. package/dist/shared/components/ai/answer-formats.js +37 -30
  30. package/dist/shared/components/ai/call-log/format.js +17 -16
  31. package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
  32. package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
  33. package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
  34. package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
  35. package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
  36. package/dist/shared/components/bulk/bulk-field-options.js +10 -10
  37. package/dist/shared/components/cbv/column-totals.js +53 -51
  38. package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
  40. package/dist/shared/components/command-center/announce.js +7 -6
  41. package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
  42. package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
  43. package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
  44. package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
  45. package/dist/shared/components/delivery-analytics/drill.js +32 -32
  46. package/dist/shared/components/imports/RunDetailSheet.js +1 -1
  47. package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
  48. package/dist/shared/components/integrations/console/EventsView.js +35 -35
  49. package/dist/shared/components/integrations/console/FirefightView.js +15 -14
  50. package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
  51. package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
  52. package/dist/shared/components/integrations/console/SignalCard.js +67 -67
  53. package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
  54. package/dist/shared/components/item-edit/ChangesTray.js +88 -74
  55. package/dist/shared/components/item-edit/FilePickerField.js +123 -123
  56. package/dist/shared/components/item-edit/GroupSection.js +301 -292
  57. package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
  58. package/dist/shared/components/item-edit/InlineGridField.js +45 -36
  59. package/dist/shared/components/item-edit/InlineTableField.js +1390 -1376
  60. package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
  61. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
  62. package/dist/shared/components/item-edit/RecordRecapChanges.js +116 -74
  63. package/dist/shared/components/item-edit/RecordRecapStrip.js +148 -160
  64. package/dist/shared/components/item-edit/summary-layout-request.js +15 -0
  65. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
  66. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  67. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +226 -157
  68. package/dist/shared/components/layout-editor/settings/WhoSection.js +53 -52
  69. package/dist/shared/components/layout-editor/settings/controls.js +98 -90
  70. package/dist/shared/components/layout-editor/settings/settings-registry.js +8 -0
  71. package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
  72. package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
  73. package/dist/shared/components/ops-report/format.js +37 -36
  74. package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
  75. package/dist/shared/components/panels/RevisionsPanel.js +306 -305
  76. package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
  77. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
  78. package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
  79. package/dist/shared/components/pipeline/TeamsView.js +189 -130
  80. package/dist/shared/components/profile/AgentsPanel.js +6 -6
  81. package/dist/shared/components/profile/DelegationCard.js +13 -12
  82. package/dist/shared/components/profile/PersonActivity.js +48 -48
  83. package/dist/shared/components/profile/PersonExtras.js +107 -107
  84. package/dist/shared/components/profile/PersonWeek.js +9 -9
  85. package/dist/shared/components/queue/QueueBulkBar.js +19 -18
  86. package/dist/shared/components/queue/QueueBulkMove.js +21 -20
  87. package/dist/shared/components/queue/QueueItemSheet.js +136 -131
  88. package/dist/shared/components/queue/QueueWorklist.js +884 -872
  89. package/dist/shared/components/queue/worklist-helpers.js +36 -21
  90. package/dist/shared/components/support/RequestList.js +123 -123
  91. package/dist/shared/components/support/SupportAnalytics.js +29 -29
  92. package/dist/shared/lib/activity-sentence.js +251 -229
  93. package/dist/shared/lib/format-value.js +5 -4
  94. package/dist/shared/lib/layout-resolve.js +64 -48
  95. package/dist/shared/lib/number-format.js +87 -0
  96. package/dist/shared/lib/number-kind.js +133 -0
  97. package/dist/shared/lib/utils.js +24 -20
  98. package/dist/shared/lib/watch-list.js +1 -1
  99. package/dist/shared/lib/widget-value-format.js +26 -12
  100. package/package.json +1 -1
@@ -4,11 +4,11 @@ import { Search as ae, AlertCircle as re, X as se, RotateCw as le, ChevronDown a
4
4
  import { useState as x, useEffect as T, useMemo as de, useRef as B } from "react";
5
5
  import { useNivaroClient as P } from "../../context.js";
6
6
  import { get as M, post as oe } from "../../lib/commands.js";
7
- import { cn as h, formatRelative as I, formatDateTime as R } from "../../lib/utils.js";
7
+ import { cn as h, formatRelative as I, formatDateTime as R, formatNumber as ie } from "../../lib/utils.js";
8
8
  import { UserAvatar as G } from "../UserAvatar.js";
9
- import { CallerChangesSection as ie } from "./CallerChanges.js";
10
- import { PartnerDependenciesPanel as ce } from "./PartnerDependencies.js";
11
- const ue = "••••••", pe = {
9
+ import { CallerChangesSection as ce } from "./CallerChanges.js";
10
+ import { PartnerDependenciesPanel as ue } from "./PartnerDependencies.js";
11
+ const pe = "••••••", me = {
12
12
  API_KEY_INVALID: "The key matches none on file. The caller holds a deleted or mistyped key.",
13
13
  API_KEY_REVOKED: "The key is switched off. Switch it back on under API Keys, or issue a new one.",
14
14
  API_KEY_EXPIRED: "The key passed its expiry date. Extend it or issue a new one.",
@@ -24,20 +24,20 @@ const ue = "••••••", pe = {
24
24
  FORBIDDEN: "The caller is signed in but lacks permission for what it asked.",
25
25
  RATE_LIMITED: "The caller went past the instance's rate limit.",
26
26
  UNAUTHORIZED: "The caller was not recognised."
27
- }, me = {
27
+ }, he = {
28
28
  session: "session",
29
29
  token: "token",
30
30
  api_key: "API key",
31
31
  masquerade: "masquerade",
32
32
  none: "anonymous"
33
- }, he = {
33
+ }, xe = {
34
34
  session: "bg-slate-100 text-slate-600 dark:bg-slate-700/50 dark:text-slate-300",
35
35
  token: "bg-violet-100 text-violet-800 dark:bg-violet-500/20 dark:text-violet-200",
36
36
  api_key: "bg-sky-100 text-sky-800 dark:bg-sky-500/20 dark:text-sky-200",
37
37
  masquerade: "bg-amber-100 text-amber-800 dark:bg-amber-500/20 dark:text-amber-200",
38
38
  none: "bg-red-100 text-red-800 dark:bg-red-500/20 dark:text-red-200"
39
39
  };
40
- function xe(l) {
40
+ function be(l) {
41
41
  return l >= 500 ? "text-red-700 dark:text-red-400" : l >= 400 ? "text-amber-700 dark:text-amber-400" : l >= 300 ? "text-slate-500" : "text-emerald-700 dark:text-emerald-400";
42
42
  }
43
43
  function X(l) {
@@ -46,11 +46,11 @@ function X(l) {
46
46
  return ((i = o[0]) == null ? void 0 : i.toUpperCase()) ?? "";
47
47
  }).join("") || "?";
48
48
  }
49
- function be(l) {
49
+ function ke(l) {
50
50
  const o = l ? new Date(l) : null;
51
51
  return o && !Number.isNaN(o.getTime()) ? o.toTimeString().slice(0, 8) : "a moment";
52
52
  }
53
- function ke(l) {
53
+ function ye(l) {
54
54
  if (!l) return "";
55
55
  try {
56
56
  return JSON.stringify(JSON.parse(l), null, 2);
@@ -70,8 +70,8 @@ function U(l) {
70
70
  }
71
71
  return l.replace(/\s+/g, " ").slice(0, 160);
72
72
  }
73
- const ye = ["GET", "POST", "PATCH", "PUT", "DELETE"], fe = ["2xx", "3xx", "4xx", "5xx"];
74
- function ge({
73
+ const fe = ["GET", "POST", "PATCH", "PUT", "DELETE"], ge = ["2xx", "3xx", "4xx", "5xx"];
74
+ function Ne({
75
75
  hours: l = 24,
76
76
  filters: o,
77
77
  onFiltersChange: i,
@@ -102,7 +102,7 @@ function ge({
102
102
  refetchInterval: b === !1 ? !1 : b,
103
103
  placeholderData: (t) => t
104
104
  }), D = (_ == null ? void 0 : _.data) ?? [], L = (_ == null ? void 0 : _.total) ?? 0, C = Math.max(1, Math.ceil(L / 50)), A = [];
105
- r.user && A.push({ key: "user", label: "one caller" }), r.api_key != null && A.push({ key: "api_key", label: `API key #${r.api_key}` }), r.inbound && A.push({ key: "inbound", label: "integrations only" }), r.errors && A.push({ key: "errors", label: "errors only" }), (r.from || r.to) && A.push({ key: "from", label: `around ${be(r.from ?? r.to)}` });
105
+ r.user && A.push({ key: "user", label: "one caller" }), r.api_key != null && A.push({ key: "api_key", label: `API key #${r.api_key}` }), r.inbound && A.push({ key: "inbound", label: "integrations only" }), r.errors && A.push({ key: "errors", label: "errors only" }), (r.from || r.to) && A.push({ key: "from", label: `around ${ke(r.from ?? r.to)}` });
106
106
  const j = B(!1), $ = (Y = D[0]) == null ? void 0 : Y.id;
107
107
  T(() => {
108
108
  !r.focus || j.current || $ == null || (j.current = !0, u($));
@@ -126,7 +126,7 @@ function ge({
126
126
  S,
127
127
  {
128
128
  value: r.method ?? "",
129
- options: [["", "Any method"], ...ye.map((t) => [t, t])],
129
+ options: [["", "Any method"], ...fe.map((t) => [t, t])],
130
130
  onChange: (t) => N({ ...r, method: t || void 0 })
131
131
  }
132
132
  ),
@@ -134,7 +134,7 @@ function ge({
134
134
  S,
135
135
  {
136
136
  value: r.status ?? "",
137
- options: [["", "Any status"], ...fe.map((t) => [t, t])],
137
+ options: [["", "Any status"], ...ge.map((t) => [t, t])],
138
138
  onChange: (t) => N({ ...r, status: t || void 0 })
139
139
  }
140
140
  ),
@@ -215,7 +215,7 @@ function ge({
215
215
  ] }) }),
216
216
  /* @__PURE__ */ e("tbody", { children: D.map((t) => {
217
217
  const O = w === t.id, H = t.api_key_name ?? t.user_name ?? t.user_email ?? (t.user ? `#${t.user.slice(0, 8)}` : "—");
218
- return /* @__PURE__ */ s(Ne, { children: [
218
+ return /* @__PURE__ */ s(ve, { children: [
219
219
  /* @__PURE__ */ s(
220
220
  "tr",
221
221
  {
@@ -250,9 +250,9 @@ function ge({
250
250
  {
251
251
  className: h(
252
252
  "shrink-0 rounded px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide",
253
- he[t.auth ?? "none"]
253
+ xe[t.auth ?? "none"]
254
254
  ),
255
- children: me[t.auth ?? "none"]
255
+ children: he[t.auth ?? "none"]
256
256
  }
257
257
  )
258
258
  ] }) }),
@@ -270,7 +270,7 @@ function ge({
270
270
  /* @__PURE__ */ e(
271
271
  "td",
272
272
  {
273
- className: h("px-2 py-1.5 text-right font-semibold", xe(t.status)),
273
+ className: h("px-2 py-1.5 text-right font-semibold", be(t.status)),
274
274
  children: t.status
275
275
  }
276
276
  ),
@@ -293,8 +293,8 @@ function ge({
293
293
  /* @__PURE__ */ e(E, { label: "User agent", value: t.user_agent ?? "—", mono: !0, wide: !0 }),
294
294
  t.query && /* @__PURE__ */ e(E, { label: "Query", value: `?${t.query}`, mono: !0, wide: !0 })
295
295
  ] }),
296
- t.error && /* @__PURE__ */ e("pre", { className: "mt-2 max-h-56 overflow-auto rounded-md border border-red-200 bg-white p-2 text-[11px] leading-snug text-red-800 dark:border-red-500/30 dark:bg-[#1a1416] dark:text-red-200", children: ke(t.error) }),
297
- t.request_body && /* @__PURE__ */ e(ve, { row: t })
296
+ t.error && /* @__PURE__ */ e("pre", { className: "mt-2 max-h-56 overflow-auto rounded-md border border-red-200 bg-white p-2 text-[11px] leading-snug text-red-800 dark:border-red-500/30 dark:bg-[#1a1416] dark:text-red-200", children: ye(t.error) }),
297
+ t.request_body && /* @__PURE__ */ e(we, { row: t })
298
298
  ] })
299
299
  ] })
300
300
  ] }, t.id);
@@ -346,7 +346,7 @@ function ge({
346
346
  }
347
347
  );
348
348
  }
349
- function Ne({ children: l }) {
349
+ function ve({ children: l }) {
350
350
  return /* @__PURE__ */ e(J, { children: l });
351
351
  }
352
352
  function E({
@@ -392,7 +392,7 @@ function S({
392
392
  p || "_any"
393
393
  )) });
394
394
  }
395
- function ve({ row: l }) {
395
+ function we({ row: l }) {
396
396
  const o = P(), [i, p] = x(!1), [n, c] = x(() => {
397
397
  try {
398
398
  return JSON.stringify(JSON.parse(l.request_body ?? ""), null, 2);
@@ -426,7 +426,7 @@ function ve({ row: l }) {
426
426
  body: q ?? (u == null ? void 0 : u.message) ?? "Replay failed"
427
427
  });
428
428
  }
429
- }), g = (l.request_body ?? "").endsWith("…"), w = r.includes(ue) || r.endsWith("…");
429
+ }), g = (l.request_body ?? "").endsWith("…"), w = r.includes(pe) || r.endsWith("…");
430
430
  return /* @__PURE__ */ s("div", { className: "mt-2", "data-request-replay": l.id, children: [
431
431
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
432
432
  /* @__PURE__ */ e("span", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Request body" }),
@@ -511,7 +511,7 @@ function ve({ row: l }) {
511
511
  )
512
512
  ] });
513
513
  }
514
- function De({ hours: l = 24 }) {
514
+ function Le({ hours: l = 24 }) {
515
515
  var v;
516
516
  const o = P(), [i, p] = x(l), [n, c] = x(null), { data: b, isLoading: k, dataUpdatedAt: m } = K({
517
517
  queryKey: ["api-inbound-callers", i],
@@ -666,7 +666,7 @@ ${U(a.last_error.error)}`,
666
666
  }
667
667
  ),
668
668
  /* @__PURE__ */ s("span", { className: "shrink-0 tabular-nums text-slate-400", children: [
669
- u.calls,
669
+ ie(u.calls),
670
670
  u.errors > 0 && /* @__PURE__ */ s("span", { className: "text-red-600 dark:text-red-400", children: [
671
671
  " · ",
672
672
  u.errors,
@@ -683,7 +683,7 @@ ${U(a.last_error.error)}`,
683
683
  );
684
684
  }) }),
685
685
  n && (n.kind === "api_key" ? n.api_key_id != null : !!n.user) && /* @__PURE__ */ e(
686
- ie,
686
+ ce,
687
687
  {
688
688
  caller: {
689
689
  key: n.kind === "api_key" ? `k${n.api_key_id}` : `u${String(n.user).toUpperCase()}`,
@@ -694,7 +694,7 @@ ${U(a.last_error.error)}`,
694
694
  n.key
695
695
  ),
696
696
  n && /* @__PURE__ */ e(
697
- ce,
697
+ ue,
698
698
  {
699
699
  callerKey: n.key,
700
700
  label: n.label
@@ -702,7 +702,7 @@ ${U(a.last_error.error)}`,
702
702
  `deps-${n.key}`
703
703
  ),
704
704
  /* @__PURE__ */ e(
705
- we,
705
+ _e,
706
706
  {
707
707
  hours: i,
708
708
  onPick: (a) => {
@@ -713,7 +713,7 @@ ${U(a.last_error.error)}`,
713
713
  }
714
714
  ),
715
715
  /* @__PURE__ */ e(
716
- ge,
716
+ Ne,
717
717
  {
718
718
  hours: i,
719
719
  filters: N,
@@ -724,7 +724,7 @@ ${U(a.last_error.error)}`,
724
724
  )
725
725
  ] });
726
726
  }
727
- function we({
727
+ function _e({
728
728
  hours: l,
729
729
  onPick: o
730
730
  }) {
@@ -772,7 +772,7 @@ function we({
772
772
  /* @__PURE__ */ e("th", { className: "px-3 py-1.5 text-right font-medium", children: "Last" })
773
773
  ] }) }),
774
774
  /* @__PURE__ */ e("tbody", { children: k.map((d) => {
775
- const y = pe[d.code] ?? d.message ?? "";
775
+ const y = me[d.code] ?? d.message ?? "";
776
776
  return /* @__PURE__ */ s(
777
777
  "tr",
778
778
  {
@@ -838,8 +838,8 @@ function we({
838
838
  );
839
839
  }
840
840
  export {
841
- ge as ApiRequestLog,
842
- we as AuthFailuresSection,
843
- De as InboundCallersView,
844
- ve as ReplayBlock
841
+ Ne as ApiRequestLog,
842
+ _e as AuthFailuresSection,
843
+ Le as InboundCallersView,
844
+ we as ReplayBlock
845
845
  };