open-chat-studio-widget 0.4.7 → 0.4.8
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/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/{index-c9203be6.js → index-AhSI5tER.js} +329 -238
- package/dist/cjs/index-AhSI5tER.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -5
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js +3941 -3904
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/open-chat-studio-widget.cjs.js +8 -7
- package/dist/cjs/open-chat-studio-widget.cjs.js.map +1 -1
- package/dist/cjs/open-chat-studio-widget.entry.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ocs-chat/ocs-chat.css +36 -0
- package/dist/collection/components/ocs-chat/ocs-chat.js +41 -20
- package/dist/collection/components/ocs-chat/ocs-chat.js.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/open-chat-studio-widget.js +3939 -3900
- package/dist/components/open-chat-studio-widget.js.map +1 -1
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/{index-0349ca51.js → index-DkJ7OJTS.js} +327 -216
- package/dist/esm/index-DkJ7OJTS.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +5 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/open-chat-studio-widget.entry.js +3942 -3903
- package/dist/esm/open-chat-studio-widget.entry.js.map +1 -1
- package/dist/esm/open-chat-studio-widget.js +7 -5
- package/dist/esm/open-chat-studio-widget.js.map +1 -1
- package/dist/open-chat-studio-widget/index.esm.js.map +1 -1
- package/dist/open-chat-studio-widget/loader.esm.js.map +1 -0
- package/dist/open-chat-studio-widget/open-chat-studio-widget.entry.esm.js.map +1 -0
- package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js +1 -1
- package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js.map +1 -1
- package/dist/open-chat-studio-widget/p-DQuL1Twl.js +2 -0
- package/dist/open-chat-studio-widget/p-DQuL1Twl.js.map +1 -0
- package/dist/open-chat-studio-widget/p-DkJ7OJTS.js +3 -0
- package/dist/open-chat-studio-widget/p-DkJ7OJTS.js.map +1 -0
- package/dist/open-chat-studio-widget/p-bde68fbd.entry.js +4 -0
- package/dist/open-chat-studio-widget/p-bde68fbd.entry.js.map +1 -0
- package/dist/types/components/ocs-chat/ocs-chat.d.ts +5 -0
- package/dist/types/components.d.ts +20 -0
- package/dist/types/stencil-public-runtime.d.ts +35 -6
- package/package.json +2 -2
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-c9203be6.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/index-0349ca51.js.map +0 -1
- package/dist/open-chat-studio-widget/p-3dc66a9a.js +0 -3
- package/dist/open-chat-studio-widget/p-3dc66a9a.js.map +0 -1
- package/dist/open-chat-studio-widget/p-6b9a332c.entry.js +0 -4
- package/dist/open-chat-studio-widget/p-6b9a332c.entry.js.map +0 -1
- package/dist/open-chat-studio-widget/p-e1255160.js +0 -2
- package/dist/open-chat-studio-widget/p-e1255160.js.map +0 -1
- package/loader/package.json +0 -11
|
@@ -499,6 +499,39 @@ video {
|
|
|
499
499
|
[hidden]:where(:not([hidden="until-found"])) {
|
|
500
500
|
display: none;
|
|
501
501
|
}
|
|
502
|
+
.container {
|
|
503
|
+
width: 100%;
|
|
504
|
+
}
|
|
505
|
+
@media (min-width: 640px) {
|
|
506
|
+
|
|
507
|
+
.container {
|
|
508
|
+
max-width: 640px;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
@media (min-width: 768px) {
|
|
512
|
+
|
|
513
|
+
.container {
|
|
514
|
+
max-width: 768px;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
@media (min-width: 1024px) {
|
|
518
|
+
|
|
519
|
+
.container {
|
|
520
|
+
max-width: 1024px;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
@media (min-width: 1280px) {
|
|
524
|
+
|
|
525
|
+
.container {
|
|
526
|
+
max-width: 1280px;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
@media (min-width: 1536px) {
|
|
530
|
+
|
|
531
|
+
.container {
|
|
532
|
+
max-width: 1536px;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
502
535
|
#ocs-chat-window {
|
|
503
536
|
z-index: var(--chat-z-index);
|
|
504
537
|
font-size: var(--chat-window-font-size);
|
|
@@ -747,6 +780,7 @@ video {
|
|
|
747
780
|
overflow-y: auto;
|
|
748
781
|
}
|
|
749
782
|
.messages-container::-webkit-scrollbar {
|
|
783
|
+
height: 0.375rem;
|
|
750
784
|
width: 0.375rem;
|
|
751
785
|
}
|
|
752
786
|
.messages-container::-webkit-scrollbar-track {
|
|
@@ -1342,6 +1376,7 @@ textarea {
|
|
|
1342
1376
|
overflow-y: auto;
|
|
1343
1377
|
}
|
|
1344
1378
|
textarea::-webkit-scrollbar {
|
|
1379
|
+
height: 0.375rem;
|
|
1345
1380
|
width: 0.375rem;
|
|
1346
1381
|
}
|
|
1347
1382
|
textarea::-webkit-scrollbar-track {
|
|
@@ -1371,6 +1406,7 @@ textarea::-webkit-scrollbar-thumb:hover {
|
|
|
1371
1406
|
height: var(--loading-spinner-size);
|
|
1372
1407
|
}
|
|
1373
1408
|
.overflow-y-auto::-webkit-scrollbar {
|
|
1409
|
+
height: 0.375rem;
|
|
1374
1410
|
width: 0.375rem;
|
|
1375
1411
|
}
|
|
1376
1412
|
.overflow-y-auto::-webkit-scrollbar-track {
|
|
@@ -509,10 +509,30 @@ export class OcsChat {
|
|
|
509
509
|
// Silently fail for polling
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
|
|
512
|
+
/**
|
|
513
|
+
* Scroll the message container to the bottom.
|
|
514
|
+
* @param forceEnd When `false`, scroll the top of the last message into view.
|
|
515
|
+
* When `true`, scroll all the way to the end of the last message.
|
|
516
|
+
*/
|
|
517
|
+
scrollToBottom(forceEnd = false) {
|
|
513
518
|
setTimeout(() => {
|
|
514
519
|
if (this.messageListRef) {
|
|
515
|
-
|
|
520
|
+
const lastChild = this.messageListRef.lastElementChild;
|
|
521
|
+
if (!forceEnd && lastChild) {
|
|
522
|
+
// scroll so that the top of the last message is in the centre of the message container
|
|
523
|
+
const parentRect = this.messageListRef.getBoundingClientRect();
|
|
524
|
+
const childRect = lastChild.getBoundingClientRect();
|
|
525
|
+
const currentScrollTop = this.messageListRef.scrollTop;
|
|
526
|
+
const childTopRelativeToParent = childRect.top - parentRect.top;
|
|
527
|
+
const targetScroll = currentScrollTop + childTopRelativeToParent - (parentRect.height / 2);
|
|
528
|
+
this.messageListRef.scrollTo({
|
|
529
|
+
top: targetScroll,
|
|
530
|
+
behavior: 'smooth'
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
this.messageListRef.scrollTop = this.messageListRef.scrollHeight;
|
|
535
|
+
}
|
|
516
536
|
}
|
|
517
537
|
}, OcsChat.SCROLL_DELAY_MS);
|
|
518
538
|
}
|
|
@@ -613,6 +633,7 @@ export class OcsChat {
|
|
|
613
633
|
this.pauseMessagePolling();
|
|
614
634
|
}
|
|
615
635
|
else {
|
|
636
|
+
this.scrollToBottom(true);
|
|
616
637
|
this.resumeMessagePolling();
|
|
617
638
|
}
|
|
618
639
|
}
|
|
@@ -939,6 +960,7 @@ export class OcsChat {
|
|
|
939
960
|
return {
|
|
940
961
|
"chatbotId": {
|
|
941
962
|
"type": "string",
|
|
963
|
+
"attribute": "chatbot-id",
|
|
942
964
|
"mutable": false,
|
|
943
965
|
"complexType": {
|
|
944
966
|
"original": "string",
|
|
@@ -953,11 +975,11 @@ export class OcsChat {
|
|
|
953
975
|
},
|
|
954
976
|
"getter": false,
|
|
955
977
|
"setter": false,
|
|
956
|
-
"attribute": "chatbot-id",
|
|
957
978
|
"reflect": false
|
|
958
979
|
},
|
|
959
980
|
"apiBaseUrl": {
|
|
960
981
|
"type": "string",
|
|
982
|
+
"attribute": "api-base-url",
|
|
961
983
|
"mutable": false,
|
|
962
984
|
"complexType": {
|
|
963
985
|
"original": "string",
|
|
@@ -972,12 +994,12 @@ export class OcsChat {
|
|
|
972
994
|
},
|
|
973
995
|
"getter": false,
|
|
974
996
|
"setter": false,
|
|
975
|
-
"attribute": "api-base-url",
|
|
976
997
|
"reflect": false,
|
|
977
998
|
"defaultValue": "\"https://chatbots.dimagi.com\""
|
|
978
999
|
},
|
|
979
1000
|
"buttonText": {
|
|
980
1001
|
"type": "string",
|
|
1002
|
+
"attribute": "button-text",
|
|
981
1003
|
"mutable": false,
|
|
982
1004
|
"complexType": {
|
|
983
1005
|
"original": "string",
|
|
@@ -992,11 +1014,11 @@ export class OcsChat {
|
|
|
992
1014
|
},
|
|
993
1015
|
"getter": false,
|
|
994
1016
|
"setter": false,
|
|
995
|
-
"attribute": "button-text",
|
|
996
1017
|
"reflect": false
|
|
997
1018
|
},
|
|
998
1019
|
"iconUrl": {
|
|
999
1020
|
"type": "string",
|
|
1021
|
+
"attribute": "icon-url",
|
|
1000
1022
|
"mutable": false,
|
|
1001
1023
|
"complexType": {
|
|
1002
1024
|
"original": "string",
|
|
@@ -1011,11 +1033,11 @@ export class OcsChat {
|
|
|
1011
1033
|
},
|
|
1012
1034
|
"getter": false,
|
|
1013
1035
|
"setter": false,
|
|
1014
|
-
"attribute": "icon-url",
|
|
1015
1036
|
"reflect": false
|
|
1016
1037
|
},
|
|
1017
1038
|
"buttonShape": {
|
|
1018
1039
|
"type": "string",
|
|
1040
|
+
"attribute": "button-shape",
|
|
1019
1041
|
"mutable": false,
|
|
1020
1042
|
"complexType": {
|
|
1021
1043
|
"original": "'round' | 'square'",
|
|
@@ -1030,12 +1052,12 @@ export class OcsChat {
|
|
|
1030
1052
|
},
|
|
1031
1053
|
"getter": false,
|
|
1032
1054
|
"setter": false,
|
|
1033
|
-
"attribute": "button-shape",
|
|
1034
1055
|
"reflect": false,
|
|
1035
1056
|
"defaultValue": "'square'"
|
|
1036
1057
|
},
|
|
1037
1058
|
"headerText": {
|
|
1038
1059
|
"type": "string",
|
|
1060
|
+
"attribute": "header-text",
|
|
1039
1061
|
"mutable": false,
|
|
1040
1062
|
"complexType": {
|
|
1041
1063
|
"original": "''",
|
|
@@ -1050,11 +1072,11 @@ export class OcsChat {
|
|
|
1050
1072
|
},
|
|
1051
1073
|
"getter": false,
|
|
1052
1074
|
"setter": false,
|
|
1053
|
-
"attribute": "header-text",
|
|
1054
1075
|
"reflect": false
|
|
1055
1076
|
},
|
|
1056
1077
|
"newChatConfirmationMessage": {
|
|
1057
1078
|
"type": "string",
|
|
1079
|
+
"attribute": "new-chat-confirmation-message",
|
|
1058
1080
|
"mutable": false,
|
|
1059
1081
|
"complexType": {
|
|
1060
1082
|
"original": "string",
|
|
@@ -1069,12 +1091,12 @@ export class OcsChat {
|
|
|
1069
1091
|
},
|
|
1070
1092
|
"getter": false,
|
|
1071
1093
|
"setter": false,
|
|
1072
|
-
"attribute": "new-chat-confirmation-message",
|
|
1073
1094
|
"reflect": false,
|
|
1074
1095
|
"defaultValue": "\"Starting a new chat will clear your current conversation. Continue?\""
|
|
1075
1096
|
},
|
|
1076
1097
|
"visible": {
|
|
1077
1098
|
"type": "boolean",
|
|
1099
|
+
"attribute": "visible",
|
|
1078
1100
|
"mutable": true,
|
|
1079
1101
|
"complexType": {
|
|
1080
1102
|
"original": "boolean",
|
|
@@ -1089,12 +1111,12 @@ export class OcsChat {
|
|
|
1089
1111
|
},
|
|
1090
1112
|
"getter": false,
|
|
1091
1113
|
"setter": false,
|
|
1092
|
-
"attribute": "visible",
|
|
1093
1114
|
"reflect": false,
|
|
1094
1115
|
"defaultValue": "false"
|
|
1095
1116
|
},
|
|
1096
1117
|
"position": {
|
|
1097
1118
|
"type": "string",
|
|
1119
|
+
"attribute": "position",
|
|
1098
1120
|
"mutable": true,
|
|
1099
1121
|
"complexType": {
|
|
1100
1122
|
"original": "'left' | 'center' | 'right'",
|
|
@@ -1109,12 +1131,12 @@ export class OcsChat {
|
|
|
1109
1131
|
},
|
|
1110
1132
|
"getter": false,
|
|
1111
1133
|
"setter": false,
|
|
1112
|
-
"attribute": "position",
|
|
1113
1134
|
"reflect": false,
|
|
1114
1135
|
"defaultValue": "'right'"
|
|
1115
1136
|
},
|
|
1116
1137
|
"welcomeMessages": {
|
|
1117
1138
|
"type": "string",
|
|
1139
|
+
"attribute": "welcome-messages",
|
|
1118
1140
|
"mutable": false,
|
|
1119
1141
|
"complexType": {
|
|
1120
1142
|
"original": "string",
|
|
@@ -1129,11 +1151,11 @@ export class OcsChat {
|
|
|
1129
1151
|
},
|
|
1130
1152
|
"getter": false,
|
|
1131
1153
|
"setter": false,
|
|
1132
|
-
"attribute": "welcome-messages",
|
|
1133
1154
|
"reflect": false
|
|
1134
1155
|
},
|
|
1135
1156
|
"starterQuestions": {
|
|
1136
1157
|
"type": "string",
|
|
1158
|
+
"attribute": "starter-questions",
|
|
1137
1159
|
"mutable": false,
|
|
1138
1160
|
"complexType": {
|
|
1139
1161
|
"original": "string",
|
|
@@ -1148,11 +1170,11 @@ export class OcsChat {
|
|
|
1148
1170
|
},
|
|
1149
1171
|
"getter": false,
|
|
1150
1172
|
"setter": false,
|
|
1151
|
-
"attribute": "starter-questions",
|
|
1152
1173
|
"reflect": false
|
|
1153
1174
|
},
|
|
1154
1175
|
"userId": {
|
|
1155
1176
|
"type": "string",
|
|
1177
|
+
"attribute": "user-id",
|
|
1156
1178
|
"mutable": false,
|
|
1157
1179
|
"complexType": {
|
|
1158
1180
|
"original": "string",
|
|
@@ -1167,11 +1189,11 @@ export class OcsChat {
|
|
|
1167
1189
|
},
|
|
1168
1190
|
"getter": false,
|
|
1169
1191
|
"setter": false,
|
|
1170
|
-
"attribute": "user-id",
|
|
1171
1192
|
"reflect": false
|
|
1172
1193
|
},
|
|
1173
1194
|
"userName": {
|
|
1174
1195
|
"type": "string",
|
|
1196
|
+
"attribute": "user-name",
|
|
1175
1197
|
"mutable": false,
|
|
1176
1198
|
"complexType": {
|
|
1177
1199
|
"original": "string",
|
|
@@ -1186,11 +1208,11 @@ export class OcsChat {
|
|
|
1186
1208
|
},
|
|
1187
1209
|
"getter": false,
|
|
1188
1210
|
"setter": false,
|
|
1189
|
-
"attribute": "user-name",
|
|
1190
1211
|
"reflect": false
|
|
1191
1212
|
},
|
|
1192
1213
|
"persistentSession": {
|
|
1193
1214
|
"type": "boolean",
|
|
1215
|
+
"attribute": "persistent-session",
|
|
1194
1216
|
"mutable": false,
|
|
1195
1217
|
"complexType": {
|
|
1196
1218
|
"original": "boolean",
|
|
@@ -1205,12 +1227,12 @@ export class OcsChat {
|
|
|
1205
1227
|
},
|
|
1206
1228
|
"getter": false,
|
|
1207
1229
|
"setter": false,
|
|
1208
|
-
"attribute": "persistent-session",
|
|
1209
1230
|
"reflect": false,
|
|
1210
1231
|
"defaultValue": "true"
|
|
1211
1232
|
},
|
|
1212
1233
|
"persistentSessionExpire": {
|
|
1213
1234
|
"type": "number",
|
|
1235
|
+
"attribute": "persistent-session-expire",
|
|
1214
1236
|
"mutable": false,
|
|
1215
1237
|
"complexType": {
|
|
1216
1238
|
"original": "number",
|
|
@@ -1225,12 +1247,12 @@ export class OcsChat {
|
|
|
1225
1247
|
},
|
|
1226
1248
|
"getter": false,
|
|
1227
1249
|
"setter": false,
|
|
1228
|
-
"attribute": "persistent-session-expire",
|
|
1229
1250
|
"reflect": false,
|
|
1230
1251
|
"defaultValue": "60 * 24"
|
|
1231
1252
|
},
|
|
1232
1253
|
"allowFullScreen": {
|
|
1233
1254
|
"type": "boolean",
|
|
1255
|
+
"attribute": "allow-full-screen",
|
|
1234
1256
|
"mutable": false,
|
|
1235
1257
|
"complexType": {
|
|
1236
1258
|
"original": "boolean",
|
|
@@ -1245,12 +1267,12 @@ export class OcsChat {
|
|
|
1245
1267
|
},
|
|
1246
1268
|
"getter": false,
|
|
1247
1269
|
"setter": false,
|
|
1248
|
-
"attribute": "allow-full-screen",
|
|
1249
1270
|
"reflect": false,
|
|
1250
1271
|
"defaultValue": "true"
|
|
1251
1272
|
},
|
|
1252
1273
|
"allowAttachments": {
|
|
1253
1274
|
"type": "boolean",
|
|
1275
|
+
"attribute": "allow-attachments",
|
|
1254
1276
|
"mutable": false,
|
|
1255
1277
|
"complexType": {
|
|
1256
1278
|
"original": "boolean",
|
|
@@ -1265,12 +1287,12 @@ export class OcsChat {
|
|
|
1265
1287
|
},
|
|
1266
1288
|
"getter": false,
|
|
1267
1289
|
"setter": false,
|
|
1268
|
-
"attribute": "allow-attachments",
|
|
1269
1290
|
"reflect": false,
|
|
1270
1291
|
"defaultValue": "false"
|
|
1271
1292
|
},
|
|
1272
1293
|
"typingIndicatorText": {
|
|
1273
1294
|
"type": "string",
|
|
1295
|
+
"attribute": "typing-indicator-text",
|
|
1274
1296
|
"mutable": false,
|
|
1275
1297
|
"complexType": {
|
|
1276
1298
|
"original": "string",
|
|
@@ -1285,7 +1307,6 @@ export class OcsChat {
|
|
|
1285
1307
|
},
|
|
1286
1308
|
"getter": false,
|
|
1287
1309
|
"setter": false,
|
|
1288
|
-
"attribute": "typing-indicator-text",
|
|
1289
1310
|
"reflect": false,
|
|
1290
1311
|
"defaultValue": "\"Preparing response\""
|
|
1291
1312
|
}
|