@nivaro/react 0.3.117 → 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.
Files changed (137) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3757 -3695
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/file-live.js +69 -54
  73. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  74. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  75. package/dist/shared/components/item-edit/removed-line.js +31 -25
  76. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  77. package/dist/shared/components/list/ListViewers.js +46 -35
  78. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  79. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  80. package/dist/shared/components/panels/AlertBanners.js +82 -72
  81. package/dist/shared/components/panels/BranchLanes.js +22 -22
  82. package/dist/shared/components/panels/CommentImages.js +123 -102
  83. package/dist/shared/components/panels/CommentPanel.js +186 -185
  84. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  85. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  86. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  87. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  88. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  89. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  90. package/dist/shared/components/profile/AgentNameField.js +107 -81
  91. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  92. package/dist/shared/components/profile/PersonAccess.js +599 -495
  93. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  94. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  95. package/dist/shared/components/profile/primitives.js +1 -1
  96. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  97. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  98. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  99. package/dist/shared/components/support/AssignRules.js +1733 -0
  100. package/dist/shared/components/support/PersonPick.js +88 -0
  101. package/dist/shared/components/support/RequestList.js +790 -0
  102. package/dist/shared/components/support/ScreenShare.js +158 -152
  103. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  104. package/dist/shared/components/support/SupportView.js +140 -246
  105. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  106. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  107. package/dist/shared/components/support/assign-rules-text.js +171 -0
  108. package/dist/shared/components/support/support-list.js +125 -0
  109. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  110. package/dist/shared/components/ui/checkbox.js +6 -6
  111. package/dist/shared/components/ui/select.js +43 -39
  112. package/dist/shared/components/ui/sheet.js +9 -9
  113. package/dist/shared/components/ui/switch.js +12 -11
  114. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  115. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  116. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  117. package/dist/shared/lib/activity-sentence.js +103 -91
  118. package/dist/shared/lib/agent-presence.js +27 -21
  119. package/dist/shared/lib/approval-progress.js +2 -2
  120. package/dist/shared/lib/copy-rules.js +31 -24
  121. package/dist/shared/lib/derived-causes.js +113 -78
  122. package/dist/shared/lib/grid-cursors.js +26 -26
  123. package/dist/shared/lib/label-flash.js +27 -0
  124. package/dist/shared/lib/list-return.js +137 -125
  125. package/dist/shared/lib/live-deltas.js +40 -34
  126. package/dist/shared/lib/live-groups.js +56 -52
  127. package/dist/shared/lib/live-preference.js +64 -59
  128. package/dist/shared/lib/live-screen.js +223 -192
  129. package/dist/shared/lib/partner-failure.js +11 -11
  130. package/dist/shared/lib/rollup-recalc.js +68 -64
  131. package/dist/shared/lib/screen-refresh.js +74 -68
  132. package/dist/shared/lib/screen-share.js +108 -104
  133. package/dist/shared/lib/send-status.js +77 -61
  134. package/dist/shared/lib/text-diff-window.js +29 -0
  135. package/dist/shared/lib/watch-list.js +210 -209
  136. package/dist/shared/lib/widget-image-render.js +72 -49
  137. package/package.json +1 -1
