@hanzo/studio 0.1.1 → 0.1.3

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/desk.js CHANGED
@@ -48,7 +48,7 @@ export function Desk({ made, wire, others, onPick, onEdit, busy, failed }) {
48
48
  onSelect: () => onPick(i),
49
49
  }));
50
50
  const compare = against !== null && against !== made.at && made.versions[against] ? made.versions[against] : null;
51
- return (_jsxs(YStack, { flex: 1, minH: 0, "data-slot": "studio-tab", children: [_jsxs(XStack, { gap: "$1", px: "$2", py: "$1.5", items: "center", borderBottomWidth: 1, borderColor: "$borderColor", shrink: 0, flexWrap: "wrap", children: [_jsxs(XStack, { items: "center", gap: "$2", flex: 1, minW: 0, px: "$1", children: [_jsx(Icon, { size: 14 }), _jsx(SizableText, { size: "$2", fontWeight: "600", numberOfLines: 1, children: made.title })] }), _jsx(DropdownMenu, { trigger: _jsxs(XStack, { render: "button", "aria-label": "Versions", items: "center", gap: "$1", height: 30, px: "$2.5", rounded: "$3", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(SizableText, { size: "$2", children: `v${made.at + 1} of ${made.versions.length}` }), _jsx(ChevronDown, { size: 13 })] }), items: [{ type: 'label', key: 'h', label: 'Versions' }, ...versions] }), made.versions.length > 1 ? (_jsx(DropdownMenu, { trigger: _jsxs(XStack, { render: "button", "aria-label": "Compare versions", "aria-pressed": compare ? true : undefined, items: "center", gap: "$1.5", height: 30, px: "$2.5", rounded: "$3", bg: compare ? '$hover' : 'transparent', cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Columns2, { size: 14 }), _jsx(SizableText, { size: "$2", children: compare ? `v${(against ?? 0) + 1} | v${made.at + 1}` : 'Compare' })] }), items: [
51
+ return (_jsxs(YStack, { flex: 1, minH: 0, "data-slot": "studio-tab", children: [_jsxs(XStack, { gap: "$1", px: "$2", py: "$1.5", items: "center", borderBottomWidth: 1, borderColor: "$borderColor", shrink: 0, flexWrap: "wrap", children: [_jsxs(XStack, { items: "center", gap: "$2", flex: 1, minW: 0, px: "$1", children: [_jsx(Icon, { size: 14 }), _jsx(SizableText, { size: "$2", fontWeight: "600", numberOfLines: 1, children: made.title })] }), _jsx(DropdownMenu, { trigger: _jsxs(XStack, { render: "button", "aria-label": `v${made.at + 1} of ${made.versions.length}, versions`, items: "center", gap: "$1", height: 30, px: "$2.5", rounded: "$3", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(SizableText, { size: "$2", children: `v${made.at + 1} of ${made.versions.length}` }), _jsx(ChevronDown, { size: 13 })] }), items: [{ type: 'label', key: 'h', label: 'Versions' }, ...versions] }), made.versions.length > 1 ? (_jsx(DropdownMenu, { trigger: _jsxs(XStack, { render: "button", "aria-label": "Compare versions", "aria-pressed": compare ? true : undefined, items: "center", gap: "$1.5", height: 30, px: "$2.5", rounded: "$3", bg: compare ? '$hover' : 'transparent', cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [_jsx(Columns2, { size: 14 }), _jsx(SizableText, { size: "$2", children: compare ? `v${(against ?? 0) + 1} | v${made.at + 1}` : 'Compare' })] }), items: [
52
52
  { type: 'label', key: 'h', label: 'Compare with' },
53
53
  ...made.versions.map((x, i) => ({ key: x.id, label: `Version ${i + 1}`, description: x.note.slice(0, 60), disabled: i === made.at, onSelect: () => setAgainst(i) })),
54
54
  ...(compare ? [{ type: 'separator', key: 's' }, { key: 'off', label: 'Stop comparing', onSelect: () => setAgainst(null) }] : []),
package/lib/home.js CHANGED
@@ -30,7 +30,7 @@ function Card({ s, i, onPress }) {
30
30
  const Icon = k.icon;
31
31
  const look = PRESETS[i % PRESETS.length];
32
32
  use(look.display);
33
- return (_jsxs(YStack, { role: "listitem", width: "calc(50% - 6px)", $sm: { width: 'calc(25% - 9px)' }, gap: "$1.5", children: [_jsxs(YStack, { render: "button", "aria-label": `${s.title}: ${s.subtitle}`, onPress: onPress, position: "relative", width: "100%", rounded: 16, overflow: "hidden", cursor: "pointer", hoverStyle: { opacity: 0.92 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, style: { aspectRatio: '4 / 5' }, children: [s.thumb ? (_jsx("img", { src: s.thumb, alt: "", style: { position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover' } })) : (_jsxs("div", { "aria-hidden": true, style: { position: 'absolute', inset: 0, background: look.colors.paper, color: look.colors.ink, padding: '14% 10%', display: 'flex', flexDirection: 'column', justifyContent: 'flex-end', textAlign: 'left' }, children: [_jsx("div", { style: { width: '28%', height: 4, background: look.colors.accent, marginBottom: 10 } }), _jsx("div", { style: { fontFamily: stack(look.display), fontWeight: look.weights.display, fontSize: 'clamp(18px, 2.4vw, 30px)', lineHeight: look.leading.display, letterSpacing: `${look.tracking.display}em` }, children: s.title })] })), _jsxs(XStack, { position: "absolute", t: 8, l: 8, r: 8, justify: "space-between", items: "center", children: [_jsx(XStack, { width: 26, height: 26, rounded: 99, bg: "rgba(0,0,0,0.55)", items: "center", justify: "center", children: _jsx(Icon, { size: 13 }) }), _jsx(XStack, { px: "$2", height: 22, rounded: 99, bg: "rgba(0,0,0,0.55)", items: "center", children: _jsx(SizableText, { size: "$1", color: "#fff", children: RUNTIME[s.kind] }) })] })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", numberOfLines: 1, children: s.title }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, mt: -4, children: s.subtitle })] }));
33
+ return (_jsxs(YStack, { role: "listitem", width: "calc(50% - 6px)", $sm: { width: 'calc(25% - 9px)' }, gap: "$1.5", children: [_jsxs(YStack, { position: "relative", width: "100%", rounded: 16, overflow: "hidden", style: { aspectRatio: '4 / 5' }, children: [s.thumb ? (_jsx("img", { src: s.thumb, alt: "", style: { position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover' } })) : (_jsxs("div", { "aria-hidden": true, style: { position: 'absolute', inset: 0, background: look.colors.paper, color: look.colors.ink, padding: '14% 10%', display: 'flex', flexDirection: 'column', justifyContent: 'flex-end', textAlign: 'left' }, children: [_jsx("div", { style: { width: '28%', height: 4, background: look.colors.accent, marginBottom: 10 } }), _jsx("div", { style: { fontFamily: stack(look.display), fontWeight: look.weights.display, fontSize: 'clamp(18px, 2.4vw, 30px)', lineHeight: look.leading.display, letterSpacing: `${look.tracking.display}em` }, children: s.title })] })), _jsxs(XStack, { "aria-hidden": true, position: "absolute", t: 8, l: 8, r: 8, justify: "space-between", items: "center", children: [_jsx(XStack, { width: 26, height: 26, rounded: 99, bg: "rgba(0,0,0,0.55)", items: "center", justify: "center", children: _jsx(Icon, { size: 13 }) }), _jsx(XStack, { px: "$2", height: 22, rounded: 99, bg: "rgba(0,0,0,0.55)", items: "center", children: _jsx(SizableText, { size: "$1", color: "#fff", children: RUNTIME[s.kind] }) })] }), _jsx(YStack, { render: "button", "aria-label": `${s.title}: ${s.subtitle}`, onPress: onPress, position: "absolute", t: 0, l: 0, r: 0, b: 0, rounded: 16, cursor: "pointer", hoverStyle: { bg: 'rgba(255,255,255,0.08)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' } })] }), _jsx(SizableText, { size: "$2", fontWeight: "600", numberOfLines: 1, children: s.title }), _jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 1, mt: -4, children: s.subtitle })] }));
34
34
  }
35
35
  const STATE = { making: 'Making', done: 'Done', failed: 'Failed' };
36
36
  /** The last eight conversations, each with what it is doing now. */
package/lib/places.js CHANGED
@@ -90,7 +90,7 @@ export function Explore() {
90
90
  return null;
91
91
  return (_jsxs(YStack, { gap: "$2", children: [_jsx(SizableText, { size: "$4", fontWeight: "600", children: c.label }), _jsx(XStack, { flexWrap: "wrap", gap: "$2", children: list.map((s) => {
92
92
  const why = kind(s.kind).needs(available);
93
- return (_jsxs(YStack, { render: "button", "aria-label": `${s.title}${why ? `, ${why}` : ''}`, "aria-disabled": why ? true : undefined, onPress: () => {
93
+ return (_jsxs(YStack, { render: "button", "aria-disabled": why ? true : undefined, onPress: () => {
94
94
  if (why)
95
95
  return;
96
96
  queue(s);
package/lib/talk.js CHANGED
@@ -352,8 +352,9 @@ function Opening() {
352
352
  return (_jsxs(YStack, { items: "center", width: "100%", pt: "$6", pb: "$2", gap: "$2", children: [_jsx(SizableText, { render: "h2", size: "$9", fontWeight: "600", color: "$ink", text: "center", children: "What should we create?" }), _jsx(SizableText, { size: "$3", color: "$soft", text: "center", children: "Images, posters, documents, slides, type systems, 3D, video and sound. Everything opens in a tab." })] }));
353
353
  }
354
354
  /** A composer chip: what it sets, and its value. */
355
- function Pillish({ label, icon, value }) {
356
- return (_jsxs(XStack, { render: "button", "aria-label": `${label}: ${value}`, items: "center", gap: "$1.5", height: 32, px: "$2.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [icon, _jsx(SizableText, { size: "$2", numberOfLines: 1, maxW: 120, children: value }), _jsx(ChevronDown, { size: 12 })] }));
355
+ /** A menu's trigger: the menu hands it its state and handlers, and they land on the button itself. */
356
+ function Pillish({ label, icon, value, ...trigger }) {
357
+ return (_jsxs(XStack, { ...trigger, render: "button", "aria-label": `${label}: ${value}`, items: "center", gap: "$1.5", height: 32, px: "$2.5", rounded: 999, borderWidth: 1, borderColor: "$borderColor", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: [icon, _jsx(SizableText, { size: "$2", numberOfLines: 1, maxW: 120, children: value }), _jsx(ChevronDown, { size: 12 })] }));
357
358
  }
358
359
  /** What a turn made, as a chip that opens its tab. */
359
360
  function Chip({ made, wire, n, onPress }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/studio",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
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,7 +13,7 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@axe-core/playwright": "4.14.0",
16
- "@hanzo/build": "0.2.56",
16
+ "@hanzo/build": "0.2.60",
17
17
  "@hanzo/composer": "0.2.0",
18
18
  "@hanzo/font": "1.9.3",
19
19
  "@hanzo/gui": "8.3.5",
@@ -58,7 +58,7 @@
58
58
  "url": "git+https://github.com/hanzoai/studio.git"
59
59
  },
60
60
  "peerDependencies": {
61
- "@hanzo/build": ">=0.2.56",
61
+ "@hanzo/build": ">=0.2.60",
62
62
  "@hanzo/composer": ">=0.2.0",
63
63
  "@hanzo/gui": ">=8.3.5",
64
64
  "@hanzo/ui": ">=8.27.77",