pager-widget 0.2.1 → 0.2.3
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/App.jsx +104 -50
- package/ConsentPopup.jsx +21 -15
- package/Dropdown.jsx +146 -0
- package/InputConverter.jsx +365 -246
- package/dist/inter.fd2364ba.woff2 +0 -0
- package/dist/lib.js +15 -13
- package/fontStyles.js +9 -19
- package/package.json +1 -1
- package/static/additional.css +28 -9
- package/static/fonts/inter.woff2 +0 -0
- package/useEndpoint.js +11 -0
- package/yarn-error.log +9536 -0
- package/dist/Gordita-Medium.e5d1fa87.woff2 +0 -0
- package/dist/Gordita-Regular.6d2fd269.woff2 +0 -0
package/App.jsx
CHANGED
|
@@ -15,6 +15,7 @@ import useWidgetService from "./useWidgetService";
|
|
|
15
15
|
import InputConverter from "./InputConverter";
|
|
16
16
|
import ConsentPopup from "./ConsentPopup";
|
|
17
17
|
import axios from "axios";
|
|
18
|
+
import { EndPointProvider } from "./useEndpoint";
|
|
18
19
|
|
|
19
20
|
const switchSize = (size, small, medium, large) => {
|
|
20
21
|
// ;
|
|
@@ -77,7 +78,7 @@ const FormHeader = styled.div`
|
|
|
77
78
|
align-items: center;
|
|
78
79
|
width: 100%;
|
|
79
80
|
float: left;
|
|
80
|
-
font-family: "
|
|
81
|
+
font-family: "Inter", "Open Sans";
|
|
81
82
|
font-size: ${(props) => switchSize(props.size, "15px", "20px", "24px")};
|
|
82
83
|
color: #000;
|
|
83
84
|
margin-right: 12px;
|
|
@@ -135,7 +136,7 @@ const ChatWrapper = styled.div`
|
|
|
135
136
|
height: 46px;
|
|
136
137
|
|
|
137
138
|
p{
|
|
138
|
-
font-family:
|
|
139
|
+
font-family: "Inter", "Open Sans";
|
|
139
140
|
font-size: 12px;
|
|
140
141
|
color: #000;
|
|
141
142
|
margin: 0;
|
|
@@ -312,7 +313,7 @@ const ChatContentWrapper = styled.div`
|
|
|
312
313
|
padding: 12px 20px 20px 15px;
|
|
313
314
|
display: block;
|
|
314
315
|
overflow-y: scroll;
|
|
315
|
-
background: #
|
|
316
|
+
background: #FFFFFF;
|
|
316
317
|
overflow-x: hidden;
|
|
317
318
|
box-sizing: border-box;
|
|
318
319
|
// background-position: center;
|
|
@@ -354,14 +355,14 @@ const AssistantChat = styled.div`
|
|
|
354
355
|
// .timestamp {
|
|
355
356
|
// color: #888;
|
|
356
357
|
// font-size: 10px;
|
|
357
|
-
// font-family:
|
|
358
|
+
// font-family: "Inter", "Open Sans";
|
|
358
359
|
// }
|
|
359
360
|
|
|
360
361
|
// .tryit_cards h4 {
|
|
361
362
|
// font-size: 13px;
|
|
362
363
|
// margin-top: 10px;
|
|
363
364
|
// margin-bottom: 0px;
|
|
364
|
-
// font-family:
|
|
365
|
+
// font-family: "Inter", "Open Sans";
|
|
365
366
|
// width: 100%;
|
|
366
367
|
// color: #fff;
|
|
367
368
|
|
|
@@ -773,7 +774,7 @@ const ContentHeader = styled.div`
|
|
|
773
774
|
}
|
|
774
775
|
`;
|
|
775
776
|
const Paragraph = styled.p`
|
|
776
|
-
font-family: "
|
|
777
|
+
font-family: "Inter", "Open Sans";
|
|
777
778
|
margin: 0;
|
|
778
779
|
width: 100%;
|
|
779
780
|
color: #000;
|
|
@@ -809,14 +810,14 @@ const ChatMessage = styled.div`
|
|
|
809
810
|
padding: 12px 10px 8px 16px !important;
|
|
810
811
|
margin-left: 14px;
|
|
811
812
|
margin-top: 14px;
|
|
812
|
-
font-family: "
|
|
813
|
+
font-family: "Inter", "Open Sans";
|
|
813
814
|
white-space: pre-wrap;
|
|
814
815
|
box-sizing: border-box;
|
|
815
816
|
word-break: break-word;
|
|
816
817
|
border-radius: 0px 6px 6px 6px;
|
|
817
818
|
color: #333;
|
|
818
819
|
position: relative;
|
|
819
|
-
background: #
|
|
820
|
+
background: #f2f4f7 0% 0% no-repeat padding-box;
|
|
820
821
|
box-shadow: 0px 3px 5px #00000029;
|
|
821
822
|
border-radius: 0px 10px 10px 10px;
|
|
822
823
|
// font-size: 13px;
|
|
@@ -912,7 +913,7 @@ const ChatMessage = styled.div`
|
|
|
912
913
|
.timestamp {
|
|
913
914
|
color: #888;
|
|
914
915
|
// font-size: 10px;
|
|
915
|
-
font-family: "
|
|
916
|
+
font-family: "Inter", "Open Sans";
|
|
916
917
|
position: relative;
|
|
917
918
|
bottom: 0px;
|
|
918
919
|
text-transform: uppercase;
|
|
@@ -947,7 +948,7 @@ const ChatMessage = styled.div`
|
|
|
947
948
|
|
|
948
949
|
h6 {
|
|
949
950
|
// font-size: 13px;
|
|
950
|
-
font-family: "
|
|
951
|
+
font-family: "Inter", "Open Sans";
|
|
951
952
|
color: #333;
|
|
952
953
|
margin: 0;
|
|
953
954
|
|
|
@@ -976,7 +977,7 @@ const ChatMessage = styled.div`
|
|
|
976
977
|
.chatAssistant_one {
|
|
977
978
|
h6 {
|
|
978
979
|
font-size: 16px;
|
|
979
|
-
font-family: "
|
|
980
|
+
font-family: "Inter", "Open Sans";
|
|
980
981
|
color: #555;
|
|
981
982
|
margin: 16px 0 0;
|
|
982
983
|
font-style: italic;
|
|
@@ -988,7 +989,7 @@ const ChatMessage = styled.div`
|
|
|
988
989
|
li {
|
|
989
990
|
color: #1d48eb;
|
|
990
991
|
font-size: 16px;
|
|
991
|
-
font-family: "
|
|
992
|
+
font-family: "Inter", "Open Sans";
|
|
992
993
|
margin-bottom: 4px;
|
|
993
994
|
a {
|
|
994
995
|
text-decoration: none;
|
|
@@ -1006,24 +1007,24 @@ const ChatMessage = styled.div`
|
|
|
1006
1007
|
|
|
1007
1008
|
.wid_message {
|
|
1008
1009
|
font-size: 16px;
|
|
1009
|
-
font-family: "
|
|
1010
|
+
font-family: "Inter", "Open Sans";
|
|
1010
1011
|
}
|
|
1011
1012
|
`;
|
|
1012
1013
|
|
|
1013
1014
|
const FormMessage = styled.div`
|
|
1014
1015
|
width: 100%;
|
|
1015
1016
|
|
|
1016
|
-
padding: 1px 10px 8px
|
|
1017
|
+
padding: 1px 10px 8px 10px !important;
|
|
1017
1018
|
margin-left: 14px;
|
|
1018
1019
|
margin-top: 20px;
|
|
1019
|
-
font-family: "
|
|
1020
|
+
font-family: "Inter", "Open Sans";
|
|
1020
1021
|
white-space: pre-wrap;
|
|
1021
1022
|
box-sizing: border-box;
|
|
1022
1023
|
word-break: break-word;
|
|
1023
1024
|
border-radius: 0px 6px 6px 6px;
|
|
1024
1025
|
color: #333;
|
|
1025
1026
|
// position: relative;
|
|
1026
|
-
background: #
|
|
1027
|
+
background: #f6f8fa 0% 0% no-repeat padding-box;
|
|
1027
1028
|
box-shadow: 0px 3px 5px #00000029;
|
|
1028
1029
|
border: 1px solid lightgrey;
|
|
1029
1030
|
// border-radius: 0px 10px 10px 10px;
|
|
@@ -1345,7 +1346,7 @@ const MessageBox = styled.div`
|
|
|
1345
1346
|
.timestamp {
|
|
1346
1347
|
color: #888;
|
|
1347
1348
|
font-size: 10px;
|
|
1348
|
-
font-family: "
|
|
1349
|
+
font-family: "Inter", "Open Sans";
|
|
1349
1350
|
|
|
1350
1351
|
@media (min-width: 2160px) {
|
|
1351
1352
|
font-size: ${(props) => switchSize(props.size, "12px", "12px", "16px")};
|
|
@@ -1372,7 +1373,7 @@ const MessageBox = styled.div`
|
|
|
1372
1373
|
font-size: 13px;
|
|
1373
1374
|
margin-top: 10px;
|
|
1374
1375
|
margin-bottom: 0px;
|
|
1375
|
-
font-family: "
|
|
1376
|
+
font-family: "Inter", "Open Sans";
|
|
1376
1377
|
width: 100%;
|
|
1377
1378
|
color: #fff;
|
|
1378
1379
|
|
|
@@ -1402,7 +1403,7 @@ const MessageBox = styled.div`
|
|
|
1402
1403
|
font-size: 12px;
|
|
1403
1404
|
color: #fff;
|
|
1404
1405
|
max-width: 100%;
|
|
1405
|
-
font-family: "
|
|
1406
|
+
font-family: "Inter", "Open Sans";
|
|
1406
1407
|
margin: 0 0 8px 0;
|
|
1407
1408
|
display: flex;
|
|
1408
1409
|
|
|
@@ -1566,7 +1567,7 @@ const MessageBox = styled.div`
|
|
|
1566
1567
|
|
|
1567
1568
|
h6 {
|
|
1568
1569
|
font-size: 13px;
|
|
1569
|
-
font-family: "
|
|
1570
|
+
font-family: "Inter", "Open Sans";
|
|
1570
1571
|
color: #333;
|
|
1571
1572
|
margin: 0;
|
|
1572
1573
|
|
|
@@ -1660,7 +1661,7 @@ const MessageBox = styled.div`
|
|
|
1660
1661
|
font-size: 12px;
|
|
1661
1662
|
width: 35%;
|
|
1662
1663
|
margin: 0;
|
|
1663
|
-
font-family: "
|
|
1664
|
+
font-family: "Inter", "Open Sans";
|
|
1664
1665
|
|
|
1665
1666
|
@media (min-width: 2160px) {
|
|
1666
1667
|
font-size: ${(props) => switchSize(props.size, "16px", "18px", "20px")};
|
|
@@ -1688,7 +1689,7 @@ const MessageBox = styled.div`
|
|
|
1688
1689
|
position: relative;
|
|
1689
1690
|
bottom: 1px;
|
|
1690
1691
|
width: 60%;
|
|
1691
|
-
font-family: "
|
|
1692
|
+
font-family: "Inter", "Open Sans";
|
|
1692
1693
|
margin: 0;
|
|
1693
1694
|
word-break: break-word;
|
|
1694
1695
|
|
|
@@ -1722,7 +1723,6 @@ const FormBox = styled.div`
|
|
|
1722
1723
|
width: 100%;
|
|
1723
1724
|
position: relative;
|
|
1724
1725
|
display: flex;
|
|
1725
|
-
|
|
1726
1726
|
|
|
1727
1727
|
${LogoSize} {
|
|
1728
1728
|
position: absolute;
|
|
@@ -2036,7 +2036,7 @@ const FormBox = styled.div`
|
|
|
2036
2036
|
.timestamp {
|
|
2037
2037
|
color: #888;
|
|
2038
2038
|
font-size: 10px;
|
|
2039
|
-
font-family: "
|
|
2039
|
+
font-family: "'Inter', 'Open Sans'";
|
|
2040
2040
|
|
|
2041
2041
|
@media (min-width: 2160px) {
|
|
2042
2042
|
font-size: ${(props) => switchSize(props.size, "12px", "12px", "16px")};
|
|
@@ -2063,7 +2063,7 @@ const FormBox = styled.div`
|
|
|
2063
2063
|
font-size: 13px;
|
|
2064
2064
|
margin-top: 10px;
|
|
2065
2065
|
margin-bottom: 0px;
|
|
2066
|
-
font-family: "
|
|
2066
|
+
font-family: "'Inter', 'Open Sans'";
|
|
2067
2067
|
width: 100%;
|
|
2068
2068
|
color: #fff;
|
|
2069
2069
|
|
|
@@ -2093,7 +2093,7 @@ const FormBox = styled.div`
|
|
|
2093
2093
|
font-size: 12px;
|
|
2094
2094
|
color: #fff;
|
|
2095
2095
|
max-width: 100%;
|
|
2096
|
-
font-family: "
|
|
2096
|
+
font-family: "'Inter', 'Open Sans'";
|
|
2097
2097
|
margin: 0 0 8px 0;
|
|
2098
2098
|
display: flex;
|
|
2099
2099
|
|
|
@@ -2257,7 +2257,7 @@ const FormBox = styled.div`
|
|
|
2257
2257
|
|
|
2258
2258
|
h6 {
|
|
2259
2259
|
font-size: 13px;
|
|
2260
|
-
font-family: "
|
|
2260
|
+
font-family: "'Inter', 'Open Sans'";
|
|
2261
2261
|
color: #333;
|
|
2262
2262
|
margin: 0;
|
|
2263
2263
|
|
|
@@ -2351,7 +2351,7 @@ const FormBox = styled.div`
|
|
|
2351
2351
|
font-size: 12px;
|
|
2352
2352
|
width: 35%;
|
|
2353
2353
|
margin: 0;
|
|
2354
|
-
font-family: "
|
|
2354
|
+
font-family: "'Inter', 'Open Sans'";
|
|
2355
2355
|
|
|
2356
2356
|
@media (min-width: 2160px) {
|
|
2357
2357
|
font-size: ${(props) => switchSize(props.size, "16px", "18px", "20px")};
|
|
@@ -2379,7 +2379,7 @@ const FormBox = styled.div`
|
|
|
2379
2379
|
position: relative;
|
|
2380
2380
|
bottom: 1px;
|
|
2381
2381
|
width: 60%;
|
|
2382
|
-
font-family: "
|
|
2382
|
+
font-family: "'Inter', 'Open Sans'";
|
|
2383
2383
|
margin: 0;
|
|
2384
2384
|
word-break: break-word;
|
|
2385
2385
|
|
|
@@ -2642,7 +2642,7 @@ const WidgetUpdateButton = styled.div`
|
|
|
2642
2642
|
cursor: pointer;
|
|
2643
2643
|
margin-top: 12px;
|
|
2644
2644
|
font-size: 14px;
|
|
2645
|
-
font-family: "
|
|
2645
|
+
font-family: "Inter";
|
|
2646
2646
|
display: flex;
|
|
2647
2647
|
align-items: center;
|
|
2648
2648
|
padding: 6px 12px;
|
|
@@ -2677,7 +2677,7 @@ export const Button = styled.button`
|
|
|
2677
2677
|
outline: 0;
|
|
2678
2678
|
cursor: pointer;
|
|
2679
2679
|
margin-top: 4px;
|
|
2680
|
-
font-family: "
|
|
2680
|
+
font-family: "Inter";
|
|
2681
2681
|
display: inline-flex;
|
|
2682
2682
|
align-items: center;
|
|
2683
2683
|
padding: 6px 12px;
|
|
@@ -2777,8 +2777,8 @@ const InputMessageChat = styled.div`
|
|
|
2777
2777
|
padding: 8px 16px 4px 16px;
|
|
2778
2778
|
border-top: 1px solid #e5e5e5;
|
|
2779
2779
|
border-bottom: 1px solid #e5e5e5;
|
|
2780
|
-
border-bottom-left-radius:
|
|
2781
|
-
border-bottom-right-radius:
|
|
2780
|
+
border-bottom-left-radius: 0px;
|
|
2781
|
+
border-bottom-right-radius: 0px;
|
|
2782
2782
|
|
|
2783
2783
|
.widget_input_message_section {
|
|
2784
2784
|
display: flex;
|
|
@@ -2806,7 +2806,7 @@ const InputMessageChat = styled.div`
|
|
|
2806
2806
|
border: none;
|
|
2807
2807
|
background-color: transparent;
|
|
2808
2808
|
outline: none;
|
|
2809
|
-
font-family: "
|
|
2809
|
+
font-family: "Inter";
|
|
2810
2810
|
// font-size: 14px !important;
|
|
2811
2811
|
// margin-top: 5px;
|
|
2812
2812
|
// line-height: 20px;
|
|
@@ -3111,7 +3111,7 @@ const ButtonWrapper = styled.div`
|
|
|
3111
3111
|
cursor: pointer;
|
|
3112
3112
|
margin-top: 12px;
|
|
3113
3113
|
font-size: 12px;
|
|
3114
|
-
font-family: "
|
|
3114
|
+
font-family: "Inter";
|
|
3115
3115
|
display: inline-flex;
|
|
3116
3116
|
align-items: center;
|
|
3117
3117
|
padding: 6px 12px;
|
|
@@ -3162,7 +3162,7 @@ const style = {
|
|
|
3162
3162
|
overflowWrap: "break-word",
|
|
3163
3163
|
textAlign: "start",
|
|
3164
3164
|
height: "38px",
|
|
3165
|
-
fontFamily: "
|
|
3165
|
+
fontFamily: "Inter",
|
|
3166
3166
|
};
|
|
3167
3167
|
|
|
3168
3168
|
const App = ({
|
|
@@ -3222,9 +3222,7 @@ const App = ({
|
|
|
3222
3222
|
if (!widget?.id) return; // Prevent API call if widget ID is undefined
|
|
3223
3223
|
|
|
3224
3224
|
axios
|
|
3225
|
-
.get(
|
|
3226
|
-
`http://dev.pagergpt.ai/wgt-hook/public/${widget?.workspace}/${widget.id}/form`
|
|
3227
|
-
)
|
|
3225
|
+
.get(`${endpoint}/public/${widget?.workspace}/${widget.id}/form`)
|
|
3228
3226
|
.then((res) => {
|
|
3229
3227
|
setFields(res.data);
|
|
3230
3228
|
})
|
|
@@ -3256,6 +3254,7 @@ const App = ({
|
|
|
3256
3254
|
exit={exit}
|
|
3257
3255
|
logoshape={style.logo_shape}
|
|
3258
3256
|
/>
|
|
3257
|
+
<EndPointProvider endpoint={endpoint}>
|
|
3259
3258
|
<ChatContentWrapper
|
|
3260
3259
|
size={widget_size}
|
|
3261
3260
|
clsassName="widget_chat_content"
|
|
@@ -3298,8 +3297,8 @@ const App = ({
|
|
|
3298
3297
|
style={{
|
|
3299
3298
|
borderRadius: "50%",
|
|
3300
3299
|
top: "2px",
|
|
3301
|
-
height: "
|
|
3302
|
-
width: "
|
|
3300
|
+
height: "24.9px",
|
|
3301
|
+
width: "24px",
|
|
3303
3302
|
}}
|
|
3304
3303
|
>
|
|
3305
3304
|
<img
|
|
@@ -3318,7 +3317,7 @@ const App = ({
|
|
|
3318
3317
|
<InputConverter
|
|
3319
3318
|
formData={fields}
|
|
3320
3319
|
conversationId={conversationId}
|
|
3321
|
-
|
|
3320
|
+
widget={widget}
|
|
3322
3321
|
workspace={widget?.workspace}
|
|
3323
3322
|
setFormSubmit={setFormSubmit}
|
|
3324
3323
|
setSourceState={setSourceState}
|
|
@@ -3328,6 +3327,7 @@ const App = ({
|
|
|
3328
3327
|
</>
|
|
3329
3328
|
) : null}
|
|
3330
3329
|
</ChatContentWrapper>
|
|
3330
|
+
</EndPointProvider>
|
|
3331
3331
|
<Footer
|
|
3332
3332
|
{...{ sendMessage, onFileUpload }}
|
|
3333
3333
|
widget={widget}
|
|
@@ -3921,7 +3921,7 @@ const ChatHeaderTop = ({ widget, onClick, open, restart, exit, logoshape }) => {
|
|
|
3921
3921
|
</Paragraph>
|
|
3922
3922
|
</ContentHeaderLeft>
|
|
3923
3923
|
<ContentHeaderRight size={scale.widgetSize}>
|
|
3924
|
-
<IconSpan
|
|
3924
|
+
{/* <IconSpan
|
|
3925
3925
|
className="relative restart"
|
|
3926
3926
|
onClick={restart}
|
|
3927
3927
|
style={{ fill: widget.primary_color }}
|
|
@@ -3943,8 +3943,28 @@ const ChatHeaderTop = ({ widget, onClick, open, restart, exit, logoshape }) => {
|
|
|
3943
3943
|
/>
|
|
3944
3944
|
</svg>
|
|
3945
3945
|
<label className="restart_content">Restart Chat</label>
|
|
3946
|
-
</IconSpan>
|
|
3947
|
-
<
|
|
3946
|
+
</IconSpan> */}
|
|
3947
|
+
<div
|
|
3948
|
+
style={{
|
|
3949
|
+
|
|
3950
|
+
display: "flex",
|
|
3951
|
+
gap: "8px",
|
|
3952
|
+
}}
|
|
3953
|
+
>
|
|
3954
|
+
<button
|
|
3955
|
+
onClick={restart}
|
|
3956
|
+
style={{
|
|
3957
|
+
color: `${widget.primary_color}`,
|
|
3958
|
+
background: `${widget.accent_color}`,
|
|
3959
|
+
border: "1px solid white",
|
|
3960
|
+
padding: "6px 12px",
|
|
3961
|
+
borderRadius: "8px",
|
|
3962
|
+
height: "28px"
|
|
3963
|
+
}}
|
|
3964
|
+
>
|
|
3965
|
+
Restart
|
|
3966
|
+
</button>
|
|
3967
|
+
{/* <IconSpan
|
|
3948
3968
|
className="relative close_section"
|
|
3949
3969
|
onClick={exit}
|
|
3950
3970
|
style={{ fill: widget.primary_color }}
|
|
@@ -3964,7 +3984,21 @@ const ChatHeaderTop = ({ widget, onClick, open, restart, exit, logoshape }) => {
|
|
|
3964
3984
|
<path d="M16.8 14.9l4.2-4.2.1-.1c.4-.5.4-1.3-.1-1.7-.5-.4-1.3-.4-1.7.1l-4.2 4.2L10.9 9l-.1-.1c-.2-.2-.5-.3-.9-.3-.3 0-.6.1-.8.4-.3.2-.4.5-.3.8 0 .3.2.6.4.8l4.2 4.2L9.2 19c-.2.2-.4.5-.4.9 0 .7.5 1.2 1.2 1.2.3 0 .6-.1.9-.4l4.2-4.2 4.2 4.2-.1.3h.9c.3 0 .6-.1.9-.4.5-.5.5-1.2 0-1.7l-4.2-4z" />
|
|
3965
3985
|
</svg>
|
|
3966
3986
|
<label className=""> End Chat </label>
|
|
3967
|
-
</IconSpan>
|
|
3987
|
+
</IconSpan> */}
|
|
3988
|
+
<button
|
|
3989
|
+
onClick={exit}
|
|
3990
|
+
style={{
|
|
3991
|
+
color: `${widget.primary_color}`,
|
|
3992
|
+
background: `${widget.accent_color}`,
|
|
3993
|
+
border: "1px solid white",
|
|
3994
|
+
padding: "6px 12px",
|
|
3995
|
+
borderRadius: "8px",
|
|
3996
|
+
height: "28px"
|
|
3997
|
+
}}
|
|
3998
|
+
>
|
|
3999
|
+
Exit
|
|
4000
|
+
</button>
|
|
4001
|
+
</div>
|
|
3968
4002
|
</ContentHeaderRight>
|
|
3969
4003
|
</ContentHeader>
|
|
3970
4004
|
</ChatHeader>
|
|
@@ -3983,6 +4017,7 @@ const AiResponse = ({
|
|
|
3983
4017
|
const scale = useScaleContext();
|
|
3984
4018
|
return (
|
|
3985
4019
|
<>
|
|
4020
|
+
|
|
3986
4021
|
<MessageBox size={scale.widgetSize} className="widget_chat_logs">
|
|
3987
4022
|
<LogoSize style={{ borderRadius: logoshape == "box" ? "5%" : "50%" }}>
|
|
3988
4023
|
<img
|
|
@@ -4044,7 +4079,14 @@ const ChatAssistant = ({
|
|
|
4044
4079
|
return (
|
|
4045
4080
|
<>
|
|
4046
4081
|
<MessageBox size={scale.widgetSize} className="widget_chat_logs">
|
|
4047
|
-
<LogoSize
|
|
4082
|
+
<LogoSize
|
|
4083
|
+
style={{
|
|
4084
|
+
borderRadius: logoshape == "box" ? "5%" : "50%",
|
|
4085
|
+
width: "24.9px",
|
|
4086
|
+
height: "24px",
|
|
4087
|
+
top: "12px",
|
|
4088
|
+
}}
|
|
4089
|
+
>
|
|
4048
4090
|
<img
|
|
4049
4091
|
alt={"logo"}
|
|
4050
4092
|
src={
|
|
@@ -4055,7 +4097,12 @@ const ChatAssistant = ({
|
|
|
4055
4097
|
</LogoSize>
|
|
4056
4098
|
<ChatMessage size={scale.widgetSize}>
|
|
4057
4099
|
<div className="flex widget_title chat_assisitant">
|
|
4058
|
-
<h6
|
|
4100
|
+
<h6 style={{
|
|
4101
|
+
fontWeight: "500",
|
|
4102
|
+
fontSize: "12px",
|
|
4103
|
+
fontStyle: "normal",
|
|
4104
|
+
lineHeight: "18px",
|
|
4105
|
+
}}>{widget && widget.name}</h6>
|
|
4059
4106
|
<div className="timestamp">{formatTimeAMPM(timestamp)}</div>
|
|
4060
4107
|
</div>
|
|
4061
4108
|
{type === "text_with_btns" ? (
|
|
@@ -4066,7 +4113,7 @@ const ChatAssistant = ({
|
|
|
4066
4113
|
<div>
|
|
4067
4114
|
{console.log("output struct", outputStruct.value)}
|
|
4068
4115
|
<AssistantMd mdText={outputStruct.value}></AssistantMd>
|
|
4069
|
-
|
|
4116
|
+
</div>
|
|
4070
4117
|
)}
|
|
4071
4118
|
</ChatMessage>
|
|
4072
4119
|
</MessageBox>
|
|
@@ -4290,7 +4337,14 @@ const UserAssistant = ({
|
|
|
4290
4337
|
className="flex widget_title user_chat"
|
|
4291
4338
|
style={{ color: "#000" }}
|
|
4292
4339
|
>
|
|
4293
|
-
<h6
|
|
4340
|
+
<h6 style={{
|
|
4341
|
+
color:`${widget.user_message_text_color}`,
|
|
4342
|
+
fontSize: "12px",
|
|
4343
|
+
fontStyle: "normal",
|
|
4344
|
+
fontWeight: "500",
|
|
4345
|
+
lineHeight: "18px"
|
|
4346
|
+
|
|
4347
|
+
}}>{SYS_FirstName}</h6>
|
|
4294
4348
|
<div className="timestamp" style={{ color: "#fff", gap: 0 }}>
|
|
4295
4349
|
{formatTimeAMPM(timestamp)}
|
|
4296
4350
|
</div>
|
package/ConsentPopup.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
2
|
import {
|
|
3
3
|
browserName,
|
|
4
4
|
osName,
|
|
@@ -14,6 +14,7 @@ import AssistantMd, {
|
|
|
14
14
|
evalNormalOrJoinText,
|
|
15
15
|
parseUrlAndString,
|
|
16
16
|
} from "./md/assistant_md"
|
|
17
|
+
import { EndPointContext } from "./useEndpoint";
|
|
17
18
|
const ConsentPopup = ({
|
|
18
19
|
formData,
|
|
19
20
|
conversationId,
|
|
@@ -27,15 +28,13 @@ const ConsentPopup = ({
|
|
|
27
28
|
|
|
28
29
|
}) => {
|
|
29
30
|
|
|
30
|
-
const [deviceLocation, setDeviceLocation] = useState(
|
|
31
|
-
lat: "",
|
|
32
|
-
long: "",
|
|
33
|
-
});
|
|
31
|
+
const [deviceLocation, setDeviceLocation] = useState("");
|
|
34
32
|
|
|
35
33
|
// const consentOutput = JSON.parse(widget?.consent_data)
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const endpoint = useContext(EndPointContext)
|
|
36
|
+
console.log("ConsentPopup Endpoint:", endpoint);
|
|
37
|
+
console.log("consent widget", widget?.accent_color)
|
|
39
38
|
const handleCheckboxChange = (event) => {
|
|
40
39
|
setIsVisible(event.target.checked);
|
|
41
40
|
};
|
|
@@ -47,12 +46,18 @@ const ConsentPopup = ({
|
|
|
47
46
|
lat: position.coords.latitude,
|
|
48
47
|
long: position.coords.longitude,
|
|
49
48
|
});
|
|
49
|
+
axios.get(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${position.coords.latitude}&lon=${position.coords.longitude}`).then((res)=> {
|
|
50
|
+
|
|
51
|
+
setDeviceLocation(res.data.address?.country)
|
|
52
|
+
}).catch((err)=> {
|
|
53
|
+
setDeviceLocation("")
|
|
54
|
+
})
|
|
55
|
+
|
|
50
56
|
},
|
|
51
|
-
|
|
52
|
-
console.error("Error getting location:", error.message);
|
|
53
|
-
}
|
|
57
|
+
|
|
54
58
|
);
|
|
55
59
|
} else {
|
|
60
|
+
setDeviceLocation("")
|
|
56
61
|
console.error("Geolocation is not supported by this browser.");
|
|
57
62
|
}
|
|
58
63
|
}, []);
|
|
@@ -77,7 +82,7 @@ const ConsentPopup = ({
|
|
|
77
82
|
|
|
78
83
|
{
|
|
79
84
|
field_id: "SYS_location",
|
|
80
|
-
value:
|
|
85
|
+
value: `${deviceLocation}`,
|
|
81
86
|
},
|
|
82
87
|
// Correctly updated location
|
|
83
88
|
{
|
|
@@ -109,7 +114,7 @@ const ConsentPopup = ({
|
|
|
109
114
|
|
|
110
115
|
axios
|
|
111
116
|
.post(
|
|
112
|
-
|
|
117
|
+
`${endpoint}/${widget.workspace}/${widget.id}/lead`,
|
|
113
118
|
submissionPayload,
|
|
114
119
|
{ withCredentials: true }
|
|
115
120
|
)
|
|
@@ -148,8 +153,9 @@ console.log("url location", window.location.origin)
|
|
|
148
153
|
{console.log("output struct 2", widget.consent_data)}
|
|
149
154
|
<div style={{
|
|
150
155
|
fontSize: "16px",
|
|
151
|
-
fontWeight: "
|
|
156
|
+
fontWeight: "400",
|
|
152
157
|
lineHeight: "24px",
|
|
158
|
+
fontFamily: "Inter, Open Sans"
|
|
153
159
|
|
|
154
160
|
|
|
155
161
|
|
|
@@ -187,9 +193,9 @@ console.log("url location", window.location.origin)
|
|
|
187
193
|
|
|
188
194
|
}}>
|
|
189
195
|
<button
|
|
190
|
-
|
|
196
|
+
|
|
191
197
|
disabled={isVisible == false ? true : false}
|
|
192
|
-
style={{...popupStyles.button, width: "90%"}}
|
|
198
|
+
style={{...popupStyles.button, width: "90%", background:isVisible === false ?"#E2E8F0":widget?.accent_color}}
|
|
193
199
|
onClick={handleSubmit}
|
|
194
200
|
>
|
|
195
201
|
Submit
|