@chat21/chat21-web-widget 5.1.34-rc1 → 5.1.34
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 +8 -129
- package/Dockerfile +5 -4
- package/angular.json +3 -21
- package/docs/changelog/this-branch.md +0 -36
- package/env.sample +2 -3
- package/nginx.conf +2 -22
- package/package.json +3 -10
- package/src/app/app.component.html +2 -2
- package/src/app/app.component.scss +14 -25
- package/src/app/app.component.spec.ts +6 -21
- package/src/app/app.component.ts +9 -10
- package/src/app/app.module.ts +0 -13
- package/src/app/component/conversation-detail/conversation/conversation.component.html +11 -25
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +2 -40
- package/src/app/component/conversation-detail/conversation/conversation.component.spec.ts +75 -644
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +14 -100
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +13 -25
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.spec.ts +5 -123
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +0 -1
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +10 -23
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +1 -19
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +149 -242
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +5 -8
- package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.spec.ts +3 -53
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +96 -200
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +6 -211
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.spec.ts +78 -452
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +76 -291
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +53 -113
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +4 -12
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.spec.ts +29 -274
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.html +9 -23
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.spec.ts +8 -80
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.html +23 -29
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.spec.ts +16 -185
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +14 -34
- package/src/app/component/error-alert/error-alert.component.spec.ts +5 -65
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.html +7 -16
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +0 -21
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.spec.ts +7 -89
- package/src/app/component/form/form-builder/form-builder.component.html +1 -1
- package/src/app/component/form/form-builder/form-builder.component.spec.ts +21 -163
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.html +4 -8
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.scss +5 -10
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.spec.ts +16 -90
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +0 -26
- package/src/app/component/form/inputs/form-label/form-label.component.spec.ts +11 -45
- package/src/app/component/form/inputs/form-radio-button/form-radio-button.component.spec.ts +6 -24
- package/src/app/component/form/inputs/form-select/form-select.component.spec.ts +5 -14
- package/src/app/component/form/inputs/form-text/form-text.component.html +12 -14
- package/src/app/component/form/inputs/form-text/form-text.component.scss +1 -11
- package/src/app/component/form/inputs/form-text/form-text.component.spec.ts +17 -113
- package/src/app/component/form/inputs/form-text/form-text.component.ts +3 -35
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +11 -13
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +5 -6
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.spec.ts +13 -149
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +0 -26
- package/src/app/component/form/prechat-form/prechat-form.component.html +11 -14
- package/src/app/component/form/prechat-form/prechat-form.component.spec.ts +10 -102
- package/src/app/component/form/prechat-form/prechat-form.component.ts +1 -8
- package/src/app/component/home/home.component.html +31 -38
- package/src/app/component/home/home.component.scss +2 -4
- package/src/app/component/home/home.component.spec.ts +11 -226
- package/src/app/component/home-conversations/home-conversations.component.html +26 -30
- package/src/app/component/home-conversations/home-conversations.component.scss +0 -3
- package/src/app/component/home-conversations/home-conversations.component.spec.ts +36 -212
- package/src/app/component/last-message/last-message.component.html +9 -15
- package/src/app/component/last-message/last-message.component.scss +2 -16
- package/src/app/component/last-message/last-message.component.spec.ts +23 -204
- package/src/app/component/last-message/last-message.component.ts +1 -4
- package/src/app/component/launcher-button/launcher-button.component.html +13 -8
- package/src/app/component/launcher-button/launcher-button.component.spec.ts +8 -104
- package/src/app/component/list-all-conversations/list-all-conversations.component.html +17 -12
- package/src/app/component/list-all-conversations/list-all-conversations.component.scss +0 -2
- package/src/app/component/list-conversations/list-conversations.component.html +22 -22
- package/src/app/component/menu-options/menu-options.component.html +20 -30
- package/src/app/component/menu-options/menu-options.component.spec.ts +9 -125
- package/src/app/component/message/audio/audio.component.html +15 -13
- package/src/app/component/message/audio/audio.component.spec.ts +5 -140
- package/src/app/component/message/audio/audio.component.ts +5 -1
- package/src/app/component/message/avatar/avatar.component.html +2 -2
- package/src/app/component/message/avatar/avatar.component.spec.ts +7 -99
- package/src/app/component/message/bubble-message/bubble-message.component.html +51 -38
- package/src/app/component/message/bubble-message/bubble-message.component.scss +1 -54
- package/src/app/component/message/bubble-message/bubble-message.component.spec.ts +57 -154
- package/src/app/component/message/bubble-message/bubble-message.component.ts +11 -89
- package/src/app/component/message/buttons/action-button/action-button.component.html +4 -3
- package/src/app/component/message/buttons/action-button/action-button.component.spec.ts +5 -49
- package/src/app/component/message/buttons/link-button/link-button.component.scss +8 -5
- package/src/app/component/message/buttons/link-button/link-button.component.spec.ts +5 -50
- package/src/app/component/message/buttons/text-button/text-button.component.spec.ts +5 -44
- package/src/app/component/message/carousel/carousel.component.html +16 -29
- package/src/app/component/message/carousel/carousel.component.scss +8 -20
- package/src/app/component/message/carousel/carousel.component.spec.ts +3 -80
- package/src/app/component/message/carousel/carousel.component.ts +0 -16
- package/src/app/component/message/frame/frame.component.html +4 -9
- package/src/app/component/message/frame/frame.component.spec.ts +15 -34
- package/src/app/component/message/frame/frame.component.ts +2 -7
- package/src/app/component/message/html/html.component.html +1 -1
- package/src/app/component/message/html/html.component.scss +1 -1
- package/src/app/component/message/html/html.component.spec.ts +7 -24
- package/src/app/component/message/image/image.component.html +10 -12
- package/src/app/component/message/image/image.component.scss +0 -16
- package/src/app/component/message/image/image.component.spec.ts +15 -101
- package/src/app/component/message/image/image.component.ts +51 -90
- package/src/app/component/message/info-message/info-message.component.spec.ts +14 -26
- package/src/app/component/message/like-unlike/like-unlike.component.html +9 -7
- package/src/app/component/message/like-unlike/like-unlike.component.spec.ts +3 -31
- package/src/app/component/message/return-receipt/return-receipt.component.spec.ts +17 -38
- package/src/app/component/message/text/text.component.html +3 -3
- package/src/app/component/message/text/text.component.scss +86 -80
- package/src/app/component/message/text/text.component.spec.ts +13 -106
- package/src/app/component/message-attachment/message-attachment.component.spec.ts +13 -134
- package/src/app/component/selection-department/selection-department.component.html +23 -21
- package/src/app/component/selection-department/selection-department.component.spec.ts +14 -159
- package/src/app/component/selection-department/selection-department.component.ts +1 -8
- package/src/app/component/send-button/send-button.component.html +13 -5
- package/src/app/component/send-button/send-button.component.spec.ts +2 -2
- package/src/app/component/star-rating-widget/star-rating-widget.component.html +81 -51
- package/src/app/directives/tooltip.directive.spec.ts +4 -8
- package/src/app/modals/confirm-close/confirm-close.component.html +8 -20
- package/src/app/modals/confirm-close/confirm-close.component.scss +0 -3
- package/src/app/modals/confirm-close/confirm-close.component.spec.ts +4 -13
- package/src/app/modals/confirm-close/confirm-close.component.ts +1 -8
- package/src/app/pipe/html-entites-encode.pipe.spec.ts +2 -35
- package/src/app/pipe/marked.pipe.spec.ts +2 -38
- package/src/app/pipe/marked.pipe.ts +41 -51
- package/src/app/providers/app-config.service.ts +2 -4
- package/src/app/providers/brand.service.spec.ts +2 -23
- package/src/app/providers/brand.service.ts +1 -1
- package/src/app/providers/global-settings.service.spec.ts +14 -1009
- package/src/app/providers/global-settings.service.ts +2 -82
- package/src/app/providers/translator.service.ts +6 -26
- package/src/app/sass/_variables.scss +0 -3
- package/src/app/sass/animations.scss +1 -19
- package/src/app/utils/globals.ts +1 -21
- package/src/app/utils/utils-resources.ts +1 -1
- package/src/assets/i18n/en.json +99 -106
- package/src/assets/i18n/es.json +100 -107
- package/src/assets/i18n/fr.json +100 -107
- package/src/assets/i18n/it.json +98 -107
- package/src/assets/twp/index-dev.html +0 -18
- 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/scripts/script.service.spec.ts +2 -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/widget-config-template.json +1 -4
- package/src/widget-config.json +1 -4
- package/tsconfig.json +0 -5
- package/.angular-mcp-cache/package.json +0 -1
- package/.cursor/angular18-accessibility-auditor-skill.md +0 -442
- package/.cursor/mcp.json +0 -15
- package/.github/workflows/build.yml +0 -22
- package/.github/workflows/playwright.yml +0 -27
- package/mocks/voice-websocket-mock/server.cjs +0 -245
- package/playwright.config.ts +0 -41
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.html +0 -46
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.scss +0 -83
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.ts +0 -192
- package/src/app/component/form/prechat-form-test-mock.ts +0 -35
- package/src/app/component/message/audio-sync/audio-sync.component.html +0 -18
- 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 -103
- package/src/app/component/message/audio-sync/audio-sync.component.ts +0 -643
- package/src/app/providers/tts-audio-playback-coordinator.service.spec.ts +0 -117
- package/src/app/providers/tts-audio-playback-coordinator.service.ts +0 -109
- 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 -40
- 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-streaming.service.spec.ts +0 -23
- package/src/app/providers/voice/voice-streaming.service.ts +0 -702
- package/src/app/providers/voice/voice-streaming.types.ts +0 -112
- package/src/app/providers/voice/voice.service.spec.ts +0 -227
- package/src/app/providers/voice/voice.service.ts +0 -973
- 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/sounds/keyboard.mp3 +0 -0
- package/src/assets/twp/tiledesk_widget_files/widget-css-override-example.css +0 -14
- package/src/assets/vad/silero_vad_legacy.onnx +0 -0
- package/src/assets/vad/vad.worklet.bundle.min.js +0 -1
- package/src/chat21-core/providers/chat-manager.spec.ts +0 -72
- package/tests/widget-form-rich.spec.ts +0 -67
- package/tests/widget-index-dev-settings.spec.ts +0 -52
- package/tests/widget-twp-iframe.spec.ts +0 -39
|
@@ -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,122 +6,20 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
+
# 5.1.34
|
|
10
|
+
- **bug fixed**: if last message is ulr_preview shows previous message buttons
|
|
9
11
|
|
|
10
|
-
# 5.1.
|
|
11
|
-
- **
|
|
12
|
+
# 5.1.33
|
|
13
|
+
- **bug fixed**: widget not loaded because blob block loading in lauch.js
|
|
12
14
|
|
|
13
|
-
# 5.1.
|
|
14
|
-
- **bug
|
|
15
|
-
|
|
16
|
-
# 5.1.33-rc11
|
|
17
|
-
- **changed**: **Stream audio** — updated the streaming/voice-mode footer icon.
|
|
18
|
-
- **added**: **Stream audio** — tooltip on the stream button (i18n key `STREAM_AUDIO`, e.g. “Use voice mode”) via SVG `<title>` and `aria-label`.
|
|
19
|
-
|
|
20
|
-
# 5.1.33-rc10
|
|
21
|
-
- **bug-fixed**: fixed bug with knowledge base json sources without URLs
|
|
22
|
-
|
|
23
|
-
# 5.1.33-rc9
|
|
24
|
-
- **changed**: **Conversation footer** — accessibility-focused markup (ARIA roles/labels, live regions, semantic send control), stream-audio layout (wrapper + voice mode: hide attach/emoji while streaming, inline status, stream button + spectrum), optional **Close chat** action when `closeChatInConversation` is enabled; emoji restriction alert uses assertive live region semantics.
|
|
25
|
-
- **bug-fixed**: **`getConversationDetail` Tiledesk fallback** — when `getMyRequests()` rejects, the conversation is treated as archived (`isConversationArchived = true`) and the handler returns immediately instead of resetting state from an empty fallback payload.
|
|
26
|
-
- **bug-fixed**: **`VoiceService`** — skip Web Audio `createMediaStreamSource` when the `MediaStream` has no audio tracks (avoids `InvalidStateError` under mocked `getUserMedia` in unit tests and edge browsers).
|
|
27
|
-
- **bug-fixed**: **`TtsAudioPlaybackCoordinator`** — avoid emitting a duplicate `isTTSPlaying$` `true` when preempting an already-playing owner (keeps emission sequence stable for consumers).
|
|
28
|
-
- **bug-fixed**: **Unit tests** — aligned `BubbleMessageComponent` specs with `calcImageSize` + DI mocks; `AudioSyncComponent` spec module setup (`declarations` + `CommonModule`) and TTS streaming call expectations; `VoiceService` specs with realistic mic streams and updated expectations for proxy `listening` / `barge_in` (no `setAudioMuted` on those paths); `TtsAudioPlaybackCoordinator` `stopAll` test asserts `_stopAll$` broadcast via spy; `ConversationComponent` spec for Tiledesk error path.
|
|
29
|
-
|
|
30
|
-
# 5.1.33-rc7
|
|
31
|
-
- **added**: added more URL source types in kb_json_sources
|
|
32
|
-
|
|
33
|
-
# 5.1.33-rc5
|
|
34
|
-
- **added**: cssSource tiledeskSettings property to manage and override widget style
|
|
35
|
-
|
|
36
|
-
# 5.1.33-rc4
|
|
37
|
-
- **bug fixed**: bug fixed extractUrlsFromText
|
|
38
|
-
|
|
39
|
-
# 5.1.32-rc18
|
|
40
|
-
- **bug fixed**: bug fix css kb_json_sources
|
|
41
|
-
|
|
42
|
-
# 5.1.32-rc17
|
|
43
|
-
- **bug fixed**: empty message in preview URLs
|
|
44
|
-
|
|
45
|
-
# 5.1.32-rc16
|
|
46
|
-
- **added**: added chat-json-sources to preview URLs
|
|
47
|
-
|
|
48
|
-
# 5.1.32-rc15
|
|
49
|
-
- **changed**: redemptionMs: 800
|
|
50
|
-
|
|
51
|
-
# 5.1.32-rc14
|
|
52
|
-
- **changed**: minor ui fixed
|
|
53
|
-
|
|
54
|
-
# 5.1.32-rc13
|
|
55
|
-
- **added**: VAD speech state events (`speechStart$`, `speechEnd$`) to improve UI/state transitions around user speech
|
|
56
|
-
- **changed**: stream audio footer UI — stream button expands into a “Terminate” pill with animated level bars driven by mic intensity; recorder icon hidden while streaming; textarea width adjusted while streaming
|
|
57
|
-
- **changed**: `StreamAudioSpectrum` — consolidated stream spectrum + stream button visuals into a single component with improved silence vs speaking handling and volume-driven bar heights
|
|
58
|
-
- **changed**: conversation layout while streaming — adjusted received bubble sizing (`fullSizeMessage`) and loading spinner spacing (`fullSize`) for full-width stream mode
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# 5.1.32-rc12
|
|
63
|
-
- **changed**: voice acquisition blocking during TTS response — pause VAD after user speech ends until the TTS response cycle completes; added safety timeout and `isAcquisitionBlocked$` to drive UI (e.g. greyed spectrum)
|
|
64
|
-
- **chore**: version bump to `5.1.32-rc12`
|
|
65
|
-
|
|
66
|
-
# 5.1.32-rc11
|
|
67
|
-
- **added**: global TTS stop — `TtsAudioPlaybackCoordinator.stopAll()` + `stopAllPlayback$` to abort current and queued TTS playback and reveal full message text
|
|
68
|
-
- **changed**: stop TTS playback when closing stream audio
|
|
69
|
-
- **chore**: version bump to `5.1.32-rc11`
|
|
70
|
-
|
|
71
|
-
# 5.1.32-rc10
|
|
72
|
-
- **added**: TTS playback state (`isTTSPlaying$`) to coordinate voice UI and suppress mic segment emission while the bot is speaking
|
|
73
|
-
- **changed**: stream spectrum theme color turns grey while TTS is playing
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
# 5.1.32-rc9
|
|
77
|
-
- **added**: mic-triggered TTS interruption — when VAD detects user speech, stop current TTS playback, clear the queue, and reveal the full message text
|
|
78
|
-
- **added**: global TTS stop API (`TtsAudioPlaybackCoordinator.stopAll()` + `stopAllPlayback$`) to stop current + queued TTS playback from UI/events (e.g. close stream)
|
|
79
|
-
- **changed**: `chat-audio-sync` TTS playback now streams audio via authenticated POST to `message.metadata.src`, sending `voiceSettings` + `text` and `streaming: true`
|
|
80
|
-
- **changed**: stream UI spectrum — removed circular orb and stretched the spectrum line to fill the `#streamAudioAlert` width with 10px side padding
|
|
81
|
-
- **changed**: conversation content layout while streaming — adjusted received bubble left margin and loading spinner margins for full-size mode
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
# 5.1.32-rc8
|
|
85
|
-
- **changed**: updated the dev environment defaults to align with the stage setup (remote config URL, API endpoints, logging level, storage prefix, and related settings)
|
|
86
|
-
|
|
87
|
-
# 5.1.32-rc7
|
|
88
|
-
- **added**: `StreamAudioSpectrum` component for audio visualization in the streaming footer UI
|
|
89
|
-
- **added**: TTS playback coordinator queue — ensures TTS messages play sequentially without interrupting the previous one
|
|
90
|
-
- **changed**: `chat-audio-sync` — updated TTS audio handling to support streaming playback and improved autoplay/animation timing
|
|
91
|
-
- **changed**: iframe loader (`launch.js`, `launch_template.js`) — streamlined loading logic and improved error handling, with fixes for localhost environments
|
|
92
|
-
|
|
93
|
-
# 5.1.32-rc4
|
|
94
|
-
- **added**: “Close stream” control (`.close-stream-button`) — content and sheet bottom offset in fullscreen using `--chat-footer-stream-button-height` only while the stream is listening (`isStreamAudioActive`); variables in `_variables.scss`.
|
|
95
|
-
- **added**: `VoiceService.discardCurrentRecordingSegment()` — when a message arrives from another sender during streaming, the current WebM segment is discarded (no upload) without stopping mic/VAD; `interruptStreamDueToPeerMessage()` in the footer no longer clears `isStreamAudioActive`.
|
|
96
|
-
- **changed**: `#streamAudioAlert` — band above the footer with a frosted-glass look (`backdrop-filter`, semi-transparent `color-mix`).
|
|
97
|
-
|
|
98
|
-
# 5.1.32-rc3
|
|
99
|
-
- **changed**: `nginx.conf` (Docker image) — explicit MIME types for `.mjs`, `.wasm`, `.onnx` and `default_type` at `http` level (avoids `text/plain` on ONNX/VAD modules behind containerized deploys).
|
|
100
|
-
- **chore**: removed deprecated Amazon beta/prod deploy scripts from the repository.
|
|
101
|
-
|
|
102
|
-
# 5.1.32-rc2
|
|
103
|
-
- **bug fixed**: minor streaming icon UI fixed
|
|
104
|
-
- **changed**: Refactor stream audio button UI in the conversation footer (layout / classes).
|
|
105
|
-
|
|
106
|
-
# 5.1.32-rc1
|
|
107
|
-
- **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.
|
|
108
|
-
- **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.
|
|
109
|
-
- **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.
|
|
110
|
-
- **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.
|
|
111
|
-
- **bug fixed**: `AnalyserNode.getByteFrequencyData` TypeScript error — `Uint8Array` created from an explicit `ArrayBuffer` for correct DOM typings.
|
|
112
|
-
- **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.
|
|
15
|
+
# 5.1.31
|
|
16
|
+
- **bug fixed**: bug fix disabled user-typing with human and user-typing with human is not available
|
|
113
17
|
|
|
114
18
|
# 5.1.30
|
|
115
19
|
- **bug fixed**: startHidden is not working properly
|
|
116
20
|
|
|
117
|
-
# 5.1.
|
|
118
|
-
- **bug fixed**:
|
|
119
|
-
|
|
120
|
-
# 5.1.30-rc2
|
|
121
|
-
- **bug fixed**: bug fix disabled user-typing with human
|
|
122
|
-
|
|
123
|
-
# 5.1.30-rc1
|
|
124
|
-
- **bug fixed**: startHidden is not working properly
|
|
21
|
+
# 5.1.28
|
|
22
|
+
- **bug fixed**: header option menu is deactivated on mobile
|
|
125
23
|
|
|
126
24
|
# 5.1.28
|
|
127
25
|
- **bug fixed**: fixed Bot/Human conversation detection by correctly classifying bot replies
|
|
@@ -133,22 +31,8 @@
|
|
|
133
31
|
- **changed**: Set the default autoStart value to false
|
|
134
32
|
- **added**: Added the open widget loading spinner
|
|
135
33
|
- **changed**: Load the widget without authentication and display the speech bubble
|
|
136
|
-
|
|
137
|
-
# 5.1.27-rc3
|
|
138
|
-
- **bug fixed**: fixed Bot/Human conversation detection by correctly classifying bot replies
|
|
139
|
-
|
|
140
|
-
# 5.1.27-rc2
|
|
141
|
-
- **bug fixed**: centralized fullscreen management on mobile and handled the case of the closed widget that remained fullscreen
|
|
142
|
-
|
|
143
|
-
# 5.1.27-rc1
|
|
144
|
-
- **added**: closeChatInConversation parameters
|
|
145
|
-
- **added**: close chat button under textarea footer component
|
|
146
|
-
|
|
147
|
-
# 5.1.26-rc6
|
|
148
34
|
- **changed**: mobile always opens fullscreen and ignores legacy stored size”.
|
|
149
35
|
- **changed**: changed user-typing
|
|
150
|
-
|
|
151
|
-
# 5.1.26-rc5
|
|
152
36
|
- **changed**: Hide the resize-widget button when on mobile
|
|
153
37
|
- **added**: added "I'm thinking" when the bot responds
|
|
154
38
|
|
|
@@ -210,11 +94,6 @@
|
|
|
210
94
|
- **bug-fixed**: check showEmojiFooterButton to enable/disable emojii
|
|
211
95
|
- **bug-fixed**: markdown is fired as an emojii and blocked by isEmojii check fn
|
|
212
96
|
|
|
213
|
-
# 5.1.7-rc7
|
|
214
|
-
- **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
|
|
215
|
-
|
|
216
|
-
# 5.1.7-rc6
|
|
217
|
-
- **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
|
|
218
97
|
|
|
219
98
|
# 5.1.7-rc5
|
|
220
99
|
- **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
|
@@ -61,9 +61,7 @@
|
|
|
61
61
|
"idb",
|
|
62
62
|
"accept-language-parser",
|
|
63
63
|
"file-saver",
|
|
64
|
-
"dayjs"
|
|
65
|
-
"onnxruntime-web",
|
|
66
|
-
"@ricky0123/vad-web"
|
|
64
|
+
"dayjs"
|
|
67
65
|
],
|
|
68
66
|
"sourceMap": true,
|
|
69
67
|
"optimization": false,
|
|
@@ -162,19 +160,7 @@
|
|
|
162
160
|
"src/styles.scss"
|
|
163
161
|
],
|
|
164
162
|
"scripts": [],
|
|
165
|
-
"codeCoverage": true
|
|
166
|
-
"codeCoverageExclude": [
|
|
167
|
-
"src/chat21-core/providers/firebase/**/*.ts",
|
|
168
|
-
"src/chat21-core/providers/mqtt/**/*.ts",
|
|
169
|
-
"src/main.ts",
|
|
170
|
-
"src/polyfills.ts",
|
|
171
|
-
"src/zone-flag.ts",
|
|
172
|
-
"src/models/**/*.ts",
|
|
173
|
-
"src/chat21-core/models/**/*.ts",
|
|
174
|
-
"src/chat21-core/providers/native/**/*.ts",
|
|
175
|
-
"src/chat21-core/providers/logger/customLogger.ts",
|
|
176
|
-
"src/chat21-core/providers/logger/loggerInstance.ts"
|
|
177
|
-
]
|
|
163
|
+
"codeCoverage": true
|
|
178
164
|
}
|
|
179
165
|
},
|
|
180
166
|
"e2e": {
|
|
@@ -196,9 +182,5 @@
|
|
|
196
182
|
"defaultConfiguration": "development"
|
|
197
183
|
}
|
|
198
184
|
}
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
"cli": {
|
|
202
|
-
"analytics": false
|
|
203
|
-
}
|
|
185
|
+
}}
|
|
204
186
|
}
|
|
@@ -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/env.sample
CHANGED
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.34
|
|
4
|
+
"version": "5.1.34",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.tiledesk.com",
|
|
7
7
|
"repository": {
|
|
@@ -10,15 +10,12 @@
|
|
|
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",
|
|
17
|
-
"test:e2e": "playwright test",
|
|
18
16
|
"lint": "ng lint",
|
|
19
17
|
"e2e": "ng e2e",
|
|
20
|
-
"source-map-explorer": "source-map-explorer dist/*.js"
|
|
21
|
-
"voice-mock": "node mocks/voice-websocket-mock/server.cjs"
|
|
18
|
+
"source-map-explorer": "source-map-explorer dist/*.js"
|
|
22
19
|
},
|
|
23
20
|
"private": false,
|
|
24
21
|
"dependencies": {
|
|
@@ -35,7 +32,6 @@
|
|
|
35
32
|
"@ctrl/ngx-emoji-mart": "^9.2.0",
|
|
36
33
|
"@ngx-translate/core": "^16.0.4",
|
|
37
34
|
"@ngx-translate/http-loader": "^16.0.1",
|
|
38
|
-
"@ricky0123/vad-web": "^0.0.30",
|
|
39
35
|
"accept-language-parser": "^1.5.0",
|
|
40
36
|
"bootstrap": "^5.1.3",
|
|
41
37
|
"dayjs": "^1.11.7",
|
|
@@ -44,7 +40,6 @@
|
|
|
44
40
|
"humanize-duration-ts": "^2.1.1",
|
|
45
41
|
"marked": "^16.3.0",
|
|
46
42
|
"ngx-logger": "^5.0.11",
|
|
47
|
-
"onnxruntime-web": "^1.24.3",
|
|
48
43
|
"replace": "^1.2.2",
|
|
49
44
|
"rxjs": "^7.8.2",
|
|
50
45
|
"source-map-explorer": "^2.5.3",
|
|
@@ -57,7 +52,6 @@
|
|
|
57
52
|
"@angular/cli": "^18.2.19",
|
|
58
53
|
"@angular/compiler-cli": "^18.2.13",
|
|
59
54
|
"@angular/language-service": "^18.2.13",
|
|
60
|
-
"@playwright/test": "^1.59.1",
|
|
61
55
|
"@types/jasmine": "^3.6.11",
|
|
62
56
|
"@types/jasminewd2": "~2.0.3",
|
|
63
57
|
"@types/marked": "^6.0.0",
|
|
@@ -74,7 +68,6 @@
|
|
|
74
68
|
"protractor": "~7.0.0",
|
|
75
69
|
"ts-node": "~7.0.0",
|
|
76
70
|
"tslint": "~6.1.0",
|
|
77
|
-
"typescript": "~5.4"
|
|
78
|
-
"ws": "^8.18.0"
|
|
71
|
+
"typescript": "~5.4"
|
|
79
72
|
}
|
|
80
73
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
<div id="tiledesk-container" [class.active]="g.isShown">
|
|
1
|
+
|
|
2
|
+
<div id="tiledesk-container" [class.active]="g.isShown" tabindex="9999">
|
|
3
3
|
|
|
4
4
|
<div id="chat21-conversations"
|
|
5
5
|
[ngClass]="{ 'swing-in-bottom-fwd' : g.isOpen === true, 'full-screen-mode' : g.fullscreenMode === true, 'c21-align-left' : g.align === 'left', 'c21-align-right' : g.align !== 'left'}"
|
|
@@ -50,18 +50,8 @@ body {
|
|
|
50
50
|
margin:0px;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
outline: none;
|
|
56
|
-
}
|
|
57
|
-
chat-root *:focus-visible {
|
|
58
|
-
outline: 2px solid var(--c21-focus-ring, #1a73e8);
|
|
59
|
-
outline-offset: 2px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
::-moz-focus-inner {
|
|
63
|
-
border: 0;
|
|
64
|
-
}
|
|
53
|
+
:focus {outline: none !important;}
|
|
54
|
+
::-moz-focus-inner {border:0;}
|
|
65
55
|
|
|
66
56
|
|
|
67
57
|
|
|
@@ -252,7 +242,10 @@ chat-root {
|
|
|
252
242
|
height: 100%;
|
|
253
243
|
|
|
254
244
|
// ========= BEGIN: RESET CSS TAG ========= //
|
|
255
|
-
|
|
245
|
+
*:focus {
|
|
246
|
+
outline: none;
|
|
247
|
+
}
|
|
248
|
+
button{
|
|
256
249
|
cursor: pointer;
|
|
257
250
|
}
|
|
258
251
|
|
|
@@ -262,19 +255,14 @@ chat-root {
|
|
|
262
255
|
|
|
263
256
|
textarea,
|
|
264
257
|
textarea:visited,
|
|
258
|
+
textarea:focus,
|
|
265
259
|
textarea:hover,
|
|
266
|
-
textarea:active
|
|
260
|
+
textarea:active{
|
|
261
|
+
// all: unset;
|
|
267
262
|
line-height: 20px!important;
|
|
268
|
-
box-shadow: none!important;
|
|
269
|
-
border: 0px solid var(--trasp-light-black)!important;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
textarea:focus:not(:focus-visible) {
|
|
273
263
|
outline: none!important;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
textarea:focus-visible {
|
|
277
|
-
outline: 0px !important;
|
|
264
|
+
box-shadow:none!important;
|
|
265
|
+
border: 0px solid var(--trasp-light-black)!important;
|
|
278
266
|
}
|
|
279
267
|
|
|
280
268
|
// ========= BEGIN: CSS APP.COMPONENT ========= //
|
|
@@ -415,7 +403,7 @@ chat-root {
|
|
|
415
403
|
}
|
|
416
404
|
}
|
|
417
405
|
button.c21-button-primary:hover,
|
|
418
|
-
button.c21-button-primary:focus
|
|
406
|
+
button.c21-button-primary:focus,
|
|
419
407
|
button.c21-button-primary:active {
|
|
420
408
|
//outline-width: 0px;
|
|
421
409
|
opacity: 0.8;
|
|
@@ -431,9 +419,10 @@ chat-root {
|
|
|
431
419
|
cursor: pointer;
|
|
432
420
|
}
|
|
433
421
|
button.c21-button-link:hover,
|
|
434
|
-
button.c21-button-link:focus
|
|
422
|
+
button.c21-button-link:focus,
|
|
435
423
|
button.c21-button-link:active {
|
|
436
424
|
text-decoration: underline;
|
|
425
|
+
outline: none;
|
|
437
426
|
}
|
|
438
427
|
|
|
439
428
|
.c21-divBudge {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
2
1
|
import { Triggerhandler } from './../chat21-core/utils/triggerHandler';
|
|
3
2
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
4
3
|
import { RouterTestingModule } from '@angular/router/testing';
|
|
@@ -21,32 +20,25 @@ import { PresenceService } from 'src/chat21-core/providers/abstract/presence.ser
|
|
|
21
20
|
import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
|
|
22
21
|
import { AppConfigService } from './providers/app-config.service';
|
|
23
22
|
import { ChatManager } from 'src/chat21-core/providers/chat-manager';
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
import { NGXLogger } from 'ngx-logger';
|
|
27
24
|
import { CustomLogger } from 'src/chat21-core/providers/logger/customLogger';
|
|
28
25
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
29
26
|
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
30
|
-
import { of } from 'rxjs';
|
|
31
27
|
|
|
32
28
|
describe('AppComponent', () => {
|
|
33
29
|
let component: AppComponent;
|
|
34
30
|
let fixture: ComponentFixture<AppComponent>;
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
let ngxlogger: NGXLogger;
|
|
32
|
+
let customLogger = new CustomLogger(ngxlogger)
|
|
37
33
|
|
|
38
34
|
beforeEach(waitForAsync(() => {
|
|
39
|
-
LoggerInstance.setInstance(customLogger);
|
|
40
|
-
spyOn(AppComponent.prototype, 'ngAfterViewInit').and.stub();
|
|
41
35
|
TestBed.configureTestingModule({
|
|
42
36
|
declarations: [
|
|
43
37
|
AppComponent
|
|
44
38
|
],
|
|
45
39
|
imports: [RouterTestingModule,
|
|
46
40
|
TranslateModule.forRoot()],
|
|
47
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
48
41
|
providers: [
|
|
49
|
-
Globals,
|
|
50
42
|
Triggerhandler,
|
|
51
43
|
GlobalSettingsService,
|
|
52
44
|
AppStorageService,
|
|
@@ -71,18 +63,11 @@ describe('AppComponent', () => {
|
|
|
71
63
|
}));
|
|
72
64
|
|
|
73
65
|
beforeEach(() => {
|
|
74
|
-
spyOn(TestBed.inject(GlobalSettingsService), 'getProjectParametersById').and.returnValue(
|
|
75
|
-
of({ project: null }) as any,
|
|
76
|
-
);
|
|
77
|
-
spyOn(TestBed.inject(GlobalSettingsService), 'manageLoadingDomains').and.returnValue(true);
|
|
78
|
-
|
|
79
|
-
const translator = TestBed.inject(TranslatorService);
|
|
80
|
-
spyOn(translator, 'initI18n').and.returnValue(Promise.resolve(undefined));
|
|
81
|
-
spyOn(translator, 'translate').and.stub();
|
|
82
|
-
spyOn(translator, 'getLanguage').and.returnValue('en');
|
|
83
|
-
|
|
84
66
|
fixture = TestBed.createComponent(AppComponent);
|
|
85
67
|
component = fixture.componentInstance;
|
|
68
|
+
LoggerInstance.setInstance(customLogger)
|
|
69
|
+
let logger = LoggerInstance.getInstance()
|
|
70
|
+
component['logger']= logger
|
|
86
71
|
fixture.detectChanges();
|
|
87
72
|
});
|
|
88
73
|
|