@hanzo/rooms 0.1.37 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/Account.js +18 -9
- package/dist/Chat.js +122 -199
- package/dist/Column.js +16 -15
- package/dist/Directory.d.ts +4 -9
- package/dist/Directory.js +60 -155
- package/dist/Me.js +20 -16
- package/dist/Prose.js +5 -4
- package/dist/RightPane.d.ts +20 -28
- package/dist/RightPane.js +107 -327
- package/dist/Settings.js +42 -28
- package/dist/Shell.js +19 -22
- package/dist/dev.js +42 -26
- package/dist/host.d.ts +5 -9
- package/dist/host.js +5 -6
- package/dist/lib/destination.d.ts +6 -6
- package/dist/lib/destination.js +6 -6
- package/dist/lib/host.d.ts +50 -31
- package/dist/lib/host.js +98 -48
- package/dist/lib/limits.d.ts +13 -9
- package/dist/lib/limits.js +20 -0
- package/dist/lib/plans.d.ts +2 -13
- package/dist/lib/plans.js +2 -19
- package/dist/lib/session.d.ts +9 -12
- package/dist/lib/session.js +7 -19
- package/dist/pane.d.ts +4 -57
- package/dist/pane.js +13 -159
- package/dist/waiting.d.ts +2 -1
- package/dist/waiting.js +3 -2
- package/package.json +3 -5
- package/dist/Billing.d.ts +0 -1
- package/dist/Billing.js +0 -32
- package/dist/enso.d.ts +0 -72
- package/dist/enso.js +0 -112
- package/dist/model.d.ts +0 -4
- package/dist/model.js +0 -44
package/README.md
CHANGED
|
@@ -11,13 +11,13 @@ import { CalScheduler } from '@hanzo/rooms/CalScheduler'
|
|
|
11
11
|
|
|
12
12
|
configure({ site: '', home: '/home', signUp: '/signup' })
|
|
13
13
|
|
|
14
|
-
<Rooms router={router}
|
|
14
|
+
<Rooms router={router} path={pathname} route={route} Link={Link}>
|
|
15
15
|
<Room mode="cal"><CalScheduler /></Room>
|
|
16
16
|
</Rooms>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
`configure()` names the host's addresses (where its own pages live, the
|
|
20
20
|
gateway and IAM, the plan catalogue to paint first). `<Rooms>` carries what
|
|
21
|
-
moves: the router, the
|
|
21
|
+
moves: the router, the path, the route and the link component. The rooms
|
|
22
22
|
import nothing from a host, and their look comes from `@hanzo/appearance` and
|
|
23
23
|
`@hanzo/design` through `@hanzo/ui`.
|
package/dist/Account.js
CHANGED
|
@@ -3,22 +3,28 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
/**
|
|
4
4
|
* WHO YOU ARE, at the foot of the sidebar: the person, and the person's menu.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* the
|
|
6
|
+
* The plan leads it — @hanzo/build's `Meter`, the block every account menu opens
|
|
7
|
+
* with: the plan by its family and its windows as shares, the free allowance on
|
|
8
|
+
* Free, the balance only with no plan. Then profile, appearance, usage, billing,
|
|
9
|
+
* API keys, security and sign out — the account, and nothing that belongs to the
|
|
10
|
+
* workspace. Which workspace you stand in is the switcher at the TOP of the
|
|
11
|
+
* sidebar, and what it may spend is its Billing: a plan never sits beside a
|
|
12
|
+
* balance here.
|
|
11
13
|
*/
|
|
12
|
-
import { useEffect, useRef, useState } from 'react';
|
|
13
|
-
import { Activity, ChevronsUpDown, KeyRound, LogOut, PanelLeftClose, Palette, Shield, UserRound } from 'lucide-react';
|
|
14
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
15
|
+
import { Activity, ChevronsUpDown, CreditCard, KeyRound, LogOut, PanelLeftClose, Palette, Shield, UserRound } from 'lucide-react';
|
|
16
|
+
import { Meter, useStanding } from '@hanzo/build';
|
|
14
17
|
import { XStack, YStack, Text, Box } from '@hanzo/ui';
|
|
15
18
|
import { sheet } from '@hanzo/ui/glass';
|
|
16
19
|
import { useIam } from '@hanzo/iam/react';
|
|
17
20
|
import { useSignOut } from './lib/signout.js';
|
|
18
21
|
import { useAccount } from './lib/account.js';
|
|
19
22
|
import { Face } from './cast.js';
|
|
20
|
-
import { iam } from './lib/api.js';
|
|
23
|
+
import { api, iam } from './lib/api.js';
|
|
24
|
+
import { bearer, org } from './lib/session.js';
|
|
21
25
|
import { link } from './lib/tags.js';
|
|
26
|
+
import { showSettings } from './open.js';
|
|
27
|
+
import { site } from './where.js';
|
|
22
28
|
function Row({ icon, onPress, children, }) {
|
|
23
29
|
return (_jsx(Box, { render: "button", onClick: onPress, width: "100%", px: "$3", py: "$2", rounded: "$2", hoverStyle: { bg: '$hover' }, children: _jsxs(XStack, { items: "center", gap: "$2", children: [icon, _jsx(Text, { fontSize: "$2", color: "$ink", children: children })] }) }));
|
|
24
30
|
}
|
|
@@ -29,6 +35,9 @@ export function Account({ onToggleCollapse, onProfile, onAppearance, onUsage, on
|
|
|
29
35
|
const { user: account } = useAccount();
|
|
30
36
|
const [open, setOpen] = useState(false);
|
|
31
37
|
const holder = useRef(null);
|
|
38
|
+
const scoped = org();
|
|
39
|
+
const target = useMemo(() => ({ api: api(), token: bearer, org: scoped }), [scoped]);
|
|
40
|
+
const plan = useStanding(target, open);
|
|
32
41
|
useEffect(() => {
|
|
33
42
|
if (!open)
|
|
34
43
|
return;
|
|
@@ -55,5 +64,5 @@ export function Account({ onToggleCollapse, onProfile, onAppearance, onUsage, on
|
|
|
55
64
|
// @ts-expect-error — ref is forwarded to the DOM node by the primitive.
|
|
56
65
|
, {
|
|
57
66
|
// @ts-expect-error — ref is forwarded to the DOM node by the primitive.
|
|
58
|
-
ref: holder, position: "relative", borderTopWidth: 1, borderColor: "$borderColor", children: [open ? (_jsxs(YStack, { role: "menu", "aria-label": "Account", position: "absolute", b: "calc(100% + 6px)", l: "$2", r: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", ...sheet(2), py: "$2", gap: "$1", z: "var(--z-modal)", children: [_jsx(Row, { icon: _jsx(UserRound, { size: 15, "aria-hidden": true }), onPress: act(() => (onProfile ? onProfile() : window.location.assign(link(`${iam()}/account`)))), children: "Profile" }), onAppearance ? (_jsx(Row, { icon: _jsx(Palette, { size: 15, "aria-hidden": true }), onPress: act(onAppearance), children: "Appearance" })) : null, onUsage ? (_jsx(Row, { icon: _jsx(Activity, { size: 15, "aria-hidden": true }), onPress: act(onUsage), children: "Usage" })) : null, onKeys ? (_jsx(Row, { icon: _jsx(KeyRound, { size: 15, "aria-hidden": true }), onPress: act(onKeys), children: "API keys" })) : null, _jsx(Row, { icon: _jsx(Shield, { size: 15, "aria-hidden": true }), onPress: act(() => window.location.assign(link(`${iam()}/account/security`))), children: "Security" }), _jsx(Box, { height: 1, bg: "$borderColor", my: "$1" }), _jsx(Row, { icon: _jsx(LogOut, { size: 15, "aria-hidden": true }), onPress: act(() => void logout()), children: "Sign out" })] })) : null, _jsxs(XStack, { items: "center", width: "100%", children: [_jsx(Box, { render: "button", onClick: () => setOpen((v) => !v), "aria-expanded": open, "aria-haspopup": "menu", "aria-label": "Account", flex: 1, minW: 0, px: "$3", py: "$2", hoverStyle: { bg: '$hover' }, children: _jsxs(XStack, { items: "center", gap: "$2", minW: 0, children: [_jsx(Face, { src: face, name: called, size: 22 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$color", numberOfLines: 1, children: called }), email && email !== called ? (_jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: email })) : null] }), _jsx(ChevronsUpDown, { size: 14, "aria-hidden": true })] }) }), onToggleCollapse ? (_jsx(Box, { render: "button", onClick: onToggleCollapse, "aria-label": "Collapse sidebar", p: "$2", mr: "$1.5", rounded: "$2", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(PanelLeftClose, { size: 16, "aria-hidden": true }) })) : null] })] }));
|
|
67
|
+
ref: holder, position: "relative", borderTopWidth: 1, borderColor: "$borderColor", children: [open ? (_jsxs(YStack, { role: "menu", "aria-label": "Account", position: "absolute", b: "calc(100% + 6px)", l: "$2", r: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", ...sheet(2), py: "$2", gap: "$1", z: "var(--z-modal)", children: [_jsx(Meter, { read: plan, onPlans: act(() => window.location.assign(site('/pricing'))), onBilling: act(() => showSettings('billing')) }), _jsx(Box, { height: 1, bg: "$borderColor", my: "$1" }), _jsx(Row, { icon: _jsx(UserRound, { size: 15, "aria-hidden": true }), onPress: act(() => (onProfile ? onProfile() : window.location.assign(link(`${iam()}/account`)))), children: "Profile" }), onAppearance ? (_jsx(Row, { icon: _jsx(Palette, { size: 15, "aria-hidden": true }), onPress: act(onAppearance), children: "Appearance" })) : null, onUsage ? (_jsx(Row, { icon: _jsx(Activity, { size: 15, "aria-hidden": true }), onPress: act(onUsage), children: "Usage" })) : null, _jsx(Row, { icon: _jsx(CreditCard, { size: 15, "aria-hidden": true }), onPress: act(() => showSettings('billing')), children: "Billing" }), onKeys ? (_jsx(Row, { icon: _jsx(KeyRound, { size: 15, "aria-hidden": true }), onPress: act(onKeys), children: "API keys" })) : null, _jsx(Row, { icon: _jsx(Shield, { size: 15, "aria-hidden": true }), onPress: act(() => window.location.assign(link(`${iam()}/account/security`))), children: "Security" }), _jsx(Box, { height: 1, bg: "$borderColor", my: "$1" }), _jsx(Row, { icon: _jsx(LogOut, { size: 15, "aria-hidden": true }), onPress: act(() => void logout()), children: "Sign out" })] })) : null, _jsxs(XStack, { items: "center", width: "100%", children: [_jsx(Box, { render: "button", onClick: () => setOpen((v) => !v), "aria-expanded": open, "aria-haspopup": "menu", "aria-label": "Account", flex: 1, minW: 0, px: "$3", py: "$2", hoverStyle: { bg: '$hover' }, children: _jsxs(XStack, { items: "center", gap: "$2", minW: 0, children: [_jsx(Face, { src: face, name: called, size: 22 }), _jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$color", numberOfLines: 1, children: called }), email && email !== called ? (_jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: email })) : null] }), _jsx(ChevronsUpDown, { size: 14, "aria-hidden": true })] }) }), onToggleCollapse ? (_jsx(Box, { render: "button", onClick: onToggleCollapse, "aria-label": "Collapse sidebar", p: "$2", mr: "$1.5", rounded: "$2", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(PanelLeftClose, { size: 16, "aria-hidden": true }) })) : null] })] }));
|
|
59
68
|
}
|