@chat21/chat21-web-widget 5.0.75-rc.1 → 5.0.75

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/CHANGELOG.md CHANGED
@@ -5,6 +5,9 @@
5
5
  *Dario De Pascalis*
6
6
  ### **Copyrigth**: *Tiledesk SRL*
7
7
 
8
+ ### 5.0.75 in PROD
9
+ - bug-fixed: WELCOME_TITLE and WELCOME_MSG translation labels not rendered
10
+
8
11
  ### 5.0.74 in PROD
9
12
 
10
13
  ### 5.0.74-rc.5
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.0.75-rc.1",
4
+ "version": "5.0.75",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -637,11 +637,6 @@ chat-root {
637
637
  }
638
638
  }
639
639
 
640
-
641
- #tiledesk-image-preview {
642
- border-radius: 16px;
643
- }
644
-
645
640
  .chat21-fullscreen {
646
641
  width: 100%;
647
642
  height: 100%;
@@ -7,6 +7,5 @@
7
7
  [ngStyle] = "{ 'width': width, 'height': height }"
8
8
  [src]="metadata.src"
9
9
  (load)="onLoaded($event)"
10
- (click)="onClickImage()"/>
11
- <!-- downloadImage(metadata.src, metadata.name); -->
10
+ (click)="downloadImage(metadata.src, metadata.name)"/>
12
11
  </div>
@@ -43,58 +43,46 @@ export class ImageComponent implements OnInit {
43
43
  }
44
44
 
45
45
  onClickImage(){
46
- const that = this;
47
- var ifrm = document.createElement("iframe");
48
- ifrm.setAttribute("frameborder", "0");
49
- // ifrm.setAttribute("border", "0");
50
- ifrm.setAttribute('id','tiledesk-image-preview');
51
- ifrm.setAttribute('tiledesk_context','parent');
52
- ifrm.setAttribute('style', 'width: 100%; height: 100%; position: absolute; z-index: 2147483003;')
53
-
54
- var iframeContent = '<head>'
55
- iframeContent += '<style> .tiledesk-popup {position: absolute; inset: 1px; outline-offset: -5px; background-color: rgba(0, 0, 0, 0.35); border-radius:16px; will-change: opacity;}'
56
- iframeContent += '.tiledesk-popup-content { position: fixed; inset: 0px; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; outline: 0px;}'
57
- iframeContent += '.tiledesk-popup-button { display: flex; align-items: center; justify-content: center; width: 35px; height: 35px; position: absolute; top: 0px; right: 0px; background-color: transparent; border: none; cursor: pointer; margin: 9px; padding: 0px; }'
58
- iframeContent += '.tiledesk-popup-image { max-height: 90vh; max-width: 90vw; }'
59
- iframeContent += '</style>'
60
- iframeContent += '</head>';
61
- iframeContent += '<body>'
62
- iframeContent += '<div class="frame-root" id="frame-root">'
63
- iframeContent += '<div class="frame-content">'
64
- iframeContent += '<div class="tiledesk-popup" style="opacity: 1;"></div>'
65
- iframeContent += '<div role="button" tabindex="-1" class="tiledesk-popup-content">'
66
- // iframeContent += '<button id="button" type="button" data-testid="closeButton" class="tiledesk-popup-button">'
67
- // iframeContent += '<svg id="ic_close" fill="#000000" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><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 12z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>'
68
- // iframeContent += '</button>'
69
- iframeContent += '<a href="'+this.metadata.src+'" data-testid="popupImage-wrapper" class="tidio-popup-vgwcqv" style="opacity: 1; transform: translate3d(0px, 0px, 0px);">'
70
- iframeContent += '<img src="'+this.metadata.src+'" class="tiledesk-popup-image" id="image-popup">'
71
- iframeContent += '</a>'
72
- iframeContent += '</div>'
73
- iframeContent += '</div>'
74
- iframeContent +='</body>'
75
46
 
76
- // ifrm.src = 'data:text/html;charset=utf-8,' + encodeURI(iframeContent);
77
- ifrm.srcdoc = iframeContent
78
- window.document.body.appendChild(ifrm)
47
+ // var ifrm = document.createElement("iframe");
48
+ // ifrm.setAttribute("frameborder", "0");
49
+ // ifrm.setAttribute("border", "0");
50
+ // ifrm.setAttribute('id','tiledeskiframe');
51
+ // ifrm.setAttribute('tiledesk_context','parent');
52
+ // ifrm.setAttribute('style', 'width: 100%; height: 100%; position: fixed; top: 0px; left: 0px; z-index: 2147483003; border: 0px;')
53
+
54
+ // var iframeContent = '<html>'
55
+ // iframeContent += '<head></head>'
56
+ // iframeContent += '<body>'
57
+ // iframeContent += '<div class="frame-root">'
58
+ // iframeContent += '<div class="frame-content">'
59
+ // iframeContent += '<div class="tiledesk-popup" style="opacity: 1;"></div>'
60
+ // iframeContent += '<div role="button" tabindex="-1" class="tidio-popup-1y163m9">'
61
+ // iframeContent += '<button type="button" data-testid="closeButton" class="tidio-popup-fru4e5 >'
62
+ // iframeContent += '<svg id="ic_close" fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><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 12z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>'
63
+ // iframeContent += '</button>'
64
+ // iframeContent += '<a href="#popup" data-testid="popupImage-wrapper" class="tidio-popup-vgwcqv" style="opacity: 1; transform: translate3d(0px, 0px, 0px);">'
65
+ // iframeContent += '<img src="'+this.metadata.src+'" alt="popup" class="tidio-popup-wuejeg">'
66
+ // iframeContent += '</a>'
67
+ // iframeContent += '</div>'
68
+ // iframeContent += '</div>'
69
+ // iframeContent += '</div>'
70
+ // iframeContent +='</body>'
71
+ // iframeContent +='</html>'
72
+
73
+ // var tiledeskdiv = this.globals.windowContext.document.getElementById('tiledeskdiv');
79
74
 
75
+ // tiledeskdiv.appendChild(ifrm);
76
+ // ifrm.contentWindow.document.open();
77
+ // ifrm.contentWindow.document.write(iframeContent);
78
+ // ifrm.contentWindow.document.close();
80
79
 
81
- ifrm.onload = function(ev) {
82
- var iframe = window.document.getElementById('tiledesk-image-preview')
83
- // var button = ifrm.contentWindow.document.getElementById("button");
84
- // button.addEventListener("click", function(event){
85
- // window.document.body.removeChild(iframe)
86
- // });
87
- var div = ifrm.contentWindow.document.getElementById('frame-root')
88
- div.addEventListener("click", function(event){
89
- window.document.body.removeChild(iframe)
90
- });
91
- var image = ifrm.contentWindow.document.getElementById('image-popup')
92
- image.addEventListener("click", function(event){
93
- event.preventDefault();
94
- event.stopPropagation();
95
- that.downloadImage(that.metadata.src, that.metadata.name)
96
- });
97
- };
80
+ // ifrm.onload = function(ev) {
81
+ // // var button = document.getElementById("button");
82
+ // // button.addEventListener("click", function(event){
83
+ // // alert(event.target);
84
+ // // });
85
+ // };
98
86
 
99
87
  }
100
88
 
@@ -266,7 +266,7 @@ export class TranslatorService {
266
266
 
267
267
 
268
268
  this._translate.get(labels).subscribe(res => {
269
- // console.log('»»»» initI18n »»»»»» »»»»»» GET TRANSLATED LABELS RES ', res);
269
+ console.log('»»»» initI18n »»»»»» »»»»»» GET TRANSLATED LABELS RES ', res);
270
270
  globals.LABEL_PLACEHOLDER = res['LABEL_PLACEHOLDER']
271
271
  globals.LABEL_START_NW_CONV = res['LABEL_START_NW_CONV'];
272
272
  globals.LABEL_SELECT_TOPIC = res['LABEL_SELECT_TOPIC'];
@@ -316,11 +316,14 @@ export class TranslatorService {
316
316
  globals.CLOSED = res['CLOSED'];
317
317
  globals.LABEL_PREVIEW = res['LABEL_PREVIEW']
318
318
  globals.LABEL_ERROR_FIELD_REQUIRED= res['LABEL_ERROR_FIELD_REQUIRED']
319
-
319
+
320
+ console.log('resss', globals.WELCOME_TITLE)
321
+ if(globals.WELCOME_TITLE === 'WELLCOME_TITLE') globals.WELCOME_TITLE = res['WELCOME_TITLE']
320
322
  if (!globals.welcomeTitle) {
321
-
322
323
  globals.welcomeTitle = globals.WELCOME_TITLE; /** Set the widget welcome message. Value type : string */
323
324
  }
325
+
326
+ if(globals.WELCOME_MSG === 'WELLCOME_MSG') globals.WELCOME_MSG = res['WELCOME_MSG']
324
327
  if (!globals.welcomeMsg) {
325
328
  globals.welcomeMsg = globals.WELCOME_MSG; /** Set the widget welcome message. Value type : string */
326
329
  }
@@ -119,102 +119,102 @@ export class Globals {
119
119
  LABEL_PREVIEW: string;
120
120
 
121
121
  // ============ BEGIN: EXTERNAL PARAMETERS ==============//
122
- autoStart: boolean;
123
- startHidden: boolean;
124
- isShown: boolean;
125
- isOpen: boolean;
126
- startFromHome: boolean;
127
- projectid: string;
128
- preChatForm: boolean;
129
- align: string;
130
- calloutTimer: number;
131
- calloutTitle: string;
132
- calloutMsg: string;
133
- calloutStaus: boolean;
134
- userFullname: string;
135
- userEmail: string;
136
- widgetTitle: string;
137
- fullscreenMode: boolean;
138
- hideHeaderCloseButton: boolean;
139
- themeColor: string;
140
- themeColorOpacity: number;
141
- themeForegroundColor: string;
142
- colorGradient: string;
143
- colorGradient180: string;
144
- allowTranscriptDownload: boolean;
145
- poweredBy: string;
146
- logoChat: string;
147
- welcomeTitle: string;
148
- welcomeMsg: string;
149
- recipientId: string;
150
- newConversationStart: boolean;
151
- recipientFullname: string;
122
+ autoStart: boolean;
123
+ startHidden: boolean;
124
+ isShown: boolean;
125
+ isOpen: boolean;
126
+ startFromHome: boolean;
127
+ projectid: string;
128
+ preChatForm: boolean;
129
+ align: string;
130
+ calloutTimer: number;
131
+ calloutTitle: string;
132
+ calloutMsg: string;
133
+ calloutStaus: boolean;
134
+ userFullname: string;
135
+ userEmail: string;
136
+ widgetTitle: string;
137
+ fullscreenMode: boolean;
138
+ hideHeaderCloseButton: boolean;
139
+ themeColor: string;
140
+ themeColorOpacity: number;
141
+ themeForegroundColor: string;
142
+ colorGradient: string;
143
+ colorGradient180: string;
144
+ allowTranscriptDownload: boolean;
145
+ poweredBy: string;
146
+ logoChat: string;
147
+ welcomeTitle: string;
148
+ welcomeMsg: string;
149
+ recipientId: string;
150
+ newConversationStart: boolean;
151
+ recipientFullname: string;
152
152
  // userId: string;
153
153
  // userToken: string;
154
- marginX: string;
155
- marginY: string;
156
- mobileMarginX: string;
157
- mobileMarginY: string;
158
- launcherWidth: string;
159
- launcherHeight: string;
160
- baloonImage: string;
161
- baloonShape: string;
162
- isLogEnabled: boolean;
163
- openExternalLinkButton: boolean;
164
- hideHeaderConversationOptionsMenu: boolean;
165
- hideCloseConversationOptionMenu: boolean;
166
- hideRestartConversationOptionsMenu: boolean;
167
- hideSettings: boolean;
168
- filterByRequester: boolean;
169
- persistence;
170
- windowContext;
171
-
172
- showWaitTime: boolean;
173
- showAvailableAgents: boolean;
174
- showLogoutOption: boolean;
175
- supportMode: boolean;
176
-
177
- customAttributes: any;
178
- showAttachmentButton: boolean;
179
- showAllConversations: boolean;
154
+ marginX: string;
155
+ marginY: string;
156
+ mobileMarginX: string;
157
+ mobileMarginY: string;
158
+ launcherWidth: string;
159
+ launcherHeight: string;
160
+ baloonImage: string;
161
+ baloonShape: string;
162
+ isLogEnabled: boolean;
163
+ openExternalLinkButton: boolean;
164
+ hideHeaderConversationOptionsMenu: boolean;
165
+ hideCloseConversationOptionMenu: boolean;
166
+ hideRestartConversationOptionsMenu: boolean;
167
+ hideSettings: boolean;
168
+ filterByRequester: boolean;
169
+ persistence;
170
+ windowContext;
171
+
172
+ showWaitTime: boolean;
173
+ showAvailableAgents: boolean;
174
+ showLogoutOption: boolean;
175
+ supportMode: boolean;
176
+
177
+ customAttributes: any;
178
+ showAttachmentButton: boolean;
179
+ showAllConversations: boolean;
180
180
  // privacyField: string;
181
- jwt: string;
182
-
183
- isOpenNewMessage: boolean;
184
- dynamicWaitTimeReply: boolean; // ******* new ********
185
- logLevel: string; // ******* new ********
186
-
187
- bubbleSentBackground: string; // ******* new ********
188
- bubbleSentTextColor: string; // ******* new ********
189
- bubbleReceivedBackground: string; // ******* new ********
190
- bubbleReceivedTextColor: string; // ******* new ********
191
- fontSize: string; // ******* new ********
192
- fontFamily: string; // ******* new ********
193
- buttonFontSize: string; // ******* new ********
194
- buttonBackgroundColor: string // ******* new ********
195
- buttonTextColor: string // ******* new ********
196
- buttonHoverBackgroundColor: string // ******* new ********
197
- buttonHoverTextColor: string // ******* new ********
198
- singleConversation: boolean; // ******* new ********
199
- restartConversation: boolean; // ******* new ********
200
- nativeRating: boolean; // ******* new ********
201
- showInfoMessage: Array<string>; // ******* new ********
202
- typingLocation: string; // ******* new ********
203
- allowReopen: boolean; // ******* new ********
204
- continueConversationBeforeTime: number; // ******* new ********
205
- participants: Array<string>; // ******* new ********
206
- whatsappNumber: string; // ******* new ********
207
- messangerPageTitle: string; // ******* new ********
208
- telegramUsername: string; // ******* new ********
209
- fileUploadAccept: string; // ******* new ********
210
- disconnetTime: number; // ******* new ********
211
-
212
- onPageChangeVisibilityMobile: 'open' | 'close' | 'last'; // ******* new ********
213
- onPageChangeVisibilityDesktop: 'open' | 'close' | 'last'; // ******* new ********
214
- displayOnMobile: boolean; // ******* new ********
215
- displayOnDesktop: boolean; // ******* new ********
216
-
217
- hiddenMessage: string; // ******* new ********
181
+ jwt: string;
182
+
183
+ isOpenNewMessage: boolean;
184
+ dynamicWaitTimeReply: boolean; // ******* new ********
185
+ logLevel: string; // ******* new ********
186
+
187
+ bubbleSentBackground: string; // ******* new ********
188
+ bubbleSentTextColor: string; // ******* new ********
189
+ bubbleReceivedBackground: string; // ******* new ********
190
+ bubbleReceivedTextColor: string; // ******* new ********
191
+ fontSize: string; // ******* new ********
192
+ fontFamily: string; // ******* new ********
193
+ buttonFontSize: string; // ******* new ********
194
+ buttonBackgroundColor: string // ******* new ********
195
+ buttonTextColor: string // ******* new ********
196
+ buttonHoverBackgroundColor: string // ******* new ********
197
+ buttonHoverTextColor: string // ******* new ********
198
+ singleConversation: boolean; // ******* new ********
199
+ restartConversation: boolean; // ******* new ********
200
+ nativeRating: boolean; // ******* new ********
201
+ showInfoMessage: Array<string>; // ******* new ********
202
+ typingLocation: string; // ******* new ********
203
+ allowReopen: boolean; // ******* new ********
204
+ continueConversationBeforeTime: number; // ******* new ********
205
+ participants: Array<string>; // ******* new ********
206
+ whatsappNumber: string; // ******* new ********
207
+ messangerPageTitle: string; // ******* new ********
208
+ telegramUsername: string; // ******* new ********
209
+ fileUploadAccept: string; // ******* new ********
210
+ disconnetTime: number; // ******* new ********
211
+
212
+ onPageChangeVisibilityMobile: 'open' | 'close' | 'last'; // ******* new ********
213
+ onPageChangeVisibilityDesktop: 'open' | 'close' | 'last'; // ******* new ********
214
+ displayOnMobile: boolean; // ******* new ********
215
+ displayOnDesktop: boolean; // ******* new ********
216
+
217
+ hiddenMessage: string; // ******* new ********
218
218
  constructor(
219
219
  ) { }
220
220