@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.
Files changed (215) hide show
  1. package/dist/address-info-display/address-info-display.js +1 -0
  2. package/dist/algolia/filter-section.js +1 -0
  3. package/dist/badges/badge/icon-with-badge/icon-with-badge.js +1 -0
  4. package/dist/badges/tag/tag.js +1 -0
  5. package/dist/breadcrumbs/breadcrumb.js +7 -16
  6. package/dist/breadcrumbs/breadcrumb.module.css.js +1 -1
  7. package/dist/buttons/add-to-cart-button/add-to-cart-button.d.ts +1 -1
  8. package/dist/buttons/add-to-cart-button/add-to-cart-button.js +12 -13
  9. package/dist/cards/data-card/data-card.js +1 -0
  10. package/dist/cards/orderline-card/orderline-card.js +1 -0
  11. package/dist/carousel/category-carousel/category-carousel.js +1 -0
  12. package/dist/carousel/usp-carousel/product-usp-carousel-slide.js +1 -0
  13. package/dist/carousel/usp-carousel/product-usp-carousel.js +1 -0
  14. package/dist/cart-totals/cart-totals-summary.js +1 -0
  15. package/dist/collapsables/accordion/accordion-item.js +6 -5
  16. package/dist/collapsables/accordion/accordion.js +1 -0
  17. package/dist/collapsables/accordion/accordion.module.css.js +1 -1
  18. package/dist/cookies/client-cookie-context.d.ts +3 -0
  19. package/dist/cookies/client-cookie-context.js +30 -0
  20. package/dist/cookies/cookie-context.d.ts +2 -0
  21. package/dist/cookies/cookie-context.js +6 -0
  22. package/dist/cookies/cookie-provider.d.ts +6 -0
  23. package/dist/cookies/cookie-provider.js +10 -0
  24. package/dist/cookies/readonly-cookie-reader.d.ts +2 -0
  25. package/dist/cookies/readonly-cookie-reader.js +18 -0
  26. package/dist/cookies/types.d.ts +14 -0
  27. package/dist/cookies/types.js +7 -0
  28. package/dist/{shared/hooks → cookies}/use-cookie.d.ts +1 -2
  29. package/dist/cookies/use-cookie.js +30 -0
  30. package/dist/country-select/hooks/use-countries.js +2 -1
  31. package/dist/country-selector/connected-country-selector.js +1 -1
  32. package/dist/country-selector/use-countries-languages.js +3 -11
  33. package/dist/display/info-display/info-display.js +1 -0
  34. package/dist/display/product-sku/product-sku.js +1 -0
  35. package/dist/exports.d.ts +6 -1
  36. package/dist/forms/layout/form/form-segment-group.js +1 -0
  37. package/dist/forms/layout/form/form-segment.js +1 -0
  38. package/dist/forms/partials/password-validation/password-validation.js +1 -0
  39. package/dist/global-search/plugins/categories-plugin.js +1 -0
  40. package/dist/global-search/plugins/popular-categories-plugin.js +1 -0
  41. package/dist/global-search/plugins/popular-searches-plugin.js +1 -0
  42. package/dist/global-search/plugins/query-suggestions-plugin.js +1 -0
  43. package/dist/global-search/plugins/quick-access-plugin.js +1 -0
  44. package/dist/global-search/plugins/recent-searches-plugin.js +1 -0
  45. package/dist/global-search/search-highlight/highlight.js +1 -0
  46. package/dist/global-search/search-result-panel/sections/section-container.js +1 -0
  47. package/dist/global-search/search-section/search-list.js +1 -0
  48. package/dist/global-search/search-section/search-section.js +1 -0
  49. package/dist/header/buttons/account/connected-account-button.js +1 -8
  50. package/dist/header/drawers/search-drawer.js +1 -0
  51. package/dist/header/header-layout/header-layout.js +1 -0
  52. package/dist/icons/glyph/glyphs-arrow-blackcaps-right-icon.js +1 -0
  53. package/dist/icons/glyph/glyphs-arrow-boldcaps-left-icon.js +1 -0
  54. package/dist/icons/glyph/glyphs-arrow-boldcaps-right-icon.js +1 -0
  55. package/dist/icons/glyph/glyphs-arrow-semibold-right-icon.js +1 -0
  56. package/dist/icons/glyph/glyphs-chevrons-bold-down-icon.js +1 -0
  57. package/dist/icons/glyph/glyphs-chevrons-bold-up-icon.js +1 -0
  58. package/dist/icons/glyph/glyphs-chevrons-slim-down-icon.js +1 -0
  59. package/dist/icons/glyph/glyphs-chevrons-slim-left-icon.js +1 -0
  60. package/dist/icons/glyph/glyphs-chevrons-slim-right-icon.js +1 -0
  61. package/dist/icons/solid/solid-attention-icon.js +1 -0
  62. package/dist/icons/solid/solid-cart-icon.js +1 -0
  63. package/dist/icons/solid/solid-close-icon.js +1 -0
  64. package/dist/icons/solid/solid-favorite-icon.js +1 -0
  65. package/dist/icons/solid/solid-home-icon.js +1 -0
  66. package/dist/icons/solid/solid-information-icon.js +1 -0
  67. package/dist/icons/solid/solid-login-icon.js +1 -0
  68. package/dist/icons/solid/solid-logout-icon.js +1 -0
  69. package/dist/icons/solid/solid-news-icon.js +1 -0
  70. package/dist/icons/solid/solid-notice-icon.js +1 -0
  71. package/dist/icons/solid/solid-okay-icon.js +1 -0
  72. package/dist/icons/solid/solid-rating-icon.js +1 -0
  73. package/dist/icons/solid/solid-salecategory-icon.js +1 -0
  74. package/dist/icons/solid/solid-tag-icon.js +1 -0
  75. package/dist/icons/stroke/stroke-categories-icon.js +1 -0
  76. package/dist/icons/stroke/stroke-checkmark-icon.js +1 -0
  77. package/dist/icons/stroke/stroke-closebox-icon.js +1 -0
  78. package/dist/icons/stroke/stroke-dehashed-icon.js +1 -0
  79. package/dist/icons/stroke/stroke-download-icon.js +1 -0
  80. package/dist/icons/stroke/stroke-event-icon.js +1 -0
  81. package/dist/icons/stroke/stroke-favorite-icon.js +1 -0
  82. package/dist/icons/stroke/stroke-filter-icon.js +1 -0
  83. package/dist/icons/stroke/stroke-hashed-icon.js +1 -0
  84. package/dist/icons/stroke/stroke-information-icon.js +1 -0
  85. package/dist/icons/stroke/stroke-minus-icon.js +1 -0
  86. package/dist/icons/stroke/stroke-plus-icon.js +1 -0
  87. package/dist/icons/stroke/stroke-recent-icon.js +1 -0
  88. package/dist/icons/stroke/stroke-search-icon.js +1 -0
  89. package/dist/icons/stroke/stroke-trash-icon.js +1 -0
  90. package/dist/index.js +7 -2
  91. package/dist/intl/use-formatted-date.js +1 -0
  92. package/dist/layout/center.js +1 -0
  93. package/dist/lists/download-document-list/download-document-list.js +1 -0
  94. package/dist/lists/feature-list/feature-list.js +1 -0
  95. package/dist/lists/icon-list/icon-list.js +1 -0
  96. package/dist/lists/menu-list/menu-list-header.js +1 -0
  97. package/dist/lists/menu-list/use-menu-list-item.js +1 -0
  98. package/dist/lists/menu-list/use-menu-list.js +1 -0
  99. package/dist/lists/product-overview-grid/product-overview-grid.js +1 -0
  100. package/dist/loading/blank-page-spacer.js +1 -0
  101. package/dist/loading/dynamic-loading-overlay.js +1 -0
  102. package/dist/loading/loading-overlay.js +1 -0
  103. package/dist/loading/progress-circle.js +1 -0
  104. package/dist/media/image-grid/images-grid.d.ts +2 -1
  105. package/dist/media/image-grid/images-grid.js +2 -2
  106. package/dist/media/image-lightbox/image-lightbox.d.ts +2 -1
  107. package/dist/media/image-lightbox/image-lightbox.js +2 -2
  108. package/dist/message/message.js +1 -0
  109. package/dist/pages/account/components/create-account-form/create-account-form.js +1 -1
  110. package/dist/pages/account/create-account-page/create-account-page.js +5 -3
  111. package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.d.ts +2 -1
  112. package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.js +2 -4
  113. package/dist/pages/account/sign-in-page/sign-in-page.js +2 -2
  114. package/dist/pages/checkout/cart-page/cart-page.js +1 -1
  115. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-content.js +1 -0
  116. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-header.js +1 -0
  117. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-link.js +1 -0
  118. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.js +1 -0
  119. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +1 -1
  120. package/dist/pages/checkout/payment-page/hooks/use-has-returned-from-adyen.js +1 -0
  121. package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.js +1 -0
  122. package/dist/pages/components/page-container/page-container.js +1 -0
  123. package/dist/pages/components/page-meta-data/page-meta-data.js +1 -0
  124. package/dist/pages/loading-page/loading-page.js +1 -0
  125. package/dist/pages/my-sonic/actions/change-password/change-password-dialog.js +1 -0
  126. package/dist/pages/my-sonic/actions/change-password/change-password.js +1 -0
  127. package/dist/pages/my-sonic/actions/change-password/connected-change-password-dialog.js +1 -0
  128. package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.js +1 -0
  129. package/dist/pages/my-sonic/navigation/my-sonic-navigation-items.js +1 -0
  130. package/dist/pages/my-sonic/widgets/connected-bill-to-address-widget.js +2 -1
  131. package/dist/pages/my-sonic/widgets/connected-ship-to-address-widget.js +2 -1
  132. package/dist/pages/product/layouts/product-details-page-layout/product-details-page-layout.js +1 -0
  133. package/dist/pages/product/product-details-page/components/product-details-images/product-detail-images.js +1 -3
  134. package/dist/pages/product/product-details-page/components/product-details-images/product-detail-images.module.css.js +1 -1
  135. package/dist/pages/product/product-details-page/product-details.js +5 -1
  136. package/dist/pages/product/product-listing-page/no-results/no-results.js +3 -1
  137. package/dist/promos/promo-banner/promo-banner.js +1 -0
  138. package/dist/shared/api/bff/hooks/use-fetch-announcements.js +1 -0
  139. package/dist/shared/api/bff/hooks/use-fetch-navigation-links.js +1 -0
  140. package/dist/shared/api/bff/hooks/use-fetch-product-details-page-data.js +1 -0
  141. package/dist/shared/api/bff/hooks/use-fetch-product-listing-page-data.js +1 -0
  142. package/dist/shared/api/bff/hooks/use-fetch-recently-viewed-products.js +1 -0
  143. package/dist/shared/api/storefront/hooks/authentication/use-fetch-session.js +1 -0
  144. package/dist/shared/api/storefront/hooks/authentication/use-invalidate-session.js +1 -0
  145. package/dist/shared/api/storefront/hooks/authentication/use-is-authenticated.js +1 -0
  146. package/dist/shared/api/storefront/hooks/authentication/use-patch-session.js +1 -0
  147. package/dist/shared/api/storefront/hooks/authentication/use-recover-password.js +1 -0
  148. package/dist/shared/api/storefront/hooks/authentication/use-sign-in.js +1 -0
  149. package/dist/shared/api/storefront/hooks/authentication/use-sign-out.js +1 -0
  150. package/dist/shared/api/storefront/hooks/cart/use-add-product-to-current-cart.js +1 -0
  151. package/dist/shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js +1 -0
  152. package/dist/shared/api/storefront/hooks/cart/use-delete-current-cart.js +1 -0
  153. package/dist/shared/api/storefront/hooks/cart/use-fetch-cart-by-id.js +1 -0
  154. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-checkout-atp.js +1 -0
  155. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-count.js +1 -0
  156. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js +1 -0
  157. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines.js +1 -0
  158. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-product-atp.js +1 -0
  159. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-promotions.js +1 -0
  160. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js +7 -4
  161. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.js +1 -0
  162. package/dist/shared/api/storefront/hooks/cart/use-invalidate-current-cart.js +1 -0
  163. package/dist/shared/api/storefront/hooks/cart/use-patch-cart-line-by-id.js +1 -0
  164. package/dist/shared/api/storefront/hooks/cart/use-patch-cart.js +1 -0
  165. package/dist/shared/api/storefront/hooks/cart/use-place-order.js +1 -0
  166. package/dist/shared/api/storefront/hooks/cart/use-save-cart-for-later.js +1 -0
  167. package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-address.js +1 -0
  168. package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-addresses.js +1 -0
  169. package/dist/shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.js +1 -0
  170. package/dist/shared/api/storefront/hooks/customer/use-fetch-current-ship-to-address.js +1 -0
  171. package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-by-customer-id.js +1 -0
  172. package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.js +1 -0
  173. package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-address.js +1 -0
  174. package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-addresses.js +1 -0
  175. package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.js +1 -0
  176. package/dist/shared/api/storefront/hooks/customer/use-patch-ship-to-address.js +1 -0
  177. package/dist/shared/api/storefront/hooks/customer/use-post-ship-to-address.js +1 -0
  178. package/dist/shared/api/storefront/hooks/orders/use-fetch-orders.js +1 -0
  179. package/dist/shared/api/storefront/hooks/payment/use-create-adyen-session.js +1 -0
  180. package/dist/shared/api/storefront/hooks/payment/use-fetch-adyen-config.js +1 -0
  181. package/dist/shared/api/storefront/hooks/payment/use-invalidate-adyen.js +1 -0
  182. package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.d.ts +5 -3
  183. package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.js +5 -8
  184. package/dist/shared/api/storefront/hooks/translation/use-fetch-translations.js +1 -0
  185. package/dist/shared/api/storefront/hooks/website/use-fetch-countries-languages.js +1 -0
  186. package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.js +1 -0
  187. package/dist/shared/api/storefront/hooks/website/use-fetch-country-models.js +1 -0
  188. package/dist/shared/api/storefront/hooks/website/use-fetch-settings.js +1 -0
  189. package/dist/shared/api/storefront/hooks/website/use-update-locale.js +1 -0
  190. package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js +1 -0
  191. package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-wishlist.js +1 -1
  192. package/dist/shared/api/storefront/hooks/wishlist/use-create-wishlist.js +1 -0
  193. package/dist/shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js +1 -0
  194. package/dist/shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items.js +1 -1
  195. package/dist/shared/api/storefront/hooks/wishlist/use-fetch-wishlists.js +1 -0
  196. package/dist/shared/api/storefront/services/website-service.js +9 -0
  197. package/dist/shared/feature-flags/use-feature-flags.js +1 -0
  198. package/dist/shared/hooks/use-debounced-callback.d.ts +5 -1
  199. package/dist/shared/hooks/use-debounced-callback.js +10 -10
  200. package/dist/shared/providers/react-query-container.d.ts +8 -3
  201. package/dist/shared/providers/react-query-container.js +4 -4
  202. package/dist/shared/routing/route-provider.d.ts +1 -0
  203. package/dist/shared/routing/types.d.ts +1 -0
  204. package/dist/shared/routing/use-location.js +2 -2
  205. package/dist/sidebar/sidebar-provider.js +0 -2
  206. package/dist/styles.css +31 -1
  207. package/dist/table/elements/col.js +1 -0
  208. package/dist/table/elements/use-table-row.js +1 -0
  209. package/dist/table/elements/use-table.js +1 -0
  210. package/dist/table/elements/use-td.js +1 -0
  211. package/dist/table/elements/use-th.js +1 -0
  212. package/dist/text/highlight-text/highlight-text.js +1 -0
  213. package/dist/text/truncated/truncated.js +1 -0
  214. package/package.json +3 -3
  215. 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 { href } = useLocation();
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 { href } = useLocation();
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({
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { IntersectionObserverComponent } from '../../../../observers/intersection-observer.js';
3
4
  import styles from './product-details-page-layout.module.css.js';
@@ -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: [isXl ? (jsxs(Fragment, { children: [jsx(ImagesGrid, { images: images, onSelectImage: (image, _index) => handleOpenImage(image) }), 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, { images: images, onZoom: onZoom })), isOpenZoom && (jsx(ZoomImage, { currentImage: images[selectedZoomImageIndex], isZoomed: isOpenZoom, onClose: closeZoom, scrollFromTopPercentage: scrollPercentage }))] }));
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
- useMarkProductAsRecentlyViewed({ productId: product.id });
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: "/", size: "md", children: jsx(FormattedMessage, { id: "Continue shopping" }) }) })] }));
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 { jsx } from 'react/jsx-runtime';
2
3
  import clsx from 'clsx';
