@evenicanpm/storefront-core 2.3.0 → 2.4.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 (80) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +29 -9
  3. package/src/api-manager/datasources/d365/d365-address.datasource.ts +11 -0
  4. package/src/api-manager/datasources/d365/d365-cart.datasource.ts +23 -1
  5. package/src/api-manager/datasources/d365/d365-order.datasource.ts +6 -1
  6. package/src/api-manager/datasources/d365/d365-user.datasource.ts +29 -14
  7. package/src/api-manager/datasources/e4/graphqlRequestSdk.ts +7 -0
  8. package/src/api-manager/index.ts +2 -1
  9. package/src/api-manager/schemas/product.schema.ts +1 -1
  10. package/src/auth/msal.ts +1 -4
  11. package/src/cms/blocks/block-manager.tsx +1 -1
  12. package/src/cms/blocks/components/footer/footer-content.tsx +61 -0
  13. package/src/cms/blocks/components/footer/index.tsx +9 -71
  14. package/src/cms/blocks/components/footer/interfaces.ts +4 -0
  15. package/src/cms/blocks/components/footer/sections/footer-contact.tsx +18 -9
  16. package/src/cms/blocks/components/footer/sections/footer-logo.tsx +17 -2
  17. package/src/cms/endpoints.ts +7 -2
  18. package/src/components/BazaarMenu.tsx +1 -1
  19. package/src/components/Typography.tsx +4 -2
  20. package/src/components/_tests_/site-logo.test.tsx +1 -1
  21. package/src/components/carousel-cards/carousel-card-1/CarouselCard1.stories.tsx +1 -1
  22. package/src/components/categories/category-menu.tsx +1 -1
  23. package/src/components/countries-input.tsx +4 -0
  24. package/src/components/header/components/user.tsx +4 -5
  25. package/src/components/navbar/mobile-menu/mobile-menu.test.tsx +1 -1
  26. package/src/components/navbar/utils/transform-nav.test.ts +1 -1
  27. package/src/components/navbar/utils/transform-nav.ts +1 -1
  28. package/src/components/product-cards/product-card/product-card.tsx +5 -2
  29. package/src/components/product-cards/product-card/styles/index.ts +1 -5
  30. package/src/components/product-cards/product-card-plp/product-card.tsx +4 -12
  31. package/src/components/product-cards/product-card-plp/styles/index.ts +15 -0
  32. package/src/components/products-view/compound/products-grid-view.tsx +5 -1
  33. package/src/components/products-view/compound/products-list-view.tsx +5 -1
  34. package/src/components/site-logo.tsx +1 -1
  35. package/src/components/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-item.tsx +3 -1
  36. package/src/global.d.ts +3 -0
  37. package/src/pages/account/account-navigation.tsx +2 -2
  38. package/src/pages/account/account-routes.ts +38 -4
  39. package/src/pages/account/addresses/address-form.tsx +20 -2
  40. package/src/pages/account/table-row-skeleton.tsx +31 -0
  41. package/src/pages/account/wishlist/wishlist-item.tsx +3 -1
  42. package/src/pages/blog/blog-detail-view.tsx +3 -1
  43. package/src/pages/cart/cart-item.tsx +1 -7
  44. package/src/pages/checkout/checkout-alt-form/checkout-form.tsx +14 -3
  45. package/src/pages/checkout/checkout-alt-form/steps/address/address-card.tsx +5 -3
  46. package/src/pages/checkout/checkout-alt-form/steps/address/new-address-form.tsx +1 -1
  47. package/src/pages/cms-page-view.tsx +1 -1
  48. package/src/pages/confirmation/ordered-products.tsx +3 -1
  49. package/src/pages/product-details/bopis/find-in-store-modal.tsx +4 -4
  50. package/src/pages/product-details/bopis/pickup-option-select.tsx +2 -2
  51. package/src/pages/product-details/bopis/search-header.tsx +2 -2
  52. package/src/pages/product-details/product-description.tsx +25 -13
  53. package/src/pages/product-details/product-intro/compound/context.ts +8 -3
  54. package/src/pages/product-details/product-intro/compound/product-info.tsx +25 -19
  55. package/src/pages/product-details/product-intro/compound/product-intro-images.tsx +26 -8
  56. package/src/pages/product-details/product-intro/compound/thumbnail-with-skeleton.tsx +17 -21
  57. package/src/pages/product-details/product-tabs.tsx +20 -4
  58. package/src/pages/product-list/product-list-view.tsx +2 -1
  59. package/src/providers/nav-provider/index.tsx +1 -1
  60. package/src/providers/nav-provider/utils/createLink.ts +1 -1
  61. package/tsconfig.json +1 -2
  62. package/__mocks__/countries.ts +0 -11
  63. package/__mocks__/create-mutation.ts +0 -68
  64. package/__mocks__/create-query.ts +0 -94
  65. package/__mocks__/data/categories.json +0 -795
  66. package/__mocks__/get-product-by-id.ts +0 -6
  67. package/__mocks__/next-auth-react.ts +0 -9
  68. package/__mocks__/next-font.js +0 -4
  69. package/__mocks__/next-headers.js +0 -13
  70. package/__mocks__/next-image.tsx +0 -18
  71. package/__mocks__/next-link.js +0 -19
  72. package/__mocks__/next-navigation.ts +0 -29
  73. package/__mocks__/product-dimensions.ts +0 -635
  74. package/__mocks__/products.ts +0 -533
  75. package/__mocks__/query-client.ts +0 -3
  76. package/__mocks__/wishlists.json +0 -408
  77. package/src/cms/blog.ts +0 -229
  78. package/src/cms/interfaces/navigation.ts +0 -52
  79. package/src/cms/interfaces/product-data.ts +0 -83
  80. package/src/cms/pages.ts +0 -149
