@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.
Files changed (79) hide show
  1. package/CHANGELOG.md +110 -8
  2. package/angular.json +2 -2
  3. package/deploy_beta.sh +10 -0
  4. package/deploy_prod.sh +9 -0
  5. package/package.json +2 -2
  6. package/src/app/app.component.html +7 -1
  7. package/src/app/app.component.scss +11 -102
  8. package/src/app/app.component.ts +60 -2
  9. package/src/app/component/conversation-detail/conversation/conversation.component.html +4 -2
  10. package/src/app/component/conversation-detail/conversation/conversation.component.scss +70 -7
  11. package/src/app/component/conversation-detail/conversation/conversation.component.ts +106 -65
  12. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +3 -2
  13. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.scss +7 -15
  14. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +1 -5
  15. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +48 -33
  16. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +13 -8
  17. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +17 -18
  18. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +11 -15
  19. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +54 -17
  20. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +1 -2
  21. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +7 -5
  22. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.scss +0 -3
  23. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +1 -3
  24. package/src/app/component/form/form-builder/form-builder.component.scss +0 -1
  25. package/src/app/component/form/inputs/form-text/form-text.component.scss +0 -1
  26. package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +0 -1
  27. package/src/app/component/form/prechat-form/prechat-form.component.scss +1 -3
  28. package/src/app/component/home/home.component.html +41 -0
  29. package/src/app/component/home/home.component.scss +34 -8
  30. package/src/app/component/home/home.component.ts +17 -0
  31. package/src/app/component/home-conversations/home-conversations.component.scss +0 -3
  32. package/src/app/component/last-message/last-message.component.html +0 -2
  33. package/src/app/component/last-message/last-message.component.scss +0 -2
  34. package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -5
  35. package/src/app/component/list-conversations/list-conversations.component.scss +0 -2
  36. package/src/app/component/menu-options/menu-options.component.scss +0 -2
  37. package/src/app/component/message/audio/audio.component.html +1 -1
  38. package/src/app/component/message/audio/audio.component.scss +1 -0
  39. package/src/app/component/message/audio/audio.component.ts +0 -1
  40. package/src/app/component/message/avatar/avatar.component.scss +4 -4
  41. package/src/app/component/message/bubble-message/bubble-message.component.html +1 -4
  42. package/src/app/component/message/bubble-message/bubble-message.component.scss +0 -1
  43. package/src/app/component/message/bubble-message/bubble-message.component.ts +0 -2
  44. package/src/app/component/message/buttons/action-button/action-button.component.scss +6 -6
  45. package/src/app/component/message/buttons/link-button/link-button.component.scss +5 -5
  46. package/src/app/component/message/buttons/text-button/text-button.component.scss +5 -6
  47. package/src/app/component/message/carousel/carousel.component.html +2 -1
  48. package/src/app/component/message/carousel/carousel.component.scss +5 -6
  49. package/src/app/component/message/frame/frame.component.scss +0 -2
  50. package/src/app/component/message/html/html.component.scss +1 -3
  51. package/src/app/component/message/image/image.component.scss +0 -2
  52. package/src/app/component/message/info-message/info-message.component.scss +0 -2
  53. package/src/app/component/message/like-unlike/like-unlike.component.scss +0 -2
  54. package/src/app/component/message/text/text.component.html +4 -4
  55. package/src/app/component/message/text/text.component.scss +2 -4
  56. package/src/app/component/message/text/text.component.ts +0 -2
  57. package/src/app/component/message-attachment/message-attachment.component.scss +2 -1
  58. package/src/app/component/selection-department/selection-department.component.scss +1 -5
  59. package/src/app/component/star-rating-widget/star-rating-widget.component.scss +0 -7
  60. package/src/app/pipe/marked.pipe.ts +18 -7
  61. package/src/app/providers/global-settings.service.ts +108 -9
  62. package/src/app/sass/_variables.scss +15 -2
  63. package/src/app/utils/constants.ts +2 -1
  64. package/src/app/utils/globals.ts +101 -101
  65. package/src/app/utils/utils.ts +0 -85
  66. package/src/assets/i18n/en.json +5 -4
  67. package/src/assets/i18n/es.json +3 -2
  68. package/src/assets/i18n/fr.json +3 -2
  69. package/src/assets/i18n/it.json +3 -2
  70. package/src/assets/twp/chatbot-panel.html +39 -0
  71. package/src/assets/twp/index-dev.html +177 -121
  72. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -1
  73. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +9 -1
  74. package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +14 -0
  75. package/src/chat21-core/utils/constants.ts +2 -0
  76. package/src/chat21-core/utils/user-typing/user-typing.component.scss +0 -1
  77. package/src/chat21-core/utils/utils-message.ts +12 -1
  78. package/src/chat21-core/utils/utils.ts +85 -0
  79. package/src/iframe-style.css +54 -35
