@sonic-equipment/ui 203.0.0 → 205.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 (205) 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/cards/data-card/data-card.js +1 -0
  6. package/dist/cards/orderline-card/orderline-card.js +1 -0
  7. package/dist/cards/table-card/table-card.d.ts +12 -0
  8. package/dist/cards/table-card/table-card.js +14 -0
  9. package/dist/cards/table-card/table-card.module.css.js +3 -0
  10. package/dist/carousel/category-carousel/category-carousel.js +1 -0
  11. package/dist/carousel/usp-carousel/product-usp-carousel-slide.js +1 -0
  12. package/dist/carousel/usp-carousel/product-usp-carousel.js +1 -0
  13. package/dist/cart-totals/cart-totals-summary.js +1 -0
  14. package/dist/collapsables/accordion/accordion.js +1 -0
  15. package/dist/country-select/hooks/use-countries.js +1 -0
  16. package/dist/display/info-display/info-display.js +1 -0
  17. package/dist/display/product-sku/product-sku.js +1 -0
  18. package/dist/exports.d.ts +7 -3
  19. package/dist/filters/pagination/pagination.js +1 -1
  20. package/dist/forms/fields/search-field/search-field.js +1 -1
  21. package/dist/forms/fields/text-field/text-field.d.ts +1 -0
  22. package/dist/forms/fields/text-field/text-field.js +2 -2
  23. package/dist/forms/layout/form/form-segment-group.js +1 -0
  24. package/dist/forms/layout/form/form-segment.js +1 -0
  25. package/dist/forms/partials/password-validation/password-validation.js +1 -0
  26. package/dist/global-search/plugins/categories-plugin.js +1 -0
  27. package/dist/global-search/plugins/popular-categories-plugin.js +1 -0
  28. package/dist/global-search/plugins/popular-searches-plugin.js +1 -0
  29. package/dist/global-search/plugins/query-suggestions-plugin.js +1 -0
  30. package/dist/global-search/plugins/quick-access-plugin.js +1 -0
  31. package/dist/global-search/plugins/recent-searches-plugin.js +1 -0
  32. package/dist/global-search/search-highlight/highlight.js +1 -0
  33. package/dist/global-search/search-result-panel/sections/section-container.js +1 -0
  34. package/dist/global-search/search-section/search-list.js +1 -0
  35. package/dist/global-search/search-section/search-section.js +1 -0
  36. package/dist/header/drawers/search-drawer.js +1 -0
  37. package/dist/header/header-layout/header-layout.js +1 -0
  38. package/dist/icons/glyph/glyphs-arrow-blackcaps-right-icon.js +1 -0
  39. package/dist/icons/glyph/glyphs-arrow-boldcaps-left-icon.js +1 -0
  40. package/dist/icons/glyph/glyphs-arrow-boldcaps-right-icon.js +1 -0
  41. package/dist/icons/glyph/glyphs-arrow-semibold-right-icon.js +1 -0
  42. package/dist/icons/glyph/glyphs-chevrons-bold-down-icon.js +1 -0
  43. package/dist/icons/glyph/glyphs-chevrons-bold-up-icon.js +1 -0
  44. package/dist/icons/glyph/glyphs-chevrons-slim-down-icon.js +1 -0
  45. package/dist/icons/glyph/glyphs-chevrons-slim-left-icon.js +1 -0
  46. package/dist/icons/glyph/glyphs-chevrons-slim-right-icon.js +1 -0
  47. package/dist/icons/solid/solid-attention-icon.js +1 -0
  48. package/dist/icons/solid/solid-cart-icon.js +1 -0
  49. package/dist/icons/solid/solid-close-icon.js +1 -0
  50. package/dist/icons/solid/solid-edit-icon.js +8 -0
  51. package/dist/icons/solid/solid-favorite-icon.js +1 -0
  52. package/dist/icons/solid/solid-home-icon.js +1 -0
  53. package/dist/icons/solid/solid-information-icon.js +1 -0
  54. package/dist/icons/solid/solid-login-icon.js +1 -0
  55. package/dist/icons/solid/solid-logout-icon.js +1 -0
  56. package/dist/icons/solid/solid-news-icon.js +1 -0
  57. package/dist/icons/solid/solid-notice-icon.js +1 -0
  58. package/dist/icons/solid/solid-okay-icon.js +1 -0
  59. package/dist/icons/solid/solid-rating-icon.js +1 -0
  60. package/dist/icons/solid/solid-salecategory-icon.js +1 -0
  61. package/dist/icons/solid/solid-tag-icon.js +1 -0
  62. package/dist/icons/stroke/stroke-categories-icon.js +1 -0
  63. package/dist/icons/stroke/stroke-checkmark-icon.js +1 -0
  64. package/dist/icons/stroke/stroke-closebox-icon.js +1 -0
  65. package/dist/icons/stroke/stroke-dehashed-icon.js +1 -0
  66. package/dist/icons/stroke/stroke-download-icon.js +1 -0
  67. package/dist/icons/stroke/stroke-event-icon.js +1 -0
  68. package/dist/icons/stroke/stroke-favorite-icon.js +1 -0
  69. package/dist/icons/stroke/stroke-filter-icon.js +1 -0
  70. package/dist/icons/stroke/stroke-hashed-icon.js +1 -0
  71. package/dist/icons/stroke/stroke-information-icon.js +1 -0
  72. package/dist/icons/stroke/stroke-minus-icon.js +1 -0
  73. package/dist/icons/stroke/stroke-plus-icon.js +1 -0
  74. package/dist/icons/stroke/stroke-recent-icon.js +1 -0
  75. package/dist/icons/stroke/stroke-search-icon.js +1 -0
  76. package/dist/icons/stroke/stroke-trash-icon.js +1 -0
  77. package/dist/index.js +10 -6
  78. package/dist/intl/translation-id.d.ts +1 -1
  79. package/dist/intl/use-formatted-date.js +1 -0
  80. package/dist/layout/center.js +1 -0
  81. package/dist/lists/download-document-list/download-document-list.js +1 -0
  82. package/dist/lists/feature-list/feature-list.js +1 -0
  83. package/dist/lists/icon-list/icon-list.js +1 -0
  84. package/dist/lists/menu-list/menu-list-header.js +1 -0
  85. package/dist/lists/menu-list/use-menu-list-item.js +1 -0
  86. package/dist/lists/menu-list/use-menu-list.js +1 -0
  87. package/dist/lists/product-overview-grid/product-overview-grid.js +1 -0
  88. package/dist/loading/blank-page-spacer.js +1 -0
  89. package/dist/loading/dynamic-loading-overlay.js +1 -0
  90. package/dist/loading/loading-overlay.js +1 -0
  91. package/dist/loading/progress-circle.js +1 -0
  92. package/dist/message/message.js +1 -0
  93. package/dist/pages/checkout/cart-page/cart-page.js +1 -1
  94. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-content.js +1 -0
  95. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-header.js +1 -0
  96. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-link.js +1 -0
  97. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.js +1 -0
  98. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +1 -1
  99. package/dist/pages/checkout/payment-page/components/payment.js +2 -2
  100. package/dist/pages/checkout/payment-page/hooks/use-has-returned-from-adyen.js +1 -0
  101. package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.js +2 -1
  102. package/dist/pages/components/page-container/page-container.js +1 -0
  103. package/dist/pages/components/page-meta-data/page-meta-data.js +1 -0
  104. package/dist/pages/loading-page/loading-page.js +1 -0
  105. package/dist/pages/my-sonic/actions/change-password/change-password-dialog.js +1 -0
  106. package/dist/pages/my-sonic/actions/change-password/change-password.js +1 -0
  107. package/dist/pages/my-sonic/actions/change-password/connected-change-password-dialog.js +1 -0
  108. package/dist/pages/my-sonic/actions/create-ship-to-address/connected-create-ship-to-address-form.js +6 -6
  109. package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.js +1 -0
  110. package/dist/pages/my-sonic/navigation/my-sonic-navigation-items.js +1 -0
  111. package/dist/pages/my-sonic/pages/order-history/order-history.js +4 -1
  112. package/dist/pages/my-sonic/widgets/connected-address-book-widget.d.ts +1 -0
  113. package/dist/pages/my-sonic/widgets/connected-address-book-widget.js +166 -0
  114. package/dist/pages/my-sonic/widgets/connected-address-book-widget.module.css.js +3 -0
  115. package/dist/pages/product/layouts/product-details-page-layout/product-details-page-layout.js +1 -0
  116. package/dist/promos/promo-banner/promo-banner.js +1 -0
  117. package/dist/shared/api/{storefront → bff}/hooks/cart/use-patch-cart.d.ts +2 -2
  118. package/dist/shared/api/{storefront → bff}/hooks/cart/use-patch-cart.js +2 -1
  119. package/dist/shared/api/{storefront → bff}/hooks/cart/use-place-order.d.ts +2 -2
  120. package/dist/shared/api/{storefront → bff}/hooks/cart/use-place-order.js +2 -1
  121. package/dist/shared/api/{storefront → bff}/hooks/cart/use-save-cart-for-later.d.ts +1 -1
  122. package/dist/shared/api/{storefront → bff}/hooks/cart/use-save-cart-for-later.js +2 -1
  123. package/dist/shared/api/bff/hooks/use-fetch-announcements.js +1 -0
  124. package/dist/shared/api/bff/hooks/use-fetch-navigation-links.js +1 -0
  125. package/dist/shared/api/bff/hooks/use-fetch-product-details-page-data.js +1 -0
  126. package/dist/shared/api/bff/hooks/use-fetch-product-listing-page-data.js +1 -0
  127. package/dist/shared/api/bff/hooks/use-fetch-recently-viewed-products.js +1 -0
  128. package/dist/shared/api/bff/services/bff-service.d.ts +12 -0
  129. package/dist/shared/api/bff/services/bff-service.js +43 -1
  130. package/dist/shared/api/storefront/hooks/authentication/use-fetch-session.js +1 -0
  131. package/dist/shared/api/storefront/hooks/authentication/use-invalidate-session.js +1 -0
  132. package/dist/shared/api/storefront/hooks/authentication/use-is-authenticated.js +1 -0
  133. package/dist/shared/api/storefront/hooks/authentication/use-patch-session.js +1 -0
  134. package/dist/shared/api/storefront/hooks/authentication/use-recover-password.js +1 -0
  135. package/dist/shared/api/storefront/hooks/authentication/use-sign-in.js +1 -0
  136. package/dist/shared/api/storefront/hooks/authentication/use-sign-out.js +1 -0
  137. package/dist/shared/api/storefront/hooks/cart/use-add-product-to-current-cart.js +1 -0
  138. package/dist/shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js +1 -0
  139. package/dist/shared/api/storefront/hooks/cart/use-delete-current-cart.js +1 -0
  140. package/dist/shared/api/storefront/hooks/cart/use-fetch-cart-by-id.js +1 -0
  141. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-checkout-atp.js +1 -0
  142. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-count.js +1 -0
  143. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js +1 -0
  144. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines.js +1 -0
  145. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-product-atp.js +1 -0
  146. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-promotions.js +1 -0
  147. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js +1 -0
  148. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.js +1 -0
  149. package/dist/shared/api/storefront/hooks/cart/use-invalidate-current-cart.js +1 -0
  150. package/dist/shared/api/storefront/hooks/cart/use-patch-cart-line-by-id.js +1 -0
  151. package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-address.js +1 -0
  152. package/dist/shared/api/storefront/hooks/customer/use-fetch-bill-to-addresses.js +1 -0
  153. package/dist/shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.js +1 -0
  154. package/dist/shared/api/storefront/hooks/customer/use-fetch-current-ship-to-address.js +1 -0
  155. package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-by-customer-id.js +1 -0
  156. package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.js +1 -0
  157. package/dist/shared/api/storefront/hooks/customer/use-fetch-paged-ship-to-addresses.d.ts +8 -0
  158. package/dist/shared/api/storefront/hooks/customer/use-fetch-paged-ship-to-addresses.js +13 -0
  159. package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-address.js +1 -0
  160. package/dist/shared/api/storefront/hooks/customer/use-fetch-ship-to-addresses.js +1 -0
  161. package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.js +1 -0
  162. package/dist/shared/api/storefront/hooks/customer/use-patch-ship-to-address.js +1 -0
  163. package/dist/shared/api/storefront/hooks/customer/use-post-ship-to-address.js +1 -0
  164. package/dist/shared/api/storefront/hooks/orders/use-fetch-orders.d.ts +1 -2
  165. package/dist/shared/api/storefront/hooks/orders/use-fetch-orders.js +1 -0
  166. package/dist/shared/api/storefront/hooks/payment/use-create-adyen-session.js +1 -0
  167. package/dist/shared/api/storefront/hooks/payment/use-fetch-adyen-config.js +1 -0
  168. package/dist/shared/api/storefront/hooks/payment/use-invalidate-adyen.js +1 -0
  169. package/dist/shared/api/storefront/hooks/product/use-mark-product-as-viewed.js +1 -0
  170. package/dist/shared/api/storefront/hooks/translation/use-fetch-translations.js +1 -0
  171. package/dist/shared/api/storefront/hooks/website/use-fetch-countries-languages.js +1 -0
  172. package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.js +1 -0
  173. package/dist/shared/api/storefront/hooks/website/use-fetch-country-models.js +1 -0
  174. package/dist/shared/api/storefront/hooks/website/use-fetch-settings.js +1 -0
  175. package/dist/shared/api/storefront/hooks/website/use-update-locale.js +1 -0
  176. package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js +1 -0
  177. package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-wishlist.js +1 -1
  178. package/dist/shared/api/storefront/hooks/wishlist/use-create-wishlist.js +1 -0
  179. package/dist/shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js +1 -0
  180. package/dist/shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items.js +1 -1
  181. package/dist/shared/api/storefront/hooks/wishlist/use-fetch-wishlists.js +1 -0
  182. package/dist/shared/api/storefront/model/storefront.model.d.ts +8 -0
  183. package/dist/shared/api/storefront/services/cart-service.d.ts +1 -12
  184. package/dist/shared/api/storefront/services/cart-service.js +1 -43
  185. package/dist/shared/api/storefront/services/customer-service.d.ts +9 -1
  186. package/dist/shared/api/storefront/services/customer-service.js +19 -1
  187. package/dist/shared/api/storefront/services/order-service.d.ts +1 -5
  188. package/dist/shared/feature-flags/use-feature-flags.js +1 -0
  189. package/dist/shared/utils/children-to-text.d.ts +2 -0
  190. package/dist/shared/utils/children-to-text.js +18 -0
  191. package/dist/styles.css +259 -26
  192. package/dist/table/data-table.d.ts +3 -1
  193. package/dist/table/data-table.js +2 -2
  194. package/dist/table/elements/col.js +1 -0
  195. package/dist/table/elements/table.module.css.js +1 -1
  196. package/dist/table/elements/td.js +2 -2
  197. package/dist/table/elements/th.js +2 -2
  198. package/dist/table/elements/types.d.ts +1 -0
  199. package/dist/table/elements/use-table-row.js +1 -0
  200. package/dist/table/elements/use-table.js +1 -0
  201. package/dist/table/elements/use-td.js +2 -0
  202. package/dist/table/elements/use-th.js +1 -0
  203. package/dist/text/highlight-text/highlight-text.js +1 -0
  204. package/dist/text/truncated/truncated.js +4 -1
  205. package/package.json +3 -3