3
4
  import { Link } from '../../buttons/link/link.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../utils/time.js';
3
4
  import { fetchAnnouncements } from '../services/bff-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../utils/time.js';
3
4
  import { fetchNavigationLinks } from '../services/bff-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../utils/time.js';
3
4
  import { fetchProductDetailsPageData } from '../services/bff-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../utils/time.js';
3
4
  import { fetchProductListingPageData } from '../services/bff-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../utils/time.js';
3
4
  import { fetchRecentlyViewedProducts } from '../services/bff-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchSession } from '../../services/authentication-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCallback } from 'react';
2
3
  import { useQueryClient } from '@tanstack/react-query';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useFetchSession } from './use-fetch-session.js';
2
3
 
3
4
  function useIsAuthenticated() {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient } from '@tanstack/react-query';
2
3
  import { patchSession } from '../../services/authentication-service.js';
3
4
  import { useAwaitableMutation } from '../../../shared/hooks/use-awaitable-mutation.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { recoverPassword } from '../../services/authentication-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { isRequestError } from '../../../../fetch/request.js';
3
4
  import { signIn, createSession } from '../../services/authentication-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { UnauthorizedRequestError } from '../../../../fetch/request.js';
3
4
  import { signOut } from '../../services/authentication-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { addProductToCurrentCart } from '../../services/cart-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { deleteCartLineById } from '../../services/cart-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { deleteCurrentCart, fetchCurrentCart } from '../../services/cart-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchCart } from '../../services/cart-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchCurrentCheckoutAtp } from '../../services/cart-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useFetchCurrentCart } from './use-fetch-current-cart.js';
