@hanzo/app 0.3.94 → 0.3.96
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/Account.d.ts +9 -3
- package/dist/Account.js +142 -141
- package/dist/App.js +71 -37
- package/dist/Bar.js +1 -1
- package/dist/Betas.d.ts +1 -1
- package/dist/Betas.js +16 -22
- package/dist/Board.js +114 -48
- package/dist/CalScheduler.d.ts +1 -0
- package/dist/CalScheduler.js +223 -57
- package/dist/Chat.js +432 -153
- package/dist/Contacts.js +35 -31
- package/dist/ContextMenu.js +126 -42
- package/dist/Directory.js +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/Drive.js +351 -119
- package/dist/Gate.js +156 -13
- package/dist/Home.js +31 -53
- package/dist/Inbox.js +29 -15
- package/dist/InlineRename.d.ts +6 -0
- package/dist/InlineRename.js +41 -0
- package/dist/Learning.js +132 -13
- package/dist/Market.js +13 -9
- package/dist/Meet.d.ts +5 -0
- package/dist/Meet.js +75 -51
- package/dist/MoreMenu.d.ts +19 -0
- package/dist/MoreMenu.js +33 -0
- package/dist/NeedMoreUsage.js +2 -2
- package/dist/OrgSwitcher.js +6 -2
- package/dist/PreferencesDialog.js +5 -2
- package/dist/Rail.d.ts +73 -7
- package/dist/Rail.js +372 -111
- package/dist/Recents.js +77 -24
- package/dist/RightPane.js +2 -2
- package/dist/Search.d.ts +13 -1
- package/dist/Search.js +366 -50
- package/dist/Setup.js +34 -5
- package/dist/Shared.js +12 -12
- package/dist/Shell.d.ts +10 -0
- package/dist/Shell.js +258 -158
- package/dist/Sidebar.d.ts +14 -3
- package/dist/Sidebar.js +411 -129
- package/dist/SkipLink.d.ts +8 -0
- package/dist/SkipLink.js +11 -0
- package/dist/Start.js +51 -52
- package/dist/Terminals.js +159 -11
- package/dist/ToBottom.js +1 -1
- package/dist/Upgrade.d.ts +8 -3
- package/dist/Upgrade.js +194 -103
- package/dist/Usage.d.ts +1 -1
- package/dist/Usage.js +186 -82
- package/dist/WalletPill.js +8 -2
- package/dist/Work.js +162 -53
- package/dist/archive.d.ts +8 -0
- package/dist/archive.js +16 -0
- package/dist/bots/Bots.js +16 -1
- package/dist/bots/ComputerDialog.js +53 -26
- package/dist/bots/ConnectorsDialog.js +34 -15
- package/dist/bots/Make.js +5 -1
- package/dist/bots/Panel.js +37 -31
- package/dist/bots/Roster.d.ts +4 -1
- package/dist/bots/Roster.js +71 -25
- package/dist/bots/Thread.js +54 -27
- package/dist/bots/face.js +9 -3
- package/dist/bots/grid.d.ts +36 -0
- package/dist/bots/grid.js +91 -0
- package/dist/bots/ink.d.ts +1 -1
- package/dist/bots/ink.js +1 -1
- package/dist/bots/kit.d.ts +9 -4
- package/dist/bots/kit.js +3 -2
- package/dist/chord.d.ts +13 -0
- package/dist/chord.js +30 -1
- package/dist/crew.js +47 -4
- package/dist/ground.d.ts +2 -2
- package/dist/ground.js +3 -3
- package/dist/help.d.ts +7 -3
- package/dist/help.js +19 -14
- package/dist/keys.d.ts +28 -0
- package/dist/keys.js +58 -0
- package/dist/lib/arrival.d.ts +5 -0
- package/dist/lib/arrival.js +10 -0
- package/dist/lib/betas.d.ts +2 -0
- package/dist/lib/betas.js +10 -0
- package/dist/lib/branch.d.ts +11 -0
- package/dist/lib/branch.js +11 -0
- package/dist/lib/chatPreferences.d.ts +1 -1
- package/dist/lib/chatPreferences.js +1 -1
- package/dist/lib/dev-mode.d.ts +18 -0
- package/dist/lib/dev-mode.js +102 -0
- package/dist/lib/durable.d.ts +1 -1
- package/dist/lib/durable.js +1 -1
- package/dist/lib/info-hint.d.ts +7 -0
- package/dist/lib/info-hint.js +8 -0
- package/dist/lib/model-picker.d.ts +2 -0
- package/dist/lib/model-picker.js +12 -0
- package/dist/lib/owners.d.ts +5 -0
- package/dist/lib/owners.js +15 -0
- package/dist/lib/pay.d.ts +2 -0
- package/dist/lib/pay.js +4 -0
- package/dist/lib/todo.d.ts +7 -1
- package/dist/lib/todo.js +41 -29
- package/dist/look.js +39 -8
- package/dist/rail-open.d.ts +9 -0
- package/dist/rail-open.js +34 -0
- package/dist/renaming.d.ts +10 -0
- package/dist/renaming.js +25 -0
- package/dist/seek.d.ts +6 -1
- package/dist/seek.js +13 -0
- package/dist/thread.d.ts +2 -1
- package/dist/thread.js +85 -44
- package/package.json +11 -11
package/dist/Meet.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { useState, useEffect, useRef, useCallback, useMemo } from 'react';
|
|
4
4
|
import { Video, VideoOff, Mic, MicOff, PhoneOff, Copy, Check, Plus, Calendar, ExternalLink, Bot, Volume2, Square, Send, UserPlus, Tv, LayoutGrid, ArrowRight, Captions, } from 'lucide-react';
|
|
5
5
|
import { Text, View, XStack, YStack } from '@hanzo/gui';
|
|
6
|
-
import { Button } from '@hanzo/ui';
|
|
6
|
+
import { Button, toast } from '@hanzo/ui';
|
|
7
7
|
import { useIamToken } from '@hanzo/iam/react';
|
|
8
8
|
import { phrase } from '@hanzo/i18n';
|
|
9
9
|
import { refused, speech, useTranscript, useVoice } from '@hanzo/voice';
|
|
@@ -103,8 +103,14 @@ async function generateAgentMeetingResponse(prompt, agentName, token, t) {
|
|
|
103
103
|
throw new Error(t('The co-pilot answered with nothing.'));
|
|
104
104
|
return text;
|
|
105
105
|
}
|
|
106
|
-
/**
|
|
107
|
-
|
|
106
|
+
/** The invited agents and the co-pilot after `name` is asked or sent away: the co-pilot is the first one asked, and when it leaves the next in line takes over. */
|
|
107
|
+
export function invited(agents, copilot, name) {
|
|
108
|
+
if (agents.includes(name)) {
|
|
109
|
+
const rest = agents.filter((a) => a !== name);
|
|
110
|
+
return { invited: rest, copilot: copilot === name ? (rest[0] ?? null) : copilot };
|
|
111
|
+
}
|
|
112
|
+
return { invited: [...agents, name], copilot: copilot ?? name };
|
|
113
|
+
}
|
|
108
114
|
export function Meet() {
|
|
109
115
|
const { t, locale } = useI18n();
|
|
110
116
|
const [activeCall, setActiveCall] = useState(null);
|
|
@@ -119,12 +125,13 @@ export function Meet() {
|
|
|
119
125
|
// Agent Invitation and Active Call Participation
|
|
120
126
|
const [invitedAgents, setInvitedAgents] = useState(['Hanzo Coder', 'Hanzo Researcher']);
|
|
121
127
|
const [activeCoPilotAgent, setActiveCoPilotAgent] = useState('Hanzo Coder');
|
|
128
|
+
const coPilotName = activeCoPilotAgent ?? 'Hanzo Coder';
|
|
122
129
|
const [showAgentPicker, setShowAgentPicker] = useState(false);
|
|
123
130
|
const [meetingView, setMeetingView] = useState('iframe');
|
|
124
131
|
const [agentQuestion, setAgentQuestion] = useState('');
|
|
125
132
|
// Agent Speech in Call
|
|
126
133
|
const { token } = useIamToken();
|
|
127
|
-
const { speaking, speak, toggle } = useAgentSpeech(
|
|
134
|
+
const { speaking, speak, toggle } = useAgentSpeech(coPilotName);
|
|
128
135
|
const [audioTesting, setAudioTesting] = useState(false);
|
|
129
136
|
// The call's notes: what was said and answered here, and nothing before it.
|
|
130
137
|
const [liveNotes, setLiveNotes] = useState([]);
|
|
@@ -185,18 +192,25 @@ export function Meet() {
|
|
|
185
192
|
};
|
|
186
193
|
const handleCopyLink = (call) => {
|
|
187
194
|
const link = `https://meet.hanzo.ai/${call}`;
|
|
188
|
-
navigator.clipboard
|
|
189
|
-
|
|
190
|
-
|
|
195
|
+
if (typeof navigator === 'undefined' || !navigator.clipboard) {
|
|
196
|
+
toast.error(t('Could not copy'));
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
void navigator.clipboard
|
|
200
|
+
.writeText(link)
|
|
201
|
+
.then(() => {
|
|
202
|
+
setCopied(true);
|
|
203
|
+
toast.success(t('Copied'));
|
|
204
|
+
setTimeout(() => setCopied(false), 2000);
|
|
205
|
+
})
|
|
206
|
+
.catch(() => {
|
|
207
|
+
toast.error(t('Could not copy'));
|
|
208
|
+
});
|
|
191
209
|
};
|
|
192
210
|
const toggleAgentInvite = (agentName) => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
return next.length > 0 ? next : [agentName];
|
|
197
|
-
}
|
|
198
|
-
return [...prev, agentName];
|
|
199
|
-
});
|
|
211
|
+
const next = invited(invitedAgents, activeCoPilotAgent, agentName);
|
|
212
|
+
setInvitedAgents(next.invited);
|
|
213
|
+
setActiveCoPilotAgent(next.copilot);
|
|
200
214
|
};
|
|
201
215
|
const testAudioSpeaker = () => {
|
|
202
216
|
if (audioTesting) {
|
|
@@ -206,9 +220,9 @@ export function Meet() {
|
|
|
206
220
|
}
|
|
207
221
|
setAudioTesting(true);
|
|
208
222
|
speakAgent(t("Welcome to Hanzo Meet. This is {agent}'s voice. If you can hear this, your speakers are working.", {
|
|
209
|
-
agent:
|
|
223
|
+
agent: coPilotName,
|
|
210
224
|
}), {
|
|
211
|
-
agent:
|
|
225
|
+
agent: coPilotName,
|
|
212
226
|
token,
|
|
213
227
|
onEnd: () => setAudioTesting(false),
|
|
214
228
|
onError: () => setAudioTesting(false),
|
|
@@ -242,17 +256,17 @@ export function Meet() {
|
|
|
242
256
|
const time = clock(locale);
|
|
243
257
|
setLiveNotes((prev) => [...prev, t('{time}: You (voice): {text}', { time, text: transcript })]);
|
|
244
258
|
try {
|
|
245
|
-
const reply = await generateAgentMeetingResponse(transcript,
|
|
246
|
-
setLiveNotes((prev) => [...prev, t('{time}: {agent} (AI): {reply}', { time, agent:
|
|
247
|
-
void handsFreeSay(cleanForSpeech(reply), voiceOf(
|
|
259
|
+
const reply = await generateAgentMeetingResponse(transcript, coPilotName, token, t);
|
|
260
|
+
setLiveNotes((prev) => [...prev, t('{time}: {agent} (AI): {reply}', { time, agent: coPilotName, reply })]);
|
|
261
|
+
void handsFreeSay(cleanForSpeech(reply), voiceOf(coPilotName));
|
|
248
262
|
}
|
|
249
263
|
catch (err) {
|
|
250
264
|
setLiveNotes((prev) => [
|
|
251
265
|
...prev,
|
|
252
|
-
t('{time}: {agent} did not answer: {reason}', { time, agent:
|
|
266
|
+
t('{time}: {agent} did not answer: {reason}', { time, agent: coPilotName, reason: err.message }),
|
|
253
267
|
]);
|
|
254
268
|
}
|
|
255
|
-
}, [
|
|
269
|
+
}, [coPilotName, token, handsFreeSay, t, locale]);
|
|
256
270
|
const handleAskAgent = async (e) => {
|
|
257
271
|
e.preventDefault();
|
|
258
272
|
const q = agentQuestion.trim();
|
|
@@ -262,14 +276,14 @@ export function Meet() {
|
|
|
262
276
|
const time = clock(locale);
|
|
263
277
|
setLiveNotes((prev) => [...prev, t('{time}: You: {text}', { time, text: q })]);
|
|
264
278
|
try {
|
|
265
|
-
const reply = await generateAgentMeetingResponse(q,
|
|
266
|
-
setLiveNotes((prev) => [...prev, t('{time}: {agent} (AI): {reply}', { time, agent:
|
|
267
|
-
speak(reply,
|
|
279
|
+
const reply = await generateAgentMeetingResponse(q, coPilotName, token, t);
|
|
280
|
+
setLiveNotes((prev) => [...prev, t('{time}: {agent} (AI): {reply}', { time, agent: coPilotName, reply })]);
|
|
281
|
+
speak(reply, coPilotName);
|
|
268
282
|
}
|
|
269
283
|
catch (err) {
|
|
270
284
|
setLiveNotes((prev) => [
|
|
271
285
|
...prev,
|
|
272
|
-
t('{time}: {agent} did not answer: {reason}', { time, agent:
|
|
286
|
+
t('{time}: {agent} did not answer: {reason}', { time, agent: coPilotName, reason: err.message }),
|
|
273
287
|
]);
|
|
274
288
|
}
|
|
275
289
|
};
|
|
@@ -278,15 +292,15 @@ export function Meet() {
|
|
|
278
292
|
if (!liveNotes.length)
|
|
279
293
|
return;
|
|
280
294
|
const call = activeCall || t('this call');
|
|
281
|
-
toggle(t('Briefing for {call}. {notes}', { call, notes: liveNotes.join('. ') }),
|
|
295
|
+
toggle(t('Briefing for {call}. {notes}', { call, notes: liveNotes.join('. ') }), coPilotName);
|
|
282
296
|
};
|
|
283
297
|
// What the hands-free control says: why it cannot run, or that Hanzo's speech
|
|
284
298
|
// refused and the browser stood in (or could not) — never silence.
|
|
285
299
|
const handsFreeNote = handsFree.reason ?? (handsFree.refusal ? refused(handsFree.refusal) : null);
|
|
286
|
-
return (_jsxs(YStack, { width: "100%", height: "100%", bg: "$background", overflowX: "
|
|
287
|
-
['iframe', t('
|
|
288
|
-
['grid', t('Agent
|
|
289
|
-
].map(([view, label, Icon]) => (_jsxs(Button, { size: "sm", variant: meetingView === view ? '
|
|
300
|
+
return (_jsxs(YStack, { width: "100%", height: "100%", bg: "$background", overflowX: "hidden", overflowY: "auto", children: [_jsxs(XStack, { minH: 56, px: "$5", py: "$2", "$max-sm": { px: '$4' }, gap: "$3", flexWrap: "wrap", bg: "$panel", borderBottomWidth: 1, borderBottomColor: "$borderColor", items: "center", justify: "space-between", children: [_jsxs(XStack, { items: "center", gap: "$3", shrink: 1, minW: 0, children: [_jsx(XStack, { width: 32, height: 32, rounded: "$3", bg: "$raised", items: "center", justify: "center", shrink: 0, children: _jsx(Video, { size: 17, color: "var(--foreground)", "aria-hidden": true }) }), _jsxs(YStack, { shrink: 1, minW: 0, gap: "$0.5", children: [_jsxs(XStack, { items: "center", gap: "$2", flexWrap: "wrap", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: "Hanzo Meet" }), activeCall ? (_jsx(Text, { fontSize: "$1", fontWeight: "500", bg: "$hover", color: "$soft", borderWidth: 1, borderColor: "$borderColor", px: "$1.5", py: "$0.5", rounded: "$xs", children: t('Live · {site}', { site: 'meet.hanzo.ai' }) })) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: t('WebRTC video calls with AI meeting transcription and voice') })] })] }), activeCall ? (_jsxs(XStack, { items: "center", gap: "$2", shrink: 1, minW: 0, flexWrap: "wrap", children: [_jsx(XStack, { bg: "$hover", rounded: "$3", p: 2, gap: 2, borderWidth: 1, borderColor: "var(--border-strong)", shrink: 1, minW: 0, children: [
|
|
301
|
+
['iframe', t('Stage'), Tv],
|
|
302
|
+
['grid', t('Agent grid'), LayoutGrid],
|
|
303
|
+
].map(([view, label, Icon]) => (_jsxs(Button, { size: "sm", variant: meetingView === view ? 'secondary' : 'ghost', ...(meetingView === view ? null : { color: '$soft' }), "aria-pressed": meetingView === view, onClick: () => setMeetingView(view), children: [_jsx(Icon, { size: 12 }), label] }, view))) }), botAssisting ? (_jsx(View, { display: "none", "$max-md": { display: 'flex' }, children: _jsxs(Button, { size: "sm", variant: copilot ? 'secondary' : 'outline', borderColor: "var(--border-strong)", onClick: () => setCopilot((v) => !v), "aria-label": t('Co-pilot'), "aria-expanded": copilot, "aria-controls": "meet-copilot", children: [_jsx(Bot, { size: 13 }), t('Co-pilot')] }) })) : null, _jsxs(Button, { size: "sm", variant: "outline", borderColor: "var(--border-strong)", onClick: () => handleCopyLink(activeCall), children: [copied ? _jsx(Check, { size: 13 }) : _jsx(Copy, { size: 13 }), t(copied ? 'Link copied' : 'Copy meeting link')] }), _jsx(View, { display: "none", $sm: { display: 'flex' }, width: 1, height: 20, bg: "$borderColor", mx: "$1" }), _jsxs(Button, { size: "sm", variant: "destructive", onClick: () => {
|
|
290
304
|
stopAgentSpeech();
|
|
291
305
|
// Leaving the call hangs up the hands-free conversation and
|
|
292
306
|
// settles the transcript with it.
|
|
@@ -295,10 +309,10 @@ export function Meet() {
|
|
|
295
309
|
if (transcriber.open)
|
|
296
310
|
transcriber.toggle();
|
|
297
311
|
setActiveCall(null);
|
|
298
|
-
}, children: [_jsx(PhoneOff, { size: 14 }), t('Leave
|
|
312
|
+
}, children: [_jsx(PhoneOff, { size: 14 }), t('Leave call')] })] })) : (_jsx(XStack, { items: "center", gap: "$2", shrink: 1, minW: "auto", children: _jsx(Button, { asChild: true, variant: "linkMuted", size: "sm", px: 0, children: _jsxs("a", { href: "https://meet.hanzo.ai", target: "_blank", rel: "noopener noreferrer", children: ["meet.hanzo.ai", _jsx(ExternalLink, { size: 12 })] }) }) }))] }), activeCall ? (_jsxs(XStack, { flex: 1, overflow: "hidden", position: "relative", children: [_jsx(XStack, { flex: 1, minW: "auto", position: "relative", bg: "$sunken", children: meetingView === 'iframe' ? (_jsx(View, { render: _jsx("iframe", { src: `https://meet.hanzo.ai/${activeCall}#config.prejoinPageEnabled=false&config.startWithAudioMuted=${!micOn}&config.startWithVideoMuted=${!cameraOn}`, allow: "camera; microphone; display-capture; autoplay; clipboard-write; speaker-selection; screen-wake-lock", title: t('Hanzo Meet: {call}', { call: activeCall }) }), width: "100%", height: "100%", borderWidth: 0, bg: "$sunken" }, "stage")) : (_jsxs(View, { flex: 1, display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))", gap: 12, p: 16, overflowY: "auto", bg: "$background", children: [_jsxs(YStack, { bg: "$panel", rounded: "$5", borderWidth: 1, borderColor: "$borderColor", position: "relative", overflow: "hidden", items: "center", justify: "center", p: "$5", gap: "$2.5", minH: 220, children: [_jsx(YStack, { width: 72, height: 72, rounded: 9999, bg: "$raised", items: "center", justify: "center", children: _jsx(Text, { fontSize: "$6", fontWeight: "600", color: "$ink", children: t('You') }) }), _jsxs(YStack, { items: "center", gap: "$1", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('{name} (Host)', { name: 'Alex' }) }), _jsx(Text, { fontSize: "$1", color: micOn ? GOOD : '$soft', children: t(micOn ? 'Mic active' : 'Muted') })] })] }), invitedAgents.map((agentName) => {
|
|
299
313
|
const voice = voiceOf(agentName);
|
|
300
|
-
const isThisSpeaking = (speaking || handsFree.state === 'speaking') && activeCoPilotAgent
|
|
301
|
-
return (_jsxs(YStack, { bg: "$panel", rounded:
|
|
314
|
+
const isThisSpeaking = (speaking || handsFree.state === 'speaking') && activeCoPilotAgent?.toLowerCase() === agentName.toLowerCase();
|
|
315
|
+
return (_jsxs(YStack, { bg: "$panel", rounded: "$5", borderWidth: isThisSpeaking ? 2 : 1, borderColor: isThisSpeaking ? 'var(--state-success)' : '$borderColor', position: "relative", overflow: "hidden", items: "center", justify: "center", p: "$5", gap: "$2.5", minH: 220, transition: "200ms", children: [_jsxs(View, { position: "relative", children: [_jsx(Face, { name: agentName, size: 72 }), isThisSpeaking ? (_jsx(View, { position: "absolute", b: -4, r: -4, bg: "var(--popover)", borderWidth: 1, borderColor: "var(--state-success)", rounded: 9999, p: 4, children: _jsx(Volume2, { size: 12, color: GOOD }) })) : null] }), _jsxs(YStack, { items: "center", gap: "$0.5", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: agentName }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Voice: {voice}', { voice }) })] }), _jsx(XStack, { items: "center", gap: "$1.5", bg: "$hover", px: "$2.5", py: "$1", rounded: "$5", children: isThisSpeaking ? (_jsxs(_Fragment, { children: [_jsx(AudioWave, { active: true, color: "var(--state-success)" }), _jsx(Text, { fontSize: "$1", fontWeight: "500", color: GOOD, children: t('Speaking in call') })] })) : (_jsxs(_Fragment, { children: [_jsx(Bot, { size: 12, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "500", color: "$soft", children: t('AI agent · in call') })] })) })] }, agentName));
|
|
302
316
|
})] }, "grid")) }), botAssisting ? (_jsxs(YStack, { id: "meet-copilot", width: 360, minW: 360, bg: "$panel", borderLeftWidth: 1, borderLeftColor: "$borderColor", p: 16, gap: 12, "$max-md": {
|
|
303
317
|
display: copilot ? 'flex' : 'none',
|
|
304
318
|
position: 'absolute',
|
|
@@ -310,43 +324,53 @@ export function Meet() {
|
|
|
310
324
|
minW: 0,
|
|
311
325
|
z: 'var(--z-sheet)',
|
|
312
326
|
borderLeftWidth: 0,
|
|
313
|
-
}, children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsxs(XStack, { items: "center", gap:
|
|
327
|
+
}, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [_jsx(Face, { name: coPilotName, size: 28 }), _jsxs(YStack, { minW: 0, flex: 1, gap: "$0.5", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", numberOfLines: 1, children: activeCoPilotAgent ?? t('No co-pilot selected') }), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: t('AI co-pilot · Voice: {voice}', { voice: voiceOf(coPilotName) }) })] })] }), _jsx(Text, { fontSize: "$1", fontWeight: "500", color: GOOD, bg: "$hover", px: "$2", py: "$0.5", rounded: "$xs", shrink: 0, children: t('Live in call') })] }), _jsx(XStack, { gap: 4, flexWrap: "wrap", children: invitedAgents.map((agent) => (_jsx(Button, { size: "sm", variant: activeCoPilotAgent === agent ? 'secondary' : 'ghost', color: activeCoPilotAgent === agent ? '$ink' : '$soft', "aria-pressed": activeCoPilotAgent === agent, onClick: () => setActiveCoPilotAgent(agent), children: agent }, agent))) }), _jsxs(XStack, { gap: 8, children: [_jsx(Button, { size: "sm", flex: 1, variant: speaking ? 'secondary' : 'default', disabled: !speaking && !liveNotes.length, onClick: handleReadBriefing, children: speaking ? (_jsxs(_Fragment, { children: [_jsx(AudioWave, { active: true, color: "var(--state-success)" }), t('Stop briefing'), _jsx(Square, { size: 11, fill: "currentColor" })] })) : (_jsxs(_Fragment, { children: [_jsx(Volume2, { size: 14 }), t('Briefing')] })) }), _jsxs(Button, { size: "sm", variant: handsFree.open ? 'secondary' : 'default', "data-testid": "hands-free-voice-toggle", "data-state": handsFree.state, "data-refusal": handsFree.refusal ? handsFree.refusal.service : undefined, "aria-pressed": handsFree.open, disabled: !!handsFree.blocked, title: handsFreeNote ??
|
|
314
328
|
t(handsFree.open
|
|
315
|
-
? 'Hands-
|
|
316
|
-
: 'Enable
|
|
317
|
-
t(transcriber.open ? 'Transcribing — click to stop' : 'Transcribe what is said into the notes'), onClick: transcriber.toggle, children: [_jsx(Captions, { size: 14, color: transcriber.open ? 'var(--state-success)' : 'currentColor' }), t(transcriber.open ? 'Transcribing' : 'Transcribe')] })] }), handsFreeNote ? (_jsx(Text, { fontSize: "$1", color: "$soft", role: "status", children: handsFreeNote })) : null, transcriberNote ? (_jsx(Text, { fontSize: "$1", color: "$soft", role: "status", children: transcriberNote })) : null, _jsxs(YStack, { flex: 1, overflowY: "auto", bg: "$background", rounded:
|
|
329
|
+
? 'Hands-free voice active (speaks and interrupts on voice)'
|
|
330
|
+
: 'Enable hands-free voice mode'), onClick: handsFree.toggle, children: [_jsx(Mic, { size: 14, color: handsFree.open ? 'var(--state-success)' : 'currentColor' }), t(handsFree.open ? 'Hands-free on' : 'Hands-free')] }), _jsxs(Button, { size: "sm", variant: transcriber.open ? 'secondary' : 'default', "data-testid": "live-transcript-toggle", "data-state": transcriber.state, "data-refusal": transcriber.refusal ? transcriber.refusal.service : undefined, "aria-pressed": transcriber.open, disabled: !!transcriber.blocked, title: transcriberNote ??
|
|
331
|
+
t(transcriber.open ? 'Transcribing — click to stop' : 'Transcribe what is said into the notes'), onClick: transcriber.toggle, children: [_jsx(Captions, { size: 14, color: transcriber.open ? 'var(--state-success)' : 'currentColor' }), t(transcriber.open ? 'Transcribing' : 'Transcribe')] })] }), handsFreeNote ? (_jsx(Text, { fontSize: "$1", color: "$soft", role: "status", children: handsFreeNote })) : null, transcriberNote ? (_jsx(Text, { fontSize: "$1", color: "$soft", role: "status", children: transcriberNote })) : null, _jsxs(YStack, { flex: 1, overflowY: "auto", bg: "$background", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", p: "$3", gap: "$2", children: [liveNotes.length === 0 && !caption ? (_jsx(Text, { fontSize: "$2", color: "$soft", lineHeight: "$3", children: t('Notes from this call appear here. Ask {agent} below or turn on Transcribe.', { agent: coPilotName }) })) : null, liveNotes.map((note, i) => (_jsx(Text, { fontSize: "$2", color: "$ink", lineHeight: "$3", pb: "$2", borderBottomWidth: i === liveNotes.length - 1 ? 0 : 1, borderBottomColor: "$borderColor", children: note }, i))), transcriber.open && caption ? (_jsx(Text, { "data-testid": "live-caption", fontSize: "$2", color: "$soft", lineHeight: "$3", "aria-live": "polite", children: caption })) : null] }), _jsxs(XStack, { render: "form", onSubmit: handleAskAgent, gap: "$1.5", items: "center", children: [_jsx(Text, { render: _jsx("input", { type: "text", value: agentQuestion, onChange: (e) => setAgentQuestion(e.target.value), placeholder: t('Ask {agent} in meeting...', { agent: coPilotName }) }), flex: 1, minW: 0, minH: 36, "$max-sm": { minH: 44 }, bg: "$background", borderWidth: 1, borderColor: "var(--border-control)", focusStyle: { borderColor: 'var(--ring)' }, rounded: "$2", px: 10, py: 8, color: "$ink", fontSize: "$2", outlineStyle: "none" }), _jsx(Button, { type: "submit", variant: "primary", size: "icon-sm", minH: 36, minW: 36, "$max-sm": { minH: 44, minW: 44 }, disabled: !agentQuestion.trim(), "aria-label": t('Ask'), children: _jsx(Send, { size: 13 }) })] }), _jsxs(XStack, { gap: "$2", children: [_jsx(Button, { size: "sm", variant: "outline", borderColor: "var(--border-strong)", flex: 1, minH: 36, "$max-sm": { minH: 44 }, disabled: !agentQuestion.trim(), title: t('Add what is typed above to the notes, without asking the co-pilot'), onClick: () => {
|
|
318
332
|
const note = agentQuestion.trim();
|
|
319
333
|
if (!note)
|
|
320
334
|
return;
|
|
321
335
|
setAgentQuestion('');
|
|
322
336
|
setLiveNotes((prev) => [...prev, t('{time}: You (note): {note}', { time: clock(locale), note })]);
|
|
323
|
-
}, children: t('+ Add
|
|
337
|
+
}, children: t('+ Add live note') }), _jsx(Button, { variant: "outline", borderColor: "var(--border-strong)", size: "sm", minH: 36, "$max-sm": { minH: 44 }, disabled: !liveNotes.length, onClick: () => {
|
|
324
338
|
const text = liveNotes.join('\n');
|
|
325
|
-
navigator.clipboard
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
339
|
+
if (typeof navigator === 'undefined' || !navigator.clipboard) {
|
|
340
|
+
toast.error(t('Could not copy'));
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
void navigator.clipboard
|
|
344
|
+
.writeText(text)
|
|
345
|
+
.then(() => toast.success(t('Copied')))
|
|
346
|
+
.catch(() => toast.error(t('Could not copy')));
|
|
347
|
+
}, children: t('Copy summary') })] })] })) : null] })) : (_jsxs(XStack, { flex: 1, minH: 0, overflow: "hidden", "$max-lg": { flexDirection: 'column', overflowY: 'auto', overflowX: 'hidden' }, children: [_jsx(YStack, { flex: 1, minW: 0, p: "$6", overflowY: "auto", overflowX: "hidden", "$max-lg": { p: '$5', flexBasis: 'auto', grow: 0, shrink: 0, overflowY: 'visible', overflowX: 'hidden' }, "$max-sm": { p: '$4' }, children: _jsxs(YStack, { width: "100%", maxW: 640, gap: "$6", "$max-sm": { gap: '$5' }, children: [_jsxs(YStack, { gap: "$1.5", maxW: 560, children: [_jsx(Text, { render: "h1", m: 0, fontSize: "$8", lineHeight: "$8", "$max-sm": { fontSize: '$7', lineHeight: '$7' }, fontWeight: "600", color: "$ink", letterSpacing: -0.5, children: t('Secure, high-definition video calls') }), _jsx(Text, { fontSize: "$3", color: "$soft", lineHeight: "$4", children: t('Powered by native Hanzo Meet ({link}). Connect with team members, clients, and autonomous AI agents.', {
|
|
348
|
+
link: (_jsx(Text, { render: _jsx("a", { href: "https://meet.hanzo.ai", target: "_blank", rel: "noopener noreferrer" }), color: "$ink", textDecorationLine: "none", children: "meet.hanzo.ai" })),
|
|
349
|
+
}) })] }), _jsxs(XStack, { gap: "$3", flexWrap: "wrap", items: "center", "$max-sm": { gap: '$2' }, children: [_jsxs(Button, { variant: "primary", size: "lg", minH: 42, "$max-sm": { minH: 44, width: '100%' }, onClick: startInstantMeeting, children: [_jsx(Plus, { size: 16 }), t('Start instant meeting')] }), _jsxs(XStack, { items: "center", gap: "$1.5", bg: "$panel", borderWidth: 1, borderColor: "var(--border-strong)", focusWithinStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, rounded: "$3", px: "$1", minH: 42, minW: 0, maxW: "100%", "$max-sm": { width: '100%', minH: 44 }, children: [_jsx(Text, { render: _jsx("input", { type: "text", value: callInput, onChange: (e) => setCallInput(e.target.value), onKeyDown: (e) => e.key === 'Enter' && joinCustomMeeting(), placeholder: t('Enter meeting code or link'), "aria-label": t('Meeting code or link') }), flex: 1, minW: 0, bg: "transparent", borderWidth: 0, outlineStyle: "none", color: "$ink", fontSize: "$2", width: 210, "$max-sm": { width: 'auto' }, px: 8 }), _jsx(Button, { variant: "secondary", size: "sm", minH: 34, "$max-sm": { minH: 36 }, disabled: !callInput.trim(), onClick: joinCustomMeeting, children: t('Join') })] }), _jsxs(Button, { size: "lg", minH: 42, "$max-sm": { minH: 44 }, variant: showAgentPicker ? 'secondary' : 'outline', borderColor: "var(--border-strong)", "aria-expanded": showAgentPicker, onClick: () => setShowAgentPicker(!showAgentPicker), children: [_jsx(UserPlus, { size: 14 }), t('Invite agents ({count})', { count: invitedAgents.length.toLocaleString(locale) })] })] }), showAgentPicker ? (_jsxs(YStack, { bg: "$panel", borderWidth: 1, borderColor: "var(--border-strong)", rounded: "$5", p: "$4", gap: "$3", width: "100%", children: [_jsxs(YStack, { gap: "$1", children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Select AI agents to attend meetings') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Each agent joins the call with voice synthesis and pair programming.') })] }), _jsx(View, { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(min(220px, 100%), 1fr))", gap: "$2", children: AVAILABLE_MEETING_AGENTS.map((agent) => {
|
|
350
|
+
const isInvited = invitedAgents.includes(agent.name);
|
|
351
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button" }), "aria-pressed": isInvited, onClick: () => toggleAgentInvite(agent.name), items: "center", gap: "$2.5", px: "$2.5", py: "$2", "$max-sm": { minH: 48 }, rounded: "$3", bg: isInvited ? '$raised' : '$hover', borderWidth: 1, borderColor: isInvited ? 'var(--border-selected)' : '$borderColor', cursor: "pointer", transition: "quickest", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Face, { name: agent.name, size: 32 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: "$0.5", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", text: "start", numberOfLines: 1, children: agent.name }), _jsx(Text, { fontSize: "$1", color: "$soft", text: "start", numberOfLines: 1, children: t('{role} · {voice}', { role: t(agent.role), voice: agent.voice }) })] }), _jsx(View, { width: 16, height: 16, rounded: "$xs", shrink: 0, borderWidth: isInvited ? 0 : 1, borderColor: "var(--border-selected)", bg: isInvited ? 'var(--foreground)' : 'transparent', items: "center", justify: "center", children: isInvited ? _jsx(Check, { size: 11, strokeWidth: 3, color: "var(--background)" }) : null })] }, agent.id));
|
|
352
|
+
}) })] })) : null, _jsxs(YStack, { bg: "$panel", borderWidth: 1, borderColor: "$borderColor", rounded: "$5", overflow: "hidden", width: "100%", children: [_jsxs(XStack, { height: 280, "$max-sm": { height: 240 }, bg: "$sunken", position: "relative", items: "center", justify: "center", children: [cameraOn ? (_jsx(View, { render: _jsx("video", { ref: videoRef, autoPlay: true, playsInline: true, muted: true }), width: "100%", height: "100%", objectFit: "cover" })) : (_jsxs(YStack, { items: "center", gap: 8, children: [_jsx(XStack, { width: 64, height: 64, rounded: 9999, bg: "$raised", items: "center", justify: "center", children: _jsx(VideoOff, { size: 28, color: "var(--muted-foreground)" }) }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Camera is off') })] })), _jsxs(XStack, { position: "absolute", b: 12, maxW: "calc(100% - 16px)", items: "center", justify: "center", flexWrap: "wrap", gap: 6, bg: "var(--surface-overlay)", backdropFilter: "blur(8px)", px: 10, py: 6, rounded: 20, borderWidth: 1, borderColor: "var(--border-strong)", children: [_jsx(Button, { size: "icon", rounded: 9999, variant: cameraOn ? 'default' : 'destructive', "aria-label": t(cameraOn ? 'Turn camera off' : 'Turn camera on'), title: t(cameraOn ? 'Turn camera off' : 'Turn camera on'), onClick: () => setCameraOn(!cameraOn), children: cameraOn ? _jsx(Video, { size: 16 }) : _jsx(VideoOff, { size: 16 }) }), _jsx(Button, { size: "icon", rounded: 9999, variant: micOn ? 'default' : 'destructive', "aria-label": t(micOn ? 'Mute mic' : 'Unmute mic'), title: t(micOn ? 'Mute mic' : 'Unmute mic'), onClick: () => setMicOn(!micOn), children: micOn ? _jsx(Mic, { size: 14, strokeWidth: 1.75 }) : _jsx(MicOff, { size: 14, strokeWidth: 1.75 }) }), _jsx(Button, { size: "sm", rounded: 9999, variant: audioTesting ? 'secondary' : 'default', title: t('Test agent voice and audio output'), onClick: testAudioSpeaker, children: audioTesting ? (_jsxs(_Fragment, { children: [_jsx(AudioWave, { active: true, color: "var(--state-success)" }), t('Testing audio…')] })) : (_jsxs(_Fragment, { children: [_jsx(Volume2, { size: 12, strokeWidth: 1.75 }), t('Test audio')] })) }), _jsxs(Button, { size: "sm", rounded: 9999, variant: botAssisting ? 'secondary' : 'default', "aria-pressed": botAssisting, onClick: () => setBotAssisting(!botAssisting), children: [_jsx(Bot, { size: 13 }), t(botAssisting ? 'AI co-pilot on' : 'AI co-pilot off')] })] })] }), _jsxs(XStack, { p: "$3", gap: "$3", flexWrap: "wrap", items: "center", justify: "space-between", bg: "$panel", children: [_jsx(Text, { fontSize: "$1", color: "$soft", flex: 1, minW: 0, children: t('Readiness: Camera {camera} · Mic {mic} · Audio {audio}', {
|
|
353
|
+
camera: t(cameraOn ? 'active' : 'muted'),
|
|
354
|
+
mic: t(micOn ? 'active' : 'muted'),
|
|
355
|
+
audio: t(audioTesting ? 'testing' : 'ready'),
|
|
356
|
+
}) }), _jsx(Text, { fontSize: "$1", color: "$soft", fontWeight: "500", shrink: 0, children: t('HD 1080p ready') })] })] })] }) }), _jsxs(YStack, { grow: 1, shrink: 1, flexBasis: 380, minW: 0, maxW: "100%", bg: "$panel", borderLeftWidth: 1, borderLeftColor: "$borderColor", p: "$5", "$max-sm": { p: '$4' }, gap: "$5", overflowY: "auto", overflowX: "hidden", "$max-lg": {
|
|
357
|
+
width: '100%',
|
|
358
|
+
grow: 0,
|
|
336
359
|
shrink: 0,
|
|
337
360
|
flexBasis: 'auto',
|
|
338
361
|
borderLeftWidth: 0,
|
|
339
362
|
borderTopWidth: 1,
|
|
340
363
|
borderTopColor: '$borderColor',
|
|
364
|
+
overflowY: 'visible',
|
|
341
365
|
overflowX: 'hidden',
|
|
342
|
-
}, children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: "$
|
|
366
|
+
}, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", flexWrap: "wrap", children: [_jsx(Text, { render: "h2", m: 0, fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Upcoming meetings') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Synced with Calendar') })] }), _jsx(YStack, { gap: "$3", children: meetings.map((m) => (_jsxs(YStack, { bg: "$background", borderWidth: 1, borderColor: "$borderColor", rounded: "$4", p: "$3.5", gap: "$3", children: [_jsxs(YStack, { gap: "$1.5", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", flexWrap: "wrap", children: [_jsx(Text, { fontSize: "$1", fontWeight: "500", bg: "$raised", color: "$ink", px: "$1.5", py: "$0.5", rounded: "$xs", children: t('{date} · {time}', { date: t(m.date), time: m.time }) }), m.botInvited ? (_jsxs(XStack, { items: "center", gap: "$1", children: [_jsx(Bot, { size: 12, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: "$soft", fontWeight: "500", children: t('Agents attending') })] })) : null] }), _jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", lineHeight: "$3", children: t(m.title) }), _jsxs(XStack, { items: "center", gap: "$1.5", flexWrap: "wrap", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: t('Host: {host}', { host: m.hostName ? t(m.host, { name: m.hostName }) : t(m.host) }) }), m.agents && m.agents.length > 0 ? (_jsxs(XStack, { display: "inline-flex", items: "center", gap: "$1", children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: "\u00B7" }), _jsx(Text, { fontSize: "$1", color: "$soft", children: m.agents.join(', ') })] })) : null] })] }), _jsxs(XStack, { gap: "$2", children: [_jsxs(Button, { variant: "outline", borderColor: "var(--border-strong)", size: "sm", flex: 1, minH: 36, "$max-sm": { minH: 44 }, onClick: () => {
|
|
343
367
|
if (m.agents) {
|
|
344
368
|
setInvitedAgents(m.agents);
|
|
345
369
|
if (m.agents[0])
|
|
346
370
|
setActiveCoPilotAgent(m.agents[0]);
|
|
347
371
|
}
|
|
348
372
|
setActiveCall(m.call);
|
|
349
|
-
}, children: [_jsx(Video, { size:
|
|
373
|
+
}, children: [_jsx(Video, { size: 13 }), t('Join call')] }), _jsx(Button, { variant: "outline", borderColor: "var(--border-strong)", size: "icon-sm", minH: 36, minW: 36, "$max-sm": { minH: 44, minW: 44 }, "aria-label": t('Copy invite link'), title: t('Copy invite link'), onClick: () => handleCopyLink(m.call), children: _jsx(Copy, { size: 13 }) })] })] }, m.id))) }), _jsxs(YStack, { mt: "auto", p: "$3.5", bg: "$background", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", gap: "$2", children: [_jsxs(YStack, { gap: "$1", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Calendar, { size: 14, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Need to book a slot?') })] }), _jsx(Text, { fontSize: "$2", color: "$soft", lineHeight: "$3", children: t('Use Hanzo Calendar to coordinate available times across team members and bots.') })] }), _jsx(Button, { asChild: true, variant: "link", size: "sm", px: 0, justify: "flex-start", children: _jsxs("a", { href: "/cal", children: [t('Open calendar scheduler'), _jsx(ArrowRight, { size: 12 })] }) })] })] })] }))] }));
|
|
350
374
|
}
|
|
351
375
|
/** A note's time, as the reader's clock shows it: 4:22 PM, never "4:22:". */
|
|
352
376
|
function clock(locale) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type DropdownMenuProps } from '@hanzo/ui';
|
|
3
|
+
import { type Group } from './lib/betas.js';
|
|
4
|
+
import type { NavEntry } from './Rail.js';
|
|
5
|
+
type T = (key: string, params?: Record<string, string | number>) => string;
|
|
6
|
+
type Heading = 'Workspace' | Group;
|
|
7
|
+
/** The entries under their headings, in ORDER, each keeping the order it came in. */
|
|
8
|
+
export declare function moreGroups(entries: NavEntry[], t: T): {
|
|
9
|
+
key: Heading;
|
|
10
|
+
label: string;
|
|
11
|
+
items: NavEntry[];
|
|
12
|
+
}[];
|
|
13
|
+
export declare function MoreMenu({ entries, onPin, t, trigger, ...rest }: {
|
|
14
|
+
entries: NavEntry[];
|
|
15
|
+
onPin: (id: string) => void;
|
|
16
|
+
t: T;
|
|
17
|
+
trigger: ReactElement;
|
|
18
|
+
} & Pick<DropdownMenuProps, 'placement' | 'minWidth' | 'maxHeight'>): ReactNode;
|
|
19
|
+
export {};
|
package/dist/MoreMenu.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
// The "More" pop-open menu, shared by the desktop sidebar, the folded rail and the phone's menu so they cannot drift:
|
|
4
|
+
// every place under a short heading (Hanzo's own group names from lib/betas), each row with a small pin button for a
|
|
5
|
+
// mouse or finger. The menu never lets Tab reach that button, so the last row, "Pin to sidebar…", opens a page of the
|
|
6
|
+
// same places as ordinary rows, which the arrow keys reach.
|
|
7
|
+
import { Fragment } from 'react';
|
|
8
|
+
import { Check, Pin } from 'lucide-react';
|
|
9
|
+
import { phrase } from '@hanzo/i18n';
|
|
10
|
+
import { Text, XStack } from '@hanzo/gui';
|
|
11
|
+
import { DropdownMenu, DropdownMenuBack, DropdownMenuContent, DropdownMenuItem, DropdownMenuPage, DropdownMenuSection, DropdownMenuSeparator, toast, } from '@hanzo/ui';
|
|
12
|
+
import { GROUPS, HEADING, BETAS } from './lib/betas.js';
|
|
13
|
+
const WORKSPACE = phrase('Workspace');
|
|
14
|
+
/** The built-in places first, then Hanzo's groups in the order betas.ts holds them. */
|
|
15
|
+
const ORDER = ['Workspace', ...GROUPS];
|
|
16
|
+
/** Built-ins are the Workspace; a hosted or beta app files under its own betas.ts group. Team and Marketplace have none (Business: the company and what it sells), Bot is Agents. */
|
|
17
|
+
const EXTERNAL = { 'ext-team': 'Business', 'ext-market': 'Business', 'ext-bots': 'Agents' };
|
|
18
|
+
const headingOf = (id) => EXTERNAL[id] ?? BETAS.find((b) => id === `app-${b.id}` || id === `beta-${b.id}`)?.group ?? 'Workspace';
|
|
19
|
+
/** The entries under their headings, in ORDER, each keeping the order it came in. */
|
|
20
|
+
export function moreGroups(entries, t) {
|
|
21
|
+
return ORDER.map((key) => ({ key, label: t(key === 'Workspace' ? WORKSPACE : HEADING[key]), items: entries.filter((e) => headingOf(e.id) === key) })).filter((g) => g.items.length > 0);
|
|
22
|
+
}
|
|
23
|
+
export function MoreMenu({ entries, onPin, t, trigger, ...rest }) {
|
|
24
|
+
const pinnable = entries.filter((e) => e.pinnable !== false);
|
|
25
|
+
const pin = (item) => {
|
|
26
|
+
onPin(item.id);
|
|
27
|
+
toast.success(t('Pinned {name} to the sidebar', { name: item.label }));
|
|
28
|
+
};
|
|
29
|
+
return (_jsx(DropdownMenu, { trigger: trigger, defaultPage: "main", ...rest, children: _jsxs(DropdownMenuContent, { minW: rest.minWidth ?? 220, maxH: rest.maxHeight, children: [_jsxs(DropdownMenuPage, { id: "main", children: [moreGroups(entries, t).map((g, i) => (_jsxs(Fragment, { children: [i === 0 ? null : _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuSection, { label: g.label, children: g.items.map((item) => (_jsx(DropdownMenuItem, { "data-item": item.id, "aria-current": item.on ? 'page' : undefined, onSelect: item.onPress, actions: item.pinnable === false ? undefined : (_jsx(XStack, { render: "button", "aria-hidden": true, tabIndex: -1, "data-item": `pin-${item.id}`, width: 24, height: 24, items: "center", justify: "center", rounded: 6, cursor: "pointer", hoverStyle: { bg: '$hover' }, onClick: (e) => {
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
pin(item);
|
|
32
|
+
}, children: _jsx(Pin, { size: 14, "aria-hidden": true }) })), children: _jsxs(XStack, { items: "center", gap: 10, flex: 1, children: [_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: item.icon }), _jsx(Text, { fontSize: "$2", flex: 1, children: item.label }), item.on ? _jsx(Check, { size: 14, "aria-hidden": true }) : null] }) }, item.id))) })] }, g.key))), pinnable.length ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { "data-item": "pin-page", page: "pin", children: _jsxs(XStack, { items: "center", gap: 10, flex: 1, children: [_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(Pin, { size: 15, "aria-hidden": true }) }), _jsx(Text, { fontSize: "$2", flex: 1, children: t('Pin to sidebar…') })] }) })] })) : null] }), _jsxs(DropdownMenuPage, { id: "pin", children: [_jsx(DropdownMenuBack, { children: t('Pin to sidebar') }), pinnable.map((item) => (_jsx(DropdownMenuItem, { "data-item": `pin-to-${item.id}`, onSelect: () => pin(item), children: _jsxs(XStack, { items: "center", gap: 10, flex: 1, children: [_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: item.icon }), _jsx(Text, { fontSize: "$2", flex: 1, children: item.label })] }) }, item.id)))] })] }) }));
|
|
33
|
+
}
|
package/dist/NeedMoreUsage.js
CHANGED
|
@@ -53,7 +53,7 @@ export function NeedMoreUsageBanner({ resetsAt, fallbackModel, isUncapped, custo
|
|
|
53
53
|
model: fallbackModel,
|
|
54
54
|
})
|
|
55
55
|
: t("Wait for the reset, or keep working now with usage credits, billed on top of your plan.");
|
|
56
|
-
return (_jsxs(XStack, { "data-slot": "limited-banner", width: "100%", items: "center", justify: "space-between", gap: "$3", px: 16, py: 12, rounded: 12, bg: "var(--card)", borderWidth: 1, borderColor: "var(--border)", flexWrap: "wrap", children: [_jsxs(YStack, { flex: 1, minW: 220, gap: 3, "data-slot": "limited-banner-message", children: [_jsxs(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: "$ink", children: [headlinePrefix, " · ", _jsx(Text, { render: "button", "data-kind": "usage",
|
|
56
|
+
return (_jsxs(XStack, { "data-slot": "limited-banner", width: "100%", items: "center", justify: "space-between", gap: "$3", px: 16, py: 12, rounded: 12, bg: "var(--card)", borderWidth: 1, borderColor: "var(--border)", flexWrap: "wrap", children: [_jsxs(YStack, { flex: 1, minW: 220, gap: 3, "data-slot": "limited-banner-message", children: [_jsxs(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: "$ink", children: [headlinePrefix, " · ", _jsx(Text, { render: _jsx("button", { type: "button" }), "data-kind": "usage", onClick: onSeeUsage, fontSize: 13, lineHeight: 18, fontWeight: "400", color: "$soft", cursor: "pointer", hoverStyle: { color: "$ink" }, textDecorationLine: "underline", bg: "transparent", borderWidth: 0, p: 0, display: "inline", children: t("limits shared with Hanzo Dev") })] }), _jsx(Text, { fontSize: 12.5, lineHeight: 17, color: "$soft", children: subline })] }), _jsx(XStack, { items: "center", gap: "$2", shrink: 0, children: _jsx(Box, { render: _jsx("button", { type: "button" }), "data-slot": "get-more-usage", "data-kind": "topup", onClick: onGetMoreUsage, px: 14, py: 7, minH: 36, "$max-sm": { minH: 44 }, rounded: 8, bg: "var(--secondary)", hoverStyle: { bg: "var(--secondary-hover)" }, borderWidth: 1, borderColor: "var(--border-strong)", cursor: "pointer", items: "center", justify: "center", children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: "$ink", children: t("Get more usage") }) }) })] }));
|
|
57
57
|
}
|
|
58
58
|
export function NeedMoreUsageModal({ open, onClose, resetsAt, onBuyCredits, onSetupTeam, }) {
|
|
59
59
|
const { t } = useI18n();
|
|
@@ -82,5 +82,5 @@ export function NeedMoreUsageModal({ open, onClose, resetsAt, onBuyCredits, onSe
|
|
|
82
82
|
setBusy(false);
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
return (_jsx(Dialog, { open: open, onOpenChange: (v) => (v ? undefined : onClose()), children: _jsxs(DialogContent, { "data-slot": "need-more-usage-modal", showCloseButton: false, width: "calc(100vw - 32px)", maxW: 536, bg: "var(--popover)", rounded: 16, p: 24, gap: 16, borderWidth: 1, borderColor: "var(--border)", boxShadow: "var(--shadow-floating)", children: [_jsxs(XStack, { items: "center", justify: "space-between", width: "100%", children: [_jsx(DialogTitle, { fontSize: 18, lineHeight: 24, fontWeight: "600", color: "$ink", children: t("Need more usage?") }), _jsx(Box, { render: "button", "aria-label": t("Close"), "data-slot": "need-more-usage-close",
|
|
85
|
+
return (_jsx(Dialog, { open: open, onOpenChange: (v) => (v ? undefined : onClose()), children: _jsxs(DialogContent, { "data-slot": "need-more-usage-modal", showCloseButton: false, width: "calc(100vw - 32px)", maxW: 536, bg: "var(--popover)", rounded: 16, p: 24, gap: 16, borderWidth: 1, borderColor: "var(--border)", boxShadow: "var(--shadow-floating)", children: [_jsxs(XStack, { items: "center", justify: "space-between", width: "100%", children: [_jsx(DialogTitle, { fontSize: 18, lineHeight: 24, fontWeight: "600", color: "$ink", children: t("Need more usage?") }), _jsx(Box, { render: _jsx("button", { type: "button" }), "aria-label": t("Close"), "data-slot": "need-more-usage-close", onClick: onClose, width: 32, height: 32, "$max-sm": { minW: 44, minH: 44 }, rounded: 8, bg: "transparent", borderWidth: 0, cursor: "pointer", items: "center", justify: "center", hoverStyle: { bg: "$hover" }, children: _jsx(X, { size: 18, "aria-hidden": true, color: "var(--muted-foreground)" }) })] }), _jsx(Text, { fontSize: 13.5, lineHeight: 19, color: "$soft", mt: -4, children: subtitle }), _jsxs(XStack, { width: "100%", gap: 12, items: "stretch", "$max-sm": { flexDirection: "column" }, children: [_jsxs(YStack, { flex: 1, minW: 0, "$max-sm": { flexBasis: "auto", grow: 0, width: "100%" }, p: 18, rounded: 12, bg: "var(--card)", borderWidth: 1, borderColor: "var(--border)", justify: "space-between", gap: 16, children: [_jsxs(YStack, { gap: 12, children: [_jsx(Box, { width: 44, height: 40, items: "flex-start", justify: "center", children: _jsx(HandCoinMeterIcon, {}) }), _jsxs(YStack, { gap: 6, children: [_jsx(Text, { fontSize: 15, lineHeight: 20, fontWeight: "600", color: "$ink", children: t("Keep working now") }), _jsx(Text, { fontSize: 13, lineHeight: 18.5, color: "$soft", children: keepWorkingBody })] })] }), _jsxs(YStack, { gap: 8, items: "center", width: "100%", pt: 4, children: [_jsx(Box, { render: _jsx("button", { type: "button" }), "data-slot": "buy-usage-credits", onClick: () => void handleBuy(), width: "100%", py: 9, px: 14, minH: 38, "$max-sm": { minH: 44 }, rounded: 8, bg: "var(--secondary)", hoverStyle: { bg: "var(--secondary-hover)" }, borderWidth: 1, borderColor: "var(--border-strong)", cursor: "pointer", items: "center", justify: "center", opacity: busy ? 0.7 : 1, children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "600", color: "$ink", children: busy ? t("Turning on credits…") : t("Buy usage credits") }) }), _jsx(Text, { fontSize: 11.5, lineHeight: 15, color: "$soft", text: "center", children: t("Buying turns on usage credits") })] })] }), _jsxs(YStack, { flex: 1, minW: 0, "$max-sm": { flexBasis: "auto", grow: 0, width: "100%" }, p: 18, rounded: 12, bg: "var(--surface-card-emphasis)", borderWidth: 1, borderColor: "var(--border-selected)", justify: "space-between", gap: 16, children: [_jsxs(YStack, { gap: 12, children: [_jsxs(XStack, { width: "100%", items: "flex-start", justify: "space-between", gap: 8, children: [_jsx(Box, { width: 44, height: 40, items: "flex-start", justify: "center", children: _jsx(TeamTrendIcon, {}) }), _jsx(Box, { px: 10, py: 3, rounded: 999, bg: "var(--primary)", items: "center", justify: "center", children: _jsx(Text, { fontSize: 11.5, lineHeight: 15, fontWeight: "600", color: "var(--primary-foreground)", children: t("Recommended") }) })] }), _jsxs(YStack, { gap: 6, children: [_jsx(Text, { fontSize: 15, lineHeight: 20, fontWeight: "600", color: "$ink", children: t("Bring your team along") }), _jsx(Text, { fontSize: 13, lineHeight: 18.5, color: "$soft", children: t("If Hanzo's this useful to you, share it with your colleagues — work together in shared projects, all on one plan.") })] })] }), _jsx(YStack, { gap: 8, items: "center", width: "100%", pt: 4, pb: 23, children: _jsx(Box, { render: _jsx("button", { type: "button" }), "data-slot": "setup-team-plan", onClick: onSetupTeam, width: "100%", py: 9, px: 14, minH: 38, "$max-sm": { minH: 44 }, rounded: 8, bg: "var(--primary)", hoverStyle: { bg: "var(--primary-hover)" }, borderWidth: 0, cursor: "pointer", items: "center", justify: "center", children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "600", color: "var(--primary-foreground)", children: t("Set up a Team plan") }) }) })] })] })] }) }));
|
|
86
86
|
}
|
package/dist/OrgSwitcher.js
CHANGED
|
@@ -71,8 +71,12 @@ export function OrgSwitcherDropdown({ open, onClose, activeOrgId, onSelect, alig
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
const handleKeyDown = (e) => {
|
|
74
|
-
if (e.key === 'Escape')
|
|
74
|
+
if (e.key === 'Escape') {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
e.stopPropagation();
|
|
75
77
|
onClose();
|
|
78
|
+
queueMicrotask(() => triggerRef?.current?.focus?.());
|
|
79
|
+
}
|
|
76
80
|
};
|
|
77
81
|
document.addEventListener('mousedown', handleClickOutside);
|
|
78
82
|
document.addEventListener('keydown', handleKeyDown);
|
|
@@ -120,7 +124,7 @@ export function TopOrgSelector() {
|
|
|
120
124
|
const face = activeOrg?.logo || activeOrg?.avatar;
|
|
121
125
|
const activeOrgId = activeOrg?.name || activeOrg?.id || currentOrgId || 'hanzo';
|
|
122
126
|
const activeOrgName = activeOrg?.displayName || activeOrg?.name || 'hanzo';
|
|
123
|
-
return (_jsxs(XStack, { position: "relative", display: "inline-flex", items: "center", children: [_jsxs(Button, { ref: buttonRef, size: "sm", variant: open ? 'secondary' : 'default', onClick: () => setOpen((v) => !v), gap: 6, paddingInlineStart: 6, paddingInlineEnd: 8, "aria-label": t('Switch organization'), children: [_jsx(XStack, { width: 20, height: 20, rounded: 9999, bg: "$raised", items: "center", justify: "center", overflow: "hidden", children: face ? (_jsx(View, { render: _jsx("img", { src: face, alt: "", width: 20, height: 20 }), width: "100%", height: "100%", objectFit: "cover" })) : (_jsx(HanzoMark, { size: 13 })) }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", maxW: 140, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", children: activeOrgName }), _jsx(ChevronDown, { size: 13, opacity: 0.65 })] }), _jsx(OrgSwitcherDropdown, { open: open, onClose: () => setOpen(false), activeOrgId: activeOrgId, onSelect: () => setOpen(false), triggerRef: buttonRef })] }));
|
|
127
|
+
return (_jsxs(XStack, { position: "relative", display: "inline-flex", items: "center", children: [_jsxs(Button, { ref: buttonRef, size: "sm", variant: open ? 'secondary' : 'default', onClick: () => setOpen((v) => !v), gap: 6, paddingInlineStart: 6, paddingInlineEnd: 8, "aria-label": t('Switch organization'), "aria-expanded": open, "aria-haspopup": "menu", children: [_jsx(XStack, { width: 20, height: 20, rounded: 9999, bg: "$raised", items: "center", justify: "center", overflow: "hidden", children: face ? (_jsx(View, { render: _jsx("img", { src: face, alt: "", width: 20, height: 20 }), width: "100%", height: "100%", objectFit: "cover" })) : (_jsx(HanzoMark, { size: 13 })) }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", maxW: 140, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", children: activeOrgName }), _jsx(ChevronDown, { size: 13, opacity: 0.65 })] }), _jsx(OrgSwitcherDropdown, { open: open, onClose: () => setOpen(false), activeOrgId: activeOrgId, onSelect: () => setOpen(false), triggerRef: buttonRef })] }));
|
|
124
128
|
}
|
|
125
129
|
/**
|
|
126
130
|
* The organizations as tiles down the far left, as a team chat draws them:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { useI18n } from '@hanzo/i18n/react';
|
|
5
|
-
import { Dialog, DialogContent, DialogTitle,
|
|
5
|
+
import { Dialog, DialogContent, DialogTitle, Text, XStack, YStack } from '@hanzo/ui';
|
|
6
6
|
import { Search, X } from 'lucide-react';
|
|
7
7
|
import { FIRST, SettingsList } from './Settings.js';
|
|
8
8
|
import { SettingsPane } from './SettingsPane.js';
|
|
@@ -21,5 +21,8 @@ export function PreferencesDialog({ open, onOpenChange, initialSection = FIRST,
|
|
|
21
21
|
}
|
|
22
22
|
setActive(row.id);
|
|
23
23
|
};
|
|
24
|
-
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { "data-slot": "preferences-dialog", width: "94vw", maxW: 980, height: "84vh", maxH: 760, p: 0, gap: 0, rounded: 14, overflow: "hidden", bg: "var(--pane-fill, var(--card))", borderWidth: 1, borderColor: "var(--pane-edge, var(--
|
|
24
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { "data-slot": "preferences-dialog", width: "94vw", maxW: 980, height: "84vh", maxH: 760, p: 0, gap: 0, rounded: 14, overflow: "hidden", bg: "var(--pane-fill, var(--card))", borderWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", children: [_jsx(DialogTitle, { display: "none", children: t('Settings') }), _jsxs(XStack, { flex: 1, minH: 0, minW: 0, width: "100%", overflow: "hidden", "$max-md": { flexDirection: 'column' }, children: [_jsxs(YStack, { width: 256, shrink: 0, height: "100%", minW: 0, bg: "var(--side-fill, var(--background))", borderRightWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", "$max-md": { width: '100%', height: 'auto', maxH: '42%', borderRightWidth: 0, borderBottomWidth: 1 }, children: [_jsx(XStack, { px: 12, pt: 12, pb: 8, shrink: 0, children: _jsxs(XStack, { "data-slot": "settings-search", flex: 1, height: 32, px: 10, gap: 8, items: "center", rounded: 8, bg: "var(--surface-card-quiet, var(--card))", borderWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", children: [_jsx(XStack, { "data-slot": "settings-search-icon", width: 14, height: 14, shrink: 0, items: "center", justify: "center", pointerEvents: "none", "aria-hidden": true, children: _jsx(Search, { size: 13, color: "var(--muted-foreground)", "aria-hidden": true }) }), _jsx(Text, { "data-slot": "settings-search-input", render: _jsx("input", { type: "search", value: filter, onChange: (e) => setFilter(e.target.value), onKeyDown: (e) => {
|
|
25
|
+
if (e.key === 'Escape')
|
|
26
|
+
setFilter('');
|
|
27
|
+
}, placeholder: t('Search settings'), "aria-label": t('Search settings') }), flex: 1, minW: 0, width: "100%", height: "100%", p: 0, bg: "transparent", borderWidth: 0, outlineStyle: "none", fontSize: 13, color: "var(--foreground)" }), filter ? (_jsx(XStack, { render: "button", type: 'button', "aria-label": t('Clear search'), onClick: () => setFilter(''), width: 18, height: 18, shrink: 0, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: 'var(--secondary)' }, children: _jsx(X, { size: 11, color: "var(--muted-foreground)", "aria-hidden": true }) })) : null] }) }), _jsx(YStack, { flex: 1, minH: 0, px: 8, pb: 12, overflowY: "auto", overflowX: "hidden", children: _jsx(SettingsList, { active: active, filter: filter, onPick: pick, onBack: () => onOpenChange(false) }) })] }), _jsxs(YStack, { flex: 1, minW: 0, minH: 0, height: "100%", bg: "var(--pane-fill, var(--card))", position: "relative", children: [_jsx(XStack, { position: "absolute", t: 12, r: 14, z: 5, children: _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Close'), onClick: () => onOpenChange(false), width: 32, height: 32, rounded: 999, items: "center", justify: "center", bg: "var(--surface-card-quiet, var(--card))", borderWidth: 1, borderColor: "var(--pane-edge, var(--white-08))", cursor: "pointer", hoverStyle: { bg: 'var(--secondary)' }, children: _jsx(X, { size: 15, color: "var(--foreground)", "aria-hidden": true }) }) }), _jsx(SettingsPane, { id: active })] })] })] }) }));
|
|
25
28
|
}
|