@copilotz/chat-ui 0.9.22 → 0.9.23
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 +54 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +54 -39
- package/dist/index.js.map +1 -1
- package/dist/styles.css +12 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -64,6 +64,10 @@ var defaultChatConfig = {
|
|
|
64
64
|
inputPlaceholder: "Type your message...",
|
|
65
65
|
sendButton: "Send",
|
|
66
66
|
sendMessageTooltip: "Send message",
|
|
67
|
+
stageMessageTooltip: "Stage message",
|
|
68
|
+
sendNowTooltip: "Send now",
|
|
69
|
+
stagedMessageLabel: "Not sent yet",
|
|
70
|
+
discardStagedMessageTooltip: "Discard",
|
|
67
71
|
newThread: "New Conversation",
|
|
68
72
|
deleteThread: "Delete Conversation",
|
|
69
73
|
copyMessage: "Copy",
|
|
@@ -5266,7 +5270,8 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
5266
5270
|
config?.labels?.attachmentsCount,
|
|
5267
5271
|
"{{count}}/{{max}} attachments",
|
|
5268
5272
|
{ count: staged.attachments.length, max: maxAttachments }
|
|
5269
|
-
) })
|
|
5273
|
+
) }),
|
|
5274
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "text-xs text-muted-foreground", children: config?.labels?.stagedMessageLabel || "Not sent yet" })
|
|
5270
5275
|
] }),
|
|
5271
5276
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
5272
5277
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -5279,7 +5284,7 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
5279
5284
|
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Send, { className: "h-4 w-4" })
|
|
5280
5285
|
}
|
|
5281
5286
|
) }),
|
|
5282
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.sendMessageTooltip })
|
|
5287
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.sendNowTooltip || config?.labels?.sendMessageTooltip })
|
|
5283
5288
|
] }),
|
|
5284
5289
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
5285
5290
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -5293,7 +5298,7 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
5293
5298
|
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-4 w-4" })
|
|
5294
5299
|
}
|
|
5295
5300
|
) }),
|
|
5296
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.voiceCancel })
|
|
5301
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.discardStagedMessageTooltip || config?.labels?.voiceCancel })
|
|
5297
5302
|
] })
|
|
5298
5303
|
]
|
|
5299
5304
|
},
|
|
@@ -5418,7 +5423,7 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
5418
5423
|
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Send, { className: "h-4 w-4" })
|
|
5419
5424
|
}
|
|
5420
5425
|
) }),
|
|
5421
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.sendMessageTooltip })
|
|
5426
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { children: config?.labels?.stageMessageTooltip || config?.labels?.sendMessageTooltip })
|
|
5422
5427
|
] }),
|
|
5423
5428
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
|
|
5424
5429
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -6017,6 +6022,7 @@ var ChatUI = ({
|
|
|
6017
6022
|
isMessagesLoading = false,
|
|
6018
6023
|
isLoadingOlderMessages = false,
|
|
6019
6024
|
hasMoreMessagesBefore = false,
|
|
6025
|
+
activityNotice = null,
|
|
6020
6026
|
callbacks = {},
|
|
6021
6027
|
onLoadOlderMessages,
|
|
6022
6028
|
user,
|
|
@@ -6665,41 +6671,50 @@ var ChatUI = ({
|
|
|
6665
6671
|
] })
|
|
6666
6672
|
}
|
|
6667
6673
|
),
|
|
6668
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6674
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("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: [
|
|
6675
|
+
activityNotice && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mx-auto mb-2 w-full max-w-3xl px-3 md:px-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
6676
|
+
"div",
|
|
6677
|
+
{
|
|
6678
|
+
className: activityNotice.tone === "error" ? "rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive" : "rounded-md border border-border bg-muted/70 px-3 py-2 text-sm text-muted-foreground",
|
|
6679
|
+
children: activityNotice.message
|
|
6680
|
+
}
|
|
6681
|
+
) }),
|
|
6682
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
6683
|
+
ChatInput,
|
|
6684
|
+
{
|
|
6685
|
+
value: inputValue,
|
|
6686
|
+
onChange: (value) => {
|
|
6687
|
+
inputValueRef.current = value;
|
|
6688
|
+
if (initialInputApplied.current && !initialInputConsumedRef.current) {
|
|
6689
|
+
initialInputConsumedRef.current = true;
|
|
6690
|
+
onInitialInputConsumed?.();
|
|
6691
|
+
}
|
|
6692
|
+
},
|
|
6693
|
+
onSubmit: handleSendMessage,
|
|
6694
|
+
attachments,
|
|
6695
|
+
onAttachmentsChange: setAttachments,
|
|
6696
|
+
placeholder: config.labels.inputPlaceholder,
|
|
6697
|
+
disabled: false,
|
|
6698
|
+
isGenerating,
|
|
6699
|
+
onStopGeneration: callbacks.onStopGeneration,
|
|
6700
|
+
enableFileUpload: config.features.enableFileUpload,
|
|
6701
|
+
enableAudioRecording: config.features.enableAudioRecording,
|
|
6702
|
+
maxAttachments: config.features.maxAttachments,
|
|
6703
|
+
maxFileSize: config.features.maxFileSize,
|
|
6704
|
+
acceptedFileTypes: config.features.acceptedFileTypes,
|
|
6705
|
+
config,
|
|
6706
|
+
mentionAgents: participantIds && participantIds.length > 0 ? agentOptions.filter(
|
|
6707
|
+
(a) => participantIds.includes(a.id)
|
|
6708
|
+
) : agentOptions,
|
|
6709
|
+
targetAgentId,
|
|
6710
|
+
showTargetAgentSelector: Boolean(
|
|
6711
|
+
isMultiAgentMode && shouldShowAgentSelector && onTargetAgentChange
|
|
6712
|
+
),
|
|
6713
|
+
targetAgentSelectorPlaceholder: config.agentSelector?.label || "Select agent",
|
|
6714
|
+
onTargetAgentChange
|
|
6715
|
+
}
|
|
6716
|
+
)
|
|
6717
|
+
] })
|
|
6703
6718
|
] }),
|
|
6704
6719
|
config?.customComponent?.component && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
6705
6720
|
"div",
|