@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,13 +1,14 @@
1
- import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
- import { UserRound as v, Undo2 as S, UserRoundPlus as C, UserRoundPen as U, UserRoundX as Y, Check as E } from "lucide-react";
3
- import { useState as F, Fragment as P, useInsertionEffect as I } from "react";
4
- import { toast as c } from "sonner";
1
+ import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
+ import { UserRound as v, Undo2 as S, UserRoundPlus as C, UserRoundPen as E, UserRoundX as U, Check as Y } from "lucide-react";
3
+ import { useState as F, Fragment as P, useInsertionEffect as T } from "react";
4
+ import { toast as h } from "sonner";
5
+ import { plainErrorText as I, userErrorMessage as R } from "../../lib/safe-error.js";
5
6
  import { usePersonalDefaultsApi as D } from "./usePersonalDefaults.js";
6
- function T(e) {
7
+ function A(e) {
7
8
  return e.applied && e.hasDefault ? "applied" : e.editable ? e.loaded ? e.failed && !e.hasDefault ? e.hasValue ? "offer" : null : e.hasDefault ? e.hasValue ? e.isDefault ? "saved" : "update" : "saved-empty" : e.hasValue ? "offer" : "reserve" : "reserve" : null;
8
9
  }
9
- function K(e, t, a) {
10
- return e != null && e.allowed(t) ? e.manageable(t) ? T({
10
+ function q(e, t, a) {
11
+ return e != null && e.allowed(t) ? e.manageable(t) ? A({
11
12
  editable: a,
12
13
  loaded: e.loaded,
13
14
  hasValue: e.hasValue(t),
@@ -18,30 +19,30 @@ function K(e, t, a) {
18
19
  }) : e.applied(t) && e.defaultFor(t) !== null ? "applied" : null : null;
19
20
  }
20
21
  function g(e, t) {
21
- var d, s, f;
22
- const a = e;
23
- return ((s = (d = a == null ? void 0 : a.response) == null ? void 0 : d.data) == null ? void 0 : s.error) ?? ((f = a == null ? void 0 : a.data) == null ? void 0 : f.error) ?? (a == null ? void 0 : a.error) ?? (a == null ? void 0 : a.message) ?? t;
22
+ var s, p, o;
23
+ const a = e, d = ((p = (s = a == null ? void 0 : a.response) == null ? void 0 : s.data) == null ? void 0 : p.error) ?? ((o = a == null ? void 0 : a.data) == null ? void 0 : o.error) ?? (a == null ? void 0 : a.error);
24
+ return typeof d == "string" ? I(d, t) : R(e, t);
24
25
  }
25
- function R(e, t) {
26
+ function L(e, t) {
26
27
  return e.clear(t).then(
27
- (a) => (c.success(
28
+ (a) => (h.success(
28
29
  "Your default was cleared",
29
30
  a ? {
30
31
  action: {
31
32
  label: "Undo",
32
33
  onClick: () => {
33
34
  e.restore(a).then(
34
- () => c.success("Your default is back"),
35
- (d) => c.error(g(d, "Could not put your default back"))
35
+ () => h.success("Your default is back"),
36
+ (d) => h.error(g(d, "Could not put your default back"))
36
37
  );
37
38
  }
38
39
  }
39
40
  } : void 0
40
41
  ), !0),
41
- (a) => (c.error(g(a, "Could not clear your default")), !1)
42
+ (a) => (h.error(g(a, "Could not clear your default")), !1)
42
43
  );
43
44
  }
44
- const A = `
45
+ const V = `
45
46
  [data-pd-row]{container-type:inline-size;container-name:nvrpd}
46
47
  [data-personal-default-slot]{min-width:13rem}
47
48
  [data-personal-default-slot][data-pd-new]{min-width:16rem}
@@ -64,15 +65,15 @@ const A = `
64
65
  button[data-field-menu-trigger]{opacity:1}
65
66
  }
66
67
  `, N = "nvr-personal-default-css";
67
- function L() {
68
- I(() => {
68
+ function $() {
69
+ T(() => {
69
70
  if (typeof document > "u" || document.getElementById(N)) return;
70
71
  const e = document.createElement("style");
71
- e.id = N, e.textContent = A, document.head.appendChild(e);
72
+ e.id = N, e.textContent = V, document.head.appendChild(e);
72
73
  }, []);
73
74
  }
74
- const y = 'relative inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded px-1 text-[10.5px] font-medium text-slate-500 transition-colors duration-150 before:absolute before:inset-x-0 before:-inset-y-0.5 before:content-[""] hover:bg-muted hover:text-slate-800 active:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-600 disabled:cursor-not-allowed disabled:opacity-50 aria-expanded:bg-muted aria-expanded:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground dark:focus-visible:ring-sky-300 dark:aria-expanded:text-foreground', V = "inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap px-1 text-[10.5px] font-medium text-slate-500 dark:text-muted-foreground", $ = "inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded bg-sky-50 px-1.5 text-[10.5px] font-medium text-sky-800 dark:bg-sky-900/30 dark:text-sky-200";
75
- function j() {
75
+ const y = 'relative inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded px-1 text-[10.5px] font-medium text-slate-500 transition-colors duration-150 before:absolute before:inset-x-0 before:-inset-y-0.5 before:content-[""] hover:bg-muted hover:text-slate-800 active:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-600 disabled:cursor-not-allowed disabled:opacity-50 aria-expanded:bg-muted aria-expanded:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground dark:focus-visible:ring-sky-300 dark:aria-expanded:text-foreground', M = "inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap px-1 text-[10.5px] font-medium text-slate-500 dark:text-muted-foreground", j = "inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded bg-sky-50 px-1.5 text-[10.5px] font-medium text-sky-800 dark:bg-sky-900/30 dark:text-sky-200";
76
+ function B() {
76
77
  return /* @__PURE__ */ r(
77
78
  "span",
78
79
  {
@@ -82,69 +83,69 @@ function j() {
82
83
  }
83
84
  );
84
85
  }
85
- function W({
86
+ function G({
86
87
  field: e,
87
88
  label: t,
88
89
  state: a,
89
90
  confirmOpen: d,
90
91
  onConfirm: s,
91
- onUndo: f,
92
- onCleared: h
92
+ onUndo: p,
93
+ onCleared: o
93
94
  }) {
94
- L();
95
- const l = D(), [x, b] = F(!1), u = t || e, k = a !== "saved-empty", m = /* @__PURE__ */ o(
95
+ $();
96
+ const l = D(), [x, b] = F(!1), i = t || e, k = a !== "saved-empty", m = /* @__PURE__ */ u(
96
97
  "button",
97
98
  {
98
99
  type: "button",
99
100
  "data-personal-default-clear": e,
100
- "aria-label": k ? `Clear your saved default for ${u} (the field keeps its value)` : `Clear your saved default for ${u}`,
101
+ "aria-label": k ? `Clear your saved default for ${i} (the field keeps its value)` : `Clear your saved default for ${i}`,
101
102
  "data-tip": k ? "Forget your saved default — this field keeps its value" : "Forget your saved default",
102
103
  "data-pd-action": !0,
103
104
  tabIndex: -1,
104
105
  disabled: x || !l,
105
106
  "aria-busy": x || void 0,
106
107
  onClick: () => {
107
- l && (b(!0), R(l, e).then((n) => {
108
- b(!1), n && (h == null || h());
108
+ l && (b(!0), L(l, e).then((n) => {
109
+ b(!1), n && (o == null || o());
109
110
  }));
110
111
  },
111
112
  className: y,
112
113
  children: [
113
- /* @__PURE__ */ r(Y, { "data-pd-icon": !0, className: "h-3 w-3", "aria-hidden": !0 }),
114
+ /* @__PURE__ */ r(U, { "data-pd-icon": !0, className: "h-3 w-3", "aria-hidden": !0 }),
114
115
  /* @__PURE__ */ r("span", { "data-pd-label": !0, children: "Clear default" })
115
116
  ]
116
117
  },
117
118
  "clear"
118
- ), w = (n) => /* @__PURE__ */ o(
119
+ ), w = (n) => /* @__PURE__ */ u(
119
120
  "button",
120
121
  {
121
122
  type: "button",
122
123
  ...n === "make" ? { "data-personal-default-make": e } : { "data-personal-default-update": e },
123
- "aria-label": n === "make" ? `Make this your default for ${u}` : `Update your saved default for ${u} to this value`,
124
+ "aria-label": n === "make" ? `Make this your default for ${i}` : `Update your saved default for ${i} to this value`,
124
125
  "aria-haspopup": "dialog",
125
126
  "aria-expanded": d === n,
126
127
  "data-tip": n === "make" ? "Start your new records with this value" : "Start your new records with this value instead",
127
128
  "data-pd-action": !0,
128
129
  tabIndex: -1,
129
- onClick: (p) => s(p.currentTarget, n),
130
+ onClick: (c) => s(c.currentTarget, n),
130
131
  className: y,
131
132
  children: [
132
- n === "make" ? /* @__PURE__ */ r(C, { className: "h-3 w-3", "aria-hidden": !0 }) : /* @__PURE__ */ r(U, { className: "h-3 w-3", "aria-hidden": !0 }),
133
+ n === "make" ? /* @__PURE__ */ r(C, { className: "h-3 w-3", "aria-hidden": !0 }) : /* @__PURE__ */ r(E, { className: "h-3 w-3", "aria-hidden": !0 }),
133
134
  /* @__PURE__ */ r("span", { "data-pd-primary": !0, children: n === "make" ? "Make default" : "Update default" })
134
135
  ]
135
136
  },
136
137
  n
137
138
  );
138
- let i = [];
139
- return a === "offer" ? i = [w("make")] : a === "update" ? i = [w("update"), m] : a === "saved" || a === "saved-empty" ? i = [
140
- /* @__PURE__ */ o(
139
+ let f = [];
140
+ return a === "offer" ? f = [w("make")] : a === "update" ? f = [w("update"), m] : a === "saved" || a === "saved-empty" ? f = [
141
+ /* @__PURE__ */ u(
141
142
  "span",
142
143
  {
143
144
  "data-personal-default-saved": e,
144
145
  "data-tip": a === "saved" ? "Your new records start with this value" : "You have a saved default for this field — new records start with it",
145
- className: V,
146
+ className: M,
146
147
  children: [
147
- a === "saved" ? /* @__PURE__ */ r(E, { className: "h-3 w-3 text-sky-700 dark:text-sky-300", "aria-hidden": !0 }) : /* @__PURE__ */ r(v, { className: "h-3 w-3", "aria-hidden": !0 }),
148
+ a === "saved" ? /* @__PURE__ */ r(Y, { className: "h-3 w-3 text-sky-700 dark:text-sky-300", "aria-hidden": !0 }) : /* @__PURE__ */ r(v, { className: "h-3 w-3", "aria-hidden": !0 }),
148
149
  /* @__PURE__ */ r("span", { className: "sr-only", children: "Your default" }),
149
150
  /* @__PURE__ */ r("span", { "data-pd-label": !0, "aria-hidden": !0, children: "Your default" })
150
151
  ]
@@ -152,13 +153,13 @@ function W({
152
153
  "status"
153
154
  ),
154
155
  m
155
- ] : a === "applied" && (i = [
156
- /* @__PURE__ */ o(
156
+ ] : a === "applied" && (f = [
157
+ /* @__PURE__ */ u(
157
158
  "span",
158
159
  {
159
160
  "data-personal-default": e,
160
161
  "data-tip": "Filled in from your saved default",
161
- className: $,
162
+ className: j,
162
163
  children: [
163
164
  /* @__PURE__ */ r(v, { className: "h-3 w-3", "aria-hidden": !0 }),
164
165
  /* @__PURE__ */ r("span", { className: "sr-only", children: "Your default" }),
@@ -167,15 +168,15 @@ function W({
167
168
  },
168
169
  "status"
169
170
  ),
170
- /* @__PURE__ */ o(
171
+ /* @__PURE__ */ u(
171
172
  "button",
172
173
  {
173
174
  type: "button",
174
175
  "data-personal-default-undo": e,
175
- "aria-label": `Undo: empty ${u} (your saved default stays)`,
176
+ "aria-label": `Undo: empty ${i} (your saved default stays)`,
176
177
  "data-tip": "Empty this field — your saved default stays",
177
178
  "data-pd-action": !0,
178
- onClick: f,
179
+ onClick: p,
179
180
  className: y,
180
181
  children: [
181
182
  /* @__PURE__ */ r(S, { className: "h-3 w-3", "aria-hidden": !0 }),
@@ -193,14 +194,14 @@ function W({
193
194
  "data-pd-new": l != null && l.isNew ? "" : void 0,
194
195
  "aria-hidden": a === "reserve" ? !0 : void 0,
195
196
  className: "inline-flex shrink-0 items-center justify-end",
196
- children: i.map((n, p) => /* @__PURE__ */ o(P, { children: [
197
- p > 0 && /* @__PURE__ */ r(j, {}),
197
+ children: f.map((n, c) => /* @__PURE__ */ u(P, { children: [
198
+ c > 0 && /* @__PURE__ */ r(B, {}),
198
199
  n
199
- ] }, String(n.key ?? p)))
200
+ ] }, String(n.key ?? c)))
200
201
  }
201
202
  );
202
203
  }
203
- function X({ field: e }) {
204
+ function H({ field: e }) {
204
205
  const t = D();
205
206
  if (!(t != null && t.allowed(e))) return null;
206
207
  const a = t.loaded && t.isDefault(e), d = t.loaded && t.defaultFor(e) !== null, s = a ? "Your default: new records you start get this value." : d ? "You have your own default for this field, different from this value." : "You can save your own default for this field (Edit mode).";
@@ -217,12 +218,12 @@ function X({ field: e }) {
217
218
  );
218
219
  }
219
220
  export {
220
- A as PERSONAL_DEFAULT_CSS,
221
- X as PersonalDefaultMark,
222
- W as PersonalDefaultSlot,
223
- R as clearPersonalDefault,
224
- K as personalDefaultSlotFor,
225
- T as personalDefaultSlotState,
221
+ V as PERSONAL_DEFAULT_CSS,
222
+ H as PersonalDefaultMark,
223
+ G as PersonalDefaultSlot,
224
+ L as clearPersonalDefault,
225
+ q as personalDefaultSlotFor,
226
+ A as personalDefaultSlotState,
226
227
  g as refusalText,
227
- L as usePersonalDefaultCss
228
+ $ as usePersonalDefaultCss
228
229
  };