@hanzo/app 0.3.94 → 0.3.95
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 +113 -47
- 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/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.js +210 -151
- 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 +1 -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.js +18 -13
- package/dist/bots/Thread.js +54 -27
- package/dist/bots/face.js +6 -2
- package/dist/bots/kit.d.ts +1 -0
- package/dist/bots/kit.js +1 -1
- package/dist/chord.d.ts +13 -0
- package/dist/chord.js +30 -1
- package/dist/crew.js +47 -4
- package/dist/ground.d.ts +1 -1
- package/dist/ground.js +1 -1
- 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/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 +6 -0
- package/dist/lib/todo.js +37 -25
- 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/thread.d.ts +2 -1
- package/dist/thread.js +85 -44
- package/package.json +11 -11
package/dist/App.js
CHANGED
|
@@ -71,22 +71,25 @@ import { nav as places } from '@hanzo/studio';
|
|
|
71
71
|
import { useAi } from './lib/ai.js';
|
|
72
72
|
import { Chat } from './Chat.js';
|
|
73
73
|
import { UsageProvider } from './Usage.js';
|
|
74
|
-
import { AnonSettingsPane, Sidebar } from './Sidebar.js';
|
|
74
|
+
import { AnonSettingsPane, dispatchTabsAction, Sidebar } from './Sidebar.js';
|
|
75
75
|
import { Learning } from './Learning.js';
|
|
76
76
|
import { isPlans, leave, useDevHost } from './dev.js';
|
|
77
77
|
import { Gate } from './Gate.js';
|
|
78
78
|
import { useHost } from './host.js';
|
|
79
79
|
import { useKept } from './kept.js';
|
|
80
|
-
import { Mark, raised, Rail, Toggle } from './Rail.js';
|
|
80
|
+
import { Mark, raised, Rail, RAIL_FOLDED, Toggle, usePinnedNav } from './Rail.js';
|
|
81
81
|
import { Layer, Lift, useDrawer } from './Drawer.js';
|
|
82
82
|
import { empty, openThread, showSettings, useOpen } from './open.js';
|
|
83
|
+
import { SkipLink } from './SkipLink.js';
|
|
83
84
|
import { Split } from './Shell.js';
|
|
84
85
|
import { Search } from './Search.js';
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
86
|
+
import { inDialog, typing as isTyping } from './chord.js';
|
|
87
|
+
import { useGlobalKeys } from './keys.js';
|
|
88
|
+
import { BAR, floor, pane } from './ground.js';
|
|
87
89
|
import { org as currentOrg, pick } from './lib/session.js';
|
|
88
|
-
import {
|
|
90
|
+
import { rememberSettingsReturn } from './lib/dev-mode.js';
|
|
89
91
|
import { useFree } from './Upgrade.js';
|
|
92
|
+
import { payUrl } from './lib/pay.js';
|
|
90
93
|
import { Ask, useBetas } from './Betas.js';
|
|
91
94
|
import { BETAS } from './lib/betas.js';
|
|
92
95
|
import { app, design, flow, go, hosted, place, settings, studio, talk, TERMINALS, visit } from './lib/host.js';
|
|
@@ -114,11 +117,6 @@ const Betas = lazy(() => import('./Betas.js').then((m) => ({ default: m.BetasPan
|
|
|
114
117
|
const HOME = { mode: 'chat', thread: null };
|
|
115
118
|
/** Where each mode was last, so the rail goes back to it. */
|
|
116
119
|
const last = { chat: '', dev: '', studio: '', design: '', flow: '', tabs: '' };
|
|
117
|
-
/** Whether a key press is the reader typing, where the app's keys are the field's. */
|
|
118
|
-
const typing = (e) => {
|
|
119
|
-
const el = e.target;
|
|
120
|
-
return !!el && (el.isContentEditable || el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.tagName === 'SELECT');
|
|
121
|
-
};
|
|
122
120
|
export function App({ bar, betas } = {}) {
|
|
123
121
|
return (_jsx(Gate, { children: _jsx(Window, { bar: bar, betas: betas }) }));
|
|
124
122
|
}
|
|
@@ -141,6 +139,10 @@ function Window({ bar, betas }) {
|
|
|
141
139
|
const [learning, setLearning] = useState(false);
|
|
142
140
|
const [anonSettings, setAnonSettings] = useState(false);
|
|
143
141
|
const found = useCallback(() => setFinding(false), []);
|
|
142
|
+
const closedRef = useRef(closed);
|
|
143
|
+
closedRef.current = closed;
|
|
144
|
+
const flip = useCallback(() => setClosed(!closedRef.current), [setClosed]);
|
|
145
|
+
const pins = usePinnedNav();
|
|
144
146
|
const dev = useDevHost();
|
|
145
147
|
useEffect(() => {
|
|
146
148
|
if (typeof window === 'undefined')
|
|
@@ -272,29 +274,33 @@ function Window({ bar, betas }) {
|
|
|
272
274
|
window.dispatchEvent(new CustomEvent('hanzo:anon-settings'));
|
|
273
275
|
return;
|
|
274
276
|
}
|
|
277
|
+
rememberSettingsReturn();
|
|
275
278
|
move(settings(wanted));
|
|
276
279
|
}, [wanted, move, host]);
|
|
277
|
-
// The app's keys.
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
if (mod && !e.shiftKey && !e.altKey && e.key === ',') {
|
|
289
|
-
e.preventDefault();
|
|
290
|
-
if (!host.token?.() && typeof window !== 'undefined') {
|
|
291
|
-
window.dispatchEvent(new CustomEvent('hanzo:anon-settings'));
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
move(settings());
|
|
280
|
+
// The app's keys: the global ones once (keys.ts), and Back and Forward in a window.
|
|
281
|
+
useGlobalKeys({
|
|
282
|
+
find: () => setFinding((open) => !open),
|
|
283
|
+
newChat: () => {
|
|
284
|
+
empty();
|
|
285
|
+
move(talk());
|
|
286
|
+
},
|
|
287
|
+
sidebar: flip,
|
|
288
|
+
settings: () => {
|
|
289
|
+
if (!host.token?.()) {
|
|
290
|
+
window.dispatchEvent(new CustomEvent('hanzo:anon-settings'));
|
|
295
291
|
return;
|
|
296
292
|
}
|
|
297
|
-
|
|
293
|
+
rememberSettingsReturn();
|
|
294
|
+
move(settings('account'));
|
|
295
|
+
},
|
|
296
|
+
chooseTheme: host.chooseTheme,
|
|
297
|
+
say: (message) => void import('@hanzo/ui').then((m) => m.toast?.success(message)),
|
|
298
|
+
});
|
|
299
|
+
useEffect(() => {
|
|
300
|
+
if (!bar)
|
|
301
|
+
return;
|
|
302
|
+
const key = (e) => {
|
|
303
|
+
if (isTyping(e.target) || inDialog(e.target))
|
|
298
304
|
return;
|
|
299
305
|
const back = (e.metaKey && e.key === '[') || (e.altKey && e.key === 'ArrowLeft');
|
|
300
306
|
const forth = (e.metaKey && e.key === ']') || (e.altKey && e.key === 'ArrowRight');
|
|
@@ -308,7 +314,7 @@ function Window({ bar, betas }) {
|
|
|
308
314
|
};
|
|
309
315
|
window.addEventListener('keydown', key);
|
|
310
316
|
return () => window.removeEventListener('keydown', key);
|
|
311
|
-
}, [bar, router
|
|
317
|
+
}, [bar, router]);
|
|
312
318
|
const back = () => move(away.current || app(''));
|
|
313
319
|
const toChat = () => move(last.chat || talk());
|
|
314
320
|
const toDev = () => move(mode === 'dev' && !inPlace ? app('') : last.dev || app(''));
|
|
@@ -325,14 +331,42 @@ function Window({ bar, betas }) {
|
|
|
325
331
|
id: 'learning', label: t('Learning'), active: learning, icon: _jsx(RefreshCw, { size: 16, "aria-hidden": true }),
|
|
326
332
|
onPress: () => { shut(); setLearning(true); },
|
|
327
333
|
}] })) : undefined;
|
|
328
|
-
const flip = () => setClosed(!closed);
|
|
329
334
|
const seek = () => {
|
|
330
335
|
shut();
|
|
331
336
|
setFinding(true);
|
|
332
337
|
};
|
|
333
|
-
return (_jsx(AiProvider, { client: client ?? undefined, children: _jsx(HostProvider, { host: host, children: _jsx(PrefsProvider, { children: _jsx(UsageProvider, { children: _jsxs(YStack, { ref: windowRef, "data-slot": "window", ...floor, flex: 1, minW: 0, height: bar ? '100%' : '100dvh', overflow: "hidden", rounded: bar ? '$3' : undefined, "$max-md": { position: 'fixed', t: TOP, l: 0, r: 0, height: HEIGHT, ...{ overflow: 'clip' } }, children: [_jsxs(XStack, { "data-slot": "title-bar", height: BAR, shrink: 0, items: "center", "$max-md": bar ? undefined : { display: 'none' }, onMouseDown: bar ? dragWindow : undefined, onDoubleClick: bar ? toggleWindowMaximize : undefined, ...(bar?.drag ?? null), children: [_jsxs(XStack, { "data-slot": "title-bar-start", height: "100%", items: "center", gap: 2, pl: (bar?.inset ?? 0) + 4, pr: 6, shrink: 0, width: closed ?
|
|
334
|
-
|
|
335
|
-
|
|
338
|
+
return (_jsx(AiProvider, { client: client ?? undefined, children: _jsx(HostProvider, { host: host, children: _jsx(PrefsProvider, { children: _jsx(UsageProvider, { children: _jsxs(YStack, { ref: windowRef, "data-slot": "window", ...floor, flex: 1, minW: 0, height: bar ? '100%' : '100dvh', overflow: "hidden", rounded: bar ? '$3' : undefined, "$max-md": { position: 'fixed', t: TOP, l: 0, r: 0, height: HEIGHT, ...{ overflow: 'clip' } }, children: [_jsx(SkipLink, {}), _jsxs(XStack, { "data-slot": "title-bar", height: BAR, shrink: 0, items: "center", display: !bar && mode !== 'chat' && mode !== 'dev' ? 'none' : 'flex', "$max-md": bar ? undefined : { display: 'none' }, onMouseDown: bar ? dragWindow : undefined, onDoubleClick: bar ? toggleWindowMaximize : undefined, ...(bar?.drag ?? null), children: [_jsxs(XStack, { "data-slot": "title-bar-start", height: "100%", items: "center", gap: 2, pl: (bar?.inset ?? 0) + 4, pr: 6, shrink: 0, width: closed ? RAIL_FOLDED : 'calc(var(--pane-gap) + var(--app-sidebar-span, 256px))', ...(bar?.drag ?? null), children: [_jsx(XStack, { $md: { display: 'none' }, children: _jsx(Toggle, { open: drawer.state === 'open', onPress: drawer.open, label: t('Open sidebar') }) }), bar ? (_jsxs(_Fragment, { children: [_jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Toggle, { open: !closed, onPress: flip }) }), _jsx(Mark, { label: t('Back'), "data-slot": "back", onPress: () => router.back(), children: _jsx(ArrowLeft, { size: 15, "aria-hidden": true, "data-i18n-mirror": true }) }), _jsx(Mark, { label: t('Forward'), "data-slot": "forward", onPress: () => router.forward(), children: _jsx(ArrowRight, { size: 15, "aria-hidden": true, "data-i18n-mirror": true }) })] })) : null] }), _jsxs(XStack, { id: "hanzo-titlebar-slot", "data-slot": "title-bar-main", flex: 1, minW: 0, self: "stretch", items: "center", justify: "space-between", pl: 14, pr: 8, gap: 6, ...(bar?.drag ?? null), children: [_jsx(XStack, { "data-slot": "titlebar-fallback", flex: 1, minW: 0, items: "center", justify: "space-between", gap: 8, children: _jsx(Text, { fontSize: "$2", fontWeight: "500", color: "$ink", numberOfLines: 1, children: bar
|
|
339
|
+
? mode === 'chat'
|
|
340
|
+
? ''
|
|
341
|
+
: mode === 'dev'
|
|
342
|
+
? 'Dev'
|
|
343
|
+
: mode === 'studio'
|
|
344
|
+
? 'Studio'
|
|
345
|
+
: mode === 'design'
|
|
346
|
+
? 'Design'
|
|
347
|
+
: mode === 'flow'
|
|
348
|
+
? 'Flow'
|
|
349
|
+
: mode === 'tabs'
|
|
350
|
+
? 'Tabs'
|
|
351
|
+
: ''
|
|
352
|
+
: '' }) }), bar ? (bar.controls !== undefined ? (bar.controls) : !bar.inset ? (_jsx(WindowControls, {})) : null) : null] })] }), _jsxs(XStack, { ref: drawer.pane, "data-app": mode, "data-slot": "frame", bg: "transparent", ...drawer.slide, flex: 1, minW: 0, minH: 0, paddingInlineEnd: "var(--pane-gap)", pb: "var(--pane-gap)",
|
|
353
|
+
// The gap above the pane is only needed when the top title-bar row is hidden.
|
|
354
|
+
pt: bar || mode === 'chat' || mode === 'dev' ? 0 : 'var(--pane-gap)', "$max-md": { p: 0 }, children: [drawer.slide ? _jsx(Lift, {}) : null, _jsxs(YStack, { height: "100%", position: "relative", display: closed ? 'flex' : 'none', "$max-md": { display: 'none' }, children: [_jsx(Rail, { pins: pins, host: host, mode: mode, at: where, inside: inside, open: !closed, onOpen: bar ? undefined : () => setClosed(false), onNew: () => {
|
|
355
|
+
if (mode === 'dev')
|
|
356
|
+
move(app(''));
|
|
357
|
+
else if (mode === 'design')
|
|
358
|
+
move(design(''));
|
|
359
|
+
else if (mode === 'studio')
|
|
360
|
+
move(studio(''));
|
|
361
|
+
else if (mode === 'flow')
|
|
362
|
+
move(flow(''));
|
|
363
|
+
else if (mode === 'tabs')
|
|
364
|
+
dispatchTabsAction({ kind: 'shell' });
|
|
365
|
+
else {
|
|
366
|
+
empty();
|
|
367
|
+
move(talk());
|
|
368
|
+
}
|
|
369
|
+
}, onChat: toChat, onDev: toDev, onDesign: toDesign, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }), closed ? (_jsx(YStack, { "data-slot": "sidebar-reopen-edge", position: "absolute", t: 0, b: 0, r: -4, width: 8, z: "var(--z-raised)", cursor: "ew-resize", onDoubleClick: () => setClosed(false), onMouseDown: (down) => {
|
|
336
370
|
const e = down;
|
|
337
371
|
const startX = e.clientX ?? 0;
|
|
338
372
|
const onMove = (mv) => {
|
|
@@ -348,19 +382,19 @@ function Window({ bar, betas }) {
|
|
|
348
382
|
};
|
|
349
383
|
window.addEventListener('mousemove', onMove);
|
|
350
384
|
window.addEventListener('mouseup', onUp);
|
|
351
|
-
} })) : null] }), closed || alone ? null : (_jsx(YStack, { "$max-md": { display: 'none' }, children: _jsx(Sidebar, { host: host, mode: mode, thread: thread, go: move, onShut: () => setClosed(true), onSeek: seek, onBack: back, places: sidebar, made: maker }) })), _jsxs(YStack, { "data-slot": "stage",
|
|
385
|
+
} })) : null] }), closed || alone ? null : (_jsx(YStack, { marginInlineStart: "var(--pane-gap)", "$max-md": { display: 'none' }, children: _jsx(Sidebar, { pins: pins, host: host, mode: mode, thread: thread, inside: inside, go: move, onShut: bar ? undefined : () => setClosed(true), onSeek: seek, onBack: back, onChat: toChat, onDev: toDev, onDesign: toDesign, onStudio: toStudio, onTabs: toTabs, onOrg: org, places: sidebar, made: maker }) })), _jsxs(YStack, { "data-slot": "stage",
|
|
352
386
|
// A column: the phone's bar, then the panes taking the rest. Not a grid of `auto` and
|
|
353
387
|
// `1fr` rows: from md the bar is display none, which leaves the grid, so the panes were
|
|
354
388
|
// placed in the `auto` row and stood their content's height, and Dev's pane, which
|
|
355
389
|
// scrolls inside, collapsed to its border (Projects drew blank). The rest of the row
|
|
356
390
|
// beside the rail and the sidebar, never width 100%: a View does not shrink, so at the
|
|
357
391
|
// row's full width again the pane stood past the window's edge.
|
|
358
|
-
flex: 1, minW: 0, minH: 0, marginInlineStart: closed || alone ? 0 : 'var(--pane-gap)', "$max-md": { marginInlineStart: 0, pb: `max(var(--pane-gap), ${FOOT})` }, children: [bar ? null : _jsx(Bar, { host: host, mode: mode, places: sidebar, open: drawer.state !== 'shut', go: move, onMenu: drawer.open }), _jsx(XStack, { "data-slot": "panes", flex: 1, display: "grid", gridTemplateAreas: '"pane side"', gridTemplateColumns: "minmax(0, 1fr) auto", gridTemplateRows: "minmax(0, 1fr)", minW: 0, minH: 0, children: anonSettings && host.person === null ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(AnonSettingsPane, { host: host, onClose: () => {
|
|
392
|
+
flex: 1, minW: 0, minH: 0, marginInlineStart: closed || alone ? 0 : 'var(--pane-gap)', "$max-md": { marginInlineStart: 0, pb: `max(var(--pane-gap), ${FOOT})` }, children: [bar ? null : _jsx(Bar, { host: host, mode: mode, places: sidebar, open: drawer.state !== 'shut', go: move, onMenu: drawer.open }), _jsx(XStack, { "data-slot": "panes", flex: 1, display: "grid", gridTemplateAreas: '"pane side"', gridTemplateColumns: "minmax(0, 1fr) auto", gridTemplateRows: "minmax(0, 1fr)", minW: 0, minH: 0, children: anonSettings && host.person === null ? (_jsx(YStack, { id: "main-content", tabIndex: -1, render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(AnonSettingsPane, { host: host, onClose: () => {
|
|
359
393
|
setAnonSettings(false);
|
|
360
394
|
if (typeof window !== 'undefined') {
|
|
361
395
|
window.dispatchEvent(new CustomEvent('hanzo:anon-settings', { detail: { open: false } }));
|
|
362
396
|
}
|
|
363
|
-
} }) })) : mode === 'chat' ? (_jsx(Split, { framed: true, children: _jsx(Chat, {}) })) : mode === 'tabs' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(Suspense, { fallback: null, children: _jsx(Terminals, {}) }) })) : mode === 'design' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(YStack, { flex: 1, minH: 0, height: "100%", children: _jsx(Suspense, { fallback: null, children: _jsx(Studio, { host: maker, rail: false }) }) }) })) : mode === 'flow' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: blockedBeta ? (_jsx(YStack, { "data-slot": "hosted-request", flex: 1, minH: 0, items: "center", justify: "center", p: "$6", children: _jsxs(YStack, { width: "100%", maxW: 440, gap: "$4", children: [_jsxs(XStack, { items: "center", gap: "$3", children: [_jsx(XStack, { width: 44, height: 44, rounded: "$4", bg: "$hover", items: "center", justify: "center", shrink: 0, children: _jsx(Workflow, { size: 22, "aria-hidden": true }) }), _jsxs(YStack, { gap: 2, minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Text, { fontSize: "$6", fontWeight: "600", color: "$ink", children: "Flow" }), _jsx(Text, { fontSize: "$1", color: "$quiet", px: "$2", py: 2, rounded: "$2", bg: "$hover", children: t('Beta') })] }), _jsx(Text, { fontSize: "$3", color: "$quiet", children: BETAS.find((b) => b.id === 'flow')?.line ?? 'Visual workflows and multi-agent pipelines.' })] })] }), _jsxs(XStack, { items: "center", gap: "$2", pt: "$1", children: [_jsx(Ask, { beta: BETAS.find((b) => b.id === 'flow'), go: move }), _jsx(Button, { variant: "ghost", size: "sm", onPress: () => move('/beta'), children: t('All betas') })] })] }) })) : (_jsx(YStack, { flex: 1, minH: 0, height: "100%", children: _jsx(Suspense, { fallback: null, children: _jsx(FlowStudio, { host: maker }) }) })) })) : mode === 'studio' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: blockedBeta ? (_jsx(YStack, { "data-slot": "hosted-request", flex: 1, minH: 0, items: "center", justify: "center", p: "$6", children: _jsxs(YStack, { width: "100%", maxW: 440, gap: "$4", children: [_jsxs(XStack, { items: "center", gap: "$3", children: [_jsx(XStack, { width: 44, height: 44, rounded: "$4", bg: "$hover", items: "center", justify: "center", shrink: 0, children: _jsx(Clapperboard, { size: 22, "aria-hidden": true }) }), _jsxs(YStack, { gap: 2, minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Text, { fontSize: "$6", fontWeight: "600", color: "$ink", children: "Studio" }), _jsx(Text, { fontSize: "$1", color: "$quiet", px: "$2", py: 2, rounded: "$2", bg: "$hover", children: t('Beta') })] }), _jsx(Text, { fontSize: "$3", color: "$quiet", children: BETAS.find((b) => b.id === 'studio')?.line ?? 'Director Studio for AI film, video, and creative production.' })] })] }), _jsxs(XStack, { items: "center", gap: "$2", pt: "$1", children: [_jsx(Ask, { beta: BETAS.find((b) => b.id === 'studio'), go: move }), _jsx(Button, { variant: "ghost", size: "sm", onPress: () => move('/beta'), children: t('All betas') })] })] }) })) : (_jsx(YStack, { flex: 1, minH: 0, height: "100%", children: _jsx(Suspense, { fallback: null, children: _jsx(DirectorStudio, { host: maker }) }) })) })) : at.mode === 'hosted' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(Suspense, { fallback: null, children: _jsx(Hosted, { id: at.id, go: move }) }) })) : mode === 'beta' ? (_jsx(YStack, { render: "main", "data-slot": "pane", ...pane(), overflowY: "auto", overflowX: "hidden", flex: 1, minW: 0, minH: 0, p: "$4", $md: { p: '$6' }, children: betas ?? (_jsx(Suspense, { fallback: null, children: _jsx(Betas, { go: move }) })) })) : (_jsxs(YStack, { render: "main", "data-slot": "pane", ...(run ? null : { ...pane(), overflow: 'hidden' }), position: "relative", flex: 1, minW: 0, minH: 0, children: [!plans && !run && !inPlace && closed && free && host.person !== null ? (_jsx(XStack, { position: "absolute", t: 8, r: 12, z:
|
|
397
|
+
} }) })) : mode === 'chat' ? (_jsx(Split, { framed: true, children: _jsx(Chat, {}) })) : mode === 'tabs' ? (_jsx(YStack, { id: "main-content", tabIndex: -1, render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(Suspense, { fallback: null, children: _jsx(Terminals, {}) }) })) : mode === 'design' ? (_jsx(YStack, { id: "main-content", tabIndex: -1, render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(YStack, { flex: 1, minH: 0, height: "100%", children: _jsx(Suspense, { fallback: null, children: _jsx(Studio, { host: maker, rail: false }) }) }) })) : mode === 'flow' ? (_jsx(YStack, { id: "main-content", tabIndex: -1, render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: blockedBeta ? (_jsx(YStack, { "data-slot": "hosted-request", flex: 1, minH: 0, items: "center", justify: "center", p: "$6", children: _jsxs(YStack, { width: "100%", maxW: 440, gap: "$4", children: [_jsxs(XStack, { items: "center", gap: "$3", children: [_jsx(XStack, { width: 44, height: 44, rounded: "$4", bg: "$hover", items: "center", justify: "center", shrink: 0, children: _jsx(Workflow, { size: 22, "aria-hidden": true }) }), _jsxs(YStack, { gap: 2, minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Text, { fontSize: "$6", fontWeight: "600", color: "$ink", children: "Flow" }), _jsx(Text, { fontSize: "$1", color: "$quiet", px: "$2", py: 2, rounded: "$2", bg: "$hover", children: t('Beta') })] }), _jsx(Text, { fontSize: "$3", color: "$quiet", children: BETAS.find((b) => b.id === 'flow')?.line ?? 'Visual workflows and multi-agent pipelines.' })] })] }), _jsxs(XStack, { items: "center", gap: "$2", pt: "$1", children: [_jsx(Ask, { beta: BETAS.find((b) => b.id === 'flow'), go: move }), _jsx(Button, { variant: "ghost", size: "sm", onPress: () => move('/beta'), children: t('All betas') })] })] }) })) : (_jsx(YStack, { flex: 1, minH: 0, height: "100%", children: _jsx(Suspense, { fallback: null, children: _jsx(FlowStudio, { host: maker }) }) })) })) : mode === 'studio' ? (_jsx(YStack, { id: "main-content", tabIndex: -1, render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: blockedBeta ? (_jsx(YStack, { "data-slot": "hosted-request", flex: 1, minH: 0, items: "center", justify: "center", p: "$6", children: _jsxs(YStack, { width: "100%", maxW: 440, gap: "$4", children: [_jsxs(XStack, { items: "center", gap: "$3", children: [_jsx(XStack, { width: 44, height: 44, rounded: "$4", bg: "$hover", items: "center", justify: "center", shrink: 0, children: _jsx(Clapperboard, { size: 22, "aria-hidden": true }) }), _jsxs(YStack, { gap: 2, minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Text, { fontSize: "$6", fontWeight: "600", color: "$ink", children: "Studio" }), _jsx(Text, { fontSize: "$1", color: "$quiet", px: "$2", py: 2, rounded: "$2", bg: "$hover", children: t('Beta') })] }), _jsx(Text, { fontSize: "$3", color: "$quiet", children: BETAS.find((b) => b.id === 'studio')?.line ?? 'Director Studio for AI film, video, and creative production.' })] })] }), _jsxs(XStack, { items: "center", gap: "$2", pt: "$1", children: [_jsx(Ask, { beta: BETAS.find((b) => b.id === 'studio'), go: move }), _jsx(Button, { variant: "ghost", size: "sm", onPress: () => move('/beta'), children: t('All betas') })] })] }) })) : (_jsx(YStack, { flex: 1, minH: 0, height: "100%", children: _jsx(Suspense, { fallback: null, children: _jsx(DirectorStudio, { host: maker }) }) })) })) : at.mode === 'hosted' ? (_jsx(YStack, { id: "main-content", tabIndex: -1, render: "main", "data-slot": "pane", ...pane(), overflow: "hidden", flex: 1, minW: 0, minH: 0, children: _jsx(Suspense, { fallback: null, children: _jsx(Hosted, { id: at.id, go: move }) }) })) : mode === 'beta' ? (_jsx(YStack, { id: "main-content", tabIndex: -1, render: "main", "data-slot": "pane", ...pane(), overflowY: "auto", overflowX: "hidden", flex: 1, minW: 0, minH: 0, p: "$4", $md: { p: '$6' }, children: betas ?? (_jsx(Suspense, { fallback: null, children: _jsx(Betas, { go: move }) })) })) : (_jsxs(YStack, { id: "main-content", tabIndex: -1, render: "main", "data-slot": "pane", ...(run ? null : { ...pane(), overflow: 'hidden' }), position: "relative", flex: 1, minW: 0, minH: 0, children: [!plans && !run && !inPlace && closed && free && host.person !== null ? (_jsx(XStack, { position: "absolute", t: 8, r: 12, z: "var(--z-raised)", items: "center", "$max-md": { display: 'none' }, children: _jsxs(XStack, { render: "button", "data-slot": "header-upgrade", "aria-label": t('Upgrade plan'), items: "center", gap: "$1.5", px: "$2", py: "$1", rounded: "$3", bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, onClick: () => window.location.assign(payUrl('/cart', { org: currentOrg(), returnUrl: window.location.href })), children: [_jsx(Sparkles, { size: 14, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$3", fontWeight: "500", color: "$soft", numberOfLines: 1, children: t('Upgrade plan') })] }) })) : null, plans ? null : _jsx(Builder, { host: host, rail: false })] })) })] })] }), drawer.state === 'shut' ? null : (_jsx(Layer, { drawer: drawer, top: bar ? BAR : 0, children: _jsx(XStack, { flex: 1, minH: 0, children: _jsx(YStack, { flex: 1, minW: 0, children: _jsx(Sidebar, { pins: pins, host: host, mode: mode, thread: thread, inside: inside, go: move, onShut: shut, onSeek: seek, onBack: back, onChat: toChat, onDev: toDev, onDesign: toDesign, onStudio: toStudio, onTabs: toTabs, onOrg: org, drawer: true, places: sidebar, made: maker }) }) }) })), finding ? _jsx(Search, { go: move, onClose: found, mode: mode, host: host }) : null, learning ? _jsx(Learning, { open: true, onClose: () => setLearning(false) }) : null, _jsx(AppContextMenu, { host: host, mode: mode, closed: closed, onToggleSidebar: flip, onSeek: seek, onNewChat: () => {
|
|
364
398
|
empty();
|
|
365
399
|
move(talk());
|
|
366
400
|
}, go: move })] }) }) }) }) }));
|
package/dist/Bar.js
CHANGED
|
@@ -37,7 +37,7 @@ const GLASS = {
|
|
|
37
37
|
};
|
|
38
38
|
/** A round glass button named for what it does (`label`, already in the reader's language). */
|
|
39
39
|
function Round({ label, onPress, opacity, pointerEvents, children, ...rest }) {
|
|
40
|
-
return (_jsx(XStack, { render: "button", "aria-label": label,
|
|
40
|
+
return (_jsx(XStack, { render: _jsx("button", { type: "button" }), "aria-label": label, onClick: onPress, ...GLASS, width: ROUND, height: ROUND, items: "center", justify: "center", shrink: 0, cursor: "pointer", opacity: opacity, pointerEvents: pointerEvents, pressStyle: { bg: '$raised', scale: 0.96 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, ...rest, children: children }));
|
|
41
41
|
}
|
|
42
42
|
/** The drawer's mark: two strokes, the lower one shorter and flush with the start, 15×9. */
|
|
43
43
|
function Lines() {
|
package/dist/Betas.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare function Ask({ beta, go }: {
|
|
|
19
19
|
beta: Beta;
|
|
20
20
|
go?: (href: string) => void;
|
|
21
21
|
}): import("react").JSX.Element;
|
|
22
|
-
/** Every app in beta, by group, each with
|
|
22
|
+
/** Every app in beta, by group, each rendered as a responsive 2-column desktop / 1-column mobile card with status indicator. */
|
|
23
23
|
export declare function BetasList({ go }: {
|
|
24
24
|
go?: (href: string) => void;
|
|
25
25
|
}): import("react").JSX.Element;
|
package/dist/Betas.js
CHANGED
|
@@ -23,27 +23,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
23
23
|
// cannot leak an unfinished app.
|
|
24
24
|
import { useCallback, useEffect, useState, useSyncExternalStore } from 'react';
|
|
25
25
|
import { ArrowUpRight, Compass, FlaskConical } from 'lucide-react';
|
|
26
|
-
import { phrase } from '@hanzo/i18n';
|
|
27
26
|
import { useI18n } from '@hanzo/i18n/react';
|
|
28
27
|
import { useIam } from '@hanzo/iam/react';
|
|
29
28
|
import { Button, Dialog, DialogContent, DialogTitle, Text, XStack, YStack } from '@hanzo/ui';
|
|
30
29
|
import { api } from './lib/api.js';
|
|
31
|
-
import { BETAS, GROUPS, opens } from './lib/betas.js';
|
|
30
|
+
import { BETAS, GROUPS, HEADING, opens } from './lib/betas.js';
|
|
32
31
|
import { useHydrated } from './lib/hydrated.js';
|
|
33
32
|
import { bearer, scope, superAdmin } from './lib/session.js';
|
|
34
33
|
import { hosted } from './lib/host.js';
|
|
35
34
|
import { CHANGED, optin } from './lib/optin.js';
|
|
36
35
|
const NONE = { flags: {}, asked: [], public: [], blocked: false };
|
|
37
|
-
/** A group's heading as the list draws it: authored English, drawn through `t`. */
|
|
38
|
-
const HEADING = {
|
|
39
|
-
Business: phrase('Business'),
|
|
40
|
-
Data: phrase('Data'),
|
|
41
|
-
Agents: phrase('Agents'),
|
|
42
|
-
'Build & run': phrase('Build & run'),
|
|
43
|
-
Security: phrase('Security'),
|
|
44
|
-
Creative: phrase('Creative'),
|
|
45
|
-
Models: phrase('Models'),
|
|
46
|
-
};
|
|
47
36
|
/** One read per token, shared by every caller on the page. */
|
|
48
37
|
let held = null;
|
|
49
38
|
let reading = null;
|
|
@@ -144,35 +133,40 @@ export function Ask({ beta, go }) {
|
|
|
144
133
|
const [wrong, setWrong] = useState(null);
|
|
145
134
|
if (open(beta.id)) {
|
|
146
135
|
const to = beta.embed !== undefined ? hosted(beta.id) : beta.href;
|
|
147
|
-
return to && go ? (_jsx(Button, { size: "sm", rounded:
|
|
136
|
+
return to && go ? (_jsx(Button, { size: "sm", variant: "secondary", rounded: "$3", minH: 36, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, onPress: () => go(to), "data-slot": "beta-open", children: t('Open') })) : (_jsxs(XStack, { items: "center", gap: "$1.5", px: "$2.5", py: "$1", rounded: 999, bg: "$raised", borderWidth: 1, borderColor: "$edge", "data-slot": "beta-on", children: [_jsx(YStack, { width: 7, height: 7, rounded: 999, bg: "var(--state-online)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "500", color: "$ink", children: t('You’re in') })] }));
|
|
148
137
|
}
|
|
149
138
|
if (promoted(beta.id)) {
|
|
150
|
-
return (_jsx(Text, { fontSize: "$
|
|
139
|
+
return (_jsx(Text, { fontSize: "$1", color: "$soft", "data-slot": "beta-optin", children: t(blocked ? 'Turned off by your organization' : 'Turn on experimental features in Settings') }));
|
|
151
140
|
}
|
|
152
141
|
if (asked(beta.id)) {
|
|
153
|
-
return (
|
|
142
|
+
return (_jsxs(XStack, { items: "center", gap: "$1.5", px: "$2.5", py: "$1", rounded: 999, bg: "$raised", borderWidth: 1, borderColor: "$edge", "data-slot": "beta-requested", children: [_jsx(YStack, { width: 6, height: 6, rounded: 999, bg: "$soft", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "500", color: "$aside", children: t('Requested') })] }));
|
|
154
143
|
}
|
|
155
|
-
return (_jsxs(YStack, { items: "flex-
|
|
144
|
+
return (_jsxs(YStack, { items: "flex-start", gap: "$1", children: [_jsx(Button, { size: "sm", rounded: "$3", minH: 36, variant: "outline", borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, disabled: busy, "data-slot": "beta-request", onPress: () => {
|
|
156
145
|
setBusy(true);
|
|
157
146
|
setWrong(null);
|
|
158
147
|
request([beta.id])
|
|
159
148
|
.catch((e) => setWrong(e instanceof Error ? e.message : String(e)))
|
|
160
149
|
.finally(() => setBusy(false));
|
|
161
|
-
}, children: t(busy ? 'Requesting…' : 'Request access') }), wrong ? (_jsx(Text, { fontSize: "$1", color: "
|
|
150
|
+
}, children: t(busy ? 'Requesting…' : 'Request access') }), wrong ? (_jsx(Text, { role: "alert", fontSize: "$1", color: "var(--state-error)", children: wrong })) : null] }));
|
|
162
151
|
}
|
|
163
|
-
/** Every app in beta, by group, each with
|
|
152
|
+
/** Every app in beta, by group, each rendered as a responsive 2-column desktop / 1-column mobile card with status indicator. */
|
|
164
153
|
export function BetasList({ go }) {
|
|
165
154
|
const { t } = useI18n();
|
|
166
|
-
const { promoted } = useBetas();
|
|
167
|
-
return (_jsx(YStack, { gap: "$
|
|
155
|
+
const { open, asked, promoted } = useBetas();
|
|
156
|
+
return (_jsx(YStack, { gap: "$6", minW: 0, "data-slot": "betas", children: GROUPS.map((group) => (_jsxs(YStack, { gap: "$3", minW: 0, children: [_jsx(Text, { render: "h2", m: 0, fontSize: "$4", fontWeight: "600", color: "$ink", children: t(HEADING[group]) }), _jsx(XStack, { display: "grid", gridTemplateColumns: "repeat(2, minmax(0, 1fr))", "$max-sm": { gridTemplateColumns: 'minmax(0, 1fr)' }, gap: "$3", minW: 0, children: BETAS.filter((b) => b.group === group).map((b) => {
|
|
157
|
+
const isOpen = open(b.id);
|
|
158
|
+
const isPublic = promoted(b.id);
|
|
159
|
+
const isAsked = asked(b.id);
|
|
160
|
+
return (_jsxs(YStack, { "data-beta": b.id, p: "$4", rounded: "$5", bg: "$panel", borderWidth: 1, borderColor: "$edge", gap: "$4", justify: "space-between", minW: 0, transition: "quickest", hoverStyle: { bg: '$hover', borderColor: 'var(--border-strong)' }, children: [_jsxs(YStack, { gap: "$1.5", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$2", flexWrap: "wrap", children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [_jsx(YStack, { width: 7, height: 7, rounded: 999, shrink: 0, bg: isOpen ? 'var(--state-online)' : isAsked ? '$aside' : '$edge', "aria-hidden": true }), _jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", numberOfLines: 1, children: b.name })] }), isPublic ? (_jsx(XStack, { px: "$2", py: "$0.5", rounded: 999, bg: "$raised", borderWidth: 1, borderColor: "$edge", "data-slot": "beta-public", children: _jsx(Text, { fontSize: "$1", fontWeight: "500", color: "$aside", children: t('Public beta') }) })) : null] }), _jsx(Text, { fontSize: "$2", color: "$soft", lineHeight: "$3", children: t(b.line) })] }), _jsx(XStack, { items: "center", justify: "flex-end", flexWrap: "wrap", gap: "$2", children: _jsx(Ask, { beta: b, go: go }) })] }, b.id));
|
|
161
|
+
}) })] }, group))) }));
|
|
168
162
|
}
|
|
169
163
|
/** The Betas list in a dialog, from the rail's More. */
|
|
170
164
|
export function BetasDialog({ open, onOpenChange, go }) {
|
|
171
165
|
const { t } = useI18n();
|
|
172
|
-
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { maxW:
|
|
166
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { maxW: 680, width: "calc(100vw - 24px)", rounded: "$6", gap: "$4", children: [_jsxs(YStack, { gap: "$1.5", children: [_jsx(DialogTitle, { children: t('Betas') }), _jsx(Text, { fontSize: "$2", color: "$soft", lineHeight: "$3", maxW: 540, children: t('Apps we have not opened to everyone yet. Ask for the ones you want and we will let you in.') })] }), _jsx(YStack, { maxH: "62vh", overflowY: "auto", overflowX: "hidden", paddingInlineEnd: "$1", children: _jsx(BetasList, { go: go }) }), _jsxs(XStack, { items: "center", justify: "space-between", pt: "$3", borderTopWidth: 1, borderColor: "$edge", flexWrap: "wrap", gap: "$3", children: [_jsx(Text, { fontSize: "$2", color: "$soft", children: t('Looking for community plugins and MCP tools?') }), _jsx(Button, { size: "sm", variant: "outline", rounded: "$3", minH: 36, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, onPress: () => window.open('https://hanzo.market', '_blank', 'noopener,noreferrer'), children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Compass, { size: 14, "aria-hidden": true }), _jsx(Text, { fontSize: "$2", color: "$ink", children: t('Explore on hanzo.market') }), _jsx(ArrowUpRight, { size: 13, "aria-hidden": true })] }) })] })] }) }));
|
|
173
167
|
}
|
|
174
168
|
/** The Betas view rendered inside the app's main pane under /beta. */
|
|
175
169
|
export function BetasPane({ go }) {
|
|
176
170
|
const { t } = useI18n();
|
|
177
|
-
return (_jsxs(YStack, { flex: 1, minH: 0, maxW:
|
|
171
|
+
return (_jsxs(YStack, { flex: 1, minH: 0, minW: 0, maxW: 960, mx: "auto", width: "100%", px: "$4", pt: "$6", pb: "$9", "$max-sm": { px: '$3', pt: '$4', pb: '$7' }, gap: "$6", children: [_jsxs(YStack, { gap: "$1.5", maxW: 600, children: [_jsxs(XStack, { items: "center", gap: "$2.5", children: [_jsx(FlaskConical, { size: 20, color: "var(--foreground)", "aria-hidden": true }), _jsx(Text, { render: "h1", m: 0, fontSize: "$7", lineHeight: "$8", fontWeight: "600", letterSpacing: -0.42, color: "$ink", children: t('Ecosystem betas & early access') })] }), _jsx(Text, { fontSize: "$3", color: "$soft", lineHeight: "$4", children: t('Preview upcoming releases, manage early access requests for your account, and explore models and developer tools.') })] }), _jsx(BetasList, { go: go })] }));
|
|
178
172
|
}
|