@hanzo/rooms 0.1.40 → 0.1.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/Column.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 app's one column, the same in both modes: the Chat / Dev switch, a filter,
4
4
  // New, Dev's places, the Recents of the mode it is in, and at the foot the
5
5
  // account (components/workspace/Me.tsx).
@@ -7,17 +7,20 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  // Dev's places are @hanzo/build's `nav`, the one list every rail draws, each a
8
8
  // row of its own under a quiet group label: nothing waits behind a More.
9
9
  //
10
+ // Terminals sits under New in both modes. The machines and their sessions live
11
+ // on platform.hanzo.ai, so the row is a link there, in a tab of its own.
12
+ //
10
13
  // It is a pane on the frame's ground (app/_web.tsx), sized by the edge in the
11
14
  // gutter to its right: dragged, keyed or double-clicked back (@hanzo/build's
12
15
  // `Grip`), kept per browser. Pulled in past its floor it collapses to a rail of
13
16
  // marks, kept under the key the builder's rail kept it under, so a reader's
14
17
  // choice outlives the move.
15
18
  import { Text, XStack, YStack } from '@hanzo/gui';
16
- import { PanelLeft, Plus, Search } from 'lucide-react';
19
+ import { PanelLeft, Plus, Search, SquareTerminal } from 'lucide-react';
17
20
  import { Grip, nav, NEW } from '@hanzo/build';
18
21
  import { Sidebar, SidebarIconButton, SidebarItem } from '@hanzo/ui/chat';
19
22
  import { HanzoMark } from '@hanzogui/shell';
20
- import { useId, useState } from 'react';
23
+ import { Fragment, useId, useState } from 'react';
21
24
  import { ModeMark } from './ModeMark.js';
22
25
  import { useKept } from './kept.js';
23
26
  import { Made, Me } from './Me.js';
@@ -27,7 +30,7 @@ import { empty } from './open.js';
27
30
  import { useSpan } from './span.js';
28
31
  import { pane } from './ground.js';
29
32
  import { pick } from './lib/session.js';
30
- import { app, talk } from './lib/host.js';
33
+ import { app, talk, TERMINALS } from './lib/host.js';
31
34
  import { brand } from './where.js';
32
35
  /** The grip stands in the gutter between the column and the pane. gui carries a `calc()` to the page unchanged; its
33
36
  * types only name custom properties. */
@@ -54,6 +57,12 @@ const keys = (press) => ({
54
57
  });
55
58
  /** A row of the column: a pill, lit where the reader is. Compact, so every place fits a laptop's height with Recents under them. */
56
59
  const ROW = { rounded: '$4', minH: 30, py: 0 };
