@sonic-equipment/ui 0.0.56 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -4092,6 +4092,28 @@ declare function AlgoliaResultsCount(): string | null;
|
|
|
4092
4092
|
|
|
4093
4093
|
declare function AlgoliaSortBy(): react_jsx_runtime.JSX.Element | null;
|
|
4094
4094
|
|
|
4095
|
+
interface UseAlgoliaEventResult {
|
|
4096
|
+
context: Readonly<AlgoliaInsightsProviderGlobalState>;
|
|
4097
|
+
sendAddToCartFromProductListPageEvent({ objectId, }: {
|
|
4098
|
+
objectId: string;
|
|
4099
|
+
}): void;
|
|
4100
|
+
sendAddToCartFromSearchEvent({ objectId, queryId, }: {
|
|
4101
|
+
objectId: string;
|
|
4102
|
+
queryId: string;
|
|
4103
|
+
}): void;
|
|
4104
|
+
sendProductClickFromProductListPageEvent({ objectId, position, }: {
|
|
4105
|
+
objectId: string;
|
|
4106
|
+
position: number;
|
|
4107
|
+
}): void;
|
|
4108
|
+
sendProductClickFromSearchEvent({ index, objectId, position, queryId, }: {
|
|
4109
|
+
index: string;
|
|
4110
|
+
objectId: string | string[] | undefined;
|
|
4111
|
+
position: number | number[];
|
|
4112
|
+
queryId: string;
|
|
4113
|
+
}): void;
|
|
4114
|
+
}
|
|
4115
|
+
declare function useAlgoliaInsights(): UseAlgoliaEventResult;
|
|
4116
|
+
|
|
4095
4117
|
interface GlobalSearchProps {
|
|
4096
4118
|
children: ReactNode;
|
|
4097
4119
|
searchClient?: SearchClient;
|
|
@@ -4278,4 +4300,8 @@ declare const useGlobalSearchDisclosure: () => {
|
|
|
4278
4300
|
toggle: VoidFunction;
|
|
4279
4301
|
};
|
|
4280
4302
|
|
|
4281
|
-
|
|
4303
|
+
declare function ReactQueryContainer({ children }: {
|
|
4304
|
+
children: ReactNode;
|
|
4305
|
+
}): react_jsx_runtime.JSX.Element;
|
|
4306
|
+
|
|
4307
|
+
export { Accordion, type AccountCollectionModel, type AccountModel, type AccountPaymentProfileCollectionModel, type AccountPaymentProfileModel, type AccountSettingsModel, type AccountShipToCollectionModel, type AccountShipToModel, type AccountsReceivableDto, type AddProductToCurrentCartParams, AddToCartButton, type AddressFieldCollectionModel, type AddressFieldDisplayCollectionModel, type AddressFieldDisplayModel, type AgingBucketDto, AlgoliaActiveCategories, AlgoliaCategoriesFilters, AlgoliaFilterPanel, type AlgoliaFilterPanelProps, AlgoliaInsightInstantSearchProvider, AlgoliaInsightsProvider, AlgoliaInsightsProviderContext, type AlgoliaInsightsProviderState, AlgoliaMultiSelectFilterSection, AlgoliaPagination, AlgoliaProvider, AlgoliaResultsCount, AlgoliaSortBy, type AttributeTypeDto, type AttributeTypeFacetModel, type AttributeTypeModel, type AttributeValueDto, type AttributeValueFacetModel, type AttributeValueModel, type AutocompleteItemModel, type AutocompleteModel, type AutocompleteProductCollectionModel, type AutocompleteProductModel, type AutocompleteProps$1 as AutocompleteProps, type AvailabilityDto$2 as AvailabilityDto, AvailabilityMessageType$2 as AvailabilityMessageType, BadgeImagePlacementValues, type BadgeModel, BadgeStyleValues, BadgeTypeValues, type BaseAddressModel, type BaseModel$1 as BaseModel, type BillToCollectionModel, type BillToModel, type BrandAlphabetLetterModel, type BrandAlphabetModel, type BrandAutocompleteModel, type BrandCategoryCollectionModel, type BrandCategoryModel, type BrandCollectionModel, type BrandDto$2 as BrandDto, type BrandModel, type BrandProductLineCollectionModel, type BrandProductLineModel, type BreadCrumb, type BreadCrumbModel, Breadcrumb, type BreadcrumbProps, type BreakPriceDto$2 as BreakPriceDto, type BreakPriceRfqModel, type BudgetCalendarCollectionModel, type BudgetCalendarModel, type BudgetCollectionModel, type BudgetLineModel, type BudgetModel, Button, type ButtonProps, type CalculationMethod, type CarrierDto, type CartCollectionModel, type CartLineCollectionModel, type CartLineModel$2 as CartLineModel, type CartModel, CartProvider, type CartSettingsModel, type CatalogPageModel, type Category$1 as Category, CategoryCarousel, type CategoryCarouselProps, type CategoryCollectionModel, type CategoryFacetModel, type CategoryModel, Checkbox, type CheckboxProps$1 as CheckboxProps, type ChildTraitValueModel, ColorCheckbox, type ColorCheckboxProps, type ConfigSectionDto, type ConfigSectionModel, type ConfigSectionOptionDto, type ConfigurationModel, ConnectedAddToCartButton, type ContactUsModel, type ContentModel, type CostCodeDto, type CostCodeModel, type CountryCollectionModel, type CountryModel, type CreditCardBillingAddressDto, type CreditCardDto, type CrossSellCollectionModel, type CurrencyCollectionModel, type CurrencyModel, CurrencyPositioningType, type CustomerCostCodeDto, type CustomerOrderTaxDto, type CustomerSettingsModel, type CustomerValidationDto, type DashboardPanelCollectionModel, type DashboardPanelModel, type DealerCollectionModel, type DealerModel, type DetailModel, type DocumentDto, type DocumentModel, type ECheckDto, type FacetModel, FavoriteButton, type FavoriteButtonProps, FavoriteProvider, type FetchProductListingPageDataArgs, type FieldScoreDetailedDto, type FieldScoreDetailedModel, type FieldScoreDto, type FieldScoreModel, type FieldValidationDto, type FilterOption, FilterSection, type Filters, FormattedMessage, type FormattedMessageFunction, type FormattedMessageProps, GlobalSearch, GlobalSearchContainer, GlobalSearchDisclosureContext, GlobalStateProvider, GlobalStateProviderContext, IconButton, type IconButtonProps, Image, type ImageModel, IntlProvider, type InventoryAvailabilityDto, type InventoryWarehousesDto, type InvoiceCollectionModel, type InvoiceHistoryTaxDto, type InvoiceLineModel, type InvoiceModel, type InvoiceSettingsModel, type JobQuoteCollectionModel, type JobQuoteLineModel, type JobQuoteModel, type LanguageCollectionModel, type LanguageModel, type LegacyConfigurationDto, type Link$1 as Link, LinkButton, type LinkButtonProps, LoadingOverlay, type MessageCollectionModel, type MessageModel, type MobileAppSettingsModel, type MobileContentModel, type MobilePageDto, type MobileWidgetDto, MultiSelect, type MultiSelectProps, type NavigateFn, type NavigateOptions$1 as NavigateOptions, NumberField, type NumberFieldSize, type OrderApprovalCollectionModel, type OrderCollectionModel, type OrderHistoryTaxDto, type OrderLineModel, type OrderModel, type OrderPromotionModel, type OrderRequestModel, type OrderSettingsModel, type OrderStatusMappingCollectionModel, type OrderStatusMappingModel, Page, PageContainer, type PageProps, type PaginationModel, type PaymentMethodDto, type PaymentOptionsDto, type PersonaModel, type PoRequisitionModel, type PriceFacetModel, type PriceRangeModel, type PricingRfqModel, type ProductAutocompleteItemModel, type ProductAvailabilityModel, ProductCard, type ProductCardProps, type ProductCollectionModel, type ProductDto, type ProductHit$1 as ProductHit, type ProductImageDto, type ProductInventoryDto, type ProductLineDto, type ProductLineModel, ProductListingPage, type ProductListingPageDataResponse, type ProductListingPageProps, type ProductModel, ProductOverviewGrid, type ProductOverviewGridProps, ProductPrice, type ProductPriceDto$2 as ProductPriceDto, type ProductPriceModel, type ProductPriceProps, type ProductSettingsModel, ProductSku, type ProductSkuProps, type ProductSubscriptionDto$2 as ProductSubscriptionDto, type ProductSubscriptionModel, type ProductUnitOfMeasureDto, type ProfileTransactionRequestModel, ProgressCircle, type ProgressCircleProps, type PromoCard$1 as PromoCard, type PromoCards, type PromotionCollectionModel, type PromotionModel, type QuoteCollectionModel, type QuoteLineModel, type QuoteModel, type QuoteSettingsModel, ReactQueryContainer, type RealTimeCartInventoryModel, type RealTimeInventoryModel, type RealTimePricingModel, type RefinementListItem, type RelatedProductDto, type RequisitionCollectionModel, type RequisitionLineCollectionModel, type RequisitionLineModel, type RequisitionModel, type RmaLineDto, type RmaModel, RouteButton, RouteLink, RouteProvider, type RouteProviderProps, type SalespersonModel, type ScoreExplanationDto, type ScoreExplanationModel, SearchResultsPage, type SectionOptionDto$2 as SectionOptionDto, type SectionOptionModel, Select, type SelectProps, type SessionModel, type SessionRequestModel, type SettingsCollectionModel, type SetupRequestModel, type ShareEntityModel, type ShareOrderModel, type ShipToCollectionModel, type ShipToModel, type ShipViaDto, type ShipmentPackageDto, type ShipmentPackageLineDto, ShowAll, type ShowAllProps, Sidebar, SidebarDetectBreakpoint, type SidebarProps, SidebarProvider, type SiteMessageCollectionModel, type SiteMessageModel, type SortOptionModel, type SpecificationDto, type SpecificationModel, type StateCollectionModel, type StateModel, type StyleTraitDto, type StyleValueDto, type StyledProductDto, type SuggestionModel, type TellAFriendModel, TextField, type TraitValueModel, type TranslationDictionaryCollectionModel, type TranslationDictionaryModel, type TranslationId, type UnitOfMeasureModel, type UpdateCartLineParams, type UpdateGlobalState$1 as UpdateGlobalState, type UpdateWishListLineCollectionModel, type UseAlgoliaEventResult, VariantDisplayTypeValues, type VariantTraitModel, type VmiBinCollectionModel, type VmiBinCountModel, type VmiBinModel, type VmiCountCollectionModel, type VmiCountModel, type VmiLocationCollectionModel, type VmiLocationModel, type VmiNoteCollectionModel, type VmiNoteModel, type VmiUserImportCollectionModel, type VmiUserImportModel, type VmiUserModel, type WarehouseCollectionModel, type WarehouseDto, type WarehouseModel, type WebsiteModel, type WebsiteSettingsModel, type WishListCollectionModel, type WishListEmailScheduleModel, type WishListLineCollectionModel, type WishListLineModel, type WishListModel, type WishListSettingsModel, type WishListShareModel, config, configPerEnvironment, createSonicSearchClient, transformAlgoliaProductHitToProductHit, useAddProductToCurrentCart, useAlgolia, useAlgoliaInsights, useAlgoliaSearch, useBreakpoint, useCartEvents, useDebouncedCallback, useDeleteCartLineById, useDisclosure, useFavorite, useFavoriteProduct, useFetchCurrentCartLines, useFetchProductListingPageData, useFormattedMessage, useGlobalSearchDisclosure, useGlobalState, useNavigate, useScrollLock, useUpdateCartLineById, userToken, userTokenEventEmitter };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
1
|
+
import { useQuery, useQueryClient, useMutation, QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
2
2
|
import qs from 'query-string';
|
|
3
3
|
import React, { useState, useCallback, useEffect, useRef, createContext, useContext, forwardRef, useLayoutEffect, Children, cloneElement, createElement as createElement$1, useMemo, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
@@ -16,7 +16,7 @@ import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query
|
|
|
16
16
|
import { createLocalStorageRecentSearchesPlugin, search } from '@algolia/autocomplete-plugin-recent-searches';
|
|
17
17
|
import { TransitionGroup, Transition } from 'react-transition-group';
|
|
18
18
|
|
|
19
|
-
const sandboxUrls = /local|insitesandbox.com|azurestaticapps|ui.sonic-equipment.com|sandbox/i;
|
|
19
|
+
const sandboxUrls = /local|insitesandbox.com|azurestaticapps|ui.sonic-equipment.com|sandbox|accept|test/i;
|
|
20
20
|
const productionUrls = /sonic-equipment.com|production/i;
|
|
21
21
|
let environmentUrl;
|
|
22
22
|
function getEnvironment() {
|
|
@@ -57,7 +57,7 @@ const configPerEnvironment = {
|
|
|
57
57
|
ALGOLIA_PROXY_HOST: 'sonicequipment.commerce.insitesandbox.com',
|
|
58
58
|
PROXY_API_URL: 'https://shop.sonic-equipment.com/api/v1/bff',
|
|
59
59
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
60
|
-
SHOP_API_URL: '',
|
|
60
|
+
SHOP_API_URL: 'https://shop.sonic-equipment.com',
|
|
61
61
|
},
|
|
62
62
|
sandbox: {
|
|
63
63
|
ALGOLIA_API_KEY: 'e0edf30798a6b2e4e44fd25f0f2f9646',
|
|
@@ -65,8 +65,9 @@ const configPerEnvironment = {
|
|
|
65
65
|
ALGOLIA_HOST: 'test-bff.shop.sonic-equipment.com',
|
|
66
66
|
ALGOLIA_PROXY_HOST: 'sonicequipment.commerce.insitesandbox.com',
|
|
67
67
|
PROXY_API_URL: 'https://sonicequipment.commerce.insitesandbox.com/api/v1/bff',
|
|
68
|
+
SHOP_API_URL:
|
|
68
69
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
69
|
-
|
|
70
|
+
'https://sonicequipment.commerce.insitesandbox.com',
|
|
70
71
|
},
|
|
71
72
|
};
|
|
72
73
|
const config = configPerEnvironment[environment];
|
|
@@ -8410,4 +8411,18 @@ function GlobalSearch({ children, searchClient }) {
|
|
|
8410
8411
|
return (jsx(GlobalSearchContainer, { children: jsx(AlgoliaSearchProvider, { searchClient: searchClient, children: jsxs("div", { className: styles$a['search-wrapper'], children: [children, jsx("div", { className: styles$a['search-root'], children: jsx(SearchRoot, {}) })] }) }) }));
|
|
8411
8412
|
}
|
|
8412
8413
|
|
|
8413
|
-
|
|
8414
|
+
const queryClient = new QueryClient({
|
|
8415
|
+
defaultOptions: {
|
|
8416
|
+
queries: {
|
|
8417
|
+
/* Set gcTime and staleTime to 0 to disable react query cache */
|
|
8418
|
+
gcTime: 24 * 60 * 60 * 1000,
|
|
8419
|
+
retry: false,
|
|
8420
|
+
staleTime: 24 * 60 * 60 * 1000,
|
|
8421
|
+
},
|
|
8422
|
+
},
|
|
8423
|
+
});
|
|
8424
|
+
function ReactQueryContainer({ children }) {
|
|
8425
|
+
return (jsx(QueryClientProvider, { client: queryClient, children: children }));
|
|
8426
|
+
}
|
|
8427
|
+
|
|
8428
|
+
export { Accordion, AddToCartButton, AlgoliaActiveCategories, AlgoliaCategoriesFilters, AlgoliaFilterPanel, AlgoliaInsightInstantSearchProvider, AlgoliaInsightsProvider, AlgoliaInsightsProviderContext, AlgoliaMultiSelectFilterSection, AlgoliaPagination, AlgoliaProvider, AlgoliaResultsCount, AlgoliaSortBy, AvailabilityMessageType, BadgeImagePlacementValues, BadgeStyleValues, BadgeTypeValues, Breadcrumb, Button, CartProvider, CategoryCarousel, Checkbox, ColorCheckbox, ConnectedAddToCartButton, CurrencyPositioningType, FavoriteButton, FavoriteProvider, FilterSection, FormattedMessage, GlobalSearch, GlobalSearchContainer, GlobalSearchDisclosureContext, GlobalStateProvider, GlobalStateProviderContext, IconButton, Image, IntlProvider, LinkButton, LoadingOverlay, MultiSelect, NumberField, Page, PageContainer, ProductCard, ProductListingPage, ProductOverviewGrid, ProductPrice, ProductSku, ProgressCircle, ReactQueryContainer, RouteButton, RouteLink, RouteProvider, SearchResultsPage, Select, ShowAll, Sidebar, SidebarDetectBreakpoint, SidebarProvider, TextField, VariantDisplayTypeValues, config, configPerEnvironment, createSonicSearchClient, transformAlgoliaProductHitToProductHit, useAddProductToCurrentCart, useAlgolia, useAlgoliaInsights, useAlgoliaSearch, useBreakpoint, useCartEvents, useDebouncedCallback, useDeleteCartLineById, useDisclosure, useFavorite, useFavoriteProduct, useFetchCurrentCartLines, useFetchProductListingPageData, useFormattedMessage, useGlobalSearchDisclosure, useGlobalState, useNavigate, useScrollLock, useUpdateCartLineById, userToken, userTokenEventEmitter };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -63,7 +63,9 @@ export * from './algolia/algolia-insights-provider';
|
|
|
63
63
|
export * from './algolia/algolia-provider';
|
|
64
64
|
export * from './algolia/algolia-results-count';
|
|
65
65
|
export * from './algolia/algolia-sort-by';
|
|
66
|
+
export * from './algolia/use-algolia-insights';
|
|
66
67
|
export * from './global-search/global-search';
|
|
67
68
|
export * from './global-search/global-search-provider/global-search-container';
|
|
68
69
|
export * from './algolia/use-algolia-search';
|
|
69
70
|
export * from './global-search/global-search-provider/use-search-disclosure';
|
|
71
|
+
export * from './shared/providers/react-query-container';
|
package/dist/styles.css
CHANGED
|
@@ -2992,10 +2992,11 @@
|
|
|
2992
2992
|
}
|
|
2993
2993
|
|
|
2994
2994
|
.no-search-module-87NKV .no-search-module-dtT5J {
|
|
2995
|
-
display:
|
|
2995
|
+
display: grid;
|
|
2996
2996
|
width: 153px;
|
|
2997
2997
|
height: 272px;
|
|
2998
2998
|
cursor: pointer;
|
|
2999
|
+
place-items: center;
|
|
2999
3000
|
}
|
|
3000
3001
|
|
|
3001
3002
|
@media (width >= 768px) {
|