@hanzo/app 0.3.77 → 0.3.79
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.js +3 -2
- package/dist/App.js +2 -2
- package/dist/Rail.d.ts +2 -3
- package/dist/Rail.js +7 -8
- package/dist/ground.d.ts +2 -0
- package/dist/ground.js +2 -0
- package/package.json +1 -1
package/dist/Account.js
CHANGED
|
@@ -52,6 +52,7 @@ import { leave } from './dev.js';
|
|
|
52
52
|
import { payUrl } from './lib/pay.js';
|
|
53
53
|
import { asked, KEYS, legal, out, pages } from './help.js';
|
|
54
54
|
import { showSettings } from './open.js';
|
|
55
|
+
import { MARK } from './ground.js';
|
|
55
56
|
import { site, where } from './where.js';
|
|
56
57
|
import { BAD } from './lib/mix.js';
|
|
57
58
|
/** An organization this tab created, until the token carries it. */
|
|
@@ -288,9 +289,9 @@ export function Account({ host, narrow = false, above = false, onOrg, defaultAcc
|
|
|
288
289
|
// Clear of the rail's mark (or the row) it opens from, and flush with its foot.
|
|
289
290
|
offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { ref: (el) => {
|
|
290
291
|
row.current = el instanceof HTMLElement ? el : null;
|
|
291
|
-
}, render: "button", "data-slot": "me", "aria-label": t('Account: {name}', { name: [who, current].filter(Boolean).join(' · ') }), width: narrow ? (above ? 44 :
|
|
292
|
+
}, render: "button", "data-slot": "me", "aria-label": t('Account: {name}', { name: [who, current].filter(Boolean).join(' · ') }), width: narrow ? (above ? 44 : MARK) : '100%', height: narrow ? (above ? 44 : MARK) : undefined, minH: narrow ? (above ? 44 : MARK) : 48,
|
|
292
293
|
// A thumb's 44 on a touch screen.
|
|
293
|
-
$touchable: narrow ? { width: 44, minH: 44 } : undefined, px: narrow ? 0 : '$2', gap: "$2.5", rounded: narrow ?
|
|
294
|
+
$touchable: narrow ? { width: 44, height: 44, minH: 44 } : undefined, px: narrow ? 0 : '$2', gap: "$2.5", rounded: narrow ? 12 : '$5', borderWidth: narrow && above ? 1 : 0, borderColor: narrow && above ? 'var(--border-strong)' : undefined, bg: narrow && above ? 'var(--pane-fill)' : narrow && open ? '$edge' : 'transparent', items: "center", justify: narrow ? 'center' : 'flex-start', hoverStyle: { bg: narrow && open ? '$edge' : '$hover' }, pressStyle: { bg: '$raised' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, cursor: "pointer", children: [_jsx(Face, { host: host, size: narrow ? (above ? 32 : 26) : 32 }), narrow ? null : (_jsxs(_Fragment, { children: [_jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(SizableText, { size: "$3", fontWeight: "600", color: "$ink", numberOfLines: 1, text: "start", children: who }), working ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, text: "start", children: working })) : null] }), isFree ? (_jsx(Button, { size: "xs", variant: "outline", "data-slot": "me-upgrade", px: "$2", py: "$0.5", rounded: "$3", onPress: (e) => {
|
|
294
295
|
e?.stopPropagation?.();
|
|
295
296
|
getPro();
|
|
296
297
|
}, cursor: "pointer", children: t('Upgrade plan') })) : null, _jsx(ChevronsUpDown, { size: 14, "aria-hidden": true, opacity: 0.6 })] }))] }) }), _jsxs(DropdownMenuContent, { minW: 260, maxW: "calc(100vw - 16px)", "aria-labelledby": undefined, "aria-label": t('Account'), onCloseAutoFocus: back, children: [_jsxs(DropdownMenuSub, { open: account, onOpenChange: setAccount, children: [_jsxs(DropdownMenuSubTrigger, { minH: 48, gap: "$2.5", "data-slot": "me-account", children: [_jsx(Face, { host: host, size: 28 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: who }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, children: host.person.email || working })] })] }), account ? (_jsxs(DropdownMenuSubContent, { minW: 240, maxW: "calc(100vw - 16px)", pointerEvents: "auto", children: [_jsx(YStack, { cursor: "pointer", rounded: "$3", hoverStyle: { bg: '$hover' }, onPress: () => {
|
package/dist/App.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
// The web app as the whole window, in three modes: Chat, a conversation with
|
|
4
4
|
// the product's AI; Dev, @hanzo/build's `<Builder>` without a rail of its own;
|
|
5
5
|
// and Studio, @hanzo/studio's `<Studio>` the same way, its places (`nav`) in the
|
|
@@ -330,7 +330,7 @@ function Window({ bar, betas }) {
|
|
|
330
330
|
shut();
|
|
331
331
|
setFinding(true);
|
|
332
332
|
};
|
|
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 ? RAIL : `calc(${RAIL}px + var(--app-sidebar-span, ${SIDE}px))`, ...(bar?.drag ?? null), children: [_jsx(XStack, { $md: { display: 'none' }, children: _jsx(Toggle, { open: drawer.state === 'open', onPress: drawer.open, label: t('Open sidebar') }) }), _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 }) })] }), _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: 10, 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: 13, lineHeight: 18, fontWeight: "500", color: "$ink", numberOfLines: 1, children: mode === 'chat' ? '' : mode === 'dev' ? 'Dev' : mode === 'studio' ? 'Studio' : mode === 'design' ? 'Design' : mode === 'flow' ? 'Flow' : mode === 'tabs' ? 'Tabs' : '' }) }), 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)",
|
|
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 ? RAIL : `calc(${RAIL}px + var(--app-sidebar-span, ${SIDE}px))`, ...(bar?.drag ?? null), children: [_jsx(XStack, { $md: { display: 'none' }, children: _jsx(Toggle, { open: drawer.state === 'open', onPress: drawer.open, label: t('Open sidebar') }) }), _jsx(XStack, { "$max-md": { display: 'none' }, children: _jsx(Toggle, { open: !closed, onPress: flip }) }), bar ? (_jsxs(_Fragment, { children: [_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: 10, 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: 13, lineHeight: 18, fontWeight: "500", color: "$ink", numberOfLines: 1, children: mode === 'chat' ? '' : mode === 'dev' ? 'Dev' : mode === 'studio' ? 'Studio' : mode === 'design' ? 'Design' : mode === 'flow' ? 'Flow' : mode === 'tabs' ? 'Tabs' : '' }) }), 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)",
|
|
334
334
|
// The gap above the pane is the gap at its end and foot; a window's own bar above it is that gap.
|
|
335
335
|
pt: bar ? 0 : 'var(--pane-gap)', "$max-md": { p: 0 }, children: [drawer.slide ? _jsx(Lift, {}) : null, _jsxs(YStack, { height: "100%", position: "relative", "$max-md": { display: 'none' }, children: [_jsx(Rail, { host: host, mode: mode, at: where, inside: inside, open: !closed, 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: 20, cursor: "ew-resize", onDoubleClick: () => setClosed(false), onMouseDown: (down) => {
|
|
336
336
|
const e = down;
|
package/dist/Rail.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type Host } from '@hanzo/build';
|
|
3
|
+
import { MARK } from './ground.js';
|
|
3
4
|
import { type Place } from './lib/host.js';
|
|
4
|
-
|
|
5
|
-
/** A mark, px: a 40px rounded square on the rail's 56px. */
|
|
6
|
-
export declare const MARK = 40;
|
|
5
|
+
export { MARK };
|
|
7
6
|
/** The places the rail holds beside the products, by the builder address each opens. */
|
|
8
7
|
export declare const RAISED: {
|
|
9
8
|
readonly library: '-/artifacts';
|
package/dist/Rail.js
CHANGED
|
@@ -47,11 +47,9 @@ import { out } from './help.js';
|
|
|
47
47
|
import { BETAS } from './lib/betas.js';
|
|
48
48
|
import { HOSTED_APPS } from './lib/hosted.js';
|
|
49
49
|
import { Account } from './Account.js';
|
|
50
|
-
import { HEAD, RAIL, TOUCH_HEAD } from './ground.js';
|
|
50
|
+
import { HEAD, MARK, RAIL, TOUCH_HEAD } from './ground.js';
|
|
51
51
|
import { app, hosted, WORKSPACE } from './lib/host.js';
|
|
52
|
-
|
|
53
|
-
/** A mark, px: a 40px rounded square on the rail's 56px. */
|
|
54
|
-
export const MARK = 40;
|
|
52
|
+
export { MARK };
|
|
55
53
|
/** A mark on a touch screen, px: a thumb's 44. */
|
|
56
54
|
const TOUCH = 44;
|
|
57
55
|
/** The places the rail holds beside the products, by the builder address each opens. */
|
|
@@ -128,13 +126,14 @@ export function Rail({ host, mode, at, open, toggle, inside = null, rows = false
|
|
|
128
126
|
return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t('Products'), width: RAIL, flex: 1,
|
|
129
127
|
// As tall as the window and no taller: its marks scroll inside it (below), never the page.
|
|
130
128
|
minH: 0,
|
|
131
|
-
// The first mark stands at the pane's top edge, one head row high (HEAD), and the last at its foot
|
|
132
|
-
//
|
|
133
|
-
|
|
129
|
+
// The first mark stands at the pane's top edge, one head row high (HEAD), and the last at its foot:
|
|
130
|
+
// the frame and drawer already leave `--pane-gap` below, so pb=0 aligns the account hover box symmetrically
|
|
131
|
+
// with the inner pane's bottom corner.
|
|
132
|
+
pt: (HEAD - MARK) / 2 + 2, pb: 0, gap: 3, shrink: 0, items: "center", $touchable: { pt: (TOUCH_HEAD - TOUCH) / 2, pb: 0 }, children: [toggle ? (_jsx(YStack, { children: _jsx(Toggle, { open: open, onPress: toggle }) })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", items: "center", gap: 4, width: "100%", "$platform-web": { scrollbarWidth: 'none' }, children: [_jsx(Mark, { label: t('Chat'), on: mode === 'chat', onPress: onChat, "data-slot": "rail-chat", children: _jsx(MARKS.chat.icon, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Dev", on: mode === 'dev' && !here, onPress: onDev, "data-slot": "rail-dev", children: _jsx(MARKS.dev.icon, { size: 18, "aria-hidden": true }) }), anon ? null : (_jsx(Mark, { label: "Design", on: mode === 'design', onPress: onDesign, "data-slot": "rail-design", children: _jsx(MARKS.design.icon, { size: 18, "aria-hidden": true }) })), !anon && opened('studio') ? (_jsx(Mark, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "rail-studio", children: _jsx(MARKS.studio.icon, { size: 18, "aria-hidden": true }) })) : null, anon ? null : (_jsx(Mark, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "rail-tabs", children: _jsx(MARKS.tabs.icon, { size: 18, "aria-hidden": true }) })), apps.map((a) => (_jsx(Mark, { label: a.name, on: inside === a.id, onPress: () => go(hosted(a.id)), "data-slot": `rail-app-${a.id}`, children: _jsx(a.icon, { size: 18, "aria-hidden": true }) }, a.id))), _jsx(Mark, { label: t('Library'), on: here === 'library', onPress: to(RAISED.library), "data-slot": "rail-library", children: _jsx(MARKS.library.icon, { size: 18, "aria-hidden": true }) }), anon ? null : (_jsx(Mark, { label: t('Scheduled tasks'), on: here === 'scheduled', onPress: to(RAISED.scheduled), "data-slot": "rail-scheduled", children: _jsx(MARKS.scheduled.icon, { size: 18, "aria-hidden": true }) })), anon ? null : (_jsx(Mark, { label: t('Customize'), on: here === 'customize', onPress: to(RAISED.customize), "data-slot": "rail-customize", children: _jsx(MARKS.customize.icon, { size: 18, "aria-hidden": true }) })), anon ? null : (_jsx(Mark, { label: t('Betas'), on: mode === 'beta', onPress: () => go('/beta'), "data-slot": "rail-betas", children: _jsx(FlaskConical, { size: 18, "aria-hidden": true }) })), betasDialog, !anon && rest.length ? (_jsx(DropdownMenu
|
|
134
133
|
// Toward the content: right of the rail, left of it right to left.
|
|
135
134
|
, {
|
|
136
135
|
// Toward the content: right of the rail, left of it right to left.
|
|
137
|
-
placement: dir === 'rtl' ? 'left-start' : 'right-start', minWidth: 220, trigger: _jsx(XStack, { render: "button", "aria-label": t('More'), ...{ title: t('More') }, "data-slot": "rail-more", width: MARK, height: MARK, rounded:
|
|
136
|
+
placement: dir === 'rtl' ? 'left-start' : 'right-start', minWidth: 220, trigger: _jsx(XStack, { render: "button", "aria-label": t('More'), ...{ title: t('More') }, "data-slot": "rail-more", width: MARK, height: MARK, rounded: 12, items: "center", justify: "center", cursor: "pointer", opacity: 0.62, hoverStyle: { bg: '$hover', opacity: 1 }, pressStyle: { bg: '$raised' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, $touchable: { width: 44, height: 44 }, children: _jsx(Ellipsis, { size: 18, "aria-hidden": true }) }), items: rest })) : null] }), anon ? (_jsxs(YStack, { gap: 4, items: "center", children: [_jsx(Mark, { label: t('See plans and pricing'), "data-slot": "anon-pricing", onPress: () => {
|
|
138
137
|
if (typeof window !== 'undefined')
|
|
139
138
|
window.location.assign('/pricing');
|
|
140
139
|
}, children: _jsx(Sparkles, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Help'), "data-slot": "anon-help", onPress: () => {
|
package/dist/ground.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export declare const BAND = 52;
|
|
|
34
34
|
*/
|
|
35
35
|
export declare const HEAD = 40;
|
|
36
36
|
export declare const TOUCH_HEAD = 44;
|
|
37
|
+
/** A mark on the rail, px: a 40px rounded square leaving `--pane-gap` (4px) on each side of the 48px rail. */
|
|
38
|
+
export declare const MARK = 40;
|
|
37
39
|
/**
|
|
38
40
|
* A corner mark's centre from its edge, px: the rail's first mark from the
|
|
39
41
|
* window's start edge (the rail is twice this wide), and the pane head's last
|
package/dist/ground.js
CHANGED
|
@@ -34,6 +34,8 @@ export const BAND = 52;
|
|
|
34
34
|
*/
|
|
35
35
|
export const HEAD = 40;
|
|
36
36
|
export const TOUCH_HEAD = 44;
|
|
37
|
+
/** A mark on the rail, px: a 40px rounded square leaving `--pane-gap` (4px) on each side of the 48px rail. */
|
|
38
|
+
export const MARK = 40;
|
|
37
39
|
/**
|
|
38
40
|
* A corner mark's centre from its edge, px: the rail's first mark from the
|
|
39
41
|
* window's start edge (the rail is twice this wide), and the pane head's last
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.79",
|
|
4
4
|
"description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|