@copilotz/chat-ui 0.9.12 → 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 +25 -8
- 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 +25 -8
- 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",
|
|
@@ -122,7 +124,7 @@ var defaultChatConfig = {
|
|
|
122
124
|
showActivity: true,
|
|
123
125
|
showActivityDetails: true,
|
|
124
126
|
threadTags: {
|
|
125
|
-
enabled:
|
|
127
|
+
enabled: true,
|
|
126
128
|
groupingEnabled: true,
|
|
127
129
|
defaultGroupBy: "date",
|
|
128
130
|
allowCreate: true,
|
|
@@ -176,7 +178,11 @@ function mergeConfig(_baseConfig, userConfig) {
|
|
|
176
178
|
},
|
|
177
179
|
features: {
|
|
178
180
|
...defaultChatConfig.features,
|
|
179
|
-
...userConfig.features
|
|
181
|
+
...userConfig.features,
|
|
182
|
+
threadTags: {
|
|
183
|
+
...defaultChatConfig.features.threadTags,
|
|
184
|
+
...userConfig.features?.threadTags
|
|
185
|
+
}
|
|
180
186
|
},
|
|
181
187
|
ui: {
|
|
182
188
|
...defaultChatConfig.ui,
|
|
@@ -4329,6 +4335,12 @@ function getActiveMentionMatch(value, caret) {
|
|
|
4329
4335
|
query
|
|
4330
4336
|
};
|
|
4331
4337
|
}
|
|
4338
|
+
function formatLabel(template, fallback, values) {
|
|
4339
|
+
return (template || fallback).replace(
|
|
4340
|
+
/\{\{(\w+)\}\}/g,
|
|
4341
|
+
(_, key) => String(values[key] ?? "")
|
|
4342
|
+
);
|
|
4343
|
+
}
|
|
4332
4344
|
function resolveTargetFromMentions(value, agents) {
|
|
4333
4345
|
const matches = value.matchAll(/(^|\s)@([\w.-]+)/g);
|
|
4334
4346
|
for (const match of matches) {
|
|
@@ -4721,7 +4733,11 @@ var ChatInput = memo4(function ChatInput2({
|
|
|
4721
4733
|
};
|
|
4722
4734
|
const processFile = async (file) => {
|
|
4723
4735
|
if (file.size > maxFileSize) {
|
|
4724
|
-
alert(
|
|
4736
|
+
alert(formatLabel(
|
|
4737
|
+
config?.labels?.fileTooLarge,
|
|
4738
|
+
"File too large. Max allowed: {{maxSize}}MB",
|
|
4739
|
+
{ maxSize: Math.round(maxFileSize / 1024 / 1024) }
|
|
4740
|
+
));
|
|
4725
4741
|
return null;
|
|
4726
4742
|
}
|
|
4727
4743
|
const fileId = `${Date.now()}_${Math.random().toString(36).slice(2)}`;
|
|
@@ -5252,7 +5268,7 @@ var ChatInput = memo4(function ChatInput2({
|
|
|
5252
5268
|
agents: mentionAgents,
|
|
5253
5269
|
targetAgentId,
|
|
5254
5270
|
onTargetChange: onTargetAgentChange,
|
|
5255
|
-
placeholder: targetAgentSelectorPlaceholder || "Select agent",
|
|
5271
|
+
placeholder: targetAgentSelectorPlaceholder || config?.agentSelector?.label || "Select agent",
|
|
5256
5272
|
disabled: disabled || isGenerating,
|
|
5257
5273
|
compact: true
|
|
5258
5274
|
}
|
|
@@ -5311,10 +5327,11 @@ var ChatInput = memo4(function ChatInput2({
|
|
|
5311
5327
|
window.innerWidth > 768 ? config?.labels?.inputHelpText : "",
|
|
5312
5328
|
attachments.length > 0 && /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
5313
5329
|
" \u2022 ",
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5330
|
+
formatLabel(
|
|
5331
|
+
config?.labels?.attachmentsCount,
|
|
5332
|
+
"{{count}}/{{max}} attachments",
|
|
5333
|
+
{ count: attachments.length, max: maxAttachments }
|
|
5334
|
+
)
|
|
5318
5335
|
] }),
|
|
5319
5336
|
config?.labels?.footerLabel && /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
5320
5337
|
" \u2022 ",
|