@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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +136 -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 +3757 -3695
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4451 -4385
- 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/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/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/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 +135 -94
- 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 +88 -85
- 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 +245 -141
- 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 +15 -16
- 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/addendum-view.js +6 -0
- 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 +151 -130
- 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/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
- 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/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,115 +1,150 @@
|
|
|
1
|
-
import { useQueryClient as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { useNivaroClient as
|
|
4
|
-
import { get as
|
|
5
|
-
import { useLiveRecord as
|
|
6
|
-
const
|
|
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
|
-
|
|
10
|
-
],
|
|
11
|
-
function
|
|
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
|
|
14
|
-
return Number.isNaN(
|
|
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
|
|
17
|
-
function
|
|
18
|
-
|
|
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
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
return
|
|
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
|
|
36
|
-
if ((/int|float|decimal|number|numeric|money|currency|double|real/.test(
|
|
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(
|
|
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
|
|
43
|
-
return e.
|
|
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
|
|
47
|
-
return
|
|
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
|
|
50
|
-
const
|
|
51
|
-
return
|
|
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,
|
|
54
|
-
const
|
|
55
|
-
return !Number.isNaN(
|
|
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
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
for (const e of
|
|
62
|
-
},
|
|
63
|
-
|
|
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
|
|
66
|
-
const
|
|
97
|
+
function W(e, t) {
|
|
98
|
+
const n = A(), r = t && t !== "new" ? String(t) : null;
|
|
67
99
|
w(
|
|
68
|
-
|
|
69
|
-
() =>
|
|
70
|
-
() =>
|
|
100
|
+
T,
|
|
101
|
+
() => g,
|
|
102
|
+
() => g
|
|
71
103
|
);
|
|
72
|
-
const
|
|
73
|
-
return
|
|
74
|
-
queryKey:
|
|
75
|
-
queryFn: () =>
|
|
76
|
-
enabled:
|
|
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
|
|
82
|
-
const { data: r } =
|
|
83
|
-
return
|
|
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
|
|
86
|
-
const
|
|
87
|
-
|
|
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
|
|
90
|
-
return
|
|
91
|
-
const
|
|
92
|
-
|
|
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]),
|
|
126
|
+
}, [e, r]), _(
|
|
95
127
|
e,
|
|
96
128
|
r,
|
|
97
|
-
(
|
|
98
|
-
|
|
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
|
-
|
|
106
|
-
|
|
137
|
+
k as CAUSE_FRESH_MS,
|
|
138
|
+
L as CAUSE_SHOW_MS,
|
|
107
139
|
x as becauseWords,
|
|
108
|
-
|
|
140
|
+
B as causeSentence,
|
|
109
141
|
K as causeShown,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
|
2
|
-
function p(e =
|
|
1
|
+
const c = 150, f = 250;
|
|
2
|
+
function p(e = d) {
|
|
3
3
|
let t = null, r = null, n = null;
|
|
4
|
-
const
|
|
4
|
+
const i = () => {
|
|
5
5
|
n = null, r !== t && (t && e(t, "end"), t = r, t && e(t, "start"));
|
|
6
|
-
},
|
|
7
|
-
n && clearTimeout(n), n = setTimeout(
|
|
6
|
+
}, o = (s) => {
|
|
7
|
+
n && clearTimeout(n), n = setTimeout(i, s);
|
|
8
8
|
};
|
|
9
9
|
return {
|
|
10
10
|
focus(s) {
|
|
11
|
-
r = s,
|
|
11
|
+
r = s, o(s ? 150 : 250);
|
|
12
12
|
},
|
|
13
13
|
blur() {
|
|
14
|
-
r = null,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 = (
|
|
46
|
-
for (const
|
|
47
|
-
const
|
|
48
|
-
|
|
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
|
|
51
|
-
if (r.has(n(
|
|
52
|
-
const
|
|
53
|
-
r.set(n(
|
|
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 ??
|
|
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
|
-
|
|
68
|
+
a as CURSOR_COLORS,
|
|
69
69
|
f as CURSOR_LEAVE_MS,
|
|
70
|
-
|
|
70
|
+
c as CURSOR_SETTLE_MS,
|
|
71
71
|
C as assignCursorColors,
|
|
72
72
|
p as createCellAnnouncer,
|
|
73
|
-
|
|
73
|
+
u as cursorColor,
|
|
74
74
|
S as markRemoteCell,
|
|
75
75
|
m as personInitials,
|
|
76
|
-
|
|
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
|
+
};
|