@nivaro/react 0.3.117 → 0.3.119

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 (138) 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 +4451 -4385
  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 +135 -94
  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 +88 -85
  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 +245 -141
  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 +15 -16
  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/addendum-view.js +6 -0
  73. package/dist/shared/components/item-edit/file-live.js +69 -54
  74. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  75. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  76. package/dist/shared/components/item-edit/removed-line.js +31 -25
  77. package/dist/shared/components/layout-editor/pickers/field-picker.js +151 -130
  78. package/dist/shared/components/list/ListViewers.js +46 -35
  79. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  80. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  81. package/dist/shared/components/panels/AlertBanners.js +82 -72
  82. package/dist/shared/components/panels/BranchLanes.js +22 -22
  83. package/dist/shared/components/panels/CommentImages.js +123 -102
  84. package/dist/shared/components/panels/CommentPanel.js +186 -185
  85. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  86. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  87. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  88. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  89. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  90. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  91. package/dist/shared/components/profile/AgentNameField.js +107 -81
  92. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  93. package/dist/shared/components/profile/PersonAccess.js +599 -495
  94. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  95. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  96. package/dist/shared/components/profile/primitives.js +1 -1
  97. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  98. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  99. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  100. package/dist/shared/components/support/AssignRules.js +1733 -0
  101. package/dist/shared/components/support/PersonPick.js +88 -0
  102. package/dist/shared/components/support/RequestList.js +790 -0
  103. package/dist/shared/components/support/ScreenShare.js +158 -152
  104. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  105. package/dist/shared/components/support/SupportView.js +140 -246
  106. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  107. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  108. package/dist/shared/components/support/assign-rules-text.js +171 -0
  109. package/dist/shared/components/support/support-list.js +125 -0
  110. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  111. package/dist/shared/components/ui/checkbox.js +6 -6
  112. package/dist/shared/components/ui/select.js +43 -39
  113. package/dist/shared/components/ui/sheet.js +9 -9
  114. package/dist/shared/components/ui/switch.js +12 -11
  115. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  116. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  117. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  118. package/dist/shared/lib/activity-sentence.js +103 -91
  119. package/dist/shared/lib/agent-presence.js +27 -21
  120. package/dist/shared/lib/approval-progress.js +2 -2
  121. package/dist/shared/lib/copy-rules.js +31 -24
  122. package/dist/shared/lib/derived-causes.js +113 -78
  123. package/dist/shared/lib/grid-cursors.js +26 -26
  124. package/dist/shared/lib/label-flash.js +27 -0
  125. package/dist/shared/lib/list-return.js +137 -125
  126. package/dist/shared/lib/live-deltas.js +40 -34
  127. package/dist/shared/lib/live-groups.js +56 -52
  128. package/dist/shared/lib/live-preference.js +64 -59
  129. package/dist/shared/lib/live-screen.js +223 -192
  130. package/dist/shared/lib/partner-failure.js +11 -11
  131. package/dist/shared/lib/rollup-recalc.js +68 -64
  132. package/dist/shared/lib/screen-refresh.js +74 -68
  133. package/dist/shared/lib/screen-share.js +108 -104
  134. package/dist/shared/lib/send-status.js +77 -61
  135. package/dist/shared/lib/text-diff-window.js +29 -0
  136. package/dist/shared/lib/watch-list.js +210 -209
  137. package/dist/shared/lib/widget-image-render.js +72 -49
  138. package/package.json +1 -1
