@chat21/chat21-web-widget 5.1.0-rc22 → 5.1.0-rc24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@
6
6
  ### **Copyrigth**:
7
7
  *Tiledesk SRL*
8
8
 
9
+ # 5.1.0-rc24
10
+ - **added**: size tiledeskSettings property
11
+
12
+ # 5.1.0-rc23
13
+ - **added**: hideHeaderConversation tiledeskSettings property
14
+
9
15
  # 5.1.0-rc22
10
16
  - **changed**: footer UI if fullscreenMode is enabled
11
17
  - **changed**: buttons alignment if fullscreenMode is enabled
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-rc22",
4
+ "version": "5.1.0-rc24",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -515,16 +515,6 @@ chat-root {
515
515
  border-radius: 16px;
516
516
  }
517
517
 
518
- .chat21-fullscreen {
519
- width: 100%;
520
- height: 100%;
521
- right: 0px;
522
- left: 0px;
523
- bottom: 0px;
524
- border-radius: 0px;
525
- max-height: none;
526
- }
527
-
528
518
 
529
519
  /***************************
530
520
  ******** PAGE MODAL ********
@@ -596,7 +586,7 @@ chat-root {
596
586
  .c21-header {
597
587
  overflow: hidden;
598
588
  width: 100%;
599
- height: 52px;
589
+ height: var(--chat-header-height);
600
590
  position: relative;
601
591
  margin: 0;
602
592
  padding: 0;
@@ -617,7 +607,7 @@ chat-root {
617
607
 
618
608
  .c21-header-container{
619
609
  position: relative;
620
- height: 52px;
610
+ height: 100%;
621
611
  width: 100%;
622
612
  margin: 0 auto;
623
613
 
@@ -688,7 +678,7 @@ chat-root {
688
678
  }
689
679
  .c21-body {
690
680
  position: absolute;
691
- top: 52px;
681
+ top: var(--chat-header-height);
692
682
  bottom: 0;
693
683
  left: 0;
694
684
  right: 0;
@@ -2122,7 +2122,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
2122
2122
  this.el.nativeElement.style.setProperty('--font-family-bubble-message', this.g.fontFamily)
2123
2123
  this.el.nativeElement.style.setProperty('--button-in-msg-font-family', this.g.fontFamily)
2124
2124
 
2125
-
2125
+ this.el.nativeElement.style.setProperty('--chat-header-height', this.g.hideHeaderConversation? '0px': null)
2126
2126
  }
2127
2127
 
2128
2128
 
@@ -8,6 +8,7 @@
8
8
 
9
9
  <!-- HEADER -->
10
10
  <chat-conversation-header
11
+ *ngIf="!g?.hideHeaderConversation"
11
12
  [idConversation]= "conversationWith"
12
13
  [senderId]="senderId"
13
14
  [soundEnabled]="g?.soundEnabled"
@@ -19,6 +20,7 @@
19
20
  [hideSignOutOptionMenu]="(!g?.singleConversation || !g?.showLogoutOption)"
20
21
  [hideChatDetailOptionMenu]="(!g?.isDevMode)"
21
22
  [fullscreenMode]="g?.fullscreenMode"
23
+ [size]="g?.size"
22
24
  [stylesMap]="stylesMap"
23
25
  [translationMap]="translationMapHeader"
24
26
  [widgetTitle]="g?.project?.widgetTitle"
@@ -13,34 +13,36 @@
13
13
  bottom: var(--chat-footer-height) !important
14
14
  }
15
15
 
16
- :host-context(#chat21-conversations.full-screen-mode){
17
- --button-in-msg-padding: 10px 16px;
18
- #chat21-footer{
19
- left: 20%;
20
- right: 20%;
21
- }
22
-
23
- chat-conversation-content ::ng-deep{
24
- .attachment_container,
25
- .buttons-wrapper {
26
- justify-content: flex-start;
27
- }
28
-
29
- .button-in-message{
30
- padding: 14px 22px !important
16
+ @media(min-width:688px){
17
+ :host-context(#chat21-conversations.full-screen-mode){
18
+ --button-in-msg-padding: 10px 16px;
19
+ #chat21-footer{
20
+ left: 20%;
21
+ right: 20%;
31
22
  }
32
-
33
- }
34
-
35
- chat-conversation-footer ::ng-deep {
36
- .textarea-container {
37
- padding: 8px 24px;
38
- background-color: var(--chat-footer-background-color);
39
- border-radius: 28px;
23
+
24
+ chat-conversation-content ::ng-deep{
25
+ .attachment_container,
26
+ .buttons-wrapper {
27
+ justify-content: flex-start;
28
+ }
29
+
30
+ .button-in-message{
31
+ padding: 14px 22px !important
32
+ }
33
+
40
34
  }
41
- #hiddenFooter,
42
- #emoji-mart-container {
43
- bottom: calc(100% + 10px)
35
+
36
+ chat-conversation-footer ::ng-deep {
37
+ .textarea-container {
38
+ padding: 8px 24px;
39
+ background-color: var(--chat-footer-background-color);
40
+ border-radius: 28px;
41
+ }
42
+ #hiddenFooter,
43
+ #emoji-mart-container {
44
+ bottom: calc(100% + 10px)
45
+ }
44
46
  }
45
47
  }
46
48
  }
@@ -221,7 +221,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
221
221
  'CLOSE',
222
222
  'MAXIMIZE',
223
223
  'MINIMIZE',
224
- 'FULLSCREEN',
224
+ 'CENTER',
225
225
  'CLOSE_CHAT',
226
226
  'RESTART',
227
227
  'LOGOUT',
@@ -1020,9 +1020,9 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
1020
1020
  //this.g.setParameter('activeConversation', null, false);
1021
1021
  /** remove Min/Max/fullscreen css classes */
1022
1022
  var tiledeskDiv = this.g.windowContext.window.document.getElementById('tiledeskdiv')
1023
- tiledeskDiv.classList.remove('increaseSize')
1024
- tiledeskDiv.classList.remove('decreaseSize')
1025
- tiledeskDiv.classList.remove('top')
1023
+ tiledeskDiv.classList.remove('max-size')
1024
+ tiledeskDiv.classList.remove('min-size')
1025
+ tiledeskDiv.classList.remove('top-size')
1026
1026
 
1027
1027
  this.onCloseWidget.emit();
1028
1028
  }
@@ -1073,20 +1073,21 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
1073
1073
  // this.hideTextAreaContent = true
1074
1074
  }
1075
1075
  /** CALLED BY: conv-header component */
