@nivaro/react 0.3.99 → 0.3.101
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/useFormSchema.js +82 -85
- package/dist/hooks/useSessionRecorder.js +206 -175
- package/dist/index.d.ts +84 -16
- package/dist/index.js +627 -622
- package/dist/lib/commands.js +15 -11
- package/dist/shared/components/ActivityEntry.js +5 -5
- package/dist/shared/components/CollectionBrowserView.js +516 -503
- package/dist/shared/components/ItemEditForm.js +3471 -3465
- package/dist/shared/components/JobsTray.js +76 -61
- package/dist/shared/components/MyWorkView.js +133 -126
- package/dist/shared/components/NotificationBell.js +322 -289
- package/dist/shared/components/RecordCompare.js +38 -40
- package/dist/shared/components/RecordReadView.js +119 -119
- package/dist/shared/components/TipLayer.js +56 -41
- package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
- package/dist/shared/components/integrations/console/SignalCard.js +40 -40
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
- package/dist/shared/components/integrations/console/drill/status.js +23 -18
- package/dist/shared/components/item-edit/InlineGridField.js +45 -45
- package/dist/shared/components/item-edit/InlineTableField.js +750 -749
- package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
- package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
- package/dist/shared/components/item-edit/RecordInsights.js +86 -86
- package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
- package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
- package/dist/shared/components/item-edit/header-path-preview.js +46 -34
- package/dist/shared/components/item-edit/related-missing.js +75 -19
- package/dist/shared/components/notifications/DeliveryChips.js +1 -2
- package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
- package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
- package/dist/shared/components/panels/BackgroundMove.js +242 -0
- package/dist/shared/components/panels/MoveAdvisory.js +204 -0
- package/dist/shared/components/panels/PipelinePanel.js +1459 -1220
- package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
- package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
- package/dist/shared/components/profile/DayTimeline.js +145 -140
- package/dist/shared/components/profile/PersonAccess.js +679 -383
- package/dist/shared/components/profile/PersonActivity.js +404 -427
- package/dist/shared/components/profile/PersonDidPanel.js +248 -134
- package/dist/shared/components/profile/PersonProfile.js +33 -32
- package/dist/shared/components/profile/journey-view.js +166 -0
- package/dist/shared/lib/activity-sentence.js +319 -236
- package/dist/shared/lib/commands.js +18 -14
- package/dist/shared/lib/error-hints.js +1 -1
- package/dist/shared/lib/job-failure-text.js +12 -0
- package/dist/shared/lib/jobs-tray.js +60 -41
- package/dist/shared/lib/move-failure.js +19 -0
- package/dist/shared/lib/obligation-banner.js +22 -21
- package/dist/shared/lib/partner-failure.js +83 -0
- package/dist/shared/lib/prefetch.js +73 -73
- package/dist/shared/lib/replay-checkout.js +18 -13
- package/dist/shared/lib/replay-context.js +90 -77
- package/dist/shared/lib/replay-idle.js +21 -0
- package/dist/shared/lib/replay-socket.js +21 -17
- package/dist/shared/lib/rum.js +56 -51
- package/dist/shared/lib/safe-error.js +17 -13
- package/dist/shared/lib/stale-chunk.js +69 -26
- package/dist/shared/lib/system-collections.js +20 -0
- package/package.json +1 -1
|
@@ -10,10 +10,10 @@ import { toastError as Jt } from "../lib/error-toast.js";
|
|
|
10
10
|
import { readGroupStructure as Qt, isFolded as Yt, isEmptyValue as ye, planFieldGrid as zt } from "../lib/form-structure.js";
|
|
11
11
|
import { quietHiddenSectionsOf as Xt } from "../lib/layout-resolve.js";
|
|
12
12
|
import { useLiveRecord as Zt } from "../lib/live.js";
|
|
13
|
-
import { isDisplayFormulaField as
|
|
13
|
+
import { isDisplayFormulaField as Te, resolvePlacementText as el, displayFormulaOf as tl, formatDisplayValue as ll } from "../lib/placement-behaviour.js";
|
|
14
14
|
import { invalidateRecordRow as rl, useRecordReader as nl } from "../lib/record-loader.js";
|
|
15
15
|
import { sanitizeHtml as al } from "../lib/sanitize-html.js";
|
|
16
|
-
import { titleCase as Ze, formatRelative as
|
|
16
|
+
import { titleCase as Ze, formatRelative as Ce } from "../lib/utils.js";
|
|
17
17
|
import { matchesVisibleWhen as il } from "../lib/visible-when.js";
|
|
18
18
|
import { InboundRequestPopover as sl } from "./integrations/InboundRequest.js";
|
|
19
19
|
import { FileM2MField as dl } from "./item-edit/FilePickerField.js";
|
|
@@ -23,16 +23,16 @@ import { isNamelessLabel as ul, NAMELESS_LABEL as ml } from "./item-edit/option-
|
|
|
23
23
|
import { PersonalDefaultMark as bt } from "./item-edit/PersonalDefaultControl.js";
|
|
24
24
|
import { usePlacementTextContext as fl, evaluateDisplayFormula as pl } from "./item-edit/placement-behaviour.js";
|
|
25
25
|
import { RuleHiddenNotes as hl } from "./item-edit/RuleHiddenNotes.js";
|
|
26
|
-
import {
|
|
27
|
-
import { ruleHiddenGroups as
|
|
26
|
+
import { RELATED_LOADING_CLASS as bl, RelatedMissingLabel as gl } from "./item-edit/related-missing.js";
|
|
27
|
+
import { ruleHiddenGroups as yl, groupHasReadableField as xl } from "./item-edit/rule-hidden.js";
|
|
28
28
|
import { UserChip as _t } from "./item-edit/UserChip.js";
|
|
29
|
-
import { DesignNode as
|
|
30
|
-
import { DesignCanvas as
|
|
31
|
-
import { revealGroupKey as
|
|
32
|
-
import { choiceLabelsFrom as
|
|
33
|
-
import { useRecordIntegrity as
|
|
29
|
+
import { DesignNode as vl } from "./layout-editor/DesignNode.js";
|
|
30
|
+
import { DesignCanvas as _l } from "./layout-editor/design-canvas.js";
|
|
31
|
+
import { revealGroupKey as kl } from "./layout-editor/design-context.js";
|
|
32
|
+
import { choiceLabelsFrom as Nl } from "./layout-editor/overview/describe-conditions.js";
|
|
33
|
+
import { useRecordIntegrity as wl, integrityByField as Sl } from "./panels/RecordIntegrityBanner.js";
|
|
34
34
|
import { SimpleSelectXs as gt } from "./ui/SimpleSelect.js";
|
|
35
|
-
import { WidgetSlot as
|
|
35
|
+
import { WidgetSlot as $l } from "./WidgetSlot.js";
|
|
36
36
|
const xe = (a) => {
|
|
37
37
|
if (!a) return {};
|
|
38
38
|
if (typeof a == "object") return a;
|
|
@@ -41,8 +41,8 @@ const xe = (a) => {
|
|
|
41
41
|
} catch {
|
|
42
42
|
return {};
|
|
43
43
|
}
|
|
44
|
-
},
|
|
45
|
-
function
|
|
44
|
+
}, Fl = 3;
|
|
45
|
+
function ql(a) {
|
|
46
46
|
let u = a;
|
|
47
47
|
if (typeof u == "string")
|
|
48
48
|
try {
|
|
@@ -74,7 +74,7 @@ const kt = (a) => {
|
|
|
74
74
|
}, Ue = (a) => {
|
|
75
75
|
const u = Number(a);
|
|
76
76
|
return Number.isNaN(u) ? String(a) : u.toLocaleString("en-US");
|
|
77
|
-
}, Ie = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", le = () => /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }),
|
|
77
|
+
}, Ie = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", le = () => /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), Al = `
|
|
78
78
|
[data-read-board]{grid-template-columns:minmax(0,1fr)}
|
|
79
79
|
[data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
80
80
|
@media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
|
|
@@ -102,7 +102,7 @@ function Ve({
|
|
|
102
102
|
}
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Ll({ collection: a, id: u }) {
|
|
106
106
|
const b = ke(), s = nl(), F = vt(), { data: N } = V({
|
|
107
107
|
queryKey: ["cbv-collection-meta", a],
|
|
108
108
|
queryFn: () => b.request(
|
|
@@ -112,7 +112,7 @@ function Al({ collection: a, id: u }) {
|
|
|
112
112
|
retry: !1
|
|
113
113
|
}), {
|
|
114
114
|
data: _,
|
|
115
|
-
isPending:
|
|
115
|
+
isPending: T,
|
|
116
116
|
error: q
|
|
117
117
|
} = V({
|
|
118
118
|
queryKey: ["rrv-related", a, String(u)],
|
|
@@ -122,12 +122,12 @@ function Al({ collection: a, id: u }) {
|
|
|
122
122
|
retry: !1
|
|
123
123
|
});
|
|
124
124
|
if (u == null) return /* @__PURE__ */ t(le, {});
|
|
125
|
-
if (!_ && !q && (
|
|
126
|
-
return /* @__PURE__ */ t("span", { className:
|
|
127
|
-
if (!_) return /* @__PURE__ */ t(
|
|
125
|
+
if (!_ && !q && (T || !N))
|
|
126
|
+
return /* @__PURE__ */ t("span", { className: bl });
|
|
127
|
+
if (!_) return /* @__PURE__ */ t(gl, { error: q, collection: a, id: u });
|
|
128
128
|
let f = "";
|
|
129
|
-
const
|
|
130
|
-
if (
|
|
129
|
+
const O = N == null ? void 0 : N.display_template;
|
|
130
|
+
if (O && (f = O.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (A, j) => {
|
|
131
131
|
const w = j.split(".").reduce((x, g) => x == null ? void 0 : x[g], _);
|
|
132
132
|
return w == null ? "" : String(w);
|
|
133
133
|
}).trim()), !f) {
|
|
@@ -181,7 +181,7 @@ function Ol({ id: a }) {
|
|
|
181
181
|
}
|
|
182
182
|
);
|
|
183
183
|
}
|
|
184
|
-
const tt = ({ collection: a, id: u }) => a === "nivaro_files" ? /* @__PURE__ */ t(Ol, { id: u }) : /* @__PURE__ */ t(
|
|
184
|
+
const tt = ({ collection: a, id: u }) => a === "nivaro_files" ? /* @__PURE__ */ t(Ol, { id: u }) : /* @__PURE__ */ t(Ll, { collection: a, id: u });
|
|
185
185
|
function Rl({
|
|
186
186
|
junction: a,
|
|
187
187
|
parentFk: u,
|
|
@@ -192,14 +192,14 @@ function Rl({
|
|
|
192
192
|
relation: _
|
|
193
193
|
}) {
|
|
194
194
|
var W;
|
|
195
|
-
const
|
|
195
|
+
const T = ke(), { data: q } = V({
|
|
196
196
|
queryKey: ["cbv-collection-meta", a],
|
|
197
|
-
queryFn: () =>
|
|
197
|
+
queryFn: () => T.request(Y(`/collections/${a}`)).then((v) => v.data),
|
|
198
198
|
staleTime: 10 * 6e4,
|
|
199
199
|
retry: !1
|
|
200
200
|
}), f = ((q == null ? void 0 : q.relations) ?? []).find(
|
|
201
201
|
(v) => v.many_collection === a && v.many_field === b
|
|
202
|
-
),
|
|
202
|
+
), O = Ht(f == null ? void 0 : f.one_allowed_collections), A = !!f && !f.one_collection && (O.length > 0 || !!f.one_collection_field), j = (f == null ? void 0 : f.one_collection_field) ?? "collection", w = (v) => v ? v === "directus_users" ? "nivaro_users" : v : null, x = (f == null ? void 0 : f.one_collection) ?? (A ? O.some((v) => v === "directus_users" || v === "nivaro_users") ? "nivaro_users" : w(O[0]) : null), { data: g } = V({
|
|
203
203
|
// Under the edit form's ['m2m-items', junction, parentFk, parentId] prefix (a longer key,
|
|
204
204
|
// so never the same cache entry): every link write that refreshes the form's list —
|
|
205
205
|
// a file upload, a picker change, the save itself — refreshes Summary's too. Its own
|
|
@@ -213,7 +213,7 @@ function Rl({
|
|
|
213
213
|
b,
|
|
214
214
|
A ? j : ""
|
|
215
215
|
],
|
|
216
|
-
queryFn: () =>
|
|
216
|
+
queryFn: () => T.request(
|
|
217
217
|
Y(`/items/${a}`, {
|
|
218
218
|
filter: JSON.stringify({ [u]: { _eq: s } }),
|
|
219
219
|
fields: A ? `id,${b},${j}` : `id,${b}`,
|
|
@@ -232,12 +232,12 @@ function Rl({
|
|
|
232
232
|
enabled: !!q,
|
|
233
233
|
staleTime: 3e4,
|
|
234
234
|
retry: !1
|
|
235
|
-
}),
|
|
235
|
+
}), C = g == null ? void 0 : g.map((v) => v.id), S = x ?? (A ? ((W = g == null ? void 0 : g.find((v) => v.collection)) == null ? void 0 : W.collection) ?? null : null), D = C == null ? void 0 : C.length;
|
|
236
236
|
return _e(() => {
|
|
237
237
|
D !== void 0 && (F == null || F(D));
|
|
238
238
|
}, [D, F]), _e(() => {
|
|
239
239
|
S && (N == null || N(S));
|
|
240
|
-
}, [S, N]), q && !S && (!A || g) ? /* @__PURE__ */ t(le, {}) : !
|
|
240
|
+
}, [S, N]), q && !S && (!A || g) ? /* @__PURE__ */ t(le, {}) : !C || !S ? /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : C.length === 0 ? /* @__PURE__ */ t(le, {}) : S === "nivaro_files" && _ ? /* @__PURE__ */ t("div", { className: "mt-1", children: /* @__PURE__ */ t(
|
|
241
241
|
dl,
|
|
242
242
|
{
|
|
243
243
|
relation: _,
|
|
@@ -251,7 +251,7 @@ function Rl({
|
|
|
251
251
|
className: "inline-flex items-center whitespace-nowrap",
|
|
252
252
|
children: [
|
|
253
253
|
/* @__PURE__ */ t(tt, { collection: k ?? S, id: v }),
|
|
254
|
-
$ <
|
|
254
|
+
$ < C.length - 1 && /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
|
|
255
255
|
]
|
|
256
256
|
},
|
|
257
257
|
`${k ?? S}:${v}`
|
|
@@ -266,14 +266,14 @@ function Tl({
|
|
|
266
266
|
defaultPreset: N,
|
|
267
267
|
onCount: _
|
|
268
268
|
}) {
|
|
269
|
-
const
|
|
269
|
+
const T = ke(), q = vt(), f = (F ?? []).filter((l) => l && Array.isArray(l.columns)), [O, A] = Q(
|
|
270
270
|
() => {
|
|
271
271
|
var l;
|
|
272
272
|
return f.length >= 2 ? ((l = f.find((d) => d.name === N)) == null ? void 0 : l.name) ?? f[0].name : "__all__";
|
|
273
273
|
}
|
|
274
274
|
), { data: j } = V({
|
|
275
275
|
queryKey: ["cbv-collection-meta", a],
|
|
276
|
-
queryFn: () =>
|
|
276
|
+
queryFn: () => T.request(Y(`/collections/${a}`)).then((l) => l.data),
|
|
277
277
|
staleTime: 10 * 6e4,
|
|
278
278
|
retry: !1
|
|
279
279
|
}), w = (l) => {
|
|
@@ -283,7 +283,7 @@ function Tl({
|
|
|
283
283
|
)) == null ? void 0 : d.one_collection) ?? null;
|
|
284
284
|
}, { data: x } = V({
|
|
285
285
|
queryKey: ["rrv-cols", a, s ?? null],
|
|
286
|
-
queryFn: () =>
|
|
286
|
+
queryFn: () => T.request(
|
|
287
287
|
Y(`/field-config/${a}`, s ? { layout_id: s } : {})
|
|
288
288
|
).then((l) => ({
|
|
289
289
|
// Lines carry their own number — sort by it and show it first.
|
|
@@ -301,11 +301,11 @@ function Tl({
|
|
|
301
301
|
"timestamp",
|
|
302
302
|
"uuid"
|
|
303
303
|
].includes(d.type ?? ""))
|
|
304
|
-
).filter((d, o, h) => h.findIndex((
|
|
304
|
+
).filter((d, o, h) => h.findIndex((R) => R.field === d.field) === o)
|
|
305
305
|
})),
|
|
306
306
|
staleTime: 5 * 6e4,
|
|
307
307
|
retry: !1
|
|
308
|
-
}), g = (x == null ? void 0 : x.cols) ?? [],
|
|
308
|
+
}), g = (x == null ? void 0 : x.cols) ?? [], C = !!(x != null && x.lineNo), S = O !== "__all__" ? f.find((l) => l.name === O) : null, D = ve(() => {
|
|
309
309
|
if (!S) return g;
|
|
310
310
|
const l = new Set(S.columns), d = g.filter((o) => l.has(o.field));
|
|
311
311
|
return d.length > 0 ? d : g;
|
|
@@ -315,7 +315,7 @@ function Tl({
|
|
|
315
315
|
];
|
|
316
316
|
for (const [d, o] of Object.entries(Z)) {
|
|
317
317
|
if (!(o != null && o.value.trim())) continue;
|
|
318
|
-
const h = o.value.trim(),
|
|
318
|
+
const h = o.value.trim(), R = Number(h), M = o.op === "_contains" ? h : h === "true" || h === "false" ? h === "true" : Number.isNaN(R) ? h : R;
|
|
319
319
|
l.push({ path: [d], op: o.op, value: M });
|
|
320
320
|
}
|
|
321
321
|
return JSON.stringify(l);
|
|
@@ -324,12 +324,12 @@ function Tl({
|
|
|
324
324
|
isLoading: fe,
|
|
325
325
|
isFetching: Ee
|
|
326
326
|
} = V({
|
|
327
|
-
queryKey: ["rrv-rows", a, u, b, W,
|
|
328
|
-
queryFn: () =>
|
|
327
|
+
queryKey: ["rrv-rows", a, u, b, W, C, k, De],
|
|
328
|
+
queryFn: () => T.request(
|
|
329
329
|
Y(`/items/${a}`, {
|
|
330
330
|
limit: m,
|
|
331
331
|
page: k,
|
|
332
|
-
...W ? { sort: W } :
|
|
332
|
+
...W ? { sort: W } : C ? { sort: "line_number" } : {},
|
|
333
333
|
conditions: De
|
|
334
334
|
})
|
|
335
335
|
),
|
|
@@ -347,7 +347,7 @@ function Tl({
|
|
|
347
347
|
pe.map((l) => l.field).join(","),
|
|
348
348
|
he.join(",")
|
|
349
349
|
],
|
|
350
|
-
queryFn: () =>
|
|
350
|
+
queryFn: () => T.request(
|
|
351
351
|
Y(`/items/${a}/resolve-paths`, {
|
|
352
352
|
ids: he.join(","),
|
|
353
353
|
paths: pe.map((l) => l.field).join(",")
|
|
@@ -355,10 +355,10 @@ function Tl({
|
|
|
355
355
|
).then((l) => l.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
|
|
356
356
|
enabled: pe.length > 0 && he.length > 0,
|
|
357
357
|
staleTime: 3e4
|
|
358
|
-
}), P =
|
|
358
|
+
}), P = C && E.some((l) => l.line_number != null), se = Math.max(1, Math.ceil(ee / m)), de = (l, d, o) => {
|
|
359
359
|
$(1), B((h) => {
|
|
360
|
-
const
|
|
361
|
-
return o ?
|
|
360
|
+
const R = { ...h };
|
|
361
|
+
return o ? R[l] = { op: d, value: o } : delete R[l], R;
|
|
362
362
|
});
|
|
363
363
|
}, Be = (l) => {
|
|
364
364
|
$(1), v((d) => d === l ? `-${l}` : d === `-${l}` ? "" : l);
|
|
@@ -404,8 +404,8 @@ function Tl({
|
|
|
404
404
|
if (d.type === "decimal" || d.type === "float") return et(o);
|
|
405
405
|
if (d.type === "integer") return Ue(o);
|
|
406
406
|
if (d.type === "date" || d.type === "datetime" || d.type === "timestamp") return kt(o);
|
|
407
|
-
const
|
|
408
|
-
return
|
|
407
|
+
const R = String(o);
|
|
408
|
+
return R.length > 48 ? `${R.slice(0, 48)}…` : R;
|
|
409
409
|
}, oe = (l) => ["decimal", "float", "integer"].includes(l.type ?? "") && !w(l.field) && !l.field.includes("."), Pe = (l) => {
|
|
410
410
|
const d = l.options;
|
|
411
411
|
if (!d) return {};
|
|
@@ -425,8 +425,8 @@ function Tl({
|
|
|
425
425
|
const o = E.map((M) => Number(M[l.field])).filter((M) => !Number.isNaN(M));
|
|
426
426
|
let h = null;
|
|
427
427
|
if (d === "count" ? h = E.length : o.length > 0 && (d === "sum" ? h = o.reduce((M, re) => M + re, 0) : d === "avg" ? h = o.reduce((M, re) => M + re, 0) / o.length : d === "min" ? h = Math.min(...o) : d === "max" && (h = Math.max(...o))), h === null) return "—";
|
|
428
|
-
const
|
|
429
|
-
return d === "count" ||
|
|
428
|
+
const R = Pe(l).format;
|
|
429
|
+
return d === "count" || R === "int" ? Ue(Math.round(h)) : R === "currency" || l.type === "decimal" || l.type === "float" ? et(h) : d === "avg" ? h.toFixed(2) : Ue(h);
|
|
430
430
|
}, Se = (l) => !w(l.field) && !l.field.includes("."), Ke = (l) => w(l.field) || l.field.includes(".") ? null : l.type === "boolean" ? "bool" : ["integer", "decimal", "float"].includes(l.type ?? "") ? "num" : ["string", "text"].includes(l.type ?? "") ? "text" : null, $e = D.some((l) => Ke(l) != null);
|
|
431
431
|
return /* @__PURE__ */ p("div", { children: [
|
|
432
432
|
f.length >= 2 && /* @__PURE__ */ t("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
|
|
@@ -437,8 +437,8 @@ function Tl({
|
|
|
437
437
|
{
|
|
438
438
|
type: "button",
|
|
439
439
|
onClick: () => A(l.name),
|
|
440
|
-
"aria-pressed":
|
|
441
|
-
className: `rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors ${
|
|
440
|
+
"aria-pressed": O === l.name,
|
|
441
|
+
className: `rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors ${O === l.name ? "border-nvr-cyan bg-nvr-cyan/10 text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-400 dark:hover:bg-slate-800"}`,
|
|
442
442
|
children: l.label
|
|
443
443
|
},
|
|
444
444
|
l.name
|
|
@@ -652,22 +652,22 @@ function yt({
|
|
|
652
652
|
flush: F,
|
|
653
653
|
renderSlot: N,
|
|
654
654
|
integrityMarks: _,
|
|
655
|
-
renderGrid:
|
|
655
|
+
renderGrid: T,
|
|
656
656
|
onEditSection: q,
|
|
657
657
|
gridCounts: f
|
|
658
658
|
}) {
|
|
659
659
|
var dt;
|
|
660
|
-
const
|
|
660
|
+
const O = ke(), A = fl(), j = s ? s.record ?? {} : null, w = !!(s != null && s.context.showHidden), x = s ? String(((dt = s.record) == null ? void 0 : dt.id) ?? "") : u ?? "", g = ve(
|
|
661
661
|
() => s ? {
|
|
662
662
|
...s.layout,
|
|
663
663
|
layout: s.layout.layout ?? { id: 0, name: "" }
|
|
664
664
|
} : b,
|
|
665
665
|
[s, b]
|
|
666
|
-
),
|
|
667
|
-
kind:
|
|
666
|
+
), C = (e) => ({
|
|
667
|
+
kind: Te(e.field) ? "slot" : "field",
|
|
668
668
|
field: e.field,
|
|
669
669
|
group_key: e.group_key ?? null
|
|
670
|
-
}), S = (e, r, i = !1) => s ? /* @__PURE__ */ t(
|
|
670
|
+
}), S = (e, r, i = !1) => s ? /* @__PURE__ */ t(vl, { target: e, children: i ? /* @__PURE__ */ t("div", { "data-design-hidden": !0, className: "opacity-40", children: r }) : r }) : r, D = ve(
|
|
671
671
|
() => [
|
|
672
672
|
...new Set(
|
|
673
673
|
(s ? [] : (g == null ? void 0 : g.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
|
|
@@ -691,14 +691,14 @@ function yt({
|
|
|
691
691
|
type: "button",
|
|
692
692
|
"data-field-touch": e,
|
|
693
693
|
"data-field-touch-caller": r.caller.key,
|
|
694
|
-
"data-tip": `Changed ${
|
|
695
|
-
"aria-label": `Changed ${
|
|
694
|
+
"data-tip": `Changed ${Ce(r.at)} by ${r.caller.name} (through the API) — click for the request`,
|
|
695
|
+
"aria-label": `Changed ${Ce(r.at)} by ${r.caller.name} through the API`,
|
|
696
696
|
className: "ml-1 inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 align-middle text-[9.5px] font-medium leading-4 text-amber-800 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300 dark:hover:bg-amber-400/20",
|
|
697
697
|
children: [
|
|
698
698
|
/* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400", "aria-hidden": !0 }),
|
|
699
699
|
r.caller.name,
|
|
700
700
|
" · ",
|
|
701
|
-
|
|
701
|
+
Ce(r.at)
|
|
702
702
|
]
|
|
703
703
|
}
|
|
704
704
|
)
|
|
@@ -707,14 +707,14 @@ function yt({
|
|
|
707
707
|
"span",
|
|
708
708
|
{
|
|
709
709
|
"data-field-touch": e,
|
|
710
|
-
"data-tip": `Changed ${
|
|
710
|
+
"data-tip": `Changed ${Ce(r.at)} by ${r.who}${i ? ` · ${r.via}` : ""}`,
|
|
711
711
|
role: "img",
|
|
712
|
-
"aria-label": `Changed ${
|
|
712
|
+
"aria-label": `Changed ${Ce(r.at)} by ${r.who}`,
|
|
713
713
|
className: `ml-1 inline-block h-1.5 w-1.5 rounded-full align-middle ${i ? "bg-amber-400" : "bg-slate-300 dark:bg-slate-600"}`
|
|
714
714
|
}
|
|
715
715
|
);
|
|
716
|
-
}, { data: k } =
|
|
717
|
-
() => _ && (k != null && k.enabled) ?
|
|
716
|
+
}, { data: k } = wl(a, x, !!_ && !s), $ = ve(
|
|
717
|
+
() => _ && (k != null && k.enabled) ? Sl(k.findings) : null,
|
|
718
718
|
[_, k]
|
|
719
719
|
), ie = ({ field: e }) => {
|
|
720
720
|
const r = $ == null ? void 0 : $.get(e);
|
|
@@ -734,7 +734,7 @@ function yt({
|
|
|
734
734
|
);
|
|
735
735
|
}, { data: B } = V({
|
|
736
736
|
queryKey: ["cbv-collection-meta", a],
|
|
737
|
-
queryFn: () =>
|
|
737
|
+
queryFn: () => O.request(
|
|
738
738
|
Y(`/collections/${a}`)
|
|
739
739
|
).then((e) => e.data),
|
|
740
740
|
staleTime: 10 * 6e4,
|
|
@@ -742,7 +742,7 @@ function yt({
|
|
|
742
742
|
}), Z = xt(), { data: De } = V({
|
|
743
743
|
queryKey: ["rrv-record", a, x],
|
|
744
744
|
enabled: !s,
|
|
745
|
-
queryFn: () =>
|
|
745
|
+
queryFn: () => O.request(Y(`/items/${a}/${x}`)).then((e) => e.data),
|
|
746
746
|
initialData: () => Z.getQueryData(["item", a, x]) ?? void 0,
|
|
747
747
|
initialDataUpdatedAt: () => {
|
|
748
748
|
var e;
|
|
@@ -769,7 +769,7 @@ function yt({
|
|
|
769
769
|
const E = (e) => fe.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: ee } = V({
|
|
770
770
|
queryKey: ["rrv-field-config", a, g.layout.id],
|
|
771
771
|
enabled: !s,
|
|
772
|
-
queryFn: () =>
|
|
772
|
+
queryFn: () => O.request(
|
|
773
773
|
Y(`/field-config/${a}`, { layout_id: g.layout.id })
|
|
774
774
|
).then((e) => e.data ?? []).catch(() => null),
|
|
775
775
|
staleTime: 5 * 6e4,
|
|
@@ -788,7 +788,7 @@ function yt({
|
|
|
788
788
|
var r;
|
|
789
789
|
return !((e.is_visible === void 0 || e.is_visible) && xe(e.overrides).hidden !== !0 && !((r = U.get(e.field)) != null && r.hidden));
|
|
790
790
|
}, se = g.assignments.filter(
|
|
791
|
-
(e) => (!e.field.startsWith("__") ||
|
|
791
|
+
(e) => (!e.field.startsWith("__") || Te(e.field)) && (w || !P(e))
|
|
792
792
|
), de = g.assignments.filter(
|
|
793
793
|
(e) => e.field.startsWith("__widget_") && e.widget_id != null && (w || e.is_visible === void 0 || !!e.is_visible)
|
|
794
794
|
), Be = (e) => {
|
|
@@ -799,7 +799,7 @@ function yt({
|
|
|
799
799
|
return [];
|
|
800
800
|
}
|
|
801
801
|
}, He = N || s ? g.assignments.filter(
|
|
802
|
-
(e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !
|
|
802
|
+
(e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !Te(e.field) && (w || e.is_visible === void 0 || !!e.is_visible)
|
|
803
803
|
).sort((e, r) => e.sort - r.sort) : [], oe = ["__pipeline__", "__addendums__"], Pe = new Set(oe), Ne = (e) => (N == null ? void 0 : N(e.field, e)) ?? (s ? /* @__PURE__ */ t("div", { className: "rounded-xl border border-dashed border-slate-300 bg-white px-5 py-3 text-[12px] font-medium text-slate-500 dark:border-slate-600 dark:bg-slate-900/40 dark:text-slate-400", children: e.label_override || Ze(e.field.replace(/^_+|_+$/g, "")) }) : null), Me = (e, r = "trailing") => N || s ? He.filter(
|
|
804
804
|
(i) => e === null ? i.group_key == null && r === "leading" === Pe.has(i.field) : i.group_key === e
|
|
805
805
|
).sort(
|
|
@@ -821,8 +821,8 @@ function yt({
|
|
|
821
821
|
}, [Se, Ke] = Q({}), $e = (e) => w || Se[e] === !0, [l, d] = Q({}), o = ht(
|
|
822
822
|
(e) => (r) => d((i) => i[e] === r ? i : { ...i, [e]: r }),
|
|
823
823
|
[]
|
|
824
|
-
), [h,
|
|
825
|
-
(e) => (r) =>
|
|
824
|
+
), [h, R] = Q({}), M = ht(
|
|
825
|
+
(e) => (r) => R((i) => i[e] === r ? i : { ...i, [e]: r }),
|
|
826
826
|
[]
|
|
827
827
|
), re = (e) => {
|
|
828
828
|
const r = de.filter((c) => c.group_key === e).sort((c, y) => c.sort - y.sort);
|
|
@@ -831,7 +831,7 @@ function yt({
|
|
|
831
831
|
return /* @__PURE__ */ t("div", { className: i ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: r.map((c) => /* @__PURE__ */ t("div", { hidden: !$e(c.field), children: S(
|
|
832
832
|
{ kind: "slot", field: c.field, group_key: c.group_key ?? null },
|
|
833
833
|
/* @__PURE__ */ t(
|
|
834
|
-
|
|
834
|
+
$l,
|
|
835
835
|
{
|
|
836
836
|
widgetId: c.widget_id,
|
|
837
837
|
inputBindings: Be(c),
|
|
@@ -847,15 +847,15 @@ function yt({
|
|
|
847
847
|
),
|
|
848
848
|
P(c)
|
|
849
849
|
) }, c.field)) });
|
|
850
|
-
}, [ne, je] = Q(() => /* @__PURE__ */ new Set()), Fe = w || !m ? [] :
|
|
850
|
+
}, [ne, je] = Q(() => /* @__PURE__ */ new Set()), Fe = w || !m ? [] : yl({
|
|
851
851
|
groups: g.groups.filter(
|
|
852
852
|
(e) => e.type !== "container" && e.visibility_mode !== "new_only"
|
|
853
853
|
),
|
|
854
854
|
values: m,
|
|
855
855
|
fields: [...U.values()],
|
|
856
|
-
choices:
|
|
856
|
+
choices: Nl([...U.values()]),
|
|
857
857
|
quiet: Xt(g.layout.conditions),
|
|
858
|
-
readable: (e) =>
|
|
858
|
+
readable: (e) => xl(
|
|
859
859
|
g.assignments.filter((r) => r.group_key === e).map((r) => r.field),
|
|
860
860
|
m,
|
|
861
861
|
!!s
|
|
@@ -872,7 +872,7 @@ function yt({
|
|
|
872
872
|
_e(() => {
|
|
873
873
|
qe && Je(qe.open ? new Set(g.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
|
|
874
874
|
}, [qe == null ? void 0 : qe.seq]), _e(() => {
|
|
875
|
-
const e = Ae ?
|
|
875
|
+
const e = Ae ? kl(Ae.target) : null;
|
|
876
876
|
e && Je((r) => r.has(e) ? r : new Set(r).add(e));
|
|
877
877
|
}, [Ae == null ? void 0 : Ae.seq]);
|
|
878
878
|
const Qe = [];
|
|
@@ -893,7 +893,7 @@ function yt({
|
|
|
893
893
|
xe(e.overrides).interface ?? ((i = U.get(e.field)) == null ? void 0 : i.interface) ?? ""
|
|
894
894
|
);
|
|
895
895
|
return /rich|wysiwyg|editorjs/i.test(r);
|
|
896
|
-
},
|
|
896
|
+
}, Le = (e) => {
|
|
897
897
|
const r = U.get(e.field), i = xe(e.overrides);
|
|
898
898
|
if (i.summary_toggle === !0 && !s && x && m)
|
|
899
899
|
return /* @__PURE__ */ t(
|
|
@@ -906,7 +906,7 @@ function yt({
|
|
|
906
906
|
label: ce(e)
|
|
907
907
|
}
|
|
908
908
|
);
|
|
909
|
-
if (
|
|
909
|
+
if (Te(e.field)) {
|
|
910
910
|
const K = tl(i), ue = pl((K == null ? void 0 : K.expr) ?? "", m ?? {});
|
|
911
911
|
return /* @__PURE__ */ t("span", { "data-display-formula": e.field, className: "tabular-nums", children: ue.error ? "—" : ll(ue.value, K ?? { format: "", currency: null }) });
|
|
912
912
|
}
|
|
@@ -983,25 +983,25 @@ function yt({
|
|
|
983
983
|
}, At = (e) => se.find((r) => r.field === e), ce = (e) => {
|
|
984
984
|
var c;
|
|
985
985
|
const r = xe(e.overrides).label, i = A ? el(e.overrides, A).label : void 0;
|
|
986
|
-
return i !== void 0 ? i :
|
|
987
|
-
},
|
|
988
|
-
const r = Qt(e.swap_config), i = se.filter((n) => n.group_key === e.key && !Ft.has(n.field)).filter((n) => w || !m || !Yt(n.overrides) || !ye(m[n.field])).sort((n,
|
|
986
|
+
return i !== void 0 ? i : Te(e.field) ? typeof r == "string" && r.trim() ? r : "Formula" : typeof r == "string" && r.trim() ? r : e.label_override || ((c = U.get(e.field)) == null ? void 0 : c.label) || Ze(e.field);
|
|
987
|
+
}, Lt = (e) => {
|
|
988
|
+
const r = Qt(e.swap_config), i = se.filter((n) => n.group_key === e.key && !Ft.has(n.field)).filter((n) => w || !m || !Yt(n.overrides) || !ye(m[n.field])).sort((n, L) => n.sort - L.sort), c = de.filter((n) => n.group_key === e.key), y = Me(e.key), I = i.length === 0 && c.length === 0 && y.length === 0;
|
|
989
989
|
if (I && !s) return null;
|
|
990
|
-
const te = (n) => $t && !w && (X(n) || G(n)) && ((f == null ? void 0 : f[n.field]) ?? l[n.field]) === 0, K = i.filter((n) => !X(n)), ue = i.filter(X), We = c.filter((n) => $e(n.field)),
|
|
991
|
-
const
|
|
992
|
-
return
|
|
990
|
+
const te = (n) => $t && !w && (X(n) || G(n)) && ((f == null ? void 0 : f[n.field]) ?? l[n.field]) === 0, K = i.filter((n) => !X(n)), ue = i.filter(X), We = c.filter((n) => $e(n.field)), Rt = !e.hide_when_empty && y.length === 0 && We.length === 0 && i.length > 0 && i.some((n) => X(n) || G(n)) && i.every(te), Ye = (n) => !Rt && te(n), Tt = i.filter((n) => !Ye(n)), ge = (n) => (f == null ? void 0 : f[n.field]) ?? l[n.field], Ct = !!e.hide_when_empty && !s && !w && !!m && y.length === 0 && We.length === 0 && i.every((n) => X(n) || G(n) ? ge(n) === 0 : ye(m[n.field])) || !I && Tt.length === 0 && y.length === 0 && We.length === 0, Dt = (n) => (f == null ? void 0 : f[n.field]) ?? l[n.field], ze = !!r.emptyText && !!m && !s && y.length === 0 && We.length === 0 && i.every((n) => X(n) || G(n) ? Dt(n) === 0 : ye(m[n.field])), Et = zt(K, { rows: r.rows }).units, Xe = e.is_collapsed ? ql(e.summary_fields).map((n) => {
|
|
991
|
+
const L = i.find((Oe) => Oe.field === n.field);
|
|
992
|
+
return L ? { a: L, label: n.label || ce(L) } : null;
|
|
993
993
|
}).filter((n) => !!n).filter(
|
|
994
994
|
({ a: n }) => !e.summary_hide_empty || !m || (X(n) || G(n) ? ge(n) !== 0 : !ye(m[n.field]))
|
|
995
|
-
).slice(0,
|
|
995
|
+
).slice(0, Fl) : [], ot = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : ue.length > 0 || c.length > 0 || y.length > 0 || K.length > 4 ? "full" : "half", Pt = (n) => {
|
|
996
996
|
var mt, ft, pt;
|
|
997
|
-
const
|
|
997
|
+
const L = Ye(n), J = !!(xe(n.overrides).options ?? {}).emphasis, Re = rt(n) || !!((ft = (mt = U.get(n.field)) == null ? void 0 : mt.interface) != null && ft.includes("rich-text")), ct = m == null ? void 0 : m[n.field], ut = !Re && !G(n) && !he(n.field) && (String(((pt = U.get(n.field)) == null ? void 0 : pt.interface) ?? "").includes("textarea") || typeof ct == "string" && ct.length > 36);
|
|
998
998
|
return /* @__PURE__ */ t(
|
|
999
999
|
"div",
|
|
1000
1000
|
{
|
|
1001
|
-
hidden:
|
|
1002
|
-
className: `min-w-0 ${
|
|
1001
|
+
hidden: L,
|
|
1002
|
+
className: `min-w-0 ${Re || G(n) && (h[n.field] === "nivaro_files" || (l[n.field] ?? 0) > 3) ? "col-span-full" : J || ut ? "col-span-2" : ""}`,
|
|
1003
1003
|
children: S(
|
|
1004
|
-
|
|
1004
|
+
C(n),
|
|
1005
1005
|
/* @__PURE__ */ p(me, { children: [
|
|
1006
1006
|
/* @__PURE__ */ p("dt", { className: Ie, children: [
|
|
1007
1007
|
ce(n),
|
|
@@ -1015,8 +1015,8 @@ function yt({
|
|
|
1015
1015
|
"data-replay-field": n.field,
|
|
1016
1016
|
"data-field-collection": a,
|
|
1017
1017
|
"data-remote-changed": fe.has(n.field) || void 0,
|
|
1018
|
-
className: `mt-1 min-w-0${E(n.field)} ${J ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${G(n) ||
|
|
1019
|
-
children: m ?
|
|
1018
|
+
className: `mt-1 min-w-0${E(n.field)} ${J ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${G(n) || Re ? "" : ut ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
|
|
1019
|
+
children: m ? Le(n) : /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
1020
1020
|
}
|
|
1021
1021
|
)
|
|
1022
1022
|
] }),
|
|
@@ -1025,26 +1025,26 @@ function yt({
|
|
|
1025
1025
|
},
|
|
1026
1026
|
n.field
|
|
1027
1027
|
);
|
|
1028
|
-
}, Mt = (n,
|
|
1029
|
-
const
|
|
1028
|
+
}, Mt = (n, L) => {
|
|
1029
|
+
const Oe = m && !s ? L.filter((J) => !ye(m[J.field])) : L;
|
|
1030
1030
|
return /* @__PURE__ */ p(
|
|
1031
1031
|
"div",
|
|
1032
1032
|
{
|
|
1033
1033
|
"data-read-row": n.key,
|
|
1034
|
-
className: `min-w-0 ${
|
|
1034
|
+
className: `min-w-0 ${L.length > 2 ? "col-span-full" : "col-span-2"}`,
|
|
1035
1035
|
children: [
|
|
1036
|
-
/* @__PURE__ */ t("dt", { className: Ie, children: n.label.trim() ||
|
|
1037
|
-
/* @__PURE__ */ t("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: m ?
|
|
1038
|
-
|
|
1036
|
+
/* @__PURE__ */ t("dt", { className: Ie, children: n.label.trim() || L.map(ce).join(" / ") }),
|
|
1037
|
+
/* @__PURE__ */ t("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: m ? Oe.length === 0 ? /* @__PURE__ */ t(le, {}) : Oe.map((J, Re) => /* @__PURE__ */ p(It, { children: [
|
|
1038
|
+
Re > 0 && /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
|
|
1039
1039
|
S(
|
|
1040
|
-
|
|
1040
|
+
C(J),
|
|
1041
1041
|
/* @__PURE__ */ t(
|
|
1042
1042
|
"span",
|
|
1043
1043
|
{
|
|
1044
1044
|
"data-replay-field": J.field,
|
|
1045
1045
|
"data-field-collection": a,
|
|
1046
1046
|
className: `min-w-0 break-words${E(J.field)}`,
|
|
1047
|
-
children:
|
|
1047
|
+
children: Le(J)
|
|
1048
1048
|
}
|
|
1049
1049
|
),
|
|
1050
1050
|
P(J)
|
|
@@ -1058,7 +1058,7 @@ function yt({
|
|
|
1058
1058
|
return /* @__PURE__ */ t(
|
|
1059
1059
|
"section",
|
|
1060
1060
|
{
|
|
1061
|
-
hidden:
|
|
1061
|
+
hidden: Ct,
|
|
1062
1062
|
"data-read-section": e.key,
|
|
1063
1063
|
"data-read-width": ot,
|
|
1064
1064
|
className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
|
|
@@ -1089,9 +1089,9 @@ function yt({
|
|
|
1089
1089
|
{
|
|
1090
1090
|
"data-read-collapsed-summary": e.key,
|
|
1091
1091
|
className: "pointer-events-none flex min-w-0 flex-1 items-baseline gap-x-3 overflow-hidden whitespace-nowrap text-[12px] font-normal",
|
|
1092
|
-
children: Xe.map(({ a: n, label:
|
|
1093
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500", children:
|
|
1094
|
-
/* @__PURE__ */ t("span", { className: "min-w-0 truncate font-medium text-slate-700 dark:text-slate-300", children: m ? X(n) || G(n) ? ge(n) == null ? "…" : `${ge(n)} ${X(n) ? ge(n) === 1 ? "row" : "rows" : ge(n) === 1 ? "item" : "items"}` : ye(m[n.field]) ? /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) :
|
|
1092
|
+
children: Xe.map(({ a: n, label: L }) => /* @__PURE__ */ p("span", { className: "flex min-w-0 shrink items-baseline gap-1", children: [
|
|
1093
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500", children: L }),
|
|
1094
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 truncate font-medium text-slate-700 dark:text-slate-300", children: m ? X(n) || G(n) ? ge(n) == null ? "…" : `${ge(n)} ${X(n) ? ge(n) === 1 ? "row" : "rows" : ge(n) === 1 ? "item" : "items"}` : ye(m[n.field]) ? /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Le(n) : "…" })
|
|
1095
1095
|
] }, n.field))
|
|
1096
1096
|
}
|
|
1097
1097
|
)
|
|
@@ -1102,8 +1102,8 @@ function yt({
|
|
|
1102
1102
|
type: "button",
|
|
1103
1103
|
"data-read-edit-section": e.key,
|
|
1104
1104
|
onClick: () => {
|
|
1105
|
-
var n,
|
|
1106
|
-
return q(e.key, ((n = K[0]) == null ? void 0 : n.field) ?? ((
|
|
1105
|
+
var n, L;
|
|
1106
|
+
return q(e.key, ((n = K[0]) == null ? void 0 : n.field) ?? ((L = ue[0]) == null ? void 0 : L.field) ?? null);
|
|
1107
1107
|
},
|
|
1108
1108
|
title: `Edit ${e.label}`,
|
|
1109
1109
|
"aria-label": `Edit ${e.label}`,
|
|
@@ -1146,16 +1146,16 @@ function yt({
|
|
|
1146
1146
|
}
|
|
1147
1147
|
),
|
|
1148
1148
|
ue.map((n) => {
|
|
1149
|
-
var
|
|
1149
|
+
var L;
|
|
1150
1150
|
return /* @__PURE__ */ t(
|
|
1151
1151
|
"div",
|
|
1152
1152
|
{
|
|
1153
1153
|
className: K.length > 0 ? "mt-3" : "",
|
|
1154
1154
|
hidden: Ye(n) || ze,
|
|
1155
1155
|
children: S(
|
|
1156
|
-
|
|
1156
|
+
C(n),
|
|
1157
1157
|
/* @__PURE__ */ p(me, { children: [
|
|
1158
|
-
(
|
|
1158
|
+
(L = $ == null ? void 0 : $.get(n.field)) != null && L.length ? /* @__PURE__ */ p("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-amber-700 dark:text-amber-300", children: [
|
|
1159
1159
|
/* @__PURE__ */ t("span", { children: ce(n) }),
|
|
1160
1160
|
/* @__PURE__ */ t(ie, { field: n.field }),
|
|
1161
1161
|
/* @__PURE__ */ p("span", { className: "font-normal text-amber-700/80 dark:text-amber-300/80", children: [
|
|
@@ -1166,7 +1166,7 @@ function yt({
|
|
|
1166
1166
|
"; switch to Edit to fix"
|
|
1167
1167
|
] })
|
|
1168
1168
|
] }) : null,
|
|
1169
|
-
(
|
|
1169
|
+
(T ? T(n) : null) ?? St(n)
|
|
1170
1170
|
] }),
|
|
1171
1171
|
P(n)
|
|
1172
1172
|
)
|
|
@@ -1191,13 +1191,13 @@ function yt({
|
|
|
1191
1191
|
},
|
|
1192
1192
|
e.key
|
|
1193
1193
|
);
|
|
1194
|
-
}, at = we(null),
|
|
1194
|
+
}, at = we(null), Ot = we(null, "leading"), it = nt.map((e) => At(e)).filter((e) => !!e && !X(e)).filter((e) => w || !qt(e)), [ae, ...st] = it;
|
|
1195
1195
|
return /* @__PURE__ */ p(
|
|
1196
1196
|
"div",
|
|
1197
1197
|
{
|
|
1198
1198
|
className: F ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto bg-slate-50/60 px-5 py-4 dark:bg-transparent",
|
|
1199
1199
|
children: [
|
|
1200
|
-
|
|
1200
|
+
Ot,
|
|
1201
1201
|
it.length > 0 && /* @__PURE__ */ p(
|
|
1202
1202
|
"div",
|
|
1203
1203
|
{
|
|
@@ -1217,7 +1217,7 @@ function yt({
|
|
|
1217
1217
|
"data-replay-field": ae.field,
|
|
1218
1218
|
"data-field-collection": a,
|
|
1219
1219
|
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${E(ae.field)}`,
|
|
1220
|
-
children: m ?
|
|
1220
|
+
children: m ? Le(ae) : "…"
|
|
1221
1221
|
}
|
|
1222
1222
|
)
|
|
1223
1223
|
] }),
|
|
@@ -1239,7 +1239,7 @@ function yt({
|
|
|
1239
1239
|
"data-field-collection": a,
|
|
1240
1240
|
"data-remote-changed": fe.has(e.field) || void 0,
|
|
1241
1241
|
className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${E(e.field)}`,
|
|
1242
|
-
children: m ?
|
|
1242
|
+
children: m ? Le(e) : "…"
|
|
1243
1243
|
}
|
|
1244
1244
|
)
|
|
1245
1245
|
] }),
|
|
@@ -1248,9 +1248,9 @@ function yt({
|
|
|
1248
1248
|
]
|
|
1249
1249
|
}
|
|
1250
1250
|
),
|
|
1251
|
-
/* @__PURE__ */ t("style", { children:
|
|
1251
|
+
/* @__PURE__ */ t("style", { children: Al }),
|
|
1252
1252
|
B && Fe.length > 0 && /* @__PURE__ */ t("div", { className: "mb-3", children: /* @__PURE__ */ t(hl, { items: Fe, revealed: ne, onToggle: Ge }) }),
|
|
1253
|
-
B ? /* @__PURE__ */ t("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Qe.map(
|
|
1253
|
+
B ? /* @__PURE__ */ t("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Qe.map(Lt) }) : /* @__PURE__ */ p("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
|
|
1254
1254
|
/* @__PURE__ */ t("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1255
1255
|
/* @__PURE__ */ t("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1256
1256
|
/* @__PURE__ */ t("div", { className: "h-56 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
@@ -1260,8 +1260,8 @@ function yt({
|
|
|
1260
1260
|
}
|
|
1261
1261
|
);
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1264
|
-
return a.design ? /* @__PURE__ */ t(
|
|
1263
|
+
function xr(a) {
|
|
1264
|
+
return a.design ? /* @__PURE__ */ t(_l, { design: a.design.context, onRefusedWrite: a.design.onRefusedWrite, children: /* @__PURE__ */ t(Ut.Provider, { value: null, children: /* @__PURE__ */ t(yt, { ...a }) }) }) : /* @__PURE__ */ t(yt, { ...a });
|
|
1265
1265
|
}
|
|
1266
1266
|
function Cl({
|
|
1267
1267
|
collection: a,
|
|
@@ -1270,8 +1270,8 @@ function Cl({
|
|
|
1270
1270
|
value: s,
|
|
1271
1271
|
label: F
|
|
1272
1272
|
}) {
|
|
1273
|
-
const N = ke(), _ = xt(), [
|
|
1274
|
-
if (
|
|
1273
|
+
const N = ke(), _ = xt(), [T, q] = Q(null), f = T ?? (s === !0 || s === 1 || s === "1" || s === "true"), O = async () => {
|
|
1274
|
+
if (T !== null) return;
|
|
1275
1275
|
const A = !f;
|
|
1276
1276
|
q(A);
|
|
1277
1277
|
try {
|
|
@@ -1292,8 +1292,8 @@ function Cl({
|
|
|
1292
1292
|
role: "switch",
|
|
1293
1293
|
"aria-checked": f,
|
|
1294
1294
|
"aria-label": typeof F == "string" ? F : b,
|
|
1295
|
-
disabled:
|
|
1296
|
-
onClick: () => void
|
|
1295
|
+
disabled: T !== null,
|
|
1296
|
+
onClick: () => void O(),
|
|
1297
1297
|
"data-summary-toggle": b,
|
|
1298
1298
|
className: "group inline-flex items-center gap-2 rounded-md py-0.5 text-[13px] font-medium text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan disabled:opacity-60 dark:text-slate-100",
|
|
1299
1299
|
children: [
|
|
@@ -1316,7 +1316,7 @@ function Cl({
|
|
|
1316
1316
|
);
|
|
1317
1317
|
}
|
|
1318
1318
|
export {
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1319
|
+
Fl as COLLAPSED_SUMMARY_MAX,
|
|
1320
|
+
xr as RecordReadView,
|
|
1321
|
+
ql as collapsedSummaryEntries
|
|
1322
1322
|
};
|