@hanzo/ui 8.4.2 → 8.4.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/dist/chat/Message.cjs
CHANGED
|
@@ -29,8 +29,10 @@ function Caret() {
|
|
|
29
29
|
return (0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('caret'), width: 2, height: 15, rounded: 1, bg: "$ink", "aria-hidden": true });
|
|
30
30
|
}
|
|
31
31
|
function Message({ role, children, actions, busy = false, icon, body, ...props }) {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
// `tool` takes the aside too — see the Role note above. Machine chatter about
|
|
33
|
+
// a turn, not speech in it.
|
|
34
|
+
if (role === 'system' || role === 'tool')
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { ...(0, slot_1.slot)('message'), "data-role": role, width: "100%", justify: "center", py: "$2", ...props, children: (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$1", color: "$soft", text: "center", children: children }) }));
|
|
34
36
|
const mine = role === 'user';
|
|
35
37
|
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('message'), "data-role": role, width: "100%", justify: mine ? 'flex-end' : 'flex-start', gap: "$2",
|
|
36
38
|
// Makes `actions` revealable with `$group-hover`. Unnamed: gui types
|
package/dist/chat/Message.d.ts
CHANGED
|
@@ -10,7 +10,21 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { XStack } from '@hanzo/gui';
|
|
12
12
|
import type { ComponentProps, ReactNode } from 'react';
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Who is speaking — and it is the WIRE's set, not a presentation set of our own.
|
|
15
|
+
*
|
|
16
|
+
* This was `user | assistant | system`, three roles that look different, which is
|
|
17
|
+
* a reasonable thing to want and the wrong place to want it. A completion carries
|
|
18
|
+
* `tool` too, so `@hanzo/ai`'s `useChat` holds turns this could not accept and
|
|
19
|
+
* `<Chat {...useChat(…)} />` did not typecheck for ANY surface — the one call the
|
|
20
|
+
* pair exists to make work. A component fed by the SDK has to take the SDK's
|
|
21
|
+
* vocabulary; narrowing it here just moves the mismatch to every caller.
|
|
22
|
+
*
|
|
23
|
+
* `tool` presents as the aside `system` does: it is machine chatter about the
|
|
24
|
+
* turn rather than speech in it. A surface that wants tool calls drawn properly
|
|
25
|
+
* has `Step` for that and passes it as children.
|
|
26
|
+
*/
|
|
27
|
+
export type Role = 'user' | 'assistant' | 'system' | 'tool';
|
|
14
28
|
/** What a gui stack accepts. `role` is dropped: here it names the speaker, not
|
|
15
29
|
* an ARIA role. `aria-label` still reaches the row. */
|
|
16
30
|
type Stack = Omit<ComponentProps<typeof XStack>, 'children' | 'role'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../src/chat/Message.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,OAAO,EAAQ,MAAM,EAAU,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../src/chat/Message.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,OAAO,EAAQ,MAAM,EAAU,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE3D;wDACwD;AACxD,KAAK,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,CAAA;AAErE;;;;;;;GAOG;AACH,wBAAgB,KAAK,4CAEpB;AAED,MAAM,WAAW,YAAa,SAAQ,KAAK;IACzC,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,sEAAsE;IACtE,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;6DACyD;IACzD,IAAI,CAAC,EAAE,KAAK,CAAA;CACb;AAED,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,IAAY,EACZ,IAAI,EACJ,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,YAAY,2CAyDd"}
|
package/dist/chat/Message.js
CHANGED
|
@@ -25,8 +25,10 @@ export function Caret() {
|
|
|
25
25
|
return _jsx(YStack, { ...slot('caret'), width: 2, height: 15, rounded: 1, bg: "$ink", "aria-hidden": true });
|
|
26
26
|
}
|
|
27
27
|
export function Message({ role, children, actions, busy = false, icon, body, ...props }) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
// `tool` takes the aside too — see the Role note above. Machine chatter about
|
|
29
|
+
// a turn, not speech in it.
|
|
30
|
+
if (role === 'system' || role === 'tool')
|
|
31
|
+
return (_jsx(XStack, { ...slot('message'), "data-role": role, width: "100%", justify: "center", py: "$2", ...props, children: _jsx(Text, { fontSize: "$1", color: "$soft", text: "center", children: children }) }));
|
|
30
32
|
const mine = role === 'user';
|
|
31
33
|
return (_jsxs(XStack, { ...slot('message'), "data-role": role, width: "100%", justify: mine ? 'flex-end' : 'flex-start', gap: "$2",
|
|
32
34
|
// Makes `actions` revealable with `$group-hover`. Unnamed: gui types
|
package/dist/chat/Message.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/chat/Message.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;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AK,MAAM,CAAA;IAC5B,OAAO,CACL,MAAC,MAAM,OACD,IAAI,CAAC,SAAS,CAAC,eACR,IAAI,EACf,KAAK,EAAC,MAAM,EACZ,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,EACzC,GAAG,EAAC,IAAI;QACR,qEAAqE;QACrE,oDAAoD;QACpD,KAAK,WACD,KAAK,aAER,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,EAAE,EAAC,IAAI,YAAE,IAAI,GAAU,CAAC,CAAC,CAAC,IAAI,EACvD,MAAC,MAAM,OACD,IAAI,CAAC,cAAc,CAAC,iBACX,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACtC,GAAG,EAAC,IAAI;gBACR,yDAAyD;gBACzD,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAC3B,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KACtB,CAAC,IAAI,IAAI;oBACX,EAAE,EAAE,QAAQ;oBACZ,OAAO,EAAE,IAAI;oBACb,EAAE,EAAE,IAAI;oBACR,EAAE,EAAE,IAAI;iBACT,CAAC,KACE,IAAI,aAEP,GAAG,CAAC,QAAQ,CAAC,EACb,IAAI,CAAC,CAAC,CAAC,KAAC,KAAK,KAAG,CAAC,CAAC,CAAC,IAAI,EACvB,OAAO,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,GAAG,EAAC,IAAI,EAAC,KAAK,EAAC,QAAQ,YAAE,OAAO,GAAU,CAAC,CAAC,CAAC,IAAI,IAC7D,IACF,CACV,CAAA;AACH,CAAC"}
|
package/dist/gallery.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.4.
|
|
1
|
+
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.4.3</title><style>/* @hanzo/ui — generated by scripts/gen-css.mjs. Do not edit. */
|
|
2
2
|
:root { --hanzo-ui-styles: 1; }
|
|
3
3
|
/* Hanzo Design System — the entry point. Import THIS one file.
|
|
4
4
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
|
|
6
6
|
"exports": {
|