@copilotz/chat-ui 0.9.7 → 0.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +85 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +85 -77
- package/dist/index.js.map +1 -1
- package/dist/styles.css +26 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3369,7 +3369,8 @@ var TargetAgentSelector = memo3(({
|
|
|
3369
3369
|
onTargetChange,
|
|
3370
3370
|
label = "Target",
|
|
3371
3371
|
placeholder = "Select agent",
|
|
3372
|
-
disabled = false
|
|
3372
|
+
disabled = false,
|
|
3373
|
+
compact = false
|
|
3373
3374
|
}) => {
|
|
3374
3375
|
const agentsWithColors = useMemo4(() => assignAgentColors(agents), [agents]);
|
|
3375
3376
|
const selectedAgent = useMemo4(
|
|
@@ -3381,7 +3382,7 @@ var TargetAgentSelector = memo3(({
|
|
|
3381
3382
|
Button,
|
|
3382
3383
|
{
|
|
3383
3384
|
variant: "ghost",
|
|
3384
|
-
className:
|
|
3385
|
+
className: `gap-1.5 font-medium hover:bg-accent/50 ${compact ? "h-9 rounded-full px-2 text-sm text-muted-foreground hover:text-foreground" : "h-9 px-3 text-base"}`,
|
|
3385
3386
|
disabled,
|
|
3386
3387
|
children: [
|
|
3387
3388
|
/* @__PURE__ */ jsx20(AtSign, { className: "h-4 w-4 text-muted-foreground" }),
|
|
@@ -4556,6 +4557,9 @@ var ChatInput = memo4(function ChatInput2({
|
|
|
4556
4557
|
className = "",
|
|
4557
4558
|
config,
|
|
4558
4559
|
mentionAgents = [],
|
|
4560
|
+
targetAgentId = null,
|
|
4561
|
+
showTargetAgentSelector = false,
|
|
4562
|
+
targetAgentSelectorPlaceholder,
|
|
4559
4563
|
onTargetAgentChange
|
|
4560
4564
|
}) {
|
|
4561
4565
|
const voiceDefaultMode = config?.voiceCompose?.defaultMode ?? "text";
|
|
@@ -5086,7 +5090,7 @@ var ChatInput = memo4(function ChatInput2({
|
|
|
5086
5090
|
};
|
|
5087
5091
|
const canAddMoreAttachments = attachments.length < maxAttachments;
|
|
5088
5092
|
const showVoiceComposer = enableAudioRecording && isVoiceComposerOpen;
|
|
5089
|
-
return /* @__PURE__ */ jsx25(TooltipProvider, { children: /* @__PURE__ */ jsx25("div", { className: `
|
|
5093
|
+
return /* @__PURE__ */ jsx25(TooltipProvider, { children: /* @__PURE__ */ jsx25("div", { className: `bg-transparent py-0 ${className}`, children: /* @__PURE__ */ jsxs15("div", { className: "mx-auto w-full max-w-3xl space-y-3 px-3 md:px-2", children: [
|
|
5090
5094
|
uploadProgress.size > 0 && /* @__PURE__ */ jsx25("div", { className: "space-y-2", children: Array.from(uploadProgress.entries()).map(([id, progress]) => /* @__PURE__ */ jsx25(
|
|
5091
5095
|
FileUploadItem,
|
|
5092
5096
|
{
|
|
@@ -5201,38 +5205,51 @@ var ChatInput = memo4(function ChatInput2({
|
|
|
5201
5205
|
)) }) })
|
|
5202
5206
|
] }),
|
|
5203
5207
|
/* @__PURE__ */ jsxs15("div", { className: "flex min-h-10 items-center justify-between gap-2", children: [
|
|
5204
|
-
/* @__PURE__ */
|
|
5205
|
-
/* @__PURE__ */
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
ref: fileInputRef,
|
|
5209
|
-
type: "file",
|
|
5210
|
-
multiple: true,
|
|
5211
|
-
accept: acceptedFileTypes.length > 0 ? acceptedFileTypes.join(",") : void 0,
|
|
5212
|
-
onChange: handleFileSelect,
|
|
5213
|
-
className: "hidden"
|
|
5214
|
-
}
|
|
5215
|
-
),
|
|
5216
|
-
/* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
5217
|
-
/* @__PURE__ */ jsx25(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(
|
|
5218
|
-
Button,
|
|
5208
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
5209
|
+
enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
5210
|
+
/* @__PURE__ */ jsx25(
|
|
5211
|
+
"input",
|
|
5219
5212
|
{
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
e.stopPropagation();
|
|
5227
|
-
fileInputRef.current?.click();
|
|
5228
|
-
},
|
|
5229
|
-
disabled,
|
|
5230
|
-
children: /* @__PURE__ */ jsx25(Paperclip, { className: "h-4 w-4" })
|
|
5213
|
+
ref: fileInputRef,
|
|
5214
|
+
type: "file",
|
|
5215
|
+
multiple: true,
|
|
5216
|
+
accept: acceptedFileTypes.length > 0 ? acceptedFileTypes.join(",") : void 0,
|
|
5217
|
+
onChange: handleFileSelect,
|
|
5218
|
+
className: "hidden"
|
|
5231
5219
|
}
|
|
5232
|
-
)
|
|
5233
|
-
/* @__PURE__ */
|
|
5234
|
-
|
|
5235
|
-
|
|
5220
|
+
),
|
|
5221
|
+
/* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
5222
|
+
/* @__PURE__ */ jsx25(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(
|
|
5223
|
+
Button,
|
|
5224
|
+
{
|
|
5225
|
+
type: "button",
|
|
5226
|
+
variant: "ghost",
|
|
5227
|
+
size: "icon",
|
|
5228
|
+
className: "h-9 w-9 rounded-full text-muted-foreground hover:text-foreground",
|
|
5229
|
+
onClick: (e) => {
|
|
5230
|
+
e.preventDefault();
|
|
5231
|
+
e.stopPropagation();
|
|
5232
|
+
fileInputRef.current?.click();
|
|
5233
|
+
},
|
|
5234
|
+
disabled,
|
|
5235
|
+
children: /* @__PURE__ */ jsx25(Paperclip, { className: "h-4 w-4" })
|
|
5236
|
+
}
|
|
5237
|
+
) }),
|
|
5238
|
+
/* @__PURE__ */ jsx25(TooltipContent, { children: config?.labels?.attachFileTooltip })
|
|
5239
|
+
] })
|
|
5240
|
+
] }),
|
|
5241
|
+
showTargetAgentSelector && onTargetAgentChange && mentionAgents.length > 0 && /* @__PURE__ */ jsx25(
|
|
5242
|
+
TargetAgentSelector,
|
|
5243
|
+
{
|
|
5244
|
+
agents: mentionAgents,
|
|
5245
|
+
targetAgentId,
|
|
5246
|
+
onTargetChange: onTargetAgentChange,
|
|
5247
|
+
placeholder: targetAgentSelectorPlaceholder || "Select agent",
|
|
5248
|
+
disabled: disabled || isGenerating,
|
|
5249
|
+
compact: true
|
|
5250
|
+
}
|
|
5251
|
+
)
|
|
5252
|
+
] }),
|
|
5236
5253
|
/* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
5237
5254
|
enableAudioRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ jsxs15(Tooltip, { children: [
|
|
5238
5255
|
/* @__PURE__ */ jsx25(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(
|
|
@@ -6527,50 +6544,41 @@ var ChatUI = ({
|
|
|
6527
6544
|
] })
|
|
6528
6545
|
}
|
|
6529
6546
|
),
|
|
6530
|
-
/* @__PURE__ */
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
)
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
acceptedFileTypes: config.features.acceptedFileTypes,
|
|
6566
|
-
config,
|
|
6567
|
-
mentionAgents: participantIds && participantIds.length > 0 ? agentOptions.filter(
|
|
6568
|
-
(a) => participantIds.includes(a.id)
|
|
6569
|
-
) : agentOptions,
|
|
6570
|
-
onTargetAgentChange
|
|
6571
|
-
}
|
|
6572
|
-
)
|
|
6573
|
-
] })
|
|
6547
|
+
/* @__PURE__ */ jsx28("div", { className: "-mt-8 bg-gradient-to-t from-background via-background/95 to-transparent px-0 pb-[env(safe-area-inset-bottom)] pt-10", children: /* @__PURE__ */ jsx28(
|
|
6548
|
+
ChatInput,
|
|
6549
|
+
{
|
|
6550
|
+
value: inputValue,
|
|
6551
|
+
onChange: (value) => {
|
|
6552
|
+
setInputValue(value);
|
|
6553
|
+
if (initialInputApplied.current && !initialInputConsumedRef.current) {
|
|
6554
|
+
initialInputConsumedRef.current = true;
|
|
6555
|
+
onInitialInputConsumed?.();
|
|
6556
|
+
}
|
|
6557
|
+
},
|
|
6558
|
+
onSubmit: handleSendMessage,
|
|
6559
|
+
attachments,
|
|
6560
|
+
onAttachmentsChange: setAttachments,
|
|
6561
|
+
placeholder: config.labels.inputPlaceholder,
|
|
6562
|
+
disabled: false,
|
|
6563
|
+
isGenerating,
|
|
6564
|
+
onStopGeneration: callbacks.onStopGeneration,
|
|
6565
|
+
enableFileUpload: config.features.enableFileUpload,
|
|
6566
|
+
enableAudioRecording: config.features.enableAudioRecording,
|
|
6567
|
+
maxAttachments: config.features.maxAttachments,
|
|
6568
|
+
maxFileSize: config.features.maxFileSize,
|
|
6569
|
+
acceptedFileTypes: config.features.acceptedFileTypes,
|
|
6570
|
+
config,
|
|
6571
|
+
mentionAgents: participantIds && participantIds.length > 0 ? agentOptions.filter(
|
|
6572
|
+
(a) => participantIds.includes(a.id)
|
|
6573
|
+
) : agentOptions,
|
|
6574
|
+
targetAgentId,
|
|
6575
|
+
showTargetAgentSelector: Boolean(
|
|
6576
|
+
isMultiAgentMode && shouldShowAgentSelector && onTargetAgentChange
|
|
6577
|
+
),
|
|
6578
|
+
targetAgentSelectorPlaceholder: config.agentSelector?.label || "Select agent",
|
|
6579
|
+
onTargetAgentChange
|
|
6580
|
+
}
|
|
6581
|
+
) })
|
|
6574
6582
|
] }),
|
|
6575
6583
|
config?.customComponent?.component && !isMobile && /* @__PURE__ */ jsx28(
|
|
6576
6584
|
"div",
|