@tellescope/react-components 1.172.0 → 1.172.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/react-components",
3
- "version": "1.172.0",
3
+ "version": "1.172.1",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -84,7 +84,7 @@
84
84
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
85
85
  "react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
86
86
  },
87
- "gitHead": "b415f876ba14e2e77c7ff8d0265e5667b68c6335",
87
+ "gitHead": "91a22b59bb059b03006713f1c20d9746850bfe53",
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  }
@@ -1415,6 +1415,26 @@ export const useTellescopeForm = ({ isPublicForm, form, urlLogicValue, customiza
1415
1415
  })
1416
1416
  .catch(console.error)
1417
1417
  }
1418
+
1419
+ const cbSaveField = fields.find(f => f.id === fieldId && (f.type === 'Chargebee'))
1420
+ if (cbSaveField && typeof value === 'object' && (formResponseId || accessCode)) {
1421
+ session.api.form_responses.save_field_response({
1422
+ accessCode,
1423
+ formResponseId,
1424
+ response: {
1425
+ answer: {
1426
+ type: cbSaveField.type as "Chargebee",
1427
+ value,
1428
+ } as any,
1429
+ fieldId: cbSaveField.id,
1430
+ fieldTitle: cbSaveField.title,
1431
+ externalId: cbSaveField.externalId,
1432
+ fieldDescription: cbSaveField.description,
1433
+ fieldHtmlDescription: cbSaveField.htmlDescription,
1434
+ },
1435
+ })
1436
+ .catch(console.error)
1437
+ }
1418
1438
  }, [fields])
1419
1439
 
1420
1440
  const onAddFile = useCallback((blobs?: FileBlob | FileBlob[], fieldId=activeField.value.id) => {
@@ -3342,9 +3342,7 @@ export const ChargeebeeInput = ({ field, value, onChange, setCustomerId }: FormI
3342
3342
  onChange({ url }, field.id)
3343
3343
  }, [loadCount, url])
3344
3344
 
3345
- if (error && typeof error === 'string') return <Typography color="error">{error}</Typography>
3346
- if (!url) return <LinearProgress />
3347
- if (loadCount === 2) {
3345
+ if (value || loadCount === 2) {
3348
3346
  return (
3349
3347
  <Grid container alignItems="center" wrap="nowrap">
3350
3348
  <CheckCircleOutline color="success" />
@@ -3355,6 +3353,8 @@ export const ChargeebeeInput = ({ field, value, onChange, setCustomerId }: FormI
3355
3353
  </Grid>
3356
3354
  )
3357
3355
  }
3356
+ if (error && typeof error === 'string') return <Typography color="error">{error}</Typography>
3357
+ if (!url) return <LinearProgress />
3358
3358
  return (
3359
3359
  <iframe src={url} title="Checkout" style={{ border: 'none', width: '100%', height: 700 }}
3360
3360
  onLoad={() => setLoadCount(l => l + 1)}