@@ -1,94 +0,0 @@
1
- import { useQuery } from "@tanstack/react-query";
2
- import categories from "../__mocks__/data/categories.json";
3
- import { data as products } from "../__mocks__/products";
4
- import wishlists from "../__mocks__/wishlists.json";
5
-
6
- const cartBase = {
7
- Id: "cart-123",
8
- Version: 1,
9
- CartLines: [
10
- {
11
- LineId: "line-1",
12
- ProductId: 1,
13
- Quantity: 0,
14
- },
15
- ],
16
- };
17
- const cart = cartBase;
18
-
19
- const shippingInventoryData = {
20
- AggregatedProductInventoryAvailabilities: [
21
- {
22
- TotalAvailableInventoryLevelCode: "AVAIL",
23
- },
24
- ],
25
- };
26
-
27
- // Need to mock create query as fn() and then
28
- // mock the return value in the respective storeies
29
- // files, per component
30
- export const createQuery = (apiManagerPath: string[]) => {
31
- console.log(apiManagerPath);
32
- if (apiManagerPath[0] === "cart")
33
- return {
34
- useData: () => useQuery({ queryKey: ["cart"], queryFn: () => cart }),
35
- };
36
- if (apiManagerPath[1] === "getInventory") {
37
- return {
38
- useData: () =>
39
- useQuery({
40
- queryKey: ["cart", "getInventory"],
41
- queryFn: () => shippingInventoryData,
42
- }),
43
- };
44
- }
45
- if (apiManagerPath[1] === "searchProducts") {
46
- console.log("here are the products");
47
- console.log(products.products.length);
48
- return {
49
- useData: () =>
50
- useQuery({
51
- queryKey: ["product", "searchProducts"],
52
- queryFn: () => Promise.resolve(products.products),
53
- }),
54
- useSuspenseData: () =>
55
- useQuery({
56
- queryKey: ["product", "searchProducts"],
57
- queryFn: () => Promise.resolve(products.products),
58
- }),
59
- };
60
- }
61
- if (apiManagerPath[1] === "getWishlists") {
62
- return {
63
- useData: () =>
64
- useQuery({
65
- queryKey: ["wishlists"],
66
- queryFn: () => wishlists,
67
- }),
68
- useSuspenseData: () =>
69
- useQuery({
70
- queryKey: ["wishlists"],
71
- queryFn: () => wishlists,
72
- }),
73
- };
74
- }
75
- if (apiManagerPath[1] === "getCategories") {
76
- console.log("Here i am!");
77
- return {
78
- useData: () =>
79
- useQuery({
80
- queryKey: ["categories", "getCategories"],
81
- queryFn: () => categories,
82
- }),
83
- useSuspenseData: () =>
84
- useQuery({
85
- queryKey: ["cateogires", "getCategories"],
86
- queryFn: () => categories,
87
- }),
88
- };
89
- }
90
- };
91
-
92
- export const createApiPath = (key: string, method: string) => {
93
- return [key, method];
94
- };