2
3
 
3
4
  function useFetchCurrentCartCount() {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useFetchCurrentCartWithAtp } from './use-fetch-current-cart-with-atp.js';
2
3
 
3
4
  function useFetchCurrentCartLinesWithAtp() {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useFetchCurrentCart } from './use-fetch-current-cart.js';
2
3
 
3
4
  function useFetchCurrentCartLines() {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchCurrentCartProductAtp } from '../../services/cart-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchCurrentCartPromotions } from '../../services/cart-service.js';
@@ -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
- ...line,
17
- atp: atp.find(a => a.productCode === line.erpNumber) || null,
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,4 @@
1
+ "use client";
1
2
  import { useFetchCartById } from './use-fetch-cart-by-id.js';
2
3
 
3
4
  function useFetchCurrentCart(args) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCallback } from 'react';
2
3
  import { useQueryClient } from '@tanstack/react-query';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { patchCartLineById } from '../../services/cart-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCallback } from 'react';
2
3
  import { useAwaitableMutation } from '../../../shared/hooks/use-awaitable-mutation.js';
3
4
  import { patchCart } from '../../services/cart-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCallback } from 'react';
2
3
  import { useAwaitableMutation } from '../../../shared/hooks/use-awaitable-mutation.js';
3
4
  import { placeOrder } from '../../services/cart-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { saveCartForLater } from '../../services/cart-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { fetchBillToAddress } from '../../services/customer-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { fetchBillToAddresses } from '../../services/customer-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useFetchBillToAddress } from './use-fetch-bill-to-address.js';
