@nivaro/react 0.3.45 → 0.3.47

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 (90) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +290 -23
  4. package/dist/index.js +679 -659
  5. package/dist/shared/components/BaseMap.js +149 -103
  6. package/dist/shared/components/CollectionBrowserView.js +813 -826
  7. package/dist/shared/components/ErrorNotice.js +169 -0
  8. package/dist/shared/components/ErrorSurface.js +23 -17
  9. package/dist/shared/components/ListLoadError.js +8 -29
  10. package/dist/shared/components/LoadErrorNote.js +38 -21
  11. package/dist/shared/components/QueryErrorState.js +8 -11
  12. package/dist/shared/components/ReportView.js +1320 -1291
  13. package/dist/shared/components/chat/ChannelArchive.js +60 -60
  14. package/dist/shared/components/chat/ChannelExtras.js +74 -74
  15. package/dist/shared/components/chat/ChatPanel.js +368 -367
  16. package/dist/shared/components/command-center/CommandCenterView.js +313 -69
  17. package/dist/shared/components/command-center/Customize.js +353 -0
  18. package/dist/shared/components/command-center/Header.js +279 -53
  19. package/dist/shared/components/command-center/KioskLinks.js +198 -0
  20. package/dist/shared/components/command-center/PeekPanel.js +144 -3
  21. package/dist/shared/components/command-center/announce.js +13 -0
  22. package/dist/shared/components/command-center/board-prefs.js +99 -0
  23. package/dist/shared/components/command-center/freshness.js +29 -0
  24. package/dist/shared/components/command-center/layout.js +56 -0
  25. package/dist/shared/components/command-center/panels/AttentionPanel.js +132 -3
  26. package/dist/shared/components/command-center/panels/Banner.js +75 -0
  27. package/dist/shared/components/command-center/panels/BoardSettings.js +224 -0
  28. package/dist/shared/components/command-center/panels/FeedPanel.js +145 -29
  29. package/dist/shared/components/command-center/panels/FlowPanel.js +154 -56
  30. package/dist/shared/components/command-center/panels/ForecastPanel.js +244 -3
  31. package/dist/shared/components/command-center/panels/MapLegend.js +266 -0
  32. package/dist/shared/components/command-center/panels/MapPanel.js +216 -66
  33. package/dist/shared/components/command-center/panels/PartnersPanel.js +49 -3
  34. package/dist/shared/components/command-center/panels/PeoplePanel.js +258 -40
  35. package/dist/shared/components/command-center/panels/RegionPicker.js +88 -3
  36. package/dist/shared/components/command-center/panels/SystemPanel.js +158 -38
  37. package/dist/shared/components/command-center/panels/ThroughputPanel.js +307 -3
  38. package/dist/shared/components/command-center/panels/TimeBar.js +227 -6
  39. package/dist/shared/components/command-center/panels/TrafficPanel.js +12 -8
  40. package/dist/shared/components/command-center/panels/WorkloadPanel.js +82 -3
  41. package/dist/shared/components/command-center/panels/attention-actions.js +267 -0
  42. package/dist/shared/components/command-center/panels/map-shared.js +95 -0
  43. package/dist/shared/components/command-center/panels/registry.js +87 -19
  44. package/dist/shared/components/command-center/shell-hooks.js +118 -0
  45. package/dist/shared/components/command-center/shortcuts.js +37 -0
  46. package/dist/shared/components/command-center/theme.js +39 -21
  47. package/dist/shared/components/command-center/time.js +52 -0
  48. package/dist/shared/components/command-center/url-state.js +54 -0
  49. package/dist/shared/components/command-center/work-links.js +32 -0
  50. package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
  51. package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
  52. package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
  53. package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
  54. package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
  55. package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
  56. package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
  57. package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
  58. package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
  59. package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
  60. package/dist/shared/components/import/ImportFromFileButton.js +61 -60
  61. package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
  62. package/dist/shared/components/imports/NewImportDialog.js +29 -28
  63. package/dist/shared/components/imports/RunDetailSheet.js +63 -63
  64. package/dist/shared/components/item-edit/FieldRow.js +329 -329
  65. package/dist/shared/components/item-edit/InlineTableField.js +898 -898
  66. package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
  67. package/dist/shared/components/item-edit/PlanGrid.js +220 -221
  68. package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
  69. package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
  70. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
  71. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
  72. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
  73. package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
  74. package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
  75. package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
  76. package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
  77. package/dist/shared/components/monitoring/TrafficMiniMap.js +111 -70
  78. package/dist/shared/components/panels/SlaClock.js +35 -36
  79. package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
  80. package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
  81. package/dist/shared/components/profile/AgentsPanel.js +73 -72
  82. package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
  83. package/dist/shared/components/support/SupportRequestDialog.js +85 -81
  84. package/dist/shared/components/support/SupportView.js +94 -87
  85. package/dist/shared/lib/autofill-poll.js +21 -18
  86. package/dist/shared/lib/error-actions.js +85 -0
  87. package/dist/shared/lib/error-message.js +223 -82
  88. package/dist/shared/lib/error-toast.js +71 -13
  89. package/dist/shared/lib/safe-error.js +136 -38
  90. package/package.json +1 -1
