@chat21/chat21-web-widget 5.1.30 → 5.1.32-rc2

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.
Files changed (56) hide show
  1. package/.github/workflows/docker-community-push-latest.yml +23 -13
  2. package/.github/workflows/docker-image-tag-community-tag-push.yml +22 -12
  3. package/CHANGELOG.md +41 -2
  4. package/Dockerfile +4 -5
  5. package/angular.json +5 -2
  6. package/deploy_amazon_beta.sh +17 -7
  7. package/docs/changelog/this-branch.md +36 -0
  8. package/package.json +4 -1
  9. package/src/app/app.component.ts +10 -9
  10. package/src/app/app.module.ts +9 -0
  11. package/src/app/component/conversation-detail/conversation/conversation.component.html +7 -1
  12. package/src/app/component/conversation-detail/conversation/conversation.component.scss +2 -2
  13. package/src/app/component/conversation-detail/conversation/conversation.component.ts +34 -5
  14. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +2 -2
  15. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +1 -1
  16. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +2 -0
  17. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +146 -79
  18. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +131 -13
  19. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +108 -7
  20. package/src/app/component/last-message/last-message.component.ts +4 -1
  21. package/src/app/component/message/audio/audio.component.ts +0 -5
  22. package/src/app/component/message/audio-sync/audio-sync.component.html +19 -0
  23. package/src/app/component/message/audio-sync/audio-sync.component.scss +65 -0
  24. package/src/app/component/message/audio-sync/audio-sync.component.spec.ts +23 -0
  25. package/src/app/component/message/audio-sync/audio-sync.component.ts +197 -0
  26. package/src/app/component/message/bubble-message/bubble-message.component.html +6 -1
  27. package/src/app/component/message/bubble-message/bubble-message.component.ts +2 -1
  28. package/src/app/providers/global-settings.service.ts +21 -0
  29. package/src/app/providers/translator.service.ts +2 -0
  30. package/src/app/providers/voice/STT&TTS/openai-voice.config.ts +12 -0
  31. package/src/app/providers/voice/STT&TTS/openai-voice.provider.ts +171 -0
  32. package/src/app/providers/voice/STT&TTS/speech-provider.abstract.ts +39 -0
  33. package/src/app/providers/voice/audio.types.ts +34 -0
  34. package/src/app/providers/voice/vad.service.spec.ts +28 -0
  35. package/src/app/providers/voice/vad.service.ts +70 -0
  36. package/src/app/providers/voice/voice.service.spec.ts +60 -0
  37. package/src/app/providers/voice/voice.service.ts +264 -0
  38. package/src/app/sass/_variables.scss +1 -0
  39. package/src/app/shims/onnxruntime-web-wasm.ts +4 -0
  40. package/src/app/utils/conversation-sender-classifier.ts +21 -0
  41. package/src/app/utils/globals.ts +7 -1
  42. package/src/assets/i18n/en.json +1 -0
  43. package/src/assets/i18n/es.json +1 -0
  44. package/src/assets/i18n/fr.json +1 -0
  45. package/src/assets/i18n/it.json +1 -0
  46. package/src/assets/onnx/ort-wasm-simd-threaded.mjs +59 -0
  47. package/src/assets/onnx/ort-wasm-simd-threaded.wasm +0 -0
  48. package/src/assets/vad/silero_vad_legacy.onnx +0 -0
  49. package/src/assets/vad/vad.worklet.bundle.min.js +1 -0
  50. package/src/chat21-core/models/message.ts +2 -1
  51. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +3 -2
  52. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +12 -0
  53. package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +1 -1
  54. package/src/chat21-core/utils/utils-message.ts +7 -0
  55. package/src/chat21-core/utils/utils.ts +5 -2
  56. package/tsconfig.json +5 -0
@@ -14,6 +14,7 @@ export class MessageModel {
14
14
  public attributes: any,
15
15
  public channel_type: string,
16
16
  public isSender: boolean,
17
- public emoticon?: boolean
17
+ public emoticon?: boolean,
18
+ public isJustRecived?: boolean
18
19
  ) { }
