@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.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -34,6 +34,8 @@ var defaultChatConfig = {
|
|
|
34
34
|
stopGenerationTooltip: "Stop generation",
|
|
35
35
|
attachFiles: "Attach Files",
|
|
36
36
|
attachFileTooltip: "Attach file",
|
|
37
|
+
fileTooLarge: "File too large. Max allowed: {{maxSize}}MB",
|
|
38
|
+
attachmentsCount: "{{count}}/{{max}} attachments",
|
|
37
39
|
voiceEnter: "Voice input",
|
|
38
40
|
voiceExit: "Use keyboard",
|
|
39
41
|
voiceTitle: "Voice",
|
|
@@ -4333,6 +4335,12 @@ function getActiveMentionMatch(value, caret) {
|
|
|
4333
4335
|
query
|
|
4334
4336
|
};
|
|
4335
4337
|
}
|
|
4338
|
+
function formatLabel(template, fallback, values) {
|
|
4339
|
+
return (template || fallback).replace(
|
|
4340
|
+
/\{\{(\w+)\}\}/g,
|
|
4341
|
+
(_, key) => String(values[key] ?? "")
|
|
4342
|
+
);
|
|
4343
|
+
}
|
|
4336
4344
|
function resolveTargetFromMentions(value, agents) {
|
|
4337
4345
|
const matches = value.matchAll(/(^|\s)@([\w.-]+)/g);
|
|
4338
4346
|
for (const match of matches) {
|
|
@@ -4725,7 +4733,11 @@ var ChatInput = memo4(function ChatInput2({
|
|
|
4725
4733
|
};
|
|
4726
4734
|
const processFile = async (file) => {
|
|
4727
4735
|
if (file.size > maxFileSize) {
|
|
4728
|
-
alert(
|
|
4736
|
+
alert(formatLabel(
|
|
4737
|
+
config?.labels?.fileTooLarge,
|
|
4738
|
+
"File too large. Max allowed: {{maxSize}}MB",
|
|
4739
|
+
{ maxSize: Math.round(maxFileSize / 1024 / 1024) }
|
|
4740
|
+
));
|
|
4729
4741
|
return null;
|
|
4730
4742
|
}
|
|
4731
4743
|
const fileId = `${Date.now()}_${Math.random().toString(36).slice(2)}`;
|
|
@@ -5256,7 +5268,7 @@ var ChatInput = memo4(function ChatInput2({
|
|
|
5256
5268
|
agents: mentionAgents,
|
|
5257
5269
|
targetAgentId,
|
|
5258
5270
|
onTargetChange: onTargetAgentChange,
|
|
5259
|
-
placeholder: targetAgentSelectorPlaceholder || "Select agent",
|
|
5271
|
+
placeholder: targetAgentSelectorPlaceholder || config?.agentSelector?.label || "Select agent",
|
|
5260
5272
|
disabled: disabled || isGenerating,
|
|
5261
5273
|
compact: true
|
|
5262
5274
|
}
|
|
@@ -5315,10 +5327,11 @@ var ChatInput = memo4(function ChatInput2({
|
|
|
5315
5327
|
window.innerWidth > 768 ? config?.labels?.inputHelpText : "",
|
|
5316
5328
|
attachments.length > 0 && /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
5317
5329
|
" \u2022 ",
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5330
|
+
formatLabel(
|
|
5331
|
+
config?.labels?.attachmentsCount,
|
|
5332
|
+
"{{count}}/{{max}} attachments",
|
|
5333
|
+
{ count: attachments.length, max: maxAttachments }
|
|
5334
|
+
)
|
|
5322
5335
|
] }),
|
|
5323
5336
|
config?.labels?.footerLabel && /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
5324
5337
|
" \u2022 ",
|