@chat21/chat21-web-widget 5.1.20-rc2 → 5.1.23

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.
@@ -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
- - name: Check out the repo
16
- uses: actions/checkout@v2
17
-
18
- - name: Set up Docker Buildx
19
- uses: docker/setup-buildx-action@v2
20
-
21
- - name: Log in to Docker Hub
22
- uses: docker/login-action@v2
23
- with:
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
- - '**' # Trigger su qualsiasi tag
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
- - name: Check out the repo
15
- uses: actions/checkout@v2
16
-
17
- - name: Set up Docker Buildx
18
- uses: docker/setup-buildx-action@v2
19
-
20
- - name: Log in to Docker Hub
21
- uses: docker/login-action@v2
22
- with:
23
- username: ${{ secrets.DOCKERHUB_USERNAME }}
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,16 +6,19 @@
6
6
  ### **Copyrigth**:
7
7
  *Tiledesk SRL*
8
8
 
9
- # 5.1.20-rc2
9
+ # 5.1.23
10
10
  - **changed**: API for upload a file/iamges
11
- - **changed**: marked pipe do not render /n
12
11
 
13
- # 5.1.20-rc1
14
- - **changed**: API for upload a file/iamges
12
+ # 5.1.22
13
+ - **changed**: Updated Launch.js for Wix and Shopify by bypassing scrdoc
15
14
 
16
- # 5.1.19
15
+ # 5.1.21
16
+ - **bug fixed**: saved the widget's size state to local storage (in HP conversations)
17
17
 
18
- # 5.1.19-rc1
18
+ # 5.1.20
19
+ - **changed**: marked pipe do not render /n
20
+
21
+ # 5.1.19
19
22
  - **bug fixed**: show bottom scroll button and unread message badge only when I'm not at the bottom of the page
20
23
  - **changed**: allow HTML code to be inserted into messages, but do not parse the code. Ensure coexistence with Markdown.
21
24
  - **bug fixed**: after sending a multi-line message, the text area remains open on multiple lines.
@@ -25,7 +28,6 @@
25
28
  - **changed**: saved the widget's size state to local storage. The parameter flow is (default → storage → settings → URL)
26
29
 
27
30
  # 5.1.18
28
- # 5.1.15-rc3
29
31
  - **added**: Implemented Shadow DOM in the text component to isolate HTML and Markdown rendering in a safe and protected context
30
32
  - **changed**: Adapted text component styles to support Shadow DOM (removed ::ng-deep, added styles for common markdown elements)
31
33
  - **security**: HTML/Markdown content is now rendered in an isolated Shadow DOM, improving security and preventing interference with the rest of the application
@@ -36,12 +38,6 @@
36
38
  # 5.1.16
37
39
  - **changed**: "close chat" header conversation menu button enabled in chatbot-panel.html
38
40
 
39
- # 5.1.15-rc2
40
- - **bug-fixed**: Bug fix for ifame message width
41
-
42
- # 5.1.15-rc1
43
- - **changed**: Load local translations before remote ones
44
-
45
41
  # 5.1.15
46
42
  - **changed**: Load local translations before remote ones
47
43
 
@@ -50,56 +46,14 @@
50
46
 
51
47
  # 5.1.13
52
48
  - **bug-fixed**: set default widget size
53
-
54
- # 5.1.7-rc16
55
- - **bug-fixed**: set default widget size
56
-
57
- # 5.1.7-rc15
58
- - **bug-fixed**: set the color of the buttons with visibility control to the font color
59
-
60
- # 5.1.7-rc14
61
- - **bug-fixed**: departmentId and departmentName is incorrect in attributes
62
-
63
- # 5.1.7-rc13
64
- - **changed**: Force authentication if ageChangeVisibilityDesktop or PageChangeVisibilityMobile is OPEN
65
-
66
- # 5.1.7-rc12
67
- - **changed**: Set the default autoStart value to false
68
- - **added**: Added the open widget loading spinner
69
- - **changed**: Load the widget without authentication and display the speech bubble
70
-
71
- # 5.1.7-rc11
72
- - **changed**: set default value autoStart false
73
- - **added**:added loading spinner
74
-
75
- # 5.1.7-rc10
76
- - **changed**: load widget without authentication and display the balloon
77
-
78
- # 5.1.7-rc9
79
- - **removed**: 'DOMAIN_NOT_ALLOWED' in textarea footer component
80
-
81
- # 5.1.7-rc8
82
- # changes in the branch
83
- - **changed**: Load local translations before remote ones
84
- - **bug-fixed**: set default widget size
85
49
  - **changed**: Updated the translations of the tooltips in the footer-component
86
50
  - **changed**: Refactored the network-offline component and made it generic for displaying errors (now error-alert.component)
87
-
88
- # 5.1.7-rc7
89
- - **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
90
-
91
- # 5.1.7-rc6
92
- - **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
51
+ - **bug-fixed**: set the color of the buttons with visibility control to the font color (setButtonColors function)
93
52
 
94
53
  # 5.1.12
95
54
  - **bug-fixed**: check showEmojiFooterButton to enable/disable emojii
96
55
  - **bug-fixed**: markdown is fired as an emojii and blocked by isEmojii check fn
97
56
 
