@hanzo/ui 8.29.22 → 8.29.23
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/Composer.cjs +181 -99
- package/dist/chat/Composer.d.ts +110 -81
- package/dist/chat/Composer.d.ts.map +1 -1
- package/dist/chat/Composer.js +183 -101
- package/dist/chat/Composer.js.map +1 -1
- package/dist/chat/Dial.cjs +96 -0
- package/dist/chat/Dial.d.ts +7 -0
- package/dist/chat/Dial.d.ts.map +1 -0
- package/dist/chat/Dial.js +94 -0
- package/dist/chat/Dial.js.map +1 -0
- package/dist/chat/Dictation.cjs +142 -0
- package/dist/chat/Dictation.d.ts +13 -0
- package/dist/chat/Dictation.d.ts.map +1 -0
- package/dist/chat/Dictation.js +140 -0
- package/dist/chat/Dictation.js.map +1 -0
- package/dist/chat/Families.cjs +41 -0
- package/dist/chat/Families.d.ts +3 -0
- package/dist/chat/Families.d.ts.map +1 -0
- package/dist/chat/Families.js +39 -0
- package/dist/chat/Families.js.map +1 -0
- package/dist/chat/Mention.cjs +25 -0
- package/dist/chat/Mention.d.ts +16 -0
- package/dist/chat/Mention.d.ts.map +1 -0
- package/dist/chat/Mention.js +22 -0
- package/dist/chat/Mention.js.map +1 -0
- package/dist/chat/Palette.cjs +22 -0
- package/dist/chat/Palette.d.ts +21 -0
- package/dist/chat/Palette.d.ts.map +1 -0
- package/dist/chat/Palette.js +20 -0
- package/dist/chat/Palette.js.map +1 -0
- package/dist/chat/Plus.cjs +76 -0
- package/dist/chat/Plus.d.ts +49 -0
- package/dist/chat/Plus.d.ts.map +1 -0
- package/dist/chat/Plus.js +74 -0
- package/dist/chat/Plus.js.map +1 -0
- package/dist/chat/Tune.cjs +55 -0
- package/dist/chat/Tune.d.ts +49 -0
- package/dist/chat/Tune.d.ts.map +1 -0
- package/dist/chat/Tune.js +51 -0
- package/dist/chat/Tune.js.map +1 -0
- package/dist/chat/index.cjs +25 -4
- package/dist/chat/index.d.ts +11 -3
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js +10 -2
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/languages.cjs +17 -0
- package/dist/chat/languages.d.ts +11 -0
- package/dist/chat/languages.d.ts.map +1 -0
- package/dist/chat/languages.js +15 -0
- package/dist/chat/languages.js.map +1 -0
- package/dist/chat/pure.cjs +7 -1
- package/dist/chat/pure.d.ts +3 -1
- package/dist/chat/pure.d.ts.map +1 -1
- package/dist/chat/pure.js +4 -0
- package/dist/chat/pure.js.map +1 -1
- package/dist/chat/ring.cjs +9 -0
- package/dist/chat/ring.d.ts +11 -0
- package/dist/chat/ring.d.ts.map +1 -0
- package/dist/chat/ring.js +7 -0
- package/dist/chat/ring.js.map +1 -0
- package/dist/chat/send.cjs +3 -2
- package/dist/chat/send.d.ts +4 -1
- package/dist/chat/send.d.ts.map +1 -1
- package/dist/chat/send.js +3 -2
- package/dist/chat/send.js.map +1 -1
- package/dist/chat/ways.cjs +19 -0
- package/dist/chat/ways.d.ts +11 -0
- package/dist/chat/ways.d.ts.map +1 -0
- package/dist/chat/ways.js +17 -0
- package/dist/chat/ways.js.map +1 -0
- package/dist/gallery.cjs +4 -1
- package/dist/gallery.d.ts.map +1 -1
- package/dist/gallery.html +41 -15
- package/dist/gallery.js +5 -2
- package/dist/gallery.js.map +1 -1
- package/dist/models/ModelPicker.cjs +3 -3
- package/dist/models/ModelPicker.d.ts +6 -1
- package/dist/models/ModelPicker.d.ts.map +1 -1
- package/dist/models/ModelPicker.js +3 -3
- package/dist/models/ModelPicker.js.map +1 -1
- package/dist/models/ModelPickerMenu.cjs +19 -13
- package/dist/models/ModelPickerMenu.d.ts +4 -0
- package/dist/models/ModelPickerMenu.d.ts.map +1 -1
- package/dist/models/ModelPickerMenu.js +19 -13
- package/dist/models/ModelPickerMenu.js.map +1 -1
- package/dist/models/catalog.cjs +7 -0
- package/dist/models/catalog.d.ts +2 -0
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/catalog.js +6 -0
- package/dist/models/catalog.js.map +1 -1
- package/dist/models/index.cjs +2 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/product/BranchSelect.cjs +1 -1
- package/dist/product/BranchSelect.js +1 -1
- package/dist/product/BranchSelect.js.map +1 -1
- package/dist/product/ChipSelect.cjs +60 -11
- package/dist/product/ChipSelect.d.ts +13 -2
- package/dist/product/ChipSelect.d.ts.map +1 -1
- package/dist/product/ChipSelect.js +61 -12
- package/dist/product/ChipSelect.js.map +1 -1
- package/dist/product/RepoSelect.cjs +11 -5
- package/dist/product/RepoSelect.d.ts +6 -2
- package/dist/product/RepoSelect.d.ts.map +1 -1
- package/dist/product/RepoSelect.js +13 -7
- package/dist/product/RepoSelect.js.map +1 -1
- package/dist/product/chipSelect.logic.d.ts +4 -1
- package/dist/product/chipSelect.logic.d.ts.map +1 -1
- package/dist/product/chipSelect.logic.js.map +1 -1
- package/dist/product/index.cjs +3 -3
- package/dist/product/index.d.ts +1 -1
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +3 -3
- package/dist/product/index.js.map +1 -1
- package/dist/styles.css +37 -11
- package/package.json +8 -2
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Plus = Plus;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
/**
|
|
7
|
+
* The composer's `+`: files, then what the conversation works with — agents,
|
|
8
|
+
* skills, connectors, a design system, plugins, a device — then the Research
|
|
9
|
+
* and Memory switches. A row is drawn only when the surface hands it a shelf:
|
|
10
|
+
* a shelf is what is there (`rows`), what picking one does, and the ways to
|
|
11
|
+
* make, manage and find more. A row with nothing behind it is not drawn.
|
|
12
|
+
*
|
|
13
|
+
* On a laptop each shelf opens beside the menu; on a phone it is a page of the
|
|
14
|
+
* same menu, with Back.
|
|
15
|
+
*
|
|
16
|
+
* The menu's own words are the reader's language (@hanzo/i18n `t`); what a
|
|
17
|
+
* shelf holds — its rows, its links, its search and empty words — is the
|
|
18
|
+
* surface's, drawn as given.
|
|
19
|
+
*/
|
|
20
|
+
const gui_1 = require("@hanzo/gui");
|
|
21
|
+
const i18n_1 = require("@hanzo/i18n");
|
|
22
|
+
const react_1 = require("@hanzo/i18n/react");
|
|
23
|
+
const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
|
|
24
|
+
const gui_2 = require("../backends/gui/index.cjs");
|
|
25
|
+
const react_2 = require("react");
|
|
26
|
+
const ring_1 = require("./ring.cjs");
|
|
27
|
+
const ICON = 16;
|
|
28
|
+
/**
|
|
29
|
+
* The shelves, in the menu's order, with their names and marks, and the three
|
|
30
|
+
* sentences a shelf says of itself: its search's name, while it reads, and
|
|
31
|
+
* when it holds nothing. Whole sentences, so a language puts the noun where it goes.
|
|
32
|
+
*/
|
|
33
|
+
const SHELVES = [
|
|
34
|
+
{ key: 'agents', label: (0, i18n_1.phrase)('Agents'), search: (0, i18n_1.phrase)('Search agents'), reading: (0, i18n_1.phrase)('Reading agents'), none: (0, i18n_1.phrase)('No agents yet'), icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Bot, { size: ICON }) },
|
|
35
|
+
{ key: 'skills', label: (0, i18n_1.phrase)('Skills'), search: (0, i18n_1.phrase)('Search skills'), reading: (0, i18n_1.phrase)('Reading skills'), none: (0, i18n_1.phrase)('No skills yet'), icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ScrollText, { size: ICON }) },
|
|
36
|
+
{ key: 'connectors', label: (0, i18n_1.phrase)('Connectors'), search: (0, i18n_1.phrase)('Search connectors'), reading: (0, i18n_1.phrase)('Reading connectors'), none: (0, i18n_1.phrase)('No connectors yet'), icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Blocks, { size: ICON }) },
|
|
37
|
+
{ key: 'design', label: (0, i18n_1.phrase)('Design system'), search: (0, i18n_1.phrase)('Search design system'), reading: (0, i18n_1.phrase)('Reading design system'), none: (0, i18n_1.phrase)('No design system yet'), icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Palette, { size: ICON }) },
|
|
38
|
+
{ key: 'plugins', label: (0, i18n_1.phrase)('Plugins'), search: (0, i18n_1.phrase)('Search plugins'), reading: (0, i18n_1.phrase)('Reading plugins'), none: (0, i18n_1.phrase)('No plugins yet'), icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Plug, { size: ICON }) },
|
|
39
|
+
{ key: 'devices', label: (0, i18n_1.phrase)('Devices'), search: (0, i18n_1.phrase)('Search devices'), reading: (0, i18n_1.phrase)('Reading devices'), none: (0, i18n_1.phrase)('No devices yet'), icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Monitor, { size: ICON }) },
|
|
40
|
+
];
|
|
41
|
+
/** A row's anatomy: its mark, its label, a dim note, and a check when it is on. */
|
|
42
|
+
function Line({ icon, label, note, on, tail }) {
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { flex: 1, minW: 0, items: "center", gap: 10, children: [icon ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { width: ICON, height: ICON, items: "center", justify: "center", shrink: 0, "aria-hidden": true, children: icon })) : null, (0, jsx_runtime_1.jsx)(gui_1.SizableText, { fontSize: 14, color: "$ink", numberOfLines: 1, shrink: 0, children: label }), note ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { fontSize: 13, color: "$hint", numberOfLines: 1, flex: 1, minW: 0, children: note })) : ((0, jsx_runtime_1.jsx)(gui_1.XStack, { flex: 1 })), tail, on ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Check, { size: ICON, color: "var(--primary)", "aria-hidden": true }) : null] }));
|
|
44
|
+
}
|
|
45
|
+
/** A shelf's rows, its status, then its ways to more. */
|
|
46
|
+
function Contents({ shelf, words, close }) {
|
|
47
|
+
const { t } = (0, react_1.useI18n)();
|
|
48
|
+
const [q, setQ] = (0, react_2.useState)('');
|
|
49
|
+
const needle = q.trim().toLowerCase();
|
|
50
|
+
const rows = needle ? shelf.rows.filter((r) => `${r.label} ${r.note ?? ''}`.toLowerCase().includes(needle)) : shelf.rows;
|
|
51
|
+
const links = [shelf.create, shelf.manage, shelf.browse].filter((l) => Boolean(l));
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [shelf.search ? (0, jsx_runtime_1.jsx)(gui_2.DropdownMenuSearch, { value: q, onValueChange: setQ, placeholder: shelf.search, "aria-label": t(words.search) }) : null, shelf.loading && !shelf.rows.length ? (0, jsx_runtime_1.jsx)(gui_2.DropdownMenuLoading, { children: t(words.reading) }) : null, shelf.error ? (0, jsx_runtime_1.jsx)(gui_2.DropdownMenuEmpty, { children: shelf.error }) : null, !shelf.loading && !shelf.error && !rows.length ? (0, jsx_runtime_1.jsx)(gui_2.DropdownMenuEmpty, { children: needle ? t('Nothing matches') : (shelf.empty ?? t(words.none)) }) : null, rows.map((r) => ((0, jsx_runtime_1.jsx)(gui_2.DropdownMenuItem, { preventCloseOnSelect: true, onSelect: () => shelf.pick(r.id), "aria-checked": r.on ?? false, "data-slot": "plus-row", children: (0, jsx_runtime_1.jsx)(Line, { icon: r.icon, label: r.label, note: r.note, on: r.on }) }, r.id))), links.length ? (0, jsx_runtime_1.jsx)(gui_2.DropdownMenuSeparator, {}) : null, links.map((l, i) => ((0, jsx_runtime_1.jsx)(gui_2.DropdownMenuItem, { onSelect: () => {
|
|
53
|
+
close();
|
|
54
|
+
l.onPress();
|
|
55
|
+
}, children: (0, jsx_runtime_1.jsx)(Line, { icon: l === shelf.manage ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Briefcase, { size: ICON }) : (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Plus, { size: ICON }), label: l.label }) }, l.label)))] }));
|
|
56
|
+
}
|
|
57
|
+
/** The `+` and its menu. */
|
|
58
|
+
function Plus(p) {
|
|
59
|
+
const { t } = (0, react_1.useI18n)();
|
|
60
|
+
const media = (0, gui_1.useMedia)();
|
|
61
|
+
const wide = media.sm;
|
|
62
|
+
const [open, setOpen] = (0, react_2.useState)(false);
|
|
63
|
+
// The shelf open beside the menu.
|
|
64
|
+
const [sub, setSub] = (0, react_2.useState)(null);
|
|
65
|
+
const close = () => setOpen(false);
|
|
66
|
+
const shelves = (0, react_2.useMemo)(() => SHELVES.filter((s) => p[s.key]), [p]);
|
|
67
|
+
const switches = [
|
|
68
|
+
p.research ? { key: 'research', label: t('Research'), icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Telescope, { size: ICON }), s: p.research } : null,
|
|
69
|
+
p.memory ? { key: 'memory', label: t('Memory'), icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Brain, { size: ICON }), s: p.memory } : null,
|
|
70
|
+
].filter((x) => x !== null);
|
|
71
|
+
const main = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [p.upload ? ((0, jsx_runtime_1.jsx)(gui_2.DropdownMenuItem, { "data-slot": "plus-upload", onSelect: () => {
|
|
72
|
+
close();
|
|
73
|
+
p.upload?.();
|
|
74
|
+
}, children: (0, jsx_runtime_1.jsx)(Line, { icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Paperclip, { size: ICON }), label: t('Upload or add files'), tail: (0, jsx_runtime_1.jsx)(gui_2.DropdownMenuShortcut, { "data-i18n-ltr": true, children: "Ctrl+U" }) }) })) : null, p.upload && shelves.length ? (0, jsx_runtime_1.jsx)(gui_2.DropdownMenuSeparator, {}) : null, shelves.map((s) => wide ? ((0, jsx_runtime_1.jsxs)(gui_2.DropdownMenuSub, { open: sub === s.key, onOpenChange: (o) => setSub(o ? s.key : sub === s.key ? null : sub), children: [(0, jsx_runtime_1.jsx)(gui_2.DropdownMenuSubTrigger, { "data-slot": `plus-${s.key}`, onPress: () => setSub(s.key), children: (0, jsx_runtime_1.jsx)(Line, { icon: s.icon, label: t(s.label) }) }), sub === s.key ? ((0, jsx_runtime_1.jsx)(gui_2.DropdownMenuSubContent, { minW: 200, maxW: 340, maxH: 420, pointerEvents: "auto", style: { overflowY: "auto" }, children: (0, jsx_runtime_1.jsx)(Contents, { shelf: p[s.key], words: s, close: close }) })) : null] }, s.key)) : ((0, jsx_runtime_1.jsx)(gui_2.DropdownMenuItem, { page: s.key, "data-slot": `plus-${s.key}`, children: (0, jsx_runtime_1.jsx)(Line, { icon: s.icon, label: t(s.label) }) }, s.key))), switches.length && (p.upload || shelves.length) ? (0, jsx_runtime_1.jsx)(gui_2.DropdownMenuSeparator, {}) : null, switches.map((w) => ((0, jsx_runtime_1.jsx)(gui_2.DropdownMenuItem, { preventCloseOnSelect: true, onSelect: () => w.s.set(!w.s.on), role: 'menuitemcheckbox', "aria-checked": w.s.on, "data-slot": `plus-${w.key}`, children: (0, jsx_runtime_1.jsx)(Line, { icon: w.icon, label: w.label, on: w.s.on }) }, w.key)))] }));
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)(gui_2.DropdownMenu, { open: open, onOpenChange: setOpen, ...(wide ? null : { defaultPage: 'main' }), children: [(0, jsx_runtime_1.jsx)(gui_2.DropdownMenuTrigger, { asChild: true, disabled: p.disabled, children: (0, jsx_runtime_1.jsx)(gui_1.XStack, { render: "button", "data-slot": "plus", "aria-label": t('Add files, agents, skills and more'), width: p.size ?? 36, height: p.size ?? 36, rounded: 999, items: "center", justify: "center", shrink: 0, cursor: p.disabled ? 'default' : 'pointer', opacity: p.disabled ? 0.4 : 1, bg: open ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: ring_1.RING, children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Plus, { size: 18, color: "$ink" }) }) }), (0, jsx_runtime_1.jsx)(gui_2.DropdownMenuContent, { align: "start", minW: 240, "data-slot": "plus-menu", children: wide ? (main) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(gui_2.DropdownMenuPage, { id: "main", children: main }), shelves.map((s) => ((0, jsx_runtime_1.jsxs)(gui_2.DropdownMenuPage, { id: s.key, children: [(0, jsx_runtime_1.jsx)(gui_2.DropdownMenuBack, { children: t(s.label) }), (0, jsx_runtime_1.jsx)(Contents, { shelf: p[s.key], words: s, close: close })] }, s.key)))] })) })] }));
|
|
76
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** One thing a shelf holds. `on` marks what the conversation already has. */
|
|
3
|
+
export interface Row {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
/** A few dim words beside the label, where they help. */
|
|
8
|
+
note?: string;
|
|
9
|
+
on?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface Link {
|
|
12
|
+
label: string;
|
|
13
|
+
onPress: () => void;
|
|
14
|
+
}
|
|
15
|
+
export interface Shelf {
|
|
16
|
+
rows: Row[];
|
|
17
|
+
pick: (id: string) => void;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
error?: string | null;
|
|
20
|
+
/** A search field over the rows, with this placeholder. */
|
|
21
|
+
search?: string;
|
|
22
|
+
/** Said when there are no rows and nothing is loading. */
|
|
23
|
+
empty?: string;
|
|
24
|
+
create?: Link;
|
|
25
|
+
manage?: Link;
|
|
26
|
+
browse?: Link;
|
|
27
|
+
}
|
|
28
|
+
export interface Switch {
|
|
29
|
+
on: boolean;
|
|
30
|
+
set: (on: boolean) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface PlusProps {
|
|
33
|
+
/** Upload or add files (Ctrl+U). */
|
|
34
|
+
upload?: () => void;
|
|
35
|
+
agents?: Shelf;
|
|
36
|
+
skills?: Shelf;
|
|
37
|
+
connectors?: Shelf;
|
|
38
|
+
design?: Shelf;
|
|
39
|
+
plugins?: Shelf;
|
|
40
|
+
devices?: Shelf;
|
|
41
|
+
research?: Switch;
|
|
42
|
+
memory?: Switch;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/** The button's box, px: the composer's control size (36 on a laptop, 44 on a phone). */
|
|
45
|
+
size?: number;
|
|
46
|
+
}
|
|
47
|
+
/** The `+` and its menu. */
|
|
48
|
+
export declare function Plus(p: PlusProps): import("react").JSX.Element;
|
|
49
|
+
//# sourceMappingURL=Plus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plus.d.ts","sourceRoot":"","sources":["../../src/chat/Plus.tsx"],"names":[],"mappings":"AAiDA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIzD,6EAA6E;AAC7E,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,OAAO,CAAA;CACb;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,IAAI,CAAA;IACb,MAAM,CAAC,EAAE,IAAI,CAAA;IACb,MAAM,CAAC,EAAE,IAAI,CAAA;CACd;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,OAAO,CAAA;IACX,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAA;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yFAAyF;IACzF,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAiFD,4BAA4B;AAC5B,wBAAgB,IAAI,CAAC,CAAC,EAAE,SAAS,+BA+FhC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The composer's `+`: files, then what the conversation works with — agents,
|
|
5
|
+
* skills, connectors, a design system, plugins, a device — then the Research
|
|
6
|
+
* and Memory switches. A row is drawn only when the surface hands it a shelf:
|
|
7
|
+
* a shelf is what is there (`rows`), what picking one does, and the ways to
|
|
8
|
+
* make, manage and find more. A row with nothing behind it is not drawn.
|
|
9
|
+
*
|
|
10
|
+
* On a laptop each shelf opens beside the menu; on a phone it is a page of the
|
|
11
|
+
* same menu, with Back.
|
|
12
|
+
*
|
|
13
|
+
* The menu's own words are the reader's language (@hanzo/i18n `t`); what a
|
|
14
|
+
* shelf holds — its rows, its links, its search and empty words — is the
|
|
15
|
+
* surface's, drawn as given.
|
|
16
|
+
*/
|
|
17
|
+
import { SizableText, useMedia, XStack } from '@hanzo/gui';
|
|
18
|
+
import { phrase } from '@hanzo/i18n';
|
|
19
|
+
import { useI18n } from '@hanzo/i18n/react';
|
|
20
|
+
import { Blocks, Bot, Briefcase, Brain, Monitor, Palette, Paperclip, Plug, Plus as PlusIcon, ScrollText, Telescope, Check, } from '@hanzogui/lucide-icons-2';
|
|
21
|
+
import { DropdownMenu, DropdownMenuBack, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuItem, DropdownMenuLoading, DropdownMenuPage, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from '../backends/gui/index.js';
|
|
22
|
+
import { useMemo, useState } from 'react';
|
|
23
|
+
import { RING } from './ring.js';
|
|
24
|
+
const ICON = 16;
|
|
25
|
+
/**
|
|
26
|
+
* The shelves, in the menu's order, with their names and marks, and the three
|
|
27
|
+
* sentences a shelf says of itself: its search's name, while it reads, and
|
|
28
|
+
* when it holds nothing. Whole sentences, so a language puts the noun where it goes.
|
|
29
|
+
*/
|
|
30
|
+
const SHELVES = [
|
|
31
|
+
{ key: 'agents', label: phrase('Agents'), search: phrase('Search agents'), reading: phrase('Reading agents'), none: phrase('No agents yet'), icon: _jsx(Bot, { size: ICON }) },
|
|
32
|
+
{ key: 'skills', label: phrase('Skills'), search: phrase('Search skills'), reading: phrase('Reading skills'), none: phrase('No skills yet'), icon: _jsx(ScrollText, { size: ICON }) },
|
|
33
|
+
{ key: 'connectors', label: phrase('Connectors'), search: phrase('Search connectors'), reading: phrase('Reading connectors'), none: phrase('No connectors yet'), icon: _jsx(Blocks, { size: ICON }) },
|
|
34
|
+
{ key: 'design', label: phrase('Design system'), search: phrase('Search design system'), reading: phrase('Reading design system'), none: phrase('No design system yet'), icon: _jsx(Palette, { size: ICON }) },
|
|
35
|
+
{ key: 'plugins', label: phrase('Plugins'), search: phrase('Search plugins'), reading: phrase('Reading plugins'), none: phrase('No plugins yet'), icon: _jsx(Plug, { size: ICON }) },
|
|
36
|
+
{ key: 'devices', label: phrase('Devices'), search: phrase('Search devices'), reading: phrase('Reading devices'), none: phrase('No devices yet'), icon: _jsx(Monitor, { size: ICON }) },
|
|
37
|
+
];
|
|
38
|
+
/** A row's anatomy: its mark, its label, a dim note, and a check when it is on. */
|
|
39
|
+
function Line({ icon, label, note, on, tail }) {
|
|
40
|
+
return (_jsxs(XStack, { flex: 1, minW: 0, items: "center", gap: 10, children: [icon ? (_jsx(XStack, { width: ICON, height: ICON, items: "center", justify: "center", shrink: 0, "aria-hidden": true, children: icon })) : null, _jsx(SizableText, { fontSize: 14, color: "$ink", numberOfLines: 1, shrink: 0, children: label }), note ? (_jsx(SizableText, { fontSize: 13, color: "$hint", numberOfLines: 1, flex: 1, minW: 0, children: note })) : (_jsx(XStack, { flex: 1 })), tail, on ? _jsx(Check, { size: ICON, color: "var(--primary)", "aria-hidden": true }) : null] }));
|
|
41
|
+
}
|
|
42
|
+
/** A shelf's rows, its status, then its ways to more. */
|
|
43
|
+
function Contents({ shelf, words, close }) {
|
|
44
|
+
const { t } = useI18n();
|
|
45
|
+
const [q, setQ] = useState('');
|
|
46
|
+
const needle = q.trim().toLowerCase();
|
|
47
|
+
const rows = needle ? shelf.rows.filter((r) => `${r.label} ${r.note ?? ''}`.toLowerCase().includes(needle)) : shelf.rows;
|
|
48
|
+
const links = [shelf.create, shelf.manage, shelf.browse].filter((l) => Boolean(l));
|
|
49
|
+
return (_jsxs(_Fragment, { children: [shelf.search ? _jsx(DropdownMenuSearch, { value: q, onValueChange: setQ, placeholder: shelf.search, "aria-label": t(words.search) }) : null, shelf.loading && !shelf.rows.length ? _jsx(DropdownMenuLoading, { children: t(words.reading) }) : null, shelf.error ? _jsx(DropdownMenuEmpty, { children: shelf.error }) : null, !shelf.loading && !shelf.error && !rows.length ? _jsx(DropdownMenuEmpty, { children: needle ? t('Nothing matches') : (shelf.empty ?? t(words.none)) }) : null, rows.map((r) => (_jsx(DropdownMenuItem, { preventCloseOnSelect: true, onSelect: () => shelf.pick(r.id), "aria-checked": r.on ?? false, "data-slot": "plus-row", children: _jsx(Line, { icon: r.icon, label: r.label, note: r.note, on: r.on }) }, r.id))), links.length ? _jsx(DropdownMenuSeparator, {}) : null, links.map((l, i) => (_jsx(DropdownMenuItem, { onSelect: () => {
|
|
50
|
+
close();
|
|
51
|
+
l.onPress();
|
|
52
|
+
}, children: _jsx(Line, { icon: l === shelf.manage ? _jsx(Briefcase, { size: ICON }) : _jsx(PlusIcon, { size: ICON }), label: l.label }) }, l.label)))] }));
|
|
53
|
+
}
|
|
54
|
+
/** The `+` and its menu. */
|
|
55
|
+
export function Plus(p) {
|
|
56
|
+
const { t } = useI18n();
|
|
57
|
+
const media = useMedia();
|
|
58
|
+
const wide = media.sm;
|
|
59
|
+
const [open, setOpen] = useState(false);
|
|
60
|
+
// The shelf open beside the menu.
|
|
61
|
+
const [sub, setSub] = useState(null);
|
|
62
|
+
const close = () => setOpen(false);
|
|
63
|
+
const shelves = useMemo(() => SHELVES.filter((s) => p[s.key]), [p]);
|
|
64
|
+
const switches = [
|
|
65
|
+
p.research ? { key: 'research', label: t('Research'), icon: _jsx(Telescope, { size: ICON }), s: p.research } : null,
|
|
66
|
+
p.memory ? { key: 'memory', label: t('Memory'), icon: _jsx(Brain, { size: ICON }), s: p.memory } : null,
|
|
67
|
+
].filter((x) => x !== null);
|
|
68
|
+
const main = (_jsxs(_Fragment, { children: [p.upload ? (_jsx(DropdownMenuItem, { "data-slot": "plus-upload", onSelect: () => {
|
|
69
|
+
close();
|
|
70
|
+
p.upload?.();
|
|
71
|
+
}, children: _jsx(Line, { icon: _jsx(Paperclip, { size: ICON }), label: t('Upload or add files'), tail: _jsx(DropdownMenuShortcut, { "data-i18n-ltr": true, children: "Ctrl+U" }) }) })) : null, p.upload && shelves.length ? _jsx(DropdownMenuSeparator, {}) : null, shelves.map((s) => wide ? (_jsxs(DropdownMenuSub, { open: sub === s.key, onOpenChange: (o) => setSub(o ? s.key : sub === s.key ? null : sub), children: [_jsx(DropdownMenuSubTrigger, { "data-slot": `plus-${s.key}`, onPress: () => setSub(s.key), children: _jsx(Line, { icon: s.icon, label: t(s.label) }) }), sub === s.key ? (_jsx(DropdownMenuSubContent, { minW: 200, maxW: 340, maxH: 420, pointerEvents: "auto", style: { overflowY: "auto" }, children: _jsx(Contents, { shelf: p[s.key], words: s, close: close }) })) : null] }, s.key)) : (_jsx(DropdownMenuItem, { page: s.key, "data-slot": `plus-${s.key}`, children: _jsx(Line, { icon: s.icon, label: t(s.label) }) }, s.key))), switches.length && (p.upload || shelves.length) ? _jsx(DropdownMenuSeparator, {}) : null, switches.map((w) => (_jsx(DropdownMenuItem, { preventCloseOnSelect: true, onSelect: () => w.s.set(!w.s.on), role: 'menuitemcheckbox', "aria-checked": w.s.on, "data-slot": `plus-${w.key}`, children: _jsx(Line, { icon: w.icon, label: w.label, on: w.s.on }) }, w.key)))] }));
|
|
72
|
+
return (_jsxs(DropdownMenu, { open: open, onOpenChange: setOpen, ...(wide ? null : { defaultPage: 'main' }), children: [_jsx(DropdownMenuTrigger, { asChild: true, disabled: p.disabled, children: _jsx(XStack, { render: "button", "data-slot": "plus", "aria-label": t('Add files, agents, skills and more'), width: p.size ?? 36, height: p.size ?? 36, rounded: 999, items: "center", justify: "center", shrink: 0, cursor: p.disabled ? 'default' : 'pointer', opacity: p.disabled ? 0.4 : 1, bg: open ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(PlusIcon, { size: 18, color: "$ink" }) }) }), _jsx(DropdownMenuContent, { align: "start", minW: 240, "data-slot": "plus-menu", children: wide ? (main) : (_jsxs(_Fragment, { children: [_jsx(DropdownMenuPage, { id: "main", children: main }), shelves.map((s) => (_jsxs(DropdownMenuPage, { id: s.key, children: [_jsx(DropdownMenuBack, { children: t(s.label) }), _jsx(Contents, { shelf: p[s.key], words: s, close: close })] }, s.key)))] })) })] }));
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=Plus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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,CAAC,GAAG,aACrC,KAAC,gBAAgB,cAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAoB,EACjD,KAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAU,CAAE,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,GAAI,KAFxC,CAAC,CAAC,GAAG,CAGT,CACpB,CAAC,IACD,CACJ,GACmB,IACT,CAChB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Choices = Choices;
|
|
5
|
+
exports.Chips = Chips;
|
|
6
|
+
exports.Tune = Tune;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
/**
|
|
9
|
+
* The row under the composer's frame: the surface's chips at its start, and at
|
|
10
|
+
* its end the model, the effort (dim) and the mode, each opening its choices.
|
|
11
|
+
*
|
|
12
|
+
* The model is `ModelPicker` in its quiet look — the one picker, here as a word
|
|
13
|
+
* in a row — and is drawn only where the person turned the model selector on
|
|
14
|
+
* (`useComposing`). The effort and the mode are lists the surface hands over: a
|
|
15
|
+
* chat offers all six efforts and the modes Auto and Manual, Dev's runs a subset
|
|
16
|
+
* and add Plan. The chips are the surface's own: Chat's are the model families
|
|
17
|
+
* the catalog lists, Dev's are the places a run reaches.
|
|
18
|
+
*
|
|
19
|
+
* Its words are the reader's language (@hanzo/i18n `t`): efforts and modes are
|
|
20
|
+
* marked English (`phrase`), drawn through `t`; model names are the catalog's.
|
|
21
|
+
*/
|
|
22
|
+
const gui_1 = require("@hanzo/gui");
|
|
23
|
+
const react_1 = require("@hanzo/i18n/react");
|
|
24
|
+
const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
|
|
25
|
+
const react_2 = require("react");
|
|
26
|
+
const gui_2 = require("../backends/gui/index.cjs");
|
|
27
|
+
const catalog_1 = require("../models/catalog.cjs");
|
|
28
|
+
const ModelPicker_1 = require("../models/ModelPicker.cjs");
|
|
29
|
+
/** A text button in the row. */
|
|
30
|
+
function Word({ children, dim = false, label, open }) {
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { render: "button", "aria-label": label, "aria-expanded": open, items: "center", height: 24, px: 6, rounded: 6, cursor: "pointer", bg: open ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineColor: '$outlineColor', outlineWidth: 2, outlineStyle: 'solid' }, "$max-sm": { height: 44, px: 8 }, children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { fontSize: 14, fontWeight: dim ? '400' : '500', color: dim ? '$hint' : '$ink', numberOfLines: 1, children: children }) }));
|
|
32
|
+
}
|
|
33
|
+
/** A titled list of choices, a check on the one in force. */
|
|
34
|
+
function Choices({ title, items, value, onPick }) {
|
|
35
|
+
const { t } = (0, react_1.useI18n)();
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { role: 'listbox', "aria-label": title, gap: 2, "data-slot": "choices", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { fontSize: 13, color: "$hint", px: 10, pt: 6, pb: 4, children: title }), items.map((c) => ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { render: "button", role: "option", "aria-selected": c.id === value, "aria-disabled": c.off || undefined, onPress: () => !c.off && onPick(c.id), items: "flex-start", gap: 12, px: 10, py: 8, rounded: 8, width: "100%", cursor: c.off ? 'default' : 'pointer', opacity: c.off ? 0.5 : 1, hoverStyle: c.off ? undefined : { bg: '$hover' }, children: [(0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { fontSize: 14, color: "$ink", style: { textAlign: 'start' }, children: t(c.label) }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { fontSize: 13, color: "$hint", style: { textAlign: 'start' }, children: t(c.note) })] }), c.id === value ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Check, { size: 16, color: "var(--primary)", mt: 2, "aria-hidden": true }) : null] }, c.id)))] }));
|
|
37
|
+
}
|
|
38
|
+
/** A word in the row that opens a panel of choices. */
|
|
39
|
+
function Opens({ label, word, dim, pill, children }) {
|
|
40
|
+
const [open, setOpen] = (0, react_2.useState)(false);
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(gui_2.Popover, { open: open, onOpenChange: setOpen, allowFlip: true, placement: "top-end", children: [(0, jsx_runtime_1.jsx)(gui_2.PopoverTrigger, { asChild: true, children: pill ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { render: "button", "data-slot": "mode", "aria-label": label, "aria-expanded": open, items: "center", height: 24, px: 8, marginInlineStart: 4, rounded: 6, bg: "$hover", cursor: "pointer", hoverStyle: { bg: '$raised' }, focusVisibleStyle: { outlineColor: '$outlineColor', outlineWidth: 2, outlineStyle: 'solid' }, "$max-sm": { height: 44, px: 12 }, children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { fontSize: 14, color: "$ink", children: word }) })) : ((0, jsx_runtime_1.jsx)(gui_1.XStack, { children: (0, jsx_runtime_1.jsx)(Word, { label: label, dim: dim, open: open, children: word }) })) }), (0, jsx_runtime_1.jsx)(gui_2.PopoverContent, { solid: true, p: 6, width: 288, maxW: "calc(100vw - 24px)", children: children(() => setOpen(false)) })] }));
|
|
42
|
+
}
|
|
43
|
+
/** The surface's chips: one tap each, the one in force marked. */
|
|
44
|
+
function Chips({ chips }) {
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { "data-slot": "composer-chips", items: "center", gap: 4, flexWrap: "wrap", rowGap: 4, minW: 0, shrink: 1, maxW: "100%", children: chips.map((c) => ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { render: "button", "data-slot": "composer-chip", "aria-pressed": c.on ?? undefined, onPress: c.onPress, items: "center", gap: 6, height: 26, px: 10, rounded: 999, borderWidth: 1, borderColor: c.on ? '$rim' : '$borderColor', bg: c.on ? '$hover' : 'transparent', cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineColor: '$outlineColor', outlineWidth: 2, outlineStyle: 'solid' }, "$max-sm": { height: 36, px: 12 }, children: [c.icon ? (0, jsx_runtime_1.jsx)(gui_1.XStack, { "aria-hidden": true, "$max-sm": { display: 'none' }, children: c.icon }) : null, (0, jsx_runtime_1.jsx)(gui_1.SizableText, { fontSize: 13, color: c.on ? '$ink' : '$quiet', numberOfLines: 1, children: c.label })] }, c.id))) }));
|
|
46
|
+
}
|
|
47
|
+
/** The row's end: the model where it is shown, and the mode. The effort is the composer's dial. */
|
|
48
|
+
function Tune({ mind, mode, onUpgrade, limits, }) {
|
|
49
|
+
const { t } = (0, react_1.useI18n)();
|
|
50
|
+
const now = mode ? mode.items.find((m) => m.id === mode.value) : undefined;
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { "data-slot": "tune", items: "center", gap: 2, marginInlineStart: "auto", shrink: 0, children: [mind ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { "data-slot": "mind", children: (0, jsx_runtime_1.jsx)(ModelPicker_1.ModelPicker, { quiet: true, size: "sm", name: t('Model'), describe: t('Model: {name}', { name: (0, catalog_1.modelName)(mind.models.find((m) => m.id === mind.model) ?? { id: mind.model }) }), models: mind.models, value: mind.model, onChange: mind.pick, loading: mind.loading, error: mind.error, limits: limits, granted: (id) => (0, catalog_1.grants)(mind.free, id, mind.models), ...(onUpgrade ? { onUpgrade } : {}) }) })) : null, mode && now ? ((0, jsx_runtime_1.jsx)(Opens, { label: t('Mode: {mode}', { mode: t(now.label) }), word: t(now.label), pill: true, children: (close) => ((0, jsx_runtime_1.jsx)(Choices, { title: t('Mode'), items: mode.items, value: mode.value, onPick: (m) => {
|
|
52
|
+
mode.set(m);
|
|
53
|
+
close();
|
|
54
|
+
} })) })) : null] }));
|
|
55
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ModelCatalogEntry, type PauseSource } from '../models/catalog.js';
|
|
3
|
+
import type { Way } from './ways.js';
|
|
4
|
+
/** Which model answers: the host's store (Chat and Dev share one), as the composer reads it. */
|
|
5
|
+
export interface Mind {
|
|
6
|
+
model: string;
|
|
7
|
+
models: ModelCatalogEntry[];
|
|
8
|
+
loading: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
/** A list shown from before, because this read failed. */
|
|
11
|
+
note: string;
|
|
12
|
+
/** The plan grants only the free lane: anything else is an upgrade, never a pick. */
|
|
13
|
+
free: boolean;
|
|
14
|
+
pick: (id: string) => void;
|
|
15
|
+
}
|
|
16
|
+
/** A short list the surface owns, one in force: the effort, or the mode as the pill at the row's end. */
|
|
17
|
+
export interface Modes<T extends string = string> {
|
|
18
|
+
value: T;
|
|
19
|
+
/** A method, so a surface's own union (`'auto' | 'plan'`) is a `Modes` without a cast. */
|
|
20
|
+
set(mode: T): void;
|
|
21
|
+
items: readonly Way<T>[];
|
|
22
|
+
}
|
|
23
|
+
/** One chip under the frame: a quick pick, a place to go. `on` marks the one in force. */
|
|
24
|
+
export interface Chip {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
on?: boolean;
|
|
29
|
+
onPress: () => void;
|
|
30
|
+
}
|
|
31
|
+
/** A titled list of choices, a check on the one in force. */
|
|
32
|
+
export declare function Choices<T extends string>({ title, items, value, onPick }: {
|
|
33
|
+
title: string;
|
|
34
|
+
items: readonly Way<T>[];
|
|
35
|
+
value: T;
|
|
36
|
+
onPick: (id: T) => void;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
/** The surface's chips: one tap each, the one in force marked. */
|
|
39
|
+
export declare function Chips({ chips }: {
|
|
40
|
+
chips: readonly Chip[];
|
|
41
|
+
}): import("react").JSX.Element;
|
|
42
|
+
/** The row's end: the model where it is shown, and the mode. The effort is the composer's dial. */
|
|
43
|
+
export declare function Tune({ mind, mode, onUpgrade, limits, }: {
|
|
44
|
+
mind?: Mind | null;
|
|
45
|
+
mode?: Modes | null;
|
|
46
|
+
onUpgrade?: (model: string) => void;
|
|
47
|
+
limits?: PauseSource | null;
|
|
48
|
+
}): import("react").JSX.Element;
|
|
49
|
+
//# sourceMappingURL=Tune.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tune.d.ts","sourceRoot":"","sources":["../../src/chat/Tune.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGhD,OAAO,EAAqB,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAEjC,gGAAgG;AAChG,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,iBAAiB,EAAE,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IACZ,qFAAqF;IACrF,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC3B;AAED,yGAAyG;AACzG,MAAM,WAAW,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC9C,KAAK,EAAE,CAAC,CAAA;IACR,0FAA0F;IAC1F,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;CACzB;AAED,0FAA0F;AAC1F,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AA0BD,6DAA6D;AAC7D,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAA;CAAE,+BAuCxJ;AA4CD,kEAAkE;AAClE,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,IAAI,EAAE,CAAA;CAAE,+BAgC1D;AAED,mGAAmG;AACnG,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,MAAM,GACP,EAAE;IACD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CAC5B,+BAwCA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The row under the composer's frame: the surface's chips at its start, and at
|
|
5
|
+
* its end the model, the effort (dim) and the mode, each opening its choices.
|
|
6
|
+
*
|
|
7
|
+
* The model is `ModelPicker` in its quiet look — the one picker, here as a word
|
|
8
|
+
* in a row — and is drawn only where the person turned the model selector on
|
|
9
|
+
* (`useComposing`). The effort and the mode are lists the surface hands over: a
|
|
10
|
+
* chat offers all six efforts and the modes Auto and Manual, Dev's runs a subset
|
|
11
|
+
* and add Plan. The chips are the surface's own: Chat's are the model families
|
|
12
|
+
* the catalog lists, Dev's are the places a run reaches.
|
|
13
|
+
*
|
|
14
|
+
* Its words are the reader's language (@hanzo/i18n `t`): efforts and modes are
|
|
15
|
+
* marked English (`phrase`), drawn through `t`; model names are the catalog's.
|
|
16
|
+
*/
|
|
17
|
+
import { SizableText, XStack, YStack } from '@hanzo/gui';
|
|
18
|
+
import { useI18n } from '@hanzo/i18n/react';
|
|
19
|
+
import { Check } from '@hanzogui/lucide-icons-2';
|
|
20
|
+
import { useState } from 'react';
|
|
21
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../backends/gui/index.js';
|
|
22
|
+
import { grants, modelName } from '../models/catalog.js';
|
|
23
|
+
import { ModelPicker } from '../models/ModelPicker.js';
|
|
24
|
+
/** A text button in the row. */
|
|
25
|
+
function Word({ children, dim = false, label, open }) {
|
|
26
|
+
return (_jsx(XStack, { render: "button", "aria-label": label, "aria-expanded": open, items: "center", height: 24, px: 6, rounded: 6, cursor: "pointer", bg: open ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineColor: '$outlineColor', outlineWidth: 2, outlineStyle: 'solid' }, "$max-sm": { height: 44, px: 8 }, children: _jsx(SizableText, { fontSize: 14, fontWeight: dim ? '400' : '500', color: dim ? '$hint' : '$ink', numberOfLines: 1, children: children }) }));
|
|
27
|
+
}
|
|
28
|
+
/** A titled list of choices, a check on the one in force. */
|
|
29
|
+
export function Choices({ title, items, value, onPick }) {
|
|
30
|
+
const { t } = useI18n();
|
|
31
|
+
return (_jsxs(YStack, { role: 'listbox', "aria-label": title, gap: 2, "data-slot": "choices", children: [_jsx(SizableText, { fontSize: 13, color: "$hint", px: 10, pt: 6, pb: 4, children: title }), items.map((c) => (_jsxs(XStack, { render: "button", role: "option", "aria-selected": c.id === value, "aria-disabled": c.off || undefined, onPress: () => !c.off && onPick(c.id), items: "flex-start", gap: 12, px: 10, py: 8, rounded: 8, width: "100%", cursor: c.off ? 'default' : 'pointer', opacity: c.off ? 0.5 : 1, hoverStyle: c.off ? undefined : { bg: '$hover' }, children: [_jsxs(YStack, { flex: 1, minW: 0, items: "flex-start", gap: 2, children: [_jsx(SizableText, { fontSize: 14, color: "$ink", style: { textAlign: 'start' }, children: t(c.label) }), _jsx(SizableText, { fontSize: 13, color: "$hint", style: { textAlign: 'start' }, children: t(c.note) })] }), c.id === value ? _jsx(Check, { size: 16, color: "var(--primary)", mt: 2, "aria-hidden": true }) : null] }, c.id)))] }));
|
|
32
|
+
}
|
|
33
|
+
/** A word in the row that opens a panel of choices. */
|
|
34
|
+
function Opens({ label, word, dim, pill, children }) {
|
|
35
|
+
const [open, setOpen] = useState(false);
|
|
36
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, allowFlip: true, placement: "top-end", children: [_jsx(PopoverTrigger, { asChild: true, children: pill ? (_jsx(XStack, { render: "button", "data-slot": "mode", "aria-label": label, "aria-expanded": open, items: "center", height: 24, px: 8, marginInlineStart: 4, rounded: 6, bg: "$hover", cursor: "pointer", hoverStyle: { bg: '$raised' }, focusVisibleStyle: { outlineColor: '$outlineColor', outlineWidth: 2, outlineStyle: 'solid' }, "$max-sm": { height: 44, px: 12 }, children: _jsx(SizableText, { fontSize: 14, color: "$ink", children: word }) })) : (_jsx(XStack, { children: _jsx(Word, { label: label, dim: dim, open: open, children: word }) })) }), _jsx(PopoverContent, { solid: true, p: 6, width: 288, maxW: "calc(100vw - 24px)", children: children(() => setOpen(false)) })] }));
|
|
37
|
+
}
|
|
38
|
+
/** The surface's chips: one tap each, the one in force marked. */
|
|
39
|
+
export function Chips({ chips }) {
|
|
40
|
+
return (_jsx(XStack, { "data-slot": "composer-chips", items: "center", gap: 4, flexWrap: "wrap", rowGap: 4, minW: 0, shrink: 1, maxW: "100%", children: chips.map((c) => (_jsxs(XStack, { render: "button", "data-slot": "composer-chip", "aria-pressed": c.on ?? undefined, onPress: c.onPress, items: "center", gap: 6, height: 26, px: 10, rounded: 999, borderWidth: 1, borderColor: c.on ? '$rim' : '$borderColor', bg: c.on ? '$hover' : 'transparent', cursor: "pointer", hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineColor: '$outlineColor', outlineWidth: 2, outlineStyle: 'solid' }, "$max-sm": { height: 36, px: 12 }, children: [c.icon ? _jsx(XStack, { "aria-hidden": true, "$max-sm": { display: 'none' }, children: c.icon }) : null, _jsx(SizableText, { fontSize: 13, color: c.on ? '$ink' : '$quiet', numberOfLines: 1, children: c.label })] }, c.id))) }));
|
|
41
|
+
}
|
|
42
|
+
/** The row's end: the model where it is shown, and the mode. The effort is the composer's dial. */
|
|
43
|
+
export function Tune({ mind, mode, onUpgrade, limits, }) {
|
|
44
|
+
const { t } = useI18n();
|
|
45
|
+
const now = mode ? mode.items.find((m) => m.id === mode.value) : undefined;
|
|
46
|
+
return (_jsxs(XStack, { "data-slot": "tune", items: "center", gap: 2, marginInlineStart: "auto", shrink: 0, children: [mind ? (_jsx(XStack, { "data-slot": "mind", children: _jsx(ModelPicker, { quiet: true, size: "sm", name: t('Model'), describe: t('Model: {name}', { name: modelName(mind.models.find((m) => m.id === mind.model) ?? { id: mind.model }) }), models: mind.models, value: mind.model, onChange: mind.pick, loading: mind.loading, error: mind.error, limits: limits, granted: (id) => grants(mind.free, id, mind.models), ...(onUpgrade ? { onUpgrade } : {}) }) })) : null, mode && now ? (_jsx(Opens, { label: t('Mode: {mode}', { mode: t(now.label) }), word: t(now.label), pill: true, children: (close) => (_jsx(Choices, { title: t('Mode'), items: mode.items, value: mode.value, onPick: (m) => {
|
|
47
|
+
mode.set(m);
|
|
48
|
+
close();
|
|
49
|
+
} })) })) : null] }));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=Tune.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tune.js","sourceRoot":"","sources":["../../src/chat/Tune.tsx"],"names":[],"mappings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,CAAC,KAAK,EAAE,EAAE,CAAC,CACV,KAAC,OAAO,IACN,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAChB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;wBACZ,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;wBACX,KAAK,EAAE,CAAA;oBACT,CAAC,GACD,CACH,GACK,CACT,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAA;AACH,CAAC"}
|
package/dist/chat/index.cjs
CHANGED
|
@@ -14,12 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.clip = void 0;
|
|
17
|
+
exports.Code = exports.Aside = exports.AsideToggle = exports.ShareButton = exports.HeaderButton = exports.Header = exports.StatusDot = exports.RailNotice = exports.RailBar = exports.SessionRail = exports.SidebarUser = exports.SidebarFolder = exports.SidebarItem = exports.SidebarSection = exports.SidebarScroll = exports.SidebarNewChat = exports.SidebarIconButton = exports.SidebarHeader = exports.Sidebar = exports.SLACK = exports.pinned = exports.sends = exports.ready = exports.Thread = exports.Message = exports.Caret = exports.Home = exports.NEXT = exports.EmptyPrompt = exports.trigger = exports.Palette = exports.LANGUAGES = exports.Dictation = exports.Plus = exports.EFFORTS = exports.useFamilies = exports.Tune = exports.Chips = exports.useUpload = exports.ROUND = exports.measure = exports.MEASURE = exports.GAP = exports.ASK = exports.Composer = exports.join = exports.Piece = exports.Parts = exports.words = exports.Chat = void 0;
|
|
18
|
+
exports.clip = exports.Persona = exports.SourceCard = exports.Sources = exports.Inspector = exports.Preview = exports.made = exports.answer = exports.read = exports.stage = exports.EMPTY = exports.TOOLS = exports.Failure = exports.Step = void 0;
|
|
19
19
|
/**
|
|
20
20
|
* @hanzo/ui/chat — the one chat shell, on @hanzo/gui primitives.
|
|
21
21
|
*
|
|
22
|
-
* Thread scrolls, Message presents a turn, Composer
|
|
22
|
+
* Thread scrolls, Message presents a turn, Composer is the one composer, Sidebar
|
|
23
23
|
* navigates between conversations, Header names the current one, and Code,
|
|
24
24
|
* Step, Failure and Sources present the pieces of a turn.
|
|
25
25
|
*
|
|
@@ -61,8 +61,29 @@ Object.defineProperty(exports, "Piece", { enumerable: true, get: function () { r
|
|
|
61
61
|
Object.defineProperty(exports, "join", { enumerable: true, get: function () { return Parts_1.join; } });
|
|
62
62
|
var Composer_1 = require("./Composer.cjs");
|
|
63
63
|
Object.defineProperty(exports, "Composer", { enumerable: true, get: function () { return Composer_1.Composer; } });
|
|
64
|
-
Object.defineProperty(exports, "ComposerTool", { enumerable: true, get: function () { return Composer_1.ComposerTool; } });
|
|
65
64
|
Object.defineProperty(exports, "ASK", { enumerable: true, get: function () { return Composer_1.ASK; } });
|
|
65
|
+
Object.defineProperty(exports, "GAP", { enumerable: true, get: function () { return Composer_1.GAP; } });
|
|
66
|
+
Object.defineProperty(exports, "MEASURE", { enumerable: true, get: function () { return Composer_1.MEASURE; } });
|
|
67
|
+
Object.defineProperty(exports, "measure", { enumerable: true, get: function () { return Composer_1.measure; } });
|
|
68
|
+
Object.defineProperty(exports, "ROUND", { enumerable: true, get: function () { return Composer_1.ROUND; } });
|
|
69
|
+
Object.defineProperty(exports, "useUpload", { enumerable: true, get: function () { return Composer_1.useUpload; } });
|
|
70
|
+
var Tune_1 = require("./Tune.cjs");
|
|
71
|
+
Object.defineProperty(exports, "Chips", { enumerable: true, get: function () { return Tune_1.Chips; } });
|
|
72
|
+
Object.defineProperty(exports, "Tune", { enumerable: true, get: function () { return Tune_1.Tune; } });
|
|
73
|
+
var Families_1 = require("./Families.cjs");
|
|
74
|
+
Object.defineProperty(exports, "useFamilies", { enumerable: true, get: function () { return Families_1.useFamilies; } });
|
|
75
|
+
var ways_1 = require("./ways.cjs");
|
|
76
|
+
Object.defineProperty(exports, "EFFORTS", { enumerable: true, get: function () { return ways_1.EFFORTS; } });
|
|
77
|
+
var Plus_1 = require("./Plus.cjs");
|
|
78
|
+
Object.defineProperty(exports, "Plus", { enumerable: true, get: function () { return Plus_1.Plus; } });
|
|
79
|
+
var Dictation_1 = require("./Dictation.cjs");
|
|
80
|
+
Object.defineProperty(exports, "Dictation", { enumerable: true, get: function () { return Dictation_1.Dictation; } });
|
|
81
|
+
var languages_1 = require("./languages.cjs");
|
|
82
|
+
Object.defineProperty(exports, "LANGUAGES", { enumerable: true, get: function () { return languages_1.LANGUAGES; } });
|
|
83
|
+
var Palette_1 = require("./Palette.cjs");
|
|
84
|
+
Object.defineProperty(exports, "Palette", { enumerable: true, get: function () { return Palette_1.Palette; } });
|
|
85
|
+
var Mention_1 = require("./Mention.cjs");
|
|
86
|
+
Object.defineProperty(exports, "trigger", { enumerable: true, get: function () { return Mention_1.trigger; } });
|
|
66
87
|
var EmptyPrompt_1 = require("./EmptyPrompt.cjs");
|
|
67
88
|
Object.defineProperty(exports, "EmptyPrompt", { enumerable: true, get: function () { return EmptyPrompt_1.EmptyPrompt; } });
|
|
68
89
|
Object.defineProperty(exports, "NEXT", { enumerable: true, get: function () { return EmptyPrompt_1.NEXT; } });
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @hanzo/ui/chat — the one chat shell, on @hanzo/gui primitives.
|
|
3
3
|
*
|
|
4
|
-
* Thread scrolls, Message presents a turn, Composer
|
|
4
|
+
* Thread scrolls, Message presents a turn, Composer is the one composer, Sidebar
|
|
5
5
|
* navigates between conversations, Header names the current one, and Code,
|
|
6
6
|
* Step, Failure and Sources present the pieces of a turn.
|
|
7
7
|
*
|
|
@@ -36,12 +36,20 @@
|
|
|
36
36
|
export { Chat, type ChatProps, type Turn } from './Chat.js';
|
|
37
37
|
export { words, type Part, type Said } from './words.js';
|
|
38
38
|
export { Parts, Piece, join, type MessagePart, type PartActions, type PartsProps, type PieceProps, } from './Parts.js';
|
|
39
|
-
export { Composer,
|
|
39
|
+
export { Composer, ASK, GAP, MEASURE, measure, ROUND, useUpload, type Carried, type ComposerProps, } from './Composer.js';
|
|
40
|
+
export { Chips, Tune, type Chip, type Mind, type Modes } from './Tune.js';
|
|
41
|
+
export { useFamilies } from './Families.js';
|
|
42
|
+
export { EFFORTS, type Effort, type Way } from './ways.js';
|
|
43
|
+
export { Plus, type Link, type PlusProps, type Row as ShelfRow, type Shelf, type Switch } from './Plus.js';
|
|
44
|
+
export { Dictation, type DictationProps } from './Dictation.js';
|
|
45
|
+
export { LANGUAGES } from './languages.js';
|
|
46
|
+
export { Palette, type Command } from './Palette.js';
|
|
47
|
+
export { trigger } from './Mention.js';
|
|
40
48
|
export { EmptyPrompt, NEXT, type EmptyPromptProps } from './EmptyPrompt.js';
|
|
41
49
|
export { Home, type HomeProps } from './Home.js';
|
|
42
50
|
export { Caret, Message, type MessageProps, type Role } from './Message.js';
|
|
43
51
|
export { Thread, type ThreadProps } from './Thread.js';
|
|
44
|
-
export { ready, sends, type Mods } from './send.js';
|
|
52
|
+
export { ready, sends, type Mods, type Rule } from './send.js';
|
|
45
53
|
export { pinned, SLACK, type Track } from './stick.js';
|
|
46
54
|
export { Sidebar, SidebarHeader, SidebarIconButton, SidebarNewChat, SidebarScroll, SidebarSection, SidebarItem, SidebarFolder, SidebarUser, type SidebarProps, type SidebarHeaderProps, type SidebarIconButtonProps, type SidebarNewChatProps, type SidebarSectionProps, type SidebarItemProps, type SidebarFolderProps, type SidebarUserProps, } from './Sidebar.js';
|
|
47
55
|
export { SessionRail, RailBar, RailNotice, StatusDot, type RailAccount, type RailBarProps, type RailLink, type RailNoticeProps, type RailSession, type SessionRailProps, type SessionStatus, } from './SessionRail.js';
|
package/dist/chat/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,QAAQ,EACR,GAAG,EACH,GAAG,EACH,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAK,OAAO,EACZ,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,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AE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/chat/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @hanzo/ui/chat — the one chat shell, on @hanzo/gui primitives.
|
|
3
3
|
*
|
|
4
|
-
* Thread scrolls, Message presents a turn, Composer
|
|
4
|
+
* Thread scrolls, Message presents a turn, Composer is the one composer, Sidebar
|
|
5
5
|
* navigates between conversations, Header names the current one, and Code,
|
|
6
6
|
* Step, Failure and Sources present the pieces of a turn.
|
|
7
7
|
*
|
|
@@ -36,7 +36,15 @@
|
|
|
36
36
|
export { Chat } from './Chat.js';
|
|
37
37
|
export { words } from './words.js';
|
|
38
38
|
export { Parts, Piece, join, } from './Parts.js';
|
|
39
|
-
export { Composer,
|
|
39
|
+
export { Composer, ASK, GAP, MEASURE, measure, ROUND, useUpload, } from './Composer.js';
|
|
40
|
+
export { Chips, Tune } from './Tune.js';
|
|
41
|
+
export { useFamilies } from './Families.js';
|
|
42
|
+
export { EFFORTS } from './ways.js';
|
|
43
|
+
export { Plus } from './Plus.js';
|
|
44
|
+
export { Dictation } from './Dictation.js';
|
|
45
|
+
export { LANGUAGES } from './languages.js';
|
|
46
|
+
export { Palette } from './Palette.js';
|
|
47
|
+
export { trigger } from './Mention.js';
|
|
40
48
|
export { EmptyPrompt, NEXT } from './EmptyPrompt.js';
|
|
41
49
|
export { Home } from './Home.js';
|
|
42
50
|
export { Caret, Message } from './Message.js';
|
package/dist/chat/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,IAAI,EAA6B,MAAM,QAAQ,CAAA;AACxD,OAAO,EAAE,KAAK,EAAwB,MAAM,SAAS,CAAA;AACrD,OAAO,EACL,KAAK,EACL,KAAK,EACL,IAA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EACL,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,GASZ,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,WAAW,EACX,OAAO,EACP,UAAU,EACV,SAAS,GAQV,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,MAAM,EACN,YAAY,EACZ,WAAW,EACX,WAAW,EACX,KAAK,GAMN,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,IAAI,EAA4B,MAAM,QAAQ,CAAA;AACvD,OAAO,EAAE,OAAO,EAAqB,MAAM,WAAW,CAAA;AAEtD;;;;;;;;GAQG;AACH,OAAO,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,MAAM,EACN,IAAI,GAOL,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,OAAO,EAAqB,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,SAAS,EAAqC,MAAM,aAAa,CAAA;AAE1E,OAAO,EACL,OAAO,EACP,UAAU,GAIX,MAAM,WAAW,CAAA;AAElB;;;;;;;GAOG;AACH,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAgD,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LANGUAGES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The languages dictation listens in, each named in itself. The platform hears
|
|
6
|
+
* the audio, never a browser's built-in recognizer, which ships it to its vendor.
|
|
7
|
+
* Its own module with no imports, so a surface that only names a language
|
|
8
|
+
* (a settings page, a spec) loads it without the composer.
|
|
9
|
+
*/
|
|
10
|
+
exports.LANGUAGES = [
|
|
11
|
+
{ id: 'en', label: 'English' },
|
|
12
|
+
{ id: 'es', label: 'Español' },
|
|
13
|
+
{ id: 'fr', label: 'Français' },
|
|
14
|
+
{ id: 'de', label: 'Deutsch' },
|
|
15
|
+
{ id: 'ja', label: '日本語' },
|
|
16
|
+
{ id: 'zh', label: '中文' },
|
|
17
|
+
];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The languages dictation listens in, each named in itself. The platform hears
|
|
3
|
+
* the audio, never a browser's built-in recognizer, which ships it to its vendor.
|
|
4
|
+
* Its own module with no imports, so a surface that only names a language
|
|
5
|
+
* (a settings page, a spec) loads it without the composer.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LANGUAGES: {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}[];
|
|
11
|
+
//# sourceMappingURL=languages.d.ts.map
|