@nosto/nosto-react 2.2.1 → 2.2.2
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/dist/index.d.ts +11 -15
- package/dist/index.es.js +178 -183
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/Nosto404.tsx +2 -25
- package/src/components/NostoCategory.tsx +2 -30
- package/src/components/NostoCheckout.tsx +2 -25
- package/src/components/NostoHome.tsx +2 -26
- package/src/components/NostoOrder.tsx +2 -33
- package/src/components/NostoOther.tsx +2 -25
- package/src/components/NostoPlacement.tsx +1 -1
- package/src/components/NostoProduct.tsx +2 -32
- package/src/components/NostoProvider.tsx +3 -8
- package/src/components/NostoSearch.tsx +2 -30
- package/src/components/NostoSession.tsx +2 -42
- package/src/components/helpers.ts +2 -2
- package/src/context.ts +0 -1
- package/src/hooks/scriptLoader.ts +4 -4
- package/src/hooks/useDeepCompareEffect.ts +1 -4
- package/src/hooks/useLoadClientScript.ts +9 -4
- package/src/hooks/useNosto404.tsx +25 -0
- package/src/hooks/useNostoApi.ts +1 -5
- package/src/hooks/useNostoCategory.tsx +31 -0
- package/src/hooks/useNostoCheckout.tsx +25 -0
- package/src/hooks/useNostoContext.ts +2 -3
- package/src/hooks/useNostoHome.tsx +25 -0
- package/src/hooks/useNostoOrder.tsx +35 -0
- package/src/hooks/useNostoOther.tsx +25 -0
- package/src/hooks/useNostoProduct.tsx +37 -0
- package/src/hooks/useNostoSearch.tsx +31 -0
- package/src/hooks/useNostoSession.tsx +33 -0
- package/src/hooks/useRenderCampaigns.tsx +6 -6
- package/src/index.ts +21 -2
- package/src/types.ts +775 -733
- package/src/utils/types.ts +5 -3
- package/src/components/index.ts +0 -11
- package/src/hooks/index.ts +0 -5
package/src/utils/types.ts
CHANGED
|
@@ -5,7 +5,8 @@ type SnakeToCamelCase<S extends string> = S extends `${infer T}_${infer U}`
|
|
|
5
5
|
// Recursive type to apply the conversion to all keys in an object type
|
|
6
6
|
export type ToCamelCase<T> = T extends (infer U)[]
|
|
7
7
|
? ToCamelCase<U>[]
|
|
8
|
-
: T extends Date
|
|
8
|
+
: T extends Date
|
|
9
|
+
? T
|
|
9
10
|
: T extends object
|
|
10
11
|
? {
|
|
11
12
|
[K in keyof T as SnakeToCamelCase<K & string>]: ToCamelCase<T[K]>
|
|
@@ -21,9 +22,10 @@ type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}`
|
|
|
21
22
|
// Recursive type to apply the conversion to all keys in an object type
|
|
22
23
|
export type ToSnakeCase<T> = T extends (infer U)[]
|
|
23
24
|
? ToSnakeCase<U>[]
|
|
24
|
-
: T extends Date
|
|
25
|
+
: T extends Date
|
|
26
|
+
? T
|
|
25
27
|
: T extends object
|
|
26
28
|
? {
|
|
27
29
|
[K in keyof T as CamelToSnakeCase<K & string>]: ToSnakeCase<T[K]>
|
|
28
30
|
}
|
|
29
|
-
: T
|
|
31
|
+
: T
|
package/src/components/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { default as Nosto404, useNosto404, type Nosto404Props } from "./Nosto404"
|
|
2
|
-
export { default as NostoOther, useNostoOther, type NostoOtherProps } from "./NostoOther"
|
|
3
|
-
export { default as NostoCheckout, useNostoCheckout, type NostoCheckoutProps } from "./NostoCheckout"
|
|
4
|
-
export { default as NostoProduct, useNostoProduct, type NostoProductProps } from "./NostoProduct"
|
|
5
|
-
export { default as NostoCategory, useNostoCategory, type NostoCategoryProps } from "./NostoCategory"
|
|
6
|
-
export { default as NostoSearch, useNostoSearch, type NostoSearchProps } from "./NostoSearch"
|
|
7
|
-
export { default as NostoOrder, useNostoOrder, type NostoOrderProps } from "./NostoOrder"
|
|
8
|
-
export { default as NostoHome, useNostoHome, type NostoHomeProps } from "./NostoHome"
|
|
9
|
-
export { default as NostoPlacement, type NostoPlacementProps } from "./NostoPlacement"
|
|
10
|
-
export { default as NostoProvider, type NostoProviderProps } from "./NostoProvider"
|
|
11
|
-
export { default as NostoSession, useNostoSession, type NostoSessionProps } from "./NostoSession"
|
package/src/hooks/index.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { useDeepCompareEffect } from "./useDeepCompareEffect"
|
|
2
|
-
export { useNostoApi } from "./useNostoApi"
|
|
3
|
-
export { useNostoContext } from "./useNostoContext"
|
|
4
|
-
export { useRenderCampaigns } from "./useRenderCampaigns"
|
|
5
|
-
export { useLoadClientScript } from "./useLoadClientScript"
|