@chat21/chat21-web-widget 5.1.0-rc19 → 5.1.0-rc21

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 (51) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/package.json +1 -1
  3. package/src/app/app.component.scss +1 -1
  4. package/src/app/app.component.ts +5 -0
  5. package/src/app/component/conversation-detail/conversation/conversation.component.scss +1 -3
  6. package/src/app/component/conversation-detail/conversation/conversation.component.ts +6 -0
  7. package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +0 -1
  8. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +0 -4
  9. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +0 -2
  10. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +1 -2
  11. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +0 -1
  12. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +2 -2
  13. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.scss +0 -3
  14. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +0 -2
  15. package/src/app/component/form/form-builder/form-builder.component.scss +0 -1
  16. package/src/app/component/form/inputs/form-text/form-text.component.scss +0 -1
  17. package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +0 -1
  18. package/src/app/component/form/prechat-form/prechat-form.component.scss +0 -2
  19. package/src/app/component/home/home.component.scss +1 -6
  20. package/src/app/component/home-conversations/home-conversations.component.scss +0 -3
  21. package/src/app/component/last-message/last-message.component.html +0 -2
  22. package/src/app/component/last-message/last-message.component.scss +0 -2
  23. package/src/app/component/list-all-conversations/list-all-conversations.component.scss +0 -3
  24. package/src/app/component/list-conversations/list-conversations.component.scss +0 -2
  25. package/src/app/component/menu-options/menu-options.component.scss +0 -2
  26. package/src/app/component/message/audio/audio.component.html +1 -1
  27. package/src/app/component/message/audio/audio.component.scss +1 -0
  28. package/src/app/component/message/audio/audio.component.ts +0 -1
  29. package/src/app/component/message/bubble-message/bubble-message.component.html +1 -4
  30. package/src/app/component/message/bubble-message/bubble-message.component.scss +0 -1
  31. package/src/app/component/message/bubble-message/bubble-message.component.ts +0 -2
  32. package/src/app/component/message/buttons/action-button/action-button.component.scss +2 -4
  33. package/src/app/component/message/buttons/link-button/link-button.component.scss +1 -3
  34. package/src/app/component/message/buttons/text-button/text-button.component.scss +1 -3
  35. package/src/app/component/message/carousel/carousel.component.scss +2 -4
  36. package/src/app/component/message/frame/frame.component.scss +0 -2
  37. package/src/app/component/message/html/html.component.scss +0 -2
  38. package/src/app/component/message/image/image.component.scss +0 -2
  39. package/src/app/component/message/info-message/info-message.component.scss +0 -2
  40. package/src/app/component/message/like-unlike/like-unlike.component.scss +0 -2
  41. package/src/app/component/message/text/text.component.html +1 -2
  42. package/src/app/component/message/text/text.component.scss +2 -4
  43. package/src/app/component/message/text/text.component.ts +0 -2
  44. package/src/app/component/selection-department/selection-department.component.scss +0 -4
  45. package/src/app/component/star-rating-widget/star-rating-widget.component.scss +0 -2
  46. package/src/app/providers/global-settings.service.ts +36 -2
  47. package/src/app/sass/_variables.scss +7 -1
  48. package/src/app/utils/globals.ts +3 -1
  49. package/src/assets/twp/index-dev.html +21 -13
  50. package/src/chat21-core/utils/user-typing/user-typing.component.scss +0 -1
  51. package/src/iframe-style.css +14 -31
package/CHANGELOG.md CHANGED
@@ -6,7 +6,15 @@
6
6
  ### **Copyrigth**:
7
7
  *Tiledesk SRL*
8
8
 
9
- # 5.1.0-rc18
9
+ # 5.1.0-rc21
10
+ - **bug-fixed**: shadow is visible while decrease widget size
11
+
12
+ # 5.1.0-rc20
13
+ - **added**: fontFamilySource settings variable
14
+ - **added**: --font-family-bubble-message as variable to manage custom font
15
+ - **removed**: fontSize and fontFamily as input property in bubble-message component
16
+
17
+ # 5.1.0-rc19
10
18
  - **added**: ability to maximize, minimize and fullscreen the widget window
