@hanzo/ui 8.4.1 → 8.4.2
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/Chat.cjs +8 -1
- package/dist/chat/Chat.d.ts.map +1 -1
- package/dist/chat/Chat.js +8 -1
- package/dist/chat/Chat.js.map +1 -1
- package/dist/gallery.html +2 -2
- package/package.json +1 -1
package/dist/chat/Chat.cjs
CHANGED
|
@@ -35,6 +35,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
35
35
|
const gui_1 = require("@hanzo/gui");
|
|
36
36
|
const react_1 = require("react");
|
|
37
37
|
const ink_1 = require("../backends/gui/ink.cjs");
|
|
38
|
+
const slot_1 = require("../backends/gui/slot.cjs");
|
|
38
39
|
const Composer_1 = require("./Composer.cjs");
|
|
39
40
|
const Message_1 = require("./Message.cjs");
|
|
40
41
|
const Thread_1 = require("./Thread.cjs");
|
|
@@ -55,5 +56,11 @@ function Chat({ messages, streaming = false, send: onSend, stop: onStop, body, e
|
|
|
55
56
|
// set it already, measured on the rendered element — and gui publishes no
|
|
56
57
|
// such prop, so writing it type-errors rather than silently doing nothing,
|
|
57
58
|
// which is the one member of that family this substrate catches for you.
|
|
58
|
-
|
|
59
|
+
// The frame is marked, like every other component here. It is not decoration:
|
|
60
|
+
// `data-slot` is what `componentName()` reads for analytics, and it is the only
|
|
61
|
+
// way a browser check can find this frame — a probe that walks N parents up
|
|
62
|
+
// from the composer lands on a `display: contents` wrapper or on the page,
|
|
63
|
+
// and then reports a component that is fine as broken, or one that is broken
|
|
64
|
+
// as fine.
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, width: "100%", ...(0, slot_1.slot)('chat'), children: [messages.length === 0 && empty ? (empty) : ((0, jsx_runtime_1.jsx)(Thread_1.Thread, { flex: 1, ...thread, children: messages.map((turn, i) => ((0, jsx_runtime_1.jsx)(Message_1.Message, { role: turn.role, busy: streaming && i === last && turn.role === 'assistant', children: body ? body(turn) : (0, ink_1.ink)(turn.content ?? '') }, turn.id))) })), (0, jsx_runtime_1.jsx)(Composer_1.Composer, { value: draft, onChange: setDraft, onSend: send, busy: streaming, ...(onStop ? { onStop } : {}), ...composer })] }));
|
|
59
66
|
}
|
package/dist/chat/Chat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../src/chat/Chat.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../src/chat/Chat.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAI7D,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAW,KAAK,IAAI,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAEnD;;;;;;;GAOG;AACH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,KAAK,CAAC;IACtE,sCAAsC;IACtC,QAAQ,EAAE,IAAI,EAAE,CAAA;IAChB,iFAAiF;IACjF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;;;;;;OAUG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5B,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CAAA;IAChC,+DAA+D;IAC/D,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;CAClC;AAED,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,SAAiB,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,GAAG,MAAM,EACV,EAAE,SAAS,2CAoDX"}
|
package/dist/chat/Chat.js
CHANGED
|
@@ -32,6 +32,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
32
32
|
import { YStack } from '@hanzo/gui';
|
|
33
33
|
import { useCallback, useState } from 'react';
|
|
34
34
|
import { ink } from '../backends/gui/ink.js';
|
|
35
|
+
import { slot } from '../backends/gui/slot.js';
|
|
35
36
|
import { Composer } from './Composer.js';
|
|
36
37
|
import { Message } from './Message.js';
|
|
37
38
|
import { Thread } from './Thread.js';
|
|
@@ -52,6 +53,12 @@ export function Chat({ messages, streaming = false, send: onSend, stop: onStop,
|
|
|
52
53
|
// set it already, measured on the rendered element — and gui publishes no
|
|
53
54
|
// such prop, so writing it type-errors rather than silently doing nothing,
|
|
54
55
|
// which is the one member of that family this substrate catches for you.
|
|
55
|
-
|
|
56
|
+
// The frame is marked, like every other component here. It is not decoration:
|
|
57
|
+
// `data-slot` is what `componentName()` reads for analytics, and it is the only
|
|
58
|
+
// way a browser check can find this frame — a probe that walks N parents up
|
|
59
|
+
// from the composer lands on a `display: contents` wrapper or on the page,
|
|
60
|
+
// and then reports a component that is fine as broken, or one that is broken
|
|
61
|
+
// as fine.
|
|
62
|
+
return (_jsxs(YStack, { flex: 1, width: "100%", ...slot('chat'), children: [messages.length === 0 && empty ? (empty) : (_jsx(Thread, { flex: 1, ...thread, children: messages.map((turn, i) => (_jsx(Message, { role: turn.role, busy: streaming && i === last && turn.role === 'assistant', children: body ? body(turn) : ink(turn.content ?? '') }, turn.id))) })), _jsx(Composer, { value: draft, onChange: setDraft, onSend: send, busy: streaming, ...(onStop ? { onStop } : {}), ...composer })] }));
|
|
56
63
|
}
|
|
57
64
|
//# sourceMappingURL=Chat.js.map
|
package/dist/chat/Chat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.js","sourceRoot":"","sources":["../../src/chat/Chat.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAE7D,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAsB,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,OAAO,EAAa,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AAkDnD,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,GAAG,MAAM,EACC;IACV,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IAEtC,4EAA4E;IAC5E,yEAAyE;IACzE,iEAAiE;IACjE,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE;QAC5B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;QACzB,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,QAAQ,CAAC,EAAE,CAAC,CAAA;QACZ,MAAM,CAAC,IAAI,CAAC,CAAA;IACd,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;IAEnB,MAAM,IAAI,GAAG,QAAQ,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