File tree Expand file tree Collapse file tree 9 files changed +24
-15
lines changed Expand file tree Collapse file tree 9 files changed +24
-15
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @typebot.io/js" ,
3
- "version" : " 0.2.61 " ,
3
+ "version" : " 0.2.62 " ,
4
4
"description" : " Javascript library to display typebots on your website" ,
5
5
"type" : " module" ,
6
6
"main" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ export const EmailInput = (props: Props) => {
23
23
inputRef ?. value !== '' && inputRef ?. reportValidity ( )
24
24
25
25
const submit = ( ) => {
26
- if ( checkIfInputIsValid ( ) ) props . onSubmit ( { value : inputValue ( ) } )
26
+ if ( checkIfInputIsValid ( ) )
27
+ props . onSubmit ( { value : inputRef ?. value ?? inputValue ( ) } )
27
28
else inputRef ?. focus ( )
28
29
}
29
30
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export const NumberInput = (props: NumberInputProps) => {
27
27
28
28
const submit = ( ) => {
29
29
if ( checkIfInputIsValid ( ) )
30
- props . onSubmit ( { value : inputValue ( ) . toString ( ) } )
30
+ props . onSubmit ( { value : inputRef ?. value ?? inputValue ( ) . toString ( ) } )
31
31
else inputRef ?. focus ( )
32
32
}
33
33
Original file line number Diff line number Diff line change @@ -63,13 +63,14 @@ export const PhoneInput = (props: PhoneInputProps) => {
63
63
const selectedCountryDialCode = phoneCountries . find (
64
64
( country ) => country . code === selectedCountryCode ( )
65
65
) ?. dial_code
66
- if ( checkIfInputIsValid ( ) )
66
+ if ( checkIfInputIsValid ( ) ) {
67
+ const val = inputRef ?. value ?? inputValue ( )
67
68
props . onSubmit ( {
68
- value : inputValue ( ) . startsWith ( '+' )
69
- ? inputValue ( )
70
- : `${ selectedCountryDialCode ?? '' } ${ inputValue ( ) } ` ,
69
+ value : val . startsWith ( '+' )
70
+ ? val
71
+ : `${ selectedCountryDialCode ?? '' } ${ val } ` ,
71
72
} )
72
- else inputRef ?. focus ( )
73
+ } else inputRef ?. focus ( )
73
74
}
74
75
75
76
const submitWhenEnter = ( e : KeyboardEvent ) => {
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ export const TextInput = (props: Props) => {
23
23
inputRef ?. value !== '' && inputRef ?. reportValidity ( )
24
24
25
25
const submit = ( ) => {
26
- if ( checkIfInputIsValid ( ) ) props . onSubmit ( { value : inputValue ( ) } )
26
+ if ( checkIfInputIsValid ( ) )
27
+ props . onSubmit ( { value : inputRef ?. value ?? inputValue ( ) } )
27
28
else inputRef ?. focus ( )
28
29
}
29
30
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ export const UrlInput = (props: Props) => {
29
29
inputRef ?. value !== '' && inputRef ?. reportValidity ( )
30
30
31
31
const submit = ( ) => {
32
- if ( checkIfInputIsValid ( ) ) props . onSubmit ( { value : inputValue ( ) } )
32
+ if ( checkIfInputIsValid ( ) )
33
+ props . onSubmit ( { value : inputRef ?. value ?? inputValue ( ) } )
33
34
else inputRef ?. focus ( )
34
35
}
35
36
Original file line number Diff line number Diff line change @@ -25,8 +25,13 @@ export const guessApiHost = (
25
25
return chatApiUrl
26
26
}
27
27
28
- return (
29
- getRuntimeVariable ( 'NEXT_PUBLIC_VIEWER_URL' ) ?. split ( ',' ) [ 0 ] ??
30
- chatApiCloudFallbackHost
28
+ const viewerUrls = getRuntimeVariable ( 'NEXT_PUBLIC_VIEWER_URL' ) ?. split (
29
+ ','
30
+ ) as string [ ] | undefined
31
+
32
+ const matchedUrl = viewerUrls ?. find ( ( url ) =>
33
+ window . ___location . href . startsWith ( url )
31
34
)
35
+
36
+ return matchedUrl ?? chatApiCloudFallbackHost
32
37
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @typebot.io/nextjs" ,
3
- "version" : " 0.2.61 " ,
3
+ "version" : " 0.2.62 " ,
4
4
"description" : " Convenient library to display typebots on your Next.js website" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @typebot.io/react" ,
3
- "version" : " 0.2.61 " ,
3
+ "version" : " 0.2.62 " ,
4
4
"description" : " Convenient library to display typebots on your React app" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
You can’t perform that action at this time.
0 commit comments