@nivaro/react 0.3.65 → 0.3.67
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 +21 -5
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +2432 -2592
- package/dist/shared/components/ItemEditForm.js +3912 -3773
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/CatalogPickerField.js +240 -238
- package/dist/shared/components/item-edit/FieldRow.js +193 -193
- package/dist/shared/components/item-edit/GroupSection.js +559 -542
- package/dist/shared/components/item-edit/M2MCombobox.js +414 -349
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +211 -187
- package/dist/shared/components/item-edit/RecordInsights.js +46 -45
- package/dist/shared/components/item-edit/RelationCombobox.js +327 -311
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +23 -19
- package/dist/shared/components/item-edit/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +73 -47
- package/dist/shared/components/item-edit/picker-search.js +25 -21
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +72 -72
- package/dist/shared/components/panels/PipelinePanel.js +261 -261
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +220 -220
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +1007 -979
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +19 -18
- package/dist/shared/lib/obligation-reason-text.js +1 -1
- package/dist/shared/lib/quick-filter-cascade.js +29 -19
- package/dist/shared/lib/utils.js +59 -57
- package/package.json +1 -1
|
@@ -1,47 +1,63 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { htmlToText as
|
|
5
|
-
import { titleCase as
|
|
6
|
-
import { collisionNumberText as
|
|
7
|
-
import { classifyLineConflicts as
|
|
8
|
-
import { lineConflictKey as
|
|
9
|
-
function
|
|
10
|
-
collision:
|
|
11
|
-
fieldLabel:
|
|
12
|
-
onCancel:
|
|
13
|
-
onResolve:
|
|
14
|
-
title:
|
|
15
|
-
intro:
|
|
16
|
-
cancelLabel:
|
|
17
|
-
formatValue:
|
|
18
|
-
topSlot:
|
|
19
|
-
replaceBody:
|
|
1
|
+
import { jsx as d, jsxs as a, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { useState as P } from "react";
|
|
3
|
+
import { createPortal as H } from "react-dom";
|
|
4
|
+
import { htmlToText as A } from "../../lib/sanitize-html.js";
|
|
5
|
+
import { titleCase as J } from "../../lib/utils.js";
|
|
6
|
+
import { collisionNumberText as K, differingTails as W } from "./collision-format.js";
|
|
7
|
+
import { classifyLineConflicts as q, mergeReady as G, mergedLinePreview as Q, previewFields as R, mergeTheirsKeys as U } from "./line-merge.js";
|
|
8
|
+
import { lineConflictKey as I } from "./line-midair.js";
|
|
9
|
+
function X({
|
|
10
|
+
collision: n,
|
|
11
|
+
fieldLabel: c,
|
|
12
|
+
onCancel: p,
|
|
13
|
+
onResolve: l,
|
|
14
|
+
title: w = "Someone else changed this record",
|
|
15
|
+
intro: M = "These fields were saved by someone else while you were editing. Pick which value wins for each — everything else you changed saves normally.",
|
|
16
|
+
cancelLabel: v = "Cancel save",
|
|
17
|
+
formatValue: S = K,
|
|
18
|
+
topSlot: b,
|
|
19
|
+
replaceBody: T,
|
|
20
|
+
merge: u,
|
|
21
|
+
applyLabel: N = "Apply & save"
|
|
20
22
|
}) {
|
|
21
|
-
const [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
const [y, $] = P("pick"), o = !!u && b === void 0 && T === void 0, s = o ? /* @__PURE__ */ d(B, { mode: y, onMode: $ }) : b, t = o && y === "merge" && u ? /* @__PURE__ */ d(
|
|
24
|
+
E,
|
|
25
|
+
{
|
|
26
|
+
sources: [{ ...n, ...u }],
|
|
27
|
+
label: c,
|
|
28
|
+
formatValue: S,
|
|
29
|
+
hideField: (r, i) => {
|
|
30
|
+
var x;
|
|
31
|
+
return !!((x = u.hideField) != null && x.call(u, i));
|
|
32
|
+
},
|
|
33
|
+
cancelLabel: v,
|
|
34
|
+
onCancel: p,
|
|
35
|
+
onResolve: l
|
|
36
|
+
}
|
|
37
|
+
) : T, [m, h] = P(
|
|
38
|
+
() => new Set(n.conflicts.map((r) => r.field))
|
|
39
|
+
), [g, C] = P(null), _ = (r, i) => {
|
|
40
|
+
if (i == null || i === "") return "—";
|
|
41
|
+
const x = S(r, i);
|
|
42
|
+
if (x != null) return x;
|
|
43
|
+
if (typeof i == "object") return JSON.stringify(i).slice(0, 120);
|
|
44
|
+
const f = String(i), k = /<[a-z][^>]*>/i.test(f) ? A(f) : f;
|
|
45
|
+
return k.trim() ? k.slice(0, 200) : "—";
|
|
46
|
+
}, D = (r, i, x) => {
|
|
47
|
+
const f = _(r, i), k = _(r, x);
|
|
48
|
+
if (f === "—" || k === "—") return { t: f, m: k };
|
|
49
|
+
const j = W(f, k);
|
|
50
|
+
return { t: j.a, m: j.b };
|
|
51
|
+
}, e = /* @__PURE__ */ d(
|
|
36
52
|
"span",
|
|
37
53
|
{
|
|
38
54
|
hidden: !0,
|
|
39
|
-
ref: (
|
|
40
|
-
|
|
55
|
+
ref: (r) => {
|
|
56
|
+
r && !g && C(r.closest('[role="dialog"]') ?? document.body);
|
|
41
57
|
}
|
|
42
58
|
}
|
|
43
59
|
);
|
|
44
|
-
return
|
|
60
|
+
return g ? H(
|
|
45
61
|
/* @__PURE__ */ a(
|
|
46
62
|
"div",
|
|
47
63
|
{
|
|
@@ -49,63 +65,63 @@ function H({
|
|
|
49
65
|
"aria-modal": "true",
|
|
50
66
|
"aria-labelledby": "nvr-midair-title",
|
|
51
67
|
className: "pointer-events-auto fixed inset-0 z-[130] flex items-center justify-center",
|
|
52
|
-
onKeyDown: (
|
|
53
|
-
|
|
68
|
+
onKeyDown: (r) => {
|
|
69
|
+
r.key === "Escape" && (r.stopPropagation(), p());
|
|
54
70
|
},
|
|
55
71
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ d(
|
|
57
73
|
"button",
|
|
58
74
|
{
|
|
59
75
|
type: "button",
|
|
60
76
|
"aria-label": "Close",
|
|
61
77
|
tabIndex: -1,
|
|
62
78
|
className: "absolute inset-0 cursor-default bg-black/40",
|
|
63
|
-
onClick:
|
|
79
|
+
onClick: p
|
|
64
80
|
}
|
|
65
81
|
),
|
|
66
82
|
/* @__PURE__ */ a("div", { className: "relative w-[560px] max-w-[94vw] rounded-lg border border-slate-200 bg-white p-5 shadow-xl dark:border-border dark:bg-card", children: [
|
|
67
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ d(
|
|
68
84
|
"p",
|
|
69
85
|
{
|
|
70
86
|
id: "nvr-midair-title",
|
|
71
87
|
className: "text-[14px] font-semibold text-slate-900 dark:text-foreground",
|
|
72
|
-
children:
|
|
88
|
+
children: w
|
|
73
89
|
}
|
|
74
90
|
),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
const
|
|
91
|
+
/* @__PURE__ */ d("p", { className: "mt-1 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: M }),
|
|
92
|
+
s,
|
|
93
|
+
t ?? /* @__PURE__ */ a(z, { children: [
|
|
94
|
+
/* @__PURE__ */ d("div", { className: "mt-3 max-h-[320px] space-y-2 overflow-y-auto", children: n.conflicts.map((r, i) => {
|
|
95
|
+
const x = m.has(r.field), f = D(r.field, r.current_value, n.mine[r.field]), k = `nvr-midair-field-${i}`;
|
|
80
96
|
return /* @__PURE__ */ a(
|
|
81
97
|
"div",
|
|
82
98
|
{
|
|
83
99
|
className: "rounded-md border border-slate-200 p-2.5 dark:border-border",
|
|
84
100
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ d(
|
|
86
102
|
"p",
|
|
87
103
|
{
|
|
88
|
-
id:
|
|
104
|
+
id: k,
|
|
89
105
|
className: "text-[12.5px] font-medium text-slate-800 dark:text-foreground",
|
|
90
|
-
children:
|
|
106
|
+
children: c(r.field)
|
|
91
107
|
}
|
|
92
108
|
),
|
|
93
109
|
/* @__PURE__ */ a(
|
|
94
110
|
"fieldset",
|
|
95
111
|
{
|
|
96
|
-
"aria-labelledby":
|
|
112
|
+
"aria-labelledby": k,
|
|
97
113
|
className: "m-0 mt-1.5 grid min-w-0 grid-cols-2 gap-2 border-0 p-0",
|
|
98
114
|
children: [
|
|
99
115
|
/* @__PURE__ */ a(
|
|
100
116
|
"button",
|
|
101
117
|
{
|
|
102
118
|
type: "button",
|
|
103
|
-
"aria-pressed":
|
|
104
|
-
onClick: () =>
|
|
105
|
-
className:
|
|
119
|
+
"aria-pressed": x,
|
|
120
|
+
onClick: () => h((j) => /* @__PURE__ */ new Set([...j, r.field])),
|
|
121
|
+
className: x ? "rounded-md border-2 border-nvr-cyan/60 bg-nvr-cyan/5 px-2.5 py-1.5 text-left" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
|
|
106
122
|
children: [
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ d("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Theirs (current)" }),
|
|
124
|
+
/* @__PURE__ */ d("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: f.t })
|
|
109
125
|
]
|
|
110
126
|
}
|
|
111
127
|
),
|
|
@@ -113,15 +129,15 @@ function H({
|
|
|
113
129
|
"button",
|
|
114
130
|
{
|
|
115
131
|
type: "button",
|
|
116
|
-
"aria-pressed": !
|
|
117
|
-
onClick: () =>
|
|
118
|
-
const
|
|
119
|
-
return
|
|
132
|
+
"aria-pressed": !x,
|
|
133
|
+
onClick: () => h((j) => {
|
|
134
|
+
const O = new Set(j);
|
|
135
|
+
return O.delete(r.field), O;
|
|
120
136
|
}),
|
|
121
|
-
className:
|
|
137
|
+
className: x ? "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border" : "rounded-md border-2 border-amber-400/70 bg-amber-50 px-2.5 py-1.5 text-left dark:bg-amber-400/10",
|
|
122
138
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ d("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Mine (overwrite)" }),
|
|
140
|
+
/* @__PURE__ */ d("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: f.m })
|
|
125
141
|
]
|
|
126
142
|
}
|
|
127
143
|
)
|
|
@@ -130,26 +146,26 @@ function H({
|
|
|
130
146
|
)
|
|
131
147
|
]
|
|
132
148
|
},
|
|
133
|
-
|
|
149
|
+
r.field
|
|
134
150
|
);
|
|
135
151
|
}) }),
|
|
136
152
|
/* @__PURE__ */ a("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
|
|
137
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ d(
|
|
138
154
|
"button",
|
|
139
155
|
{
|
|
140
156
|
type: "button",
|
|
141
|
-
onClick:
|
|
157
|
+
onClick: p,
|
|
142
158
|
className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] text-slate-600 dark:border-border dark:text-muted-foreground",
|
|
143
|
-
children:
|
|
159
|
+
children: v
|
|
144
160
|
}
|
|
145
161
|
),
|
|
146
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ d(
|
|
147
163
|
"button",
|
|
148
164
|
{
|
|
149
165
|
type: "button",
|
|
150
|
-
onClick: () =>
|
|
166
|
+
onClick: () => l(m),
|
|
151
167
|
className: "h-8 rounded-md bg-nvr-cyan px-4 text-[12.5px] font-medium text-white",
|
|
152
|
-
children:
|
|
168
|
+
children: N
|
|
153
169
|
}
|
|
154
170
|
)
|
|
155
171
|
] })
|
|
@@ -158,148 +174,156 @@ function H({
|
|
|
158
174
|
]
|
|
159
175
|
}
|
|
160
176
|
),
|
|
161
|
-
|
|
162
|
-
) :
|
|
177
|
+
g
|
|
178
|
+
) : e;
|
|
163
179
|
}
|
|
164
|
-
function
|
|
165
|
-
lines:
|
|
166
|
-
fieldLabel:
|
|
167
|
-
onCancel:
|
|
168
|
-
onResolve:
|
|
169
|
-
intro:
|
|
170
|
-
cancelLabel:
|
|
171
|
-
formatValue:
|
|
172
|
-
hideField:
|
|
180
|
+
function de({
|
|
181
|
+
lines: n,
|
|
182
|
+
fieldLabel: c,
|
|
183
|
+
onCancel: p,
|
|
184
|
+
onResolve: l,
|
|
185
|
+
intro: w = "These values were saved by someone else after you changed them. Pick which value wins for each — the rest of your changes are saved.",
|
|
186
|
+
cancelLabel: M = "Decide later",
|
|
187
|
+
formatValue: v = K,
|
|
188
|
+
hideField: S,
|
|
189
|
+
applyLabel: b,
|
|
190
|
+
mergeLabel: T
|
|
173
191
|
}) {
|
|
174
|
-
const [
|
|
175
|
-
for (const
|
|
176
|
-
for (const
|
|
192
|
+
const [u, N] = P("pick"), y = (o) => (c == null ? void 0 : c(o)) || J(o.replace(/_/g, " ")), $ = (o) => {
|
|
193
|
+
for (const s of n)
|
|
194
|
+
for (const t of s.conflicts) if (I(s, t.field) === o) return t.field;
|
|
177
195
|
return o;
|
|
178
196
|
};
|
|
179
|
-
return /* @__PURE__ */
|
|
180
|
-
|
|
197
|
+
return /* @__PURE__ */ d(
|
|
198
|
+
X,
|
|
181
199
|
{
|
|
182
|
-
title:
|
|
183
|
-
intro:
|
|
184
|
-
cancelLabel:
|
|
200
|
+
title: n.length === 1 ? `Someone else changed ${n[0].label}` : `Someone else changed ${n.length} lines`,
|
|
201
|
+
intro: w,
|
|
202
|
+
cancelLabel: M,
|
|
185
203
|
collision: {
|
|
186
|
-
conflicts:
|
|
187
|
-
(o) => o.conflicts.map((
|
|
188
|
-
field:
|
|
189
|
-
current_value:
|
|
204
|
+
conflicts: n.flatMap(
|
|
205
|
+
(o) => o.conflicts.map((s) => ({
|
|
206
|
+
field: I(o, s.field),
|
|
207
|
+
current_value: s.current_value
|
|
190
208
|
}))
|
|
191
209
|
),
|
|
192
210
|
mine: Object.fromEntries(
|
|
193
|
-
|
|
194
|
-
(o) => o.conflicts.map((
|
|
211
|
+
n.flatMap(
|
|
212
|
+
(o) => o.conflicts.map((s) => [I(o, s.field), o.mine[s.field]])
|
|
195
213
|
)
|
|
196
214
|
)
|
|
197
215
|
},
|
|
198
|
-
formatValue: (o,
|
|
216
|
+
formatValue: (o, s) => v($(o), s),
|
|
199
217
|
fieldLabel: (o) => {
|
|
200
|
-
for (const
|
|
201
|
-
for (const
|
|
202
|
-
if (
|
|
218
|
+
for (const s of n)
|
|
219
|
+
for (const t of s.conflicts)
|
|
220
|
+
if (I(s, t.field) === o) return `${s.label} · ${y(t.field)}`;
|
|
203
221
|
return o;
|
|
204
222
|
},
|
|
205
|
-
onCancel:
|
|
206
|
-
onResolve:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
223
|
+
onCancel: p,
|
|
224
|
+
onResolve: l,
|
|
225
|
+
applyLabel: b,
|
|
226
|
+
topSlot: /* @__PURE__ */ d(B, { mode: u, onMode: N }),
|
|
227
|
+
replaceBody: u === "merge" ? /* @__PURE__ */ d(
|
|
228
|
+
E,
|
|
210
229
|
{
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
230
|
+
sources: n,
|
|
231
|
+
saveLabel: T,
|
|
232
|
+
label: y,
|
|
233
|
+
formatValue: v,
|
|
234
|
+
hideField: S,
|
|
235
|
+
cancelLabel: M,
|
|
236
|
+
onCancel: p,
|
|
237
|
+
onResolve: l
|
|
218
238
|
}
|
|
219
239
|
) : void 0
|
|
220
240
|
}
|
|
221
241
|
);
|
|
222
242
|
}
|
|
223
|
-
function
|
|
224
|
-
mode:
|
|
225
|
-
onMode:
|
|
243
|
+
function B({
|
|
244
|
+
mode: n,
|
|
245
|
+
onMode: c
|
|
226
246
|
}) {
|
|
227
|
-
const
|
|
247
|
+
const p = (l, w) => /* @__PURE__ */ d(
|
|
228
248
|
"button",
|
|
229
249
|
{
|
|
230
250
|
type: "button",
|
|
231
|
-
"aria-pressed":
|
|
232
|
-
"data-resolve-mode":
|
|
233
|
-
onClick: () =>
|
|
234
|
-
className:
|
|
235
|
-
children:
|
|
251
|
+
"aria-pressed": n === l,
|
|
252
|
+
"data-resolve-mode": l,
|
|
253
|
+
onClick: () => c(l),
|
|
254
|
+
className: n === l ? "h-7 rounded-md bg-white px-3 text-[12px] font-medium text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "h-7 rounded-md px-3 text-[12px] text-slate-500 hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
|
|
255
|
+
children: w
|
|
236
256
|
}
|
|
237
257
|
);
|
|
238
258
|
return /* @__PURE__ */ a("fieldset", { className: "m-0 mt-3 inline-flex min-w-0 gap-1 rounded-lg border-0 bg-slate-100 p-1 dark:bg-muted", children: [
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
|
|
241
|
-
|
|
259
|
+
/* @__PURE__ */ d("legend", { className: "sr-only", children: "How to settle it" }),
|
|
260
|
+
p("pick", "Theirs or mine"),
|
|
261
|
+
p("merge", "Merge")
|
|
242
262
|
] });
|
|
243
263
|
}
|
|
244
|
-
function
|
|
245
|
-
|
|
246
|
-
label:
|
|
247
|
-
formatValue:
|
|
248
|
-
hideField:
|
|
249
|
-
cancelLabel:
|
|
250
|
-
onCancel:
|
|
251
|
-
onResolve:
|
|
264
|
+
function E({
|
|
265
|
+
sources: n,
|
|
266
|
+
label: c,
|
|
267
|
+
formatValue: p,
|
|
268
|
+
hideField: l,
|
|
269
|
+
cancelLabel: w,
|
|
270
|
+
onCancel: M,
|
|
271
|
+
onResolve: v,
|
|
272
|
+
saveLabel: S = "Save merged"
|
|
252
273
|
}) {
|
|
253
|
-
const [
|
|
254
|
-
if (
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
if (typeof
|
|
258
|
-
const
|
|
259
|
-
return
|
|
260
|
-
},
|
|
261
|
-
return /* @__PURE__ */ a(
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
const
|
|
264
|
-
(e) =>
|
|
265
|
-
|
|
274
|
+
const [b, T] = P(() => /* @__PURE__ */ new Map()), u = n.map((t) => ({ line: t, fields: q(t) })), N = u.flatMap((t) => t.fields), y = N.filter((t) => t.kind === "conflict" && !b.has(t.key)).length, $ = G(N, b), o = (t, m) => {
|
|
275
|
+
if (m == null || m === "") return "—";
|
|
276
|
+
const h = p(t, m);
|
|
277
|
+
if (h != null) return h;
|
|
278
|
+
if (typeof m == "object") return "—";
|
|
279
|
+
const g = String(m), C = /<[a-z][^>]*>/i.test(g) ? A(g) : g;
|
|
280
|
+
return C.trim() ? C.slice(0, 120) : "—";
|
|
281
|
+
}, s = (t, m) => T((h) => new Map(h).set(t, m));
|
|
282
|
+
return /* @__PURE__ */ a(z, { children: [
|
|
283
|
+
/* @__PURE__ */ d("div", { className: "mt-3 max-h-[360px] space-y-3 overflow-y-auto", "data-merge-view": "", children: u.map(({ line: t, fields: m }) => {
|
|
284
|
+
const h = new Set(t.conflicts.map((e) => e.field)), g = new Set((t.derived ?? []).map((e) => e.field)), C = Object.keys(t.edit ?? {}).filter(
|
|
285
|
+
(e) => {
|
|
286
|
+
var r, i;
|
|
287
|
+
return !h.has(e) && !g.has(e) && e !== "id" && !e.startsWith("_") && !(((r = t.edit) == null ? void 0 : r[e]) !== null && typeof ((i = t.edit) == null ? void 0 : i[e]) == "object") && !(l != null && l(t, e));
|
|
288
|
+
}
|
|
289
|
+
), _ = Q(t, b), D = R(t, (e) => !!(l != null && l(t, e)));
|
|
266
290
|
return /* @__PURE__ */ a(
|
|
267
291
|
"div",
|
|
268
292
|
{
|
|
269
293
|
className: "rounded-md border border-slate-200 p-2.5 dark:border-border",
|
|
270
294
|
children: [
|
|
271
|
-
/* @__PURE__ */
|
|
295
|
+
t.label && /* @__PURE__ */ d("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-foreground", children: t.label }),
|
|
272
296
|
/* @__PURE__ */ a("ul", { className: "mt-1 space-y-0.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
|
|
273
|
-
|
|
274
|
-
var
|
|
297
|
+
C.map((e) => {
|
|
298
|
+
var r;
|
|
275
299
|
return /* @__PURE__ */ a("li", { children: [
|
|
276
|
-
|
|
300
|
+
c(e),
|
|
277
301
|
": yours (",
|
|
278
|
-
|
|
302
|
+
o(e, (r = t.edit) == null ? void 0 : r[e]),
|
|
279
303
|
") — only you changed it"
|
|
280
304
|
] }, `m:${e}`);
|
|
281
305
|
}),
|
|
282
|
-
|
|
283
|
-
|
|
306
|
+
m.filter((e) => e.kind === "same").map((e) => /* @__PURE__ */ a("li", { children: [
|
|
307
|
+
c(e.field),
|
|
284
308
|
": you both set ",
|
|
285
|
-
|
|
309
|
+
o(e.field, e.theirs)
|
|
286
310
|
] }, `s:${e.key}`)),
|
|
287
|
-
|
|
288
|
-
|
|
311
|
+
m.filter((e) => e.kind === "derived").map((e) => /* @__PURE__ */ a("li", { children: [
|
|
312
|
+
c(e.field),
|
|
289
313
|
": worked out again from the merged values"
|
|
290
314
|
] }, `d:${e.key}`)),
|
|
291
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ d("li", { children: "Anything else they changed stays as they saved it." })
|
|
292
316
|
] }),
|
|
293
|
-
|
|
294
|
-
const
|
|
317
|
+
m.filter((e) => e.kind === "conflict").map((e) => {
|
|
318
|
+
const r = b.get(e.key), i = `nvr-merge-${t.rowId ?? "record"}-${e.field}`;
|
|
295
319
|
return /* @__PURE__ */ a("div", { className: "mt-2", children: [
|
|
296
320
|
/* @__PURE__ */ a(
|
|
297
321
|
"p",
|
|
298
322
|
{
|
|
299
|
-
id:
|
|
323
|
+
id: i,
|
|
300
324
|
className: "text-[12px] font-medium text-amber-700 dark:text-amber-300",
|
|
301
325
|
children: [
|
|
302
|
-
|
|
326
|
+
c(e.field),
|
|
303
327
|
" — you both changed it. Pick one:"
|
|
304
328
|
]
|
|
305
329
|
}
|
|
@@ -307,20 +331,20 @@ function R({
|
|
|
307
331
|
/* @__PURE__ */ a(
|
|
308
332
|
"fieldset",
|
|
309
333
|
{
|
|
310
|
-
"aria-labelledby":
|
|
334
|
+
"aria-labelledby": i,
|
|
311
335
|
className: "m-0 mt-1 grid min-w-0 grid-cols-2 gap-2 border-0 p-0",
|
|
312
336
|
children: [
|
|
313
337
|
/* @__PURE__ */ a(
|
|
314
338
|
"button",
|
|
315
339
|
{
|
|
316
340
|
type: "button",
|
|
317
|
-
"aria-pressed":
|
|
341
|
+
"aria-pressed": r === "theirs",
|
|
318
342
|
"data-merge-pick": "theirs",
|
|
319
|
-
onClick: () =>
|
|
320
|
-
className:
|
|
343
|
+
onClick: () => s(e.key, "theirs"),
|
|
344
|
+
className: r === "theirs" ? "rounded-md border-2 border-nvr-cyan/60 bg-nvr-cyan/5 px-2.5 py-1.5 text-left" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
|
|
321
345
|
children: [
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ d("span", { className: "block text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Theirs" }),
|
|
347
|
+
/* @__PURE__ */ d("span", { className: "mt-0.5 block text-[12px] text-slate-700 dark:text-foreground", children: o(e.field, e.theirs) })
|
|
324
348
|
]
|
|
325
349
|
}
|
|
326
350
|
),
|
|
@@ -328,13 +352,13 @@ function R({
|
|
|
328
352
|
"button",
|
|
329
353
|
{
|
|
330
354
|
type: "button",
|
|
331
|
-
"aria-pressed":
|
|
355
|
+
"aria-pressed": r === "mine",
|
|
332
356
|
"data-merge-pick": "mine",
|
|
333
|
-
onClick: () =>
|
|
334
|
-
className:
|
|
357
|
+
onClick: () => s(e.key, "mine"),
|
|
358
|
+
className: r === "mine" ? "rounded-md border-2 border-amber-400/70 bg-amber-50 px-2.5 py-1.5 text-left dark:bg-amber-400/10" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
|
|
335
359
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ d("span", { className: "block text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Mine" }),
|
|
361
|
+
/* @__PURE__ */ d("span", { className: "mt-0.5 block text-[12px] text-slate-700 dark:text-foreground", children: o(e.field, e.mine) })
|
|
338
362
|
]
|
|
339
363
|
}
|
|
340
364
|
)
|
|
@@ -343,60 +367,60 @@ function R({
|
|
|
343
367
|
)
|
|
344
368
|
] }, e.key);
|
|
345
369
|
}),
|
|
346
|
-
|
|
370
|
+
D.length > 0 && /* @__PURE__ */ a(
|
|
347
371
|
"div",
|
|
348
372
|
{
|
|
349
373
|
className: "mt-2 rounded-md bg-slate-50 px-2.5 py-1.5 dark:bg-muted/40",
|
|
350
374
|
"data-merge-preview": "",
|
|
351
375
|
children: [
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ d("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "After the merge" }),
|
|
377
|
+
/* @__PURE__ */ d("p", { className: "mt-0.5 text-[12px] text-slate-700 dark:text-foreground", children: D.map((e) => `${c(e)} ${o(e, _[e])}`).join(" · ") })
|
|
354
378
|
]
|
|
355
379
|
}
|
|
356
380
|
)
|
|
357
381
|
]
|
|
358
382
|
},
|
|
359
|
-
`${
|
|
383
|
+
`${t.key ?? "record"}:${t.rowId ?? ""}`
|
|
360
384
|
);
|
|
361
385
|
}) }),
|
|
362
386
|
/* @__PURE__ */ a("div", { className: "mt-4 flex flex-wrap items-center justify-end gap-2", children: [
|
|
363
|
-
|
|
387
|
+
!$ && /* @__PURE__ */ a(
|
|
364
388
|
"p",
|
|
365
389
|
{
|
|
366
390
|
className: "mr-auto text-[12px] text-slate-500 dark:text-muted-foreground",
|
|
367
391
|
role: "status",
|
|
368
392
|
children: [
|
|
369
393
|
"Pick a value for ",
|
|
370
|
-
|
|
394
|
+
y,
|
|
371
395
|
" ",
|
|
372
|
-
|
|
396
|
+
y === 1 ? "field" : "fields",
|
|
373
397
|
" to save."
|
|
374
398
|
]
|
|
375
399
|
}
|
|
376
400
|
),
|
|
377
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ d(
|
|
378
402
|
"button",
|
|
379
403
|
{
|
|
380
404
|
type: "button",
|
|
381
|
-
onClick:
|
|
405
|
+
onClick: M,
|
|
382
406
|
className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] text-slate-600 dark:border-border dark:text-muted-foreground",
|
|
383
|
-
children:
|
|
407
|
+
children: w
|
|
384
408
|
}
|
|
385
409
|
),
|
|
386
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ d(
|
|
387
411
|
"button",
|
|
388
412
|
{
|
|
389
413
|
type: "button",
|
|
390
|
-
disabled:
|
|
391
|
-
onClick: () =>
|
|
414
|
+
disabled: !$,
|
|
415
|
+
onClick: () => v(U(N, b)),
|
|
392
416
|
className: "h-8 rounded-md bg-nvr-cyan px-4 text-[12.5px] font-medium text-white disabled:cursor-not-allowed disabled:opacity-50",
|
|
393
|
-
children:
|
|
417
|
+
children: S
|
|
394
418
|
}
|
|
395
419
|
)
|
|
396
420
|
] })
|
|
397
421
|
] });
|
|
398
422
|
}
|
|
399
423
|
export {
|
|
400
|
-
|
|
401
|
-
|
|
424
|
+
de as LineCollisionDialog,
|
|
425
|
+
X as MidairCollisionDialog
|
|
402
426
|
};
|