@assistant-ui/react 0.7.6 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. package/dist/api/ContentPartRuntime.d.ts.map +1 -1
  2. package/dist/api/ContentPartRuntime.js +0 -1
  3. package/dist/api/ContentPartRuntime.js.map +1 -1
  4. package/dist/api/ContentPartRuntime.mjs +0 -1
  5. package/dist/api/ContentPartRuntime.mjs.map +1 -1
  6. package/dist/primitives/threadList/ThreadListItems.d.ts +2 -2
  7. package/dist/primitives/threadList/ThreadListItems.d.ts.map +1 -1
  8. package/dist/primitives/threadList/ThreadListItems.js.map +1 -1
  9. package/dist/primitives/threadList/ThreadListItems.mjs.map +1 -1
  10. package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
  11. package/dist/primitives/threadList/ThreadListNew.js +23 -6
  12. package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
  13. package/dist/primitives/threadList/ThreadListNew.mjs +24 -9
  14. package/dist/primitives/threadList/ThreadListNew.mjs.map +1 -1
  15. package/dist/styles/index.css +66 -0
  16. package/dist/styles/index.css.map +1 -1
  17. package/dist/styles/tailwindcss/thread.css +30 -0
  18. package/dist/styles/tailwindcss/thread.css.json +21 -0
  19. package/dist/ui/assistant-action-bar.d.ts +7 -7
  20. package/dist/ui/assistant-action-bar.d.ts.map +1 -1
  21. package/dist/ui/assistant-action-bar.js.map +1 -1
  22. package/dist/ui/assistant-action-bar.mjs +1 -3
  23. package/dist/ui/assistant-action-bar.mjs.map +1 -1
  24. package/dist/ui/assistant-modal.d.ts +3 -3
  25. package/dist/ui/assistant-modal.d.ts.map +1 -1
  26. package/dist/ui/assistant-modal.js.map +1 -1
  27. package/dist/ui/assistant-modal.mjs +1 -3
  28. package/dist/ui/assistant-modal.mjs.map +1 -1
  29. package/dist/ui/attachment-ui.d.ts +2 -2
  30. package/dist/ui/attachment-ui.d.ts.map +1 -1
  31. package/dist/ui/attachment-ui.js.map +1 -1
  32. package/dist/ui/attachment-ui.mjs +1 -3
  33. package/dist/ui/attachment-ui.mjs.map +1 -1
  34. package/dist/ui/base/index.d.ts +1 -1
  35. package/dist/ui/base/index.d.ts.map +1 -1
  36. package/dist/ui/base/index.js.map +1 -1
  37. package/dist/ui/base/index.mjs +1 -3
  38. package/dist/ui/base/index.mjs.map +1 -1
  39. package/dist/ui/base/tooltip-icon-button.d.ts +6 -4
  40. package/dist/ui/base/tooltip-icon-button.d.ts.map +1 -1
  41. package/dist/ui/base/tooltip-icon-button.js.map +1 -1
  42. package/dist/ui/base/tooltip-icon-button.mjs.map +1 -1
  43. package/dist/ui/branch-picker.d.ts +3 -3
  44. package/dist/ui/branch-picker.d.ts.map +1 -1
  45. package/dist/ui/branch-picker.js.map +1 -1
  46. package/dist/ui/branch-picker.mjs +1 -3
  47. package/dist/ui/branch-picker.mjs.map +1 -1
  48. package/dist/ui/composer.d.ts +4 -4
  49. package/dist/ui/composer.d.ts.map +1 -1
  50. package/dist/ui/composer.js.map +1 -1
  51. package/dist/ui/composer.mjs +1 -3
  52. package/dist/ui/composer.mjs.map +1 -1
  53. package/dist/ui/index.d.ts +2 -0
  54. package/dist/ui/index.d.ts.map +1 -1
  55. package/dist/ui/index.js +6 -0
  56. package/dist/ui/index.js.map +1 -1
  57. package/dist/ui/index.mjs +4 -0
  58. package/dist/ui/index.mjs.map +1 -1
  59. package/dist/ui/thread-config.d.ts +13 -0
  60. package/dist/ui/thread-config.d.ts.map +1 -1
  61. package/dist/ui/thread-config.js +8 -1
  62. package/dist/ui/thread-config.js.map +1 -1
  63. package/dist/ui/thread-config.mjs +8 -1
  64. package/dist/ui/thread-config.mjs.map +1 -1
  65. package/dist/ui/thread-list-item.d.ts +24 -0
  66. package/dist/ui/thread-list-item.d.ts.map +1 -0
  67. package/dist/ui/thread-list-item.js +107 -0
  68. package/dist/ui/thread-list-item.js.map +1 -0
  69. package/dist/ui/thread-list-item.mjs +77 -0
  70. package/dist/ui/thread-list-item.mjs.map +1 -0
  71. package/dist/ui/thread-list.d.ts +20 -0
  72. package/dist/ui/thread-list.d.ts.map +1 -0
  73. package/dist/ui/thread-list.js +92 -0
  74. package/dist/ui/thread-list.js.map +1 -0
  75. package/dist/ui/thread-list.mjs +62 -0
  76. package/dist/ui/thread-list.mjs.map +1 -0
  77. package/dist/ui/thread.d.ts +2 -2
  78. package/dist/ui/thread.d.ts.map +1 -1
  79. package/dist/ui/thread.js.map +1 -1
  80. package/dist/ui/thread.mjs +1 -3
  81. package/dist/ui/thread.mjs.map +1 -1
  82. package/dist/ui/user-action-bar.d.ts +2 -2
  83. package/dist/ui/user-action-bar.d.ts.map +1 -1
  84. package/dist/ui/user-action-bar.js.map +1 -1
  85. package/dist/ui/user-action-bar.mjs +1 -3
  86. package/dist/ui/user-action-bar.mjs.map +1 -1
  87. package/package.json +4 -4
  88. package/src/api/ContentPartRuntime.ts +0 -1
  89. package/src/primitives/threadList/ThreadListItems.tsx +3 -3
  90. package/src/primitives/threadList/ThreadListNew.tsx +45 -0
  91. package/src/styles/tailwindcss/thread.css +30 -0
  92. package/src/ui/assistant-action-bar.tsx +7 -10
  93. package/src/ui/assistant-modal.tsx +3 -6
  94. package/src/ui/attachment-ui.tsx +2 -5
  95. package/src/ui/base/index.ts +1 -4
  96. package/src/ui/base/tooltip-icon-button.tsx +7 -5
  97. package/src/ui/branch-picker.tsx +3 -6
  98. package/src/ui/composer.tsx +4 -7
  99. package/src/ui/index.ts +4 -0
  100. package/src/ui/thread-config.tsx +29 -7
  101. package/src/ui/thread-list-item.tsx +99 -0
  102. package/src/ui/thread-list.tsx +72 -0
  103. package/src/ui/thread.tsx +2 -5
  104. package/src/ui/user-action-bar.tsx +2 -5
  105. package/src/primitives/threadList/ThreadListNew.ts +0 -25
