@sonic-equipment/ui 219.0.0 → 221.0.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/dist/algolia/algolia-search-provider.js +7 -5
- package/dist/algolia/algolia-sonic-searchclient.js +2 -2
- package/dist/algolia/use-algolia-insights.d.ts +7 -0
- package/dist/algolia/use-algolia-insights.js +45 -7
- package/dist/algolia/use-algolia-search.d.ts +2 -1
- package/dist/buttons/favorite/connected-favorite-button.d.ts +1 -1
- package/dist/buttons/favorite/connected-favorite-button.js +0 -2
- package/dist/cards/product-card/product-card.js +5 -2
- package/dist/exports.d.ts +1 -0
- package/dist/global-search/plugins/categories-plugin.d.ts +1 -1
- package/dist/global-search/plugins/categories-plugin.js +1 -1
- package/dist/global-search/plugins/popular-categories-plugin.d.ts +1 -1
- package/dist/global-search/plugins/popular-categories-plugin.js +1 -1
- package/dist/global-search/plugins/popular-searches-plugin.d.ts +1 -1
- package/dist/global-search/plugins/popular-searches-plugin.js +1 -1
- package/dist/global-search/plugins/query-suggestions-plugin.d.ts +1 -1
- package/dist/global-search/plugins/query-suggestions-plugin.js +1 -1
- package/dist/global-search/plugins/quick-access-plugin.d.ts +1 -1
- package/dist/global-search/plugins/quick-access-plugin.js +1 -1
- package/dist/global-search/plugins/recent-searches-plugin.d.ts +1 -1
- package/dist/global-search/plugins/recent-searches-plugin.js +2 -1
- package/dist/global-search/search-highlight/highlight.d.ts +1 -1
- package/dist/global-search/search-highlight/highlight.js +1 -1
- package/dist/global-search/types.d.ts +3 -1
- package/dist/header/buttons/account/connected-account-button.js +1 -1
- package/dist/index.js +2 -1
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/navigation/quick-access-menu/quick-access-menu.d.ts +2 -1
- package/dist/navigation/quick-access-menu/quick-access-menu.js +2 -2
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/checkOptions.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.js +109 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/createStore.js +31 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.js +51 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.js +12 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.js +135 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.js +355 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/metadata.js +44 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/onInput.js +148 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.js +202 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/reshape.js +48 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/resolve.js +119 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.js +149 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.js +50 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.js +42 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.js +38 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.js +79 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getAutocompleteElementId.js +12 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNativeEvent.js +5 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.js +31 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.js +53 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getPluginSubmitPromise.js +39 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.js +5 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/isSamsung.js +6 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.js +25 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/requesters/createAlgoliaRequester.js +16 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/requesters/getAlgoliaResults.js +12 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/userAgents.js +8 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createAlgoliaInsightsPlugin.js +252 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createClickedEvent.js +16 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createSearchInsightsApi.js +209 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createViewedEvents.js +18 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/isAlgoliaInsightsHit.js +5 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algoliasea_57b3nqmtgbeobm4sw3iw2qdpxy/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/isModernInsightsClient.js +25 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_algoliase_q33j3oaxy2utuyscyksb32r6mu/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/constants.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_algoliase_q33j3oaxy2utuyscyksb32r6mu/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/createQuerySuggestionsPlugin.js +118 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_algoliase_q33j3oaxy2utuyscyksb32r6mu/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/getTemplates.js +64 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/addHighlightedAttribute.js +21 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/constants.js +10 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createLocalStorage.js +36 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createLocalStorageRecentSearchesPlugin.js +49 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createRecentSearchesPlugin.js +137 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createStorageApi.js +16 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/getLocalStorage.js +33 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/getTemplates.js +72 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/search.js +25 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.js +4 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.js +25 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.js +51 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.js +6 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.js +37 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js +19 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.js +69 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/utils/getAppIdAndApiKey.js +16 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/createRef.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/debounce.js +16 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/decycle.js +34 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.js +6 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js +10 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.js +15 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/isEqual.js +26 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/noop.js +3 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/safelyRunOnBrowser.js +13 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.js +8 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/version.js +3 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/warn.js +26 -0
- package/dist/pages/account/sign-in-page/sign-in-page.js +1 -1
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.d.ts +1 -1
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.js +1 -1
- package/dist/pages/my-sonic/pages/favorites/favorites-page.js +26 -1
- package/dist/shared/api/bff/hooks/use-fetch-favorites.d.ts +2 -0
- package/dist/shared/api/bff/hooks/use-fetch-favorites.js +29 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js +5 -12
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-wishlist.js +6 -9
- package/dist/shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js +4 -7
- package/dist/shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items.js +10 -20
- package/dist/shared/api/storefront/services/wishlist-service.d.ts +4 -1
- package/dist/shared/api/storefront/services/wishlist-service.js +16 -1
- package/dist/shared/utils/uuid.js +1 -1
- package/dist/styles.css +6 -6
- package/package.json +1 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { createContext, useState, useMemo, useRef, useEffect } from 'react';
|
|
4
|
-
import { createAutocomplete } from '@algolia/autocomplete-core';
|
|
5
|
-
import { getAlgoliaResults } from '@algolia/autocomplete-preset-algolia';
|
|
6
4
|
import { config } from '../config.js';
|
|
7
5
|
import { categoriesPlugin } from '../global-search/plugins/categories-plugin.js';
|
|
8
6
|
import { popularCategoriesPlugin } from '../global-search/plugins/popular-categories-plugin.js';
|
|
@@ -17,6 +15,8 @@ import { environment } from '../shared/utils/environment.js';
|
|
|
17
15
|
import { getAlgoliaIndex } from './algolia-index-config.js';
|
|
18
16
|
import { AlgoliaInsightsProvider } from './algolia-insights-provider.js';
|
|
19
17
|
import { createSonicSearchClient } from './algolia-sonic-searchclient.js';
|
|
18
|
+
import { createAutocomplete } from '../node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.js';
|
|
19
|
+
import { getAlgoliaResults } from '../node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js';
|
|
20
20
|
|
|
21
21
|
const GlobalSearchContext = createContext(null);
|
|
22
22
|
function AlgoliaSearchProvider({ children, searchClient: _searchClient, }) {
|
|
@@ -37,9 +37,9 @@ function AlgoliaSearchProvider({ children, searchClient: _searchClient, }) {
|
|
|
37
37
|
host: config.ALGOLIA_HOST,
|
|
38
38
|
}), [_searchClient]);
|
|
39
39
|
const languageCode = useLanguageCode();
|
|
40
|
-
const
|
|
41
|
-
const productsIndexName =
|
|
42
|
-
const productsQuerySuggestionsIndexName =
|
|
40
|
+
const indexes = getAlgoliaIndex(environment, languageCode);
|
|
41
|
+
const productsIndexName = indexes.default;
|
|
42
|
+
const productsQuerySuggestionsIndexName = indexes.suggestions;
|
|
43
43
|
const getSources = useDebouncedCallback(({ query }) => {
|
|
44
44
|
return [
|
|
45
45
|
{
|
|
@@ -145,6 +145,7 @@ function AlgoliaSearchProvider({ children, searchClient: _searchClient, }) {
|
|
|
145
145
|
const globalSearchContextValue = useMemo(() => ({
|
|
146
146
|
autocomplete,
|
|
147
147
|
formRef,
|
|
148
|
+
indexes,
|
|
148
149
|
inputRef,
|
|
149
150
|
panelRef,
|
|
150
151
|
productsIndexName,
|
|
@@ -153,6 +154,7 @@ function AlgoliaSearchProvider({ children, searchClient: _searchClient, }) {
|
|
|
153
154
|
setState,
|
|
154
155
|
state,
|
|
155
156
|
}), [
|
|
157
|
+
indexes,
|
|
156
158
|
autocomplete,
|
|
157
159
|
formRef,
|
|
158
160
|
inputRef,
|
|
@@ -15,9 +15,9 @@ const createSonicSearchClient = ({ apiKey, appId, host, protocol = 'https', }) =
|
|
|
15
15
|
searchClient.transporter.timeouts = { connect: 3000, read: 3000, write: 3000 };
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
searchClient.transporter.read = (request) => {
|
|
18
|
+
searchClient.transporter.read = (request, options) => {
|
|
19
19
|
request.path = `/api/v1/bff/${request.path.replace('*', 'x')}`;
|
|
20
|
-
return read(request);
|
|
20
|
+
return read(request, options);
|
|
21
21
|
};
|
|
22
22
|
return searchClient;
|
|
23
23
|
};
|
|
@@ -2,6 +2,9 @@ import { CartLineModel, CartModel } from '../shared/api/storefront/model/storefr
|
|
|
2
2
|
import { AlgoliaInsightsProviderGlobalState } from './use-algolia-insights-provider-global-state';
|
|
3
3
|
export interface UseAlgoliaEventResult {
|
|
4
4
|
context: Readonly<AlgoliaInsightsProviderGlobalState>;
|
|
5
|
+
sendAddToCartFromFavoritesPageEvent({ cartLine, }: {
|
|
6
|
+
cartLine: CartLineModel;
|
|
7
|
+
}): void;
|
|
5
8
|
sendAddToCartFromProductDetailsPageEvent({ cartLine, }: {
|
|
6
9
|
cartLine: CartLineModel;
|
|
7
10
|
}): void;
|
|
@@ -32,6 +35,10 @@ export interface UseAlgoliaEventResult {
|
|
|
32
35
|
objectId: string;
|
|
33
36
|
position: number;
|
|
34
37
|
}): void;
|
|
38
|
+
sendProductClickFromFavoritesPageEvent({ objectId, position, }: {
|
|
39
|
+
objectId: string;
|
|
40
|
+
position: number;
|
|
41
|
+
}): void;
|
|
35
42
|
sendProductClickFromProductListPageEvent({ objectId, position, }: {
|
|
36
43
|
objectId: string;
|
|
37
44
|
position: number;
|
|
@@ -17,9 +17,27 @@ function useAlgoliaInsights() {
|
|
|
17
17
|
const [, setGlobalState] = useAlgoliaInsightsGlobalState();
|
|
18
18
|
const result = useMemo(() => ({
|
|
19
19
|
context,
|
|
20
|
+
sendAddToCartFromFavoritesPageEvent({ cartLine }) {
|
|
21
|
+
if (!context.index)
|
|
22
|
+
return logger.warn('Unable to send addedToCartObjectIDs event, no index', context);
|
|
23
|
+
aa('addedToCartObjectIDs', {
|
|
24
|
+
currency: getCurrencyFromPriceString(cartLine.pricing?.actualPriceDisplay),
|
|
25
|
+
eventName: 'Favorites: AddToCart Clicked',
|
|
26
|
+
index: context.index,
|
|
27
|
+
objectData: [
|
|
28
|
+
{
|
|
29
|
+
price: cartLine.pricing?.actualPrice || undefined,
|
|
30
|
+
quantity: cartLine.qtyOrdered || undefined,
|
|
31
|
+
queryID: context.queryId,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
objectIDs: [cartLine.erpNumber],
|
|
35
|
+
userToken,
|
|
36
|
+
});
|
|
37
|
+
},
|
|
20
38
|
sendAddToCartFromProductDetailsPageEvent({ cartLine }) {
|
|
21
39
|
if (!context.index)
|
|
22
|
-
return logger.warn('Unable to send
|
|
40
|
+
return logger.warn('Unable to send addedToCartObjectIDsAfterSearch event, no index', context);
|
|
23
41
|
if (context.queryId) {
|
|
24
42
|
aa('addedToCartObjectIDsAfterSearch', {
|
|
25
43
|
currency: getCurrencyFromPriceString(cartLine.pricing?.actualPriceDisplay),
|
|
@@ -56,9 +74,9 @@ function useAlgoliaInsights() {
|
|
|
56
74
|
},
|
|
57
75
|
sendAddToCartFromProductListPageEvent({ cartLine }) {
|
|
58
76
|
if (!context.index)
|
|
59
|
-
return logger.warn('Unable to send
|
|
77
|
+
return logger.warn('Unable to send addedToCartObjectIDsAfterSearch event, no index', context);
|
|
60
78
|
if (!context.queryId)
|
|
61
|
-
return logger.warn('Unable to send
|
|
79
|
+
return logger.warn('Unable to send addedToCartObjectIDsAfterSearch event, no queryId', context);
|
|
62
80
|
aa('addedToCartObjectIDsAfterSearch', {
|
|
63
81
|
currency: getCurrencyFromPriceString(cartLine.pricing?.actualPriceDisplay),
|
|
64
82
|
eventName: 'PLP: AddToCart ClickedAfterSearch',
|
|
@@ -77,7 +95,7 @@ function useAlgoliaInsights() {
|
|
|
77
95
|
},
|
|
78
96
|
sendAddToCartFromSearchEvent({ cartLine, queryId }) {
|
|
79
97
|
if (!context.index)
|
|
80
|
-
return logger.warn('Unable to send
|
|
98
|
+
return logger.warn('Unable to send addedToCartObjectIDsAfterSearch event, no index', context);
|
|
81
99
|
aa('addedToCartObjectIDsAfterSearch', {
|
|
82
100
|
currency: getCurrencyFromPriceString(cartLine.pricing?.actualPriceDisplay),
|
|
83
101
|
eventName: 'SRP: AddToCart ClickedAfterSearch',
|
|
@@ -96,9 +114,9 @@ function useAlgoliaInsights() {
|
|
|
96
114
|
},
|
|
97
115
|
sendAddToCartFromSearchResultPageEvent({ cartLine }) {
|
|
98
116
|
if (!context.index)
|
|
99
|
-
return logger.warn('Unable to send
|
|
117
|
+
return logger.warn('Unable to send addedToCartObjectIDsAfterSearch event, no index', context);
|
|
100
118
|
if (!context.queryId)
|
|
101
|
-
return logger.warn('Unable to send
|
|
119
|
+
return logger.warn('Unable to send addedToCartObjectIDsAfterSearch event, no queryId', context);
|
|
102
120
|
aa('addedToCartObjectIDsAfterSearch', {
|
|
103
121
|
currency: getCurrencyFromPriceString(cartLine.pricing?.actualPriceDisplay),
|
|
104
122
|
eventName: 'SRP: AddToCart ClickedAfterSearch',
|
|
@@ -179,6 +197,26 @@ function useAlgoliaInsights() {
|
|
|
179
197
|
userToken,
|
|
180
198
|
});
|
|
181
199
|
},
|
|
200
|
+
sendProductClickFromFavoritesPageEvent({ objectId, position }) {
|
|
201
|
+
if (!objectId)
|
|
202
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
203
|
+
if (!context.index)
|
|
204
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
205
|
+
if (!context.queryId)
|
|
206
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no queryId', context);
|
|
207
|
+
aa('clickedObjectIDsAfterSearch', {
|
|
208
|
+
eventName: 'Favorites: Product Clicked',
|
|
209
|
+
index: context.index,
|
|
210
|
+
objectIDs: [objectId],
|
|
211
|
+
positions: [position],
|
|
212
|
+
queryID: context.queryId,
|
|
213
|
+
userToken,
|
|
214
|
+
});
|
|
215
|
+
setGlobalState({
|
|
216
|
+
index: context.index,
|
|
217
|
+
queryId: context.queryId,
|
|
218
|
+
});
|
|
219
|
+
},
|
|
182
220
|
sendProductClickFromProductListPageEvent({ objectId, position }) {
|
|
183
221
|
if (!objectId)
|
|
184
222
|
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
@@ -239,7 +277,7 @@ function useAlgoliaInsights() {
|
|
|
239
277
|
},
|
|
240
278
|
sendPurchaseEventFromPaymentPage({ cart }) {
|
|
241
279
|
if (!context.index)
|
|
242
|
-
return logger.warn('Unable to send
|
|
280
|
+
return logger.warn('Unable to send purchasedObjectIDs event, no index', context);
|
|
243
281
|
if (!cart.cartLines || cart.cartLines.length === 0)
|
|
244
282
|
return logger.warn('Unable to send purchasedObjectIDs event, no cartLines', cart);
|
|
245
283
|
aa('purchasedObjectIDs', {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutocompleteCollection, BaseItem, InternalAutocompleteSource } from '@algolia/autocomplete-core';
|
|
1
|
+
import { AutocompleteCollection, BaseItem, InternalAutocompleteSource } from '@algolia/autocomplete-core/dist/esm';
|
|
2
2
|
import { CategoryHit } from '../global-search/plugins/categories-plugin';
|
|
3
3
|
import { PopularCategoryHit } from '../global-search/plugins/popular-categories-plugin';
|
|
4
4
|
import { PopularSearchHit } from '../global-search/plugins/popular-searches-plugin';
|
|
@@ -26,6 +26,7 @@ export declare function useAlgoliaSearch(): {
|
|
|
26
26
|
recentSearches: ExtendedAutoCompleteCollection<RecentSearchHit> | undefined;
|
|
27
27
|
autocomplete: import("..").Autocomplete;
|
|
28
28
|
formRef: React.RefObject<HTMLFormElement>;
|
|
29
|
+
indexes: import("./algolia-index-config").Indexes;
|
|
29
30
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
30
31
|
panelRef: React.RefObject<HTMLDivElement>;
|
|
31
32
|
productsIndexName: string;
|
|
@@ -50,8 +50,6 @@ function ConnectedFavoriteButton({ onFavorited: _onFavorited, onFavoriting: _onF
|
|
|
50
50
|
setShowSignInDialog(true);
|
|
51
51
|
refetch();
|
|
52
52
|
}
|
|
53
|
-
if (isFetching)
|
|
54
|
-
return null;
|
|
55
53
|
return (jsxs(Fragment, { children: [jsx(FavoriteButton, { isDisabled: isFetching, isFavorite: isFavorite, onClick: onFavorite }), jsx(SignInDialog, { isOpen: showSignInDialog, onOpenChange: setShowSignInDialog })] }));
|
|
56
54
|
}
|
|
57
55
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useEffect } from 'react';
|
|
3
4
|
import { Tag } from '../../badges/tag/tag.js';
|
|
4
5
|
import { Link } from '../../buttons/link/link.js';
|
|
5
6
|
import { Price } from '../../display/price/price.js';
|
|
@@ -10,9 +11,11 @@ import { Image } from '../../media/image/image.js';
|
|
|
10
11
|
import styles from './product-card.module.css.js';
|
|
11
12
|
|
|
12
13
|
function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, id, image, onClick, price, route, sku, tags, title, }) {
|
|
13
|
-
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (price.currencyCode)
|
|
16
|
+
return;
|
|
14
17
|
logger.error(`Product '${sku}' does not have a currency code`);
|
|
15
|
-
}
|
|
18
|
+
}, [price.currencyCode, sku]);
|
|
16
19
|
return (jsx("div", { className: styles['product-card-container'], children: jsxs("article", { "aria-labelledby": `title-${id}`, className: styles['product-card'], "data-product-id": sku, id: id, children: [jsx(Link, { className: styles.title, href: href, id: `title-${id}`, onClick: onClick, route: route, children: title }), tags && tags.length > 0 && (jsx("div", { className: styles.tags, children: tags.map(tag => (jsx(Tag, { children: jsx(FormattedMessage, { noTranslationId: true, fallbackValue: tag, id: `tag.${tag.toLowerCase()}` }) }, tag))) })), jsx(ProductSku, { className: styles.sku, sku: sku }), price.currencyCode && (jsx(Price, { className: styles.price, currencyCode: price.currencyCode, isVatIncluded: price.isVatIncluded, originalPrice: price.originalPrice, price: price.price, variant: "sonic" })), jsx("div", { className: styles['image-container'], children: jsx(Image, { ...image, fit: "contain" }) }), jsx("div", { className: styles['add-to-cart-button'], children: AddToCartButton }), jsx("div", { className: styles['favorite-button'], children: FavoriteButton && FavoriteButton })] }) }));
|
|
17
20
|
}
|
|
18
21
|
|
package/dist/exports.d.ts
CHANGED
|
@@ -314,6 +314,7 @@ export * from './shared/api/bff/hooks/cart/use-patch-cart';
|
|
|
314
314
|
export * from './shared/api/bff/hooks/cart/use-place-order';
|
|
315
315
|
export * from './shared/api/bff/hooks/cart/use-save-cart-for-later';
|
|
316
316
|
export * from './shared/api/bff/hooks/use-fetch-announcements';
|
|
317
|
+
export * from './shared/api/bff/hooks/use-fetch-favorites';
|
|
317
318
|
export * from './shared/api/bff/hooks/use-fetch-navigation-links';
|
|
318
319
|
export * from './shared/api/bff/hooks/use-fetch-product-details-page-data';
|
|
319
320
|
export * from './shared/api/bff/hooks/use-fetch-product-listing-page-data';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getAlgoliaResults } from '@algolia/autocomplete-preset-algolia';
|
|
2
|
+
import { getAlgoliaResults } from '../../node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js';
|
|
3
3
|
|
|
4
4
|
const categoriesPlugin = ({ productsIndexName, searchClient, }) => {
|
|
5
5
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutocompletePlugin } from '@algolia/autocomplete-core';
|
|
1
|
+
import { AutocompletePlugin } from '@algolia/autocomplete-core/dist/esm';
|
|
2
2
|
import { Hit } from '@algolia/client-search';
|
|
3
3
|
import { SearchClient } from 'algoliasearch';
|
|
4
4
|
import { ImageType } from '../../shared/model/image';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getAlgoliaResults } from '@algolia/autocomplete-preset-algolia';
|
|
2
|
+
import { getAlgoliaResults } from '../../node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js';
|
|
3
3
|
|
|
4
4
|
const popularCategoriesPlugin = ({ productsIndexName, searchClient, }) => {
|
|
5
5
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions';
|
|
1
|
+
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions/dist/esm';
|
|
2
2
|
import { Hit } from '@algolia/client-search';
|
|
3
3
|
import { SearchClient } from 'algoliasearch';
|
|
4
4
|
export type PopularSearchHit = Hit<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions';
|
|
2
|
+
import { createQuerySuggestionsPlugin } from '../../node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_algoliase_q33j3oaxy2utuyscyksb32r6mu/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/createQuerySuggestionsPlugin.js';
|
|
3
3
|
|
|
4
4
|
const popularSearchesPlugin = ({ searchClient, suggestionsIndexName, }) => createQuerySuggestionsPlugin({
|
|
5
5
|
getSearchParams() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions';
|
|
1
|
+
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions/dist/esm';
|
|
2
2
|
import { Hit } from '@algolia/client-search';
|
|
3
3
|
import { SearchClient } from 'algoliasearch';
|
|
4
4
|
export type QuerySuggestionHit = Hit<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions';
|
|
2
|
+
import { createQuerySuggestionsPlugin } from '../../node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_algoliase_q33j3oaxy2utuyscyksb32r6mu/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/createQuerySuggestionsPlugin.js';
|
|
3
3
|
|
|
4
4
|
const querySuggestionsPlugin = ({ searchClient, suggestionsIndexName, }) => createQuerySuggestionsPlugin({
|
|
5
5
|
getSearchParams({ state }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutocompletePlugin } from '@algolia/autocomplete-core';
|
|
1
|
+
import { AutocompletePlugin } from '@algolia/autocomplete-core/dist/esm';
|
|
2
2
|
import { Hit } from '@algolia/client-search';
|
|
3
3
|
import { SearchClient } from 'algoliasearch';
|
|
4
4
|
import { ImageType } from '../../shared/model/image';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getAlgoliaResults } from '@algolia/autocomplete-preset-algolia';
|
|
2
|
+
import { getAlgoliaResults } from '../../node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js';
|
|
3
3
|
|
|
4
4
|
const quickAccessPlugin = ({ productsIndexName, searchClient, }) => {
|
|
5
5
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createLocalStorageRecentSearchesPlugin } from '@algolia/autocomplete-plugin-recent-searches';
|
|
1
|
+
import { createLocalStorageRecentSearchesPlugin } from '@algolia/autocomplete-plugin-recent-searches/dist/esm';
|
|
2
2
|
import { Hit } from '@algolia/client-search';
|
|
3
3
|
export type RecentSearchHit = Hit<{
|
|
4
4
|
id: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createLocalStorageRecentSearchesPlugin
|
|
2
|
+
import { createLocalStorageRecentSearchesPlugin } from '../../node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/createLocalStorageRecentSearchesPlugin.js';
|
|
3
|
+
import { search } from '../../node_modules/.pnpm/@algolia_autocomplete-plugin-recent-searches@1.19.2_@algolia_client-search@4.24.0_algoliasear_fyqsds3bt3rvcvjy7dxjzgxvaa/node_modules/@algolia/autocomplete-plugin-recent-searches/dist/esm/search.js';
|
|
3
4
|
|
|
4
5
|
const recentSearchesPlugin = createLocalStorageRecentSearchesPlugin({
|
|
5
6
|
key: 'recent-algolia-searches',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { HighlightedHit } from '@algolia/autocomplete-preset-algolia';
|
|
2
|
+
import { HighlightedHit } from '@algolia/autocomplete-preset-algolia/dist/esm';
|
|
3
3
|
type HighlightHitParams<THit> = {
|
|
4
4
|
/**
|
|
5
5
|
* The attribute to retrieve the highlighted parts from.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createElement, Fragment } from 'react';
|
|
3
|
-
import { parseAlgoliaHitHighlight } from '@algolia/autocomplete-preset-algolia';
|
|
3
|
+
import { parseAlgoliaHitHighlight } from '../../node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.js';
|
|
4
4
|
|
|
5
5
|
function Highlight({ attribute, hit, tagName = 'mark', }) {
|
|
6
6
|
return createElement(Fragment, {}, parseAlgoliaHitHighlight({ attribute, hit }).map(({ isHighlighted, value }, index) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AutocompleteApi, AutocompleteState as _AutocompleteState } from '@algolia/autocomplete-core';
|
|
1
|
+
import { AutocompleteApi, AutocompleteState as _AutocompleteState } from '@algolia/autocomplete-core/dist/esm';
|
|
2
2
|
import { SearchClient } from 'algoliasearch';
|
|
3
3
|
import { AlgoliaProductHit } from '../algolia/algolia-hit-type';
|
|
4
|
+
import { Indexes } from '../algolia/algolia-index-config';
|
|
4
5
|
import { CategoryHit } from './plugins/categories-plugin';
|
|
5
6
|
import { PopularCategoryHit } from './plugins/popular-categories-plugin';
|
|
6
7
|
import { PopularSearchHit } from './plugins/popular-searches-plugin';
|
|
@@ -13,6 +14,7 @@ export type AutocompleteState = _AutocompleteState<AutocompleteItem>;
|
|
|
13
14
|
export type GlobalSearchContextValue = {
|
|
14
15
|
autocomplete: Autocomplete;
|
|
15
16
|
formRef: React.RefObject<HTMLFormElement>;
|
|
17
|
+
indexes: Indexes;
|
|
16
18
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
17
19
|
panelRef: React.RefObject<HTMLDivElement>;
|
|
18
20
|
productsIndexName: string;
|
|
@@ -23,7 +23,7 @@ function ConnectedAccountButton({ className, 'data-test-selector': dataTestSelec
|
|
|
23
23
|
const lastName = data?.lastName ? data.lastName.trim() : undefined;
|
|
24
24
|
const customerName = firstName ? [firstName, lastName].join(' ') : undefined;
|
|
25
25
|
const customerCompany = data?.billTo?.companyName;
|
|
26
|
-
return (jsxs(Fragment, { children: [jsx(IconButton, { ref: triggerRef, className: className, "data-authenticated": data?.isAuthenticated ? true : false, "data-test-selector": dataTestSelector, isDisabled: isLoadingSession, onClick: toggle, children: jsx(AccountIcon, { "aria-label": t('My Sonic'), isAuthenticated: data?.isAuthenticated }) }), jsx(Popover, { className: styles['popover'], isOpen: isOpen, onOpenChange: state => (state ? open() : close()), placement: "bottom", triggerRef: triggerRef, children: jsx(QuickAccessMenu, { customerCompany: customerCompany, customerName: customerName, isAuthenticated: data?.isAuthenticated, onSignOut: signOut }) })] }));
|
|
26
|
+
return (jsxs(Fragment, { children: [jsx(IconButton, { ref: triggerRef, className: className, "data-authenticated": data?.isAuthenticated ? true : false, "data-test-selector": dataTestSelector, isDisabled: isLoadingSession, onClick: toggle, children: jsx(AccountIcon, { "aria-label": t('My Sonic'), isAuthenticated: data?.isAuthenticated }) }), jsx(Popover, { className: styles['popover'], isOpen: isOpen, onOpenChange: state => (state ? open() : close()), placement: "bottom", triggerRef: triggerRef, children: jsx(QuickAccessMenu, { className: styles['quick-access-menu'], customerCompany: customerCompany, customerName: customerName, isAuthenticated: data?.isAuthenticated, isGuest: data?.isGuest, onSignOut: signOut }) })] }));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export { ConnectedAccountButton };
|
package/dist/index.js
CHANGED
|
@@ -315,6 +315,7 @@ export { usePatchCart } from './shared/api/bff/hooks/cart/use-patch-cart.js';
|
|
|
315
315
|
export { usePlaceOrder } from './shared/api/bff/hooks/cart/use-place-order.js';
|
|
316
316
|
export { useSaveCartForLater } from './shared/api/bff/hooks/cart/use-save-cart-for-later.js';
|
|
317
317
|
export { useFetchAnnouncements } from './shared/api/bff/hooks/use-fetch-announcements.js';
|
|
318
|
+
export { useFetchFavorites } from './shared/api/bff/hooks/use-fetch-favorites.js';
|
|
318
319
|
export { useFetchNavigationLinks } from './shared/api/bff/hooks/use-fetch-navigation-links.js';
|
|
319
320
|
export { useFetchProductDetailsPageData } from './shared/api/bff/hooks/use-fetch-product-details-page-data.js';
|
|
320
321
|
export { useFetchProductListingPageData } from './shared/api/bff/hooks/use-fetch-product-listing-page-data.js';
|
|
@@ -388,7 +389,7 @@ export { createAdyenSession, fetchAdyenConfig } from './shared/api/storefront/se
|
|
|
388
389
|
export { markProductAsRecentlyViewed } from './shared/api/storefront/services/product-service.js';
|
|
389
390
|
export { fetchTranslations } from './shared/api/storefront/services/translation-service.js';
|
|
390
391
|
export { fetchCountriesLanguages, fetchCountriesWithLanguages, fetchSettings, updateLocale } from './shared/api/storefront/services/website-service.js';
|
|
391
|
-
export { WishListNameAlreadyExistsError, addWishListItemToWishList, createWishList, deleteWishList, deleteWishListItemFromWishList, getWishList, getWishListItemsByWishListId, getWishLists } from './shared/api/storefront/services/wishlist-service.js';
|
|
392
|
+
export { WishListNameAlreadyExistsError, addWishListItemToWishList, createWishList, deleteWishList, deleteWishListItemFromWishList, fetchAllWishListsItems, getWishList, getWishListItemsByWishListId, getWishLists } from './shared/api/storefront/services/wishlist-service.js';
|
|
392
393
|
export { cart } from './shared/data/cart.data.js';
|
|
393
394
|
export { countries, dutch, english, france, french, german, germany, languages, netherlands, switzerland, unitedKingdom } from './shared/data/countries-languages.data.js';
|
|
394
395
|
export { navigationData } from './shared/data/navigation.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Access denied.' | 'Account' | 'active' | 'Add address' | 'Add order notes' | 'Add to cart' | 'Add to list' | 'Address 1' | 'Address 2' | 'Address 3' | 'Address 4' | 'Address not found' | 'Address' | 'Address book' | 'addressProperty.Default' | 'addressProperty.Company Name' | 'addressProperty.Address Line' | 'addressProperty.Postal Code' | 'addressProperty.City' | 'addressProperty.Country' | 'All payment methods are unavailable at this time. Please contact customer support.' | 'Amount: {0}' | 'An error occurred while changing the customer.' | 'An error occurred while fetching customers. Please try again later.' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'ASC' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Back' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Billing' | 'Cancel' | 'Cart' | 'Change customer' | 'Change password' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Checkout order' | 'Chosen filters' | 'City' | 'Clear filters' | 'Create' | 'Clear' | 'Click the button below to continue shopping.' | 'Client cases' | 'Close' | 'CoC number' | 'Company name' | 'Conceal value' | 'Confirm password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Copyright © Sonic Equipment B.V.' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Current Password is invalid' | 'Date' | 'Decrease' | 'Default shipping address' | 'Delivery date' | 'Delivery expected on {0}' | 'DESC' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Edit Sonic account' | 'Edit' | 'Email' | 'Enter your email address and we will send you an email that will allow you to recover your password.' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Favorites' | 'Features' | 'Filter order status' | 'Finalize order' | 'Finalize payment' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Good day' | 'Good morning' | 'Good afternoon' | 'Good evening' | 'Goodnight' | 'Hide filters' | 'Home' | 'If an account matches the email address you entered, instructions on how to recover the password will be sent to that email address shortly. If you do not receive this email, please contact Customer Support.' | 'If you want to proceed, click the continue button. If you want to change your country, close this message and select a different country.' | 'Incl. VAT' | 'Includes' | 'Increase' | 'Industry' | 'industry.AG' | 'industry.AU' | 'industry.AV' | 'industry.BC' | 'industry.MA' | 'industry.MC' | 'industry.OT' | 'industry.PP' | 'industry.TR' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'Log out' | 'Main menu' | 'Make this the default customer' | 'Make this the default ship to address' | 'More than {0} articles' | 'My account' | 'My Sonic' | 'My Sonic menu' | 'Name' | 'Navigate to...' | 'Navigation' | 'New list name' | 'New Password is required and must be different than Current Password' | 'New password' | 'New user?' | 'Next' | 'No countries available. Unable to change address.' | 'No orders found.' | 'No results found. Please refine your search.' | 'Number of favorites' | 'Number of products' | 'of' | 'OK' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order details' | 'Order history' | 'Order number' | 'Order#' | 'Order' | 'orderProperty.Date' | 'orderProperty.Number' | 'orderProperty.PO Number' | 'orderProperty.Price' | 'orderProperty.Shipping Address' | 'orderProperty.Status' | 'Orders' | 'orderStatus.Any' | 'orderStatus.Cancelled' | 'orderStatus.ForwardToReseller' | 'orderStatus.Fulfilled' | 'orderStatus.Partially fulfilled' | 'orderStatus.Processing' | 'orderStatus.Saved' | 'orderStatus.Waiting for customer service' | 'Our products' | 'Overview' | 'Password changed. Please sign in again.' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid email address' | 'Please enter a valid phone number' | 'please go back to your cart.' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Previous' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Remember me' | 'Remove' | 'Remove all' | 'Reorder' | 'Reordering...' | 'Requested delivery date' | 'Results' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved' | 'Saved cart for later.' | 'Saving' | 'Search for a customer' | 'Search' | 'Searching again using more general terms' | 'Search orders' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Select other customer' | 'Selected customer' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Selecting this country will result in your cart to be converted to the currency {0}' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Shopping cart' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sign in or create account' | 'sign in' | 'Sign me up for newsletters and product updates' | 'Signed in' | 'Signed out' | 'Signing in…' | 'Sonic account' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'sort.ASC' | 'sort.DESC' | 'sort.NONE' | 'Specifications' | 'Start checkout' | 'Status' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Suggestions' | 'Support' | 'tag.limited' | 'tag.new' | 'The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support.' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'The order has been added to your cart.' | 'There are more customers, please refine your search if needed.' | 'There are no products in your shopping cart.' | 'There is no information to display' | 'This email is already in use' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to add the order to your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unknown' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Username' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You are not authorized to access this information.' | 'You are not authorized to perform this action' | 'You are not authorized to view customers. Please log in or contact support.' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You have reached the end of the results, but there may be more articles available. Adjust your filters or search to discover more!' | 'You must ' | 'You selected a country where we invoice in a different currency. This will result in your cart being converted to the new currency. If you would like to review your order, ' | 'Your cart has been emptied.' | 'Your email and password were not recognized.' | 'Your favorites are available on multiple devices' | 'Your new Sonic Equipment account was succesfully created. You should receive an email soon with further instructions on how to activate this account. If you do not receive this email, please contact Customer Support.' | 'Your shopping cart is still empty';
|
|
1
|
+
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Access denied.' | 'Account' | 'active' | 'Add address' | 'Add order notes' | 'Add to cart' | 'Add to list' | 'Address 1' | 'Address 2' | 'Address 3' | 'Address 4' | 'Address not found' | 'Address' | 'Address book' | 'addressProperty.Default' | 'addressProperty.Company Name' | 'addressProperty.Address Line' | 'addressProperty.Postal Code' | 'addressProperty.City' | 'addressProperty.Country' | 'All payment methods are unavailable at this time. Please contact customer support.' | 'Amount: {0}' | 'An error occurred while changing the customer.' | 'An error occurred while fetching customers. Please try again later.' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'ASC' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Back' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Billing' | 'Cancel' | 'Cart' | 'Change customer' | 'Change password' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Checkout order' | 'Chosen filters' | 'City' | 'Clear filters' | 'Create' | 'Clear' | 'Click the button below to continue shopping.' | 'Client cases' | 'Close' | 'CoC number' | 'Company name' | 'Conceal value' | 'Confirm password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Copyright © Sonic Equipment B.V.' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Current Password is invalid' | 'Date' | 'Decrease' | 'Default shipping address' | 'Delivery date' | 'Delivery expected on {0}' | 'DESC' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Edit Sonic account' | 'Edit' | 'Email' | 'Enter your email address and we will send you an email that will allow you to recover your password.' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Favorites' | 'Features' | 'Filter order status' | 'Finalize order' | 'Finalize payment' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Good day' | 'Good morning' | 'Good afternoon' | 'Good evening' | 'Goodnight' | 'Guest' | 'Hide filters' | 'Home' | 'If an account matches the email address you entered, instructions on how to recover the password will be sent to that email address shortly. If you do not receive this email, please contact Customer Support.' | 'If you want to proceed, click the continue button. If you want to change your country, close this message and select a different country.' | 'Incl. VAT' | 'Includes' | 'Increase' | 'Industry' | 'industry.AG' | 'industry.AU' | 'industry.AV' | 'industry.BC' | 'industry.MA' | 'industry.MC' | 'industry.OT' | 'industry.PP' | 'industry.TR' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'Log out' | 'Main menu' | 'Make this the default customer' | 'Make this the default ship to address' | 'More than {0} articles' | 'My account' | 'My Sonic' | 'My Sonic menu' | 'Name' | 'Navigate to...' | 'Navigation' | 'New list name' | 'New Password is required and must be different than Current Password' | 'New password' | 'New user?' | 'Next' | 'No countries available. Unable to change address.' | 'No orders found.' | 'No results found. Please refine your search.' | 'Number of favorites' | 'Number of products' | 'of' | 'OK' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order details' | 'Order history' | 'Order number' | 'Order#' | 'Order' | 'orderProperty.Date' | 'orderProperty.Number' | 'orderProperty.PO Number' | 'orderProperty.Price' | 'orderProperty.Shipping Address' | 'orderProperty.Status' | 'Orders' | 'orderStatus.Any' | 'orderStatus.Cancelled' | 'orderStatus.ForwardToReseller' | 'orderStatus.Fulfilled' | 'orderStatus.Partially fulfilled' | 'orderStatus.Processing' | 'orderStatus.Saved' | 'orderStatus.Waiting for customer service' | 'Our products' | 'Overview' | 'Password changed. Please sign in again.' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid email address' | 'Please enter a valid phone number' | 'please go back to your cart.' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Previous' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Remember me' | 'Remove' | 'Remove all' | 'Reorder' | 'Reordering...' | 'Requested delivery date' | 'Results' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved' | 'Saved cart for later.' | 'Saving' | 'Search for a customer' | 'Search' | 'Searching again using more general terms' | 'Search orders' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Select other customer' | 'Selected customer' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Selecting this country will result in your cart to be converted to the currency {0}' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Shopping cart' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sign in or create account' | 'sign in' | 'Sign me up for newsletters and product updates' | 'Signed in' | 'Signed out' | 'Signing in…' | 'Sonic account' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'sort.ASC' | 'sort.DESC' | 'sort.NONE' | 'Specifications' | 'Start checkout' | 'Status' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Suggestions' | 'Support' | 'tag.limited' | 'tag.new' | 'The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support.' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'The order has been added to your cart.' | 'There are more customers, please refine your search if needed.' | 'There are no products in your shopping cart.' | 'There is no information to display' | 'This email is already in use' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to add the order to your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unknown' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Username' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You are not authorized to access this information.' | 'You are not authorized to perform this action' | 'You are not authorized to view customers. Please log in or contact support.' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You have no favorite products yet.' | 'You have reached the end of the results, but there may be more articles available. Adjust your filters or search to discover more!' | 'You must ' | 'You selected a country where we invoice in a different currency. This will result in your cart being converted to the new currency. If you would like to review your order, ' | 'Your cart has been emptied.' | 'Your email and password were not recognized.' | 'Your favorites are available on multiple devices' | 'Your new Sonic Equipment account was succesfully created. You should receive an email soon with further instructions on how to activate this account. If you do not receive this email, please contact Customer Support.' | 'Your shopping cart is still empty';
|
|
@@ -3,6 +3,7 @@ export interface QuickAccessMenuProps {
|
|
|
3
3
|
customerCompany?: string;
|
|
4
4
|
customerName?: string;
|
|
5
5
|
isAuthenticated?: boolean;
|
|
6
|
+
isGuest?: boolean;
|
|
6
7
|
onSignOut?: () => void;
|
|
7
8
|
}
|
|
8
|
-
export declare function QuickAccessMenu({ className, customerCompany, customerName, isAuthenticated, onSignOut, }: QuickAccessMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function QuickAccessMenu({ className, customerCompany, customerName, isAuthenticated, isGuest, onSignOut, }: QuickAccessMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,12 +10,12 @@ import { useGreeting } from '../../shared/utils/greeting.js';
|
|
|
10
10
|
import { Truncated } from '../../text/truncated/truncated.js';
|
|
11
11
|
import styles from './quick-access-menu.module.css.js';
|
|
12
12
|
|
|
13
|
-
function QuickAccessMenu({ className, customerCompany, customerName, isAuthenticated, onSignOut, }) {
|
|
13
|
+
function QuickAccessMenu({ className, customerCompany, customerName, isAuthenticated, isGuest, onSignOut, }) {
|
|
14
14
|
const t = useFormattedMessage();
|
|
15
15
|
const paths = usePaths();
|
|
16
16
|
const greeting = useGreeting();
|
|
17
17
|
const links = useMySonicNavigationItems().filter(item => isMySonicNavigationLink(item));
|
|
18
|
-
return (jsxs("section", { "aria-label": t('My Sonic menu'), className: clsx(styles['quick-access-menu'], className), "data-test-selector": "quickAccessMenu", children: [jsxs("header", { className: styles['header'], children: [jsx("h2", { className: styles['title'], "data-test-selector": "quickAccessMenuTitle", children: `${greeting}${customerName || customerCompany ? ',' : ''}` }), customerName && (jsx(Truncated, { className: styles['name'], "data-test-selector": "quickAccessMenuCustomerName", lines: 2, children: customerName })), customerCompany && (jsx(Truncated, { className: styles['company'], "data-test-selector": "quickAccessMenuCustomerCompany", lines: 2, children: customerCompany }))] }), isAuthenticated && (jsx("nav", { className: styles['navigation'], children: jsx("ul", { children: links.map(link => (jsx("li", { className: styles['item'], children: jsx(Link, { className: styles['link'], "data-test-selector": link['data-test-selector'], href: link.path, children: t(link.label) }) }, link.path))) }) })), jsxs("div", { className: styles['actions'], children: [isAuthenticated && (jsx(Button, { withArrow: true, "data-test-selector": "logoutButton", onClick: onSignOut, size: "sm", children: t('Log out') })), !isAuthenticated && (jsxs(Fragment, { children: [jsx(Button, { withArrow: true, "data-test-selector": "signInButton", href: paths.SIGN_IN, size: "sm", children: t('sign in') }), jsx(Button, { withArrow: true, color: "secondary", "data-test-selector": "createAccountButton", href: paths.ACCOUNT_CREATE, size: "sm", variant: "outline", children: t('create account') })] }))] })] }));
|
|
18
|
+
return (jsxs("section", { "aria-label": t('My Sonic menu'), className: clsx(styles['quick-access-menu'], className), "data-test-selector": "quickAccessMenu", children: [jsxs("header", { className: styles['header'], children: [jsx("h2", { className: styles['title'], "data-test-selector": "quickAccessMenuTitle", children: `${greeting}${customerName || customerCompany ? ',' : ''}` }), !isGuest && customerName && (jsx(Truncated, { className: styles['name'], "data-test-selector": "quickAccessMenuCustomerName", lines: 2, children: customerName })), !isGuest && customerCompany && (jsx(Truncated, { className: styles['company'], "data-test-selector": "quickAccessMenuCustomerCompany", lines: 2, children: customerCompany })), isGuest && t('Guest')] }), !isGuest && isAuthenticated && (jsx("nav", { className: styles['navigation'], children: jsx("ul", { children: links.map(link => (jsx("li", { className: styles['item'], children: jsx(Link, { className: styles['link'], "data-test-selector": link['data-test-selector'], href: link.path, children: t(link.label) }) }, link.path))) }) })), jsxs("div", { className: styles['actions'], children: [isAuthenticated && (jsx(Button, { withArrow: true, "data-test-selector": "logoutButton", onClick: onSignOut, size: "sm", children: t('Log out') })), !isAuthenticated && (jsxs(Fragment, { children: [jsx(Button, { withArrow: true, "data-test-selector": "signInButton", href: paths.SIGN_IN, size: "sm", children: t('sign in') }), jsx(Button, { withArrow: true, color: "secondary", "data-test-selector": "createAccountButton", href: paths.ACCOUNT_CREATE, size: "sm", variant: "outline", children: t('create account') })] }))] })] }));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export { QuickAccessMenu };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { warn } from '../../../../../../@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/warn.js';
|
|
2
|
+
|
|
3
|
+
function checkOptions(options) {
|
|
4
|
+
process.env.NODE_ENV !== 'production' ? warn(!options.debug, 'The `debug` option is meant for development debugging and should not be used in production.') : void 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { checkOptions };
|