@copilotz/chat-ui 0.9.13 → 0.9.14
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 +19 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -73,6 +73,8 @@ var defaultChatConfig = {
|
|
|
73
73
|
stopGenerationTooltip: "Stop generation",
|
|
74
74
|
attachFiles: "Attach Files",
|
|
75
75
|
attachFileTooltip: "Attach file",
|
|
76
|
+
fileTooLarge: "File too large. Max allowed: {{maxSize}}MB",
|
|
77
|
+
attachmentsCount: "{{count}}/{{max}} attachments",
|
|
76
78
|
voiceEnter: "Voice input",
|
|
77
79
|
voiceExit: "Use keyboard",
|
|
78
80
|
voiceTitle: "Voice",
|
|
@@ -4315,6 +4317,12 @@ function getActiveMentionMatch(value, caret) {
|
|
|
4315
4317
|
query
|
|
4316
4318
|
};
|
|
4317
4319
|
}
|
|
4320
|
+
function formatLabel(template, fallback, values) {
|
|
4321
|
+
return (template || fallback).replace(
|
|
4322
|
+
/\{\{(\w+)\}\}/g,
|
|
4323
|
+
(_, key) => String(values[key] ?? "")
|
|
4324
|
+
);
|
|
4325
|
+
}
|
|
4318
4326
|
function resolveTargetFromMentions(value, agents) {
|
|
4319
4327
|
const matches = value.matchAll(/(^|\s)@([\w.-]+)/g);
|
|
4320
4328
|
for (const match of matches) {
|
|
@@ -4707,7 +4715,11 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
4707
4715
|
};
|
|
4708
4716
|
const processFile = async (file) => {
|
|
4709
4717
|
if (file.size > maxFileSize) {
|
|
4710
|
-
alert(
|
|
4718
|
+
alert(formatLabel(
|
|
4719
|
+
config?.labels?.fileTooLarge,
|
|
4720
|
+
"File too large. Max allowed: {{maxSize}}MB",
|
|
4721
|
+
{ maxSize: Math.round(maxFileSize / 1024 / 1024) }
|
|
4722
|
+
));
|
|
4711
4723
|
return null;
|
|
4712
4724
|
}
|
|
4713
4725
|
const fileId = `${Date.now()}_${Math.random().toString(36).slice(2)}`;
|
|
@@ -5238,7 +5250,7 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
5238
5250
|
agents: mentionAgents,
|
|
5239
5251
|
targetAgentId,
|
|
5240
5252
|
onTargetChange: onTargetAgentChange,
|
|
5241
|
-
placeholder: targetAgentSelectorPlaceholder || "Select agent",
|
|
5253
|
+
placeholder: targetAgentSelectorPlaceholder || config?.agentSelector?.label || "Select agent",
|
|
5242
5254
|
disabled: disabled || isGenerating,
|
|
5243
5255
|
compact: true
|
|
5244
5256
|
}
|
|
@@ -5297,10 +5309,11 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
|
|
|
5297
5309
|
window.innerWidth > 768 ? config?.labels?.inputHelpText : "",
|
|
5298
5310
|
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
5299
5311
|
" \u2022 ",
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5312
|
+
formatLabel(
|
|
5313
|
+
config?.labels?.attachmentsCount,
|
|
5314
|
+
"{{count}}/{{max}} attachments",
|
|
5315
|
+
{ count: attachments.length, max: maxAttachments }
|
|
5316
|
+
)
|
|
5304
5317
|
] }),
|
|
5305
5318
|
config?.labels?.footerLabel && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
5306
5319
|
" \u2022 ",
|