@chat21/chat21-web-widget 5.0.46-rc.2 → 5.0.46-rc.4
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 +7 -0
- package/dist/assets/twp/index-dev.html +16 -0
- package/dist/launch.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.scss +13 -8
- package/src/app/providers/global-settings.service.ts +14 -0
- package/src/app/utils/globals.ts +50 -26
- package/src/assets/twp/index-dev.html +16 -0
- package/src/launch.js +1 -1
package/package.json
CHANGED
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
position: fixed;
|
|
56
56
|
top: var(--margin-top);
|
|
57
57
|
|
|
58
|
-
-webkit-box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.4);
|
|
59
|
-
-moz-box-shadow: 0 3px 5px -3pxrgba(0, 0, 0, 0.4);
|
|
60
|
-
box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.4);
|
|
58
|
+
// -webkit-box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.4);
|
|
59
|
+
// -moz-box-shadow: 0 3px 5px -3pxrgba(0, 0, 0, 0.4);
|
|
60
|
+
// box-shadow: 0 3px 5px -3px rgba(0, 0, 0, 0.4);
|
|
61
61
|
.c21-header-container{
|
|
62
62
|
// height: var(--header-height);
|
|
63
|
-
|
|
63
|
+
height: calc( var(--header-height));
|
|
64
64
|
// margin: inherit;
|
|
65
65
|
|
|
66
66
|
.c21-header-content {
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
.c21-header-button{
|
|
91
|
+
margin: 6px;
|
|
91
92
|
width: 30px;
|
|
92
93
|
height: 30px;
|
|
93
94
|
}
|
|
@@ -104,6 +105,9 @@
|
|
|
104
105
|
width: var(--modal-width);
|
|
105
106
|
height: var(--content-height);
|
|
106
107
|
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
align-items: center;
|
|
107
111
|
// img {
|
|
108
112
|
// border-radius: 8px;
|
|
109
113
|
// //padding: 3px;
|
|
@@ -134,6 +138,7 @@
|
|
|
134
138
|
position: absolute;
|
|
135
139
|
top: 0;
|
|
136
140
|
right: 0;
|
|
141
|
+
|
|
137
142
|
}
|
|
138
143
|
#scroll-me-preview:hover {
|
|
139
144
|
&::-webkit-scrollbar-thumb {
|
|
@@ -151,10 +156,10 @@
|
|
|
151
156
|
|
|
152
157
|
#img-preview-file-extension {
|
|
153
158
|
text-align: center;
|
|
154
|
-
position: relative;
|
|
159
|
+
position: absolute;//relative;
|
|
155
160
|
text-transform: uppercase;
|
|
156
161
|
color: #fff;
|
|
157
|
-
|
|
162
|
+
bottom: 30px; //-25px;
|
|
158
163
|
font-weight: 500;
|
|
159
164
|
}
|
|
160
165
|
}
|
|
@@ -171,7 +176,7 @@
|
|
|
171
176
|
|
|
172
177
|
display: flex;
|
|
173
178
|
gap: 5px;
|
|
174
|
-
padding: var(--paddingTopBottom)
|
|
179
|
+
padding: var(--paddingTopBottom) 10px;
|
|
175
180
|
-webkit-box-sizing: border-box;
|
|
176
181
|
box-sizing: border-box;
|
|
177
182
|
|
|
@@ -244,7 +249,7 @@
|
|
|
244
249
|
border-radius: 10px;
|
|
245
250
|
background-color: $chat-footer-background-color;
|
|
246
251
|
-webkit-box-flex: 1;
|
|
247
|
-
width:
|
|
252
|
+
width: 88%;
|
|
248
253
|
}
|
|
249
254
|
|
|
250
255
|
.chat21-textarea-button {
|
|
@@ -989,6 +989,11 @@ export class GlobalSettingsService {
|
|
|
989
989
|
// this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > continueConversationBeforeTime:: ', TEMP]);
|
|
990
990
|
if (TEMP !== undefined) {
|
|
991
991
|
globals.continueConversationBeforeTime = +TEMP;
|
|
992
|
+
}
|
|
993
|
+
TEMP = tiledeskSettings['participants'];
|
|
994
|
+
// this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > participants:: ', TEMP]);
|
|
995
|
+
if (TEMP !== undefined) {
|
|
996
|
+
globals.participants = TEMP.split(',').map(key => { return key.trim()});;
|
|
992
997
|
}
|
|
993
998
|
}
|
|
994
999
|
|
|
@@ -1244,6 +1249,10 @@ export class GlobalSettingsService {
|
|
|
1244
1249
|
if (TEMP !== null) {
|
|
1245
1250
|
this.globals.continueConversationBeforeTime = +TEMP;
|
|
1246
1251
|
}
|
|
1252
|
+
TEMP = el.nativeElement.getAttribute('participants');
|
|
1253
|
+
if (TEMP !== null) {
|
|
1254
|
+
this.globals.participants = TEMP.split(',').map(key => { return key.trim()});
|
|
1255
|
+
}
|
|
1247
1256
|
|
|
1248
1257
|
}
|
|
1249
1258
|
|
|
@@ -1671,6 +1680,11 @@ export class GlobalSettingsService {
|
|
|
1671
1680
|
if (TEMP) {
|
|
1672
1681
|
globals.continueConversationBeforeTime = +TEMP;
|
|
1673
1682
|
}
|
|
1683
|
+
|
|
1684
|
+
TEMP = getParameterByName(windowContext, 'tiledesk_participants');
|
|
1685
|
+
if (TEMP) {
|
|
1686
|
+
globals.participants = TEMP.split(',').map(key => { return key.trim()});
|
|
1687
|
+
}
|
|
1674
1688
|
}
|
|
1675
1689
|
|
|
1676
1690
|
/**
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -215,6 +215,7 @@ export class Globals {
|
|
|
215
215
|
typingLocation: string; // ******* new ********
|
|
216
216
|
allowReopen: boolean; // ******* new ********
|
|
217
217
|
continueConversationBeforeTime: number; // ******* new ********
|
|
218
|
+
participants: Array<string>; // ******* new ********
|
|
218
219
|
constructor(
|
|
219
220
|
) {
|
|
220
221
|
// console.log(' ---------------- 1: initDefafultParameters ---------------- ');
|
|
@@ -386,6 +387,8 @@ export class Globals {
|
|
|
386
387
|
/** enable the user to reopen a closed conversation */
|
|
387
388
|
this.continueConversationBeforeTime = 48;
|
|
388
389
|
/** enable user to continue archived confersation before the value time from last timeout message */
|
|
390
|
+
this.participants = [];
|
|
391
|
+
/** enable user to talk with specific chat-bots/humans */
|
|
389
392
|
|
|
390
393
|
this.showWaitTime = true;
|
|
391
394
|
|
|
@@ -499,34 +502,55 @@ export class Globals {
|
|
|
499
502
|
*/
|
|
500
503
|
createDefaultSettingsObject() {
|
|
501
504
|
this.default_settings = {
|
|
502
|
-
'
|
|
503
|
-
'
|
|
504
|
-
'
|
|
505
|
-
'
|
|
506
|
-
'
|
|
507
|
-
'lang': this.lang, 'calloutTimer': this.calloutTimer, 'calloutStaus': this.calloutStaus,
|
|
508
|
-
'align': this.align,'welcomeMsg': this.welcomeMsg, 'calloutTitle': this.calloutTitle,
|
|
509
|
-
'calloutMsg': this.calloutMsg, 'fullscreenMode': this.fullscreenMode, 'hideHeaderCloseButton': this.hideHeaderCloseButton,
|
|
510
|
-
'themeColor': this.themeColor, 'themeColorOpacity': this.themeColorOpacity, 'themeForegroundColor': this.themeForegroundColor,
|
|
511
|
-
'allowTranscriptDownload': this.allowTranscriptDownload, //'userToken': this.userToken,
|
|
512
|
-
'autoStart': this.autoStart, 'startHidden': this.startHidden, 'isShown': this.isShown,
|
|
513
|
-
'startFromHome': this.startFromHome, 'logoChat': this.logoChat,
|
|
514
|
-
'welcomeTitle': this.welcomeTitle, 'marginX': this.marginX,
|
|
515
|
-
'marginY': this.marginY, 'lancherWidth': this.launcherWidth, 'lancherHeight': this.launcherHeight,
|
|
516
|
-
'baloonImage': this.baloonImage, 'baloonShape': this.baloonShape, 'isLogEnabled': this.isLogEnabled,
|
|
517
|
-
'openExternalLinkButton': this.openExternalLinkButton, 'hideHeaderConversationOptionsMenu': this.hideHeaderConversationOptionsMenu,
|
|
518
|
-
'hideCloseConversationOptionMenu': this.hideCloseConversationOptionMenu, 'hideRestartConversationOptionsMenu': this.hideRestartConversationOptionsMenu,
|
|
519
|
-
'showInfoMessage': this.showInfoMessage, 'typingLocation': this.typingLocation, 'allowReopen': this.allowReopen,
|
|
520
|
-
'hideSettings': this.hideSettings,'filterByRequester': this.filterByRequester,
|
|
521
|
-
'persistence': this.persistence,'showWaitTime': this.showWaitTime, 'showAvailableAgents': this.showAvailableAgents,
|
|
522
|
-
'showLogoutOption': this.showLogoutOption, 'showAttachmentButton': this.showAttachmentButton,
|
|
523
|
-
'showAllConversations': this.showAllConversations, 'jwt': this.jwt,
|
|
524
|
-
'dynamicWaitTimeReply': this.dynamicWaitTimeReply, 'soundEnabled': this.soundEnabled, 'logLevel': this.logLevel,
|
|
505
|
+
'align': this.align,
|
|
506
|
+
'allowReopen': this.allowReopen,
|
|
507
|
+
'allowTranscriptDownload': this.allowTranscriptDownload,
|
|
508
|
+
'autoStart': this.autoStart,
|
|
509
|
+
'baloonShape': this.baloonShape, 'baloonImage': this.baloonImage,
|
|
525
510
|
'bubbleSentBackground' : this.bubbleSentBackground, 'bubbleSentTextColor': this.bubbleSentTextColor,
|
|
526
511
|
'bubbleReceivedBackground': this.bubbleReceivedBackground, 'bubbleReceivedTextColor': this.bubbleReceivedTextColor,
|
|
527
|
-
'
|
|
528
|
-
'
|
|
529
|
-
'
|
|
512
|
+
'buttonBackgroundColor': this.buttonBackgroundColor, 'buttonTextColor': this.buttonTextColor, 'buttonFontSize': this.buttonFontSize,
|
|
513
|
+
'buttonHoverBackgroundColor': this.buttonHoverBackgroundColor, 'buttonHoverTextColor': this.buttonHoverTextColor,
|
|
514
|
+
'calloutTitle': this.calloutTitle, 'calloutMsg': this.calloutMsg,
|
|
515
|
+
'calloutTimer': this.calloutTimer, 'calloutStaus': this.calloutStaus,
|
|
516
|
+
'channelType': this.channelType,
|
|
517
|
+
'dynamicWaitTimeReply': this.dynamicWaitTimeReply,
|
|
518
|
+
'fontSize': this.fontSize, 'fontFamily': this.fontFamily,
|
|
519
|
+
'fullscreenMode': this.fullscreenMode,
|
|
520
|
+
'filterByRequester': this.filterByRequester,
|
|
521
|
+
'hideHeaderConversationOptionsMenu': this.hideHeaderConversationOptionsMenu, 'hideHeaderCloseButton': this.hideHeaderCloseButton,
|
|
522
|
+
'hideCloseConversationOptionMenu': this.hideCloseConversationOptionMenu, 'hideRestartConversationOptionsMenu': this.hideRestartConversationOptionsMenu,
|
|
523
|
+
'hideSettings': this.hideSettings,
|
|
524
|
+
'isLogEnabled': this.isLogEnabled,
|
|
525
|
+
'isOpen': this.isOpen, 'isShown': this.isShown,
|
|
526
|
+
'jwt': this.jwt,
|
|
527
|
+
'logLevel': this.logLevel,
|
|
528
|
+
'logoChat': this.logoChat,
|
|
529
|
+
'lang': this.lang,
|
|
530
|
+
'lancherWidth': this.launcherWidth, 'lancherHeight': this.launcherHeight,
|
|
531
|
+
'marginX': this.marginX, 'marginY': this.marginY,
|
|
532
|
+
'mobileMarginX': this.mobileMarginX, 'mobileMarginY': this.mobileMarginY,
|
|
533
|
+
'nativeRating': this.nativeRating,
|
|
534
|
+
'openExternalLinkButton': this.openExternalLinkButton,
|
|
535
|
+
'participants':this.participants,
|
|
536
|
+
'persistence': this.persistence,
|
|
537
|
+
'poweredBy': this.poweredBy,
|
|
538
|
+
'preChatForm': this.preChatForm, 'preChatFormJson': this.preChatFormJson,
|
|
539
|
+
'projectid': this.projectid,
|
|
540
|
+
'recipientId': this.recipientId,
|
|
541
|
+
'singleConversation': this.singleConversation,
|
|
542
|
+
'showInfoMessage': this.showInfoMessage, 'showAllConversations': this.showAllConversations,
|
|
543
|
+
'showWaitTime': this.showWaitTime, 'showAvailableAgents': this.showAvailableAgents,
|
|
544
|
+
'showLogoutOption': this.showLogoutOption, 'showAttachmentButton': this.showAttachmentButton,
|
|
545
|
+
'soundEnabled': this.soundEnabled,
|
|
546
|
+
'startHidden': this.startHidden, 'startFromHome': this.startFromHome,
|
|
547
|
+
'tenant': this.tenant,
|
|
548
|
+
'themeColor': this.themeColor, 'themeColorOpacity': this.themeColorOpacity, 'themeForegroundColor': this.themeForegroundColor,
|
|
549
|
+
'typingLocation': this.typingLocation,
|
|
550
|
+
'userEmail': this.userEmail, 'userFullname': this.userFullname,
|
|
551
|
+
'widgetTitle': this.widgetTitle,
|
|
552
|
+
'welcomeMsg': this.welcomeMsg, 'welcomeTitle': this.welcomeTitle,
|
|
553
|
+
|
|
530
554
|
};
|
|
531
555
|
}
|
|
532
556
|
|
|
@@ -1142,6 +1142,13 @@
|
|
|
1142
1142
|
window.Tiledesk('restart')
|
|
1143
1143
|
}
|
|
1144
1144
|
|
|
1145
|
+
function onClickParticipants(){
|
|
1146
|
+
let text = document.getElementById('participants').value
|
|
1147
|
+
window.tiledeskSettings['participants'] = text
|
|
1148
|
+
console.log('onClickParticipants:', window.tiledeskSettings)
|
|
1149
|
+
window.Tiledesk('restart')
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1145
1152
|
function onClickShowAttachmentButton(){
|
|
1146
1153
|
let status = document.querySelector('input[name="showAttachmentButton"]:checked').value
|
|
1147
1154
|
window.tiledeskSettings['showAttachmentButton'] = stringToBoolean(status)
|
|
@@ -2067,6 +2074,15 @@
|
|
|
2067
2074
|
<button class="btn btn-light" onclick="onClickShowInfoMessage()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2068
2075
|
</div>
|
|
2069
2076
|
</div>
|
|
2077
|
+
<div class="row">
|
|
2078
|
+
<div class="col-md-5 formElement"><span><em><strong>participants</strong></em></span></div>
|
|
2079
|
+
<div class="col-md-5">
|
|
2080
|
+
<textarea class="form-control" id="participants" placeholder="Set a comma separated string..." rows="6" cols="30"></textarea>
|
|
2081
|
+
</div>
|
|
2082
|
+
<div class="col-md-2">
|
|
2083
|
+
<button class="btn btn-light" onclick="onClickParticipants()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2084
|
+
</div>
|
|
2085
|
+
</div>
|
|
2070
2086
|
<div class="row">
|
|
2071
2087
|
<div class="col-md-5 formElement"><span><em><strong>showAttachmentButton</strong></em></span></div>
|
|
2072
2088
|
<div class="col-md-5">
|
package/src/launch.js
CHANGED
|
@@ -124,7 +124,7 @@ function loadIframe(tiledeskScriptBaseLocation) {
|
|
|
124
124
|
var httpRequest = createCORSRequest('POST', event_data.detail.appConfigs.apiUrl+event_data.detail.default_settings.projectid+'/events',true); //set async to false because loadParams must return when the get is complete
|
|
125
125
|
httpRequest.setRequestHeader('Content-type', 'application/json');
|
|
126
126
|
httpRequest.setRequestHeader('Authorization',tiledeskToken);
|
|
127
|
-
httpRequest.send(JSON.stringify({"name":"new_conversation","attributes": {"request_id":event_data.detail.newConvId, "department": event_data.detail.global.departmentSelected.id, "language": event_data.detail.global.lang, "subtype":"info", "fullname":event_data.detail.global.attributes.userFullname, "email":event_data.detail.global.attributes.userEmail, "attributes":event_data.detail.global.attributes}}));
|
|
127
|
+
httpRequest.send(JSON.stringify({"name":"new_conversation","attributes": {"request_id":event_data.detail.newConvId, "department": event_data.detail.global.departmentSelected.id, "participants": event_data.detail.global.participants, "language": event_data.detail.global.lang, "subtype":"info", "fullname":event_data.detail.global.attributes.userFullname, "email":event_data.detail.global.attributes.userEmail, "attributes":event_data.detail.global.attributes}}));
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
|