@weni/unnnic-system 3.12.3 → 3.12.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weni/unnnic-system",
3
- "version": "3.12.3",
3
+ "version": "3.12.4",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -42,7 +42,7 @@
42
42
  :title="title"
43
43
  :class="{ bold: unreadMessages }"
44
44
  >
45
- {{ title }}
45
+ {{ contactName }}
46
46
  </h1>
47
47
 
48
48
  <p
@@ -241,6 +241,16 @@ export default {
241
241
  isHovered: false,
242
242
 
243
243
  defaultTranslations: {
244
+ unnamed_contact: {
245
+ 'pt-br': 'Contato sem nome',
246
+ en: 'Unnamed contact',
247
+ es: 'Contacto sin nombre',
248
+ },
249
+ yesterday: {
250
+ 'pt-br': 'Ontem',
251
+ en: 'Yesterday',
252
+ es: 'Ayer',
253
+ },
244
254
  waiting_for: {
245
255
  'pt-br':
246
256
  'Aguardando há 1 minuto | Aguardando há {waitingTime} minutos',
@@ -286,13 +296,6 @@ export default {
286
296
  formattedLastInteraction() {
287
297
  if (!this.lastInteractionTime) return '';
288
298
 
289
- const yesterdayTranslationsMapper = {
290
- en: 'Yesterday',
291
- 'pt-br': 'Ontem',
292
- es: 'Ayer',
293
- ayer: 'Ayer',
294
- };
295
-
296
299
  moment.locale(this.locale);
297
300
 
298
301
  const now = moment();
@@ -300,7 +303,7 @@ export default {
300
303
  const lastInteractionMoment = moment(this.lastInteractionTime);
301
304
 
302
305
  if (now.subtract(1, 'day').isSame(lastInteractionMoment, 'day')) {
303
- return yesterdayTranslationsMapper[this.locale || 'en'];
306
+ return this.i18n('yesterday');
304
307
  }
305
308
 
306
309
  if (now.diff(lastInteractionMoment, 'hours') > 0) {
@@ -343,6 +346,9 @@ export default {
343
346
 
344
347
  return { isMedia, contentType, lastMessage, mediaIcon, mediaText };
345
348
  },
349
+ contactName() {
350
+ return this.title?.trim() || `[${this.i18n('unnamed_contact')}]`;
351
+ },
346
352
  subtitle() {
347
353
  const { discussionGoal, lastMessage } = this;
348
354
  return discussionGoal
@@ -79,7 +79,7 @@ export default {
79
79
  if (firstCodePoint) {
80
80
  return String.fromCodePoint(firstCodePoint);
81
81
  }
82
- return '';
82
+ return '-';
83
83
  },
84
84
  },
85
85
  };
@@ -23,6 +23,9 @@
23
23
  "audio": "Audio message"
24
24
  }
25
25
  },
26
+ "chats_contact": {
27
+ "yesterday": "Yesterday"
28
+ },
26
29
  "emoji_picker": {
27
30
  "title": "Pick your emoji...",
28
31
  "search": "Search",
@@ -23,6 +23,9 @@
23
23
  "audio": "Mensaje de audio"
24
24
  }
25
25
  },
26
+ "chats_contact": {
27
+ "yesterday": "Ayer"
28
+ },
26
29
  "emoji_picker": {
27
30
  "title": "Elige tu emoji...",
28
31
  "search": "Buscar",
@@ -23,6 +23,9 @@
23
23
  "audio": "Mensagem de áudio"
24
24
  }
25
25
  },
26
+ "chats_contact": {
27
+ "yesterday": "Ontem"
28
+ },
26
29
  "emoji_picker": {
27
30
  "title": "Escolha seu emoji...",
28
31
  "search": "Buscar",