@@ -1,45 +1,44 @@
1
1
  import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
- import { useQuery as F, useQueryClient as L, useMutation as j } from "@tanstack/react-query";
3
- import { Clock3 as T } from "lucide-react";
2
+ import { useQuery as F, useQueryClient as E, useMutation as j } from "@tanstack/react-query";
3
+ import { Clock3 as L } from "lucide-react";
4
4
  import { useState as h } from "react";
5
5
  import { useNivaroClient as P } from "../../context.js";
6
- import { get as E, post as H, del as K } from "../../lib/commands.js";
7
- import { humanHours as l, formatRelative as Q } from "../../lib/utils.js";
8
- import { invalidateRecordNotes as B } from "../item-edit/RecordInsights.js";
9
- import { Popover as O, PopoverTrigger as z, PopoverContent as M } from "../ui/popover.js";
10
- function S(r) {
11
- var e;
12
- const t = r;
13
- return ((e = t == null ? void 0 : t.response) == null ? void 0 : e.error) ?? (t == null ? void 0 : t.message) ?? null;
6
+ import { get as T, post as H, del as K } from "../../lib/commands.js";
7
+ import { userErrorMessage as Q } from "../../lib/safe-error.js";
8
+ import { humanHours as l, formatRelative as B } from "../../lib/utils.js";
9
+ import { invalidateRecordNotes as M } from "../item-edit/RecordInsights.js";
10
+ import { Popover as O, PopoverTrigger as z, PopoverContent as U } from "../ui/popover.js";
11
+ function S(t) {
12
+ return t ? Q(t, "Could not load the deadline") : null;
14
13
  }
15
- function q(r, t) {
16
- return ["sla-breach", r, t];
14
+ function q(t, r) {
15
+ return ["sla-breach", t, r];
17
16
  }
18
- function U(r, t) {
17
+ function W(t, r) {
19
18
  const e = P();
20
19
  return F({
21
- queryKey: q(r, String(t ?? "")),
22
- queryFn: () => e.request(E(`/sla/status/${r}/${t}`)).then((o) => o).catch(() => null),
23
- enabled: !!t,
20
+ queryKey: q(t, String(r ?? "")),
21
+ queryFn: () => e.request(T(`/sla/status/${t}/${r}`)).then((o) => o).catch(() => null),
22
+ enabled: !!r,
24
23
  staleTime: 6e4
25
24
  });
26
25
  }
27
- function W(r) {
28
- const t = r.set_by_name ? ` by ${r.set_by_name}` : "";
29
- return `Clock adjusted to ${l(r.duration_hours)} (rule: ${l(r.rule_duration_hours)})${t}, ${Q(r.set_at)}`;
26
+ function D(t) {
27
+ const r = t.set_by_name ? ` by ${t.set_by_name}` : "";
28
+ return `Clock adjusted to ${l(t.duration_hours)} (rule: ${l(t.rule_duration_hours)})${r}, ${B(t.set_at)}`;
30
29
  }
31
- function D({
32
- collection: r,
33
- itemId: t,
30
+ function G({
31
+ collection: t,
32
+ itemId: r,
34
33
  data: e,
35
34
  tone: o = "neutral"
36
35
  }) {
37
36
  var w;
38
- const m = P(), u = L(), [A, x] = h(!1), [b, y] = h(""), [i, f] = h(""), [N, c] = h(null), k = ((w = e.sla_rule) == null ? void 0 : w.duration_hours) ?? null, _ = e.elapsed_hours ?? 0, $ = () => {
39
- u.invalidateQueries({ queryKey: q(r, t) }), B(u, r, t);
37
+ const m = P(), u = E(), [A, x] = h(!1), [b, y] = h(""), [i, f] = h(""), [N, c] = h(null), k = ((w = e.sla_rule) == null ? void 0 : w.duration_hours) ?? null, _ = e.elapsed_hours ?? 0, $ = () => {
38
+ u.invalidateQueries({ queryKey: q(t, r) }), M(u, t, r);
40
39
  }, g = j({
41
40
  mutationFn: () => m.request(
42
- H(`/sla/override/${r}/${t}`, {
41
+ H(`/sla/override/${t}/${r}`, {
43
42
  duration_hours: Number(b),
44
43
  reason: i.trim()
45
44
  })
@@ -51,7 +50,7 @@ function D({
51
50
  }), v = j({
52
51
  mutationFn: () => m.request(
53
52
  K(
54
- `/sla/override/${r}/${t}${i.trim() ? `?reason=${encodeURIComponent(i.trim())}` : ""}`
53
+ `/sla/override/${t}/${r}${i.trim() ? `?reason=${encodeURIComponent(i.trim())}` : ""}`
55
54
  )
56
55
  ),
57
56
  onSuccess: () => {
@@ -77,7 +76,7 @@ function D({
77
76
  children: "Adjust clock"
78
77
  }
79
78
  ) }),
80
- /* @__PURE__ */ n(M, { align: "end", className: "w-[320px] space-y-3 p-3", "data-sla-adjust-panel": !0, children: [
79
+ /* @__PURE__ */ n(U, { align: "end", className: "w-[320px] space-y-3 p-3", "data-sla-adjust-panel": !0, children: [
81
80
  /* @__PURE__ */ n("div", { children: [
82
81
  /* @__PURE__ */ a("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Adjust this record's SLA clock" }),
83
82
  /* @__PURE__ */ n("p", { className: "mt-0.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
@@ -147,13 +146,13 @@ function D({
147
146
  }
148
147
  );
149
148
  }
150
- function re({ collection: r, itemId: t }) {
149
+ function se({ collection: t, itemId: r }) {
151
150
  var u;
152
- const { data: e } = U(r, t);
151
+ const { data: e } = W(t, r);
153
152
  if (!(e != null && e.status) || e.status === "none" || e.total_hours == null) return null;
154
153
  const o = e.total_hours - (e.elapsed_hours ?? 0), m = e.status === "breached" ? "text-red-700 dark:text-red-300" : e.status === "warning" ? "text-amber-700 dark:text-amber-300" : "text-slate-600 dark:text-slate-300";
155
154
  return /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", "data-sla-clock-line": e.status, children: [
156
- /* @__PURE__ */ a(T, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
155
+ /* @__PURE__ */ a(L, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
157
156
  /* @__PURE__ */ n("p", { className: `min-w-0 flex-1 text-[12px] ${m}`, children: [
158
157
  /* @__PURE__ */ a("span", { className: "font-medium", children: "SLA" }),
159
158
  (u = e.sla_rule) != null && u.name ? ` · ${e.sla_rule.name}` : "",
@@ -168,18 +167,18 @@ function re({ collection: r, itemId: t }) {
168
167
  "data-sla-override": !0,
169
168
  children: [
170
169
  "· ",
171
- W(e.override)
170
+ D(e.override)
172
171
  ]
173
172
  }
174
173
  )
175
174
  ] }),
176
- e.can_adjust && /* @__PURE__ */ a(D, { collection: r, itemId: t, data: e })
175
+ e.can_adjust && /* @__PURE__ */ a(G, { collection: t, itemId: r, data: e })
177
176
  ] });
178
177
  }
179
178
  export {
180
- D as AdjustClockPopover,
181
- re as SlaClockLine,
182
- W as overrideSentence,
179
+ G as AdjustClockPopover,
180
+ se as SlaClockLine,
181
+ D as overrideSentence,
183
182
  q as slaStatusKey,
184
- U as useSlaStatus
183
+ W as useSlaStatus
185
184
  };