@tellescope/react-components 1.200.2 → 1.201.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/hooks.d.ts.map +1 -1
- package/lib/cjs/Forms/hooks.js +1 -0
- package/lib/cjs/Forms/hooks.js.map +1 -1
- package/lib/cjs/hooks.d.ts +1 -0
- package/lib/cjs/hooks.d.ts.map +1 -1
- package/lib/cjs/hooks.js +20 -1
- package/lib/cjs/hooks.js.map +1 -1
- package/lib/cjs/inputs_shared.d.ts +1 -0
- package/lib/cjs/inputs_shared.d.ts.map +1 -1
- package/lib/cjs/inputs_shared.js.map +1 -1
- package/lib/cjs/layout.d.ts +4 -1
- package/lib/cjs/layout.d.ts.map +1 -1
- package/lib/cjs/layout.js +2 -2
- package/lib/cjs/layout.js.map +1 -1
- package/lib/esm/CMS/components.d.ts +0 -1
- package/lib/esm/CMS/components.d.ts.map +1 -1
- package/lib/esm/Forms/forms.d.ts +3 -3
- package/lib/esm/Forms/hooks.d.ts.map +1 -1
- package/lib/esm/Forms/hooks.js +2 -1
- package/lib/esm/Forms/hooks.js.map +1 -1
- package/lib/esm/Forms/inputs.d.ts +1 -1
- package/lib/esm/Forms/inputs.native.d.ts +0 -1
- package/lib/esm/Forms/inputs.native.d.ts.map +1 -1
- package/lib/esm/controls.d.ts +2 -2
- package/lib/esm/hooks.d.ts +1 -0
- package/lib/esm/hooks.d.ts.map +1 -1
- package/lib/esm/hooks.js +18 -0
- package/lib/esm/hooks.js.map +1 -1
- package/lib/esm/inputs.d.ts +1 -1
- package/lib/esm/inputs_shared.d.ts +1 -0
- package/lib/esm/inputs_shared.d.ts.map +1 -1
- package/lib/esm/inputs_shared.js.map +1 -1
- package/lib/esm/layout.d.ts +5 -2
- package/lib/esm/layout.d.ts.map +1 -1
- package/lib/esm/layout.js +2 -2
- package/lib/esm/layout.js.map +1 -1
- package/lib/esm/state.d.ts +288 -288
- package/lib/esm/theme.native.d.ts +0 -1
- package/lib/esm/theme.native.d.ts.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/hooks.tsx +3 -1
- package/src/hooks.ts +24 -0
- package/src/inputs_shared.tsx +1 -0
- package/src/layout.tsx +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.201.0",
|
|
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.
|
|
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.201.0",
|
|
51
|
+
"@tellescope/sdk": "^1.201.0",
|
|
52
|
+
"@tellescope/types-client": "^1.201.0",
|
|
53
|
+
"@tellescope/types-models": "^1.201.0",
|
|
54
|
+
"@tellescope/types-utilities": "^1.201.0",
|
|
55
|
+
"@tellescope/utilities": "^1.201.0",
|
|
56
|
+
"@tellescope/validation": "^1.201.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",
|
|
@@ -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": "
|
|
87
|
+
"gitHead": "f47e1bb6ac39838d698df1c4d0d40170920526b6",
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
}
|
package/src/Forms/hooks.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { DatabaseRecord, Enduser, Form, FormField, FormResponse } from "@tellesc
|
|
|
5
5
|
import { phoneValidator } from "@tellescope/validation"
|
|
6
6
|
import { FileBlob, Indexable } from "@tellescope/types-utilities"
|
|
7
7
|
import { CompoundFilter, EnduserRelationship, FormCustomization, FormResponseAnswerAddress, FormResponseAnswerFileValue, FormResponseValue, FormResponseValueAnswer, OrganizationTheme, PreviousFormCompoundLogic, PreviousFormFieldType } from "@tellescope/types-models"
|
|
8
|
-
import { WithTheme, contact_is_valid, useFileUpload, useFormFields, useFormResponses, useResolvedSession, value_is_loaded } from "../index"
|
|
8
|
+
import { WithTheme, contact_is_valid, useAddGTMTag, useFileUpload, useFormFields, useFormResponses, useResolvedSession, value_is_loaded } from "../index"
|
|
9
9
|
import ReactGA from "react-ga4";
|
|
10
10
|
|
|
11
11
|
import isEmail from "validator/lib/isEmail"
|
|
@@ -544,6 +544,8 @@ export const useTellescopeForm = ({ dontAutoadvance, isPublicForm, form, urlLogi
|
|
|
544
544
|
goBackURL = new URL(window.location.href).searchParams.get('back') || ''
|
|
545
545
|
} catch(err) {}
|
|
546
546
|
|
|
547
|
+
useAddGTMTag(form?.gtmTag)
|
|
548
|
+
|
|
547
549
|
useEffect(() => {
|
|
548
550
|
try {
|
|
549
551
|
window.location.hash = activeField.value.id
|
package/src/hooks.ts
CHANGED
|
@@ -60,4 +60,28 @@ export const useSearchAPI = <T,>({ query, onLoad, searchAPI } : { query: string
|
|
|
60
60
|
|
|
61
61
|
return () => { clearTimeout(t) }
|
|
62
62
|
}, [query, searchAPI, onLoad, searchedRef])
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const useAddGTMTag = (gtmTag?: string) => {
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (!gtmTag) return
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
const existingScript = document.querySelector(
|
|
71
|
+
`script[src*="https://www.googletagmanager.com/gtm.js?id=${gtmTag}"]`
|
|
72
|
+
)
|
|
73
|
+
if (existingScript) return
|
|
74
|
+
|
|
75
|
+
const script = document.createElement('script');
|
|
76
|
+
script.type = 'text/javascript';
|
|
77
|
+
script.text = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
78
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
79
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
80
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
81
|
+
})(window,document,'script','dataLayer','${gtmTag}');`
|
|
82
|
+
document.head.appendChild(script);
|
|
83
|
+
} catch(err) {
|
|
84
|
+
console.warn(err)
|
|
85
|
+
}
|
|
86
|
+
}, [gtmTag])
|
|
63
87
|
}
|
package/src/inputs_shared.tsx
CHANGED
|
@@ -817,6 +817,7 @@ export interface GenericSearchProps <T> extends FilterComponent<T> {
|
|
|
817
817
|
value?: string,
|
|
818
818
|
onChange?: (s: string) => void,
|
|
819
819
|
hideIcon?: boolean,
|
|
820
|
+
variant?: TextFieldProps['variant'],
|
|
820
821
|
}
|
|
821
822
|
interface ModelSearchProps<T> extends GenericSearchProps<T>, SearchAPIProps<T> {}
|
|
822
823
|
export const ModelSearchInput = <T,>({
|
package/src/layout.tsx
CHANGED
|
@@ -303,6 +303,7 @@ export interface ScrollingListProps <T extends { id: string | number }> extends
|
|
|
303
303
|
hideHorizontalScroll?: boolean,
|
|
304
304
|
}
|
|
305
305
|
loadMoreOptions?: LoadMoreOptions<T>,
|
|
306
|
+
scrollRef?: React.RefObject<FixedSizeList<T[]>>,
|
|
306
307
|
}
|
|
307
308
|
export const ScrollingList = <T extends { id: string | number }>({
|
|
308
309
|
title,
|
|
@@ -322,7 +323,9 @@ export const ScrollingList = <T extends { id: string | number }>({
|
|
|
322
323
|
itemContainerStyle,
|
|
323
324
|
virtualization,
|
|
324
325
|
loadMoreOptions,
|
|
325
|
-
|
|
326
|
+
initialScrollOffset,
|
|
327
|
+
scrollRef,
|
|
328
|
+
} : ScrollingListProps<T> & { noParentScroll?: boolean, initialScrollOffset?: number }) => {
|
|
326
329
|
const width = usePageWidth()
|
|
327
330
|
const fetchRef = useRef(0)
|
|
328
331
|
const titleStyleWithDefaults = { fontSize: 20, fontWeight: 'bold', marginBottom: 3, ...titleStyle }
|
|
@@ -380,7 +383,7 @@ export const ScrollingList = <T extends { id: string | number }>({
|
|
|
380
383
|
: emptyText
|
|
381
384
|
: virtualization?.virtualize ? (
|
|
382
385
|
// keep consistent with DraggableList
|
|
383
|
-
<FixedSizeList
|
|
386
|
+
<FixedSizeList initialScrollOffset={initialScrollOffset} ref={scrollRef}
|
|
384
387
|
style={{ overflowX: virtualization?.hideHorizontalScroll ? 'hidden' : undefined }}
|
|
385
388
|
height={virtualization?.height || window.innerHeight - 225}
|
|
386
389
|
width={
|