2
3
 
3
4
  function useFetchCurrentBillToAddress({ includeValidation = false, } = {}) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useFetchShipToAddress } from './use-fetch-ship-to-address.js';
2
3
 
3
4
  function useFetchCurrentShipToAddress({ includeValidation = false, } = {}) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { fetchFulfillmentMethods } from '../../services/customer-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useFetchCurrentCart } from '../cart/use-fetch-current-cart.js';
2
3
  import { useFetchFulfillmentMethodsByCustomerId } from './use-fetch-fulfillment-methods-by-customer-id.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { fetchShipToAddress } from '../../services/customer-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { fetchShipToAddresses } from '../../services/customer-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { patchBillToAddress } from '../../services/customer-service.js';
2
3
  import { useAwaitableMutation } from '../../../shared/hooks/use-awaitable-mutation.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { patchShipToAddress } from '../../services/customer-service.js';
2
3
  import { useAwaitableMutation } from '../../../shared/hooks/use-awaitable-mutation.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { postShipToAddress } from '../../services/customer-service.js';
2
3
  import { useAwaitableMutation } from '../../../shared/hooks/use-awaitable-mutation.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { fetchOrders } from '../../services/order-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import { createAdyenSession } from '../../services/payment-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { useIsAuthenticated } from '../authentication/use-is-authenticated.js';
