@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 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",
@@ -161,7 +163,7 @@ var defaultChatConfig = {
161
163
  showActivity: true,
162
164
  showActivityDetails: true,
163
165
  threadTags: {
164
- enabled: false,
166
+ enabled: true,
165
167
  groupingEnabled: true,
166
168
  defaultGroupBy: "date",
167
169
  allowCreate: true,
@@ -215,7 +217,11 @@ function mergeConfig(_baseConfig, userConfig) {
215
217
  },
216
218
  features: {
217
219
  ...defaultChatConfig.features,
218
- ...userConfig.features
220
+ ...userConfig.features,
221
+ threadTags: {
222
+ ...defaultChatConfig.features.threadTags,
223
+ ...userConfig.features?.threadTags
224
+ }
219
225
  },
220
226
  ui: {
221
227
  ...defaultChatConfig.ui,
@@ -4311,6 +4317,12 @@ function getActiveMentionMatch(value, caret) {
4311
4317
  query
4312
4318
  };
4313
4319
  }
4320
+ function formatLabel(template, fallback, values) {
4321
+ return (template || fallback).replace(
4322
+ /\{\{(\w+)\}\}/g,
4323
+ (_, key) => String(values[key] ?? "")
4324
+ );
4325
+ }
4314
4326
  function resolveTargetFromMentions(value, agents) {
4315
4327
  const matches = value.matchAll(/(^|\s)@([\w.-]+)/g);
4316
4328
  for (const match of matches) {
@@ -4703,7 +4715,11 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
4703
4715
  };
4704
4716
  const processFile = async (file) => {
4705
4717
  if (file.size > maxFileSize) {
4706
- alert(`File too large. Max allowed: ${Math.round(maxFileSize / 1024 / 1024)}MB`);
4718
+ alert(formatLabel(
4719
+ config?.labels?.fileTooLarge,
4720
+ "File too large. Max allowed: {{maxSize}}MB",
4721
+ { maxSize: Math.round(maxFileSize / 1024 / 1024) }
4722
+ ));
4707
4723
  return null;
4708
4724
  }
4709
4725
  const fileId = `${Date.now()}_${Math.random().toString(36).slice(2)}`;
@@ -5234,7 +5250,7 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
5234
5250
  agents: mentionAgents,
5235
5251
  targetAgentId,
5236
5252
  onTargetChange: onTargetAgentChange,
5237
- placeholder: targetAgentSelectorPlaceholder || "Select agent",
5253
+ placeholder: targetAgentSelectorPlaceholder || config?.agentSelector?.label || "Select agent",
5238
5254
  disabled: disabled || isGenerating,
5239
5255
  compact: true
5240
5256
  }
@@ -5293,10 +5309,11 @@ var ChatInput = (0, import_react8.memo)(function ChatInput2({
5293
5309
  window.innerWidth > 768 ? config?.labels?.inputHelpText : "",
5294
5310
  attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
5295
5311
  " \u2022 ",
5296
- attachments.length,
5297
- "/",
5298
- maxAttachments,
5299
- " anexos"
5312
+ formatLabel(
5313
+ config?.labels?.attachmentsCount,
5314
+ "{{count}}/{{max}} attachments",
5315
+ { count: attachments.length, max: maxAttachments }
5316
+ )
5300
5317
  ] }),
5301
5318
  config?.labels?.footerLabel && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
5302
5319
  " \u2022 ",