98
- # 5.1.7-rc7
99
- - **bug-fixed**: button new_conversation always appear. added subscription to conversationAdded
100
-
101
- # 5.1.7-rc6
102
- - **added**: Added MAX_ATTACHMENT_ERROR error message when uploading a file larger than 10 MB
103
57
 
104
58
  # 5.1.7-rc5
105
59
  - **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 --platform=$BUILDPLATFORM node:20.12.2-alpine3.19 as builder
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
- FROM --platform=$BUILDPLATFORM nginx:1.14.1-alpine
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", "-c", "envsubst < /usr/share/nginx/html/widget-config-template.json > /usr/share/nginx/html/widget-config.json && exec nginx -g 'daemon off;'"]
36
+ CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/widget-config-template.json > /usr/share/nginx/html/widget-config.json && exec nginx -g 'daemon off;'"]
package/angular.json CHANGED
@@ -44,8 +44,7 @@
44
44
  "src/environments/real_data/widget-config-docker.json",
45
45
  "src/environments/real_data/widget-config-native-mqtt.json",
46
46
  "src/environments/real_data/widget-config-native-prod.json",
47
- "src/environments/real_data/widget-config-aws-stage.json",
48
- "src/environments/real_data/widget-config-aws-aruba.json"
47
+ "src/environments/real_data/widget-config-aws-stage.json"
49
48
  ],
50
49
  "styles": [
51
50
  "src/app/sass/styles.scss"
@@ -2,16 +2,8 @@
2
2
  version=`node -e 'console.log(require("./package.json").version)'`
3
3
  echo "version $version"
4
4
 
5
- npm i
6
-
7
- cp src/environments/real_data/environment.pre.ts src/environments/environment.pre.ts
8
-
9
5
  ng build --configuration="pre" --aot=true --base-href
10
6
 
11
- ### SET HASHING : START ###
12
- cp ./src/launch_template.js ./dist/browser/launch.js
13
- node ./src/build_launch.js
14
- ### SET HASHING : END ###
15
7
 
16
8
  # ########## --->>>> NATIVE-MQTT folder START <<<<<------ ########## #
17
9
 
@@ -31,17 +23,15 @@ node ./src/build_launch.js
31
23
 
32
24
 
33
25
  # ########## --->>>> FIREBASE folder START <<<<<------ ########## #
34
- cd dist/browser
35
- aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300 --exclude='launch.js' #7days
36
- aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
37
- aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control max-age=300 --exclude='launch.js' #7days
38
- aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control "no-store,no-cache,private" --exclude='*' --include='launch.js'
39
- cd ../..
26
+ cd dist
27
+ aws s3 sync . s3://tiledesk-widget-pre/v5/$version/ --cache-control max-age=300
28
+ aws s3 sync . s3://tiledesk-widget-pre/v5/ --cache-control max-age=300
29
+ cd ..
40
30
 
41
- aws cloudfront create-invalidation --distribution-id E2V5O0YPR61V8P --paths "/*"
42
-
43
- git restore src/environments/environment.pre.ts
31
+ #aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*"
32
+ cd ..
44
33
 
34
+ aws cloudfront create-invalidation --distribution-id E2V5O0YPR61V8P --paths "/*"
45
35
  # echo new version deployed $NEW_VER/$NEW_BUILD/ on s3://tiledesk-widget-pre/v2
46
36
  echo new version deployed $version/ on s3://tiledesk-widget-pre/v5 and s3://tiledesk-widget-pre/v5/$version/
47
37
  echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget-pre/v5/index.html
@@ -35,7 +35,7 @@ aws cloudfront create-invalidation --distribution-id E3EJDWEHY08CZZ --paths "/*
35
35
 
36
36
  git restore src/environments/environment.prod.ts
37
37
 
38
- echo new version deployed $version on s3://tiledesk-widget/v5
39
- echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget/v5/index.html
40
- echo https://widget.tiledesk.com/v5/index.html
41
- echo https://widget.tiledesk.com/v5/$version/index.html
38
+ echo new version deployed $version on s3://tiledesk-widget/v6
39
+ echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-widget/v6/index.html
40
+ echo https://widget.tiledesk.com/v6/index.html
41
+ echo https://widget.tiledesk.com/v6/$version/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.20-rc2",
4
+ "version": "5.1.23",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -145,12 +145,5 @@
145
145
  <chat-launcher-button *ngIf="isInitialized"
146
146
  (onButtonClicked)="onOpenCloseWidget($event)">
147
147
  </chat-launcher-button>
148
-
149
- <!-- Loading Spinner -->
150
- <div *ngIf="loading" class="tiledesk-loading-overlay">
151
- <div class="tiledesk-loading-spinner">
152
- <div class="spinner-circle"></div>
153
- <div class="loading-text">{{ translationMap.get('LABEL_LOADING') }}</div>
154
- </div>
155
- </div>
148
+
156
149
  </div>
@@ -761,63 +761,4 @@ chat-root {
761
761
  }
762
762
  }
763
763
 
