@chat21/chat21-web-widget 5.1.30 → 5.1.32-rc1
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/.github/workflows/docker-community-push-latest.yml +23 -13
- package/.github/workflows/docker-image-tag-community-tag-push.yml +22 -12
- package/CHANGELOG.md +38 -2
- package/Dockerfile +4 -5
- package/angular.json +5 -2
- package/docs/changelog/this-branch.md +36 -0
- package/package.json +4 -1
- package/src/app/app.component.ts +10 -9
- package/src/app/app.module.ts +9 -0
- package/src/app/component/conversation-detail/conversation/conversation.component.html +7 -1
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +2 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +34 -5
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +2 -2
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +1 -1
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +2 -0
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +143 -78
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +131 -13
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +108 -7
- package/src/app/component/last-message/last-message.component.ts +4 -1
- package/src/app/component/message/audio/audio.component.ts +0 -5
- package/src/app/component/message/audio-sync/audio-sync.component.html +19 -0
- package/src/app/component/message/audio-sync/audio-sync.component.scss +65 -0
- package/src/app/component/message/audio-sync/audio-sync.component.spec.ts +23 -0
- package/src/app/component/message/audio-sync/audio-sync.component.ts +197 -0
- package/src/app/component/message/bubble-message/bubble-message.component.html +6 -1
- package/src/app/component/message/bubble-message/bubble-message.component.ts +2 -1
- package/src/app/providers/global-settings.service.ts +21 -0
- package/src/app/providers/translator.service.ts +2 -0
- package/src/app/providers/voice/STT&TTS/openai-voice.config.ts +12 -0
- package/src/app/providers/voice/STT&TTS/openai-voice.provider.ts +171 -0
- package/src/app/providers/voice/STT&TTS/speech-provider.abstract.ts +39 -0
- package/src/app/providers/voice/audio.types.ts +34 -0
- package/src/app/providers/voice/vad.service.spec.ts +28 -0
- package/src/app/providers/voice/vad.service.ts +70 -0
- package/src/app/providers/voice/voice.service.spec.ts +60 -0
- package/src/app/providers/voice/voice.service.ts +264 -0
- package/src/app/sass/_variables.scss +1 -0
- package/src/app/shims/onnxruntime-web-wasm.ts +4 -0
- package/src/app/utils/conversation-sender-classifier.ts +21 -0
- package/src/app/utils/globals.ts +7 -1
- package/src/assets/i18n/en.json +1 -0
- package/src/assets/i18n/es.json +1 -0
- package/src/assets/i18n/fr.json +1 -0
- package/src/assets/i18n/it.json +1 -0
- package/src/assets/onnx/ort-wasm-simd-threaded.mjs +59 -0
- package/src/assets/onnx/ort-wasm-simd-threaded.wasm +0 -0
- package/src/assets/vad/silero_vad_legacy.onnx +0 -0
- package/src/assets/vad/vad.worklet.bundle.min.js +1 -0
- package/src/chat21-core/models/message.ts +2 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +3 -2
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +12 -0
- package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +1 -1
- package/src/chat21-core/utils/utils-message.ts +7 -0
- package/src/chat21-core/utils/utils.ts +5 -2
- package/tsconfig.json +5 -0
|
@@ -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 + '
|
|
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
|
-
|