@chat21/chat21-web-widget 5.1.33 → 5.1.34-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.
Files changed (201) hide show
  1. package/.angular-mcp-cache/package.json +1 -0
  2. package/.cursor/angular18-accessibility-auditor-skill.md +442 -0
  3. package/.cursor/mcp.json +15 -0
  4. package/.github/workflows/docker-community-push-latest.yml +23 -13
  5. package/.github/workflows/docker-image-tag-community-tag-push.yml +22 -12
  6. package/.github/workflows/playwright.yml +27 -0
  7. package/CHANGELOG.md +130 -6
  8. package/Dockerfile +4 -5
  9. package/angular.json +24 -4
  10. package/docs/changelog/this-branch.md +36 -0
  11. package/env.sample +3 -2
  12. package/mocks/voice-websocket-mock/server.cjs +245 -0
  13. package/nginx.conf +22 -2
  14. package/package.json +10 -3
  15. package/playwright.config.ts +41 -0
  16. package/src/app/app.component.html +2 -2
  17. package/src/app/app.component.scss +25 -14
  18. package/src/app/app.component.spec.ts +21 -6
  19. package/src/app/app.component.ts +10 -9
  20. package/src/app/app.module.ts +15 -0
  21. package/src/app/component/conversation-detail/conversation/conversation.component.html +25 -11
  22. package/src/app/component/conversation-detail/conversation/conversation.component.scss +40 -2
  23. package/src/app/component/conversation-detail/conversation/conversation.component.spec.ts +644 -75
  24. package/src/app/component/conversation-detail/conversation/conversation.component.ts +100 -14
  25. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +25 -13
  26. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.spec.ts +123 -5
  27. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +1 -0
  28. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +23 -10
  29. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +33 -2
  30. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +242 -149
  31. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +8 -6
  32. package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.spec.ts +53 -3
  33. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +200 -96
  34. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +211 -6
  35. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.spec.ts +452 -78
  36. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +291 -76
  37. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +113 -53
  38. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +12 -4
  39. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.spec.ts +274 -29
  40. package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.html +23 -9
  41. package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.spec.ts +80 -8
  42. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.html +29 -23
  43. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.spec.ts +185 -16
  44. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +34 -14
  45. package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.html +46 -0
  46. package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.scss +83 -0
  47. package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.ts +192 -0
  48. package/src/app/component/error-alert/error-alert.component.spec.ts +65 -5
  49. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.html +16 -7
  50. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +21 -0
  51. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.spec.ts +89 -7
  52. package/src/app/component/form/form-builder/form-builder.component.html +1 -1
  53. package/src/app/component/form/form-builder/form-builder.component.spec.ts +163 -21
  54. package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.html +8 -4
  55. package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.scss +10 -5
  56. package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.spec.ts +90 -16
  57. package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +26 -0
  58. package/src/app/component/form/inputs/form-label/form-label.component.spec.ts +45 -11
  59. package/src/app/component/form/inputs/form-radio-button/form-radio-button.component.spec.ts +24 -6
  60. package/src/app/component/form/inputs/form-select/form-select.component.spec.ts +14 -5
  61. package/src/app/component/form/inputs/form-text/form-text.component.html +14 -12
  62. package/src/app/component/form/inputs/form-text/form-text.component.scss +11 -1
  63. package/src/app/component/form/inputs/form-text/form-text.component.spec.ts +113 -17
  64. package/src/app/component/form/inputs/form-text/form-text.component.ts +35 -3
  65. package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +13 -11
  66. package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +6 -5
  67. package/src/app/component/form/inputs/form-textarea/form-textarea.component.spec.ts +149 -13
  68. package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +26 -0
  69. package/src/app/component/form/prechat-form/prechat-form.component.html +14 -11
  70. package/src/app/component/form/prechat-form/prechat-form.component.spec.ts +102 -10
  71. package/src/app/component/form/prechat-form/prechat-form.component.ts +8 -1
  72. package/src/app/component/form/prechat-form-test-mock.ts +35 -0
  73. package/src/app/component/home/home.component.html +38 -31
  74. package/src/app/component/home/home.component.scss +4 -2
  75. package/src/app/component/home/home.component.spec.ts +226 -11
  76. package/src/app/component/home-conversations/home-conversations.component.html +30 -26
  77. package/src/app/component/home-conversations/home-conversations.component.scss +3 -0
  78. package/src/app/component/home-conversations/home-conversations.component.spec.ts +212 -36
  79. package/src/app/component/last-message/last-message.component.html +15 -9
  80. package/src/app/component/last-message/last-message.component.scss +16 -2
  81. package/src/app/component/last-message/last-message.component.spec.ts +204 -23
  82. package/src/app/component/last-message/last-message.component.ts +4 -1
  83. package/src/app/component/launcher-button/launcher-button.component.html +8 -13
  84. package/src/app/component/launcher-button/launcher-button.component.spec.ts +104 -8
  85. package/src/app/component/list-all-conversations/list-all-conversations.component.html +12 -17
  86. package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -0
  87. package/src/app/component/list-conversations/list-conversations.component.html +22 -22
  88. package/src/app/component/menu-options/menu-options.component.html +30 -20
  89. package/src/app/component/menu-options/menu-options.component.spec.ts +125 -9
  90. package/src/app/component/message/audio/audio.component.html +13 -15
  91. package/src/app/component/message/audio/audio.component.spec.ts +140 -5
  92. package/src/app/component/message/audio/audio.component.ts +1 -5
  93. package/src/app/component/message/audio-sync/audio-sync.component.html +18 -0
  94. package/src/app/component/message/audio-sync/audio-sync.component.scss +65 -0
  95. package/src/app/component/message/audio-sync/audio-sync.component.spec.ts +103 -0
  96. package/src/app/component/message/audio-sync/audio-sync.component.ts +643 -0
  97. package/src/app/component/message/avatar/avatar.component.html +2 -2
  98. package/src/app/component/message/avatar/avatar.component.spec.ts +99 -7
  99. package/src/app/component/message/bubble-message/bubble-message.component.html +43 -51
  100. package/src/app/component/message/bubble-message/bubble-message.component.scss +59 -1
  101. package/src/app/component/message/bubble-message/bubble-message.component.spec.ts +154 -57
  102. package/src/app/component/message/bubble-message/bubble-message.component.ts +152 -109
  103. package/src/app/component/message/buttons/action-button/action-button.component.html +3 -4
  104. package/src/app/component/message/buttons/action-button/action-button.component.spec.ts +49 -5
  105. package/src/app/component/message/buttons/link-button/link-button.component.scss +5 -8
  106. package/src/app/component/message/buttons/link-button/link-button.component.spec.ts +50 -5
  107. package/src/app/component/message/buttons/text-button/text-button.component.spec.ts +44 -5
  108. package/src/app/component/message/carousel/carousel.component.html +29 -16
  109. package/src/app/component/message/carousel/carousel.component.scss +20 -8
  110. package/src/app/component/message/carousel/carousel.component.spec.ts +80 -3
  111. package/src/app/component/message/carousel/carousel.component.ts +16 -0
  112. package/src/app/component/message/frame/frame.component.html +9 -4
  113. package/src/app/component/message/frame/frame.component.spec.ts +34 -15
  114. package/src/app/component/message/frame/frame.component.ts +7 -2
  115. package/src/app/component/message/html/html.component.html +1 -1
  116. package/src/app/component/message/html/html.component.scss +1 -1
  117. package/src/app/component/message/html/html.component.spec.ts +24 -7
  118. package/src/app/component/message/image/image.component.html +12 -10
  119. package/src/app/component/message/image/image.component.scss +16 -0
  120. package/src/app/component/message/image/image.component.spec.ts +101 -15
  121. package/src/app/component/message/image/image.component.ts +90 -51
  122. package/src/app/component/message/info-message/info-message.component.spec.ts +26 -14
  123. package/src/app/component/message/json-sources/json-sources.component.html +38 -0
  124. package/src/app/component/message/json-sources/json-sources.component.scss +201 -0
  125. package/src/app/component/message/json-sources/json-sources.component.ts +89 -0
  126. package/src/app/component/message/like-unlike/like-unlike.component.html +7 -9
  127. package/src/app/component/message/like-unlike/like-unlike.component.spec.ts +31 -3
  128. package/src/app/component/message/return-receipt/return-receipt.component.spec.ts +38 -17
  129. package/src/app/component/message/text/text.component.html +3 -3
  130. package/src/app/component/message/text/text.component.scss +80 -86
  131. package/src/app/component/message/text/text.component.spec.ts +106 -13
  132. package/src/app/component/message-attachment/message-attachment.component.spec.ts +134 -13
  133. package/src/app/component/selection-department/selection-department.component.html +21 -23
  134. package/src/app/component/selection-department/selection-department.component.spec.ts +159 -14
  135. package/src/app/component/selection-department/selection-department.component.ts +8 -1
  136. package/src/app/component/send-button/send-button.component.html +5 -13
  137. package/src/app/component/send-button/send-button.component.spec.ts +2 -2
  138. package/src/app/component/star-rating-widget/star-rating-widget.component.html +51 -81
  139. package/src/app/directives/tooltip.directive.spec.ts +8 -4
  140. package/src/app/modals/confirm-close/confirm-close.component.html +20 -8
  141. package/src/app/modals/confirm-close/confirm-close.component.scss +3 -0
  142. package/src/app/modals/confirm-close/confirm-close.component.spec.ts +13 -4
  143. package/src/app/modals/confirm-close/confirm-close.component.ts +8 -1
  144. package/src/app/pipe/html-entites-encode.pipe.spec.ts +35 -2
  145. package/src/app/pipe/marked.pipe.spec.ts +38 -2
  146. package/src/app/pipe/marked.pipe.ts +51 -41
  147. package/src/app/providers/app-config.service.ts +4 -2
  148. package/src/app/providers/brand.service.spec.ts +23 -2
  149. package/src/app/providers/brand.service.ts +1 -1
  150. package/src/app/providers/global-settings.service.spec.ts +1009 -14
  151. package/src/app/providers/global-settings.service.ts +82 -2
  152. package/src/app/providers/json-sources-parser.service.ts +175 -0
  153. package/src/app/providers/translator.service.ts +26 -6
  154. package/src/app/providers/tts-audio-playback-coordinator.service.spec.ts +117 -0
  155. package/src/app/providers/tts-audio-playback-coordinator.service.ts +109 -0
  156. package/src/app/providers/url-preview.service.ts +82 -0
  157. package/src/app/providers/voice/STT&TTS/openai-voice.config.ts +12 -0
  158. package/src/app/providers/voice/STT&TTS/openai-voice.provider.ts +171 -0
  159. package/src/app/providers/voice/STT&TTS/speech-provider.abstract.ts +39 -0
  160. package/src/app/providers/voice/audio.types.ts +40 -0
  161. package/src/app/providers/voice/vad.service.spec.ts +28 -0
  162. package/src/app/providers/voice/vad.service.ts +70 -0
  163. package/src/app/providers/voice/voice-streaming.service.spec.ts +23 -0
  164. package/src/app/providers/voice/voice-streaming.service.ts +702 -0
  165. package/src/app/providers/voice/voice-streaming.types.ts +112 -0
  166. package/src/app/providers/voice/voice.service.spec.ts +227 -0
  167. package/src/app/providers/voice/voice.service.ts +973 -0
  168. package/src/app/sass/_variables.scss +3 -0
  169. package/src/app/sass/animations.scss +19 -1
  170. package/src/app/shims/onnxruntime-web-wasm.ts +4 -0
  171. package/src/app/utils/globals.ts +21 -1
  172. package/src/app/utils/json-sources-utils.ts +27 -0
  173. package/src/app/utils/url-utils.ts +98 -0
  174. package/src/app/utils/utils-resources.ts +1 -1
  175. package/src/assets/i18n/en.json +106 -99
  176. package/src/assets/i18n/es.json +107 -100
  177. package/src/assets/i18n/fr.json +107 -100
  178. package/src/assets/i18n/it.json +107 -98
  179. package/src/assets/onnx/ort-wasm-simd-threaded.mjs +59 -0
  180. package/src/assets/onnx/ort-wasm-simd-threaded.wasm +0 -0
  181. package/src/assets/sounds/keyboard.mp3 +0 -0
  182. package/src/assets/twp/chatbot-panel.html +3 -1
  183. package/src/assets/twp/index-dev.html +18 -0
  184. package/src/assets/twp/tiledesk_widget_files/widget-css-override-example.css +14 -0
  185. package/src/assets/vad/silero_vad_legacy.onnx +0 -0
  186. package/src/assets/vad/vad.worklet.bundle.min.js +1 -0
  187. package/src/chat21-core/models/message.ts +2 -1
  188. package/src/chat21-core/providers/chat-manager.spec.ts +72 -0
  189. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +3 -2
  190. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +12 -0
  191. package/src/chat21-core/providers/scripts/script.service.spec.ts +12 -2
  192. package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +1 -1
  193. package/src/chat21-core/utils/constants.ts +4 -0
  194. package/src/chat21-core/utils/utils-message.ts +45 -6
  195. package/src/chat21-core/utils/utils.ts +5 -2
  196. package/src/widget-config-template.json +4 -1
  197. package/src/widget-config.json +4 -1
  198. package/tests/widget-form-rich.spec.ts +67 -0
  199. package/tests/widget-index-dev-settings.spec.ts +52 -0
  200. package/tests/widget-twp-iframe.spec.ts +39 -0
  201. package/tsconfig.json +5 -0
