@arbidocs/blocks 0.5.43 → 0.5.44
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/README.md +14 -0
- package/dist/{ConnectedNativeDocxComparison-52KQKJGY.js → ConnectedNativeDocxComparison-4DYPHNY2.js} +6 -6
- package/dist/{ConnectedNativeDocxComparison-52KQKJGY.js.map → ConnectedNativeDocxComparison-4DYPHNY2.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-UVLZGS2V.cjs → ConnectedNativeDocxComparison-OZE2SPNU.cjs} +7 -7
- package/dist/{ConnectedNativeDocxComparison-UVLZGS2V.cjs.map → ConnectedNativeDocxComparison-OZE2SPNU.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-BRBL3MOV.js → ConnectedNativeDocxEditor-F3EHJKDI.js} +5 -5
- package/dist/{ConnectedNativeDocxEditor-BRBL3MOV.js.map → ConnectedNativeDocxEditor-F3EHJKDI.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-KHR5I7W6.cjs → ConnectedNativeDocxEditor-MUM6YRPY.cjs} +7 -7
- package/dist/{ConnectedNativeDocxEditor-KHR5I7W6.cjs.map → ConnectedNativeDocxEditor-MUM6YRPY.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-DSVFI7BX.cjs → ConnectedStreamedWordArtifact-F6M766FG.cjs} +7 -7
- package/dist/ConnectedStreamedWordArtifact-F6M766FG.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-EQUE6WT5.js → ConnectedStreamedWordArtifact-XUWLRRG5.js} +6 -6
- package/dist/{ConnectedStreamedWordArtifact-EQUE6WT5.js.map → ConnectedStreamedWordArtifact-XUWLRRG5.js.map} +1 -1
- package/dist/WorkspaceTableView-2CGEO5KK.cjs +1 -1
- package/dist/WorkspaceTableView-3ARFQYNO.js +1 -1
- package/dist/agents/index.cjs +326 -326
- package/dist/agents/index.js +4 -4
- package/dist/calls/index.cjs +73 -696
- package/dist/calls/index.cjs.map +1 -1
- package/dist/calls/index.js +10 -666
- package/dist/calls/index.js.map +1 -1
- package/dist/{chunk-3YZ3RUSB.cjs → chunk-3GHFTAOV.cjs} +4 -4
- package/dist/{chunk-3YZ3RUSB.cjs.map → chunk-3GHFTAOV.cjs.map} +1 -1
- package/dist/{chunk-6AJJJ5HR.cjs → chunk-5R256EMF.cjs} +671 -3
- package/dist/chunk-5R256EMF.cjs.map +1 -0
- package/dist/{chunk-EFDZRAW6.js → chunk-CG7EYB3J.js} +3 -3
- package/dist/{chunk-EFDZRAW6.js.map → chunk-CG7EYB3J.js.map} +1 -1
- package/dist/{chunk-YAGSGBVM.js → chunk-EY4IEOW3.js} +3 -3
- package/dist/{chunk-YAGSGBVM.js.map → chunk-EY4IEOW3.js.map} +1 -1
- package/dist/{chunk-YD3RN2FY.cjs → chunk-F72ZD5Q2.cjs} +3 -3
- package/dist/{chunk-YD3RN2FY.cjs.map → chunk-F72ZD5Q2.cjs.map} +1 -1
- package/dist/{chunk-E3IEZMRK.cjs → chunk-FKFGP7MQ.cjs} +18 -18
- package/dist/{chunk-E3IEZMRK.cjs.map → chunk-FKFGP7MQ.cjs.map} +1 -1
- package/dist/{chunk-WAIHNFUH.js → chunk-G5JENSLN.js} +3 -3
- package/dist/{chunk-WAIHNFUH.js.map → chunk-G5JENSLN.js.map} +1 -1
- package/dist/{chunk-O3MRE2HL.cjs → chunk-GUV63FUC.cjs} +11 -11
- package/dist/{chunk-O3MRE2HL.cjs.map → chunk-GUV63FUC.cjs.map} +1 -1
- package/dist/{chunk-REHG7VRQ.js → chunk-H6UK6LGL.js} +4 -4
- package/dist/{chunk-REHG7VRQ.js.map → chunk-H6UK6LGL.js.map} +1 -1
- package/dist/{chunk-75Z5AUMM.js → chunk-JS7KJRKG.js} +3 -3
- package/dist/{chunk-75Z5AUMM.js.map → chunk-JS7KJRKG.js.map} +1 -1
- package/dist/{chunk-TPNLYQD2.cjs → chunk-PV5A5SAC.cjs} +5 -5
- package/dist/{chunk-TPNLYQD2.cjs.map → chunk-PV5A5SAC.cjs.map} +1 -1
- package/dist/{chunk-K53QRFPJ.cjs → chunk-QPDQYZIR.cjs} +4 -4
- package/dist/{chunk-K53QRFPJ.cjs.map → chunk-QPDQYZIR.cjs.map} +1 -1
- package/dist/{chunk-UZVXVTTB.cjs → chunk-QWSAJNQE.cjs} +9 -9
- package/dist/{chunk-UZVXVTTB.cjs.map → chunk-QWSAJNQE.cjs.map} +1 -1
- package/dist/{chunk-2QDNQM63.cjs → chunk-T5BCPKU3.cjs} +3 -3
- package/dist/{chunk-2QDNQM63.cjs.map → chunk-T5BCPKU3.cjs.map} +1 -1
- package/dist/{chunk-X7CXCEGO.js → chunk-T6KAZPOZ.js} +3 -3
- package/dist/{chunk-X7CXCEGO.js.map → chunk-T6KAZPOZ.js.map} +1 -1
- package/dist/{chunk-4U4NXFV5.js → chunk-TKTNXFAB.js} +666 -9
- package/dist/chunk-TKTNXFAB.js.map +1 -0
- package/dist/{chunk-FOIDBAZB.js → chunk-TOP5BMS7.js} +3 -3
- package/dist/{chunk-FOIDBAZB.js.map → chunk-TOP5BMS7.js.map} +1 -1
- package/dist/{chunk-7CHI36EP.js → chunk-VE6DHRXD.js} +3 -3
- package/dist/{chunk-7CHI36EP.js.map → chunk-VE6DHRXD.js.map} +1 -1
- package/dist/connect/docx.cjs +9 -9
- package/dist/connect/docx.js +5 -5
- package/dist/connect/index.cjs +1957 -774
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +1667 -487
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +3 -3
- package/dist/connect/viewer.js +3 -3
- package/dist/connection/ConnectedFilterDropdown.d.ts +6 -0
- package/dist/connection/conversation/ConnectedConversation.d.ts +7 -9
- package/dist/connection/conversation/ConnectedConversationPage.d.ts +30 -0
- package/dist/connection/conversation/SemanticSearchButton.d.ts +12 -0
- package/dist/connection/files/imports/ConnectedAccountsImport.d.ts +16 -0
- package/dist/connection/files/imports/DriveImportPanel.d.ts +10 -0
- package/dist/connection/files/imports/EmailImportPanel.d.ts +21 -0
- package/dist/connection/files/imports/ImportHandoff.d.ts +24 -0
- package/dist/connection/files/imports/useDriveSyncTrigger.d.ts +11 -0
- package/dist/connection/files/imports/useEmailSyncTrigger.d.ts +11 -0
- package/dist/connection/files/imports/useImportHandoff.d.ts +20 -0
- package/dist/connection/files/index.d.ts +1 -0
- package/dist/facts/index.cjs +55 -55
- package/dist/facts/index.js +3 -3
- package/dist/index.cjs +384 -384
- package/dist/index.js +5 -5
- package/dist/settings/index.cjs +1 -1
- package/dist/settings/index.js +1 -1
- package/dist/workflow-canvas/index.cjs +17 -17
- package/dist/workflow-canvas/index.js +4 -4
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedStreamedWordArtifact-DSVFI7BX.cjs.map +0 -1
- package/dist/chunk-4U4NXFV5.js.map +0 -1
- package/dist/chunk-6AJJJ5HR.cjs.map +0 -1
package/dist/calls/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunk5R256EMF_cjs = require('../chunk-5R256EMF.cjs');
|
|
5
5
|
var chunkEGSSLWNZ_cjs = require('../chunk-EGSSLWNZ.cjs');
|
|
6
|
-
|
|
6
|
+
require('../chunk-HDEOORSV.cjs');
|
|
7
7
|
var chunkP6HVJP6Z_cjs = require('../chunk-P6HVJP6Z.cjs');
|
|
8
8
|
var chunkMOIZ2R5X_cjs = require('../chunk-MOIZ2R5X.cjs');
|
|
9
9
|
require('../chunk-G2BKHCI2.cjs');
|
|
@@ -12,7 +12,7 @@ require('../chunk-ZW6FPIFC.cjs');
|
|
|
12
12
|
var chunkNXHETIOB_cjs = require('../chunk-NXHETIOB.cjs');
|
|
13
13
|
require('../chunk-725OETK3.cjs');
|
|
14
14
|
require('../chunk-PPCATBOY.cjs');
|
|
15
|
-
|
|
15
|
+
require('../chunk-B3NYBMDR.cjs');
|
|
16
16
|
require('../chunk-SI222Z3A.cjs');
|
|
17
17
|
require('../chunk-ULWRNGGE.cjs');
|
|
18
18
|
require('../chunk-MHVNT4J3.cjs');
|
|
@@ -20,8 +20,8 @@ require('../chunk-DES3K4SD.cjs');
|
|
|
20
20
|
var react = require('react');
|
|
21
21
|
var react$1 = require('@arbidocs/react');
|
|
22
22
|
var jsxRuntime = require('react/jsx-runtime');
|
|
23
|
-
var lucideReact = require('lucide-react');
|
|
24
23
|
var ui = require('@arbidocs/react/ui');
|
|
24
|
+
var lucideReact = require('lucide-react');
|
|
25
25
|
var browser = require('@arbidocs/sdk/browser');
|
|
26
26
|
|
|
27
27
|
var RING_TIMEOUT_MS = 3e4;
|
|
@@ -77,511 +77,6 @@ function ConnectedCallLayer() {
|
|
|
77
77
|
hasIncomingCall && callsEnabled && /* @__PURE__ */ jsxRuntime.jsx(ConnectedIncomingCall, {})
|
|
78
78
|
] });
|
|
79
79
|
}
|
|
80
|
-
function StartCallButton(props) {
|
|
81
|
-
const enabled = react$1.useCallsEnabled();
|
|
82
|
-
const canHost = react$1.useCanHostCalls();
|
|
83
|
-
return enabled && (canHost || props.isLive) ? /* @__PURE__ */ jsxRuntime.jsx(EnabledStartCallButton, { ...props }) : null;
|
|
84
|
-
}
|
|
85
|
-
function EnabledStartCallButton({
|
|
86
|
-
onStart,
|
|
87
|
-
isLive = false,
|
|
88
|
-
label = "Start call",
|
|
89
|
-
testId = "start-call-button"
|
|
90
|
-
}) {
|
|
91
|
-
const [isStarting, setIsStarting] = react.useState(false);
|
|
92
|
-
const inCall = react$1.useCallSession((s) => s.active !== null);
|
|
93
|
-
const text = inCall ? "Already in a call" : isLive ? "Join call" : label;
|
|
94
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
95
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
-
ui.Button,
|
|
97
|
-
{
|
|
98
|
-
type: "button",
|
|
99
|
-
variant: "ghost",
|
|
100
|
-
size: "icon",
|
|
101
|
-
"aria-label": isLive ? "Join call" : label,
|
|
102
|
-
"data-testid": testId,
|
|
103
|
-
"data-live": isLive || void 0,
|
|
104
|
-
disabled: isStarting || inCall,
|
|
105
|
-
onClick: () => {
|
|
106
|
-
setIsStarting(true);
|
|
107
|
-
void onStart().finally(() => setIsStarting(false));
|
|
108
|
-
},
|
|
109
|
-
className: ui.cn(
|
|
110
|
-
"text-muted-foreground hover:text-foreground",
|
|
111
|
-
isLive && "text-green-text hover:text-green-text"
|
|
112
|
-
),
|
|
113
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: ui.cn("size-5", isLive && "animate-pulse") })
|
|
114
|
-
}
|
|
115
|
-
) }),
|
|
116
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: text }) })
|
|
117
|
-
] });
|
|
118
|
-
}
|
|
119
|
-
var INVITE_LINK_HINT = "will get an invitation to create an ARBI account and join";
|
|
120
|
-
var NO_KEY_REASON = "Cannot receive encrypted calls yet";
|
|
121
|
-
var NO_EMAIL_REASON = "No e-mail address to send a link to";
|
|
122
|
-
function contactName(contact) {
|
|
123
|
-
return contact.card?.name?.trim() || [contact.card?.given_name, contact.card?.family_name].filter(Boolean).join(" ") || (contact.user ? ui.getUserDisplayName(contact.user) : "") || contactEmail(contact) || "Contact";
|
|
124
|
-
}
|
|
125
|
-
function contactEmail(contact) {
|
|
126
|
-
return contact.email ?? contact.user?.email ?? contact.card?.emails?.[0]?.email ?? null;
|
|
127
|
-
}
|
|
128
|
-
function callContactOf(contact) {
|
|
129
|
-
if (!contact.external_id || contact.status === "failed") return null;
|
|
130
|
-
if (contact.user && ui.isAgent(contact.user)) return null;
|
|
131
|
-
return {
|
|
132
|
-
contactExtId: contact.external_id,
|
|
133
|
-
user: contact.user ?? null,
|
|
134
|
-
name: contactName(contact),
|
|
135
|
-
email: contactEmail(contact)
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
function userCandidate(user, section, status, contactExtId = null) {
|
|
139
|
-
const ringable = status !== "ring" || !!user.encryption_public_key;
|
|
140
|
-
return {
|
|
141
|
-
id: user.external_id,
|
|
142
|
-
name: ui.getUserDisplayName(user) || user.email,
|
|
143
|
-
email: user.email ?? null,
|
|
144
|
-
section,
|
|
145
|
-
status: ringable ? status : "unavailable",
|
|
146
|
-
reason: ringable ? void 0 : NO_KEY_REASON,
|
|
147
|
-
user,
|
|
148
|
-
contactExtId
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
function buildCallCandidates(opts) {
|
|
152
|
-
const seen = /* @__PURE__ */ new Set();
|
|
153
|
-
const out = [];
|
|
154
|
-
const add = (c) => {
|
|
155
|
-
if (seen.has(c.id)) return;
|
|
156
|
-
seen.add(c.id);
|
|
157
|
-
out.push(c);
|
|
158
|
-
};
|
|
159
|
-
const people = (users) => users.filter((u) => !ui.isAgent(u) && u.external_id !== opts.me);
|
|
160
|
-
if (opts.scope !== "contacts") {
|
|
161
|
-
for (const u of people(opts.members)) add(userCandidate(u, "members", "ring"));
|
|
162
|
-
return out;
|
|
163
|
-
}
|
|
164
|
-
const contacts = (opts.contacts ?? []).filter((c) => !(c.user && ui.isAgent(c.user)));
|
|
165
|
-
const contactOf = new Map(
|
|
166
|
-
contacts.filter((c) => c.user).map((c) => [c.user.external_id, c.contactExtId])
|
|
167
|
-
);
|
|
168
|
-
for (const u of people(opts.members)) {
|
|
169
|
-
const contactId = contactOf.get(u.external_id) ?? opts.contactIdOf?.(u) ?? null;
|
|
170
|
-
add(userCandidate(u, "members", contactId ? "ring" : "add-contact", contactId));
|
|
171
|
-
}
|
|
172
|
-
for (const c of contacts) {
|
|
173
|
-
if (c.user) {
|
|
174
|
-
if (c.user.external_id === opts.me) continue;
|
|
175
|
-
add(userCandidate(c.user, "contacts", "ring", c.contactExtId));
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
const status = c.email ? "invite" : "unavailable";
|
|
179
|
-
add({
|
|
180
|
-
id: c.contactExtId,
|
|
181
|
-
name: c.name,
|
|
182
|
-
email: c.email,
|
|
183
|
-
section: "contacts",
|
|
184
|
-
status,
|
|
185
|
-
reason: c.email ? INVITE_LINK_HINT : NO_EMAIL_REASON,
|
|
186
|
-
user: null,
|
|
187
|
-
contactExtId: c.contactExtId
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
return out;
|
|
191
|
-
}
|
|
192
|
-
function isPickable(c) {
|
|
193
|
-
return c.status === "ring" || c.status === "invite";
|
|
194
|
-
}
|
|
195
|
-
function matchesQuery(c, query) {
|
|
196
|
-
const q = query.trim().toLowerCase();
|
|
197
|
-
if (!q) return true;
|
|
198
|
-
return c.name.toLowerCase().includes(q) || (c.email ?? "").toLowerCase().includes(q);
|
|
199
|
-
}
|
|
200
|
-
var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
201
|
-
var COPY = {
|
|
202
|
-
workspace: {
|
|
203
|
-
title: "Call thread members",
|
|
204
|
-
description: "Only members of this thread\u2019s workspace can join. Pick who to ring \u2014 or nobody, and share the call from the thread.",
|
|
205
|
-
action: "Start call"
|
|
206
|
-
},
|
|
207
|
-
chat: {
|
|
208
|
-
title: "Call the group",
|
|
209
|
-
description: "The people you pick are rung.",
|
|
210
|
-
action: "Start call"
|
|
211
|
-
},
|
|
212
|
-
contacts: {
|
|
213
|
-
title: "New call",
|
|
214
|
-
description: "Your contacts with an ARBI account are rung. Others get an invitation to create an account and join.",
|
|
215
|
-
action: "Start call"
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
function CandidateRow({
|
|
219
|
-
candidate,
|
|
220
|
-
checked,
|
|
221
|
-
onToggle,
|
|
222
|
-
onAddContact,
|
|
223
|
-
adding
|
|
224
|
-
}) {
|
|
225
|
-
const pickable = isPickable(candidate);
|
|
226
|
-
const hint = candidate.status === "invite" ? candidate.reason : candidate.status === "add-contact" ? "Not in your contacts" : void 0;
|
|
227
|
-
const row = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
228
|
-
"li",
|
|
229
|
-
{
|
|
230
|
-
className: ui.cn(
|
|
231
|
-
"flex items-center gap-3 rounded-md px-2 py-1.5",
|
|
232
|
-
pickable ? "hover:bg-muted" : "opacity-60"
|
|
233
|
-
),
|
|
234
|
-
"data-testid": `call-picker-row-${candidate.id}`,
|
|
235
|
-
"data-status": candidate.status,
|
|
236
|
-
"aria-disabled": !pickable || void 0,
|
|
237
|
-
children: [
|
|
238
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
239
|
-
ui.Checkbox,
|
|
240
|
-
{
|
|
241
|
-
checked,
|
|
242
|
-
disabled: !pickable,
|
|
243
|
-
onCheckedChange: onToggle,
|
|
244
|
-
"aria-label": `Invite ${candidate.name}`,
|
|
245
|
-
"data-testid": `call-picker-check-${candidate.id}`
|
|
246
|
-
}
|
|
247
|
-
),
|
|
248
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
249
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm", children: candidate.name }),
|
|
250
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "block truncate text-xs text-muted-foreground", children: [
|
|
251
|
-
candidate.email,
|
|
252
|
-
hint && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ml-1 inline-flex items-center gap-1", children: [
|
|
253
|
-
candidate.status === "invite" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "size-3", "aria-hidden": true }),
|
|
254
|
-
candidate.email ? `\xB7 ${hint}` : hint
|
|
255
|
-
] })
|
|
256
|
-
] })
|
|
257
|
-
] }),
|
|
258
|
-
candidate.status === "add-contact" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
259
|
-
ui.Button,
|
|
260
|
-
{
|
|
261
|
-
type: "button",
|
|
262
|
-
size: "sm",
|
|
263
|
-
variant: "outline",
|
|
264
|
-
disabled: adding,
|
|
265
|
-
onClick: onAddContact,
|
|
266
|
-
"data-testid": `call-picker-add-${candidate.id}`,
|
|
267
|
-
children: [
|
|
268
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "mr-1 size-3.5" }),
|
|
269
|
-
"Add contact"
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
)
|
|
273
|
-
]
|
|
274
|
-
}
|
|
275
|
-
);
|
|
276
|
-
if (candidate.status !== "unavailable" || !candidate.reason) return row;
|
|
277
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
278
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: row }),
|
|
279
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: candidate.reason }) })
|
|
280
|
-
] });
|
|
281
|
-
}
|
|
282
|
-
function InviteLinks({ callExtId }) {
|
|
283
|
-
const { notify } = chunkB3NYBMDR_cjs.useBlocksEnvironment();
|
|
284
|
-
const revokeLink = react$1.useRevokeCallInviteLink(callExtId);
|
|
285
|
-
const { data: invites = [] } = react$1.useCallInviteLinks(callExtId);
|
|
286
|
-
const live = invites.filter((i) => !i.revoked_at);
|
|
287
|
-
if (!live.length) return null;
|
|
288
|
-
const revoke = async (id) => {
|
|
289
|
-
try {
|
|
290
|
-
await revokeLink(id);
|
|
291
|
-
} catch (err) {
|
|
292
|
-
notify(err instanceof Error ? err.message : "Could not revoke the link", "error");
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-1", "data-testid": "call-picker-invite-links", children: [
|
|
296
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xs font-medium text-muted-foreground", children: "Invitations sent" }),
|
|
297
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col gap-1", children: live.map((invite) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2 text-sm", children: [
|
|
298
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "size-3.5 text-muted-foreground", "aria-hidden": true }),
|
|
299
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: invite.email }),
|
|
300
|
-
invite.used_at && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "joined" }),
|
|
301
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
302
|
-
ui.Button,
|
|
303
|
-
{
|
|
304
|
-
type: "button",
|
|
305
|
-
size: "sm",
|
|
306
|
-
variant: "ghost",
|
|
307
|
-
onClick: () => void revoke(invite.external_id),
|
|
308
|
-
"data-testid": `call-picker-revoke-${invite.external_id}`,
|
|
309
|
-
children: [
|
|
310
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "mr-1 size-3.5" }),
|
|
311
|
-
"Revoke"
|
|
312
|
-
]
|
|
313
|
-
}
|
|
314
|
-
)
|
|
315
|
-
] }, invite.external_id)) })
|
|
316
|
-
] });
|
|
317
|
-
}
|
|
318
|
-
function CallPeoplePicker({
|
|
319
|
-
open,
|
|
320
|
-
onOpenChange,
|
|
321
|
-
scope,
|
|
322
|
-
workspaceExtId,
|
|
323
|
-
members: chatMembers = [],
|
|
324
|
-
preselected = [],
|
|
325
|
-
title,
|
|
326
|
-
description,
|
|
327
|
-
actionLabel,
|
|
328
|
-
callExtId,
|
|
329
|
-
onSubmit
|
|
330
|
-
}) {
|
|
331
|
-
const { notify } = chunkB3NYBMDR_cjs.useBlocksEnvironment();
|
|
332
|
-
const createContact = react$1.useCreateContact();
|
|
333
|
-
const { userId: me, workspaceId: selectedWorkspaceId } = chunkP6HVJP6Z_cjs.useConnectedWorkspace();
|
|
334
|
-
const { data: workspaces = [] } = react$1.useWorkspaces({ enabled: scope !== "chat" });
|
|
335
|
-
const [picked, setPicked] = react.useState(() => new Set(preselected));
|
|
336
|
-
const [query, setQuery] = react.useState("");
|
|
337
|
-
const [newEmail, setNewEmail] = react.useState(null);
|
|
338
|
-
const [newName, setNewName] = react.useState("");
|
|
339
|
-
const [adding, setAdding] = react.useState(false);
|
|
340
|
-
const [busy, setBusy] = react.useState(false);
|
|
341
|
-
const [added, setAdded] = react.useState([]);
|
|
342
|
-
const { byEmail } = react$1.usePeople();
|
|
343
|
-
const { people: hits } = react$1.usePeopleSearch(open && scope === "contacts" ? query : "");
|
|
344
|
-
const preselectedKey = preselected.join(",");
|
|
345
|
-
react.useEffect(() => {
|
|
346
|
-
if (open) setPicked(new Set(preselectedKey ? preselectedKey.split(",") : []));
|
|
347
|
-
}, [open, preselectedKey]);
|
|
348
|
-
const workspaceId = workspaceExtId ?? (scope === "contacts" ? selectedWorkspaceId : null);
|
|
349
|
-
const workspaceMembers = react.useMemo(
|
|
350
|
-
() => (workspaces.find((w) => w.external_id === workspaceId)?.users ?? []).map((wu) => wu.user),
|
|
351
|
-
[workspaces, workspaceId]
|
|
352
|
-
);
|
|
353
|
-
const candidates = react.useMemo(() => {
|
|
354
|
-
const found = hits.flatMap(
|
|
355
|
-
(p) => p.contactId ? [{ contactExtId: p.contactId, user: p.user, name: p.name, email: p.email }] : []
|
|
356
|
-
);
|
|
357
|
-
return buildCallCandidates({
|
|
358
|
-
scope,
|
|
359
|
-
members: scope === "chat" ? chatMembers : workspaceMembers,
|
|
360
|
-
contacts: [...added, ...found],
|
|
361
|
-
contactIdOf: (u) => byEmail(u.email)?.contactId ?? null,
|
|
362
|
-
me
|
|
363
|
-
});
|
|
364
|
-
}, [scope, chatMembers, workspaceMembers, hits, added, byEmail, me]);
|
|
365
|
-
const shown = candidates.filter((c) => matchesQuery(c, query));
|
|
366
|
-
const copy = COPY[scope];
|
|
367
|
-
const toggle = (id) => setPicked((prev) => {
|
|
368
|
-
const next = new Set(prev);
|
|
369
|
-
if (next.has(id)) next.delete(id);
|
|
370
|
-
else next.add(id);
|
|
371
|
-
return next;
|
|
372
|
-
});
|
|
373
|
-
const addContact = async (email, name) => {
|
|
374
|
-
setAdding(true);
|
|
375
|
-
try {
|
|
376
|
-
const cardName = name?.trim();
|
|
377
|
-
const contact = await createContact.mutateAsync({
|
|
378
|
-
email,
|
|
379
|
-
invite: true,
|
|
380
|
-
...cardName ? { card: { name: cardName, emails: [{ email }] } } : {}
|
|
381
|
-
});
|
|
382
|
-
if (contact.status === "failed") {
|
|
383
|
-
throw new Error(contact.outcome_detail || "Could not add the contact");
|
|
384
|
-
}
|
|
385
|
-
const added2 = callContactOf(contact);
|
|
386
|
-
if (added2) setAdded((prev) => [...prev, added2]);
|
|
387
|
-
const id = contact.user?.external_id ?? contact.external_id;
|
|
388
|
-
const pickable = contact.user ? !!contact.user.encryption_public_key : !!added2?.email;
|
|
389
|
-
if (id && pickable) setPicked((prev) => new Set(prev).add(id));
|
|
390
|
-
setNewEmail(null);
|
|
391
|
-
setNewName("");
|
|
392
|
-
} catch (err) {
|
|
393
|
-
notify(
|
|
394
|
-
err instanceof browser.ArbiApiError ? browser.refusalReason(err, "Could not add the contact") : err instanceof Error ? err.message : "Could not add the contact",
|
|
395
|
-
"error"
|
|
396
|
-
);
|
|
397
|
-
} finally {
|
|
398
|
-
setAdding(false);
|
|
399
|
-
}
|
|
400
|
-
};
|
|
401
|
-
const submit = async () => {
|
|
402
|
-
if (busy) return;
|
|
403
|
-
const chosen = candidates.filter((c) => picked.has(c.id) && isPickable(c));
|
|
404
|
-
setBusy(true);
|
|
405
|
-
try {
|
|
406
|
-
await onSubmit({
|
|
407
|
-
ring: chosen.filter((c) => c.status === "ring" && c.user).map((c) => c.user),
|
|
408
|
-
invites: chosen.filter((c) => c.status === "invite" && c.contactExtId).map((c) => ({ contactExtId: c.contactExtId, name: c.name }))
|
|
409
|
-
});
|
|
410
|
-
onOpenChange(false);
|
|
411
|
-
} catch (err) {
|
|
412
|
-
notify(err instanceof Error ? err.message : "Something went wrong", "error");
|
|
413
|
-
} finally {
|
|
414
|
-
setBusy(false);
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
const sections = scope === "contacts" ? [
|
|
418
|
-
{ id: "members", label: "Workspace members" },
|
|
419
|
-
{ id: "contacts", label: "Contacts" }
|
|
420
|
-
] : [{ id: "members", label: scope === "chat" ? "Members" : "Workspace members" }];
|
|
421
|
-
const count = candidates.filter((c) => picked.has(c.id) && isPickable(c)).length;
|
|
422
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { className: "sm:max-w-md", "data-testid": "call-people-picker", children: [
|
|
423
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
|
|
424
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: title ?? copy.title }),
|
|
425
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: description ?? copy.description })
|
|
426
|
-
] }),
|
|
427
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-col gap-3", children: [
|
|
428
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
429
|
-
ui.Input,
|
|
430
|
-
{
|
|
431
|
-
placeholder: "Search people",
|
|
432
|
-
value: query,
|
|
433
|
-
onChange: (e) => setQuery(e.target.value),
|
|
434
|
-
"aria-label": "Search people",
|
|
435
|
-
"data-testid": "call-picker-search"
|
|
436
|
-
}
|
|
437
|
-
),
|
|
438
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-h-80 overflow-y-auto", children: [
|
|
439
|
-
sections.map((section) => {
|
|
440
|
-
const rows = shown.filter((c) => c.section === section.id);
|
|
441
|
-
if (!rows.length) return null;
|
|
442
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "mb-2", children: [
|
|
443
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "px-2 pb-1 text-xs font-medium text-muted-foreground", children: section.label }),
|
|
444
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { "data-testid": `call-picker-section-${section.id}`, children: rows.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
445
|
-
CandidateRow,
|
|
446
|
-
{
|
|
447
|
-
candidate: c,
|
|
448
|
-
checked: picked.has(c.id),
|
|
449
|
-
onToggle: () => toggle(c.id),
|
|
450
|
-
adding,
|
|
451
|
-
onAddContact: () => c.email && void addContact(c.email)
|
|
452
|
-
},
|
|
453
|
-
c.id
|
|
454
|
-
)) })
|
|
455
|
-
] }, section.id);
|
|
456
|
-
}),
|
|
457
|
-
!shown.length && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 py-3 text-sm text-muted-foreground", children: scope === "contacts" && !query.trim() ? "Search your contacts by name or e-mail." : candidates.length ? "Nobody matches." : "Nobody to call here yet." })
|
|
458
|
-
] }),
|
|
459
|
-
scope === "contacts" && (newEmail === null ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
460
|
-
ui.Button,
|
|
461
|
-
{
|
|
462
|
-
type: "button",
|
|
463
|
-
variant: "ghost",
|
|
464
|
-
size: "sm",
|
|
465
|
-
className: "self-start",
|
|
466
|
-
onClick: () => setNewEmail(EMAIL_RE.test(query.trim()) ? query.trim() : ""),
|
|
467
|
-
"data-testid": "call-picker-add-contact",
|
|
468
|
-
children: [
|
|
469
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "mr-1 size-4" }),
|
|
470
|
-
"Add contact\u2026"
|
|
471
|
-
]
|
|
472
|
-
}
|
|
473
|
-
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
474
|
-
"form",
|
|
475
|
-
{
|
|
476
|
-
className: "flex flex-wrap items-center gap-2",
|
|
477
|
-
onSubmit: (e) => {
|
|
478
|
-
e.preventDefault();
|
|
479
|
-
if (EMAIL_RE.test(newEmail.trim())) void addContact(newEmail.trim(), newName);
|
|
480
|
-
},
|
|
481
|
-
children: [
|
|
482
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
483
|
-
ui.Input,
|
|
484
|
-
{
|
|
485
|
-
className: "min-w-[8rem] flex-1",
|
|
486
|
-
placeholder: "Name (optional)",
|
|
487
|
-
value: newName,
|
|
488
|
-
maxLength: 200,
|
|
489
|
-
onChange: (e) => setNewName(e.target.value),
|
|
490
|
-
"aria-label": "New contact's name",
|
|
491
|
-
autoComplete: "off",
|
|
492
|
-
"data-testid": "call-picker-new-name"
|
|
493
|
-
}
|
|
494
|
-
),
|
|
495
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
496
|
-
ui.Input,
|
|
497
|
-
{
|
|
498
|
-
className: "min-w-[10rem] flex-1",
|
|
499
|
-
type: "email",
|
|
500
|
-
autoFocus: true,
|
|
501
|
-
placeholder: "name@example.com",
|
|
502
|
-
value: newEmail,
|
|
503
|
-
onChange: (e) => setNewEmail(e.target.value),
|
|
504
|
-
"aria-label": "New contact's e-mail",
|
|
505
|
-
"data-testid": "call-picker-new-email"
|
|
506
|
-
}
|
|
507
|
-
),
|
|
508
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
509
|
-
ui.Button,
|
|
510
|
-
{
|
|
511
|
-
type: "submit",
|
|
512
|
-
size: "sm",
|
|
513
|
-
disabled: adding || !EMAIL_RE.test(newEmail.trim()),
|
|
514
|
-
"data-testid": "call-picker-new-submit",
|
|
515
|
-
children: "Add"
|
|
516
|
-
}
|
|
517
|
-
),
|
|
518
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
519
|
-
ui.Button,
|
|
520
|
-
{
|
|
521
|
-
type: "button",
|
|
522
|
-
size: "sm",
|
|
523
|
-
variant: "ghost",
|
|
524
|
-
onClick: () => {
|
|
525
|
-
setNewEmail(null);
|
|
526
|
-
setNewName("");
|
|
527
|
-
},
|
|
528
|
-
children: "Cancel"
|
|
529
|
-
}
|
|
530
|
-
)
|
|
531
|
-
]
|
|
532
|
-
}
|
|
533
|
-
)),
|
|
534
|
-
callExtId && scope === "contacts" && /* @__PURE__ */ jsxRuntime.jsx(InviteLinks, { callExtId }),
|
|
535
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: "Agents can\u2019t join calls." })
|
|
536
|
-
] }),
|
|
537
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.DialogFooter, { children: [
|
|
538
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "ghost", onClick: () => onOpenChange(false), disabled: busy, children: "Cancel" }),
|
|
539
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: () => void submit(), disabled: busy, "data-testid": "call-picker-submit", children: busy ? "Working\u2026" : `${actionLabel ?? copy.action}${count ? ` (${count})` : ""}` })
|
|
540
|
-
] })
|
|
541
|
-
] }) });
|
|
542
|
-
}
|
|
543
|
-
function ThreadCallButton({
|
|
544
|
-
conversationId
|
|
545
|
-
}) {
|
|
546
|
-
const arbi = react$1.useArbi();
|
|
547
|
-
const { data: conversations } = chunkHDEOORSV_cjs.useConnectedConversations();
|
|
548
|
-
const { workspaceId: workspaceExtId } = chunkP6HVJP6Z_cjs.useConnectedWorkspace();
|
|
549
|
-
const liveCallId = react$1.useCallSession((s) => react$1.threadLiveCallId(s, conversationId));
|
|
550
|
-
const isLive = liveCallId !== null;
|
|
551
|
-
const canHost = react$1.useCanHostCalls();
|
|
552
|
-
const [picking, setPicking] = react.useState(false);
|
|
553
|
-
const conversation = conversations.find((c) => c.external_id === conversationId);
|
|
554
|
-
if (!conversation?.is_shared) return null;
|
|
555
|
-
const title = conversation.title ?? null;
|
|
556
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
557
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
558
|
-
StartCallButton,
|
|
559
|
-
{
|
|
560
|
-
onStart: async () => {
|
|
561
|
-
if (liveCallId && !canHost) return react$1.openCall(arbi, { callExtId: liveCallId });
|
|
562
|
-
if (isLive) return react$1.startThreadCall(arbi, { threadExtId: conversationId, title, ring: [] });
|
|
563
|
-
setPicking(true);
|
|
564
|
-
return true;
|
|
565
|
-
},
|
|
566
|
-
isLive,
|
|
567
|
-
label: "Call thread members",
|
|
568
|
-
testId: "thread-call-button"
|
|
569
|
-
}
|
|
570
|
-
),
|
|
571
|
-
picking && /* @__PURE__ */ jsxRuntime.jsx(
|
|
572
|
-
CallPeoplePicker,
|
|
573
|
-
{
|
|
574
|
-
open: true,
|
|
575
|
-
onOpenChange: setPicking,
|
|
576
|
-
scope: "workspace",
|
|
577
|
-
workspaceExtId,
|
|
578
|
-
onSubmit: async ({ ring }) => {
|
|
579
|
-
await react$1.startThreadCall(arbi, { threadExtId: conversationId, title, ring });
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
)
|
|
583
|
-
] });
|
|
584
|
-
}
|
|
585
80
|
function GroupCallButton({
|
|
586
81
|
chatExtId,
|
|
587
82
|
title,
|
|
@@ -596,7 +91,7 @@ function GroupCallButton({
|
|
|
596
91
|
const others = members.filter((u) => u.external_id !== me && !ui.isAgent(u));
|
|
597
92
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
598
93
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
599
|
-
StartCallButton,
|
|
94
|
+
chunk5R256EMF_cjs.StartCallButton,
|
|
600
95
|
{
|
|
601
96
|
onStart: async () => {
|
|
602
97
|
if (liveCallId && !canHost) return react$1.openCall(arbi, { callExtId: liveCallId });
|
|
@@ -610,7 +105,7 @@ function GroupCallButton({
|
|
|
610
105
|
}
|
|
611
106
|
),
|
|
612
107
|
picking && /* @__PURE__ */ jsxRuntime.jsx(
|
|
613
|
-
CallPeoplePicker,
|
|
108
|
+
chunk5R256EMF_cjs.CallPeoplePicker,
|
|
614
109
|
{
|
|
615
110
|
open: true,
|
|
616
111
|
onOpenChange: setPicking,
|
|
@@ -628,7 +123,7 @@ function DmCallButton({ peer }) {
|
|
|
628
123
|
const arbi = react$1.useArbi();
|
|
629
124
|
const name = react$1.userDisplayName(peer);
|
|
630
125
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
631
|
-
StartCallButton,
|
|
126
|
+
chunk5R256EMF_cjs.StartCallButton,
|
|
632
127
|
{
|
|
633
128
|
onStart: () => react$1.startDmCall(arbi, {
|
|
634
129
|
external_id: peer.external_id,
|
|
@@ -658,7 +153,7 @@ function EnabledNewCallChip() {
|
|
|
658
153
|
}
|
|
659
154
|
),
|
|
660
155
|
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
661
|
-
CallPeoplePicker,
|
|
156
|
+
chunk5R256EMF_cjs.CallPeoplePicker,
|
|
662
157
|
{
|
|
663
158
|
open: true,
|
|
664
159
|
onOpenChange: setOpen,
|
|
@@ -677,157 +172,6 @@ function EnabledNewCallChip() {
|
|
|
677
172
|
)
|
|
678
173
|
] });
|
|
679
174
|
}
|
|
680
|
-
function ScheduleCallButton({
|
|
681
|
-
conversationId,
|
|
682
|
-
peer,
|
|
683
|
-
variant = "icon",
|
|
684
|
-
className
|
|
685
|
-
}) {
|
|
686
|
-
const callsEnabled = react$1.useCanHostCalls();
|
|
687
|
-
const { conversations } = react$1.useConversationItems();
|
|
688
|
-
const { data: workspaces = [] } = react$1.useWorkspaces();
|
|
689
|
-
const { workspaceId: selectedWorkspaceId, userId: me } = chunkP6HVJP6Z_cjs.useConnectedWorkspace();
|
|
690
|
-
const { openCalendar } = chunkB3NYBMDR_cjs.useBlocksEnvironment();
|
|
691
|
-
if (!callsEnabled) return null;
|
|
692
|
-
const open = () => {
|
|
693
|
-
const conversation = conversationId ? conversations?.find((c) => c.external_id === conversationId) : void 0;
|
|
694
|
-
let people = [];
|
|
695
|
-
if (peer) people = [peer];
|
|
696
|
-
else if (conversation?.is_shared) {
|
|
697
|
-
const workspace = workspaces.find((w) => w.external_id === selectedWorkspaceId);
|
|
698
|
-
people = (workspace?.users ?? []).map((wu) => wu.user);
|
|
699
|
-
}
|
|
700
|
-
chunkB3NYBMDR_cjs.requestCalendarComposer({
|
|
701
|
-
title: peer ? `Call with ${ui.getUserDisplayName(peer) || peer.email}` : conversation?.title ?? "",
|
|
702
|
-
conversationId: conversationId ?? null,
|
|
703
|
-
attendees: people.filter((u) => !ui.isAgent(u) && u.external_id !== me).map((u) => ({
|
|
704
|
-
email: u.email,
|
|
705
|
-
user_id: u.external_id,
|
|
706
|
-
name: ui.getUserDisplayName(u) || null
|
|
707
|
-
})),
|
|
708
|
-
addCall: true
|
|
709
|
-
});
|
|
710
|
-
openCalendar();
|
|
711
|
-
};
|
|
712
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
713
|
-
ui.Button,
|
|
714
|
-
{
|
|
715
|
-
type: "button",
|
|
716
|
-
variant: "ghost",
|
|
717
|
-
size: variant === "icon" ? "icon" : "sm",
|
|
718
|
-
className: ui.cn(variant === "icon" && "size-8", className),
|
|
719
|
-
onClick: open,
|
|
720
|
-
"aria-label": "Schedule call",
|
|
721
|
-
title: "Schedule call",
|
|
722
|
-
"data-testid": "schedule-call-button",
|
|
723
|
-
children: [
|
|
724
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarPlus, { className: "size-4" }),
|
|
725
|
-
variant === "label" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5", children: "Schedule call" })
|
|
726
|
-
]
|
|
727
|
-
}
|
|
728
|
-
);
|
|
729
|
-
}
|
|
730
|
-
function MeetingThreadTranscriptAction({
|
|
731
|
-
conversationExtId,
|
|
732
|
-
meetingCallExtId,
|
|
733
|
-
title,
|
|
734
|
-
messages
|
|
735
|
-
}) {
|
|
736
|
-
const { data: call } = react$1.useCall(meetingCallExtId);
|
|
737
|
-
const { data: workspaceUsers = [] } = react$1.useWorkspaceUsers();
|
|
738
|
-
const lines = react.useMemo(
|
|
739
|
-
() => react$1.threadTranscriptLines(messages, (id) => {
|
|
740
|
-
const user = workspaceUsers.find((wu) => wu.user.external_id === id)?.user;
|
|
741
|
-
return user ? ui.getUserDisplayName(user) : null;
|
|
742
|
-
}),
|
|
743
|
-
[messages, workspaceUsers]
|
|
744
|
-
);
|
|
745
|
-
if (!meetingCallExtId || !call?.is_creator) return null;
|
|
746
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
747
|
-
chunk6AJJJ5HR_cjs.SaveTranscriptToThread,
|
|
748
|
-
{
|
|
749
|
-
title,
|
|
750
|
-
lines,
|
|
751
|
-
excludeConversationExtId: conversationExtId,
|
|
752
|
-
iconOnly: true
|
|
753
|
-
}
|
|
754
|
-
);
|
|
755
|
-
}
|
|
756
|
-
function MeetingThreadRecordingsAction({
|
|
757
|
-
meetingCallExtId,
|
|
758
|
-
title,
|
|
759
|
-
iconOnly = false
|
|
760
|
-
}) {
|
|
761
|
-
const [open, setOpen] = react.useState(false);
|
|
762
|
-
const pending = chunkEGSSLWNZ_cjs.usePendingRecording();
|
|
763
|
-
react.useEffect(() => {
|
|
764
|
-
if (pending) setOpen(true);
|
|
765
|
-
}, [pending]);
|
|
766
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
767
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
768
|
-
chunkEGSSLWNZ_cjs.HeaderAction,
|
|
769
|
-
{
|
|
770
|
-
label: "Recordings",
|
|
771
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Disc, { className: "size-3.5", "aria-hidden": true }),
|
|
772
|
-
iconOnly,
|
|
773
|
-
onClick: () => setOpen(true),
|
|
774
|
-
testId: "meeting-recordings"
|
|
775
|
-
}
|
|
776
|
-
),
|
|
777
|
-
open && /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: true, onOpenChange: (o) => !o && setOpen(false), children: /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { className: "sm:max-w-2xl", "data-testid": "meeting-recordings-dialog", children: [
|
|
778
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
|
|
779
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Recordings" }),
|
|
780
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: "Recordings of this meeting, encrypted under the workspace key. Playing or downloading one decrypts it in this browser." })
|
|
781
|
-
] }),
|
|
782
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
783
|
-
chunk6AJJJ5HR_cjs.RecordingsList,
|
|
784
|
-
{
|
|
785
|
-
callExtId: meetingCallExtId,
|
|
786
|
-
title,
|
|
787
|
-
className: "max-h-[60vh] overflow-y-auto"
|
|
788
|
-
}
|
|
789
|
-
)
|
|
790
|
-
] }) })
|
|
791
|
-
] });
|
|
792
|
-
}
|
|
793
|
-
function ConnectedConversationCallActions() {
|
|
794
|
-
const conversationId = react$1.useArbiSessionState((state) => state.conversationId);
|
|
795
|
-
const { conversations } = react$1.useConversationItems();
|
|
796
|
-
const conversation = conversationId ? conversations.find((c) => c.external_id === conversationId) : void 0;
|
|
797
|
-
const meetingCallExtId = conversation?.meeting_call_ext_id ?? null;
|
|
798
|
-
const { messageHistory } = react$1.useConversationData();
|
|
799
|
-
const threadMessages = chunk6AJJJ5HR_cjs.useMeetingThreadMessages(meetingCallExtId, messageHistory);
|
|
800
|
-
const meetingMessages = react.useMemo(
|
|
801
|
-
() => meetingCallExtId ? threadMessages.map((m) => ({
|
|
802
|
-
content: m.content,
|
|
803
|
-
created_at: m.created_at,
|
|
804
|
-
tools: m.tools ?? m.meta?.tools
|
|
805
|
-
})) : [],
|
|
806
|
-
[meetingCallExtId, threadMessages]
|
|
807
|
-
);
|
|
808
|
-
if (!conversationId) return null;
|
|
809
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
810
|
-
/* @__PURE__ */ jsxRuntime.jsx(ThreadCallButton, { conversationId }),
|
|
811
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScheduleCallButton, { conversationId }),
|
|
812
|
-
meetingCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
813
|
-
MeetingThreadTranscriptAction,
|
|
814
|
-
{
|
|
815
|
-
conversationExtId: conversationId,
|
|
816
|
-
meetingCallExtId,
|
|
817
|
-
title: conversation?.title,
|
|
818
|
-
messages: meetingMessages
|
|
819
|
-
}
|
|
820
|
-
),
|
|
821
|
-
meetingCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
822
|
-
MeetingThreadRecordingsAction,
|
|
823
|
-
{
|
|
824
|
-
meetingCallExtId,
|
|
825
|
-
title: conversation?.title,
|
|
826
|
-
iconOnly: true
|
|
827
|
-
}
|
|
828
|
-
)
|
|
829
|
-
] });
|
|
830
|
-
}
|
|
831
175
|
function ChatCallCard({
|
|
832
176
|
callExtId,
|
|
833
177
|
senderName,
|
|
@@ -965,7 +309,7 @@ function ConnectedCallChatHistory({
|
|
|
965
309
|
const transcriptEntry = (msg) => {
|
|
966
310
|
const { parsed, speakerId } = transcriptSpeaker(msg);
|
|
967
311
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
968
|
-
|
|
312
|
+
chunk5R256EMF_cjs.TranscriptEntry,
|
|
969
313
|
{
|
|
970
314
|
speakerId,
|
|
971
315
|
speakerName: speakerId === myExtId ? "Me" : parsed?.speaker_name || (memberById(speakerId) ? senderName(speakerId) : senderName(msg.sender_ext_id)),
|
|
@@ -983,7 +327,7 @@ function ConnectedCallChatHistory({
|
|
|
983
327
|
}),
|
|
984
328
|
[transcriptMessages]
|
|
985
329
|
);
|
|
986
|
-
const provisionalSpeakers =
|
|
330
|
+
const provisionalSpeakers = chunk5R256EMF_cjs.useProvisionalSpeakers(recordingsCallExtId, chatLines);
|
|
987
331
|
const filterOptions = [
|
|
988
332
|
{ value: "all", label: "All" },
|
|
989
333
|
{ value: "chat", label: "Chat", testId: "chat-filter" },
|
|
@@ -996,7 +340,7 @@ function ConnectedCallChatHistory({
|
|
|
996
340
|
...recordingsCallExtId ? [{ value: "recordings", label: "Recordings", testId: "recordings-filter" }] : []
|
|
997
341
|
];
|
|
998
342
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
999
|
-
messages.length === 0 && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
343
|
+
messages.length === 0 && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(chunk5R256EMF_cjs.CallConversationEmpty, { callExtId: recordingsCallExtId }),
|
|
1000
344
|
(hasTranscript || recordingsCallExtId) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0 z-10 flex justify-center py-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1001
345
|
chunkNXHETIOB_cjs.ConversationFilter,
|
|
1002
346
|
{
|
|
@@ -1005,11 +349,11 @@ function ConnectedCallChatHistory({
|
|
|
1005
349
|
onChange: setView
|
|
1006
350
|
}
|
|
1007
351
|
) }),
|
|
1008
|
-
view === "recordings" && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
352
|
+
view === "recordings" && recordingsCallExtId && /* @__PURE__ */ jsxRuntime.jsx(chunk5R256EMF_cjs.RecordingsList, { callExtId: recordingsCallExtId, title: meetingTitle, className: "py-1" }),
|
|
1009
353
|
loadOlder,
|
|
1010
354
|
view === "transcript" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col py-1", "data-testid": "transcript-view", children: [
|
|
1011
355
|
isHost && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1012
|
-
|
|
356
|
+
chunk5R256EMF_cjs.SaveTranscriptToThread,
|
|
1013
357
|
{
|
|
1014
358
|
title: meetingTitle,
|
|
1015
359
|
lines: transcriptExport,
|
|
@@ -1017,7 +361,7 @@ function ConnectedCallChatHistory({
|
|
|
1017
361
|
}
|
|
1018
362
|
),
|
|
1019
363
|
transcriptMessages.map((msg) => transcriptEntry(msg)),
|
|
1020
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
364
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk5R256EMF_cjs.ProvisionalSpeakers, { ids: provisionalSpeakers })
|
|
1021
365
|
] }),
|
|
1022
366
|
(view === "all" || view === "chat") && items.map((item, i) => {
|
|
1023
367
|
const { message: msg, isFirstOfDay } = item;
|
|
@@ -1037,7 +381,7 @@ function ConnectedCallChatHistory({
|
|
|
1037
381
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
1038
382
|
separator,
|
|
1039
383
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1040
|
-
|
|
384
|
+
chunk5R256EMF_cjs.RecordingCard,
|
|
1041
385
|
{
|
|
1042
386
|
callExtId: msg.call_ext_id,
|
|
1043
387
|
recordingExtId: msg.recording_ext_id ?? null,
|
|
@@ -1064,61 +408,105 @@ function ConnectedCallChatHistory({
|
|
|
1064
408
|
}
|
|
1065
409
|
return renderItem(item, i);
|
|
1066
410
|
}),
|
|
1067
|
-
view === "all" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
411
|
+
view === "all" && /* @__PURE__ */ jsxRuntime.jsx(chunk5R256EMF_cjs.ProvisionalSpeakers, { ids: provisionalSpeakers })
|
|
1068
412
|
] });
|
|
1069
413
|
}
|
|
1070
414
|
|
|
1071
415
|
Object.defineProperty(exports, "CallConversationEmpty", {
|
|
1072
416
|
enumerable: true,
|
|
1073
|
-
get: function () { return
|
|
417
|
+
get: function () { return chunk5R256EMF_cjs.CallConversationEmpty; }
|
|
418
|
+
});
|
|
419
|
+
Object.defineProperty(exports, "CallPeoplePicker", {
|
|
420
|
+
enumerable: true,
|
|
421
|
+
get: function () { return chunk5R256EMF_cjs.CallPeoplePicker; }
|
|
422
|
+
});
|
|
423
|
+
Object.defineProperty(exports, "ConnectedConversationCallActions", {
|
|
424
|
+
enumerable: true,
|
|
425
|
+
get: function () { return chunk5R256EMF_cjs.ConnectedConversationCallActions; }
|
|
426
|
+
});
|
|
427
|
+
Object.defineProperty(exports, "MeetingThreadRecordingsAction", {
|
|
428
|
+
enumerable: true,
|
|
429
|
+
get: function () { return chunk5R256EMF_cjs.MeetingThreadRecordingsAction; }
|
|
430
|
+
});
|
|
431
|
+
Object.defineProperty(exports, "MeetingThreadTranscriptAction", {
|
|
432
|
+
enumerable: true,
|
|
433
|
+
get: function () { return chunk5R256EMF_cjs.MeetingThreadTranscriptAction; }
|
|
1074
434
|
});
|
|
1075
435
|
Object.defineProperty(exports, "PickThreadDialog", {
|
|
1076
436
|
enumerable: true,
|
|
1077
|
-
get: function () { return
|
|
437
|
+
get: function () { return chunk5R256EMF_cjs.PickThreadDialog; }
|
|
1078
438
|
});
|
|
1079
439
|
Object.defineProperty(exports, "ProvisionalSpeakers", {
|
|
1080
440
|
enumerable: true,
|
|
1081
|
-
get: function () { return
|
|
441
|
+
get: function () { return chunk5R256EMF_cjs.ProvisionalSpeakers; }
|
|
1082
442
|
});
|
|
1083
443
|
Object.defineProperty(exports, "RecordingCard", {
|
|
1084
444
|
enumerable: true,
|
|
1085
|
-
get: function () { return
|
|
445
|
+
get: function () { return chunk5R256EMF_cjs.RecordingCard; }
|
|
1086
446
|
});
|
|
1087
447
|
Object.defineProperty(exports, "RecordingsList", {
|
|
1088
448
|
enumerable: true,
|
|
1089
|
-
get: function () { return
|
|
449
|
+
get: function () { return chunk5R256EMF_cjs.RecordingsList; }
|
|
1090
450
|
});
|
|
1091
451
|
Object.defineProperty(exports, "SaveTranscriptToThread", {
|
|
1092
452
|
enumerable: true,
|
|
1093
|
-
get: function () { return
|
|
453
|
+
get: function () { return chunk5R256EMF_cjs.SaveTranscriptToThread; }
|
|
454
|
+
});
|
|
455
|
+
Object.defineProperty(exports, "ScheduleCallButton", {
|
|
456
|
+
enumerable: true,
|
|
457
|
+
get: function () { return chunk5R256EMF_cjs.ScheduleCallButton; }
|
|
458
|
+
});
|
|
459
|
+
Object.defineProperty(exports, "StartCallButton", {
|
|
460
|
+
enumerable: true,
|
|
461
|
+
get: function () { return chunk5R256EMF_cjs.StartCallButton; }
|
|
462
|
+
});
|
|
463
|
+
Object.defineProperty(exports, "ThreadCallButton", {
|
|
464
|
+
enumerable: true,
|
|
465
|
+
get: function () { return chunk5R256EMF_cjs.ThreadCallButton; }
|
|
1094
466
|
});
|
|
1095
467
|
Object.defineProperty(exports, "ThreadCallLogCard", {
|
|
1096
468
|
enumerable: true,
|
|
1097
|
-
get: function () { return
|
|
469
|
+
get: function () { return chunk5R256EMF_cjs.ThreadCallLogCard; }
|
|
1098
470
|
});
|
|
1099
471
|
Object.defineProperty(exports, "TranscriptEntry", {
|
|
1100
472
|
enumerable: true,
|
|
1101
|
-
get: function () { return
|
|
473
|
+
get: function () { return chunk5R256EMF_cjs.TranscriptEntry; }
|
|
1102
474
|
});
|
|
1103
475
|
Object.defineProperty(exports, "TranscriptRunsContext", {
|
|
1104
476
|
enumerable: true,
|
|
1105
|
-
get: function () { return
|
|
477
|
+
get: function () { return chunk5R256EMF_cjs.TranscriptRunsContext; }
|
|
478
|
+
});
|
|
479
|
+
Object.defineProperty(exports, "buildCallCandidates", {
|
|
480
|
+
enumerable: true,
|
|
481
|
+
get: function () { return chunk5R256EMF_cjs.buildCallCandidates; }
|
|
482
|
+
});
|
|
483
|
+
Object.defineProperty(exports, "callContactOf", {
|
|
484
|
+
enumerable: true,
|
|
485
|
+
get: function () { return chunk5R256EMF_cjs.callContactOf; }
|
|
486
|
+
});
|
|
487
|
+
Object.defineProperty(exports, "isPickable", {
|
|
488
|
+
enumerable: true,
|
|
489
|
+
get: function () { return chunk5R256EMF_cjs.isPickable; }
|
|
490
|
+
});
|
|
491
|
+
Object.defineProperty(exports, "matchesQuery", {
|
|
492
|
+
enumerable: true,
|
|
493
|
+
get: function () { return chunk5R256EMF_cjs.matchesQuery; }
|
|
1106
494
|
});
|
|
1107
495
|
Object.defineProperty(exports, "threadTranscriptRuns", {
|
|
1108
496
|
enumerable: true,
|
|
1109
|
-
get: function () { return
|
|
497
|
+
get: function () { return chunk5R256EMF_cjs.threadTranscriptRuns; }
|
|
1110
498
|
});
|
|
1111
499
|
Object.defineProperty(exports, "useCallPersonName", {
|
|
1112
500
|
enumerable: true,
|
|
1113
|
-
get: function () { return
|
|
501
|
+
get: function () { return chunk5R256EMF_cjs.useCallPersonName; }
|
|
1114
502
|
});
|
|
1115
503
|
Object.defineProperty(exports, "useProvisionalSpeakers", {
|
|
1116
504
|
enumerable: true,
|
|
1117
|
-
get: function () { return
|
|
505
|
+
get: function () { return chunk5R256EMF_cjs.useProvisionalSpeakers; }
|
|
1118
506
|
});
|
|
1119
507
|
Object.defineProperty(exports, "useTranscriptRuns", {
|
|
1120
508
|
enumerable: true,
|
|
1121
|
-
get: function () { return
|
|
509
|
+
get: function () { return chunk5R256EMF_cjs.useTranscriptRuns; }
|
|
1122
510
|
});
|
|
1123
511
|
Object.defineProperty(exports, "BackstageBanner", {
|
|
1124
512
|
enumerable: true,
|
|
@@ -1564,26 +952,15 @@ Object.defineProperty(exports, "stageContentHeight", {
|
|
|
1564
952
|
enumerable: true,
|
|
1565
953
|
get: function () { return chunkNXHETIOB_cjs.stageContentHeight; }
|
|
1566
954
|
});
|
|
1567
|
-
exports.CallPeoplePicker = CallPeoplePicker;
|
|
1568
955
|
exports.ChatCallCard = ChatCallCard;
|
|
1569
956
|
exports.ConnectedCallChatHistory = ConnectedCallChatHistory;
|
|
1570
957
|
exports.ConnectedCallDock = ConnectedCallDock;
|
|
1571
958
|
exports.ConnectedCallLayer = ConnectedCallLayer;
|
|
1572
959
|
exports.ConnectedCallRoom = ConnectedCallRoom;
|
|
1573
|
-
exports.ConnectedConversationCallActions = ConnectedConversationCallActions;
|
|
1574
960
|
exports.ConnectedIncomingCall = ConnectedIncomingCall;
|
|
1575
961
|
exports.DmCallButton = DmCallButton;
|
|
1576
962
|
exports.GroupCallButton = GroupCallButton;
|
|
1577
|
-
exports.MeetingThreadRecordingsAction = MeetingThreadRecordingsAction;
|
|
1578
|
-
exports.MeetingThreadTranscriptAction = MeetingThreadTranscriptAction;
|
|
1579
963
|
exports.NewCallChip = NewCallChip;
|
|
1580
964
|
exports.RING_TIMEOUT_MS = RING_TIMEOUT_MS;
|
|
1581
|
-
exports.ScheduleCallButton = ScheduleCallButton;
|
|
1582
|
-
exports.StartCallButton = StartCallButton;
|
|
1583
|
-
exports.ThreadCallButton = ThreadCallButton;
|
|
1584
|
-
exports.buildCallCandidates = buildCallCandidates;
|
|
1585
|
-
exports.callContactOf = callContactOf;
|
|
1586
|
-
exports.isPickable = isPickable;
|
|
1587
|
-
exports.matchesQuery = matchesQuery;
|
|
1588
965
|
//# sourceMappingURL=index.cjs.map
|
|
1589
966
|
//# sourceMappingURL=index.cjs.map
|