764
- // ========= BEGIN: LOADING SPINNER ========= //
765
- .tiledesk-loading-overlay {
766
- position: absolute;
767
- top: 0;
768
- left: 0;
769
- width: 100%;
770
- height: 100%;
771
- background-color: rgba(248, 249, 250, 0.95);
772
- display: flex;
773
- justify-content: center;
774
- align-items: center;
775
- z-index: 9999;
776
- backdrop-filter: blur(2px);
777
- }
778
-
779
- .tiledesk-loading-spinner {
780
- display: flex;
781
- flex-direction: column;
782
- align-items: center;
783
- gap: 16px;
784
- }
785
-
786
- .spinner-circle {
787
- width: 50px;
788
- height: 50px;
789
- border: 4px solid rgba(59, 130, 246, 0.2);
790
- border-top-color: #3b82f6;
791
- border-radius: 50%;
792
- animation: spin 0.8s linear infinite;
793
- }
794
-
795
- @keyframes spin {
796
- 0% {
797
- transform: rotate(0deg);
798
- }
799
- 100% {
800
- transform: rotate(360deg);
801
- }
802
- }
803
-
804
- .loading-text {
805
- font-family: var(--font-family-bubble-message, 'Roboto', 'Google Sans', Helvetica, Arial, sans-serif);
806
- font-size: 14px;
807
- font-weight: 500;
808
- color: #3b82f6;
809
- letter-spacing: 0.5px;
810
- animation: pulse 1.5s ease-in-out infinite;
811
- }
812
-
813
- @keyframes pulse {
814
- 0%, 100% {
815
- opacity: 1;
816
- }
817
- 50% {
818
- opacity: 0.5;
819
- }
820
- }
821
- // ========= END: LOADING SPINNER ========= //
822
-
823
764
  }
@@ -106,10 +106,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
106
106
 
107
107
  forceDisconnect: boolean = false;
108
108
 
109
- //network status
110
- isOnline: boolean = true;
111
- loading: boolean = false;
112
-
113
109
  // alert error message
114
110
  isShowErrorMessage: boolean = false;
115
111
  errorMessage: string = '';
@@ -153,7 +149,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
153
149
  this.logger.info('[APP-CONF]---------------- ngAfterViewInit: APP.COMPONENT ---------------- ')
154
150
 
155
151
  // Initialize translation map and enable buttons
156
- const keys = ['MAXIMIZE', 'MINIMIZE', 'CENTER', 'BUTTON_CLOSE_TO_ICON', 'LABEL_LOADING'];
152
+ const keys = ['MAXIMIZE', 'MINIMIZE', 'CENTER', 'BUTTON_CLOSE_TO_ICON'];
157
153
  this.translationMap = this.translateService.translateLanguage(keys);
158
154
  this.isButtonsDisabled = false;
159
155
 
@@ -320,15 +316,8 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
320
316
  this.g.setIsOpen(isOpen)
321
317
  this.appStorageService.setItem('isOpen', isOpen)
322
318
  }
323
-
324
- if(this.g.onPageChangeVisibilityDesktop === 'last'){
325
- this.logger.debug('[APP-COMP2] ------this.g.isOpen: ', this.g.isOpen)
326
- if(this.g.isOpen){
327
- this.g.autoStart = true;
328
- }
329
- }
330
-
331
-
319
+
320
+
332
321
  /**CHECK IF JWT IS IN URL PARAMETERS */
333
322
  this.logger.debug('[APP-COMP] check if token is passed throw url: ', this.g.jwt);
334
323
  if (this.g.jwt) {
@@ -365,6 +354,10 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
365
354
  this.subscriptions.push(obsSettingsService);
366
355
  this.globalSettingsService.initWidgetParamiters(this.g, this.el);
367
356
 
357
+ // SET AUDIO
358
+ this.audio = new Audio();
359
+ this.audio.src = this.g.baseLocation + URL_SOUND_LIST_CONVERSATION;
360
+ this.audio.load();
368
361
  }
369
362
 
370
363
  private initAll() {
@@ -455,7 +448,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
455
448
  that.triggerOnAuthStateChanged(that.stateLoggedUser);
456
449
  that.logger.debug('[APP-COMP] 1 - IMPOSTO STATO CONNESSO UTENTE ', autoStart);
457
450
 
458
- this.initAudioNotification()
451
+
459
452
 
460
453
  new Promise(async (resolve, reject)=> {
461
454
  that.typingService.initialize(this.g.tenant);
@@ -481,30 +474,26 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
481
474
  that.listenToWidgetClick()
482
475
  }
483
476
 
484
- /** DDP IF AUTOSTART IS FALSE, SHOW WIDGET */
485
- if(!autoStart){
486
- that.logger.info('[APP-COMP] AUTOSTART IS FALSE AND LOGGED SUCCESSFULLY ');
487
- this.g.setParameter('isShown', true, true);
488
- }
489
477
 
490
478
 
491
479
  } else if (state && state === AUTH_STATE_OFFLINE && !this.forceDisconnect) {
492
480
  /** non sono loggato */
493
481
  that.logger.info('[APP-COMP] OFFLINE - NO CURRENT USER AUTENTICATE: ');
494
482
  that.g.setParameter('isLogged', false);
495
- // that.hideWidget();
483
+ that.hideWidget();
496
484
  // that.g.setParameter('isShown', false, true);
497
485
  that.triggerOnAuthStateChanged(that.stateLoggedUser);
498
- if (autoStart || this.g.onPageChangeVisibilityDesktop === 'open' || this.g.onPageChangeVisibilityMobile === 'open') {
486
+ if (autoStart) {
499
487
  that.authenticate();
500
488
  }
501
- } else if(state && state === AUTH_STATE_CLOSE ){
489
+ }else if(state && state === AUTH_STATE_CLOSE ){
502
490
  that.logger.info('[APP-COMP] CLOSE - CHANNEL CLOSED: ', this.chatManager);
503
491
  if(this.g.recipientId){
504
492
  this.chatManager.removeConversationHandler(this.g.recipientId)
505
493
  this.g.recipientId = null;
506
494
  }
507
- }
495
+ }
496
+
508
497
 
509
498
  });
