@chat21/chat21-web-widget 5.1.0-rc9 → 5.1.0
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 +106 -8
- package/angular.json +2 -2
- package/deploy_beta.sh +10 -0
- package/deploy_prod.sh +9 -0
- package/package.json +2 -2
- package/src/app/app.component.html +7 -1
- package/src/app/app.component.scss +11 -102
- package/src/app/app.component.ts +61 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.html +4 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +70 -7
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +106 -65
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +3 -2
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.scss +7 -15
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +1 -5
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +48 -33
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +13 -8
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +17 -18
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +11 -15
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +54 -17
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +1 -2
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +7 -5
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.scss +0 -3
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +1 -3
- package/src/app/component/form/form-builder/form-builder.component.scss +0 -1
- package/src/app/component/form/inputs/form-text/form-text.component.scss +0 -1
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +0 -1
- package/src/app/component/form/prechat-form/prechat-form.component.scss +1 -3
- package/src/app/component/home/home.component.html +41 -0
- package/src/app/component/home/home.component.scss +34 -8
- package/src/app/component/home/home.component.ts +17 -0
- package/src/app/component/home-conversations/home-conversations.component.scss +0 -3
- package/src/app/component/last-message/last-message.component.html +0 -2
- package/src/app/component/last-message/last-message.component.scss +0 -2
- package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -5
- package/src/app/component/list-conversations/list-conversations.component.scss +0 -2
- package/src/app/component/menu-options/menu-options.component.scss +0 -2
- package/src/app/component/message/audio/audio.component.html +1 -1
- package/src/app/component/message/audio/audio.component.scss +1 -0
- package/src/app/component/message/audio/audio.component.ts +0 -1
- package/src/app/component/message/avatar/avatar.component.scss +4 -4
- package/src/app/component/message/bubble-message/bubble-message.component.html +1 -4
- package/src/app/component/message/bubble-message/bubble-message.component.scss +0 -1
- package/src/app/component/message/bubble-message/bubble-message.component.ts +0 -2
- package/src/app/component/message/buttons/action-button/action-button.component.scss +6 -6
- package/src/app/component/message/buttons/link-button/link-button.component.scss +5 -5
- package/src/app/component/message/buttons/text-button/text-button.component.scss +5 -6
- package/src/app/component/message/carousel/carousel.component.scss +2 -3
- package/src/app/component/message/frame/frame.component.scss +0 -2
- package/src/app/component/message/html/html.component.scss +1 -3
- package/src/app/component/message/image/image.component.scss +0 -2
- package/src/app/component/message/info-message/info-message.component.scss +0 -2
- package/src/app/component/message/like-unlike/like-unlike.component.scss +0 -2
- package/src/app/component/message/text/text.component.html +5 -3
- package/src/app/component/message/text/text.component.scss +2 -4
- package/src/app/component/message/text/text.component.ts +0 -2
- package/src/app/component/message-attachment/message-attachment.component.scss +2 -1
- package/src/app/component/selection-department/selection-department.component.scss +1 -5
- package/src/app/component/star-rating-widget/star-rating-widget.component.scss +0 -7
- package/src/app/pipe/marked.pipe.ts +5 -2
- package/src/app/providers/global-settings.service.ts +108 -9
- package/src/app/sass/_variables.scss +16 -2
- package/src/app/utils/constants.ts +2 -1
- package/src/app/utils/globals.ts +103 -98
- package/src/app/utils/utils.ts +0 -85
- package/src/assets/i18n/en.json +5 -4
- package/src/assets/i18n/es.json +3 -2
- package/src/assets/i18n/fr.json +3 -2
- package/src/assets/i18n/it.json +3 -2
- package/src/assets/twp/chatbot-panel.html +39 -0
- package/src/assets/twp/index-dev.html +177 -121
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +9 -1
- package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +14 -0
- package/src/chat21-core/utils/constants.ts +2 -0
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +0 -1
- package/src/chat21-core/utils/utils-message.ts +12 -1
- package/src/chat21-core/utils/utils.ts +85 -0
- package/src/iframe-style.css +54 -35
|
@@ -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,10 +1382,9 @@
|
|
|
1360
1382
|
console.log('onClickshowAudioRecorderFooterButton:', window.tiledeskSettings)
|
|
1361
1383
|
window.Tiledesk('restart')
|
|
1362
1384
|
}
|
|
1385
|
+
/** WIDGET CONVERSATION DETAIL SECTION : end*/
|
|
1363
1386
|
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1387
|
+
/** WIDGET BUBBLE MESSAGE SECTION : start*/
|
|
1367
1388
|
function onClickFontSize(){
|
|
1368
1389
|
let text = document.getElementById('fontSize').value
|
|
1369
1390
|
text === ""? text= '1.4em': text
|
|
@@ -1372,7 +1393,21 @@
|
|
|
1372
1393
|
window.Tiledesk('restart')
|
|
1373
1394
|
}
|
|
1374
1395
|
|
|
1396
|
+
function onClickFontFamily(){
|
|
1397
|
+
let text = document.getElementById('fontFamily').value
|
|
1398
|
+
window.tiledeskSettings['fontFamily'] = text
|
|
1399
|
+
|
|
1400
|
+
let source = document.getElementById('fontFamilySource').value
|
|
1401
|
+
// text === ""? text= '1.4em': text
|
|
1402
|
+
window.tiledeskSettings['fontFamilySource'] = source
|
|
1403
|
+
|
|
1404
|
+
console.log('onClickFontFamily:',window.tiledeskSettings);
|
|
1405
|
+
window.Tiledesk('restart')
|
|
1406
|
+
}
|
|
1375
1407
|
|
|
1408
|
+
/** WIDGET BUBBLE MESSAGE SECTION : end*/
|
|
1409
|
+
|
|
1410
|
+
/**WIDGET BUTTON STYLE SECTION : start */
|
|
1376
1411
|
function onClickButtonFontSize(){
|
|
1377
1412
|
let text = document.getElementById('buttonFontSize').value
|
|
1378
1413
|
text === ""? text= '15px': text
|
|
@@ -1380,19 +1415,7 @@
|
|
|
1380
1415
|
console.log('onClickButtonFontSize:',window.tiledeskSettings);
|
|
1381
1416
|
window.Tiledesk('restart')
|
|
1382
1417
|
}
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1418
|
+
/**WIDGET BUTTON STYLE SECTION : end */
|
|
1396
1419
|
|
|
1397
1420
|
function onClickTestAll(){
|
|
1398
1421
|
inputs = document.getElementsByTagName('input');
|
|
@@ -1784,6 +1807,78 @@
|
|
|
1784
1807
|
<button class="btn btn-light" onclick="onClickOpenConversationById()">Open conversation <i class="fa-regular fa-comment" aria-hidden="true"></i></button>
|
|
1785
1808
|
</div>
|
|
1786
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-->
|
|
1787
1882
|
<div class="row section c21-parameters">
|
|
1788
1883
|
<div><h3 style="line-height: 0.3;">MANAGE <em><strong>widget settings</strong></em></h3></div>
|
|
1789
1884
|
<div class="docs">Select an option for Tiledesk settings parameter</div>
|
|
@@ -1830,16 +1925,6 @@
|
|
|
1830
1925
|
<button class="btn btn-light" onclick="onClickPreChatForm()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
1831
1926
|
</div>
|
|
1832
1927
|
</div>
|
|
1833
|
-
<div class="row">
|
|
1834
|
-
<div class="col-md-5 formElement"><span><em><strong>align</strong></em></span></div>
|
|
1835
|
-
<div class="col-md-5">
|
|
1836
|
-
<input class="form-check-input" type="radio" name="align" value="left"><label class="form-check-label" for="preChatForm">Left</label>
|
|
1837
|
-
<input class="form-check-input" type="radio" name="align" value="right" checked><label class="form-check-label" for="preChatForm">Right</label>
|
|
1838
|
-
</div>
|
|
1839
|
-
<div class="col-md-2">
|
|
1840
|
-
<button class="btn btn-light" onclick="onClickAlign()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
1841
|
-
</div>
|
|
1842
|
-
</div>
|
|
1843
1928
|
<div class="row">
|
|
1844
1929
|
<div class="col-md-5 formElement"><span><em><strong>calloutTimer</strong></em></span></div>
|
|
1845
1930
|
<div class="col-md-5">
|
|
@@ -1937,8 +2022,6 @@
|
|
|
1937
2022
|
<button class="btn btn-light" onclick="onClickRestartConversation()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
1938
2023
|
</div>
|
|
1939
2024
|
</div>
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
2025
|
<div class="row">
|
|
1943
2026
|
<div class="col-md-5 formElement"><span><em><strong>hideSettings</strong></em></span></div>
|
|
1944
2027
|
<div class="col-md-5">
|
|
@@ -1949,17 +2032,6 @@
|
|
|
1949
2032
|
<button class="btn btn-light" onclick="onClickHideSettings()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
1950
2033
|
</div>
|
|
1951
2034
|
</div>
|
|
1952
|
-
|
|
1953
|
-
<div class="row">
|
|
1954
|
-
<div class="col-md-5 formElement"><span><em><strong>fullscreenMode</strong></em></span></div>
|
|
1955
|
-
<div class="col-md-5">
|
|
1956
|
-
<input class="form-check-input" type="radio" name="fullscreenMode" value="true"><label>True</label>
|
|
1957
|
-
<input class="form-check-input" type="radio" name="fullscreenMode" value="false" checked ><label>False</label>
|
|
1958
|
-
</div>
|
|
1959
|
-
<div class="col-md-2">
|
|
1960
|
-
<button class="btn btn-light" onclick="onClickFullScreenMode()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
1961
|
-
</div>
|
|
1962
|
-
</div>
|
|
1963
2035
|
<div class="row">
|
|
1964
2036
|
<div class="col-md-5 formElement"><span><em><strong>themeColor</strong></em></span></div>
|
|
1965
2037
|
<div class="col-md-5 formElement">
|
|
@@ -1998,42 +2070,6 @@
|
|
|
1998
2070
|
<button class="btn btn-light" onclick="onClickDepartmentId()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
1999
2071
|
</div>
|
|
2000
2072
|
</div>
|
|
2001
|
-
<div class="row">
|
|
2002
|
-
<div class="col-md-5 formElement"><span><em><strong>marginX</strong></em></span></div>
|
|
2003
|
-
<div class="col-md-5 formElement">
|
|
2004
|
-
<input class="form-control col-sm-2" type="text" id="marginX" name="marginX" placeholder="Ex. 100px, 1em">
|
|
2005
|
-
</div>
|
|
2006
|
-
<div class="col-md-2">
|
|
2007
|
-
<button class="btn btn-light" onclick="onClickMarginX()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2008
|
-
</div>
|
|
2009
|
-
</div>
|
|
2010
|
-
<div class="row">
|
|
2011
|
-
<div class="col-md-5 formElement"><span><em><strong>marginY</strong></em></span></div>
|
|
2012
|
-
<div class="col-md-5 formElement">
|
|
2013
|
-
<input class="form-control col-sm-2" type="text" id="marginY" name="marginY" placeholder="Ex. 100px, 1em">
|
|
2014
|
-
</div>
|
|
2015
|
-
<div class="col-md-2 ">
|
|
2016
|
-
<button class="btn btn-light" onclick="onClickMarginY()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2017
|
-
</div>
|
|
2018
|
-
</div>
|
|
2019
|
-
<div class="row">
|
|
2020
|
-
<div class="col-md-5 formElement"><span><em><strong>mobileMarginX</strong></em></span></div>
|
|
2021
|
-
<div class="col-md-5 formElement">
|
|
2022
|
-
<input class="form-control col-sm-2" type="text" id="mobileMarginX" name="mobileMarginX" placeholder="Ex. 100px, 1em">
|
|
2023
|
-
</div>
|
|
2024
|
-
<div class="col-md-2">
|
|
2025
|
-
<button class="btn btn-light" onclick="onClickMobileMarginX()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2026
|
-
</div>
|
|
2027
|
-
</div>
|
|
2028
|
-
<div class="row">
|
|
2029
|
-
<div class="col-md-5 formElement"><span><em><strong>mobileMarginY</strong></em></span></div>
|
|
2030
|
-
<div class="col-md-5 formElement">
|
|
2031
|
-
<input class="form-control col-sm-2" type="text" id="mobileMarginY" name="mobileMarginY" placeholder="Ex. 100px, 1em">
|
|
2032
|
-
</div>
|
|
2033
|
-
<div class="col-md-2 ">
|
|
2034
|
-
<button class="btn btn-light" onclick="onClickMobileMarginY()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2035
|
-
</div>
|
|
2036
|
-
</div>
|
|
2037
2073
|
<div class="row">
|
|
2038
2074
|
<div class="col-md-5 formElement"><span><em><strong>autoStart</strong></em></span></div>
|
|
2039
2075
|
<div class="col-md-5">
|
|
@@ -2247,6 +2283,16 @@
|
|
|
2247
2283
|
|
|
2248
2284
|
|
|
2249
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>
|
|
2250
2296
|
<div class="row">
|
|
2251
2297
|
<div class="col-md-5 formElement"><span><em><strong>hideHeaderCloseButton</strong></em></span></div>
|
|
2252
2298
|
<div class="col-md-5">
|
|
@@ -2455,6 +2501,16 @@
|
|
|
2455
2501
|
<button class="btn btn-light" onclick="onClickFontSize()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2456
2502
|
</div>
|
|
2457
2503
|
</div>
|
|
2504
|
+
<div class="row">
|
|
2505
|
+
<div class="col-md-5 formElement"><span><em><strong>fontFamily</strong></em></span></div>
|
|
2506
|
+
<div class="col-md-5 formElement">
|
|
2507
|
+
<input class="form-control col-sm-2" type="text" id="fontFamily" name="fontFamily" placeholder="Family">
|
|
2508
|
+
<input class="form-control col-sm-2" type="text" id="fontFamilySource" name="fontFamilySource" placeholder="Source">
|
|
2509
|
+
</div>
|
|
2510
|
+
<div class="col-md-2">
|
|
2511
|
+
<button class="btn btn-light" onclick="onClickFontFamily()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2512
|
+
</div>
|
|
2513
|
+
</div>
|
|
2458
2514
|
|
|
2459
2515
|
|
|
2460
2516
|
<div><h3 style="line-height: 0.3;">MANAGE <em><strong>BUTTON STYLES</strong></em></h3></div>
|
|
@@ -15,7 +15,7 @@ import { LoggerService } from '../abstract/logger.service';
|
|
|
15
15
|
import { LoggerInstance } from '../logger/loggerInstance';
|
|
16
16
|
|
|
17
17
|
// utils
|
|
18
|
-
import { MSG_STATUS_RECEIVED, TYPE_DIRECT, MESSAGE_TYPE_INFO, INFO_MESSAGE_TYPE } from '../../utils/constants';
|
|
18
|
+
import { MSG_STATUS_RECEIVED, TYPE_DIRECT, MESSAGE_TYPE_INFO, INFO_MESSAGE_TYPE, MESSAGE_TYPE_PRIVATE } from '../../utils/constants';
|
|
19
19
|
import { compareValues, searchIndexInArrayForUid, conversationMessagesRef } from '../../utils/utils';
|
|
20
20
|
import { v4 as uuidv4 } from 'uuid';
|
|
21
21
|
import { messageType, checkIfIsMemberJoinedGroup, hideInfoMessage, isJustRecived, isSender, infoMessageType } from '../../utils/utils-message';
|
|
@@ -230,6 +230,12 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
230
230
|
private addedNew(message:MessageModel){
|
|
231
231
|
const msg = this.messageCommandGenerate(message);
|
|
232
232
|
if(this.isValidMessage(msg)){
|
|
233
|
+
|
|
234
|
+
// do not add 'private' msg in widget array messages
|
|
235
|
+
let isPrivateMessage = messageType(MESSAGE_TYPE_PRIVATE, msg)
|
|
236
|
+
if(isPrivateMessage){
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
233
239
|
// msg.attributes && msg.attributes['subtype'] === 'info'
|
|
234
240
|
let isInfoMessage = messageType(MESSAGE_TYPE_INFO, msg)
|
|
235
241
|
if(isInfoMessage){
|
|
@@ -464,6 +470,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
464
470
|
const that = this;
|
|
465
471
|
const commands = msg.attributes.commands;
|
|
466
472
|
let i=0;
|
|
473
|
+
if(commands.length === 0) return;
|
|
467
474
|
return new Promise((resolve, reject)=>{
|
|
468
475
|
function execute(command){
|
|
469
476
|
if(command.type === "message"){
|
|
@@ -15,7 +15,7 @@ import { UserModel } from '../../models/user';
|
|
|
15
15
|
import { ConversationHandlerService } from '../abstract/conversation-handler.service';
|
|
16
16
|
|
|
17
17
|
// utils
|
|
18
|
-
import { MSG_STATUS_RECEIVED, TYPE_DIRECT, MESSAGE_TYPE_INFO, INFO_MESSAGE_TYPE } from '../../utils/constants';
|
|
18
|
+
import { MSG_STATUS_RECEIVED, TYPE_DIRECT, MESSAGE_TYPE_INFO, INFO_MESSAGE_TYPE, MESSAGE_TYPE_PRIVATE } from '../../utils/constants';
|
|
19
19
|
import { compareValues, searchIndexInArrayForUid } from '../../utils/utils';
|
|
20
20
|
import { messageType, checkIfIsMemberJoinedGroup, hideInfoMessage, isJustRecived, isSender, infoMessageType } from '../../utils/utils-message';
|
|
21
21
|
import { v4 as uuidv4 } from 'uuid';
|
|
@@ -262,6 +262,13 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
262
262
|
/** */
|
|
263
263
|
private addedMessage(messageSnapshot: MessageModel): Promise<boolean> {
|
|
264
264
|
const msg = this.messageGenerate(messageSnapshot);
|
|
265
|
+
|
|
266
|
+
// do not add 'private' msg in widget array messages
|
|
267
|
+
let isPrivateMessage = messageType(MESSAGE_TYPE_PRIVATE, msg)
|
|
268
|
+
if(isPrivateMessage){
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
|
|
265
272
|
let isInfoMessage = messageType(MESSAGE_TYPE_INFO, msg)
|
|
266
273
|
if(isInfoMessage){
|
|
267
274
|
this.messageInfo.next(msg)
|
|
@@ -458,6 +465,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
458
465
|
const that = this;
|
|
459
466
|
const commands = msg.attributes.commands;
|
|
460
467
|
let i=0;
|
|
468
|
+
if(commands.length === 0) return;
|
|
461
469
|
return new Promise((resolve, reject)=>{
|
|
462
470
|
function execute(command){
|
|
463
471
|
if(command.type === "message"){
|
|
@@ -68,4 +68,18 @@ export class TiledeskRequestsService {
|
|
|
68
68
|
return res
|
|
69
69
|
})
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
public getMyRequests(): Promise<{ requests: Array<any>}> {
|
|
73
|
+
this.tiledeskToken = this.appStorage.getItem('tiledeskToken')
|
|
74
|
+
const url = this.URL_TILEDESK_REQUEST + '/me?preflight=true'
|
|
75
|
+
this.logger.log('[TILEDESK-SERVICE] - GET REQUEST url ', url);
|
|
76
|
+
const httpOptions = {
|
|
77
|
+
headers: new HttpHeaders({
|
|
78
|
+
'Content-Type': 'application/json',
|
|
79
|
+
Authorization: this.tiledeskToken
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return this.http.get<{ requests: Array<any>}>(url, httpOptions).toPromise()
|
|
84
|
+
}
|
|
71
85
|
}
|
|
@@ -71,6 +71,8 @@ export const TYPE_POPUP_DETAIL_MESSAGE = 'DETAIL_MESSAGE';
|
|
|
71
71
|
export const MESSAGE_TYPE_INFO = 'INFO';
|
|
72
72
|
export const MESSAGE_TYPE_MINE = 'MINE';
|
|
73
73
|
export const MESSAGE_TYPE_OTHERS = 'OTHERS';
|
|
74
|
+
export const MESSAGE_TYPE_PRIVATE = 'PRIVATE';
|
|
75
|
+
|
|
74
76
|
|
|
75
77
|
export enum INFO_MESSAGE_TYPE {
|
|
76
78
|
CHAT_REOPENED = 'CHAT_REOPENED',
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
MESSAGE_TYPE_OTHERS,
|
|
8
8
|
MAX_WIDTH_IMAGES,
|
|
9
9
|
INFO_MESSAGE_TYPE,
|
|
10
|
-
CHANNEL_TYPE
|
|
10
|
+
CHANNEL_TYPE,
|
|
11
|
+
MESSAGE_TYPE_PRIVATE
|
|
11
12
|
} from '../../chat21-core/utils/constants';
|
|
12
13
|
/** */
|
|
13
14
|
export function isCarousel(message: any) {
|
|
@@ -103,10 +104,20 @@ export function isFirstMessage(messages, senderId, index):boolean{
|
|
|
103
104
|
return false;
|
|
104
105
|
}
|
|
105
106
|
|
|
107
|
+
export function isPrivate(message: any) {
|
|
108
|
+
if (message && message.attributes && message.attributes.subtype === 'private') {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
|
|
106
114
|
|
|
107
115
|
/** */
|
|
108
116
|
export function messageType(msgType: string, message: any) {
|
|
109
117
|
|
|
118
|
+
if (msgType === MESSAGE_TYPE_PRIVATE) {
|
|
119
|
+
return isPrivate(message);
|
|
120
|
+
}
|
|
110
121
|
if (msgType === MESSAGE_TYPE_INFO) {
|
|
111
122
|
return isInfo(message);
|
|
112
123
|
}
|
|
@@ -579,4 +579,89 @@ function componentFromStr(numStr, percent) {
|
|
|
579
579
|
|
|
580
580
|
|
|
581
581
|
|
|
582
|
+
// export function isAllowedUrlInText(text: string, allowedUrls: string[]): boolean {
|
|
583
|
+
// // Regex per trovare URL o domini nudi nel testo
|
|
584
|
+
// const urlRegex = /https?:\/\/[^\s]+|www\.[^\s]+|(?:\b[\w-]+\.)+[a-z]{2,}(\/[^\s]*)?/gi;
|
|
585
|
+
// const foundUrls = text.match(urlRegex);
|
|
586
|
+
|
|
587
|
+
// if (!foundUrls) {
|
|
588
|
+
// return true; // Nessun URL => testo ammesso
|
|
589
|
+
// }
|
|
590
|
+
|
|
591
|
+
// // Normalizza dominio: rimuove schema, www., slash finali
|
|
592
|
+
// const normalize = (url: string) =>
|
|
593
|
+
// url
|
|
594
|
+
// .replace(/^https?:\/\//i, '')
|
|
595
|
+
// .replace(/^www\./i, '')
|
|
596
|
+
// .replace(/\/$/, '')
|
|
597
|
+
// .toLowerCase();
|
|
598
|
+
|
|
599
|
+
// // Normalizza tutti gli allowed pattern per confronto
|
|
600
|
+
// const normalizedAllowedPatterns = allowedUrls.map(pattern =>
|
|
601
|
+
// pattern
|
|
602
|
+
// .replace(/^https?:\/\//i, '')
|
|
603
|
+
// .replace(/^www\./i, '')
|
|
604
|
+
// .replace(/\/$/, '')
|
|
605
|
+
// .toLowerCase()
|
|
606
|
+
// .replace(/\./g, '\\.')
|
|
607
|
+
// .replace(/\//g, '\\/')
|
|
608
|
+
// .replace(/\*/g, '.*')
|
|
609
|
+
// );
|
|
610
|
+
|
|
611
|
+
// return foundUrls.every(rawUrl => {
|
|
612
|
+
// const url = normalize(rawUrl);
|
|
613
|
+
// return normalizedAllowedPatterns.some(pattern => {
|
|
614
|
+
// const regex = new RegExp(`^${pattern}$`, 'i');
|
|
615
|
+
// return regex.test(url);
|
|
616
|
+
// });
|
|
617
|
+
// });
|
|
618
|
+
// }
|
|
619
|
+
|
|
620
|
+
export function isAllowedUrlInText(text: string, allowedUrls: string[]) {
|
|
621
|
+
const urlsInMessage = extractUrls(text);
|
|
622
|
+
|
|
623
|
+
const allowedPatterns = allowedUrls.map((url) => {
|
|
624
|
+
try {
|
|
625
|
+
// Prova a estrarre il dominio da una URL completa
|
|
626
|
+
const hostname = new URL(url).hostname.toLowerCase();
|
|
627
|
+
return hostname;
|
|
628
|
+
} catch {
|
|
629
|
+
// Lascia il dominio nudo (es: "*.tiledesk.com" o "tiledesk.com")
|
|
630
|
+
return url.toLowerCase();
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
const matchesAllowed = (domain: string) => {
|
|
635
|
+
return allowedPatterns.some((pattern) => {
|
|
636
|
+
if (pattern === '*') {
|
|
637
|
+
return true; //accept all
|
|
638
|
+
}
|
|
639
|
+
if (pattern.startsWith('*.')) {
|
|
640
|
+
const base = pattern.replace(/^\*\./, '');
|
|
641
|
+
return domain === base || domain.endsWith('.' + base);
|
|
642
|
+
} else {
|
|
643
|
+
return domain === pattern;
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
const nonWhitelistedDomains = urlsInMessage.filter((url) => {
|
|
649
|
+
try {
|
|
650
|
+
const domain = new URL(url).hostname.toLowerCase();
|
|
651
|
+
return !matchesAllowed(domain);
|
|
652
|
+
} catch (e) {
|
|
653
|
+
return true; // Considera URL non valido come non ammesso
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
return nonWhitelistedDomains.length === 0;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
function extractUrls(text: string): string[] {
|
|
661
|
+
const urlRegex = /https?:\/\/[^\s]+/g;
|
|
662
|
+
return text.match(urlRegex) || [];
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
582
667
|
|