@tellescope/react-components 1.242.9 → 1.242.10

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.9",
3
+ "version": "1.242.10",
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.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",
54
+ "@tellescope/constants": "1.242.10",
55
+ "@tellescope/sdk": "1.242.10",
56
+ "@tellescope/types-client": "1.242.10",
57
+ "@tellescope/types-models": "1.242.10",
58
+ "@tellescope/types-utilities": "1.242.10",
59
+ "@tellescope/utilities": "1.242.10",
60
+ "@tellescope/validation": "1.242.10",
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": "fd7946e8dfa03c32847d09ce66d01ef35b188d74",
87
+ "gitHead": "eae1820bfda6fb99837110055e208524d228c41a",
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 => {