510
499
  this.subscriptions.push(subAuthStateChanged);
@@ -749,8 +738,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
749
738
  // divWidgetContainer.style.display = 'block';
750
739
  // }
751
740
  // }, 500);
752
-
753
- this.loading = false;
754
741
  }
755
742
  // ========= end:: START UI ============//
756
743
 
@@ -859,13 +846,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
859
846
  this.appStorageService.setItem('attributes', JSON.stringify(attributes));
860
847
  return attributes;
861
848
  }
862
-
863
- // SET AUDIO
864
- private initAudioNotification(){
865
- this.audio = new Audio();
866
- this.audio.src = this.g.baseLocation + URL_SOUND_LIST_CONVERSATION;
867
- this.audio.load();
868
- }
849
+
869
850
 
870
851
  private async initConversationsHandler(tenant: string, senderId: string) {
871
852
  this.logger.debug('[APP-COMP] initialize: ListConversationsComponent');
@@ -1624,46 +1605,23 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1624
1605
  this.f21_close();
1625
1606
  }
1626
1607
 
1627
-
1628
- /** DDP reload widget */
1629
- async reloadWidget() {
1630
- this.openCloseWidget();
1631
- this.logger.debug('[APP-COMP-1] AAA - hideWidget');
1632
- await Promise.all([
1633
- this.authenticate(),
1634
- // this.initAll()
1635
- ]);
1636
- this.logger.debug('[APP-COMP-1] CCC - showWidget');
1637
- }
1638
-
1639
-
1640
1608
  /**
1641
1609
  * LAUNCHER BUTTON:
1642
1610
  * onClick button open/close widget
1643
1611
  */
