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