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