@@ -0,0 +1,107 @@
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-item.tsx
32
+ var thread_list_item_exports = {};
33
+ __export(thread_list_item_exports, {
34
+ default: () => thread_list_item_default
35
+ });
36
+ module.exports = __toCommonJS(thread_list_item_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_tooltip_icon_button = require("./base/tooltip-icon-button.cjs");
41
+ var import_primitives = require("../primitives/index.cjs");
42
+ var import_thread_config = require("./thread-config.cjs");
43
+ var import_classnames = __toESM(require("classnames"));
44
+ var import_jsx_runtime = require("react/jsx-runtime");
45
+ var ThreadListItem = () => {
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ThreadListItemRoot, { children: [
47
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThreadListItemTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThreadListItemTitle, {}) }),
48
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThreadListItemArchive, {})
49
+ ] });
50
+ };
51
+ var ThreadListItemRoot = (0, import_withDefaults.withDefaults)(import_primitives.ThreadListItemPrimitive.Root, {
52
+ className: "aui-thread-list-item"
53
+ });
54
+ ThreadListItemRoot.displayName = "ThreadListItemRoot";
55
+ var ThreadListItemTrigger = (0, import_withDefaults.withDefaults)(import_primitives.ThreadListItemPrimitive.Trigger, {
56
+ className: "aui-thread-list-item-trigger"
57
+ });
58
+ var ThreadListItemTitle = (0, import_react.forwardRef)(({ className, ...props }, ref) => {
59
+ const {
60
+ strings: {
61
+ threadList: { item: { title: { fallback = "New Chat" } = {} } = {} } = {}
62
+ } = {}
63
+ } = (0, import_thread_config.useThreadConfig)();
64
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ "p",
66
+ {
67
+ ref,
68
+ className: (0, import_classnames.default)("aui-thread-list-item-title", className),
69
+ ...props,
70
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ThreadListItemPrimitive.Title, { fallback })
71
+ }
72
+ );
73
+ });
74
+ ThreadListItemTitle.displayName = "ThreadListItemTitle";
75
+ var ThreadListItemArchive = (0, import_withDefaults.withDefaults)(
76
+ (0, import_react.forwardRef)(
77
+ ({ className, ...props }, ref) => {
78
+ const {
79
+ strings: {
80
+ threadList: {
81
+ item: { archive: { label = "Archive thread" } = {} } = {}
82
+ } = {}
83
+ } = {}
84
+ } = (0, import_thread_config.useThreadConfig)();
85
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ThreadListItemPrimitive.Archive, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
+ import_tooltip_icon_button.TooltipIconButton,
87
+ {
88
+ ...props,
89
+ ref,
90
+ className: (0, import_classnames.default)("aui-thread-list-item-archive", className),
91
+ variant: "ghost",
92
+ tooltip: label,
93
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArchiveIcon, {})
94
+ }
95
+ ) });
96
+ }
97
+ ),
98
+ {}
99
+ );
100
+ ThreadListItemArchive.displayName = "ThreadListItemArchive";
101
+ var exports2 = {
102
+ Root: ThreadListItemRoot,
103
+ Title: ThreadListItemTitle,
104
+ Archive: ThreadListItemArchive
105
+ };
106
+ var thread_list_item_default = Object.assign(ThreadListItem, exports2);
107
+ //# sourceMappingURL=thread-list-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ui/thread-list-item.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ArchiveIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { ThreadListItemPrimitive } from \"../primitives\";\nimport { useThreadConfig } from \"./thread-config\";\nimport classNames from \"classnames\";\n\nconst ThreadListItem: FC = () => {\n return (\n <ThreadListItemRoot>\n <ThreadListItemTrigger>\n <ThreadListItemTitle />\n </ThreadListItemTrigger>\n <ThreadListItemArchive />\n </ThreadListItemRoot>\n );\n};\n\nconst ThreadListItemRoot = withDefaults(ThreadListItemPrimitive.Root, {\n className: \"aui-thread-list-item\",\n});\n\nThreadListItemRoot.displayName = \"ThreadListItemRoot\";\n\nconst ThreadListItemTrigger = withDefaults(ThreadListItemPrimitive.Trigger, {\n className: \"aui-thread-list-item-trigger\",\n});\n\nnamespace ThreadListItemPrimitiveTitle {\n export type Element = HTMLParagraphElement;\n export type Props = ComponentPropsWithoutRef<\"p\">;\n}\n\nconst ThreadListItemTitle = forwardRef<\n ThreadListItemPrimitiveTitle.Element,\n ThreadListItemPrimitiveTitle.Props\n>(({ className, ...props }, ref) => {\n const {\n strings: {\n threadList: { item: { title: { fallback = \"New Chat\" } = {} } = {} } = {},\n } = {},\n } = useThreadConfig();\n\n return (\n <p\n ref={ref}\n className={classNames(\"aui-thread-list-item-title\", className)}\n {...props}\n >\n <ThreadListItemPrimitive.Title fallback={fallback} />\n </p>\n );\n});\n\nThreadListItemTitle.displayName = \"ThreadListItemTitle\";\n\nconst ThreadListItemArchive = withDefaults(\n forwardRef<HTMLButtonElement, TooltipIconButton.Props>(\n ({ className, ...props }, ref) => {\n const {\n strings: {\n threadList: {\n item: { archive: { label = \"Archive thread\" } = {} } = {},\n } = {},\n } = {},\n } = useThreadConfig();\n\n return (\n <ThreadListItemPrimitive.Archive asChild>\n <TooltipIconButton\n {...props}\n ref={ref}\n className={classNames(\"aui-thread-list-item-archive\", className)}\n variant=\"ghost\"\n tooltip={label}\n >\n <ArchiveIcon />\n </TooltipIconButton>\n </ThreadListItemPrimitive.Archive>\n );\n },\n ),\n {},\n);\n\nThreadListItemArchive.displayName = \"ThreadListItemArchive\";\n\nconst exports = {\n Root: ThreadListItemRoot,\n Title: ThreadListItemTitle,\n Archive: ThreadListItemArchive,\n};\n\nexport default Object.assign(ThreadListItem, exports) as typeof ThreadListItem &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8D;AAC9D,0BAA4B;AAE5B,0BAA6B;AAC7B,iCAAkC;AAClC,wBAAwC;AACxC,2BAAgC;AAChC,wBAAuB;AAInB;AAFJ,IAAM,iBAAqB,MAAM;AAC/B,SACE,6CAAC,sBACC;AAAA,gDAAC,yBACC,sDAAC,uBAAoB,GACvB;AAAA,IACA,4CAAC,yBAAsB;AAAA,KACzB;AAEJ;AAEA,IAAM,yBAAqB,kCAAa,0CAAwB,MAAM;AAAA,EACpE,WAAW;AACb,CAAC;AAED,mBAAmB,cAAc;AAEjC,IAAM,4BAAwB,kCAAa,0CAAwB,SAAS;AAAA,EAC1E,WAAW;AACb,CAAC;AAOD,IAAM,0BAAsB,yBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM;AAAA,IACJ,SAAS;AAAA,MACP,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,WAAW,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IAC1E,IAAI,CAAC;AAAA,EACP,QAAI,sCAAgB;AAEpB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,kBAAAA,SAAW,8BAA8B,SAAS;AAAA,MAC5D,GAAG;AAAA,MAEJ,sDAAC,0CAAwB,OAAxB,EAA8B,UAAoB;AAAA;AAAA,EACrD;AAEJ,CAAC;AAED,oBAAoB,cAAc;AAElC,IAAM,4BAAwB;AAAA,MAC5B;AAAA,IACE,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChC,YAAM;AAAA,QACJ,SAAS;AAAA,UACP,YAAY;AAAA,YACV,MAAM,EAAE,SAAS,EAAE,QAAQ,iBAAiB,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,UAC1D,IAAI,CAAC;AAAA,QACP,IAAI,CAAC;AAAA,MACP,QAAI,sCAAgB;AAEpB,aACE,4CAAC,0CAAwB,SAAxB,EAAgC,SAAO,MACtC;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,UACA,eAAW,kBAAAA,SAAW,gCAAgC,SAAS;AAAA,UAC/D,SAAQ;AAAA,UACR,SAAS;AAAA,UAET,sDAAC,mCAAY;AAAA;AAAA,MACf,GACF;AAAA,IAEJ;AAAA,EACF;AAAA,EACA,CAAC;AACH;AAEA,sBAAsB,cAAc;AAEpC,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACX;AAEA,IAAO,2BAAQ,OAAO,OAAO,gBAAgBA,QAAO;","names":["classNames","exports"]}
@@ -0,0 +1,77 @@
1
+ "use client";
2
+
3
+ // src/ui/thread-list-item.tsx
4
+ import { forwardRef } from "react";
5
+ import { ArchiveIcon } from "lucide-react";
6
+ import { withDefaults } from "./utils/withDefaults.mjs";
7
+ import { TooltipIconButton } from "./base/tooltip-icon-button.mjs";
8
+ import { ThreadListItemPrimitive } from "../primitives/index.mjs";
9
+ import { useThreadConfig } from "./thread-config.mjs";
10
+ import classNames from "classnames";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ var ThreadListItem = () => {
13
+ return /* @__PURE__ */ jsxs(ThreadListItemRoot, { children: [
14
+ /* @__PURE__ */ jsx(ThreadListItemTrigger, { children: /* @__PURE__ */ jsx(ThreadListItemTitle, {}) }),
15
+ /* @__PURE__ */ jsx(ThreadListItemArchive, {})
16
+ ] });
17
+ };
18
+ var ThreadListItemRoot = withDefaults(ThreadListItemPrimitive.Root, {
19
+ className: "aui-thread-list-item"
20
+ });
21
+ ThreadListItemRoot.displayName = "ThreadListItemRoot";
22
+ var ThreadListItemTrigger = withDefaults(ThreadListItemPrimitive.Trigger, {
23
+ className: "aui-thread-list-item-trigger"
24
+ });
25
+ var ThreadListItemTitle = forwardRef(({ className, ...props }, ref) => {
26
+ const {
27
+ strings: {
28
+ threadList: { item: { title: { fallback = "New Chat" } = {} } = {} } = {}
29
+ } = {}
30
+ } = useThreadConfig();
31
+ return /* @__PURE__ */ jsx(
32
+ "p",
33
+ {
34
+ ref,
35
+ className: classNames("aui-thread-list-item-title", className),
36
+ ...props,
37
+ children: /* @__PURE__ */ jsx(ThreadListItemPrimitive.Title, { fallback })
38
+ }
39
+ );
40
+ });
41
+ ThreadListItemTitle.displayName = "ThreadListItemTitle";
42
+ var ThreadListItemArchive = withDefaults(
43
+ forwardRef(
44
+ ({ className, ...props }, ref) => {
45
+ const {
46
+ strings: {
47
+ threadList: {
48
+ item: { archive: { label = "Archive thread" } = {} } = {}
49
+ } = {}
50
+ } = {}
51
+ } = useThreadConfig();
52
+ return /* @__PURE__ */ jsx(ThreadListItemPrimitive.Archive, { asChild: true, children: /* @__PURE__ */ jsx(
53
+ TooltipIconButton,
54
+ {
55
+ ...props,
56
+ ref,
57
+ className: classNames("aui-thread-list-item-archive", className),
58
+ variant: "ghost",
59
+ tooltip: label,
60
+ children: /* @__PURE__ */ jsx(ArchiveIcon, {})
61
+ }
62
+ ) });
63
+ }
64
+ ),
65
+ {}
66
+ );
67
+ ThreadListItemArchive.displayName = "ThreadListItemArchive";
68
+ var exports = {
69
+ Root: ThreadListItemRoot,
70
+ Title: ThreadListItemTitle,
71
+ Archive: ThreadListItemArchive
72
+ };
73
+ var thread_list_item_default = Object.assign(ThreadListItem, exports);
74
+ export {
75
+ thread_list_item_default as default
76
+ };
77
+ //# sourceMappingURL=thread-list-item.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ui/thread-list-item.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ArchiveIcon } from \"lucide-react\";\n\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { ThreadListItemPrimitive } from \"../primitives\";\nimport { useThreadConfig } from \"./thread-config\";\nimport classNames from \"classnames\";\n\nconst ThreadListItem: FC = () => {\n return (\n <ThreadListItemRoot>\n <ThreadListItemTrigger>\n <ThreadListItemTitle />\n </ThreadListItemTrigger>\n <ThreadListItemArchive />\n </ThreadListItemRoot>\n );\n};\n\nconst ThreadListItemRoot = withDefaults(ThreadListItemPrimitive.Root, {\n className: \"aui-thread-list-item\",\n});\n\nThreadListItemRoot.displayName = \"ThreadListItemRoot\";\n\nconst ThreadListItemTrigger = withDefaults(ThreadListItemPrimitive.Trigger, {\n className: \"aui-thread-list-item-trigger\",\n});\n\nnamespace ThreadListItemPrimitiveTitle {\n export type Element = HTMLParagraphElement;\n export type Props = ComponentPropsWithoutRef<\"p\">;\n}\n\nconst ThreadListItemTitle = forwardRef<\n ThreadListItemPrimitiveTitle.Element,\n ThreadListItemPrimitiveTitle.Props\n>(({ className, ...props }, ref) => {\n const {\n strings: {\n threadList: { item: { title: { fallback = \"New Chat\" } = {} } = {} } = {},\n } = {},\n } = useThreadConfig();\n\n return (\n <p\n ref={ref}\n className={classNames(\"aui-thread-list-item-title\", className)}\n {...props}\n >\n <ThreadListItemPrimitive.Title fallback={fallback} />\n </p>\n );\n});\n\nThreadListItemTitle.displayName = \"ThreadListItemTitle\";\n\nconst ThreadListItemArchive = withDefaults(\n forwardRef<HTMLButtonElement, TooltipIconButton.Props>(\n ({ className, ...props }, ref) => {\n const {\n strings: {\n threadList: {\n item: { archive: { label = \"Archive thread\" } = {} } = {},\n } = {},\n } = {},\n } = useThreadConfig();\n\n return (\n <ThreadListItemPrimitive.Archive asChild>\n <TooltipIconButton\n {...props}\n ref={ref}\n className={classNames(\"aui-thread-list-item-archive\", className)}\n variant=\"ghost\"\n tooltip={label}\n >\n <ArchiveIcon />\n </TooltipIconButton>\n </ThreadListItemPrimitive.Archive>\n );\n },\n ),\n {},\n);\n\nThreadListItemArchive.displayName = \"ThreadListItemArchive\";\n\nconst exports = {\n Root: ThreadListItemRoot,\n Title: ThreadListItemTitle,\n Archive: ThreadListItemArchive,\n};\n\nexport default Object.assign(ThreadListItem, exports) as typeof ThreadListItem &\n typeof exports;\n"],"mappings":";;;AAEA,SAAmC,kBAA2B;AAC9D,SAAS,mBAAmB;AAE5B,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAChC,OAAO,gBAAgB;AAInB,SAEI,KAFJ;AAFJ,IAAM,iBAAqB,MAAM;AAC/B,SACE,qBAAC,sBACC;AAAA,wBAAC,yBACC,8BAAC,uBAAoB,GACvB;AAAA,IACA,oBAAC,yBAAsB;AAAA,KACzB;AAEJ;AAEA,IAAM,qBAAqB,aAAa,wBAAwB,MAAM;AAAA,EACpE,WAAW;AACb,CAAC;AAED,mBAAmB,cAAc;AAEjC,IAAM,wBAAwB,aAAa,wBAAwB,SAAS;AAAA,EAC1E,WAAW;AACb,CAAC;AAOD,IAAM,sBAAsB,WAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM;AAAA,IACJ,SAAS;AAAA,MACP,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,WAAW,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IAC1E,IAAI,CAAC;AAAA,EACP,IAAI,gBAAgB;AAEpB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,WAAW,8BAA8B,SAAS;AAAA,MAC5D,GAAG;AAAA,MAEJ,8BAAC,wBAAwB,OAAxB,EAA8B,UAAoB;AAAA;AAAA,EACrD;AAEJ,CAAC;AAED,oBAAoB,cAAc;AAElC,IAAM,wBAAwB;AAAA,EAC5B;AAAA,IACE,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChC,YAAM;AAAA,QACJ,SAAS;AAAA,UACP,YAAY;AAAA,YACV,MAAM,EAAE,SAAS,EAAE,QAAQ,iBAAiB,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,UAC1D,IAAI,CAAC;AAAA,QACP,IAAI,CAAC;AAAA,MACP,IAAI,gBAAgB;AAEpB,aACE,oBAAC,wBAAwB,SAAxB,EAAgC,SAAO,MACtC;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ;AAAA,UACA,WAAW,WAAW,gCAAgC,SAAS;AAAA,UAC/D,SAAQ;AAAA,UACR,SAAS;AAAA,UAET,8BAAC,eAAY;AAAA;AAAA,MACf,GACF;AAAA,IAEJ;AAAA,EACF;AAAA,EACA,CAAC;AACH;AAEA,sBAAsB,cAAc;AAEpC,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACX;AAEA,IAAO,2BAAQ,OAAO,OAAO,gBAAgB,OAAO;","names":[]}
@@ -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":[]}
@@ -1,5 +1,5 @@
1
1
  import { type FC } from "react";
