@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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +248 -16
- package/dist/index.js +679 -659
- package/dist/shared/components/CollectionBrowserView.js +813 -826
- package/dist/shared/components/ErrorNotice.js +169 -0
- package/dist/shared/components/ErrorSurface.js +23 -17
- package/dist/shared/components/ListLoadError.js +8 -29
- package/dist/shared/components/LoadErrorNote.js +38 -21
- package/dist/shared/components/QueryErrorState.js +8 -11
- package/dist/shared/components/ReportView.js +1320 -1291
- package/dist/shared/components/chat/ChannelArchive.js +60 -60
- package/dist/shared/components/chat/ChannelExtras.js +74 -74
- package/dist/shared/components/chat/ChatPanel.js +368 -367
- package/dist/shared/components/command-center/PeekPanel.js +33 -32
- package/dist/shared/components/command-center/panels/BoardSettings.js +41 -40
- package/dist/shared/components/command-center/panels/PeoplePanel.js +32 -31
- package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
- package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
- package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
- package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
- package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
- package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
- package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
- package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
- package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
- package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
- package/dist/shared/components/import/ImportFromFileButton.js +61 -60
- package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
- package/dist/shared/components/imports/NewImportDialog.js +29 -28
- package/dist/shared/components/imports/RunDetailSheet.js +63 -63
- package/dist/shared/components/item-edit/FieldRow.js +329 -329
- package/dist/shared/components/item-edit/InlineTableField.js +898 -898
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
- package/dist/shared/components/item-edit/PlanGrid.js +220 -221
- package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
- package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
- package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
- package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
- package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
- package/dist/shared/components/panels/SlaClock.js +35 -36
- package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
- package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
- package/dist/shared/components/profile/AgentsPanel.js +73 -72
- package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
- package/dist/shared/components/support/SupportRequestDialog.js +85 -81
- package/dist/shared/components/support/SupportView.js +94 -87
- package/dist/shared/lib/autofill-poll.js +21 -18
- package/dist/shared/lib/error-actions.js +85 -0
- package/dist/shared/lib/error-message.js +223 -82
- package/dist/shared/lib/error-toast.js +71 -13
- package/dist/shared/lib/safe-error.js +136 -38
- package/package.json +1 -1
|
@@ -1,131 +1,135 @@
|
|
|
1
1
|
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Loader2 as
|
|
4
|
-
import { useState as l, useRef as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { invalidateRecordTasks as
|
|
8
|
-
import { prepareReplayClip as
|
|
9
|
-
import { installReplayTail as
|
|
10
|
-
import { Dialog as
|
|
11
|
-
import { collectSupportContext as
|
|
12
|
-
function
|
|
13
|
-
open:
|
|
2
|
+
import { useQueryClient as _, useQuery as z, useMutation as G } from "@tanstack/react-query";
|
|
3
|
+
import { Loader2 as j, Paperclip as H, X } from "lucide-react";
|
|
4
|
+
import { useState as l, useRef as U, useEffect as I } from "react";
|
|
5
|
+
import { useNivaroClient as B } from "../../context.js";
|
|
6
|
+
import { get as J, post as V } from "../../lib/commands.js";
|
|
7
|
+
import { invalidateRecordTasks as Z } from "../../lib/record-tasks.js";
|
|
8
|
+
import { prepareReplayClip as O } from "../../lib/replay-capture.js";
|
|
9
|
+
import { installReplayTail as ee } from "../../lib/replay-tail.js";
|
|
10
|
+
import { Dialog as te, DialogContent as re, DialogHeader as ae, DialogTitle as ne, DialogDescription as le } from "../ui/dialog.js";
|
|
11
|
+
import { collectSupportContext as se } from "./support-context.js";
|
|
12
|
+
function ye({
|
|
13
|
+
open: s,
|
|
14
14
|
onOpenChange: c,
|
|
15
|
-
collection:
|
|
15
|
+
collection: d,
|
|
16
16
|
item: p,
|
|
17
|
-
recordLabel:
|
|
18
|
-
|
|
17
|
+
recordLabel: A,
|
|
18
|
+
initialTitle: f,
|
|
19
|
+
initialDescription: g,
|
|
20
|
+
onCreated: y
|
|
19
21
|
}) {
|
|
20
|
-
const m =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, []),
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const m = B(), i = _(), n = !!d && p != null && p !== "", [u, Q] = l(null), [b, v] = l(""), [E, k] = l(""), [w, N] = l([]), [T, K] = l(!1), [F, x] = l(null), [M, P] = l(!0), q = U(null), C = U(!1);
|
|
23
|
+
I(() => {
|
|
24
|
+
ee();
|
|
25
|
+
}, []), I(() => {
|
|
26
|
+
s && (f && v((e) => e || f), g && k((e) => e || g));
|
|
27
|
+
}, [s, f, g]), I(() => {
|
|
28
|
+
if (!s) {
|
|
29
|
+
q.current = null;
|
|
26
30
|
return;
|
|
27
31
|
}
|
|
28
|
-
|
|
29
|
-
clip:
|
|
32
|
+
q.current = {
|
|
33
|
+
clip: O("support"),
|
|
30
34
|
route: typeof window < "u" ? window.location.pathname : ""
|
|
31
35
|
};
|
|
32
|
-
}, [
|
|
33
|
-
const { data:
|
|
34
|
-
queryKey: ["support-categories", n ?
|
|
36
|
+
}, [s]);
|
|
37
|
+
const { data: S = [] } = z({
|
|
38
|
+
queryKey: ["support-categories", n ? d : null],
|
|
35
39
|
queryFn: () => m.request(
|
|
36
|
-
|
|
40
|
+
J("/support/categories", n ? { collection: d } : void 0)
|
|
37
41
|
).then((e) => e.data ?? []),
|
|
38
|
-
enabled:
|
|
39
|
-
}),
|
|
40
|
-
|
|
42
|
+
enabled: s
|
|
43
|
+
}), R = () => {
|
|
44
|
+
Q(null), v(""), k(""), N([]), x(null), P(!0);
|
|
41
45
|
};
|
|
42
|
-
async function
|
|
43
|
-
if (!
|
|
44
|
-
const e =
|
|
45
|
-
return
|
|
46
|
+
async function $() {
|
|
47
|
+
if (!M) return { fileId: null, replay: null };
|
|
48
|
+
const e = q.current;
|
|
49
|
+
return se({
|
|
46
50
|
clip: (e == null ? void 0 : e.clip) ?? null,
|
|
47
51
|
route: (e == null ? void 0 : e.route) ?? (typeof window < "u" ? window.location.pathname : ""),
|
|
48
52
|
upload: (r) => m.upload(r, { title: "What they saw" }),
|
|
49
53
|
userAgent: typeof navigator < "u" ? navigator.userAgent : null
|
|
50
54
|
});
|
|
51
55
|
}
|
|
52
|
-
const
|
|
56
|
+
const D = G({
|
|
53
57
|
mutationFn: async () => {
|
|
54
|
-
const e = await
|
|
58
|
+
const e = await $();
|
|
55
59
|
return m.request(
|
|
56
|
-
|
|
57
|
-
title:
|
|
58
|
-
description:
|
|
59
|
-
category_id:
|
|
60
|
-
collection: n ?
|
|
60
|
+
V("/support/tickets", {
|
|
61
|
+
title: b.trim(),
|
|
62
|
+
description: E.trim() || null,
|
|
63
|
+
category_id: u,
|
|
64
|
+
collection: n ? d : null,
|
|
61
65
|
item: n ? String(p) : null,
|
|
62
|
-
attachments: [...
|
|
66
|
+
attachments: [...w.map((r) => r.id), ...e.fileId ? [e.fileId] : []],
|
|
63
67
|
...e.replay ? { replay: e.replay } : {}
|
|
64
68
|
})
|
|
65
69
|
);
|
|
66
70
|
},
|
|
67
71
|
onSuccess: (e) => {
|
|
68
|
-
i.invalidateQueries({ queryKey: ["support-tickets"] }), i.invalidateQueries({ queryKey: ["support-summary"] }), n &&
|
|
72
|
+
i.invalidateQueries({ queryKey: ["support-tickets"] }), i.invalidateQueries({ queryKey: ["support-summary"] }), n && Z(i, d, p), y == null || y(e.data), R(), c(!1);
|
|
69
73
|
},
|
|
70
74
|
onError: (e) => {
|
|
71
|
-
var
|
|
75
|
+
var o;
|
|
72
76
|
const r = e.response;
|
|
73
|
-
if ((((
|
|
74
|
-
i.invalidateQueries({ queryKey: ["support-tickets"] }), i.invalidateQueries({ queryKey: ["support-summary"] }),
|
|
77
|
+
if ((((o = r == null ? void 0 : r.data) == null ? void 0 : o.code) ?? (r == null ? void 0 : r.code)) === "DUPLICATE_REQUEST") {
|
|
78
|
+
i.invalidateQueries({ queryKey: ["support-tickets"] }), i.invalidateQueries({ queryKey: ["support-summary"] }), R(), c(!1);
|
|
75
79
|
return;
|
|
76
80
|
}
|
|
77
81
|
x(e.message || "Could not send the request");
|
|
78
82
|
},
|
|
79
83
|
onSettled: () => {
|
|
80
|
-
|
|
84
|
+
C.current = !1;
|
|
81
85
|
}
|
|
82
86
|
});
|
|
83
|
-
async function
|
|
87
|
+
async function L(e) {
|
|
84
88
|
if (e != null && e.length) {
|
|
85
|
-
|
|
89
|
+
K(!0), x(null);
|
|
86
90
|
try {
|
|
87
91
|
for (const r of Array.from(e).slice(0, 10)) {
|
|
88
|
-
const
|
|
89
|
-
|
|
92
|
+
const o = await m.upload(r);
|
|
93
|
+
N((Y) => [...Y, { id: String(o.id), name: r.name }]);
|
|
90
94
|
}
|
|
91
95
|
} catch {
|
|
92
96
|
x("A file could not be uploaded");
|
|
93
97
|
} finally {
|
|
94
|
-
|
|
98
|
+
K(!1);
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
|
-
const h =
|
|
102
|
+
const h = S.find((e) => e.id === u) ?? null, W = b.trim().length > 0 && !D.isPending && !T;
|
|
99
103
|
return /* @__PURE__ */ t(
|
|
100
|
-
|
|
104
|
+
te,
|
|
101
105
|
{
|
|
102
|
-
open:
|
|
106
|
+
open: s,
|
|
103
107
|
onOpenChange: (e) => {
|
|
104
|
-
e ||
|
|
108
|
+
e || R(), c(e);
|
|
105
109
|
},
|
|
106
|
-
children: /* @__PURE__ */ a(
|
|
107
|
-
/* @__PURE__ */ a(
|
|
108
|
-
/* @__PURE__ */ t(
|
|
109
|
-
/* @__PURE__ */ t(
|
|
110
|
+
children: /* @__PURE__ */ a(re, { className: "max-w-xl dark:bg-card", "data-support-request": !0, children: [
|
|
111
|
+
/* @__PURE__ */ a(ae, { className: "px-6 pt-5", children: [
|
|
112
|
+
/* @__PURE__ */ t(ne, { className: "text-[15px] font-semibold text-slate-900 dark:text-slate-100", children: n ? `Request a change${A ? ` · ${A}` : ""}` : "Get help" }),
|
|
113
|
+
/* @__PURE__ */ t(le, { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: n ? "Tell the administrators what needs to change on this record. You can follow the request under My requests." : "Ask the administrators for help. You can follow the request under My requests." })
|
|
110
114
|
] }),
|
|
111
115
|
/* @__PURE__ */ a(
|
|
112
116
|
"form",
|
|
113
117
|
{
|
|
114
118
|
className: "space-y-4 px-6 pb-5 pt-3",
|
|
115
119
|
onSubmit: (e) => {
|
|
116
|
-
e.preventDefault(), !(!
|
|
120
|
+
e.preventDefault(), !(!W || C.current) && (C.current = !0, D.mutate());
|
|
117
121
|
},
|
|
118
122
|
children: [
|
|
119
|
-
|
|
123
|
+
S.length > 0 && /* @__PURE__ */ a("fieldset", { children: [
|
|
120
124
|
/* @__PURE__ */ t("legend", { className: "mb-1.5 text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "What kind of request?" }),
|
|
121
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1.5", "data-support-types": !0, children:
|
|
125
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1.5", "data-support-types": !0, children: S.map((e) => /* @__PURE__ */ t(
|
|
122
126
|
"button",
|
|
123
127
|
{
|
|
124
128
|
type: "button",
|
|
125
129
|
"data-support-type": e.id,
|
|
126
|
-
"aria-pressed":
|
|
127
|
-
onClick: () =>
|
|
128
|
-
className:
|
|
130
|
+
"aria-pressed": u === e.id,
|
|
131
|
+
onClick: () => Q(u === e.id ? null : e.id),
|
|
132
|
+
className: u === e.id ? "rounded-full border border-nvr-cyan/60 bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan" : "rounded-full border border-slate-200 px-2.5 py-1 text-[12px] text-slate-600 hover:border-slate-300 dark:border-border dark:text-slate-300",
|
|
129
133
|
children: e.name
|
|
130
134
|
},
|
|
131
135
|
e.id
|
|
@@ -138,8 +142,8 @@ function fe({
|
|
|
138
142
|
"input",
|
|
139
143
|
{
|
|
140
144
|
"data-support-title": !0,
|
|
141
|
-
value:
|
|
142
|
-
onChange: (e) =>
|
|
145
|
+
value: b,
|
|
146
|
+
onChange: (e) => v(e.target.value),
|
|
143
147
|
maxLength: 200,
|
|
144
148
|
placeholder: n ? "e.g. Move to funding year 2027" : "e.g. I need access to the National zone",
|
|
145
149
|
className: "h-9 w-full rounded-md border border-slate-200 bg-white px-3 text-[13px] text-slate-900 outline-none focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100"
|
|
@@ -152,8 +156,8 @@ function fe({
|
|
|
152
156
|
"textarea",
|
|
153
157
|
{
|
|
154
158
|
"data-support-description": !0,
|
|
155
|
-
value:
|
|
156
|
-
onChange: (e) =>
|
|
159
|
+
value: E,
|
|
160
|
+
onChange: (e) => k(e.target.value),
|
|
157
161
|
rows: 5,
|
|
158
162
|
placeholder: "What should change, and why",
|
|
159
163
|
className: "w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-[13px] text-slate-900 outline-none focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100"
|
|
@@ -162,7 +166,7 @@ function fe({
|
|
|
162
166
|
] }),
|
|
163
167
|
/* @__PURE__ */ a("div", { children: [
|
|
164
168
|
/* @__PURE__ */ a("label", { className: "inline-flex cursor-pointer items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-900 dark:text-slate-300 dark:hover:text-slate-100", children: [
|
|
165
|
-
T ? /* @__PURE__ */ t(
|
|
169
|
+
T ? /* @__PURE__ */ t(j, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(H, { className: "h-3.5 w-3.5" }),
|
|
166
170
|
"Attach files",
|
|
167
171
|
/* @__PURE__ */ t(
|
|
168
172
|
"input",
|
|
@@ -172,12 +176,12 @@ function fe({
|
|
|
172
176
|
className: "hidden",
|
|
173
177
|
"data-support-files": !0,
|
|
174
178
|
onChange: (e) => {
|
|
175
|
-
|
|
179
|
+
L(e.target.files), e.target.value = "";
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
182
|
)
|
|
179
183
|
] }),
|
|
180
|
-
|
|
184
|
+
w.length > 0 && /* @__PURE__ */ t("ul", { className: "mt-1.5 flex flex-wrap gap-1.5", children: w.map((e) => /* @__PURE__ */ a(
|
|
181
185
|
"li",
|
|
182
186
|
{
|
|
183
187
|
className: "inline-flex items-center gap-1 rounded bg-slate-100 px-2 py-0.5 text-[11.5px] text-slate-700 dark:bg-white/10 dark:text-slate-200",
|
|
@@ -188,9 +192,9 @@ function fe({
|
|
|
188
192
|
{
|
|
189
193
|
type: "button",
|
|
190
194
|
"aria-label": `Remove ${e.name}`,
|
|
191
|
-
onClick: () =>
|
|
195
|
+
onClick: () => N((r) => r.filter((o) => o.id !== e.id)),
|
|
192
196
|
className: "text-slate-400 hover:text-slate-700 dark:hover:text-slate-100",
|
|
193
|
-
children: /* @__PURE__ */ t(
|
|
197
|
+
children: /* @__PURE__ */ t(X, { className: "h-3 w-3" })
|
|
194
198
|
}
|
|
195
199
|
)
|
|
196
200
|
]
|
|
@@ -208,8 +212,8 @@ function fe({
|
|
|
208
212
|
"input",
|
|
209
213
|
{
|
|
210
214
|
type: "checkbox",
|
|
211
|
-
checked:
|
|
212
|
-
onChange: (e) =>
|
|
215
|
+
checked: M,
|
|
216
|
+
onChange: (e) => P(e.target.checked),
|
|
213
217
|
className: "mt-0.5 accent-[#00ceff]"
|
|
214
218
|
}
|
|
215
219
|
),
|
|
@@ -220,7 +224,7 @@ function fe({
|
|
|
220
224
|
]
|
|
221
225
|
}
|
|
222
226
|
),
|
|
223
|
-
|
|
227
|
+
F && /* @__PURE__ */ t("p", { className: "text-[12px] text-red-600 dark:text-red-400", role: "alert", children: F }),
|
|
224
228
|
/* @__PURE__ */ a("div", { className: "flex justify-end gap-2 pt-1", children: [
|
|
225
229
|
/* @__PURE__ */ t(
|
|
226
230
|
"button",
|
|
@@ -236,10 +240,10 @@ function fe({
|
|
|
236
240
|
{
|
|
237
241
|
type: "submit",
|
|
238
242
|
"data-support-send": !0,
|
|
239
|
-
disabled: !
|
|
243
|
+
disabled: !W,
|
|
240
244
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-nvr-cyan/60 bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy hover:bg-nvr-cyan/15 disabled:opacity-50 dark:text-nvr-cyan",
|
|
241
245
|
children: [
|
|
242
|
-
|
|
246
|
+
D.isPending && /* @__PURE__ */ t(j, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
243
247
|
"Send request"
|
|
244
248
|
]
|
|
245
249
|
}
|
|
@@ -253,5 +257,5 @@ function fe({
|
|
|
253
257
|
);
|
|
254
258
|
}
|
|
255
259
|
export {
|
|
256
|
-
|
|
260
|
+
ye as SupportRequestDialog
|
|
257
261
|
};
|