@nivaro/react 0.3.25 → 0.3.27
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/hooks/useSessionRecorder.js +1 -1
- package/dist/shared/components/item-edit/M2MCombobox.js +117 -116
- package/dist/shared/components/item-edit/RelationCombobox.js +173 -167
- package/dist/shared/components/panels/ItemLockBanner.js +354 -307
- package/dist/shared/lib/picker-rank.js +21 -0
- package/package.json +1 -1
|
@@ -1,218 +1,263 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { QueryClientContext as
|
|
3
|
-
import { Lock as
|
|
4
|
-
import { useContext as
|
|
1
|
+
import { jsxs as v, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { QueryClientContext as Se } from "@tanstack/react-query";
|
|
3
|
+
import { Lock as Z, LockOpen as ie } from "lucide-react";
|
|
4
|
+
import { useContext as Ce, useState as x, useRef as A, useCallback as w, useEffect as N } from "react";
|
|
5
5
|
import { toast as u } from "sonner";
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { post as
|
|
8
|
-
import { idleState as
|
|
9
|
-
import { useOptionalRealtime as
|
|
10
|
-
import { announceRecordTabs as
|
|
11
|
-
import { Button as
|
|
12
|
-
import { Popover as
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
const [
|
|
6
|
+
import { useNivaroClient as qe, useItemEditAuth as Te } from "../../context.js";
|
|
7
|
+
import { post as q, get as Ae, del as P } from "../../lib/commands.js";
|
|
8
|
+
import { idleState as Ie } from "../../lib/idle.js";
|
|
9
|
+
import { useOptionalRealtime as le, updateTouches as Oe } from "../../lib/realtime.js";
|
|
10
|
+
import { announceRecordTabs as X, useRecordTabsSignal as Ye } from "../../lib/record-tabs.js";
|
|
11
|
+
import { Button as Y } from "../ui/button.js";
|
|
12
|
+
import { Popover as ue, PopoverTrigger as ce, PopoverContent as de } from "../ui/popover.js";
|
|
13
|
+
const K = 1e4, De = 1500, Fe = 2e3, Me = 3e4, Be = 6e4, je = 15e3;
|
|
14
|
+
function ze() {
|
|
15
|
+
const [e, r] = x(!0);
|
|
16
|
+
return N(() => {
|
|
17
|
+
if (typeof window > "u" || typeof document > "u") return;
|
|
18
|
+
let a = null, _ = null;
|
|
19
|
+
const g = () => typeof document.hasFocus == "function" ? document.hasFocus() : !0, p = () => {
|
|
20
|
+
_ && clearInterval(_), _ = null;
|
|
21
|
+
}, o = () => {
|
|
22
|
+
a && clearTimeout(a), a = setTimeout(() => {
|
|
23
|
+
if (a = null, !g()) {
|
|
24
|
+
p(), r(!1);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
p(), _ = setInterval(() => {
|
|
28
|
+
g() || (p(), r(!1));
|
|
29
|
+
}, Fe);
|
|
30
|
+
}, De);
|
|
31
|
+
}, L = () => {
|
|
32
|
+
a && clearTimeout(a), a = null, p(), r(!0);
|
|
33
|
+
};
|
|
34
|
+
return window.addEventListener("blur", o), window.addEventListener("focus", L), () => {
|
|
35
|
+
window.removeEventListener("blur", o), window.removeEventListener("focus", L), a && clearTimeout(a), p();
|
|
36
|
+
};
|
|
37
|
+
}, []), e;
|
|
38
|
+
}
|
|
39
|
+
function Pe() {
|
|
40
|
+
const [e, r] = x(
|
|
16
41
|
() => typeof document > "u" || document.visibilityState !== "hidden"
|
|
17
42
|
);
|
|
18
43
|
return N(() => {
|
|
19
|
-
const
|
|
20
|
-
return document.addEventListener("visibilitychange",
|
|
21
|
-
}, []),
|
|
44
|
+
const a = () => r(document.visibilityState !== "hidden");
|
|
45
|
+
return document.addEventListener("visibilitychange", a), () => document.removeEventListener("visibilitychange", a);
|
|
46
|
+
}, []), e;
|
|
22
47
|
}
|
|
23
|
-
function
|
|
24
|
-
const { lazy:
|
|
25
|
-
|
|
26
|
-
}, []),
|
|
27
|
-
(
|
|
28
|
-
var
|
|
29
|
-
const n =
|
|
30
|
-
return f !== 403 || (
|
|
48
|
+
function rt(e, r, a, _ = {}) {
|
|
49
|
+
const { lazy: g = !1, active: p = !0 } = _, o = qe(), { isAdmin: L, userId: k } = Te(), $ = Ce(Se), [R, b] = x(null), [Q, S] = x(!1), [D, ee] = x(!1), [fe, me] = x([]), [he, F] = x(null), [ke, te] = x(!1), [be, re] = x(""), [ye, U] = x(!1), [ve, ne] = x(!1), B = A(null), i = A(!1), C = A(!1), V = A(!1), W = A(0), T = A(!1), M = A(null), h = w(() => {
|
|
50
|
+
B.current && (clearInterval(B.current), B.current = null);
|
|
51
|
+
}, []), H = w(
|
|
52
|
+
(s) => {
|
|
53
|
+
var t, c;
|
|
54
|
+
const n = s, f = n.status ?? ((t = n.response) == null ? void 0 : t.status), l = ((c = n.response) == null ? void 0 : c.data) ?? n.response;
|
|
55
|
+
return f !== 403 || (l == null ? void 0 : l.code) !== "EDIT_LOCKED" ? !1 : (h(), i.current = !1, S(!1), u.warning(l.error || "You can no longer edit this record — your edit lock was let go"), $ == null || $.invalidateQueries({ queryKey: ["pipeline-instance-lock", e, r] }), $ == null || $.invalidateQueries({ queryKey: ["pipeline-instance", e, r] }), !0);
|
|
31
56
|
},
|
|
32
|
-
[
|
|
57
|
+
[$, e, r, h]
|
|
33
58
|
), d = w(async () => {
|
|
34
|
-
var
|
|
35
|
-
if (!
|
|
36
|
-
|
|
59
|
+
var s, n;
|
|
60
|
+
if (!e || !r || T.current) return !1;
|
|
61
|
+
M.current = null;
|
|
37
62
|
try {
|
|
38
|
-
return await
|
|
63
|
+
return await o.request(
|
|
64
|
+
q(`/item-locks/${e}/${r}/lock`, { beat_ms: K })
|
|
65
|
+
), i.current = !0, S(!0), U(!1), b(null), h(), B.current = setInterval(() => {
|
|
39
66
|
const f = Math.max(
|
|
40
67
|
0,
|
|
41
|
-
Math.floor((Date.now() - new Date(
|
|
68
|
+
Math.floor((Date.now() - new Date(Ie().last_active).getTime()) / 1e3)
|
|
42
69
|
);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
70
|
+
o.request(
|
|
71
|
+
q(`/item-locks/${e}/${r}/heartbeat`, {
|
|
72
|
+
idle_seconds: f,
|
|
73
|
+
beat_ms: K
|
|
74
|
+
})
|
|
75
|
+
).then((l) => {
|
|
76
|
+
if (!(l != null && l.idle_released)) return;
|
|
77
|
+
h(), i.current = !1, S(!1), u.info(
|
|
46
78
|
"Your edit lock was released after inactivity — it re-locks when you resume."
|
|
47
79
|
);
|
|
48
|
-
const
|
|
49
|
-
window.removeEventListener("pointerdown",
|
|
80
|
+
const t = () => {
|
|
81
|
+
window.removeEventListener("pointerdown", t, !0), window.removeEventListener("keydown", t, !0), d();
|
|
50
82
|
};
|
|
51
|
-
window.addEventListener("pointerdown",
|
|
52
|
-
}).catch((
|
|
53
|
-
var
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
if (c === 404 && !(
|
|
83
|
+
window.addEventListener("pointerdown", t, !0), window.addEventListener("keydown", t, !0);
|
|
84
|
+
}).catch((l) => {
|
|
85
|
+
var ae, oe;
|
|
86
|
+
const t = l, c = t.status ?? ((ae = t.response) == null ? void 0 : ae.status);
|
|
87
|
+
if (H(l) || c !== 404 && c !== 409) return;
|
|
88
|
+
const E = ((oe = t.response) == null ? void 0 : oe.data) ?? t.response;
|
|
89
|
+
if (c === 404 && !(E != null && E.locked_by)) {
|
|
58
90
|
d();
|
|
59
91
|
return;
|
|
60
92
|
}
|
|
61
|
-
|
|
62
|
-
locked_by:
|
|
63
|
-
locked_by_name:
|
|
93
|
+
h(), i.current = !1, S(!1), E != null && E.locked_by && (b({
|
|
94
|
+
locked_by: E.locked_by,
|
|
95
|
+
locked_by_name: E.locked_by_name ?? null
|
|
64
96
|
}), u.warning(
|
|
65
|
-
`${
|
|
97
|
+
`${E.locked_by_name ?? "Another user"} took over editing — your changes are no longer being saved`
|
|
66
98
|
));
|
|
67
99
|
});
|
|
68
|
-
},
|
|
100
|
+
}, K), !0;
|
|
69
101
|
} catch (f) {
|
|
70
|
-
const
|
|
71
|
-
return
|
|
102
|
+
const l = f, t = l.status ?? ((s = l.response) == null ? void 0 : s.status), c = ((n = l.response) == null ? void 0 : n.data) ?? l.response;
|
|
103
|
+
return M.current = t ?? null, H(f) ? !1 : t === 404 ? (T.current = !0, h(), i.current = !1, S(!1), !1) : (t === 409 && (c != null && c.locked_by) && (i.current = !1, S(!1), b({
|
|
72
104
|
locked_by: c.locked_by,
|
|
73
105
|
locked_by_name: c.locked_by_name ?? null,
|
|
74
106
|
...typeof c.may_take_over == "boolean" ? { may_take_over: c.may_take_over } : {}
|
|
75
107
|
})), !1);
|
|
76
108
|
}
|
|
77
|
-
}, [
|
|
78
|
-
if (!(!
|
|
109
|
+
}, [o, e, r, h, H]), y = w(async () => {
|
|
110
|
+
if (!(!e || !r))
|
|
79
111
|
try {
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
const f = (n == null ? void 0 : n.is_mine) === !0 || !!
|
|
83
|
-
if (
|
|
112
|
+
const s = await o.request(Ae(`/item-locks/${e}/${r}/lock`)), n = s == null ? void 0 : s.data;
|
|
113
|
+
me(Array.isArray(n == null ? void 0 : n.queue) ? n.queue : []), F(typeof (n == null ? void 0 : n.my_position) == "number" ? n.my_position : null);
|
|
114
|
+
const f = (n == null ? void 0 : n.is_mine) === !0 || !!k && String((n == null ? void 0 : n.locked_by) ?? "").toLowerCase() === k.toLowerCase(), l = typeof (n == null ? void 0 : n.may_take_over) == "boolean" ? { may_take_over: n.may_take_over } : {};
|
|
115
|
+
if (i.current) return;
|
|
84
116
|
if (!(n != null && n.locked_by) || f) {
|
|
85
|
-
|
|
117
|
+
b(null);
|
|
86
118
|
return;
|
|
87
119
|
}
|
|
88
|
-
|
|
89
|
-
(
|
|
90
|
-
...
|
|
91
|
-
note: n.note ??
|
|
92
|
-
idle_minutes: n.locked_by_idle_minutes ??
|
|
93
|
-
...
|
|
120
|
+
b(
|
|
121
|
+
(t) => t && t.locked_by === String(n.locked_by) ? {
|
|
122
|
+
...t,
|
|
123
|
+
note: n.note ?? t.note ?? null,
|
|
124
|
+
idle_minutes: n.locked_by_idle_minutes ?? t.idle_minutes ?? null,
|
|
125
|
+
...l
|
|
94
126
|
} : {
|
|
95
127
|
locked_by: String(n.locked_by),
|
|
96
128
|
locked_by_name: n.locked_by_name ?? null,
|
|
97
129
|
note: n.note ?? null,
|
|
98
130
|
idle_minutes: n.locked_by_idle_minutes ?? null,
|
|
99
|
-
...
|
|
131
|
+
...l
|
|
100
132
|
}
|
|
101
|
-
),
|
|
102
|
-
} catch (
|
|
103
|
-
(
|
|
133
|
+
), U(!1);
|
|
134
|
+
} catch (s) {
|
|
135
|
+
(s == null ? void 0 : s.status) === 404 && (T.current = !0);
|
|
104
136
|
}
|
|
105
|
-
}, [
|
|
137
|
+
}, [o, e, r, k]), I = (R == null ? void 0 : R.locked_by) ?? null;
|
|
106
138
|
N(() => {
|
|
107
|
-
I &&
|
|
108
|
-
}, [I,
|
|
139
|
+
I && y();
|
|
140
|
+
}, [I, y]), N(() => {
|
|
109
141
|
if (!I) return;
|
|
110
|
-
const
|
|
111
|
-
return () => clearInterval(
|
|
112
|
-
}, [I,
|
|
113
|
-
if (!(!
|
|
114
|
-
return
|
|
115
|
-
|
|
142
|
+
const s = setInterval(() => void y(), Me);
|
|
143
|
+
return () => clearInterval(s);
|
|
144
|
+
}, [I, y]), N(() => {
|
|
145
|
+
if (!(!a || !e || !r))
|
|
146
|
+
return C.current = !1, T.current = !1, g ? y() : d(), () => {
|
|
147
|
+
h(), C.current = !1, i.current && (i.current = !1, o.request(P(`/item-locks/${e}/${r}/lock`)).then(() => X(k, "lock-released", e, r)).catch(() => {
|
|
116
148
|
}));
|
|
117
149
|
};
|
|
118
|
-
}, [
|
|
119
|
-
const
|
|
120
|
-
if (!(!
|
|
121
|
-
|
|
150
|
+
}, [a, e, r, d, o, h, k, g, y]);
|
|
151
|
+
const ge = w(async () => {
|
|
152
|
+
if (!(!a || i.current || V.current) && !(Date.now() < W.current)) {
|
|
153
|
+
V.current = !0;
|
|
122
154
|
try {
|
|
123
|
-
const
|
|
124
|
-
!
|
|
155
|
+
const s = await d();
|
|
156
|
+
!s && M.current === 409 && u.warning("Someone else is editing this record — your change can’t be saved yet"), !s && M.current !== 409 && !T.current && (W.current = Date.now() + je);
|
|
125
157
|
} finally {
|
|
126
|
-
|
|
158
|
+
V.current = !1;
|
|
127
159
|
}
|
|
128
160
|
}
|
|
129
|
-
}, [
|
|
161
|
+
}, [a, d]);
|
|
130
162
|
N(() => {
|
|
131
|
-
const
|
|
132
|
-
|
|
163
|
+
const s = () => {
|
|
164
|
+
W.current = 0;
|
|
133
165
|
};
|
|
134
|
-
return window.addEventListener("online",
|
|
166
|
+
return window.addEventListener("online", s), () => window.removeEventListener("online", s);
|
|
135
167
|
}, []);
|
|
136
|
-
const
|
|
168
|
+
const j = w(() => {
|
|
169
|
+
var s;
|
|
170
|
+
if (!(!e || !r))
|
|
171
|
+
try {
|
|
172
|
+
const n = (s = o.getToken) == null ? void 0 : s.call(o), f = o.url ?? "";
|
|
173
|
+
fetch(
|
|
174
|
+
`${f}/api/item-locks/${encodeURIComponent(e)}/${encodeURIComponent(r)}/lock/release`,
|
|
175
|
+
{
|
|
176
|
+
method: "POST",
|
|
177
|
+
keepalive: !0,
|
|
178
|
+
credentials: n ? "omit" : "include",
|
|
179
|
+
headers: n ? { Authorization: `Bearer ${n}` } : {}
|
|
180
|
+
}
|
|
181
|
+
).then(() => X(k, "lock-released", e, r)).catch(() => {
|
|
182
|
+
});
|
|
183
|
+
} catch {
|
|
184
|
+
}
|
|
185
|
+
}, [o, e, r, k]), J = Pe(), we = ze(), z = p && J && we;
|
|
137
186
|
N(() => {
|
|
138
|
-
if (!
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}, Ye);
|
|
147
|
-
return () => clearTimeout(a);
|
|
148
|
-
}, [i, B, t, r, d, s, m, g]), N(() => {
|
|
149
|
-
if (!i || !L || !t || !r || I || !B) return;
|
|
150
|
-
const a = setInterval(() => {
|
|
151
|
-
!l.current && !q.current && b();
|
|
152
|
-
}, De);
|
|
153
|
-
return () => clearInterval(a);
|
|
154
|
-
}, [i, L, t, r, I, B, b]), N(() => {
|
|
155
|
-
if (!i || !t || !r) return;
|
|
156
|
-
const a = () => {
|
|
157
|
-
var f;
|
|
158
|
-
if (l.current) {
|
|
159
|
-
m(), l.current = !1, R.current = !0;
|
|
160
|
-
try {
|
|
161
|
-
const o = (f = s.getToken) == null ? void 0 : f.call(s), e = s.url ?? "";
|
|
162
|
-
fetch(
|
|
163
|
-
`${e}/api/item-locks/${encodeURIComponent(t)}/${encodeURIComponent(r)}/lock/release`,
|
|
164
|
-
{
|
|
165
|
-
method: "POST",
|
|
166
|
-
keepalive: !0,
|
|
167
|
-
credentials: o ? "omit" : "include",
|
|
168
|
-
headers: o ? { Authorization: `Bearer ${o}` } : {}
|
|
169
|
-
}
|
|
170
|
-
).catch(() => {
|
|
171
|
-
});
|
|
172
|
-
} catch {
|
|
173
|
-
}
|
|
187
|
+
if (!(!a || !e || !r)) {
|
|
188
|
+
if (z) {
|
|
189
|
+
C.current && (C.current = !1, d().then((s) => {
|
|
190
|
+
!s && M.current === 409 && u.warning(
|
|
191
|
+
"Someone else started editing while you were away — your changes are still here, but can’t be saved until they release it"
|
|
192
|
+
);
|
|
193
|
+
}));
|
|
194
|
+
return;
|
|
174
195
|
}
|
|
196
|
+
i.current && (h(), i.current = !1, S(!1), C.current = !0, J ? o.request(P(`/item-locks/${e}/${r}/lock`)).then(() => X(k, "lock-released", e, r)).catch(() => {
|
|
197
|
+
}) : j());
|
|
198
|
+
}
|
|
199
|
+
}, [
|
|
200
|
+
a,
|
|
201
|
+
z,
|
|
202
|
+
J,
|
|
203
|
+
e,
|
|
204
|
+
r,
|
|
205
|
+
d,
|
|
206
|
+
o,
|
|
207
|
+
h,
|
|
208
|
+
k,
|
|
209
|
+
j
|
|
210
|
+
]), N(() => {
|
|
211
|
+
if (!a || !g || !e || !r || I || !z) return;
|
|
212
|
+
const s = setInterval(() => {
|
|
213
|
+
!i.current && !T.current && y();
|
|
214
|
+
}, Be);
|
|
215
|
+
return () => clearInterval(s);
|
|
216
|
+
}, [a, g, e, r, I, z, y]), N(() => {
|
|
217
|
+
if (!a || !e || !r) return;
|
|
218
|
+
const s = () => {
|
|
219
|
+
i.current && (h(), i.current = !1, C.current = !0, j());
|
|
175
220
|
}, n = (f) => {
|
|
176
|
-
f.persisted &&
|
|
221
|
+
f.persisted && C.current && (C.current = !1, d());
|
|
177
222
|
};
|
|
178
|
-
return window.addEventListener("pagehide",
|
|
179
|
-
window.removeEventListener("pagehide",
|
|
223
|
+
return window.addEventListener("pagehide", s), window.addEventListener("pageshow", n), () => {
|
|
224
|
+
window.removeEventListener("pagehide", s), window.removeEventListener("pageshow", n);
|
|
180
225
|
};
|
|
181
|
-
}, [
|
|
182
|
-
|
|
226
|
+
}, [a, e, r, h, d, j]), Ye(k, "lock-released", e, r, () => {
|
|
227
|
+
a && i.current && d();
|
|
183
228
|
});
|
|
184
|
-
const
|
|
229
|
+
const G = le();
|
|
185
230
|
N(() => {
|
|
186
|
-
if (!(!
|
|
187
|
-
return
|
|
231
|
+
if (!(!a || !G || !e || !r))
|
|
232
|
+
return G.subscribeCollections([e], (s) => {
|
|
188
233
|
var n;
|
|
189
|
-
|
|
234
|
+
i.current || T.current || !((n = s.changed_fields) != null && n.includes("$lock")) || !Oe(s, r) || y();
|
|
190
235
|
});
|
|
191
|
-
}, [
|
|
192
|
-
const
|
|
193
|
-
if (!(!
|
|
194
|
-
|
|
236
|
+
}, [a, G, e, r, y]);
|
|
237
|
+
const O = le(), [xe, se] = x(!1), _e = w(async () => {
|
|
238
|
+
if (!(!e || !r)) {
|
|
239
|
+
se(!0);
|
|
195
240
|
try {
|
|
196
|
-
await
|
|
241
|
+
await o.request(q(`/item-locks/${e}/${r}/lock/request`, {})), u.success("Asked the current editor to release the lock");
|
|
197
242
|
} catch {
|
|
198
243
|
u.error("Could not send the lock request");
|
|
199
244
|
} finally {
|
|
200
|
-
|
|
245
|
+
se(!1);
|
|
201
246
|
}
|
|
202
247
|
}
|
|
203
|
-
}, [
|
|
248
|
+
}, [o, e, r]);
|
|
204
249
|
N(() => {
|
|
205
|
-
if (!
|
|
206
|
-
const
|
|
207
|
-
if ((
|
|
208
|
-
const c = (
|
|
250
|
+
if (!O || !e || !r) return;
|
|
251
|
+
const s = O.on("lock:requested", (t) => {
|
|
252
|
+
if ((t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || !i.current) return;
|
|
253
|
+
const c = (t == null ? void 0 : t.from) ?? {};
|
|
209
254
|
u(`${c.name ?? "Someone"} is asking you to release this record`, {
|
|
210
255
|
duration: 3e4,
|
|
211
256
|
action: {
|
|
212
257
|
label: "Release",
|
|
213
258
|
onClick: () => {
|
|
214
|
-
|
|
215
|
-
|
|
259
|
+
h(), i.current = !1, S(!1), o.request(
|
|
260
|
+
q(`/item-locks/${e}/${r}/lock/respond`, {
|
|
216
261
|
to: c.id,
|
|
217
262
|
action: "release"
|
|
218
263
|
})
|
|
@@ -222,8 +267,8 @@ function Xe(t, r, i, S = {}) {
|
|
|
222
267
|
cancel: {
|
|
223
268
|
label: "Keep editing",
|
|
224
269
|
onClick: () => {
|
|
225
|
-
|
|
226
|
-
|
|
270
|
+
o.request(
|
|
271
|
+
q(`/item-locks/${e}/${r}/lock/respond`, {
|
|
227
272
|
to: c.id,
|
|
228
273
|
action: "decline"
|
|
229
274
|
})
|
|
@@ -232,125 +277,127 @@ function Xe(t, r, i, S = {}) {
|
|
|
232
277
|
}
|
|
233
278
|
}
|
|
234
279
|
});
|
|
235
|
-
}), n =
|
|
236
|
-
var c,
|
|
237
|
-
(
|
|
238
|
-
`${((
|
|
280
|
+
}), n = O.on("lock:response", (t) => {
|
|
281
|
+
var c, E;
|
|
282
|
+
(t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || i.current || ((t == null ? void 0 : t.action) === "release" ? (u.success(`${((c = t == null ? void 0 : t.from) == null ? void 0 : c.name) ?? "The editor"} released the lock — it's yours`), d()) : u.warning(
|
|
283
|
+
`${((E = t == null ? void 0 : t.from) == null ? void 0 : E.name) ?? "The editor"} is keeping the lock${t != null && t.note ? `: "${t.note}"` : ""}`
|
|
239
284
|
));
|
|
240
|
-
}), f =
|
|
241
|
-
(
|
|
242
|
-
}),
|
|
243
|
-
(
|
|
285
|
+
}), f = O.on("lock:available", (t) => {
|
|
286
|
+
(t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || i.current || (u.success("Your turn — the edit lock is yours"), F(null), d());
|
|
287
|
+
}), l = O.on("lock:queued", (t) => {
|
|
288
|
+
(t == null ? void 0 : t.collection) !== e || String(t == null ? void 0 : t.item) !== String(r) || (i.current && u(`${(t == null ? void 0 : t.user_name) ?? "Someone"} is waiting to edit this record`, { duration: 8e3 }), y());
|
|
244
289
|
});
|
|
245
290
|
return () => {
|
|
246
|
-
|
|
291
|
+
s(), n(), f(), l();
|
|
247
292
|
};
|
|
248
|
-
}, [
|
|
249
|
-
const
|
|
250
|
-
if (!(!
|
|
251
|
-
|
|
293
|
+
}, [O, e, r, o, d, h, y]);
|
|
294
|
+
const pe = w(async () => {
|
|
295
|
+
if (!(!e || !r)) {
|
|
296
|
+
te(!0);
|
|
252
297
|
try {
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
), n =
|
|
298
|
+
const s = await o.request(
|
|
299
|
+
q(`/item-locks/${e}/${r}/lock/queue`, {})
|
|
300
|
+
), n = s == null ? void 0 : s.data;
|
|
256
301
|
if (n != null && n.free) {
|
|
257
|
-
|
|
302
|
+
F(null), b(null), u.success("Nobody is editing this record now — go ahead");
|
|
258
303
|
return;
|
|
259
304
|
}
|
|
260
305
|
const f = n == null ? void 0 : n.position;
|
|
261
|
-
|
|
306
|
+
F(typeof f == "number" ? f : 1), u.success("You are in line — the lock comes to you automatically when it frees up"), y();
|
|
262
307
|
} catch {
|
|
263
308
|
u.error("Could not join the queue");
|
|
264
309
|
} finally {
|
|
265
|
-
|
|
310
|
+
te(!1);
|
|
266
311
|
}
|
|
267
312
|
}
|
|
268
|
-
}, [
|
|
269
|
-
if (!(!
|
|
313
|
+
}, [o, e, r, y]), Le = w(async () => {
|
|
314
|
+
if (!(!e || !r))
|
|
270
315
|
try {
|
|
271
|
-
await
|
|
316
|
+
await o.request(P(`/item-locks/${e}/${r}/lock/queue`)), F(null), y();
|
|
272
317
|
} catch {
|
|
273
318
|
}
|
|
274
|
-
}, [
|
|
275
|
-
async (
|
|
276
|
-
if (!(!
|
|
277
|
-
|
|
319
|
+
}, [o, e, r, y]), $e = w(
|
|
320
|
+
async (s) => {
|
|
321
|
+
if (!(!e || !r || !i.current)) {
|
|
322
|
+
re(s);
|
|
278
323
|
try {
|
|
279
|
-
await
|
|
324
|
+
await o.request(q(`/item-locks/${e}/${r}/lock/note`, { note: s }));
|
|
280
325
|
} catch {
|
|
281
326
|
}
|
|
282
327
|
}
|
|
283
328
|
},
|
|
284
|
-
[
|
|
285
|
-
),
|
|
286
|
-
if (!(!
|
|
287
|
-
|
|
329
|
+
[o, e, r]
|
|
330
|
+
), Ee = w(async () => {
|
|
331
|
+
if (!(!e || !r || !i.current)) {
|
|
332
|
+
ne(!0), h(), i.current = !1, S(!1);
|
|
288
333
|
try {
|
|
289
|
-
await
|
|
334
|
+
await o.request(P(`/item-locks/${e}/${r}/lock`)), U(!0), re(""), u.success("Lock released — anyone can edit this record now");
|
|
290
335
|
} catch {
|
|
291
336
|
u.error("Failed to release the lock"), d();
|
|
292
337
|
} finally {
|
|
293
|
-
|
|
338
|
+
ne(!1);
|
|
294
339
|
}
|
|
295
340
|
}
|
|
296
|
-
}, [
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
return
|
|
300
|
-
}, [d]),
|
|
301
|
-
var
|
|
302
|
-
if (!(!
|
|
303
|
-
|
|
341
|
+
}, [o, e, r, h, d]), Ne = w(async () => {
|
|
342
|
+
if (i.current) return !0;
|
|
343
|
+
const s = await d();
|
|
344
|
+
return s && u.success("You hold the edit lock again"), s;
|
|
345
|
+
}, [d]), Re = w(async () => {
|
|
346
|
+
var s;
|
|
347
|
+
if (!(!e || !r)) {
|
|
348
|
+
ee(!0);
|
|
304
349
|
try {
|
|
305
|
-
await
|
|
350
|
+
await o.request(
|
|
351
|
+
q(`/item-locks/${e}/${r}/lock/force`, { beat_ms: K })
|
|
352
|
+
), u.success("You now hold the edit lock"), await d();
|
|
306
353
|
} catch (n) {
|
|
307
|
-
const f = ((
|
|
308
|
-
u.error(f), (n == null ? void 0 : n.status) === 403 &&
|
|
354
|
+
const f = ((s = n == null ? void 0 : n.response) == null ? void 0 : s.error) ?? "Failed to take over the lock";
|
|
355
|
+
u.error(f), (n == null ? void 0 : n.status) === 403 && b((l) => l && { ...l, may_take_over: !1 });
|
|
309
356
|
} finally {
|
|
310
|
-
|
|
357
|
+
ee(!1);
|
|
311
358
|
}
|
|
312
359
|
}
|
|
313
|
-
}, [
|
|
360
|
+
}, [o, e, r, d]);
|
|
314
361
|
return {
|
|
315
|
-
lockHolder:
|
|
316
|
-
acquired:
|
|
317
|
-
isReadOnly: !!
|
|
318
|
-
takeOver:
|
|
362
|
+
lockHolder: R,
|
|
363
|
+
acquired: Q,
|
|
364
|
+
isReadOnly: !!R,
|
|
365
|
+
takeOver: Re,
|
|
319
366
|
takingOver: D,
|
|
320
|
-
isAdmin:
|
|
321
|
-
requestLock:
|
|
322
|
-
requesting:
|
|
323
|
-
queue:
|
|
324
|
-
myPosition:
|
|
325
|
-
joinQueue:
|
|
326
|
-
leaveQueue:
|
|
327
|
-
joining:
|
|
328
|
-
myNote:
|
|
329
|
-
saveNote:
|
|
330
|
-
release:
|
|
331
|
-
releasing:
|
|
332
|
-
released:
|
|
333
|
-
relock:
|
|
334
|
-
claim:
|
|
367
|
+
isAdmin: L,
|
|
368
|
+
requestLock: _e,
|
|
369
|
+
requesting: xe,
|
|
370
|
+
queue: fe,
|
|
371
|
+
myPosition: he,
|
|
372
|
+
joinQueue: pe,
|
|
373
|
+
leaveQueue: Le,
|
|
374
|
+
joining: ke,
|
|
375
|
+
myNote: be,
|
|
376
|
+
saveNote: $e,
|
|
377
|
+
release: Ee,
|
|
378
|
+
releasing: ve,
|
|
379
|
+
released: ye,
|
|
380
|
+
relock: Ne,
|
|
381
|
+
claim: ge
|
|
335
382
|
};
|
|
336
383
|
}
|
|
337
|
-
function
|
|
338
|
-
note:
|
|
384
|
+
function nt({
|
|
385
|
+
note: e,
|
|
339
386
|
onSave: r,
|
|
340
|
-
waiting:
|
|
341
|
-
onRelease:
|
|
342
|
-
releasing:
|
|
343
|
-
released:
|
|
344
|
-
onRelock:
|
|
387
|
+
waiting: a,
|
|
388
|
+
onRelease: _,
|
|
389
|
+
releasing: g,
|
|
390
|
+
released: p,
|
|
391
|
+
onRelock: o
|
|
345
392
|
}) {
|
|
346
|
-
var
|
|
347
|
-
const [
|
|
348
|
-
N(() =>
|
|
349
|
-
const
|
|
350
|
-
|
|
393
|
+
var R;
|
|
394
|
+
const [L, k] = x(e);
|
|
395
|
+
N(() => k(e), [e]);
|
|
396
|
+
const $ = () => {
|
|
397
|
+
L.trim() !== e && r(L.trim());
|
|
351
398
|
};
|
|
352
|
-
return
|
|
353
|
-
/* @__PURE__ */
|
|
399
|
+
return p ? /* @__PURE__ */ v(ue, { children: [
|
|
400
|
+
/* @__PURE__ */ m(ce, { asChild: !0, children: /* @__PURE__ */ m(
|
|
354
401
|
"button",
|
|
355
402
|
{
|
|
356
403
|
type: "button",
|
|
@@ -358,117 +405,117 @@ function Ze({
|
|
|
358
405
|
title: "Lock released — anyone can edit this record",
|
|
359
406
|
"data-lock-released": !0,
|
|
360
407
|
className: "relative inline-flex h-8 w-8 items-center justify-center text-slate-400 transition-colors hover:bg-accent hover:text-accent-foreground dark:text-slate-500",
|
|
361
|
-
children: /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ m(ie, { className: "h-4 w-4", strokeWidth: 2 })
|
|
362
409
|
}
|
|
363
410
|
) }),
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
|
|
411
|
+
/* @__PURE__ */ v(de, { align: "end", sideOffset: 6, className: "w-[300px] p-3", children: [
|
|
412
|
+
/* @__PURE__ */ m("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "You released the edit lock" }),
|
|
413
|
+
/* @__PURE__ */ m("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: "Anyone can edit this record now. Your next edit locks it again — or lock it now." }),
|
|
414
|
+
/* @__PURE__ */ v(
|
|
415
|
+
Y,
|
|
369
416
|
{
|
|
370
417
|
type: "button",
|
|
371
418
|
size: "sm",
|
|
372
419
|
className: "mt-2 h-7 w-full text-[12px]",
|
|
373
|
-
onClick:
|
|
420
|
+
onClick: o,
|
|
374
421
|
"data-lock-relock": !0,
|
|
375
422
|
children: [
|
|
376
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ m(Z, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
377
424
|
" Lock again"
|
|
378
425
|
]
|
|
379
426
|
}
|
|
380
427
|
)
|
|
381
428
|
] })
|
|
382
|
-
] }) : /* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */
|
|
429
|
+
] }) : /* @__PURE__ */ v(ue, { children: [
|
|
430
|
+
/* @__PURE__ */ m(ce, { asChild: !0, children: /* @__PURE__ */ v(
|
|
384
431
|
"button",
|
|
385
432
|
{
|
|
386
433
|
type: "button",
|
|
387
434
|
"aria-label": "You hold the edit lock — add a note for others",
|
|
388
|
-
title:
|
|
435
|
+
title: a.length > 0 ? `You hold the edit lock · ${a.length} waiting` : "You hold the edit lock",
|
|
389
436
|
"data-lock-holder": !0,
|
|
390
437
|
className: "relative inline-flex h-8 w-8 items-center justify-center text-[#0e7490] transition-colors hover:bg-accent hover:text-accent-foreground dark:text-nvr-cyan",
|
|
391
438
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
|
|
439
|
+
/* @__PURE__ */ m(Z, { className: "h-4 w-4", strokeWidth: 2 }),
|
|
440
|
+
a.length > 0 && /* @__PURE__ */ m("span", { className: "absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-amber-500 ring-2 ring-background" })
|
|
394
441
|
]
|
|
395
442
|
}
|
|
396
443
|
) }),
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ v(de, { align: "end", sideOffset: 6, className: "w-[300px] p-3", children: [
|
|
445
|
+
/* @__PURE__ */ m("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "You hold the edit lock" }),
|
|
446
|
+
/* @__PURE__ */ m("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: "Others see this record read-only. A note tells them what you’re doing." }),
|
|
447
|
+
/* @__PURE__ */ m(
|
|
401
448
|
"input",
|
|
402
449
|
{
|
|
403
|
-
value:
|
|
404
|
-
onChange: (
|
|
405
|
-
onBlur:
|
|
406
|
-
onKeyDown: (
|
|
407
|
-
|
|
450
|
+
value: L,
|
|
451
|
+
onChange: (b) => k(b.target.value.slice(0, 300)),
|
|
452
|
+
onBlur: $,
|
|
453
|
+
onKeyDown: (b) => {
|
|
454
|
+
b.key === "Enter" && (b.preventDefault(), $());
|
|
408
455
|
},
|
|
409
456
|
placeholder: "“editing lines, ~15 min”",
|
|
410
457
|
"aria-label": "Lock note",
|
|
411
458
|
className: "mt-2 h-7 w-full rounded-md border border-slate-200 bg-white px-2 text-[12px] dark:border-border dark:bg-card"
|
|
412
459
|
}
|
|
413
460
|
),
|
|
414
|
-
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
|
|
461
|
+
a.length > 0 && /* @__PURE__ */ v("div", { className: "mt-2 rounded-md bg-amber-50 px-2 py-1.5 text-[11px] text-amber-800 dark:bg-amber-500/10 dark:text-amber-200", children: [
|
|
462
|
+
/* @__PURE__ */ v("span", { className: "font-semibold", children: [
|
|
463
|
+
a.length,
|
|
417
464
|
" waiting for the lock:"
|
|
418
465
|
] }),
|
|
419
466
|
" ",
|
|
420
|
-
|
|
467
|
+
a.map((b) => b.name ?? "someone").join(", ")
|
|
421
468
|
] }),
|
|
422
|
-
|
|
423
|
-
|
|
469
|
+
_ && /* @__PURE__ */ v(
|
|
470
|
+
Y,
|
|
424
471
|
{
|
|
425
472
|
type: "button",
|
|
426
473
|
variant: "outline",
|
|
427
474
|
size: "sm",
|
|
428
475
|
className: "mt-2 h-7 w-full text-[12px]",
|
|
429
|
-
onClick:
|
|
430
|
-
disabled:
|
|
476
|
+
onClick: _,
|
|
477
|
+
disabled: g,
|
|
431
478
|
"data-lock-release": !0,
|
|
432
479
|
children: [
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
|
|
480
|
+
/* @__PURE__ */ m(ie, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
481
|
+
g ? "Releasing…" : a.length > 0 ? `Release lock to ${((R = a[0]) == null ? void 0 : R.name) ?? "the next person"}` : "Release lock"
|
|
435
482
|
]
|
|
436
483
|
}
|
|
437
484
|
)
|
|
438
485
|
] })
|
|
439
486
|
] });
|
|
440
487
|
}
|
|
441
|
-
function
|
|
442
|
-
lockHolder:
|
|
488
|
+
function st({
|
|
489
|
+
lockHolder: e,
|
|
443
490
|
onTakeOver: r,
|
|
444
|
-
takingOver:
|
|
445
|
-
isAdmin:
|
|
446
|
-
onRequestLock:
|
|
447
|
-
requesting:
|
|
448
|
-
queue:
|
|
449
|
-
myPosition:
|
|
450
|
-
onJoinQueue:
|
|
451
|
-
onLeaveQueue:
|
|
452
|
-
joining:
|
|
453
|
-
noun:
|
|
454
|
-
readOnlyText:
|
|
491
|
+
takingOver: a,
|
|
492
|
+
isAdmin: _,
|
|
493
|
+
onRequestLock: g,
|
|
494
|
+
requesting: p,
|
|
495
|
+
queue: o,
|
|
496
|
+
myPosition: L,
|
|
497
|
+
onJoinQueue: k,
|
|
498
|
+
onLeaveQueue: $,
|
|
499
|
+
joining: R,
|
|
500
|
+
noun: b = "this item",
|
|
501
|
+
readOnlyText: Q = "fields are read-only"
|
|
455
502
|
}) {
|
|
456
|
-
if (!
|
|
457
|
-
const
|
|
458
|
-
return /* @__PURE__ */
|
|
503
|
+
if (!e) return null;
|
|
504
|
+
const S = e.locked_by_name || "Another user", D = (o == null ? void 0 : o.length) ?? 0;
|
|
505
|
+
return /* @__PURE__ */ v(
|
|
459
506
|
"div",
|
|
460
507
|
{
|
|
461
508
|
className: "mb-4 flex flex-wrap items-center gap-3 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-100",
|
|
462
509
|
"data-lock-banner": !0,
|
|
463
510
|
children: [
|
|
464
|
-
/* @__PURE__ */
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ m(Z, { className: "h-4 w-4 shrink-0 text-amber-500" }),
|
|
512
|
+
/* @__PURE__ */ v("span", { className: "min-w-0 flex-1", children: [
|
|
513
|
+
/* @__PURE__ */ m("span", { className: "font-medium", children: S }),
|
|
467
514
|
" is editing ",
|
|
468
|
-
|
|
515
|
+
b,
|
|
469
516
|
" — ",
|
|
470
|
-
|
|
471
|
-
|
|
517
|
+
Q,
|
|
518
|
+
e.idle_minutes != null && e.idle_minutes >= 2 && /* @__PURE__ */ v(
|
|
472
519
|
"span",
|
|
473
520
|
{
|
|
474
521
|
className: "ml-1.5 rounded bg-amber-100 px-1 py-px text-[10px] font-semibold text-amber-700 dark:bg-amber-500/20 dark:text-amber-200",
|
|
@@ -476,74 +523,74 @@ function et({
|
|
|
476
523
|
"data-tip": "How long since they last touched anything — they may have stepped away",
|
|
477
524
|
children: [
|
|
478
525
|
"idle ",
|
|
479
|
-
|
|
526
|
+
e.idle_minutes,
|
|
480
527
|
"m"
|
|
481
528
|
]
|
|
482
529
|
}
|
|
483
530
|
),
|
|
484
531
|
" ",
|
|
485
532
|
"until the lock is released.",
|
|
486
|
-
|
|
533
|
+
e.note && /* @__PURE__ */ v("span", { className: "mt-0.5 block text-[12.5px] text-amber-800/90 dark:text-amber-200/90", children: [
|
|
487
534
|
"“",
|
|
488
|
-
|
|
535
|
+
e.note,
|
|
489
536
|
"”"
|
|
490
537
|
] }),
|
|
491
|
-
D > 0 &&
|
|
538
|
+
D > 0 && L == null && /* @__PURE__ */ v("span", { className: "mt-0.5 block text-[11.5px] text-amber-700/80 dark:text-amber-300/80", children: [
|
|
492
539
|
D,
|
|
493
540
|
" ",
|
|
494
541
|
D === 1 ? "person is" : "people are",
|
|
495
542
|
" already waiting."
|
|
496
543
|
] })
|
|
497
544
|
] }),
|
|
498
|
-
|
|
499
|
-
|
|
545
|
+
k && (L != null ? /* @__PURE__ */ v(
|
|
546
|
+
Y,
|
|
500
547
|
{
|
|
501
548
|
size: "sm",
|
|
502
549
|
variant: "outline",
|
|
503
550
|
className: "h-7 shrink-0 border-amber-300 bg-white text-[12px] text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15",
|
|
504
|
-
onClick:
|
|
551
|
+
onClick: $,
|
|
505
552
|
"data-lock-queue-leave": !0,
|
|
506
553
|
children: [
|
|
507
554
|
"You’re #",
|
|
508
|
-
|
|
555
|
+
L,
|
|
509
556
|
" in line · Leave"
|
|
510
557
|
]
|
|
511
558
|
}
|
|
512
|
-
) : /* @__PURE__ */
|
|
513
|
-
|
|
559
|
+
) : /* @__PURE__ */ m(
|
|
560
|
+
Y,
|
|
514
561
|
{
|
|
515
562
|
size: "sm",
|
|
516
563
|
variant: "outline",
|
|
517
564
|
className: "h-7 shrink-0 border-amber-300 bg-white text-[12px] text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15",
|
|
518
|
-
onClick:
|
|
519
|
-
disabled:
|
|
565
|
+
onClick: k,
|
|
566
|
+
disabled: R,
|
|
520
567
|
"data-lock-queue-join": !0,
|
|
521
|
-
children:
|
|
568
|
+
children: R ? "Joining…" : "Ask to be next"
|
|
522
569
|
}
|
|
523
570
|
)),
|
|
524
|
-
|
|
525
|
-
|
|
571
|
+
g && /* @__PURE__ */ m(
|
|
572
|
+
Y,
|
|
526
573
|
{
|
|
527
574
|
size: "sm",
|
|
528
575
|
variant: "outline",
|
|
529
576
|
className: "h-7 shrink-0 border-amber-300 bg-white text-[12px] text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15",
|
|
530
|
-
onClick:
|
|
531
|
-
disabled:
|
|
532
|
-
children:
|
|
577
|
+
onClick: g,
|
|
578
|
+
disabled: p,
|
|
579
|
+
children: p ? "Asking…" : "Ask them to wrap up"
|
|
533
580
|
}
|
|
534
581
|
),
|
|
535
582
|
// Admins always; other roles only when the server says they may (the
|
|
536
583
|
// takeover-role allowlist, #256) — unknown = offered, and a 403 then
|
|
537
584
|
// hides it. A Take over that can only fail was a dead end.
|
|
538
|
-
(
|
|
539
|
-
|
|
585
|
+
(_ || e.may_take_over !== !1) && /* @__PURE__ */ m(
|
|
586
|
+
Y,
|
|
540
587
|
{
|
|
541
588
|
size: "sm",
|
|
542
589
|
variant: "outline",
|
|
543
|
-
className:
|
|
590
|
+
className: _ ? "h-7 shrink-0 border-amber-300 bg-white text-[12px] text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-200 dark:hover:bg-amber-500/15" : "h-7 shrink-0 border-amber-200 bg-white/60 text-[12px] text-amber-700/80 hover:bg-amber-100 dark:border-amber-500/30 dark:bg-transparent dark:text-amber-200/80 dark:hover:bg-amber-500/15",
|
|
544
591
|
onClick: r,
|
|
545
|
-
disabled:
|
|
546
|
-
children:
|
|
592
|
+
disabled: a,
|
|
593
|
+
children: a ? "Taking over…" : "Take over"
|
|
547
594
|
}
|
|
548
595
|
)
|
|
549
596
|
]
|
|
@@ -551,7 +598,7 @@ function et({
|
|
|
551
598
|
);
|
|
552
599
|
}
|
|
553
600
|
export {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
601
|
+
st as ItemLockBanner,
|
|
602
|
+
nt as LockHolderButton,
|
|
603
|
+
rt as useItemLock
|
|
557
604
|
};
|