1644
1612
  onOpenCloseWidget($event) {
1645
- this.logger.debug('[APP-COMP] onOpenCloseWidget', $event, this.g.isLogged);
1646
- if(!this.g.isLogged){
1647
- this.reloadWidget();
1648
- } else {
1649
- this.openCloseWidget();
1650
- }
1651
- }
1652
-
1653
- /** DDP show widget */
1654
- openCloseWidget() {
1655
1613
  this.g.setParameter('displayEyeCatcherCard', 'none');
1656
1614
  // const conversationActive: ConversationModel = JSON.parse(this.appStorageService.getItem('activeConversation'));
1657
1615
  const recipientId : string = this.appStorageService.getItem('recipientId')
1658
1616
  this.g.setParameter('recipientId', recipientId);
1659
1617
  this.logger.debug('[APP-COMP] openCloseWidget', recipientId, this.g.isOpen, this.g.startFromHome);
1660
-
1661
1618
  if (this.g.isOpen === false) {
1662
1619
  if(this.forceDisconnect){
1663
1620
  this.logger.log('[FORCE] onOpenCloseWidget --> reconnect', this.forceDisconnect)
1664
1621
  this.messagingAuthService.createCustomToken(this.g.tiledeskToken)
1665
1622
  this.forceDisconnect = false;
1666
1623
  }
1624
+
1667
1625
  if (!recipientId) {
1668
1626
  if(this.g.singleConversation){
1669
1627
  this.isOpenHome = false;
@@ -1683,22 +1641,29 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1683
1641
  this.isOpenHome = false;
1684
1642
  this.isOpenConversation = true;
1685
1643
  this.startUI()
1644
+ // this.isOpenSelectionDepartment = false;
1686
1645
  }
1646
+ // if (!conversationActive && !this.g.startFromHome) {
1647
+ // this.isOpenHome = false;
1648
+ // this.isOpenConversation = true;
1649
+ // this.startNwConversation();
1650
+ // } else if (conversationActive) {
1651
+ // this.isOpenHome = false;
1652
+ // this.isOpenConversation = true;
1653
+ // }
1654
+ // this.g.startFromHome = true;
1687
1655
  this.triggerOnOpenEvent();
1656
+
1688
1657
  } else {
1689
1658
  this.triggerOnCloseEvent();
1690
1659
  }
1691
1660
  //change status to the widget
1692
1661
  this.g.setIsOpen(!this.g.isOpen);
1693
1662
  this.appStorageService.setItem('isOpen', this.g.isOpen);
1694
- //show loading if widget is open and user is not logged
1695
- if(this.g.isOpen === true && !this.g.isLogged){
1696
- this.loading = true;
1697
- }
1663
+
1698
1664
  // this.saveBadgeNewConverstionNumber();
1699
1665
  }
1700
1666
 
1701
-
1702
1667
  /**
1703
1668
  * MODAL SELECTION DEPARTMENT:
1704
1669
  * selected department
@@ -2073,27 +2038,50 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
2073
2038
  }
2074
2039
  }
2075
2040
 
2076
- onWidgetSizeChange(mode: 'min' | 'max' | 'top') {
2077
- var tiledeskDiv = this.g.windowContext.window.document.getElementById('tiledeskdiv');
2078
- this.g.size = mode;
2041
+ onWidgetSizeChange(mode: any) {
2042
+ const normalize = (val: any): 'min' | 'max' | 'top' => {
2043
+ const v = (typeof val === 'string') ? val.toLowerCase().trim() : '';
2044
+ return (v === 'min' || v === 'max' || v === 'top') ? (v as any) : 'min';
2045
+ };
2046
+ const normalizedMode = normalize(mode);
2047
+
2048
+ const tiledeskDiv = this.g.windowContext?.window?.document?.getElementById('tiledeskdiv');
2049
+ this.g.size = normalizedMode;
2050
+ if (!tiledeskDiv) {
2051
+ // Widget container not yet available; still persist choice for later restores.
2052
+ try {
2053
+ this.appStorageService.setItem('size', normalizedMode);
2054
+ } catch (e) {
2055
+ this.logger.warn('[APP-COMP] onWidgetSizeChange > cannot persist size', e);
2056
+ }
2057
+ return;
2058
+ }
2059
+
2079
2060
  let parent = tiledeskDiv.parentElement as HTMLElement | null;
2080
2061
 
2081
- if(mode==='max'){
2062
+ if(normalizedMode==='max'){
2082
2063
  tiledeskDiv.classList.add('max-size')
2083
2064
  tiledeskDiv.classList.remove('min-size')
2084
2065
  tiledeskDiv.classList.remove('top-size')
2085
2066
  if(parent) parent.classList.remove('overlay--popup');
2086
- } else if(mode==='min'){
2067
+ } else if(normalizedMode==='min'){
2087
2068
  tiledeskDiv.classList.add('min-size')
2088
2069
  tiledeskDiv.classList.remove('max-size')
2089
2070
  tiledeskDiv.classList.remove('top-size')
2090
2071
  if(parent) parent.classList.remove('overlay--popup');
2091
- } else if(mode=== 'top'){
2072
+ } else if(normalizedMode=== 'top'){
2092
2073
  tiledeskDiv.classList.add('top-size')
2093
2074
  tiledeskDiv.classList.remove('max-size')
2094
2075
  tiledeskDiv.classList.remove('min-size')
2095
2076
  if(parent) parent.classList.add('overlay--popup');
2096
2077
  }
2078
+
2079
+ // Persist size changes also from the home (conversations list) view.
2080
+ try {
2081
+ this.appStorageService.setItem('size', normalizedMode);
2082
+ } catch (e) {
2083
+ this.logger.warn('[APP-COMP] onWidgetSizeChange > cannot persist size', e);
2084
+ }
2097
2085
  }
2098
2086
 
2099
2087
  /**
@@ -470,7 +470,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
470
470
  return this.isConversationArchived;
471
471
  }
472
472
 
473
- // //FALLBACK TO TILEDESK
473
+ //FALLBACK TO TILEDESK
474
474
  const requests_list = await this.tiledeskRequestService.getMyRequests().catch(err => {
475
475
  this.logger.error('[CONV-COMP] getConversationDetail: error getting request from Tiledesk', err);
476
476
  this.isConversationArchived=true
@@ -488,9 +488,9 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
488
488
  return this.isConversationArchived
489
489
  }
490
490
 
491
- this.isConversationArchived = false;
492
- return null;
493
- }
491
+ this.isConversationArchived = true;
492
+ return null;
493
+ }
494
494
 
495
495
  /**
496
496
  * this.g.recipientId:
@@ -840,20 +840,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
840
840
  this.subscriptions.push(subscribe);
841
841
  }
842
842
 
843
- subscribtionKey = 'conversationsAdded';
844
- subscribtion = this.subscriptions.find(item => item.key === subscribtionKey);
845
- if(!subscribtion){
846
-
847
- subscribtion = this.chatManager.conversationsHandlerService.conversationChanged.pipe(takeUntil(this.unsubscribe$)).subscribe((conversation) => {
848
- this.logger.debug('[CONV-COMP] ***** DATAIL conversationsChanged *****', conversation, this.conversationWith, this.isConversationArchived);
849
- if(conversation && conversation.recipient === this.conversationId){
850
- this.isConversationArchived = false
851
- }
852
- });
853
- const subscribe = {key: subscribtionKey, value: subscribtion };
854
- this.subscriptions.push(subscribe);
855
- }
856
-
857
843
  subscribtionKey = 'messageWait';
858
844
  subscribtion = this.subscriptions.find(item => item.key === subscribtionKey);
859
845
  if (!subscribtion) {
@@ -419,28 +419,3 @@ textarea:active{
419
419
  border: none;
420
420
  // margin: -2px -2px 0px;
421
421
  }
422
-
423
-
424
- // aggiungi un'animazione di fade in e fade out quando .star-rating-widget è visibile con transition
425
- .star-rating-widget {
426
- transition: all 0.5s ease-in-out;
427
- }
428
-
429
- .star-rating-widget {
430
- position: absolute;
431
- left: 0;
432
- right: 0;
433
- bottom: -52px;
434
- height: 100%;
435
- width: 100%;
436
- flex-direction: row;
437
- justify-content: center;
438
- background-color: rgb(255, 255, 255);
439
- flex-wrap: nowrap;
440
- &.active {
441
- bottom: 0px;
442
- }
443
- &.inactive {
444
- bottom: -52px;
445
- }
446
- }
@@ -87,7 +87,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
87
87
 
88
88
  file_size_limit = FILE_SIZE_LIMIT;
89
89
  attachmentTooltip: string = '';
90
- isErrorNetwork: boolean = false;
91
90
 
92
91
 
93
92
  convertColorToRGBA = convertColorToRGBA;
@@ -1,7 +1,7 @@
1
1
  <!-- tabindex="000"-->
2
2
 
3
3
  <button aflauncherbutton #aflauncherbutton id="c21-launcher-button" class="c21-button-clean scale-in-center"
4
- *ngIf="g.isOpen == false"
4
+ *ngIf="g.isLogged == true && g.isOpen == false"
5
5
  [ngClass]="{'c21-align-left' : g.align === 'left', 'c21-align-right' : g.align !== 'left'}"
6
6
  [ngStyle]="{ 'background-color': g.baloonImage? null: g.themeColor, 'bottom': g.marginY+'px!important', 'left':(g.align==='left')?g.marginX+'px!important':'', 'right':(g.align==='right')?g.marginX+'px!important':'', 'width': g.launcherWidth, 'height': g.launcherHeight, 'border-radius': g.baloonShape}"
7
7
  (click)="openCloseWidget()"
@@ -67,9 +67,8 @@ export class LauncherButtonComponent implements OnInit, AfterViewInit {
67
67
  // this.g.isOpen = !this.g.isOpen;
68
68
  // this.g.setIsOpen(!this.g.isOpen);
69
69
  // this.appStorageService.setItem('isOpen', this.g.isOpen);
70
-
71
- }
72
- this.onButtonClicked.emit( this.g.isOpen );
70
+ this.onButtonClicked.emit( this.g.isOpen );
71
+ }
73
72
  }
74
73
 
75
74
  }
@@ -1963,7 +1963,7 @@ export class GlobalSettingsService {
1963
1963
  this.logger.debug('[GLOBAL-SET] setDepartmentFromExternal > END departmentID ::::' + this.globals.departmentID + isValidID);
1964
1964
  }
1965
1965
  //remove default department from list
1966
- this.globals.departments = this.globals.departments.filter(obj => obj['default'] !== true)
1966
+ this.globals.departments = this.globals.departments?.filter(obj => obj['default'] !== true) ?? []
1967
1967
  if(this.globals.departments && this.globals.departments.length === 1){
1968
1968
  this.setDepartment(this.globals.departments[0])
1969
1969
  }
@@ -302,7 +302,6 @@ export class TranslatorService {
302
302
  'CLOSED',
303
303
  'LABEL_PREVIEW',
304
304
  'MAX_ATTACHMENT',
305
- 'MAX_ATTACHMENT_ERROR',
306
305
  'EMOJI'
307
306
  ];
308
307
 
@@ -359,7 +358,6 @@ export class TranslatorService {
359
358
  globals.LABEL_PREVIEW = res['LABEL_PREVIEW']
360
359
  globals.LABEL_ERROR_FIELD_REQUIRED= res['LABEL_ERROR_FIELD_REQUIRED']
361
360
  globals.MAX_ATTACHMENT = res['MAX_ATTACHMENT']
362
- globals.MAX_ATTACHMENT_ERROR = res['MAX_ATTACHMENT_ERROR']
363
361
  globals.EMOJI = res['EMOJI']
364
362
 
365
363
 
@@ -247,7 +247,7 @@ export class Globals {
247
247
 
248
248
  // ============ BEGIN: SET EXTERNAL PARAMETERS ==============//
249
249
  this.baseLocation = 'https://widget.tiledesk.com/v2';
250
- this.autoStart = false;
250
+ this.autoStart = true;
251
251
  /** start Authentication and startUI */
252
252
  this.startHidden = false;
253
253
  /** show/hide all widget -> js call: showAllWidget */
@@ -96,6 +96,5 @@
96
96
  "EMOJI_NOT_ELLOWED":"Emoji not allowed",
97
97
  "DOMAIN_NOT_ALLOWED":"URL contains a non-allowed domain",
98
98
  "MAX_ATTACHMENT": "Max allowed size {{FILE_SIZE_LIMIT}}Mb",
99
- "MAX_ATTACHMENT_ERROR": "The file exceeds the maximum allowed size",
100
99
  "EMOJI": "Emoji"
101
100
  }