19
20
  }
@@ -253,9 +253,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
253
253
  }
254
254
  }
255
255
 
256
-
257
256
 
258
-
259
257
  this.addRepalceMessageInArray(msg.uid, msg);
260
258
  this.messageAdded.next(msg);
261
259
  } else {
@@ -494,6 +492,9 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
494
492
  commands[i+1]? commands[i+1].time = 0 : null
495
493
  }
496
494
  }
495
+
496
+ command.message.isJustRecived = isJustRecived( that.startTime.getTime(), msg.timestamp );
497
+
497
498
  that.generateMessageObject(msg, command.message, function () {
498
499
  i += 1
499
500
  if (i < commands.length) {
@@ -273,6 +273,16 @@ export class MQTTConversationHandler extends ConversationHandlerService {
273
273
  if(isInfoMessage){
274
274
  this.messageInfo.next(msg)
275
275
  }
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
276
286
 
277
287
  if(isInfoMessage && hideInfoMessage(msg, this.showInfoMessage)){
278
288
  //if showBubbleInfoMessage array keys not includes msg.attributes.messagelabel['key'] exclude CURRENT INFO MESSAGE
@@ -492,6 +502,8 @@ export class MQTTConversationHandler extends ConversationHandlerService {
492
502
  }
493
503
  }
494
504
 
505
+ command.message.isJustRecived = isJustRecived( that.startTime.getTime(), msg.timestamp );
506
+
495
507
  that.generateMessageObject(msg, command.message, i, function () {
496
508
  i += 1
497
509
  if (i < commands.length) {
@@ -71,7 +71,7 @@ export class TiledeskRequestsService {
71
71
 
72
72
  public getMyRequests(): Promise<{ requests: Array<any>}> {
73
73
  this.tiledeskToken = this.appStorage.getItem('tiledeskToken')
74
- const url = this.URL_TILEDESK_REQUEST + '/me?preflight=true'
74
+ const url = this.URL_TILEDESK_REQUEST + 'me?preflight=true'
75
75
  this.logger.log('[TILEDESK-SERVICE] - GET REQUEST url ', url);
76
76
  const httpOptions = {
77
77
  headers: new HttpHeaders({
@@ -48,6 +48,13 @@ export function isAudio(message: any) {
48
48
  return false;
49
49
  }
50
50
 
51
+ export function isAudioTTS(message: any) {
52
+ if (message && message.type && message.type === 'tts' && message.metadata && message.metadata.src && message.metadata.type.includes('audio') ) {
53
+ return true;
54
+ }
55
+ return false;
56
+ }
57
+
51
58
  /** */
52
59
  export function isInfo(message: any) {
53
60
  if (message && message.attributes && (message.attributes.subtype === 'info' || message.attributes.subtype === 'info/support')) {
@@ -773,6 +773,11 @@ export function isAllowedUrlInText(text: string, allowedUrls: string[]) {
773
773
  return nonWhitelistedDomains.length === 0;
774
774
  }
775
775
 
776
+ // function extractUrls(text: string): string[] {
777
+ // const urlRegex = /https?:\/\/[^\s]+/g;
778
+ // return text.match(urlRegex) || [];
779
+ // }
780
+
776
781
  function extractUrls(text: string): string[] {
777
782
  // Rileva URL con o senza protocollo (http/https)
778
783
  const urlRegex = /\b((https?:\/\/)?(www\.)?[a-z0-9.-]+\.[a-z]{2,})(\/[^\s]*)?/gi;
@@ -787,5 +792,3 @@ function extractUrls(text: string): string[] {
787
792
  }
788
793
 
789
794
 
790
-
791
-
package/tsconfig.json CHANGED
@@ -23,6 +23,11 @@
23
23
  "dom"
24
24
  ],
25
25
  "resolveJsonModule": true,
26
+ "paths": {
27
+ "onnxruntime-web/wasm": [
28
+ "src/app/shims/onnxruntime-web-wasm.ts"
29
+ ]
30
+ }
26
31
  },
27
32
  "skipLibCheck": true,
28
33
  "angularCompilerOptions": {