@sonic-equipment/ui 202.0.0 → 204.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/address-info-display/address-info-display.js +1 -0
- package/dist/algolia/filter-section.js +1 -0
- package/dist/badges/badge/icon-with-badge/icon-with-badge.js +1 -0
- package/dist/badges/tag/tag.js +1 -0
- package/dist/breadcrumbs/breadcrumb.js +7 -16
- package/dist/breadcrumbs/breadcrumb.module.css.js +1 -1
- package/dist/buttons/add-to-cart-button/add-to-cart-button.d.ts +1 -1
- package/dist/buttons/add-to-cart-button/add-to-cart-button.js +12 -13
- package/dist/cards/data-card/data-card.js +1 -0
- package/dist/cards/orderline-card/orderline-card.js +1 -0
- package/dist/carousel/category-carousel/category-carousel.js +1 -0
- package/dist/carousel/usp-carousel/product-usp-carousel-slide.js +1 -0
- package/dist/carousel/usp-carousel/product-usp-carousel.js +1 -0
- package/dist/cart-totals/cart-totals-summary.js +1 -0
- package/dist/collapsables/accordion/accordion-item.js +6 -5
- package/dist/collapsables/accordion/accordion.js +1 -0
- package/dist/collapsables/accordion/accordion.module.css.js +1 -1
- package/dist/cookies/client-cookie-context.d.ts +3 -0
- package/dist/cookies/client-cookie-context.js +30 -0
- package/dist/cookies/cookie-context.d.ts +2 -0
- package/dist/cookies/cookie-context.js +6 -0
- package/dist/cookies/cookie-provider.d.ts +6 -0
- package/dist/cookies/cookie-provider.js +10 -0
- package/dist/cookies/readonly-cookie-reader.d.ts +2 -0
- package/dist/cookies/readonly-cookie-reader.js +18 -0
- package/dist/cookies/types.d.ts +14 -0
- package/dist/cookies/types.js +7 -0
- package/dist/{shared/hooks → cookies}/use-cookie.d.ts +1 -2
- package/dist/cookies/use-cookie.js +30 -0
- package/dist/country-select/hooks/use-countries.js +2 -1
- package/dist/country-selector/connected-country-selector.js +1 -1
- package/dist/country-selector/use-countries-languages.js +3 -11
- package/dist/display/info-display/info-display.js +1 -0
- package/dist/display/product-sku/product-sku.js +1 -0
- package/dist/exports.d.ts +6 -1
- package/dist/forms/layout/form/form-segment-group.js +1 -0
- package/dist/forms/layout/form/form-segment.js +1 -0
- package/dist/forms/partials/password-validation/password-validation.js +1 -0
- package/dist/global-search/plugins/categories-plugin.js +1 -0
- package/dist/global-search/plugins/popular-categories-plugin.js +1 -0
- package/dist/global-search/plugins/popular-searches-plugin.js +1 -0
- package/dist/global-search/plugins/query-suggestions-plugin.js +1 -0
- package/dist/global-search/plugins/quick-access-plugin.js +1 -0
- package/dist/global-search/plugins/recent-searches-plugin.js +1 -0
- package/dist/global-search/search-highlight/highlight.js +1 -0
- package/dist/global-search/search-result-panel/sections/section-container.js +1 -0
- package/dist/global-search/search-section/search-list.js +1 -0
- package/dist/global-search/search-section/search-section.js +1 -0
- package/dist/header/buttons/account/connected-account-button.js +1 -8
- package/dist/header/drawers/search-drawer.js +1 -0
- package/dist/header/header-layout/header-layout.js +1 -0
- package/dist/icons/glyph/glyphs-arrow-blackcaps-right-icon.js +1 -0
- package/dist/icons/glyph/glyphs-arrow-boldcaps-left-icon.js +1 -0
- package/dist/icons/glyph/glyphs-arrow-boldcaps-right-icon.js +1 -0
- package/dist/icons/glyph/glyphs-arrow-semibold-right-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-bold-down-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-bold-up-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-down-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-left-icon.js +1 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-right-icon.js +1 -0
- package/dist/icons/solid/solid-attention-icon.js +1 -0
- package/dist/icons/solid/solid-cart-icon.js +1 -0
- package/dist/icons/solid/solid-close-icon.js +1 -0
- package/dist/icons/solid/solid-favorite-icon.js +1 -0
- package/dist/icons/solid/solid-home-icon.js +1 -0
- package/dist/icons/solid/solid-information-icon.js +1 -0
- package/dist/icons/solid/solid-login-icon.js +1 -0
- package/dist/icons/solid/solid-logout-icon.js +1 -0
- package/dist/icons/solid/solid-news-icon.js +1 -0
- package/dist/icons/solid/solid-notice-icon.js +1 -0
- package/dist/icons/solid/solid-okay-icon.js +1 -0
- package/dist/icons/solid/solid-rating-icon.js +1 -0
- package/dist/icons/solid/solid-salecategory-icon.js +1 -0
- package/dist/icons/solid/solid-tag-icon.js +1 -0
- package/dist/icons/stroke/stroke-categories-icon.js +1 -0
- package/dist/icons/stroke/stroke-checkmark-icon.js +1 -0
- package/dist/icons/stroke/stroke-closebox-icon.js +1 -0
- package/dist/icons/stroke/stroke-dehashed-icon.js +1 -0
- package/dist/icons/stroke/stroke-download-icon.js +1 -0
- package/dist/icons/stroke/stroke-event-icon.js +1 -0
- package/dist/icons/stroke/stroke-favorite-icon.js +1 -0
- package/dist/icons/stroke/stroke-filter-icon.js +1 -0
- package/dist/icons/stroke/stroke-hashed-icon.js +1 -0
- package/dist/icons/stroke/stroke-information-icon.js +1 -0
- package/dist/icons/stroke/stroke-minus-icon.js +1 -0
- package/dist/icons/stroke/stroke-plus-icon.js +1 -0
- package/dist/icons/stroke/stroke-recent-icon.js +1 -0
- package/dist/icons/stroke/stroke-search-icon.js +1 -0
- package/dist/icons/stroke/stroke-trash-icon.js +1 -0
- package/dist/index.js +7 -2
- package/dist/intl/use-formatted-date.js +1 -0
- package/dist/layout/center.js +1 -0
- package/dist/lists/download-document-list/download-document-list.js +1 -0
- package/dist/lists/feature-list/feature-list.js +1 -0
- package/dist/lists/icon-list/icon-list.js +1 -0
- package/dist/lists/menu-list/menu-list-header.js +1 -0
- package/dist/lists/menu-list/use-menu-list-item.js +1 -0
- package/dist/lists/menu-list/use-menu-list.js +1 -0
- package/dist/lists/product-overview-grid/product-overview-grid.js +1 -0
- package/dist/loading/blank-page-spacer.js +1 -0
- package/dist/loading/dynamic-loading-overlay.js +1 -0
- package/dist/loading/loading-overlay.js +1 -0
- package/dist/loading/progress-circle.js +1 -0
- package/dist/media/image-grid/images-grid.d.ts +2 -1
- package/dist/media/image-grid/images-grid.js +2 -2
- package/dist/media/image-lightbox/image-lightbox.d.ts +2 -1
- package/dist/media/image-lightbox/image-lightbox.js +2 -2
- package/dist/message/message.js +1 -0
- package/dist/pages/account/components/create-account-form/create-account-form.js +1 -1
- package/dist/pages/account/create-account-page/create-account-page.js +5 -3
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.d.ts +2 -1
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.js +2 -4
- package/dist/pages/account/sign-in-page/sign-in-page.js +2 -2
- package/dist/pages/checkout/cart-page/cart-page.js +1 -1
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-content.js +1 -0
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-header.js +1 -0
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-link.js +1 -0
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.js +1 -0
- package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +1 -1
- package/dist/pages/checkout/payment-page/hooks/use-has-returned-from-adyen.js +1 -0
- package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.js +1 -0
- package/dist/pages/components/page-container/page-container.js +1 -0
- package/dist/pages/components/page-meta-data/page-meta-data.js +1 -0
- package/dist/pages/loading-page/loading-page.js +1 -0
- package/dist/pages/my-sonic/actions/change-password/change-password-dialog.js +1 -0
- package/dist/pages/my-sonic/actions/change-password/change-password.js +1 -0
- package/dist/pages/my-sonic/actions/change-password/connected-change-password-dialog.js +1 -0
- package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.js +1 -0
- package/dist/pages/my-sonic/navigation/my-sonic-navigation-items.js +1 -0
- package/dist/pages/my-sonic/widgets/connected-bill-to-address-widget.js +2 -1
- package/dist/pages/my-sonic/widgets/connected-ship-to-address-widget.js +2 -1
- package/dist/pages/product/layouts/product-details-page-layout/product-details-page-layout.js +1 -0
- package/dist/pages/product/product-details-page/components/product-details-images/product-detail-images.js +1 -3
- package/dist/pages/product/product-details-page/components/product-details-images/product-detail-images.module.css.js +1 -1
- package/dist/pages/product/product-details-page/product-details.js +5 -1
- package/dist/pages/product/product-listing-page/no-results/no-results.js +3 -1
- package/dist/promos/promo-banner/promo-banner.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-announcements.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-navigation-links.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-product-details-page-data.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-product-listing-page-data.js +1 -0
- package/dist/shared/api/bff/hooks/use-fetch-recently-viewed-products.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-fetch-session.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-invalidate-session.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-is-authenticated.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-patch-session.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-recover-password.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-sign-in.js +1 -0
- package/dist/shared/api/storefront/hooks/authentication/use-sign-out.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-add-product-to-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-delete-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-cart-by-id.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-checkout-atp.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-count.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-product-atp.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-promotions.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js +7 -4
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-invalidate-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-patch-cart-line-by-id.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-patch-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-place-order.js +1 -0
- package/dist/shared/api/storefront/hooks/cart/use-save-cart-for-later.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-addresses.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-current-ship-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-by-customer-id.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-addresses.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-patch-ship-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/customer/use-post-ship-to-address.js +1 -0
- package/dist/shared/api/storefront/hooks/orders/use-fetch-orders.js +1 -0
- package/dist/shared/api/storefront/hooks/payment/use-create-adyen-session.js +1 -0
- package/dist/shared/api/storefront/hooks/payment/use-fetch-adyen-config.js +1 -0
- package/dist/shared/api/storefront/hooks/payment/use-invalidate-adyen.js +1 -0
- package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.d.ts +5 -3
- package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.js +5 -8
- package/dist/shared/api/storefront/hooks/translation/use-fetch-translations.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries-languages.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-country-models.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-settings.js +1 -0
- package/dist/shared/api/storefront/hooks/website/use-update-locale.js +1 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js +1 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-wishlist.js +1 -1
- package/dist/shared/api/storefront/hooks/wishlist/use-create-wishlist.js +1 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js +1 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items.js +1 -1
- package/dist/shared/api/storefront/hooks/wishlist/use-fetch-wishlists.js +1 -0
- package/dist/shared/api/storefront/services/website-service.js +9 -0
- package/dist/shared/feature-flags/use-feature-flags.js +1 -0
- package/dist/shared/hooks/use-debounced-callback.d.ts +5 -1
- package/dist/shared/hooks/use-debounced-callback.js +10 -10
- package/dist/shared/providers/react-query-container.d.ts +8 -3
- package/dist/shared/providers/react-query-container.js +4 -4
- package/dist/shared/routing/route-provider.d.ts +1 -0
- package/dist/shared/routing/types.d.ts +1 -0
- package/dist/shared/routing/use-location.js +2 -2
- package/dist/sidebar/sidebar-provider.js +0 -2
- package/dist/styles.css +31 -1
- package/dist/table/elements/col.js +1 -0
- package/dist/table/elements/use-table-row.js +1 -0
- package/dist/table/elements/use-table.js +1 -0
- package/dist/table/elements/use-td.js +1 -0
- package/dist/table/elements/use-th.js +1 -0
- package/dist/text/highlight-text/highlight-text.js +1 -0
- package/dist/text/truncated/truncated.js +1 -0
- package/package.json +3 -3
- package/dist/shared/hooks/use-cookie.js +0 -34
|
@@ -9,7 +9,8 @@ import { AddressDataCard } from './components/address-data-card.js';
|
|
|
9
9
|
|
|
10
10
|
function ConnectedBillToAddressWidget({ billToId = 'current', } = {}) {
|
|
11
11
|
const paths = usePaths();
|
|
12
|
-
const {
|
|
12
|
+
const { pathname, search } = useLocation();
|
|
13
|
+
const href = `${pathname}${search}`;
|
|
13
14
|
const editAddressUrl = `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/${billToId}?returnUrl=${encodeURIComponent(href)}`;
|
|
14
15
|
const { data: billToAddress, error, isLoading, } = useFetchBillToAddress({ billToId });
|
|
15
16
|
return (jsx(AddressDataCard, { actions: [
|
|
@@ -9,7 +9,8 @@ import { AddressDataCard } from './components/address-data-card.js';
|
|
|
9
9
|
|
|
10
10
|
function ConnectedShipToAddressWidget({ billToId = 'current', shipToId = 'current', } = {}) {
|
|
11
11
|
const paths = usePaths();
|
|
12
|
-
const {
|
|
12
|
+
const { pathname, search } = useLocation();
|
|
13
|
+
const href = `${pathname}${search}`;
|
|
13
14
|
const editAddressUrl = `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/${billToId}${paths.ACCOUNT_EDIT_SHIP_TO_ADDRESS}/${shipToId}?returnUrl=${encodeURIComponent(href)}`;
|
|
14
15
|
const createAddressUrl = `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/${billToId}${paths.ACCOUNT_EDIT_SHIP_TO_ADDRESS}/new?returnUrl=${encodeURIComponent(href)}`;
|
|
15
16
|
const { data: shipToAddress, error, isLoading, } = useFetchShipToAddress({
|
|
@@ -6,7 +6,6 @@ import { ImageLightbox } from '../../../../../media/image-lightbox/image-lightbo
|
|
|
6
6
|
import { ZoomImage } from '../../../../../media/zoom-image/zoom-image.js';
|
|
7
7
|
import { Modal } from '../../../../../modals/modal/modal.js';
|
|
8
8
|
import { useDisclosure } from '../../../../../shared/hooks/use-disclosure.js';
|
|
9
|
-
import { useIsBreakpoint } from '../../../../../shared/hooks/use-is-breakpoint.js';
|
|
10
9
|
import styles from './product-detail-images.module.css.js';
|
|
11
10
|
|
|
12
11
|
const MAX_IMAGES = 5;
|
|
@@ -16,7 +15,6 @@ function ProductDetailImages({ images }) {
|
|
|
16
15
|
const [scrollPercentage, setScrollPercentage] = useState(0);
|
|
17
16
|
const { isOpen: isOpenModal, open: openModal, toggle: toggleModal, } = useDisclosure();
|
|
18
17
|
const { close: closeZoom, isOpen: isOpenZoom, open: openZoom, } = useDisclosure();
|
|
19
|
-
const isXl = useIsBreakpoint('xl');
|
|
20
18
|
if (images.length > MAX_IMAGES) {
|
|
21
19
|
images = images.slice(0, MAX_IMAGES);
|
|
22
20
|
}
|
|
@@ -29,7 +27,7 @@ function ProductDetailImages({ images }) {
|
|
|
29
27
|
setScrollPercentage(scrollPercentage);
|
|
30
28
|
openZoom();
|
|
31
29
|
}
|
|
32
|
-
return (jsxs(Fragment, { children: [
|
|
30
|
+
return (jsxs(Fragment, { children: [jsx(ImagesGrid, { className: styles['images-grid'], images: images, onSelectImage: (image, _index) => handleOpenImage(image) }), isOpenModal && (jsx(Modal, { hasCloseButton: true, isDismissable: true, isFullScreen: true, isKeyboardDismissDisabled: false, isOpen: isOpenModal, onOpenChange: toggleModal, shouldCloseOnInteractOutside: false, children: jsx("div", { className: styles['image-lightbox-modal'], children: jsx(ImageLightbox, { images: images, initialSelectedIndex: selectedImageIndex, onZoom: onZoom, variant: "lg" }) }) })), jsx(ImageLightbox, { className: styles['image-lightbox'], images: images, onZoom: onZoom }), isOpenZoom && (jsx(ZoomImage, { currentImage: images[selectedZoomImageIndex], isZoomed: isOpenZoom, onClose: closeZoom, scrollFromTopPercentage: scrollPercentage }))] }));
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
export { ProductDetailImages };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var styles = {"image-lightbox-modal":"product-detail-images-module-ERzjA"};
|
|
1
|
+
var styles = {"image-lightbox-modal":"product-detail-images-module-ERzjA","images-grid":"product-detail-images-module-cdIHn","image-lightbox":"product-detail-images-module-0udrk"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useEffect } from 'react';
|
|
3
4
|
import { ConnectedProductCard } from '../../../cards/product-card/connected-product-card.js';
|
|
4
5
|
import { CardCarousel } from '../../../carousel/card-carousel/card-carousel.js';
|
|
5
6
|
import { ProductUSPCarousel } from '../../../carousel/usp-carousel/product-usp-carousel.js';
|
|
@@ -15,7 +16,10 @@ import { ProductDetailsRecentlyViewedSection } from './components/product-detail
|
|
|
15
16
|
|
|
16
17
|
function ProductDetails({ data, priceComponent, }) {
|
|
17
18
|
const { breadCrumb, included, page, product, usps } = data;
|
|
18
|
-
|
|
19
|
+
const { mutate } = useMarkProductAsRecentlyViewed();
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
mutate({ productId: product.id });
|
|
22
|
+
}, [mutate, product]);
|
|
19
23
|
useDataLayer({
|
|
20
24
|
event: {
|
|
21
25
|
event: 'view_item',
|
|
@@ -3,12 +3,14 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Button } from '../../../../buttons/button/button.js';
|
|
4
4
|
import { FormattedMessage } from '../../../../intl/formatted-message.js';
|
|
5
5
|
import { useIsBreakpoint } from '../../../../shared/hooks/use-is-breakpoint.js';
|
|
6
|
+
import { usePaths } from '../../../../shared/routing/use-paths.js';
|
|
6
7
|
import { Heading } from '../../../../typography/heading/heading.js';
|
|
7
8
|
import styles from './no-results.module.css.js';
|
|
8
9
|
|
|
9
10
|
function NoResults({ content, title }) {
|
|
11
|
+
const paths = usePaths();
|
|
10
12
|
const isLg = useIsBreakpoint('lg');
|
|
11
|
-
return (jsxs("div", { className: styles['no-results'], children: [jsx(Heading, { bold: false, className: styles.title, size: isLg ? 's' : 'xs', tag: "h2", children: title }), jsx("p", { className: styles.body, children: content }), jsx("div", { className: styles.buttons, children: jsx(Button, { withArrow: true, "data-test-selector": "buttonContinueShopping", href:
|
|
13
|
+
return (jsxs("div", { className: styles['no-results'], children: [jsx(Heading, { bold: false, className: styles.title, size: isLg ? 's' : 'xs', tag: "h2", children: title }), jsx("p", { className: styles.body, children: content }), jsx("div", { className: styles.buttons, children: jsx(Button, { withArrow: true, "data-test-selector": "buttonContinueShopping", href: paths.HOME, size: "md", children: jsx(FormattedMessage, { id: "Continue shopping" }) }) })] }));
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export { NoResults };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { useFetchCurrentCart } from './use-fetch-current-cart.js';
|
|
2
3
|
import { useFetchCurrentCartProductAtp } from './use-fetch-current-cart-product-atp.js';
|
|
3
4
|
|
|
@@ -12,10 +13,12 @@ function useFetchCurrentCartWithAtp({ forceRecalculation = true, select = cartMo
|
|
|
12
13
|
select(atp
|
|
13
14
|
? {
|
|
14
15
|
...cartResult.data,
|
|
15
|
-
cartLines: cartResult.data.cartLines?.map(line =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
cartLines: cartResult.data.cartLines?.map(line => {
|
|
17
|
+
const matchingAtp = atp.find(a => a.productCode === line.erpNumber);
|
|
18
|
+
if (!matchingAtp)
|
|
19
|
+
return line;
|
|
20
|
+
return { ...line, atp: matchingAtp };
|
|
21
|
+
}),
|
|
19
22
|
}
|
|
20
23
|
: cartResult.data),
|
|
21
24
|
error: cartResult.error || error,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
productId
|
|
3
|
-
}
|
|
1
|
+
interface MarkProductAsRecentlyViewedParams {
|
|
2
|
+
productId: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function useMarkProductAsRecentlyViewed(): import("@tanstack/react-query").UseMutationResult<void, Error, MarkProductAsRecentlyViewedParams, unknown>;
|
|
5
|
+
export {};
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQueryClient, useMutation } from '@tanstack/react-query';
|
|
2
3
|
import { markProductAsRecentlyViewed } from '../../services/product-service.js';
|
|
3
4
|
|
|
4
|
-
function useMarkProductAsRecentlyViewed(
|
|
5
|
+
function useMarkProductAsRecentlyViewed() {
|
|
5
6
|
const queryClient = useQueryClient();
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
gcTime: 0,
|
|
9
|
-
queryFn: () => {
|
|
7
|
+
return useMutation({
|
|
8
|
+
mutationFn: async ({ productId }) => {
|
|
10
9
|
markProductAsRecentlyViewed({ productId: productId });
|
|
11
10
|
queryClient.invalidateQueries({
|
|
12
11
|
queryKey: ['products', 'recently-viewed'],
|
|
13
12
|
});
|
|
14
13
|
},
|
|
15
|
-
queryKey: ['mark-product-as-recently-viewed', productId],
|
|
16
|
-
staleTime: 0,
|
|
17
14
|
});
|
|
18
15
|
}
|
|
19
16
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { useQueryClient, useMutation } from '@tanstack/react-query';
|
|
2
3
|
import { getWishLists, addWishListItemToWishList } from '../../services/wishlist-service.js';
|
|
3
4
|
|
|
4
|
-
/* eslint-disable unicorn/no-await-expression-member */
|
|
5
5
|
function useAddWishListItemToWishList() {
|
|
6
6
|
const queryClient = useQueryClient();
|
|
7
7
|
return useMutation({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { useQueryClient, useQuery } from '@tanstack/react-query';
|
|
2
3
|
import { TIME } from '../../../../utils/time.js';
|
|
3
4
|
import { getWishLists, getWishListItemsByWishListId } from '../../services/wishlist-service.js';
|
|
4
5
|
|
|
5
|
-
/* eslint-disable unicorn/no-await-expression-member */
|
|
6
6
|
function useFetchAllWishListsItems({ enabled = true } = { enabled: true }) {
|
|
7
7
|
const queryClient = useQueryClient();
|
|
8
8
|
return useQuery({
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { config } from '../../../../config.js';
|
|
2
2
|
import { request } from '../../../fetch/request.js';
|
|
3
|
+
import { TIME } from '../../../utils/time.js';
|
|
3
4
|
|
|
4
5
|
async function fetchCountriesLanguages() {
|
|
5
6
|
const { body } = await request({
|
|
7
|
+
next: {
|
|
8
|
+
revalidate: 1 * TIME.DAY,
|
|
9
|
+
tags: ['countries-languages'],
|
|
10
|
+
},
|
|
6
11
|
url: `${config.SHOP_API_URL}/api/v1/websites/current?expand=languages%2Ccountries`,
|
|
7
12
|
});
|
|
8
13
|
return {
|
|
@@ -12,6 +17,10 @@ async function fetchCountriesLanguages() {
|
|
|
12
17
|
}
|
|
13
18
|
async function fetchCountriesWithLanguages() {
|
|
14
19
|
const { body } = await request({
|
|
20
|
+
next: {
|
|
21
|
+
revalidate: 1 * TIME.DAY,
|
|
22
|
+
tags: ['countries-languages'],
|
|
23
|
+
},
|
|
15
24
|
url: `${config.SHOP_API_URL}/api/v1/custom/countrylanguage`,
|
|
16
25
|
});
|
|
17
26
|
return body;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface DebouncedCallback<T extends (...args: any[]) => any> {
|
|
2
|
+
(...args: Parameters<T>): Promise<ReturnType<T>>;
|
|
3
|
+
cancel: VoidFunction;
|
|
4
|
+
}
|
|
5
|
+
export declare function useDebouncedCallback<T extends (...args: any[]) => any>(func: T, delay: number): DebouncedCallback<T>;
|
|
@@ -4,16 +4,16 @@ import { useRef, useCallback } from 'react';
|
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
5
|
function useDebouncedCallback(func, delay) {
|
|
6
6
|
const timeoutId = useRef();
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
const debounced = (...args) => new Promise(resolve => {
|
|
8
|
+
if (typeof window === 'undefined')
|
|
9
|
+
return resolve(func(...args));
|
|
10
|
+
clearTimeout(timeoutId.current);
|
|
11
|
+
timeoutId.current = setTimeout(() => {
|
|
12
|
+
resolve(func(...args));
|
|
13
|
+
}, delay);
|
|
14
|
+
});
|
|
15
|
+
debounced.cancel = () => clearTimeout(timeoutId.current);
|
|
16
|
+
return useCallback(debounced, [delay, func]);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export { useDebouncedCallback };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
export declare const globalQueryClient: QueryClient;
|
|
4
|
+
export declare function ReactQueryContainer({ children, enableDevTools, queryClient, }: {
|
|
5
|
+
children: ReactNode | ((args: {
|
|
6
|
+
queryClient: QueryClient;
|
|
7
|
+
}) => ReactNode | ReactElement);
|
|
4
8
|
enableDevTools?: boolean;
|
|
9
|
+
queryClient?: QueryClient;
|
|
5
10
|
}): import("react/jsx-runtime").JSX.Element;
|