@hanzo/app 0.2.39 → 0.2.41
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/App.js +2 -7
- package/dist/Drawer.d.ts +0 -7
- package/dist/Drawer.js +2 -9
- package/package.json +1 -1
package/dist/App.js
CHANGED
|
@@ -75,7 +75,7 @@ import { Orgs } from './Orgs.js';
|
|
|
75
75
|
import { useRooms } from './host.js';
|
|
76
76
|
import { useKept } from './kept.js';
|
|
77
77
|
import { Mark, raised, Rail, Toggle } from './Rail.js';
|
|
78
|
-
import {
|
|
78
|
+
import { Layer, Lift, RAISED, useDrawer } from './Drawer.js';
|
|
79
79
|
import { empty, openThread, showSettings, useOpen } from './open.js';
|
|
80
80
|
import { Paned } from './Shell.js';
|
|
81
81
|
import { Palette } from './Palette.js';
|
|
@@ -255,11 +255,6 @@ function Window({ bar, betas }) {
|
|
|
255
255
|
const toDev = () => move(last.dev || app(''));
|
|
256
256
|
const toStudio = () => move(last.studio || studio(''));
|
|
257
257
|
const toTabs = () => move(TERMINALS);
|
|
258
|
-
/** The drawer's New chat. */
|
|
259
|
-
const fresh = () => {
|
|
260
|
-
empty();
|
|
261
|
-
move(talk());
|
|
262
|
-
};
|
|
263
258
|
// Another organization: picked, and the app opened in it at the mode's New.
|
|
264
259
|
const org = (o) => {
|
|
265
260
|
pick(o);
|
|
@@ -279,5 +274,5 @@ function Window({ bar, betas }) {
|
|
|
279
274
|
// inline-style: the slide, a transform with no logical form whose sign and distance the drawer writes on the element itself, a drag every frame (Drawer.tsx).
|
|
280
275
|
style: drawer.slide ?? undefined, flex: 1, minW: 0, minH: 0, paddingInlineEnd: "var(--pane-gap)", pb: "var(--pane-gap)",
|
|
281
276
|
// The gap above the pane is the gap at its end and foot; a window's own bar above it is that gap.
|
|
282
|
-
pt: bar ? 0 : 'var(--pane-gap)', "$max-md": { p: 0 }, children: [drawer.slide ? _jsx(Lift, {}) : null, _jsx(YStack, { height: "100%", "$max-md": { display: 'none' }, children: _jsx(Rail, { host: host, mode: mode, at: where, inside: inside, open: !closed, toggle: bar ? undefined : flip, onChat: toChat, onDev: toDev, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }) }), closed || alone ? null : (_jsx(YStack, { "$max-md": { display: 'none' }, children: _jsx(Column, { host: host, mode: mode, thread: thread, go: move, onShut: () => setClosed(true), onSeek: seek, onBack: back, places: sidebar }) })), _jsxs(YStack, { "data-slot": "stage", 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(Top, { host: host, mode: mode, places: sidebar, open: drawer.state !== 'shut', go: move, onMenu: drawer.open, onChat: toChat, onDev: toDev }), _jsx(XStack, { "data-slot": "panes", flex: 1, minW: 0, minH: 0, children: mode === 'chat' ? (_jsx(Paned, { 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 === 'studio' ? (_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 }) }) }) })) : 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 }) })) })) : (_jsx(YStack, { render: "main", "data-slot": "pane", ...(run ? null : { ...pane(), overflow: 'hidden' }), flex: 1, minW: 0, minH: 0, children: plans ? null : _jsx(Builder, { host: host, rail: false }) })) })] })] }), drawer.state === 'shut' ? null : (_jsx(Layer, { drawer: drawer, top: bar ? BAR : 0, children:
|
|
277
|
+
pt: bar ? 0 : 'var(--pane-gap)', "$max-md": { p: 0 }, children: [drawer.slide ? _jsx(Lift, {}) : null, _jsx(YStack, { height: "100%", "$max-md": { display: 'none' }, children: _jsx(Rail, { host: host, mode: mode, at: where, inside: inside, open: !closed, toggle: bar ? undefined : flip, onChat: toChat, onDev: toDev, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }) }), closed || alone ? null : (_jsx(YStack, { "$max-md": { display: 'none' }, children: _jsx(Column, { host: host, mode: mode, thread: thread, go: move, onShut: () => setClosed(true), onSeek: seek, onBack: back, places: sidebar }) })), _jsxs(YStack, { "data-slot": "stage", 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(Top, { host: host, mode: mode, places: sidebar, open: drawer.state !== 'shut', go: move, onMenu: drawer.open, onChat: toChat, onDev: toDev }), _jsx(XStack, { "data-slot": "panes", flex: 1, minW: 0, minH: 0, children: mode === 'chat' ? (_jsx(Paned, { 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 === 'studio' ? (_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 }) }) }) })) : 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 }) })) })) : (_jsx(YStack, { render: "main", "data-slot": "pane", ...(run ? null : { ...pane(), overflow: 'hidden' }), flex: 1, minW: 0, minH: 0, children: plans ? null : _jsx(Builder, { host: host, rail: false }) })) })] })] }), drawer.state === 'shut' ? null : (_jsx(Layer, { drawer: drawer, top: bar ? BAR : 0, children: _jsxs(XStack, { flex: 1, minH: 0, children: [_jsx(YStack, { "data-slot": "drawer-rail", shrink: 0, pt: "$2", children: _jsx(Rail, { host: host, mode: mode, at: where, inside: inside, open: true, onChat: toChat, onDev: toDev, onStudio: toStudio, onTabs: toTabs, go: move, onOrg: org }) }), _jsx(YStack, { flex: 1, minW: 0, children: _jsx(Column, { host: host, mode: mode, thread: thread, go: move, onShut: shut, onSeek: seek, onBack: back, drawer: true, places: sidebar }) })] }) })), finding ? _jsx(Palette, { go: move, onClose: found, mode: mode, host: host }) : null, learning ? _jsx(Learning, { open: true, onClose: () => setLearning(false) }) : null] }) }) }) }));
|
|
283
278
|
}
|
package/dist/Drawer.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
-
import { type Who } from './Me.js';
|
|
3
2
|
import { type State } from './slide.js';
|
|
4
3
|
/** A press that moves the app: told whether it should take the menu's place in history. */
|
|
5
4
|
export type Move = (replace: boolean) => void;
|
|
@@ -53,9 +52,3 @@ export declare function Layer({ drawer, top, children }: {
|
|
|
53
52
|
top?: number;
|
|
54
53
|
children: ReactNode;
|
|
55
54
|
}): import("react").JSX.Element;
|
|
56
|
-
/** The menu's foot: the accent New chat at the start and the account (its menu opens above it) at the end. */
|
|
57
|
-
export declare function Foot({ host, onChat, onOrg }: {
|
|
58
|
-
host: Who;
|
|
59
|
-
onChat: () => void;
|
|
60
|
-
onOrg: (org: string) => void;
|
|
61
|
-
}): import("react").JSX.Element;
|
package/dist/Drawer.js
CHANGED
|
@@ -12,7 +12,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
// │ ✎ New chat │ │ the press that closes (`drawer-close`)
|
|
13
13
|
// │ ◇ Studio ⌨ Tabs ⋯ More │ │
|
|
14
14
|
// │ Pinned … Recents … │ │
|
|
15
|
-
// │
|
|
15
|
+
// │ │ │ the account stands at the rail's foot (Rail.tsx)
|
|
16
16
|
// └──────────────────────────┴────╯
|
|
17
17
|
//
|
|
18
18
|
// Three states, because the slide home has to be seen: shut (no menu, the pane
|
|
@@ -37,10 +37,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
37
37
|
// Its list's scroll stays its own (Recents' `overscrollBehavior`), and the pane,
|
|
38
38
|
// never unmounted, keeps its own.
|
|
39
39
|
import { useI18n } from '@hanzo/i18n/react';
|
|
40
|
-
import {
|
|
41
|
-
import { SquarePen } from 'lucide-react';
|
|
40
|
+
import { YStack, useMedia } from '@hanzo/gui';
|
|
42
41
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
43
|
-
import { Me } from './Me.js';
|
|
44
42
|
import { axis, OPEN, pull, settle, sign } from './slide.js';
|
|
45
43
|
/**
|
|
46
44
|
* The pane's offset as a transform: `--drawer-way` the end side's sign,
|
|
@@ -351,8 +349,3 @@ export function Layer({ drawer, top = 0, children }) {
|
|
|
351
349
|
const { t } = useI18n();
|
|
352
350
|
return (_jsxs(YStack, { ref: drawer.layer, role: "dialog", "aria-modal": true, "aria-label": t('Menu'), tabIndex: -1, "data-slot": "drawer", "data-state": drawer.state, position: "absolute", t: top, b: 0, insetInlineStart: 0, insetInlineEnd: 0, outlineStyle: "none", $md: { display: 'none' }, children: [_jsx(YStack, { "data-slot": "menu", position: "absolute", t: 0, b: 0, insetInlineStart: 0, z: "var(--z-base)", width: OPEN, bg: "var(--pane-floor)", pt: "var(--safe-top)", pb: "max(var(--pane-gap), var(--safe-bottom))", ...{ paddingInlineStart: 'max(var(--safe-left), var(--safe-right))', touchAction: 'pan-y' }, children: children }), drawer.state === 'open' ? (_jsx(YStack, { render: "button", "data-slot": "drawer-close", "aria-label": t('Close sidebar'), onPress: drawer.close, position: "absolute", t: 0, b: 0, insetInlineEnd: 0, z: "var(--z-drawer)", bg: "transparent", borderWidth: 0, cursor: "pointer", ...{ insetInlineStart: OPEN, touchAction: 'none' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' } })) : null] }));
|
|
353
351
|
}
|
|
354
|
-
/** The menu's foot: the accent New chat at the start and the account (its menu opens above it) at the end. */
|
|
355
|
-
export function Foot({ host, onChat, onOrg }) {
|
|
356
|
-
const { t } = useI18n();
|
|
357
|
-
return (_jsxs(XStack, { "data-slot": "drawer-foot", items: "center", justify: "space-between", gap: "$2", pt: "$2", px: "$1", shrink: 0, children: [_jsxs(XStack, { render: "button", "data-slot": "drawer-chat", "aria-label": t('New chat'), onPress: onChat, height: 44, px: "$4.5", gap: "$2", rounded: 9999, items: "center", justify: "center", bg: "var(--accent)", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: 'var(--accent-hover)' }, pressStyle: { bg: 'var(--accent-hover)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, children: [_jsx(SquarePen, { size: 18, color: "var(--accent-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$4", fontWeight: "600", color: "var(--accent-foreground)", children: t('Chat') })] }), _jsx(Me, { host: host, narrow: true, above: true, onOrg: onOrg })] }));
|
|
358
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/app",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.41",
|
|
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",
|