11
19
  - **added**: variable for font-family attribute css value
12
20
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.1.0-rc19",
4
+ "version": "5.1.0-rc21",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -273,7 +273,7 @@ chat-root {
273
273
  position: absolute;
274
274
  width: 100%;
275
275
  height: 100%;
276
- font-family: 'Roboto','Google Sans', Helvetica, Arial, sans-serif;
276
+ font-family: var(--font-family-bubble-message);
277
277
  font-size: 10px;
278
278
  text-align: left;
279
279
  background-color: transparent;
@@ -2118,6 +2118,11 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
2118
2118
 
2119
2119
  this.el.nativeElement.style.setProperty('--button-in-msg-background-color', this.g.bubbleSentBackground)
2120
2120
  this.el.nativeElement.style.setProperty('--button-in-msg-font-size', this.g.buttonFontSize)
2121
+ this.el.nativeElement.style.setProperty('--font-size-bubble-message', this.g.fontSize)
2122
+ this.el.nativeElement.style.setProperty('--font-family-bubble-message', this.g.fontFamily)
2123
+ this.el.nativeElement.style.setProperty('--button-in-msg-font-family', this.g.fontFamily)
2124
+
2125
+
2121
2126
  }
2122
2127
 
2123
2128
 
@@ -1,8 +1,6 @@
1
1
  // $f21ico-schedule: image-url('f21ico-schedule.svg', false, false);
2
2
  // $f21ico-done: image-url('../assets/images/f21ico-done.svg', false, false);
3
3
  // $f21ico-done_all: image-url('../assets/images/f21ico-done_all.svg', false, false);
4
- // @import 'src/app/sass/variables';
5
- // @import '../../../sass/normalize.css';
6
4
 
