@chat21/chat21-web-widget 5.1.0-rc9 → 5.1.1-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -8
- 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 +60 -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.html +2 -1
- package/src/app/component/message/carousel/carousel.component.scss +5 -6
- 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 +4 -4
- 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 +18 -7
- package/src/app/providers/global-settings.service.ts +108 -9
- package/src/app/sass/_variables.scss +15 -2
- package/src/app/utils/constants.ts +2 -1
- package/src/app/utils/globals.ts +101 -101
- package/src/app/utils/utils.ts +0 -85
- 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,160 @@ 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.
|
|
290
|
-
|
|
291
|
-
false. The default value is false. */
|
|
292
|
-
this.fullscreenMode = false;
|
|
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;
|
|
297
|
+
|
|
293
298
|
/** if it is true, the chat window is open in fullscreen mode. Permitted
|
|
294
299
|
values: true, false. Default value : false */
|
|
295
|
-
this.
|
|
300
|
+
this.fullscreenMode = false;
|
|
296
301
|
/** allows you to change the main widget's color
|
|
297
302
|
(color of the header, color of the launcher button,
|
|
298
303
|
other minor elements). Permitted values: Hex color
|
|
299
304
|
codes, e.g. #87BC65 and RGB color codes, e.g. rgb(135,188,101) */
|
|
300
|
-
this.
|
|
305
|
+
this.themeColor = convertColorToRGBA('#2a6ac1', 100);
|
|
301
306
|
/**allows you to change opacity in background headers component
|
|
302
|
-
|
|
303
|
-
this.
|
|
307
|
+
* Permitted values: [0..1] */
|
|
308
|
+
this.themeColorOpacity = 100
|
|
304
309
|
/** allows you to change text and icons' color.
|
|
305
310
|
Permitted values: Hex color codes, e.g. #425635 and RGB color
|
|
306
311
|
codes, e.g. rgb(66,86,53) */
|
|
307
|
-
this.
|
|
312
|
+
this.themeForegroundColor = convertColorToRGBA('#ffffff', 100);
|
|
308
313
|
/** allows the user to download the chat transcript. The download button appears
|
|
309
314
|
when the chat is closed by the operator. Permitter values: true, false.
|
|
310
315
|
Default value: false */
|
|
311
|
-
this.
|
|
316
|
+
this.allowTranscriptDownload = false;
|
|
312
317
|
/** link nel footer widget */
|
|
313
|
-
this.
|
|
318
|
+
this.poweredBy = BRAND_BASE_INFO.POWERED_BY;
|
|
314
319
|
/** url img logo */
|
|
315
|
-
this.
|
|
320
|
+
this.logoChat = BRAND_BASE_INFO.LOGO_CHAT;
|
|
316
321
|
/** set margin left or rigth widget */
|
|
317
|
-
this.
|
|
322
|
+
this.marginX = '20px';
|
|
318
323
|
/** set margin bottom widget */
|
|
319
|
-
this.
|
|
324
|
+
this.marginY = '20px';
|
|
320
325
|
/** set margin left or rigth widget for mobile */
|
|
321
|
-
this.
|
|
326
|
+
this.mobileMarginX = '0px';
|
|
322
327
|
/** set margin bottom widget for mobile*/
|
|
323
|
-
this.
|
|
328
|
+
this.mobileMarginY = '0px';
|
|
324
329
|
/** set launcher width widget */
|
|
325
|
-
this.
|
|
330
|
+
this.launcherWidth = '60px'
|
|
326
331
|
/** set launcher height widget */
|
|
327
|
-
this.
|
|
332
|
+
this.launcherHeight = '60px'
|
|
328
333
|
/** set launcher baloon widget image: require SVG url */
|
|
329
|
-
this.
|
|
334
|
+
this.baloonImage='';
|
|
330
335
|
/** set launcher balon widget shape: can set corner by corner */
|
|
331
|
-
this.
|
|
336
|
+
this.baloonShape = '50%';
|
|
332
337
|
// this.parameters['isLogEnabled'] = false;
|
|
333
|
-
this.
|
|
338
|
+
this.isLogEnabled = false;
|
|
339
|
+
/** Hide the header conversation Permitted values: true,
|
|
340
|
+
false. The default value is false. */
|
|
341
|
+
this.hideHeaderConversation= false;
|
|
342
|
+
/** Hide the close button in the widget header. Permitted values: true,
|
|
343
|
+
false. The default value is false. */
|
|
344
|
+
this.hideHeaderCloseButton = false;
|
|
334
345
|
/** enable to hide/show upper-right header conversation options menu */
|
|
335
|
-
this.
|
|
346
|
+
this.openExternalLinkButton = true;
|
|
336
347
|
/** enable to close a conversation from upper-right header menu */
|
|
337
|
-
this.
|
|
348
|
+
this.hideHeaderConversationOptionsMenu = false;
|
|
338
349
|
/** enable to hide/show options menu in conversation detail header */
|
|
339
|
-
this.
|
|
350
|
+
this.hideCloseConversationOptionMenu = false;
|
|
340
351
|
/** enable to hide/show options menu in home component */
|
|
341
|
-
this.
|
|
352
|
+
this.hideSettings = false;
|
|
342
353
|
/** show conversations with conversation.attributes.requester_id == user.uid */
|
|
343
|
-
this.
|
|
354
|
+
this.filterByRequester = false;
|
|
344
355
|
/** set the auth persistence */
|
|
345
|
-
this.
|
|
356
|
+
this.persistence = 'local';
|
|
346
357
|
/** set the preChatForm Json as default if preChatFormCustomFieldsEnabled is false or not exist */
|
|
347
|
-
this.
|
|
358
|
+
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
359
|
/** set the background of bubble sent message */
|
|
349
|
-
this.
|
|
360
|
+
this.bubbleSentBackground = convertColorToRGBA('#2a6ac1', 100); //'#62a8ea'
|
|
350
361
|
/** set the text color of bubble sent message */
|
|
351
|
-
this.
|
|
362
|
+
this.bubbleSentTextColor = convertColorToRGBA('#ffffff', 100); //'#ffffff'
|
|
352
363
|
/** set the background of bubble received message */
|
|
353
|
-
this.
|
|
364
|
+
this.bubbleReceivedBackground= convertColorToRGBA('#f0f2f7', 100); //#f7f7f7;
|
|
354
365
|
/** set the text color of bubble received message */
|
|
355
|
-
this.
|
|
366
|
+
this.bubbleReceivedTextColor = convertColorToRGBA('#06132b', 100); //#1a1a1a
|
|
356
367
|
/** set the text size of bubble messages */
|
|
357
|
-
this.
|
|
368
|
+
this.fontSize = '1.4em'
|
|
358
369
|
/** set the text family of bubble messages */
|
|
359
|
-
this.
|
|
370
|
+
this.fontFamily = "'Roboto','Google Sans', Helvetica, Arial, sans-serif"
|
|
360
371
|
/** set the text size of attachment-buttons */
|
|
361
|
-
this.
|
|
372
|
+
this.buttonFontSize = '15px'
|
|
362
373
|
/** set the backgroundColor of attachment-buttons */
|
|
363
|
-
this.
|
|
374
|
+
this.buttonBackgroundColor = convertColorToRGBA('#ffffff', 100)
|
|
364
375
|
/** set the text color of attachment-buttons */
|
|
376
|
+
this.buttonTextColor = convertColorToRGBA('#2a6ac1', 100)
|
|
377
|
+
/** set the text size of attachment-buttons */
|
|
365
378
|
this.buttonHoverBackgroundColor = convertColorToRGBA('#2a6ac1', 100)
|
|
366
379
|
/** set the text size of attachment-buttons */
|
|
367
380
|
this.buttonHoverTextColor = convertColorToRGBA('#ffffff', 100);
|
|
368
|
-
/** set the text size of attachment-buttons */
|
|
369
|
-
this.singleConversation = false;
|
|
370
381
|
/** set the single conversation mode for the widget */
|
|
371
|
-
this.
|
|
382
|
+
this.singleConversation = false;
|
|
372
383
|
/** allow you to always restart a new converazioe */
|
|
373
|
-
this.
|
|
384
|
+
this.restartConversation = false;
|
|
374
385
|
/** set if native rating componet has to be shown */
|
|
375
|
-
this.
|
|
386
|
+
this.nativeRating = true;
|
|
376
387
|
/** disable or show bubble info message 'MEMBER_JOINED_CHAT' */
|
|
377
|
-
this.
|
|
388
|
+
this.showInfoMessage = 'MEMBER_JOINED_GROUP'.split(',').map(key => { return key.trim()});
|
|
378
389
|
/** set the location of typing indicator (header or content) */
|
|
379
|
-
this.
|
|
390
|
+
this.typingLocation = 'content'
|
|
380
391
|
/** enable the user to reopen a closed conversation */
|
|
381
392
|
// this.continueConversationBeforeTime = 48;
|
|
382
393
|
/** enable user to continue archived confersation before the value time from last timeout message */
|
|
383
|
-
this.
|
|
394
|
+
this.allowReopen = false;
|
|
384
395
|
/** enable user to talk with specific chat-bots/humans */
|
|
385
|
-
this.
|
|
396
|
+
this.participants = [];
|
|
386
397
|
/**enable user to set a whatsapp business number to chat with */
|
|
387
|
-
this.
|
|
398
|
+
this.whatsappNumber = '';
|
|
388
399
|
/**enable user to set a facebook messanger page to chat with */
|
|
389
|
-
this.
|
|
400
|
+
this.messangerPageTitle = ''
|
|
390
401
|
/**enable user to set a telegram number to chat with */
|
|
391
|
-
this.
|
|
402
|
+
this.telegramUsername = ''
|
|
392
403
|
/**enable auto disconnect from messaging after a defined amount of time (s)*/
|
|
404
|
+
this.fileUploadAccept = "image/*,.pdf,.txt,.mp3"
|
|
393
405
|
this.disconnetTime = 0
|
|
394
406
|
|
|
395
407
|
this.showWaitTime = true;
|
|
@@ -417,57 +429,40 @@ export class Globals {
|
|
|
417
429
|
this.showAttachmentFooterButton = true;
|
|
418
430
|
/** show/hide rec audio option in footer chat-detail page */
|
|
419
431
|
this.showAudioRecorderFooterButton = true;
|
|
432
|
+
/** enabled to set a list of pattern url able to load the widget **/
|
|
433
|
+
this.allowedOnSpecificUrl = false
|
|
434
|
+
/** set a list of pattern url able to load the widget */
|
|
435
|
+
this.allowedOnSpecificUrlList = [];
|
|
436
|
+
/** set widget size from 3 different positions: min, max, top */
|
|
437
|
+
this.size = 'min';
|
|
420
438
|
|
|
421
439
|
// ============ END: SET EXTERNAL PARAMETERS ==============//
|
|
422
440
|
|
|
423
441
|
|
|
424
442
|
// ============ BEGIN: SET INTERNAL PARAMETERS ==============//
|
|
443
|
+
/** name tenant ex: tilechat */
|
|
425
444
|
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 */
|
|
445
|
+
/** channelType: group/direct */
|
|
432
446
|
this.channelType = CHANNEL_TYPE.GROUP;
|
|
433
|
-
|
|
434
|
-
// this.parameters.push({'channelType': CHANNEL_TYPE.GROUP});
|
|
435
|
-
/** channelType: group/direct */
|
|
447
|
+
/** settings for pass variables to js */
|
|
436
448
|
this.default_settings = {};
|
|
437
|
-
|
|
438
|
-
/** settings for pass variables to js */
|
|
449
|
+
/** detect is mobile : detectIfIsMobile() */
|
|
439
450
|
this.isMobile = false;
|
|
440
|
-
|
|
441
|
-
// this.parameters.push({'isMobile': false}); /** detect is mobile : detectIfIsMobile() */
|
|
442
|
-
|
|
451
|
+
/** detect is logged */
|
|
443
452
|
this.isLogged = false;
|
|
444
|
-
|
|
445
|
-
// this.parameters.push({'isLogged': false}); /** detect is logged */
|
|
446
|
-
|
|
453
|
+
|
|
447
454
|
this.BUILD_VERSION = 'v.' + environment.version;
|
|
448
|
-
// this.parameters['BUILD_VERSION'] = 'v.' + environment.version;
|
|
449
|
-
// this.parameters.push({'BUILD_VERSION': 'v.' + environment.version});
|
|
450
455
|
|
|
451
456
|
this.soundEnabled = true;
|
|
452
|
-
// this.parameters['soundEnabled'] = true;
|
|
453
|
-
// this.parameters.push({'soundEnabled': true});
|
|
454
457
|
|
|
455
458
|
this.conversationsBadge = 0;
|
|
456
|
-
// this.parameters['conversationsBadge'] = 0;
|
|
457
|
-
// this.parameters.push({'conversationsBadge': 0});
|
|
458
459
|
|
|
459
460
|
this.isOpenMenuOptions = false;
|
|
460
|
-
// this.parameters['isOpenMenuOptions'] = false;
|
|
461
|
-
// this.parameters.push({'isOpenMenuOptions': false});
|
|
462
461
|
|
|
463
462
|
this.displayEyeCatcherCard = 'none';
|
|
464
|
-
// this.parameters['displayEyeCatcherCard'] = 'none';
|
|
465
|
-
// this.parameters.push({'displayEyeCatcherCard': 'none'});
|
|
466
463
|
// ============ END: SET INTERNAL PARAMETERS ==============//
|
|
467
464
|
|
|
468
465
|
this.supportMode = true;
|
|
469
|
-
// this.parameters['supportMode'] = true;
|
|
470
|
-
// this.parameters.push({'supportMode': true});
|
|
471
466
|
|
|
472
467
|
this.newConversationStart = true;
|
|
473
468
|
|
|
@@ -525,7 +520,7 @@ export class Globals {
|
|
|
525
520
|
'fullscreenMode': this.fullscreenMode,
|
|
526
521
|
'filterByRequester': this.filterByRequester,
|
|
527
522
|
'hideHeaderConversationOptionsMenu': this.hideHeaderConversationOptionsMenu, 'hideHeaderCloseButton': this.hideHeaderCloseButton,
|
|
528
|
-
'hideCloseConversationOptionMenu': this.hideCloseConversationOptionMenu,
|
|
523
|
+
'hideCloseConversationOptionMenu': this.hideCloseConversationOptionMenu, 'hideHeaderConversation': this.hideHeaderConversation,
|
|
529
524
|
'hideSettings': this.hideSettings,
|
|
530
525
|
'isLogEnabled': this.isLogEnabled,
|
|
531
526
|
'isOpen': this.isOpen, 'isShown': this.isShown,
|
|
@@ -619,6 +614,11 @@ export class Globals {
|
|
|
619
614
|
this.align === 'left'? divTiledeskWidget.style.left = this.mobileMarginX : divTiledeskWidget.style.right = this.mobileMarginX;
|
|
620
615
|
}
|
|
621
616
|
|
|
617
|
+
//customize position for 'tiledeskdiv' for desktop if fullscreenMode is not active
|
|
618
|
+
if(isOpen && !this.isMobile && !this.fullscreenMode && divTiledeskWidget && this.size){
|
|
619
|
+
divTiledeskWidget.classList.add(this.size + '-size')
|
|
620
|
+
}
|
|
621
|
+
|
|
622
622
|
|
|
623
623
|
}
|
|
624
624
|
|
package/src/app/utils/utils.ts
CHANGED
|
@@ -200,92 +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
|
-
export function isAllowedUrlInText(text: string, allowedUrls: string[]){
|
|
252
|
-
const urlsInMessage = extractUrls(text);
|
|
253
|
-
console.log('urlsInMessage ++++ :', urlsInMessage);
|
|
254
|
-
|
|
255
|
-
// Normalize the list of allowed domains by extracting only the hostnames
|
|
256
|
-
const allowedHostnames = allowedUrls.map(url => {
|
|
257
|
-
try {
|
|
258
|
-
return new URL(url).hostname.toLowerCase();
|
|
259
|
-
} catch {
|
|
260
|
-
// Se è un dominio "nudo", come 'tiledesk.com'
|
|
261
|
-
return url.toLowerCase();
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
const nonWhitelistedDomains = urlsInMessage.filter((url) => {
|
|
266
|
-
try {
|
|
267
|
-
const domain = new URL(url).hostname.toLowerCase();
|
|
268
|
-
return !allowedHostnames.includes(domain);
|
|
269
|
-
} catch (e) {
|
|
270
|
-
// Ignore invalid URLs
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
|
|
275
|
-
if (nonWhitelistedDomains.length > 0) {
|
|
276
|
-
console.warn('Message blocked: Non-whitelisted domain(s):', nonWhitelistedDomains);
|
|
277
|
-
// this.domainWarning = true; // <-- display a warning
|
|
278
|
-
return false;
|
|
279
|
-
}
|
|
280
|
-
return true
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
function extractUrls(text: string): string[] {
|
|
285
|
-
const urlRegex = /https?:\/\/[^\s]+/g;
|
|
286
|
-
return text.match(urlRegex) || [];
|
|
287
|
-
}
|
|
288
|
-
|
|
289
204
|
export function setColorFromString(str: string) {
|
|
290
205
|
const arrayBckColor = ['#fba76f', '#80d066', '#73cdd0', '#ecd074', '#6fb1e4', '#f98bae'];
|
|
291
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">
|