@tellescope/react-components 1.148.1 → 1.150.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/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +10 -3
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/esm/CMS/components.d.ts +1 -0
- package/lib/esm/CMS/components.d.ts.map +1 -1
- package/lib/esm/Forms/forms.d.ts +3 -3
- package/lib/esm/Forms/inputs.d.ts +1 -1
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +11 -4
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/Forms/inputs.native.d.ts +1 -0
- package/lib/esm/Forms/inputs.native.d.ts.map +1 -1
- package/lib/esm/controls.d.ts +2 -2
- package/lib/esm/inputs.d.ts +1 -1
- package/lib/esm/inputs.native.d.ts +1 -0
- package/lib/esm/inputs.native.d.ts.map +1 -1
- package/lib/esm/layout.d.ts +1 -1
- package/lib/esm/state.d.ts +252 -252
- package/lib/esm/theme.native.d.ts +1 -0
- package/lib/esm/theme.native.d.ts.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/Forms/inputs.tsx +16 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.150.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"@mui/icons-material": "^5.0.1",
|
|
46
46
|
"@mui/material": "^5.0.2",
|
|
47
47
|
"@reduxjs/toolkit": "^1.6.2",
|
|
48
|
-
"@stripe/react-stripe-js": "^2.
|
|
48
|
+
"@stripe/react-stripe-js": "^2.9.0",
|
|
49
49
|
"@stripe/stripe-js": "^1.52.1",
|
|
50
|
-
"@tellescope/constants": "^1.
|
|
51
|
-
"@tellescope/sdk": "^1.
|
|
52
|
-
"@tellescope/types-client": "^1.
|
|
53
|
-
"@tellescope/types-models": "^1.
|
|
54
|
-
"@tellescope/types-utilities": "^1.
|
|
55
|
-
"@tellescope/utilities": "^1.
|
|
56
|
-
"@tellescope/validation": "^1.
|
|
50
|
+
"@tellescope/constants": "^1.150.0",
|
|
51
|
+
"@tellescope/sdk": "^1.150.0",
|
|
52
|
+
"@tellescope/types-client": "^1.150.0",
|
|
53
|
+
"@tellescope/types-models": "^1.150.0",
|
|
54
|
+
"@tellescope/types-utilities": "^1.150.0",
|
|
55
|
+
"@tellescope/utilities": "^1.150.0",
|
|
56
|
+
"@tellescope/validation": "^1.150.0",
|
|
57
57
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
58
58
|
"@typescript-eslint/parser": "^4.33.0",
|
|
59
59
|
"css-to-react-native": "^3.0.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
81
81
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "1746b2c4cfc5907edd752c62b9bb65befc9ac3dc",
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
}
|
package/src/Forms/inputs.tsx
CHANGED
|
@@ -21,9 +21,9 @@ import heic2any from "heic2any"
|
|
|
21
21
|
import AddPhotoAlternateIcon from '@mui/icons-material/AddPhotoAlternate';
|
|
22
22
|
import LanguageIcon from '@mui/icons-material/Language';
|
|
23
23
|
|
|
24
|
-
import { Elements, PaymentElement, useStripe, useElements } from '@stripe/react-stripe-js';
|
|
24
|
+
import { Elements, PaymentElement, useStripe, useElements, EmbeddedCheckout, EmbeddedCheckoutProvider } from '@stripe/react-stripe-js';
|
|
25
25
|
import { loadStripe } from '@stripe/stripe-js';
|
|
26
|
-
import { CheckCircleOutline, Delete, Edit
|
|
26
|
+
import { CheckCircleOutline, Delete, Edit } from "@mui/icons-material"
|
|
27
27
|
|
|
28
28
|
export const LanguageSelect = ({ value, ...props }: { value: string, onChange: (s: string) => void}) => (
|
|
29
29
|
<Grid container alignItems="center" justifyContent={"center"} wrap="nowrap" spacing={1}>
|
|
@@ -1420,6 +1420,7 @@ export const StripeInput = ({ field, value, onChange, setCustomerId }: FormInput
|
|
|
1420
1420
|
const session = useResolvedSession()
|
|
1421
1421
|
const [clientSecret, setClientSecret] = useState('')
|
|
1422
1422
|
const [businessName, setBusinessName] = useState('')
|
|
1423
|
+
const [isCheckout, setIsCheckout] = useState(false)
|
|
1423
1424
|
const [stripePromise, setStripePromise] = useState<ReturnType<typeof loadStripe>>()
|
|
1424
1425
|
const [, { findById: findProduct }] = useProducts({ dontFetch: true })
|
|
1425
1426
|
|
|
@@ -1432,7 +1433,8 @@ export const StripeInput = ({ field, value, onChange, setCustomerId }: FormInput
|
|
|
1432
1433
|
fetchRef.current = true
|
|
1433
1434
|
|
|
1434
1435
|
session.api.form_responses.stripe_details({ fieldId: field.id })
|
|
1435
|
-
.then(({ clientSecret, publishableKey, stripeAccount, businessName, customerId }) => {
|
|
1436
|
+
.then(({ clientSecret, publishableKey, stripeAccount, businessName, customerId, isCheckout }) => {
|
|
1437
|
+
setIsCheckout(!!isCheckout)
|
|
1436
1438
|
setClientSecret(clientSecret)
|
|
1437
1439
|
setStripePromise(loadStripe(publishableKey, { stripeAccount }))
|
|
1438
1440
|
setBusinessName(businessName)
|
|
@@ -1448,7 +1450,7 @@ export const StripeInput = ({ field, value, onChange, setCustomerId }: FormInput
|
|
|
1448
1450
|
|
|
1449
1451
|
if (value) {
|
|
1450
1452
|
return (
|
|
1451
|
-
<Grid container
|
|
1453
|
+
<Grid container alignItems="center" wrap="nowrap">
|
|
1452
1454
|
<CheckCircleOutline color="success" />
|
|
1453
1455
|
|
|
1454
1456
|
<Typography sx={{ ml: 1, fontSize: 20 }}>
|
|
@@ -1458,6 +1460,16 @@ export const StripeInput = ({ field, value, onChange, setCustomerId }: FormInput
|
|
|
1458
1460
|
)
|
|
1459
1461
|
}
|
|
1460
1462
|
if (!(clientSecret && stripePromise)) return <LinearProgress />
|
|
1463
|
+
if (isCheckout && stripePromise) return (
|
|
1464
|
+
<EmbeddedCheckoutProvider stripe={stripePromise}
|
|
1465
|
+
options={{
|
|
1466
|
+
clientSecret,
|
|
1467
|
+
onComplete: () => onChange('Completed checkout', field.id),
|
|
1468
|
+
}}
|
|
1469
|
+
>
|
|
1470
|
+
<EmbeddedCheckout />
|
|
1471
|
+
</EmbeddedCheckoutProvider>
|
|
1472
|
+
)
|
|
1461
1473
|
return (
|
|
1462
1474
|
<Elements stripe={stripePromise} options={{
|
|
1463
1475
|
clientSecret,
|