@chat21/chat21-web-widget 5.1.32-rc3 → 5.1.33
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 +13 -23
- package/.github/workflows/docker-image-tag-community-tag-push.yml +12 -22
- package/CHANGELOG.md +6 -41
- package/Dockerfile +5 -4
- package/angular.json +2 -5
- package/deploy_amazon_beta.sh +7 -17
- package/deploy_amazon_prod.sh +2 -2
- package/docs/changelog/this-branch.md +0 -36
- package/nginx.conf +2 -22
- package/package.json +1 -4
- package/src/app/app.component.ts +9 -10
- package/src/app/app.module.ts +0 -9
- package/src/app/component/conversation-detail/conversation/conversation.component.html +1 -6
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +2 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +5 -34
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +1 -1
- 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 +0 -1
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +79 -146
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +13 -131
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +7 -108
- package/src/app/component/last-message/last-message.component.ts +1 -4
- package/src/app/component/message/audio/audio.component.ts +5 -0
- package/src/app/component/message/bubble-message/bubble-message.component.html +1 -6
- package/src/app/component/message/bubble-message/bubble-message.component.ts +1 -2
- package/src/app/providers/global-settings.service.ts +0 -21
- package/src/app/providers/translator.service.ts +0 -2
- package/src/app/sass/_variables.scss +0 -1
- package/src/app/utils/globals.ts +1 -7
- package/src/assets/i18n/en.json +0 -1
- package/src/assets/i18n/es.json +0 -1
- package/src/assets/i18n/fr.json +0 -1
- package/src/assets/i18n/it.json +0 -1
- package/src/chat21-core/models/message.ts +1 -2
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +0 -12
- package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +1 -1
- package/src/chat21-core/utils/utils-message.ts +0 -7
- package/src/chat21-core/utils/utils.ts +2 -5
- package/src/launch.js +41 -32
- package/src/launch_template.js +41 -32
- package/tsconfig.json +0 -5
- package/src/app/component/message/audio-sync/audio-sync.component.html +0 -19
- package/src/app/component/message/audio-sync/audio-sync.component.scss +0 -65
- package/src/app/component/message/audio-sync/audio-sync.component.spec.ts +0 -23
- package/src/app/component/message/audio-sync/audio-sync.component.ts +0 -197
- package/src/app/providers/voice/STT&TTS/openai-voice.config.ts +0 -12
- package/src/app/providers/voice/STT&TTS/openai-voice.provider.ts +0 -171
- package/src/app/providers/voice/STT&TTS/speech-provider.abstract.ts +0 -39
- package/src/app/providers/voice/audio.types.ts +0 -34
- package/src/app/providers/voice/vad.service.spec.ts +0 -28
- package/src/app/providers/voice/vad.service.ts +0 -70
- package/src/app/providers/voice/voice.service.spec.ts +0 -60
- package/src/app/providers/voice/voice.service.ts +0 -264
- package/src/app/shims/onnxruntime-web-wasm.ts +0 -4
- package/src/assets/onnx/ort-wasm-simd-threaded.mjs +0 -59
- 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 +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
name: Docker Image Community latest CI
|
|
2
2
|
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
5
|
branches: [ master ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ master ]
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
10
|
push_to_registry:
|
|
@@ -12,22 +12,12 @@ jobs:
|
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
25
|
-
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
26
|
-
|
|
27
|
-
- name: Build and push multiarch Docker image
|
|
28
|
-
uses: docker/build-push-action@v3
|
|
29
|
-
with:
|
|
30
|
-
context: .
|
|
31
|
-
push: true
|
|
32
|
-
platforms: linux/amd64,linux/arm64
|
|
33
|
-
tags: chat21/chat21-web-widget:latest
|
|
15
|
+
- uses: actions/checkout@v2
|
|
16
|
+
name: Check out the repo
|
|
17
|
+
- uses: docker/build-push-action@v1
|
|
18
|
+
with:
|
|
19
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
20
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
21
|
+
repository: chat21/chat21-web-widget
|
|
22
|
+
push: true
|
|
23
|
+
tags: latest
|
|
@@ -3,30 +3,20 @@ name: Publish Docker Community image tags
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
|
-
- '**'
|
|
7
|
-
|
|
6
|
+
- '**' # Push events to every tag including hierarchical tags like
|
|
8
7
|
jobs:
|
|
8
|
+
|
|
9
9
|
push_to_registry:
|
|
10
10
|
name: Push Docker image to Docker Hub
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
12
|
steps:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
25
|
-
|
|
26
|
-
- name: Build and push multiarch Docker image
|
|
27
|
-
uses: docker/build-push-action@v3
|
|
28
|
-
with:
|
|
29
|
-
context: .
|
|
30
|
-
push: true
|
|
31
|
-
platforms: linux/amd64,linux/arm64
|
|
32
|
-
tags: chat21/chat21-web-widget:${{ github.ref_name }}
|
|
13
|
+
- name: Check out the repo
|
|
14
|
+
uses: actions/checkout@v2
|
|
15
|
+
- name: Push to Docker Hub
|
|
16
|
+
uses: docker/build-push-action@v1
|
|
17
|
+
with:
|
|
18
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
19
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
20
|
+
repository: chat21/chat21-web-widget
|
|
21
|
+
push: true
|
|
22
|
+
tag_with_ref: true
|
package/CHANGELOG.md
CHANGED
|
@@ -6,30 +6,17 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
-
# 5.1.
|
|
9
|
+
# 5.1.33
|
|
10
|
+
- **bug fixed**: widget not loaded because blob block loading in lauch.js
|
|
10
11
|
|
|
11
|
-
# 5.1.
|
|
12
|
-
- **bug fixed**:
|
|
13
|
-
|
|
14
|
-
# 5.1.32-rc1
|
|
15
|
-
- **added**: Voice pipeline — VAD (`@ricky0123/vad-web`) with ONNX Runtime WASM served from `/assets/onnx` (`copy-onnx-wasm`), `VoiceService` with `audioSegment$` (WebM segments) and optional STT/TTS via unified OpenAI provider using `HttpClient`, transcript / error fields on segment payloads.
|
|
16
|
-
- **added**: Stream audio UI in conversation footer — toggle, real-time volume stream and animated waveform (`volume$`); mic session lifecycle wired to upload segments on speech end.
|
|
17
|
-
- **added**: `MessageModel.isJustRecived` — set when ingesting messages (MQTT/Firebase `addCommandMessage` for `command.type === "message"`, and default for non-command messages in `addedMessage` / `addedNew`) to distinguish “new in session” vs history.
|
|
18
|
-
- **added**: `chat-audio-sync` for TTS messages — karaoke-style word sync to audio, full `message` input, typography aligned with text bubbles; skips animation when `isJustRecived === false`; after playback ends sets `message.isJustRecived = false` so replays show full text without re-animating.
|
|
19
|
-
- **bug fixed**: `AnalyserNode.getByteFrequencyData` TypeScript error — `Uint8Array` created from an explicit `ArrayBuffer` for correct DOM typings.
|
|
20
|
-
- **bug fixed**: `isStreamAudioActive` no longer derived from per-frame mic level (`volume > 1`), which caused the stream button / active state to flash continuously while listening.
|
|
12
|
+
# 5.1.31
|
|
13
|
+
- **bug fixed**: bug fix disabled user-typing with human and user-typing with human is not available
|
|
21
14
|
|
|
22
15
|
# 5.1.30
|
|
23
16
|
- **bug fixed**: startHidden is not working properly
|
|
24
17
|
|
|
25
|
-
# 5.1.
|
|
26
|
-
- **bug fixed**:
|
|
27
|
-
|
|
28
|
-
# 5.1.30-rc2
|
|
29
|
-
- **bug fixed**: bug fix disabled user-typing with human
|
|
30
|
-
|
|
31
|
-
# 5.1.30-rc1
|
|
32
|
-
- **bug fixed**: startHidden is not working properly
|
|
18
|
+
# 5.1.28
|
|
19
|
+
- **bug fixed**: header option menu is deactivated on mobile
|
|
33
20
|
|
|
34
21
|
# 5.1.28
|
|
35
22
|
- **bug fixed**: fixed Bot/Human conversation detection by correctly classifying bot replies
|
|
@@ -41,22 +28,8 @@
|
|
|
41
28
|
- **changed**: Set the default autoStart value to false
|
|
42
29
|
- **added**: Added the open widget loading spinner
|
|
43
30
|
- **changed**: Load the widget without authentication and display the speech bubble
|
|
44
|
-
|
|
45
|
-
# 5.1.27-rc3
|
|
46
|
-
- **bug fixed**: fixed Bot/Human conversation detection by correctly classifying bot replies
|
|
47
|
-
|
|
48
|
-
# 5.1.27-rc2
|
|
49
|
-
- **bug fixed**: centralized fullscreen management on mobile and handled the case of the closed widget that remained fullscreen
|
|
50
|
-
|
|
51
|
-
# 5.1.27-rc1
|
|
52
|
-
- **added**: closeChatInConversation parameters
|
|
53
|
-
- **added**: close chat button under textarea footer component
|
|
54
|
-
|
|
55
|
-
# 5.1.26-rc6
|
|
56
31
|
- **changed**: mobile always opens fullscreen and ignores legacy stored size”.
|
|
57
32
|
- **changed**: changed user-typing
|
|
58
|
-
|
|
59
|
-
# 5.1.26-rc5
|
|
60
33
|
- **changed**: Hide the resize-widget button when on mobile
|
|
61
34
|
- **added**: added "I'm thinking" when the bot responds
|
|
62
35
|
|
|
@@ -118,14 +91,6 @@
|
|
|
118
91
|
- **bug-fixed**: check showEmojiFooterButton to enable/disable emojii
|
|
119
92
|
- **bug-fixed**: markdown is fired as an emojii and blocked by isEmojii check fn
|
|
120
93
|
|
|
121
|
-
<<<<<<< HEAD
|
|
122
|
-
=======
|
|
123
|
-
# 5.1.7-rc7
|
|
124
|
-
- **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
|
|
125
|
-
|
|
126
|
-
# 5.1.7-rc6
|
|
127
|
-
- **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
|
|
128
|
-
>>>>>>> master-pre
|
|
129
94
|
|
|
130
95
|
# 5.1.7-rc5
|
|
131
96
|
- **bug-fixed**: bug fixed BUTTON STYLES
|
package/Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
### STAGE 1: Build ###
|
|
2
2
|
|
|
3
3
|
# We label our stage as ‘builder’
|
|
4
|
-
FROM
|
|
4
|
+
FROM node:20.12.2-alpine3.19 as builder
|
|
5
5
|
|
|
6
6
|
COPY package.json package-lock.json ./
|
|
7
7
|
|
|
@@ -15,11 +15,12 @@ COPY . .
|
|
|
15
15
|
|
|
16
16
|
## Build the angular app in production mode and store the artifacts in dist folder
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
RUN npx ng build --configuration="prod" --output-path=dist --base-href=./ --output-hashing=none
|
|
20
19
|
|
|
20
|
+
|
|
21
21
|
### STAGE 2: Setup ###
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
FROM nginx:1.14.1-alpine
|
|
23
24
|
|
|
24
25
|
## Copy our default nginx config
|
|
25
26
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
@@ -32,4 +33,4 @@ COPY --from=builder /ng-app/dist/browser /usr/share/nginx/html
|
|
|
32
33
|
|
|
33
34
|
RUN echo "Chat21 Web Widget Started!!"
|
|
34
35
|
|
|
35
|
-
CMD ["/bin/sh",
|
|
36
|
+
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/widget-config-template.json > /usr/share/nginx/html/widget-config.json && exec nginx -g 'daemon off;'"]
|
package/angular.json
CHANGED
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
"src/environments/real_data/widget-config-docker.json",
|
|
45
45
|
"src/environments/real_data/widget-config-native-mqtt.json",
|
|
46
46
|
"src/environments/real_data/widget-config-native-prod.json",
|
|
47
|
-
"src/environments/real_data/widget-config-aws-stage.json"
|
|
48
|
-
"src/environments/real_data/widget-config-aws-aruba.json"
|
|
47
|
+
"src/environments/real_data/widget-config-aws-stage.json"
|
|
49
48
|
],
|
|
50
49
|
"styles": [
|
|
51
50
|
"src/app/sass/styles.scss"
|
|
@@ -60,9 +59,7 @@
|
|
|
60
59
|
"idb",
|
|
61
60
|
"accept-language-parser",
|
|
62
61
|
"file-saver",
|
|
63
|
-
"dayjs"
|
|
64
|
-
"onnxruntime-web",
|
|
65
|
-
"@ricky0123/vad-web"
|
|
62
|
+
"dayjs"
|
|
66
63
|
],
|
|
67
64
|
"sourceMap": true,
|
|
68
65
|
"optimization": false,
|
package/deploy_amazon_beta.sh
CHANGED
|
@@ -2,16 +2,8 @@
|
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
5
|
-
npm i
|
|
6
|
-
|
|
7
|
-
cp src/environments/real_data/environment.pre.ts src/environments/environment.pre.ts
|
|
8
|
-
|
|
9
5
|
ng build --configuration="pre" --aot=true --base-href
|
|
10
6
|
|
|
11
|
-
### SET HASHING : START ###
|
|
12
|
-
cp ./src/launch_template.js ./dist/browser/launch.js
|
|
13
|
-
node ./src/build_launch.js
|
|
14
|
-
### SET HASHING : END ###
|
|
15
7
|
|
|
16
8
|
# ########## --->>>> NATIVE-MQTT folder START <<<<<------ ########## #
|
|
17
9
|
|
|
@@ -31,17 +23,15 @@ node ./src/build_launch.js
|
|
|
31
23
|
|
|
32
24
|
|
|
33
25
|
# ########## --->>>> FIREBASE folder START <<<<<------ ########## #
|
|
34
|
-
cd dist
|
|
35
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300
|
|
36
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5
|
|
37
|
-
|
|
38
|
-
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
39
|
-
cd ../..
|
|
26
|
+
cd dist
|
|
27
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300
|
|
28
|
+
aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control max-age=300
|
|
29
|
+
cd ..
|
|
40
30
|
|
|
41
|
-
aws cloudfront create-invalidation --distribution-id
|
|
42
|
-
|
|
43
|
-
git restore src/environments/environment.pre.ts
|
|
31
|
+
#aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
32
|
+
cd ..
|
|
44
33
|
|
|
34
|
+
aws cloudfront create-invalidation --distribution-id E2V5O0YPR61V8P --paths "/*"
|
|
45
35
|
# echo new version deployed $NEW_VER/$NEW_BUILD/ on s3://tiledesk-widget-pre/v2
|
|
46
36
|
echo new version deployed $version/ on s3://tiledesk-widget-pre/v5 and s3://tiledesk-widget-pre/v5/$version/
|
|
47
37
|
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget-pre/v5/index.html
|
package/deploy_amazon_prod.sh
CHANGED
|
@@ -27,8 +27,8 @@ cd dist/browser
|
|
|
27
27
|
# aws s3 sync . s3://tiledesk-widget/v5/latest/
|
|
28
28
|
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
29
29
|
aws s3 sync . s3://tiledesk-widget/v6/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
30
|
-
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
31
|
-
aws s3 sync . s3://tiledesk-widget/v6/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
30
|
+
#aws s3 sync . s3://tiledesk-widget/v6/ --cache-control max-age=86400 --exclude='launch.js' #8days
|
|
31
|
+
#aws s3 sync . s3://tiledesk-widget/v6/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
|
|
32
32
|
cd ../..
|
|
33
33
|
|
|
34
34
|
aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
|
|
@@ -45,39 +45,3 @@ Questo branch migliora il feedback in conversazione e rende il comportamento del
|
|
|
45
45
|
- Il callout non compare quando il widget e' aperto o quando la preview nuovo messaggio e' attiva.
|
|
46
46
|
- La UI della conversazione indica chiaramente se l'ultimo responder e' bot o umano.
|
|
47
47
|
- "Sto pensando..." compare solo nelle conversazioni bot e ha un comportamento prevedibile.
|
|
48
|
-
# This branch: identificazione bot o umano
|
|
49
|
-
|
|
50
|
-
## Obiettivo
|
|
51
|
-
|
|
52
|
-
In questo branch e' stata introdotta una logica esplicita per capire, all'apertura della conversazione, se l'ultimo responder lato server e' un **bot** oppure un **umano**.
|
|
53
|
-
|
|
54
|
-
## Come viene fatta l'identificazione
|
|
55
|
-
|
|
56
|
-
- La valutazione parte dai messaggi gia' caricati in conversazione.
|
|
57
|
-
- Viene cercato l'**ultimo messaggio ricevuto dal server** (non inviato dal client corrente).
|
|
58
|
-
- Quel messaggio viene classificato con una funzione dedicata (`classifyMessageSenderKind`) che usa piu' segnali:
|
|
59
|
-
- `attributes.flowAttributes.chatbot_id` (quando presente indica bot)
|
|
60
|
-
- pattern del mittente (es. `senderId` con prefisso bot, quando applicabile)
|
|
61
|
-
- informazioni del mittente (`sender_fullname` e metadati associati)
|
|
62
|
-
|
|
63
|
-
## Regola speciale per messaggi di sistema
|
|
64
|
-
|
|
65
|
-
Se l'ultimo messaggio utile e' di tipo `system`, viene fatto un controllo aggiuntivo:
|
|
66
|
-
|
|
67
|
-
- se in `attributes` e' presente un evento con `messagelabel.key = MEMBER_JOINED_GROUP`
|
|
68
|
-
- e rappresenta il passaggio della conversazione a un operatore
|
|
69
|
-
|
|
70
|
-
allora la conversazione viene forzata a **Umano** anche se altri indizi potrebbero suggerire bot.
|
|
71
|
-
|
|
72
|
-
## Risultato in UI
|
|
73
|
-
|
|
74
|
-
- In apertura conversazione viene mostrato un badge con stato:
|
|
75
|
-
- `Bot`
|
|
76
|
-
- `Umano`
|
|
77
|
-
- Questo stato viene ricalcolato al variare dei messaggi ricevuti.
|
|
78
|
-
|
|
79
|
-
## Effetto sui feedback utente
|
|
80
|
-
|
|
81
|
-
- Il messaggio temporaneo `"sto pensando..."` viene mostrato solo quando la conversazione risulta di tipo **Bot**.
|
|
82
|
-
- Alla ricezione della prima risposta dal server, `"sto pensando..."` viene nascosto **immediatamente**.
|
|
83
|
-
- Non e' previsto alcun tempo minimo di visualizzazione del messaggio.
|
package/nginx.conf
CHANGED
|
@@ -5,38 +5,18 @@ events {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
http {
|
|
8
|
-
include /etc/nginx/mime.types;
|
|
9
|
-
default_type application/octet-stream;
|
|
10
|
-
|
|
11
8
|
server {
|
|
12
9
|
listen 80;
|
|
13
10
|
server_name localhost;
|
|
14
11
|
|
|
15
12
|
root /usr/share/nginx/html;
|
|
16
13
|
index index.html index.htm;
|
|
14
|
+
include /etc/nginx/mime.types;
|
|
17
15
|
|
|
18
16
|
gzip on;
|
|
19
17
|
gzip_min_length 1000;
|
|
20
18
|
gzip_proxied expired no-cache no-store private auth;
|
|
21
|
-
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript
|
|
22
|
-
|
|
23
|
-
# ONNX Runtime (.mjs), WASM e modelli VAD: il browser rifiuta moduli ES con Content-Type: text/plain
|
|
24
|
-
location ~* \.mjs$ {
|
|
25
|
-
root /usr/share/nginx/html;
|
|
26
|
-
default_type application/javascript;
|
|
27
|
-
charset utf-8;
|
|
28
|
-
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
29
|
-
}
|
|
30
|
-
location ~* \.wasm$ {
|
|
31
|
-
root /usr/share/nginx/html;
|
|
32
|
-
default_type application/wasm;
|
|
33
|
-
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
34
|
-
}
|
|
35
|
-
location ~* \.onnx$ {
|
|
36
|
-
root /usr/share/nginx/html;
|
|
37
|
-
default_type application/octet-stream;
|
|
38
|
-
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
39
|
-
}
|
|
19
|
+
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
|
40
20
|
|
|
41
21
|
location / {
|
|
42
22
|
try_files $uri $uri/ /index.html;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chat21/chat21-web-widget",
|
|
3
3
|
"author": "Tiledesk SRL",
|
|
4
|
-
"version": "5.1.
|
|
4
|
+
"version": "5.1.33",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.tiledesk.com",
|
|
7
7
|
"repository": {
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"ng": "ng",
|
|
13
|
-
"copy-onnx-wasm": "mkdir -p src/assets/onnx && cp node_modules/onnxruntime-web/dist/ort-wasm-simd-threaded.mjs node_modules/onnxruntime-web/dist/ort-wasm-simd-threaded.wasm src/assets/onnx/",
|
|
14
13
|
"start": "ng serve",
|
|
15
14
|
"build": "ng build",
|
|
16
15
|
"test": "ng test",
|
|
@@ -33,7 +32,6 @@
|
|
|
33
32
|
"@ctrl/ngx-emoji-mart": "^9.2.0",
|
|
34
33
|
"@ngx-translate/core": "^16.0.4",
|
|
35
34
|
"@ngx-translate/http-loader": "^16.0.1",
|
|
36
|
-
"@ricky0123/vad-web": "^0.0.30",
|
|
37
35
|
"accept-language-parser": "^1.5.0",
|
|
38
36
|
"bootstrap": "^5.1.3",
|
|
39
37
|
"dayjs": "^1.11.7",
|
|
@@ -42,7 +40,6 @@
|
|
|
42
40
|
"humanize-duration-ts": "^2.1.1",
|
|
43
41
|
"marked": "^16.3.0",
|
|
44
42
|
"ngx-logger": "^5.0.11",
|
|
45
|
-
"onnxruntime-web": "^1.24.3",
|
|
46
43
|
"replace": "^1.2.2",
|
|
47
44
|
"rxjs": "^7.8.2",
|
|
48
45
|
"source-map-explorer": "^2.5.3",
|
package/src/app/app.component.ts
CHANGED
|
@@ -106,16 +106,17 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
106
106
|
|
|
107
107
|
forceDisconnect: boolean = false;
|
|
108
108
|
|
|
109
|
-
//network status
|
|
110
|
-
isOnline: boolean = true;
|
|
111
|
-
loading: boolean = false;
|
|
112
|
-
private calloutScheduleTimeout: any = null;
|
|
113
|
-
|
|
114
109
|
// alert error message
|
|
115
110
|
isShowErrorMessage: boolean = false;
|
|
116
111
|
errorMessage: string = '';
|
|
117
112
|
errorKeyMessage: string = null;
|
|
118
113
|
errorParams: Record<string, any> = {};
|
|
114
|
+
|
|
115
|
+
//network status
|
|
116
|
+
isOnline: boolean = true;
|
|
117
|
+
|
|
118
|
+
loading: boolean = false;
|
|
119
|
+
private calloutScheduleTimeout: any = null;
|
|
119
120
|
|
|
120
121
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
121
122
|
constructor(
|
|
@@ -169,13 +170,13 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
169
170
|
if (conversation.attributes && conversation.attributes['subtype'] === 'info') {
|
|
170
171
|
return;
|
|
171
172
|
}
|
|
172
|
-
if (conversation.is_new &&
|
|
173
|
+
if (conversation.is_new && this.isInitialized) {
|
|
173
174
|
that.manageTabNotification(false, 'conv-added')
|
|
174
175
|
// this.soundMessage();
|
|
175
176
|
}
|
|
176
|
-
if(this.g.isOpen === false
|
|
177
|
-
that.g.isOpenNewMessage = true;
|
|
177
|
+
if(this.g.isOpen === false){
|
|
178
178
|
that.lastConversation = conversation;
|
|
179
|
+
that.g.isOpenNewMessage = true;
|
|
179
180
|
}
|
|
180
181
|
} else {
|
|
181
182
|
//widget closed
|
|
@@ -223,7 +224,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
223
224
|
that.lastConversation = conversation;
|
|
224
225
|
that.g.isOpenNewMessage = true;
|
|
225
226
|
that.logger.debug('[APP-COMP] lastconversationnn', that.lastConversation)
|
|
226
|
-
that.logger.debug('[APP-COMP] lastconversationnn message' + JSON.stringify(that.lastConversation?.attributes?.commands))
|
|
227
227
|
}
|
|
228
228
|
let badgeNewConverstionNumber = that.conversationsHandlerService.countIsNew()
|
|
229
229
|
that.g.setParameter('conversationsBadge', badgeNewConverstionNumber);
|
|
@@ -2319,7 +2319,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
2319
2319
|
this.el.nativeElement.style.setProperty('--chat-header-height', this.g.hideHeaderConversation? '0px': null)
|
|
2320
2320
|
this.el.nativeElement.style.setProperty('--font-size-bubble-message', this.g.fontSize)
|
|
2321
2321
|
this.el.nativeElement.style.setProperty('--font-family-bubble-message', this.g.fontFamily)
|
|
2322
|
-
this.el.nativeElement.style.setProperty('--chat-footer-close-button-height', this.g.closeChatInConversation? '30px': '0px')
|
|
2323
2322
|
|
|
2324
2323
|
}
|
|
2325
2324
|
|
package/src/app/app.module.ts
CHANGED
|
@@ -25,7 +25,6 @@ import { InfoMessageComponent } from './component/message/info-message/info-mess
|
|
|
25
25
|
import { HtmlComponent } from './component/message/html/html.component';
|
|
26
26
|
import { FrameComponent } from './component/message/frame/frame.component';
|
|
27
27
|
import { AudioComponent } from './component/message/audio/audio.component';
|
|
28
|
-
import { AudioSyncComponent } from './component/message/audio-sync/audio-sync.component';
|
|
29
28
|
import { UserTypingComponent } from './../chat21-core/utils/user-typing/user-typing.component';
|
|
30
29
|
/** MESSAGE ATTACHMENTS COMPONENTS */
|
|
31
30
|
import { MessageAttachmentComponent } from './component/message-attachment/message-attachment.component';
|
|
@@ -137,11 +136,6 @@ import { Rules } from './utils/rules';
|
|
|
137
136
|
import { ScriptService } from 'src/chat21-core/providers/scripts/script.service';
|
|
138
137
|
import { CarouselComponent } from './component/message/carousel/carousel.component';
|
|
139
138
|
import { BrandService } from './providers/brand.service';
|
|
140
|
-
import { OpenAiVoiceProviderService } from './providers/voice/STT&TTS/openai-voice.provider';
|
|
141
|
-
import {
|
|
142
|
-
SpeechToTextProvider,
|
|
143
|
-
TextToSpeechProvider,
|
|
144
|
-
} from './providers/voice/STT&TTS/speech-provider.abstract';
|
|
145
139
|
import { ErrorAlertComponent } from './component/error-alert/error-alert.component';
|
|
146
140
|
import { ConfirmCloseComponent } from './modals/confirm-close/confirm-close.component';
|
|
147
141
|
|
|
@@ -306,7 +300,6 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
|
|
|
306
300
|
LinkButtonComponent,
|
|
307
301
|
TextButtonComponent,
|
|
308
302
|
AudioComponent,
|
|
309
|
-
AudioSyncComponent,
|
|
310
303
|
UserTypingComponent,
|
|
311
304
|
/**DIRECTIVES */
|
|
312
305
|
HtmlEntitiesEncodePipe,
|
|
@@ -412,8 +405,6 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigService, app
|
|
|
412
405
|
WaitingService,
|
|
413
406
|
ScriptService,
|
|
414
407
|
BrandService,
|
|
415
|
-
{ provide: SpeechToTextProvider, useExisting: OpenAiVoiceProviderService },
|
|
416
|
-
{ provide: TextToSpeechProvider, useExisting: OpenAiVoiceProviderService },
|
|
417
408
|
provideHttpClient(withInterceptorsFromDi())
|
|
418
409
|
],
|
|
419
410
|
bootstrap: [AppComponent]
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
[showThinkingMessage]="showThinkingMessage"
|
|
67
67
|
[lastServerSenderKind]="lastServerSenderKind"
|
|
68
68
|
[fullscreenMode]="g?.fullscreenMode"
|
|
69
|
-
[isStreamAudioActive]="isStreamAudioActive"
|
|
70
69
|
[translationMap]="translationMapContent"
|
|
71
70
|
[stylesMap]="stylesMap"
|
|
72
71
|
(onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
|
|
@@ -133,14 +132,12 @@
|
|
|
133
132
|
[showAttachmentFooterButton]="g?.showAttachmentFooterButton"
|
|
134
133
|
[showEmojiFooterButton]="g?.showEmojiFooterButton"
|
|
135
134
|
[showAudioRecorderFooterButton]="g?.showAudioRecorderFooterButton"
|
|
136
|
-
[showAudioStreamFooterButton]="g?.showAudioStreamFooterButton"
|
|
137
135
|
[hideTextAreaContent]="(g?.singleConversation && hideTextAreaContent) || (isConversationArchived && !g?.allowReopen)"
|
|
138
136
|
[isConversationArchived]="isConversationArchived"
|
|
139
137
|
[hideTextReply]="hideFooterTextReply"
|
|
140
138
|
[isMobile]="g?.isMobile"
|
|
141
139
|
[isEmojiiPickerShow]="isEmojiiPickerShow"
|
|
142
140
|
[footerMessagePlaceholder]="footerMessagePlaceholder"
|
|
143
|
-
[closeChatInConversation]="g?.closeChatInConversation"
|
|
144
141
|
[fileUploadAccept]="g?.fileUploadAccept"
|
|
145
142
|
[dropEvent]="dropEvent"
|
|
146
143
|
[poweredBy]="g?.poweredBy"
|
|
@@ -151,9 +148,7 @@
|
|
|
151
148
|
(onAfterSendMessage)="onAfterSendMessageFN($event)"
|
|
152
149
|
(onChangeTextArea)="onChangeTextArea($event)"
|
|
153
150
|
(onAttachmentFileButtonClicked)="onAttachmentFileButtonClicked($event)"
|
|
154
|
-
(onNewConversationButtonClicked)="onNewConversationButtonClickedFN($event)"
|
|
155
|
-
(onStreamAudioActiveChange)="onStreamAudioActiveChange($event)"
|
|
156
|
-
(onCloseChatButtonClicked)="onCloseChatButtonClickedFN($event)">
|
|
151
|
+
(onNewConversationButtonClicked)="onNewConversationButtonClickedFN($event)">
|
|
157
152
|
</chat-conversation-footer>
|
|
158
153
|
|
|
159
154
|
</div>
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
#dropZone_container{
|
|
138
138
|
position: absolute;
|
|
139
139
|
top: 52px;
|
|
140
|
-
bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height)
|
|
140
|
+
bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height));
|
|
141
141
|
left: 0;
|
|
142
142
|
right: 0;
|
|
143
143
|
background-color: rgba(240,248,255,0.6);
|
|
@@ -240,7 +240,7 @@ dialog:-internal-dialog-in-top-layer{
|
|
|
240
240
|
|
|
241
241
|
|
|
242
242
|
::ng-deep .chat21-sheet-content{
|
|
243
|
-
bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height) +
|
|
243
|
+
bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height) + 34px)!important;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
}
|
|
@@ -161,10 +161,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
161
161
|
membersConversation = ['SYSTEM'];
|
|
162
162
|
// ========== end:: typying =======
|
|
163
163
|
|
|
164
|
-
// ========== begin:: stream audio ======= //
|
|
165
|
-
public isStreamAudioActive = false;
|
|
166
|
-
// ========== end:: stream audio ======= //
|
|
167
|
-
|
|
168
164
|
@ViewChild(ConversationFooterComponent) conversationFooter: ConversationFooterComponent
|
|
169
165
|
@ViewChild(ConversationContentComponent) conversationContent: ConversationContentComponent
|
|
170
166
|
conversationHandlerService: ConversationHandlerService
|
|
@@ -250,8 +246,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
250
246
|
'CONTINUE',
|
|
251
247
|
'EMOJI_NOT_ELLOWED',
|
|
252
248
|
'ATTACHMENT',
|
|
253
|
-
'EMOJI'
|
|
254
|
-
'CLOSE_CHAT'
|
|
249
|
+
'EMOJI'
|
|
255
250
|
];
|
|
256
251
|
|
|
257
252
|
const keysContent = [
|
|
@@ -506,7 +501,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
506
501
|
return this.isConversationArchived;
|
|
507
502
|
}
|
|
508
503
|
|
|
509
|
-
//
|
|
504
|
+
//FALLBACK TO TILEDESK
|
|
510
505
|
const requests_list = await this.tiledeskRequestService.getMyRequests().catch(err => {
|
|
511
506
|
this.logger.error('[CONV-COMP] getConversationDetail: error getting request from Tiledesk', err);
|
|
512
507
|
this.isConversationArchived=true
|
|
@@ -524,9 +519,9 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
524
519
|
return this.isConversationArchived
|
|
525
520
|
}
|
|
526
521
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
522
|
+
this.isConversationArchived = true;
|
|
523
|
+
return null;
|
|
524
|
+
}
|
|
530
525
|
|
|
531
526
|
/**
|
|
532
527
|
* this.g.recipientId:
|
|
@@ -882,20 +877,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
882
877
|
this.subscriptions.push(subscribe);
|
|
883
878
|
}
|
|
884
879
|
|
|
885
|
-
subscribtionKey = 'conversationsAdded';
|
|
886
|
-
subscribtion = this.subscriptions.find(item => item.key === subscribtionKey);
|
|
887
|
-
if(!subscribtion){
|
|
888
|
-
|
|
889
|
-
subscribtion = this.chatManager.conversationsHandlerService.conversationChanged.pipe(takeUntil(this.unsubscribe$)).subscribe((conversation) => {
|
|
890
|
-
this.logger.debug('[CONV-COMP] ***** DATAIL conversationsChanged *****', conversation, this.conversationWith, this.isConversationArchived);
|
|
891
|
-
if(conversation && conversation.recipient === this.conversationId){
|
|
892
|
-
this.isConversationArchived = false
|
|
893
|
-
}
|
|
894
|
-
});
|
|
895
|
-
const subscribe = {key: subscribtionKey, value: subscribtion };
|
|
896
|
-
this.subscriptions.push(subscribe);
|
|
897
|
-
}
|
|
898
|
-
|
|
899
880
|
subscribtionKey = 'messageWait';
|
|
900
881
|
subscribtion = this.subscriptions.find(item => item.key === subscribtionKey);
|
|
901
882
|
if (!subscribtion) {
|
|
@@ -1402,16 +1383,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
1402
1383
|
this.logger.debug('[CONV-COMP] floating onNewConversationButtonClicked')
|
|
1403
1384
|
this.onNewConversationButtonClicked.emit()
|
|
1404
1385
|
}
|
|
1405
|
-
|
|
1406
|
-
/** CALLED BY: conv-footer streaming audio button */
|
|
1407
|
-
onStreamAudioActiveChange(event: boolean){
|
|
1408
|
-
this.isStreamAudioActive = event
|
|
1409
|
-
}
|
|
1410
|
-
/** CALLED BY: conv-footer component */
|
|
1411
|
-
onCloseChatButtonClickedFN(event){
|
|
1412
|
-
this.logger.debug('[CONV-COMP] onCloseChatButtonClicked::::', event)
|
|
1413
|
-
this.onCloseChat()
|
|
1414
|
-
}
|
|
1415
1386
|
// =========== END: event emitter function ====== //
|
|
1416
1387
|
|
|
1417
1388
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<div *ngFor="let message of messages; let first = first; let last = last; let i = index" tabindex="1521" class="rowMsg">
|
|
23
23
|
|
|
24
24
|
<!-- message SENDER:: -->
|
|
25
|
-
<div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_MINE, message)
|
|
25
|
+
<div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_MINE, message)" class="msg_container base_sent">
|
|
26
26
|
|
|
27
27
|
<!--backgroundColor non viene ancora usato -->
|
|
28
28
|
<!-- class="messages msg_sent slide-in-right" -->
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
top: 0;
|
|
45
45
|
right: 0;
|
|
46
46
|
left: 0;
|
|
47
|
-
bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height)
|
|
47
|
+
bottom: calc(var(--chat-footer-logo-height) + var(--chat-footer-height));
|
|
48
48
|
overflow: hidden;
|
|
49
49
|
.time{
|
|
50
50
|
margin-bottom: 20px;
|
package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts
CHANGED
|
@@ -26,7 +26,6 @@ export class ConversationContentComponent implements OnInit {
|
|
|
26
26
|
@Input() showThinkingMessage: boolean;
|
|
27
27
|
@Input() lastServerSenderKind: 'bot' | 'human' | null;
|
|
28
28
|
@Input() fullscreenMode: boolean;
|
|
29
|
-
@Input() isStreamAudioActive: boolean;
|
|
30
29
|
@Input() translationMap: Map< string, string>;
|
|
31
30
|
@Input() stylesMap: Map<string, string>;
|
|
32
31
|
@Output() onBeforeMessageRender = new EventEmitter();
|