@envive-ai/react-widgets 0.3.2 → 0.3.5
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/SearchResults/SearchResults.d.cts +2 -2
- package/dist/SearchResults/SearchResults.d.ts +3 -2
- package/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/SearchResults/SearchResultsWidget.d.ts +2 -2
- package/dist/SearchZeroState/SearchZeroState.cjs +1 -1
- package/dist/SearchZeroState/SearchZeroState.js +1 -1
- package/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- package/dist/SearchZeroState/components/RecommendedProducts.cjs +1 -1
- package/dist/SearchZeroState/components/RecommendedProducts.js +1 -1
- package/dist/SearchZeroState/index.d.cts +2 -1
- package/dist/SearchZeroState/index.d.ts +2 -1
- package/dist/SearchZeroState/types.d.cts +2 -2
- package/dist/SearchZeroState/types.d.ts +2 -2
- package/dist/SuggestionBar/SuggestionBar.cjs +3 -3
- package/dist/SuggestionBar/SuggestionBar.d.cts +3 -3
- package/dist/SuggestionBar/SuggestionBar.d.ts +3 -3
- package/dist/SuggestionBar/SuggestionBar.js +4 -4
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.cjs +2 -2
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.js +2 -2
- package/dist/SuggestionButtonContainer/types.d.cts +3 -2
- package/dist/SuggestionButtonContainer/types.d.ts +3 -2
- package/dist/hooks/dist/application/models/api/response.d.cts +11 -0
- package/dist/hooks/dist/application/models/api/search.d.cts +13 -0
- package/dist/hooks/dist/application/models/chatElementDisplayLocation.d.cts +27 -0
- package/dist/hooks/dist/application/models/featureGates.d.cts +30 -0
- package/dist/hooks/dist/application/models/frontendConfig.d.cts +17 -0
- package/dist/hooks/dist/application/models/utilityTypes/camelCase.d.cts +71 -0
- package/dist/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +58 -0
- package/dist/hooks/dist/application/models/utilityTypes/internal.d.cts +22 -0
- package/dist/hooks/dist/application/models/utilityTypes/splitWords.d.cts +31 -0
- package/dist/hooks/dist/application/models/utilityTypes/trim.d.cts +30 -0
- package/dist/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +30 -0
- package/dist/hooks/dist/application/models/variantInfo/pageVisitInfo.d.cts +11 -0
- package/dist/hooks/dist/application/models/variantInfo/plpInfo.d.cts +8 -0
- package/dist/hooks/dist/application/models/variantInfo/productInfo.d.cts +10 -0
- package/dist/hooks/dist/application/models/variantInfo/variantInfo.d.cts +31 -0
- package/dist/hooks/dist/application/utils/overrides.d.cts +22 -0
- package/dist/hooks/dist/atoms/search/searchAPI.d.cts +11 -0
- package/dist/hooks/dist/contexts/types.d.cts +671 -0
- package/dist/hooks/dist/hooks/Search/useSearch.d.cts +57 -0
- package/dist/hooks/dist/hooks/utils.d.cts +9 -0
- package/dist/hooks/dist/merchants/domInsertion.d.cts +15 -0
- package/dist/hooks/dist/merchants/gridInsertion.d.cts +22 -0
- package/dist/hooks/dist/types/customerService.d.cts +24 -0
- package/dist/hooks/dist/types/custservice-types.d.cts +10 -0
- package/dist/hooks/dist/types/enviveConfig.d.cts +30 -0
- package/dist/hooks/dist/types/index.d.cts +6 -0
- package/dist/hooks/dist/types/search-filter-types.d.cts +26 -0
- package/dist/hooks/dist/types/suggestionBarV2-types.d.cts +9 -0
- package/dist/hooks/dist/types/test-types.d.cts +8 -0
- package/dist/packages/hooks/dist/application/models/api/response.d.ts +11 -0
- package/dist/packages/hooks/dist/application/models/api/search.d.ts +13 -0
- package/dist/packages/hooks/dist/application/models/chatElementDisplayLocation.d.ts +27 -0
- package/dist/packages/hooks/dist/application/models/featureGates.d.ts +30 -0
- package/dist/packages/hooks/dist/application/models/frontendConfig.d.ts +17 -0
- package/dist/packages/hooks/dist/application/models/utilityTypes/camelCase.d.ts +71 -0
- package/dist/packages/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +58 -0
- package/dist/packages/hooks/dist/application/models/utilityTypes/internal.d.ts +22 -0
- package/dist/packages/hooks/dist/application/models/utilityTypes/splitWords.d.ts +31 -0
- package/dist/packages/hooks/dist/application/models/utilityTypes/trim.d.ts +30 -0
- package/dist/packages/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +30 -0
- package/dist/packages/hooks/dist/application/models/variantInfo/pageVisitInfo.d.ts +11 -0
- package/dist/packages/hooks/dist/application/models/variantInfo/plpInfo.d.ts +8 -0
- package/dist/packages/hooks/dist/application/models/variantInfo/productInfo.d.ts +10 -0
- package/dist/packages/hooks/dist/application/models/variantInfo/variantInfo.d.ts +31 -0
- package/dist/packages/hooks/dist/application/utils/overrides.d.ts +22 -0
- package/dist/packages/hooks/dist/atoms/search/searchAPI.d.ts +13 -0
- package/dist/packages/hooks/dist/contexts/types.d.ts +671 -0
- package/dist/packages/hooks/dist/hooks/Search/index.d.ts +1 -0
- package/dist/packages/hooks/dist/hooks/Search/useSearch.d.ts +57 -0
- package/dist/packages/hooks/dist/hooks/utils.d.ts +9 -0
- package/dist/packages/hooks/dist/merchants/domInsertion.d.ts +15 -0
- package/dist/packages/hooks/dist/merchants/gridInsertion.d.ts +22 -0
- package/dist/packages/hooks/dist/types/customerService.d.ts +24 -0
- package/dist/packages/hooks/dist/types/custservice-types.d.ts +10 -0
- package/dist/packages/hooks/dist/types/enviveConfig.d.ts +30 -0
- package/dist/packages/hooks/dist/types/index.d.ts +5 -0
- package/dist/packages/hooks/dist/types/search-filter-types.d.ts +26 -0
- package/dist/packages/hooks/dist/types/suggestionBarV2-types.d.ts +9 -0
- package/dist/packages/hooks/dist/types/test-types.d.ts +8 -0
- package/package.json +1 -1
- package/src/SuggestionButtonContainer/SuggestionButtonContainer.tsx +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Whitespace } from "./internal.cjs";
|
|
2
|
+
|
|
3
|
+
//#region ../hooks/dist/application/models/utilityTypes/trim.d.ts
|
|
4
|
+
|
|
5
|
+
//#region src/application/models/utilityTypes/trim.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Remove spaces from the left side.
|
|
8
|
+
*/
|
|
9
|
+
type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
|
|
10
|
+
/**
|
|
11
|
+
* Remove spaces from the right side.
|
|
12
|
+
*/
|
|
13
|
+
type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
|
|
14
|
+
/**
|
|
15
|
+
* Remove leading and trailing spaces from a string.
|
|
16
|
+
* @example
|
|
17
|
+
* ```
|
|
18
|
+
* import type {Trim} from 'type-fest';
|
|
19
|
+
*
|
|
20
|
+
* Trim<' foo '>
|
|
21
|
+
* //=> 'foo'
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @category String
|
|
25
|
+
* @category Template literal
|
|
26
|
+
*/
|
|
27
|
+
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Trim };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region ../hooks/dist/application/models/utilityTypes/unknownArray.d.ts
|
|
2
|
+
//#region src/application/models/utilityTypes/unknownArray.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Represents an array with `unknown` value.
|
|
5
|
+
*
|
|
6
|
+
* Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```
|
|
10
|
+
* import type {UnknownArray} from 'type-fest';
|
|
11
|
+
*
|
|
12
|
+
* type IsArray<T> = T extends UnknownArray ? true : false;
|
|
13
|
+
*
|
|
14
|
+
* type A = IsArray<['foo']>;
|
|
15
|
+
* //=> true
|
|
16
|
+
*
|
|
17
|
+
* type B = IsArray<readonly number[]>;
|
|
18
|
+
* //=> true
|
|
19
|
+
*
|
|
20
|
+
* type C = IsArray<string>;
|
|
21
|
+
* //=> false
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @category Type
|
|
25
|
+
* @category Array
|
|
26
|
+
*/
|
|
27
|
+
type UnknownArray = readonly unknown[];
|
|
28
|
+
//#endregion
|
|
29
|
+
//#endregion
|
|
30
|
+
export { UnknownArray };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PageVisitCategory } from "@spiffy-ai/commerce-api-client";
|
|
2
|
+
|
|
3
|
+
//#region ../hooks/dist/application/models/variantInfo/pageVisitInfo.d.ts
|
|
4
|
+
//#region src/application/models/variantInfo/pageVisitInfo.d.ts
|
|
5
|
+
interface PageVisitInfo {
|
|
6
|
+
url: string;
|
|
7
|
+
pageVisitCategory: PageVisitCategory;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#endregion
|
|
11
|
+
export { PageVisitInfo };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region ../hooks/dist/application/models/variantInfo/productInfo.d.ts
|
|
2
|
+
//#region src/application/models/variantInfo/productInfo.d.ts
|
|
3
|
+
interface ProductInfo {
|
|
4
|
+
productId: string;
|
|
5
|
+
parentProductId?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ProductInfo };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PLPInfo } from "./plpInfo.cjs";
|
|
2
|
+
import { PageVisitInfo } from "./pageVisitInfo.cjs";
|
|
3
|
+
import { ProductInfo } from "./productInfo.cjs";
|
|
4
|
+
|
|
5
|
+
//#region ../hooks/dist/application/models/variantInfo/variantInfo.d.ts
|
|
6
|
+
//#region src/application/models/variantInfo/variantInfo.d.ts
|
|
7
|
+
declare enum VariantTypeEnum {
|
|
8
|
+
Pdp = "pdp",
|
|
9
|
+
Plp = "plp",
|
|
10
|
+
PageVisit = "page_visit",
|
|
11
|
+
Home = "home",
|
|
12
|
+
Search = "search",
|
|
13
|
+
Other = "other",
|
|
14
|
+
}
|
|
15
|
+
type VariantInfo = PDPVariantInfo | PLPVariantInfo | PageVisitVariantInfo;
|
|
16
|
+
type PDPVariantInfo = {
|
|
17
|
+
variantId: string;
|
|
18
|
+
variant: VariantTypeEnum.Pdp;
|
|
19
|
+
} & ProductInfo;
|
|
20
|
+
type PLPVariantInfo = {
|
|
21
|
+
variantId: string;
|
|
22
|
+
variant: VariantTypeEnum.Plp;
|
|
23
|
+
url?: string;
|
|
24
|
+
} & PLPInfo;
|
|
25
|
+
type PageVisitVariantInfo = {
|
|
26
|
+
variantId: string;
|
|
27
|
+
variant: VariantTypeEnum.PageVisit;
|
|
28
|
+
} & PageVisitInfo;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#endregion
|
|
31
|
+
export { VariantInfo };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region ../hooks/dist/application/utils/overrides.d.ts
|
|
2
|
+
//#region src/application/utils/overrides.d.ts
|
|
3
|
+
type ReplaceOp<T> = {
|
|
4
|
+
$replace: T;
|
|
5
|
+
};
|
|
6
|
+
type DeleteOp = {
|
|
7
|
+
$delete: true;
|
|
8
|
+
};
|
|
9
|
+
type Builtin = Date | RegExp | ((...args: unknown[]) => unknown);
|
|
10
|
+
type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Override<T> is a DeepPartial-like type with special operators:
|
|
13
|
+
* - { $replace: T } to replace an entire subtree/array
|
|
14
|
+
* - { $delete: true } to delete an object key
|
|
15
|
+
*
|
|
16
|
+
* Arrays behavior:
|
|
17
|
+
* - Arrays of objects: merge-by-index by default (unless `arrayStrategy: 'replace'` or `$replace` is used)
|
|
18
|
+
* - Arrays of primitives (string/number/boolean/...): replaced by default when a patch array is provided
|
|
19
|
+
*/
|
|
20
|
+
type Override<T> = T extends Primitive | Builtin ? T | ReplaceOp<T> | DeleteOp : T extends (infer U)[] ? Array<Override<U> | undefined> | ReplaceOp<T> : T extends Map<unknown, unknown> | Set<unknown> ? ReplaceOp<T> : T extends object ? { [K in keyof T]?: Override<T[K]> | DeleteOp | null } | ReplaceOp<T> : T;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Override };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region ../hooks/dist/atoms/search/searchAPI.d.ts
|
|
2
|
+
|
|
3
|
+
//#region src/atoms/search/searchAPI.d.ts
|
|
4
|
+
type SelectedFilterOption = {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
filterId: string;
|
|
8
|
+
filterItemId: string;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { SelectedFilterOption };
|