@hanzo/studio 0.1.6 → 0.1.8

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/talk.js +11 -8
  2. package/package.json +7 -5
package/lib/talk.js CHANGED
@@ -2,14 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  * A CONVERSATION and its tabs: the chat that makes things on the left, every
4
4
  * thing it made in a tab on the right. The same two panes as a Dev run, from
5
- * the same parts: @hanzo/ui's `Chat` for the thread and its composer (built by
6
- * @hanzo/build's `prompt`), and @hanzo/build's `Panel` over a `Deck` for the
5
+ * the same parts: @hanzo/ui's `Chat` for the thread and its composer (the one
6
+ * composer, handed Studio's pills), and @hanzo/build's `Panel` over a `Deck` for the
7
7
  * tabs, scoped to this conversation so its tabs are kept with it.
8
8
  *
9
9
  * A new conversation has no id in the address until its first message is sent;
10
10
  * then the address names it, and the conversation in hand is the one shown.
11
11
  */
12
- import { Gutter, Panel, PanelToggle, prompt, Reply, SideProvider, useDeck, useKey, usePanel, useSplit } from '@hanzo/build';
12
+ import { Gutter, Panel, PanelToggle, Reply, SideProvider, useDeck, useKey, usePanel, useSplit } from '@hanzo/build';
13
13
  import { SizableText, useMedia, XStack, YStack } from '@hanzo/gui';
14
14
  import { Check, ChevronDown, Ellipsis, Image as ImageIcon, LoaderCircle, Palette, Sparkles, X } from '@hanzogui/lucide-icons-2';
15
15
  import { DropdownMenu } from '@hanzo/ui';
@@ -319,7 +319,7 @@ function Conversation({ start, host, wire, available }) {
319
319
  ];
320
320
  const tools = (_jsxs(XStack, { items: "center", gap: 2, children: [_jsx(DropdownMenu, { trigger: _jsx(Pillish, { label: "Kind", icon: _jsx(Sparkles, { size: 13 }), value: picked ? kind(picked).label : 'Auto' }), items: kindItems }), _jsx(DropdownMenu, { trigger: _jsx(Pillish, { label: "Brand", icon: _jsx(Palette, { size: 13 }), value: brandName }), items: brandItems }), _jsx(DropdownMenu, { trigger: _jsx(XStack, { render: "button", "aria-label": "More options: model, aspect, count", width: 32, height: 32, items: "center", justify: "center", rounded: 999, cursor: "pointer", hoverStyle: { bg: '$hover' }, children: _jsx(Ellipsis, { size: 16 }) }), items: optionItems })] }));
321
321
  const head = attached.length || uploading ? (_jsxs(XStack, { gap: "$2", flexWrap: "wrap", "data-slot": "attached", children: [attached.map((f) => (_jsxs(XStack, { position: "relative", children: [_jsx(Thumb, { wire: wire, file: f }), _jsx(XStack, { render: "button", "aria-label": `Remove ${f.name}`, onPress: () => setAttached((a) => a.filter((x) => x.key !== f.key)), position: "absolute", t: -6, r: -6, width: 20, height: 20, rounded: 99, bg: "$background", borderWidth: 1, borderColor: "$borderColor", items: "center", justify: "center", cursor: "pointer", children: _jsx(X, { size: 11 }) })] }, f.key))), uploading ? (_jsx(XStack, { width: 56, height: 56, rounded: "$3", bg: "$hover", items: "center", justify: "center", children: _jsx(LoaderCircle, { size: 16 }) })) : null] })) : undefined;