@@ -4,8 +4,8 @@ export declare const usePlaceOrder: () => {
4
4
  isLoading: boolean;
5
5
  isSuccess: boolean;
6
6
  mutate: (args_0: {
7
- cart: import("../../model/storefront.model").PatchCartModel;
7
+ cart: import("../../../storefront/model/storefront.model").PatchCartModel;
8
8
  isPending?: boolean;
9
- }) => Promise<import("../../model/storefront.model").CartModel>;
9
+ }) => Promise<import("../../../storefront/model/storefront.model").CartModel>;
10
10
  reset: () => void;
11
11
  };
@@ -1,6 +1,7 @@
1
+ "use client";
1
2
  import { useCallback } from 'react';
2
3
  import { useAwaitableMutation } from '../../../shared/hooks/use-awaitable-mutation.js';
3
- import { placeOrder } from '../../services/cart-service.js';
4
+ import { placeOrder } from '../../services/bff-service.js';
4
5
 
5
6
  const usePlaceOrder = () => {
6
7
  const onSuccess = useCallback(({ data: cart, queryClient }) => {
@@ -1,4 +1,4 @@
1
- import { CartModel } from '../../model/storefront.model';
1
+ import { CartModel } from '../../../storefront/model/storefront.model';
2
2
  interface UseSaveCartForLaterArgs {
3
3
  onError?: VoidFunction;
4
4
  onSuccess?: VoidFunction;
@@ -1,5 +1,6 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
- import { saveCartForLater } from '../../services/cart-service.js';
3
+ import { saveCartForLater } from '../../services/bff-service.js';
3
4
 
4
5
  function useSaveCartForLater({ onError, onSuccess, } = {}) {
5
6
  const queryClient = useQueryClient();
@@ -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,6 +1,7 @@
1
1
  import { CultureCode } from '../../../../intl/types';
2
2
  import { ProductListingPageData } from '../../../../pages/product/product-listing-page/product-listing-page-data-types';
3
3
  import { AnnouncementObject } from '../../../model/announcement';
4
+ import { CartModel, PatchCartModel } from '../../storefront/model/storefront.model';
4
5
  import { NavigationResponse, ProductDetailsPageDataResponse, ProductSummary } from '../model/bff.model';
5
6
  export interface FetchAnnouncementsArgs {
6
7
  cultureCode: CultureCode;
@@ -21,3 +22,14 @@ export declare function fetchNavigationLinks({ cultureCode, source, }: FetchNavi
21
22
  export declare function fetchRecentlyViewedProducts({ cultureCode, }: {
22
23
  cultureCode: CultureCode;
23
24
  }): Promise<ProductSummary[]>;
25
+ export declare function patchCart({ cart, forceRecalculation, }: {
26
+ cart: PatchCartModel;
27
+ forceRecalculation?: boolean;
28
+ }): Promise<CartModel>;
29
+ export declare function placeOrder({ cart, isPending, }: {
30
+ cart: PatchCartModel;
31
+ isPending?: boolean;
32
+ }): Promise<CartModel>;
33
+ export declare function saveCartForLater({ cart }: {
34
+ cart: CartModel;
35
+ }): Promise<CartModel>;
@@ -114,5 +114,47 @@ async function fetchRecentlyViewedProducts({ cultureCode, }) {
114
114
  });
115
115
  return body;
116
116
  }
117
+ async function patchCart({ cart, forceRecalculation = true, }) {
118
+ const { body } = await request({
119
+ body: cart,
120
+ credentials: 'include',
121
+ headers: {
122
+ 'Content-Type': 'application/json',
123
+ },
124
+ method: 'PATCH',
125
+ url: `${config.BFF_API_URL}/api/v1/carts/current${forceRecalculation ? '?forceRecalculation=true' : ''}`,
126
+ });
127
+ return body;
128
+ }
129
+ async function placeOrder({ cart, isPending, }) {
130
+ const newStatus = cart.requiresApproval
131
+ ? 'AwaitingApproval'
132
+ : isPending
133
+ ? 'PendingPaymentValidation'
134
+ : 'Submitted';
135
+ const { body } = await request({
136
+ body: { ...cart, status: newStatus },
137
+ credentials: 'include',
138
+ headers: {
139
+ 'Content-Type': 'application/json',
140
+ },
141
+ method: 'PATCH',
142
+ url: `${config.BFF_API_URL}/api/v1/carts/current?forceRecalculation=false`,
143
+ });
144
+ return body;
145
+ }
146
+ async function saveCartForLater({ cart }) {
147
+ // USER NEEDS TO BE LOGGED IN
148
+ const { body } = await request({
149
+ body: JSON.stringify({ ...cart, status: 'Saved' }),
150
+ credentials: 'include',
151
+ headers: {
152
+ 'Content-Type': 'application/json',
153
+ },
154
+ method: 'PATCH',
155
+ url: `${config.BFF_API_URL}/api/v1/carts/current`,
156
+ });
157
+ return body;
158
+ }
117
159
 
118
- export { fetchAnnouncements, fetchNavigationLinks, fetchProductDetailsPageData, fetchProductListingPageData, fetchRecentlyViewedProducts };
160
+ export { fetchAnnouncements, fetchNavigationLinks, fetchProductDetailsPageData, fetchProductListingPageData, fetchRecentlyViewedProducts, patchCart, placeOrder, saveCartForLater };
@@ -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
 
@@ -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 { 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
 
@@ -0,0 +1,8 @@
1
+ import { SortOption } from '../../model/storefront.model';
2
+ export declare function useFetchPagedShipToAddresses({ enabled, page, pageSize, search, sort, }?: {
3
+ enabled?: boolean;
4
+ page: number;
5
+ pageSize: number;
6
+ search?: string;
7
+ sort?: SortOption;
8
+ }): import("@tanstack/react-query").UseQueryResult<import("../../model/storefront.model").AddressesCollectionModel, Error>;
@@ -0,0 +1,13 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { fetchPagedShipToAddresses } from '../../services/customer-service.js';
3
+
4
+ function useFetchPagedShipToAddresses({ enabled = true, page = 1, pageSize = 20, search, sort, } = { enabled: true, page: 1, pageSize: 20, search: '' }) {
5
+ return useQuery({
6
+ enabled,
7
+ placeholderData: prev => prev,
8
+ queryFn: () => fetchPagedShipToAddresses({ page, pageSize, search, sort }),
9
+ queryKey: ['addresses', page, pageSize, search, sort],
10
+ });
11
+ }
12
+
13
+ export { useFetchPagedShipToAddresses };
@@ -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,5 +1,4 @@
1
- import { OrderStatus } from '../../model/storefront.model';
2
- import { SortOption } from '../../services/order-service';
1
+ import { OrderStatus, SortOption } from '../../model/storefront.model';
3
2
  export declare function useFetchOrders({ enabled, page, pageSize, search, sort, status, }?: {
4
3
  enabled?: boolean;
5
4
  page: number;
@@ -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,4 @@
1
+ "use client";
1
2
  import { useQueryClient, useMutation } from '@tanstack/react-query';
2
3
  import { markProductAsRecentlyViewed } from '../../services/product-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 { 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';
@@ -2190,6 +2190,10 @@ export interface MobilePageDto {
2190
2190
  [key: string]: any;
2191
2191
  } | null;
2192
2192
  }
2193
+ export interface AddressesCollectionModel extends BaseModel {
2194
+ pagination: PaginationModel | null;
2195
+ shipTos: ShipToModel[] | null;
2196
+ }
2193
2197
  export interface OrderCollectionModel extends BaseModel {
2194
2198
  orders: OrderModel[] | null;
2195
2199
  pagination: PaginationModel | null;
@@ -3092,3 +3096,7 @@ export type OrderStatus = keyof typeof orderStatusMappings;
3092
3096
  export declare const orderStatuses: OrderStatus[];
3093
3097
  export declare function fromApiStatusToOrderStatus(status: string): OrderStatus;
3094
3098
  export declare const isValidStatus: (status: string | undefined | null) => status is OrderStatus;
3099
+ export interface SortOption {
3100
+ name: string;
3101
+ order: 'ASC' | 'DESC';
3102
+ }
@@ -1,4 +1,4 @@
1
- import { AdyenPaymentModel, CartLineModel, CartLineModel as ShopCartLineModel, CartModel, CheckoutAtpEntry, PatchCartModel, ProductAtp, PromotionModel } from '../model/storefront.model';
1
+ import { AdyenPaymentModel, CartLineModel, CartLineModel as ShopCartLineModel, CartModel, CheckoutAtpEntry, ProductAtp, PromotionModel } from '../model/storefront.model';
2
2
  export declare function fetchCart({ forceRecalculation, id, }: {
3
3
  forceRecalculation?: boolean;
4
4
  id: string;
@@ -12,10 +12,6 @@ export declare function patchCartLineById({ cartLine, cartLineId, }: {
12
12
  cartLine: CartLineModel;
13
13
  cartLineId: string;
14
14
  }): Promise<CartLineModel>;
15
- export declare function patchCart({ cart, forceRecalculation, }: {
16
- cart: PatchCartModel;
17
- forceRecalculation?: boolean;
18
- }): Promise<CartModel>;
19
15
  export declare function deleteCurrentCart(): Promise<CartModel>;
20
16
  export declare function deleteCartLineById({ cartLineId, }: {
21
17
  cartLineId: string;
@@ -28,13 +24,6 @@ export interface AddProductToCurrentCartParams {
28
24
  export declare function addProductToCurrentCart(productOrderData: AddProductToCurrentCartParams): Promise<ShopCartLineModel>;
29
25
  export declare function fetchCurrentCartProductAtp(): Promise<ProductAtp[]>;
30
26
  export declare function fetchCurrentCheckoutAtp(): Promise<CheckoutAtpEntry[]>;
31
- export declare function placeOrder({ cart, isPending, }: {
32
- cart: PatchCartModel;
33
- isPending?: boolean;
34
- }): Promise<CartModel>;
35
- export declare function saveCartForLater({ cart }: {
36
- cart: CartModel;
37
- }): Promise<CartModel>;
38
27
  export declare function postAdyenPayment({ currencyCode, data, orderAmount, returnUrl, webOrderNumber, }: {
39
28
  currencyCode: string;
40
29
  data: any;
@@ -37,18 +37,6 @@ async function patchCartLineById({ cartLine, cartLineId, }) {
37
37
  });
38
38
  return body;
39
39
  }
40
- async function patchCart({ cart, forceRecalculation = true, }) {
41
- const { body } = await request({
42
- body: cart,
43
- credentials: 'include',
44
- headers: {
45
- 'Content-Type': 'application/json',
46
- },
47
- method: 'PATCH',
48
- url: `${config.BFF_API_URL}/api/v1/carts/current${forceRecalculation ? '?forceRecalculation=true' : ''}`,
49
- });
50
- return body;
51
- }
52
40
  async function deleteCurrentCart() {
53
41
  const { body } = await request({
54
42
  credentials: 'include',
@@ -98,36 +86,6 @@ async function fetchCurrentCheckoutAtp() {
98
86
  });
99
87
  return body;
100
88
  }
101
- async function placeOrder({ cart, isPending, }) {
102
- const newStatus = cart.requiresApproval
103
- ? 'AwaitingApproval'
104
- : isPending
105
- ? 'PendingPaymentValidation'
106
- : 'Submitted';
107
- const { body } = await request({
108
- body: { ...cart, status: newStatus },
109
- credentials: 'include',
110
- headers: {
111
- 'Content-Type': 'application/json',
112
- },
113
- method: 'PATCH',
114
- url: `${config.BFF_API_URL}/api/v1/carts/current?forceRecalculation=false`,
115
- });
116
- return body;
117
- }
118
- async function saveCartForLater({ cart }) {
119
- // USER NEEDS TO BE LOGGED IN
120
- const { body } = await request({
121
- body: JSON.stringify({ ...cart, status: 'Saved' }),
122
- credentials: 'include',
123
- headers: {
124
- 'Content-Type': 'application/json',
125
- },
126
- method: 'PATCH',
127
- url: `${config.BFF_API_URL}/api/v1/carts/current`,
128
- });
129
- return body;
130
- }
131
89
  async function postAdyenPayment({ currencyCode, data, orderAmount, returnUrl, webOrderNumber, }) {
132
90
  const { body } = await request({
133
91
  body: {
@@ -194,4 +152,4 @@ function convertToMinorUnits(value, currencyCode) {
194
152
  return Math.round(valueInMinorUnits);
195
153
  }
196
154
 
197
- export { addProductToCurrentCart, convertToMinorUnits, deleteCartLineById, deleteCurrentCart, fetchCart, fetchCurrentCart, fetchCurrentCartLines, fetchCurrentCartProductAtp, fetchCurrentCartPromotions, fetchCurrentCheckoutAtp, getAdyenPaymentDetails, patchCart, patchCartLineById, placeOrder, postAdyenPayment, saveCartForLater };
155
+ export { addProductToCurrentCart, convertToMinorUnits, deleteCartLineById, deleteCurrentCart, fetchCart, fetchCurrentCart, fetchCurrentCartLines, fetchCurrentCartProductAtp, fetchCurrentCartPromotions, fetchCurrentCheckoutAtp, getAdyenPaymentDetails, patchCartLineById, postAdyenPayment };