@nivaro/react 0.3.46 → 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 (57) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +248 -16
  4. package/dist/index.js +679 -659
  5. package/dist/shared/components/CollectionBrowserView.js +813 -826
  6. package/dist/shared/components/ErrorNotice.js +169 -0
  7. package/dist/shared/components/ErrorSurface.js +23 -17
  8. package/dist/shared/components/ListLoadError.js +8 -29
  9. package/dist/shared/components/LoadErrorNote.js +38 -21
  10. package/dist/shared/components/QueryErrorState.js +8 -11
  11. package/dist/shared/components/ReportView.js +1320 -1291
  12. package/dist/shared/components/chat/ChannelArchive.js +60 -60
  13. package/dist/shared/components/chat/ChannelExtras.js +74 -74
  14. package/dist/shared/components/chat/ChatPanel.js +368 -367
  15. package/dist/shared/components/command-center/PeekPanel.js +33 -32
  16. package/dist/shared/components/command-center/panels/BoardSettings.js +41 -40
  17. package/dist/shared/components/command-center/panels/PeoplePanel.js +32 -31
  18. package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
  19. package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
  20. package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
  21. package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
  22. package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
  23. package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
  24. package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
  25. package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
  26. package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
  27. package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
  28. package/dist/shared/components/import/ImportFromFileButton.js +61 -60
  29. package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
  30. package/dist/shared/components/imports/NewImportDialog.js +29 -28
  31. package/dist/shared/components/imports/RunDetailSheet.js +63 -63
  32. package/dist/shared/components/item-edit/FieldRow.js +329 -329
  33. package/dist/shared/components/item-edit/InlineTableField.js +898 -898
  34. package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
  35. package/dist/shared/components/item-edit/PlanGrid.js +220 -221
  36. package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
  37. package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
  38. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
  39. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
  40. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
  41. package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
  42. package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
  43. package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
  44. package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
  45. package/dist/shared/components/panels/SlaClock.js +35 -36
  46. package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
  47. package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
  48. package/dist/shared/components/profile/AgentsPanel.js +73 -72
  49. package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
  50. package/dist/shared/components/support/SupportRequestDialog.js +85 -81
  51. package/dist/shared/components/support/SupportView.js +94 -87
  52. package/dist/shared/lib/autofill-poll.js +21 -18
  53. package/dist/shared/lib/error-actions.js +85 -0
  54. package/dist/shared/lib/error-message.js +223 -82
  55. package/dist/shared/lib/error-toast.js +71 -13
  56. package/dist/shared/lib/safe-error.js +136 -38
  57. package/package.json +1 -1
@@ -1,44 +1,45 @@
1
1
  import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
- import { useQueryClient as $, useQuery as C } from "@tanstack/react-query";
3
- import { AlertCircle as N, RotateCw as I } from "lucide-react";
2
+ import { useQueryClient as C, useQuery as I } from "@tanstack/react-query";
3
+ import { AlertCircle as N, RotateCw as O } from "lucide-react";
4
4
  import { useState as d } from "react";
5
- import { toast as O } from "sonner";
6
- import { useNivaroClient as F } from "../../../context.js";
5
+ import { toast as F } from "sonner";
6
+ import { useNivaroClient as q } from "../../../context.js";
7
+ import { userErrorMessage as _ } from "../../../lib/safe-error.js";
7
8
  import { Button as c } from "../../ui/button.js";
8
9
  import { Skeleton as g } from "../../ui/skeleton.js";
9
- import { helpVideoApi as _, helpVideoKeys as q, helpVideoError as z } from "../api.js";
10
+ import { helpVideoApi as w, helpVideoKeys as z, helpVideoError as M } from "../api.js";
10
11
  import { DownloadMenu as j } from "../viewer/DownloadMenu.js";
11
- import { renderLabel as K, whenSaved as w } from "./publish.js";
12
- import { UnsavedNote as M } from "./UnsavedNote.js";
12
+ import { renderLabel as K, whenSaved as y } from "./publish.js";
13
+ import { UnsavedNote as P } from "./UnsavedNote.js";
13
14
  const m = "rounded-full px-2 py-0.5 text-[11px] font-medium";
