@assistant-ui/react 0.7.90 → 0.8.0

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.
Files changed (298) hide show
  1. package/dist/cloud/auiV0.js.map +1 -1
  2. package/dist/cloud/auiV0.mjs.map +1 -1
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1 -3
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +0 -1
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/internal.d.ts +0 -1
  10. package/dist/internal.d.ts.map +1 -1
  11. package/dist/internal.js +0 -3
  12. package/dist/internal.js.map +1 -1
  13. package/dist/internal.mjs +0 -2
  14. package/dist/internal.mjs.map +1 -1
  15. package/dist/model-context/ModelContextTypes.d.ts +11 -0
  16. package/dist/model-context/ModelContextTypes.d.ts.map +1 -1
  17. package/dist/model-context/ModelContextTypes.js.map +1 -1
  18. package/dist/model-context/ModelContextTypes.mjs.map +1 -1
  19. package/dist/model-context/makeAssistantVisible.d.ts.map +1 -1
  20. package/dist/model-context/makeAssistantVisible.js +7 -3
  21. package/dist/model-context/makeAssistantVisible.js.map +1 -1
  22. package/dist/model-context/makeAssistantVisible.mjs +7 -3
  23. package/dist/model-context/makeAssistantVisible.mjs.map +1 -1
  24. package/dist/primitives/contentPart/index.d.ts +0 -1
  25. package/dist/primitives/contentPart/index.d.ts.map +1 -1
  26. package/dist/primitives/contentPart/index.js +0 -3
  27. package/dist/primitives/contentPart/index.js.map +1 -1
  28. package/dist/primitives/contentPart/index.mjs +0 -2
  29. package/dist/primitives/contentPart/index.mjs.map +1 -1
  30. package/dist/primitives/index.d.ts +0 -1
  31. package/dist/primitives/index.d.ts.map +1 -1
  32. package/dist/primitives/index.js +0 -3
  33. package/dist/primitives/index.js.map +1 -1
  34. package/dist/primitives/index.mjs +0 -2
  35. package/dist/primitives/index.mjs.map +1 -1
  36. package/dist/primitives/message/MessageContent.d.ts +1 -2
  37. package/dist/primitives/message/MessageContent.d.ts.map +1 -1
  38. package/dist/primitives/message/MessageContent.js +2 -7
  39. package/dist/primitives/message/MessageContent.js.map +1 -1
  40. package/dist/primitives/message/MessageContent.mjs +2 -7
  41. package/dist/primitives/message/MessageContent.mjs.map +1 -1
  42. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -1
  43. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js +1 -3
  44. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js.map +1 -1
  45. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs +1 -3
  46. package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs.map +1 -1
  47. package/dist/runtimes/edge/converters/toCoreMessages.d.ts.map +1 -1
  48. package/dist/runtimes/edge/converters/toCoreMessages.js +1 -6
  49. package/dist/runtimes/edge/converters/toCoreMessages.js.map +1 -1
  50. package/dist/runtimes/edge/converters/toCoreMessages.mjs +1 -6
  51. package/dist/runtimes/edge/converters/toCoreMessages.mjs.map +1 -1
  52. package/dist/runtimes/edge/converters/toLanguageModelMessages.js.map +1 -1
  53. package/dist/runtimes/edge/converters/toLanguageModelMessages.mjs.map +1 -1
  54. package/dist/runtimes/external-store/ThreadMessageLike.d.ts +2 -2
  55. package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
  56. package/dist/runtimes/external-store/ThreadMessageLike.js +0 -3
  57. package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
  58. package/dist/runtimes/external-store/ThreadMessageLike.mjs +0 -3
  59. package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
  60. package/dist/types/AssistantTypes.d.ts +3 -7
  61. package/dist/types/AssistantTypes.d.ts.map +1 -1
  62. package/dist/types/AssistantTypes.js.map +1 -1
  63. package/dist/types/ContentPartComponentTypes.d.ts +1 -3
  64. package/dist/types/ContentPartComponentTypes.d.ts.map +1 -1
  65. package/dist/types/ContentPartComponentTypes.js.map +1 -1
  66. package/dist/types/index.d.ts +1 -1
  67. package/dist/types/index.d.ts.map +1 -1
  68. package/dist/types/index.js.map +1 -1
  69. package/package.json +1 -21
  70. package/src/cloud/auiV0.ts +1 -1
  71. package/src/index.ts +0 -1
  72. package/src/internal.ts +0 -1
  73. package/src/model-context/ModelContextTypes.ts +19 -0
  74. package/src/model-context/makeAssistantVisible.tsx +9 -3
  75. package/src/primitives/contentPart/index.ts +0 -1
  76. package/src/primitives/index.ts +0 -1
  77. package/src/primitives/message/MessageContent.tsx +0 -9
  78. package/src/runtimes/composer/DefaultEditComposerRuntimeCore.tsx +1 -3
  79. package/src/runtimes/edge/converters/toCoreMessages.ts +11 -14
  80. package/src/runtimes/edge/converters/toLanguageModelMessages.ts +2 -2
  81. package/src/runtimes/external-store/ThreadMessageLike.tsx +0 -6
  82. package/src/types/AssistantTypes.ts +4 -9
  83. package/src/types/ContentPartComponentTypes.tsx +0 -4
  84. package/src/types/index.ts +0 -2
  85. package/dist/primitives/contentPart/ContentPartDisplay.d.ts +0 -9
  86. package/dist/primitives/contentPart/ContentPartDisplay.d.ts.map +0 -1
  87. package/dist/primitives/contentPart/ContentPartDisplay.js +0 -37
  88. package/dist/primitives/contentPart/ContentPartDisplay.js.map +0 -1
  89. package/dist/primitives/contentPart/ContentPartDisplay.mjs +0 -13
  90. package/dist/primitives/contentPart/ContentPartDisplay.mjs.map +0 -1
  91. package/dist/primitives/contentPart/useContentPartDisplay.d.ts +0 -8
  92. package/dist/primitives/contentPart/useContentPartDisplay.d.ts.map +0 -1
  93. package/dist/primitives/contentPart/useContentPartDisplay.js +0 -42
  94. package/dist/primitives/contentPart/useContentPartDisplay.js.map +0 -1
  95. package/dist/primitives/contentPart/useContentPartDisplay.mjs +0 -18
  96. package/dist/primitives/contentPart/useContentPartDisplay.mjs.map +0 -1
  97. package/dist/styles/index.css +0 -1261
  98. package/dist/styles/index.css.map +0 -1
  99. package/dist/styles/modal.css +0 -143
  100. package/dist/styles/modal.css.map +0 -1
  101. package/dist/styles/tailwindcss/base-components.css +0 -69
  102. package/dist/styles/tailwindcss/base-components.css.json +0 -48
  103. package/dist/styles/tailwindcss/modal.css +0 -29
  104. package/dist/styles/tailwindcss/modal.css.json +0 -26
  105. package/dist/styles/tailwindcss/thread.css +0 -262
  106. package/dist/styles/tailwindcss/thread.css.json +0 -183
  107. package/dist/styles/themes/default.css +0 -64
  108. package/dist/styles/themes/default.css.json +0 -46
  109. package/dist/styles/themes/shadcn-extras.css +0 -4
  110. package/dist/styles/themes/shadcn-extras.css.json +0 -5
  111. package/dist/tailwindcss/index.d.ts +0 -49
  112. package/dist/tailwindcss/index.d.ts.map +0 -1
  113. package/dist/tailwindcss/index.js +0 -189
  114. package/dist/tailwindcss/index.js.map +0 -1
  115. package/dist/tailwindcss/index.mjs +0 -181
  116. package/dist/tailwindcss/index.mjs.map +0 -1
  117. package/dist/ui/assistant-action-bar.d.ts +0 -24
  118. package/dist/ui/assistant-action-bar.d.ts.map +0 -1
  119. package/dist/ui/assistant-action-bar.js +0 -193
  120. package/dist/ui/assistant-action-bar.js.map +0 -1
  121. package/dist/ui/assistant-action-bar.mjs +0 -181
  122. package/dist/ui/assistant-action-bar.mjs.map +0 -1
  123. package/dist/ui/assistant-message.d.ts +0 -13
  124. package/dist/ui/assistant-message.d.ts.map +0 -1
  125. package/dist/ui/assistant-message.js +0 -107
  126. package/dist/ui/assistant-message.js.map +0 -1
  127. package/dist/ui/assistant-message.mjs +0 -77
  128. package/dist/ui/assistant-message.mjs.map +0 -1
  129. package/dist/ui/assistant-modal.d.ts +0 -23
  130. package/dist/ui/assistant-modal.d.ts.map +0 -1
  131. package/dist/ui/assistant-modal.js +0 -126
  132. package/dist/ui/assistant-modal.js.map +0 -1
  133. package/dist/ui/assistant-modal.mjs +0 -99
  134. package/dist/ui/assistant-modal.mjs.map +0 -1
  135. package/dist/ui/attachment-ui.d.ts +0 -12
  136. package/dist/ui/attachment-ui.d.ts.map +0 -1
  137. package/dist/ui/attachment-ui.js +0 -170
  138. package/dist/ui/attachment-ui.js.map +0 -1
  139. package/dist/ui/attachment-ui.mjs +0 -160
  140. package/dist/ui/attachment-ui.mjs.map +0 -1
  141. package/dist/ui/base/CircleStopIcon.d.ts +0 -3
  142. package/dist/ui/base/CircleStopIcon.d.ts.map +0 -1
  143. package/dist/ui/base/CircleStopIcon.js +0 -45
  144. package/dist/ui/base/CircleStopIcon.js.map +0 -1
  145. package/dist/ui/base/CircleStopIcon.mjs +0 -20
  146. package/dist/ui/base/CircleStopIcon.mjs.map +0 -1
  147. package/dist/ui/base/avatar.d.ts +0 -12
  148. package/dist/ui/base/avatar.d.ts.map +0 -1
  149. package/dist/ui/base/avatar.js +0 -69
  150. package/dist/ui/base/avatar.js.map +0 -1
  151. package/dist/ui/base/avatar.mjs +0 -31
  152. package/dist/ui/base/avatar.mjs.map +0 -1
  153. package/dist/ui/base/button.d.ts +0 -16
  154. package/dist/ui/base/button.d.ts.map +0 -1
  155. package/dist/ui/base/button.js +0 -66
  156. package/dist/ui/base/button.js.map +0 -1
  157. package/dist/ui/base/button.mjs +0 -40
  158. package/dist/ui/base/button.mjs.map +0 -1
  159. package/dist/ui/base/dialog.d.ts +0 -9
  160. package/dist/ui/base/dialog.d.ts.map +0 -1
  161. package/dist/ui/base/dialog.js +0 -80
  162. package/dist/ui/base/dialog.js.map +0 -1
  163. package/dist/ui/base/dialog.mjs +0 -40
  164. package/dist/ui/base/dialog.mjs.map +0 -1
  165. package/dist/ui/base/index.d.ts +0 -6
  166. package/dist/ui/base/index.d.ts.map +0 -1
  167. package/dist/ui/base/index.js +0 -55
  168. package/dist/ui/base/index.js.map +0 -1
  169. package/dist/ui/base/index.mjs +0 -25
  170. package/dist/ui/base/index.mjs.map +0 -1
  171. package/dist/ui/base/tooltip-icon-button.d.ts +0 -17
  172. package/dist/ui/base/tooltip-icon-button.d.ts.map +0 -1
  173. package/dist/ui/base/tooltip-icon-button.js +0 -44
  174. package/dist/ui/base/tooltip-icon-button.js.map +0 -1
  175. package/dist/ui/base/tooltip-icon-button.mjs +0 -19
  176. package/dist/ui/base/tooltip-icon-button.mjs.map +0 -1
  177. package/dist/ui/base/tooltip.d.ts +0 -6
  178. package/dist/ui/base/tooltip.d.ts.map +0 -1
  179. package/dist/ui/base/tooltip.js +0 -57
  180. package/dist/ui/base/tooltip.js.map +0 -1
  181. package/dist/ui/base/tooltip.mjs +0 -20
  182. package/dist/ui/base/tooltip.mjs.map +0 -1
  183. package/dist/ui/branch-picker.d.ts +0 -15
  184. package/dist/ui/branch-picker.d.ts.map +0 -1
  185. package/dist/ui/branch-picker.js +0 -89
  186. package/dist/ui/branch-picker.js.map +0 -1
  187. package/dist/ui/branch-picker.mjs +0 -69
  188. package/dist/ui/branch-picker.mjs.map +0 -1
  189. package/dist/ui/composer.d.ts +0 -25
  190. package/dist/ui/composer.d.ts.map +0 -1
  191. package/dist/ui/composer.js +0 -168
  192. package/dist/ui/composer.js.map +0 -1
  193. package/dist/ui/composer.mjs +0 -138
  194. package/dist/ui/composer.mjs.map +0 -1
  195. package/dist/ui/content-part.d.ts +0 -7
  196. package/dist/ui/content-part.d.ts.map +0 -1
  197. package/dist/ui/content-part.js +0 -61
  198. package/dist/ui/content-part.js.map +0 -1
  199. package/dist/ui/content-part.mjs +0 -27
  200. package/dist/ui/content-part.mjs.map +0 -1
  201. package/dist/ui/edit-composer.d.ts +0 -22
  202. package/dist/ui/edit-composer.d.ts.map +0 -1
  203. package/dist/ui/edit-composer.js +0 -77
  204. package/dist/ui/edit-composer.js.map +0 -1
  205. package/dist/ui/edit-composer.mjs +0 -57
  206. package/dist/ui/edit-composer.mjs.map +0 -1
  207. package/dist/ui/index.d.ts +0 -75
  208. package/dist/ui/index.d.ts.map +0 -1
  209. package/dist/ui/index.js +0 -86
  210. package/dist/ui/index.js.map +0 -1
  211. package/dist/ui/index.mjs +0 -38
  212. package/dist/ui/index.mjs.map +0 -1
  213. package/dist/ui/thread-config.d.ts +0 -162
  214. package/dist/ui/thread-config.d.ts.map +0 -1
  215. package/dist/ui/thread-config.js +0 -63
  216. package/dist/ui/thread-config.js.map +0 -1
  217. package/dist/ui/thread-config.mjs +0 -41
  218. package/dist/ui/thread-config.mjs.map +0 -1
  219. package/dist/ui/thread-list-item.d.ts +0 -13
  220. package/dist/ui/thread-list-item.d.ts.map +0 -1
  221. package/dist/ui/thread-list-item.js +0 -94
  222. package/dist/ui/thread-list-item.js.map +0 -1
  223. package/dist/ui/thread-list-item.mjs +0 -64
  224. package/dist/ui/thread-list-item.mjs.map +0 -1
  225. package/dist/ui/thread-list.d.ts +0 -27
  226. package/dist/ui/thread-list.d.ts.map +0 -1
  227. package/dist/ui/thread-list.js +0 -91
  228. package/dist/ui/thread-list.js.map +0 -1
  229. package/dist/ui/thread-list.mjs +0 -61
  230. package/dist/ui/thread-list.mjs.map +0 -1
  231. package/dist/ui/thread-welcome.d.ts +0 -21
  232. package/dist/ui/thread-welcome.d.ts.map +0 -1
  233. package/dist/ui/thread-welcome.js +0 -101
  234. package/dist/ui/thread-welcome.js.map +0 -1
  235. package/dist/ui/thread-welcome.mjs +0 -81
  236. package/dist/ui/thread-welcome.mjs.map +0 -1
  237. package/dist/ui/thread.d.ts +0 -30
  238. package/dist/ui/thread.d.ts.map +0 -1
  239. package/dist/ui/thread.js +0 -152
  240. package/dist/ui/thread.js.map +0 -1
  241. package/dist/ui/thread.mjs +0 -125
  242. package/dist/ui/thread.mjs.map +0 -1
  243. package/dist/ui/user-action-bar.d.ts +0 -16
  244. package/dist/ui/user-action-bar.d.ts.map +0 -1
  245. package/dist/ui/user-action-bar.js +0 -63
  246. package/dist/ui/user-action-bar.js.map +0 -1
  247. package/dist/ui/user-action-bar.mjs +0 -43
  248. package/dist/ui/user-action-bar.mjs.map +0 -1
  249. package/dist/ui/user-message.d.ts +0 -13
  250. package/dist/ui/user-message.d.ts.map +0 -1
  251. package/dist/ui/user-message.js +0 -96
  252. package/dist/ui/user-message.js.map +0 -1
  253. package/dist/ui/user-message.mjs +0 -65
  254. package/dist/ui/user-message.mjs.map +0 -1
  255. package/dist/ui/utils/withDefaults.d.ts +0 -7
  256. package/dist/ui/utils/withDefaults.d.ts.map +0 -1
  257. package/dist/ui/utils/withDefaults.js +0 -66
  258. package/dist/ui/utils/withDefaults.js.map +0 -1
  259. package/dist/ui/utils/withDefaults.mjs +0 -30
  260. package/dist/ui/utils/withDefaults.mjs.map +0 -1
  261. package/src/primitives/contentPart/ContentPartDisplay.tsx +0 -20
  262. package/src/primitives/contentPart/useContentPartDisplay.tsx +0 -21
  263. package/src/styles/base.css +0 -37
  264. package/src/styles/index.css +0 -4
  265. package/src/styles/modal.css +0 -1
  266. package/src/styles/tailwindcss/base-components.css +0 -69
  267. package/src/styles/tailwindcss/modal.css +0 -29
  268. package/src/styles/tailwindcss/thread.css +0 -262
  269. package/src/styles/themes/default.css +0 -64
  270. package/src/styles/themes/shadcn-extras.css +0 -4
  271. package/src/tailwindcss/index.ts +0 -149
  272. package/src/ui/assistant-action-bar.tsx +0 -301
  273. package/src/ui/assistant-message.tsx +0 -96
  274. package/src/ui/assistant-modal.tsx +0 -146
  275. package/src/ui/attachment-ui.tsx +0 -211
  276. package/src/ui/base/CircleStopIcon.tsx +0 -17
  277. package/src/ui/base/avatar.tsx +0 -41
  278. package/src/ui/base/button.tsx +0 -42
  279. package/src/ui/base/dialog.tsx +0 -113
  280. package/src/ui/base/index.ts +0 -15
  281. package/src/ui/base/tooltip-icon-button.tsx +0 -29
  282. package/src/ui/base/tooltip.tsx +0 -22
  283. package/src/ui/branch-picker.tsx +0 -117
  284. package/src/ui/composer.tsx +0 -210
  285. package/src/ui/content-part.tsx +0 -23
  286. package/src/ui/edit-composer.tsx +0 -98
  287. package/src/ui/index.ts +0 -98
  288. package/src/ui/thread-config.tsx +0 -246
  289. package/src/ui/thread-list-item.tsx +0 -91
  290. package/src/ui/thread-list.tsx +0 -78
  291. package/src/ui/thread-welcome.tsx +0 -140
  292. package/src/ui/thread.tsx +0 -176
  293. package/src/ui/user-action-bar.tsx +0 -66
  294. package/src/ui/user-message.tsx +0 -92
  295. package/src/ui/utils/withDefaults.tsx +0 -35
  296. package/tailwindcss/README.md +0 -1
  297. package/tailwindcss/package-lock.json +0 -6
  298. package/tailwindcss/package.json +0 -5
