@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,57 @@
|
|
|
1
|
+
import { SearchResponseProductAttributes } from "../../application/models/api/response.js";
|
|
2
|
+
import { ProductCardConfig } from "../../contexts/types.js";
|
|
3
|
+
import { SearchResult } from "../../application/models/api/search.js";
|
|
4
|
+
import { SelectedFilterOption } from "../../atoms/search/searchAPI.js";
|
|
5
|
+
import { SearchFilterDatum, SelectFilterItem } from "../../types/search-filter-types.js";
|
|
6
|
+
import { SearchResultsState } from "../utils.js";
|
|
7
|
+
import { SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
|
|
8
|
+
|
|
9
|
+
//#region ../hooks/dist/hooks/Search/useSearch.d.ts
|
|
10
|
+
//#region src/hooks/Search/useSearch.d.ts
|
|
11
|
+
interface SearchResultsHocProps {
|
|
12
|
+
searchData: SearchResult | null;
|
|
13
|
+
searchResponseId: string;
|
|
14
|
+
merchantShortName: string;
|
|
15
|
+
productCardConfig: ProductCardConfig;
|
|
16
|
+
productList: SearchResponseProduct[];
|
|
17
|
+
autocompleteResults: string[];
|
|
18
|
+
searchFilters: SearchFilterDatum[];
|
|
19
|
+
availableDynamicFilters: {
|
|
20
|
+
name: string;
|
|
21
|
+
displayName: string;
|
|
22
|
+
}[];
|
|
23
|
+
selectedFilterOptions: SelectedFilterOption[];
|
|
24
|
+
recommendedProducts: SearchResponseProductAttributes['attributes'][];
|
|
25
|
+
recommendedProductsHeading: string;
|
|
26
|
+
searchOverlayHeading: string;
|
|
27
|
+
searchText: string;
|
|
28
|
+
query: string;
|
|
29
|
+
searchResultsState: SearchResultsState;
|
|
30
|
+
isLoadingSearch: boolean;
|
|
31
|
+
isFilterOpen: boolean;
|
|
32
|
+
shouldShowAutocomplete: boolean;
|
|
33
|
+
focusedIndex: number;
|
|
34
|
+
focusedOptionId: string | undefined;
|
|
35
|
+
filterButtonText: string;
|
|
36
|
+
onSearchInputChange: (value: string) => void;
|
|
37
|
+
onSubmitSearch: () => void;
|
|
38
|
+
onAutocompleteSelect: (suggestion: string) => void;
|
|
39
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
40
|
+
onSearchInputFocus: () => void;
|
|
41
|
+
onSearchInputBlur: () => void;
|
|
42
|
+
onToggleDynamicFilter: ({
|
|
43
|
+
filter,
|
|
44
|
+
dynamicFilterDisplayName
|
|
45
|
+
}: {
|
|
46
|
+
filter: string;
|
|
47
|
+
dynamicFilterDisplayName: string;
|
|
48
|
+
}) => void;
|
|
49
|
+
onSelectFilterItem: SelectFilterItem;
|
|
50
|
+
onRemoveFilter: (filter: SelectedFilterOption) => void;
|
|
51
|
+
onClearAllFilters: () => void;
|
|
52
|
+
setIsFilterOpen: (isFilterOpen: boolean) => void;
|
|
53
|
+
resetSearch: () => void;
|
|
54
|
+
searchResultsRef: React.RefObject<HTMLDivElement>;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { SearchResultsHocProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region ../hooks/dist/merchants/domInsertion.d.ts
|
|
2
|
+
//#region src/merchants/domInsertion.d.ts
|
|
3
|
+
declare enum DOMInsertionType {
|
|
4
|
+
AFTER = "after",
|
|
5
|
+
BEFORE = "before",
|
|
6
|
+
ADJACENT_AFTER_BEGIN = "adjacent-after-begin",
|
|
7
|
+
ADJACENT_BEFORE_BEGIN = "adjacent-before-begin",
|
|
8
|
+
ADJACENT_AFTER_END = "adjacent-after-end",
|
|
9
|
+
ADJACENT_BEFORE_END = "adjacent-before-end",
|
|
10
|
+
APPEND_CHILD = "append-child",
|
|
11
|
+
NONE = "none",
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#endregion
|
|
15
|
+
export { DOMInsertionType };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region ../hooks/dist/merchants/gridInsertion.d.ts
|
|
2
|
+
//#region src/merchants/gridInsertion.d.ts
|
|
3
|
+
declare enum GridInsertionType {
|
|
4
|
+
FIXED_1 = "fixed-1",
|
|
5
|
+
FIXED_2 = "fixed-2",
|
|
6
|
+
FIXED_3 = "fixed-3",
|
|
7
|
+
FIXED_4 = "fixed-4",
|
|
8
|
+
FIXED_5 = "fixed-5",
|
|
9
|
+
FIXED_6 = "fixed-6",
|
|
10
|
+
FIXED_7 = "fixed-7",
|
|
11
|
+
FIXED_8 = "fixed-8",
|
|
12
|
+
FIXED_9 = "fixed-9",
|
|
13
|
+
FIXED_12 = "fixed-12",
|
|
14
|
+
FIXED_13 = "fixed-13",
|
|
15
|
+
ROW_1 = "row-1",
|
|
16
|
+
ROW_2 = "row-2",
|
|
17
|
+
ROW_3 = "row-3",
|
|
18
|
+
ROW_4 = "row-4",
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#endregion
|
|
22
|
+
export { GridInsertionType };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region ../hooks/dist/types/customerService.d.ts
|
|
2
|
+
|
|
3
|
+
//#region src/types/customerService.d.ts
|
|
4
|
+
declare enum CustomerServiceType {
|
|
5
|
+
shopify = "shopify",
|
|
6
|
+
gorgias = "gorgias",
|
|
7
|
+
kustomer = "kustomer",
|
|
8
|
+
groove = "groove",
|
|
9
|
+
tidio = "tidio",
|
|
10
|
+
zowie = "zowie",
|
|
11
|
+
redo = "redo",
|
|
12
|
+
gladly = "gladly",
|
|
13
|
+
richpanel = "richpanel",
|
|
14
|
+
zendesk = "zendesk",
|
|
15
|
+
unsupported = "unsupported",
|
|
16
|
+
}
|
|
17
|
+
declare enum CustomerServiceIntegrationMode {
|
|
18
|
+
none = "none",
|
|
19
|
+
simple = "simple",
|
|
20
|
+
full = "full",
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#endregion
|
|
24
|
+
export { CustomerServiceIntegrationMode, CustomerServiceType };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FrontendConfigOverrides } from "../application/models/frontendConfig.js";
|
|
2
|
+
import { VariantInfo } from "../application/models/variantInfo/variantInfo.js";
|
|
3
|
+
|
|
4
|
+
//#region ../hooks/dist/types/enviveConfig.d.ts
|
|
5
|
+
//#region src/types/enviveConfig.d.ts
|
|
6
|
+
interface EnviveConfig {
|
|
7
|
+
publicKey?: string;
|
|
8
|
+
userID?: string;
|
|
9
|
+
env?: 'prod' | 'dev';
|
|
10
|
+
clientID?: string;
|
|
11
|
+
show?: boolean;
|
|
12
|
+
featureOverrides?: Record<string, boolean>;
|
|
13
|
+
variantInfoOverride?: VariantInfo;
|
|
14
|
+
variantUrlOverride?: string;
|
|
15
|
+
pageVariantIdOverride?: string;
|
|
16
|
+
selectedCustomizeOption?: string;
|
|
17
|
+
reducedMotionOverride?: boolean;
|
|
18
|
+
initialOpenSearchOverlay?: boolean;
|
|
19
|
+
WidgetMountingOverride?: Record<string, any>[];
|
|
20
|
+
configChanges?: FrontendConfigOverrides[];
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface Window {
|
|
24
|
+
_spiffy?: EnviveConfig;
|
|
25
|
+
_envive?: EnviveConfig;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#endregion
|
|
30
|
+
export { EnviveConfig };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ChatState } from "./custservice-types.js";
|
|
2
|
+
import { SuggestionBarLocationForMetrics } from "./suggestionBarV2-types.js";
|
|
3
|
+
import { TestProps } from "./test-types.js";
|
|
4
|
+
import { SearchFilterDatum, SearchFilterItemDatum, SelectFilterItem } from "./search-filter-types.js";
|
|
5
|
+
import { EnviveConfig } from "./enviveConfig.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region ../hooks/dist/types/search-filter-types.d.ts
|
|
2
|
+
|
|
3
|
+
type SelectFilterItem = ({
|
|
4
|
+
filterId,
|
|
5
|
+
filterItemId,
|
|
6
|
+
isSelected,
|
|
7
|
+
displayName
|
|
8
|
+
}: {
|
|
9
|
+
filterId: string;
|
|
10
|
+
filterItemId: string;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
displayName: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
type SearchFilterDatum = {
|
|
15
|
+
filterId: string;
|
|
16
|
+
displayName: string;
|
|
17
|
+
items: SearchFilterItemDatum[];
|
|
18
|
+
};
|
|
19
|
+
type SearchFilterItemDatum = {
|
|
20
|
+
filterItemId: string;
|
|
21
|
+
displayName: string;
|
|
22
|
+
productCount: number;
|
|
23
|
+
isSelected: boolean;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { SearchFilterDatum, SearchFilterItemDatum, SelectFilterItem };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region ../hooks/dist/types/suggestionBarV2-types.d.ts
|
|
2
|
+
//#region src/types/suggestionBarV2-types.d.ts
|
|
3
|
+
declare enum SuggestionBarLocationForMetrics {
|
|
4
|
+
SUGGESTION_BAR_TOP = "top",
|
|
5
|
+
SUGGESTION_BAR_BOTTOM = "bottom",
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#endregion
|
|
9
|
+
export { SuggestionBarLocationForMetrics };
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ function ButtonContainer({ children }: ButtonContainerProps) {
|
|
|
25
25
|
const SuggestionButtonContainer: React.FC<SuggestionButtonContainerProps> = ({
|
|
26
26
|
buttonVariation,
|
|
27
27
|
hoverButtonVariation,
|
|
28
|
-
buttonTexts,
|
|
28
|
+
buttonTexts = [],
|
|
29
29
|
boldFirstButton = false,
|
|
30
30
|
twoRowsOnMobile = false,
|
|
31
31
|
animationSpeed = 'none',
|