@hanzo/app 0.2.16 → 0.2.17
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/Me.d.ts +2 -1
- package/dist/Me.js +5 -3
- package/package.json +1 -1
package/dist/Me.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare function Face({ host, size }: {
|
|
|
21
21
|
* plan, Free included, is one to move up from.
|
|
22
22
|
*/
|
|
23
23
|
export declare const upgrade: (family: string | null | undefined) => string;
|
|
24
|
-
export declare function Me({ host, narrow, above, onOrg, }: {
|
|
24
|
+
export declare function Me({ host, narrow, above, onOrg, defaultAccountOpen, }: {
|
|
25
25
|
host: Who;
|
|
26
26
|
/** The rail's: the face alone, the menu opening beside it. */
|
|
27
27
|
narrow?: boolean;
|
|
@@ -32,6 +32,7 @@ export declare function Me({ host, narrow, above, onOrg, }: {
|
|
|
32
32
|
above?: boolean;
|
|
33
33
|
/** Work in another organization: picked, then the app opened in it. */
|
|
34
34
|
onOrg: (org: string) => void;
|
|
35
|
+
defaultAccountOpen?: boolean;
|
|
35
36
|
}): import("react").JSX.Element;
|
|
36
37
|
/**
|
|
37
38
|
* What became of an organization this tab created: nothing to say once the token
|
package/dist/Me.js
CHANGED
|
@@ -142,11 +142,12 @@ const Mark = ({ org }) => (_jsx(XStack, { width: 16, height: 16, rounded: "$2",
|
|
|
142
142
|
export const upgrade = (family) => family === 'Enterprise' ? phrase('Enterprise plan') : family === 'Agency' ? phrase('Agency plan') : phrase('Upgrade plan');
|
|
143
143
|
/** The keys a row prints, in this platform's spelling. */
|
|
144
144
|
const mac = () => typeof navigator !== 'undefined' && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
145
|
-
export function Me({ host, narrow = false, above = false, onOrg, }) {
|
|
145
|
+
export function Me({ host, narrow = false, above = false, onOrg, defaultAccountOpen = false, }) {
|
|
146
146
|
const { t, dir, locale, setLocale } = useI18n();
|
|
147
147
|
const rtl = dir === 'rtl';
|
|
148
148
|
const [open, setOpen] = useState(false);
|
|
149
|
-
const [account, setAccount] = useState(false);
|
|
149
|
+
const [account, setAccount] = useState(defaultAccountOpen ?? false);
|
|
150
|
+
const [orgs, setOrgs] = useState(false);
|
|
150
151
|
const [lang, setLang] = useState(false);
|
|
151
152
|
const [langQuery, setLangQuery] = useState('');
|
|
152
153
|
const [help, setHelp] = useState(false);
|
|
@@ -208,6 +209,7 @@ export function Me({ host, narrow = false, above = false, onOrg, }) {
|
|
|
208
209
|
if (next)
|
|
209
210
|
return;
|
|
210
211
|
setAccount(false);
|
|
212
|
+
setOrgs(false);
|
|
211
213
|
setLang(false);
|
|
212
214
|
setHelp(false);
|
|
213
215
|
},
|
|
@@ -221,7 +223,7 @@ export function Me({ host, narrow = false, above = false, onOrg, }) {
|
|
|
221
223
|
$touchable: narrow ? { width: 44, minH: 44 } : undefined, px: narrow ? 0 : '$2', gap: "$2.5", rounded: narrow ? 999 : '$5', items: "center", justify: narrow ? 'center' : 'flex-start', hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, cursor: "pointer", children: [_jsx(Face, { host: host, size: narrow ? 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) => {
|
|
222
224
|
e?.stopPropagation?.();
|
|
223
225
|
getPro();
|
|
224
|
-
}, 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", 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:
|
|
226
|
+
}, 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(Meter, { read: read, onPlans: () => leave('here'), onBilling: () => (setOpen(false), showSettings('billing')) }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => showSettings('account'), children: _jsx(Line, { icon: _jsx(CircleUserRound, { size: 16, "aria-hidden": true }), children: t('Profile') }) }), _jsx(DropdownMenuItem, { onSelect: () => showSettings('general'), children: _jsx(Line, { icon: _jsx(Palette, { size: 16, "aria-hidden": true }), children: t('Personalization') }) }), _jsx(DropdownMenuItem, { "aria-keyshortcuts": "Control+, Meta+,", onSelect: () => showSettings('general'), children: _jsx(Line, { icon: _jsx(Settings, { size: 16, "aria-hidden": true }), trail: _jsx(DropdownMenuShortcut, { "aria-hidden": true, children: _jsx("bdi", { dir: "ltr", children: apple ? '⌘,' : 'Ctrl+,' }) }), children: t('Settings') }) }), _jsx(DropdownMenuItem, { onSelect: () => window.location.assign(site('/beta')), children: _jsx(Line, { icon: _jsx(FlaskConical, { size: 16, "aria-hidden": true }), children: t('Beta') }) })] })) : null] }), _jsxs(DropdownMenuSub, { open: orgs, onOpenChange: setOrgs, children: [_jsx(DropdownMenuSubTrigger, { "data-slot": "me-orgs", children: _jsx(Line, { icon: _jsx(Mark, { org: here ?? all[0] }), trail: _jsx(Check, { size: 16, "aria-label": t('Current') }), children: t('{org} · {plan}', { org: (here ? (here.personal ? t('Personal') : here.display) : current), plan: planName || t('No plan') }) }) }), orgs ? (_jsxs(DropdownMenuSubContent, { minW: 260, maxW: "calc(100vw - 16px)", pointerEvents: "auto", children: [_jsx(DropdownMenuLabel, { children: t('Organizations') }), all.map((o) => (_jsx(DropdownMenuItem, { onSelect: () => o.name !== current && onOrg(o.name), children: _jsx(Line, { icon: _jsx(Mark, { org: o }), sub: [o.personal ? t('Personal') : said(o.role, t), planFor(o) || (isFree && o.personal ? t('Free') : '')].filter(Boolean).join(' - '), trail: o.name === current ? _jsx(Check, { size: 16, "aria-label": t('Current') }) : null, children: o.display }) }, o.name))), _jsx(DropdownMenuItem, { onSelect: () => setCreating(true), children: _jsx(Line, { icon: _jsx(Plus, { size: 16, "aria-hidden": true }), children: t('Create organization') }) }), _jsx(DropdownMenuItem, { onSelect: () => out(site(settings('organization'))), children: _jsx(Line, { icon: _jsx(Settings, { size: 16, "aria-hidden": true }), children: t('Organization settings') }) }), where().team ? null : here && !here.personal ? (_jsx(DropdownMenuItem, { onSelect: () => out(`${ENTRY}&org=${encodeURIComponent(here.name)}`), children: _jsx(Line, { icon: _jsx(Users, { size: 16, "aria-hidden": true }), trail: _jsx(ArrowUpRight, { size: 14, "aria-hidden": true, opacity: 0.6 }), children: t('Open in Hanzo Team') }) })) : (_jsx(DropdownMenuItem, { onSelect: () => setCreating(true), children: _jsx(Line, { icon: _jsx(Users, { size: 16, "aria-hidden": true }), children: t('Create a team') }) })), superAdmin() ? (_jsx(DropdownMenuItem, { onSelect: choose, children: _jsx(Line, { icon: _jsx(Building2, { size: 16, "aria-hidden": true }), children: t('All organizations') }) })) : null] })) : null] }), _jsx(DropdownMenuItem, { onSelect: () => leave('here'), children: _jsx(Line, { icon: _jsx(Sparkles, { size: 16, "aria-hidden": true }), children: t(plans) }) }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuSub, { open: lang, onOpenChange: (next) => {
|
|
225
227
|
setLang(next);
|
|
226
228
|
if (!next)
|
|
227
229
|
setLangQuery('');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
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",
|