60
+ /** Terminals, a row drawn as a link out: another origin, its own tab, no handle back to this page. */
61
+ const OUT = { 'data-slot': 'app-terminals', role: 'link', render: _jsx("a", { href: TERMINALS, target: "_blank", rel: "noopener noreferrer" }) };
62
+ /** Terminals in the rail, as its mark. */
63
+ const Mark = () => (_jsx(SidebarIconButton, { label: "Terminals", width: 36, height: 32, rounded: 999, ...OUT, children: _jsx(SquareTerminal, { size: 16 }) }));
64
+ /** Terminals in the column, as a row. */
65
+ const Row = () => (_jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, icon: _jsx(SquareTerminal, { size: 16, "aria-hidden": true }), ...OUT, children: "Terminals" }) }));
57
66
  export function Column({ host, mode, thread, onChat, onDev, go, drawer = false, }) {
58
67
  const [kept, setCollapsed] = useKept('hanzo.build.rail', false);
59
68
  const collapsed = kept && !drawer;
@@ -75,15 +84,15 @@ export function Column({ host, mode, thread, onChat, onDev, go, drawer = false,
75
84
  window.location.assign(mode === 'dev' ? app('') : talk());
76
85
  };
77
86
  if (collapsed)
78
- return (_jsx(YStack, { "data-slot": "app-column", "data-collapsed": "", position: "relative", shrink: 0, width: RAIL, "$max-md": { display: 'none' }, children: _jsxs(Sidebar, { "data-slot": "app-rail", "data-collapsed": "true", role: "navigation", "aria-label": brand(), ...pane(), ...FILL, px: "$1.5", py: "$2.5", gap: "$1.5", items: "center", children: [_jsx(SidebarIconButton, { label: "Expand sidebar", onPress: () => setCollapsed(false), width: 36, height: 36, rounded: 999, children: _jsx(PanelLeft, { size: 16 }) }), _jsx(ModeMark, { mode: mode, onChat: onChat, onDev: onDev, stacked: true }), mode === 'chat' ? (_jsx(SidebarIconButton, { label: "New chat", onPress: create, width: 36, height: 36, rounded: 999, children: _jsx(Plus, { size: 16 }) })) : (
87
+ return (_jsx(YStack, { "data-slot": "app-column", "data-collapsed": "", position: "relative", shrink: 0, width: RAIL, "$max-md": { display: 'none' }, children: _jsxs(Sidebar, { "data-slot": "app-rail", "data-collapsed": "true", role: "navigation", "aria-label": brand(), ...pane(), ...FILL, px: "$1.5", py: "$2.5", gap: "$1.5", items: "center", children: [_jsx(SidebarIconButton, { label: "Expand sidebar", onPress: () => setCollapsed(false), width: 36, height: 36, rounded: 999, children: _jsx(PanelLeft, { size: 16 }) }), _jsx(ModeMark, { mode: mode, onChat: onChat, onDev: onDev, stacked: true }), mode === 'chat' ? (_jsxs(_Fragment, { children: [_jsx(SidebarIconButton, { label: "New chat", onPress: create, width: 36, height: 36, rounded: 999, children: _jsx(Plus, { size: 16 }) }), _jsx(Mark, {})] })) : (
79
88
  // Every place, as its mark: collapsed is narrower, never shorter of a destination.
80
- groups.map((g) => (_jsx(YStack, { role: "group", "aria-label": g.label, items: "center", gap: 2, pt: "$1", children: g.links.map((link) => (_jsx(SidebarIconButton, { label: link.label, onPress: () => link.onPress?.(), width: 36, height: 32, rounded: 999, "aria-current": link.active ? 'page' : undefined, children: link.icon }, link.id))) }, g.id)))), _jsx(YStack, { flex: 1 }), _jsx(Me, { host: host, narrow: true, onOrg: org })] }) }));
89
+ groups.map((g) => (_jsx(YStack, { role: "group", "aria-label": g.label, items: "center", gap: 2, pt: "$1", children: g.links.map((link) => (_jsxs(Fragment, { children: [_jsx(SidebarIconButton, { label: link.label, onPress: () => link.onPress?.(), width: 36, height: 32, rounded: 999, "aria-current": link.active ? 'page' : undefined, children: link.icon }), link.id === NEW ? _jsx(Mark, {}) : null] }, link.id))) }, g.id)))), _jsx(YStack, { flex: 1 }), _jsx(Me, { host: host, narrow: true, onOrg: org })] }) }));
81
90
  return (_jsxs(YStack, { "data-slot": "app-column", ref: drawer ? undefined : span.ref,
82
91
  // inline-style: `--span`, the width a drag rewrites on the element itself (span.ts); no prop sets a variable.
83
92
  style: drawer ? undefined : span.style, position: "relative", shrink: 0, height: "100%", width: drawer ? '100%' : 'var(--span)', ...(drawer ? {} : { '$max-md': { display: 'none' } }), children: [_jsxs(Sidebar, { "data-slot": "app-rail", "data-collapsed": "false", role: "navigation", "aria-label": brand(), ...pane(), ...FILL, px: "$2.5", pt: "$3", pb: "$2", gap: "$0", children: [_jsxs(XStack, { "data-slot": "mode-switch", items: "center", gap: "$2", px: "$1.5", pb: "$3", minW: 0, children: [_jsx(HanzoMark, { size: 18 }), _jsx(ModeMark, { mode: mode, onChat: onChat, onDev: onDev })] }), _jsxs(XStack, { "data-slot": "app-filter", items: "center", gap: "$2", px: "$3", height: 36, rounded: 999, borderWidth: 1, borderColor: "$borderColor", bg: "$edge", shrink: 0, children: [_jsx(Search, { size: 15, "aria-hidden": true, color: "var(--soft, var(--muted-foreground))" }), _jsx(Text, { render: _jsx("input", { value: words, onChange: (e) => setWords(e.target.value), onKeyDown: (e) => {
84
93
  if (e.key === 'Escape')
85
94
  setWords('');
86
- }, placeholder: mode === 'chat' ? 'Filter chats' : 'Filter runs', "aria-label": "Filter recents" }), flex: 1, minW: 0, bg: "transparent", borderWidth: 0, outlineStyle: "none", color: "inherit", fontSize: "$2" })] }), mode === 'chat' ? (_jsx(YStack, { role: "list", mt: "$2.5", gap: 2, shrink: 0, children: _jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { "data-slot": "app-new", ...ROW, active: !thread, icon: _jsx(Plus, { size: 16, "aria-hidden": true }), onPress: create, ...keys(create), children: "New chat" }) }) })) : (_jsx(YStack, { "data-slot": "app-places", mt: "$1.5", shrink: 0, children: groups.map((g) => (_jsxs(YStack, { pt: "$1.5", children: [_jsx(Text, { id: `${uid}-${g.id}`, pl: "$2", pb: 2, fontSize: "$1", color: "$soft", fontWeight: "600", textTransform: "uppercase", letterSpacing: 0.6, children: g.label }), _jsx(YStack, { role: "list", "aria-labelledby": `${uid}-${g.id}`, gap: 1, children: g.links.map((link) => (_jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, ...(link.id === NEW ? { 'data-slot': 'app-new' } : {}), active: link.active, icon: link.icon, onPress: link.onPress, ...keys(() => link.onPress?.()), children: link.label }) }, link.id))) })] }, g.id))) })), _jsx(XStack, { height: 1, bg: "$borderColor", mx: "$1.5", mt: "$3", shrink: 0 }), _jsx(Recents, { host: host, mode: mode, thread: thread, words: words, onOpen: open, onNew: create }), _jsxs(YStack, { gap: "$2", pt: "$2", shrink: 0, children: [_jsx(Made, {}), _jsx(Setup, {})] }), _jsxs(XStack, { "data-slot": "app-foot", items: "center", gap: "$1", pt: "$2", shrink: 0, children: [_jsx(YStack, { flex: 1, minW: 0, children: _jsx(Me, { host: host, onOrg: org }) }), drawer ? null : (_jsx(SidebarIconButton, { label: "Collapse sidebar", onPress: () => setCollapsed(true), width: 32, height: 32, rounded: 999, children: _jsx(PanelLeft, { size: 16 }) }))] })] }), drawer ? null : (_jsx(Grip, { side: "left", span: span.span, floor: FLOOR, ceil: CEIL, reset: WIDTH, onSpan: span.move, onKeep: span.keep, onShut: () => setCollapsed(true), label: "Resize sidebar",
95
+ }, placeholder: mode === 'chat' ? 'Filter chats' : 'Filter runs', "aria-label": "Filter recents" }), flex: 1, minW: 0, bg: "transparent", borderWidth: 0, outlineStyle: "none", color: "inherit", fontSize: "$2" })] }), mode === 'chat' ? (_jsxs(YStack, { role: "list", mt: "$2.5", gap: 2, shrink: 0, children: [_jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { "data-slot": "app-new", ...ROW, active: !thread, icon: _jsx(Plus, { size: 16, "aria-hidden": true }), onPress: create, ...keys(create), children: "New chat" }) }), _jsx(Row, {})] })) : (_jsx(YStack, { "data-slot": "app-places", mt: "$1.5", shrink: 0, children: groups.map((g) => (_jsxs(YStack, { pt: "$1.5", children: [_jsx(Text, { id: `${uid}-${g.id}`, pl: "$2", pb: 2, fontSize: "$1", color: "$soft", fontWeight: "600", textTransform: "uppercase", letterSpacing: 0.6, children: g.label }), _jsx(YStack, { role: "list", "aria-labelledby": `${uid}-${g.id}`, gap: 1, children: g.links.map((link) => (_jsxs(Fragment, { children: [_jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, ...(link.id === NEW ? { 'data-slot': 'app-new' } : {}), active: link.active, icon: link.icon, onPress: link.onPress, ...keys(() => link.onPress?.()), children: link.label }) }), link.id === NEW ? _jsx(Row, {}) : null] }, link.id))) })] }, g.id))) })), _jsx(XStack, { height: 1, bg: "$borderColor", mx: "$1.5", mt: "$3", shrink: 0 }), _jsx(Recents, { host: host, mode: mode, thread: thread, words: words, onOpen: open, onNew: create }), _jsxs(YStack, { gap: "$2", pt: "$2", shrink: 0, children: [_jsx(Made, {}), _jsx(Setup, {})] }), _jsxs(XStack, { "data-slot": "app-foot", items: "center", gap: "$1", pt: "$2", shrink: 0, children: [_jsx(YStack, { flex: 1, minW: 0, children: _jsx(Me, { host: host, onOrg: org }) }), drawer ? null : (_jsx(SidebarIconButton, { label: "Collapse sidebar", onPress: () => setCollapsed(true), width: 32, height: 32, rounded: 999, children: _jsx(PanelLeft, { size: 16 }) }))] })] }), drawer ? null : (_jsx(Grip, { side: "left", span: span.span, floor: FLOOR, ceil: CEIL, reset: WIDTH, onSpan: span.move, onKeep: span.keep, onShut: () => setCollapsed(true), label: "Resize sidebar",
87
96
  // In the gutter between the column and the pane, not over the column's own rows.
88
97
  r: GUTTER_END, width: "var(--pane-gap)" }))] }));
