@assistant-ui/react 0.7.91 → 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.
- package/dist/cloud/auiV0.js.map +1 -1
- package/dist/cloud/auiV0.mjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.ts +0 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +0 -3
- package/dist/internal.js.map +1 -1
- package/dist/internal.mjs +0 -2
- package/dist/internal.mjs.map +1 -1
- package/dist/model-context/ModelContextTypes.d.ts +11 -0
- package/dist/model-context/ModelContextTypes.d.ts.map +1 -1
- package/dist/model-context/ModelContextTypes.js.map +1 -1
- package/dist/model-context/ModelContextTypes.mjs.map +1 -1
- package/dist/model-context/makeAssistantVisible.d.ts.map +1 -1
- package/dist/model-context/makeAssistantVisible.js +4 -2
- package/dist/model-context/makeAssistantVisible.js.map +1 -1
- package/dist/model-context/makeAssistantVisible.mjs +4 -2
- package/dist/model-context/makeAssistantVisible.mjs.map +1 -1
- package/dist/primitives/contentPart/index.d.ts +0 -1
- package/dist/primitives/contentPart/index.d.ts.map +1 -1
- package/dist/primitives/contentPart/index.js +0 -3
- package/dist/primitives/contentPart/index.js.map +1 -1
- package/dist/primitives/contentPart/index.mjs +0 -2
- package/dist/primitives/contentPart/index.mjs.map +1 -1
- package/dist/primitives/index.d.ts +0 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +0 -3
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/index.mjs +0 -2
- package/dist/primitives/index.mjs.map +1 -1
- package/dist/primitives/message/MessageContent.d.ts +1 -2
- package/dist/primitives/message/MessageContent.d.ts.map +1 -1
- package/dist/primitives/message/MessageContent.js +2 -7
- package/dist/primitives/message/MessageContent.js.map +1 -1
- package/dist/primitives/message/MessageContent.mjs +2 -7
- package/dist/primitives/message/MessageContent.mjs.map +1 -1
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js +1 -3
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js.map +1 -1
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs +1 -3
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.js +1 -6
- package/dist/runtimes/edge/converters/toCoreMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.mjs +1 -6
- package/dist/runtimes/edge/converters/toCoreMessages.mjs.map +1 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.mjs.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.d.ts +2 -2
- package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.js +0 -3
- package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.mjs +0 -3
- package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
- package/dist/types/AssistantTypes.d.ts +3 -7
- package/dist/types/AssistantTypes.d.ts.map +1 -1
- package/dist/types/AssistantTypes.js.map +1 -1
- package/dist/types/ContentPartComponentTypes.d.ts +1 -3
- package/dist/types/ContentPartComponentTypes.d.ts.map +1 -1
- package/dist/types/ContentPartComponentTypes.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -21
- package/src/cloud/auiV0.ts +1 -1
- package/src/index.ts +0 -1
- package/src/internal.ts +0 -1
- package/src/model-context/ModelContextTypes.ts +19 -0
- package/src/model-context/makeAssistantVisible.tsx +4 -2
- package/src/primitives/contentPart/index.ts +0 -1
- package/src/primitives/index.ts +0 -1
- package/src/primitives/message/MessageContent.tsx +0 -9
- package/src/runtimes/composer/DefaultEditComposerRuntimeCore.tsx +1 -3
- package/src/runtimes/edge/converters/toCoreMessages.ts +11 -14
- package/src/runtimes/edge/converters/toLanguageModelMessages.ts +2 -2
- package/src/runtimes/external-store/ThreadMessageLike.tsx +0 -6
- package/src/types/AssistantTypes.ts +4 -9
- package/src/types/ContentPartComponentTypes.tsx +0 -4
- package/src/types/index.ts +0 -2
- package/dist/primitives/contentPart/ContentPartDisplay.d.ts +0 -9
- package/dist/primitives/contentPart/ContentPartDisplay.d.ts.map +0 -1
- package/dist/primitives/contentPart/ContentPartDisplay.js +0 -37
- package/dist/primitives/contentPart/ContentPartDisplay.js.map +0 -1
- package/dist/primitives/contentPart/ContentPartDisplay.mjs +0 -13
- package/dist/primitives/contentPart/ContentPartDisplay.mjs.map +0 -1
- package/dist/primitives/contentPart/useContentPartDisplay.d.ts +0 -8
- package/dist/primitives/contentPart/useContentPartDisplay.d.ts.map +0 -1
- package/dist/primitives/contentPart/useContentPartDisplay.js +0 -42
- package/dist/primitives/contentPart/useContentPartDisplay.js.map +0 -1
- package/dist/primitives/contentPart/useContentPartDisplay.mjs +0 -18
- package/dist/primitives/contentPart/useContentPartDisplay.mjs.map +0 -1
- package/dist/styles/index.css +0 -1261
- package/dist/styles/index.css.map +0 -1
- package/dist/styles/modal.css +0 -143
- package/dist/styles/modal.css.map +0 -1
- package/dist/styles/tailwindcss/base-components.css +0 -69
- package/dist/styles/tailwindcss/base-components.css.json +0 -48
- package/dist/styles/tailwindcss/modal.css +0 -29
- package/dist/styles/tailwindcss/modal.css.json +0 -26
- package/dist/styles/tailwindcss/thread.css +0 -262
- package/dist/styles/tailwindcss/thread.css.json +0 -183
- package/dist/styles/themes/default.css +0 -64
- package/dist/styles/themes/default.css.json +0 -46
- package/dist/styles/themes/shadcn-extras.css +0 -4
- package/dist/styles/themes/shadcn-extras.css.json +0 -5
- package/dist/tailwindcss/index.d.ts +0 -49
- package/dist/tailwindcss/index.d.ts.map +0 -1
- package/dist/tailwindcss/index.js +0 -189
- package/dist/tailwindcss/index.js.map +0 -1
- package/dist/tailwindcss/index.mjs +0 -181
- package/dist/tailwindcss/index.mjs.map +0 -1
- package/dist/ui/assistant-action-bar.d.ts +0 -24
- package/dist/ui/assistant-action-bar.d.ts.map +0 -1
- package/dist/ui/assistant-action-bar.js +0 -193
- package/dist/ui/assistant-action-bar.js.map +0 -1
- package/dist/ui/assistant-action-bar.mjs +0 -181
- package/dist/ui/assistant-action-bar.mjs.map +0 -1
- package/dist/ui/assistant-message.d.ts +0 -13
- package/dist/ui/assistant-message.d.ts.map +0 -1
- package/dist/ui/assistant-message.js +0 -107
- package/dist/ui/assistant-message.js.map +0 -1
- package/dist/ui/assistant-message.mjs +0 -77
- package/dist/ui/assistant-message.mjs.map +0 -1
- package/dist/ui/assistant-modal.d.ts +0 -23
- package/dist/ui/assistant-modal.d.ts.map +0 -1
- package/dist/ui/assistant-modal.js +0 -126
- package/dist/ui/assistant-modal.js.map +0 -1
- package/dist/ui/assistant-modal.mjs +0 -99
- package/dist/ui/assistant-modal.mjs.map +0 -1
- package/dist/ui/attachment-ui.d.ts +0 -12
- package/dist/ui/attachment-ui.d.ts.map +0 -1
- package/dist/ui/attachment-ui.js +0 -170
- package/dist/ui/attachment-ui.js.map +0 -1
- package/dist/ui/attachment-ui.mjs +0 -160
- package/dist/ui/attachment-ui.mjs.map +0 -1
- package/dist/ui/base/CircleStopIcon.d.ts +0 -3
- package/dist/ui/base/CircleStopIcon.d.ts.map +0 -1
- package/dist/ui/base/CircleStopIcon.js +0 -45
- package/dist/ui/base/CircleStopIcon.js.map +0 -1
- package/dist/ui/base/CircleStopIcon.mjs +0 -20
- package/dist/ui/base/CircleStopIcon.mjs.map +0 -1
- package/dist/ui/base/avatar.d.ts +0 -12
- package/dist/ui/base/avatar.d.ts.map +0 -1
- package/dist/ui/base/avatar.js +0 -69
- package/dist/ui/base/avatar.js.map +0 -1
- package/dist/ui/base/avatar.mjs +0 -31
- package/dist/ui/base/avatar.mjs.map +0 -1
- package/dist/ui/base/button.d.ts +0 -16
- package/dist/ui/base/button.d.ts.map +0 -1
- package/dist/ui/base/button.js +0 -66
- package/dist/ui/base/button.js.map +0 -1
- package/dist/ui/base/button.mjs +0 -40
- package/dist/ui/base/button.mjs.map +0 -1
- package/dist/ui/base/dialog.d.ts +0 -9
- package/dist/ui/base/dialog.d.ts.map +0 -1
- package/dist/ui/base/dialog.js +0 -80
- package/dist/ui/base/dialog.js.map +0 -1
- package/dist/ui/base/dialog.mjs +0 -40
- package/dist/ui/base/dialog.mjs.map +0 -1
- package/dist/ui/base/index.d.ts +0 -6
- package/dist/ui/base/index.d.ts.map +0 -1
- package/dist/ui/base/index.js +0 -55
- package/dist/ui/base/index.js.map +0 -1
- package/dist/ui/base/index.mjs +0 -25
- package/dist/ui/base/index.mjs.map +0 -1
- package/dist/ui/base/tooltip-icon-button.d.ts +0 -17
- package/dist/ui/base/tooltip-icon-button.d.ts.map +0 -1
- package/dist/ui/base/tooltip-icon-button.js +0 -44
- package/dist/ui/base/tooltip-icon-button.js.map +0 -1
- package/dist/ui/base/tooltip-icon-button.mjs +0 -19
- package/dist/ui/base/tooltip-icon-button.mjs.map +0 -1
- package/dist/ui/base/tooltip.d.ts +0 -6
- package/dist/ui/base/tooltip.d.ts.map +0 -1
- package/dist/ui/base/tooltip.js +0 -57
- package/dist/ui/base/tooltip.js.map +0 -1
- package/dist/ui/base/tooltip.mjs +0 -20
- package/dist/ui/base/tooltip.mjs.map +0 -1
- package/dist/ui/branch-picker.d.ts +0 -15
- package/dist/ui/branch-picker.d.ts.map +0 -1
- package/dist/ui/branch-picker.js +0 -89
- package/dist/ui/branch-picker.js.map +0 -1
- package/dist/ui/branch-picker.mjs +0 -69
- package/dist/ui/branch-picker.mjs.map +0 -1
- package/dist/ui/composer.d.ts +0 -25
- package/dist/ui/composer.d.ts.map +0 -1
- package/dist/ui/composer.js +0 -168
- package/dist/ui/composer.js.map +0 -1
- package/dist/ui/composer.mjs +0 -138
- package/dist/ui/composer.mjs.map +0 -1
- package/dist/ui/content-part.d.ts +0 -7
- package/dist/ui/content-part.d.ts.map +0 -1
- package/dist/ui/content-part.js +0 -61
- package/dist/ui/content-part.js.map +0 -1
- package/dist/ui/content-part.mjs +0 -27
- package/dist/ui/content-part.mjs.map +0 -1
- package/dist/ui/edit-composer.d.ts +0 -22
- package/dist/ui/edit-composer.d.ts.map +0 -1
- package/dist/ui/edit-composer.js +0 -77
- package/dist/ui/edit-composer.js.map +0 -1
- package/dist/ui/edit-composer.mjs +0 -57
- package/dist/ui/edit-composer.mjs.map +0 -1
- package/dist/ui/index.d.ts +0 -75
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -86
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/index.mjs +0 -38
- package/dist/ui/index.mjs.map +0 -1
- package/dist/ui/thread-config.d.ts +0 -162
- package/dist/ui/thread-config.d.ts.map +0 -1
- package/dist/ui/thread-config.js +0 -63
- package/dist/ui/thread-config.js.map +0 -1
- package/dist/ui/thread-config.mjs +0 -41
- package/dist/ui/thread-config.mjs.map +0 -1
- package/dist/ui/thread-list-item.d.ts +0 -13
- package/dist/ui/thread-list-item.d.ts.map +0 -1
- package/dist/ui/thread-list-item.js +0 -94
- package/dist/ui/thread-list-item.js.map +0 -1
- package/dist/ui/thread-list-item.mjs +0 -64
- package/dist/ui/thread-list-item.mjs.map +0 -1
- package/dist/ui/thread-list.d.ts +0 -27
- package/dist/ui/thread-list.d.ts.map +0 -1
- package/dist/ui/thread-list.js +0 -91
- package/dist/ui/thread-list.js.map +0 -1
- package/dist/ui/thread-list.mjs +0 -61
- package/dist/ui/thread-list.mjs.map +0 -1
- package/dist/ui/thread-welcome.d.ts +0 -21
- package/dist/ui/thread-welcome.d.ts.map +0 -1
- package/dist/ui/thread-welcome.js +0 -101
- package/dist/ui/thread-welcome.js.map +0 -1
- package/dist/ui/thread-welcome.mjs +0 -81
- package/dist/ui/thread-welcome.mjs.map +0 -1
- package/dist/ui/thread.d.ts +0 -30
- package/dist/ui/thread.d.ts.map +0 -1
- package/dist/ui/thread.js +0 -152
- package/dist/ui/thread.js.map +0 -1
- package/dist/ui/thread.mjs +0 -125
- package/dist/ui/thread.mjs.map +0 -1
- package/dist/ui/user-action-bar.d.ts +0 -16
- package/dist/ui/user-action-bar.d.ts.map +0 -1
- package/dist/ui/user-action-bar.js +0 -63
- package/dist/ui/user-action-bar.js.map +0 -1
- package/dist/ui/user-action-bar.mjs +0 -43
- package/dist/ui/user-action-bar.mjs.map +0 -1
- package/dist/ui/user-message.d.ts +0 -13
- package/dist/ui/user-message.d.ts.map +0 -1
- package/dist/ui/user-message.js +0 -96
- package/dist/ui/user-message.js.map +0 -1
- package/dist/ui/user-message.mjs +0 -65
- package/dist/ui/user-message.mjs.map +0 -1
- package/dist/ui/utils/withDefaults.d.ts +0 -7
- package/dist/ui/utils/withDefaults.d.ts.map +0 -1
- package/dist/ui/utils/withDefaults.js +0 -66
- package/dist/ui/utils/withDefaults.js.map +0 -1
- package/dist/ui/utils/withDefaults.mjs +0 -30
- package/dist/ui/utils/withDefaults.mjs.map +0 -1
- package/src/primitives/contentPart/ContentPartDisplay.tsx +0 -20
- package/src/primitives/contentPart/useContentPartDisplay.tsx +0 -21
- package/src/styles/base.css +0 -37
- package/src/styles/index.css +0 -4
- package/src/styles/modal.css +0 -1
- package/src/styles/tailwindcss/base-components.css +0 -69
- package/src/styles/tailwindcss/modal.css +0 -29
- package/src/styles/tailwindcss/thread.css +0 -262
- package/src/styles/themes/default.css +0 -64
- package/src/styles/themes/shadcn-extras.css +0 -4
- package/src/tailwindcss/index.ts +0 -149
- package/src/ui/assistant-action-bar.tsx +0 -301
- package/src/ui/assistant-message.tsx +0 -96
- package/src/ui/assistant-modal.tsx +0 -146
- package/src/ui/attachment-ui.tsx +0 -211
- package/src/ui/base/CircleStopIcon.tsx +0 -17
- package/src/ui/base/avatar.tsx +0 -41
- package/src/ui/base/button.tsx +0 -42
- package/src/ui/base/dialog.tsx +0 -113
- package/src/ui/base/index.ts +0 -15
- package/src/ui/base/tooltip-icon-button.tsx +0 -29
- package/src/ui/base/tooltip.tsx +0 -22
- package/src/ui/branch-picker.tsx +0 -117
- package/src/ui/composer.tsx +0 -210
- package/src/ui/content-part.tsx +0 -23
- package/src/ui/edit-composer.tsx +0 -98
- package/src/ui/index.ts +0 -98
- package/src/ui/thread-config.tsx +0 -246
- package/src/ui/thread-list-item.tsx +0 -91
- package/src/ui/thread-list.tsx +0 -78
- package/src/ui/thread-welcome.tsx +0 -140
- package/src/ui/thread.tsx +0 -176
- package/src/ui/user-action-bar.tsx +0 -66
- package/src/ui/user-message.tsx +0 -92
- package/src/ui/utils/withDefaults.tsx +0 -35
- package/tailwindcss/README.md +0 -1
- package/tailwindcss/package-lock.json +0 -6
- package/tailwindcss/package.json +0 -5
package/dist/ui/base/tooltip.js
DELETED
@@ -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":[]}
|
package/dist/ui/base/tooltip.mjs
DELETED
@@ -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"}
|
package/dist/ui/branch-picker.js
DELETED
@@ -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;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8D;AAC9D,0BAAkD;AAElD,iCAAkC;AAClC,0BAA6B;AAC7B,2BAAgC;AAChC,wBAAsC;AACtC,qBAA0B;AAYtB;AAVJ,IAAM,uBAAuB,CAAC,mBAAmB,UAAU;AACzD,QAAM,EAAE,cAAc,EAAE,oBAAoB,KAAK,IAAI,CAAC,EAAE,QAAI,sCAAgB;AAC5E,QAAM,4BAAwB,0BAAU,CAAC,MAAM,EAAE,aAAa,IAAI;AAClE,SAAO,sBAAsB,CAAC,oBAAoB;AACpD;AAEA,IAAM,eAAmB,MAAM;AAC7B,QAAM,oBAAoB,qBAAqB,IAAI;AACnD,MAAI,CAAC,kBAAmB,QAAO;AAC/B,SACE,6CAAC,oBAAiB,sBAAoB,MACpC;AAAA,gDAAC,wBAAqB;AAAA,IACtB,4CAAC,qBAAkB;AAAA,IACnB,4CAAC,oBAAiB;AAAA,KACpB;AAEJ;AAEA,aAAa,cAAc;AAE3B,IAAM,uBAAmB,kCAAa,wCAAsB,MAAM;AAAA,EAChE,WAAW;AACb,CAAC;AAED,iBAAiB,cAAc;AAO/B,IAAM,2BAAuB,yBAG3B,CAAC,OAAO,Q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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;AAC9D,SAAS,iBAAiB,wBAAwB;AAElD,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,iBAAiB;AAYtB,SACE,KADF;AAVJ,IAAM,uBAAuB,CAAC,mBAAmB,UAAU;AACzD,QAAM,EAAE,cAAc,EAAE,oBAAoB,KAAK,IAAI,CAAC,EAAE,IAAI,gBAAgB;AAC5E,QAAM,wBAAwB,UAAU,CAAC,MAAM,EAAE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I,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":[]}
|
package/dist/ui/composer.d.ts
DELETED
@@ -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"}
|
package/dist/ui/composer.js
DELETED
@@ -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
|
package/dist/ui/composer.js.map
DELETED
@@ -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,WAAS,MAAC;AAAA,IACzB,4CAAC,kBAAe;AAAA,KAClB;AAEJ;AAEA,SAAS,cAAc;AAEvB,IAAM,mBAAe,kCAAa,oCAAkB,MAAM;AAAA,EACxD,WAAW;AACb,CAAC;AAED,aAAa,cAAc;AAE3B,IAAM,0BAAsB,kCAAa,oCAAkB,OAAO;AAAA,EAChE,MAAM;AAAA,EACN,WAAW;AAAA,EACX,WAAW;AACb,CAAC;AAOD,IAAM,oBAAgB;A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