2
- import { TooltipIconButtonProps } from "./base/tooltip-icon-button";
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<TooltipIconButtonProps> & import("react").RefAttributes<HTMLButtonElement>>;
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;
@@ -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,EAEL,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAIpC,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"}
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"}
@@ -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 {\n TooltipIconButton,\n TooltipIconButtonProps,\n} 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<TooltipIconButtonProps>;\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,iCAGO;AACP,+BAA6B;AAC7B,0BAAwB;AACxB,2BAAyB;AACzB,2BAKO;AACP,wBAAgC;AAChC,qBAA0B;AAalB;AAXR,IAAM,SAA2B,CAAC,WAAW;AAC3C,QAAM;AAAA,IACJ,YAAY;AAAA,MACV,UAAU,oBAAoB,gBAAAA;AAAA,MAC9B,eAAe,yBAAyB,sBAAAC;AAAA,MACxC,GAAG;AAAA,IACL,IAAI,CAAC;AAAA,EACP,IAAI;AACJ,SACE,4CAAC,cAAW,QACV,uDAAC,kBACC;AAAA,gDAAC,0BAAuB;AAAA,IACxB,4CAAC,kBAAe,YAAY,mBAAmB;AAAA,IAC/C,4CAAC,6BAA0B;AAAA,IAC3B,6CAAC,wBACC;AAAA,kDAAC,wBAAqB;AAAA,MACtB,4CAAC,qBAAkB;AAAA,OACrB;AAAA,KACF,GACF;AAEJ;AAOA,IAAM,uBAAmB,kCAAa,kCAAgB,MAAM;AAAA,EAC1D,WAAW;AACb,CAAC;AAED,IAAM,iBAAa;AAAA,EACjB,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ;AAC7B,WACE,4CAAC,6CAAqB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G3B,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS;AAAA,MACP,QAAQ,EAAE,gBAAgB,EAAE,UAAU,mBAAmB,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACvE,IAAI,CAAC;AAAA,EACP,QAAI,sCAAgB;AACpB,SACE,4CAAC,kCAAgB,gBAAhB,EAA+B,SAAO,MACrC,sDAAC,kCAA+B,SAAmB,GAAG,OAAO,KAC1D,gBAAM,YAAY,4CAAC,qCAAc,GACpC,GACF;AAEJ,CAAC;AAED,qBAAqB,cAAc;AAEnC,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,gBAAgB;AAClB;AAEA,IAAO,iBAAQ,OAAO,OAAO,QAAQA,QAAO;","names":["Composer","ThreadWelcome","UserMessage","AssistantMessage","EditComposer","exports"]}
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,iCAAkC;AAClC,+BAA6B;AAC7B,0BAAwB;AACxB,2BAAyB;AACzB,2BAKO;AACP,wBAAgC;AAChC,qBAA0B;AAalB;AAXR,IAAM,SAA2B,CAAC,WAAW;AAC3C,QAAM;AAAA,IACJ,YAAY;AAAA,MACV,UAAU,oBAA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KAEJ;AAEJ;AAEA,eAAe,cAAc;AAE7B,IAAM,4BAAgC,MAAM;AAC1C,QAAM,kBAAc,0BAAU,CAAC,MAAM,EAAE,WAAW;AAElD,SACE,4CAAC,kCAAgB,IAAhB,EAAmB,OAAO,OAAO,SAAS,OACzC,sDAAC,SAAI,WAAU,mCACZ,uBAAa,IAAI,CAAC,YAAY,QAC7B;AAAA,IAAC,kCAAgB;AAAA,IAAhB;AAAA,MAEC,WAAU;AAAA,MACV,QAAQ,WAAW;AAAA,MACnB,QAAO;AAAA,MACP,UAAQ;AAAA,MAEP,qBAAW;AAAA;AAAA,IANP;AAAA,EAOP,CACD,GACH,GACF;AAEJ;AAEA,IAAM,qCAAiC,kCAAa,8CAAmB;AAAA,EACrE,SAAS;AAAA,EACT,WAAW;AACb,CAAC;AAOD,IAAM,2BAAuB,yBAG3B,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS;AAAA,MACP,QAAQ,EAAE,gBAAgB,EAAE,UAAU,mBAAmB,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACvE,IAAI,CAAC;AAAA,EACP,QAAI,sCAAgB;AACpB,SACE,4CAAC,kCAAgB,gBAAhB,EAA+B,SAAO,MACrC,sDAAC,kCAA+B,SAAmB,GAAG,OAAO,KAC1D,gBAAM,YAAY,4CAAC,qCAAc,GACpC,GACF;AAEJ,CAAC;AAED,qBAAqB,cAAc;AAEnC,IAAMC,WAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,gBAAgB;AAClB;AAEA,IAAO,iBAAQ,OAAO,OAAO,QAAQA,QAAO;","names":["Composer","ThreadWelcome","UserMessage","AssistantMessage","EditComposer","exports"]}
@@ -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";
@@ -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 {\n TooltipIconButton,\n TooltipIconButtonProps,\n} 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<TooltipIconButtonProps>;\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;AAAA,EACE;AAAA,OAEK;AACP,OAAO,sBAAsB;AAC7B,OAAO,iBAAiB;AACxB,OAAO,kBAAkB;AACzB;AAAA,EAEE;AAAA,EAEA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAalB,SAkDJ,UAlDI,KAGA,YAHA;AAXR,IAAM,SAA2B,CAAC,WAAW;AAC3C,QAAM;AAAA,IACJ,YAAY;AAAA,MACV,UAAU,oBAAoB;AAAA,MAC9B,eAAe,yBAAyB;AAAA,MACxC,GAAG;AAAA,IACL,IAAI,CAAC;AAAA,EACP,IAAI;AACJ,SACE,oBAAC,cAAW,QACV,+BAAC,kBACC;AAAA,wBAAC,0BAAuB;AAAA,IACxB,oBAAC,kBAAe,YAAY,mBAAmB;AAAA,IAC/C,oBAAC,6BAA0B;AAAA,IAC3B,qBAAC,wBACC;AAAA,0BAAC,wBAAqB;AAAA,MACtB,oBAA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ACP,UAAQ;AAAA,MAEP,qBAAW;AAAA;AAAA,IANP;AAAA,EAOP,CACD,GACH,GACF;AAEJ;AAEA,IAAM,iCAAiC,aAAa,mBAAmB;AAAA,EACrE,SAAS;AAAA,EACT,WAAW;AACb,CAAC;AAOD,IAAM,uBAAuB,WAG3B,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS;AAAA,MACP,QAAQ,EAAE,gBAAgB,EAAE,UAAU,mBAAmB,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACvE,IAAI,CAAC;AAAA,EACP,IAAI,gBAAgB;AACpB,SACE,oBAAC,gBAAgB,gBAAhB,EAA+B,SAAO,MACrC,8BAAC,kCAA+B,SAAmB,GAAG,OAAO,KAC1D,gBAAM,YAAY,oBAAC,iBAAc,GACpC,GACF;AAEJ,CAAC;AAED,qBAAqB,cAAc;AAEnC,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,gBAAgB;AAClB;AAEA,IAAO,iBAAQ,OAAO,OAAO,QAAQ,OAAO;","names":[]}
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,OAAO,kBAAkB;AACz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1
  import { type FC } from "react";
2
- import { TooltipIconButtonProps } from "./base/tooltip-icon-button";
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<TooltipIconButtonProps> & import("react").RefAttributes<HTMLButtonElement>>;
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,EAEL,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAYpC,QAAA,MAAM,aAAa,EAAE,EAQpB,CAAC;AAkCF,QAAA,MAAM,OAAO;;;;;;;CAGZ,CAAC;wBAEsD,OAAO,aAAa,GAC1E,OAAO,OAAO;AADhB,wBACiB"}
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 {\n TooltipIconButton,\n TooltipIconButtonProps,\n} 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<TooltipIconButtonProps>;\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,iCAGO;AACP,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"]}
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.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@ -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 {\n TooltipIconButton,\n TooltipIconButtonProps,\n} 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<TooltipIconButtonProps>;\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;AAAA,EACE;AAAA,OAEK;AACP,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":[]}
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,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