@chat21/chat21-web-widget 5.1.32-rc9 → 5.1.33-rc8
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/.angular-mcp-cache/package.json +1 -0
- package/.cursor/angular18-accessibility-auditor-skill.md +442 -0
- package/.cursor/mcp.json +15 -0
- package/.github/workflows/playwright.yml +27 -0
- package/.playwright-mcp/console-2026-05-08T15-31-09-000Z.log +17 -0
- package/.playwright-mcp/console-2026-05-08T15-32-19-412Z.log +89 -0
- package/.playwright-mcp/console-2026-05-08T16-18-48-424Z.log +133 -0
- package/.playwright-mcp/console-2026-05-11T12-54-06-869Z.log +13 -0
- package/.playwright-mcp/console-2026-05-11T12-54-56-229Z.log +147 -0
- package/.playwright-mcp/console-2026-05-11T12-55-47-174Z.log +183 -0
- package/.playwright-mcp/console-2026-05-11T15-34-03-590Z.log +210 -0
- package/.playwright-mcp/console-2026-05-12T15-07-31-880Z.log +118 -0
- package/.playwright-mcp/page-2026-05-08T15-32-19-900Z.yml +851 -0
- package/.playwright-mcp/page-2026-05-08T15-32-47-264Z.yml +857 -0
- package/.playwright-mcp/page-2026-05-08T15-33-17-089Z.yml +1110 -0
- package/.playwright-mcp/page-2026-05-08T15-33-23-486Z.yml +1069 -0
- package/.playwright-mcp/page-2026-05-08T15-33-45-390Z.yml +1076 -0
- package/.playwright-mcp/page-2026-05-08T15-33-52-666Z.yml +1072 -0
- package/.playwright-mcp/page-2026-05-08T15-34-01-338Z.yml +1085 -0
- package/.playwright-mcp/page-2026-05-08T15-34-07-227Z.yml +1072 -0
- package/.playwright-mcp/page-2026-05-08T15-34-13-875Z.yml +1072 -0
- package/.playwright-mcp/page-2026-05-08T15-34-21-885Z.yml +1109 -0
- package/.playwright-mcp/page-2026-05-08T15-34-32-755Z.yml +1109 -0
- package/.playwright-mcp/page-2026-05-08T15-35-09-607Z.yml +1119 -0
- package/.playwright-mcp/page-2026-05-08T15-35-14-242Z.yml +1109 -0
- package/.playwright-mcp/page-2026-05-08T16-18-48-671Z.yml +44 -0
- package/.playwright-mcp/page-2026-05-08T16-18-52-753Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-19-13-919Z.yml +68 -0
- package/.playwright-mcp/page-2026-05-08T16-19-17-977Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-19-25-733Z.yml +120 -0
- package/.playwright-mcp/page-2026-05-08T16-19-29-252Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-19-39-269Z.yml +80 -0
- package/.playwright-mcp/page-2026-05-08T16-19-43-915Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-20-04-407Z.yml +81 -0
- package/.playwright-mcp/page-2026-05-08T16-20-08-984Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-20-32-397Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-20-58-658Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-21-12-320Z.yml +86 -0
- package/.playwright-mcp/page-2026-05-08T16-21-39-154Z.yml +91 -0
- package/.playwright-mcp/page-2026-05-08T16-21-45-420Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-22-21-062Z.yml +0 -0
- package/.playwright-mcp/page-2026-05-08T16-22-58-232Z.yml +91 -0
- package/.playwright-mcp/page-2026-05-08T16-23-36-520Z.yml +0 -0
- package/.playwright-mcp/page-2026-05-08T16-23-46-805Z.yml +100 -0
- package/.playwright-mcp/page-2026-05-08T16-23-55-169Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-24-26-574Z.yml +91 -0
- package/.playwright-mcp/page-2026-05-08T16-25-34-414Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-25-59-831Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-26-21-809Z.yml +91 -0
- package/.playwright-mcp/page-2026-05-08T16-26-47-443Z.yml +105 -0
- package/.playwright-mcp/page-2026-05-08T16-26-56-136Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-27-59-610Z.yml +48 -0
- package/.playwright-mcp/page-2026-05-11T12-54-07-180Z.yml +44 -0
- package/.playwright-mcp/page-2026-05-11T12-54-56-946Z.yml +4 -0
- package/.playwright-mcp/page-2026-05-11T12-55-47-503Z.yml +24 -0
- package/.playwright-mcp/page-2026-05-11T12-56-00-766Z.yml +28 -0
- package/.playwright-mcp/page-2026-05-11T12-56-06-438Z.yml +90 -0
- package/.playwright-mcp/page-2026-05-11T12-57-56-838Z.yml +106 -0
- package/.playwright-mcp/page-2026-05-11T12-58-00-124Z.yml +106 -0
- package/.playwright-mcp/page-2026-05-11T12-59-08-836Z.yml +61 -0
- package/.playwright-mcp/page-2026-05-11T12-59-12-088Z.yml +61 -0
- package/.playwright-mcp/page-2026-05-11T12-59-26-215Z.yml +69 -0
- package/.playwright-mcp/page-2026-05-11T12-59-29-519Z.yml +69 -0
- package/.playwright-mcp/page-2026-05-11T12-59-37-309Z.yml +0 -0
- package/.playwright-mcp/page-2026-05-11T12-59-39-968Z.yml +79 -0
- package/.playwright-mcp/page-2026-05-11T12-59-45-983Z.yml +78 -0
- package/.playwright-mcp/page-2026-05-11T12-59-49-951Z.yml +78 -0
- package/.playwright-mcp/page-2026-05-11T15-34-04-515Z.yml +0 -0
- package/.playwright-mcp/page-2026-05-12T15-07-32-171Z.yml +44 -0
- package/.playwright-mcp/page-2026-05-12T15-08-09-820Z.yml +119 -0
- package/CHANGELOG.md +54 -4
- package/angular.json +20 -3
- package/deploy_amazon_beta.sh +7 -17
- package/deploy_amazon_prod.sh +41 -0
- package/docs/TILEDESK_WIDGET_ACCESSIBILITY_STATEMENT_COMPLETE.md +379 -0
- package/env.sample +3 -2
- package/mocks/voice-websocket-mock/server.cjs +245 -0
- package/package.json +7 -3
- package/playwright-report/index.html +90 -0
- package/playwright.config.ts +41 -0
- package/src/app/app.component.html +2 -2
- package/src/app/app.component.scss +25 -14
- package/src/app/app.component.spec.ts +21 -6
- package/src/app/app.module.ts +4 -0
- package/src/app/component/conversation-detail/conversation/conversation.component.html +19 -11
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +28 -0
- package/src/app/component/conversation-detail/conversation/conversation.component.spec.ts +644 -75
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +61 -17
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +25 -13
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.spec.ts +123 -5
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +1 -0
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +17 -7
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +15 -3
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +249 -149
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +0 -1
- package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.spec.ts +53 -3
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component copy.html +172 -0
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +112 -62
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +133 -7
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.spec.ts +452 -78
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +192 -84
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +113 -53
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +12 -4
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.spec.ts +274 -29
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.html +23 -9
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.spec.ts +80 -8
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.html +29 -23
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.spec.ts +185 -16
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +34 -14
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.html +43 -18
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.scss +56 -2
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.ts +135 -5
- package/src/app/component/error-alert/error-alert.component.spec.ts +65 -5
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.html +16 -7
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +21 -0
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.spec.ts +89 -7
- 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 +163 -21
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.html +8 -4
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.scss +10 -5
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.spec.ts +90 -16
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +26 -0
- package/src/app/component/form/inputs/form-label/form-label.component.spec.ts +45 -11
- package/src/app/component/form/inputs/form-radio-button/form-radio-button.component.spec.ts +24 -6
- package/src/app/component/form/inputs/form-select/form-select.component.spec.ts +14 -5
- package/src/app/component/form/inputs/form-text/form-text.component.html +14 -12
- package/src/app/component/form/inputs/form-text/form-text.component.scss +11 -1
- package/src/app/component/form/inputs/form-text/form-text.component.spec.ts +113 -17
- package/src/app/component/form/inputs/form-text/form-text.component.ts +26 -0
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +13 -11
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +6 -5
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.spec.ts +149 -13
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +26 -0
- package/src/app/component/form/prechat-form/prechat-form.component.html +14 -11
- package/src/app/component/form/prechat-form/prechat-form.component.spec.ts +102 -10
- package/src/app/component/form/prechat-form/prechat-form.component.ts +8 -1
- package/src/app/component/form/prechat-form-test-mock.ts +35 -0
- package/src/app/component/home/home.component.html +38 -31
- package/src/app/component/home/home.component.scss +4 -2
- package/src/app/component/home/home.component.spec.ts +226 -11
- package/src/app/component/home-conversations/home-conversations.component.html +30 -26
- package/src/app/component/home-conversations/home-conversations.component.scss +3 -0
- package/src/app/component/home-conversations/home-conversations.component.spec.ts +212 -36
- package/src/app/component/last-message/last-message.component.html +15 -9
- package/src/app/component/last-message/last-message.component.scss +16 -2
- package/src/app/component/last-message/last-message.component.spec.ts +204 -23
- package/src/app/component/launcher-button/launcher-button.component.html +8 -13
- package/src/app/component/launcher-button/launcher-button.component.spec.ts +104 -8
- package/src/app/component/list-all-conversations/list-all-conversations.component.html +12 -17
- package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -0
- package/src/app/component/list-conversations/list-conversations.component.html +22 -22
- package/src/app/component/menu-options/menu-options.component.html +30 -20
- package/src/app/component/menu-options/menu-options.component.spec.ts +125 -9
- package/src/app/component/message/audio/audio.component.html +13 -15
- package/src/app/component/message/audio/audio.component.spec.ts +140 -5
- package/src/app/component/message/audio/audio.component.ts +1 -0
- package/src/app/component/message/audio-sync/audio-sync.component.scss +1 -0
- package/src/app/component/message/audio-sync/audio-sync.component.spec.ts +81 -1
- package/src/app/component/message/audio-sync/audio-sync.component.ts +133 -86
- package/src/app/component/message/avatar/avatar.component.html +2 -2
- package/src/app/component/message/avatar/avatar.component.spec.ts +99 -7
- package/src/app/component/message/bubble-message/bubble-message.component.html +39 -52
- package/src/app/component/message/bubble-message/bubble-message.component.scss +54 -1
- package/src/app/component/message/bubble-message/bubble-message.component.spec.ts +154 -57
- package/src/app/component/message/bubble-message/bubble-message.component.ts +138 -110
- package/src/app/component/message/buttons/action-button/action-button.component.html +3 -4
- package/src/app/component/message/buttons/action-button/action-button.component.spec.ts +49 -5
- package/src/app/component/message/buttons/link-button/link-button.component.scss +5 -8
- package/src/app/component/message/buttons/link-button/link-button.component.spec.ts +50 -5
- package/src/app/component/message/buttons/text-button/text-button.component.spec.ts +44 -5
- package/src/app/component/message/carousel/carousel.component.html +29 -16
- package/src/app/component/message/carousel/carousel.component.scss +20 -8
- package/src/app/component/message/carousel/carousel.component.spec.ts +80 -3
- package/src/app/component/message/carousel/carousel.component.ts +16 -0
- package/src/app/component/message/frame/frame.component.html +9 -4
- package/src/app/component/message/frame/frame.component.spec.ts +34 -15
- package/src/app/component/message/frame/frame.component.ts +7 -2
- 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 +24 -7
- package/src/app/component/message/image/image.component.html +12 -10
- package/src/app/component/message/image/image.component.scss +16 -0
- package/src/app/component/message/image/image.component.spec.ts +101 -15
- package/src/app/component/message/image/image.component.ts +90 -51
- package/src/app/component/message/info-message/info-message.component.spec.ts +26 -14
- package/src/app/component/message/json-sources/json-sources.component.html +38 -0
- package/src/app/component/message/json-sources/json-sources.component.scss +197 -0
- package/src/app/component/message/json-sources/json-sources.component.ts +89 -0
- package/src/app/component/message/like-unlike/like-unlike.component.html +7 -9
- package/src/app/component/message/like-unlike/like-unlike.component.spec.ts +31 -3
- package/src/app/component/message/return-receipt/return-receipt.component.spec.ts +38 -17
- package/src/app/component/message/text/text.component.html +3 -3
- package/src/app/component/message/text/text.component.scss +80 -86
- package/src/app/component/message/text/text.component.spec.ts +106 -13
- package/src/app/component/message-attachment/message-attachment.component.spec.ts +134 -13
- package/src/app/component/selection-department/selection-department.component.html +21 -23
- package/src/app/component/selection-department/selection-department.component.spec.ts +159 -14
- package/src/app/component/selection-department/selection-department.component.ts +8 -1
- package/src/app/component/send-button/send-button.component.html +5 -13
- 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 +51 -81
- package/src/app/directives/tooltip.directive.spec.ts +8 -4
- package/src/app/modals/confirm-close/confirm-close.component.html +20 -8
- package/src/app/modals/confirm-close/confirm-close.component.scss +3 -0
- package/src/app/modals/confirm-close/confirm-close.component.spec.ts +13 -4
- package/src/app/modals/confirm-close/confirm-close.component.ts +8 -1
- package/src/app/pipe/html-entites-encode.pipe.spec.ts +35 -2
- package/src/app/pipe/marked.pipe.spec.ts +38 -2
- package/src/app/providers/app-config.service.ts +4 -2
- package/src/app/providers/brand.service.spec.ts +23 -2
- package/src/app/providers/brand.service.ts +1 -1
- package/src/app/providers/global-settings.service.spec.ts +1009 -14
- package/src/app/providers/global-settings.service.ts +30 -2
- package/src/app/providers/json-sources-parser.service.ts +182 -0
- package/src/app/providers/translator.service.ts +24 -6
- package/src/app/providers/tts-audio-playback-coordinator.service.spec.ts +117 -0
- package/src/app/providers/tts-audio-playback-coordinator.service.ts +39 -16
- package/src/app/providers/url-preview.service.ts +82 -0
- package/src/app/providers/voice/audio.types.ts +6 -0
- package/src/app/providers/voice/voice-streaming.service.spec.ts +23 -0
- package/src/app/providers/voice/voice-streaming.service.ts +710 -0
- package/src/app/providers/voice/voice-streaming.types.ts +113 -0
- package/src/app/providers/voice/voice.service.spec.ts +203 -3
- package/src/app/providers/voice/voice.service.ts +517 -13
- package/src/app/sass/_variables.scss +1 -1
- package/src/app/sass/animations.scss +19 -1
- package/src/app/utils/globals.ts +4 -0
- package/src/app/utils/json-sources-utils.ts +27 -0
- package/src/app/utils/url-utils.ts +98 -0
- package/src/app/utils/utils-resources.ts +1 -1
- package/src/assets/i18n/en.json +26 -1
- package/src/assets/i18n/es.json +106 -101
- package/src/assets/i18n/fr.json +106 -101
- package/src/assets/i18n/it.json +106 -99
- package/src/assets/twp/index-dev.html +18 -0
- package/src/assets/twp/tiledesk_widget_files/widget-css-override-example.css +14 -0
- package/src/chat21-core/providers/chat-manager.spec.ts +72 -0
- package/src/chat21-core/providers/scripts/script.service.spec.ts +12 -2
- package/src/chat21-core/utils/constants.ts +4 -0
- package/src/chat21-core/utils/utils-message.ts +23 -1
- package/src/widget-config-template.json +3 -1
- package/src/widget-config.json +28 -27
- package/test-results/.last-run.json +4 -0
- package/tests/widget-form-rich.spec.ts +67 -0
- package/tests/widget-index-dev-settings.spec.ts +52 -0
- package/tests/widget-twp-iframe.spec.ts +39 -0
|
@@ -1,45 +1,290 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
|
1
3
|
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
2
|
-
import {
|
|
3
|
-
import { Globals } from './../../../utils/globals';
|
|
4
|
-
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
5
|
-
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
4
|
+
import { HttpTestingController } from '@angular/common/http/testing';
|
|
6
5
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { AppConfigService } from '../../../providers/app-config.service';
|
|
7
|
+
import { HEADER_MENU_OPTION } from '../../../utils/constants';
|
|
9
8
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
10
|
-
import { NGXLogger } from 'ngx-logger';
|
|
11
9
|
import { CustomLogger } from 'src/chat21-core/providers/logger/customLogger';
|
|
10
|
+
import { NGXLogger } from 'ngx-logger';
|
|
11
|
+
import { ConversationHeaderComponent } from './conversation-header.component';
|
|
12
12
|
|
|
13
13
|
describe('ConversationHeaderComponent', () => {
|
|
14
14
|
let component: ConversationHeaderComponent;
|
|
15
15
|
let fixture: ComponentFixture<ConversationHeaderComponent>;
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
let httpMock: HttpTestingController;
|
|
17
|
+
|
|
18
|
+
const ngxlogger = jasmine.createSpyObj('NGXLogger', ['log', 'trace', 'debug', 'warn', 'error', 'info']);
|
|
19
|
+
const customLogger = new CustomLogger(ngxlogger);
|
|
20
|
+
|
|
21
|
+
const apiUrl = 'https://api.example.com/';
|
|
22
|
+
const appConfigStub = {
|
|
23
|
+
getConfig: jasmine.createSpy('getConfig').and.returnValue({ apiUrl }),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
beforeEach(async () => {
|
|
27
|
+
LoggerInstance.setInstance(customLogger);
|
|
28
|
+
|
|
29
|
+
await TestBed.configureTestingModule({
|
|
30
|
+
declarations: [ConversationHeaderComponent],
|
|
31
|
+
providers: [
|
|
32
|
+
{ provide: AppConfigService, useValue: appConfigStub },
|
|
33
|
+
provideHttpClient(withInterceptorsFromDi()),
|
|
34
|
+
provideHttpClientTesting(),
|
|
35
|
+
],
|
|
36
|
+
})
|
|
37
|
+
.overrideComponent(ConversationHeaderComponent, {
|
|
38
|
+
set: {
|
|
39
|
+
template: `
|
|
40
|
+
<button class="back" (click)="returnHome()">back</button>
|
|
41
|
+
<button class="close-widget" (click)="closeWidget()">closeW</button>
|
|
42
|
+
<button class="toggle-menu" (click)="toggleMenu()">menu</button>
|
|
43
|
+
<button class="close-chat" (click)="closeChat()">closeChat</button>
|
|
44
|
+
<button class="restart" (click)="restartChat()">restart</button>
|
|
45
|
+
<button class="detail" (click)="openDetail()">detail</button>
|
|
46
|
+
<button class="signout" (click)="signOut()">signout</button>
|
|
47
|
+
<button class="sound" (click)="toggleSound()">sound</button>
|
|
48
|
+
<button class="max" (click)="onChangeSize('max')">max</button>
|
|
49
|
+
<button class="min" (click)="onChangeSize('min')">min</button>
|
|
50
|
+
<button class="top" (click)="onChangeSize('top')">top</button>
|
|
51
|
+
<button class="transcript" (click)="dowloadTranscript()">transcript</button>
|
|
52
|
+
`,
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
.compileComponents();
|
|
56
|
+
|
|
35
57
|
fixture = TestBed.createComponent(ConversationHeaderComponent);
|
|
36
58
|
component = fixture.componentInstance;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
component
|
|
59
|
+
httpMock = TestBed.inject(HttpTestingController);
|
|
60
|
+
component.translationMap = new Map([['OPTIONS', 'Opt']]);
|
|
61
|
+
component.senderId = 'sender-1';
|
|
62
|
+
component.idConversation = 'conv-1';
|
|
63
|
+
component.windowContext = window;
|
|
64
|
+
fixture.detectChanges();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
afterEach(() => {
|
|
68
|
+
httpMock.verify();
|
|
40
69
|
});
|
|
41
70
|
|
|
42
71
|
it('should create', () => {
|
|
43
72
|
expect(component).toBeTruthy();
|
|
44
73
|
});
|
|
74
|
+
|
|
75
|
+
describe('constructor / ngOnInit', () => {
|
|
76
|
+
it('should read apiUrl from AppConfigService', () => {
|
|
77
|
+
expect((component as any).API_URL).toBe(apiUrl);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('ngOnInit should add senderId to membersConversation', () => {
|
|
81
|
+
const m = new ConversationHeaderComponent(appConfigStub as unknown as AppConfigService);
|
|
82
|
+
m.senderId = 'u1';
|
|
83
|
+
m.translationMap = new Map();
|
|
84
|
+
m.ngOnInit();
|
|
85
|
+
expect(m.membersConversation).toContain('u1');
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('ngOnChanges', () => {
|
|
90
|
+
it('should run when idConversation is set', () => {
|
|
91
|
+
component.idConversation = 'new-id';
|
|
92
|
+
component.ngOnChanges({
|
|
93
|
+
idConversation: {
|
|
94
|
+
previousValue: undefined,
|
|
95
|
+
currentValue: 'new-id',
|
|
96
|
+
firstChange: true,
|
|
97
|
+
isFirstChange: () => true,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
expect(component).toBeTruthy();
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe('ngAfterViewInit', () => {
|
|
105
|
+
it('should enable header buttons', () => {
|
|
106
|
+
component.isButtonsDisabled = true;
|
|
107
|
+
component.ngAfterViewInit();
|
|
108
|
+
expect(component.isButtonsDisabled).toBe(false);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe('click handlers / outputs', () => {
|
|
113
|
+
it('returnHome should emit onBack', () => {
|
|
114
|
+
spyOn(component.onBack, 'emit');
|
|
115
|
+
component.returnHome();
|
|
116
|
+
expect(component.onBack.emit).toHaveBeenCalled();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('closeWidget should emit onCloseWidget', () => {
|
|
120
|
+
spyOn(component.onCloseWidget, 'emit');
|
|
121
|
+
component.closeWidget();
|
|
122
|
+
expect(component.onCloseWidget.emit).toHaveBeenCalled();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('toggleMenu should flip menu visibility', () => {
|
|
126
|
+
spyOn(component.onMenuOptionShow, 'emit');
|
|
127
|
+
component.isMenuShow = false;
|
|
128
|
+
component.toggleMenu();
|
|
129
|
+
expect(component.onMenuOptionShow.emit).toHaveBeenCalledWith(true);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('closeChat should emit CLOSE option', () => {
|
|
133
|
+
spyOn(component.onMenuOptionClick, 'emit');
|
|
134
|
+
component.closeChat();
|
|
135
|
+
expect(component.onMenuOptionClick.emit).toHaveBeenCalledWith(HEADER_MENU_OPTION.CLOSE);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('restartChat should emit RESTART and close menu', () => {
|
|
139
|
+
spyOn(component.onMenuOptionClick, 'emit');
|
|
140
|
+
spyOn(component.onMenuOptionShow, 'emit');
|
|
141
|
+
component.restartChat();
|
|
142
|
+
expect(component.onMenuOptionClick.emit).toHaveBeenCalledWith(HEADER_MENU_OPTION.RESTART);
|
|
143
|
+
expect(component.onMenuOptionShow.emit).toHaveBeenCalledWith(false);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('openDetail should emit DETAIL', () => {
|
|
147
|
+
spyOn(component.onMenuOptionClick, 'emit');
|
|
148
|
+
component.openDetail();
|
|
149
|
+
expect(component.onMenuOptionClick.emit).toHaveBeenCalledWith(HEADER_MENU_OPTION.DETAIL);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('signOut should emit LOGOUT', () => {
|
|
153
|
+
spyOn(component.onMenuOptionClick, 'emit');
|
|
154
|
+
component.signOut();
|
|
155
|
+
expect(component.onMenuOptionClick.emit).toHaveBeenCalledWith(HEADER_MENU_OPTION.LOGOUT);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('onChangeSize max should emit MAXIMIZE and close menu', () => {
|
|
159
|
+
spyOn(component.onMenuOptionClick, 'emit');
|
|
160
|
+
spyOn(component.onMenuOptionShow, 'emit');
|
|
161
|
+
component.onChangeSize('max');
|
|
162
|
+
expect(component.onMenuOptionClick.emit).toHaveBeenCalledWith(HEADER_MENU_OPTION.MAXIMIZE);
|
|
163
|
+
expect(component.onMenuOptionShow.emit).toHaveBeenCalledWith(false);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it('toggleSound should emit volume option and flip soundEnabled', () => {
|
|
167
|
+
spyOn(component.onMenuOptionClick, 'emit');
|
|
168
|
+
spyOn(component.onMenuOptionShow, 'emit');
|
|
169
|
+
component.soundEnabled = false;
|
|
170
|
+
component.toggleSound();
|
|
171
|
+
expect(component.soundEnabled).toBe(true);
|
|
172
|
+
expect(component.onMenuOptionClick.emit).toHaveBeenCalledWith(HEADER_MENU_OPTION.VOLUME_ON);
|
|
173
|
+
component.toggleSound();
|
|
174
|
+
expect(component.onMenuOptionClick.emit).toHaveBeenCalledWith(HEADER_MENU_OPTION.VOLUME_OFF);
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
describe('dowloadTranscript', () => {
|
|
179
|
+
it('should open transcript URL in windowContext', () => {
|
|
180
|
+
const openSpy = jasmine.createSpy('open');
|
|
181
|
+
component.windowContext = { open: openSpy };
|
|
182
|
+
component.idConversation = 'req-99';
|
|
183
|
+
component.dowloadTranscript();
|
|
184
|
+
expect(openSpy).toHaveBeenCalledWith(apiUrl + 'public/requests/req-99/messages-user.html', '_blank');
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
describe('DOM integration', () => {
|
|
189
|
+
it('should wire back button', () => {
|
|
190
|
+
spyOn(component, 'returnHome');
|
|
191
|
+
const btn = fixture.nativeElement.querySelector('.back');
|
|
192
|
+
btn.click();
|
|
193
|
+
expect(component.returnHome).toHaveBeenCalled();
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
describe('ngOnDestroy', () => {
|
|
198
|
+
it('should clear subscription entries when subscriptions use value.unsubscribe', () => {
|
|
199
|
+
const unsub = jasmine.createSpy('unsubscribe');
|
|
200
|
+
(component as any).subscriptions = [{ value: { unsubscribe: unsub } }];
|
|
201
|
+
component.ngOnDestroy();
|
|
202
|
+
expect(unsub).toHaveBeenCalled();
|
|
203
|
+
expect((component as any).subscriptions.length).toBe(0);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('should not throw when subscriptions is empty', () => {
|
|
207
|
+
(component as any).subscriptions = [];
|
|
208
|
+
expect(() => component.ngOnDestroy()).not.toThrow();
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
describe('onChangeSize edge cases', () => {
|
|
213
|
+
beforeEach(() => {
|
|
214
|
+
spyOn(component.onMenuOptionClick, 'emit');
|
|
215
|
+
spyOn(component.onMenuOptionShow, 'emit');
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it('should emit MINIMIZE for min', () => {
|
|
219
|
+
component.onChangeSize('min');
|
|
220
|
+
expect(component.onMenuOptionClick.emit).toHaveBeenCalledWith(HEADER_MENU_OPTION.MINIMIZE);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('should emit TOP for top', () => {
|
|
224
|
+
component.onChangeSize('top');
|
|
225
|
+
expect(component.onMenuOptionClick.emit).toHaveBeenCalledWith(HEADER_MENU_OPTION.TOP);
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it('should emit nothing for unknown status (only menu close)', () => {
|
|
229
|
+
(component.onMenuOptionClick.emit as jasmine.Spy).calls.reset();
|
|
230
|
+
component.onChangeSize('unknown' as any);
|
|
231
|
+
expect(component.onMenuOptionClick.emit).not.toHaveBeenCalled();
|
|
232
|
+
expect(component.onMenuOptionShow.emit).toHaveBeenCalledWith(false);
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
describe('toggleMenu observable-style flips', () => {
|
|
237
|
+
it('should emit negation when menu already open', () => {
|
|
238
|
+
spyOn(component.onMenuOptionShow, 'emit');
|
|
239
|
+
component.isMenuShow = true;
|
|
240
|
+
component.toggleMenu();
|
|
241
|
+
expect(component.onMenuOptionShow.emit).toHaveBeenCalledWith(false);
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
describe('dowloadTranscript error handling', () => {
|
|
246
|
+
it('should propagate open failure and not emit menu close after throw', () => {
|
|
247
|
+
spyOn(component.onMenuOptionShow, 'emit');
|
|
248
|
+
component.windowContext = {
|
|
249
|
+
open: jasmine.createSpy('open').and.throwError('blocked'),
|
|
250
|
+
};
|
|
251
|
+
expect(() => component.dowloadTranscript()).toThrow();
|
|
252
|
+
expect(component.onMenuOptionShow.emit).not.toHaveBeenCalled();
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
describe('DOM click integration (handlers)', () => {
|
|
257
|
+
const clickClass = (cls: string) => (fixture.nativeElement as HTMLElement).querySelector(cls)?.dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
|
258
|
+
|
|
259
|
+
it('wires close-widget, toggle-menu, transcript', () => {
|
|
260
|
+
spyOn(component, 'closeWidget');
|
|
261
|
+
spyOn(component, 'toggleMenu');
|
|
262
|
+
spyOn(component, 'dowloadTranscript');
|
|
263
|
+
clickClass('.close-widget');
|
|
264
|
+
clickClass('.toggle-menu');
|
|
265
|
+
clickClass('.transcript');
|
|
266
|
+
expect(component.closeWidget).toHaveBeenCalled();
|
|
267
|
+
expect(component.toggleMenu).toHaveBeenCalled();
|
|
268
|
+
expect(component.dowloadTranscript).toHaveBeenCalled();
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
it('wires sound and resize buttons', () => {
|
|
272
|
+
spyOn(component, 'toggleSound');
|
|
273
|
+
spyOn(component, 'onChangeSize');
|
|
274
|
+
clickClass('.sound');
|
|
275
|
+
clickClass('.max');
|
|
276
|
+
expect(component.toggleSound).toHaveBeenCalled();
|
|
277
|
+
expect(component.onChangeSize).toHaveBeenCalledWith('max');
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
describe('ngOnInit edge', () => {
|
|
282
|
+
it('should push undefined senderId when missing', () => {
|
|
283
|
+
const h = new ConversationHeaderComponent(appConfigStub as unknown as AppConfigService);
|
|
284
|
+
h.senderId = undefined as any;
|
|
285
|
+
h.translationMap = new Map();
|
|
286
|
+
h.ngOnInit();
|
|
287
|
+
expect(h.membersConversation.length).toBeGreaterThan(1);
|
|
288
|
+
});
|
|
289
|
+
});
|
|
45
290
|
});
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
<div class="c21-iframe-container" [@enterAnimation]>
|
|
2
|
-
<!-- 'background-color': stylesMap?.get('backgroundColor'), 'color': styleMap?.get('foregroundColor'), 'background-image': 'linear-gradient( 180grad,' + stylesMap?.get('themeColor')+','+ convertColorToRGBA(stylesMap?.get('themeColor'), 50)+')' -->
|
|
3
2
|
<div class="c21-iframe-header c21-header" [ngStyle]="{ 'background-image': stylesMap?.get('colorGradient')}">
|
|
4
|
-
|
|
3
|
+
|
|
5
4
|
<!-- ICON BACK CHAT -->
|
|
6
|
-
<button
|
|
7
|
-
|
|
5
|
+
<button type="button"
|
|
6
|
+
class="c21-header-button c21-left c21-button-clean"
|
|
7
|
+
[attr.aria-label]="translationMap?.get('CLOSE') || 'Close'"
|
|
8
|
+
(click)="returnClose()">
|
|
9
|
+
<svg aria-hidden="true" focusable="false" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
|
|
8
10
|
width="24px" height="24px" viewBox="0 0 24 24">
|
|
9
11
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
10
12
|
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z" />
|
|
11
|
-
<title id="altIconTitle">{{ translationMap?.get('CLOSE') }}</title>
|
|
12
13
|
</svg>
|
|
13
14
|
</button>
|
|
14
15
|
|
|
15
16
|
<!-- ICON OPEN EXTERNAL -->
|
|
16
|
-
<button *ngIf="openExternalLinkButton"
|
|
17
|
-
|
|
17
|
+
<button *ngIf="openExternalLinkButton"
|
|
18
|
+
type="button"
|
|
19
|
+
class="c21-header-button c21-right c21-button-clean"
|
|
20
|
+
aria-label="Open in a new window"
|
|
21
|
+
(click)="returnOpenExternal()">
|
|
22
|
+
<svg aria-hidden="true" focusable="false" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
|
|
18
23
|
width="24px" height="24px" viewBox="0 0 24 24">
|
|
19
24
|
<path d="M0 0h24v24H0z" fill="none"/>
|
|
20
25
|
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/>
|
|
@@ -27,10 +32,19 @@
|
|
|
27
32
|
</div>
|
|
28
33
|
</div>
|
|
29
34
|
<div class="c21-iframe">
|
|
30
|
-
<div
|
|
35
|
+
<div *ngIf="!hideSpinner" class="lds-roller" aria-hidden="true">
|
|
31
36
|
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
|
|
32
37
|
</div>
|
|
33
38
|
|
|
34
|
-
<iframe
|
|
39
|
+
<iframe id="contentFrame" #iframe
|
|
40
|
+
allowfullscreen
|
|
41
|
+
[title]="button?.value || 'Embedded conversation panel'"
|
|
42
|
+
sandbox="allow-scripts allow-same-origin allow-popups allow-forms allow-popups-to-escape-sandbox"
|
|
43
|
+
referrerpolicy="strict-origin-when-cross-origin"
|
|
44
|
+
loading="lazy"
|
|
45
|
+
width="100%" height="100%" style="border:none;"
|
|
46
|
+
[src]="url"
|
|
47
|
+
(load)="onIframeLoaded($event)"
|
|
48
|
+
(error)="onError($event)"></iframe>
|
|
35
49
|
</div>
|
|
36
50
|
</div>
|
|
@@ -1,29 +1,101 @@
|
|
|
1
1
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
2
|
-
import {
|
|
2
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
3
3
|
|
|
4
4
|
import { ConversationInternalFrameComponent } from './conversation-internal-frame.component';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { CustomLogger } from 'src/chat21-core/providers/logger/customLogger';
|
|
6
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
7
|
+
describe('ConversationInternalFrameComponent', () => {
|
|
7
8
|
let component: ConversationInternalFrameComponent;
|
|
8
9
|
let fixture: ComponentFixture<ConversationInternalFrameComponent>;
|
|
10
|
+
const ngxlogger = jasmine.createSpyObj('NGXLogger', ['log', 'trace', 'debug', 'warn', 'error', 'info']);
|
|
11
|
+
const customLogger = new CustomLogger(ngxlogger);
|
|
9
12
|
|
|
10
13
|
beforeEach(waitForAsync(() => {
|
|
14
|
+
LoggerInstance.setInstance(customLogger);
|
|
11
15
|
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [
|
|
13
|
-
imports: [
|
|
14
|
-
BrowserAnimationsModule
|
|
15
|
-
]
|
|
16
|
+
declarations: [ConversationInternalFrameComponent],
|
|
17
|
+
imports: [BrowserAnimationsModule],
|
|
16
18
|
})
|
|
17
|
-
|
|
19
|
+
.overrideComponent(ConversationInternalFrameComponent, {
|
|
20
|
+
set: {
|
|
21
|
+
template: `
|
|
22
|
+
<iframe #iframe title="inner" src="about:blank"></iframe>
|
|
23
|
+
<button type="button" (click)="returnClose()">close</button>
|
|
24
|
+
<button type="button" (click)="returnOpenExternal()">ext</button>
|
|
25
|
+
`,
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
.compileComponents();
|
|
18
29
|
}));
|
|
19
30
|
|
|
20
31
|
beforeEach(() => {
|
|
21
32
|
fixture = TestBed.createComponent(ConversationInternalFrameComponent);
|
|
22
33
|
component = fixture.componentInstance;
|
|
34
|
+
component.button = { link: 'https://example.com/path', value: 'Test' };
|
|
35
|
+
component.translationMap = new Map();
|
|
36
|
+
component.stylesMap = new Map();
|
|
23
37
|
fixture.detectChanges();
|
|
24
38
|
});
|
|
25
39
|
|
|
26
40
|
it('should create', () => {
|
|
27
41
|
expect(component).toBeTruthy();
|
|
28
42
|
});
|
|
43
|
+
|
|
44
|
+
describe('ngOnInit', () => {
|
|
45
|
+
it('should trust resource URL from button.link', () => {
|
|
46
|
+
expect(component.url).toBeDefined();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should leave url unset when button has no link', () => {
|
|
50
|
+
const f = TestBed.createComponent(ConversationInternalFrameComponent);
|
|
51
|
+
const c = f.componentInstance;
|
|
52
|
+
c.button = { value: 'x' };
|
|
53
|
+
c.ngOnInit();
|
|
54
|
+
expect(c.url).toBeUndefined();
|
|
55
|
+
f.destroy();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe('ngAfterViewInit', () => {
|
|
60
|
+
it('should run without throwing when iframe is present', () => {
|
|
61
|
+
expect(() => component.ngAfterViewInit()).not.toThrow();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
describe('events', () => {
|
|
66
|
+
it('returnClose should emit onClose and set closed state', () => {
|
|
67
|
+
spyOn(component.onClose, 'emit');
|
|
68
|
+
component.returnClose();
|
|
69
|
+
expect(component.isOpen).toBe('closed');
|
|
70
|
+
expect(component.onClose.emit).toHaveBeenCalled();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('returnOpenExternal should emit button payload', () => {
|
|
74
|
+
spyOn(component.onOpenExternal, 'emit');
|
|
75
|
+
component.returnOpenExternal();
|
|
76
|
+
expect(component.onOpenExternal.emit).toHaveBeenCalledWith(component.button);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('onIframeLoaded should hide spinner', () => {
|
|
80
|
+
component.hideSpinner = false;
|
|
81
|
+
component.onIframeLoaded({});
|
|
82
|
+
expect(component.hideSpinner).toBe(true);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('onError should log', () => {
|
|
86
|
+
spyOn((component as any).logger, 'error');
|
|
87
|
+
component.onError({ message: 'x' });
|
|
88
|
+
expect((component as any).logger.error).toHaveBeenCalled();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
describe('ngOnDestroy', () => {
|
|
93
|
+
it('should reset url and spinner', () => {
|
|
94
|
+
component.url = {} as any;
|
|
95
|
+
component.hideSpinner = true;
|
|
96
|
+
component.ngOnDestroy();
|
|
97
|
+
expect(component.url).toBeNull();
|
|
98
|
+
expect(component.hideSpinner).toBe(false);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
29
101
|
});
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
<div id='c21-preview'
|
|
1
|
+
<div id='c21-preview'
|
|
2
|
+
role="dialog"
|
|
3
|
+
aria-modal="true"
|
|
4
|
+
cdkTrapFocus
|
|
5
|
+
[cdkTrapFocusAutoCapture]="true"
|
|
6
|
+
[attr.aria-label]="translationMap?.get('LABEL_PREVIEW')">
|
|
2
7
|
<div class="modal-preview-image" #divPreview id="divPreview">
|
|
3
8
|
|
|
4
9
|
<div class="c21-header">
|
|
5
10
|
<div class="c21-header-container">
|
|
6
11
|
|
|
7
12
|
<div class="c21-header-content">
|
|
8
|
-
<!-- ICON CLOSE
|
|
9
|
-
<button
|
|
10
|
-
|
|
13
|
+
<!-- ICON CLOSE PREVIEW -->
|
|
14
|
+
<button type="button"
|
|
15
|
+
class="c21-header-button c21-right c21-close c21-button-clean"
|
|
16
|
+
[attr.aria-label]="translationMap?.get('BUTTON_CLOSE_PREVIEW') || translationMap?.get('CLOSE')"
|
|
17
|
+
[ngStyle]="{'display': (hideHeaderCloseButton)?'none':'flex'}"
|
|
18
|
+
(click)="onClickClose()">
|
|
19
|
+
<svg aria-hidden="true" focusable="false" [ngStyle]="{'fill': stylesMap?.get('themeColor') }" xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
|
11
20
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
12
21
|
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" />
|
|
13
|
-
<title id="altIconTitle">{{ translationMap?.get('CLOSE') }}</title>
|
|
14
22
|
</svg>
|
|
15
23
|
</button>
|
|
16
24
|
|
|
17
|
-
<!-- TITLE -->
|
|
18
|
-
<!-- <div class="c21-title" [ngStyle]="{'color': stylesMap?.get('themeColor') }">
|
|
19
|
-
<div class="titleText">{{ translationMap?.get('LABEL_PREVIEW') }}</div>
|
|
20
|
-
</div> -->
|
|
21
25
|
</div>
|
|
22
26
|
|
|
23
27
|
</div>
|
|
@@ -37,36 +41,38 @@
|
|
|
37
41
|
|
|
38
42
|
<div id="c21-footer">
|
|
39
43
|
<div class="visible-text-area">
|
|
40
|
-
<textarea
|
|
44
|
+
<textarea
|
|
41
45
|
start-focus-chat21-conversation-preview-component
|
|
42
|
-
inputTextArea
|
|
43
|
-
#textbox
|
|
44
|
-
|
|
45
|
-
aria-
|
|
46
|
-
rows="1"
|
|
47
|
-
id="chat21-main-message-context-preview"
|
|
46
|
+
inputTextArea
|
|
47
|
+
#textbox
|
|
48
|
+
[attr.aria-label]="translationMap?.get('LABEL_PLACEHOLDER')"
|
|
49
|
+
[attr.aria-multiline]="true"
|
|
50
|
+
rows="1"
|
|
51
|
+
id="chat21-main-message-context-preview"
|
|
48
52
|
class='f21textarea c21-button-clean'
|
|
49
53
|
[(ngModel)]="textInputTextArea"
|
|
50
|
-
(ngModelChange)="onTextAreaChange()"
|
|
51
|
-
(keypress)="onkeypress($event)"
|
|
54
|
+
(ngModelChange)="onTextAreaChange()"
|
|
52
55
|
(keydown)="onkeydown($event)"
|
|
53
56
|
(paste)="onPaste($event)"
|
|
54
57
|
placeholder="{{ translationMap?.get('LABEL_PLACEHOLDER') }}">
|
|
55
58
|
</textarea>
|
|
56
59
|
|
|
57
60
|
</div>
|
|
58
|
-
<
|
|
61
|
+
<button type="button"
|
|
62
|
+
class="chat21-textarea-button c21-button-clean"
|
|
63
|
+
id="chat21-button-send"
|
|
64
|
+
[class.active]="!isFilePendingToLoad"
|
|
65
|
+
[attr.aria-label]="translationMap?.get('BUTTON_SEND_MESSAGE')"
|
|
66
|
+
(click)="onSendPressed($event)">
|
|
59
67
|
<span class="v-align-center">
|
|
60
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
|
|
68
|
+
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
61
69
|
<path d="M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"/>
|
|
62
70
|
</svg>
|
|
63
71
|
</span>
|
|
64
|
-
</
|
|
72
|
+
</button>
|
|
65
73
|
|
|
66
74
|
</div>
|
|
67
75
|
|
|
68
76
|
</div>
|
|
69
77
|
|
|
70
78
|
</div>
|
|
71
|
-
<span id="testFocus" tabindex="1599" onFocus="document.querySelector('[start-focus-chat21-conversation-preview-component]').focus()"></span>
|
|
72
|
-
<span id="altTextArea" style="display: none">scrivi la tua domanda</span>
|