@tellescope/react-components 1.242.7 → 1.242.9

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.242.7",
3
+ "version": "1.242.9",
4
4
  "description": "",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -36,7 +36,11 @@
36
36
  "@types/react-dom": "17.0.18",
37
37
  "@types/react-native": "0.65.27",
38
38
  "@types/react-window": "1.8.5",
39
+ "@typescript-eslint/eslint-plugin": "4.33.0",
40
+ "@typescript-eslint/parser": "4.33.0",
39
41
  "babel-loader": "8.4.1",
42
+ "eslint": "7.32.0",
43
+ "eslint-plugin-react": "7.31.11",
40
44
  "react-native": "0.68.0",
41
45
  "typescript": "4.9.3"
42
46
  },
@@ -47,20 +51,16 @@
47
51
  "@reduxjs/toolkit": "1.9.0",
48
52
  "@stripe/react-stripe-js": "2.9.0",
49
53
  "@stripe/stripe-js": "1.52.1",
50
- "@tellescope/constants": "1.242.7",
51
- "@tellescope/sdk": "1.242.7",
52
- "@tellescope/types-client": "1.242.7",
53
- "@tellescope/types-models": "1.242.7",
54
- "@tellescope/types-utilities": "1.242.7",
55
- "@tellescope/utilities": "1.242.7",
56
- "@tellescope/validation": "1.242.7",
57
- "@typescript-eslint/eslint-plugin": "4.33.0",
58
- "@typescript-eslint/parser": "4.33.0",
54
+ "@tellescope/constants": "1.242.9",
55
+ "@tellescope/sdk": "1.242.9",
56
+ "@tellescope/types-client": "1.242.9",
57
+ "@tellescope/types-models": "1.242.9",
58
+ "@tellescope/types-utilities": "1.242.9",
59
+ "@tellescope/utilities": "1.242.9",
60
+ "@tellescope/validation": "1.242.9",
59
61
  "css-to-react-native": "3.0.0",
60
62
  "draft-js": "0.11.7",
61
63
  "draftjs-to-html": "0.9.1",
62
- "eslint": "7.32.0",
63
- "eslint-plugin-react": "7.31.11",
64
64
  "formik": "2.2.9",
65
65
  "heic2any": "0.0.4",
66
66
  "html-to-draftjs": "1.5.0",
@@ -84,7 +84,7 @@
84
84
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.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": "59f8a434d6e3132e05be51c1d956b81865338ff8",
87
+ "gitHead": "fd7946e8dfa03c32847d09ce66d01ef35b188d74",
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  }
@@ -9,14 +9,15 @@ import { FormResponseAnswerFileValue, OrganizationTheme } from "@tellescope/type
9
9
  import { calculate_form_scoring, field_can_autosubmit, form_response_value_to_string, formatted_date, object_is_empty, objects_equivalent, read_local_storage, remove_script_tags, responses_satisfy_conditions, truncate_string } from "@tellescope/utilities"
10
10
  import { Divider } from "@mui/material"
11
11
 