1076
- onWidgetSizeChange(mode){
1076
+ onWidgetSizeChange(mode: 'min' | 'max' | 'top'){
1077
1077
  var tiledeskDiv = this.g.windowContext.window.document.getElementById('tiledeskdiv')
1078
+ this.g.size = mode
1078
1079
  if(mode==='max'){
1079
- tiledeskDiv.classList.add('increaseSize')
1080
- tiledeskDiv.classList.remove('decreaseSize')
1081
- tiledeskDiv.classList.remove('top')
1080
+ tiledeskDiv.classList.add('max-size')
1081
+ tiledeskDiv.classList.remove('min-size')
1082
+ tiledeskDiv.classList.remove('top-size')
1082
1083
  }else if(mode==='min'){
1083
- tiledeskDiv.classList.add('decreaseSize')
1084
- tiledeskDiv.classList.remove('increaseSize')
1085
- tiledeskDiv.classList.remove('top')
1084
+ tiledeskDiv.classList.add('min-size')
1085
+ tiledeskDiv.classList.remove('max-size')
1086
+ tiledeskDiv.classList.remove('top-size')
1086
1087
  }else if(mode=== 'top'){
1087
- tiledeskDiv.classList.add('top')
1088
- tiledeskDiv.classList.remove('increaseSize')
1089
- tiledeskDiv.classList.remove('decreaseSize')
1088
+ tiledeskDiv.classList.add('top-size')
1089
+ tiledeskDiv.classList.remove('max-size')
1090
+ tiledeskDiv.classList.remove('min-size')
1090
1091
 
1091
1092
  }
1092
1093
  this.isMenuShow = false;
@@ -1307,7 +1308,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
1307
1308
  private onIncreaseWith(){
1308
1309
  try{
1309
1310
  const tiledeskDiv = this.g.windowContext.window.document.getElementById('tiledeskdiv')
1310
- tiledeskDiv.classList.add('increaseSize')
1311
+ tiledeskDiv.classList.add('max-size')
1311
1312
  const chat21conversations = document.getElementById('chat21-conversations')
1312
1313
  chat21conversations.style.borderRadius = '16px'
1313
1314
  // tiledeskDiv.style.width = '696px'
@@ -1320,8 +1321,8 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
1320
1321
  private restoreDefaultWidgetSize(){
1321
1322
  try{
1322
1323
  const tiledeskDiv = this.g.windowContext.window.document.getElementById('tiledeskdiv')
1323
- tiledeskDiv.classList.remove('increaseSize')
1324
- tiledeskDiv.classList.remove('decreaseSize')
1324
+ tiledeskDiv.classList.remove('max-size')
1325
+ tiledeskDiv.classList.remove('min-size')
1325
1326
  // tiledeskDiv.style.width = '376px'
1326
1327
  // tiledeskDiv.style.maxHeight = '620px'
1327
1328
  }catch(e){
@@ -123,7 +123,7 @@
123
123
  </div> -->
124
124
 
125
125
  <!-- ICON MAXIMIZE -->
126
- <div class="c21-header-button c21-right" *ngIf="heightStatus==='min' && !fullscreenMode" (click)="onChangeSize('max')">
126
+ <div class="c21-header-button c21-right" *ngIf="size === 'min' && !fullscreenMode" (click)="onChangeSize('max')">
127
127
  <svg role="img" aria-labelledby="altIconTitle" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
128
128
  width="17" height="17" viewBox="0 0 17 17">
129
129
  <path d="M6.49001 8.30999L3.69 11.11V9.40999C3.69 8.93999 3.31 8.55999 2.84 8.55999C2.37 8.55999 1.99001 8.93999 1.99001 9.40999V14.01H6.59C7.06 14.01 7.44 13.63 7.44 13.16C7.44 12.69 7.06 12.31 6.59 12.31H4.89L7.69 9.50999L6.49001 8.30999ZM9.41 1.98999C8.94 1.98999 8.56001 2.36999 8.56001 2.83999C8.56001 3.30999 8.94 3.68999 9.41 3.68999H11.11L8.31001 6.48999L9.51 7.68999L12.31 4.88999V6.58999C12.31 7.05999 12.69 7.43999 13.16 7.43999C13.63 7.43999 14.01 7.05999 14.01 6.58999V1.98999H9.41Z" fill="currentColor"></path>
@@ -132,7 +132,7 @@
132
132
  <span class="label-menu-item">{{ translationMap?.get('MAXIMIZE') }}</span>
133
133
  </div>
134
134
  <!-- ICON MINIMIZE -->
135
- <div class="c21-header-button c21-right" *ngIf="heightStatus==='max' || heightStatus==='top' || fullscreenMode" (click)="onChangeSize('min')">
135
+ <div class="c21-header-button c21-right" *ngIf="(size==='max' || size==='top') && !fullscreenMode" (click)="onChangeSize('min')">
136
136
  <svg role="img" aria-labelledby="altIconTitle" class="icon-menu" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
137
137
  width="17" height="17" viewBox="0 0 17 17">
138
138
  <path d="M13.59 5.31h-1.7l3.3-3.3-1.2-1.2-3.3 3.3v-1.7a.85.85 0 1 0-1.7 0v4.6h4.6a.85.85 0 1 0 0-1.7M1.57 9.84c0 .47.38.85.85.85h1.7l-3.3 3.3 1.2 1.2 3.3-3.3v1.7a.85.85 0 1 0 1.7 0v-4.6h-4.6a.85.85 0 0 0-.85.85" fill="currentColor"></path>
@@ -140,17 +140,17 @@
140
140
  </svg>
141
141
  <span class="label-menu-item">{{ translationMap?.get('MINIMIZE') }}</span>
142
142
  </div>
143
-
144
143
  <!-- ICON TOP -->
145
- <!-- <div class="c21-header-button c21-right" *ngIf="heightStatus!=='top' && !fullscreenMode" (click)="onChangeSize('top')">
144
+ <div class="c21-header-button c21-right" *ngIf="size!=='top' && !fullscreenMode" (click)="onChangeSize('top')">
146
145
  <svg role="img" aria-labelledby="altIconTitle" fill="none" xmlns="http://www.w3.org/2000/svg" transform="matrix(-1,0,0,1,0,0)"
147
146
  width="17" height="17" viewBox="0 0 17 17">
148
- <path fill="currentColor" d="M6.5,8.3l-2.8,2.8v-1.7c0-.5-.4-.9-.9-.9s-.8.4-.8.9v4.6h4.6c.5,0,.8-.4.8-.9s-.4-.8-.8-.8h-1.7l2.8-2.8-1.2-1.2ZM9.4,2c-.5,0-.8.4-.8.8s.4.9.8.9h1.7l-2.8,2.8,1.2,1.2,2.8-2.8v1.7c0,.5.4.8.8.8s.9-.4.9-.8V2h-4.6Z"/>
149
- <path fill="currentColor" d="M8.3,9.5l2.8,2.8h-1.7c-.5,0-.9.4-.9.9s.4.8.9.8h4.6v-4.6c0-.5-.4-.8-.9-.8s-.8.4-.8.8v1.7l-2.8-2.8-1.2,1.2ZM2,6.5c0,.5.4.8.8.8s.9-.4.9-.8v-1.7l2.8,2.8,1.2-1.2-2.8-2.8h1.7c.5,0,.8-.4.8-.8s-.4-.9-.8-.9H2v4.6Z"/>
150
- <title id="altIconTitle">{{ translationMap?.get('FULLSCREEN') }}</title>
147
+ <path fill="currentColor" d="M3.7,7.6L2.5,6.4C2.2,6,2.2,5.5,2.5,5.2s0.9-0.4,1.2-0.1L7,8.4l-3.3,3.3c-0.4,0.4-0.8,0.3-1.1,0s-0.4-0.9-0.1-1.2l1.2-1.2 H1.5l0-1.7H3.7z"/>
148
+ <path fill="currentColor" d="M13.3,7.6l1.2-1.2c0.4-0.4,0.3-0.8,0-1.1s-0.9-0.4-1.2-0.1L10,8.4l3.3,3.3c0.4,0.4,0.8,0.3,1.1,0s0.4-0.9,0.1-1.2l-1.2-1.2 h2.2l0-1.7H13.3z"/>
149
+ <path fill="currentColor" d="M8.5,14.5L8.5,14.5c-0.5,0-0.9-0.4-0.9-0.8V3.3c0-0.5,0.4-0.8,0.8-0.8h0c0.5,0,0.8,0.4,0.8,0.8v10.4 C9.4,14.2,9,14.5,8.5,14.5z"/>
150
+ <title id="altIconTitle">{{ translationMap?.get('CENTER') }}</title>
151
151
  </svg>
152
- <span class="label-menu-item">{{ translationMap?.get('FULLSCREEN') }}</span>
153
- </div> -->
152
+ <span class="label-menu-item">{{ translationMap?.get('CENTER') }}</span>
153
+ </div>
154
154
 
155
155
  <!-- ICON LOGOUT -->
156
156
  <div class="c21-header-button c21-right" *ngIf="!hideSignOutOptionMenu" (click)="signOut()">
@@ -23,6 +23,7 @@ export class ConversationHeaderComponent implements OnInit, OnChanges {
23
23
  @Input() typingLocation: string;
24
24
  @Input() isTrascriptDownloadEnabled: boolean;
25
25
  @Input() fullscreenMode: boolean;
26
+ @Input() size: 'min' | 'max' | 'top';
26
27
  @Input() hideCloseConversationOptionMenu: boolean;
27
28
  @Input() hideHeaderCloseButton: boolean;
28
29
  @Input() hideHeaderBackButton: boolean;
@@ -104,10 +105,9 @@ export class ConversationHeaderComponent implements OnInit, OnChanges {
104
105
  this.onMenuOptionClick.emit(HEADER_MENU_OPTION.LOGOUT)
105
106
  }
106
107
  /**
107
- * @param status : string 'max' || 'min'
108
+ * @param status : string 'max' || 'min' || 'top'
108
109
  */
109
110
  onChangeSize(status){
110
- this.heightStatus = status
111
111
  if(status === 'min') this.onMenuOptionClick.emit(HEADER_MENU_OPTION.MINIMIZE)
112
112
  if(status === 'max') this.onMenuOptionClick.emit(HEADER_MENU_OPTION.MAXIMIZE)
113
113
  if(status === 'top') this.onMenuOptionClick.emit(HEADER_MENU_OPTION.TOP)
@@ -6,7 +6,7 @@
6
6
  .c21-header {
7
7
  overflow: hidden;
8
8
  width: 100%;
9
- height: 52px;
9
+ height: var(--chat-header-height);
10
10
  .c21-header-button {
11
11
  .c21-close-button.c21-small {
12
12
  width: 31px;
@@ -15,7 +15,7 @@
15
15
  .c21-header {
16
16
  overflow: hidden;
17
17
  width: 100%;
18
- height: 52px;
18
+ height: var(--chat-header-height);
19
19
  position: relative;
20
20
  margin: 0;
21
21
  padding: 0;
@@ -64,7 +64,7 @@
64
64
 
65
65
  .c21-header-container{
66
66
  position: relative;
67
- height: 52px;
67
+ height: 100%;
68
68
  width: 100%;
69
69
  margin: 0 auto;
70
70
 
@@ -12,7 +12,7 @@
12
12
  .c21-header {
13
13
  overflow: hidden;
14
14
  width: 100%;
15
- height: 52px;
15
+ height: var(--chat-header-height);
16
16
  .c21-header-button {
17
17
  .c21-close-button.c21-small {
18
18
  width: 31px;
@@ -760,13 +760,19 @@ export class GlobalSettingsService {
760
760
  TEMP = tiledeskSettings['fullscreenMode'];
761
761
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fullscreenMode:: ', TEMP);
762
762
  if (TEMP !== undefined) {
763
- globals.fullscreenMode = TEMP;
763
+ globals.fullscreenMode = (TEMP === true) ? true : false;
764
764
  // globals.setParameter('fullscreenMode', TEMP);
765
765
  }
766
766
  TEMP = tiledeskSettings['hideHeaderCloseButton'];
767
767
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > hideHeaderCloseButton:: ', TEMP);
768
768
  if (TEMP !== undefined) {
769
- globals.hideHeaderCloseButton = TEMP;
769
+ globals.hideHeaderCloseButton = (TEMP === true) ? true : false;
770
+ // globals.setParameter('hideHeaderCloseButton', TEMP);
771
+ }
772
+ TEMP = tiledeskSettings['hideHeaderConversation'];
773
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > hideHeaderCloseButton:: ', TEMP);
774
+ if (TEMP !== undefined) {
775
+ globals.hideHeaderConversation = (TEMP === true) ? true : false;
770
776
  // globals.setParameter('hideHeaderCloseButton', TEMP);
771
777
  }
772
778
  TEMP = tiledeskSettings['themeColor'];
@@ -909,7 +915,7 @@ export class GlobalSettingsService {
909
915
  globals.hideSettings = (TEMP === true) ? true : false;;
910
916
  }
911
917
  TEMP = tiledeskSettings['isLogEnabled'];
912
- // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > logLevel:: ', TEMP]);
918
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > isLogEnabled:: ', TEMP]);
913
919
  if (TEMP !== undefined) {
914
920
  globals.isLogEnabled = TEMP;
915
921
  }
@@ -958,7 +964,7 @@ export class GlobalSettingsService {
958
964
  globals.fontFamily = TEMP + ',' + globals.fontFamily;
959
965
  }
960
966
  TEMP = tiledeskSettings['fontFamilySource'];
961
- // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fontFamily:: ', TEMP]);
967
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fontFamilySource:: ', TEMP]);
962
968
  if (TEMP !== undefined) {
963
969
  globals.fontFamilySource = TEMP;
964
970
  }
@@ -1007,7 +1013,7 @@ export class GlobalSettingsService {
1007
1013
  globals.nativeRating = (TEMP === true) ? true : false;
1008
1014
  }
1009
1015
  TEMP = tiledeskSettings['showInfoMessage'];
1010
- // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > showBubbleInfoMessage:: ', TEMP]);
1016
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > showInfoMessage:: ', TEMP]);
1011
1017
  if (TEMP !== undefined) {
1012
1018
  globals.showInfoMessage = TEMP.split(',').map(key => { return key.trim()});
1013
1019
  }
@@ -1050,7 +1056,7 @@ export class GlobalSettingsService {
1050
1056
  globals.telegramUsername = TEMP;
1051
1057
  }
1052
1058
  TEMP = tiledeskSettings['fileUploadAccept'];
1053
- // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > telegramUsername:: ', TEMP]);
1059
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > fileUploadAccept:: ', TEMP]);
1054
1060
  if (TEMP !== undefined) {
1055
1061
  globals.fileUploadAccept = TEMP;
1056
1062
  }
@@ -1090,9 +1096,14 @@ export class GlobalSettingsService {
1090
1096
  globals.showEmojiFooterButton = (TEMP === true) ? true : false;
1091
1097
  }
1092
1098
  TEMP = tiledeskSettings['showAudioRecorderFooterButton'];
1093
- // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > showEmojiFooterButton:: ', TEMP]);
1099
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > showAudioRecorderFooterButton:: ', TEMP]);
1094
1100
  if (TEMP !== undefined) {
1095
1101
  globals.showAudioRecorderFooterButton = (TEMP === true) ? true : false;
1102
+ }
1103
+ TEMP = tiledeskSettings['size'];
1104
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > size:: ', TEMP]);
1105
+ if (TEMP !== undefined) {
1106
+ globals.size = TEMP;
1096
1107
  }
1097
1108
  }
1098
1109
 
@@ -1510,6 +1521,11 @@ export class GlobalSettingsService {
1510
1521
  globals.hideHeaderCloseButton = stringToBoolean(TEMP);
1511
1522
  }
1512
1523
 
1524
+ TEMP = getParameterByName(windowContext, 'tiledesk_hideHeaderConversation');
1525
+ if (TEMP) {
1526
+ globals.hideHeaderConversation = stringToBoolean(TEMP);
1527
+ }
1528
+
1513
1529
  TEMP = getParameterByName(windowContext, 'tiledesk_themeColor');
1514
1530
  if (TEMP) {
1515
1531
  const themecolor = stringToBoolean(TEMP);
@@ -1830,6 +1846,11 @@ export class GlobalSettingsService {
1830
1846
  if (TEMP) {
1831
1847
  globals.showEmojiFooterButton = stringToBoolean(TEMP);
1832
1848
  }
1849
+
1850
+ TEMP = getParameterByName(windowContext, 'tiledesk_size');
1851
+ if (TEMP) {
1852
+ globals.size = TEMP;
1853
+ }
1833
1854
 
1834
1855
  }
1835
1856
 
@@ -28,6 +28,8 @@
28
28
 
29
29
  --bkg-color-info-message: rgba(24, 119, 242, 0.1);
30
30
 
31
+ --chat-header-height: 52px;
32
+
31
33
  --chat-footer-height: 64px;
32
34
  --chat-footer-logo-height: 30px;
33
35
  --chat-footer-border-radius: 16px;
@@ -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;
@@ -223,6 +224,8 @@ export class Globals {
223
224
  allowedOnSpecificUrlList: Array<string> // ******* new ********
224
225
 
225
226
  fontFamilySource: string; // ******* new ********
227
+
228
+ size: 'min' | 'max' | 'top'; // ******* new ********
226
229
  constructor(
227
230
  ) { }
228
231
 
@@ -245,156 +248,160 @@ export class Globals {
245
248
  // ============ BEGIN: SET EXTERNAL PARAMETERS ==============//
246
249
  this.baseLocation = 'https://widget.tiledesk.com/v2';
247
250
  this.autoStart = true;
248
- this.startHidden = false;
249
251
  /** start Authentication and startUI */
250
- this.isShown = true;
252
+ this.startHidden = false;
251
253
  /** show/hide all widget -> js call: showAllWidget */
252
- this.isOpen = false;
254
+ this.isShown = true;
253
255
  /** show/hide window widget -> js call: hideAllWidget */
254
- this.startFromHome = true;
256
+ this.isOpen = false;
255
257
  /** start from Home or Conversation */
256
- this.isOpenPrechatForm = true;
258
+ this.startFromHome = true;
257
259
  /** check open/close modal prechatform if g.preChatForm is true */
258
- this.isOpenStartRating = false;
260
+ this.isOpenPrechatForm = true;
259
261
  /** show/hide all rating chat */
260
- this.projectid = '';
262
+ this.isOpenStartRating = false;
261
263
  /** The TileDesk project id. Find your TileDesk ProjectID in the
262
- TileDesk Dashboard under the Widget menu. */
263
- this.preChatForm = false;
264
+ TileDesk Dashboard under the Widget menu. */
265
+ this.projectid = '';
264
266
  /** You can require customers to enter information like name and email
265
267
  before sending a chat message by enabling the Pre-Chat form. Permitted
266
268
  values: true, false. The default value is false. */
267
- this.align = '';
269
+ this.preChatForm = false;
268
270
  /** if it is true, the chat window is automatically open when the
269
- widget is loaded. Permitted values: true, false. Default value : false */
270
- this.calloutTimer = -1;
271
+ widget is loaded. Permitted values: true, false. Default value : false */
272
+ this.align = '';
271
273
  /** Proactively open the chat windows to increase the customer engagement.
272
274
  Permitted values: -1 (Disabled), 0 (Immediatly) or a positive integer value.
273
275
  For exmaple: 5 (After 5 seconds), 10 (After 10 seconds). */
274
- this.calloutTitle = '';
276
+ this.calloutTimer = -1;
275
277
  /** title box callout */
276
- this.calloutMsg = '';
278
+ this.calloutTitle = '';
277
279
  /** stato callout (shown only first time) */
278
- this.calloutStaus = true;
280
+ this.calloutMsg = '';
279
281
  /** message box callout */
280
- this.userFullname = '';
282
+ this.calloutStaus = true;
281
283
  /** userFullname: Current user fullname. Set this parameter to specify
282
284
  the visitor fullname. */
283
- this.userEmail = '';
285
+ this.userFullname = '';
284
286
  /** Current user email address. Set this parameter to specify the visitor
285
287
  email address. */
286
- this.widgetTitle = '';
288
+ this.userEmail = '';
287
289
  /** Set the widget title label shown in the widget header. Value type : string.
288
290
  The default value is Tiledesk. */
289
- this.dynamicWaitTimeReply = true;
291
+ this.widgetTitle = '';
290
292
  /** The user can decide whether or not to share the
291
- * average response time of his team (if 'dynamicWaitTimeReply' is
292
- * false the WAITING_TIME_NOT_FOUND will always be displayed)
293
- * is set to true for backward compatibility with old projects */
294
- this.hideHeaderCloseButton = false;
295
- /** Hide the close button in the widget header. Permitted values: true,
296
- false. The default value is false. */
297
- 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
+
298
298
  /** if it is true, the chat window is open in fullscreen mode. Permitted
299
299
  values: true, false. Default value : false */
300
- this.themeColor = convertColorToRGBA('#2a6ac1', 100);
300
+ this.fullscreenMode = false;
301
301
  /** allows you to change the main widget's color
302
302
  (color of the header, color of the launcher button,
303
303
  other minor elements). Permitted values: Hex color
304
304
  codes, e.g. #87BC65 and RGB color codes, e.g. rgb(135,188,101) */
305
- this.themeColorOpacity = 100
305
+ this.themeColor = convertColorToRGBA('#2a6ac1', 100);
306
306
  /**allows you to change opacity in background headers component
307
- * Permitted values: [0..1] */
308
- this.themeForegroundColor = convertColorToRGBA('#ffffff', 100);
307
+ * Permitted values: [0..1] */
308
+ this.themeColorOpacity = 100
309
309
  /** allows you to change text and icons' color.
310
310
  Permitted values: Hex color codes, e.g. #425635 and RGB color
311
311
  codes, e.g. rgb(66,86,53) */
312
- this.allowTranscriptDownload = false;
312
+ this.themeForegroundColor = convertColorToRGBA('#ffffff', 100);
313
313
  /** allows the user to download the chat transcript. The download button appears
314
314
  when the chat is closed by the operator. Permitter values: true, false.
315
315
  Default value: false */
316
- this.poweredBy = BRAND_BASE_INFO.POWERED_BY;
316
+ this.allowTranscriptDownload = false;
317
317
  /** link nel footer widget */
318
- this.logoChat = BRAND_BASE_INFO.LOGO_CHAT;
318
+ this.poweredBy = BRAND_BASE_INFO.POWERED_BY;
319
319
  /** url img logo */
320
- this.marginX = '20px';
320
+ this.logoChat = BRAND_BASE_INFO.LOGO_CHAT;
321
321
  /** set margin left or rigth widget */
322
- this.marginY = '20px';
322
+ this.marginX = '20px';
323
323
  /** set margin bottom widget */
324
- this.mobileMarginX = '0px';
324
+ this.marginY = '20px';
325
325
  /** set margin left or rigth widget for mobile */
326
- this.mobileMarginY = '0px';
326
+ this.mobileMarginX = '0px';
327
327
  /** set margin bottom widget for mobile*/
328
- this.launcherWidth = '60px'
328
+ this.mobileMarginY = '0px';
329
329
  /** set launcher width widget */
330
- this.launcherHeight = '60px'
330
+ this.launcherWidth = '60px'
331
331
  /** set launcher height widget */
332
- this.baloonImage='';
332
+ this.launcherHeight = '60px'
333
333
  /** set launcher baloon widget image: require SVG url */
334
- this.baloonShape = '50%';
334
+ this.baloonImage='';
335
335
  /** set launcher balon widget shape: can set corner by corner */
336
- this.isLogEnabled = false;
336
+ this.baloonShape = '50%';
337
337
  // this.parameters['isLogEnabled'] = false;
338
- this.openExternalLinkButton = true;
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;
339
345
  /** enable to hide/show upper-right header conversation options menu */
340
- this.hideHeaderConversationOptionsMenu = false;
346
+ this.openExternalLinkButton = true;
341
347
  /** enable to close a conversation from upper-right header menu */
342
- this.hideCloseConversationOptionMenu = false;
348
+ this.hideHeaderConversationOptionsMenu = false;
343
349
  /** enable to hide/show options menu in conversation detail header */
344
- this.hideSettings = false;
350
+ this.hideCloseConversationOptionMenu = false;
345
351
  /** enable to hide/show options menu in home component */
346
- this.filterByRequester = false;
352
+ this.hideSettings = false;
347
353
  /** show conversations with conversation.attributes.requester_id == user.uid */
348
- this.persistence = 'local';
354
+ this.filterByRequester = false;
349
355
  /** set the auth persistence */
350
- 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"}]
356
+ this.persistence = 'local';
351
357
  /** set the preChatForm Json as default if preChatFormCustomFieldsEnabled is false or not exist */
352
- this.bubbleSentBackground = convertColorToRGBA('#2a6ac1', 100); //'#62a8ea'
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"}]
353
359
  /** set the background of bubble sent message */
354
- this.bubbleSentTextColor = convertColorToRGBA('#ffffff', 100); //'#ffffff'
360
+ this.bubbleSentBackground = convertColorToRGBA('#2a6ac1', 100); //'#62a8ea'
355
361
  /** set the text color of bubble sent message */
356
- this.bubbleReceivedBackground= convertColorToRGBA('#f0f2f7', 100); //#f7f7f7;
362
+ this.bubbleSentTextColor = convertColorToRGBA('#ffffff', 100); //'#ffffff'
357
363
  /** set the background of bubble received message */
358
- this.bubbleReceivedTextColor = convertColorToRGBA('#06132b', 100); //#1a1a1a
364
+ this.bubbleReceivedBackground= convertColorToRGBA('#f0f2f7', 100); //#f7f7f7;
359
365
  /** set the text color of bubble received message */
360
- this.fontSize = '1.4em'
366
+ this.bubbleReceivedTextColor = convertColorToRGBA('#06132b', 100); //#1a1a1a
361
367
  /** set the text size of bubble messages */
362
- this.fontFamily = "'Roboto','Google Sans', Helvetica, Arial, sans-serif"
368
+ this.fontSize = '1.4em'
363
369
  /** set the text family of bubble messages */
364
- this.buttonFontSize = '15px'
370
+ this.fontFamily = "'Roboto','Google Sans', Helvetica, Arial, sans-serif"
365
371
  /** set the text size of attachment-buttons */
366
- this.buttonBackgroundColor = convertColorToRGBA('#ffffff', 100)
372
+ this.buttonFontSize = '15px'
367
373
  /** set the backgroundColor of attachment-buttons */
368
- this.buttonTextColor = convertColorToRGBA('#2a6ac1', 100)
374
+ this.buttonBackgroundColor = convertColorToRGBA('#ffffff', 100)
369
375
  /** set the text color of attachment-buttons */
376
+ this.buttonTextColor = convertColorToRGBA('#2a6ac1', 100)
377
+ /** set the text size of attachment-buttons */
370
378
  this.buttonHoverBackgroundColor = convertColorToRGBA('#2a6ac1', 100)
371
379
  /** set the text size of attachment-buttons */
372
380
  this.buttonHoverTextColor = convertColorToRGBA('#ffffff', 100);
373
- /** set the text size of attachment-buttons */
374
- this.singleConversation = false;
375
381
  /** set the single conversation mode for the widget */
376
- this.restartConversation = false;
382
+ this.singleConversation = false;
377
383
  /** allow you to always restart a new converazioe */
378
- this.nativeRating = true;
384
+ this.restartConversation = false;
379
385
  /** set if native rating componet has to be shown */
380
- this.showInfoMessage = 'MEMBER_JOINED_GROUP'.split(',').map(key => { return key.trim()});
386
+ this.nativeRating = true;
381
387
  /** disable or show bubble info message 'MEMBER_JOINED_CHAT' */
382
- this.typingLocation = 'content'
388
+ this.showInfoMessage = 'MEMBER_JOINED_GROUP'.split(',').map(key => { return key.trim()});
383
389
  /** set the location of typing indicator (header or content) */
384
- this.allowReopen = false;
390
+ this.typingLocation = 'content'
385
391
  /** enable the user to reopen a closed conversation */
386
392
  // this.continueConversationBeforeTime = 48;
387
393
  /** enable user to continue archived confersation before the value time from last timeout message */
388
- this.participants = [];
394
+ this.allowReopen = false;
389
395
  /** enable user to talk with specific chat-bots/humans */
390
- this.whatsappNumber = '';
396
+ this.participants = [];
391
397
  /**enable user to set a whatsapp business number to chat with */
392
- this.messangerPageTitle = ''
398
+ this.whatsappNumber = '';
393
399
  /**enable user to set a facebook messanger page to chat with */
394
- this.telegramUsername = ''
400
+ this.messangerPageTitle = ''
395
401
  /**enable user to set a telegram number to chat with */
396
- this.fileUploadAccept = "image/*,.pdf,.txt,.mp3"
402
+ this.telegramUsername = ''
397
403
  /**enable auto disconnect from messaging after a defined amount of time (s)*/
404
+ this.fileUploadAccept = "image/*,.pdf,.txt,.mp3"
398
405
  this.disconnetTime = 0
399
406
 
400
407
  this.showWaitTime = true;
@@ -426,57 +433,36 @@ export class Globals {
426
433
  this.allowedOnSpecificUrl = false
427
434
  /** set a list of pattern url able to load the widget */
428
435
  this.allowedOnSpecificUrlList = [];
436
+ /** set widget size from 3 different positions: min, max, top */
437
+ this.size = 'min';
429
438
 
430
439
  // ============ END: SET EXTERNAL PARAMETERS ==============//
431
440
 
432
441
 
433
442
  // ============ BEGIN: SET INTERNAL PARAMETERS ==============//
443
+ /** name tenant ex: tilechat */
434
444
  this.tenant = environment.firebaseConfig.tenant;
435
- // this.parameters['tenant'] = environment.tenant;
436
- // this.parameters.push({'tenant': environment.tenant});
437
-
438
- /** Set the widget title label shown in the widget header. Value type : string.
439
- The default value is Tiledesk. */
440
- /** name tenant ex: tilechat */
445
+ /** channelType: group/direct */
441
446
  this.channelType = CHANNEL_TYPE.GROUP;
442
- // this.parameters['channelType'] = CHANNEL_TYPE.GROUP;
443
- // this.parameters.push({'channelType': CHANNEL_TYPE.GROUP});
444
- /** channelType: group/direct */
447
+ /** settings for pass variables to js */
445
448
  this.default_settings = {};
446
- // this.parameters.push({'default_settings': '' });
447
- /** settings for pass variables to js */
449
+ /** detect is mobile : detectIfIsMobile() */
448
450
  this.isMobile = false;
449
- // this.parameters['isMobile'] = false;
450
- // this.parameters.push({'isMobile': false}); /** detect is mobile : detectIfIsMobile() */
451
-
451
+ /** detect is logged */
452
452
  this.isLogged = false;
453
- // this.parameters['isLogged'] = false;
454
- // this.parameters.push({'isLogged': false}); /** detect is logged */
455
-
453
+
456
454
  this.BUILD_VERSION = 'v.' + environment.version;
457
- // this.parameters['BUILD_VERSION'] = 'v.' + environment.version;
458
- // this.parameters.push({'BUILD_VERSION': 'v.' + environment.version});
459
455
 
460
456
  this.soundEnabled = true;
461
- // this.parameters['soundEnabled'] = true;
462
- // this.parameters.push({'soundEnabled': true});
463
457
 
464
458
  this.conversationsBadge = 0;
465
- // this.parameters['conversationsBadge'] = 0;
466
- // this.parameters.push({'conversationsBadge': 0});
467
459
 
468
460
  this.isOpenMenuOptions = false;
469
- // this.parameters['isOpenMenuOptions'] = false;
470
- // this.parameters.push({'isOpenMenuOptions': false});
471
461
 
472
462
  this.displayEyeCatcherCard = 'none';
473
- // this.parameters['displayEyeCatcherCard'] = 'none';
474
- // this.parameters.push({'displayEyeCatcherCard': 'none'});
475
463
  // ============ END: SET INTERNAL PARAMETERS ==============//
476
464
 
477
465
  this.supportMode = true;
478
- // this.parameters['supportMode'] = true;
479
- // this.parameters.push({'supportMode': true});
480
466
 
481
467
  this.newConversationStart = true;
482
468
 
@@ -534,7 +520,7 @@ export class Globals {
534
520
  'fullscreenMode': this.fullscreenMode,
535
521
  'filterByRequester': this.filterByRequester,
536
522
  'hideHeaderConversationOptionsMenu': this.hideHeaderConversationOptionsMenu, 'hideHeaderCloseButton': this.hideHeaderCloseButton,
537
- 'hideCloseConversationOptionMenu': this.hideCloseConversationOptionMenu,
523
+ 'hideCloseConversationOptionMenu': this.hideCloseConversationOptionMenu, 'hideHeaderConversation': this.hideHeaderConversation,
538
524
  'hideSettings': this.hideSettings,
539
525
  'isLogEnabled': this.isLogEnabled,
540
526
  'isOpen': this.isOpen, 'isShown': this.isShown,
@@ -628,6 +614,11 @@ export class Globals {
628
614
  this.align === 'left'? divTiledeskWidget.style.left = this.mobileMarginX : divTiledeskWidget.style.right = this.mobileMarginX;
629
615
  }
630
616
 
617
+ //customize position for 'tiledeskdiv' for desktop
618
+ if(isOpen && !this.isMobile && divTiledeskWidget && this.size){
619
+ divTiledeskWidget.classList.add(this.size + '-size')
620
+ }
621
+
631
622
 
632
623
  }
633
624
 
@@ -55,7 +55,7 @@
55
55
  "CLOSE_CHAT": "Close chat",
56
56
  "MINIMIZE":"Minimize window",
57
57
  "MAXIMIZE":"Expand window",
58
- "FULLSCREEN":"Fullscreen",
58
+ "CENTER":"Center",
59
59
  "CONFIRM_CLOSE_CHAT":"Are you sure you want to close this chat?",
60
60
 
61
61
  "INFO_SUPPORT_USER_ADDED_SUBJECT":"you",
@@ -55,7 +55,7 @@
55
55
  "CLOSE_CHAT": "Cerrar chat",
56
56
  "MINIMIZE":" Minimizar ventana",
57
57
  "MAXIMIZE":"Expandir ventana",
58
- "FULLSCREEN":"Pantalla completa",
58
+ "CENTER":"Centrar",
59
59
  "CONFIRM_CLOSE_CHAT":"¿Estás seguro de que quieres cerrar este chat?",
60
60
 
61
61
  "INFO_SUPPORT_USER_ADDED_SUBJECT":"tú",
@@ -55,7 +55,7 @@
55
55
  "CLOSE_CHAT": "Fermer la discussion",
56
56
  "MINIMIZE":"Réduire la fenêtre",
57
57
  "MAXIMIZE":"Agrandir la fenêtre",
58
- "FULLSCREEN":"Plein écran",
58
+ "CENTER":"Centrer",
59
59
  "CONFIRM_CLOSE_CHAT":"Etes-vous sûr de vouloir fermer cette discussion?",
60
60
 
61
61
  "INFO_SUPPORT_USER_ADDED_SUBJECT":"tu",
@@ -55,7 +55,7 @@
55
55
  "CLOSE_CHAT": "Chiudi chat",
56
56
  "MINIMIZE":"Comprimi finestra",
57
57
  "MAXIMIZE":"Espandi finestra",
58
- "FULLSCREEN":"Fullscreen",
58
+ "CENTER":"Centra",
59
59
  "CONFIRM_CLOSE_CHAT":"Sei sicuro di voler chiudere questa chat?",
60
60
 
61
61
  "INFO_SUPPORT_USER_ADDED_SUBJECT":"tu",
@@ -835,6 +835,63 @@
835
835
  return true;
836
836
  }
837
837
 
838
+
839
+ /** WIDGET POSITION SECTION : start*/
840
+ function onClickSize(){
841
+ let status = document.querySelector('input[name="size"]:checked').value
842
+ window.tiledeskSettings['size'] = status
843
+ console.log('onClickSize: status-->',window.tiledeskSettings);
844
+ window.Tiledesk('restart')
845
+ }
846
+
847
+ function onClickFullScreenMode(){
848
+ let status = document.querySelector('input[name="fullscreenMode"]:checked').value
849
+ window.tiledeskSettings['fullscreenMode'] = stringToBoolean(status)
850
+ console.log('onClickFullScreenMode: status-->',window.tiledeskSettings);
851
+ window.Tiledesk('restart')
852
+ }
853
+
854
+ function onClickAlign(){
855
+ let status = document.querySelector('input[name="align"]:checked').value
856
+ window.tiledeskSettings['align'] = status
857
+ console.log('onClickAlign: status-->',window.tiledeskSettings)
858
+ window.Tiledesk('restart')
859
+ }
860
+
861
+ function onClickMarginX(){
862
+ let text = document.getElementById('marginX').value
863
+ text === ""? text= '100px': text
864
+ window.tiledeskSettings['marginX'] = text
865
+ console.log('onClickMarginX:',window.tiledeskSettings);
866
+ window.Tiledesk('restart')
867
+ }
868
+
869
+ function onClickMarginY(){
870
+ let text = document.getElementById('marginY').value
871
+ text === ""? text= '50px' : text //set default value if user not write a value
872
+ window.tiledeskSettings['marginY'] = text
873
+ console.log('onClickMarginY:',window.tiledeskSettings);
874
+ window.Tiledesk('restart')
875
+ }
876
+
877
+ function onClickMobileMarginX(){
878
+ let text = document.getElementById('mobileMarginX').value
879
+ text === ""? text= '100px': text
880
+ window.tiledeskSettings['mobileMarginX'] = text
881
+ console.log('onClickMobileMarginX:',window.tiledeskSettings);
882
+ window.Tiledesk('restart')
883
+ }
884
+
885
+ function onClickMobileMarginY(){
886
+ let text = document.getElementById('mobileMarginY').value
887
+ text === ""? text= '50px' : text //set default value if user not write a value
888
+ window.tiledeskSettings['mobileMarginY'] = text
889
+ console.log('onClickMobileMarginY:',window.tiledeskSettings);
890
+ window.Tiledesk('restart')
891
+ }
892
+ /** WIDGET POSITION SECTION : end*/
893
+
894
+ /** WIDGET SETTINGS SECTION : start*/
838
895
  function onClickDisconnectTime(){
839
896
  let status = document.querySelector('input[name="disconnetTime"]:checked');
840
897
  let value;
@@ -869,13 +926,6 @@
869
926
  window.Tiledesk('restart')
870
927
  }
871
928
 
872
- function onClickAlign(){
873
- let status = document.querySelector('input[name="align"]:checked').value
874
- window.tiledeskSettings['align'] = status
875
- console.log('onClickAlign: status-->',window.tiledeskSettings)
876
- window.Tiledesk('restart')
877
- }
878
-
879
929
  function onClickCalloutTimer(){
880
930
  let status = document.querySelector('input[name="calloutTimer"]:checked');
881
931
  let value;
@@ -962,13 +1012,6 @@
962
1012
  window.Tiledesk('restart')
963
1013
  }
964
1014
 
965
- function onClickFullScreenMode(){
966
- let status = document.querySelector('input[name="fullscreenMode"]:checked').value
967
- window.tiledeskSettings['fullscreenMode'] = stringToBoolean(status)
968
- console.log('onClickFullScreenMode: status-->',window.tiledeskSettings);
969
- window.Tiledesk('restart')
970
- }
971
-
972
1015
  function onClickThemeColor(){
973
1016
  let color = document.getElementById('themeColor').value
974
1017
  document.getElementById('themeColorText').value = color
@@ -1043,38 +1086,6 @@
1043
1086
  window.Tiledesk('restart')
1044
1087
  }
1045
1088
 
1046
- function onClickMarginX(){
1047
- let text = document.getElementById('marginX').value
1048
- text === ""? text= '100px': text
1049
- window.tiledeskSettings['marginX'] = text
1050
- console.log('onClickMarginX:',window.tiledeskSettings);
1051
- window.Tiledesk('restart')
1052
- }
1053
-
1054
- function onClickMarginY(){
1055
- let text = document.getElementById('marginY').value
1056
- text === ""? text= '50px' : text //set default value if user not write a value
1057
- window.tiledeskSettings['marginY'] = text
1058
- console.log('onClickMarginY:',window.tiledeskSettings);
1059
- window.Tiledesk('restart')
1060
- }
1061
-
1062
- function onClickMobileMarginX(){
1063
- let text = document.getElementById('mobileMarginX').value
1064
- text === ""? text= '100px': text
1065
- window.tiledeskSettings['mobileMarginX'] = text
1066
- console.log('onClickMobileMarginX:',window.tiledeskSettings);
1067
- window.Tiledesk('restart')
1068
- }
1069
-
1070
- function onClickMobileMarginY(){
1071
- let text = document.getElementById('mobileMarginY').value
1072
- text === ""? text= '50px' : text //set default value if user not write a value
1073
- window.tiledeskSettings['mobileMarginY'] = text
1074
- console.log('onClickMobileMarginY:',window.tiledeskSettings);
1075
- window.Tiledesk('restart')
1076
- }
1077
-
1078
1089
  function onClickAutoStart(){
1079
1090
  let status = document.querySelector('input[name="autoStart"]:checked').value
1080
1091
  window.tiledeskSettings['autoStart'] = stringToBoolean(status)
@@ -1227,7 +1238,9 @@
1227
1238
  console.log('onClickNativeRating:', window.tiledeskSettings)
1228
1239
  window.Tiledesk('restart')
1229
1240
  }
1241
+ /** WIDGET SETTINGS SECTION : end*/
1230
1242
 
1243
+ /** WIDGET SOCIAL CHANNELS SECTION : start*/
1231
1244
  function onClickWhatsappNumber(){
1232
1245
  let status = document.getElementById('whatsappNumber').value
1233
1246
  window.tiledeskSettings['whatsappNumber'] = status
@@ -1248,6 +1261,15 @@
1248
1261
  console.log('onClickTelegramUsername:', window.tiledeskSettings)
1249
1262
  window.Tiledesk('restart')
1250
1263
  }
1264
+ /** WIDGET SOCIAL CHANNELS SECTION : end*/
1265
+
1266
+ /** WIDGET CONVERSATION DETAIL SECTION : start*/
1267
+ function onClickHideHeaderConversation(){
1268
+ let status = document.querySelector('input[name="hideHeaderConversation"]:checked').value
1269
+ window.tiledeskSettings['hideHeaderConversation'] = stringToBoolean(status)
1270
+ console.log('onClickHideHeaderConversation: status-->',window.tiledeskSettings);
1271
+ window.Tiledesk('restart')
1272
+ }
1251
1273
 
1252
1274
  function onClickHideHeaderCloseButton(){
1253
1275
  let status = document.querySelector('input[name="hideHeaderCloseButton"]:checked').value
@@ -1360,7 +1382,9 @@
1360
1382
  console.log('onClickshowAudioRecorderFooterButton:', window.tiledeskSettings)
1361
1383
  window.Tiledesk('restart')
1362
1384
  }
1385
+ /** WIDGET CONVERSATION DETAIL SECTION : end*/
1363
1386
 
1387
+ /** WIDGET BUBBLE MESSAGE SECTION : start*/
1364
1388
  function onClickFontSize(){
1365
1389
  let text = document.getElementById('fontSize').value
1366
1390
  text === ""? text= '1.4em': text
@@ -1381,6 +1405,9 @@
1381
1405
  window.Tiledesk('restart')
1382
1406
  }
1383
1407
 
1408
+ /** WIDGET BUBBLE MESSAGE SECTION : end*/
1409
+
1410
+ /**WIDGET BUTTON STYLE SECTION : start */
1384
1411
  function onClickButtonFontSize(){
1385
1412
  let text = document.getElementById('buttonFontSize').value
1386
1413
  text === ""? text= '15px': text
@@ -1388,9 +1415,7 @@
1388
1415
  console.log('onClickButtonFontSize:',window.tiledeskSettings);
1389
1416
  window.Tiledesk('restart')
1390
1417
  }
1391
-
1392
-
1393
-
1418
+ /**WIDGET BUTTON STYLE SECTION : end */
1394
1419
 
1395
1420
  function onClickTestAll(){
1396
1421
  inputs = document.getElementsByTagName('input');
@@ -1782,6 +1807,78 @@
1782
1807
  <button class="btn btn-light" onclick="onClickOpenConversationById()">Open conversation <i class="fa-regular fa-comment" aria-hidden="true"></i></button>
1783
1808
  </div>
1784
1809
  </div>
1810
+ <!-- WIDGET POSITION SECTION : start-->
1811
+ <div class="row section">
1812
+ <div><h3 style="line-height: 0.3;">Widget <em><strong>POSITION</strong></em></h3></div>
1813
+ <div class="row">
1814
+ <div class="col-md-5 formElement"><span><em><strong>size</strong></em></span></div>
1815
+ <div class="col-md-5">
1816
+ <input class="form-check-input" type="radio" name="size" value="min" checked><label class="form-check-label" for="size">min</label>
1817
+ <input class="form-check-input" type="radio" name="size" value="max"><label class="form-check-label" for="size">max</label>
1818
+ <input class="form-check-input" type="radio" name="size" value="top"><label class="form-check-label" for="size">top</label>
1819
+ </div>
1820
+ <div class="col-md-2">
1821
+ <button class="btn btn-light" onclick="onClickSize()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1822
+ </div>
1823
+ </div>
1824
+ <div class="row">
1825
+ <div class="col-md-5 formElement"><span><em><strong>fullscreenMode</strong></em></span></div>
1826
+ <div class="col-md-5">
1827
+ <input class="form-check-input" type="radio" name="fullscreenMode" value="true"><label>True</label>
1828
+ <input class="form-check-input" type="radio" name="fullscreenMode" value="false" checked ><label>False</label>
1829
+ </div>
1830
+ <div class="col-md-2">
1831
+ <button class="btn btn-light" onclick="onClickFullScreenMode()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1832
+ </div>
1833
+ </div>
1834
+ <div class="row">
1835
+ <div class="col-md-5 formElement"><span><em><strong>align</strong></em></span></div>
1836
+ <div class="col-md-5">
1837
+ <input class="form-check-input" type="radio" name="align" value="left"><label class="form-check-label" for="preChatForm">Left</label>
1838
+ <input class="form-check-input" type="radio" name="align" value="right" checked><label class="form-check-label" for="preChatForm">Right</label>
1839
+ </div>
1840
+ <div class="col-md-2">
1841
+ <button class="btn btn-light" onclick="onClickAlign()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1842
+ </div>
1843
+ </div>
1844
+ <div class="row">
1845
+ <div class="col-md-5 formElement"><span><em><strong>marginX</strong></em></span></div>
1846
+ <div class="col-md-5 formElement">
1847
+ <input class="form-control col-sm-2" type="text" id="marginX" name="marginX" placeholder="Ex. 100px, 1em">
1848
+ </div>
1849
+ <div class="col-md-2">
1850
+ <button class="btn btn-light" onclick="onClickMarginX()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1851
+ </div>
1852
+ </div>
1853
+ <div class="row">
1854
+ <div class="col-md-5 formElement"><span><em><strong>marginY</strong></em></span></div>
1855
+ <div class="col-md-5 formElement">
1856
+ <input class="form-control col-sm-2" type="text" id="marginY" name="marginY" placeholder="Ex. 100px, 1em">
1857
+ </div>
1858
+ <div class="col-md-2 ">
1859
+ <button class="btn btn-light" onclick="onClickMarginY()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1860
+ </div>
1861
+ </div>
1862
+ <div class="row">
1863
+ <div class="col-md-5 formElement"><span><em><strong>mobileMarginX</strong></em></span></div>
1864
+ <div class="col-md-5 formElement">
1865
+ <input class="form-control col-sm-2" type="text" id="mobileMarginX" name="mobileMarginX" placeholder="Ex. 100px, 1em">
1866
+ </div>
1867
+ <div class="col-md-2">
1868
+ <button class="btn btn-light" onclick="onClickMobileMarginX()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1869
+ </div>
1870
+ </div>
1871
+ <div class="row">
1872
+ <div class="col-md-5 formElement"><span><em><strong>mobileMarginY</strong></em></span></div>
1873
+ <div class="col-md-5 formElement">
1874
+ <input class="form-control col-sm-2" type="text" id="mobileMarginY" name="mobileMarginY" placeholder="Ex. 100px, 1em">
1875
+ </div>
1876
+ <div class="col-md-2 ">
1877
+ <button class="btn btn-light" onclick="onClickMobileMarginY()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1878
+ </div>
1879
+ </div>
1880
+ </div>
1881
+ <!-- WIDGET POSITION SECTION : end-->
1785
1882
  <div class="row section c21-parameters">
1786
1883
  <div><h3 style="line-height: 0.3;">MANAGE <em><strong>widget settings</strong></em></h3></div>
1787
1884
  <div class="docs">Select an option for Tiledesk settings parameter</div>
@@ -1828,16 +1925,6 @@
1828
1925
  <button class="btn btn-light" onclick="onClickPreChatForm()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1829
1926
  </div>
1830
1927
  </div>
1831
- <div class="row">
1832
- <div class="col-md-5 formElement"><span><em><strong>align</strong></em></span></div>
1833
- <div class="col-md-5">
1834
- <input class="form-check-input" type="radio" name="align" value="left"><label class="form-check-label" for="preChatForm">Left</label>
1835
- <input class="form-check-input" type="radio" name="align" value="right" checked><label class="form-check-label" for="preChatForm">Right</label>
1836
- </div>
1837
- <div class="col-md-2">
1838
- <button class="btn btn-light" onclick="onClickAlign()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1839
- </div>
1840
- </div>
1841
1928
  <div class="row">
1842
1929
  <div class="col-md-5 formElement"><span><em><strong>calloutTimer</strong></em></span></div>
1843
1930
  <div class="col-md-5">
@@ -1935,8 +2022,6 @@
1935
2022
  <button class="btn btn-light" onclick="onClickRestartConversation()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1936
2023
  </div>
1937
2024
  </div>
1938
-
1939
-
1940
2025
  <div class="row">
1941
2026
  <div class="col-md-5 formElement"><span><em><strong>hideSettings</strong></em></span></div>
1942
2027
  <div class="col-md-5">
@@ -1947,17 +2032,6 @@
1947
2032
  <button class="btn btn-light" onclick="onClickHideSettings()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1948
2033
  </div>
1949
2034
  </div>
1950
-
1951
- <div class="row">
1952
- <div class="col-md-5 formElement"><span><em><strong>fullscreenMode</strong></em></span></div>
1953
- <div class="col-md-5">
1954
- <input class="form-check-input" type="radio" name="fullscreenMode" value="true"><label>True</label>
1955
- <input class="form-check-input" type="radio" name="fullscreenMode" value="false" checked ><label>False</label>
1956
- </div>
1957
- <div class="col-md-2">
1958
- <button class="btn btn-light" onclick="onClickFullScreenMode()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1959
- </div>
1960
- </div>
1961
2035
  <div class="row">
1962
2036
  <div class="col-md-5 formElement"><span><em><strong>themeColor</strong></em></span></div>
1963
2037
  <div class="col-md-5 formElement">
@@ -1996,42 +2070,6 @@
1996
2070
  <button class="btn btn-light" onclick="onClickDepartmentId()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1997
2071
  </div>
1998
2072
  </div>
1999
- <div class="row">
2000
- <div class="col-md-5 formElement"><span><em><strong>marginX</strong></em></span></div>
2001
- <div class="col-md-5 formElement">
2002
- <input class="form-control col-sm-2" type="text" id="marginX" name="marginX" placeholder="Ex. 100px, 1em">
2003
- </div>
2004
- <div class="col-md-2">
2005
- <button class="btn btn-light" onclick="onClickMarginX()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
2006
- </div>
2007
- </div>
2008
- <div class="row">
2009
- <div class="col-md-5 formElement"><span><em><strong>marginY</strong></em></span></div>
2010
- <div class="col-md-5 formElement">
2011
- <input class="form-control col-sm-2" type="text" id="marginY" name="marginY" placeholder="Ex. 100px, 1em">
2012
- </div>
2013
- <div class="col-md-2 ">
2014
- <button class="btn btn-light" onclick="onClickMarginY()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
2015
- </div>
2016
- </div>
2017
- <div class="row">
2018
- <div class="col-md-5 formElement"><span><em><strong>mobileMarginX</strong></em></span></div>
2019
- <div class="col-md-5 formElement">
2020
- <input class="form-control col-sm-2" type="text" id="mobileMarginX" name="mobileMarginX" placeholder="Ex. 100px, 1em">
2021
- </div>
2022
- <div class="col-md-2">
2023
- <button class="btn btn-light" onclick="onClickMobileMarginX()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
2024
- </div>
2025
- </div>
2026
- <div class="row">
2027
- <div class="col-md-5 formElement"><span><em><strong>mobileMarginY</strong></em></span></div>
2028
- <div class="col-md-5 formElement">
2029
- <input class="form-control col-sm-2" type="text" id="mobileMarginY" name="mobileMarginY" placeholder="Ex. 100px, 1em">
2030
- </div>
2031
- <div class="col-md-2 ">
2032
- <button class="btn btn-light" onclick="onClickMobileMarginY()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
2033
- </div>
2034
- </div>
2035
2073
  <div class="row">
2036
2074
  <div class="col-md-5 formElement"><span><em><strong>autoStart</strong></em></span></div>
2037
2075
  <div class="col-md-5">
@@ -2245,6 +2283,16 @@
2245
2283
 
2246
2284
 
2247
2285
  <div><h3 style="line-height: 0.3;">MANAGE <em><strong>CONVERSATION DETAIL</strong></em></h3></div>
2286
+ <div class="row">
2287
+ <div class="col-md-5 formElement"><span><em><strong>hideHeaderConversation</strong></em></span></div>
2288
+ <div class="col-md-5">
2289
+ <input class="form-check-input" type="radio" name="hideHeaderConversation" value="true"><label>True</label>
2290
+ <input class="form-check-input" type="radio" name="hideHeaderConversation" value="false" checked><label>False</label>
2291
+ </div>
2292
+ <div class="col-md-2">
2293
+ <button class="btn btn-light" onclick="onClickHideHeaderConversation()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
2294
+ </div>
2295
+ </div>
2248
2296
  <div class="row">
2249
2297
  <div class="col-md-5 formElement"><span><em><strong>hideHeaderCloseButton</strong></em></span></div>
2250
2298
  <div class="col-md-5">
@@ -43,15 +43,14 @@
43
43
  height: 100%;
44
44
  }
45
45
 
46
- #tiledeskdiv.top {
47
- /* transition: width 1s, height 1s; */
48
- /* transition: all 0.5s ease-in !important; */
46
+ #tiledeskdiv.top-size {
49
47
  position: fixed;
50
- top: 50%;
48
+ /* top: 50%; */
51
49
  left: 50%;
52
50
  width: var(--iframeMaxWidth);
53
51
  height: var(--iframeMaxHeight);
54
- transform: translate(-50%, -50%);
52
+ /* transform: translate(-50%, -50%); */
53
+ transform: translate(-50%, 0%);
55
54
  }
56
55
 
57
56
 
@@ -113,13 +112,13 @@
113
112
  box-shadow: none;
114
113
  }
115
114
 
116
- #tiledesk-container.open #tiledeskdiv.decreaseSize {
115
+ #tiledesk-container.open #tiledeskdiv.min-size {
117
116
  transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out;
118
117
  width: var(--iframeMinWidth);
119
118
  height: var(--iframeMinHeight);
120
119
  }
121
120
 
122
- #tiledesk-container.open #tiledeskdiv.increaseSize {
121
+ #tiledesk-container.open #tiledeskdiv.max-size {
123
122
  /* transition: width 1s, height 1s; */
124
123
  transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out;
125
124
  width: var(--iframeMaxWidth);