@@ -1,5 +1,3 @@
1
- @import 'src/app/sass/variables';
2
-
3
1
  :host {
4
2
  --backgroundColor: #{var(--blue)};
5
3
  --textColor: #{var(--bck-msg-sent)};
@@ -7,12 +5,14 @@
7
5
  --hoverTextColor: #{var(--blue)};
8
6
  --buttonFontSize: #{var(--button-in-msg-font-size)};
9
7
  --max-width: #{var(--button-in-msg-max-width)};
8
+ --padding: #{var(--button-in-msg-padding)};
9
+ --fontFamily: #{var(--button-in-msg-font-family)};
10
10
  }
11
11
 
12
12
  .button-in-msg {
13
- padding: 8px 16px!important;
14
- position: relative;
15
- max-width: var(--max-width);
13
+ padding: var(--padding);
14
+ // position: relative;
15
+ // max-width: var(--max-width);
16
16
  min-width: inherit;
17
17
  cursor: pointer;
18
18
  border: 1px solid var(--textColor);
@@ -20,7 +20,7 @@
20
20
  margin: 3px;
21
21
  background: var(--backgroundColor);
22
22
  overflow: hidden;
23
- font-family: 'Muli', sans-serif;
23
+ font-family: var(--fontFamily);
24
24
  font-size: var(--buttonFontSize);
25
25
  -o-text-overflow: ellipsis;
26
26
  text-overflow: ellipsis;
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :host {
4
2
  --backgroundColor: #{var(--blue)};
5
3
  --textColor: #{var(--bck-msg-sent)};
@@ -7,12 +5,14 @@
7
5
  --hoverTextColor: #{var(--blue)};
8
6
  --buttonFontSize: #{var(--button-in-msg-font-size)};
9
7
  --max-width: #{var(--button-in-msg-max-width)};
8
+ --padding: #{var(--button-in-msg-padding)};
9
+ --font-family: #{var(--button-in-msg-font-family)};
10
10
  }
11
11
 
12
12
  .button-in-msg {
13
- padding: 8px 16px!important;
13
+ padding: var(--padding);
14
14
  position: relative;
15
- max-width: var(--max-width);
15
+ // max-width: var(--max-width);
16
16
  min-width: inherit;
17
17
  cursor: pointer;
18
18
  border: 1px solid var(--textColor);
@@ -20,7 +20,7 @@
20
20
  margin: 3px;
21
21
  background: var(--backgroundColor);
22
22
  overflow: hidden;
23
- font-family: 'Muli', sans-serif;
23
+ font-family: var(--font-family);
24
24
  font-size: var(--buttonFontSize);
25
25
  -o-text-overflow: ellipsis;
26
26
  text-overflow: ellipsis;
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :host {
4
2
  --backgroundColor: #{var(--blue)};
5
3
  --textColor: #{var(--bck-msg-sent)};
@@ -7,14 +5,15 @@
7
5
  --hoverTextColor: #{var(--blue)};
8
6
  --buttonFontSize: #{var(--button-in-msg-font-size)};
9
7
  --max-width: #{var(--button-in-msg-max-width)};
8
+ --padding: #{var(--button-in-msg-padding)};
9
+ --font-family: #{var(--button-in-msg-font-family)};
10
10
  }
11
11
 
12
12
 
13
13
  .button-in-msg {
14
-
15
- padding: 8px 16px!important;
14
+ padding: var(--padding);
16
15
  position: relative;
17
- max-width: var(--max-width);
16
+ // max-width: var(--max-width);
18
17
  min-width: inherit;
19
18
  cursor: pointer;
20
19
  border: 1px solid var(--textColor); //$blue
@@ -22,7 +21,7 @@
22
21
  margin: 3px;
23
22
  background: var(--backgroundColor);
24
23
  overflow: hidden;
25
- font-family: 'Muli', sans-serif;
24
+ font-family: var(--font-family);
26
25
  font-size: var(--buttonFontSize);
27
26
  -o-text-overflow: ellipsis;
28
27
  text-overflow: ellipsis;
@@ -7,7 +7,8 @@
7
7
  <div class="carousel">
8
8
  <!-- <div class="card" style="width: 17px;"></div> -->
9
9
  <div class="card" *ngFor="let card of gallery; let i = index">
10
- <div [style.opacity]="i+1 === activeElement? 1: 0.5">
10
+ <!-- <div [style.opacity]="i+1 === activeElement? 1: 0.5"> -->
11
+ <div>
11
12
  <div class="card-image" *ngIf="card?.preview?.src !== ''">
12
13
  <img [src]="card?.preview?.src" alt="img" draggable="false">
13
14
  </div>
@@ -1,5 +1,3 @@
1
- @import 'src/app/sass/variables';
2
-
3
1
  :host {
4
2
  --backgroundColor: #{var(--blue)};
5
3
  --textColor: #{var(--bck-msg-sent)};
@@ -7,6 +5,7 @@
7
5
  --hoverTextColor: #{var(--blue)};
8
6
  --buttonFontSize: #{var(--button-in-msg-font-size)};
9
7
  --max-width: #{var(--button-in-msg-max-width)};
8
+ --fontFamily: #{var(--font-family)};
10
9
 
11
10
  --cardWidth: 220px;
12
11
  }
@@ -55,7 +54,7 @@
55
54
  display: grid;
56
55
  align-items: start;
57
56
  grid-auto-flow: column;
58
- grid-auto-columns: calc((100% / 3) - 12px);
57
+ // grid-auto-columns: calc((100% / 3) - 12px);
59
58
  // overflow-x: auto;
60
59
  overflow-x: hidden;
61
60
  scroll-snap-type: x mandatory;
@@ -203,7 +202,7 @@
203
202
  transition: all .3s;
204
203
 
205
204
  background: var(--backgroundColor);
206
- font-family: 'Muli', sans-serif;
205
+ font-family: var(--fontFamily);
207
206
  font-size: var(--buttonFontSize);
208
207
  -o-text-overflow: ellipsis;
209
208
  text-overflow: ellipsis;
@@ -271,12 +270,12 @@
271
270
  }
272
271
  @media screen and (max-width: 900px) {
273
272
  .wrapper .carousel {
274
- grid-auto-columns: calc((100% / 2) - 9px);
273
+ // grid-auto-columns: calc((100% / 2) - 9px);
275
274
  }
276
275
  }
277
276
  @media screen and (max-width: 600px) {
278
277
  .wrapper .carousel {
279
- grid-auto-columns: var(--cardWidth);
278
+ // grid-auto-columns: var(--cardWidth);
280
279
  // grid-auto-columns: 17px repeat(var(--cardWidth)) 17px;
281
280
  }
282
281
  }
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :host{
4
2
  // --borderRadius: #{$border-radius-bubble-message};
5
3
  --borderRadius: 8px;
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :root {
4
2
  --themeColor: #{var(--blue)};
5
3
  --foregroundColor: #{var(--col-msg-sent)};
@@ -20,7 +18,7 @@
20
18
  margin: 3px;
21
19
  background: transparent;
22
20
  overflow: hidden;
23
- font-family: 'Muli', sans-serif !important;
21
+ font-family: var(--font-family) !important;
24
22
  font-size: var(--buttonFontSize) !important;
25
23
  -o-text-overflow: ellipsis;
26
24
  text-overflow: ellipsis;
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :host{
4
2
  // --borderRadius: #{$border-radius-bubble-message};
5
3
  --borderRadius: 8px;
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  .info-container{
4
2
  display: flex;
5
3
  align-content: center;
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :host{
4
2
  // --borderRadius: #{$border-radius-bubble-message};
5
3
  --borderRadius: 25px;
@@ -1,4 +1,4 @@
1
- <p #messageEl class="message_innerhtml marked"
2
- [innerHTML]="printMessage(text, messageEl, this) | htmlEntitiesEncode | marked"
3
- [style.color]="color"
4
- [style.font-size]="fontSize"></p>
1
+ <p #messageEl class="message_innerhtml marked"
2
+ [innerHTML]="printMessage(text, messageEl, this) | marked"
3
+ [style.color]="color"></p>
4
+ <!-- [innerHTML]="printMessage(text, messageEl, this) | htmlEntitiesEncode | marked" -->
@@ -1,10 +1,8 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  .message_innerhtml {
4
2
  margin: 0px;
5
3
  // padding: 0px 14px;
6
4
  &.marked{
7
- padding:8px;
5
+ padding: 12px 16px;
8
6
  margin-block-start: 0em!important;
9
7
  margin-block-end: 0em!important;
10
8
  }
@@ -15,7 +13,7 @@
15
13
  }
16
14
 
17
15
  p {
18
- font-size: 1.4em;
16
+ font-size: var(--font-size-bubble-message);
19
17
  margin: 0;
20
18
  padding: 14px;
21
19
  line-height: 1.4em;
@@ -10,8 +10,6 @@ export class TextComponent implements OnInit {
10
10
  @Input() text: string;
11
11
  @Input() htmlEnabled: boolean = false;
12
12
  @Input() color: string;
13
- @Input() fontSize: string;
14
- @Input() fontFamily: string;
15
13
  @Output() onBeforeMessageRender = new EventEmitter();
16
14
  @Output() onAfterMessageRender = new EventEmitter();
17
15
 
@@ -12,7 +12,8 @@
12
12
  display: flex;
13
13
  flex-wrap: wrap;
14
14
  -webkit-box-pack: end;
15
- justify-content: flex-end;
15
+ // justify-content: flex-end;
16
+ justify-content: flex-start;
16
17
  width: 100%;
17
18
  border: none;
18
19
  }
@@ -1,7 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
- // @import '../../../sass/normalize.css';
3
-
4
-
5
1
  #chat21-selection-department {
6
2
 
7
3
  --backgroundColor: #{var(--light-white)};
@@ -16,7 +12,7 @@
16
12
  .c21-header {
17
13
  overflow: hidden;
18
14
  width: 100%;
19
- height: 52px;
15
+ height: var(--chat-header-height);
20
16
  .c21-header-button {
21
17
  .c21-close-button.c21-small {
22
18
  width: 31px;
@@ -1,7 +1,5 @@
1
1
  // @import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
2
2
  // @import url(https://use.fontawesome.com/releases/v5.5.0/css/all.css);
3
- // @import 'src/app/sass/variables';
4
-
5
3
  #chat21-star-rating-widget {
6
4
  background-color: #ffffff;
7
5
  width: 100%;
@@ -82,11 +80,6 @@
82
80
  .c21-body-content {
83
81
  padding: 10px 0px;
84
82
  /* star-rating */
85
- .default-title {
86
- font-size: 2em;
87
- font-family:'Roboto';
88
- color:var(--black);
89
- }
90
83
  .default-text {
91
84
  font-size: 1.4em;
92
85
  font-family:'Roboto';
@@ -9,19 +9,30 @@ import { marked } from 'marked';
9
9
  export class MarkedPipe implements PipeTransform {
10
10
  transform(value: any): any {
11
11
  const renderer = new marked.Renderer();
12
- renderer.link = function(href, title, text) {
13
- const link = marked.Renderer.prototype.link.call(this, href, title, text);
14
- return link.replace('<a', '<a target="_blank" ');
12
+ renderer.link = function({ href, title, tokens }) {
13
+ const text = tokens
14
+ ? tokens.map(token => token.raw).join('')
15
+ : href; // fallback se tokens non c'è
16
+ if (!href) return text;
17
+
18
+ return `<a href="${href}" target="_blank" rel="noopener noreferrer">${text}</a>`;
15
19
  };
20
+
16
21
  marked.setOptions({
17
- renderer: renderer
22
+ renderer,
23
+ gfm: true,
24
+ breaks: true
18
25
  });
26
+
19
27
  if (value && value.length > 0) {
20
- const text = marked(value);
21
- return text;
28
+ try {
29
+ return marked.parse(value);
30
+ } catch (err) {
31
+ console.error('Errore nel parsing markdown:', err);
32
+ return value;
33
+ }
22
34
  }
23
35
  return value;
24
36
  }
25
37
 
26
-
27
38
  }
@@ -10,7 +10,7 @@ import { TemplateBindingParseResult } from '@angular/compiler';
10
10
  import { AppStorageService } from '../../chat21-core/providers/abstract/app-storage.service';
11
11
  import { LoggerService } from '../../chat21-core/providers/abstract/logger.service';
12
12
  import { LoggerInstance } from '../../chat21-core/providers/logger/loggerInstance';
13
- import { invertColor, isJsonArray } from '../../chat21-core/utils/utils';
13
+ import { invertColor, isAllowedUrlInText, isJsonArray } from '../../chat21-core/utils/utils';
14
14
  import { AppConfigService } from './app-config.service';
15
15
 
16
16
 
@@ -331,6 +331,8 @@ export class GlobalSettingsService {
331
331
  this.globals.setColorWithGradient();
332
332
  /** set css iframe from parameters */
333
333
  this.setCssIframe();
334
+ /** set main style */
335
+ this.setStyle();
334
336
 
335
337
  this.logger.debug('[GLOBAL-SET] ***** END SET PARAMETERS *****');
336
338
  this.obsSettingsService.next(true);
@@ -373,8 +375,36 @@ export class GlobalSettingsService {
373
375
  divTiledeskiframe.style.height = '100%';
374
376
  divTiledeskiframe.style.maxHeight = 'none';
375
377
  divTiledeskiframe.style.maxWidth = 'none';
378
+ // divTiledeskiframe.classList.add('fullscreen')
379
+ divTiledeskiframe.classList.remove('min-size')
380
+ divTiledeskiframe.classList.remove('max-size')
381
+ divTiledeskiframe.classList.remove('top-size')
382
+
383
+ }
384
+ }
385
+
386
+ setStyle(){
387
+
388
+ /** load custom FONT */
389
+ if(this.globals.fontFamily && this.globals.fontFamilySource){
390
+ this.loadFont(this.globals.fontFamily, this.globals.fontFamilySource)
376
391
  }
377
392
  }
393
+ loadFont(family: string, href: string,) {
394
+ const mainFont = family.split(",")[0].replace(/['"]/g, "").trim(); // es. "Montserrat"
395
+
396
+ if (document.querySelector(`link[data-font='${mainFont}']`)) {
397
+ return;
398
+ }
399
+
400
+ const link = document.createElement('link');
401
+ link.rel = 'stylesheet';
402
+ link.href = href;
403
+ link.setAttribute('data-font', mainFont); // marker pulito
404
+ document.head.appendChild(link);
405
+
406
+ document.documentElement.style.setProperty('--font-family', family);
407
+ }
378
408
  /**
379
409
  * A: setVariablesFromService
380
410
  */
@@ -516,6 +546,15 @@ export class GlobalSettingsService {
516
546
  if (variables.hasOwnProperty('showAudioRecorderFooterButton')) {
517
547
  globals['showAudioRecorderFooterButton'] = variables['showAudioRecorderFooterButton'];
518
548
  }
549
+ if (variables.hasOwnProperty('allowedOnSpecificUrl')) {
550
+ globals['allowedOnSpecificUrl'] = variables['allowedOnSpecificUrl'];
551
+ }
552
+ if (variables.hasOwnProperty('allowedOnSpecificUrlList')) {
553
+ globals['allowedOnSpecificUrlList'] = variables['allowedOnSpecificUrlList'];
554
+ }
555
+ if (variables.hasOwnProperty('allowedUploadExtentions')) {
556
+ globals['fileUploadAccept'] = variables['allowedUploadExtentions'];
557
+ }
519
558
 
520
559
  }
521
560
  }
@@ -728,13 +767,19 @@ export class GlobalSettingsService {
728
767
  TEMP = tiledeskSettings['fullscreenMode'];
729
768
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fullscreenMode:: ', TEMP);
730
769
  if (TEMP !== undefined) {
731
- globals.fullscreenMode = TEMP;
770
+ globals.fullscreenMode = (TEMP === true) ? true : false;
732
771
  // globals.setParameter('fullscreenMode', TEMP);
733
772
  }
734
773
  TEMP = tiledeskSettings['hideHeaderCloseButton'];
735
774
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > hideHeaderCloseButton:: ', TEMP);
736
775
  if (TEMP !== undefined) {
737
- globals.hideHeaderCloseButton = TEMP;
776
+ globals.hideHeaderCloseButton = (TEMP === true) ? true : false;
777
+ // globals.setParameter('hideHeaderCloseButton', TEMP);
778
+ }
779
+ TEMP = tiledeskSettings['hideHeaderConversation'];
780
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > hideHeaderCloseButton:: ', TEMP);
781
+ if (TEMP !== undefined) {
782
+ globals.hideHeaderConversation = (TEMP === true) ? true : false;
738
783
  // globals.setParameter('hideHeaderCloseButton', TEMP);
739
784
  }
740
785
  TEMP = tiledeskSettings['themeColor'];
@@ -877,7 +922,7 @@ export class GlobalSettingsService {
877
922
  globals.hideSettings = (TEMP === true) ? true : false;;
878
923
  }
879
924
  TEMP = tiledeskSettings['isLogEnabled'];
880
- // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > logLevel:: ', TEMP]);
925
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > isLogEnabled:: ', TEMP]);
881
926
  if (TEMP !== undefined) {
882
927
  globals.isLogEnabled = TEMP;
883
928
  }
@@ -923,7 +968,12 @@ export class GlobalSettingsService {
923
968
  TEMP = tiledeskSettings['fontFamily'];
924
969
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fontFamily:: ', TEMP]);
925
970
  if (TEMP !== undefined) {
926
- globals.fontFamily = TEMP;
971
+ globals.fontFamily = TEMP + ',' + globals.fontFamily;
972
+ }
973
+ TEMP = tiledeskSettings['fontFamilySource'];
974
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fontFamilySource:: ', TEMP]);
975
+ if (TEMP !== undefined) {
976
+ globals.fontFamilySource = TEMP;
927
977
  }
928
978
  TEMP = tiledeskSettings['buttonFontSize'];
929
979
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > buttonFontSize:: ', TEMP]);
@@ -970,7 +1020,7 @@ export class GlobalSettingsService {
970
1020
  globals.nativeRating = (TEMP === true) ? true : false;
971
1021
  }
972
1022
  TEMP = tiledeskSettings['showInfoMessage'];
973
- // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > showBubbleInfoMessage:: ', TEMP]);
1023
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > showInfoMessage:: ', TEMP]);
974
1024
  if (TEMP !== undefined) {
975
1025
  globals.showInfoMessage = TEMP.split(',').map(key => { return key.trim()});
976
1026
  }
@@ -1013,7 +1063,7 @@ export class GlobalSettingsService {
1013
1063
  globals.telegramUsername = TEMP;
1014
1064
  }
1015
1065
  TEMP = tiledeskSettings['fileUploadAccept'];
1016
- // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > telegramUsername:: ', TEMP]);
1066
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fileUploadAccept:: ', TEMP]);
1017
1067
  if (TEMP !== undefined) {
1018
1068
  globals.fileUploadAccept = TEMP;
1019
1069
  }
@@ -1053,9 +1103,14 @@ export class GlobalSettingsService {
1053
1103
  globals.showEmojiFooterButton = (TEMP === true) ? true : false;
1054
1104
  }
1055
1105
  TEMP = tiledeskSettings['showAudioRecorderFooterButton'];
1056
- // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > showEmojiFooterButton:: ', TEMP]);
1106
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > showAudioRecorderFooterButton:: ', TEMP]);
1057
1107
  if (TEMP !== undefined) {
1058
1108
  globals.showAudioRecorderFooterButton = (TEMP === true) ? true : false;
1109
+ }
1110
+ TEMP = tiledeskSettings['size'];
1111
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > size:: ', TEMP]);
1112
+ if (TEMP !== undefined) {
1113
+ globals.size = TEMP;
1059
1114
  }
1060
1115
  }
1061
1116
 
@@ -1254,7 +1309,11 @@ export class GlobalSettingsService {
1254
1309
  }
1255
1310
  TEMP = el.nativeElement.getAttribute('fontFamily');
1256
1311
  if (TEMP !== null) {
1257
- this.globals.fontFamily = TEMP;
1312
+ this.globals.fontFamily = TEMP + ',' + this.globals.fontFamily;
1313
+ }
1314
+ TEMP = el.nativeElement.getAttribute('fontFamilySource');
1315
+ if (TEMP !== null) {
1316
+ this.globals.fontFamilySource = TEMP;
1258
1317
  }
1259
1318
  TEMP = el.nativeElement.getAttribute('buttonFontSize');
1260
1319
  if (TEMP !== null) {
@@ -1469,6 +1528,11 @@ export class GlobalSettingsService {
1469
1528
  globals.hideHeaderCloseButton = stringToBoolean(TEMP);
1470
1529
  }
1471
1530
 
1531
+ TEMP = getParameterByName(windowContext, 'tiledesk_hideHeaderConversation');
1532
+ if (TEMP) {
1533
+ globals.hideHeaderConversation = stringToBoolean(TEMP);
1534
+ }
1535
+
1472
1536
  TEMP = getParameterByName(windowContext, 'tiledesk_themeColor');
1473
1537
  if (TEMP) {
1474
1538
  const themecolor = stringToBoolean(TEMP);
@@ -1789,6 +1853,11 @@ export class GlobalSettingsService {
1789
1853
  if (TEMP) {
1790
1854
  globals.showEmojiFooterButton = stringToBoolean(TEMP);
1791
1855
  }
1856
+
1857
+ TEMP = getParameterByName(windowContext, 'tiledesk_size');
1858
+ if (TEMP) {
1859
+ globals.size = TEMP;
1860
+ }
1792
1861
 
1793
1862
  }
1794
1863
 
@@ -1970,4 +2039,34 @@ export class GlobalSettingsService {
1970
2039
  }
1971
2040
  }
1972
2041
 
2042
+ manageLoadingDomains(): boolean {
2043
+ const { allowedOnSpecificUrl, allowedOnSpecificUrlList } = this.globals;
2044
+
2045
+ if(!allowedOnSpecificUrl){
2046
+ return true
2047
+ }
2048
+
2049
+ if (!Array.isArray(allowedOnSpecificUrlList) || allowedOnSpecificUrlList.length === 0) {
2050
+ console.log('allowedOnSpecificUrl is true and allowedOnSpecificUrlList is empty or not set');
2051
+ return true
2052
+ }
2053
+
2054
+ function wildcardToRegex(pattern: string): RegExp {
2055
+ // Escape caratteri speciali della regex, tranne * che poi sostituiremo
2056
+ const escaped = pattern.replace(/[-/\\^+?.()|[\]{}]/g, '\\$&');
2057
+ // Sostituisci * con .*
2058
+ const regexPattern = '^' + escaped.replace(/\*/g, '.*') + '$';
2059
+ return new RegExp(regexPattern);
2060
+ }
2061
+
2062
+ const currentUrl = this.globals.windowContext.location.href;
2063
+ const shouldShow = allowedOnSpecificUrlList.some(pattern => {
2064
+ const regex = wildcardToRegex(pattern);
2065
+ return regex.test(currentUrl);
2066
+ });
2067
+
2068
+ // let isAllowedToLoad = !isAllowedUrlInText(this.globals.windowContext.location.origin, this.globals.hideOnSpecificDomainList)
2069
+ return shouldShow
2070
+ }
2071
+
1973
2072
  }
@@ -20,13 +20,17 @@
20
20
 
21
21
  --border-radius-bubble-message: 20px;
22
22
  --button-in-msg-font-size: 15px;
23
+ --button-in-msg-font-family: 'Roboto','Google Sans', Helvetica, Arial, sans-serif;
23
24
  --button-in-msg-max-width: 280px;
25
+ --button-in-msg-padding: 8px 16px;
24
26
 
25
27
  --max-width-images: 230px; //change also MAX_WIDTH_IMAGES in constants.ts
26
28
 
27
29
  --bkg-color-info-message: rgba(24, 119, 242, 0.1);
28
30
 
29
- --chat-footer-height: 56px;
31
+ --chat-header-height: 52px;
32
+
33
+ --chat-footer-height: 64px;
30
34
  --chat-footer-logo-height: 30px;
31
35
  --chat-footer-border-radius: 16px;
32
36
  --chat-footer-background-color: #f6f7fb;
@@ -35,9 +39,18 @@
35
39
 
36
40
  --icon-fill-color: #5f6368;
37
41
 
38
-
39
42
  --content-background-color: #fff;
40
43
  --content-text-color: var(--black);
44
+
45
+ --font-family: 'Roboto','Google Sans', Helvetica, Arial, sans-serif; //Mulish, sans-serif;
46
+ --font-family-bubble-message: 'Roboto','Google Sans', Helvetica, Arial, sans-serif;
47
+ --font-family-callout: 'Helvetica Neue', 'Apple Color Emoji', Helvetica, Arial, sans-serif;
48
+ --font-family-powered-by: Mulish, sans-serif;
49
+
50
+ --font-size-bubble-message: 1.4em;
51
+
52
+ --avatar-height: 40px;
53
+ --avatar-width: 40px;
41
54
  }
42
55
 
43
56
  $trasp-black:rgba(0,0,0,0.8);
@@ -73,6 +73,7 @@ export const HEADER_MENU_OPTION = {
73
73
  DETAIL : 'detail',
74
74
  RESTART : 'restart',
75
75
  MAXIMIZE : 'maximize',
76
- MINIMIZE : 'minimize'
76
+ MINIMIZE : 'minimize',
77
+ TOP : 'top'
77
78
  }
78
79