3
4
  import { fetchAdyenConfig } from '../../services/payment-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCallback } from 'react';
2
3
  import { useQueryClient } from '@tanstack/react-query';
3
4
 
@@ -1,3 +1,5 @@
1
- export declare function useMarkProductAsRecentlyViewed({ productId, }: {
2
- productId?: string;
3
- }): import("@tanstack/react-query").UseQueryResult<void, Error>;
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
- import { useQueryClient, useQuery } from '@tanstack/react-query';
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({ productId, }) {
5
+ function useMarkProductAsRecentlyViewed() {
5
6
  const queryClient = useQueryClient();
6
- return useQuery({
7
- enabled: Boolean(productId),
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,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchTranslations } from '../../services/translation-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchCountriesLanguages } from '../../services/website-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchCountriesWithLanguages } from '../../services/website-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchCountriesLanguages } from '../../services/website-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { fetchSettings } from '../../services/website-service.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useMutation } from '@tanstack/react-query';
2
3
  import { updateLocale } from '../../services/website-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { createWishList, addWishListItemToWishList } from '../../services/wishlist-service.js';
3
4
 
@@ -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,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { createWishList } from '../../services/wishlist-service.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { deleteWishListItemFromWishList } from '../../services/wishlist-service.js';
3
4
 
@@ -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,3 +1,4 @@
1
+ "use client";
1
2
  import { useQuery } from '@tanstack/react-query';
2
3
  import { TIME } from '../../../../utils/time.js';
3
4
  import { getWishLists } from '../../services/wishlist-service.js';
@@ -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,3 +1,4 @@
1
+ "use client";
1
2
  import { useMemo } from 'react';
2
3
  import qs from 'query-string';
3
4
 
@@ -1 +1,5 @@
1
- export declare function useDebouncedCallback<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => Promise<ReturnType<T>>;
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
- return useCallback(function debounced(...args) {
8
- return new Promise(resolve => {
9
- if (typeof window === 'undefined')
10
- return resolve(func(...args));
11
- clearTimeout(timeoutId.current);
12
- timeoutId.current = setTimeout(() => {
13
- resolve(func(...args));
14
- }, delay);
15
- });
16
- }, [delay, func]);
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
- export declare function ReactQueryContainer({ children, enableDevTools, }: {
3
- children: ReactNode;
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;