@chat21/chat21-web-widget 5.1.0-rc8 → 5.1.0
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 +108 -7
- package/angular.json +2 -2
- package/deploy_beta.sh +10 -0
- package/deploy_prod.sh +9 -0
- package/package.json +2 -2
- package/src/app/app.component.html +7 -1
- package/src/app/app.component.scss +11 -102
- package/src/app/app.component.ts +61 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.html +4 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +70 -7
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +106 -65
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +3 -2
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.scss +7 -15
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +1 -5
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +48 -33
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +13 -8
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +17 -18
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +11 -15
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +54 -17
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +1 -2
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +7 -5
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.scss +0 -3
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +1 -3
- package/src/app/component/form/form-builder/form-builder.component.scss +0 -1
- package/src/app/component/form/inputs/form-text/form-text.component.scss +0 -1
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +0 -1
- package/src/app/component/form/prechat-form/prechat-form.component.scss +1 -3
- package/src/app/component/home/home.component.html +41 -0
- package/src/app/component/home/home.component.scss +34 -8
- package/src/app/component/home/home.component.ts +17 -0
- package/src/app/component/home-conversations/home-conversations.component.scss +0 -3
- package/src/app/component/last-message/last-message.component.html +0 -2
- package/src/app/component/last-message/last-message.component.scss +0 -2
- package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -5
- package/src/app/component/list-conversations/list-conversations.component.scss +0 -2
- package/src/app/component/menu-options/menu-options.component.scss +0 -2
- package/src/app/component/message/audio/audio.component.html +1 -1
- package/src/app/component/message/audio/audio.component.scss +1 -0
- package/src/app/component/message/audio/audio.component.ts +0 -1
- package/src/app/component/message/avatar/avatar.component.scss +4 -4
- package/src/app/component/message/bubble-message/bubble-message.component.html +1 -4
- package/src/app/component/message/bubble-message/bubble-message.component.scss +0 -1
- package/src/app/component/message/bubble-message/bubble-message.component.ts +0 -2
- package/src/app/component/message/buttons/action-button/action-button.component.scss +6 -6
- package/src/app/component/message/buttons/link-button/link-button.component.scss +5 -5
- package/src/app/component/message/buttons/text-button/text-button.component.scss +5 -6
- package/src/app/component/message/carousel/carousel.component.scss +2 -3
- package/src/app/component/message/frame/frame.component.scss +0 -2
- package/src/app/component/message/html/html.component.scss +1 -3
- package/src/app/component/message/image/image.component.scss +0 -2
- package/src/app/component/message/info-message/info-message.component.scss +0 -2
- package/src/app/component/message/like-unlike/like-unlike.component.scss +0 -2
- package/src/app/component/message/text/text.component.html +5 -3
- package/src/app/component/message/text/text.component.scss +2 -4
- package/src/app/component/message/text/text.component.ts +0 -2
- package/src/app/component/message-attachment/message-attachment.component.scss +2 -1
- package/src/app/component/selection-department/selection-department.component.scss +1 -5
- package/src/app/component/star-rating-widget/star-rating-widget.component.scss +0 -7
- package/src/app/pipe/marked.pipe.ts +5 -2
- package/src/app/providers/global-settings.service.ts +108 -9
- package/src/app/sass/_variables.scss +16 -2
- package/src/app/utils/constants.ts +2 -1
- package/src/app/utils/globals.ts +103 -98
- package/src/app/utils/utils.ts +0 -47
- package/src/assets/i18n/en.json +5 -4
- package/src/assets/i18n/es.json +3 -2
- package/src/assets/i18n/fr.json +3 -2
- package/src/assets/i18n/it.json +3 -2
- package/src/assets/twp/chatbot-panel.html +39 -0
- package/src/assets/twp/index-dev.html +177 -121
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +9 -1
- package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +14 -0
- package/src/chat21-core/utils/constants.ts +2 -0
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +0 -1
- package/src/chat21-core/utils/utils-message.ts +12 -1
- package/src/chat21-core/utils/utils.ts +85 -0
- package/src/iframe-style.css +54 -35
package/src/app/utils/globals.ts
CHANGED
|
@@ -135,7 +135,6 @@ export class Globals {
|
|
|
135
135
|
userEmail: string;
|
|
136
136
|
widgetTitle: string;
|
|
137
137
|
fullscreenMode: boolean;
|
|
138
|
-
hideHeaderCloseButton: boolean;
|
|
139
138
|
themeColor: string;
|
|
140
139
|
themeColorOpacity: number;
|
|
141
140
|
themeForegroundColor: string;
|
|
@@ -161,6 +160,8 @@ export class Globals {
|
|
|
161
160
|
baloonShape: string;
|
|
162
161
|
isLogEnabled: boolean;
|
|
163
162
|
openExternalLinkButton: boolean;
|
|
163
|
+
hideHeaderConversation: boolean
|
|
164
|
+
hideHeaderCloseButton: boolean;
|
|
164
165
|
hideHeaderConversationOptionsMenu: boolean;
|
|
165
166
|
hideCloseConversationOptionMenu: boolean;
|
|
166
167
|
hideSettings: boolean;
|
|
@@ -218,6 +219,13 @@ export class Globals {
|
|
|
218
219
|
showEmojiFooterButton: boolean // ******* new ********
|
|
219
220
|
showAttachmentFooterButton: boolean // ******* new ********
|
|
220
221
|
showAudioRecorderFooterButton: boolean // ******* new ********
|
|
222
|
+
|
|
223
|
+
allowedOnSpecificUrl: boolean // ******* new ********
|
|
224
|
+
allowedOnSpecificUrlList: Array<string> // ******* new ********
|
|
225
|
+
|
|
226
|
+
fontFamilySource: string; // ******* new ********
|
|
227
|
+
|
|
228
|
+
size: 'min' | 'max' | 'top'; // ******* new ********
|
|
221
229
|
constructor(
|
|
222
230
|
) { }
|
|
223
231
|
|
|
@@ -240,156 +248,165 @@ export class Globals {
|
|
|
240
248
|
// ============ BEGIN: SET EXTERNAL PARAMETERS ==============//
|
|
241
249
|
this.baseLocation = 'https://widget.tiledesk.com/v2';
|
|
242
250
|
this.autoStart = true;
|
|
243
|
-
this.startHidden = false;
|
|
244
251
|
/** start Authentication and startUI */
|
|
245
|
-
this.
|
|
252
|
+
this.startHidden = false;
|
|
246
253
|
/** show/hide all widget -> js call: showAllWidget */
|
|
247
|
-
this.
|
|
254
|
+
this.isShown = true;
|
|
248
255
|
/** show/hide window widget -> js call: hideAllWidget */
|
|
249
|
-
this.
|
|
256
|
+
this.isOpen = false;
|
|
250
257
|
/** start from Home or Conversation */
|
|
251
|
-
this.
|
|
258
|
+
this.startFromHome = true;
|
|
252
259
|
/** check open/close modal prechatform if g.preChatForm is true */
|
|
253
|
-
this.
|
|
260
|
+
this.isOpenPrechatForm = true;
|
|
254
261
|
/** show/hide all rating chat */
|
|
255
|
-
this.
|
|
262
|
+
this.isOpenStartRating = false;
|
|
256
263
|
/** The TileDesk project id. Find your TileDesk ProjectID in the
|
|
257
|
-
|
|
258
|
-
this.
|
|
264
|
+
TileDesk Dashboard under the Widget menu. */
|
|
265
|
+
this.projectid = '';
|
|
259
266
|
/** You can require customers to enter information like name and email
|
|
260
267
|
before sending a chat message by enabling the Pre-Chat form. Permitted
|
|
261
268
|
values: true, false. The default value is false. */
|
|
262
|
-
this.
|
|
269
|
+
this.preChatForm = false;
|
|
263
270
|
/** if it is true, the chat window is automatically open when the
|
|
264
|
-
|
|
265
|
-
this.
|
|
271
|
+
widget is loaded. Permitted values: true, false. Default value : false */
|
|
272
|
+
this.align = '';
|
|
266
273
|
/** Proactively open the chat windows to increase the customer engagement.
|
|
267
274
|
Permitted values: -1 (Disabled), 0 (Immediatly) or a positive integer value.
|
|
268
275
|
For exmaple: 5 (After 5 seconds), 10 (After 10 seconds). */
|
|
269
|
-
this.
|
|
276
|
+
this.calloutTimer = -1;
|
|
270
277
|
/** title box callout */
|
|
271
|
-
this.
|
|
278
|
+
this.calloutTitle = '';
|
|
272
279
|
/** stato callout (shown only first time) */
|
|
273
|
-
this.
|
|
280
|
+
this.calloutMsg = '';
|
|
274
281
|
/** message box callout */
|
|
275
|
-
this.
|
|
282
|
+
this.calloutStaus = true;
|
|
276
283
|
/** userFullname: Current user fullname. Set this parameter to specify
|
|
277
284
|
the visitor fullname. */
|
|
278
|
-
this.
|
|
285
|
+
this.userFullname = '';
|
|
279
286
|
/** Current user email address. Set this parameter to specify the visitor
|
|
280
287
|
email address. */
|
|
281
|
-
this.
|
|
288
|
+
this.userEmail = '';
|
|
282
289
|
/** Set the widget title label shown in the widget header. Value type : string.
|
|
283
290
|
The default value is Tiledesk. */
|
|
284
|
-
this.
|
|
291
|
+
this.widgetTitle = '';
|
|
285
292
|
/** The user can decide whether or not to share the
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
this.
|
|
293
|
+
* average response time of his team (if 'dynamicWaitTimeReply' is
|
|
294
|
+
* false the WAITING_TIME_NOT_FOUND will always be displayed)
|
|
295
|
+
* is set to true for backward compatibility with old projects */
|
|
296
|
+
this.dynamicWaitTimeReply = true;
|
|
290
297
|
/** Hide the close button in the widget header. Permitted values: true,
|
|
291
298
|
false. The default value is false. */
|
|
292
|
-
this.
|
|
299
|
+
this.hideHeaderCloseButton = false;
|
|
300
|
+
|
|
293
301
|
/** if it is true, the chat window is open in fullscreen mode. Permitted
|
|
294
302
|
values: true, false. Default value : false */
|
|
295
|
-
this.
|
|
303
|
+
this.fullscreenMode = false;
|
|
296
304
|
/** allows you to change the main widget's color
|
|
297
305
|
(color of the header, color of the launcher button,
|
|
298
306
|
other minor elements). Permitted values: Hex color
|
|
299
307
|
codes, e.g. #87BC65 and RGB color codes, e.g. rgb(135,188,101) */
|
|
300
|
-
this.
|
|
308
|
+
this.themeColor = convertColorToRGBA('#2a6ac1', 100);
|
|
301
309
|
/**allows you to change opacity in background headers component
|
|
302
|
-
|
|
303
|
-
this.
|
|
310
|
+
* Permitted values: [0..1] */
|
|
311
|
+
this.themeColorOpacity = 100
|
|
304
312
|
/** allows you to change text and icons' color.
|
|
305
313
|
Permitted values: Hex color codes, e.g. #425635 and RGB color
|
|
306
314
|
codes, e.g. rgb(66,86,53) */
|
|
307
|
-
this.
|
|
315
|
+
this.themeForegroundColor = convertColorToRGBA('#ffffff', 100);
|
|
308
316
|
/** allows the user to download the chat transcript. The download button appears
|
|
309
317
|
when the chat is closed by the operator. Permitter values: true, false.
|
|
310
318
|
Default value: false */
|
|
311
|
-
this.
|
|
319
|
+
this.allowTranscriptDownload = false;
|
|
312
320
|
/** link nel footer widget */
|
|
313
|
-
this.
|
|
321
|
+
this.poweredBy = BRAND_BASE_INFO.POWERED_BY;
|
|
314
322
|
/** url img logo */
|
|
315
|
-
this.
|
|
323
|
+
this.logoChat = BRAND_BASE_INFO.LOGO_CHAT;
|
|
316
324
|
/** set margin left or rigth widget */
|
|
317
|
-
this.
|
|
325
|
+
this.marginX = '20px';
|
|
318
326
|
/** set margin bottom widget */
|
|
319
|
-
this.
|
|
327
|
+
this.marginY = '20px';
|
|
320
328
|
/** set margin left or rigth widget for mobile */
|
|
321
|
-
this.
|
|
329
|
+
this.mobileMarginX = '0px';
|
|
322
330
|
/** set margin bottom widget for mobile*/
|
|
323
|
-
this.
|
|
331
|
+
this.mobileMarginY = '0px';
|
|
324
332
|
/** set launcher width widget */
|
|
325
|
-
this.
|
|
333
|
+
this.launcherWidth = '60px'
|
|
326
334
|
/** set launcher height widget */
|
|
327
|
-
this.
|
|
335
|
+
this.launcherHeight = '60px'
|
|
328
336
|
/** set launcher baloon widget image: require SVG url */
|
|
329
|
-
this.
|
|
337
|
+
this.baloonImage='';
|
|
330
338
|
/** set launcher balon widget shape: can set corner by corner */
|
|
331
|
-
this.
|
|
339
|
+
this.baloonShape = '50%';
|
|
332
340
|
// this.parameters['isLogEnabled'] = false;
|
|
333
341
|
this.openExternalLinkButton = true;
|
|
342
|
+
/** Hide the header conversation Permitted values: true,
|
|
343
|
+
false. The default value is false. */
|
|
344
|
+
this.hideHeaderConversation= false;
|
|
345
|
+
/** Hide the close button in the widget header. Permitted values: true,
|
|
346
|
+
false. The default value is false. */
|
|
347
|
+
this.hideHeaderCloseButton = false;
|
|
348
|
+
/** set global log. Permitted values: true, false. The default value is false. */
|
|
349
|
+
this.isLogEnabled = false;
|
|
334
350
|
/** enable to hide/show upper-right header conversation options menu */
|
|
335
|
-
this.
|
|
351
|
+
this.openExternalLinkButton = true;
|
|
336
352
|
/** enable to close a conversation from upper-right header menu */
|
|
337
|
-
this.
|
|
353
|
+
this.hideHeaderConversationOptionsMenu = false;
|
|
338
354
|
/** enable to hide/show options menu in conversation detail header */
|
|
339
|
-
this.
|
|
355
|
+
this.hideCloseConversationOptionMenu = false;
|
|
340
356
|
/** enable to hide/show options menu in home component */
|
|
341
|
-
this.
|
|
357
|
+
this.hideSettings = false;
|
|
342
358
|
/** show conversations with conversation.attributes.requester_id == user.uid */
|
|
343
|
-
this.
|
|
359
|
+
this.filterByRequester = false;
|
|
344
360
|
/** set the auth persistence */
|
|
345
|
-
this.
|
|
361
|
+
this.persistence = 'local';
|
|
346
362
|
/** set the preChatForm Json as default if preChatFormCustomFieldsEnabled is false or not exist */
|
|
347
|
-
this.
|
|
363
|
+
this.preChatFormJson = [{name: "userFullname", type:"text", mandatory:true, label:"LABEL_FIELD_NAME"},{name:"userEmail", type:"text", mandatory:true, regex:"/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$/", label:"LABEL_FIELD_EMAIL", errorLabel:"LABEL_ERROR_FIELD_EMAIL"}]
|
|
348
364
|
/** set the background of bubble sent message */
|
|
349
|
-
this.
|
|
365
|
+
this.bubbleSentBackground = convertColorToRGBA('#2a6ac1', 100); //'#62a8ea'
|
|
350
366
|
/** set the text color of bubble sent message */
|
|
351
|
-
this.
|
|
367
|
+
this.bubbleSentTextColor = convertColorToRGBA('#ffffff', 100); //'#ffffff'
|
|
352
368
|
/** set the background of bubble received message */
|
|
353
|
-
this.
|
|
369
|
+
this.bubbleReceivedBackground= convertColorToRGBA('#f0f2f7', 100); //#f7f7f7;
|
|
354
370
|
/** set the text color of bubble received message */
|
|
355
|
-
this.
|
|
371
|
+
this.bubbleReceivedTextColor = convertColorToRGBA('#06132b', 100); //#1a1a1a
|
|
356
372
|
/** set the text size of bubble messages */
|
|
357
|
-
this.
|
|
373
|
+
this.fontSize = '1.4em'
|
|
358
374
|
/** set the text family of bubble messages */
|
|
359
|
-
this.
|
|
375
|
+
this.fontFamily = "'Roboto','Google Sans', Helvetica, Arial, sans-serif"
|
|
360
376
|
/** set the text size of attachment-buttons */
|
|
361
|
-
this.
|
|
377
|
+
this.buttonFontSize = '15px'
|
|
362
378
|
/** set the backgroundColor of attachment-buttons */
|
|
363
|
-
this.
|
|
379
|
+
this.buttonBackgroundColor = convertColorToRGBA('#ffffff', 100)
|
|
364
380
|
/** set the text color of attachment-buttons */
|
|
381
|
+
this.buttonTextColor = convertColorToRGBA('#2a6ac1', 100)
|
|
382
|
+
/** set the text size of attachment-buttons */
|
|
365
383
|
this.buttonHoverBackgroundColor = convertColorToRGBA('#2a6ac1', 100)
|
|
366
384
|
/** set the text size of attachment-buttons */
|
|
367
385
|
this.buttonHoverTextColor = convertColorToRGBA('#ffffff', 100);
|
|
368
|
-
/** set the text size of attachment-buttons */
|
|
369
|
-
this.singleConversation = false;
|
|
370
386
|
/** set the single conversation mode for the widget */
|
|
371
|
-
this.
|
|
387
|
+
this.singleConversation = false;
|
|
372
388
|
/** allow you to always restart a new converazioe */
|
|
373
|
-
this.
|
|
389
|
+
this.restartConversation = false;
|
|
374
390
|
/** set if native rating componet has to be shown */
|
|
375
|
-
this.
|
|
391
|
+
this.nativeRating = true;
|
|
376
392
|
/** disable or show bubble info message 'MEMBER_JOINED_CHAT' */
|
|
377
|
-
this.
|
|
393
|
+
this.showInfoMessage = 'MEMBER_JOINED_GROUP'.split(',').map(key => { return key.trim()});
|
|
378
394
|
/** set the location of typing indicator (header or content) */
|
|
379
|
-
this.
|
|
395
|
+
this.typingLocation = 'content'
|
|
380
396
|
/** enable the user to reopen a closed conversation */
|
|
381
397
|
// this.continueConversationBeforeTime = 48;
|
|
382
398
|
/** enable user to continue archived confersation before the value time from last timeout message */
|
|
383
|
-
this.
|
|
399
|
+
this.allowReopen = false;
|
|
384
400
|
/** enable user to talk with specific chat-bots/humans */
|
|
385
|
-
this.
|
|
401
|
+
this.participants = [];
|
|
386
402
|
/**enable user to set a whatsapp business number to chat with */
|
|
387
|
-
this.
|
|
403
|
+
this.whatsappNumber = '';
|
|
388
404
|
/**enable user to set a facebook messanger page to chat with */
|
|
389
|
-
this.
|
|
405
|
+
this.messangerPageTitle = ''
|
|
390
406
|
/**enable user to set a telegram number to chat with */
|
|
391
|
-
this.
|
|
407
|
+
this.telegramUsername = ''
|
|
392
408
|
/**enable auto disconnect from messaging after a defined amount of time (s)*/
|
|
409
|
+
this.fileUploadAccept = "image/*,.pdf,.txt,.mp3"
|
|
393
410
|
this.disconnetTime = 0
|
|
394
411
|
|
|
395
412
|
this.showWaitTime = true;
|
|
@@ -417,57 +434,40 @@ export class Globals {
|
|
|
417
434
|
this.showAttachmentFooterButton = true;
|
|
418
435
|
/** show/hide rec audio option in footer chat-detail page */
|
|
419
436
|
this.showAudioRecorderFooterButton = true;
|
|
437
|
+
/** enabled to set a list of pattern url able to load the widget **/
|
|
438
|
+
this.allowedOnSpecificUrl = false
|
|
439
|
+
/** set a list of pattern url able to load the widget */
|
|
440
|
+
this.allowedOnSpecificUrlList = [];
|
|
441
|
+
/** set widget size from 3 different positions: min, max, top */
|
|
442
|
+
this.size = 'min';
|
|
420
443
|
|
|
421
444
|
// ============ END: SET EXTERNAL PARAMETERS ==============//
|
|
422
445
|
|
|
423
446
|
|
|
424
447
|
// ============ BEGIN: SET INTERNAL PARAMETERS ==============//
|
|
448
|
+
/** name tenant ex: tilechat */
|
|
425
449
|
this.tenant = environment.firebaseConfig.tenant;
|
|
426
|
-
|
|
427
|
-
// this.parameters.push({'tenant': environment.tenant});
|
|
428
|
-
|
|
429
|
-
/** Set the widget title label shown in the widget header. Value type : string.
|
|
430
|
-
The default value is Tiledesk. */
|
|
431
|
-
/** name tenant ex: tilechat */
|
|
450
|
+
/** channelType: group/direct */
|
|
432
451
|
this.channelType = CHANNEL_TYPE.GROUP;
|
|
433
|
-
|
|
434
|
-
// this.parameters.push({'channelType': CHANNEL_TYPE.GROUP});
|
|
435
|
-
/** channelType: group/direct */
|
|
452
|
+
/** settings for pass variables to js */
|
|
436
453
|
this.default_settings = {};
|
|
437
|
-
|
|
438
|
-
/** settings for pass variables to js */
|
|
454
|
+
/** detect is mobile : detectIfIsMobile() */
|
|
439
455
|
this.isMobile = false;
|
|
440
|
-
|
|
441
|
-
// this.parameters.push({'isMobile': false}); /** detect is mobile : detectIfIsMobile() */
|
|
442
|
-
|
|
456
|
+
/** detect is logged */
|
|
443
457
|
this.isLogged = false;
|
|
444
|
-
|
|
445
|
-
// this.parameters.push({'isLogged': false}); /** detect is logged */
|
|
446
|
-
|
|
458
|
+
|
|
447
459
|
this.BUILD_VERSION = 'v.' + environment.version;
|
|
448
|
-
// this.parameters['BUILD_VERSION'] = 'v.' + environment.version;
|
|
449
|
-
// this.parameters.push({'BUILD_VERSION': 'v.' + environment.version});
|
|
450
460
|
|
|
451
461
|
this.soundEnabled = true;
|
|
452
|
-
// this.parameters['soundEnabled'] = true;
|
|
453
|
-
// this.parameters.push({'soundEnabled': true});
|
|
454
462
|
|
|
455
463
|
this.conversationsBadge = 0;
|
|
456
|
-
// this.parameters['conversationsBadge'] = 0;
|
|
457
|
-
// this.parameters.push({'conversationsBadge': 0});
|
|
458
464
|
|
|
459
465
|
this.isOpenMenuOptions = false;
|
|
460
|
-
// this.parameters['isOpenMenuOptions'] = false;
|
|
461
|
-
// this.parameters.push({'isOpenMenuOptions': false});
|
|
462
466
|
|
|
463
467
|
this.displayEyeCatcherCard = 'none';
|
|
464
|
-
// this.parameters['displayEyeCatcherCard'] = 'none';
|
|
465
|
-
// this.parameters.push({'displayEyeCatcherCard': 'none'});
|
|
466
468
|
// ============ END: SET INTERNAL PARAMETERS ==============//
|
|
467
469
|
|
|
468
470
|
this.supportMode = true;
|
|
469
|
-
// this.parameters['supportMode'] = true;
|
|
470
|
-
// this.parameters.push({'supportMode': true});
|
|
471
471
|
|
|
472
472
|
this.newConversationStart = true;
|
|
473
473
|
|
|
@@ -525,7 +525,7 @@ export class Globals {
|
|
|
525
525
|
'fullscreenMode': this.fullscreenMode,
|
|
526
526
|
'filterByRequester': this.filterByRequester,
|
|
527
527
|
'hideHeaderConversationOptionsMenu': this.hideHeaderConversationOptionsMenu, 'hideHeaderCloseButton': this.hideHeaderCloseButton,
|
|
528
|
-
'hideCloseConversationOptionMenu': this.hideCloseConversationOptionMenu,
|
|
528
|
+
'hideCloseConversationOptionMenu': this.hideCloseConversationOptionMenu, 'hideHeaderConversation': this.hideHeaderConversation,
|
|
529
529
|
'hideSettings': this.hideSettings,
|
|
530
530
|
'isLogEnabled': this.isLogEnabled,
|
|
531
531
|
'isOpen': this.isOpen, 'isShown': this.isShown,
|
|
@@ -619,6 +619,11 @@ export class Globals {
|
|
|
619
619
|
this.align === 'left'? divTiledeskWidget.style.left = this.mobileMarginX : divTiledeskWidget.style.right = this.mobileMarginX;
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
+
//customize position for 'tiledeskdiv' for desktop if fullscreenMode is not active
|
|
623
|
+
if(isOpen && !this.isMobile && !this.fullscreenMode && divTiledeskWidget && this.size){
|
|
624
|
+
divTiledeskWidget.classList.add(this.size + '-size')
|
|
625
|
+
}
|
|
626
|
+
|
|
622
627
|
|
|
623
628
|
}
|
|
624
629
|
|
package/src/app/utils/utils.ts
CHANGED
|
@@ -200,54 +200,7 @@ export function avatarPlaceholder(name: string) {
|
|
|
200
200
|
return initials;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
export function isEmoji(str: string) {
|
|
204
|
-
// tslint:disable-next-line:max-line-length
|
|
205
|
-
const ranges = ['(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])'];
|
|
206
|
-
if (str.match(ranges.join('|'))) {
|
|
207
|
-
return true;
|
|
208
|
-
} else {
|
|
209
|
-
return false;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export function isAllowedUrlInText(text: string, allowedUrls: string[]): boolean {
|
|
214
|
-
// Regex per trovare URL o domini nudi nel testo
|
|
215
|
-
const urlRegex = /https?:\/\/[^\s]+|www\.[^\s]+|(?:\b[\w-]+\.)+[a-z]{2,}(\/[^\s]*)?/gi;
|
|
216
|
-
const foundUrls = text.match(urlRegex);
|
|
217
203
|
|
|
218
|
-
if (!foundUrls) {
|
|
219
|
-
return true; // Nessun URL => testo ammesso
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Normalizza dominio: rimuove schema, www., slash finali
|
|
223
|
-
const normalize = (url: string) =>
|
|
224
|
-
url
|
|
225
|
-
.replace(/^https?:\/\//i, '')
|
|
226
|
-
.replace(/^www\./i, '')
|
|
227
|
-
.replace(/\/$/, '')
|
|
228
|
-
.toLowerCase();
|
|
229
|
-
|
|
230
|
-
// Normalizza tutti gli allowed pattern per confronto
|
|
231
|
-
const normalizedAllowedPatterns = allowedUrls.map(pattern =>
|
|
232
|
-
pattern
|
|
233
|
-
.replace(/^https?:\/\//i, '')
|
|
234
|
-
.replace(/^www\./i, '')
|
|
235
|
-
.replace(/\/$/, '')
|
|
236
|
-
.toLowerCase()
|
|
237
|
-
.replace(/\./g, '\\.')
|
|
238
|
-
.replace(/\//g, '\\/')
|
|
239
|
-
.replace(/\*/g, '.*')
|
|
240
|
-
);
|
|
241
|
-
|
|
242
|
-
return foundUrls.every(rawUrl => {
|
|
243
|
-
const url = normalize(rawUrl);
|
|
244
|
-
return normalizedAllowedPatterns.some(pattern => {
|
|
245
|
-
const regex = new RegExp(`^${pattern}$`, 'i');
|
|
246
|
-
return regex.test(url);
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
|
|
251
204
|
export function setColorFromString(str: string) {
|
|
252
205
|
const arrayBckColor = ['#fba76f', '#80d066', '#73cdd0', '#ecd074', '#6fb1e4', '#f98bae'];
|
|
253
206
|
let num = 0;
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"LABEL_PLACEHOLDER": "
|
|
2
|
+
"LABEL_PLACEHOLDER": "Type your message..",
|
|
3
3
|
"LABEL_START_NW_CONV": "New conversation",
|
|
4
4
|
"LABEL_WHATSAPP": "Message us",
|
|
5
5
|
"LABEL_SELECT_TOPIC": "Select a topic",
|
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
"WAITING_TIME_NOT_FOUND": "The team will reply as soon as possible",
|
|
54
54
|
"CLOSED": "CLOSED",
|
|
55
55
|
"CLOSE_CHAT": "Close chat",
|
|
56
|
-
"MINIMIZE":"Minimize",
|
|
57
|
-
"MAXIMIZE":"
|
|
56
|
+
"MINIMIZE":"Minimize window",
|
|
57
|
+
"MAXIMIZE":"Expand window",
|
|
58
|
+
"CENTER":"Center",
|
|
58
59
|
"CONFIRM_CLOSE_CHAT":"Are you sure you want to close this chat?",
|
|
59
60
|
|
|
60
61
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"you",
|
|
@@ -93,5 +94,5 @@
|
|
|
93
94
|
"SWITCH_TO": "Or switch to:",
|
|
94
95
|
"CONNECTION_NETWORK_ERROR": "Our apologies. There was some trouble connecting to network",
|
|
95
96
|
"EMOJI_NOT_ELLOWED":"Emoji not allowed",
|
|
96
|
-
"DOMAIN_NOT_ALLOWED":"
|
|
97
|
+
"DOMAIN_NOT_ALLOWED":"URL contains a non-allowed domain"
|
|
97
98
|
}
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
"WAITING_TIME_NOT_FOUND": "El equipo responderá lo antes posible",
|
|
54
54
|
"CLOSED": "CERRADA",
|
|
55
55
|
"CLOSE_CHAT": "Cerrar chat",
|
|
56
|
-
"MINIMIZE":"Minimizar",
|
|
57
|
-
"MAXIMIZE":"
|
|
56
|
+
"MINIMIZE":" Minimizar ventana",
|
|
57
|
+
"MAXIMIZE":"Expandir ventana",
|
|
58
|
+
"CENTER":"Centrar",
|
|
58
59
|
"CONFIRM_CLOSE_CHAT":"¿Estás seguro de que quieres cerrar este chat?",
|
|
59
60
|
|
|
60
61
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tú",
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
"WAITING_TIME_NOT_FOUND": "Nous vous répondrons dans les plus brefs délais",
|
|
54
54
|
"CLOSED": "Fermé",
|
|
55
55
|
"CLOSE_CHAT": "Fermer la discussion",
|
|
56
|
-
"MINIMIZE":"
|
|
57
|
-
"MAXIMIZE":"
|
|
56
|
+
"MINIMIZE":"Réduire la fenêtre",
|
|
57
|
+
"MAXIMIZE":"Agrandir la fenêtre",
|
|
58
|
+
"CENTER":"Centrer",
|
|
58
59
|
"CONFIRM_CLOSE_CHAT":"Etes-vous sûr de vouloir fermer cette discussion?",
|
|
59
60
|
|
|
60
61
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tu",
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
"WAITING_TIME_NOT_FOUND": "Vi risponderemo appena possibile",
|
|
54
54
|
"CLOSED": "Chiusa",
|
|
55
55
|
"CLOSE_CHAT": "Chiudi chat",
|
|
56
|
-
"MINIMIZE":"
|
|
57
|
-
"MAXIMIZE":"
|
|
56
|
+
"MINIMIZE":"Comprimi finestra",
|
|
57
|
+
"MAXIMIZE":"Espandi finestra",
|
|
58
|
+
"CENTER":"Centra",
|
|
58
59
|
"CONFIRM_CLOSE_CHAT":"Sei sicuro di voler chiudere questa chat?",
|
|
59
60
|
|
|
60
61
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tu",
|
|
@@ -108,6 +108,27 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
.loading-text {
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 60%;
|
|
114
|
+
left: 50%;
|
|
115
|
+
transform: translateX(-50%);
|
|
116
|
+
font-family: sans-serif;
|
|
117
|
+
font-size: 18px;
|
|
118
|
+
color: rgb(224, 106, 88);;
|
|
119
|
+
animation: blinkText 1.5s infinite ease-in-out;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Animazione lampeggiante */
|
|
123
|
+
@keyframes blinkText {
|
|
124
|
+
0%, 100% {
|
|
125
|
+
opacity: 1;
|
|
126
|
+
}
|
|
127
|
+
50% {
|
|
128
|
+
opacity: 0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
111
132
|
#deferred-styles {
|
|
112
133
|
display: none;
|
|
113
134
|
}
|
|
@@ -458,6 +479,23 @@
|
|
|
458
479
|
}(document, 'script', 'tiledesk-jssdk'));
|
|
459
480
|
|
|
460
481
|
</script> -->
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
<script type="application/javascript" id="check_embed">
|
|
485
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
486
|
+
const isEmbedded = window.self !== window.top;
|
|
487
|
+
|
|
488
|
+
if (isEmbedded) {
|
|
489
|
+
//HIDE header and footer elements
|
|
490
|
+
const header = document.querySelector('header');
|
|
491
|
+
const footer = document.querySelector('footer');
|
|
492
|
+
if (header) header.style.display = 'none';
|
|
493
|
+
if (footer) footer.style.display = 'none';
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
</script>
|
|
497
|
+
|
|
498
|
+
|
|
461
499
|
<script type="application/javascript">
|
|
462
500
|
window.tiledeskSettings = {
|
|
463
501
|
marginX: "100px",
|
|
@@ -654,6 +692,7 @@
|
|
|
654
692
|
|
|
655
693
|
<div id="preloader">
|
|
656
694
|
<div class="loader"></div>
|
|
695
|
+
<!-- <div class="loading-text">Loading . . .</div> -->
|
|
657
696
|
</div>
|
|
658
697
|
|
|
659
698
|
<header id="header">
|