@@ -1,115 +1,150 @@
1
- import { useQueryClient as M, useQuery as N } from "@tanstack/react-query";
2
- import { useEffect as C, useSyncExternalStore as w } from "react";
3
- import { useNivaroClient as v } from "../context.js";
4
- import { get as D } from "./commands.js";
5
- import { useLiveRecord as F } from "./live.js";
6
- const _ = 72 * 36e5, Y = 2 * 6e4, y = (e, n) => [
1
+ import { useQueryClient as C, useQuery as M } from "@tanstack/react-query";
2
+ import { useEffect as D, useSyncExternalStore as w } from "react";
3
+ import { useNivaroClient as A } from "../context.js";
4
+ import { get as F } from "./commands.js";
5
+ import { useLiveRecord as _ } from "./live.js";
6
+ const L = 72 * 36e5, k = 2 * 6e4, S = (e, t) => [
7
7
  "record-derived-causes",
8
8
  e,
9
- n
10
- ], A = 864e5, E = /^\d{4}-\d{2}-\d{2}$/;
11
- function g(e) {
9
+ t
10
+ ], U = 864e5, v = /^\d{4}-\d{2}-\d{2}$/;
11
+ function $(e) {
12
12
  if (e == null || e === "") return null;
13
- const n = String(e), s = E.test(n) ? Date.parse(`${n}T00:00:00Z`) : Date.parse(n);
14
- return Number.isNaN(s) ? null : s;
13
+ const t = String(e), n = v.test(t) ? Date.parse(`${t}T00:00:00Z`) : Date.parse(t);
14
+ return Number.isNaN(n) ? null : n;
15
15
  }
16
- const a = (e, n) => `${e} ${n}${e === 1 ? "" : "s"}`;
17
- function L(e) {
18
- return Math.abs(e).toLocaleString("en-US", { maximumFractionDigits: 2 });
16
+ const l = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`;
17
+ function E(e, t) {
18
+ const n = Math.abs(e);
19
+ if (t)
20
+ try {
21
+ return n.toLocaleString("en-US", {
22
+ style: "currency",
23
+ currency: t,
24
+ minimumFractionDigits: Number.isInteger(n) ? 0 : 2
25
+ });
26
+ } catch {
27
+ }
28
+ return n.toLocaleString("en-US", { maximumFractionDigits: 2 });
29
+ }
30
+ function z(e) {
31
+ const t = (u) => {
32
+ if (typeof u == "string")
33
+ try {
34
+ return t(JSON.parse(u));
35
+ } catch {
36
+ return {};
37
+ }
38
+ return u && typeof u == "object" && !Array.isArray(u) ? u : {};
39
+ }, n = t(e == null ? void 0 : e.options), r = t(e == null ? void 0 : e.display_options);
40
+ if (String(n.format ?? r.format ?? "") !== "currency" && !n.currency && !r.currency) return null;
41
+ const o = String(n.currency ?? r.currency ?? "USD").toUpperCase();
42
+ return /^[A-Z]{3}$/.test(o) ? o : "USD";
19
43
  }
20
- function h(e, n) {
21
- const s = String(n ?? "").toLowerCase(), r = /date|time/.test(s);
22
- if (r) {
23
- const l = g(e.from), c = g(e.to);
24
- if (l == null && c != null) return "Filled in";
25
- if (c == null) return "Cleared";
26
- if (l != null) {
27
- const i = c - l;
28
- if (i === 0) return "Changed";
29
- const d = i > 0 ? "later" : "earlier", b = Math.round(Math.abs(i) / A);
30
- if (b >= 1) return `Moved ${a(b, "day")} ${d}`;
31
- const $ = Math.round(Math.abs(i) / 36e5);
32
- return $ >= 1 ? `Moved ${a($, "hour")} ${d}` : `Moved ${a(Math.max(1, Math.round(Math.abs(i) / 6e4)), "minute")} ${d}`;
44
+ function q(e, t, n) {
45
+ const r = String(t ?? "").toLowerCase(), s = /date|time/.test(r);
46
+ if (s) {
47
+ const f = $(e.from), d = $(e.to);
48
+ if (f == null && d != null) return "Filled in";
49
+ if (d == null) return "Cleared";
50
+ if (f != null) {
51
+ const a = d - f;
52
+ if (a === 0) return "Changed";
53
+ const m = a > 0 ? "later" : "earlier", p = Math.round(Math.abs(a) / U);
54
+ if (p >= 1) return `Moved ${l(p, "day")} ${m}`;
55
+ const y = Math.round(Math.abs(a) / 36e5);
56
+ return y >= 1 ? `Moved ${l(y, "hour")} ${m}` : `Moved ${l(Math.max(1, Math.round(Math.abs(a) / 6e4)), "minute")} ${m}`;
33
57
  }
34
58
  }
35
- const t = Number(e.from), u = Number(e.to);
36
- if ((/int|float|decimal|number|numeric|money|currency|double|real/.test(s) || !r && e.from != null && e.to != null && Number.isFinite(t) && Number.isFinite(u)) && Number.isFinite(u)) {
59
+ const o = Number(e.from), u = Number(e.to);
60
+ if ((/int|float|decimal|number|numeric|money|currency|double|real/.test(r) || !s && e.from != null && e.to != null && Number.isFinite(o) && Number.isFinite(u)) && Number.isFinite(u)) {
37
61
  if (e.from == null || e.from === "") return "Filled in";
38
- if (Number.isFinite(t) && u !== t) return `${u > t ? "Up" : "Down"} ${L(u - t)}`;
62
+ if (Number.isFinite(o) && u !== o)
63
+ return `${u > o ? "Up" : "Down"} ${E(u - o, n)}`;
39
64
  }
40
65
  return e.to == null || e.to === "" ? "Cleared" : "Changed";
41
66
  }
42
- function q(e) {
43
- return e.own ? e.label : e.record_label ? `${e.label} on ${e.record_label}` : e.collection_label ? `a ${e.collection_label}’s ${e.label}` : e.label;
67
+ function c(e) {
68
+ return e.split(/(\s+)/).map((t) => /^[A-Z][a-z'’]*$/.test(t) ? t.toLowerCase() : t).join("");
69
+ }
70
+ function O(e) {
71
+ const t = e.split(/\s+[·•|–—-]\s+/).map((n) => n.trim()).filter(Boolean);
72
+ return t.length < 2 ? e.trim() : `${t[0]} (${t.slice(1).join(", ")})`;
73
+ }
74
+ function j(e) {
75
+ return e.own ? c(e.label) : e.record_label ? `${O(e.record_label)}’s ${c(e.label)}` : e.collection_label ? `a ${c(e.collection_label)}’s ${c(e.label)}` : c(e.label);
44
76
  }
45
77
  function x(e) {
46
- const n = [...new Set(e.map(q))];
47
- return n.length === 0 ? "" : n.length === 1 ? `because ${n[0]} changed` : n.length === 2 ? `because ${n[0]} and ${n[1]} changed` : `because ${n[0]}, ${n[1]} and ${a(n.length - 2, "other")} changed`;
78
+ const t = [...new Set(e.map(j))];
79
+ return t.length === 0 ? "" : t.length === 1 ? `because ${t[0]} changed` : t.length === 2 ? `because ${t[0]} and ${t[1]} changed` : `because ${t[0]}, ${t[1]} and ${l(t.length - 2, "other")} changed`;
48
80
  }
49
- function k(e, n) {
50
- const s = x(e.inputs);
51
- return s ? `${h(e, n)} ${s}` : h(e, n);
81
+ function B(e, t, n) {
82
+ const r = x(e.inputs), s = q(e, t, n);
83
+ return r ? `${s} ${r}` : s;
52
84
  }
53
- function K(e, n = Date.now()) {
54
- const s = Date.parse(e.at);
55
- return !Number.isNaN(s) && n - s < _;
85
+ function K(e, t = Date.now()) {
86
+ const n = Date.parse(e.at);
87
+ return !Number.isNaN(n) && t - n < L;
56
88
  }
57
- const o = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Set();
58
- let m = 0;
59
- const S = (e, n) => `${e}\0${n}`, p = () => {
60
- m++;
61
- for (const e of f) e();
62
- }, O = (e) => (f.add(e), () => {
63
- f.delete(e);
89
+ const i = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set();
90
+ let g = 0;
91
+ const N = (e, t) => `${e}\0${t}`, h = () => {
92
+ g++;
93
+ for (const e of b) e();
94
+ }, T = (e) => (b.add(e), () => {
95
+ b.delete(e);
64
96
  });
65
- function T(e, n) {
66
- const s = v(), r = n && n !== "new" ? String(n) : null;
97
+ function W(e, t) {
98
+ const n = A(), r = t && t !== "new" ? String(t) : null;
67
99
  w(
68
- O,
69
- () => m,
70
- () => m
100
+ T,
101
+ () => g,
102
+ () => g
71
103
  );
72
- const t = !!e && !!r && o.has(S(e, r));
73
- return N({
74
- queryKey: y(e ?? "", r ?? ""),
75
- queryFn: () => s.request(D(`/records/${e}/${r}/derived`)).then((u) => Array.isArray(u.data) ? u.data : []).catch(() => []),
76
- enabled: t,
104
+ const s = !!e && !!r && i.has(N(e, r));
105
+ return M({
106
+ queryKey: S(e ?? "", r ?? ""),
107
+ queryFn: () => n.request(F(`/records/${e}/${r}/derived`)).then((o) => Array.isArray(o.data) ? o.data : []).catch(() => []),
108
+ enabled: s,
77
109
  staleTime: 6e4,
78
110
  retry: !1
79
111
  });
80
112
  }
81
- function V(e, n, s) {
82
- const { data: r } = T(e, n), t = r == null ? void 0 : r.find((u) => u.field === s);
83
- return t && K(t) ? t : null;
113
+ function J(e, t, n) {
114
+ const { data: r } = W(e, t), s = r == null ? void 0 : r.find((o) => o.field === n);
115
+ return s && K(s) ? s : null;
84
116
  }
85
- function Z(e, n) {
86
- const s = M(), r = n && n !== "new" ? String(n) : null;
87
- C(() => {
117
+ function V(e, t) {
118
+ const n = C(), r = t && t !== "new" ? String(t) : null;
119
+ D(() => {
88
120
  if (!e || !r) return;
89
- const t = S(e, r);
90
- return o.set(t, (o.get(t) ?? 0) + 1), p(), () => {
91
- const u = (o.get(t) ?? 1) - 1;
92
- u <= 0 ? o.delete(t) : o.set(t, u), p();
121
+ const s = N(e, r);
122
+ return i.set(s, (i.get(s) ?? 0) + 1), h(), () => {
123
+ const o = (i.get(s) ?? 1) - 1;
124
+ o <= 0 ? i.delete(s) : i.set(s, o), h();
93
125
  };
94
- }, [e, r]), F(
126
+ }, [e, r]), _(
95
127
  e,
96
128
  r,
97
- (t) => {
98
- t.aspectsOnly || t.deleted || !e || !r || s.invalidateQueries({ queryKey: y(e, r) });
129
+ (s) => {
130
+ s.aspectsOnly || s.deleted || !e || !r || n.invalidateQueries({ queryKey: S(e, r) });
99
131
  },
100
132
  // A rollup or rule re-derives right after the write that caused it: wait it out.
101
133
  { includeOwn: !0, debounceMs: 1e3 }
102
134
  );
103
135
  }
104
136
  export {
105
- Y as CAUSE_FRESH_MS,
106
- _ as CAUSE_SHOW_MS,
137
+ k as CAUSE_FRESH_MS,
138
+ L as CAUSE_SHOW_MS,
107
139
  x as becauseWords,
108
- k as causeSentence,
140
+ B as causeSentence,
109
141
  K as causeShown,
110
- h as changeWords,
111
- y as derivedCausesKey,
112
- q as inputWords,
113
- V as useDerivedCause,
114
- Z as useDerivedCausesLive
142
+ q as changeWords,
143
+ S as derivedCausesKey,
144
+ z as fieldCurrency,
145
+ j as inputWords,
146
+ c as midSentence,
147
+ O as recordName,
148
+ J as useDerivedCause,
149
+ V as useDerivedCausesLive
115
150
  };
@@ -1,27 +1,27 @@
1
- const d = 150, f = 250;
2
- function p(e = c) {
1
+ const c = 150, f = 250;
2
+ function p(e = d) {
3
3
  let t = null, r = null, n = null;
4
- const o = () => {
4
+ const i = () => {
5
5
  n = null, r !== t && (t && e(t, "end"), t = r, t && e(t, "start"));
6
- }, i = (s) => {
7
- n && clearTimeout(n), n = setTimeout(o, s);
6
+ }, o = (s) => {
7
+ n && clearTimeout(n), n = setTimeout(i, s);
8
8
  };
9
9
  return {
10
10
  focus(s) {
11
- r = s, i(s ? 150 : 250);
11
+ r = s, o(s ? 150 : 250);
12
12
  },
13
13
  blur() {
14
- r = null, i(250);
14
+ r = null, o(250);
15
15
  },
16
16
  flush() {
17
17
  n && clearTimeout(n), n = null, t && e(t, "end"), t = null, r = null;
18
18
  }
19
19
  };
20
20
  }
21
- function c(e, t) {
21
+ function d(e, t) {
22
22
  typeof window > "u" || window.dispatchEvent(new CustomEvent("nvr:cell-editing", { detail: { cell: e, state: t } }));
23
23
  }
24
- const u = [
24
+ const a = [
25
25
  "#0ea5e9",
26
26
  // sky
27
27
  "#8b5cf6",
@@ -35,22 +35,22 @@ const u = [
35
35
  "#84cc16"
36
36
  // lime
37
37
  ];
38
- function l(e) {
38
+ function u(e) {
39
39
  const t = String(e ?? "").toUpperCase();
40
40
  let r = 0;
41
41
  for (let n = 0; n < t.length; n++) r = r * 31 + t.charCodeAt(n) | 0;
42
- return u[Math.abs(r) % u.length];
42
+ return a[Math.abs(r) % a.length];
43
43
  }
44
44
  function C(e, t = /* @__PURE__ */ new Map()) {
45
- const r = /* @__PURE__ */ new Map(), n = (o) => o.toUpperCase();
46
- for (const o of e) {
47
- const i = t.get(n(o));
48
- i && ![...r.values()].includes(i) && r.set(n(o), i);
45
+ const r = /* @__PURE__ */ new Map(), n = (i) => i.toUpperCase();
46
+ for (const i of e) {
47
+ const o = t.get(n(i));
48
+ o && ![...r.values()].includes(o) && r.set(n(i), o);
49
49
  }
50
- for (const o of e) {
51
- if (r.has(n(o))) continue;
52
- const i = new Set(r.values()), s = u.find((a) => !i.has(a));
53
- r.set(n(o), s ?? l(o));
50
+ for (const i of e) {
51
+ if (r.has(n(i))) continue;
52
+ const o = new Set(r.values()), s = a.find((l) => !o.has(l));
53
+ r.set(n(i), s ?? u(i));
54
54
  }
55
55
  return r;
56
56
  }
@@ -59,19 +59,19 @@ function m(e) {
59
59
  return t.length === 0 ? "?" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
60
60
  }
61
61
  function S(e, t, r) {
62
- const n = e.getAttribute("data-tip");
63
- return e.classList.add("nvr-remote-editing"), e.dataset.remoteEditor = t.name, e.style.setProperty("--nvr-cursor", r ?? l(t.id ?? t.name)), e.setAttribute("data-tip", `${t.name} is here`), () => {
64
- e.classList.remove("nvr-remote-editing"), delete e.dataset.remoteEditor, e.style.removeProperty("--nvr-cursor"), n == null ? e.removeAttribute("data-tip") : e.setAttribute("data-tip", n);
62
+ const n = e.getAttribute("data-tip"), i = e.getAttribute("data-tip-side");
63
+ return e.classList.add("nvr-remote-editing"), e.dataset.remoteEditor = t.name, e.style.setProperty("--nvr-cursor", r ?? u(t.id ?? t.name)), e.setAttribute("data-tip", `${t.name} is here`), e.setAttribute("data-tip-side", "top"), () => {
64
+ e.classList.remove("nvr-remote-editing"), delete e.dataset.remoteEditor, e.style.removeProperty("--nvr-cursor"), n == null ? e.removeAttribute("data-tip") : e.setAttribute("data-tip", n), i == null ? e.removeAttribute("data-tip-side") : e.setAttribute("data-tip-side", i);
65
65
  };
66
66
  }
67
67
  export {
68
- u as CURSOR_COLORS,
68
+ a as CURSOR_COLORS,
69
69
  f as CURSOR_LEAVE_MS,
70
- d as CURSOR_SETTLE_MS,
70
+ c as CURSOR_SETTLE_MS,
71
71
  C as assignCursorColors,
72
72
  p as createCellAnnouncer,
73
- l as cursorColor,
73
+ u as cursorColor,
74
74
  S as markRemoteCell,
75
75
  m as personInitials,
76
- c as windowCellEmit
76
+ d as windowCellEmit
77
77
  };
@@ -0,0 +1,27 @@
1
+ import { useRef as c, useState as f, useEffect as a } from "react";
2
+ import { liveMotionAllowed as i } from "./live-preference.js";
3
+ function m(o, t) {
4
+ const n = c({ id: o, label: t }), [e, s] = f(0);
5
+ return a(() => {
6
+ const r = n.current;
7
+ n.current = { id: o, label: t }, o != null && String(r.id) === String(o) && r.label != null && t != null && r.label !== t && i() && s((u) => u + 1);
8
+ }, [o, t]), e;
9
+ }
10
+ function b(o) {
11
+ if (!o || typeof o.animate != "function") return;
12
+ const t = typeof document < "u" && document.documentElement.classList.contains("dark"), n = {
13
+ borderColor: t ? "rgb(34, 211, 238)" : "rgb(8, 145, 178)",
14
+ boxShadow: `0 0 0 3px rgba(34, 211, 238, ${t ? 0.35 : 0.28})`
15
+ }, e = {
16
+ borderColor: getComputedStyle(o).borderColor,
17
+ boxShadow: "0 0 0 3px rgba(34, 211, 238, 0)"
18
+ };
19
+ o.animate([n, { ...n, offset: 0.4 }, e], {
20
+ duration: 1200,
21
+ easing: "cubic-bezier(0.16, 1, 0.3, 1)"
22
+ });
23
+ }
24
+ export {
25
+ b as flashFieldBox,
26
+ m as useLabelFlash
27
+ };