@@ -1,5 +1,4 @@
1
- <!-- 'background-color': stylesMap.get('backgroundColor'), 'color': stylesMap.get('foregroundColor'), 'background-image': stylesMap.get('themeColor')+','+ convertColorToRGBA(stylesMap.get('themeColor'), 50)+')' -->
2
- <div class="c21-header" [ngStyle]="{'background-image': stylesMap?.get('colorGradient') }">
1
+ <div class="c21-header" [ngStyle]="{'background-image': stylesMap?.get('colorGradient') }">
3
2
 
4
3
  <div class="c21-header-container">
5
4
 
@@ -7,63 +6,106 @@
7
6
  <div class="c21-header-content">
8
7
 
9
8
  <!-- ICON CLOSE CHAT -->
10
- <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-close c21-button-clean" [ngStyle]="{'display': (hideHeaderCloseButton)?'none':'flex'}" (click)="closeWidget()">
11
- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
9
+ <button [attr.disabled]="(isButtonsDisabled)?true:null"
10
+ type="button"
11
+ class="c21-header-button c21-right c21-close c21-button-clean"
12
+ [attr.aria-label]="translationMap?.get('BUTTON_CLOSE_TO_ICON')"
13
+ [ngStyle]="{'display': (hideHeaderCloseButton)?'none':'flex'}"
14
+ (click)="closeWidget()">
15
+ <svg aria-hidden="true" focusable="false"
16
+ [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }"
17
+ xmlns="http://www.w3.org/2000/svg"
12
18
  width="24px" height="24px" viewBox="0 0 24 24">
