@chat21/chat21-web-widget 5.0.46 → 5.0.47-rc.2

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 (29) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/assets/i18n/en.json +1 -0
  3. package/dist/assets/images/website mockup.jpg +0 -0
  4. package/dist/assets/twp/chatbot-panel.html +612 -0
  5. package/dist/assets/twp/index-dev.html +71 -0
  6. package/dist/launch.js +1 -0
  7. package/dist/main.js +1 -1
  8. package/dist/test.html +4 -1
  9. package/package.json +1 -1
  10. package/src/app/app.component.scss +3 -1
  11. package/src/app/app.component.ts +7 -1
  12. package/src/app/component/conversation-detail/conversation/conversation.component.scss +2 -1
  13. package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +2 -1
  14. package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.scss +2 -1
  15. package/src/app/component/home/home.component.html +81 -1
  16. package/src/app/component/home/home.component.scss +34 -0
  17. package/src/app/component/home/home.component.ts +23 -1
  18. package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -1
  19. package/src/app/component/message/return-receipt/return-receipt.component.scss +1 -0
  20. package/src/app/component/star-rating-widget/star-rating-widget.component.scss +2 -1
  21. package/src/app/providers/global-settings.service.ts +30 -1
  22. package/src/app/utils/globals.ts +14 -1
  23. package/src/assets/i18n/en.json +1 -0
  24. package/src/assets/images/website mockup.jpg +0 -0
  25. package/src/assets/twp/chatbot-panel.html +612 -0
  26. package/src/assets/twp/index-dev.html +71 -0
  27. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +12 -12
  28. package/src/chat21-core/utils/utils-message.ts +2 -1
  29. package/src/launch.js +1 -0
package/dist/test.html CHANGED
@@ -59,7 +59,10 @@
59
59
  // buttonHoverTextColor: "#828282",
60
60
  // buttonHoverBackgroundColor: "#b61416",
61
61
  // preChatFormJson: [{"name": "userFullname", "type":"text", "mandatory":true, "label":"LABEL_FIELD_NAME"}]
62
- hideSettings: false
62
+ hideSettings: false,
63
+ whatsappNumber: '222222',
64
+ messangerPageTitle: 'ddsad',
65
+ telegramUsername: 'sdasd'
63
66
  };
64
67
 
