@tellescope/react-components 1.242.9 → 1.243.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/state.d.ts +14 -2
- package/lib/cjs/state.d.ts.map +1 -1
- package/lib/cjs/state.js +2 -2
- package/lib/cjs/state.js.map +1 -1
- package/lib/esm/Forms/form_responses.d.ts +1 -0
- package/lib/esm/Forms/form_responses.d.ts.map +1 -1
- package/lib/esm/Forms/forms.d.ts +3 -3
- package/lib/esm/Forms/forms.v2.d.ts +3 -3
- package/lib/esm/Forms/hooks.d.ts +2 -2
- package/lib/esm/Forms/inputs.d.ts +1 -1
- package/lib/esm/Forms/inputs.v2.d.ts +1 -1
- package/lib/esm/TwilioVideo/hooks.d.ts +1 -1
- package/lib/esm/controls.d.ts +2 -2
- package/lib/esm/state.d.ts +222 -210
- package/lib/esm/state.d.ts.map +1 -1
- package/lib/esm/state.js +2 -2
- package/lib/esm/state.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/state.tsx +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.243.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"@reduxjs/toolkit": "1.9.0",
|
|
52
52
|
"@stripe/react-stripe-js": "2.9.0",
|
|
53
53
|
"@stripe/stripe-js": "1.52.1",
|
|
54
|
-
"@tellescope/constants": "1.
|
|
55
|
-
"@tellescope/sdk": "1.
|
|
56
|
-
"@tellescope/types-client": "1.
|
|
57
|
-
"@tellescope/types-models": "1.
|
|
58
|
-
"@tellescope/types-utilities": "1.
|
|
59
|
-
"@tellescope/utilities": "1.
|
|
60
|
-
"@tellescope/validation": "1.
|
|
54
|
+
"@tellescope/constants": "1.243.0",
|
|
55
|
+
"@tellescope/sdk": "1.243.0",
|
|
56
|
+
"@tellescope/types-client": "1.243.0",
|
|
57
|
+
"@tellescope/types-models": "1.243.0",
|
|
58
|
+
"@tellescope/types-utilities": "1.243.0",
|
|
59
|
+
"@tellescope/utilities": "1.243.0",
|
|
60
|
+
"@tellescope/validation": "1.243.0",
|
|
61
61
|
"css-to-react-native": "3.0.0",
|
|
62
62
|
"draft-js": "0.11.7",
|
|
63
63
|
"draftjs-to-html": "0.9.1",
|
|
@@ -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": "
|
|
87
|
+
"gitHead": "b739627c11e171972aa0beeb1ca0806159e8d8a2",
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
}
|
package/src/state.tsx
CHANGED
|
@@ -716,7 +716,7 @@ const DEFAULT_FETCH_LIMIT = 500
|
|
|
716
716
|
const BULK_READ_DEFAULT_LIMIT = 1000 // 1000 is max
|
|
717
717
|
const DONE_LOADING_TOKEN = 'doneLoading'
|
|
718
718
|
|
|
719
|
-
export type UpdateElement <T,> = (id: string, e: Partial<T>, o?: CustomUpdateOptions) => Promise<T>
|
|
719
|
+
export type UpdateElement <T,> = (id: string, e: Partial<T>, o?: CustomUpdateOptions, _overrideUnique?: boolean) => Promise<T>
|
|
720
720
|
|
|
721
721
|
export interface ListUpdateMethods <T, ADD> extends LoadMoreFunctions<T> {
|
|
722
722
|
addLocalElement: (e: T, o?: AddOptions) => T,
|
|
@@ -756,7 +756,7 @@ export const useListStateHook = <T extends { id: string | number }, ADD extends
|
|
|
756
756
|
findByIds?: ({ ids } : { ids: string[] }) => Promise<{ matches: T[] }>,
|
|
757
757
|
addOne?: (value: ADD) => Promise<T>,
|
|
758
758
|
addSome?: (values: ADD[]) => Promise<{ created: T[], errors: any[] }>,
|
|
759
|
-
updateOne?: (id: string, updates: Partial<T>, o?: CustomUpdateOptions) => Promise<T>,
|
|
759
|
+
updateOne?: (id: string, updates: Partial<T>, o?: CustomUpdateOptions, _overrideUnique?: boolean) => Promise<T>,
|
|
760
760
|
deleteOne?: (id: string) => Promise<void>,
|
|
761
761
|
},
|
|
762
762
|
options?: {
|
|
@@ -835,9 +835,9 @@ export const useListStateHook = <T extends { id: string | number }, ADD extends
|
|
|
835
835
|
options?.onUpdate?.([{ ...updated, id }])
|
|
836
836
|
return updated
|
|
837
837
|
}, [dispatch, options, slice])
|
|
838
|
-
const updateElement = useCallback(async (id: string, e: Partial<T>, o?: CustomUpdateOptions) => {
|
|
838
|
+
const updateElement = useCallback(async (id: string, e: Partial<T>, o?: CustomUpdateOptions, _overrideUnique?: boolean) => {
|
|
839
839
|
if (!updateOne) throw new Error(`Update element by API is not supported`)
|
|
840
|
-
return replaceLocalElement(id, await updateOne(id, e, o)) // API returns updated model, avoids needing to merge object fields client-side, so just replace
|
|
840
|
+
return replaceLocalElement(id, await updateOne(id, e, o, _overrideUnique)) // API returns updated model, avoids needing to merge object fields client-side, so just replace
|
|
841
841
|
}, [replaceLocalElement, updateOne])
|
|
842
842
|
|
|
843
843
|
const removeLocalElement = useCallback(id => {
|