@assistant-ui/react 0.7.7 → 0.7.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.
- package/dist/primitives/threadList/ThreadListItems.d.ts +2 -2
- package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
- package/dist/primitives/threadList/ThreadListItems.mjs.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.js +23 -6
- package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.mjs +24 -9
- package/dist/primitives/threadList/ThreadListNew.mjs.map +1 -1
- package/dist/styles/index.css +66 -0
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/tailwindcss/thread.css +30 -0
- package/dist/styles/tailwindcss/thread.css.json +21 -0
- package/dist/ui/assistant-action-bar.d.ts +7 -7
- package/dist/ui/assistant-action-bar.d.ts.map +1 -1
- package/dist/ui/assistant-action-bar.js.map +1 -1
- package/dist/ui/assistant-action-bar.mjs +1 -3
- package/dist/ui/assistant-action-bar.mjs.map +1 -1
- package/dist/ui/assistant-modal.d.ts +3 -3
- package/dist/ui/assistant-modal.d.ts.map +1 -1
- package/dist/ui/assistant-modal.js.map +1 -1
- package/dist/ui/assistant-modal.mjs +1 -3
- package/dist/ui/assistant-modal.mjs.map +1 -1
- package/dist/ui/attachment-ui.d.ts +2 -2
- package/dist/ui/attachment-ui.d.ts.map +1 -1
- package/dist/ui/attachment-ui.js.map +1 -1
- package/dist/ui/attachment-ui.mjs +1 -3
- package/dist/ui/attachment-ui.mjs.map +1 -1
- package/dist/ui/base/index.d.ts +1 -1
- package/dist/ui/base/index.d.ts.map +1 -1
- package/dist/ui/base/index.js.map +1 -1
- package/dist/ui/base/index.mjs +1 -3
- package/dist/ui/base/index.mjs.map +1 -1
- package/dist/ui/base/tooltip-icon-button.d.ts +6 -4
- package/dist/ui/base/tooltip-icon-button.d.ts.map +1 -1
- package/dist/ui/base/tooltip-icon-button.js.map +1 -1
- package/dist/ui/base/tooltip-icon-button.mjs.map +1 -1
- package/dist/ui/branch-picker.d.ts +3 -3
- package/dist/ui/branch-picker.d.ts.map +1 -1
- package/dist/ui/branch-picker.js.map +1 -1
- package/dist/ui/branch-picker.mjs +1 -3
- package/dist/ui/branch-picker.mjs.map +1 -1
- package/dist/ui/composer.d.ts +4 -4
- package/dist/ui/composer.d.ts.map +1 -1
- package/dist/ui/composer.js.map +1 -1
- package/dist/ui/composer.mjs +1 -3
- package/dist/ui/composer.mjs.map +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +6 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +4 -0
- package/dist/ui/index.mjs.map +1 -1
- package/dist/ui/thread-config.d.ts +13 -0
- package/dist/ui/thread-config.d.ts.map +1 -1
- package/dist/ui/thread-config.js.map +1 -1
- package/dist/ui/thread-config.mjs.map +1 -1
- package/dist/ui/thread-list-item.d.ts +24 -0
- package/dist/ui/thread-list-item.d.ts.map +1 -0
- package/dist/ui/thread-list-item.js +107 -0
- package/dist/ui/thread-list-item.js.map +1 -0
- package/dist/ui/thread-list-item.mjs +77 -0
- package/dist/ui/thread-list-item.mjs.map +1 -0
- package/dist/ui/thread-list.d.ts +20 -0
- package/dist/ui/thread-list.d.ts.map +1 -0
- package/dist/ui/thread-list.js +92 -0
- package/dist/ui/thread-list.js.map +1 -0
- package/dist/ui/thread-list.mjs +62 -0
- package/dist/ui/thread-list.mjs.map +1 -0
- package/dist/ui/thread.d.ts +2 -2
- package/dist/ui/thread.d.ts.map +1 -1
- package/dist/ui/thread.js.map +1 -1
- package/dist/ui/thread.mjs +1 -3
- package/dist/ui/thread.mjs.map +1 -1
- package/dist/ui/user-action-bar.d.ts +2 -2
- package/dist/ui/user-action-bar.d.ts.map +1 -1
- package/dist/ui/user-action-bar.js.map +1 -1
- package/dist/ui/user-action-bar.mjs +1 -3
- package/dist/ui/user-action-bar.mjs.map +1 -1
- package/package.json +5 -5
- package/src/primitives/threadList/ThreadListItems.tsx +3 -3
- package/src/primitives/threadList/ThreadListNew.tsx +45 -0
- package/src/styles/tailwindcss/thread.css +30 -0
- package/src/ui/assistant-action-bar.tsx +7 -10
- package/src/ui/assistant-modal.tsx +3 -6
- package/src/ui/attachment-ui.tsx +2 -5
- package/src/ui/base/index.ts +1 -4
- package/src/ui/base/tooltip-icon-button.tsx +7 -5
- package/src/ui/branch-picker.tsx +3 -6
- package/src/ui/composer.tsx +4 -7
- package/src/ui/index.ts +4 -0
- package/src/ui/thread-config.tsx +13 -0
- package/src/ui/thread-list-item.tsx +99 -0
- package/src/ui/thread-list.tsx +72 -0
- package/src/ui/thread.tsx +2 -5
- package/src/ui/user-action-bar.tsx +2 -5
- package/src/primitives/threadList/ThreadListNew.ts +0 -25
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type FC } from "react";
|
|
2
|
+
import { ThreadListPrimitive } from "../primitives";
|
|
3
|
+
declare const ThreadList: FC;
|
|
4
|
+
declare const exports: {
|
|
5
|
+
Root: import("react").ForwardRefExoticComponent<Partial<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
New: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
7
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}, "ref"> & import("class-variance-authority").VariantProps<(props?: ({
|
|
11
|
+
variant?: "default" | "outline" | "ghost" | null | undefined;
|
|
12
|
+
size?: "default" | "icon" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
Items: FC<{
|
|
15
|
+
components?: Partial<ThreadListPrimitive.Items.Props["components"]>;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: typeof ThreadList & typeof exports;
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=thread-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-list.d.ts","sourceRoot":"","sources":["../../src/ui/thread-list.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKpD,QAAA,MAAM,UAAU,EAAE,EAOjB,CAAC;AA8CF,QAAA,MAAM,OAAO;;;;;;;;;;;qBAdE,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;;CAkBpE,CAAC;wBAEmD,OAAO,UAAU,GACpE,OAAO,OAAO;AADhB,wBACiB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/ui/thread-list.tsx
|
|
32
|
+
var thread_list_exports = {};
|
|
33
|
+
__export(thread_list_exports, {
|
|
34
|
+
default: () => thread_list_default
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(thread_list_exports);
|
|
37
|
+
var import_react = require("react");
|
|
38
|
+
var import_lucide_react = require("lucide-react");
|
|
39
|
+
var import_withDefaults = require("./utils/withDefaults.cjs");
|
|
40
|
+
var import_primitives = require("../primitives/index.cjs");
|
|
41
|
+
var import_thread_list_item = __toESM(require("./thread-list-item.cjs"));
|
|
42
|
+
var import_thread_config = require("./thread-config.cjs");
|
|
43
|
+
var import_base = require("./base/index.cjs");
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
var ThreadList = () => {
|
|
46
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ThreadListRoot, { children: [
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThreadListNew, {}),
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThreadListItems, {})
|
|
49
|
+
] });
|
|
50
|
+
};
|
|
51
|
+
var ThreadListRoot = (0, import_withDefaults.withDefaults)("div", {
|
|
52
|
+
className: "aui-root aui-thread-list-root"
|
|
53
|
+
});
|
|
54
|
+
ThreadListRoot.displayName = "ThreadListRoot";
|
|
55
|
+
var ThreadListNew = (0, import_react.forwardRef)((props, ref) => {
|
|
56
|
+
const {
|
|
57
|
+
strings: { threadList: { new: { label = "New Thread" } = {} } = {} } = {}
|
|
58
|
+
} = (0, import_thread_config.useThreadConfig)();
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ThreadListPrimitive.New, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
60
|
+
import_base.Button,
|
|
61
|
+
{
|
|
62
|
+
...props,
|
|
63
|
+
ref,
|
|
64
|
+
className: "aui-thread-list-new",
|
|
65
|
+
variant: "ghost",
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.PlusIcon, {}),
|
|
68
|
+
label
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
) });
|
|
72
|
+
});
|
|
73
|
+
ThreadListNew.displayName = "ThreadListNew";
|
|
74
|
+
var ThreadListItems = ({ components }) => {
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
import_primitives.ThreadListPrimitive.Items,
|
|
77
|
+
{
|
|
78
|
+
components: {
|
|
79
|
+
...components,
|
|
80
|
+
ThreadListItem: components?.ThreadListItem ?? import_thread_list_item.default
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
ThreadListItems.displayName = "ThreadListItems";
|
|
86
|
+
var exports2 = {
|
|
87
|
+
Root: ThreadListRoot,
|
|
88
|
+
New: ThreadListNew,
|
|
89
|
+
Items: ThreadListItems
|
|
90
|
+
};
|
|
91
|
+
var thread_list_default = Object.assign(ThreadList, exports2);
|
|
92
|
+
//# sourceMappingURL=thread-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/thread-list.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { ThreadListPrimitive } from \"../primitives\";\nimport ThreadListItem from \"./thread-list-item\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { Button, ButtonProps } from \"./base\";\n\nconst ThreadList: FC = () => {\n return (\n <ThreadListRoot>\n <ThreadListNew />\n <ThreadListItems />\n </ThreadListRoot>\n );\n};\n\nconst ThreadListRoot = withDefaults(\"div\", {\n className: \"aui-root aui-thread-list-root\",\n});\nThreadListRoot.displayName = \"ThreadListRoot\";\n\nconst ThreadListNew = forwardRef<\n HTMLButtonElement,\n ThreadListPrimitive.New.Props & ButtonProps\n>((props, ref) => {\n const {\n strings: { threadList: { new: { label = \"New Thread\" } = {} } = {} } = {},\n } = useThreadConfig();\n\n return (\n <ThreadListPrimitive.New asChild>\n <Button\n {...props}\n ref={ref}\n className=\"aui-thread-list-new\"\n variant=\"ghost\"\n >\n <PlusIcon />\n {label}\n </Button>\n </ThreadListPrimitive.New>\n );\n});\nThreadListNew.displayName = \"ThreadListNew\";\n\nconst ThreadListItems: FC<{\n components?: Partial<ThreadListPrimitive.Items.Props[\"components\"]>;\n}> = ({ components }) => {\n return (\n <ThreadListPrimitive.Items\n components={{\n ...components,\n ThreadListItem: components?.ThreadListItem ?? ThreadListItem,\n }}\n />\n );\n};\n\nThreadListItems.displayName = \"ThreadListItems\";\n\nconst exports = {\n Root: ThreadListRoot,\n New: ThreadListNew,\n Items: ThreadListItems,\n};\n\nexport default Object.assign(ThreadList, exports) as typeof ThreadList &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAoC;AACpC,0BAAyB;AAEzB,0BAA6B;AAC7B,wBAAoC;AACpC,8BAA2B;AAC3B,2BAAgC;AAChC,kBAAoC;AAIhC;AAFJ,IAAM,aAAiB,MAAM;AAC3B,SACE,6CAAC,kBACC;AAAA,gDAAC,iBAAc;AAAA,IACf,4CAAC,mBAAgB;AAAA,KACnB;AAEJ;AAEA,IAAM,qBAAiB,kCAAa,OAAO;AAAA,EACzC,WAAW;AACb,CAAC;AACD,eAAe,cAAc;AAE7B,IAAM,oBAAgB,yBAGpB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,aAAa,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EAC1E,QAAI,sCAAgB;AAEpB,SACE,4CAAC,sCAAoB,KAApB,EAAwB,SAAO,MAC9B;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,WAAU;AAAA,MACV,SAAQ;AAAA,MAER;AAAA,oDAAC,gCAAS;AAAA,QACT;AAAA;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AACD,cAAc,cAAc;AAE5B,IAAM,kBAED,CAAC,EAAE,WAAW,MAAM;AACvB,SACE;AAAA,IAAC,sCAAoB;AAAA,IAApB;AAAA,MACC,YAAY;AAAA,QACV,GAAG;AAAA,QACH,gBAAgB,YAAY,kBAAkB,wBAAAA;AAAA,MAChD;AAAA;AAAA,EACF;AAEJ;AAEA,gBAAgB,cAAc;AAE9B,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AACT;AAEA,IAAO,sBAAQ,OAAO,OAAO,YAAYA,QAAO;","names":["ThreadListItem","exports"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/ui/thread-list.tsx
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { PlusIcon } from "lucide-react";
|
|
6
|
+
import { withDefaults } from "./utils/withDefaults.mjs";
|
|
7
|
+
import { ThreadListPrimitive } from "../primitives/index.mjs";
|
|
8
|
+
import ThreadListItem from "./thread-list-item.mjs";
|
|
9
|
+
import { useThreadConfig } from "./thread-config.mjs";
|
|
10
|
+
import { Button } from "./base/index.mjs";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var ThreadList = () => {
|
|
13
|
+
return /* @__PURE__ */ jsxs(ThreadListRoot, { children: [
|
|
14
|
+
/* @__PURE__ */ jsx(ThreadListNew, {}),
|
|
15
|
+
/* @__PURE__ */ jsx(ThreadListItems, {})
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
var ThreadListRoot = withDefaults("div", {
|
|
19
|
+
className: "aui-root aui-thread-list-root"
|
|
20
|
+
});
|
|
21
|
+
ThreadListRoot.displayName = "ThreadListRoot";
|
|
22
|
+
var ThreadListNew = forwardRef((props, ref) => {
|
|
23
|
+
const {
|
|
24
|
+
strings: { threadList: { new: { label = "New Thread" } = {} } = {} } = {}
|
|
25
|
+
} = useThreadConfig();
|
|
26
|
+
return /* @__PURE__ */ jsx(ThreadListPrimitive.New, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
27
|
+
Button,
|
|
28
|
+
{
|
|
29
|
+
...props,
|
|
30
|
+
ref,
|
|
31
|
+
className: "aui-thread-list-new",
|
|
32
|
+
variant: "ghost",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(PlusIcon, {}),
|
|
35
|
+
label
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
) });
|
|
39
|
+
});
|
|
40
|
+
ThreadListNew.displayName = "ThreadListNew";
|
|
41
|
+
var ThreadListItems = ({ components }) => {
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
ThreadListPrimitive.Items,
|
|
44
|
+
{
|
|
45
|
+
components: {
|
|
46
|
+
...components,
|
|
47
|
+
ThreadListItem: components?.ThreadListItem ?? ThreadListItem
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
ThreadListItems.displayName = "ThreadListItems";
|
|
53
|
+
var exports = {
|
|
54
|
+
Root: ThreadListRoot,
|
|
55
|
+
New: ThreadListNew,
|
|
56
|
+
Items: ThreadListItems
|
|
57
|
+
};
|
|
58
|
+
var thread_list_default = Object.assign(ThreadList, exports);
|
|
59
|
+
export {
|
|
60
|
+
thread_list_default as default
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=thread-list.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/thread-list.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PlusIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { ThreadListPrimitive } from \"../primitives\";\nimport ThreadListItem from \"./thread-list-item\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { Button, ButtonProps } from \"./base\";\n\nconst ThreadList: FC = () => {\n return (\n <ThreadListRoot>\n <ThreadListNew />\n <ThreadListItems />\n </ThreadListRoot>\n );\n};\n\nconst ThreadListRoot = withDefaults(\"div\", {\n className: \"aui-root aui-thread-list-root\",\n});\nThreadListRoot.displayName = \"ThreadListRoot\";\n\nconst ThreadListNew = forwardRef<\n HTMLButtonElement,\n ThreadListPrimitive.New.Props & ButtonProps\n>((props, ref) => {\n const {\n strings: { threadList: { new: { label = \"New Thread\" } = {} } = {} } = {},\n } = useThreadConfig();\n\n return (\n <ThreadListPrimitive.New asChild>\n <Button\n {...props}\n ref={ref}\n className=\"aui-thread-list-new\"\n variant=\"ghost\"\n >\n <PlusIcon />\n {label}\n </Button>\n </ThreadListPrimitive.New>\n );\n});\nThreadListNew.displayName = \"ThreadListNew\";\n\nconst ThreadListItems: FC<{\n components?: Partial<ThreadListPrimitive.Items.Props[\"components\"]>;\n}> = ({ components }) => {\n return (\n <ThreadListPrimitive.Items\n components={{\n ...components,\n ThreadListItem: components?.ThreadListItem ?? ThreadListItem,\n }}\n />\n );\n};\n\nThreadListItems.displayName = \"ThreadListItems\";\n\nconst exports = {\n Root: ThreadListRoot,\n New: ThreadListNew,\n Items: ThreadListItems,\n};\n\nexport default Object.assign(ThreadList, exports) as typeof ThreadList &\n typeof exports;\n"],"mappings":";;;AAEA,SAAS,kBAA2B;AACpC,SAAS,gBAAgB;AAEzB,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AACpC,OAAO,oBAAoB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,cAA2B;AAIhC,SACE,KADF;AAFJ,IAAM,aAAiB,MAAM;AAC3B,SACE,qBAAC,kBACC;AAAA,wBAAC,iBAAc;AAAA,IACf,oBAAC,mBAAgB;AAAA,KACnB;AAEJ;AAEA,IAAM,iBAAiB,aAAa,OAAO;AAAA,EACzC,WAAW;AACb,CAAC;AACD,eAAe,cAAc;AAE7B,IAAM,gBAAgB,WAGpB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,aAAa,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EAC1E,IAAI,gBAAgB;AAEpB,SACE,oBAAC,oBAAoB,KAApB,EAAwB,SAAO,MAC9B;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,WAAU;AAAA,MACV,SAAQ;AAAA,MAER;AAAA,4BAAC,YAAS;AAAA,QACT;AAAA;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AACD,cAAc,cAAc;AAE5B,IAAM,kBAED,CAAC,EAAE,WAAW,MAAM;AACvB,SACE;AAAA,IAAC,oBAAoB;AAAA,IAApB;AAAA,MACC,YAAY;AAAA,QACV,GAAG;AAAA,QACH,gBAAgB,YAAY,kBAAkB;AAAA,MAChD;AAAA;AAAA,EACF;AAEJ;AAEA,gBAAgB,cAAc;AAE9B,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AACT;AAEA,IAAO,sBAAQ,OAAO,OAAO,YAAY,OAAO;","names":[]}
|
package/dist/ui/thread.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FC } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { TooltipIconButton } from "./base/tooltip-icon-button";
|
|
3
3
|
import { ThreadConfig } from "./thread-config";
|
|
4
4
|
import { ThreadPrimitive } from "../primitives";
|
|
5
5
|
declare const Thread: FC<ThreadConfig>;
|
|
@@ -23,7 +23,7 @@ declare const exports: {
|
|
|
23
23
|
components?: Partial<ThreadPrimitive.Messages.Props["components"]>;
|
|
24
24
|
}>;
|
|
25
25
|
FollowupSuggestions: FC;
|
|
26
|
-
ScrollToBottom: import("react").ForwardRefExoticComponent<Partial<
|
|
26
|
+
ScrollToBottom: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
27
|
ViewportFooter: import("react").ForwardRefExoticComponent<Partial<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
28
|
};
|
|
29
29
|
declare const _default: typeof Thread & typeof exports;
|
package/dist/ui/thread.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/ui/thread.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAM5C,OAAO,
|
|
1
|
+
{"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/ui/thread.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAM5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAO,EACL,YAAY,EAIb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,YAAY,CAqB5B,CAAC;AAiHF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;+BA7EY,OAAO;qBACjB,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;;;;;CAmFnE,CAAC;wBAE+C,OAAO,MAAM,GAAG,OAAO,OAAO;AAA/E,wBAAgF"}
|
package/dist/ui/thread.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/thread.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { ArrowDownIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport Composer from \"./composer\";\nimport ThreadWelcome from \"./thread-welcome\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/ui/thread.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { ArrowDownIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport Composer from \"./composer\";\nimport ThreadWelcome from \"./thread-welcome\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport AssistantMessage from \"./assistant-message\";\nimport UserMessage from \"./user-message\";\nimport EditComposer from \"./edit-composer\";\nimport {\n ThreadConfig,\n ThreadConfigProvider,\n ThreadConfigProviderProps,\n useThreadConfig,\n} from \"./thread-config\";\nimport { ThreadPrimitive } from \"../primitives\";\nimport { useThread } from \"../context\";\n\nconst Thread: FC<ThreadConfig> = (config) => {\n const {\n components: {\n Composer: ComposerComponent = Composer,\n ThreadWelcome: ThreadWelcomeComponent = ThreadWelcome,\n ...messageComponents\n } = {},\n } = config;\n return (\n <ThreadRoot config={config}>\n <ThreadViewport>\n <ThreadWelcomeComponent />\n <ThreadMessages components={messageComponents} />\n <ThreadFollowupSuggestions />\n <ThreadViewportFooter>\n <ThreadScrollToBottom />\n <ComposerComponent />\n </ThreadViewportFooter>\n </ThreadViewport>\n </ThreadRoot>\n );\n};\n\nnamespace ThreadRoot {\n export type Element = HTMLDivElement;\n export type Props = ThreadPrimitive.Root.Props & ThreadConfigProviderProps;\n}\n\nconst ThreadRootStyled = withDefaults(ThreadPrimitive.Root, {\n className: \"aui-root aui-thread-root\",\n});\n\nconst ThreadRoot = forwardRef<ThreadRoot.Element, ThreadRoot.Props>(\n ({ config, ...props }, ref) => {\n return (\n <ThreadConfigProvider config={config}>\n <ThreadRootStyled {...props} ref={ref} />\n </ThreadConfigProvider>\n );\n },\n);\n\nThreadRoot.displayName = \"ThreadRoot\";\n\nconst ThreadViewport = withDefaults(ThreadPrimitive.Viewport, {\n className: \"aui-thread-viewport\",\n});\n\nThreadViewport.displayName = \"ThreadViewport\";\n\nconst ThreadViewportFooter = withDefaults(\"div\", {\n className: \"aui-thread-viewport-footer\",\n});\n\nThreadViewportFooter.displayName = \"ThreadViewportFooter\";\n\nconst ThreadMessages: FC<{\n unstable_flexGrowDiv?: boolean;\n components?: Partial<ThreadPrimitive.Messages.Props[\"components\"]>;\n}> = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ...rest }) => {\n return (\n <>\n <ThreadPrimitive.Messages\n components={{\n ...components,\n UserMessage: components?.UserMessage ?? UserMessage,\n AssistantMessage: components?.AssistantMessage ?? AssistantMessage,\n EditComposer: components?.EditComposer ?? EditComposer,\n }}\n {...rest}\n />\n {flexGrowDiv && (\n <ThreadPrimitive.If empty={false}>\n <div style={{ flexGrow: 1 }} />\n </ThreadPrimitive.If>\n )}\n </>\n );\n};\n\nThreadMessages.displayName = \"ThreadMessages\";\n\nconst ThreadFollowupSuggestions: FC = () => {\n const suggestions = useThread((t) => t.suggestions);\n\n return (\n <ThreadPrimitive.If empty={false} running={false}>\n <div className=\"aui-thread-followup-suggestions\">\n {suggestions?.map((suggestion, idx) => (\n <ThreadPrimitive.Suggestion\n key={idx}\n className=\"aui-thread-followup-suggestion\"\n prompt={suggestion.prompt}\n method=\"replace\"\n autoSend\n >\n {suggestion.prompt}\n </ThreadPrimitive.Suggestion>\n ))}\n </div>\n </ThreadPrimitive.If>\n );\n};\n\nconst ThreadScrollToBottomIconButton = withDefaults(TooltipIconButton, {\n variant: \"outline\",\n className: \"aui-thread-scroll-to-bottom\",\n});\n\nnamespace ThreadScrollToBottom {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ThreadScrollToBottom = forwardRef<\n ThreadScrollToBottom.Element,\n ThreadScrollToBottom.Props\n>((props, ref) => {\n const {\n strings: {\n thread: { scrollToBottom: { tooltip = \"Scroll to bottom\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n return (\n <ThreadPrimitive.ScrollToBottom asChild>\n <ThreadScrollToBottomIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ArrowDownIcon />}\n </ThreadScrollToBottomIconButton>\n </ThreadPrimitive.ScrollToBottom>\n );\n});\n\nThreadScrollToBottom.displayName = \"ThreadScrollToBottom\";\n\nconst exports = {\n Root: ThreadRoot,\n Viewport: ThreadViewport,\n Messages: ThreadMessages,\n FollowupSuggestions: ThreadFollowupSuggestions,\n ScrollToBottom: ThreadScrollToBottom,\n ViewportFooter: ThreadViewportFooter,\n};\n\nexport default Object.assign(Thread, exports) as typeof Thread & typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAoC;AACpC,0BAA8B;AAE9B,0BAA6B;AAC7B,sBAAqB;AACrB,4BAA0B;AAC1B,iC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QA,QAAO;","names":["Composer","ThreadWelcome","UserMessage","AssistantMessage","EditComposer","exports"]}
|
package/dist/ui/thread.mjs
CHANGED
|
@@ -6,9 +6,7 @@ import { ArrowDownIcon } from "lucide-react";
|
|
|
6
6
|
import { withDefaults } from "./utils/withDefaults.mjs";
|
|
7
7
|
import Composer from "./composer.mjs";
|
|
8
8
|
import ThreadWelcome from "./thread-welcome.mjs";
|
|
9
|
-
import {
|
|
10
|
-
TooltipIconButton
|
|
11
|
-
} from "./base/tooltip-icon-button.mjs";
|
|
9
|
+
import { TooltipIconButton } from "./base/tooltip-icon-button.mjs";
|
|
12
10
|
import AssistantMessage from "./assistant-message.mjs";
|
|
13
11
|
import UserMessage from "./user-message.mjs";
|
|
14
12
|
import EditComposer from "./edit-composer.mjs";
|
package/dist/ui/thread.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/thread.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { ArrowDownIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport Composer from \"./composer\";\nimport ThreadWelcome from \"./thread-welcome\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/ui/thread.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { ArrowDownIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport Composer from \"./composer\";\nimport ThreadWelcome from \"./thread-welcome\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport AssistantMessage from \"./assistant-message\";\nimport UserMessage from \"./user-message\";\nimport EditComposer from \"./edit-composer\";\nimport {\n ThreadConfig,\n ThreadConfigProvider,\n ThreadConfigProviderProps,\n useThreadConfig,\n} from \"./thread-config\";\nimport { ThreadPrimitive } from \"../primitives\";\nimport { useThread } from \"../context\";\n\nconst Thread: FC<ThreadConfig> = (config) => {\n const {\n components: {\n Composer: ComposerComponent = Composer,\n ThreadWelcome: ThreadWelcomeComponent = ThreadWelcome,\n ...messageComponents\n } = {},\n } = config;\n return (\n <ThreadRoot config={config}>\n <ThreadViewport>\n <ThreadWelcomeComponent />\n <ThreadMessages components={messageComponents} />\n <ThreadFollowupSuggestions />\n <ThreadViewportFooter>\n <ThreadScrollToBottom />\n <ComposerComponent />\n </ThreadViewportFooter>\n </ThreadViewport>\n </ThreadRoot>\n );\n};\n\nnamespace ThreadRoot {\n export type Element = HTMLDivElement;\n export type Props = ThreadPrimitive.Root.Props & ThreadConfigProviderProps;\n}\n\nconst ThreadRootStyled = withDefaults(ThreadPrimitive.Root, {\n className: \"aui-root aui-thread-root\",\n});\n\nconst ThreadRoot = forwardRef<ThreadRoot.Element, ThreadRoot.Props>(\n ({ config, ...props }, ref) => {\n return (\n <ThreadConfigProvider config={config}>\n <ThreadRootStyled {...props} ref={ref} />\n </ThreadConfigProvider>\n );\n },\n);\n\nThreadRoot.displayName = \"ThreadRoot\";\n\nconst ThreadViewport = withDefaults(ThreadPrimitive.Viewport, {\n className: \"aui-thread-viewport\",\n});\n\nThreadViewport.displayName = \"ThreadViewport\";\n\nconst ThreadViewportFooter = withDefaults(\"div\", {\n className: \"aui-thread-viewport-footer\",\n});\n\nThreadViewportFooter.displayName = \"ThreadViewportFooter\";\n\nconst ThreadMessages: FC<{\n unstable_flexGrowDiv?: boolean;\n components?: Partial<ThreadPrimitive.Messages.Props[\"components\"]>;\n}> = ({ components, unstable_flexGrowDiv: flexGrowDiv = true, ...rest }) => {\n return (\n <>\n <ThreadPrimitive.Messages\n components={{\n ...components,\n UserMessage: components?.UserMessage ?? UserMessage,\n AssistantMessage: components?.AssistantMessage ?? AssistantMessage,\n EditComposer: components?.EditComposer ?? EditComposer,\n }}\n {...rest}\n />\n {flexGrowDiv && (\n <ThreadPrimitive.If empty={false}>\n <div style={{ flexGrow: 1 }} />\n </ThreadPrimitive.If>\n )}\n </>\n );\n};\n\nThreadMessages.displayName = \"ThreadMessages\";\n\nconst ThreadFollowupSuggestions: FC = () => {\n const suggestions = useThread((t) => t.suggestions);\n\n return (\n <ThreadPrimitive.If empty={false} running={false}>\n <div className=\"aui-thread-followup-suggestions\">\n {suggestions?.map((suggestion, idx) => (\n <ThreadPrimitive.Suggestion\n key={idx}\n className=\"aui-thread-followup-suggestion\"\n prompt={suggestion.prompt}\n method=\"replace\"\n autoSend\n >\n {suggestion.prompt}\n </ThreadPrimitive.Suggestion>\n ))}\n </div>\n </ThreadPrimitive.If>\n );\n};\n\nconst ThreadScrollToBottomIconButton = withDefaults(TooltipIconButton, {\n variant: \"outline\",\n className: \"aui-thread-scroll-to-bottom\",\n});\n\nnamespace ThreadScrollToBottom {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ThreadScrollToBottom = forwardRef<\n ThreadScrollToBottom.Element,\n ThreadScrollToBottom.Props\n>((props, ref) => {\n const {\n strings: {\n thread: { scrollToBottom: { tooltip = \"Scroll to bottom\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n return (\n <ThreadPrimitive.ScrollToBottom asChild>\n <ThreadScrollToBottomIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ArrowDownIcon />}\n </ThreadScrollToBottomIconButton>\n </ThreadPrimitive.ScrollToBottom>\n );\n});\n\nThreadScrollToBottom.displayName = \"ThreadScrollToBottom\";\n\nconst exports = {\n Root: ThreadRoot,\n Viewport: ThreadViewport,\n Messages: ThreadMessages,\n FollowupSuggestions: ThreadFollowupSuggestions,\n ScrollToBottom: ThreadScrollToBottom,\n ViewportFooter: ThreadViewportFooter,\n};\n\nexport default Object.assign(Thread, exports) as typeof Thread & typeof exports;\n"],"mappings":";;;AAEA,SAAS,kBAA2B;AACpC,SAAS,qBAAqB;AAE9B,SAAS,oBAAoB;AAC7B,OAAO,cAAc;AACrB,OAAO,mBAAmB;AAC1B,SAAS,yBAAyB;AAClC,OAAO,sBAAsB;AAC7B,OAAO,iBAAiB;AACxB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|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FC } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { TooltipIconButton } from "./base/tooltip-icon-button";
|
|
3
3
|
declare const UserActionBar: FC;
|
|
4
4
|
declare const exports: {
|
|
5
5
|
Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
@@ -7,7 +7,7 @@ declare const exports: {
|
|
|
7
7
|
} & {
|
|
8
8
|
asChild?: boolean;
|
|
9
9
|
}, "ref"> & import("../primitives/actionBar/useActionBarFloatStatus").UseActionBarFloatStatusProps & import("react").RefAttributes<HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
-
Edit: import("react").ForwardRefExoticComponent<Partial<
|
|
10
|
+
Edit: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
};
|
|
12
12
|
declare const _default: typeof UserActionBar & typeof exports;
|
|
13
13
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-action-bar.d.ts","sourceRoot":"","sources":["../../src/ui/user-action-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,
|
|
1
|
+
{"version":3,"file":"user-action-bar.d.ts","sourceRoot":"","sources":["../../src/ui/user-action-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAY/D,QAAA,MAAM,aAAa,EAAE,EAQpB,CAAC;AAkCF,QAAA,MAAM,OAAO;;;;;;;CAGZ,CAAC;wBAEsD,OAAO,aAAa,GAC1E,OAAO,OAAO;AADhB,wBACiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/user-action-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PencilIcon } from \"lucide-react\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/ui/user-action-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PencilIcon } from \"lucide-react\";\n\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { useThread } from \"../context\";\nimport { ActionBarPrimitive } from \"../primitives\";\n\nconst useAllowEdit = (ensureCapability = false) => {\n const { userMessage: { allowEdit = true } = {} } = useThreadConfig();\n const editSupported = useThread((t) => t.capabilities.edit);\n return allowEdit && (!ensureCapability || editSupported);\n};\n\nconst UserActionBar: FC = () => {\n const allowEdit = useAllowEdit(true);\n if (!allowEdit) return null;\n return (\n <UserActionBarRoot hideWhenRunning autohide=\"not-last\">\n <UserActionBarEdit />\n </UserActionBarRoot>\n );\n};\n\nUserActionBar.displayName = \"UserActionBar\";\n\nconst UserActionBarRoot = withDefaults(ActionBarPrimitive.Root, {\n className: \"aui-user-action-bar-root\",\n});\n\nUserActionBarRoot.displayName = \"UserActionBarRoot\";\n\nnamespace UserActionBarEdit {\n export type Element = ActionBarPrimitive.Edit.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst UserActionBarEdit = forwardRef<\n UserActionBarEdit.Element,\n UserActionBarEdit.Props\n>((props, ref) => {\n const {\n strings: { userMessage: { edit: { tooltip = \"Edit\" } = {} } = {} } = {},\n } = useThreadConfig();\n const allowEdit = useAllowEdit();\n return (\n <ActionBarPrimitive.Edit disabled={!allowEdit} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <PencilIcon />}\n </TooltipIconButton>\n </ActionBarPrimitive.Edit>\n );\n});\n\nUserActionBarEdit.displayName = \"UserActionBarEdit\";\n\nconst exports = {\n Root: UserActionBarRoot,\n Edit: UserActionBarEdit,\n};\n\nexport default Object.assign(UserActionBar, exports) as typeof UserActionBar &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAoC;AACpC,0BAA2B;AAE3B,iCAAkC;AAClC,0BAA6B;AAC7B,2BAAgC;AAChC,qBAA0B;AAC1B,wBAAmC;AAa7B;AAXN,IAAM,eAAe,CAAC,mBAAmB,UAAU;AACjD,QAAM,EAAE,aAAa,EAAE,YAAY,KAAK,IAAI,CAAC,EAAE,QAAI,sCAAgB;AACnE,QAAM,oBAAgB,0BAAU,CAAC,MAAM,EAAE,aAAa,IAAI;AAC1D,SAAO,cAAc,CAAC,oBAAoB;AAC5C;AAEA,IAAM,gBAAoB,MAAM;AAC9B,QAAM,YAAY,aAAa,IAAI;AACnC,MAAI,CAAC,UAAW,QAAO;AACvB,SACE,4CAAC,qBAAkB,iBAAe,MAAC,UAAS,YAC1C,sDAAC,qBAAkB,GACrB;AAEJ;AAEA,cAAc,cAAc;AAE5B,IAAM,wBAAoB,kCAAa,qCAAmB,MAAM;AAAA,EAC9D,WAAW;AACb,CAAC;AAED,kBAAkB,cAAc;AAOhC,IAAM,wBAAoB,yBAGxB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACxE,QAAI,sCAAgB;AACpB,QAAM,YAAY,aAAa;AAC/B,SACE,4CAAC,qCAAmB,MAAnB,EAAwB,UAAU,CAAC,WAAW,SAAO,MACpD,sDAAC,gDAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,4CAAC,kCAAW,GACjC,GACF;AAEJ,CAAC;AAED,kBAAkB,cAAc;AAEhC,IAAMA,WAAU;AAAA,EACd,MAAM;AAAA,EACN,MAAM;AACR;AAEA,IAAO,0BAAQ,OAAO,OAAO,eAAeA,QAAO;","names":["exports"]}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
// src/ui/user-action-bar.tsx
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
5
|
import { PencilIcon } from "lucide-react";
|
|
6
|
-
import {
|
|
7
|
-
TooltipIconButton
|
|
8
|
-
} from "./base/tooltip-icon-button.mjs";
|
|
6
|
+
import { TooltipIconButton } from "./base/tooltip-icon-button.mjs";
|
|
9
7
|
import { withDefaults } from "./utils/withDefaults.mjs";
|
|
10
8
|
import { useThreadConfig } from "./thread-config.mjs";
|
|
11
9
|
import { useThread } from "../context/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/user-action-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PencilIcon } from \"lucide-react\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/ui/user-action-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type FC } from \"react\";\nimport { PencilIcon } from \"lucide-react\";\n\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { useThread } from \"../context\";\nimport { ActionBarPrimitive } from \"../primitives\";\n\nconst useAllowEdit = (ensureCapability = false) => {\n const { userMessage: { allowEdit = true } = {} } = useThreadConfig();\n const editSupported = useThread((t) => t.capabilities.edit);\n return allowEdit && (!ensureCapability || editSupported);\n};\n\nconst UserActionBar: FC = () => {\n const allowEdit = useAllowEdit(true);\n if (!allowEdit) return null;\n return (\n <UserActionBarRoot hideWhenRunning autohide=\"not-last\">\n <UserActionBarEdit />\n </UserActionBarRoot>\n );\n};\n\nUserActionBar.displayName = \"UserActionBar\";\n\nconst UserActionBarRoot = withDefaults(ActionBarPrimitive.Root, {\n className: \"aui-user-action-bar-root\",\n});\n\nUserActionBarRoot.displayName = \"UserActionBarRoot\";\n\nnamespace UserActionBarEdit {\n export type Element = ActionBarPrimitive.Edit.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst UserActionBarEdit = forwardRef<\n UserActionBarEdit.Element,\n UserActionBarEdit.Props\n>((props, ref) => {\n const {\n strings: { userMessage: { edit: { tooltip = \"Edit\" } = {} } = {} } = {},\n } = useThreadConfig();\n const allowEdit = useAllowEdit();\n return (\n <ActionBarPrimitive.Edit disabled={!allowEdit} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <PencilIcon />}\n </TooltipIconButton>\n </ActionBarPrimitive.Edit>\n );\n});\n\nUserActionBarEdit.displayName = \"UserActionBarEdit\";\n\nconst exports = {\n Root: UserActionBarRoot,\n Edit: UserActionBarEdit,\n};\n\nexport default Object.assign(UserActionBar, exports) as typeof UserActionBar &\n typeof exports;\n"],"mappings":";;;AAEA,SAAS,kBAA2B;AACpC,SAAS,kBAAkB;AAE3B,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAC1B,SAAS,0BAA0B;AAa7B;AAXN,IAAM,eAAe,CAAC,mBAAmB,UAAU;AACjD,QAAM,EAAE,aAAa,EAAE,YAAY,KAAK,IAAI,CAAC,EAAE,IAAI,gBAAgB;AACnE,QAAM,gBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,IAAI;AAC1D,SAAO,cAAc,CAAC,oBAAoB;AAC5C;AAEA,IAAM,gBAAoB,MAAM;AAC9B,QAAM,YAAY,aAAa,IAAI;AACnC,MAAI,CAAC,UAAW,QAAO;AACvB,SACE,oBAAC,qBAAkB,iBAAe,MAAC,UAAS,YAC1C,8BAAC,qBAAkB,GACrB;AAEJ;AAEA,cAAc,cAAc;AAE5B,IAAM,oBAAoB,aAAa,mBAAmB,MAAM;AAAA,EAC9D,WAAW;AACb,CAAC;AAED,kBAAkB,cAAc;AAOhC,IAAM,oBAAoB,WAGxB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACxE,IAAI,gBAAgB;AACpB,QAAM,YAAY,aAAa;AAC/B,SACE,oBAAC,mBAAmB,MAAnB,EAAwB,UAAU,CAAC,WAAW,SAAO,MACpD,8BAAC,qBAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,oBAAC,cAAW,GACjC,GACF;AAEJ,CAAC;AAED,kBAAkB,cAAc;AAEhC,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,MAAM;AACR;AAEA,IAAO,0BAAQ,OAAO,OAAO,eAAe,OAAO;","names":[]}
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"conversational-ui",
|
|
30
30
|
"conversational-ai"
|
|
31
31
|
],
|
|
32
|
-
"version": "0.7.
|
|
32
|
+
"version": "0.7.8",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"exports": {
|
|
35
35
|
".": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
],
|
|
66
66
|
"sideEffects": false,
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@ai-sdk/provider": "^1.0.
|
|
68
|
+
"@ai-sdk/provider": "^1.0.1",
|
|
69
69
|
"@radix-ui/primitive": "^1.1.0",
|
|
70
70
|
"@radix-ui/react-avatar": "^1.1.1",
|
|
71
71
|
"@radix-ui/react-compose-refs": "^1.1.0",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@types/json-schema": "^7.0.15",
|
|
111
|
-
"@types/node": "^22.9.
|
|
111
|
+
"@types/node": "^22.9.3",
|
|
112
112
|
"autoprefixer": "^10.4.20",
|
|
113
113
|
"esbuild-plugin-file-path-extensions": "^2.1.3",
|
|
114
114
|
"eslint": "^9",
|
|
@@ -121,8 +121,8 @@
|
|
|
121
121
|
"tsup": "8.3.5",
|
|
122
122
|
"tsx": "^4.19.2",
|
|
123
123
|
"@assistant-ui/tailwindcss-transformer": "0.1.0",
|
|
124
|
-
"@assistant-ui/
|
|
125
|
-
"@assistant-ui/
|
|
124
|
+
"@assistant-ui/tsbuildutils": "^0.0.0",
|
|
125
|
+
"@assistant-ui/tsconfig": "0.0.0"
|
|
126
126
|
},
|
|
127
127
|
"publishConfig": {
|
|
128
128
|
"access": "public",
|
|
@@ -4,7 +4,7 @@ import { ComponentType, FC, memo, useMemo } from "react";
|
|
|
4
4
|
import { ThreadListItemRuntimeProvider } from "../../context/providers/ThreadListItemRuntimeProvider";
|
|
5
5
|
import { useAssistantRuntime, useThreadList } from "../../context";
|
|
6
6
|
|
|
7
|
-
export namespace
|
|
7
|
+
export namespace ThreadListPrimitiveItems {
|
|
8
8
|
export type Props = {
|
|
9
9
|
archived?: boolean | undefined;
|
|
10
10
|
components: {
|
|
@@ -16,7 +16,7 @@ export namespace MessagePrimitiveContent {
|
|
|
16
16
|
type ThreadListItemProps = {
|
|
17
17
|
partIndex: number;
|
|
18
18
|
archived: boolean;
|
|
19
|
-
components:
|
|
19
|
+
components: ThreadListPrimitiveItems.Props["components"];
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const ThreadListItemImpl: FC<ThreadListItemProps> = ({
|
|
@@ -52,7 +52,7 @@ const ThreadListItem = memo(
|
|
|
52
52
|
prev.components.ThreadListItem === next.components.ThreadListItem,
|
|
53
53
|
);
|
|
54
54
|
|
|
55
|
-
export const ThreadListPrimitiveItems: FC<
|
|
55
|
+
export const ThreadListPrimitiveItems: FC<ThreadListPrimitiveItems.Props> = ({
|
|
56
56
|
archived = false,
|
|
57
57
|
components,
|
|
58
58
|
}) => {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ActionButtonElement,
|
|
5
|
+
ActionButtonProps,
|
|
6
|
+
} from "../../utils/createActionButton";
|
|
7
|
+
import { useAssistantRuntime, useThreadList } from "../../context";
|
|
8
|
+
import { forwardRef } from "react";
|
|
9
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
10
|
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
11
|
+
|
|
12
|
+
const useThreadListNew = () => {
|
|
13
|
+
const runtime = useAssistantRuntime();
|
|
14
|
+
return () => {
|
|
15
|
+
runtime.switchToNewThread();
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export namespace ThreadListPrimitiveNew {
|
|
20
|
+
export type Element = ActionButtonElement;
|
|
21
|
+
export type Props = ActionButtonProps<typeof useThreadListNew>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const ThreadListPrimitiveNew = forwardRef<
|
|
25
|
+
ThreadListPrimitiveNew.Element,
|
|
26
|
+
ThreadListPrimitiveNew.Props
|
|
27
|
+
>(({ onClick, disabled, ...props }, forwardedRef) => {
|
|
28
|
+
const isMain = useThreadList((t) => t.newThread === t.mainThreadId);
|
|
29
|
+
const callback = useThreadListNew();
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Primitive.button
|
|
33
|
+
type="button"
|
|
34
|
+
{...(isMain ? { "data-active": "true" } : null)}
|
|
35
|
+
{...props}
|
|
36
|
+
ref={forwardedRef}
|
|
37
|
+
disabled={disabled || !callback}
|
|
38
|
+
onClick={composeEventHandlers(onClick, () => {
|
|
39
|
+
callback?.();
|
|
40
|
+
})}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
ThreadListPrimitiveNew.displayName = "ThreadListPrimitive.New";
|
|
@@ -219,3 +219,33 @@
|
|
|
219
219
|
.aui-text-running::after {
|
|
220
220
|
@apply animate-pulse font-sans content-['\25CF'] ltr:ml-1 rtl:mr-1;
|
|
221
221
|
}
|
|
222
|
+
|
|
223
|
+
/* thread-list */
|
|
224
|
+
|
|
225
|
+
.aui-thread-list-root {
|
|
226
|
+
@apply flex flex-col items-stretch gap-1.5;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.aui-thread-list-item {
|
|
230
|
+
@apply data-[active]:bg-aui-muted hover:bg-aui-muted flex items-center gap-2 rounded-lg transition-all;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.aui-thread-list-new {
|
|
234
|
+
@apply data-[active]:bg-aui-muted hover:bg-aui-muted flex items-center justify-start gap-1 rounded-lg px-2.5 py-2 text-start;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.aui-thread-list-new > .lucide-plus {
|
|
238
|
+
@apply size-5;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.aui-thread-list-item-trigger {
|
|
242
|
+
@apply flex-grow px-3 py-2 text-start;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.aui-thread-list-item-title {
|
|
246
|
+
@apply text-sm;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.aui-thread-list-item-archive {
|
|
250
|
+
@apply hover:text-aui-primary text-aui-foreground ml-auto mr-3 size-4 p-0;
|
|
251
|
+
}
|
|
@@ -11,10 +11,7 @@ import {
|
|
|
11
11
|
ThumbsUpIcon,
|
|
12
12
|
} from "lucide-react";
|
|
13
13
|
import { ActionBarPrimitive, MessagePrimitive } from "../primitives";
|
|
14
|
-
import {
|
|
15
|
-
TooltipIconButton,
|
|
16
|
-
TooltipIconButtonProps,
|
|
17
|
-
} from "./base/tooltip-icon-button";
|
|
14
|
+
import { TooltipIconButton } from "./base/tooltip-icon-button";
|
|
18
15
|
import { withDefaults } from "./utils/withDefaults";
|
|
19
16
|
import { useThreadConfig } from "./thread-config";
|
|
20
17
|
import { useThread } from "../context";
|
|
@@ -91,7 +88,7 @@ AssistantActionBarRoot.displayName = "AssistantActionBarRoot";
|
|
|
91
88
|
|
|
92
89
|
namespace AssistantActionBarCopy {
|
|
93
90
|
export type Element = ActionBarPrimitive.Copy.Element;
|
|
94
|
-
export type Props = Partial<
|
|
91
|
+
export type Props = Partial<TooltipIconButton.Props> & {
|
|
95
92
|
copiedDuration?: number | undefined;
|
|
96
93
|
};
|
|
97
94
|
}
|
|
@@ -141,7 +138,7 @@ const AssistantActionBarSpeechControl: FC = () => {
|
|
|
141
138
|
|
|
142
139
|
namespace AssistantActionBarSpeak {
|
|
143
140
|
export type Element = ActionBarPrimitive.Speak.Element;
|
|
144
|
-
export type Props = Partial<
|
|
141
|
+
export type Props = Partial<TooltipIconButton.Props>;
|
|
145
142
|
}
|
|
146
143
|
|
|
147
144
|
const AssistantActionBarSpeak = forwardRef<
|
|
@@ -168,7 +165,7 @@ AssistantActionBarSpeak.displayName = "AssistantActionBarSpeak";
|
|
|
168
165
|
|
|
169
166
|
namespace AssistantActionBarStopSpeaking {
|
|
170
167
|
export type Element = ActionBarPrimitive.StopSpeaking.Element;
|
|
171
|
-
export type Props = Partial<
|
|
168
|
+
export type Props = Partial<TooltipIconButton.Props>;
|
|
172
169
|
}
|
|
173
170
|
|
|
174
171
|
const AssistantActionBarStopSpeaking = forwardRef<
|
|
@@ -197,7 +194,7 @@ AssistantActionBarStopSpeaking.displayName = "AssistantActionBarStopSpeaking";
|
|
|
197
194
|
|
|
198
195
|
namespace AssistantActionBarReload {
|
|
199
196
|
export type Element = ActionBarPrimitive.Reload.Element;
|
|
200
|
-
export type Props = Partial<
|
|
197
|
+
export type Props = Partial<TooltipIconButton.Props>;
|
|
201
198
|
}
|
|
202
199
|
|
|
203
200
|
const AssistantActionBarReload = forwardRef<
|
|
@@ -223,7 +220,7 @@ AssistantActionBarReload.displayName = "AssistantActionBarReload";
|
|
|
223
220
|
|
|
224
221
|
namespace AssistantActionBarFeedbackPositive {
|
|
225
222
|
export type Element = ActionBarPrimitive.FeedbackPositive.Element;
|
|
226
|
-
export type Props = Partial<
|
|
223
|
+
export type Props = Partial<TooltipIconButton.Props>;
|
|
227
224
|
}
|
|
228
225
|
|
|
229
226
|
const AssistantActionBarFeedbackPositive = forwardRef<
|
|
@@ -256,7 +253,7 @@ AssistantActionBarFeedbackPositive.displayName =
|
|
|
256
253
|
|
|
257
254
|
namespace AssistantActionBarFeedbackNegative {
|
|
258
255
|
export type Element = ActionBarPrimitive.FeedbackNegative.Element;
|
|
259
|
-
export type Props = Partial<
|
|
256
|
+
export type Props = Partial<TooltipIconButton.Props>;
|
|
260
257
|
}
|
|
261
258
|
|
|
262
259
|
const AssistantActionBarFeedbackNegative = forwardRef<
|
|
@@ -6,10 +6,7 @@ import { BotIcon, ChevronDownIcon } from "lucide-react";
|
|
|
6
6
|
import { AssistantModalPrimitive } from "../primitives";
|
|
7
7
|
import Thread from "./thread";
|
|
8
8
|
import { withDefaults } from "./utils/withDefaults";
|
|
9
|
-
import {
|
|
10
|
-
TooltipIconButton,
|
|
11
|
-
TooltipIconButtonProps,
|
|
12
|
-
} from "./base/tooltip-icon-button";
|
|
9
|
+
import { TooltipIconButton } from "./base/tooltip-icon-button";
|
|
13
10
|
import {
|
|
14
11
|
ThreadConfig,
|
|
15
12
|
ThreadConfigProvider,
|
|
@@ -50,7 +47,7 @@ AssistantModalRoot.displayName = "AssistantModalRoot";
|
|
|
50
47
|
|
|
51
48
|
namespace AssistantModalTrigger {
|
|
52
49
|
export type Element = HTMLButtonElement;
|
|
53
|
-
export type Props = Partial<
|
|
50
|
+
export type Props = Partial<TooltipIconButton.Props>;
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
const AssistantModalTrigger = forwardRef<
|
|
@@ -81,7 +78,7 @@ const ModalButtonStyled = withDefaults(TooltipIconButton, {
|
|
|
81
78
|
|
|
82
79
|
namespace AssistantModalButton {
|
|
83
80
|
export type Element = HTMLButtonElement;
|
|
84
|
-
export type Props = Partial<
|
|
81
|
+
export type Props = Partial<TooltipIconButton.Props> & {
|
|
85
82
|
"data-state"?: "open" | "closed";
|
|
86
83
|
};
|
|
87
84
|
}
|