65
68
  (function(d, s, id) {
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.0.46",
4
+ "version": "5.0.47-rc.2",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -679,7 +679,9 @@ chat-root {
679
679
  .c21-title {
680
680
  position: absolute;
681
681
  left: 0;
682
- display: inline-block;
682
+ // display: inline-block;
683
+ display: flex;
684
+ align-items: center;
683
685
  width: calc(100% - 200px);
684
686
  height: 1.6em;
685
687
  line-height: 1.6em;
@@ -602,7 +602,10 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
602
602
  this.logger.debug('[APP-COMP] ============ idConversation ===============', recipientId, this.g.recipientId);
603
603
  // this.g.recipientId = null;
604
604
  this.logger.debug('[APP-COMP] singleConversation conv da ...', this.g.recipientId)
605
- if(this.g.recipientId && this.g.singleConversation){
605
+ if(this.g.restartConversation && this.g.singleConversation){
606
+ this.logger.debug('[APP-COMP] RESTART-CONVERSARION::: start a new conversations...', this.g.restartConversation)
607
+ this.onNewConversation();
608
+ }else if(this.g.recipientId && this.g.singleConversation){
606
609
  //start widget from current recipientId conversation
607
610
  this.logger.debug('[APP-COMP] singleConversation conv da API', this.g.recipientId)
608
611
  this.isOpenHome = false;
@@ -781,6 +784,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
781
784
  if (location.href) {
782
785
  attributes['sourcePage'] = location.href;
783
786
  }
787
+ if(document.title){
788
+ attributes['sourceTitle'] = document.title;
789
+ }
784
790
  if (projectid) {
785
791
  attributes['projectId'] = projectid;
786
792
  }
@@ -38,7 +38,8 @@
38
38
  position: absolute;
39
39
  left: 50px;
40
40
  right: 100px;
41
- display: inline-block;
41
+ display: flex;
42
+ align-items: center;
42
43
  width: auto;
43
44
  height: 42px;
44
45
  padding: 0px;
@@ -25,7 +25,8 @@
25
25
  position: absolute;
26
26
  left: 50px;
27
27
  right: 100px;
28
- display: inline-block;
28
+ display: flex;
29
+ align-items: center;
29
30
  width: auto;
30
31
  height: 42px;
31
32
  padding: 0px;
@@ -16,7 +16,8 @@
16
16
  position: absolute;
17
17
  left: 50px;
18
18
  right: 100px;
19
- display: inline-block;
19
+ display: flex;
20
+ align-items: center;
20
21
  width: auto;
21
22
  height: 42px;
22
23
  padding: 0px;
@@ -13,7 +13,7 @@
13
13
  <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24">
14
14
  <path fill="none" d="M0 0h24v24H0V0z"/>
15
15
  <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>
16
- <title id="altIconTitle">{{g.BUTTON_CLOSE_TO_ICON}}</title>
16
+ <title id="altIconTitle">{{translationMapHeader?.get('BUTTON_CLOSE_TO_ICON')}}</title>
17
17
  </svg>
18
18
  </button>
19
19
  </div>
@@ -67,6 +67,86 @@
67
67
 
68
68
  </div>
69
69
 
70
+ <!-- FOOTER - CONTENT -->
71
+ <div class="c21-footer-content fade-in-bottom-footer" >
72
+ <div id="c21-whatsapp" *ngIf="g?.whatsappNumber && g?.whatsappNumber.trim() !== ''">
73
+ <button tabindex="1040" aflistconv #aflistconv class="c21-button-primary" (click)="openConversationOnPlatform('whatsapp')">
74
+ <span class="v-align-center">
75
+ <!-- <svg [ngStyle]="{'fill': 'yellow' }" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
76
+ <path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" [ngStyle]="{'fill': g.themeForegroundColor}"/>
77
+ </svg> -->
78
+ <svg aria-labelledby="altIconTitle" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="28" height="28" viewBox="0 0 1219.547 1225.016">
79
+ <path fill="#E0E0E0" d="M1041.858 178.02C927.206 63.289 774.753.07 612.325 0 277.617 0 5.232 272.298 5.098 606.991c-.039 106.986 27.915 211.42 81.048 303.476L0 1225.016l321.898-84.406c88.689 48.368 188.547 73.855 290.166 73.896h.258.003c334.654 0 607.08-272.346 607.222-607.023.056-162.208-63.052-314.724-177.689-429.463zm-429.533 933.963h-.197c-90.578-.048-179.402-24.366-256.878-70.339l-18.438-10.93-191.021 50.083 51-186.176-12.013-19.087c-50.525-80.336-77.198-173.175-77.16-268.504.111-278.186 226.507-504.503 504.898-504.503 134.812.056 261.519 52.604 356.814 147.965 95.289 95.36 147.728 222.128 147.688 356.948-.118 278.195-226.522 504.543-504.693 504.543z"/>
80
+ <linearGradient id="a" gradientUnits="userSpaceOnUse" x1="609.77" y1="1190.114" x2="609.77" y2="21.084">
81
+ <stop offset="0" stop-color="#20b038"/>
82
+ <stop offset="1" stop-color="#60d66a"/>
83
+ </linearGradient><path fill="url(#a)" d="M27.875 1190.114l82.211-300.18c-50.719-87.852-77.391-187.523-77.359-289.602.133-319.398 260.078-579.25 579.469-579.25 155.016.07 300.508 60.398 409.898 169.891 109.414 109.492 169.633 255.031 169.57 409.812-.133 319.406-260.094 579.281-579.445 579.281-.023 0 .016 0 0 0h-.258c-96.977-.031-192.266-24.375-276.898-70.5l-307.188 80.548z"/>
84
+ <image overflow="visible" opacity=".08" width="20" height="20" xlink:href="FCC0802E2AF8A915.png" transform="translate(270.984 291.372)"/>
85
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M462.273 349.294c-11.234-24.977-23.062-25.477-33.75-25.914-8.742-.375-18.75-.352-28.742-.352-10 0-26.25 3.758-39.992 18.766-13.75 15.008-52.5 51.289-52.5 125.078 0 73.797 53.75 145.102 61.242 155.117 7.5 10 103.758 166.266 256.203 226.383 126.695 49.961 152.477 40.023 179.977 37.523s88.734-36.273 101.234-71.297c12.5-35.016 12.5-65.031 8.75-71.305-3.75-6.25-13.75-10-28.75-17.5s-88.734-43.789-102.484-48.789-23.75-7.5-33.75 7.516c-10 15-38.727 48.773-47.477 58.773-8.75 10.023-17.5 11.273-32.5 3.773-15-7.523-63.305-23.344-120.609-74.438-44.586-39.75-74.688-88.844-83.438-103.859-8.75-15-.938-23.125 6.586-30.602 6.734-6.719 15-17.508 22.5-26.266 7.484-8.758 9.984-15.008 14.984-25.008 5-10.016 2.5-18.773-1.25-26.273s-32.898-81.67-46.234-111.326z"/>
86
+ <path fill="#FFF" d="M1036.898 176.091C923.562 62.677 772.859.185 612.297.114 281.43.114 12.172 269.286 12.039 600.137 12 705.896 39.633 809.13 92.156 900.13L7 1211.067l318.203-83.438c87.672 47.812 186.383 73.008 286.836 73.047h.255.003c330.812 0 600.109-269.219 600.25-600.055.055-160.343-62.328-311.108-175.649-424.53zm-424.601 923.242h-.195c-89.539-.047-177.344-24.086-253.93-69.531l-18.227-10.805-188.828 49.508 50.414-184.039-11.875-18.867c-49.945-79.414-76.312-171.188-76.273-265.422.109-274.992 223.906-498.711 499.102-498.711 133.266.055 258.516 52 352.719 146.266 94.195 94.266 146.031 219.578 145.992 352.852-.118 274.999-223.923 498.749-498.899 498.749z"/>
87
+ <title id="altIconTitle">Whatsapp</title>
88
+ </svg>
89
+ </span>
90
+ <div class="clear"></div>
91
+ </button>
92
+ </div>
93
+ <div id="c21-telegram" *ngIf="g?.telegramUsername && g?.telegramUsername.trim() !== ''">
94
+ <button tabindex="1040" aflistconv #aflistconv class="c21-button-primary" (click)="openConversationOnPlatform('telegram')">
95
+ <span class="v-align-center">
96
+ <!-- <svg [ngStyle]="{'fill': 'yellow' }" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
97
+ <path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" [ngStyle]="{'fill': g.themeForegroundColor}"/>
98
+ </svg> -->
99
+ <svg aria-labelledby="altIconTitle" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="26" height="26" viewBox="0 0 368 368" style="enable-background:new 0 0 368 368;" xml:space="preserve">
100
+ <g id="XMLID_1_">
101
+ <linearGradient id="XMLID_7_" gradientUnits="userSpaceOnUse" x1="-66.831" y1="-68.1757" x2="-65.3102" y2="-68.1757" gradientTransform="matrix(-60 139.992 -139.992 -60 -13316.416 5324.4634)">
102
+ <stop offset="0" style="stop-color:#37AEE2"/>
103
+ <stop offset="1" style="stop-color:#1E96C8"/>
104
+ </linearGradient>
105
+ <circle id="XMLID_3_" fill="url(#XMLID_7_)" cx="184" cy="184" r="182.5"/>
106
+ <path id="XMLID_4_" fill="#C8DAEA" d="M150.5,267.6c-5.9,0-4.9-2.2-6.9-7.9l-17.4-57.2L260,123.2"/>
107
+ <path id="XMLID_5_" fill="#A9C9DD" d="M150.5,267.6c4.6,0,6.6-2.1,9.1-4.6l24.3-23.7l-30.4-18.3"/>
108
+ <linearGradient id="XMLID_8_" gradientUnits="userSpaceOnUse" x1="-61.9167" y1="-70.9915" x2="-60.3959" y2="-70.9915" gradientTransform="matrix(24.9894 40.0038 -47.6951 20.9596 -1641.849 4153.2417)">
109
+ <stop offset="0" style="stop-color:#EFF7FC"/>
110
+ <stop offset="1" style="stop-color:#FFFFFF"/>
111
+ </linearGradient>
112
+ <path id="XMLID_6_" fill="url(#XMLID_8_)" d="M153.6,221.1l73.5,54.3c8.4,4.6,14.4,2.2,16.5-7.8l29.9-141.1c3.1-12.3-4.7-17.9-12.7-14.2 L85.2,180.2c-12,4.8-11.9,11.5-2.2,14.5l45.1,14.1l104.4-65.9c4.9-3,9.5-1.4,5.7,1.9"/>
113
+ </g>
114
+ <title id="altIconTitle">Telegram</title>
115
+ </svg>
116
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
117
+ <path [ngStyle]="{'fill': g.themeForegroundColor}" d="M13.92,11.22s-1.22-.6-1.44-.68a.76.76,0,0,0-.27-.06.46.46,0,0,0-.4.24c-.12.17-.48.59-.59.72l-.05,0-.25-.1A6.22,6.22,0,0,1,8.54,9.26l0,0s.05-.06.07-.09l.2-.23.1-.11a1.36,1.36,0,0,0,.19-.31l0-.05a.54.54,0,0,0,0-.52c0-.06-.53-1.27-.58-1.4-.13-.31-.3-.45-.54-.45H7.88a3,3,0,0,0-1,.26,2.08,2.08,0,0,0-.77,1.76A3.78,3.78,0,0,0,7,10.17a.09.09,0,0,0,0,.05,7.81,7.81,0,0,0,3.33,2.89,5.37,5.37,0,0,0,2,.51h0l.32,0h.06a2.13,2.13,0,0,0,1.48-1,1.7,1.7,0,0,0,.09-1.08A.72.72,0,0,0,13.92,11.22Z" transform="translate(-1.83 -1.83)"/>
118
+ <path [ngStyle]="{'fill': g.themeForegroundColor}" d="M10.14,1.83a8,8,0,0,0-8,8,7.86,7.86,0,0,0,1.1,4L1.85,17.89a.19.19,0,0,0,0,.21.21.21,0,0,0,.15.07h.06l4.24-1.35a8,8,0,0,0,11.82-7A8,8,0,0,0,10.14,1.83Zm0,14.27a6.37,6.37,0,0,1-3.49-1,.19.19,0,0,0-.12,0H6.47l-2.12.68.68-2a.22.22,0,0,0,0-.19A6.22,6.22,0,0,1,3.79,9.8a6.36,6.36,0,1,1,6.35,6.3Z" transform="translate(-1.83 -1.83)"/>
119
+ </svg> -->
120
+ </span>
121
+ <div class="clear"></div>
122
+ </button>
123
+ </div>
124
+ <div id="c21-messanger" *ngIf="g?.messangerPageTitle && g?.messangerPageTitle.trim() !== ''">
125
+ <button tabindex="1040" aflistconv #aflistconv class="c21-button-primary" (click)="openConversationOnPlatform('messanger')">
126
+ <span class="v-align-center">
127
+ <!-- <svg [ngStyle]="{'fill': 'yellow' }" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
128
+ <path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" [ngStyle]="{'fill': g.themeForegroundColor}"/>
129
+ </svg> -->
130
+ <svg aria-labelledby="altIconTitle" xmlns="http://www.w3.org/2000/svg" width="26" height="26" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 800 800">
131
+ <radialGradient id="Gradient" cx="101.925" cy="809.0079" r="1.0896" gradientTransform="matrix(800 0 0 -799.9985 -81386 648000.75)" gradientUnits="userSpaceOnUse">
132
+ <stop offset="0" style="stop-color:#0099FF"/>
133
+ <stop offset="0.6098" style="stop-color:#A033FF"/>
134
+ <stop offset="0.9348" style="stop-color:#FF5280"/>
135
+ <stop offset="1" style="stop-color:#FF7061"/>
136
+ </radialGradient>
137
+ <path fill="url(#Gradient)" d="M400,0C174.7,0,0,165.1,0,388c0,116.6,47.8,217.4,125.6,287c6.5,5.8,10.5,14,10.7,22.8l2.2,71.2 c0.7,22.7,24.1,37.5,44.9,28.3l79.4-35c6.7-3,14.3-3.5,21.4-1.6c36.5,10,75.3,15.4,115.8,15.4c225.3,0,400-165.1,400-388 S625.3,0,400,0z"/>
138
+ <path fill="#FFFFFF" d="M159.8,501.5l117.5-186.4c18.7-29.7,58.7-37,86.8-16l93.5,70.1c8.6,6.4,20.4,6.4,28.9-0.1 l126.2-95.8c16.8-12.8,38.8,7.4,27.6,25.3L522.7,484.9c-18.7,29.7-58.7,37-86.8,16l-93.5-70.1c-8.6-6.4-20.4-6.4-28.9,0.1 l-126.2,95.8C170.5,539.5,148.5,519.4,159.8,501.5z"/>
139
+ <title id="altIconTitle">Facebook Messanger</title>
140
+ </svg>
141
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
142
+ <path [ngStyle]="{'fill': g.themeForegroundColor}" d="M13.92,11.22s-1.22-.6-1.44-.68a.76.76,0,0,0-.27-.06.46.46,0,0,0-.4.24c-.12.17-.48.59-.59.72l-.05,0-.25-.1A6.22,6.22,0,0,1,8.54,9.26l0,0s.05-.06.07-.09l.2-.23.1-.11a1.36,1.36,0,0,0,.19-.31l0-.05a.54.54,0,0,0,0-.52c0-.06-.53-1.27-.58-1.4-.13-.31-.3-.45-.54-.45H7.88a3,3,0,0,0-1,.26,2.08,2.08,0,0,0-.77,1.76A3.78,3.78,0,0,0,7,10.17a.09.09,0,0,0,0,.05,7.81,7.81,0,0,0,3.33,2.89,5.37,5.37,0,0,0,2,.51h0l.32,0h.06a2.13,2.13,0,0,0,1.48-1,1.7,1.7,0,0,0,.09-1.08A.72.72,0,0,0,13.92,11.22Z" transform="translate(-1.83 -1.83)"/>
143
+ <path [ngStyle]="{'fill': g.themeForegroundColor}" d="M10.14,1.83a8,8,0,0,0-8,8,7.86,7.86,0,0,0,1.1,4L1.85,17.89a.19.19,0,0,0,0,.21.21.21,0,0,0,.15.07h.06l4.24-1.35a8,8,0,0,0,11.82-7A8,8,0,0,0,10.14,1.83Zm0,14.27a6.37,6.37,0,0,1-3.49-1,.19.19,0,0,0-.12,0H6.47l-2.12.68.68-2a.22.22,0,0,0,0-.19A6.22,6.22,0,0,1,3.79,9.8a6.36,6.36,0,1,1,6.35,6.3Z" transform="translate(-1.83 -1.83)"/>
144
+ </svg> -->
145
+ </span>
146
+ <div class="clear"></div>
147
+ </button>
148
+ </div>
149
+ </div>
70
150
 
71
151
  <!-- FOOTER -->
72
152
  <div class="c21-footer fade-in-bottom-footer">
@@ -198,6 +198,40 @@
198
198
  // }
199
199
  }
200
200
 
201
+ .c21-footer-content{
202
+ position: absolute;
203
+ width: 100%;
204
+ height: 40px; //30px;
205
+ bottom: 40px;
206
+ // left: 0px;
207
+ // right: 0px;
208
+ display: flex;
209
+ align-items: center;
210
+ justify-content: center;
211
+ background-color: white;
212
+ // box-shadow: 0 0px 10px 0px $trasp-light-gray;
213
+ z-index: 20;
214
+ gap: 10px;
215
+ // border-top: 1px solid $trasp-light-gray;
216
+ #c21-whatsapp, #c21-telegram, #c21-messanger{
217
+ .c21-button-primary{
218
+ background-color: transparent;
219
+ color: white;
220
+ margin: 0;
221
+ padding: 5px;
222
+ height: 35px;
223
+ width: 35px;
224
+ display: flex;
225
+ justify-content: center;
226
+
227
+ }
228
+ &:hover svg{
229
+ transform: scale(1.2);
230
+ }
231
+
232
+ }
233
+ }
234
+
201
235
  /********* c21-footer **********/
202
236
  .c21-footer {
203
237
  position: absolute;
@@ -1,4 +1,5 @@
1
1
  import { ElementRef, ViewChild, Component, OnInit, Input, Output, EventEmitter, ViewEncapsulation, SimpleChanges, AfterViewInit } from '@angular/core';
2
+ import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
2
3
  import { ConversationModel } from '../../../chat21-core/models/conversation';
3
4
  import { LoggerService } from '../../../chat21-core/providers/abstract/logger.service';
4
5
  import { LoggerInstance } from '../../../chat21-core/providers/logger/loggerInstance';
@@ -48,13 +49,23 @@ export class HomeComponent implements OnInit, AfterViewInit {
48
49
  private logger: LoggerService = LoggerInstance.getInstance();
49
50
 
50
51
  constructor(
51
- public g: Globals
52
+ public g: Globals,
53
+ private customTranslateService: CustomTranslateService,
52
54
  ) {
53
55
 
54
56
  }
55
57
 
56
58
  ngOnInit() {
57
59
  this.logger.debug('[HOME-COMP] ngOnInit');
60
+ this.initiTranslations()
61
+ }
62
+
63
+ initiTranslations(){
64
+
65
+ let keysHeader = [
66
+ 'BUTTON_CLOSE_TO_ICON'
67
+ ]
68
+ this.translationMapHeader = this.customTranslateService.translateLanguage(keysHeader)
58
69
  }
59
70
 
60
71
  ngAfterViewInit(){
@@ -92,6 +103,17 @@ export class HomeComponent implements OnInit, AfterViewInit {
92
103
  this.onOpenAllConvesations.emit();
93
104
  }
94
105
 
106
+ openConversationOnPlatform(platform: "telegram" | "whatsapp" | "messanger" ){
107
+ if(platform === 'telegram'){
108
+ window.open('https://telegram.me'+this.g.telegramUsername, '_blank')
109
+ }else if(platform === 'whatsapp'){
110
+ window.open('https://wa.me/'+this.g.whatsappNumber, '_blank')
111
+ }else if(platform=== 'messanger'){
112
+ window.open('https://m.me/'+this.g.messangerPageTitle, '_blank')
113
+ }
114
+
115
+ }
116
+
95
117
  onConversationSelectedFN(conversation: ConversationModel) {
96
118
  if(conversation){
97
119
  // rimuovo classe animazione
@@ -27,7 +27,8 @@
27
27
  position: absolute;
28
28
  left: 50px;
29
29
  right: 100px;
30
- display: inline-block;
30
+ display: flex;
31
+ align-items: center;
31
32
  width: auto;
32
33
  height: 42px;
33
34
  padding: 0px;
@@ -9,6 +9,7 @@
9
9
  background-position: center;
10
10
  background-size: cover;
11
11
  overflow-x: hidden;
12
+ overflow-y: hidden;
12
13
  }
13
14
  .c21-ico-schedule {
14
15
  background-image: url("../../../../assets/images/f21ico-schedule.svg");
@@ -44,7 +44,8 @@
44
44
  position: absolute;
45
45
  left: 45px;
46
46
  right: 45px;
47
- display: inline-block;
47
+ display: flex;
48
+ align-items: center;
48
49
  width: auto;
49
50
  height: 1.6em;
50
51
  line-height: 1.6em;
@@ -962,6 +962,11 @@ export class GlobalSettingsService {
962
962
  if (TEMP !== undefined) {
963
963
  globals.singleConversation = (TEMP === true) ? true : false;
964
964
  }
965
+ TEMP = tiledeskSettings['restartConversation'];
966
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > continueConversationBeforeTime:: ', TEMP]);
967
+ if (TEMP !== undefined) {
968
+ globals.restartConversation = (TEMP === true) ? true : false;
969
+ }
965
970
  TEMP = tiledeskSettings['nativeRating'];
966
971
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > nativeRating:: ', TEMP]);
967
972
  if (TEMP !== undefined) {
@@ -994,7 +999,22 @@ export class GlobalSettingsService {
994
999
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > participants:: ', TEMP]);
995
1000
  if (TEMP !== undefined) {
996
1001
  globals.participants = TEMP.split(',').map(key => { return key.trim()});;
997
- }
1002
+ }
1003
+ TEMP = tiledeskSettings['whatsappNumber'];
1004
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > whatsappNumber:: ', TEMP]);
1005
+ if (TEMP !== undefined) {
1006
+ globals.whatsappNumber = TEMP;
1007
+ }
1008
+ TEMP = tiledeskSettings['messangerPageTitle'];
1009
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > messangerPageTitle:: ', TEMP]);
1010
+ if (TEMP !== undefined) {
1011
+ globals.messangerPageTitle = TEMP;
1012
+ }
1013
+ TEMP = tiledeskSettings['telegramUsername'];
1014
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > telegramUsername:: ', TEMP]);
1015
+ if (TEMP !== undefined) {
1016
+ globals.telegramUsername = TEMP;
1017
+ }
998
1018
  }
999
1019
 
1000
1020
  /**
@@ -1226,6 +1246,10 @@ export class GlobalSettingsService {
1226
1246
  if (TEMP !== null) {
1227
1247
  this.globals.singleConversation = (TEMP === true) ? true : false;
1228
1248
  }
1249
+ TEMP = el.nativeElement.getAttribute('restartConversation');
1250
+ if (TEMP !== null) {
1251
+ this.globals.restartConversation = (TEMP === true) ? true : false;;
1252
+ }
1229
1253
  TEMP = el.nativeElement.getAttribute('nativeRating');
1230
1254
  if (TEMP !== null) {
1231
1255
  this.globals.nativeRating = (TEMP === true) ? true : false;
@@ -1653,6 +1677,11 @@ export class GlobalSettingsService {
1653
1677
  globals.singleConversation = stringToBoolean(TEMP);;
1654
1678
  }
1655
1679
 
1680
+ TEMP = getParameterByName(windowContext, 'tiledesk_restartConversation');
1681
+ if (TEMP) {
1682
+ globals.restartConversation = TEMP;
1683
+ }
1684
+
1656
1685
  TEMP = getParameterByName(windowContext, 'tiledesk_nativeRating');
1657
1686
  if (TEMP) {
1658
1687
  globals.nativeRating = stringToBoolean(TEMP);
@@ -210,12 +210,16 @@ export class Globals {
210
210
  buttonHoverBackgroundColor: string // ******* new ********
211
211
  buttonHoverTextColor: string // ******* new ********
212
212
  singleConversation: boolean; // ******* new ********
213
+ restartConversation: boolean; // ******* new ********
213
214
  nativeRating: boolean; // ******* new ********
214
215
  showInfoMessage: Array<string>; // ******* new ********
215
216
  typingLocation: string; // ******* new ********
216
217
  allowReopen: boolean; // ******* new ********
217
218
  continueConversationBeforeTime: number; // ******* new ********
218
219
  participants: Array<string>; // ******* new ********
220
+ whatsappNumber: string; // ******* new ********
221
+ messangerPageTitle: string; // ******* new ********
222
+ telegramUsername: string; // ******* new ********
219
223
  constructor(
220
224
  ) {
221
225
  // console.log(' ---------------- 1: initDefafultParameters ---------------- ');
@@ -377,6 +381,8 @@ export class Globals {
377
381
  /** set the text size of attachment-buttons */
378
382
  this.singleConversation = false;
379
383
  /** set the single conversation mode for the widget */
384
+ this.restartConversation = true;
385
+ /** allow you to always restart a new converazioe */
380
386
  this.nativeRating = true;
381
387
  /** set if native rating componet has to be shown */
382
388
  this.showInfoMessage = 'MEMBER_JOINED_GROUP'.split(',').map(key => { return key.trim()});
@@ -388,7 +394,13 @@ export class Globals {
388
394
  this.continueConversationBeforeTime = 48;
389
395
  /** enable user to continue archived confersation before the value time from last timeout message */
390
396
  this.participants = [];
391
- /** enable user to talk with specific chat-bots/humans */
397
+ /** enable user to talk with specific chat-bots/humans */
398
+ this.whatsappNumber = '';
399
+ /**enable user to set a whatsapp business number to chat with */
400
+ this.messangerPageTitle = ''
401
+ /**enable user to set a facebook messanger page to chat with */
402
+ this.telegramUsername = ''
403
+ /**enable user to set a telegram number to chat with */
392
404
 
393
405
  this.showWaitTime = true;
394
406
 
@@ -538,6 +550,7 @@ export class Globals {
538
550
  'preChatForm': this.preChatForm, 'preChatFormJson': this.preChatFormJson,
539
551
  'projectid': this.projectid,
540
552
  'recipientId': this.recipientId,
553
+ 'restartConversation': this.restartConversation,
541
554
  'singleConversation': this.singleConversation,
542
555
  'showInfoMessage': this.showInfoMessage, 'showAllConversations': this.showAllConversations,
543
556
  'showWaitTime': this.showWaitTime, 'showAvailableAgents': this.showAvailableAgents,
@@ -2,6 +2,7 @@
2
2
  "LABEL_TU": "",
3
3
  "LABEL_PLACEHOLDER": "type your message..",
4
4
  "LABEL_START_NW_CONV": "New conversation",
5
+ "LABEL_WHATSAPP": "Message us",
5
6
  "LABEL_FIRST_MSG": "Describe shortly your problem, you will be contacted by an agent.",
6
7
  "LABEL_FIRST_MSG_NO_AGENTS": "🤔 All operators are offline at the moment. You can anyway describe your problem. It will be assigned to the support team who will answer you as soon as possible.",
7
8
  "LABEL_SELECT_TOPIC": "Select a topic",