322
- const composer = prompt({
322
+ const composer = {
323
323
  value: draft,
324
324
  onChange: setDraft,
325
325
  onSend: () => void send(draft),
@@ -330,12 +330,15 @@ function Conversation({ start, host, wire, available }) {
330
330
  label: 'What should we create?',
331
331
  head,
332
332
  plus: { upload: attach },
333
- where: tools,
334
- mind: null,
333
+ // Kind, Brand and the image options are the pills above the field.
334
+ pills: tools,
335
+ column: true,
335
336
  narrow: !wide,
336
- });
337
+ // While nothing has been made: where to start.
338
+ starters: empty ? _jsx(Home, { available: available, onStart: begin }) : undefined,
339
+ };
337
340
  const deskPane = (sheet) => (_jsx(Panel, { side: deck, kinds: tabs, onHide: () => setDesk(false), sheet: sheet, label: "What this conversation made" }));
338
- return (_jsxs(XStack, { "data-slot": "studio-split", flex: 1, minH: 0, minW: 0, width: "100%", children: [_jsxs(YStack, { "data-slot": "studio-talk", ref: split.main, style: split.mainStyle, ...pane, flex: 1, minH: 0, minW: 0, width: "100%", overflow: "hidden", children: [_jsxs(XStack, { px: "$4", pt: "$3", pb: "$2", gap: "$2", items: "center", minH: 44, children: [_jsx(SizableText, { render: "h1", size: "$5", color: "$ink", numberOfLines: 1, flex: 1, minW: 0, children: empty ? 'Studio' : chat.title }), chat.made.length ? _jsx(PanelToggle, { open: desk, onToggle: () => setDesk(!desk) }) : null] }), _jsx(Thread, { messages: messages, streaming: busy, send: (text) => void send(text), stop: working ? () => working.abort() : undefined, body: body, center: true, onFiles: (files) => void upload(files), empty: _jsx(Opening, {}), composer: { ...composer, foot: empty ? _jsx(Home, { available: available, onStart: begin }) : undefined } })] }), desk && chat.made.length && !wide ? deskPane(true) : null, desk && chat.made.length && wide ? (_jsxs(YStack, { "data-slot": "studio-desk", ref: split.aside, ...pane, ml: gap, position: "relative", shrink: 0, minH: 0, style: split.asideStyle, children: [split.grip ? (_jsx(Gutter, { ...split.grip, label: "Resize the tabs", inset: pane.borderWidth })) : null, _jsx(SideProvider, { value: split.side, children: deskPane(false) })] })) : null] }));
341
+ return (_jsxs(XStack, { "data-slot": "studio-split", flex: 1, minH: 0, minW: 0, width: "100%", children: [_jsxs(YStack, { "data-slot": "studio-talk", ref: split.main, style: split.mainStyle, ...pane, flex: 1, minH: 0, minW: 0, width: "100%", overflow: "hidden", children: [_jsxs(XStack, { px: "$4", pt: "$3", pb: "$2", gap: "$2", items: "center", minH: 44, children: [_jsx(SizableText, { render: "h1", size: "$5", color: "$ink", numberOfLines: 1, flex: 1, minW: 0, children: empty ? 'Studio' : chat.title }), chat.made.length ? _jsx(PanelToggle, { open: desk, onToggle: () => setDesk(!desk) }) : null] }), _jsx(Thread, { messages: messages, streaming: busy, send: (text) => void send(text), stop: working ? () => working.abort() : undefined, body: body, center: true, onFiles: (files) => void upload(files), empty: _jsx(Opening, {}), composer: composer })] }), desk && chat.made.length && !wide ? deskPane(true) : null, desk && chat.made.length && wide ? (_jsxs(YStack, { "data-slot": "studio-desk", ref: split.aside, ...pane, ml: gap, position: "relative", shrink: 0, minH: 0, style: split.asideStyle, children: [split.grip ? (_jsx(Gutter, { ...split.grip, label: "Resize the tabs", inset: pane.borderWidth })) : null, _jsx(SideProvider, { value: split.side, children: deskPane(false) })] })) : null] }));
339
342
  }
340
343
  function brandOf(chat) {
341
344
  const m = chat.brand ? chat.made.find((x) => x.id === chat.brand) : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/studio",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "license": "BSD-3-Clause",
6
6
  "description": "Hanzo Studio: a chat that makes images, posters, documents, slides, type systems, 3D, video and sound, with every result open in a tab beside it. Mounted by the Hanzo app at hanzo.ai/studio and served whole at studio.hanzo.ai.",
@@ -13,11 +13,12 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@axe-core/playwright": "4.14.0",
16
- "@hanzo/build": "0.2.77",
16
+ "@hanzo/build": "0.2.85",
17
17
  "@hanzo/composer": "0.2.0",
18
18
  "@hanzo/font": "1.9.3",
19
19
  "@hanzo/gui": "8.3.5",
20
- "@hanzo/ui": "8.29.5",
20
+ "@hanzo/i18n": "0.5.3",
21
+ "@hanzo/ui": "8.29.24",
21
22
  "@hanzo/vite": "0.1.4",
22
23
  "@hanzo/voice": "0.1.19",
23
24
  "@hanzogui/lucide-icons-2": "8.3.5",
@@ -58,10 +59,11 @@
58
59
  "url": "git+https://github.com/hanzoai/studio.git"
59
60
  },
60
61
  "peerDependencies": {
61
- "@hanzo/build": ">=0.2.60",
62
+ "@hanzo/build": ">=0.2.85",
62
63
  "@hanzo/composer": ">=0.2.0",
63
64
  "@hanzo/gui": ">=8.3.5",
64
- "@hanzo/ui": ">=8.29.0",
65
+ "@hanzo/i18n": ">=0.4.0",
66
+ "@hanzo/ui": ">=8.29.24",
65
67
  "@hanzo/voice": ">=0.1.19",
66
68
  "@hanzogui/lucide-icons-2": ">=8.3.5",
67
69
  "react": ">=19.2.8"