@hanzo/build 0.2.129 → 0.2.130

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.
Files changed (2) hide show
  1. package/lib/project.js +14 -7
  2. package/package.json +1 -1
package/lib/project.js CHANGED
@@ -9,7 +9,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
9
9
  * opened by its slug (Artifacts), and works the same way.
10
10
  *
11
11
  * bar mark · project · history · chat toggle | Preview Files Code Layers |
12
- * Share · Publish
12
+ * Share · Publish; on a phone the views (with Chat) are a row under it
13
13
  * left the project's runs as a conversation, suggestions, and the ask
14
14
  * right the deployed page, framed under its own bar (reload · page · device
15
15
  * · open), and kept loaded while another view is open; the repository
@@ -456,12 +456,19 @@ export function Project({ at }) {
456
456
  }, empty: _jsx(SizableText, { size: "$2", color: "$soft", p: "$4", children: t('Open a file from Files. Code here is read at {ref}; ask in the chat to change it.', { ref }) }) })) : (_jsx(YStack, { p: "$4", gap: "$2", children: picked.length ? (picked.map((p) => (_jsxs(XStack, { items: "center", gap: "$2.5", px: "$3", py: "$2.5", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$panel", children: [_jsx(MousePointerClick, { size: 14, color: "$soft" }), _jsxs(SizableText, { size: "$2", color: "$ink", fontFamily: "$mono", flex: 1, minW: 0, children: [p.label, " \u2014 ", p.id] })] }, p.id)))) : (_jsx(YStack, { p: "$5", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$panel", items: "center", gap: "$2", children: _jsx(SizableText, { size: "$2", color: "$soft", text: "center", children: bridge
457
457
  ? t('Pick an element in the preview to see it here and attach it to your next ask.')
458
458
  : t('Layers are read through the preview bridge, and this page does not run it. Its elements cannot be listed from here.') }) })) }));
459
- return (_jsxs(_Fragment, { children: [_jsxs(Workspace, { start: _jsxs(XStack, { items: "center", gap: "$2", minW: 0, shrink: 1, children: [_jsx(XStack, { render: "button", "aria-label": t('All runs'), onPress: () => host.go(''), p: "$1", shrink: 0, children: _jsx(HanzoMark, { size: 20 }) }), _jsx(ProjectChip, { name: title, onPress: () => setSwitcher(true) }), _jsx(XStack, { render: "button", "aria-label": t('History'), onPress: () => setHistory(true), p: "$1.5", rounded: "$3", shrink: 0, hoverStyle: { bg: '$hover' }, children: _jsx(Clock, { size: 16 }) }), _jsx(XStack, { render: "button", "aria-label": shut ? t('Show the chat') : t('Hide the chat'), "aria-pressed": !shut, onClick: () => (cramped ? setAsked(!asked) : setCollapsed(!collapsed)), minW: 32, minH: 32, items: "center", justify: "center", rounded: "$3", shrink: 0, hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, "$max-md": { display: 'none' }, children: _jsx(PanelLeft, { size: 16 }) })] }), middle: _jsx(Views, { views: [CHAT, ...VIEWS], value: pane === 'chat' && !wide ? 'chat' : view, onChange: (v) => {
460
- if (v === 'chat')
461
- return setPane('chat');
462
- setView(v);
463
- setPane('view');
464
- }, label: t('View') }), end: _jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(XStack, { display: "none", $md: { display: 'flex' }, children: _jsxs(Button, { variant: "outline", size: "sm", onPress: () => void share(), children: [_jsx(Share2, { size: 14 }), " ", t('Share')] }) }), _jsxs(Button, { size: "sm", variant: "primary", "aria-label": t('Publish'), disabled: !clone || !slug, onPress: () => setPublish({ repo: clone, title, ref, name: slug, project: slug }), children: [_jsx(Upload, { size: 14 }), _jsx(SizableText, { size: "$2", color: "inherit", "$max-md": { display: 'none' }, children: t('Publish') })] })] }), chat: chat, dock: _jsx(Console, { lines: lines, height: dock, onHeight: setDock, onClear: () => setPageLines([]), status: run.status || end.status || undefined, label: t('Console') }), collapsed: shut, pane: pane, width: across, onLayout: (e) => setRoom(e.nativeEvent.layout.width), children: [preview, body] }), _jsx(Dialog, { open: history, onOpenChange: setHistory, children: _jsxs(DialogContent, { maxW: 480, children: [_jsx(DialogTitle, { children: t('Runs on {title}', { title }) }), _jsx(YStack, { gap: "$1", children: runs.value.length === 0 ? (_jsx(SizableText, { size: "$2", color: "$soft", children: t('No runs yet.') })) : (runs.value.map((r) => {
459
+ const views = (_jsx(Views, { views: [CHAT, ...VIEWS], value: pane === 'chat' && !wide ? 'chat' : view, onChange: (v) => {
460
+ if (v === 'chat')
461
+ return setPane('chat');
462
+ setView(v);
463
+ setPane('view');
464
+ }, label: t('View') }));
465
+ // On a phone the bar has no room for the views beside the project: there
466
+ // they were a scroller of the bar's leftovers, 49px at 375 beside a project
467
+ // named "Instrument", showing part of Chat and none of Code (hanzo-inc/app#305).
468
+ // So below md they take a row of their own under the bar, in whichever pane
469
+ // shows (one pane at a time there, so one row).
470
+ const row = wide ? null : (_jsx(XStack, { "data-slot": "views-row", justify: "center", px: "$3", pb: "$2", shrink: 0, children: views }));
471
+ return (_jsxs(_Fragment, { children: [_jsxs(Workspace, { start: _jsxs(XStack, { items: "center", gap: "$2", minW: 0, shrink: 1, children: [_jsx(XStack, { render: "button", "aria-label": t('All runs'), onPress: () => host.go(''), p: "$1", shrink: 0, children: _jsx(HanzoMark, { size: 20 }) }), _jsx(ProjectChip, { name: title, onPress: () => setSwitcher(true) }), _jsx(XStack, { render: "button", "aria-label": t('History'), onPress: () => setHistory(true), p: "$1.5", rounded: "$3", shrink: 0, hoverStyle: { bg: '$hover' }, children: _jsx(Clock, { size: 16 }) }), _jsx(XStack, { render: "button", "aria-label": shut ? t('Show the chat') : t('Hide the chat'), "aria-pressed": !shut, onClick: () => (cramped ? setAsked(!asked) : setCollapsed(!collapsed)), minW: 32, minH: 32, items: "center", justify: "center", rounded: "$3", shrink: 0, hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, "$max-md": { display: 'none' }, children: _jsx(PanelLeft, { size: 16 }) })] }), middle: wide ? views : undefined, end: _jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(XStack, { display: "none", $md: { display: 'flex' }, children: _jsxs(Button, { variant: "outline", size: "sm", onPress: () => void share(), children: [_jsx(Share2, { size: 14 }), " ", t('Share')] }) }), _jsxs(Button, { size: "sm", variant: "primary", "aria-label": t('Publish'), disabled: !clone || !slug, onPress: () => setPublish({ repo: clone, title, ref, name: slug, project: slug }), children: [_jsx(Upload, { size: 14 }), _jsx(SizableText, { size: "$2", color: "inherit", "$max-md": { display: 'none' }, children: t('Publish') })] })] }), chat: _jsxs(_Fragment, { children: [row, chat] }), dock: _jsx(Console, { lines: lines, height: dock, onHeight: setDock, onClear: () => setPageLines([]), status: run.status || end.status || undefined, label: t('Console') }), collapsed: shut, pane: pane, width: across, onLayout: (e) => setRoom(e.nativeEvent.layout.width), children: [row, preview, body] }), _jsx(Dialog, { open: history, onOpenChange: setHistory, children: _jsxs(DialogContent, { maxW: 480, children: [_jsx(DialogTitle, { children: t('Runs on {title}', { title }) }), _jsx(YStack, { gap: "$1", children: runs.value.length === 0 ? (_jsx(SizableText, { size: "$2", color: "$soft", children: t('No runs yet.') })) : (runs.value.map((r) => {
465
472
  const active = r.id === current;
466
473
  return (_jsxs(XStack, { render: "button", "aria-current": active ? 'true' : undefined, onPress: () => {
467
474
  setChosen(r.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/build",
3
- "version": "0.2.129",
3
+ "version": "0.2.130",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "description": "Hanzo Build — say what you want, watch it built, deployed and running. The builder as a component, mounted by the Hanzo app at hanzo.ai.",