12
- export const TellescopeFormContainer = ({ businessId, organizationIds, ...props } : {
13
- businessId?: string,
14
- organizationIds?: string[],
12
+ export const TellescopeFormContainer = ({ businessId, organizationIds, ...props } : {
13
+ businessId?: string,
14
+ organizationIds?: string[],
15
15
  dontAddContext?: boolean,
16
- children: React.ReactNode,
16
+ children: React.ReactNode,
17
17
  hideBg?: boolean,
18
18
  backgroundColor?: string,
19
19
  hideLogo?: boolean,
20
+ logoURL?: string,
20
21
  logoHeight?: number,
21
22
  language?: string,
22
23
  onChangeLanguage?: (l: string) => void,
@@ -35,17 +36,19 @@ export const TellescopeFormContainer = ({ businessId, organizationIds, ...props
35
36
  )
36
37
  }
37
38
 
38
- const TellescopeFormContainerWithTheme: typeof TellescopeFormContainer = ({ paperMinHeight=575, children, language, onChangeLanguage, style, hideBg, backgroundColor, hideLogo, logoHeight, maxWidth }) => {
39
+ const TellescopeFormContainerWithTheme: typeof TellescopeFormContainer = ({ paperMinHeight=575, children, language, onChangeLanguage, style, hideBg, backgroundColor, hideLogo, logoURL, logoHeight, maxWidth }) => {
39
40
  const theme = useOrganizationTheme()
40
41
 
42
+ const resolvedLogoURL = logoURL || theme.logoURL
43
+
41
44
  const formContent = (
42
45
  <Flex flex={1} column>
43
46
  {hideLogo
44
47
  ? null
45
- : theme.logoURL
48
+ : resolvedLogoURL
46
49
  ? (
47
50
  <Flex alignItems="center" justifyContent={"center"} style={{ height: logoHeight || LOGO_HEIGHT, marginTop: 10 }}>
48
- <img src={theme.logoURL} alt={theme.name} style={{ height: logoHeight || LOGO_HEIGHT, maxWidth: 225 }} /> {/* todo: replace with something that resolves better for native */}
51
+ <img src={resolvedLogoURL} alt={theme.name} style={{ height: logoHeight || LOGO_HEIGHT, maxWidth: 225 }} /> {/* todo: replace with something that resolves better for native */}
49
52
  </Flex>
50
53
  )
51
54
  : (
@@ -801,6 +804,7 @@ const TellescopeFormWithContext: typeof TellescopeForm = (props) => {
801
804
  return (
802
805
  <TellescopeFormContainer style={props.style} dontAddContext
803
806
  hideBg={props.hideBg || props.form?.customization?.hideBg}
807
+ logoURL={props.form?.customization?.logoURL}
804
808
  logoHeight={props.logoHeight}
805
809
  backgroundColor={props.backgroundColor}
806
810
  hideLogo={props?.customization?.hideLogo}
@@ -9,14 +9,15 @@ import { FormResponseAnswerFileValue, OrganizationTheme } from "@tellescope/type
9
9
  import { calculate_form_scoring, field_can_autosubmit, form_response_value_to_string, formatted_date, object_is_empty, objects_equivalent, read_local_storage, remove_script_tags, responses_satisfy_conditions, truncate_string } from "@tellescope/utilities"
10
10
  import { Divider } from "@mui/material"
11
11
 
12
- export const TellescopeFormContainerV2 = ({ businessId, organizationIds, ...props } : {
13
- businessId?: string,
14
- organizationIds?: string[],
12
+ export const TellescopeFormContainerV2 = ({ businessId, organizationIds, ...props } : {
13
+ businessId?: string,
14
+ organizationIds?: string[],
15
15
  dontAddContext?: boolean,
16
- children: React.ReactNode,
16
+ children: React.ReactNode,
17
17
  hideBg?: boolean,
18
18
  backgroundColor?: string,
19
19
  hideLogo?: boolean,
20
+ logoURL?: string,
20
21
  logoHeight?: number,
21
22
  language?: string,
22
23
  onChangeLanguage?: (l: string) => void,
@@ -632,10 +633,10 @@ export const TellescopeSingleQuestionFlowV2: typeof TellescopeFormV2 = ({
632
633
 
633
634
  {/* V2: Logo below progress bar, left-aligned */}
634
635
  {!customization?.hideLogo && (
635
- theme?.logoURL
636
+ (customization?.logoURL || theme?.logoURL)
636
637
  ? (
637
638
  <Flex alignItems="flex-start" style={{ marginBottom: '20px' }}>
638
- <img src={theme.logoURL} alt={theme.name} style={{ height: customization?.logoHeight || LOGO_HEIGHT, maxWidth: 225 }} />
639
+ <img src={customization?.logoURL || theme?.logoURL} alt={theme?.name} style={{ height: customization?.logoHeight || LOGO_HEIGHT, maxWidth: 225 }} />
639
640
  </Flex>
640
641
  )
641
642
  : (