@tellescope/react-components 1.171.0 → 1.171.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.171.0",
3
+ "version": "1.171.1",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -47,13 +47,13 @@
47
47
  "@reduxjs/toolkit": "^1.6.2",
48
48
  "@stripe/react-stripe-js": "^2.9.0",
49
49
  "@stripe/stripe-js": "^1.52.1",
50
- "@tellescope/constants": "^1.171.0",
51
- "@tellescope/sdk": "^1.171.0",
52
- "@tellescope/types-client": "^1.171.0",
53
- "@tellescope/types-models": "^1.171.0",
54
- "@tellescope/types-utilities": "^1.171.0",
55
- "@tellescope/utilities": "^1.171.0",
56
- "@tellescope/validation": "^1.171.0",
50
+ "@tellescope/constants": "^1.171.1",
51
+ "@tellescope/sdk": "^1.171.1",
52
+ "@tellescope/types-client": "^1.171.1",
53
+ "@tellescope/types-models": "^1.171.1",
54
+ "@tellescope/types-utilities": "^1.171.1",
55
+ "@tellescope/utilities": "^1.171.1",
56
+ "@tellescope/validation": "^1.171.1",
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",
@@ -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": "a9948a5ee7adeab6f1c4c56c5f7c67ab21b951be",
87
+ "gitHead": "6909a4e4706eae5a624b226e781893775d20bb42",
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  }
@@ -1290,7 +1290,7 @@ export const useTellescopeForm = ({ isPublicForm, form, urlLogicValue, customiza
1290
1290
  }, [activeField, validateField, uploadingFiles])
1291
1291
 
1292
1292
  const autoAdvanceRef = useRef(false)
1293
- const goToNextField = useCallback(() => {
1293
+ const goToNextField = useCallback((answer?: FormResponseValue['answer']) => {
1294
1294
  if (!currentValue) return
1295
1295
  if (isNextDisabled() && currentValue?.answer.type !== 'Hidden Value') return
1296
1296
 
@@ -1313,7 +1313,10 @@ export const useTellescopeForm = ({ isPublicForm, form, urlLogicValue, customiza
1313
1313
  session.api.form_responses.save_field_response({
1314
1314
  accessCode,
1315
1315
  formResponseId,
1316
- response: currentValue,
1316
+ response: {
1317
+ ...currentValue,
1318
+ answer: answer || currentValue.answer
1319
+ },
1317
1320
  })
1318
1321
  .catch(console.error)
1319
1322
  }
@@ -3073,7 +3073,9 @@ export const HiddenValueInput = ({ goToNextField, goToPreviousField, field, valu
3073
3073
  goToPreviousField?.()
3074
3074
  } else {
3075
3075
  onChange(field.title, field.id)
3076
- goToNextField?.()
3076
+ console.log('going to next field for hidden value', field.title, !!goToNextField)
3077
+ // pass value that is set after above onChange
3078
+ goToNextField?.({ type: 'Hidden Value', value: field.title })
3077
3079
  }
3078
3080
  }, [value, onChange, field, goToNextField, goToPreviousField, isSinglePage])
3079
3081
 
@@ -1,9 +1,8 @@
1
- import { AnswerForType } from "@tellescope/types-models";
1
+ import { AnswerForType, FormResponseValue } from "@tellescope/types-models";
2
2
  import { DatabaseRecord, Enduser, Form, FormField } from "@tellescope/types-client";
3
3
  import { FileBlob, TreeNode } from "@tellescope/types-utilities";
4
4
  import { JSXElementConstructor } from "react";
5
5
  import { Response } from "./hooks";
6
- import { FileUploadHandler } from "../inputs";
7
6
 
8
7
  export type FormFieldNode = TreeNode<FormField>
9
8
 
@@ -24,7 +23,7 @@ export interface FormInputProps<K extends keyof AnswerForType> {
24
23
  enduserId?: string,
25
24
  enduser?: Partial<Enduser>
26
25
  goToPreviousField?: () => void,
27
- goToNextField?: () => void,
26
+ goToNextField?: (response?: FormResponseValue['answer']) => void,
28
27
  isPreviousDisabled?: () => boolean,
29
28
  formResponseId?: string,
30
29
  rootResponseId?: string,