@nivaro/react 0.3.17 → 0.3.18
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 +51 -1
- package/dist/index.js +243 -240
- package/dist/shared/components/CollectionBrowserView.js +439 -438
- package/dist/shared/components/ItemEditForm.js +3758 -3708
- package/dist/shared/components/ProfileView.js +38 -23
- package/dist/shared/components/RecordReadView.js +452 -430
- package/dist/shared/components/bulk/BulkActionButtons.js +113 -106
- package/dist/shared/components/chat/ChannelArchive.js +16 -17
- package/dist/shared/components/chat/ChatPanel.js +992 -930
- package/dist/shared/components/chat/Composer.js +307 -303
- package/dist/shared/components/chat/chat-core.js +8 -4
- package/dist/shared/components/chat/chat-drafts.js +60 -43
- package/dist/shared/components/item-edit/InlineTableField.js +159 -158
- package/dist/shared/components/item-edit/RecordLiveSync.js +169 -155
- package/dist/shared/components/item-edit/RelationCombobox.js +274 -247
- package/dist/shared/components/item-edit/RowHistorySheet.js +62 -62
- package/dist/shared/components/item-edit/picker-search.js +28 -0
- package/dist/shared/components/panels/RevisionsPanel.js +268 -260
- package/dist/shared/components/profile/BrowserPushCard.js +135 -89
- package/dist/shared/components/profile/push-failure.js +76 -0
- package/dist/shared/lib/display-prefs.js +90 -0
- package/dist/shared/lib/theme-accents.js +21 -16
- package/package.json +1 -1
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { EyeOff as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { useLiveRecord as
|
|
9
|
-
import { useOptionalRealtime as
|
|
10
|
-
import { useRecordTabsSignal as
|
|
11
|
-
import { userErrorMessage as
|
|
12
|
-
import { formatRelative as
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
1
|
+
import { jsx as i, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as ue } from "@tanstack/react-query";
|
|
3
|
+
import { EyeOff as me, ArrowLeft as le, Trash2 as be, Copy as fe, FileUp as pe, Bot as he, UploadCloud as ge } from "lucide-react";
|
|
4
|
+
import { useState as w, useRef as h, useEffect as k } from "react";
|
|
5
|
+
import { toast as O } from "sonner";
|
|
6
|
+
import { useNivaroClient as ve, useRecordSurface as ye, useItemEditAuth as xe } from "../../context.js";
|
|
7
|
+
import { get as U, post as we } from "../../lib/commands.js";
|
|
8
|
+
import { useLiveRecord as ke, useLiveEvent as ee, useLiveRecordEvent as re, LIVE_ASPECTS as g, batchTouches as Se } from "../../lib/live.js";
|
|
9
|
+
import { useOptionalRealtime as Ne } from "../../lib/realtime.js";
|
|
10
|
+
import { useRecordTabsSignal as Re, useRecordTabs as Te } from "../../lib/record-tabs.js";
|
|
11
|
+
import { userErrorMessage as _e } from "../../lib/safe-error.js";
|
|
12
|
+
import { formatRelative as $e } from "../../lib/utils.js";
|
|
13
|
+
function Ee(e, r, d) {
|
|
14
|
+
var b;
|
|
15
|
+
if (d.active)
|
|
16
16
|
return { text: e ? `${e} moved this to ${r}` : `This record moved to ${r}` };
|
|
17
|
-
const
|
|
17
|
+
const f = ((b = d.label) == null ? void 0 : b.trim()) || "A record in your tabs";
|
|
18
18
|
return {
|
|
19
|
-
text: e ? `${e} moved ${
|
|
20
|
-
open:
|
|
19
|
+
text: e ? `${e} moved ${f} to ${r}` : `${f} moved to ${r}`,
|
|
20
|
+
open: d.open
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
function De(e, r) {
|
|
24
|
+
const d = e == null ? void 0 : e.user_id;
|
|
25
|
+
return typeof d == "string" && !!r && d.toUpperCase() === String(r).toUpperCase();
|
|
26
|
+
}
|
|
27
|
+
const Ae = 8e3, te = [
|
|
24
28
|
"item",
|
|
25
29
|
"rrv-record",
|
|
26
30
|
"revisions",
|
|
@@ -40,26 +44,33 @@ const $e = 8e3, Ee = [
|
|
|
40
44
|
"record-integrations",
|
|
41
45
|
"record-integrity"
|
|
42
46
|
];
|
|
43
|
-
function
|
|
44
|
-
const
|
|
47
|
+
function Ce(e, r, d) {
|
|
48
|
+
const f = new Set(te), b = String(d);
|
|
45
49
|
e.removeQueries({
|
|
46
|
-
predicate: (
|
|
50
|
+
predicate: (c) => f.has(c.queryKey[0]) && c.queryKey[1] === r && String(c.queryKey[2]) === b
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function ze(e, r, d) {
|
|
54
|
+
if (!r || d.length === 0) return;
|
|
55
|
+
const f = new Set(te), b = new Set(d.map(String));
|
|
56
|
+
e.invalidateQueries({
|
|
57
|
+
predicate: (c) => f.has(c.queryKey[0]) && c.queryKey[1] === r && b.has(String(c.queryKey[2]))
|
|
47
58
|
});
|
|
48
59
|
}
|
|
49
|
-
function
|
|
50
|
-
return /* @__PURE__ */ i("div", { className: "p-6", children: /* @__PURE__ */
|
|
60
|
+
function Le({ onBack: e }) {
|
|
61
|
+
return /* @__PURE__ */ i("div", { className: "p-6", children: /* @__PURE__ */ u(
|
|
51
62
|
"div",
|
|
52
63
|
{
|
|
53
64
|
"data-record-gone": "access",
|
|
54
65
|
role: "alert",
|
|
55
66
|
className: "flex items-center gap-3 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10",
|
|
56
67
|
children: [
|
|
57
|
-
/* @__PURE__ */ i(
|
|
58
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ i(me, { className: "h-4 w-4 shrink-0 text-amber-500" }),
|
|
69
|
+
/* @__PURE__ */ u("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: [
|
|
59
70
|
/* @__PURE__ */ i("span", { className: "font-semibold", children: "You no longer have access to this record." }),
|
|
60
71
|
" A role, scope or filter change hid it while you had it open."
|
|
61
72
|
] }),
|
|
62
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ u(
|
|
63
74
|
"button",
|
|
64
75
|
{
|
|
65
76
|
type: "button",
|
|
@@ -67,7 +78,7 @@ function Ae({ onBack: e }) {
|
|
|
67
78
|
"data-record-gone-back": !0,
|
|
68
79
|
className: "inline-flex h-7 shrink-0 items-center gap-1 rounded-md border border-amber-300 bg-white px-2.5 text-[11.5px] font-medium text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-300 dark:hover:bg-amber-500/10",
|
|
69
80
|
children: [
|
|
70
|
-
/* @__PURE__ */ i(
|
|
81
|
+
/* @__PURE__ */ i(le, { className: "h-3.5 w-3.5" }),
|
|
71
82
|
"Back"
|
|
72
83
|
]
|
|
73
84
|
}
|
|
@@ -76,107 +87,108 @@ function Ae({ onBack: e }) {
|
|
|
76
87
|
}
|
|
77
88
|
) });
|
|
78
89
|
}
|
|
79
|
-
const
|
|
90
|
+
const Qe = (e) => {
|
|
80
91
|
var r;
|
|
81
92
|
return (e == null ? void 0 : e.status) ?? ((r = e == null ? void 0 : e.response) == null ? void 0 : r.status);
|
|
82
93
|
};
|
|
83
|
-
function
|
|
94
|
+
function Ge({
|
|
84
95
|
collection: e,
|
|
85
96
|
itemId: r,
|
|
86
|
-
dirty:
|
|
87
|
-
loadDenied:
|
|
88
|
-
onGoneChange:
|
|
97
|
+
dirty: d = !1,
|
|
98
|
+
loadDenied: f = !1,
|
|
99
|
+
onGoneChange: b
|
|
89
100
|
}) {
|
|
90
|
-
const
|
|
91
|
-
$.current =
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
const
|
|
101
|
+
const c = Ne(), T = ve(), y = ue(), [A, j] = w(!1), [C, se] = w([]), [o, ne] = w(null), [ae, L] = w({}), [B, F] = w(!1), [P, Y] = w(!1), S = h(null), N = h(null), _ = h(Date.now()), Q = h(null), $ = h(b);
|
|
102
|
+
$.current = b;
|
|
103
|
+
const v = h(null), H = ye(), V = h(H);
|
|
104
|
+
V.current = H;
|
|
105
|
+
const R = (s) => {
|
|
95
106
|
var t;
|
|
96
|
-
|
|
107
|
+
v.current = s, ne(s), (t = $.current) == null || t.call($, s), (s == null ? void 0 : s.kind) === "access" && setTimeout(() => Ce(y, e, r), 0);
|
|
97
108
|
};
|
|
98
109
|
k(() => {
|
|
99
|
-
_.current = Date.now(),
|
|
110
|
+
_.current = Date.now(), Q.current = null, L({}), v.current && R(null);
|
|
100
111
|
}, [e, r]);
|
|
101
|
-
const
|
|
102
|
-
for (const t of s)
|
|
103
|
-
},
|
|
112
|
+
const m = (s) => {
|
|
113
|
+
for (const t of s) y.invalidateQueries({ queryKey: t });
|
|
114
|
+
}, q = async (s) => {
|
|
104
115
|
let t = null;
|
|
105
116
|
try {
|
|
106
|
-
t = (await
|
|
107
|
-
|
|
117
|
+
t = (await T.request(
|
|
118
|
+
U("/trash/record", { collection: e, item: r })
|
|
108
119
|
)).data;
|
|
109
120
|
} catch {
|
|
110
121
|
t = null;
|
|
111
122
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
123
|
+
const a = !!(t != null && t.deleted_at) && new Date(t.deleted_at).getTime() >= _.current - 6e4;
|
|
124
|
+
R(a || s === "deleted" && !t ? {
|
|
114
125
|
kind: "deleted",
|
|
115
126
|
by: (t == null ? void 0 : t.deleted_by_name) ?? null,
|
|
116
127
|
at: (t == null ? void 0 : t.deleted_at) ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
117
128
|
trashId: (t == null ? void 0 : t.trash_id) ?? null,
|
|
118
129
|
canRestore: !!(t != null && t.can_restore)
|
|
119
130
|
} : { kind: "access" });
|
|
120
|
-
},
|
|
131
|
+
}, oe = async () => {
|
|
121
132
|
var s;
|
|
122
133
|
try {
|
|
123
|
-
const t = (await
|
|
124
|
-
|
|
125
|
-
)).data,
|
|
126
|
-
if (!
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
const t = (await T.request(
|
|
135
|
+
U(`/pipelines/instance/${e}/${r}`)
|
|
136
|
+
)).data, a = (s = t == null ? void 0 : t.history) == null ? void 0 : s[0];
|
|
137
|
+
if (!a || a.id === Q.current || a.timestamp && new Date(a.timestamp).getTime() < _.current - 5e3 || (Q.current = a.id, typeof document < "u" && document.visibilityState === "hidden")) return;
|
|
138
|
+
const l = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.user_email || null, x = a.to_state_label ?? "a new state", n = Ee(l, x, V.current);
|
|
139
|
+
O.info(
|
|
140
|
+
n.text,
|
|
141
|
+
n.open ? { action: { label: "Open", onClick: n.open } } : {}
|
|
131
142
|
);
|
|
132
143
|
} catch {
|
|
133
144
|
}
|
|
134
|
-
},
|
|
135
|
-
var
|
|
145
|
+
}, ie = (s) => {
|
|
146
|
+
var a;
|
|
136
147
|
if (s.deleted) {
|
|
137
|
-
|
|
148
|
+
q("deleted");
|
|
138
149
|
return;
|
|
139
150
|
}
|
|
140
|
-
if (
|
|
141
|
-
s.events.some((
|
|
142
|
-
const t = (
|
|
143
|
-
if (t(
|
|
151
|
+
if (v.current) return;
|
|
152
|
+
s.events.some((l) => l.source === "import" && !l.own) && (Y(!0), S.current && clearTimeout(S.current), S.current = setTimeout(() => Y(!1), Ae));
|
|
153
|
+
const t = (l) => Se(s, l);
|
|
154
|
+
if (t(g.state) && (m([
|
|
144
155
|
["pipeline-instance", e, r],
|
|
145
156
|
["pipeline-all-owners", e, r],
|
|
146
157
|
["pipeline-instance-owners", e, r],
|
|
147
158
|
["pipeline-owners-resolved", e, r],
|
|
148
159
|
["approval-brief", e, r]
|
|
149
|
-
]), (
|
|
160
|
+
]), (a = s.changedFields) != null && a.includes(g.state) && oe()), t(g.addendums) && m([["addendums", e, r]]), t(g.comments) ? m([
|
|
150
161
|
["comments", e, r],
|
|
151
162
|
["comments-related", e, r]
|
|
152
|
-
]) : (t(
|
|
163
|
+
]) : (t(g.state) || t(g.integrations) || t(g.addendums) || !s.aspectsOnly) && m([["comments-related", e, r]]), t(g.tasks) && m([["tasks", e, r]]), t(g.integrations) && m([
|
|
153
164
|
["erp-submissions", e, r],
|
|
154
165
|
["record-integrations", e, r]
|
|
155
166
|
]), !s.aspectsOnly) {
|
|
156
|
-
if (s.ids.length > 0 && s.ids.every((
|
|
157
|
-
|
|
167
|
+
if (s.ids.length > 0 && s.ids.every((l) => l === "*")) {
|
|
168
|
+
m([
|
|
158
169
|
["item", e, r],
|
|
159
170
|
["pipeline-instance", e, r]
|
|
160
171
|
]);
|
|
161
172
|
return;
|
|
162
173
|
}
|
|
163
|
-
|
|
174
|
+
z(!0);
|
|
164
175
|
}
|
|
165
|
-
},
|
|
166
|
-
|
|
176
|
+
}, z = async (s) => {
|
|
177
|
+
m([
|
|
167
178
|
["item", e, r],
|
|
168
179
|
// Summary mode reads its own copy (#1869) — it diffs + highlights.
|
|
169
180
|
["rrv-record", e, r],
|
|
170
181
|
["field-touch", e, r],
|
|
171
|
-
["revisions", e, r]
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
182
|
+
["revisions", e, r]
|
|
183
|
+
]);
|
|
184
|
+
const t = ["last-touch", e, String(r)];
|
|
185
|
+
await y.invalidateQueries({ queryKey: t }).catch(() => {
|
|
186
|
+
}), !(!s || De(y.getQueryData(t), G.current)) && (j(!0), N.current && clearTimeout(N.current), N.current = setTimeout(() => j(!1), 4e3));
|
|
175
187
|
};
|
|
176
|
-
|
|
177
|
-
const { userId:
|
|
178
|
-
|
|
179
|
-
|
|
188
|
+
ke(e, r, ie);
|
|
189
|
+
const { userId: E } = xe(), G = h(E);
|
|
190
|
+
G.current = E, Re(E, "saved", e, r, () => {
|
|
191
|
+
v.current || (z(!1), m([
|
|
180
192
|
["pipeline-instance", e, r],
|
|
181
193
|
["comments", e, r],
|
|
182
194
|
["tasks", e, r],
|
|
@@ -186,13 +198,13 @@ function He({
|
|
|
186
198
|
]));
|
|
187
199
|
}), k(
|
|
188
200
|
() => () => {
|
|
189
|
-
|
|
201
|
+
N.current && clearTimeout(N.current), S.current && clearTimeout(S.current);
|
|
190
202
|
},
|
|
191
203
|
[]
|
|
192
|
-
),
|
|
204
|
+
), ee(
|
|
193
205
|
"owners:changed",
|
|
194
206
|
() => {
|
|
195
|
-
|
|
207
|
+
v.current || m([
|
|
196
208
|
["pipeline-instance-owners", e, r],
|
|
197
209
|
["pipeline-owners-resolved", e, r],
|
|
198
210
|
["pipeline-all-owners", e, r],
|
|
@@ -200,45 +212,45 @@ function He({
|
|
|
200
212
|
]);
|
|
201
213
|
},
|
|
202
214
|
{ debounceMs: 400 }
|
|
203
|
-
),
|
|
215
|
+
), re(
|
|
204
216
|
"record:integrity",
|
|
205
217
|
e,
|
|
206
218
|
r,
|
|
207
|
-
() =>
|
|
219
|
+
() => m([["record-integrity", e, r]])
|
|
208
220
|
);
|
|
209
|
-
const
|
|
210
|
-
|
|
221
|
+
const J = h(/* @__PURE__ */ new Map());
|
|
222
|
+
re("record:automation", e, r, (s) => {
|
|
211
223
|
const t = String((s == null ? void 0 : s.flow_id) ?? "");
|
|
212
224
|
if (!t) return;
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
const x = () => L((
|
|
216
|
-
const { [t]:
|
|
217
|
-
return
|
|
225
|
+
const a = J.current, l = a.get(t);
|
|
226
|
+
l && clearTimeout(l), a.delete(t);
|
|
227
|
+
const x = () => L((n) => {
|
|
228
|
+
const { [t]: p, ...M } = n;
|
|
229
|
+
return M;
|
|
218
230
|
});
|
|
219
231
|
if ((s == null ? void 0 : s.state) === "end") {
|
|
220
232
|
x();
|
|
221
233
|
return;
|
|
222
234
|
}
|
|
223
|
-
L((
|
|
235
|
+
L((n) => ({ ...n, [t]: String((s == null ? void 0 : s.flow_name) || "An automation") })), a.set(t, setTimeout(x, 5 * 6e4));
|
|
224
236
|
}), k(() => {
|
|
225
|
-
const s =
|
|
237
|
+
const s = J.current;
|
|
226
238
|
return () => {
|
|
227
239
|
for (const t of s.values()) clearTimeout(t);
|
|
228
240
|
s.clear();
|
|
229
241
|
};
|
|
230
|
-
}, []),
|
|
242
|
+
}, []), ee(
|
|
231
243
|
"access:changed",
|
|
232
244
|
() => {
|
|
233
245
|
setTimeout(
|
|
234
246
|
() => {
|
|
235
247
|
var s;
|
|
236
|
-
((s =
|
|
248
|
+
((s = v.current) == null ? void 0 : s.kind) !== "deleted" && T.request(U(`/items/${e}/${r}`, { fields: "id" })).then(() => {
|
|
237
249
|
var t;
|
|
238
|
-
((t =
|
|
250
|
+
((t = v.current) == null ? void 0 : t.kind) === "access" && (R(null), m([["item", e, r]]));
|
|
239
251
|
}).catch((t) => {
|
|
240
|
-
const
|
|
241
|
-
(
|
|
252
|
+
const a = Qe(t);
|
|
253
|
+
(a === 403 || a === 404) && q("access");
|
|
242
254
|
});
|
|
243
255
|
},
|
|
244
256
|
Math.floor(Math.random() * 1500)
|
|
@@ -246,62 +258,62 @@ function He({
|
|
|
246
258
|
},
|
|
247
259
|
{ debounceMs: 300 }
|
|
248
260
|
), k(() => {
|
|
249
|
-
|
|
250
|
-
}, [
|
|
251
|
-
const
|
|
261
|
+
f && !v.current && q("access");
|
|
262
|
+
}, [f]);
|
|
263
|
+
const D = Te(e, r, d, E), [de, W] = w(!1);
|
|
252
264
|
k(() => {
|
|
253
|
-
|
|
254
|
-
}, [
|
|
255
|
-
if (!
|
|
256
|
-
const s = (
|
|
257
|
-
const
|
|
258
|
-
|
|
265
|
+
D.otherDirty || W(!1);
|
|
266
|
+
}, [D.otherDirty]), k(() => {
|
|
267
|
+
if (!c) return;
|
|
268
|
+
const s = (n) => {
|
|
269
|
+
const p = n.detail;
|
|
270
|
+
p != null && p.name && c.emit("record:uploading", {
|
|
259
271
|
collection: e,
|
|
260
272
|
item: String(r),
|
|
261
|
-
name:
|
|
262
|
-
state:
|
|
273
|
+
name: p.name,
|
|
274
|
+
state: p.state
|
|
263
275
|
});
|
|
264
276
|
};
|
|
265
277
|
window.addEventListener("nvr:upload-state", s);
|
|
266
|
-
const t = (
|
|
267
|
-
if ((
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
return
|
|
278
|
+
const t = (n) => {
|
|
279
|
+
if ((n == null ? void 0 : n.collection) !== e || String(n == null ? void 0 : n.item) !== String(r)) return;
|
|
280
|
+
const p = String(n.user_name ?? n.user ?? "Someone");
|
|
281
|
+
se((M) => {
|
|
282
|
+
const Z = M.filter((I) => !(I.user === p && I.name === n.name));
|
|
283
|
+
return n.state === "start" ? [...Z, { user: p, name: String(n.name) }] : Z;
|
|
272
284
|
});
|
|
273
|
-
},
|
|
274
|
-
(
|
|
275
|
-
}), x = (
|
|
285
|
+
}, a = c.on("record:uploading", t), l = c.on("record:comment", (n) => {
|
|
286
|
+
(n == null ? void 0 : n.collection) !== e || String(n == null ? void 0 : n.item) !== String(r) || (y.invalidateQueries({ queryKey: ["comments", e, r] }), y.invalidateQueries({ queryKey: ["comments-related", e, r] }));
|
|
287
|
+
}), x = (n) => t(n.detail);
|
|
276
288
|
return window.addEventListener("nvr:record-uploading", x), () => {
|
|
277
|
-
window.removeEventListener("nvr:upload-state", s), window.removeEventListener("nvr:record-uploading", x),
|
|
289
|
+
window.removeEventListener("nvr:upload-state", s), window.removeEventListener("nvr:record-uploading", x), a(), l();
|
|
278
290
|
};
|
|
279
|
-
}, [
|
|
280
|
-
const
|
|
291
|
+
}, [c, e, r, y]);
|
|
292
|
+
const ce = async () => {
|
|
281
293
|
if (o != null && o.trashId) {
|
|
282
|
-
|
|
294
|
+
F(!0);
|
|
283
295
|
try {
|
|
284
|
-
await
|
|
296
|
+
await T.request(we(`/trash/${o.trashId}/restore`, {})), R(null), _.current = Date.now(), m([["item", e, r]]), O.success("Record restored");
|
|
285
297
|
} catch (s) {
|
|
286
|
-
|
|
298
|
+
O.error(_e(s, "Restore failed"));
|
|
287
299
|
} finally {
|
|
288
|
-
|
|
300
|
+
F(!1);
|
|
289
301
|
}
|
|
290
302
|
}
|
|
291
|
-
},
|
|
292
|
-
return !o &&
|
|
293
|
-
(o == null ? void 0 : o.kind) === "deleted" && /* @__PURE__ */
|
|
303
|
+
}, K = Object.values(ae), X = D.otherDirty && !de && !d && !o;
|
|
304
|
+
return !o && K.length === 0 && !X && !P && (!c || !A && C.length === 0) ? null : /* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
305
|
+
(o == null ? void 0 : o.kind) === "deleted" && /* @__PURE__ */ u(
|
|
294
306
|
"div",
|
|
295
307
|
{
|
|
296
308
|
"data-record-gone": "deleted",
|
|
297
309
|
role: "alert",
|
|
298
310
|
className: "flex items-center gap-3 rounded-lg border border-rose-300 bg-rose-50 px-3.5 py-2.5 dark:border-rose-500/40 dark:bg-rose-500/10",
|
|
299
311
|
children: [
|
|
300
|
-
/* @__PURE__ */ i(
|
|
301
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ i(be, { className: "h-4 w-4 shrink-0 text-rose-500" }),
|
|
313
|
+
/* @__PURE__ */ u("p", { className: "min-w-0 flex-1 text-[12px] text-rose-800 dark:text-rose-300", children: [
|
|
302
314
|
/* @__PURE__ */ i("span", { className: "font-semibold", children: "This record was deleted" }),
|
|
303
315
|
o.by ? ` by ${o.by}` : "",
|
|
304
|
-
o.at ? ` ${
|
|
316
|
+
o.at ? ` ${$e(o.at)}` : "",
|
|
305
317
|
". Saving is turned off",
|
|
306
318
|
o.canRestore ? " — restore it to keep working." : "."
|
|
307
319
|
] }),
|
|
@@ -309,29 +321,29 @@ function He({
|
|
|
309
321
|
"button",
|
|
310
322
|
{
|
|
311
323
|
type: "button",
|
|
312
|
-
onClick: () => void
|
|
313
|
-
disabled:
|
|
324
|
+
onClick: () => void ce(),
|
|
325
|
+
disabled: B,
|
|
314
326
|
className: "h-7 shrink-0 rounded-md border border-rose-300 bg-white px-2.5 text-[11.5px] font-medium text-rose-700 hover:bg-rose-100 disabled:opacity-50 dark:border-rose-500/40 dark:bg-transparent dark:text-rose-300 dark:hover:bg-rose-500/10",
|
|
315
|
-
children:
|
|
327
|
+
children: B ? "Restoring…" : "Restore"
|
|
316
328
|
}
|
|
317
329
|
)
|
|
318
330
|
]
|
|
319
331
|
}
|
|
320
332
|
),
|
|
321
|
-
(o == null ? void 0 : o.kind) === "access" && !
|
|
322
|
-
|
|
333
|
+
(o == null ? void 0 : o.kind) === "access" && !b && /* @__PURE__ */ i(Le, { onBack: () => window.history.back() }),
|
|
334
|
+
X && /* @__PURE__ */ u(
|
|
323
335
|
"div",
|
|
324
336
|
{
|
|
325
337
|
"data-record-other-tab": !0,
|
|
326
338
|
className: "flex items-center gap-3 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10",
|
|
327
339
|
children: [
|
|
328
|
-
/* @__PURE__ */ i(
|
|
340
|
+
/* @__PURE__ */ i(fe, { className: "h-4 w-4 shrink-0 text-amber-500" }),
|
|
329
341
|
/* @__PURE__ */ i("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: "This record is open with unsaved changes in another tab — editing it here too may overwrite them." }),
|
|
330
342
|
/* @__PURE__ */ i(
|
|
331
343
|
"button",
|
|
332
344
|
{
|
|
333
345
|
type: "button",
|
|
334
|
-
onClick:
|
|
346
|
+
onClick: D.focusOther,
|
|
335
347
|
className: "h-7 shrink-0 rounded-md border border-amber-300 bg-white px-2.5 text-[11.5px] font-medium text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-300 dark:hover:bg-amber-500/10",
|
|
336
348
|
children: "Switch to that tab"
|
|
337
349
|
}
|
|
@@ -340,7 +352,7 @@ function He({
|
|
|
340
352
|
"button",
|
|
341
353
|
{
|
|
342
354
|
type: "button",
|
|
343
|
-
onClick: () =>
|
|
355
|
+
onClick: () => W(!0),
|
|
344
356
|
className: "h-7 shrink-0 rounded-md px-2 text-[11.5px] text-amber-700 hover:bg-amber-100 dark:text-amber-300 dark:hover:bg-amber-500/10",
|
|
345
357
|
children: "Dismiss"
|
|
346
358
|
}
|
|
@@ -348,51 +360,51 @@ function He({
|
|
|
348
360
|
]
|
|
349
361
|
}
|
|
350
362
|
),
|
|
351
|
-
|
|
363
|
+
P && !o && /* @__PURE__ */ u(
|
|
352
364
|
"div",
|
|
353
365
|
{
|
|
354
366
|
"data-record-importing": !0,
|
|
355
367
|
role: "status",
|
|
356
368
|
className: "flex items-center gap-3 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10",
|
|
357
369
|
children: [
|
|
358
|
-
/* @__PURE__ */ i(
|
|
359
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ i(pe, { className: "h-4 w-4 shrink-0 animate-pulse text-amber-500" }),
|
|
371
|
+
/* @__PURE__ */ u("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: [
|
|
360
372
|
/* @__PURE__ */ i("span", { className: "font-semibold", children: "An import is updating this record" }),
|
|
361
373
|
" — the changed fields refresh here as it goes.",
|
|
362
|
-
|
|
374
|
+
d ? " Your unsaved edits may be out of date; check them before saving." : ""
|
|
363
375
|
] })
|
|
364
376
|
]
|
|
365
377
|
}
|
|
366
378
|
),
|
|
367
|
-
|
|
379
|
+
K.length > 0 && !o && /* @__PURE__ */ u(
|
|
368
380
|
"div",
|
|
369
381
|
{
|
|
370
382
|
"data-record-automation": !0,
|
|
371
383
|
role: "status",
|
|
372
384
|
className: "flex items-center gap-3 rounded-lg border border-nvr-cyan/40 bg-nvr-cyan/10 px-3.5 py-2.5",
|
|
373
385
|
children: [
|
|
374
|
-
/* @__PURE__ */ i(
|
|
375
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ i(he, { className: "h-4 w-4 shrink-0 animate-pulse text-nvr-cyan" }),
|
|
387
|
+
/* @__PURE__ */ u("p", { className: "min-w-0 flex-1 text-[12px] text-[#0e7490] dark:text-[#67e8f9]", children: [
|
|
376
388
|
/* @__PURE__ */ i("span", { className: "font-semibold", children: "Automation is updating this record" }),
|
|
377
389
|
" —",
|
|
378
390
|
" ",
|
|
379
|
-
|
|
391
|
+
K.join(", "),
|
|
380
392
|
". Its changes appear here when it finishes."
|
|
381
393
|
] })
|
|
382
394
|
]
|
|
383
395
|
}
|
|
384
396
|
),
|
|
385
|
-
|
|
386
|
-
|
|
397
|
+
c && (A || C.length > 0) && /* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
398
|
+
A && /* @__PURE__ */ u("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-2.5 py-0.5 text-[11px] font-medium text-[#0e7490] dark:text-[#67e8f9]", children: [
|
|
387
399
|
/* @__PURE__ */ i("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
|
|
388
400
|
"Updated just now by someone else"
|
|
389
401
|
] }),
|
|
390
|
-
|
|
402
|
+
C.map((s) => /* @__PURE__ */ u(
|
|
391
403
|
"span",
|
|
392
404
|
{
|
|
393
405
|
className: "inline-flex items-center gap-1.5 rounded-full border border-slate-200 bg-white px-2.5 py-0.5 text-[11px] text-slate-600 dark:border-border dark:bg-card dark:text-slate-300",
|
|
394
406
|
children: [
|
|
395
|
-
/* @__PURE__ */ i(
|
|
407
|
+
/* @__PURE__ */ i(ge, { className: "h-3 w-3 animate-pulse text-nvr-cyan" }),
|
|
396
408
|
s.user,
|
|
397
409
|
" is uploading “",
|
|
398
410
|
s.name.length > 32 ? `${s.name.slice(0, 32)}…` : s.name,
|
|
@@ -405,9 +417,11 @@ function He({
|
|
|
405
417
|
] });
|
|
406
418
|
}
|
|
407
419
|
export {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
420
|
+
te as RECORD_QUERY_HEADS,
|
|
421
|
+
Le as RecordAccessLostPanel,
|
|
422
|
+
Ge as RecordLiveSync,
|
|
423
|
+
ze as invalidateRecordQueries,
|
|
424
|
+
Ee as moveNotice,
|
|
425
|
+
Ce as purgeRecordQueries,
|
|
426
|
+
De as writtenBySelf
|
|
413
427
|
};
|