@@ -96,6 +96,5 @@
96
96
  "EMOJI_NOT_ELLOWED":"Emoji no permitido",
97
97
  "DOMAIN_NOT_ALLOWED":"La URL contiene un dominio no permitido",
98
98
  "MAX_ATTACHMENT": "Tamaño máximo permitido {{FILE_SIZE_LIMIT}}Mb",
99
- "MAX_ATTACHMENT_ERROR": "El archivo supera el tamaño máximo permitido",
100
99
  "EMOJI": "Emoji"
101
100
  }
@@ -96,6 +96,5 @@
96
96
  "EMOJI_NOT_ELLOWED":"Emoji non autorisé",
97
97
  "DOMAIN_NOT_ALLOWED":"L'URL contient un domaine non autorisé",
98
98
  "MAX_ATTACHMENT": "Taille maximale autorisée {{FILE_SIZE_LIMIT}}Mo",
99
- "MAX_ATTACHMENT_ERROR": "Le fichier dépasse la taille maximale autorisée",
100
99
  "EMOJI": "Emoji"
101
100
  }
@@ -94,6 +94,5 @@
94
94
  "EMOJI_NOT_ELLOWED":"Emoji non consentiti",
95
95
  "DOMAIN_NOT_ALLOWED":"L'URL contiene un dominio non consentito",