89
98
  }
@@ -30,6 +30,8 @@ export declare const ENTRY = "https://hanzo.team/?signin";
30
30
  * team's session has to live.
31
31
  */
32
32
  export declare const START = "https://hanzo.team/start";
33
+ /** Terminals: the machines and their sessions, kept by the platform, opened from the column in a tab of their own. */
34
+ export declare const TERMINALS = "https://platform.hanzo.ai/terminals";
33
35
  /**
34
36
  * THE APP'S ADDRESSES ARE PATHS, in two modes at two roots. Chat is /chat, a
35
37
  * new conversation, and /chat/<id> one of the reader's. Dev is /dev, Dev's New,
package/dist/lib/host.js CHANGED
@@ -33,6 +33,8 @@ export const ENTRY = `${WORKSPACE}/?signin`;
33
33
  * team's session has to live.
34
34
  */
35
35
  export const START = `${WORKSPACE}/start`;
36
+ /** Terminals: the machines and their sessions, kept by the platform, opened from the column in a tab of their own. */
37
+ export const TERMINALS = 'https://platform.hanzo.ai/terminals';
36
38
  /**
37
39
  * THE APP'S ADDRESSES ARE PATHS, in two modes at two roots. Chat is /chat, a
38
40
  * new conversation, and /chat/<id> one of the reader's. Dev is /dev, Dev's New,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/rooms",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "description": "The workspace rooms — Home, Chat, Inbox, Contacts, Meet, Cal, Drive, Board, Work, Bots — and the frame that holds them, once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",