13
19
  <path d="M19.35,9.21c.2-.2.2-.51,0-.71l-.71-.71c-.2-.2-.51-.2-.71,0l-5.94,5.94-5.94-5.94c-.2-.2-.51-.2-.71,0l-.71.71c-.2.2-.2.51,0,.71l7,7c.2.2.51.2.71,0l7-7Z"/>
14
- <title id="altIconTitle">{{ translationMap?.get('BUTTON_CLOSE_TO_ICON') }}</title>
15
20
  </svg>
16
21
  </button>
17
-
22
+
18
23
  <!-- ICON MENU OPTION -->
19
- <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-button-clean" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="toggleMenu()" >
20
- <svg aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
24
+ <button [attr.disabled]="(isButtonsDisabled)?true:null"
25
+ type="button"
26
+ class="c21-header-button c21-right c21-button-clean"
27
+ [attr.aria-label]="translationMap?.get('OPTIONS')"
28
+ [attr.aria-expanded]="isMenuShow ? 'true' : 'false'"
29
+ aria-haspopup="true"
30
+ [attr.aria-controls]="isMenuShow ? 'c21-options-menu' : null"
31
+ [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}"
32
+ (click)="toggleMenu()">
33
+ <svg aria-hidden="true" focusable="false"
34
+ [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }"
35
+ xmlns="http://www.w3.org/2000/svg"
21
36
  width="24" height="24" viewBox="0 0 24 24">
