@nivaro/react 0.3.116 → 0.3.118
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 +140 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3855 -3785
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ReportView.js +1086 -1091
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/cbv/column-totals.js +62 -57
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/charts/category-axis.js +93 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/use-query-entry.js +17 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,146 +1,155 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
import { useState as E, useRef as p, useEffect as x, useLayoutEffect as q } from "react";
|
|
2
|
+
function N(n, t) {
|
|
3
|
+
return n.deleted || !t || t.length === 0 ? !1 : n.changedFields === null ? !n.aspectsOnly : n.changedFields.some((e) => t.includes(e));
|
|
4
4
|
}
|
|
5
|
-
function A(
|
|
6
|
-
const e = (
|
|
5
|
+
function A(n, t) {
|
|
6
|
+
const e = (n ?? []).find((l) => l.field === t);
|
|
7
7
|
return e ? e.hidden ? "hidden" : e.readonly ? "readonly" : "editable" : "absent";
|
|
8
8
|
}
|
|
9
|
-
const B = (
|
|
10
|
-
if (
|
|
9
|
+
const B = (n, t) => {
|
|
10
|
+
if (n === t || (n == null || n === "") && (t == null || t === "")) return !0;
|
|
11
11
|
try {
|
|
12
|
-
return JSON.stringify(
|
|
12
|
+
return JSON.stringify(n) === JSON.stringify(t);
|
|
13
13
|
} catch {
|
|
14
14
|
return !1;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
function j(n, t) {
|
|
18
|
+
const e = (t == null ? void 0 : t.assignments) ?? [];
|
|
19
|
+
if (!n || e.length === 0) return n;
|
|
20
|
+
const l = new Set(
|
|
21
|
+
e.filter((o) => o.is_visible !== !1 && o.is_visible !== 0).map((o) => o.field)
|
|
22
|
+
);
|
|
23
|
+
return n.map((o) => l.has(o.field) || o.hidden ? o : { ...o, hidden: !0 });
|
|
24
|
+
}
|
|
25
|
+
function H(n, t, e) {
|
|
26
|
+
const l = [], o = [];
|
|
27
|
+
for (const r of Object.keys(n)) {
|
|
28
|
+
if (r.startsWith("$") || r.startsWith("__") || B(n[r], t[r])) continue;
|
|
29
|
+
const s = A(e, r);
|
|
30
|
+
s === "editable" ? l.push(r) : o.push({ field: r, status: s });
|
|
23
31
|
}
|
|
24
|
-
return { keep:
|
|
32
|
+
return { keep: l, held: o };
|
|
25
33
|
}
|
|
26
|
-
function J(
|
|
27
|
-
const
|
|
28
|
-
for (const
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
const i = e.get(
|
|
34
|
+
function J(n, t, e, l) {
|
|
35
|
+
const o = /* @__PURE__ */ new Set([...n.keys(), ...t.keys()]), r = [];
|
|
36
|
+
for (const s of o) {
|
|
37
|
+
const u = n.get(s) ?? [], d = [...t.get(s) ?? []];
|
|
38
|
+
if (u.length === 0 && d.length === 0) continue;
|
|
39
|
+
const i = e.get(s);
|
|
32
40
|
if (!i) continue;
|
|
33
|
-
const
|
|
34
|
-
|
|
41
|
+
const f = A(l, i);
|
|
42
|
+
f !== "editable" && r.push({ field: i, stagingKey: s, status: f, links: [...u], unlinks: d });
|
|
35
43
|
}
|
|
36
|
-
return
|
|
44
|
+
return r;
|
|
37
45
|
}
|
|
38
|
-
function M(
|
|
46
|
+
function M(n, t) {
|
|
39
47
|
const e = [];
|
|
40
|
-
return
|
|
48
|
+
return n > 0 && e.push(`${n} link${n === 1 ? "" : "s"} added`), t > 0 && e.push(`${t} link${t === 1 ? "" : "s"} removed`), e.join(" · ") || "No change";
|
|
41
49
|
}
|
|
42
|
-
function U(
|
|
43
|
-
const
|
|
44
|
-
return
|
|
50
|
+
function U(n) {
|
|
51
|
+
const t = n == null ? void 0 : n.trim();
|
|
52
|
+
return t ? `Form updated for ${t}` : "Form updated";
|
|
45
53
|
}
|
|
46
|
-
function O(
|
|
47
|
-
let
|
|
48
|
-
for (;
|
|
49
|
-
const e = getComputedStyle(
|
|
50
|
-
if (/(auto|scroll)/.test(e.overflowY) &&
|
|
51
|
-
|
|
54
|
+
function O(n) {
|
|
55
|
+
let t = (n == null ? void 0 : n.parentElement) ?? null;
|
|
56
|
+
for (; t && t !== document.body; ) {
|
|
57
|
+
const e = getComputedStyle(t);
|
|
58
|
+
if (/(auto|scroll)/.test(e.overflowY) && t.scrollHeight > t.clientHeight) return t;
|
|
59
|
+
t = t.parentElement;
|
|
52
60
|
}
|
|
53
61
|
return document.scrollingElement ?? null;
|
|
54
62
|
}
|
|
55
|
-
function C(
|
|
63
|
+
function C(n) {
|
|
56
64
|
try {
|
|
57
|
-
return document.querySelector(`[data-field="${CSS.escape(
|
|
65
|
+
return document.querySelector(`[data-field="${CSS.escape(n)}"]`);
|
|
58
66
|
} catch {
|
|
59
67
|
return null;
|
|
60
68
|
}
|
|
61
69
|
}
|
|
62
|
-
function
|
|
63
|
-
var
|
|
70
|
+
function _() {
|
|
71
|
+
var s, u;
|
|
64
72
|
if (typeof document > "u") return null;
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
for (const
|
|
69
|
-
const i =
|
|
73
|
+
const n = [...document.querySelectorAll("[data-field]")];
|
|
74
|
+
if (n.length === 0) return null;
|
|
75
|
+
const t = O(n[0]), e = t && t !== document.scrollingElement ? t.getBoundingClientRect().top : 0, l = [];
|
|
76
|
+
for (const d of n) {
|
|
77
|
+
const i = d.getBoundingClientRect();
|
|
70
78
|
if (i.height === 0 || i.bottom <= e) continue;
|
|
71
|
-
const
|
|
72
|
-
if (!(!
|
|
79
|
+
const f = d.getAttribute("data-field");
|
|
80
|
+
if (!(!f || l.some((a) => a.key === f)) && (l.push({ key: f, top: i.top - e }), l.length >= 6))
|
|
73
81
|
break;
|
|
74
82
|
}
|
|
75
|
-
const
|
|
76
|
-
return { fields:
|
|
83
|
+
const o = document.activeElement, r = ((u = (s = o == null ? void 0 : o.closest) == null ? void 0 : s.call(o, "[data-field]")) == null ? void 0 : u.getAttribute("data-field")) ?? null;
|
|
84
|
+
return { fields: l, focused: r, scroller: t };
|
|
77
85
|
}
|
|
78
|
-
function R(
|
|
79
|
-
if (!
|
|
80
|
-
const
|
|
81
|
-
let
|
|
82
|
-
for (const
|
|
83
|
-
const
|
|
84
|
-
if (!
|
|
85
|
-
const
|
|
86
|
-
Math.abs(
|
|
86
|
+
function R(n) {
|
|
87
|
+
if (!n || typeof document > "u") return !1;
|
|
88
|
+
const t = n.scroller, e = t && t !== document.scrollingElement ? t.getBoundingClientRect().top : 0;
|
|
89
|
+
let l = !1;
|
|
90
|
+
for (const o of n.fields) {
|
|
91
|
+
const r = C(o.key);
|
|
92
|
+
if (!r) continue;
|
|
93
|
+
const s = r.getBoundingClientRect().top - e - o.top;
|
|
94
|
+
Math.abs(s) >= 1 && (t ? t.scrollTop += s : window.scrollBy(0, s)), l = !0;
|
|
87
95
|
break;
|
|
88
96
|
}
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
97
|
+
if (n.focused) {
|
|
98
|
+
const o = C(n.focused);
|
|
99
|
+
if (o && !o.contains(document.activeElement)) {
|
|
100
|
+
const r = o.querySelector(
|
|
93
101
|
'input:not([type=hidden]):not([disabled]), textarea:not([disabled]), [role="combobox"], [contenteditable="true"]'
|
|
94
102
|
);
|
|
95
|
-
|
|
103
|
+
r == null || r.focus({ preventScroll: !0 });
|
|
96
104
|
}
|
|
97
105
|
}
|
|
98
|
-
return
|
|
106
|
+
return l;
|
|
99
107
|
}
|
|
100
|
-
function W(
|
|
108
|
+
function W(n, t) {
|
|
101
109
|
var g, y, h;
|
|
102
|
-
const [e,
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
var
|
|
109
|
-
const c =
|
|
110
|
-
if (!
|
|
111
|
-
|
|
110
|
+
const [e, l] = E(n), [o, r] = E(null), s = p(e);
|
|
111
|
+
s.current = e;
|
|
112
|
+
const u = p(t);
|
|
113
|
+
u.current = t;
|
|
114
|
+
const d = p(null), i = p(0);
|
|
115
|
+
x(() => {
|
|
116
|
+
var k, b;
|
|
117
|
+
const c = s.current, m = ((k = n == null ? void 0 : n.layout) == null ? void 0 : k.id) ?? null, T = ((b = c == null ? void 0 : c.layout) == null ? void 0 : b.id) ?? null;
|
|
118
|
+
if (!u.current.enabled || c === void 0 || n === void 0 || m === T) {
|
|
119
|
+
n !== c && l(n);
|
|
112
120
|
return;
|
|
113
121
|
}
|
|
114
|
-
if (
|
|
115
|
-
|
|
122
|
+
if (n === null || m == null) {
|
|
123
|
+
l(n);
|
|
116
124
|
return;
|
|
117
125
|
}
|
|
118
126
|
let S = !1;
|
|
119
|
-
const
|
|
120
|
-
return
|
|
121
|
-
if (S ||
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
127
|
+
const w = ++i.current;
|
|
128
|
+
return u.current.prepare(m).catch(() => null).then(($) => {
|
|
129
|
+
if (S || w !== i.current) return;
|
|
130
|
+
d.current = _();
|
|
131
|
+
const v = { from: c ?? null, to: n, n: w };
|
|
132
|
+
u.current.onSwitch(v, $), l(n), r(v);
|
|
125
133
|
}), () => {
|
|
126
134
|
S = !0;
|
|
127
135
|
};
|
|
128
|
-
}, [
|
|
129
|
-
const a =
|
|
136
|
+
}, [n]);
|
|
137
|
+
const a = n == null || e === void 0 || !t.enabled || (((g = n == null ? void 0 : n.layout) == null ? void 0 : g.id) ?? null) === (((y = e == null ? void 0 : e.layout) == null ? void 0 : y.id) ?? null) ? n : e, F = ((h = a == null ? void 0 : a.layout) == null ? void 0 : h.id) ?? null;
|
|
130
138
|
return q(() => {
|
|
131
|
-
const c =
|
|
132
|
-
if (c && (
|
|
139
|
+
const c = d.current;
|
|
140
|
+
if (c && (d.current = null, !R(c))) {
|
|
133
141
|
const m = requestAnimationFrame(() => R(c));
|
|
134
142
|
return () => cancelAnimationFrame(m);
|
|
135
143
|
}
|
|
136
|
-
}, [
|
|
144
|
+
}, [F]), { shown: a, last: o };
|
|
137
145
|
}
|
|
138
146
|
export {
|
|
139
|
-
|
|
147
|
+
_ as captureFormAnchor,
|
|
140
148
|
A as fieldStatus,
|
|
141
149
|
U as formUpdatedText,
|
|
142
|
-
|
|
150
|
+
N as layoutMayChange,
|
|
143
151
|
M as linkChangeText,
|
|
152
|
+
j as placedFields,
|
|
144
153
|
R as restoreFormAnchor,
|
|
145
154
|
J as splitStagedLinks,
|
|
146
155
|
H as splitUnsaved,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as w, jsx as g } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as _, keepPreviousData as J } from "@tanstack/react-query";
|
|
3
3
|
import { Send as O } from "lucide-react";
|
|
4
|
-
import { useContext as L, createContext as
|
|
4
|
+
import { useContext as L, createContext as T, useState as j, useRef as q, useCallback as C, useMemo as F } from "react";
|
|
5
5
|
import { useNivaroClient as B } from "../../context.js";
|
|
6
6
|
import { useDebounced as R } from "../../hooks/useDebounced.js";
|
|
7
7
|
import { post as H } from "../../lib/commands.js";
|
|
8
8
|
import { cn as V } from "../../lib/utils.js";
|
|
9
|
-
const G =
|
|
9
|
+
const G = T(null), oe = () => L(G), Q = 600;
|
|
10
10
|
function ae(e) {
|
|
11
11
|
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" && "id" in e ? e.id == null : !1;
|
|
12
12
|
}
|
|
@@ -32,13 +32,13 @@ function z(e) {
|
|
|
32
32
|
const [t, ...i] = e.partners;
|
|
33
33
|
return `Needed by ${t ?? "a partner"}${i.length ? ` + ${i.length}` : ""}`;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const t = e.partners.join(", ") || "
|
|
37
|
-
return
|
|
35
|
+
function I(e) {
|
|
36
|
+
const t = e.partners.join(", ") || "a partner system", i = e.steps.length ? ` at ${e.steps.join(" / ")}` : " at a later step";
|
|
37
|
+
return `This record is sent to ${t}${i}, which needs this field. Fill it in now so the step does not stop on it later.`;
|
|
38
38
|
}
|
|
39
39
|
const W = {}, X = {}, Y = {};
|
|
40
40
|
function de(e) {
|
|
41
|
-
const t = B(), { collection: i, itemId: p, enabled: l, draft: m } = e, [n, x] = j(null), [h, u] = j(/* @__PURE__ */ new Map()), c =
|
|
41
|
+
const t = B(), { collection: i, itemId: p, enabled: l, draft: m } = e, [n, x] = j(null), [h, u] = j(/* @__PURE__ */ new Map()), c = q(/* @__PURE__ */ new Map()), f = C((o, a) => {
|
|
42
42
|
if (a === null) {
|
|
43
43
|
if (!c.current.has(o)) return;
|
|
44
44
|
c.current.delete(o), u((r) => {
|
|
@@ -49,7 +49,7 @@ function de(e) {
|
|
|
49
49
|
}
|
|
50
50
|
const d = JSON.stringify(a);
|
|
51
51
|
c.current.get(o) !== d && (c.current.set(o, d), u((r) => new Map(r).set(o, a)));
|
|
52
|
-
}, []),
|
|
52
|
+
}, []), M = l ? U(n, m, h) : "", y = R(M, Q), A = _({
|
|
53
53
|
queryKey: ["partner-needs", i, p ?? "new", y],
|
|
54
54
|
enabled: l && !!i && y !== "",
|
|
55
55
|
staleTime: 3e4,
|
|
@@ -69,11 +69,11 @@ function de(e) {
|
|
|
69
69
|
return JSON.stringify(E) === JSON.stringify(r) ? r : E;
|
|
70
70
|
}), d;
|
|
71
71
|
}
|
|
72
|
-
}), s = l ?
|
|
72
|
+
}), s = l ? A.data : null, P = C((o) => {
|
|
73
73
|
var a;
|
|
74
74
|
return (a = n == null ? void 0 : n.lines[o]) == null ? void 0 : a.fields;
|
|
75
75
|
}, [n]);
|
|
76
|
-
return
|
|
76
|
+
return F(() => l ? {
|
|
77
77
|
fields: (s == null ? void 0 : s.fields) ?? W,
|
|
78
78
|
hints: (s == null ? void 0 : s.hints) ?? X,
|
|
79
79
|
lines: (s == null ? void 0 : s.lines) ?? Y,
|
|
@@ -87,7 +87,7 @@ function le({ field: e, mark: t }) {
|
|
|
87
87
|
"span",
|
|
88
88
|
{
|
|
89
89
|
"data-partner-need": e,
|
|
90
|
-
"data-tip":
|
|
90
|
+
"data-tip": I(t),
|
|
91
91
|
className: V(Z, "cursor-default"),
|
|
92
92
|
children: [
|
|
93
93
|
/* @__PURE__ */ g(O, { className: "h-2.5 w-2.5 shrink-0", "aria-hidden": "true" }),
|
|
@@ -116,7 +116,7 @@ function ue({ field: e, mark: t }) {
|
|
|
116
116
|
"span",
|
|
117
117
|
{
|
|
118
118
|
"data-partner-need-cell": e,
|
|
119
|
-
"data-tip":
|
|
119
|
+
"data-tip": I(t),
|
|
120
120
|
className: "pointer-events-auto absolute right-1 top-1/2 inline-flex -translate-y-1/2 items-center gap-0.5 rounded border border-indigo-200 bg-indigo-50 px-1 text-[9.5px] font-medium leading-4 text-indigo-700 dark:border-indigo-400/25 dark:bg-indigo-400/10 dark:text-indigo-200",
|
|
121
121
|
children: [
|
|
122
122
|
/* @__PURE__ */ g(O, { className: "h-2 w-2 shrink-0", "aria-hidden": "true" }),
|
|
@@ -135,7 +135,7 @@ export {
|
|
|
135
135
|
G as PartnerNeedsContext,
|
|
136
136
|
ae as isEmptyValue,
|
|
137
137
|
z as needLabel,
|
|
138
|
-
|
|
138
|
+
I as needTip,
|
|
139
139
|
U as partnerNeedsSignature,
|
|
140
140
|
oe as usePartnerNeeds,
|
|
141
141
|
de as usePartnerNeedsForm
|
|
@@ -1,58 +1,64 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
const t = {},
|
|
4
|
-
for (const [s,
|
|
5
|
-
if (
|
|
6
|
-
const
|
|
7
|
-
if (String(
|
|
1
|
+
const f = /* @__PURE__ */ new Set(["id", "sort", "date_created", "date_updated", "user_created", "user_updated"]);
|
|
2
|
+
function m(e, i, n, r = /* @__PURE__ */ new Set()) {
|
|
3
|
+
const t = {}, o = e ?? {}, a = (c) => {
|
|
4
|
+
for (const [s, u] of Object.entries(c ?? {})) {
|
|
5
|
+
if (f.has(s) || r.has(s) || s.startsWith("$") || s.startsWith("__") || u !== null && typeof u == "object" && !Array.isArray(u)) continue;
|
|
6
|
+
const l = o[s];
|
|
7
|
+
if (String(u ?? "") === String(l ?? "")) {
|
|
8
8
|
delete t[s];
|
|
9
9
|
continue;
|
|
10
10
|
}
|
|
11
|
-
t[s] =
|
|
11
|
+
t[s] = u;
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
return a(n), a(i), t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function v(e, i, n) {
|
|
17
17
|
const r = e.indexOf(n);
|
|
18
18
|
if (r < 0) return null;
|
|
19
19
|
for (let t = r + 1; t < e.length; t++) if (i.has(e[t])) return e[t];
|
|
20
20
|
for (let t = r - 1; t >= 0; t--) if (i.has(e[t])) return e[t];
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
if (!e) return "
|
|
23
|
+
function h(e, i) {
|
|
24
|
+
if (!e) return "Removed by someone else";
|
|
25
25
|
if (e.user_id && i && e.user_id.toUpperCase() === i.toUpperCase())
|
|
26
26
|
return "You removed this line in another tab";
|
|
27
|
-
if (e.via === "outside") return "
|
|
27
|
+
if (e.via === "outside") return "Removed outside the app";
|
|
28
28
|
const n = String(e.who ?? "").trim();
|
|
29
|
-
return n ? `${n.charAt(0).toUpperCase()}${n.slice(1)} removed this line` : "
|
|
29
|
+
return e.via === "procedure" ? n ? `Removed by ${/^procedure\b/i.test(n) ? n : `procedure ${n}`}` : "Removed by a procedure" : e.via === "import" ? n ? `Removed by an import (${n})` : "Removed by an import" : e.via === "system" && !n ? "Removed by the system" : n ? `${n.charAt(0).toUpperCase()}${n.slice(1)} removed this line` : "Removed by someone else";
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const d = /\s*[·•|]\s*/;
|
|
32
|
+
function p(e) {
|
|
33
|
+
return String(e ?? "").split(d).map((i) => i.replace(/^[\s,;:–—-]+|[\s,;:–—-]+$/g, "")).filter(Boolean).join(" · ");
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function $(e, i) {
|
|
36
|
+
const n = p(e), r = i != null && i > 0 ? i : null, t = n.split(" · ").filter((o) => !/^(line|row)$/i.test(o) && !(r != null && /^#\d+$/.test(o))).join(" · ");
|
|
37
|
+
return r == null ? t || "A line" : t && !/^line\s*\d/i.test(t) ? `Line ${r} · ${t}` : t || `Line ${r}`;
|
|
38
|
+
}
|
|
39
|
+
function j(e, i) {
|
|
35
40
|
const n = {};
|
|
36
41
|
for (const [r, t] of Object.entries({ ...e, ...i }))
|
|
37
42
|
if (!Array.isArray(t)) {
|
|
38
43
|
if (t !== null && typeof t == "object") {
|
|
39
|
-
const
|
|
40
|
-
|
|
44
|
+
const o = t.id;
|
|
45
|
+
o != null && (n[r] = o);
|
|
41
46
|
continue;
|
|
42
47
|
}
|
|
43
48
|
n[r] = t;
|
|
44
49
|
}
|
|
45
50
|
return n;
|
|
46
51
|
}
|
|
47
|
-
function
|
|
52
|
+
function L(e, i) {
|
|
48
53
|
return Object.entries(e).map(([n, r]) => `${i(n)}: ${r == null ? "" : String(r)}`).join(`
|
|
49
54
|
`);
|
|
50
55
|
}
|
|
51
56
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
p as cleanLineLabel,
|
|
58
|
+
v as nextLineAfter,
|
|
59
|
+
$ as removedLineName,
|
|
60
|
+
h as removedLineText,
|
|
61
|
+
j as restorableLine,
|
|
62
|
+
m as unsavedLineChanges,
|
|
63
|
+
L as unsavedLineText
|
|
58
64
|
};
|