@nivaro/react 0.3.10 → 0.3.12
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/useNivaroForm.js +1 -1
- package/dist/hooks/useSessionRecorder.js +109 -102
- package/dist/index.d.ts +34 -3
- package/dist/shared/components/CollectionBrowserView.js +1546 -1477
- package/dist/shared/components/ItemEditForm.js +4332 -4195
- package/dist/shared/components/PageRenderer.js +512 -465
- package/dist/shared/components/ProfileView.js +115 -109
- package/dist/shared/components/QueryStatStrip.js +74 -70
- package/dist/shared/components/ReportView.js +818 -827
- package/dist/shared/components/SheetHeaderBody.js +16 -14
- package/dist/shared/components/chat/ChatPanel.js +492 -472
- package/dist/shared/components/item-edit/CatalogPickerField.js +1029 -933
- package/dist/shared/components/item-edit/FieldRenderer.js +161 -156
- package/dist/shared/components/item-edit/FieldRow.js +20 -19
- package/dist/shared/components/item-edit/FilePickerField.js +52 -40
- package/dist/shared/components/item-edit/GroupSection.js +221 -221
- package/dist/shared/components/item-edit/InlineGridField.js +41 -41
- package/dist/shared/components/item-edit/InlineTableField.js +2249 -2238
- package/dist/shared/components/item-edit/M2MCombobox.js +46 -44
- package/dist/shared/components/item-edit/NestedRelationEditor.js +11 -11
- package/dist/shared/components/item-edit/QuickPicker.js +263 -216
- package/dist/shared/components/item-edit/RelationCombobox.js +285 -245
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +42 -32
- package/dist/shared/components/item-edit/RowHistorySheet.js +130 -134
- package/dist/shared/components/item-edit/SummaryPanel.js +305 -279
- package/dist/shared/components/item-edit/UserChip.js +301 -233
- package/dist/shared/components/item-edit/helpers.js +133 -134
- package/dist/shared/components/item-edit/line-qty.js +57 -0
- package/dist/shared/components/item-edit/option-disambiguate.js +53 -0
- package/dist/shared/components/panels/AddendumLinesDiff.js +87 -90
- package/dist/shared/components/panels/CommentPanel.js +350 -315
- package/dist/shared/components/panels/ItemLockBanner.js +297 -230
- package/dist/shared/components/panels/PipelinePanel.js +719 -701
- package/dist/shared/components/profile/PersonAdminTools.js +168 -144
- package/dist/shared/components/profile/PersonProfile.js +42 -41
- package/dist/shared/components/profile/session-actions.js +52 -0
- package/dist/shared/components/queue/QueueQuickFilters.js +43 -41
- package/dist/shared/components/queue/QueueWorklist.js +1005 -935
- package/dist/shared/components/widgets/ReviewListWidget.js +99 -93
- package/dist/shared/lib/obligation-banner.js +14 -13
- package/dist/shared/lib/obligation-reason-text.js +13 -0
- package/dist/shared/lib/query-filter-seed.js +34 -11
- package/dist/shared/lib/replay-checkout.js +20 -0
- package/dist/shared/lib/sanitize-html.js +24 -15
- package/dist/shared/lib/sheet-def.js +38 -22
- package/dist/shared/lib/unique-options.js +10 -0
- package/dist/shared/lib/utils.js +57 -43
- package/dist/shared/lib/validation-rules.js +58 -34
- package/package.json +1 -1
|
@@ -90,10 +90,10 @@ function et() {
|
|
|
90
90
|
const i = T(), m = E(), { data: a = [] } = q({
|
|
91
91
|
queryKey: ["nvr-profile-fields"],
|
|
92
92
|
queryFn: () => i.request(F("/profile-fields/mine")).then((n) => n.data ?? []).catch(() => [])
|
|
93
|
-
}), [s,
|
|
93
|
+
}), [s, o] = C(null), l = _({
|
|
94
94
|
mutationFn: (n) => i.request(Me("/profile-fields/mine", { values: n })),
|
|
95
95
|
onSuccess: () => {
|
|
96
|
-
|
|
96
|
+
o(null), m.invalidateQueries({ queryKey: ["nvr-profile-fields"] });
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
if (a.length === 0) return null;
|
|
@@ -118,7 +118,7 @@ function et() {
|
|
|
118
118
|
{ value: "true", label: "Yes" },
|
|
119
119
|
{ value: "false", label: "No" }
|
|
120
120
|
],
|
|
121
|
-
onChange: (b) =>
|
|
121
|
+
onChange: (b) => o({ ...c, [n.key]: b })
|
|
122
122
|
}
|
|
123
123
|
) : n.type === "select" ? /* @__PURE__ */ e(
|
|
124
124
|
M,
|
|
@@ -128,14 +128,14 @@ function et() {
|
|
|
128
128
|
{ value: "", label: "—" },
|
|
129
129
|
...u(n.options).map((b) => ({ value: b, label: b }))
|
|
130
130
|
],
|
|
131
|
-
onChange: (b) =>
|
|
131
|
+
onChange: (b) => o({ ...c, [n.key]: b })
|
|
132
132
|
}
|
|
133
133
|
) : /* @__PURE__ */ e(
|
|
134
134
|
"input",
|
|
135
135
|
{
|
|
136
136
|
type: n.type === "number" ? "number" : n.type === "date" ? "date" : "text",
|
|
137
137
|
value: c[n.key] ?? "",
|
|
138
|
-
onChange: (b) =>
|
|
138
|
+
onChange: (b) => o({ ...c, [n.key]: b.target.value }),
|
|
139
139
|
className: "h-8 w-full rounded-md border border-slate-200 bg-background px-2 text-[12.5px] dark:border-border"
|
|
140
140
|
}
|
|
141
141
|
)
|
|
@@ -145,7 +145,7 @@ function et() {
|
|
|
145
145
|
"button",
|
|
146
146
|
{
|
|
147
147
|
type: "button",
|
|
148
|
-
onClick: () =>
|
|
148
|
+
onClick: () => o(null),
|
|
149
149
|
className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500",
|
|
150
150
|
children: "Cancel"
|
|
151
151
|
}
|
|
@@ -154,10 +154,10 @@ function et() {
|
|
|
154
154
|
"button",
|
|
155
155
|
{
|
|
156
156
|
type: "button",
|
|
157
|
-
disabled:
|
|
158
|
-
onClick: () =>
|
|
157
|
+
disabled: l.isPending,
|
|
158
|
+
onClick: () => l.mutate(c),
|
|
159
159
|
className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
|
|
160
|
-
children:
|
|
160
|
+
children: l.isPending ? "Saving…" : "Save"
|
|
161
161
|
}
|
|
162
162
|
)
|
|
163
163
|
] })
|
|
@@ -170,9 +170,9 @@ function tt() {
|
|
|
170
170
|
var h;
|
|
171
171
|
return ((h = r.data) == null ? void 0 : h.preferences) ?? {};
|
|
172
172
|
})
|
|
173
|
-
}), s = (a == null ? void 0 : a.notification_prefs) ?? {},
|
|
173
|
+
}), s = (a == null ? void 0 : a.notification_prefs) ?? {}, o = (a == null ? void 0 : a.email_digest) === "daily" ? "daily" : "instant", l = (r) => {
|
|
174
174
|
var h, x;
|
|
175
|
-
return ((x = (h = s.matrix) == null ? void 0 : h[r]) == null ? void 0 : x.email) ??
|
|
175
|
+
return ((x = (h = s.matrix) == null ? void 0 : h[r]) == null ? void 0 : x.email) ?? o;
|
|
176
176
|
}, [c, u] = C(null), [n, b] = C(null), p = c ?? s.quiet_start ?? "", w = n ?? s.quiet_end ?? "", k = _({
|
|
177
177
|
mutationFn: (r) => i.request(V("/users/me/preferences", { notification_prefs: r })),
|
|
178
178
|
onSuccess: () => {
|
|
@@ -256,7 +256,7 @@ function tt() {
|
|
|
256
256
|
mutationFn: () => i.request(ae("/users/me/digest-test", {})),
|
|
257
257
|
onSuccess: (r) => J(r.data.note),
|
|
258
258
|
onError: () => J("Test send failed — try again.")
|
|
259
|
-
}), ge = te.some((r) =>
|
|
259
|
+
}), ge = te.some((r) => l(r.key) === "daily"), de = [
|
|
260
260
|
{ value: "instant", label: "Individual email" },
|
|
261
261
|
{ value: "daily", label: "Daily summary" },
|
|
262
262
|
{ value: "off", label: "No email" }
|
|
@@ -473,7 +473,7 @@ function tt() {
|
|
|
473
473
|
M,
|
|
474
474
|
{
|
|
475
475
|
ariaLabel: `Email for ${r.label}`,
|
|
476
|
-
value:
|
|
476
|
+
value: l(r.key),
|
|
477
477
|
options: de,
|
|
478
478
|
onChange: (g) => D(r.key, g)
|
|
479
479
|
}
|
|
@@ -646,7 +646,7 @@ function at() {
|
|
|
646
646
|
var u;
|
|
647
647
|
return ((u = c.data) == null ? void 0 : u.preferences) ?? {};
|
|
648
648
|
})
|
|
649
|
-
}), s = (a == null ? void 0 : a.link_app) === "portal" || (a == null ? void 0 : a.link_app) === "admin" ? a.link_app : "auto",
|
|
649
|
+
}), s = (a == null ? void 0 : a.link_app) === "portal" || (a == null ? void 0 : a.link_app) === "admin" ? a.link_app : "auto", o = _({
|
|
650
650
|
mutationFn: (c) => i.request(V("/users/me/preferences", { link_app: c })),
|
|
651
651
|
onSuccess: () => void m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] })
|
|
652
652
|
});
|
|
@@ -667,7 +667,7 @@ function at() {
|
|
|
667
667
|
{
|
|
668
668
|
type: "button",
|
|
669
669
|
title: c.hint,
|
|
670
|
-
onClick: () =>
|
|
670
|
+
onClick: () => o.mutate(c.v),
|
|
671
671
|
className: s === c.v ? "rounded bg-nvr-cyan px-3 py-1 text-[12.5px] font-medium text-white" : "rounded px-3 py-1 text-[12.5px] font-medium text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted",
|
|
672
672
|
children: c.label
|
|
673
673
|
},
|
|
@@ -678,13 +678,13 @@ function at() {
|
|
|
678
678
|
);
|
|
679
679
|
}
|
|
680
680
|
function rt() {
|
|
681
|
-
const i = T(), m = E(), [a, s] = C(""),
|
|
681
|
+
const i = T(), m = E(), [a, s] = C(""), o = (() => {
|
|
682
682
|
try {
|
|
683
683
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
684
684
|
} catch {
|
|
685
685
|
return "UTC";
|
|
686
686
|
}
|
|
687
|
-
})(),
|
|
687
|
+
})(), l = (() => {
|
|
688
688
|
var p;
|
|
689
689
|
try {
|
|
690
690
|
return ((p = Intl.supportedValuesOf) == null ? void 0 : p.call(
|
|
@@ -705,7 +705,7 @@ function rt() {
|
|
|
705
705
|
onSuccess: (p, w) => {
|
|
706
706
|
Ie(w), s(""), m.invalidateQueries({ queryKey: ["nvr-profile-prefs"] });
|
|
707
707
|
}
|
|
708
|
-
}), b = a.length > 1 ?
|
|
708
|
+
}), b = a.length > 1 ? l.filter((p) => p.toLowerCase().includes(a.toLowerCase())).slice(0, 8) : [];
|
|
709
709
|
return /* @__PURE__ */ t(
|
|
710
710
|
"div",
|
|
711
711
|
{
|
|
@@ -716,11 +716,11 @@ function rt() {
|
|
|
716
716
|
/* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
717
717
|
"Dates and times render in this zone. Your browser reports",
|
|
718
718
|
" ",
|
|
719
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
719
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: o }),
|
|
720
720
|
"."
|
|
721
721
|
] }),
|
|
722
722
|
/* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [
|
|
723
|
-
/* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan", children: u ?? `${
|
|
723
|
+
/* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan", children: u ?? `${o} (browser default)` }),
|
|
724
724
|
u && /* @__PURE__ */ e(
|
|
725
725
|
"button",
|
|
726
726
|
{
|
|
@@ -759,9 +759,9 @@ function rt() {
|
|
|
759
759
|
function nt() {
|
|
760
760
|
const i = T(), m = E(), { data: a } = q({
|
|
761
761
|
queryKey: ["nvr-profile-scopes"],
|
|
762
|
-
queryFn: () => i.request(ve()).then((
|
|
762
|
+
queryFn: () => i.request(ve()).then((o) => o.data)
|
|
763
763
|
}), s = _({
|
|
764
|
-
mutationFn: ({ dimension:
|
|
764
|
+
mutationFn: ({ dimension: o, values: l }) => i.request(ke(o, l)),
|
|
765
765
|
onSuccess: () => void m.invalidateQueries({ queryKey: ["nvr-profile-scopes"] })
|
|
766
766
|
});
|
|
767
767
|
return !a || a.dimensions.length === 0 ? null : /* @__PURE__ */ e(
|
|
@@ -771,15 +771,15 @@ function nt() {
|
|
|
771
771
|
icon: /* @__PURE__ */ e(Te, { className: "h-4 w-4" }),
|
|
772
772
|
title: "Default filters",
|
|
773
773
|
hint: "Pre-selected in browsers and reports — clear anytime",
|
|
774
|
-
children: /* @__PURE__ */ e("div", { className: "space-y-3", children: a.dimensions.map((
|
|
774
|
+
children: /* @__PURE__ */ e("div", { className: "space-y-3", children: a.dimensions.map((o) => /* @__PURE__ */ e(
|
|
775
775
|
st,
|
|
776
776
|
{
|
|
777
|
-
dimension:
|
|
778
|
-
selected: a.defaults[
|
|
779
|
-
restricted: a.restricted[
|
|
780
|
-
onSave: (
|
|
777
|
+
dimension: o,
|
|
778
|
+
selected: a.defaults[o.name] ?? [],
|
|
779
|
+
restricted: a.restricted[o.name],
|
|
780
|
+
onSave: (l) => s.mutate({ dimension: o.name, values: l })
|
|
781
781
|
},
|
|
782
|
-
|
|
782
|
+
o.name
|
|
783
783
|
)) })
|
|
784
784
|
}
|
|
785
785
|
);
|
|
@@ -790,31 +790,31 @@ function st({
|
|
|
790
790
|
restricted: a,
|
|
791
791
|
onSave: s
|
|
792
792
|
}) {
|
|
793
|
-
const
|
|
793
|
+
const o = T(), l = i.display_field ?? "name", [c, u] = C(""), [n, b] = C(!1), { data: p = [] } = q({
|
|
794
794
|
queryKey: ["nvr-scope-options", i.name],
|
|
795
|
-
queryFn: async () => ((await
|
|
795
|
+
queryFn: async () => ((await o.request(
|
|
796
796
|
ne(i.target_collection, {
|
|
797
|
-
fields: ["id",
|
|
797
|
+
fields: ["id", l],
|
|
798
798
|
sort: i.options_sort ? [i.options_sort] : void 0,
|
|
799
799
|
limit: 200
|
|
800
800
|
})
|
|
801
801
|
)).data ?? []).map((N) => ({
|
|
802
802
|
id: N.id,
|
|
803
|
-
label: String(N[
|
|
803
|
+
label: String(N[l] ?? N.id)
|
|
804
804
|
}))
|
|
805
805
|
}), w = a != null && a.length ? new Set(a.map(String)) : null, k = w ? p.filter((d) => w.has(String(d.id))) : p, P = new Set(m.map(String)), v = k.length > 24 || p.length >= 200 && !w, { data: O = [], isFetching: L } = q({
|
|
806
806
|
queryKey: ["nvr-scope-search", i.name, c],
|
|
807
807
|
queryFn: async () => {
|
|
808
|
-
const N = ((await
|
|
808
|
+
const N = ((await o.request(
|
|
809
809
|
ne(i.target_collection, {
|
|
810
|
-
fields: ["id",
|
|
811
|
-
filter: { [
|
|
810
|
+
fields: ["id", l],
|
|
811
|
+
filter: { [l]: { _contains: c } },
|
|
812
812
|
sort: i.options_sort ? [i.options_sort] : void 0,
|
|
813
813
|
limit: 30
|
|
814
814
|
})
|
|
815
815
|
)).data ?? []).map((A) => ({
|
|
816
816
|
id: A.id,
|
|
817
|
-
label: String(A[
|
|
817
|
+
label: String(A[l] ?? A.id)
|
|
818
818
|
}));
|
|
819
819
|
return w ? N.filter((A) => w.has(String(A.id))) : N;
|
|
820
820
|
},
|
|
@@ -824,15 +824,15 @@ function st({
|
|
|
824
824
|
for (const d of O) S.set(String(d.id), d.label);
|
|
825
825
|
const f = m.filter((d) => !S.has(String(d))), { data: z = [] } = q({
|
|
826
826
|
queryKey: ["nvr-scope-selected-labels", i.name, f.map(String).sort().join(",")],
|
|
827
|
-
queryFn: async () => ((await
|
|
827
|
+
queryFn: async () => ((await o.request(
|
|
828
828
|
ne(i.target_collection, {
|
|
829
|
-
fields: ["id",
|
|
829
|
+
fields: ["id", l],
|
|
830
830
|
filter: { id: { _in: f } },
|
|
831
831
|
limit: 100
|
|
832
832
|
})
|
|
833
833
|
)).data ?? []).map((N) => ({
|
|
834
834
|
id: N.id,
|
|
835
|
-
label: String(N[
|
|
835
|
+
label: String(N[l] ?? N.id)
|
|
836
836
|
})),
|
|
837
837
|
enabled: f.length > 0
|
|
838
838
|
});
|
|
@@ -947,12 +947,12 @@ function lt() {
|
|
|
947
947
|
queryKey: ["nvr-settings-2fa"],
|
|
948
948
|
queryFn: () => a.request({ _method: "GET", _path: "/settings/" }).then((f) => (f == null ? void 0 : f.data) ?? null).catch(() => null),
|
|
949
949
|
staleTime: 6e5
|
|
950
|
-
}), m = (i == null ? void 0 : i.two_factor_enabled) !== !1, a = T(), s = E(), [
|
|
950
|
+
}), m = (i == null ? void 0 : i.two_factor_enabled) !== !1, a = T(), s = E(), [o, l] = C(null), [c, u] = C(""), [n, b] = C(null), { data: p } = q({
|
|
951
951
|
queryKey: ["nvr-profile-totp"],
|
|
952
952
|
queryFn: () => a.request({ _method: "GET", _path: "/two-factor/status" }).then((f) => f.data)
|
|
953
953
|
}), w = () => void s.invalidateQueries({ queryKey: ["nvr-profile-totp"] }), k = _({
|
|
954
954
|
mutationFn: () => a.request({ _method: "POST", _path: "/two-factor/setup" }).then((f) => f.data),
|
|
955
|
-
onSuccess: (f) =>
|
|
955
|
+
onSuccess: (f) => l(f)
|
|
956
956
|
}), P = _({
|
|
957
957
|
mutationFn: (f) => a.request({
|
|
958
958
|
_method: "POST",
|
|
@@ -960,7 +960,7 @@ function lt() {
|
|
|
960
960
|
_body: { token: f }
|
|
961
961
|
}),
|
|
962
962
|
onSuccess: () => {
|
|
963
|
-
|
|
963
|
+
l(null), u(""), w();
|
|
964
964
|
}
|
|
965
965
|
}), v = _({
|
|
966
966
|
mutationFn: (f) => a.request({
|
|
@@ -1002,7 +1002,7 @@ function lt() {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
] }),
|
|
1005
|
-
!(p != null && p.enabled) && !
|
|
1005
|
+
!(p != null && p.enabled) && !o && /* @__PURE__ */ e(
|
|
1006
1006
|
"button",
|
|
1007
1007
|
{
|
|
1008
1008
|
type: "button",
|
|
@@ -1011,11 +1011,11 @@ function lt() {
|
|
|
1011
1011
|
children: k.isPending ? "Preparing…" : "Set up 2FA"
|
|
1012
1012
|
}
|
|
1013
1013
|
),
|
|
1014
|
-
|
|
1014
|
+
o && /* @__PURE__ */ t("div", { className: "mt-3 flex flex-wrap items-start gap-4", children: [
|
|
1015
1015
|
/* @__PURE__ */ e(
|
|
1016
1016
|
"img",
|
|
1017
1017
|
{
|
|
1018
|
-
src:
|
|
1018
|
+
src: o.qr,
|
|
1019
1019
|
alt: "Scan with your authenticator app",
|
|
1020
1020
|
className: "h-32 w-32 rounded-md border border-slate-200 dark:border-border"
|
|
1021
1021
|
}
|
|
@@ -1129,10 +1129,10 @@ function jt({
|
|
|
1129
1129
|
className: m,
|
|
1130
1130
|
initialTab: a,
|
|
1131
1131
|
extra: s,
|
|
1132
|
-
pushServiceWorker:
|
|
1132
|
+
pushServiceWorker: o = "/sw.js"
|
|
1133
1133
|
}) {
|
|
1134
|
-
const
|
|
1135
|
-
return !i || (
|
|
1134
|
+
const l = xe();
|
|
1135
|
+
return !i || (l == null ? void 0 : l.userId) != null && String(l.userId) === String(i) ? /* @__PURE__ */ e(ot, { className: m, extra: s, pushServiceWorker: o }) : /* @__PURE__ */ e(Je, { userId: i, className: m, initialTab: a });
|
|
1136
1136
|
}
|
|
1137
1137
|
function ot({
|
|
1138
1138
|
className: i,
|
|
@@ -1140,7 +1140,7 @@ function ot({
|
|
|
1140
1140
|
pushServiceWorker: a
|
|
1141
1141
|
}) {
|
|
1142
1142
|
var U;
|
|
1143
|
-
const s = T(),
|
|
1143
|
+
const s = T(), o = E(), l = xe(), c = !0, u = "me", { data: n } = q({
|
|
1144
1144
|
queryKey: ["nvr-profile-user", u],
|
|
1145
1145
|
queryFn: () => s.request(ye(u)).then((d) => d.data),
|
|
1146
1146
|
enabled: c
|
|
@@ -1160,7 +1160,7 @@ function ot({
|
|
|
1160
1160
|
), v = w ?? P, O = JSON.stringify(v) !== JSON.stringify(P), L = _({
|
|
1161
1161
|
mutationFn: () => s.request(ue(n.id, v)),
|
|
1162
1162
|
onSuccess: () => {
|
|
1163
|
-
k(null),
|
|
1163
|
+
k(null), o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
|
|
1164
1164
|
}
|
|
1165
1165
|
}), [S, f] = C(it), z = De(null), I = _({
|
|
1166
1166
|
mutationFn: async (d) => {
|
|
@@ -1181,7 +1181,7 @@ function ot({
|
|
|
1181
1181
|
await s.request(ue(n.id, { avatar: N }));
|
|
1182
1182
|
},
|
|
1183
1183
|
onSuccess: () => {
|
|
1184
|
-
|
|
1184
|
+
o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] }), o.invalidateQueries({ queryKey: ["user-card"] }), o.invalidateQueries({ queryKey: ["user-avatar"] });
|
|
1185
1185
|
}
|
|
1186
1186
|
}), y = p ?? (n ? { ...n, role_name: null } : null);
|
|
1187
1187
|
if (!y)
|
|
@@ -1257,7 +1257,7 @@ function ot({
|
|
|
1257
1257
|
/* @__PURE__ */ e("h1", { className: "text-[21px] font-semibold tracking-[-0.015em] text-slate-900 dark:text-white", children: Ze(y) }),
|
|
1258
1258
|
y.role_name && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-2 py-px text-[10.5px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: y.role_name }),
|
|
1259
1259
|
y.is_out_of_office && /* @__PURE__ */ e("span", { className: "rounded-full bg-amber-50 px-2 py-px text-[10.5px] font-semibold text-amber-600 dark:bg-amber-500/10 dark:text-amber-400", children: "Out of office" }),
|
|
1260
|
-
/* @__PURE__ */ e(He, { email: y.email, canClear:
|
|
1260
|
+
/* @__PURE__ */ e(He, { email: y.email, canClear: l.isAdmin })
|
|
1261
1261
|
] }),
|
|
1262
1262
|
n && // The same status the chat panel's Online tab sets — one editor,
|
|
1263
1263
|
// one preference, so the profile always agrees with the top bar.
|
|
@@ -1412,7 +1412,7 @@ function ot({
|
|
|
1412
1412
|
{
|
|
1413
1413
|
user: n,
|
|
1414
1414
|
onSaved: () => {
|
|
1415
|
-
|
|
1415
|
+
o.invalidateQueries({ queryKey: ["nvr-profile-user"] }), o.invalidateQueries({ queryKey: ["nvr-profile-card"] });
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
1418
|
),
|
|
@@ -1422,7 +1422,7 @@ function ot({
|
|
|
1422
1422
|
/* @__PURE__ */ e(at, {}),
|
|
1423
1423
|
/* @__PURE__ */ e($e, {}),
|
|
1424
1424
|
/* @__PURE__ */ e(Ue, {}),
|
|
1425
|
-
|
|
1425
|
+
l.isAdmin && (n != null && n.id) ? /* @__PURE__ */ e(Ge, { userId: String(n.id) }) : /* @__PURE__ */ e(nt, {}),
|
|
1426
1426
|
/* @__PURE__ */ e(ut, {}),
|
|
1427
1427
|
/* @__PURE__ */ e(Ye, { userId: "me" }),
|
|
1428
1428
|
/* @__PURE__ */ e(mt, {}),
|
|
@@ -1451,11 +1451,11 @@ function dt({
|
|
|
1451
1451
|
tab: i,
|
|
1452
1452
|
onChange: m
|
|
1453
1453
|
}) {
|
|
1454
|
-
const a = (
|
|
1455
|
-
m(
|
|
1454
|
+
const a = (o) => {
|
|
1455
|
+
m(o);
|
|
1456
1456
|
try {
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1457
|
+
const l = new URL(window.location.href);
|
|
1458
|
+
o === "agents" ? l.searchParams.set("tab", "agents") : l.searchParams.delete("tab"), window.history.replaceState(window.history.state, "", l);
|
|
1459
1459
|
} catch {
|
|
1460
1460
|
}
|
|
1461
1461
|
};
|
|
@@ -1468,34 +1468,34 @@ function dt({
|
|
|
1468
1468
|
children: [
|
|
1469
1469
|
["profile", "Profile"],
|
|
1470
1470
|
["agents", "What my agents did"]
|
|
1471
|
-
].map(([
|
|
1471
|
+
].map(([o, l]) => /* @__PURE__ */ e(
|
|
1472
1472
|
"button",
|
|
1473
1473
|
{
|
|
1474
1474
|
type: "button",
|
|
1475
1475
|
role: "tab",
|
|
1476
|
-
"aria-selected": i ===
|
|
1477
|
-
onClick: () => a(
|
|
1476
|
+
"aria-selected": i === o,
|
|
1477
|
+
onClick: () => a(o),
|
|
1478
1478
|
className: $(
|
|
1479
1479
|
"-mb-px border-b-2 px-3 py-2 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40",
|
|
1480
|
-
i ===
|
|
1480
|
+
i === o ? "border-nvr-cyan text-slate-900 dark:text-white" : "border-transparent text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"
|
|
1481
1481
|
),
|
|
1482
|
-
children:
|
|
1482
|
+
children: l
|
|
1483
1483
|
},
|
|
1484
|
-
|
|
1484
|
+
o
|
|
1485
1485
|
))
|
|
1486
1486
|
}
|
|
1487
1487
|
);
|
|
1488
1488
|
}
|
|
1489
1489
|
function ct() {
|
|
1490
|
-
const i = T(), [m, a] = C(!1), { data: s = [], isLoading:
|
|
1490
|
+
const i = T(), [m, a] = C(!1), { data: s = [], isLoading: o } = q({
|
|
1491
1491
|
queryKey: ["my-matrix-seats"],
|
|
1492
1492
|
queryFn: () => i.request(F("/pipelines/my-seats")).then((c) => c.data ?? []).catch(() => []),
|
|
1493
1493
|
enabled: m,
|
|
1494
1494
|
staleTime: 6e4
|
|
1495
|
-
}),
|
|
1495
|
+
}), l = /* @__PURE__ */ new Map();
|
|
1496
1496
|
for (const c of s) {
|
|
1497
|
-
const u =
|
|
1498
|
-
u.push(c),
|
|
1497
|
+
const u = l.get(c.template_name) ?? [];
|
|
1498
|
+
u.push(c), l.set(c.template_name, u);
|
|
1499
1499
|
}
|
|
1500
1500
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
|
|
1501
1501
|
/* @__PURE__ */ t(
|
|
@@ -1513,7 +1513,7 @@ function ct() {
|
|
|
1513
1513
|
]
|
|
1514
1514
|
}
|
|
1515
1515
|
),
|
|
1516
|
-
m && (
|
|
1516
|
+
m && (o ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "Loading…" }) : s.length === 0 ? /* @__PURE__ */ e("p", { className: "mt-3 text-[12.5px] text-slate-400", children: "You're not in any owner groups — approvals never route to you automatically." }) : /* @__PURE__ */ e("div", { className: "mt-3 space-y-3", children: [...l.entries()].map(([c, u]) => /* @__PURE__ */ t("div", { children: [
|
|
1517
1517
|
/* @__PURE__ */ e("p", { className: "text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: c }),
|
|
1518
1518
|
/* @__PURE__ */ t("ul", { className: "mt-1 space-y-0.5", children: [
|
|
1519
1519
|
u.slice(0, 40).map((n) => /* @__PURE__ */ t("li", { className: "text-[12.5px]", children: [
|
|
@@ -1540,10 +1540,10 @@ function ut() {
|
|
|
1540
1540
|
queryKey: ["my-reminders"],
|
|
1541
1541
|
queryFn: () => i.request(F("/reminders")).then((p) => p.data).catch(() => []),
|
|
1542
1542
|
staleTime: 3e4
|
|
1543
|
-
}), [s,
|
|
1544
|
-
mutationFn: () => i.request(ae("/reminders", { note: s, remind_at: new Date(
|
|
1543
|
+
}), [s, o] = C(""), [l, c] = C(""), u = () => void m.invalidateQueries({ queryKey: ["my-reminders"] }), n = _({
|
|
1544
|
+
mutationFn: () => i.request(ae("/reminders", { note: s, remind_at: new Date(l).toISOString() })),
|
|
1545
1545
|
onSuccess: () => {
|
|
1546
|
-
|
|
1546
|
+
o(""), c(""), u();
|
|
1547
1547
|
}
|
|
1548
1548
|
}), b = _({
|
|
1549
1549
|
mutationFn: (p) => i.request(Ee(`/reminders/${p}`)),
|
|
@@ -1576,14 +1576,14 @@ function ut() {
|
|
|
1576
1576
|
{
|
|
1577
1577
|
className: "flex flex-wrap items-center gap-2 pt-1",
|
|
1578
1578
|
onSubmit: (p) => {
|
|
1579
|
-
p.preventDefault(), s.trim() &&
|
|
1579
|
+
p.preventDefault(), s.trim() && l && n.mutate();
|
|
1580
1580
|
},
|
|
1581
1581
|
children: [
|
|
1582
1582
|
/* @__PURE__ */ e(
|
|
1583
1583
|
"input",
|
|
1584
1584
|
{
|
|
1585
1585
|
value: s,
|
|
1586
|
-
onChange: (p) =>
|
|
1586
|
+
onChange: (p) => o(p.target.value),
|
|
1587
1587
|
placeholder: "Remind me to…",
|
|
1588
1588
|
className: "h-7 min-w-[160px] flex-1 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
|
|
1589
1589
|
}
|
|
@@ -1592,7 +1592,7 @@ function ut() {
|
|
|
1592
1592
|
"input",
|
|
1593
1593
|
{
|
|
1594
1594
|
type: "datetime-local",
|
|
1595
|
-
value:
|
|
1595
|
+
value: l,
|
|
1596
1596
|
onChange: (p) => c(p.target.value),
|
|
1597
1597
|
className: "h-7 rounded border border-slate-200 px-2 text-[12px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background"
|
|
1598
1598
|
}
|
|
@@ -1601,7 +1601,7 @@ function ut() {
|
|
|
1601
1601
|
"button",
|
|
1602
1602
|
{
|
|
1603
1603
|
type: "submit",
|
|
1604
|
-
disabled: !s.trim() || !
|
|
1604
|
+
disabled: !s.trim() || !l || n.isPending,
|
|
1605
1605
|
className: "h-7 rounded bg-nvr-cyan px-2.5 text-[11.5px] font-medium text-white hover:bg-nvr-cyan-dark disabled:opacity-50",
|
|
1606
1606
|
children: n.isPending ? "Adding…" : "Add"
|
|
1607
1607
|
}
|
|
@@ -1632,16 +1632,16 @@ function mt() {
|
|
|
1632
1632
|
] })
|
|
1633
1633
|
] }),
|
|
1634
1634
|
/* @__PURE__ */ t("div", { className: "px-4 py-3", children: [
|
|
1635
|
-
/* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: m.weeks.map((s,
|
|
1636
|
-
const
|
|
1635
|
+
/* @__PURE__ */ e("div", { className: "flex items-end gap-1.5", style: { height: 56 }, children: m.weeks.map((s, o) => {
|
|
1636
|
+
const l = s.transitions + s.tasks_done + s.created;
|
|
1637
1637
|
return /* @__PURE__ */ e(
|
|
1638
1638
|
"div",
|
|
1639
1639
|
{
|
|
1640
1640
|
className: "flex-1 rounded-t bg-nvr-cyan/60 transition-all dark:bg-nvr-cyan/40",
|
|
1641
|
-
style: { height: `${Math.max(4,
|
|
1642
|
-
"data-tip": `${
|
|
1641
|
+
style: { height: `${Math.max(4, l / a * 100)}%` },
|
|
1642
|
+
"data-tip": `${l} action${l === 1 ? "" : "s"}: ${s.transitions} transitions, ${s.tasks_done} tasks done, ${s.created} created`
|
|
1643
1643
|
},
|
|
1644
|
-
|
|
1644
|
+
o
|
|
1645
1645
|
);
|
|
1646
1646
|
}) }),
|
|
1647
1647
|
/* @__PURE__ */ t("div", { className: "mt-2 flex items-center justify-between text-[11px] text-slate-400", children: [
|
|
@@ -1671,16 +1671,22 @@ function mt() {
|
|
|
1671
1671
|
function pt() {
|
|
1672
1672
|
const i = T(), m = E(), { data: a } = q({
|
|
1673
1673
|
queryKey: ["my-security"],
|
|
1674
|
-
queryFn: () => i.request(F("/security/my/sessions")).then((
|
|
1674
|
+
queryFn: () => i.request(F("/security/my/sessions")).then((l) => l.data).catch(() => ({ sessions: [], logins: [] })),
|
|
1675
1675
|
staleTime: 3e4
|
|
1676
1676
|
}), s = _({
|
|
1677
|
-
mutationFn: () => i.request(ae("/security/my/sessions/sign-out-others", {})).then((
|
|
1678
|
-
onSuccess: (
|
|
1679
|
-
m.invalidateQueries({ queryKey: ["my-security"] }),
|
|
1677
|
+
mutationFn: () => i.request(ae("/security/my/sessions/sign-out-others", {})).then((l) => l.data),
|
|
1678
|
+
onSuccess: (l) => {
|
|
1679
|
+
m.invalidateQueries({ queryKey: ["my-security"] }), o(`Signed out ${(l == null ? void 0 : l.revoked) ?? 0} other session(s)`);
|
|
1680
|
+
},
|
|
1681
|
+
onError: (l) => {
|
|
1682
|
+
var u, n;
|
|
1683
|
+
const c = ((n = (u = l == null ? void 0 : l.response) == null ? void 0 : u.data) == null ? void 0 : n.error) ?? "Could not sign out your other sessions — try again.";
|
|
1684
|
+
import("sonner").then(({ toast: b }) => b.error(c)).catch(() => {
|
|
1685
|
+
});
|
|
1680
1686
|
}
|
|
1681
|
-
}),
|
|
1687
|
+
}), o = (l) => {
|
|
1682
1688
|
try {
|
|
1683
|
-
import("sonner").then(({ toast: c }) => c.success(
|
|
1689
|
+
import("sonner").then(({ toast: c }) => c.success(l));
|
|
1684
1690
|
} catch {
|
|
1685
1691
|
}
|
|
1686
1692
|
};
|
|
@@ -1707,33 +1713,33 @@ function pt() {
|
|
|
1707
1713
|
(a == null ? void 0 : a.sessions.length) ?? 0,
|
|
1708
1714
|
")"
|
|
1709
1715
|
] }),
|
|
1710
|
-
((a == null ? void 0 : a.sessions) ?? []).map((
|
|
1716
|
+
((a == null ? void 0 : a.sessions) ?? []).map((l) => /* @__PURE__ */ t(
|
|
1711
1717
|
"p",
|
|
1712
1718
|
{
|
|
1713
1719
|
className: "flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300",
|
|
1714
1720
|
children: [
|
|
1715
1721
|
/* @__PURE__ */ t("span", { className: "font-mono text-slate-400", children: [
|
|
1716
|
-
|
|
1722
|
+
l.sid_prefix,
|
|
1717
1723
|
"…"
|
|
1718
1724
|
] }),
|
|
1719
|
-
|
|
1725
|
+
l.current && /* @__PURE__ */ e("span", { className: "rounded bg-nvr-cyan/[0.08] px-1.5 py-px text-[10px] font-medium text-[#007a99] dark:text-nvr-cyan", children: "this session" }),
|
|
1720
1726
|
/* @__PURE__ */ t("span", { className: "ml-auto text-[11px] text-slate-400", children: [
|
|
1721
1727
|
"expires in ",
|
|
1722
|
-
Math.round(
|
|
1728
|
+
Math.round(l.ttl_seconds / 3600),
|
|
1723
1729
|
"h"
|
|
1724
1730
|
] })
|
|
1725
1731
|
]
|
|
1726
1732
|
},
|
|
1727
|
-
|
|
1733
|
+
l.sid_prefix
|
|
1728
1734
|
)),
|
|
1729
1735
|
((a == null ? void 0 : a.logins) ?? []).length > 0 && /* @__PURE__ */ t(oe, { children: [
|
|
1730
1736
|
/* @__PURE__ */ e("p", { className: "pt-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: "Recent sign-ins" }),
|
|
1731
|
-
((a == null ? void 0 : a.logins) ?? []).slice(0, 8).map((
|
|
1737
|
+
((a == null ? void 0 : a.logins) ?? []).slice(0, 8).map((l, c) => (
|
|
1732
1738
|
// biome-ignore lint/suspicious/noArrayIndexKey: log rows
|
|
1733
1739
|
/* @__PURE__ */ t("p", { className: "flex items-center gap-2 text-[11.5px] text-slate-500", children: [
|
|
1734
|
-
/* @__PURE__ */ e("span", { className: "font-mono", children:
|
|
1735
|
-
|
|
1736
|
-
/* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(
|
|
1740
|
+
/* @__PURE__ */ e("span", { className: "font-mono", children: l.ip ?? "—" }),
|
|
1741
|
+
l.new_ip && /* @__PURE__ */ e("span", { className: "rounded bg-amber-100 px-1 text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: "new IP" }),
|
|
1742
|
+
/* @__PURE__ */ e("span", { className: "ml-auto text-slate-400", children: new Date(l.created_at).toLocaleString() })
|
|
1737
1743
|
] }, c)
|
|
1738
1744
|
))
|
|
1739
1745
|
] })
|
|
@@ -1743,7 +1749,7 @@ function pt() {
|
|
|
1743
1749
|
function ht() {
|
|
1744
1750
|
const i = T(), [m, a] = C(!1), { data: s } = q({
|
|
1745
1751
|
queryKey: ["my-permissions"],
|
|
1746
|
-
queryFn: () => i.request(F("/security/my/permissions")).then((
|
|
1752
|
+
queryFn: () => i.request(F("/security/my/permissions")).then((o) => o.data),
|
|
1747
1753
|
enabled: m,
|
|
1748
1754
|
staleTime: 5 * 6e4
|
|
1749
1755
|
});
|
|
@@ -1752,7 +1758,7 @@ function ht() {
|
|
|
1752
1758
|
"button",
|
|
1753
1759
|
{
|
|
1754
1760
|
type: "button",
|
|
1755
|
-
onClick: () => a((
|
|
1761
|
+
onClick: () => a((o) => !o),
|
|
1756
1762
|
className: "flex w-full items-center justify-between px-4 py-2.5 text-left",
|
|
1757
1763
|
children: [
|
|
1758
1764
|
/* @__PURE__ */ t("div", { children: [
|
|
@@ -1773,7 +1779,7 @@ function ht() {
|
|
|
1773
1779
|
s.scopes.length > 0 && /* @__PURE__ */ t("p", { children: [
|
|
1774
1780
|
"Your data is limited to:",
|
|
1775
1781
|
" ",
|
|
1776
|
-
s.scopes.map((
|
|
1782
|
+
s.scopes.map((o) => `${o.dimension}: ${o.values.join(", ")}`).join(" · ")
|
|
1777
1783
|
] }),
|
|
1778
1784
|
!s.is_admin && /* @__PURE__ */ t("div", { children: [
|
|
1779
1785
|
/* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
@@ -1781,16 +1787,16 @@ function ht() {
|
|
|
1781
1787
|
s.collections.length,
|
|
1782
1788
|
")"
|
|
1783
1789
|
] }),
|
|
1784
|
-
/* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: s.collections.map((
|
|
1790
|
+
/* @__PURE__ */ e("div", { className: "max-h-48 overflow-y-auto", children: s.collections.map((o) => /* @__PURE__ */ t(
|
|
1785
1791
|
"p",
|
|
1786
1792
|
{
|
|
1787
1793
|
className: "flex items-center gap-2 border-b border-slate-50 py-0.5 text-[12px] last:border-b-0 dark:border-border/40",
|
|
1788
1794
|
children: [
|
|
1789
|
-
/* @__PURE__ */ e("span", { className: "font-mono", children:
|
|
1790
|
-
/* @__PURE__ */ e("span", { className: "ml-auto text-[10.5px] text-slate-400", children: [...new Set(
|
|
1795
|
+
/* @__PURE__ */ e("span", { className: "font-mono", children: o.collection }),
|
|
1796
|
+
/* @__PURE__ */ e("span", { className: "ml-auto text-[10.5px] text-slate-400", children: [...new Set(o.actions)].join(" · ") })
|
|
1791
1797
|
]
|
|
1792
1798
|
},
|
|
1793
|
-
|
|
1799
|
+
o.collection
|
|
1794
1800
|
)) })
|
|
1795
1801
|
] })
|
|
1796
1802
|
] })
|
|
@@ -1810,7 +1816,7 @@ function bt() {
|
|
|
1810
1816
|
({ toast: b }) => b.success("Saved — applied on all your open tabs and devices")
|
|
1811
1817
|
);
|
|
1812
1818
|
}
|
|
1813
|
-
}),
|
|
1819
|
+
}), o = (a == null ? void 0 : a.number_format) ?? {}, { data: l = [se, ...he] } = q({
|
|
1814
1820
|
queryKey: ["nvr-theme-accents"],
|
|
1815
1821
|
queryFn: () => i.request(
|
|
1816
1822
|
F("/settings")
|
|
@@ -1853,8 +1859,8 @@ function bt() {
|
|
|
1853
1859
|
"input",
|
|
1854
1860
|
{
|
|
1855
1861
|
type: "checkbox",
|
|
1856
|
-
checked:
|
|
1857
|
-
onChange: (u) => s.mutate({ number_format: { ...
|
|
1862
|
+
checked: o.compact === !0,
|
|
1863
|
+
onChange: (u) => s.mutate({ number_format: { ...o, compact: u.target.checked } }),
|
|
1858
1864
|
className: "rounded"
|
|
1859
1865
|
}
|
|
1860
1866
|
),
|
|
@@ -1865,8 +1871,8 @@ function bt() {
|
|
|
1865
1871
|
/* @__PURE__ */ e(
|
|
1866
1872
|
"input",
|
|
1867
1873
|
{
|
|
1868
|
-
defaultValue:
|
|
1869
|
-
onBlur: (u) => s.mutate({ number_format: { ...
|
|
1874
|
+
defaultValue: o.locale ?? "",
|
|
1875
|
+
onBlur: (u) => s.mutate({ number_format: { ...o, locale: u.target.value.trim() || void 0 } }),
|
|
1870
1876
|
placeholder: "en-US",
|
|
1871
1877
|
className: "h-7 w-20 rounded-md border border-slate-200 bg-background px-1.5 text-[12px] dark:border-border"
|
|
1872
1878
|
}
|
|
@@ -1888,7 +1894,7 @@ function bt() {
|
|
|
1888
1894
|
] }),
|
|
1889
1895
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", "data-theme-accent-picker": !0, children: [
|
|
1890
1896
|
"Accent",
|
|
1891
|
-
/* @__PURE__ */ e("span", { className: "flex items-center gap-1", children:
|
|
1897
|
+
/* @__PURE__ */ e("span", { className: "flex items-center gap-1", children: l.map((u) => {
|
|
1892
1898
|
const n = u.key === "brand" && c === "brand" || u.key === c;
|
|
1893
1899
|
return /* @__PURE__ */ e(
|
|
1894
1900
|
"button",
|