14
- function Z({
15
+ function re({
15
16
  video: a,
16
- onRerecord: y,
17
- onRestored: k,
17
+ onRerecord: k,
18
+ onRestored: E,
18
19
  beforeChange: u,
19
- conflict: E = !1,
20
- onReload: V = () => {
20
+ conflict: V = !1,
21
+ onReload: D = () => {
21
22
  }
22
23
  }) {
23
- const p = F(), D = $(), [f, i] = d(null), [R, o] = d(!1), [h, x] = d(null), s = C({
24
+ const p = q(), R = C(), [f, i] = d(null), [L, o] = d(!1), [h, x] = d(null), s = I({
24
25
  queryKey: ["help-videos", "versions", a.id],
25
- queryFn: () => _(p).versions(a.id)
26
- }), L = async () => {
27
- i(null), o(!1), (await w(u, async () => {
28
- })).ok ? y() : o(!0);
29
- }, S = async (e, n) => {
26
+ queryFn: () => w(p).versions(a.id)
27
+ }), S = async () => {
28
+ i(null), o(!1), (await y(u, async () => {
29
+ })).ok ? k() : o(!0);
30
+ }, $ = async (e, n) => {
30
31
  var v;
31
32
  i(null), o(!1), x(e);
32
33
  try {
33
- if (!(await w(u, () => _(p).restore(a.id, e))).ok) {
34
+ if (!(await y(u, () => w(p).restore(a.id, e))).ok) {
34
35
  o(!0);
35
36
  return;
36
37
  }
37
- O.success(`Version ${n} copied into a new draft`), D.invalidateQueries({ queryKey: q.one(a.id) }), s.refetch(), k();
38
+ F.success(`Version ${n} copied into a new draft`), R.invalidateQueries({ queryKey: z.one(a.id) }), s.refetch(), E();
38
39
  } catch (l) {
39
- const b = (v = z(l)) == null ? void 0 : v.code;
40
+ const b = (v = M(l)) == null ? void 0 : v.code;
40
41
  i(
41
- b === "HELP_VIDEO_VERSION_FILES_REMOVED" ? `Version ${n} couldn't be restored: its files were removed by retention.` : `Version ${n} couldn't be restored. ${l.message}`
42
+ b === "HELP_VIDEO_VERSION_FILES_REMOVED" ? `Version ${n} couldn't be restored: its files were removed by retention.` : `Version ${n} couldn't be restored. ${_(l, "")}`
42
43
  ), b === "HELP_VIDEO_VERSION_FILES_REMOVED" && s.refetch();
43
44
  } finally {
44
45
  x(null);
@@ -63,14 +64,14 @@ function Z({
63
64
  size: "sm",
64
65
  variant: "outline",
65
66
  className: "h-8",
66
- onClick: () => void L(),
67
+ onClick: () => void S(),
67
68
  "data-hv-rerecord": !0,
68
69
  children: "Re-record"
69
70
  }
70
71
  )
71
72
  ] })
72
73
  ] }),
73
- R && /* @__PURE__ */ r(M, { conflict: E, onReload: V, "data-hv-versions-note": !0 }),
74
+ L && /* @__PURE__ */ r(P, { conflict: V, onReload: D, "data-hv-versions-note": !0 }),
74
75
  /* @__PURE__ */ r("div", { role: "status", "aria-live": "polite", children: f && /* @__PURE__ */ t(
75
76
  "p",
76
77
  {
@@ -90,7 +91,7 @@ function Z({
90
91
  /* @__PURE__ */ r(N, { className: "h-4 w-4", "aria-hidden": !0 }),
91
92
  /* @__PURE__ */ t("span", { children: [
92
93
  "The versions couldn't load. ",
93
- s.error.message
94
+ _(s.error, "")
94
95
  ] }),
95
96
  /* @__PURE__ */ t(
96
97
  c,
@@ -100,7 +101,7 @@ function Z({
100
101
  className: "h-7",
101
102
  onClick: () => void s.refetch(),
102
103
  children: [
103
- /* @__PURE__ */ r(I, { className: "!size-3.5" }),
104
+ /* @__PURE__ */ r(O, { className: "!size-3.5" }),
104
105
  " Try again"
105
106
  ]
106
107
  }
@@ -156,7 +157,7 @@ function Z({
156
157
  variant: "ghost",
157
158
  className: "h-8",
158
159
  disabled: h !== null,
159
- onClick: () => void S(e.id, e.version),
160
+ onClick: () => void $(e.id, e.version),
160
161
  "aria-label": `Restore version ${e.version}`,
161
162
  "data-hv-restore": e.version,
162
163
  children: h === e.id ? "Restoring…" : "Restore"
@@ -169,5 +170,5 @@ function Z({
169
170
  ] });
170
171
  }
171
172
  export {
172
- Z as VersionsTab
173
+ re as VersionsTab
173
174
  };
@@ -1,20 +1,21 @@
1
1
  import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
2
  import { useQueryClient as U, useQuery as P } from "@tanstack/react-query";
3
3
  import { Users as K } from "lucide-react";
4
- import { useState as k, useRef as i } from "react";
4
+ import { useState as E, useRef as i } from "react";
5
5
  import { useItemEditAuth as Q, useNivaroClient as O } from "../../../context.js";
6
6
  import { get as j } from "../../../lib/commands.js";
7
+ import { userErrorMessage as z } from "../../../lib/safe-error.js";
7
8
  import { Button as x } from "../../ui/button.js";
8
- import { Popover as z, PopoverTrigger as S, PopoverContent as B } from "../../ui/popover.js";
9
- import { helpVideoApi as q, helpVideoKeys as D } from "../api.js";
10
- import { RemovableChip as F, PickerCombo as V } from "../editor/PickerCombo.js";
11
- const b = ["help-videos", "author-roles"], E = "text-[12.5px] text-muted-foreground", C = "flex items-center justify-between gap-2 rounded-md border border-rose-200 bg-rose-50 px-2.5 py-1.5 text-[12.5px] text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200";
12
- function Z() {
13
- const { isAdmin: m } = Q(), p = O(), h = U(), [f, L] = k(!1), [N, v] = k(null), s = i(null), l = i([]), R = i(Promise.resolve()), c = i(0), y = i(0), d = P({
9
+ import { Popover as S, PopoverTrigger as B, PopoverContent as D } from "../../ui/popover.js";
10
+ import { helpVideoApi as k, helpVideoKeys as F } from "../api.js";
11
+ import { RemovableChip as V, PickerCombo as _ } from "../editor/PickerCombo.js";
12
+ const b = ["help-videos", "author-roles"], q = "text-[12.5px] text-muted-foreground", C = "flex items-center justify-between gap-2 rounded-md border border-rose-200 bg-rose-50 px-2.5 py-1.5 text-[12.5px] text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200";
13
+ function re() {
14
+ const { isAdmin: m } = Q(), p = O(), h = U(), [f, L] = E(!1), [N, v] = E(null), s = i(null), l = i([]), R = i(Promise.resolve()), c = i(0), y = i(0), d = P({
14
15
  queryKey: b,
15
16
  enabled: m && f,
16
17
  queryFn: async () => {
17
- const e = await q(p).authorRoles();
18
+ const e = await k(p).authorRoles();
18
19
  return s.current = e, e;
19
20
  }
20
21
  }), o = P({
@@ -34,9 +35,9 @@ function Z() {
34
35
  R.current = R.current.then(async () => {
35
36
  if (y.current === n)
36
37
  try {
37
- await q(p).setAuthorRoles(r), s.current = r, h.invalidateQueries({ queryKey: D.all });
38
+ await k(p).setAuthorRoles(r), s.current = r, h.invalidateQueries({ queryKey: F.all });
38
39
  } catch (g) {
39
- y.current += 1, v(`That change was not saved. ${g.message}`);
40
+ y.current += 1, v(`That change was not saved. ${z(g, "")}`);
40
41
  }
41
42
  }).finally(() => {
42
43
  c.current -= 1, c.current === 0 && s.current && (l.current = s.current, h.setQueryData(b, s.current));
@@ -45,26 +46,26 @@ function Z() {
45
46
  c.current === 0 && (l.current = u);
46
47
  const T = (e) => o.isPending ? "Remove role" : `Remove ${w(e)}`;
47
48
  return /* @__PURE__ */ a(
48
- z,
49
+ S,
49
50
  {
50
51
  open: f,
51
52
  onOpenChange: (e) => {
52
53
  L(e), e || v(null);
53
54
  },
54
55
  children: [
55
- /* @__PURE__ */ t(S, { asChild: !0, children: /* @__PURE__ */ a(x, { size: "sm", variant: "outline", "data-hv-author-roles": !0, children: [
56
+ /* @__PURE__ */ t(B, { asChild: !0, children: /* @__PURE__ */ a(x, { size: "sm", variant: "outline", "data-hv-author-roles": !0, children: [
56
57
  /* @__PURE__ */ t(K, { className: "mr-1 h-4 w-4", "aria-hidden": !0 }),
57
58
  " Who can record"
58
59
  ] }) }),
59
- /* @__PURE__ */ a(B, { align: "end", className: "w-[min(320px,calc(100vw-2rem))] space-y-3 text-[13px]", children: [
60
+ /* @__PURE__ */ a(D, { align: "end", className: "w-[min(320px,calc(100vw-2rem))] space-y-3 text-[13px]", children: [
60
61
  /* @__PURE__ */ t("p", { className: "text-muted-foreground", children: "Administrators can always record and edit videos. Add roles to let their members do it too." }),
61
- d.isPending ? /* @__PURE__ */ t("p", { className: E, role: "status", children: "Loading…" }) : d.isError ? /* @__PURE__ */ a("div", { className: C, role: "alert", children: [
62
+ d.isPending ? /* @__PURE__ */ t("p", { className: q, role: "status", children: "Loading…" }) : d.isError ? /* @__PURE__ */ a("div", { className: C, role: "alert", children: [
62
63
  /* @__PURE__ */ t("span", { children: "The roles that can record could not be loaded." }),
63
64
  /* @__PURE__ */ t(x, { size: "sm", variant: "outline", onClick: () => void d.refetch(), children: "Try again" })
64
65
  ] }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-1.5", children: [
65
- u.length === 0 && /* @__PURE__ */ t("span", { className: E, children: "No roles added yet." }),
66
+ u.length === 0 && /* @__PURE__ */ t("span", { className: q, children: "No roles added yet." }),
66
67
  u.map((e) => /* @__PURE__ */ t(
67
- F,
68
+ V,
68
69
  {
69
70
  "data-hv-author-role": e,
70
71
  removeLabel: T(e),
@@ -74,7 +75,7 @@ function Z() {
74
75
  e
75
76
  )),
76
77
  /* @__PURE__ */ t(
77
- V,
78
+ _,
78
79
  {
79
80
  ariaLabel: "Add a role",
80
81
  placeholder: "Add a role",
@@ -95,5 +96,5 @@ function Z() {
95
96
  );
96
97
  }
97
98
  export {
98
- Z as AuthorRolesButton
99
+ re as AuthorRolesButton
99
100
  };