7
5
  :host {
8
6
  --themeColor: var(--bck-msg-sent);
@@ -60,7 +58,7 @@
60
58
  font-weight: 500;
61
59
  line-height: 22px;
62
60
 
63
- font-family: var(--font-family);
61
+ font-family: var(--font-family-powered-by);
64
62
  letter-spacing: -0.24px;
65
63
  -webkit-font-smoothing: antialiased;
66
64
 
@@ -1018,6 +1018,12 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
1018
1018
  /** CALLED BY: conv-header component */
1019
1019
  onCloseWidgetFN() {
1020
1020
  //this.g.setParameter('activeConversation', null, false);
1021
+ /** remove Min/Max/fullscreen css classes */
1022
+ var tiledeskDiv = this.g.windowContext.window.document.getElementById('tiledeskdiv')
1023
+ tiledeskDiv.classList.remove('increaseSize')
1024
+ tiledeskDiv.classList.remove('decreaseSize')
1025
+ tiledeskDiv.classList.remove('fullscreen')
1026
+
1021
1027
  this.onCloseWidget.emit();
1022
1028
  }
1023
1029
  /** CALLED BY: conv-header component */
@@ -9,7 +9,6 @@
9
9
  <chat-audio class="test" *ngIf="audioBlob && audioUrl"
10
10
  [audioBlob] = "audioBlob"
11
11
  [color]="'var(--chat-footer-color)'"
12
- [fontSize]="stylesMap.get('fontSize')"
13
12
  [stylesMap]="stylesMap">
14
13
  </chat-audio>
15
14
 
@@ -34,8 +34,6 @@
34
34
  [ngClass]="{'button-in-msg' : message?.metadata && message?.metadata?.button}"
35
35
  [message]="message"
36
36
  [fontColor]="stylesMap.get('bubbleSentTextColor')"
37
- [fontSize]="stylesMap.get('fontSize')"
38
- [fontFamily]="stylesMap.get('fontFamily')"
39
37
  [stylesMap]="stylesMap"
40
38
  (onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
41
39
  (onAfterMessageRender)="onAfterMessageRenderFN($event)"
@@ -70,8 +68,6 @@
70
68
  [isSameSender]="isSameSender(message?.sender, i)"
71
69
  [message]="message"
72
70
  [fontColor]="stylesMap.get('bubbleReceivedTextColor')"
73
- [fontSize]="stylesMap.get('fontSize')"
74
- [fontFamily]="stylesMap.get('fontFamily')"
75
71
  [stylesMap]="stylesMap"
76
72
  (onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
77
73
  (onAfterMessageRender)="onAfterMessageRenderFN($event)"
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
 
4
2
  #scroll-me {
5
3
  scroll-behavior: smooth;
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
 
3
2
  .textarea-container{
4
3
  // padding: 8px 34px;
@@ -323,7 +322,7 @@ textarea:active{
323
322
  font-weight: 500;
324
323
  line-height: 22px;
325
324
 
326
- font-family: var(--font-family);
325
+ font-family: var(--font-family-powered-by);
327
326
  letter-spacing: 0.24px;
328
327
  -webkit-font-smoothing: antialiased;
329
328
  padding: 4px 12px;
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
 
3
2
  /* SET SCROLLBAR */
4
3
  // ============= CSS c21-header ================= //
@@ -58,8 +58,8 @@ export class ConversationHeaderComponent implements OnInit, OnChanges {
58
58
  private API_URL: string;
59
59
  private logger: LoggerService = LoggerInstance.getInstance()
60
60
  constructor(
61
- public g: Globals,
62
- public appConfigService: AppConfigService,) {
61
+ public appConfigService: AppConfigService
62
+ ) {
63
63
  this.API_URL = this.appConfigService.getConfig().apiUrl;
64
64
  }
65
65
 
@@ -1,6 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
-
4
1
  :host .c21-content ::ng-deep > chat-image {
5
2
 
6
3
  div {
@@ -3,8 +3,6 @@
3
3
  * EYE-CATCHER CARD & EYE-CATCHER CARD CLOSE BTN
4
4
  * *********************************************
5
5
  */
6
- // @import 'src/app/sass/variables';
7
-
8
6
 
9
7
 
10
8
 
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
 
3
2
  .c21-label-button {
4
3
  font-size: 1.2em !important;
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
 
3
2
  :host {
4
3
  --foregroundColor: #0000;
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
 
3
2
  :host {
4
3
  --foregroundColor: #0000;
@@ -1,5 +1,3 @@
1
- // @import '../../../sass/variables';
2
- // @import '../../../sass/normalize.css';
3
1
 
4
2
  #chat21-prechat-form {
5
3
  background-color: #ffffff;
@@ -1,8 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
- // @import '../../../sass/normalize.css';
3
-
4
-
5
-
6
1
  #chat21-home-component {
7
2
  position: absolute;
8
3
  width: 100%;
@@ -306,7 +301,7 @@
306
301
  font-weight: 500;
307
302
  line-height: 22px;
308
303
 
309
- font-family: var(--font-family);
304
+ font-family: var(--font-family-powered-by);
310
305
  letter-spacing: 0.24px;
311
306
  -webkit-font-smoothing: antialiased;
312
307
 
@@ -1,6 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
- // @import '../../../sass/normalize.css';
3
-
4
1
  #c21-app-list-conversations{
5
2
  position: relative;
6
3
  display: block;
@@ -36,8 +36,6 @@
36
36
  [message]="message"
37
37
  [isSameSender]="isSameSender(message?.sender, i)"
38
38
  [fontColor]="stylesMap.get('bubbleReceivedTextColor')"
39
- [fontSize]="stylesMap.get('fontSize')"
40
- [fontFamily]="stylesMap.get('fontFamily')"
41
39
  [stylesMap]="stylesMap"
42
40
  (onElementRendered)="onElementRenderedFN($event)">
43
41
  </chat-bubble-message>
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :host .c21-avatar-image ::ng-deep > chat-avatar-image {
4
2
 
5
3
  .c21-icon-avatar {
@@ -1,6 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
- // @import '../../../sass/normalize.css';
3
-
4
1
  #c21-app-list-all-conversations {
5
2
  position: relative;
6
3
  display: block;
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  :host .c21-msg ::ng-deep > a > img {
4
2
  max-width: 24% !important;
5
3
  vertical-align: middle;
@@ -1,5 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
-
3
1
  #c21-menu-options{
4
2
 
5
3
  .modal-menu-options {
@@ -17,7 +17,7 @@
17
17
  </svg>
18
18
  <!-- <i class="material-icons">pause</i> -->
19
19
  </button>
20
- <div class="duration" [style.color]="color" [style.font-size]="fontSize" >
20
+ <div class="duration" [style.color]="color">
21
21
  <span *ngIf="!isPlaying">{{ audioDuration ? formatTime(audioDuration) : '00:00' }}</span>
22
22
  <span *ngIf="isPlaying">{{ formatTime(currentTime) }}</span>
23
23
  </div>
@@ -80,6 +80,7 @@ button {
80
80
  }
81
81
  .duration {
82
82
  padding: 0 3px;
83
+ font-size: var(--font-size-bubble-message);
83
84
  }
84
85
  }
85
86
 
@@ -17,7 +17,6 @@ export class AudioComponent implements AfterViewInit {
17
17
  @Input() audioBlob: Blob | null = null;
18
18
  @Input() metadata: any | null = null;
19
19
  @Input() color: string;
20
- @Input() fontSize: string;
21
20
  @Input() stylesMap: Map<string, string>;
22
21
 
23
22
  audioUrl: SafeUrl | null = null;
@@ -25,7 +25,7 @@
25
25
 
26
26
  <div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
27
27
  [style.color]="fullnameColor"
28
- [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '10px 16px 8px 16px': '10px 8px 0px 8px'}" class="message_sender_fullname">
28
+ [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '12px 16px 8px 16px': '12px 16px 0px 16px'}" class="message_sender_fullname">
29
29
  {{message?.sender_fullname}}
30
30
  </div>
31
31
  <!-- message type:: image -->
@@ -61,7 +61,6 @@
61
61
  <chat-audio *ngIf="isAudio(message)"
62
62
  [metadata]="message.metadata"
63
63
  [color]="fontColor"
64
- [fontSize]="fontSize"
65
64
  [stylesMap]="stylesMap">
66
65
  </chat-audio>
67
66
 
@@ -82,8 +81,6 @@
82
81
  <chat-text *ngIf="message?.type !=='html'"
83
82
  [text]="message?.text"
84
83
  [color]="fontColor"
85
- [fontSize]="fontSize"
86
- [fontFamily]="fontFamily"
87
84
  (onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
88
85
  (onAfterMessageRender)="onAfterMessageRenderFN($event)">
89
86
  </chat-text>
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
  /* ====== SET MESSAGES ====== */
3
2
 
4
3
  .messages {
@@ -18,8 +18,6 @@ export class BubbleMessageComponent implements OnInit {
18
18
  @Input() message: MessageModel;
19
19
  @Input() isSameSender: boolean;
20
20
  @Input() fontColor: string;
21
- @Input() fontSize: string;
22
- @Input() fontFamily: string;
23
21
  @Input() stylesMap: Map<string, string>;
24
22
  @Output() onBeforeMessageRender = new EventEmitter();
25
23
  @Output() onAfterMessageRender = new EventEmitter();
@@ -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,7 +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)};
10
- --font-family: #{var(--font-family)};
8
+ --fontFamily: #{var(--button-in-msg-font-family)};
11
9
  }
12
10
 
13
11
  .button-in-msg {
@@ -21,7 +19,7 @@
21
19
  margin: 3px;
22
20
  background: var(--backgroundColor);
23
21
  overflow: hidden;
24
- font-family: var(--font-family);
22
+ font-family: var(--fontFamily);
25
23
  font-size: var(--buttonFontSize);
26
24
  -o-text-overflow: ellipsis;
27
25
  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,7 +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)};
10
- --font-family: #{var(--font-family)};
8
+ --font-family: #{var(--button-in-msg-font-family)};
11
9
  }
12
10
 
13
11
  .button-in-msg {
@@ -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,7 +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)};
10
- --font-family: #{var(--font-family)};
8
+ --font-family: #{var(--button-in-msg-font-family)};
11
9
  }
12
10
 
13
11
 
@@ -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,7 +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)};
10
- --font-family: #{var(--font-family)};
8
+ --fontFamily: #{var(--font-family)};
11
9
 
12
10
  --cardWidth: 220px;
13
11
  }
@@ -204,7 +202,7 @@
204
202
  transition: all .3s;
205
203
 
206
204
  background: var(--backgroundColor);
207
- font-family: var(--font-family);
205
+ font-family: var(--fontFamily);
208
206
  font-size: var(--buttonFontSize);
209
207
  -o-text-overflow: ellipsis;
210
208
  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
  :root {
4
2
  --themeColor: #{var(--blue)};
5
3
  --foregroundColor: #{var(--col-msg-sent)};
@@ -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,3 @@
1
1
  <p #messageEl class="message_innerhtml marked"
2
2
  [innerHTML]="printMessage(text, messageEl, this) | htmlEntitiesEncode | marked"
3
- [style.color]="color"
4
- [style.font-size]="fontSize"></p>
3
+ [style.color]="color"></p>
@@ -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
 
@@ -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)};
@@ -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%;
@@ -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);
@@ -376,6 +378,29 @@ export class GlobalSettingsService {
376
378
  divTiledeskiframe.classList.add('fullscreen')
377
379
  }
378
380
  }
381
+
382
+ setStyle(){
383
+
384
+ /** load custom FONT */
385
+ if(this.globals.fontFamily && this.globals.fontFamilySource){
386
+ this.loadFont(this.globals.fontFamily, this.globals.fontFamilySource)
387
+ }
388
+ }
389
+ loadFont(family: string, href: string,) {
390
+ const mainFont = family.split(",")[0].replace(/['"]/g, "").trim(); // es. "Montserrat"
391
+
392
+ if (document.querySelector(`link[data-font='${mainFont}']`)) {
393
+ return;
394
+ }
395
+
396
+ const link = document.createElement('link');
397
+ link.rel = 'stylesheet';
398
+ link.href = href;
399
+ link.setAttribute('data-font', mainFont); // marker pulito
400
+ document.head.appendChild(link);
401
+
402
+ document.documentElement.style.setProperty('--font-family', family);
403
+ }
379
404
  /**
380
405
  * A: setVariablesFromService
381
406
  */
@@ -930,7 +955,12 @@ export class GlobalSettingsService {
930
955
  TEMP = tiledeskSettings['fontFamily'];
931
956
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fontFamily:: ', TEMP]);
932
957
  if (TEMP !== undefined) {
933
- globals.fontFamily = TEMP;
958
+ globals.fontFamily = TEMP + ',' + globals.fontFamily;
959
+ }
960
+ TEMP = tiledeskSettings['fontFamilySource'];
961
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fontFamily:: ', TEMP]);
962
+ if (TEMP !== undefined) {
963
+ globals.fontFamilySource = TEMP;
934
964
  }
935
965
  TEMP = tiledeskSettings['buttonFontSize'];
936
966
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > buttonFontSize:: ', TEMP]);
@@ -1261,7 +1291,11 @@ export class GlobalSettingsService {
1261
1291
  }
1262
1292
  TEMP = el.nativeElement.getAttribute('fontFamily');
1263
1293
  if (TEMP !== null) {
1264
- this.globals.fontFamily = TEMP;
1294
+ this.globals.fontFamily = TEMP + ',' + this.globals.fontFamily;
1295
+ }
1296
+ TEMP = el.nativeElement.getAttribute('fontFamilySource');
1297
+ if (TEMP !== null) {
1298
+ this.globals.fontFamilySource = TEMP;
1265
1299
  }
1266
1300
  TEMP = el.nativeElement.getAttribute('buttonFontSize');
1267
1301
  if (TEMP !== null) {
@@ -20,6 +20,7 @@
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;
24
25
 
25
26
  --max-width-images: 230px; //change also MAX_WIDTH_IMAGES in constants.ts
@@ -41,8 +42,13 @@
41
42
 
42
43
 
43
44
 
44
- --font-family: Mulish, sans-serif;
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;
45
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
+
46
52
  }
47
53
 
48
54
  $trasp-black:rgba(0,0,0,0.8);
@@ -221,6 +221,8 @@ export class Globals {
221
221
 
222
222
  allowedOnSpecificUrl: boolean // ******* new ********
223
223
  allowedOnSpecificUrlList: Array<string> // ******* new ********
224
+
225
+ fontFamilySource: string; // ******* new ********
224
226
  constructor(
225
227
  ) { }
226
228
 
@@ -357,7 +359,7 @@ export class Globals {
357
359
  /** set the text color of bubble received message */
358
360
  this.fontSize = '1.4em'
359
361
  /** set the text size of bubble messages */
360
- this.fontFamily = "'Roboto','Google Sans', Helvetica, Arial, sans-serif'"
362
+ this.fontFamily = "'Roboto','Google Sans', Helvetica, Arial, sans-serif"
361
363
  /** set the text family of bubble messages */
362
364
  this.buttonFontSize = '15px'
363
365
  /** set the text size of attachment-buttons */
@@ -1361,9 +1361,6 @@
1361
1361
  window.Tiledesk('restart')
1362
1362
  }
1363
1363
 
1364
-
1365
-
1366
-
1367
1364
  function onClickFontSize(){
1368
1365
  let text = document.getElementById('fontSize').value
1369
1366
  text === ""? text= '1.4em': text
@@ -1372,6 +1369,17 @@
1372
1369
  window.Tiledesk('restart')
1373
1370
  }
1374
1371
 
1372
+ function onClickFontFamily(){
1373
+ let text = document.getElementById('fontFamily').value
1374
+ window.tiledeskSettings['fontFamily'] = text
1375
+
1376
+ let source = document.getElementById('fontFamilySource').value
1377
+ // text === ""? text= '1.4em': text
1378
+ window.tiledeskSettings['fontFamilySource'] = source
1379
+
1380
+ console.log('onClickFontFamily:',window.tiledeskSettings);
1381
+ window.Tiledesk('restart')
1382
+ }
1375
1383
 
1376
1384
  function onClickButtonFontSize(){
1377
1385
  let text = document.getElementById('buttonFontSize').value
@@ -1383,16 +1391,6 @@
1383
1391
 
1384
1392
 
1385
1393
 
1386
-
1387
-
1388
-
1389
-
1390
-
1391
-
1392
-
1393
-
1394
-
1395
-
1396
1394
 
1397
1395
  function onClickTestAll(){
1398
1396
  inputs = document.getElementsByTagName('input');
@@ -2455,6 +2453,16 @@
2455
2453
  <button class="btn btn-light" onclick="onClickFontSize()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
2456
2454
  </div>
2457
2455
  </div>
2456
+ <div class="row">
2457
+ <div class="col-md-5 formElement"><span><em><strong>fontFamily</strong></em></span></div>
2458
+ <div class="col-md-5 formElement">
2459
+ <input class="form-control col-sm-2" type="text" id="fontFamily" name="fontFamily" placeholder="Family">
2460
+ <input class="form-control col-sm-2" type="text" id="fontFamilySource" name="fontFamilySource" placeholder="Source">
2461
+ </div>
2462
+ <div class="col-md-2">
2463
+ <button class="btn btn-light" onclick="onClickFontFamily()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
2464
+ </div>
2465
+ </div>
2458
2466
 
2459
2467
 
2460
2468
  <div><h3 style="line-height: 0.3;">MANAGE <em><strong>BUTTON STYLES</strong></em></h3></div>
@@ -1,4 +1,3 @@
1
- // @import 'src/app/sass/variables';
2
1
  :root {
3
2
  --bubbleReceivedBackgroundColor: var(--blue);
4
3
  --foregroundColor: var(--bck-msg-sent);
@@ -34,27 +34,10 @@
34
34
 
35
35
  }
36
36
 
37
- #tiledeskdiv.decreaseSize {
38
- /* transition: width 1s, height 1s; */
39
- transition: all 1s ease-out;
40
- width: var(--iframeMinWidth);
41
- height: var(--iframeMinHeight);
42
- /* animation: right-animate 1s ease infinite alternate; */
43
-
44
- }
45
-
46
- #tiledeskdiv.increaseSize {
47
- /* transition: width 1s, height 1s; */
48
- transition: all 3s ease-in;
49
- width: var(--iframeMaxWidth);
50
- height: var(--iframeMaxHeight);
51
- /* animation: right-animate 1s ease infinite alternate; */
52
-
53
- }
54
37
 
55
38
  #tiledeskdiv.fullscreen {
56
39
  /* transition: width 1s, height 1s; */
57
- transition: all 3s ease-in;
40
+ /* transition: all 0.5s ease-in !important; */
58
41
  right: 0px;
59
42
  left: 0px;
60
43
  top: 0px;
@@ -110,30 +93,30 @@
110
93
  #tiledesk-container.open #tiledeskiframe {
111
94
  display: block;
112
95
  /*width: 376px;*/
113
- /* -webkit-animation: fade-in-shadow 0.4s ease-in 0.0s both;
114
- animation: fade-in-shadow 0.4s ease-in 0.0s both; */
115
- /* border-radius: 16px; */
116
- /* box-shadow: rgba(0, 18, 46, 0.16) 0px 8px 36px 0px; */
117
- /* margin: 10px; */
118
96
  }
119
97
  #tiledesk-container.open #tiledeskdiv.shadow {
120
98
  transition: box-shadow 0.8s ease-in;
121
99
  box-shadow: rgba(0, 0, 0, 0.16) 0px 8px 36px 0px; /*NEW GAB*/
122
100
  }
123
- /* @-webkit-keyframes fade-in-shadow {
124
- 0% { box-shadow: rgba(0, 0, 0, 0.0) 0 0 0px; }
125
- 100% { box-shadow: rgba(0, 0, 0, 0.1) 0 0 6px; }
126
- }
127
- @keyframes sk-bouncedelay {
128
- 0% { box-shadow: rgba(0, 0, 0, 0.0) 0 0 0px; }
129
- 100% { box-shadow: rgba(0, 0, 0, 0.1) 0 0 6px; }
130
- } */
101
+
131
102
 
132
103
  #tiledesk-container.closed #tiledeskiframe {
133
104
  display: block;
134
105
  box-shadow: none;
135
106
  }
136
107
 
108
+ #tiledesk-container.open #tiledeskdiv.decreaseSize {
109
+ transition: all 0.5s ease-in;
110
+ width: var(--iframeMinWidth);
111
+ height: var(--iframeMinHeight);
112
+ }
113
+
114
+ #tiledesk-container.open #tiledeskdiv.increaseSize {
115
+ /* transition: width 1s, height 1s; */
116
+ transition: all 0.5s ease-in;
117
+ width: var(--iframeMaxWidth);
118
+ height: var(--iframeMaxHeight);
119
+ }
137
120
 
138
121
  #tiledeskiframe .full-screen-mode {
139
122
  width: 100%;