@hanzo/build 0.2.58 → 0.2.60
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/lib/panel.js +11 -3
- package/lib/prompt.js +1 -1
- package/package.json +1 -1
package/lib/panel.js
CHANGED
|
@@ -22,7 +22,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
22
22
|
*/
|
|
23
23
|
import { SizableText, XStack, YStack } from '@hanzo/gui';
|
|
24
24
|
import { ArrowLeft, ArrowRight, ChevronRight, Columns2, ExternalLink, Globe, Maximize2, Minus, MoreHorizontal, Pin, Plus, RotateCcw, RotateCw, SquarePlus, X } from '@hanzogui/lucide-icons-2';
|
|
25
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from '@hanzo/ui';
|
|
25
|
+
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from '@hanzo/ui';
|
|
26
26
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
27
27
|
import { createPortal } from 'react-dom';
|
|
28
28
|
import { useBrowse, useBrowser } from './host.js';
|
|
@@ -292,9 +292,17 @@ export function Page({ tab, onGo, onBack, onForward, onTitle, onPin, suggested =
|
|
|
292
292
|
} }, tab.id) }), _jsx(Actions, { tab: tab, here: here, frame: frame, framed: framed, same: same, level: level, onLevel: zoomTo, acts: acts, browser: browser, onPin: onPin })] }), !src ? (_jsx(Suggested, { suggested: suggested, onGo: onGo })) : native && Browse ? (_jsx(YStack, { flex: 1, minH: 0, children: _jsx(Browse, { url: src, title: tab.title, onGo: onGo, onTitle: onTitle }) }, round)) : elsewhere ? (_jsx(Elsewhere, { tab: tab })) : picture && !own ? (_jsx(YStack, { flex: 1, minH: 0, items: "center", justify: "center", p: "$3", overflowY: "auto", overflowX: "hidden", children: _jsx("img", { src: src, alt: tab.title, style: { maxWidth: '100%', maxHeight: '100%', objectFit: 'contain', ...(scale ? { transform: scale.transform } : null) } }, round) })) : shows ? (_jsx(YStack, { flex: 1, minH: 0, overflow: "hidden", position: "relative", children: _jsx("iframe", { ref: frame, src: src, title: tab.title, sandbox: local ? 'allow-scripts allow-popups allow-forms' : 'allow-same-origin allow-scripts allow-popups allow-forms allow-modals', style: { position: 'absolute', top: 0, left: 0, border: 0, width: '100%', height: '100%', display: 'block', background: 'var(--background)', ...scale } }, round) })) : (_jsxs(YStack, { flex: 1, items: "center", justify: "center", p: "$5", gap: "$2", children: [_jsx(SizableText, { size: "$2", color: "$soft", children: `${(ext || type || 'This').toUpperCase()} previews aren’t supported yet.` }), _jsx(SizableText, { size: "$2", color: "$soft", children: "Open it in a new window to view it." })] }))] }));
|
|
293
293
|
}
|
|
294
294
|
const DRAG = 'text/x-hanzo-tab';
|
|
295
|
-
/**
|
|
295
|
+
/**
|
|
296
|
+
* One tab in the strip: its mark, its title, and its cross, or its pin when it
|
|
297
|
+
* is pinned. Its own menu (a right press, or a long press on touch) pins it or
|
|
298
|
+
* lets it go, and closes it, whatever kind it is.
|
|
299
|
+
*/
|
|
296
300
|
function Leaf({ tab, on, side, index, label, icon }) {
|
|
297
|
-
return (_jsxs(
|
|
301
|
+
return (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { asChild: true, children: _jsx(Strip, { tab: tab, on: on, side: side, index: index, label: label, icon: icon }) }), _jsxs(ContextMenuContent, { minW: 180, "aria-label": `${label} tab`, children: [_jsx(ContextMenuItem, { onSelect: () => (tab.pinned ? side.unpin(tab.id) : side.pin(tab.id)), children: tab.pinned ? 'Unpin tab' : 'Pin tab' }), _jsx(ContextMenuSeparator, {}), _jsx(ContextMenuItem, { onSelect: () => side.shut(tab.id), children: "Close tab" })] })] }));
|
|
302
|
+
}
|
|
303
|
+
/** The tab itself, as the strip draws it. */
|
|
304
|
+
function Strip({ tab, on, side, index, label, icon, ...rest }) {
|
|
305
|
+
return (_jsxs(XStack, { ...rest, "data-slot": "side-tab", "data-tab": tab.id, items: "center", gap: "$1", pl: "$2.5", pr: "$1", height: 30,
|
|
298
306
|
// As wide as a title wants up to a browser tab's width, sharing the strip
|
|
299
307
|
// as a browser's tabs do when there are many.
|
|
300
308
|
flexBasis: 236, shrink: 1, minW: 56, maxW: 236, rounded: 8, borderWidth: 1, borderColor: on ? '$borderColor' : 'transparent', bg: on ? '$edge' : 'transparent', hoverStyle: { bg: on ? '$edge' : '$hover' }, ...{
|
package/lib/prompt.js
CHANGED
|
@@ -94,7 +94,7 @@ export function Tune({ mind, limits, disabled = false }) {
|
|
|
94
94
|
}
|
|
95
95
|
/** The pill's `+`: files go with the message. Its name on hover. */
|
|
96
96
|
function Attach({ onAttach, disabled }) {
|
|
97
|
-
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { children: _jsx(Control, { type: "button", size: ROUND, "aria-label": "Attach files", "aria-disabled": disabled || undefined, onClick: disabled ? undefined : onAttach, children: _jsx(Plus, { size: 18 }) }) }), _jsx(TooltipContent, { children: _jsx(SizableText, { size: "$2", children: "Attach files" }) })] }));
|
|
97
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Control, { type: "button", size: ROUND, "aria-label": "Attach files", "aria-disabled": disabled || undefined, onClick: disabled ? undefined : onAttach, children: _jsx(Plus, { size: 18 }) }) }), _jsx(TooltipContent, { children: _jsx(SizableText, { size: "$2", children: "Attach files" }) })] }));
|
|
98
98
|
}
|
|
99
99
|
/** @hanzo/ui `Composer` props for the one composer. */
|
|
100
100
|
export function prompt(o) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/build",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.60",
|
|
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.",
|