@@ -1,146 +1,155 @@
1
- import { useState as v, useRef as p, useEffect as F, useLayoutEffect as q } from "react";
2
- function j(t, n) {
3
- return t.deleted || !n || n.length === 0 ? !1 : t.changedFields === null ? !t.aspectsOnly : t.changedFields.some((e) => n.includes(e));
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(t, n) {
6
- const e = (t ?? []).find((u) => u.field === n);
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 = (t, n) => {
10
- if (t === n || (t == null || t === "") && (n == null || n === "")) return !0;
9
+ const B = (n, t) => {
10
+ if (n === t || (n == null || n === "") && (t == null || t === "")) return !0;
11
11
  try {
12
- return JSON.stringify(t) === JSON.stringify(n);
12
+ return JSON.stringify(n) === JSON.stringify(t);
13
13
  } catch {
14
14
  return !1;
15
15
  }
16
16
  };
17
- function H(t, n, e) {
18
- const u = [], r = [];
19
- for (const o of Object.keys(t)) {
20
- if (o.startsWith("$") || o.startsWith("__") || B(t[o], n[o])) continue;
21
- const l = A(e, o);
22
- l === "editable" ? u.push(o) : r.push({ field: o, status: l });
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: u, held: r };
32
+ return { keep: l, held: o };
25
33
  }
26
- function J(t, n, e, u) {
27
- const r = /* @__PURE__ */ new Set([...t.keys(), ...n.keys()]), o = [];
28
- for (const l of r) {
29
- const s = t.get(l) ?? [], f = [...n.get(l) ?? []];
30
- if (s.length === 0 && f.length === 0) continue;
31
- const i = e.get(l);
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 d = A(u, i);
34
- d !== "editable" && o.push({ field: i, stagingKey: l, status: d, links: [...s], unlinks: f });
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 o;
44
+ return r;
37
45
  }
38
- function M(t, n) {
46
+ function M(n, t) {
39
47
  const e = [];
40
- return t > 0 && e.push(`${t} link${t === 1 ? "" : "s"} added`), n > 0 && e.push(`${n} link${n === 1 ? "" : "s"} removed`), e.join(" · ") || "No change";
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(t) {
43
- const n = t == null ? void 0 : t.trim();
44
- return n ? `Form updated for ${n}` : "Form updated";
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(t) {
47
- let n = (t == null ? void 0 : t.parentElement) ?? null;
48
- for (; n && n !== document.body; ) {
49
- const e = getComputedStyle(n);
50
- if (/(auto|scroll)/.test(e.overflowY) && n.scrollHeight > n.clientHeight) return n;
51
- n = n.parentElement;
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(t) {
63
+ function C(n) {
56
64
  try {
57
- return document.querySelector(`[data-field="${CSS.escape(t)}"]`);
65
+ return document.querySelector(`[data-field="${CSS.escape(n)}"]`);
58
66
  } catch {
59
67
  return null;
60
68
  }
61
69
  }
62
- function I() {
63
- var l, s;
70
+ function _() {
71
+ var s, u;
64
72
  if (typeof document > "u") return null;
65
- const t = [...document.querySelectorAll("[data-field]")];
66
- if (t.length === 0) return null;
67
- const n = O(t[0]), e = n && n !== document.scrollingElement ? n.getBoundingClientRect().top : 0, u = [];
68
- for (const f of t) {
69
- const i = f.getBoundingClientRect();
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 d = f.getAttribute("data-field");
72
- if (!(!d || u.some((a) => a.key === d)) && (u.push({ key: d, top: i.top - e }), u.length >= 6))
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 r = document.activeElement, o = ((s = (l = r == null ? void 0 : r.closest) == null ? void 0 : l.call(r, "[data-field]")) == null ? void 0 : s.getAttribute("data-field")) ?? null;
76
- return { fields: u, focused: o, scroller: n };
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(t) {
79
- if (!t || typeof document > "u") return !1;
80
- const n = t.scroller, e = n && n !== document.scrollingElement ? n.getBoundingClientRect().top : 0;
81
- let u = !1;
82
- for (const r of t.fields) {
83
- const o = C(r.key);
84
- if (!o) continue;
85
- const l = o.getBoundingClientRect().top - e - r.top;
86
- Math.abs(l) >= 1 && (n ? n.scrollTop += l : window.scrollBy(0, l)), u = !0;
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 (t.focused) {
90
- const r = C(t.focused);
91
- if (r && !r.contains(document.activeElement)) {
92
- const o = r.querySelector(
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
- o == null || o.focus({ preventScroll: !0 });
103
+ r == null || r.focus({ preventScroll: !0 });
96
104
  }
97
105
  }
98
- return u;
106
+ return l;
99
107
  }
100
- function W(t, n) {
108
+ function W(n, t) {
101
109
  var g, y, h;
102
- const [e, u] = v(t), [r, o] = v(null), l = p(e);
103
- l.current = e;
104
- const s = p(n);
105
- s.current = n;
106
- const f = p(null), i = p(0);
107
- F(() => {
108
- var w, E;
109
- const c = l.current, m = ((w = t == null ? void 0 : t.layout) == null ? void 0 : w.id) ?? null, $ = ((E = c == null ? void 0 : c.layout) == null ? void 0 : E.id) ?? null;
110
- if (!s.current.enabled || c === void 0 || t === void 0 || m === $) {
111
- t !== c && u(t);
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 (t === null || m == null) {
115
- u(t);
122
+ if (n === null || m == null) {
123
+ l(n);
116
124
  return;
117
125
  }
118
126
  let S = !1;
119
- const k = ++i.current;
120
- return s.current.prepare(m).catch(() => null).then((x) => {
121
- if (S || k !== i.current) return;
122
- f.current = I();
123
- const b = { from: c ?? null, to: t, n: k };
124
- s.current.onSwitch(b, x), u(t), o(b);
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
- }, [t]);
129
- const a = t == null || e === void 0 || !n.enabled || (((g = t == null ? void 0 : t.layout) == null ? void 0 : g.id) ?? null) === (((y = e == null ? void 0 : e.layout) == null ? void 0 : y.id) ?? null) ? t : e, T = ((h = a == null ? void 0 : a.layout) == null ? void 0 : h.id) ?? null;
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 = f.current;
132
- if (c && (f.current = null, !R(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
- }, [T]), { shown: a, last: r };
144
+ }, [F]), { shown: a, last: o };
137
145
  }
138
146
  export {
139
- I as captureFormAnchor,
147
+ _ as captureFormAnchor,
140
148
  A as fieldStatus,
141
149
  U as formUpdatedText,
142
- j as layoutMayChange,
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 q, useState as j, useRef as F, useCallback as A, useMemo as T } from "react";
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 = q(null), oe = () => L(G), Q = 600;
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 C(e) {
36
- const t = e.partners.join(", ") || "A partner system", i = e.steps.length ? ` at ${e.steps.join(" / ")}` : " at a later step";
37
- return `${t} needs this${i}. Fill it in now so the step does not stop on it later.`;
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 = F(/* @__PURE__ */ new Map()), f = A((o, a) => {
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
- }, []), I = l ? U(n, m, h) : "", y = R(I, Q), M = _({
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 ? M.data : null, P = A((o) => {
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 T(() => l ? {
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": C(t),
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": C(t),
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
- C as needTip,
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 l = /* @__PURE__ */ new Set(["id", "sort", "date_created", "date_updated", "user_created", "user_updated"]);
2
- function d(e, i, n, r = /* @__PURE__ */ new Set()) {
3
- const t = {}, u = e ?? {}, a = (c) => {
4
- for (const [s, o] of Object.entries(c ?? {})) {
5
- if (l.has(s) || r.has(s) || s.startsWith("$") || s.startsWith("__") || o !== null && typeof o == "object" && !Array.isArray(o)) continue;
6
- const f = u[s];
7
- if (String(o ?? "") === String(f ?? "")) {
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] = o;
11
+ t[s] = u;
12
12
  }
13
13
  };
14
14
  return a(n), a(i), t;
15
15
  }
16
- function h(e, i, n) {
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 p(e, i) {
24
- if (!e) return "This line was removed";
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 "This line was removed outside the app";
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` : "This line was removed";
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
- function v(e) {
32
- return String(e ?? "").replace(/^[\s·•|,;:–—-]+|[\s·•|,;:–—-]+$/g, "").replace(/\s*·\s*·\s*/g, " · ");
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 g(e, i) {
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 u = t.id;
40
- u != null && (n[r] = u);
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 j(e, i) {
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
- v as cleanLineLabel,
53
- h as nextLineAfter,
54
- p as removedLineText,
55
- g as restorableLine,
56
- d as unsavedLineChanges,
57
- j as unsavedLineText
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
  };