@@ -1,57 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/ui/base/tooltip.tsx
31
- var tooltip_exports = {};
32
- __export(tooltip_exports, {
33
- Tooltip: () => Tooltip,
34
- TooltipContent: () => TooltipContent,
35
- TooltipTrigger: () => TooltipTrigger
36
- });
37
- module.exports = __toCommonJS(tooltip_exports);
38
- var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
39
- var import_withDefaults = require("../utils/withDefaults.js");
40
- var import_jsx_runtime = require("react/jsx-runtime");
41
- var Tooltip = (props) => {
42
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Provider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Root, { ...props }) });
43
- };
44
- Tooltip.displayName = "Tooltip";
45
- var TooltipTrigger = TooltipPrimitive.Trigger;
46
- var TooltipContent = (0, import_withDefaults.withDefaults)(TooltipPrimitive.Content, {
47
- sideOffset: 4,
48
- className: "aui-tooltip-content"
49
- });
50
- TooltipContent.displayName = "TooltipContent";
51
- // Annotate the CommonJS export names for ESM import in node:
52
- 0 && (module.exports = {
53
- Tooltip,
54
- TooltipContent,
55
- TooltipTrigger
56
- });
57
- //# sourceMappingURL=tooltip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/ui/base/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { withDefaults } from \"../utils/withDefaults\";\nimport { FC } from \"react\";\n\nexport const Tooltip: FC<TooltipPrimitive.TooltipProps> = (props) => {\n return (\n <TooltipPrimitive.Provider>\n <TooltipPrimitive.Root {...props} />\n </TooltipPrimitive.Provider>\n );\n};\n\nTooltip.displayName = \"Tooltip\";\n\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\nexport const TooltipContent = withDefaults(TooltipPrimitive.Content, {\n sideOffset: 4,\n className: \"aui-tooltip-content\",\n});\n\nTooltipContent.displayName = \"TooltipContent\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAkC;AAClC,0BAA6B;AAMvB;AAHC,IAAM,UAA6C,CAAC,UAAU;AACnE,SACE,4CAAkB,2BAAjB,EACC,sDAAkB,uBAAjB,EAAuB,GAAG,OAAO,GACpC;AAEJ;AAEA,QAAQ,cAAc;AAEf,IAAM,iBAAkC;AAExC,IAAM,qBAAiB,kCAA8B,0BAAS;AAAA,EACnE,YAAY;AAAA,EACZ,WAAW;AACb,CAAC;AAED,eAAe,cAAc;","names":[]}
@@ -1,20 +0,0 @@
1
- // src/ui/base/tooltip.tsx
2
- import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
- import { withDefaults } from "../utils/withDefaults.mjs";
4
- import { jsx } from "react/jsx-runtime";
5
- var Tooltip = (props) => {
6
- return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { ...props }) });
7
- };
8
- Tooltip.displayName = "Tooltip";
9
- var TooltipTrigger = TooltipPrimitive.Trigger;
10
- var TooltipContent = withDefaults(TooltipPrimitive.Content, {
11
- sideOffset: 4,
12
- className: "aui-tooltip-content"
13
- });
14
- TooltipContent.displayName = "TooltipContent";
15
- export {
16
- Tooltip,
17
- TooltipContent,
18
- TooltipTrigger
19
- };
20
- //# sourceMappingURL=tooltip.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/ui/base/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { withDefaults } from \"../utils/withDefaults\";\nimport { FC } from \"react\";\n\nexport const Tooltip: FC<TooltipPrimitive.TooltipProps> = (props) => {\n return (\n <TooltipPrimitive.Provider>\n <TooltipPrimitive.Root {...props} />\n </TooltipPrimitive.Provider>\n );\n};\n\nTooltip.displayName = \"Tooltip\";\n\nexport const TooltipTrigger = TooltipPrimitive.Trigger;\n\nexport const TooltipContent = withDefaults(TooltipPrimitive.Content, {\n sideOffset: 4,\n className: \"aui-tooltip-content\",\n});\n\nTooltipContent.displayName = \"TooltipContent\";\n"],"mappings":";AAAA,YAAY,sBAAsB;AAClC,SAAS,oBAAoB;AAMvB;AAHC,IAAM,UAA6C,CAAC,UAAU;AACnE,SACE,oBAAkB,2BAAjB,EACC,8BAAkB,uBAAjB,EAAuB,GAAG,OAAO,GACpC;AAEJ;AAEA,QAAQ,cAAc;AAEf,IAAM,iBAAkC;AAExC,IAAM,iBAAiB,aAA8B,0BAAS;AAAA,EACnE,YAAY;AAAA,EACZ,WAAW;AACb,CAAC;AAED,eAAe,cAAc;","names":[]}
@@ -1,15 +0,0 @@
1
- import { type FC } from "react";
2
- import { TooltipIconButton } from "./base/tooltip-icon-button";
3
- declare const BranchPicker: FC;
4
- declare const exports: {
5
- Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
6
- asChild?: boolean;
7
- }, "ref"> & {
8
- hideWhenSingleBranch?: boolean | undefined;
9
- } & import("react").RefAttributes<HTMLDivElement>, "ref">> & import("react").RefAttributes<HTMLDivElement>>;
10
- Previous: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
11
- Next: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
12
- };
13
- declare const _default: typeof BranchPicker & typeof exports;
14
- export default _default;
15
- //# sourceMappingURL=branch-picker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"branch-picker.d.ts","sourceRoot":"","sources":["../../src/ui/branch-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAY/D,QAAA,MAAM,YAAY,EAAE,EAUnB,CAAC;AAkFF,QAAA,MAAM,OAAO;;;;;;;;CAIZ,CAAC;wBAEqD,OAAO,YAAY,GACxE,OAAO,OAAO;AADhB,wBACiB"}
@@ -1,89 +0,0 @@
1
- "use strict";
2
- "use client";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/ui/branch-picker.tsx
22
- var branch_picker_exports = {};
23
- __export(branch_picker_exports, {
24
- default: () => branch_picker_default
25
- });
26
- module.exports = __toCommonJS(branch_picker_exports);
27
- var import_react = require("react");
28
- var import_lucide_react = require("lucide-react");
29
- var import_tooltip_icon_button = require("./base/tooltip-icon-button.js");
30
- var import_withDefaults = require("./utils/withDefaults.js");
31
- var import_thread_config = require("./thread-config.js");
32
- var import_primitives = require("../primitives/index.js");
33
- var import_context = require("../context/index.js");
34
- var import_jsx_runtime = require("react/jsx-runtime");
35
- var useAllowBranchPicker = (ensureCapability = false) => {
36
- const { branchPicker: { allowBranchPicker = true } = {} } = (0, import_thread_config.useThreadConfig)();
37
- const branchPickerSupported = (0, import_context.useThread)((t) => t.capabilities.edit);
38
- return allowBranchPicker && (!ensureCapability || branchPickerSupported);
39
- };
40
- var BranchPicker = () => {
41
- const allowBranchPicker = useAllowBranchPicker(true);
42
- if (!allowBranchPicker) return null;
43
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(BranchPickerRoot, { hideWhenSingleBranch: true, children: [
44
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BranchPickerPrevious, {}),
45
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BranchPickerState, {}),
46
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BranchPickerNext, {})
47
- ] });
48
- };
49
- BranchPicker.displayName = "BranchPicker";
50
- var BranchPickerRoot = (0, import_withDefaults.withDefaults)(import_primitives.BranchPickerPrimitive.Root, {
51
- className: "aui-branch-picker-root"
52
- });
53
- BranchPickerRoot.displayName = "BranchPickerRoot";
54
- var BranchPickerPrevious = (0, import_react.forwardRef)((props, ref) => {
55
- const {
56
- strings: {
57
- branchPicker: { previous: { tooltip = "Previous" } = {} } = {}
58
- } = {}
59
- } = (0, import_thread_config.useThreadConfig)();
60
- const allowBranchPicker = useAllowBranchPicker();
61
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.BranchPickerPrimitive.Previous, { disabled: !allowBranchPicker, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tooltip_icon_button.TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronLeftIcon, {}) }) });
62
- });
63
- BranchPickerPrevious.displayName = "BranchPickerPrevious";
64
- var BranchPickerStateWrapper = (0, import_withDefaults.withDefaults)("span", {
65
- className: "aui-branch-picker-state"
66
- });
67
- var BranchPickerState = (0, import_react.forwardRef)((props, ref) => {
68
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(BranchPickerStateWrapper, { ...props, ref, children: [
69
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.BranchPickerPrimitive.Number, {}),
70
- " / ",
71
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.BranchPickerPrimitive.Count, {})
72
- ] });
73
- });
74
- BranchPickerState.displayName = "BranchPickerState";
75
- var BranchPickerNext = (0, import_react.forwardRef)((props, ref) => {
76
- const {
77
- strings: { branchPicker: { next: { tooltip = "Next" } = {} } = {} } = {}
78
- } = (0, import_thread_config.useThreadConfig)();
79
- const allowBranchPicker = useAllowBranchPicker();
80
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.BranchPickerPrimitive.Next, { disabled: !allowBranchPicker, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tooltip_icon_button.TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronRightIcon, {}) }) });
81
- });
82
- BranchPickerNext.displayName = "BranchPickerNext";
83
- var exports2 = {
84
- Root: BranchPickerRoot,
85
- Previous: BranchPickerPrevious,
86
- Next: BranchPickerNext
87
- };
88
- var branch_picker_default = Object.assign(BranchPicker, exports2);
89
- //# sourceMappingURL=branch-picker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/ui/branch-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { BranchPickerPrimitive } from \"../primitives\";\nimport { useThread } from \"../context\";\n\nconst useAllowBranchPicker = (ensureCapability = false) => {\n const { branchPicker: { allowBranchPicker = true } = {} } = useThreadConfig();\n const branchPickerSupported = useThread((t) => t.capabilities.edit);\n return allowBranchPicker && (!ensureCapability || branchPickerSupported);\n};\n\nconst BranchPicker: FC = () => {\n const allowBranchPicker = useAllowBranchPicker(true);\n if (!allowBranchPicker) return null;\n return (\n <BranchPickerRoot hideWhenSingleBranch>\n <BranchPickerPrevious />\n <BranchPickerState />\n <BranchPickerNext />\n </BranchPickerRoot>\n );\n};\n\nBranchPicker.displayName = \"BranchPicker\";\n\nconst BranchPickerRoot = withDefaults(BranchPickerPrimitive.Root, {\n className: \"aui-branch-picker-root\",\n});\n\nBranchPickerRoot.displayName = \"BranchPickerRoot\";\n\nnamespace BranchPickerPrevious {\n export type Element = BranchPickerPrimitive.Previous.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst BranchPickerPrevious = forwardRef<\n BranchPickerPrevious.Element,\n BranchPickerPrevious.Props\n>((props, ref) => {\n const {\n strings: {\n branchPicker: { previous: { tooltip = \"Previous\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Previous disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronLeftIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Previous>\n );\n});\n\nBranchPickerPrevious.displayName = \"BranchPickerPrevious\";\n\nconst BranchPickerStateWrapper = withDefaults(\"span\", {\n className: \"aui-branch-picker-state\",\n});\n\nnamespace BranchPickerState {\n export type Element = HTMLSpanElement;\n export type Props = ComponentPropsWithoutRef<\"span\">;\n}\n\nconst BranchPickerState = forwardRef<\n BranchPickerState.Element,\n BranchPickerState.Props\n>((props, ref) => {\n return (\n <BranchPickerStateWrapper {...props} ref={ref}>\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </BranchPickerStateWrapper>\n );\n});\n\nBranchPickerState.displayName = \"BranchPickerState\";\n\nnamespace BranchPickerNext {\n export type Element = BranchPickerPrimitive.Next.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst BranchPickerNext = forwardRef<\n BranchPickerNext.Element,\n BranchPickerNext.Props\n>((props, ref) => {\n const {\n strings: { branchPicker: { next: { tooltip = \"Next\" } = {} } = {} } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Next disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronRightIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Next>\n );\n});\n\nBranchPickerNext.displayName = \"BranchPickerNext\";\n\nconst exports = {\n Root: BranchPickerRoot,\n Previous: BranchPickerPrevious,\n Next: BranchPickerNext,\n};\n\nexport default Object.assign(BranchPicker, exports) as typeof BranchPicker &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA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;AAChB,SACE,6CAAC,4BAA0B,GAAG,OAAO,KACnC;AAAA,gDAAC,wCAAsB,QAAtB,EAA6B;AAAA,IAAE;AAAA,IAAG,4CAAC,wCAAsB,OAAtB,EAA4B;AAAA,KAClE;AAEJ,CAAC;AAED,kBAAkB,cAAc;AAOhC,IAAM,uBAAmB,yBAGvB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACzE,QAAI,sCAAgB;AACpB,QAAM,oBAAoB,qBAAqB;AAC/C,SACE,4CAAC,wCAAsB,MAAtB,EAA2B,UAAU,CAAC,mBAAmB,SAAO,MAC/D,sDAAC,gDAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,4CAAC,wCAAiB,GACvC,GACF;AAEJ,CAAC;AAED,iBAAiB,cAAc;AAE/B,IAAMA,WAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AACR;AAEA,IAAO,wBAAQ,OAAO,OAAO,cAAcA,QAAO;","names":["exports"]}
@@ -1,69 +0,0 @@
1
- "use client";
2
-
3
- // src/ui/branch-picker.tsx
4
- import { forwardRef } from "react";
5
- import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
6
- import { TooltipIconButton } from "./base/tooltip-icon-button.mjs";
7
- import { withDefaults } from "./utils/withDefaults.mjs";
8
- import { useThreadConfig } from "./thread-config.mjs";
9
- import { BranchPickerPrimitive } from "../primitives/index.mjs";
10
- import { useThread } from "../context/index.mjs";
11
- import { jsx, jsxs } from "react/jsx-runtime";
12
- var useAllowBranchPicker = (ensureCapability = false) => {
13
- const { branchPicker: { allowBranchPicker = true } = {} } = useThreadConfig();
14
- const branchPickerSupported = useThread((t) => t.capabilities.edit);
15
- return allowBranchPicker && (!ensureCapability || branchPickerSupported);
16
- };
17
- var BranchPicker = () => {
18
- const allowBranchPicker = useAllowBranchPicker(true);
19
- if (!allowBranchPicker) return null;
20
- return /* @__PURE__ */ jsxs(BranchPickerRoot, { hideWhenSingleBranch: true, children: [
21
- /* @__PURE__ */ jsx(BranchPickerPrevious, {}),
22
- /* @__PURE__ */ jsx(BranchPickerState, {}),
23
- /* @__PURE__ */ jsx(BranchPickerNext, {})
24
- ] });
25
- };
26
- BranchPicker.displayName = "BranchPicker";
27
- var BranchPickerRoot = withDefaults(BranchPickerPrimitive.Root, {
28
- className: "aui-branch-picker-root"
29
- });
30
- BranchPickerRoot.displayName = "BranchPickerRoot";
31
- var BranchPickerPrevious = forwardRef((props, ref) => {
32
- const {
33
- strings: {
34
- branchPicker: { previous: { tooltip = "Previous" } = {} } = {}
35
- } = {}
36
- } = useThreadConfig();
37
- const allowBranchPicker = useAllowBranchPicker();
38
- return /* @__PURE__ */ jsx(BranchPickerPrimitive.Previous, { disabled: !allowBranchPicker, asChild: true, children: /* @__PURE__ */ jsx(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx(ChevronLeftIcon, {}) }) });
39
- });
40
- BranchPickerPrevious.displayName = "BranchPickerPrevious";
41
- var BranchPickerStateWrapper = withDefaults("span", {
42
- className: "aui-branch-picker-state"
43
- });
44
- var BranchPickerState = forwardRef((props, ref) => {
45
- return /* @__PURE__ */ jsxs(BranchPickerStateWrapper, { ...props, ref, children: [
46
- /* @__PURE__ */ jsx(BranchPickerPrimitive.Number, {}),
47
- " / ",
48
- /* @__PURE__ */ jsx(BranchPickerPrimitive.Count, {})
49
- ] });
50
- });
51
- BranchPickerState.displayName = "BranchPickerState";
52
- var BranchPickerNext = forwardRef((props, ref) => {
53
- const {
54
- strings: { branchPicker: { next: { tooltip = "Next" } = {} } = {} } = {}
55
- } = useThreadConfig();
56
- const allowBranchPicker = useAllowBranchPicker();
57
- return /* @__PURE__ */ jsx(BranchPickerPrimitive.Next, { disabled: !allowBranchPicker, asChild: true, children: /* @__PURE__ */ jsx(TooltipIconButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ jsx(ChevronRightIcon, {}) }) });
58
- });
59
- BranchPickerNext.displayName = "BranchPickerNext";
60
- var exports = {
61
- Root: BranchPickerRoot,
62
- Previous: BranchPickerPrevious,
63
- Next: BranchPickerNext
64
- };
65
- var branch_picker_default = Object.assign(BranchPicker, exports);
66
- export {
67
- branch_picker_default as default
68
- };
69
- //# sourceMappingURL=branch-picker.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/ui/branch-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { BranchPickerPrimitive } from \"../primitives\";\nimport { useThread } from \"../context\";\n\nconst useAllowBranchPicker = (ensureCapability = false) => {\n const { branchPicker: { allowBranchPicker = true } = {} } = useThreadConfig();\n const branchPickerSupported = useThread((t) => t.capabilities.edit);\n return allowBranchPicker && (!ensureCapability || branchPickerSupported);\n};\n\nconst BranchPicker: FC = () => {\n const allowBranchPicker = useAllowBranchPicker(true);\n if (!allowBranchPicker) return null;\n return (\n <BranchPickerRoot hideWhenSingleBranch>\n <BranchPickerPrevious />\n <BranchPickerState />\n <BranchPickerNext />\n </BranchPickerRoot>\n );\n};\n\nBranchPicker.displayName = \"BranchPicker\";\n\nconst BranchPickerRoot = withDefaults(BranchPickerPrimitive.Root, {\n className: \"aui-branch-picker-root\",\n});\n\nBranchPickerRoot.displayName = \"BranchPickerRoot\";\n\nnamespace BranchPickerPrevious {\n export type Element = BranchPickerPrimitive.Previous.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst BranchPickerPrevious = forwardRef<\n BranchPickerPrevious.Element,\n BranchPickerPrevious.Props\n>((props, ref) => {\n const {\n strings: {\n branchPicker: { previous: { tooltip = \"Previous\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Previous disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronLeftIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Previous>\n );\n});\n\nBranchPickerPrevious.displayName = \"BranchPickerPrevious\";\n\nconst BranchPickerStateWrapper = withDefaults(\"span\", {\n className: \"aui-branch-picker-state\",\n});\n\nnamespace BranchPickerState {\n export type Element = HTMLSpanElement;\n export type Props = ComponentPropsWithoutRef<\"span\">;\n}\n\nconst BranchPickerState = forwardRef<\n BranchPickerState.Element,\n BranchPickerState.Props\n>((props, ref) => {\n return (\n <BranchPickerStateWrapper {...props} ref={ref}>\n <BranchPickerPrimitive.Number /> / <BranchPickerPrimitive.Count />\n </BranchPickerStateWrapper>\n );\n});\n\nBranchPickerState.displayName = \"BranchPickerState\";\n\nnamespace BranchPickerNext {\n export type Element = BranchPickerPrimitive.Next.Element;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst BranchPickerNext = forwardRef<\n BranchPickerNext.Element,\n BranchPickerNext.Props\n>((props, ref) => {\n const {\n strings: { branchPicker: { next: { tooltip = \"Next\" } = {} } = {} } = {},\n } = useThreadConfig();\n const allowBranchPicker = useAllowBranchPicker();\n return (\n <BranchPickerPrimitive.Next disabled={!allowBranchPicker} asChild>\n <TooltipIconButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <ChevronRightIcon />}\n </TooltipIconButton>\n </BranchPickerPrimitive.Next>\n );\n});\n\nBranchPickerNext.displayName = \"BranchPickerNext\";\n\nconst exports = {\n Root: BranchPickerRoot,\n Previous: BranchPickerPrevious,\n Next: BranchPickerNext,\n};\n\nexport default Object.assign(BranchPicker, exports) as typeof BranchPicker &\n typeof exports;\n"],"mappings":";;;AAEA,SAAmC,kBAA2B;A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O,QAAQ;AAChB,SACE,qBAAC,4BAA0B,GAAG,OAAO,KACnC;AAAA,wBAAC,sBAAsB,QAAtB,EAA6B;AAAA,IAAE;AAAA,IAAG,oBAAC,sBAAsB,OAAtB,EAA4B;AAAA,KAClE;AAEJ,CAAC;AAED,kBAAkB,cAAc;AAOhC,IAAM,mBAAmB,WAGvB,CAAC,OAAO,QAAQ;AAChB,QAAM;AAAA,IACJ,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACzE,IAAI,gBAAgB;AACpB,QAAM,oBAAoB,qBAAqB;AAC/C,SACE,oBAAC,sBAAsB,MAAtB,EAA2B,UAAU,CAAC,mBAAmB,SAAO,MAC/D,8BAAC,qBAAkB,SAAmB,GAAG,OAAO,KAC7C,gBAAM,YAAY,oBAAC,oBAAiB,GACvC,GACF;AAEJ,CAAC;AAED,iBAAiB,cAAc;AAE/B,IAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AACR;AAEA,IAAO,wBAAQ,OAAO,OAAO,cAAc,OAAO;","names":[]}
@@ -1,25 +0,0 @@
1
- import { type FC } from "react";
2
- import { TooltipIconButton } from "./base/tooltip-icon-button";
3
- import { ComposerPrimitive } from "../primitives";
4
- declare const Composer: FC;
5
- declare const exports: {
6
- Root: import("react").ForwardRefExoticComponent<Partial<Omit<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & {
7
- asChild?: boolean;
8
- }, "ref"> & import("react").RefAttributes<HTMLFormElement>, "ref">> & import("react").RefAttributes<HTMLFormElement>>;
9
- Input: import("react").ForwardRefExoticComponent<Omit<Partial<Omit<import("react-textarea-autosize").TextareaAutosizeProps & {
10
- asChild?: boolean | undefined;
11
- submitOnEnter?: boolean | undefined;
12
- cancelOnEscape?: boolean | undefined;
13
- unstable_focusOnRunStart?: boolean | undefined;
14
- unstable_focusOnScrollToBottom?: boolean | undefined;
15
- unstable_focusOnThreadSwitched?: boolean | undefined;
16
- } & import("react").RefAttributes<HTMLTextAreaElement>, "ref">> & import("react").RefAttributes<HTMLTextAreaElement>, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
17
- Action: FC;
18
- Send: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
19
- Cancel: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
20
- AddAttachment: import("react").ForwardRefExoticComponent<Partial<TooltipIconButton.Props> & import("react").RefAttributes<HTMLButtonElement>>;
21
- Attachments: FC<Partial<ComposerPrimitive.Attachments.Props>>;
22
- };
23
- declare const _default: typeof Composer & typeof exports;
24
- export default _default;
25
- //# sourceMappingURL=composer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/ui/composer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAKtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAmB,MAAM,eAAe,CAAC;AAUnE,QAAA,MAAM,QAAQ,EAAE,EAUf,CAAC;AAyKF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;CAQZ,CAAC;wBAEiD,OAAO,QAAQ,GAChE,OAAO,OAAO;AADhB,wBACiB"}
@@ -1,168 +0,0 @@
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/composer.tsx
32
- var composer_exports = {};
33
- __export(composer_exports, {
34
- default: () => composer_default
35
- });
36
- module.exports = __toCommonJS(composer_exports);
37
- var import_react = require("react");
38
- var import_lucide_react = require("lucide-react");
39
- var import_withDefaults = require("./utils/withDefaults.js");
40
- var import_thread_config = require("./thread-config.js");
41
- var import_tooltip_icon_button = require("./base/tooltip-icon-button.js");
42
- var import_CircleStopIcon = require("./base/CircleStopIcon.js");
43
- var import_primitives = require("../primitives/index.js");
44
- var import_ThreadContext = require("../context/react/ThreadContext.js");
45
- var import_attachment_ui = __toESM(require("./attachment-ui.js"));
46
- var import_jsx_runtime = require("react/jsx-runtime");
47
- var useAllowAttachments = (ensureCapability = false) => {
48
- const { composer: { allowAttachments = true } = {} } = (0, import_thread_config.useThreadConfig)();
49
- const attachmentsSupported = (0, import_ThreadContext.useThread)((t) => t.capabilities.attachments);
50
- return allowAttachments && (!ensureCapability || attachmentsSupported);
51
- };
52
- var Composer = () => {
53
- const allowAttachments = useAllowAttachments(true);
54
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ComposerRoot, { children: [
55
- allowAttachments && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerAttachments, {}),
56
- allowAttachments && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerAddAttachment, {}),
57
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerInput, { autoFocus: true }),
58
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerAction, {})
59
- ] });
60
- };
61
- Composer.displayName = "Composer";
62
- var ComposerRoot = (0, import_withDefaults.withDefaults)(import_primitives.ComposerPrimitive.Root, {
63
- className: "aui-composer-root"
64
- });
65
- ComposerRoot.displayName = "ComposerRoot";
66
- var ComposerInputStyled = (0, import_withDefaults.withDefaults)(import_primitives.ComposerPrimitive.Input, {
67
- rows: 1,
68
- autoFocus: true,
69
- className: "aui-composer-input"
70
- });
71
- var ComposerInput = (0, import_react.forwardRef)(
72
- (props, ref) => {
73
- const {
74
- strings: {
75
- composer: { input: { placeholder = "Write a message..." } = {} } = {}
76
- } = {}
77
- } = (0, import_thread_config.useThreadConfig)();
78
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerInputStyled, { placeholder, ...props, ref });
79
- }
80
- );
81
- ComposerInput.displayName = "ComposerInput";
82
- var ComposerAttachmentsContainer = (0, import_withDefaults.withDefaults)("div", {
83
- className: "aui-composer-attachments"
84
- });
85
- var ComposerAttachments = ({ components }) => {
86
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerAttachmentsContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
87
- import_primitives.ComposerPrimitive.Attachments,
88
- {
89
- components: {
90
- ...components,
91
- Attachment: components?.Attachment ?? import_attachment_ui.default
92
- }
93
- }
94
- ) });
95
- };
96
- var ComposerAttachButton = (0, import_withDefaults.withDefaults)(import_tooltip_icon_button.TooltipIconButton, {
97
- variant: "default",
98
- className: "aui-composer-attach"
99
- });
100
- var ComposerAddAttachment = (0, import_react.forwardRef)((props, ref) => {
101
- const {
102
- strings: {
103
- composer: { addAttachment: { tooltip = "Attach file" } = {} } = {}
104
- } = {}
105
- } = (0, import_thread_config.useThreadConfig)();
106
- const allowAttachments = useAllowAttachments();
107
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ComposerPrimitive.AddAttachment, { disabled: !allowAttachments, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
- ComposerAttachButton,
109
- {
110
- tooltip,
111
- variant: "ghost",
112
- ...props,
113
- ref,
114
- children: props.children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.PaperclipIcon, {})
115
- }
116
- ) });
117
- });
118
- ComposerAddAttachment.displayName = "ComposerAddAttachment";
119
- var useAllowCancel = () => {
120
- const cancelSupported = (0, import_ThreadContext.useThread)((t) => t.capabilities.cancel);
121
- return cancelSupported;
122
- };
123
- var ComposerAction = () => {
124
- const allowCancel = useAllowCancel();
125
- if (!allowCancel) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerSend, {});
126
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
127
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ThreadPrimitive.If, { running: false, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerSend, {}) }),
128
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ThreadPrimitive.If, { running: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerCancel, {}) })
129
- ] });
130
- };
131
- ComposerAction.displayName = "ComposerAction";
132
- var ComposerSendButton = (0, import_withDefaults.withDefaults)(import_tooltip_icon_button.TooltipIconButton, {
133
- variant: "default",
134
- className: "aui-composer-send"
135
- });
136
- var ComposerSend = (0, import_react.forwardRef)(
137
- (props, ref) => {
138
- const {
139
- strings: { composer: { send: { tooltip = "Send" } = {} } = {} } = {}
140
- } = (0, import_thread_config.useThreadConfig)();
141
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ComposerPrimitive.Send, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerSendButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.SendHorizontalIcon, {}) }) });
142
- }
143
- );
144
- ComposerSend.displayName = "ComposerSend";
145
- var ComposerCancelButton = (0, import_withDefaults.withDefaults)(import_tooltip_icon_button.TooltipIconButton, {
146
- variant: "default",
147
- className: "aui-composer-cancel"
148
- });
149
- var ComposerCancel = (0, import_react.forwardRef)(
150
- (props, ref) => {
151
- const {
152
- strings: { composer: { cancel: { tooltip = "Cancel" } = {} } = {} } = {}
153
- } = (0, import_thread_config.useThreadConfig)();
154
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.ComposerPrimitive.Cancel, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerCancelButton, { tooltip, ...props, ref, children: props.children ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CircleStopIcon.CircleStopIcon, {}) }) });
155
- }
156
- );
157
- ComposerCancel.displayName = "ComposerCancel";
158
- var exports2 = {
159
- Root: ComposerRoot,
160
- Input: ComposerInput,
161
- Action: ComposerAction,
162
- Send: ComposerSend,
163
- Cancel: ComposerCancel,
164
- AddAttachment: ComposerAddAttachment,
165
- Attachments: ComposerAttachments
166
- };
167
- var composer_default = Object.assign(Composer, exports2);
168
- //# sourceMappingURL=composer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/ui/composer.tsx"],"sourcesContent":["\"use client\";\n\nimport { ComponentPropsWithoutRef, forwardRef, type FC } from \"react\";\n\nimport { PaperclipIcon, SendHorizontalIcon } from \"lucide-react\";\nimport { withDefaults } from \"./utils/withDefaults\";\nimport { useThreadConfig } from \"./thread-config\";\nimport { TooltipIconButton } from \"./base/tooltip-icon-button\";\nimport { CircleStopIcon } from \"./base/CircleStopIcon\";\nimport { ComposerPrimitive, ThreadPrimitive } from \"../primitives\";\nimport { useThread } from \"../context/react/ThreadContext\";\nimport Attachment from \"./attachment-ui\";\n\nconst useAllowAttachments = (ensureCapability = false) => {\n const { composer: { allowAttachments = true } = {} } = useThreadConfig();\n const attachmentsSupported = useThread((t) => t.capabilities.attachments);\n return allowAttachments && (!ensureCapability || attachmentsSupported);\n};\n\nconst Composer: FC = () => {\n const allowAttachments = useAllowAttachments(true);\n return (\n <ComposerRoot>\n {allowAttachments && <ComposerAttachments />}\n {allowAttachments && <ComposerAddAttachment />}\n <ComposerInput autoFocus />\n <ComposerAction />\n </ComposerRoot>\n );\n};\n\nComposer.displayName = \"Composer\";\n\nconst ComposerRoot = withDefaults(ComposerPrimitive.Root, {\n className: \"aui-composer-root\",\n});\n\nComposerRoot.displayName = \"ComposerRoot\";\n\nconst ComposerInputStyled = withDefaults(ComposerPrimitive.Input, {\n rows: 1,\n autoFocus: true,\n className: \"aui-composer-input\",\n});\n\nnamespace ComposerInput {\n export type Element = HTMLTextAreaElement;\n export type Props = ComponentPropsWithoutRef<typeof ComposerInputStyled>;\n}\n\nconst ComposerInput = forwardRef<ComposerInput.Element, ComposerInput.Props>(\n (props, ref) => {\n const {\n strings: {\n composer: { input: { placeholder = \"Write a message...\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n return (\n <ComposerInputStyled placeholder={placeholder} {...props} ref={ref} />\n );\n },\n);\n\nComposerInput.displayName = \"ComposerInput\";\n\nconst ComposerAttachmentsContainer = withDefaults(\"div\", {\n className: \"aui-composer-attachments\",\n});\n\nnamespace ComposerAttachments {\n export type Props = Partial<ComposerPrimitive.Attachments.Props>;\n}\n\nconst ComposerAttachments: FC<ComposerAttachments.Props> = ({ components }) => {\n return (\n <ComposerAttachmentsContainer>\n <ComposerPrimitive.Attachments\n components={{\n ...components,\n Attachment: components?.Attachment ?? Attachment,\n }}\n />\n </ComposerAttachmentsContainer>\n );\n};\n\nconst ComposerAttachButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-attach\",\n});\n\nnamespace ComposerAddAttachment {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ComposerAddAttachment = forwardRef<\n ComposerAddAttachment.Element,\n ComposerAddAttachment.Props\n>((props, ref) => {\n const {\n strings: {\n composer: { addAttachment: { tooltip = \"Attach file\" } = {} } = {},\n } = {},\n } = useThreadConfig();\n const allowAttachments = useAllowAttachments();\n return (\n <ComposerPrimitive.AddAttachment disabled={!allowAttachments} asChild>\n <ComposerAttachButton\n tooltip={tooltip}\n variant={\"ghost\"}\n {...props}\n ref={ref}\n >\n {props.children ?? <PaperclipIcon />}\n </ComposerAttachButton>\n </ComposerPrimitive.AddAttachment>\n );\n});\n\nComposerAddAttachment.displayName = \"ComposerAddAttachment\";\n\nconst useAllowCancel = () => {\n const cancelSupported = useThread((t) => t.capabilities.cancel);\n return cancelSupported;\n};\n\nconst ComposerAction: FC = () => {\n const allowCancel = useAllowCancel();\n if (!allowCancel) return <ComposerSend />;\n return (\n <>\n <ThreadPrimitive.If running={false}>\n <ComposerSend />\n </ThreadPrimitive.If>\n <ThreadPrimitive.If running>\n <ComposerCancel />\n </ThreadPrimitive.If>\n </>\n );\n};\n\nComposerAction.displayName = \"ComposerAction\";\n\nconst ComposerSendButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-send\",\n});\n\nnamespace ComposerSend {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ComposerSend = forwardRef<ComposerSend.Element, ComposerSend.Props>(\n (props, ref) => {\n const {\n strings: { composer: { send: { tooltip = \"Send\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Send asChild>\n <ComposerSendButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <SendHorizontalIcon />}\n </ComposerSendButton>\n </ComposerPrimitive.Send>\n );\n },\n);\n\nComposerSend.displayName = \"ComposerSend\";\n\nconst ComposerCancelButton = withDefaults(TooltipIconButton, {\n variant: \"default\",\n className: \"aui-composer-cancel\",\n});\n\nnamespace ComposerCancel {\n export type Element = HTMLButtonElement;\n export type Props = Partial<TooltipIconButton.Props>;\n}\n\nconst ComposerCancel = forwardRef<ComposerCancel.Element, ComposerCancel.Props>(\n (props, ref) => {\n const {\n strings: { composer: { cancel: { tooltip = \"Cancel\" } = {} } = {} } = {},\n } = useThreadConfig();\n return (\n <ComposerPrimitive.Cancel asChild>\n <ComposerCancelButton tooltip={tooltip} {...props} ref={ref}>\n {props.children ?? <CircleStopIcon />}\n </ComposerCancelButton>\n </ComposerPrimitive.Cancel>\n );\n },\n);\n\nComposerCancel.displayName = \"ComposerCancel\";\n\nconst exports = {\n Root: ComposerRoot,\n Input: ComposerInput,\n Action: ComposerAction,\n Send: ComposerSend,\n Cancel: ComposerCancel,\n AddAttachment: ComposerAddAttachment,\n Attachments: ComposerAttachments,\n};\n\nexport default Object.assign(Composer, exports) as typeof Composer &\n typeof exports;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8D;AAE9D,0BAAkD;AAClD,0BAA6B;AAC7B,2BAAgC;AAChC,iCAAkC;AAClC,4BAA+B;AAC/B,wBAAmD;AACnD,2BAA0B;AAC1B,2BAAuB;AAWnB;AATJ,IAAM,sBAAsB,CAAC,mBAAmB,UAAU;AACxD,QAAM,EAAE,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC,EAAE,QAAI,sCAAgB;AACvE,QAAM,2BAAuB,gCAAU,CAAC,MAAM,EAAE,aAAa,WAAW;AACxE,SAAO,qBAAqB,CAAC,oBAAoB;AACnD;AAEA,IAAM,WAAe,MAAM;AACzB,QAAM,mBAAmB,oBAAoB,IAAI;AACjD,SACE,6CAAC,gBACE;AAAA,wBAAoB,4CAAC,uBAAoB;AAAA,IACzC,oBAAoB,4CAAC,yBAAsB;AAAA,IAC5C,4CAAC,iBAAc,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