96
96
  "MAX_ATTACHMENT": "Dimensione massima consentita {{FILE_SIZE_LIMIT}}Mb",
97
- "MAX_ATTACHMENT_ERROR": "Il file supera la dimensione massima consentita",
98
97
  "EMOJI": "Emoji"
99
98
  }
@@ -71,7 +71,7 @@ export class TiledeskRequestsService {
71
71
 
72
72
  public getMyRequests(): Promise<{ requests: Array<any>}> {
73
73
  this.tiledeskToken = this.appStorage.getItem('tiledeskToken')
74
- const url = this.URL_TILEDESK_REQUEST + 'me?preflight=true'
74
+ const url = this.URL_TILEDESK_REQUEST + '/me?preflight=true'
75
75
  this.logger.log('[TILEDESK-SERVICE] - GET REQUEST url ', url);
76
76
  const httpOptions = {
77
77
  headers: new HttpHeaders({
@@ -773,11 +773,6 @@ export function isAllowedUrlInText(text: string, allowedUrls: string[]) {
773
773
  return nonWhitelistedDomains.length === 0;
774
774
  }
775
775
 
776
- // function extractUrls(text: string): string[] {
777
- // const urlRegex = /https?:\/\/[^\s]+/g;
778
- // return text.match(urlRegex) || [];
779
- // }
780
-
781
776
  function extractUrls(text: string): string[] {
782
777
  // Rileva URL con o senza protocollo (http/https)
783
778
  const urlRegex = /\b((https?:\/\/)?(www\.)?[a-z0-9.-]+\.[a-z]{2,})(\/[^\s]*)?/gi;
@@ -792,3 +787,5 @@ function extractUrls(text: string): string[] {
792
787
  }
793
788
 
794
789
 
790
+
791
+
@@ -13,7 +13,7 @@
13
13
  bottom: 0px;
14
14
  width: auto;
15
15
  height: auto;
16
- display: block;
16
+ display: none;
17
17
  z-index: 3000000000; /*999999*/;
18
18
  }
19
19
 
@@ -84,12 +84,12 @@
84
84
  max-width: 1024px;
85
85
  max-height: 100%;
86
86
 
87
- /* transition:
87
+ transition:
88
88
  width 300ms,
89
89
  height 300ms,
90
90
  max-height 300ms,
91
91
  transform 300ms cubic-bezier(0, 1.2, 1, 1),
92
- opacity 300ms ease-out; */
92
+ opacity 300ms ease-out;
93
93
  /* per migliorare le prestazioni quando si usa transform */
94
94
  will-change: transform, opacity, width, height;
95
95
  }
@@ -175,14 +175,14 @@
175
175
  }
176
176
 
177
177
  #tiledesk-container.open #tiledeskdiv.min-size {
178
- /* transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out; */
178
+ transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out;
179
179
  width: var(--iframeMinWidth);
180
180
  height: var(--iframeMinHeight);
181
181
  }
182
182
 
183
183
  #tiledesk-container.open #tiledeskdiv.max-size {
184
184
  /* transition: width 1s, height 1s; */
185
- /* transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out; */
185
+ transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out;
186
186
  width: var(--iframeMaxWidth);
187
187
  height: var(--iframeMaxHeight);
188
188
  }
package/src/launch.js CHANGED
@@ -217,13 +217,68 @@ function loadIframe(tiledeskScriptBaseLocation) {
217
217
 
218
218
  iDiv.appendChild(ifrm);
219
219
 
220
- if(tiledeskScriptBaseLocation.includes('localhost')){
221
- ifrm.contentWindow.document.open();
222
- ifrm.contentWindow.document.write(srcTileDesk);
223
- ifrm.contentWindow.document.close();
224
- }else {
225
- ifrm.srcdoc = srcTileDesk
220
+ // Funzione helper per caricare iframe con fallback per compatibilità CSP (Wix, etc.)
221
+ // Usa Blob URL come metodo principale (più compatibile con CSP) con fallback a srcdoc e document.write
222
+ function loadIframeContent(iframe, htmlContent, baseLocation) {
223
+ var isLocalhost = baseLocation.includes('localhost');
224
+ var blobUrl = null;
225
+
226
+ // Metodo 1: Blob URL (più compatibile con CSP di Wix e altre piattaforme)
227
+ // Usa Blob URL come metodo principale perché è meno spesso bloccato da CSP rispetto a srcdoc
228
+ if (typeof Blob !== 'undefined' && typeof URL !== 'undefined' && URL.createObjectURL) {
229
+ try {
230
+ var blob = new Blob([htmlContent], { type: 'text/html;charset=utf-8' });
231
+ blobUrl = URL.createObjectURL(blob);
232
+ iframe.src = blobUrl;
233
+
234
+ // Cleanup del blob URL dopo il caricamento per liberare memoria
235
+ var originalOnload = iframe.onload;
236
+ iframe.onload = function() {
237
+ // Revoca il blob URL dopo un delay per assicurarsi che tutto sia caricato
238
+ setTimeout(function() {
239
+ if (blobUrl) {
240
+ try {
241
+ URL.revokeObjectURL(blobUrl);
242
+ blobUrl = null;
243
+ } catch(e) {
244
+ console.warn('Error revoking blob URL:', e);
245
+ }
246
+ }
247
+ }, 1000);
248
+ if (originalOnload) originalOnload.call(this);
249
+ };
250
+ return; // Blob URL impostato con successo
251
+ } catch(e) {
252
+ console.warn('Blob URL not available, trying srcdoc:', e);
253
+ }
254
+ }
255
+
256
+ // Metodo 2: srcdoc (fallback se Blob URL non disponibile)
257
+ // Skip per localhost (usa document.write per compatibilità sviluppo)
258
+ if (!isLocalhost && 'srcdoc' in iframe) {
259
+ try {
260
+ iframe.srcdoc = htmlContent;
261
+ return; // srcdoc impostato
262
+ } catch(e) {
263
+ console.warn('srcdoc not allowed, trying document.write:', e);
264
+ }
265
+ }
266
+
267
+ // Metodo 3: document.write (fallback finale, funziona su localhost e browser vecchi)
268
+ if (isLocalhost || (iframe.contentWindow && iframe.contentWindow.document)) {
269
+ try {
270
+ iframe.contentWindow.document.open();
271
+ iframe.contentWindow.document.write(htmlContent);
272
+ iframe.contentWindow.document.close();
273
+ return; // document.write completato
274
+ } catch(e) {
275
+ console.error('All iframe loading methods failed:', e);
276
+ }
277
+ }
226
278
  }
279
+
280
+ // Carica il contenuto dell'iframe con fallback automatico
281
+ loadIframeContent(ifrm, srcTileDesk, tiledeskScriptBaseLocation);
227
282
 
228
283
 
229
284
  }
@@ -218,13 +218,68 @@ function loadIframe(tiledeskScriptBaseLocation) {
218
218
 
219
219
  iDiv.appendChild(ifrm);
220
220
 
221
- if(tiledeskScriptBaseLocation.includes('localhost')){
222
- ifrm.contentWindow.document.open();
223
- ifrm.contentWindow.document.write(srcTileDesk);
224
- ifrm.contentWindow.document.close();
225
- }else {
226
- ifrm.srcdoc = srcTileDesk
221
+ // Funzione helper per caricare iframe con fallback per compatibilità CSP (Wix, etc.)
222
+ // Usa Blob URL come metodo principale (più compatibile con CSP) con fallback a srcdoc e document.write
223
+ function loadIframeContent(iframe, htmlContent, baseLocation) {
224
+ var isLocalhost = baseLocation.includes('localhost');
225
+ var blobUrl = null;
226
+
227
+ // Metodo 1: Blob URL (più compatibile con CSP di Wix e altre piattaforme)
228
+ // Usa Blob URL come metodo principale perché è meno spesso bloccato da CSP rispetto a srcdoc
229
+ if (typeof Blob !== 'undefined' && typeof URL !== 'undefined' && URL.createObjectURL) {
230
+ try {
231
+ var blob = new Blob([htmlContent], { type: 'text/html;charset=utf-8' });
232
+ blobUrl = URL.createObjectURL(blob);
233
+ iframe.src = blobUrl;
234
+
235
+ // Cleanup del blob URL dopo il caricamento per liberare memoria
236
+ var originalOnload = iframe.onload;
237
+ iframe.onload = function() {
238
+ // Revoca il blob URL dopo un delay per assicurarsi che tutto sia caricato
239
+ setTimeout(function() {
240
+ if (blobUrl) {
241
+ try {
242
+ URL.revokeObjectURL(blobUrl);
243
+ blobUrl = null;
244
+ } catch(e) {
245
+ console.warn('Error revoking blob URL:', e);
246
+ }
247
+ }
248
+ }, 1000);
249
+ if (originalOnload) originalOnload.call(this);
250
+ };
251
+ return; // Blob URL impostato con successo
252
+ } catch(e) {
253
+ console.warn('Blob URL not available, trying srcdoc:', e);
254
+ }
255
+ }
256
+
257
+ // Metodo 2: srcdoc (fallback se Blob URL non disponibile)
258
+ // Skip per localhost (usa document.write per compatibilità sviluppo)
259
+ if (!isLocalhost && 'srcdoc' in iframe) {
260
+ try {
261
+ iframe.srcdoc = htmlContent;
262
+ return; // srcdoc impostato
263
+ } catch(e) {
264
+ console.warn('srcdoc not allowed, trying document.write:', e);
265
+ }
266
+ }
267
+
268
+ // Metodo 3: document.write (fallback finale, funziona su localhost e browser vecchi)
269
+ if (isLocalhost || (iframe.contentWindow && iframe.contentWindow.document)) {
270
+ try {
271
+ iframe.contentWindow.document.open();
272
+ iframe.contentWindow.document.write(htmlContent);
273
+ iframe.contentWindow.document.close();
274
+ return; // document.write completato
275
+ } catch(e) {
276
+ console.error('All iframe loading methods failed:', e);
277
+ }
278
+ }
227
279
  }
280
+
281
+ // Carica il contenuto dell'iframe con fallback automatico
282
+ loadIframeContent(ifrm, srcTileDesk, tiledeskScriptBaseLocation);
228
283
 
229
284
 
230
285
  }