22
37
  <path fill="none" d="M0 0h24v24H0V0z" />
23
38
  <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />
24
- <title id="altIconTitle">{{ translationMap?.get('OPTIONS') }}</title>
25
39
  </svg>
26
40
  </button>
27
41
 
28
42
 
29
43
  <!-- ICON MAXIMIZE -->
30
- <button *ngIf="size === 'min' && !fullscreenMode && !isMobile" [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-button-clean" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="onChangeSize('max')" >
31
- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
44
+ <button *ngIf="size === 'min' && !fullscreenMode && !isMobile"
45
+ [attr.disabled]="(isButtonsDisabled)?true:null"
46
+ type="button"
47
+ class="c21-header-button c21-right c21-button-clean"
48
+ [attr.aria-label]="translationMap?.get('MAXIMIZE')"
49
+ [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}"
50
+ (click)="onChangeSize('max')">
51
+ <svg aria-hidden="true" focusable="false"
52
+ [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }"
53
+ xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
32
54
  width="17" height="17" viewBox="0 0 17 17">
33
55
  <path d="M6.49001 8.30999L3.69 11.11V9.40999C3.69 8.93999 3.31 8.55999 2.84 8.55999C2.37 8.55999 1.99001 8.93999 1.99001 9.40999V14.01H6.59C7.06 14.01 7.44 13.63 7.44 13.16C7.44 12.69 7.06 12.31 6.59 12.31H4.89L7.69 9.50999L6.49001 8.30999ZM9.41 1.98999C8.94 1.98999 8.56001 2.36999 8.56001 2.83999C8.56001 3.30999 8.94 3.68999 9.41 3.68999H11.11L8.31001 6.48999L9.51 7.68999L12.31 4.88999V6.58999C12.31 7.05999 12.69 7.43999 13.16 7.43999C13.63 7.43999 14.01 7.05999 14.01 6.58999V1.98999H9.41Z"></path>
34
- <title id="altIconTitle">{{ translationMap?.get('MAXIMIZE') }}</title>
35
56
  </svg>
36
57
  </button>
37
58
 
38
59
  <!-- ICON MINIMIZE -->
39
- <button *ngIf="size==='top' && !fullscreenMode && !isMobile" [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-button-clean" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="onChangeSize('min')" >
40
- <svg role="img" aria-labelledby="altIconTitle" class="icon-menu" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
60
+ <button *ngIf="size==='top' && !fullscreenMode && !isMobile"
61
+ [attr.disabled]="(isButtonsDisabled)?true:null"
62
+ type="button"
63
+ class="c21-header-button c21-right c21-button-clean"
64
+ [attr.aria-label]="translationMap?.get('MINIMIZE')"
65
+ [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}"
66
+ (click)="onChangeSize('min')">
67
+ <svg aria-hidden="true" focusable="false"
68
+ class="icon-menu"
69
+ [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}"
70
+ xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
41
71
  width="17" height="17" viewBox="0 0 17 17">
42
72
  <path d="M13.59 5.31h-1.7l3.3-3.3-1.2-1.2-3.3 3.3v-1.7a.85.85 0 1 0-1.7 0v4.6h4.6a.85.85 0 1 0 0-1.7M1.57 9.84c0 .47.38.85.85.85h1.7l-3.3 3.3 1.2 1.2 3.3-3.3v1.7a.85.85 0 1 0 1.7 0v-4.6h-4.6a.85.85 0 0 0-.85.85"></path>
43
- <title id="altIconTitle">{{ translationMap?.get('MINIMIZE') }}</title>
44
73
  </svg>
45
74
  </button>
46
75
 
47
76
  <!-- ICON TOP -->
48
- <button *ngIf="size==='max' && !fullscreenMode && !isMobile" [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="-1" class="c21-header-button c21-right c21-button-clean" [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}" (click)="onChangeSize('top')" >
49
- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
77
+ <button *ngIf="size==='max' && !fullscreenMode && !isMobile"
78
+ [attr.disabled]="(isButtonsDisabled)?true:null"
79
+ type="button"
80
+ class="c21-header-button c21-right c21-button-clean"
81
+ [attr.aria-label]="translationMap?.get('CENTER')"
82
+ [ngStyle]="{'display': (hideHeaderConversationOptionsMenu)?'none':'flex'}"
83
+ (click)="onChangeSize('top')">
84
+ <svg aria-hidden="true" focusable="false"
85
+ [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}"
86
+ xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
50
87
  width="17" height="17" viewBox="0 0 17 17">
51
88
  <path d="M3.7,7.6L2.5,6.4C2.2,6,2.2,5.5,2.5,5.2s0.9-0.4,1.2-0.1L7,8.4l-3.3,3.3c-0.4,0.4-0.8,0.3-1.1,0s-0.4-0.9-0.1-1.2l1.2-1.2 H1.5l0-1.7H3.7z"/>
52
89
  <path d="M13.3,7.6l1.2-1.2c0.4-0.4,0.3-0.8,0-1.1s-0.9-0.4-1.2-0.1L10,8.4l3.3,3.3c0.4,0.4,0.8,0.3,1.1,0s0.4-0.9,0.1-1.2l-1.2-1.2 h2.2l0-1.7H13.3z"/>
53
90
  <path d="M8.5,14.5L8.5,14.5c-0.5,0-0.9-0.4-0.9-0.8V3.3c0-0.5,0.4-0.8,0.8-0.8h0c0.5,0,0.8,0.4,0.8,0.8v10.4 C9.4,14.2,9,14.5,8.5,14.5z"/>
54
- <title id="altIconTitle">{{ translationMap?.get('CENTER') }}</title>
55
91
  </svg>
56
92
  </button>
57
93
 
58
94
 
59
95
 
60
96
  <!-- ICON BACK -->
61
- <button [attr.disabled]="(isButtonsDisabled)?true:null" tabindex="1530" aria-label=" indietro " class="c21-header-button c21-left c21-button-clean" [ngStyle]="{'display': (hideHeaderBackButton)?'none':'flex'}" (click)="returnHome()">
62
- <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
97
+ <button [attr.disabled]="(isButtonsDisabled)?true:null"
98
+ type="button"
99
+ class="c21-header-button c21-left c21-button-clean"
100
+ [attr.aria-label]="translationMap?.get('PREV_CONVERSATIONS') || translationMap?.get('BACK')"
101
+ [ngStyle]="{'display': (hideHeaderBackButton)?'none':'flex'}"
102
+ (click)="returnHome()">
103
+ <svg aria-hidden="true" focusable="false"
104
+ [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }"
105
+ xmlns="http://www.w3.org/2000/svg"
63
106
  width="24px" height="24px" viewBox="0 0 24 24">
64
107
  <path fill="none" d="M0 0h24v24H0V0z" />
65
108
  <path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z" />
66
- <title id="altIconTitle">{{ translationMap?.get('PREV_CONVERSATIONS') }}</title>
67
109
  </svg>
68
110
  </button>
69
111
 
@@ -71,7 +113,7 @@
71
113
  <div class="c21-title" [ngStyle]="{'color': stylesMap?.get('foregroundColor') }">
72
114
  <div class="titleText">{{widgetTitle}}</div>
73
115
  </div>
74
-
116
+
75
117
  <user-typing *ngIf="isTypings && typingLocation==='header'"
76
118
  [color]="stylesMap?.get('foregroundColor')"
77
119
  [translationMap]="translationMap"
@@ -84,44 +126,54 @@
84
126
 
85
127
  </div>
86
128
 
87
- <div *ngIf="isMenuShow" id="c21-options-menu">
129
+ <div *ngIf="isMenuShow"
130
+ id="c21-options-menu"
131
+ role="group"
132
+ [attr.aria-label]="translationMap?.get('OPTIONS')"
133
+ (keydown.escape)="$event.preventDefault(); $event.stopPropagation(); toggleMenu()">
88
134
  <!-- ICON VOLUME -->
89
- <div class="c21-header-button c21-right" (click)="toggleSound()">
90
- <svg *ngIf="!soundEnabled" aria-labelledby="altIconTitle" class="icon-menu" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
135
+ <button type="button"
136
+ class="c21-header-button c21-right c21-button-clean"
137
+ [attr.aria-pressed]="soundEnabled ? 'true' : 'false'"
138
+ [attr.aria-label]="soundEnabled ? translationMap?.get('SOUND_ON') : translationMap?.get('SOUND_OFF')"
139
+ (click)="toggleSound()">
140
+ <svg *ngIf="!soundEnabled" aria-hidden="true" focusable="false" class="icon-menu" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
91
141
  <path fill="none" d="M0 0h24v24H0V0z" />
92
142
  <path d="M4.34 2.93L2.93 4.34 7.29 8.7 7 9H3v6h4l5 5v-6.59l4.18 4.18c-.65.49-1.38.88-2.18 1.11v2.06c1.34-.3 2.57-.92 3.61-1.75l2.05 2.05 1.41-1.41L4.34 2.93zM10 15.17L7.83 13H5v-2h2.83l.88-.88L10 11.41v3.76zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zm-7-8l-1.88 1.88L12 7.76zm4.5 8c0-1.77-1.02-3.29-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24z" />
93
- <title id="altIconTitle">{{ translationMap?.get('SOUND_OFF') }}</title>
94
143
  </svg>
95
- <svg *ngIf="soundEnabled" aria-labelledby="altIconTitle" class="icon-menu" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
144
+ <svg *ngIf="soundEnabled" aria-hidden="true" focusable="false" class="icon-menu" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
96
145
  <path fill="none" d="M0 0h24v24H0V0z" />
97
146
  <path d="M3 9v6h4l5 5V4L7 9H3zm7-.17v6.34L7.83 13H5v-2h2.83L10 8.83zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77 0-4.28-2.99-7.86-7-8.77z" />
98
- <title id="altIconTitle">{{ translationMap?.get('SOUND_ON') }}</title>
99
147
  </svg>
100
148
  <span *ngIf="!soundEnabled" class="label-menu-item"> {{ translationMap?.get('SOUND_OFF') }}</span>
101
149
  <span *ngIf="soundEnabled" class="label-menu-item"> {{ translationMap?.get('SOUND_ON')}}</span>
102
- </div>
150
+ </button>
103
151
 
104
152
  <!-- ICON TRANSCRIPT -->
105
- <div class="c21-header-button c21-right" *ngIf="isTrascriptDownloadEnabled" (click)="dowloadTranscript()">
106
- <svg role="img" aria-labelledby="altIconTitle" class="icon-menu" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24">
153
+ <button type="button"
154
+ class="c21-header-button c21-right c21-button-clean" *ngIf="isTrascriptDownloadEnabled"
155
+ [attr.aria-label]="translationMap?.get('DOWNLOAD_TRANSCRIPT')"
156
+ (click)="dowloadTranscript()">
157
+ <svg aria-hidden="true" focusable="false" class="icon-menu" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24">
107
158
  <path fill="none" d="M0 0h24v24H0V0z" />
108
159
  <path d="M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z" />
109
- <title id="altIconTitle">{{ translationMap?.get('DOWNLOAD_TRANSCRIPT') }}</title>
110
160
  </svg>
111
161
  <span class="label-menu-item">{{ translationMap?.get('DOWNLOAD_TRANSCRIPT') }}</span>
112
- </div>
162
+ </button>
113
163
 
114
164
  <!-- ICON CLOSE CHAT -->
115
- <div class="c21-header-button c21-right" *ngIf="!hideCloseConversationOptionMenu" (click)="closeChat()">
116
- <svg role="img" id="archive" aria-labelledby="altIconTitle" class="icon-menu" xmlns="http://www.w3.org/2000/svg"
165
+ <button type="button"
166
+ class="c21-header-button c21-right c21-button-clean" *ngIf="!hideCloseConversationOptionMenu"
167
+ [attr.aria-label]="translationMap?.get('CLOSE_CHAT')"
168
+ (click)="closeChat()">
169
+ <svg aria-hidden="true" focusable="false" id="archive" class="icon-menu" xmlns="http://www.w3.org/2000/svg"
117
170
  width="20px" height="20px" viewBox="0 0 512 512">
118
171
  <path d="M80 152v256a40.12 40.12 0 0040 40h272a40.12 40.12 0 0040-40V152" stroke-linecap="round" stroke-linejoin="round" stroke-width="50px" fill="none"></path>
119
172
  <rect x="48" y="64" width="416" height="80" rx="28" ry="28" stroke-linejoin="round" stroke-width="50px" fill="none" ></rect>
120
173
  <path stroke-linecap="round" stroke-linejoin="round" d="M320 304l-64 64-64-64M256 345.89V224" stroke-width="50px" fill="none"></path>
121
- <title id="altIconTitle">{{ translationMap?.get('CLOSE_CHAT') }}</title>
122
174
  </svg>
123
175
  <span class="label-menu-item">{{ translationMap?.get('CLOSE_CHAT') }}</span>
124
- </div>
176
+ </button>
125
177
 
126
178
  <!-- ICON OPEN CHAT DETAIL -->
127
179
  <!-- <div class="c21-header-button c21-right" *ngIf="!hideChatDetailOptionMenu"(click)="openDetail()">
@@ -149,44 +201,52 @@
149
201
  </div> -->
150
202
 
151
203
  <!-- ICON MAXIMIZE -->
152
- <div class="c21-header-button c21-right" *ngIf="size === 'min' && !fullscreenMode" (click)="onChangeSize('max')">
153
- <svg role="img" aria-labelledby="altIconTitle" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
204
+ <button type="button"
205
+ class="c21-header-button c21-right c21-button-clean" *ngIf="size === 'min' && !fullscreenMode"
206
+ [attr.aria-label]="translationMap?.get('MAXIMIZE')"
207
+ (click)="onChangeSize('max')">
208
+ <svg aria-hidden="true" focusable="false" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
154
209
  width="17" height="17" viewBox="0 0 17 17">
155
210
  <path d="M6.49001 8.30999L3.69 11.11V9.40999C3.69 8.93999 3.31 8.55999 2.84 8.55999C2.37 8.55999 1.99001 8.93999 1.99001 9.40999V14.01H6.59C7.06 14.01 7.44 13.63 7.44 13.16C7.44 12.69 7.06 12.31 6.59 12.31H4.89L7.69 9.50999L6.49001 8.30999ZM9.41 1.98999C8.94 1.98999 8.56001 2.36999 8.56001 2.83999C8.56001 3.30999 8.94 3.68999 9.41 3.68999H11.11L8.31001 6.48999L9.51 7.68999L12.31 4.88999V6.58999C12.31 7.05999 12.69 7.43999 13.16 7.43999C13.63 7.43999 14.01 7.05999 14.01 6.58999V1.98999H9.41Z" fill="currentColor"></path>
156
- <title id="altIconTitle">{{ translationMap?.get('MAXIMIZE') }}</title>
157
211
  </svg>
158
212
  <span class="label-menu-item">{{ translationMap?.get('MAXIMIZE') }}</span>
159
- </div>
213
+ </button>
160
214
  <!-- ICON MINIMIZE -->
161
- <div class="c21-header-button c21-right" *ngIf="(size==='max' || size==='top') && !fullscreenMode" (click)="onChangeSize('min')">
162
- <svg role="img" aria-labelledby="altIconTitle" class="icon-menu" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
215
+ <button type="button"
216
+ class="c21-header-button c21-right c21-button-clean" *ngIf="(size==='max' || size==='top') && !fullscreenMode"
217
+ [attr.aria-label]="translationMap?.get('MINIMIZE')"
218
+ (click)="onChangeSize('min')">
219
+ <svg aria-hidden="true" focusable="false" class="icon-menu" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
163
220
  width="17" height="17" viewBox="0 0 17 17">
164
221
  <path d="M13.59 5.31h-1.7l3.3-3.3-1.2-1.2-3.3 3.3v-1.7a.85.85 0 1 0-1.7 0v4.6h4.6a.85.85 0 1 0 0-1.7M1.57 9.84c0 .47.38.85.85.85h1.7l-3.3 3.3 1.2 1.2 3.3-3.3v1.7a.85.85 0 1 0 1.7 0v-4.6h-4.6a.85.85 0 0 0-.85.85" fill="currentColor"></path>
165
- <title id="altIconTitle">{{ translationMap?.get('MINIMIZE') }}</title>
166
222
  </svg>
167
223
  <span class="label-menu-item">{{ translationMap?.get('MINIMIZE') }}</span>
168
- </div>
224
+ </button>
169
225
  <!-- ICON TOP -->
170
- <div class="c21-header-button c21-right" *ngIf="size!=='top' && !fullscreenMode" (click)="onChangeSize('top')">
171
- <svg role="img" aria-labelledby="altIconTitle" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
226
+ <button type="button"
227
+ class="c21-header-button c21-right c21-button-clean" *ngIf="size!=='top' && !fullscreenMode"
228
+ [attr.aria-label]="translationMap?.get('CENTER')"
229
+ (click)="onChangeSize('top')">
230
+ <svg aria-hidden="true" focusable="false" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
172
231
  width="17" height="17" viewBox="0 0 17 17">
173
232
  <path fill="currentColor" d="M3.7,7.6L2.5,6.4C2.2,6,2.2,5.5,2.5,5.2s0.9-0.4,1.2-0.1L7,8.4l-3.3,3.3c-0.4,0.4-0.8,0.3-1.1,0s-0.4-0.9-0.1-1.2l1.2-1.2 H1.5l0-1.7H3.7z"/>
174
233
  <path fill="currentColor" d="M13.3,7.6l1.2-1.2c0.4-0.4,0.3-0.8,0-1.1s-0.9-0.4-1.2-0.1L10,8.4l3.3,3.3c0.4,0.4,0.8,0.3,1.1,0s0.4-0.9,0.1-1.2l-1.2-1.2 h2.2l0-1.7H13.3z"/>
175
234
  <path fill="currentColor" d="M8.5,14.5L8.5,14.5c-0.5,0-0.9-0.4-0.9-0.8V3.3c0-0.5,0.4-0.8,0.8-0.8h0c0.5,0,0.8,0.4,0.8,0.8v10.4 C9.4,14.2,9,14.5,8.5,14.5z"/>
176
- <title id="altIconTitle">{{ translationMap?.get('CENTER') }}</title>
177
235
  </svg>
178
236
  <span class="label-menu-item">{{ translationMap?.get('CENTER') }}</span>
179
- </div>
237
+ </button>
180
238
 
181
239
  <!-- ICON LOGOUT -->
182
- <div class="c21-header-button c21-right" *ngIf="!hideSignOutOptionMenu" (click)="signOut()">
183
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" aria-labelledby="altIconTitle" class="icon-menu">
240
+ <button type="button"
241
+ class="c21-header-button c21-right c21-button-clean" *ngIf="!hideSignOutOptionMenu"
242
+ [attr.aria-label]="translationMap?.get('LOGOUT')"
243
+ (click)="signOut()">
244
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" aria-hidden="true" focusable="false" class="icon-menu">
184
245
  <path fill="none" d="M0 0h24v24H0V0z"/>
185
246
  <path d="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/>
186
- <title id="altIconTitle">{{ translationMap?.get('LOGOUT') }}</title>
187
247
  </svg>
188
248
  <span class="label-menu-item">{{ translationMap?.get('LOGOUT') }}</span>
189
- </div>
249
+ </button>
190
250
 
191
251
  <!-- BUILD VERSION -->
192
252
  <div class="c21-button build_version_menu" *ngIf="build_version">
@@ -86,11 +86,14 @@
86
86
 
87
87
  /* ==================== OPTION MENU CONTAINER ==================== */
88
88
  #c21-options-menu {
89
- width: auto;
89
+ /* Single column: every row matches the width of the widest item */
90
+ display: grid;
91
+ grid-template-columns: minmax(0, 1fr);
92
+ width: max-content;
93
+ max-width: 80%;
90
94
  height: auto;
91
95
  //min-height: 40px;
92
96
  min-width: 100px;
93
- max-width: 80%;
94
97
  position: absolute;
95
98
  z-index: 10;
96
99
  top: 40px;
@@ -103,10 +106,12 @@
103
106
  color: var(--blue);
104
107
  box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.2), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
105
108
  background-color: #ffffff;
106
- // padding: 10px 0px 10px 0px;
109
+ padding: 5px;
107
110
  .c21-header-button {
108
111
  // padding: 6px 10px 6px 10px;
109
- margin: 5px 5px;
112
+ box-sizing: border-box;
113
+ width: 100%;
114
+ margin: 5px 0;
110
115
  padding: 5px 10px;
111
116
  display: flex;
112
117
  align-items: center;
@@ -130,6 +135,9 @@
130
135
  }
131
136
 
132
137
  .build_version_menu {
138
+ box-sizing: border-box;
139
+ width: 100%;
140
+ margin: 5px 0 0;
133
141
  color: var(--gray);
134
142
  justify-content: center;
135
143
  font-size: 0.8em;