@nivaro/react 0.3.102 → 0.3.104
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 +4 -2
- package/dist/shared/components/CollectionBrowserView.js +1 -1
- package/dist/shared/components/ItemEditForm.js +2867 -2845
- package/dist/shared/components/imports/CollectionImportPanel.js +483 -459
- package/dist/shared/components/integrations/IntegrationStatusLines.js +71 -68
- package/dist/shared/components/item-edit/UserChip.js +38 -38
- package/dist/shared/components/layout-editor/DesignNode.js +16 -14
- package/dist/shared/components/layout-editor/LayoutEditor.js +445 -441
- package/dist/shared/components/layout-editor/inspector/Inspector.js +18 -18
- package/dist/shared/components/layout-editor/inspector/SlotInspector.js +80 -52
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/ButtonsSection.js +54 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +23 -15
- package/dist/shared/components/layout-editor/useLayoutDraft.js +211 -196
- package/dist/shared/components/panels/ExternalRequestsChip.js +141 -122
- package/dist/shared/lib/entry-config.js +7 -7
- package/dist/shared/lib/integration-chip.js +10 -6
- package/dist/shared/lib/owners-header-tile.js +63 -0
- package/package.json +1 -1
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as V, useQueryClient as w, useMutation as B } from "@tanstack/react-query";
|
|
3
3
|
import { RotateCcw as F, RefreshCw as v, Eye as L, Loader2 as Q, Send as T } from "lucide-react";
|
|
4
4
|
import { useState as A } from "react";
|
|
5
5
|
import { toast as y } from "sonner";
|
|
6
6
|
import { useNivaroClient as S } from "../../context.js";
|
|
7
|
-
import { get as
|
|
8
|
-
import { bannerLines as
|
|
9
|
-
import { requestTransitionRun as
|
|
7
|
+
import { get as I, post as K } from "../../lib/commands.js";
|
|
8
|
+
import { bannerLines as P } from "../../lib/obligation-banner.js";
|
|
9
|
+
import { requestTransitionRun as D } from "../../lib/run-transition.js";
|
|
10
10
|
import { cn as f } from "../../lib/utils.js";
|
|
11
|
-
import { colorPair as
|
|
11
|
+
import { colorPair as E } from "../QueryTable.js";
|
|
12
12
|
import { roleForTone as O } from "./IntegrationObligationsView.js";
|
|
13
13
|
import { SendCurrentDataButton as M } from "./SendCurrentData.js";
|
|
14
14
|
function U({
|
|
15
15
|
obligationId: d,
|
|
16
16
|
collection: i,
|
|
17
17
|
itemId: m,
|
|
18
|
-
enabled:
|
|
18
|
+
enabled: r = !0
|
|
19
19
|
}) {
|
|
20
|
-
const e = S(), b = w(), [
|
|
20
|
+
const e = S(), b = w(), [t, c] = A(!1), l = B({
|
|
21
21
|
mutationFn: () => e.request(
|
|
22
|
-
|
|
22
|
+
K(`/integration-obligations/${d}/send`)
|
|
23
23
|
),
|
|
24
|
-
onSuccess: (
|
|
24
|
+
onSuccess: (s) => {
|
|
25
25
|
var a;
|
|
26
|
-
y.message(((a =
|
|
26
|
+
y.message(((a = s == null ? void 0 : s.data) == null ? void 0 : a.detail) ?? "Sent"), b.invalidateQueries({
|
|
27
27
|
queryKey: ["integration-obligations", "record", i, String(m)]
|
|
28
28
|
});
|
|
29
29
|
},
|
|
30
|
-
onError: (
|
|
31
|
-
const a =
|
|
30
|
+
onError: (s) => {
|
|
31
|
+
const a = s == null ? void 0 : s.response;
|
|
32
32
|
y.error((a == null ? void 0 : a.error) ?? "Send now failed", { duration: 8e3 });
|
|
33
33
|
},
|
|
34
34
|
onSettled: () => c(!1)
|
|
@@ -38,33 +38,33 @@ function U({
|
|
|
38
38
|
{
|
|
39
39
|
type: "button",
|
|
40
40
|
"data-obligation-send-now": !0,
|
|
41
|
-
"data-obligation-send-now-enabled":
|
|
42
|
-
disabled:
|
|
43
|
-
title:
|
|
41
|
+
"data-obligation-send-now-enabled": r,
|
|
42
|
+
disabled: l.isPending || !r,
|
|
43
|
+
title: r ? "Send the stored request again, unchanged (admins)" : "Remediation is off for this deployment — an admin turns it on under Integrations › Remediation, then this sends from here",
|
|
44
44
|
onClick: () => {
|
|
45
|
-
if (!
|
|
45
|
+
if (!t) {
|
|
46
46
|
c(!0);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
l.mutate();
|
|
50
50
|
},
|
|
51
51
|
className: f(
|
|
52
52
|
"inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors disabled:opacity-60",
|
|
53
|
-
|
|
53
|
+
t ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan dark:border-nvr-cyan dark:bg-nvr-cyan/15" : "border-slate-200 text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted"
|
|
54
54
|
),
|
|
55
55
|
children: [
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
l.isPending ? /* @__PURE__ */ o(Q, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ o(T, { className: "h-3 w-3" }),
|
|
57
|
+
t ? "Confirm send?" : "Send now"
|
|
58
58
|
]
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
function ae(d, i) {
|
|
63
|
-
var e, b;
|
|
64
|
-
const m = S(),
|
|
63
|
+
var e, b, t;
|
|
64
|
+
const m = S(), r = V({
|
|
65
65
|
queryKey: ["integration-obligations", "record", d, String(i)],
|
|
66
66
|
queryFn: () => m.request(
|
|
67
|
-
|
|
67
|
+
I(`/integration-obligations/record/${d}/${encodeURIComponent(String(i))}`)
|
|
68
68
|
),
|
|
69
69
|
enabled: !!d && !!i,
|
|
70
70
|
staleTime: 3e4,
|
|
@@ -73,9 +73,12 @@ function ae(d, i) {
|
|
|
73
73
|
retry: !1
|
|
74
74
|
});
|
|
75
75
|
return {
|
|
76
|
-
...
|
|
77
|
-
lines:
|
|
78
|
-
remediationEnabled: ((b =
|
|
76
|
+
...r,
|
|
77
|
+
lines: P(((e = r.data) == null ? void 0 : e.data) ?? []),
|
|
78
|
+
remediationEnabled: ((b = r.data) == null ? void 0 : b.remediation_enabled) === !0,
|
|
79
|
+
/** Obligation rows on the record (null until answered). */
|
|
80
|
+
obligationCount: r.data ? (r.data.data ?? []).length : null,
|
|
81
|
+
partnerIntegration: (t = r.data) == null ? void 0 : t.partner_integration
|
|
79
82
|
};
|
|
80
83
|
}
|
|
81
84
|
const h = "inline-flex shrink-0 items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10.5px] font-medium text-slate-600 transition-colors hover:border-slate-300 hover:bg-slate-50 disabled:opacity-60 dark:border-border dark:text-muted-foreground dark:hover:bg-muted";
|
|
@@ -83,20 +86,20 @@ function de({
|
|
|
83
86
|
collection: d,
|
|
84
87
|
itemId: i,
|
|
85
88
|
lines: m,
|
|
86
|
-
remediationEnabled:
|
|
89
|
+
remediationEnabled: r,
|
|
87
90
|
actions: e
|
|
88
91
|
}) {
|
|
89
92
|
const b = w();
|
|
90
|
-
return m.length === 0 ? null : /* @__PURE__ */
|
|
93
|
+
return m.length === 0 ? null : /* @__PURE__ */ o("div", { className: "space-y-1.5", "data-integration-lines": !0, children: m.map((t) => {
|
|
91
94
|
var k;
|
|
92
|
-
const c = O(
|
|
95
|
+
const c = O(t.tone), [l, s] = c ? E(c) : [null, null], a = t.outcome === "failed" || t.outcome === "missing" || t.outcome === "overdue", C = a && t.can_resend !== !1, N = a && t.can_send_current === !0, g = (k = e == null ? void 0 : e.newestSubmissionByApi) == null ? void 0 : k.get(t.api.toLowerCase()), p = t.submission_id ?? (g == null ? void 0 : g.id) ?? null, _ = !!(e != null && e.onRetry) && p != null && (t.outcome === "failed" || (g == null ? void 0 : g.status) === "failed"), q = !!(e != null && e.onView) && p != null, R = !!t.transition_id && !!t.transition_label && a, $ = !!(e != null && e.onCheck) && (t.outcome === "pending" || t.outcome === "overdue"), j = () => {
|
|
93
96
|
var x;
|
|
94
|
-
if (!
|
|
97
|
+
if (!D({
|
|
95
98
|
collection: d,
|
|
96
99
|
item: String(i),
|
|
97
|
-
transition_id:
|
|
100
|
+
transition_id: t.transition_id
|
|
98
101
|
})) {
|
|
99
|
-
y.error(`Open the record to run “${
|
|
102
|
+
y.error(`Open the record to run “${t.transition_label}”`);
|
|
100
103
|
return;
|
|
101
104
|
}
|
|
102
105
|
(x = e == null ? void 0 : e.onRanTransition) == null || x.call(e);
|
|
@@ -104,68 +107,68 @@ function de({
|
|
|
104
107
|
return /* @__PURE__ */ u(
|
|
105
108
|
"div",
|
|
106
109
|
{
|
|
107
|
-
"data-integration-line":
|
|
108
|
-
"data-integration-outcome":
|
|
109
|
-
style:
|
|
110
|
+
"data-integration-line": t.api,
|
|
111
|
+
"data-integration-outcome": t.outcome,
|
|
112
|
+
style: l ? { "--obt": l, "--obtd": s } : void 0,
|
|
110
113
|
className: f(
|
|
111
114
|
"flex items-start gap-2 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-[12px] dark:border-border dark:bg-card",
|
|
112
|
-
|
|
115
|
+
l && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]"
|
|
113
116
|
),
|
|
114
117
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ o(
|
|
116
119
|
"span",
|
|
117
120
|
{
|
|
118
121
|
"aria-hidden": !0,
|
|
119
122
|
className: f(
|
|
120
123
|
"mt-1 h-1.5 w-1.5 shrink-0 rounded-full",
|
|
121
|
-
|
|
124
|
+
l ? "bg-[color:var(--obt)] dark:bg-[color:var(--obtd)]" : "bg-slate-400 dark:bg-slate-600"
|
|
122
125
|
)
|
|
123
126
|
}
|
|
124
127
|
),
|
|
125
128
|
/* @__PURE__ */ u("p", { className: "min-w-0 flex-1 leading-5 text-slate-700 dark:text-slate-200", children: [
|
|
126
129
|
/* @__PURE__ */ u("span", { className: "font-semibold text-slate-800 dark:text-foreground", children: [
|
|
127
|
-
|
|
130
|
+
t.api,
|
|
128
131
|
":"
|
|
129
132
|
] }),
|
|
130
133
|
" ",
|
|
131
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ o(
|
|
132
135
|
"span",
|
|
133
136
|
{
|
|
134
137
|
"data-integration-reason": !0,
|
|
135
|
-
className:
|
|
136
|
-
children:
|
|
138
|
+
className: l ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-500 dark:text-muted-foreground",
|
|
139
|
+
children: t.text
|
|
137
140
|
}
|
|
138
141
|
)
|
|
139
142
|
] }),
|
|
140
143
|
/* @__PURE__ */ u("span", { className: "ml-auto flex shrink-0 flex-wrap items-center justify-end gap-1", children: [
|
|
141
|
-
|
|
144
|
+
R && /* @__PURE__ */ u(
|
|
142
145
|
"button",
|
|
143
146
|
{
|
|
144
147
|
type: "button",
|
|
145
148
|
"data-integration-action": "rerun",
|
|
146
149
|
onClick: j,
|
|
147
|
-
title: `Fix what ${
|
|
150
|
+
title: `Fix what ${t.api} rejected, then run “${t.transition_label}” again — it re-sends from the current values`,
|
|
148
151
|
className: f(h, "border-nvr-cyan/40 text-nvr-cyan hover:bg-nvr-cyan/10"),
|
|
149
152
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ o(F, { className: "h-3 w-3" }),
|
|
151
154
|
"Re-run ",
|
|
152
|
-
|
|
155
|
+
t.transition_label
|
|
153
156
|
]
|
|
154
157
|
}
|
|
155
158
|
),
|
|
156
|
-
|
|
159
|
+
_ && /* @__PURE__ */ u(
|
|
157
160
|
"button",
|
|
158
161
|
{
|
|
159
162
|
type: "button",
|
|
160
163
|
"data-integration-action": "retry",
|
|
161
164
|
onClick: () => {
|
|
162
|
-
var
|
|
163
|
-
return (
|
|
165
|
+
var n;
|
|
166
|
+
return (n = e == null ? void 0 : e.onRetry) == null ? void 0 : n.call(e, p);
|
|
164
167
|
},
|
|
165
168
|
title: "Send the same request again, unchanged — for a partner that was down, not for data it rejected",
|
|
166
169
|
className: h,
|
|
167
170
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ o(v, { className: "h-3 w-3" }),
|
|
169
172
|
"Retry"
|
|
170
173
|
]
|
|
171
174
|
}
|
|
@@ -176,61 +179,61 @@ function de({
|
|
|
176
179
|
type: "button",
|
|
177
180
|
"data-integration-action": "check",
|
|
178
181
|
onClick: () => {
|
|
179
|
-
var
|
|
180
|
-
return (
|
|
182
|
+
var n;
|
|
183
|
+
return (n = e == null ? void 0 : e.onCheck) == null ? void 0 : n.call(e);
|
|
181
184
|
},
|
|
182
185
|
title: "Ask again whether the partner has acknowledged it",
|
|
183
186
|
className: h,
|
|
184
187
|
children: [
|
|
185
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ o(v, { className: "h-3 w-3" }),
|
|
186
189
|
"Check now"
|
|
187
190
|
]
|
|
188
191
|
}
|
|
189
192
|
),
|
|
190
|
-
|
|
193
|
+
q && /* @__PURE__ */ u(
|
|
191
194
|
"button",
|
|
192
195
|
{
|
|
193
196
|
type: "button",
|
|
194
197
|
"data-integration-action": "view",
|
|
195
198
|
onClick: () => {
|
|
196
|
-
var
|
|
197
|
-
return (
|
|
199
|
+
var n;
|
|
200
|
+
return (n = e == null ? void 0 : e.onView) == null ? void 0 : n.call(e, p);
|
|
198
201
|
},
|
|
199
202
|
title: "Show the request and the reply",
|
|
200
203
|
className: h,
|
|
201
204
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
|
|
205
|
+
/* @__PURE__ */ o(L, { className: "h-3 w-3" }),
|
|
206
|
+
t.outcome === "failed" ? "View error" : "View request"
|
|
204
207
|
]
|
|
205
208
|
}
|
|
206
209
|
),
|
|
207
|
-
|
|
210
|
+
C && /* @__PURE__ */ o(
|
|
208
211
|
U,
|
|
209
212
|
{
|
|
210
|
-
obligationId:
|
|
213
|
+
obligationId: t.obligation_id,
|
|
211
214
|
collection: d,
|
|
212
215
|
itemId: i,
|
|
213
|
-
enabled:
|
|
216
|
+
enabled: r
|
|
214
217
|
}
|
|
215
218
|
),
|
|
216
|
-
|
|
219
|
+
N && /* @__PURE__ */ o(
|
|
217
220
|
M,
|
|
218
221
|
{
|
|
219
|
-
obligationId:
|
|
220
|
-
api:
|
|
221
|
-
enabled:
|
|
222
|
+
obligationId: t.obligation_id,
|
|
223
|
+
api: t.api,
|
|
224
|
+
enabled: r,
|
|
222
225
|
onSent: () => {
|
|
223
|
-
var
|
|
226
|
+
var n;
|
|
224
227
|
b.invalidateQueries({
|
|
225
228
|
queryKey: ["integration-obligations", "record", d, String(i)]
|
|
226
|
-
}), (
|
|
229
|
+
}), (n = e == null ? void 0 : e.onCheck) == null || n.call(e);
|
|
227
230
|
}
|
|
228
231
|
}
|
|
229
232
|
)
|
|
230
233
|
] })
|
|
231
234
|
]
|
|
232
235
|
},
|
|
233
|
-
|
|
236
|
+
t.api
|
|
234
237
|
);
|
|
235
238
|
}) });
|
|
236
239
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as _ } from "@tanstack/react-query";
|
|
3
3
|
import { UserCheck as q, Mail as D, Phone as F, Building2 as z, User as O, Clock as K, MessageCircle as W, ExternalLink as H, RefreshCw as J, LogOut as Z } from "lucide-react";
|
|
4
|
-
import R, { useState as S, useRef as C, useEffect as
|
|
4
|
+
import R, { useState as S, useRef as C, useEffect as $ } from "react";
|
|
5
5
|
import { createPortal as G } from "react-dom";
|
|
6
6
|
import { useOptionalNivaroClient as M, useNavigation as V, useItemEditAuth as X } from "../../context.js";
|
|
7
|
-
import { get as
|
|
8
|
-
import { userCardQuery as
|
|
7
|
+
import { get as B, post as Y } from "../../lib/commands.js";
|
|
8
|
+
import { userCardQuery as L } from "../../lib/user-cards.js";
|
|
9
9
|
import { cn as P } from "../../lib/utils.js";
|
|
10
10
|
import { canOpenDm as I, openDmWith as A } from "../chat/chat-core.js";
|
|
11
11
|
import { HuddlePresenceLine as Q } from "../chat/huddle/HuddleLiveBadge.js";
|
|
@@ -20,7 +20,7 @@ function E(e, n, i) {
|
|
|
20
20
|
const s = C(n);
|
|
21
21
|
s.current = n;
|
|
22
22
|
const d = C(i);
|
|
23
|
-
d.current = i,
|
|
23
|
+
d.current = i, $(() => {
|
|
24
24
|
if (!e) return;
|
|
25
25
|
const o = (r) => {
|
|
26
26
|
const p = r.target;
|
|
@@ -44,7 +44,7 @@ function pe({
|
|
|
44
44
|
avatarCls: n
|
|
45
45
|
}) {
|
|
46
46
|
const i = M(), { data: s } = _({
|
|
47
|
-
...
|
|
47
|
+
...L(i, e.id),
|
|
48
48
|
enabled: !!i && !!e.id && !String(e.name ?? "").trim(),
|
|
49
49
|
staleTime: 30 * 6e4,
|
|
50
50
|
retry: !1
|
|
@@ -75,13 +75,13 @@ function xe({
|
|
|
75
75
|
showSingleName: n = !0,
|
|
76
76
|
nameLabel: i = !1
|
|
77
77
|
}) {
|
|
78
|
-
const s = C(null), d = C(null), o = C(null), [m, r] = S(null), [p,
|
|
78
|
+
const s = C(null), d = C(null), o = C(null), [m, r] = S(null), [p, b] = S({ x: 0, y: 0 }), h = () => {
|
|
79
79
|
o.current && clearTimeout(o.current), o.current = null;
|
|
80
80
|
}, k = (a) => {
|
|
81
|
-
var
|
|
81
|
+
var g;
|
|
82
82
|
h();
|
|
83
|
-
const f = (
|
|
84
|
-
f &&
|
|
83
|
+
const f = (g = s.current) == null ? void 0 : g.getBoundingClientRect();
|
|
84
|
+
f && b({ x: f.left, y: f.bottom + 6 }), r((x) => x === "pin" ? "pin" : a);
|
|
85
85
|
}, c = () => {
|
|
86
86
|
h(), o.current = setTimeout(() => r((a) => a === "pin" ? a : null), 160);
|
|
87
87
|
};
|
|
@@ -91,20 +91,20 @@ function xe({
|
|
|
91
91
|
const a = d.current;
|
|
92
92
|
if (!a) return;
|
|
93
93
|
const f = a.getBoundingClientRect();
|
|
94
|
-
let { x:
|
|
95
|
-
if (f.right > window.innerWidth - 8 && (
|
|
94
|
+
let { x: g, y: x } = p;
|
|
95
|
+
if (f.right > window.innerWidth - 8 && (g = Math.max(8, window.innerWidth - f.width - 8)), f.bottom > window.innerHeight - 8) {
|
|
96
96
|
const y = (u = s.current) == null ? void 0 : u.getBoundingClientRect();
|
|
97
97
|
x = Math.max(8, ((y == null ? void 0 : y.top) ?? x) - f.height - 6);
|
|
98
98
|
}
|
|
99
|
-
(
|
|
99
|
+
(g !== p.x || x !== p.y) && b({ x: g, y: x });
|
|
100
100
|
}, [m, p]), E(
|
|
101
101
|
!!m,
|
|
102
102
|
(a) => {
|
|
103
|
-
var f,
|
|
103
|
+
var f, g, x;
|
|
104
104
|
return (
|
|
105
105
|
// Clicks inside the user-card popover (portaled by Radix) keep the
|
|
106
106
|
// roster mounted — closing would unmount the card mid-click.
|
|
107
|
-
!!((f = a.closest) != null && f.call(a, "[data-radix-popper-content-wrapper]")) || !!((
|
|
107
|
+
!!((f = a.closest) != null && f.call(a, "[data-radix-popper-content-wrapper]")) || !!((g = d.current) != null && g.contains(a)) || !!((x = s.current) != null && x.contains(a))
|
|
108
108
|
);
|
|
109
109
|
},
|
|
110
110
|
() => r(null)
|
|
@@ -122,7 +122,7 @@ function xe({
|
|
|
122
122
|
},
|
|
123
123
|
className: "inline-flex cursor-pointer items-center",
|
|
124
124
|
children: [
|
|
125
|
-
/* @__PURE__ */ t("span", { className: "flex -space-x-2", children: w.map((a) => /* @__PURE__ */ t(pe, { user: a, avatarCls: N }, a.id)) }),
|
|
125
|
+
/* @__PURE__ */ t("span", { className: i ? "flex -space-x-1" : "flex -space-x-2", children: w.map((a) => /* @__PURE__ */ t(pe, { user: a, avatarCls: N }, a.id)) }),
|
|
126
126
|
v > 0 && /* @__PURE__ */ l("span", { className: "ml-1 rounded-full bg-slate-200 px-1.5 py-0.5 text-[10.5px] font-bold leading-none text-slate-600 dark:bg-slate-700 dark:text-slate-300", children: [
|
|
127
127
|
"+",
|
|
128
128
|
v
|
|
@@ -133,11 +133,11 @@ function xe({
|
|
|
133
133
|
"span",
|
|
134
134
|
{
|
|
135
135
|
"data-roster-label": "",
|
|
136
|
-
className: "ml-1.5 inline-flex max-w-[170px] items-baseline gap-1 text-[
|
|
136
|
+
className: "ml-1.5 inline-flex max-w-[170px] items-baseline gap-1 text-[13px] font-semibold leading-tight text-slate-900 dark:text-slate-100",
|
|
137
137
|
children: [
|
|
138
138
|
/* @__PURE__ */ t("span", { className: "truncate", children: a.name }),
|
|
139
139
|
a.mark && /* @__PURE__ */ t(T, { mark: a.mark }),
|
|
140
|
-
a.more > 0 && /* @__PURE__ */ l("span", { className: "shrink-0 text-slate-500 dark:text-slate-400", children: [
|
|
140
|
+
a.more > 0 && /* @__PURE__ */ l("span", { className: "shrink-0 font-normal text-slate-500 dark:text-slate-400", children: [
|
|
141
141
|
"+",
|
|
142
142
|
a.more
|
|
143
143
|
] })
|
|
@@ -225,7 +225,7 @@ function qe({
|
|
|
225
225
|
}) {
|
|
226
226
|
const s = M(), { data: d = [] } = _({
|
|
227
227
|
queryKey: ["pipeline-instance-owners", e, n],
|
|
228
|
-
queryFn: () => s.request(
|
|
228
|
+
queryFn: () => s.request(B(`/pipelines/instance/${e}/${n}/owners`)).then((r) => r.data ?? []),
|
|
229
229
|
enabled: !!s && !!e && !!n && n !== "new",
|
|
230
230
|
staleTime: 3e4
|
|
231
231
|
}), o = (r) => [r.first_name, r.last_name].filter(Boolean).join(" ") || r.email, m = (r) => o(r).split(" ").map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
@@ -251,7 +251,7 @@ function qe({
|
|
|
251
251
|
)) })
|
|
252
252
|
] });
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function ge({
|
|
255
255
|
user: e,
|
|
256
256
|
userId: n,
|
|
257
257
|
initials: i,
|
|
@@ -262,8 +262,8 @@ function be({
|
|
|
262
262
|
onAction: r,
|
|
263
263
|
open: p = !1
|
|
264
264
|
}) {
|
|
265
|
-
var
|
|
266
|
-
const { isAdmin:
|
|
265
|
+
var g;
|
|
266
|
+
const { isAdmin: b, userId: h } = X(), k = !!h && h.toUpperCase() === n.toUpperCase(), c = se(n, p), w = ee().roomOf(n), v = ((g = e == null ? void 0 : e.manager_name) == null ? void 0 : g.trim()) || null, N = (() => {
|
|
267
267
|
const x = e == null ? void 0 : e.timezone;
|
|
268
268
|
if (!x) return null;
|
|
269
269
|
try {
|
|
@@ -347,7 +347,7 @@ function be({
|
|
|
347
347
|
{
|
|
348
348
|
email: e == null ? void 0 : e.email,
|
|
349
349
|
enabled: p,
|
|
350
|
-
canClear:
|
|
350
|
+
canClear: b,
|
|
351
351
|
className: "mt-1"
|
|
352
352
|
}
|
|
353
353
|
)
|
|
@@ -445,8 +445,8 @@ function be({
|
|
|
445
445
|
}
|
|
446
446
|
)
|
|
447
447
|
] }),
|
|
448
|
-
|
|
449
|
-
|
|
448
|
+
b && !k && /* @__PURE__ */ t(
|
|
449
|
+
be,
|
|
450
450
|
{
|
|
451
451
|
userId: n,
|
|
452
452
|
name: e ? [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email : n,
|
|
@@ -457,18 +457,18 @@ function be({
|
|
|
457
457
|
}
|
|
458
458
|
);
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function be({
|
|
461
461
|
userId: e,
|
|
462
462
|
name: n,
|
|
463
463
|
onDone: i
|
|
464
464
|
}) {
|
|
465
465
|
const [s, d] = S(!1), [o, m] = S("");
|
|
466
|
-
|
|
466
|
+
$(() => {
|
|
467
467
|
if (!s || o.trim()) return;
|
|
468
468
|
const k = setTimeout(() => d(!1), ne);
|
|
469
469
|
return () => clearTimeout(k);
|
|
470
470
|
}, [s, o]);
|
|
471
|
-
const r = re(e, { onDone: i }), p = le(e, n, { onDone: i }),
|
|
471
|
+
const r = re(e, { onDone: i }), p = le(e, n, { onDone: i }), b = () => p.mutate({ message: o }), h = "flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] font-medium transition-colors disabled:opacity-50";
|
|
472
472
|
return /* @__PURE__ */ l("div", { className: "border-t border-slate-100 p-2 dark:border-border", "data-user-card-admin": !0, children: [
|
|
473
473
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
|
|
474
474
|
/* @__PURE__ */ l(
|
|
@@ -494,7 +494,7 @@ function ge({
|
|
|
494
494
|
{
|
|
495
495
|
type: "button",
|
|
496
496
|
disabled: p.isPending,
|
|
497
|
-
onClick: () => s ?
|
|
497
|
+
onClick: () => s ? b() : d(!0),
|
|
498
498
|
"data-tip": s ? "Click again to sign them out of every session" : "Ends every session they have, on every app — they can sign in again",
|
|
499
499
|
className: P(
|
|
500
500
|
h,
|
|
@@ -513,7 +513,7 @@ function ge({
|
|
|
513
513
|
{
|
|
514
514
|
value: o,
|
|
515
515
|
onChange: m,
|
|
516
|
-
onSubmit:
|
|
516
|
+
onSubmit: b,
|
|
517
517
|
className: "mt-2"
|
|
518
518
|
}
|
|
519
519
|
)
|
|
@@ -524,23 +524,23 @@ function ue({
|
|
|
524
524
|
size: n = "default",
|
|
525
525
|
children: i
|
|
526
526
|
}) {
|
|
527
|
-
const s = M(), { navigate: d, userUrl: o } = V(), m = o ? o(e) : `/users/${e}`, [r, p] = S(!1),
|
|
527
|
+
const s = M(), { navigate: d, userUrl: o } = V(), m = o ? o(e) : `/users/${e}`, [r, p] = S(!1), b = R.useId();
|
|
528
528
|
E(
|
|
529
529
|
r,
|
|
530
530
|
(a) => {
|
|
531
|
-
var f,
|
|
532
|
-
return !!((f = a.closest) != null && f.call(a, `[data-nvr-user-card="${CSS.escape(
|
|
531
|
+
var f, g, x, u;
|
|
532
|
+
return !!((f = a.closest) != null && f.call(a, `[data-nvr-user-card="${CSS.escape(b)}"]`)) || !!((g = a.closest) != null && g.call(a, `[data-nvr-user-chip="${CSS.escape(b)}"]`)) || // Anything else floating above the card (a tooltip, a nested menu).
|
|
533
533
|
!!((x = a.closest) != null && x.call(a, "[data-radix-popper-content-wrapper]")) && !((u = a.closest) != null && u.call(a, "[data-nvr-user-card]"));
|
|
534
534
|
},
|
|
535
535
|
() => p(!1)
|
|
536
536
|
);
|
|
537
537
|
const { data: h, isLoading: k } = _({
|
|
538
|
-
...
|
|
538
|
+
...L(s, e),
|
|
539
539
|
enabled: !!s && !!e,
|
|
540
540
|
staleTime: 12e4
|
|
541
541
|
}), { data: c } = _({
|
|
542
542
|
queryKey: ["user-presence", e],
|
|
543
|
-
queryFn: () => s.request(
|
|
543
|
+
queryFn: () => s.request(B(`/presence/users/${e}`)).then((a) => a),
|
|
544
544
|
enabled: !!s && !!e && r,
|
|
545
545
|
staleTime: 15e3,
|
|
546
546
|
refetchInterval: r ? 2e4 : !1
|
|
@@ -549,7 +549,7 @@ function ue({
|
|
|
549
549
|
/* @__PURE__ */ t("span", { className: "flex h-6 w-6 shrink-0 rounded-full animate-pulse bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
550
550
|
/* @__PURE__ */ t("span", { className: "animate-pulse h-2.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" })
|
|
551
551
|
] }) : /* @__PURE__ */ l(ie, { open: r, onOpenChange: p, children: [
|
|
552
|
-
/* @__PURE__ */ t(oe, { asChild: !0, "data-nvr-user-chip":
|
|
552
|
+
/* @__PURE__ */ t(oe, { asChild: !0, "data-nvr-user-chip": b, children: i || (n === "compact" ? /* @__PURE__ */ l("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 dark:bg-slate-800 py-px pl-px pr-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors", children: [
|
|
553
553
|
/* @__PURE__ */ t(
|
|
554
554
|
j,
|
|
555
555
|
{
|
|
@@ -587,7 +587,7 @@ function ue({
|
|
|
587
587
|
/* @__PURE__ */ t("span", { className: "text-[12px] text-slate-700 dark:text-slate-300", children: w })
|
|
588
588
|
] })) }),
|
|
589
589
|
/* @__PURE__ */ t(
|
|
590
|
-
|
|
590
|
+
ge,
|
|
591
591
|
{
|
|
592
592
|
user: h,
|
|
593
593
|
userId: e,
|
|
@@ -595,7 +595,7 @@ function ue({
|
|
|
595
595
|
navigate: d,
|
|
596
596
|
profileUrl: m,
|
|
597
597
|
online: N,
|
|
598
|
-
cardId:
|
|
598
|
+
cardId: b,
|
|
599
599
|
onAction: () => p(!1),
|
|
600
600
|
open: r
|
|
601
601
|
}
|
|
@@ -605,7 +605,7 @@ function ue({
|
|
|
605
605
|
export {
|
|
606
606
|
qe as OwnersInline,
|
|
607
607
|
Ue as OwnersInlineCompact,
|
|
608
|
-
|
|
608
|
+
be as UserCardAdminRow,
|
|
609
609
|
ue as UserChip,
|
|
610
610
|
xe as UserRosterCluster,
|
|
611
611
|
ce as rosterInitials,
|
|
@@ -44,16 +44,18 @@ function Se({
|
|
|
44
44
|
...c
|
|
45
45
|
}) {
|
|
46
46
|
var G, H, U, V, Z, J, X, q, Q, Y, ee;
|
|
47
|
-
const n = ie(), m = (n == null ? void 0 : n.inheritedFrom(e)) ?? null, le = c["data-design-copy"] !== void 0, ce = c["data-header-folded"] !== void 0, l = ((G = n == null ? void 0 : n.diffMark) == null ? void 0 : G.call(n, e)) ?? null, w = (l == null ? void 0 : l.kind) === "removed", x = !n || !!m || le || w || !!((H = n.locked) != null && H.call(n, e)),
|
|
47
|
+
const n = ie(), m = (n == null ? void 0 : n.inheritedFrom(e)) ?? null, le = c["data-design-copy"] !== void 0, ce = c["data-header-folded"] !== void 0, l = ((G = n == null ? void 0 : n.diffMark) == null ? void 0 : G.call(n, e)) ?? null, w = (l == null ? void 0 : l.kind) === "removed", x = !n || !!m || le || w || !!((H = n.locked) != null && H.call(n, e)), k = je((n == null ? void 0 : n.dnd) ?? Fe, e, { disabled: x, noDrop: ce });
|
|
48
48
|
if (!n) return /* @__PURE__ */ o(L, { children: a });
|
|
49
|
-
const ue = Re(e), D = ze(n, e), s = ((U = n.roleMark) == null ? void 0 : U.call(n, e)) ?? null, R = ((V = n.marks) == null ? void 0 : V.call(n, e)) ?? [],
|
|
49
|
+
const ue = Re(e), D = ze(n, e), s = ((U = n.roleMark) == null ? void 0 : U.call(n, e)) ?? null, R = ((V = n.marks) == null ? void 0 : V.call(n, e)) ?? [], b = ((Z = n.overlay) == null ? void 0 : Z.call(n, e)) ?? null, S = ((J = n.unsaved) == null ? void 0 : J.call(n, e)) ?? !1, v = ((X = n.peers) == null ? void 0 : X.call(n, e)) ?? [], pe = R.some((t) => t.highlight), B = ((q = n.note) == null ? void 0 : q.call(n, e)) ?? null, z = B ? /* @__PURE__ */ o(Ie, { note: B }) : null, j = x ? {} : k.props, ge = k.dragging, C = x ? null : k.slot, p = r && oe(a) ? a : null, me = (p == null ? void 0 : p.props.className) ?? "", he = /(^|\s)(absolute|fixed|sticky|relative)(\s|$)/.test(me), fe = f(
|
|
50
50
|
!he && "relative",
|
|
51
|
-
"cursor-pointer rounded-md
|
|
51
|
+
"cursor-pointer rounded-md",
|
|
52
|
+
// Header tiles sit in a strip that clips what overflows it: their ring is drawn inside.
|
|
53
|
+
e.kind === "header" ? "-outline-offset-2" : "outline-offset-2",
|
|
52
54
|
// #3193: on touch a press-and-hold picks the node up — no callout, no text selection.
|
|
53
55
|
"touch-manipulation [-webkit-touch-callout:none] [@media(pointer:coarse)]:select-none",
|
|
54
56
|
!p && (i ? "inline-block" : "block"),
|
|
55
57
|
D ? "outline outline-2 outline-nvr-cyan" : v.length > 0 ? `outline outline-2 ${v[0].outline}` : pe ? "outline-dashed outline-2 outline-violet-400 dark:outline-violet-400/70" : "hover:outline hover:outline-1 hover:outline-slate-300 dark:hover:outline-slate-600",
|
|
56
|
-
|
|
58
|
+
b == null ? void 0 : b.className,
|
|
57
59
|
"focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan",
|
|
58
60
|
Le,
|
|
59
61
|
// The section's "Changed by" shows while the pointer is over it.
|
|
@@ -63,7 +65,7 @@ function Se({
|
|
|
63
65
|
(s == null ? void 0 : s.kind) === "hidden" && "[&>:not([data-design-badges])]:opacity-40",
|
|
64
66
|
l && Ve[l.kind],
|
|
65
67
|
w && "cursor-default [&>:not([data-design-badges])]:opacity-40"
|
|
66
|
-
),
|
|
68
|
+
), ke = (t) => {
|
|
67
69
|
const u = t.target;
|
|
68
70
|
if (u.closest("[data-design-target]") !== t.currentTarget) return;
|
|
69
71
|
if (w) {
|
|
@@ -73,7 +75,7 @@ function Se({
|
|
|
73
75
|
t.shiftKey || t.metaKey || t.ctrlKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e);
|
|
74
76
|
const _ = u.closest("[data-design-pass]");
|
|
75
77
|
_ && t.currentTarget.contains(_) || (t.preventDefault(), t.stopPropagation());
|
|
76
|
-
},
|
|
78
|
+
}, be = (t) => {
|
|
77
79
|
t.key !== "Enter" || t.target !== t.currentTarget || w || t.currentTarget.tagName !== "BUTTON" && (t.preventDefault(), t.shiftKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e));
|
|
78
80
|
}, y = c["data-design-tab"] !== void 0 || ((Q = p == null ? void 0 : p.props) == null ? void 0 : Q["data-design-tab"]) !== void 0, F = {
|
|
79
81
|
"data-design-target": ue,
|
|
@@ -88,8 +90,8 @@ function Se({
|
|
|
88
90
|
...x || !("tabIndex" in j) ? { role: "button", tabIndex: 0 } : {},
|
|
89
91
|
...y && m ? { "data-tip": `From ${m}` } : {},
|
|
90
92
|
className: fe,
|
|
91
|
-
onClickCapture:
|
|
92
|
-
onKeyDown:
|
|
93
|
+
onClickCapture: ke,
|
|
94
|
+
onKeyDown: be
|
|
93
95
|
}, ve = (s == null ? void 0 : s.kind) === "hidden" ? ye : Ne, M = e.kind === "field" || e.kind === "header" ? ((Y = n.fillRate) == null ? void 0 : Y.call(n, e.field)) ?? null : null, N = e.kind === "group" && !y ? ((ee = n.lastChange) == null ? void 0 : ee.call(n, e)) ?? null : null, P = N && [N.by ? `by ${N.by}` : null, N.at ? Te(N.at) : null].filter(Boolean).join(" · ") || null, A = P && !l ? /* @__PURE__ */ g(
|
|
94
96
|
"span",
|
|
95
97
|
{
|
|
@@ -120,10 +122,10 @@ function Se({
|
|
|
120
122
|
]
|
|
121
123
|
}
|
|
122
124
|
)
|
|
123
|
-
}),
|
|
125
|
+
}), b && h.push({
|
|
124
126
|
rank: 1,
|
|
125
127
|
text: "Who sees it",
|
|
126
|
-
node: /* @__PURE__ */ o("span", { "data-design-pass": "", className: "pointer-events-auto", children:
|
|
128
|
+
node: /* @__PURE__ */ o("span", { "data-design-pass": "", className: "pointer-events-auto", children: b.chip })
|
|
127
129
|
}), R.forEach((t, u) => {
|
|
128
130
|
const _ = f(
|
|
129
131
|
Ke,
|
|
@@ -171,7 +173,7 @@ function Se({
|
|
|
171
173
|
m
|
|
172
174
|
] })
|
|
173
175
|
});
|
|
174
|
-
const { shown: xe, rest: $ } = Ge(h), W = R.length > 0 ||
|
|
176
|
+
const { shown: xe, rest: $ } = Ge(h), W = R.length > 0 || b != null || v.length > 0, T = y && !l ? [...h.map((t) => t.text), ...v.map((t) => t.name)] : [];
|
|
175
177
|
T.length > 0 && (F["data-tip"] = m && !s && !W ? `From ${m}` : T.join(" · "));
|
|
176
178
|
const I = y && l ? /* @__PURE__ */ o("span", { "data-design-badges": "", className: "pointer-events-none absolute -top-2 right-0 z-10", children: /* @__PURE__ */ o(re, { diff: l }) }) : T.length > 0 ? /* @__PURE__ */ o(
|
|
177
179
|
"span",
|
|
@@ -238,15 +240,15 @@ function Se({
|
|
|
238
240
|
"aria-hidden": !0,
|
|
239
241
|
"data-design-drop-indicator": C,
|
|
240
242
|
className: "pointer-events-none absolute z-30 rounded-full bg-nvr-cyan shadow-[0_0_0_2px_#fff] dark:shadow-[0_0_0_2px_#0f172a]",
|
|
241
|
-
style:
|
|
242
|
-
children:
|
|
243
|
+
style: k.indicator ?? de[C],
|
|
244
|
+
children: k.merge && /* @__PURE__ */ g(
|
|
243
245
|
"span",
|
|
244
246
|
{
|
|
245
247
|
"data-design-merge-label": "",
|
|
246
248
|
className: "absolute right-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded bg-nvr-cyan px-1.5 text-[11px] font-medium leading-5 text-white",
|
|
247
249
|
children: [
|
|
248
250
|
"Join into ",
|
|
249
|
-
|
|
251
|
+
k.merge
|
|
250
252
|
]
|
|
251
253
|
}
|
|
252
254
|
)
|