@nivaro/react 0.3.136 → 0.3.138
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 +95 -4
- package/dist/index.js +748 -743
- package/dist/shared/components/CollectionBrowserView.js +392 -389
- package/dist/shared/components/DelegateCoverLine.js +80 -87
- package/dist/shared/components/ItemEditForm.js +589 -588
- package/dist/shared/components/MyWorkView.js +284 -286
- package/dist/shared/components/NotificationBell.js +251 -205
- package/dist/shared/components/ai/AiAnalyticsView.js +878 -417
- package/dist/shared/components/ai/AiPlanCard.js +164 -122
- package/dist/shared/components/ai/AiPlanUndo.js +291 -0
- package/dist/shared/components/ai/call-log/CallDrawer.js +357 -0
- package/dist/shared/components/ai/call-log/RawJson.js +126 -0
- package/dist/shared/components/ai/call-log/ThreadView.js +223 -0
- package/dist/shared/components/ai/call-log/TranscriptView.js +227 -0
- package/dist/shared/components/ai/call-log/controls.js +364 -0
- package/dist/shared/components/ai/call-log/format.js +46 -0
- package/dist/shared/components/ai/call-log/url.js +105 -0
- package/dist/shared/components/chat/ChatPanel.js +86 -86
- package/dist/shared/components/chat/chat-core.js +422 -346
- package/dist/shared/components/integrations/IntegrationObligationsView.js +98 -98
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +102 -93
- package/dist/shared/components/integrations/console/api.js +11 -1
- package/dist/shared/components/item-edit/HeaderRollupExplainer.js +5 -1
- package/dist/shared/components/item-edit/RecordLiveSync.js +241 -229
- package/dist/shared/components/item-edit/RecordRecapChanges.js +166 -0
- package/dist/shared/components/item-edit/RecordRecapStrip.js +254 -84
- package/dist/shared/components/item-edit/live-related.js +34 -18
- package/dist/shared/components/panels/RevisionsPanel.js +735 -683
- package/dist/shared/components/queue/QueueWorklist.js +323 -316
- package/dist/shared/components/support/SupportRequestDialog.js +198 -181
- package/dist/shared/components/trackers/use-tracker-link.js +74 -65
- package/dist/shared/lib/config-update-refresh.js +34 -0
- package/dist/shared/lib/config-watch.js +17 -17
- package/dist/shared/lib/gap-refresh.js +49 -0
- package/dist/shared/lib/integration-dots.js +8 -8
- package/dist/shared/lib/live-ops.js +26 -23
- package/dist/shared/lib/live-pickers.js +1 -1
- package/dist/shared/lib/live-queries.js +223 -195
- package/dist/shared/lib/live.js +56 -51
- package/dist/shared/lib/obligation-banner.js +11 -10
- package/dist/shared/lib/obligation-filters.js +22 -18
- package/dist/shared/lib/obligation-reason-text.js +18 -8
- package/dist/shared/lib/presence-hooks.js +133 -132
- package/dist/shared/lib/reconnect-resync.js +90 -0
- package/dist/shared/lib/record-room-holds.js +43 -0
- package/dist/shared/lib/socket-realtime.js +116 -105
- package/dist/shared/lib/user-sync.js +1 -6
- package/package.json +1 -1
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { UserCheck as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import {
|
|
1
|
+
import { jsx as a, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as h, useQuery as y } from "@tanstack/react-query";
|
|
3
|
+
import { UserCheck as b } from "lucide-react";
|
|
4
|
+
import { useRef as x, useMemo as w, useEffect as k } from "react";
|
|
5
|
+
import { useNivaroClient as N } from "../context.js";
|
|
6
|
+
import { get as C } from "../lib/commands.js";
|
|
7
|
+
import { useGapRefresh as _ } from "../lib/gap-refresh.js";
|
|
8
|
+
import { useLiveEvent as D, useLiveCollection as M } from "../lib/live.js";
|
|
8
9
|
import { useLiveOps as S } from "../lib/live-ops.js";
|
|
9
|
-
import { cn as
|
|
10
|
-
import { TickerNumber as
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
const r = e.first_name || e.name, t =
|
|
14
|
-
return e.records === 0 ? { lead:
|
|
15
|
-
lead:
|
|
10
|
+
import { cn as v } from "../lib/utils.js";
|
|
11
|
+
import { TickerNumber as E } from "./TickerNumber.js";
|
|
12
|
+
const g = ["my-work-covering"], $ = 5e3;
|
|
13
|
+
function q(e, n = /* @__PURE__ */ new Date()) {
|
|
14
|
+
const r = e.first_name || e.name, t = T(e.ends_at, n), u = `You're covering for ${e.name} ${t ?? "today"}`;
|
|
15
|
+
return e.records === 0 ? { lead: u, count: null, tail: `none of ${r}'s records need you right now` } : {
|
|
16
|
+
lead: u,
|
|
16
17
|
count: e.records,
|
|
17
18
|
tail: `of ${r}'s record${e.records === 1 ? "" : "s"} need${e.records === 1 ? "s" : ""} you`
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function T(e, n = /* @__PURE__ */ new Date()) {
|
|
21
22
|
if (!e) return null;
|
|
22
23
|
const r = new Date(e);
|
|
23
|
-
return !Number.isFinite(r.getTime()) || r.toDateString() ===
|
|
24
|
+
return !Number.isFinite(r.getTime()) || r.toDateString() === n.toDateString() ? null : `until ${r.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" })}`;
|
|
24
25
|
}
|
|
25
|
-
function L(e,
|
|
26
|
-
const r = e.map((t) => t.ends_at ? new Date(t.ends_at).getTime() : Number.NaN).filter((t) => Number.isFinite(t) && t >
|
|
27
|
-
return r.length ? Math.min(...r) -
|
|
26
|
+
function L(e, n = Date.now()) {
|
|
27
|
+
const r = e.map((t) => t.ends_at ? new Date(t.ends_at).getTime() : Number.NaN).filter((t) => Number.isFinite(t) && t > n);
|
|
28
|
+
return r.length ? Math.min(...r) - n : null;
|
|
28
29
|
}
|
|
29
|
-
function Q(e,
|
|
30
|
-
return
|
|
30
|
+
function Q(e, n) {
|
|
31
|
+
return n.some((r) => {
|
|
31
32
|
const t = e.get(String(r.collection));
|
|
32
33
|
return !!t && (r.item === "*" || t.has(String(r.item)));
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
return
|
|
38
|
-
queryKey:
|
|
39
|
-
queryFn: () =>
|
|
36
|
+
function R(e = !0) {
|
|
37
|
+
const n = N();
|
|
38
|
+
return y({
|
|
39
|
+
queryKey: g,
|
|
40
|
+
queryFn: () => n.request(C("/my-work/covering")).then((r) => {
|
|
40
41
|
var t;
|
|
41
42
|
return Array.isArray((t = r.data) == null ? void 0 : t.covering) ? r.data.covering : [];
|
|
42
43
|
}),
|
|
@@ -46,101 +47,93 @@ function O(e = !0) {
|
|
|
46
47
|
refetchInterval: 5 * 6e4
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var d;
|
|
66
|
-
const n = /* @__PURE__ */ new Map();
|
|
67
|
-
for (const b of t)
|
|
68
|
-
for (const l of b.keys) {
|
|
69
|
-
const m = l.indexOf(":");
|
|
70
|
-
if (m <= 0) continue;
|
|
71
|
-
const f = l.slice(0, m);
|
|
72
|
-
n.has(f) || n.set(f, /* @__PURE__ */ new Set()), (d = n.get(f)) == null || d.add(l.slice(m + 1));
|
|
50
|
+
function O(e = !0) {
|
|
51
|
+
const n = h(), r = R(e), t = r.data ?? [], u = _(
|
|
52
|
+
() => void n.invalidateQueries({ queryKey: g }, { cancelRefetch: !1 }),
|
|
53
|
+
$,
|
|
54
|
+
e
|
|
55
|
+
), s = x(u);
|
|
56
|
+
s.current = u, D("owners:changed", () => s.current(), { debounceMs: 1500, enabled: e }), S("my-work", () => s.current(), { debounceMs: 1500, enabled: e });
|
|
57
|
+
const i = w(() => {
|
|
58
|
+
var c;
|
|
59
|
+
const o = /* @__PURE__ */ new Map();
|
|
60
|
+
for (const p of t)
|
|
61
|
+
for (const d of p.keys) {
|
|
62
|
+
const l = d.indexOf(":");
|
|
63
|
+
if (l <= 0) continue;
|
|
64
|
+
const m = d.slice(0, l);
|
|
65
|
+
o.has(m) || o.set(m, /* @__PURE__ */ new Set()), (c = o.get(m)) == null || c.add(d.slice(l + 1));
|
|
73
66
|
}
|
|
74
|
-
return
|
|
67
|
+
return o;
|
|
75
68
|
}, [t]);
|
|
76
69
|
return M(
|
|
77
|
-
[...
|
|
78
|
-
(
|
|
79
|
-
Q(
|
|
70
|
+
[...i.keys()],
|
|
71
|
+
(o) => {
|
|
72
|
+
Q(i, o.events) && s.current();
|
|
80
73
|
},
|
|
81
|
-
{ debounceMs: 1e3, includeOwn: !0, enabled: e &&
|
|
82
|
-
),
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
return () => clearTimeout(
|
|
74
|
+
{ debounceMs: 1e3, includeOwn: !0, enabled: e && i.size > 0 }
|
|
75
|
+
), k(() => {
|
|
76
|
+
const o = L(t);
|
|
77
|
+
if (o == null || o > 2 ** 31 - 1) return;
|
|
78
|
+
const c = setTimeout(() => s.current(), o + 1e3);
|
|
79
|
+
return () => clearTimeout(c);
|
|
87
80
|
}, [t]), r;
|
|
88
81
|
}
|
|
89
|
-
function
|
|
82
|
+
function V({
|
|
90
83
|
onShow: e,
|
|
91
|
-
showing:
|
|
84
|
+
showing: n,
|
|
92
85
|
showLabel: r = "Show them",
|
|
93
86
|
className: t
|
|
94
87
|
}) {
|
|
95
|
-
const { data:
|
|
96
|
-
return
|
|
88
|
+
const { data: u } = O(), s = u ?? [];
|
|
89
|
+
return s.length === 0 ? null : /* @__PURE__ */ a(
|
|
97
90
|
"section",
|
|
98
91
|
{
|
|
99
92
|
"data-delegate-cover": !0,
|
|
100
93
|
"aria-label": "Covering for colleagues",
|
|
101
|
-
className:
|
|
94
|
+
className: v(
|
|
102
95
|
"rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
103
96
|
t
|
|
104
97
|
),
|
|
105
|
-
children: /* @__PURE__ */
|
|
106
|
-
const
|
|
98
|
+
children: /* @__PURE__ */ a("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: s.map((i) => {
|
|
99
|
+
const o = q(i), c = n != null && n === i.user_id;
|
|
107
100
|
return (
|
|
108
101
|
// Wraps instead of squeezing: in a narrow column (phone, the home side card) the
|
|
109
102
|
// action drops under the sentence; the icon sits in the first line, not a gutter.
|
|
110
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ f(
|
|
111
104
|
"li",
|
|
112
105
|
{
|
|
113
106
|
"data-delegate-cover-line": i.user_id,
|
|
114
107
|
className: "flex flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2.5",
|
|
115
108
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
109
|
+
/* @__PURE__ */ f("p", { className: "min-w-[min(100%,18rem)] flex-1 text-[12.5px] leading-5 text-foreground", children: [
|
|
110
|
+
/* @__PURE__ */ a(
|
|
111
|
+
b,
|
|
119
112
|
{
|
|
120
113
|
className: "-mt-0.5 mr-2 inline-block h-4 w-4 text-nvr-cyan",
|
|
121
114
|
strokeWidth: 2,
|
|
122
115
|
"aria-hidden": !0
|
|
123
116
|
}
|
|
124
117
|
),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
128
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ a("span", { children: o.lead }),
|
|
119
|
+
/* @__PURE__ */ a("span", { className: "text-muted-foreground", children: " — " }),
|
|
120
|
+
o.count != null && /* @__PURE__ */ f("span", { className: "font-semibold tabular-nums", "data-delegate-cover-count": !0, children: [
|
|
121
|
+
/* @__PURE__ */ a(E, { value: o.count }),
|
|
129
122
|
" "
|
|
130
123
|
] }),
|
|
131
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ a("span", { className: o.count == null ? "text-muted-foreground" : void 0, children: o.tail })
|
|
132
125
|
] }),
|
|
133
|
-
e && i.records > 0 && /* @__PURE__ */
|
|
126
|
+
e && i.records > 0 && /* @__PURE__ */ a(
|
|
134
127
|
"button",
|
|
135
128
|
{
|
|
136
129
|
type: "button",
|
|
137
130
|
onClick: () => e(i),
|
|
138
|
-
"aria-pressed":
|
|
139
|
-
className:
|
|
131
|
+
"aria-pressed": n !== void 0 ? c : void 0,
|
|
132
|
+
className: v(
|
|
140
133
|
"max-w-full shrink-0 rounded-md border px-2.5 py-1 text-[11.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
141
|
-
|
|
134
|
+
c ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-[#0e7490] dark:text-[#67e8f9]" : "border-slate-200 text-foreground hover:bg-muted dark:border-border"
|
|
142
135
|
),
|
|
143
|
-
children:
|
|
136
|
+
children: c ? "Showing" : r
|
|
144
137
|
}
|
|
145
138
|
)
|
|
146
139
|
]
|
|
@@ -153,12 +146,12 @@ function P({
|
|
|
153
146
|
);
|
|
154
147
|
}
|
|
155
148
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
149
|
+
g as COVERING_QUERY_KEY,
|
|
150
|
+
V as DelegateCoverLine,
|
|
158
151
|
Q as coverBatchMatters,
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
T as coverEnds,
|
|
153
|
+
q as coverSentence,
|
|
161
154
|
L as nextCoverEnd,
|
|
162
|
-
|
|
163
|
-
|
|
155
|
+
O as useCovering,
|
|
156
|
+
R as useCoveringQuery
|
|
164
157
|
};
|