@faststore/core 3.66.0 → 3.68.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 (251) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +74 -74
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/webpack/client-production/0.pack +0 -0
  6. package/.next/cache/webpack/client-production/index.pack +0 -0
  7. package/.next/cache/webpack/server-production/0.pack +0 -0
  8. package/.next/cache/webpack/server-production/index.pack +0 -0
  9. package/.next/prerender-manifest.js +1 -1
  10. package/.next/prerender-manifest.json +1 -1
  11. package/.next/react-loadable-manifest.json +87 -72
  12. package/.next/routes-manifest.json +1 -1
  13. package/.next/server/chunks/1333.js +1 -0
  14. package/.next/server/chunks/2778.js +2 -2
  15. package/.next/server/chunks/2792.js +1 -1
  16. package/.next/server/chunks/3006.js +1 -1
  17. package/.next/server/chunks/3836.js +1 -1
  18. package/.next/server/chunks/3918.js +1 -1
  19. package/.next/server/chunks/3963.js +1 -1
  20. package/.next/server/chunks/6789.js +1 -1
  21. package/.next/server/chunks/7178.js +1 -1
  22. package/.next/server/chunks/7228.js +1 -1
  23. package/.next/server/chunks/7794.js +1 -1
  24. package/.next/server/chunks/83.js +1 -1
  25. package/.next/server/chunks/831.js +1 -1
  26. package/.next/server/chunks/839.js +1 -0
  27. package/.next/server/chunks/8569.js +1 -1
  28. package/.next/server/chunks/8687.js +1 -1
  29. package/.next/server/chunks/948.js +2 -2
  30. package/.next/server/chunks/9563.js +2 -2
  31. package/.next/server/chunks/9630.js +4 -4
  32. package/.next/server/chunks/UIBannerText.js +1 -1
  33. package/.next/server/functions-config-manifest.json +1 -1
  34. package/.next/server/middleware-build-manifest.js +1 -1
  35. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  36. package/.next/server/pages/404.js +1 -1
  37. package/.next/server/pages/404.js.nft.json +1 -1
  38. package/.next/server/pages/500.js +1 -1
  39. package/.next/server/pages/500.js.nft.json +1 -1
  40. package/.next/server/pages/[...slug].js +1 -1
  41. package/.next/server/pages/[...slug].js.nft.json +1 -1
  42. package/.next/server/pages/[slug]/p.js +1 -1
  43. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  44. package/.next/server/pages/_app.js.nft.json +1 -1
  45. package/.next/server/pages/_document.js.nft.json +1 -1
  46. package/.next/server/pages/_error.js.nft.json +1 -1
  47. package/.next/server/pages/account/403.js +1 -1
  48. package/.next/server/pages/account/403.js.nft.json +1 -1
  49. package/.next/server/pages/account/404.js +1 -1
  50. package/.next/server/pages/account/404.js.nft.json +1 -1
  51. package/.next/server/pages/account/[...unknown].js.nft.json +1 -1
  52. package/.next/server/pages/account/orders/[id].js +1 -1
  53. package/.next/server/pages/account/orders/[id].js.nft.json +1 -1
  54. package/.next/server/pages/account/orders.js +1 -1
  55. package/.next/server/pages/account/orders.js.nft.json +1 -1
  56. package/.next/server/pages/account/profile.js +1 -1
  57. package/.next/server/pages/account/profile.js.nft.json +1 -1
  58. package/.next/server/pages/account/security.js +1 -1
  59. package/.next/server/pages/account/security.js.nft.json +1 -1
  60. package/.next/server/pages/account/user-details.js +1 -1
  61. package/.next/server/pages/account/user-details.js.nft.json +1 -1
  62. package/.next/server/pages/account.js.nft.json +1 -1
  63. package/.next/server/pages/api/graphql.js +2 -2
  64. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  65. package/.next/server/pages/api/health/live.js.nft.json +1 -1
  66. package/.next/server/pages/api/health/ready.js.nft.json +1 -1
  67. package/.next/server/pages/api/preview.js +1 -1
  68. package/.next/server/pages/api/preview.js.nft.json +1 -1
  69. package/.next/server/pages/checkout.js +1 -1
  70. package/.next/server/pages/checkout.js.nft.json +1 -1
  71. package/.next/server/pages/en-US/404.html +1 -1
  72. package/.next/server/pages/en-US/500.html +1 -1
  73. package/.next/server/pages/en-US/checkout.html +1 -1
  74. package/.next/server/pages/en-US/login.html +1 -1
  75. package/.next/server/pages/en-US/s.html +1 -1
  76. package/.next/server/pages/en-US.html +1 -1
  77. package/.next/server/pages/index.js +1 -1
  78. package/.next/server/pages/index.js.nft.json +1 -1
  79. package/.next/server/pages/login.js +1 -1
  80. package/.next/server/pages/login.js.nft.json +1 -1
  81. package/.next/server/pages/s.js +1 -1
  82. package/.next/server/pages/s.js.nft.json +1 -1
  83. package/.next/server/pages-manifest.json +1 -1
  84. package/.next/static/chunks/2284.6dd050e60172189a.js +1 -0
  85. package/.next/static/chunks/3155.243c7558a71f0695.js +1 -0
  86. package/.next/static/chunks/3166-6af5e854c2f2913a.js +1 -0
  87. package/.next/static/chunks/3399.93804fb74f79436c.js +1 -0
  88. package/.next/static/chunks/353.7f2181843462717d.js +1 -0
  89. package/.next/static/chunks/4803.412bf2a7e15626a6.js +1 -0
  90. package/.next/static/chunks/5781.28d03feacead66ad.js +1 -0
  91. package/.next/static/chunks/6355.57d1a07f50ee6cc9.js +1 -0
  92. package/.next/static/chunks/{6393.361c44eb0818eb7e.js → 6393.53e9ea4f29d1bf23.js} +1 -1
  93. package/.next/static/chunks/6700.f046aa86e2c83b53.js +1 -0
  94. package/.next/static/chunks/6857.b2c06171638955ea.js +1 -0
  95. package/.next/static/chunks/7191-9bdd5f0c18fbd942.js +1 -0
  96. package/.next/static/chunks/{6410.bd3fa399df59cc80.js → 7351.e90a4cc21797c136.js} +1 -1
  97. package/.next/static/chunks/7481.3c4ad3642e346232.js +1 -0
  98. package/.next/static/chunks/7498-0dc4f9a9ed199d3a.js +1 -0
  99. package/.next/static/chunks/83.ee1fdbe283ac65b6.js +1 -0
  100. package/.next/static/chunks/9173-88b7ddf38554a5cf.js +1 -0
  101. package/.next/static/chunks/BannerNewsletter.a9ea51c53885c80f.js +1 -0
  102. package/.next/static/chunks/{BannerText.695d4d4b6a3f7309.js → BannerText.21f106b180339df1.js} +1 -1
  103. package/.next/static/chunks/CartSidebar.55cc31a37ffa6ee6.js +1 -0
  104. package/.next/static/chunks/{Footer.5ed205d931401110.js → Footer.09dddd47ce6c816f.js} +1 -1
  105. package/.next/static/chunks/Newsletter.2c79d1813e9f9c95.js +1 -0
  106. package/.next/static/chunks/ProductShelf.299d0989eea49a79.js +1 -0
  107. package/.next/static/chunks/ProductTiles.ab99b919f3c0215f.js +1 -0
  108. package/.next/static/chunks/RegionModal.503f063f2e19b936.js +1 -0
  109. package/.next/static/chunks/RegionSlider.00de4571775d04cc.js +1 -0
  110. package/.next/static/chunks/Toast.75a18f47eb23b703.js +1 -0
  111. package/.next/static/chunks/UIBannerText.f4167ceafb96cf67.js +1 -0
  112. package/.next/static/chunks/UISKUMatrixSidebar.8b6fac58c48f999c.js +1 -0
  113. package/.next/static/chunks/UIToast.a49584c87d3adc17.js +1 -0
  114. package/.next/static/chunks/pages/{404-3582ed9196afdf1e.js → 404-dca50618ea3e6fb6.js} +1 -1
  115. package/.next/static/chunks/pages/{500-1b4eca062588da7f.js → 500-ae6697c7631fb07a.js} +1 -1
  116. package/.next/static/chunks/pages/[...slug]-debd8b208a0e3d02.js +1 -0
  117. package/.next/static/chunks/pages/[slug]/p-d782ecb21200f200.js +1 -0
  118. package/.next/static/chunks/pages/_app-728289774860e9d9.js +1 -0
  119. package/.next/static/chunks/pages/account/{403-c791997011f970b6.js → 403-a3d8b31b4e9ee8a6.js} +1 -1
  120. package/.next/static/chunks/pages/account/{404-74e64bb12e8f5a68.js → 404-22b789f04fcdce39.js} +1 -1
  121. package/.next/static/chunks/pages/account/orders/[id]-a2f44ba3963b81cd.js +1 -0
  122. package/.next/static/chunks/pages/account/orders-ec040e06c4b516d0.js +1 -0
  123. package/.next/static/chunks/pages/account/profile-29f93f4c5a55bd87.js +1 -0
  124. package/.next/static/chunks/pages/account/security-94874fc477520f74.js +1 -0
  125. package/.next/static/chunks/pages/account/{user-details-6f9fe72e02f5c5df.js → user-details-143cb45d5080d1d9.js} +1 -1
  126. package/.next/static/chunks/pages/checkout-b0637ee59b1cdca8.js +1 -0
  127. package/.next/static/chunks/pages/index-b45c9535696b5ab1.js +1 -0
  128. package/.next/static/chunks/pages/login-bae3a4cdaaed110c.js +1 -0
  129. package/.next/static/chunks/pages/s-011eedb19dcdccc6.js +1 -0
  130. package/.next/static/chunks/webpack-8b6c086380cf1398.js +1 -0
  131. package/.next/static/css/{74e963fcd3434141.css → 118f0b6523312556.css} +1 -1
  132. package/.next/static/css/{e4b714970415f2eb.css → 2a4b7072e47636f1.css} +1 -1
  133. package/.next/static/css/{8a3f440e0ff9cd8e.css → 3d41485722b4e3f5.css} +1 -1
  134. package/.next/static/css/{2841bab51b99dd53.css → 92960607d6088082.css} +1 -1
  135. package/.next/static/css/d26cb0a54378b3d9.css +1 -0
  136. package/.next/static/css/f93cf36b16950027.css +1 -0
  137. package/.next/static/pRYrZEXsDEpvxbtvEobPH/_buildManifest.js +1 -0
  138. package/.next/trace +135 -132
  139. package/.turbo/turbo-build.log +36 -33
  140. package/.turbo/turbo-test.log +5 -5
  141. package/@generated/gql.ts +8 -0
  142. package/@generated/graphql.ts +83 -0
  143. package/@generated/persisted-documents.json +1 -0
  144. package/@generated/schema.graphql +51 -0
  145. package/CHANGELOG.md +12 -0
  146. package/cms/faststore/content-types.json +238 -1
  147. package/cms/faststore/sections.json +34 -33
  148. package/cypress/integration/plp.test.js +2 -2
  149. package/index.ts +9 -0
  150. package/package.json +6 -6
  151. package/src/components/cms/GlobalSections.tsx +1 -0
  152. package/src/components/cms/RenderSections.tsx +8 -4
  153. package/src/components/cms/global/Components.ts +8 -0
  154. package/src/components/common/PreviewTag/section.module.scss +2 -2
  155. package/src/components/navigation/Navbar/Navbar.tsx +5 -6
  156. package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +23 -4
  157. package/src/components/region/RegionBar/RegionBar.tsx +48 -12
  158. package/src/components/region/RegionFilterButton/RegionFilterButton.tsx +57 -0
  159. package/src/components/region/RegionFilterButton/index.ts +1 -0
  160. package/src/components/region/RegionModal/RegionModal.tsx +26 -16
  161. package/src/components/region/RegionModal/useRegion.ts +12 -11
  162. package/src/components/region/RegionPopover/RegionPopover.tsx +37 -22
  163. package/src/components/region/RegionSlider/RegionSlider.tsx +407 -0
  164. package/src/components/region/RegionSlider/index.ts +1 -0
  165. package/src/components/region/RegionSlider/section.module.scss +72 -0
  166. package/src/components/search/Filter/FilterDeliveryMethodFacet.tsx +68 -0
  167. package/src/components/search/Filter/FilterDesktop.tsx +148 -90
  168. package/src/components/search/Filter/FilterSlider.tsx +193 -104
  169. package/src/components/search/Filter/section.module.scss +2 -0
  170. package/src/components/sections/ProductGallery/section.module.scss +2 -0
  171. package/src/components/sections/RegionBar/DefaultComponents.ts +1 -0
  172. package/src/components/sections/RegionBar/RegionBar.tsx +2 -1
  173. package/src/components/templates/LandingPage/LandingPage.tsx +6 -3
  174. package/src/components/templates/ProductListingPage/ProductListing.tsx +4 -1
  175. package/src/components/templates/ProductListingPage/ProductListingPage.tsx +3 -0
  176. package/src/components/templates/SearchPage/SearchPage.tsx +3 -0
  177. package/src/components/templates/SearchPage/SearchWrapper.tsx +15 -7
  178. package/src/components/ui/PickupPoints/PickupPointCard.tsx +39 -0
  179. package/src/components/ui/PickupPoints/PickupPointCards.tsx +102 -0
  180. package/src/components/ui/PickupPoints/index.ts +5 -0
  181. package/src/components/ui/ProductGallery/ProductGallery.tsx +6 -9
  182. package/src/experimental/index.ts +6 -0
  183. package/src/pages/404.tsx +15 -6
  184. package/src/pages/500.tsx +15 -6
  185. package/src/pages/[...slug].tsx +14 -5
  186. package/src/pages/[slug]/p.tsx +6 -3
  187. package/src/pages/_app.tsx +15 -10
  188. package/src/pages/account/403.tsx +30 -27
  189. package/src/pages/account/404.tsx +27 -20
  190. package/src/pages/account/orders/[id].tsx +22 -19
  191. package/src/pages/account/orders/index.tsx +25 -22
  192. package/src/pages/account/profile.tsx +27 -23
  193. package/src/pages/account/security.tsx +28 -23
  194. package/src/pages/account/user-details.tsx +20 -17
  195. package/src/pages/checkout.tsx +11 -8
  196. package/src/pages/index.tsx +7 -4
  197. package/src/pages/login.tsx +16 -7
  198. package/src/pages/s.tsx +5 -2
  199. package/src/sdk/deliveryPromise/index.ts +22 -0
  200. package/src/sdk/deliveryPromise/provider.tsx +119 -0
  201. package/src/sdk/deliveryPromise/queries.ts +80 -0
  202. package/src/sdk/deliveryPromise/reducer.ts +137 -0
  203. package/src/sdk/deliveryPromise/useDeliveryPromise.ts +419 -0
  204. package/src/sdk/overrides/PageProvider.tsx +9 -4
  205. package/src/sdk/product/useLocalizedVariables.ts +20 -6
  206. package/src/sdk/search/useFilter.ts +12 -1
  207. package/src/server/cms/index.ts +2 -0
  208. package/src/typings/overrides.ts +2 -1
  209. package/src/utils/globalSettings.ts +74 -0
  210. package/src/utils/utilities.ts +5 -0
  211. package/test/server/index.test.ts +1 -0
  212. package/.next/server/chunks/6272.js +0 -1
  213. package/.next/static/chunks/2284.1b43aea18c23c79e.js +0 -1
  214. package/.next/static/chunks/3155.ea52e06317dab557.js +0 -1
  215. package/.next/static/chunks/3166-50d81179a0f5a894.js +0 -1
  216. package/.next/static/chunks/3399.13a97fefb512c902.js +0 -1
  217. package/.next/static/chunks/3465.af28497e8069330f.js +0 -1
  218. package/.next/static/chunks/4803.de5b14237d616808.js +0 -1
  219. package/.next/static/chunks/4949.ea0775ca3029fb98.js +0 -1
  220. package/.next/static/chunks/6355.f1b1feefc0c84a2a.js +0 -1
  221. package/.next/static/chunks/6700.4e9426fe8b826dab.js +0 -1
  222. package/.next/static/chunks/7191-2a7b8ddbd07128b6.js +0 -1
  223. package/.next/static/chunks/7498-5246b607527180dd.js +0 -1
  224. package/.next/static/chunks/83.b87d797323ff2034.js +0 -1
  225. package/.next/static/chunks/9173-c1819846b9006c7a.js +0 -1
  226. package/.next/static/chunks/9540.69781e999f27cc05.js +0 -1
  227. package/.next/static/chunks/BannerNewsletter.7c592f132e7048e5.js +0 -1
  228. package/.next/static/chunks/CartSidebar.a00083c44c87c268.js +0 -1
  229. package/.next/static/chunks/Newsletter.1004055f09f76d3c.js +0 -1
  230. package/.next/static/chunks/ProductShelf.d51ba3e6a1b4a57d.js +0 -1
  231. package/.next/static/chunks/ProductTiles.77284431e2b8c898.js +0 -1
  232. package/.next/static/chunks/RegionModal.f61aa62e0a09182a.js +0 -1
  233. package/.next/static/chunks/Toast.6116bc845cd67f49.js +0 -1
  234. package/.next/static/chunks/UIBannerText.6cc5c00d4ba9b64e.js +0 -1
  235. package/.next/static/chunks/UISKUMatrixSidebar.782c55a97889e84a.js +0 -1
  236. package/.next/static/chunks/UIToast.494d0b0ce2c6106a.js +0 -1
  237. package/.next/static/chunks/pages/[...slug]-0db18c1c0920e8d2.js +0 -1
  238. package/.next/static/chunks/pages/[slug]/p-a255e4a7352455df.js +0 -1
  239. package/.next/static/chunks/pages/_app-1885a948b243078c.js +0 -1
  240. package/.next/static/chunks/pages/account/orders/[id]-b9feb0c860ff1cec.js +0 -1
  241. package/.next/static/chunks/pages/account/orders-1d8409a8b4b0e581.js +0 -1
  242. package/.next/static/chunks/pages/account/profile-5a919fa02b76a422.js +0 -1
  243. package/.next/static/chunks/pages/account/security-b5ab3d1ecbbea9d9.js +0 -1
  244. package/.next/static/chunks/pages/checkout-3a4983b22625c4e3.js +0 -1
  245. package/.next/static/chunks/pages/index-6e68be53d1fef20e.js +0 -1
  246. package/.next/static/chunks/pages/login-de3dd10c6b35159a.js +0 -1
  247. package/.next/static/chunks/pages/s-9b0f606f120d66b0.js +0 -1
  248. package/.next/static/chunks/webpack-a24b8ac1ca628dfe.js +0 -1
  249. package/.next/static/css/202a74b80e6ce63f.css +0 -1
  250. package/.next/static/pub-GYCLSosy4MirjEMnD/_buildManifest.js +0 -1
  251. /package/.next/static/{pub-GYCLSosy4MirjEMnD → pRYrZEXsDEpvxbtvEobPH}/_ssgManifest.js +0 -0
@@ -2142,7 +2142,7 @@
2142
2142
  "required": ["label"],
2143
2143
  "properties": {
2144
2144
  "icon": {
2145
- "title": "Location Icon",
2145
+ "title": "Location icon",
2146
2146
  "type": "object",
2147
2147
  "properties": {
2148
2148
  "icon": {
@@ -2153,7 +2153,7 @@
2153
2153
  "default": "MapPin"
2154
2154
  },
2155
2155
  "alt": {
2156
- "title": "Alternative Label",
2156
+ "title": "Alternative label",
2157
2157
  "type": "string",
2158
2158
  "default": "Map Pin icon"
2159
2159
  }
@@ -2167,7 +2167,8 @@
2167
2167
  "editLabel": {
2168
2168
  "title": "Location edit label",
2169
2169
  "type": "string",
2170
- "default": "Edit"
2170
+ "default": "",
2171
+ "description": "[Deprecated] This label should not be used anymore."
2171
2172
  },
2172
2173
  "buttonIcon": {
2173
2174
  "title": "Button Icon",
@@ -2219,24 +2220,23 @@
2219
2220
  "properties": {
2220
2221
  "label": {
2221
2222
  "title": "Input field label",
2222
- "type": "string",
2223
- "default": "Postal Code"
2223
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2224
+ "type": "string"
2224
2225
  },
2225
2226
  "errorMessage": {
2226
2227
  "title": "Input field error message",
2227
- "type": "string",
2228
- "default": "You entered an invalid Postal Code"
2228
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2229
+ "type": "string"
2229
2230
  },
2230
2231
  "noProductsAvailableErrorMessage": {
2231
2232
  "title": "Input field error message for the scenario of no products available for a given location",
2232
- "type": "string",
2233
- "default": "There are no products available for %s.",
2234
- "description": "The '%s' will be replaced by the postal code value."
2233
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections The '%s' is replaced by the postal code value.",
2234
+ "type": "string"
2235
2235
  },
2236
2236
  "buttonActionText": {
2237
2237
  "title": "Input field action button label",
2238
- "type": "string",
2239
- "default": "Apply"
2238
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2239
+ "type": "string"
2240
2240
  }
2241
2241
  }
2242
2242
  },
@@ -2247,11 +2247,12 @@
2247
2247
  "text": {
2248
2248
  "type": "string",
2249
2249
  "title": "Link Text",
2250
- "default": "I don't know my Postal Code"
2250
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections"
2251
2251
  },
2252
2252
  "to": {
2253
2253
  "type": "string",
2254
- "title": "Action link"
2254
+ "title": "Action link",
2255
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections"
2255
2256
  },
2256
2257
  "icon": {
2257
2258
  "title": "Icon",
@@ -2259,15 +2260,15 @@
2259
2260
  "properties": {
2260
2261
  "icon": {
2261
2262
  "title": "Icon",
2263
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2262
2264
  "type": "string",
2263
2265
  "enumNames": ["Arrow Square Out"],
2264
- "enum": ["ArrowSquareOut"],
2265
- "default": "ArrowSquareOut"
2266
+ "enum": ["ArrowSquareOut"]
2266
2267
  },
2267
2268
  "alt": {
2268
2269
  "title": "Alternative Label",
2269
- "type": "string",
2270
- "default": "Arrow Square Out icon"
2270
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2271
+ "type": "string"
2271
2272
  }
2272
2273
  }
2273
2274
  }
@@ -2300,24 +2301,23 @@
2300
2301
  "properties": {
2301
2302
  "label": {
2302
2303
  "title": "Input field label",
2303
- "type": "string",
2304
- "default": "Postal Code"
2304
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2305
+ "type": "string"
2305
2306
  },
2306
2307
  "errorMessage": {
2307
2308
  "title": "Input field error message",
2308
- "type": "string",
2309
- "default": "You entered an invalid Postal Code"
2309
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2310
+ "type": "string"
2310
2311
  },
2311
2312
  "noProductsAvailableErrorMessage": {
2312
2313
  "title": "Input field error message for the scenario of no products available for a given location",
2313
- "type": "string",
2314
- "default": "There are no products available for %s.",
2315
- "description": "The '%s' will be replaced by the postal code value."
2314
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections The '%s' is replaced by the postal code value.",
2315
+ "type": "string"
2316
2316
  },
2317
2317
  "buttonActionText": {
2318
2318
  "title": "Input field action button label",
2319
- "type": "string",
2320
- "default": "Apply"
2319
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2320
+ "type": "string"
2321
2321
  }
2322
2322
  }
2323
2323
  },
@@ -2345,11 +2345,12 @@
2345
2345
  "text": {
2346
2346
  "type": "string",
2347
2347
  "title": "Link Text",
2348
- "default": "I don't know my Postal Code"
2348
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections"
2349
2349
  },
2350
2350
  "to": {
2351
2351
  "type": "string",
2352
- "title": "Action link"
2352
+ "title": "Action link",
2353
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections"
2353
2354
  },
2354
2355
  "icon": {
2355
2356
  "title": "Icon",
@@ -2357,15 +2358,15 @@
2357
2358
  "properties": {
2358
2359
  "icon": {
2359
2360
  "title": "Icon",
2361
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2360
2362
  "type": "string",
2361
2363
  "enumNames": ["Arrow Square Out"],
2362
- "enum": ["ArrowSquareOut"],
2363
- "default": "ArrowSquareOut"
2364
+ "enum": ["ArrowSquareOut"]
2364
2365
  },
2365
2366
  "alt": {
2366
2367
  "title": "Alternative Label",
2367
- "type": "string",
2368
- "default": "Arrow Square Out icon"
2368
+ "description": "[Deprecated] Use the fields from the Settings tab in Global Sections",
2369
+ "type": "string"
2369
2370
  }
2370
2371
  }
2371
2372
  }
@@ -3,8 +3,8 @@
3
3
  * Cypress tests for PLP
4
4
  */
5
5
 
6
- import { options } from '../global'
7
6
  import { cypress } from '../../discovery.config'
7
+ import { options } from '../global'
8
8
 
9
9
  const { pages } = cypress
10
10
 
@@ -33,7 +33,7 @@ describe('Search page Filters and Sorting options', () => {
33
33
  const value = $checkbox.attr('data-value')
34
34
  // const quantity = $checkbox.attr('data-quantity')
35
35
 
36
- cy.getById('filter-slider-button-apply')
36
+ cy.getById('fs-filter-slider-button-apply')
37
37
  .click()
38
38
 
39
39
  .then(() => {
package/index.ts CHANGED
@@ -26,3 +26,12 @@ export { default as ProductGallerySection } from './src/components/sections/Prod
26
26
  export { default as ProductShelfSection } from './src/components/sections/ProductShelf'
27
27
  export { default as RegionBarSection } from './src/components/sections/RegionBar'
28
28
  export { default as Section } from './src/components/sections/Section'
29
+
30
+ // Delivery Promise
31
+ export {
32
+ PICKUP_IN_POINT_FACET_VALUE,
33
+ PICKUP_POINT_FACET_KEY,
34
+ SHIPPING_FACET_KEY,
35
+ PICKUP_ALL_FACET_VALUE,
36
+ getPickupPoints,
37
+ } from './src/sdk/deliveryPromise'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "3.66.0",
3
+ "version": "3.68.0",
4
4
  "license": "MIT",
5
5
  "repository": "vtex/faststore",
6
6
  "browserslist": "supports es6-module and not dead",
@@ -44,11 +44,11 @@
44
44
  "@envelop/graphql-jit": "^8.0.3",
45
45
  "@envelop/parser-cache": "^6.0.2",
46
46
  "@envelop/validation-cache": "^6.0.2",
47
- "@faststore/api": "^3.66.0",
47
+ "@faststore/api": "^3.68.0",
48
48
  "@faststore/graphql-utils": "^3.56.1",
49
49
  "@faststore/lighthouse": "^3.56.1",
50
- "@faststore/sdk": "^3.63.0",
51
- "@faststore/ui": "^3.65.0",
50
+ "@faststore/sdk": "^3.68.0",
51
+ "@faststore/ui": "^3.68.0",
52
52
  "@graphql-codegen/cli": "5.0.2",
53
53
  "@graphql-codegen/client-preset": "4.2.6",
54
54
  "@graphql-codegen/typescript": "4.0.7",
@@ -60,7 +60,7 @@
60
60
  "@graphql-typed-document-node/core": "^3.2.0",
61
61
  "@parcel/watcher": "^2.4.0",
62
62
  "@types/react": "^18.2.42",
63
- "@vtex/client-cms": "^0.2.12",
63
+ "@vtex/client-cms": "^0.2.16",
64
64
  "@vtex/client-cp": "0.3.0",
65
65
  "@vtex/prettier-config": "1.0.0",
66
66
  "autoprefixer": "^10.4.0",
@@ -107,5 +107,5 @@
107
107
  "ts-jest": "29.1.1",
108
108
  "typescript": "5.3.2"
109
109
  },
110
- "gitHead": "df3a172b06dc2e5759067eeed6dd13905003b7d7"
110
+ "gitHead": "ecc700eec58eaa22c6ae8c5f655c204ecf18f598"
111
111
  }
@@ -10,6 +10,7 @@ export const GLOBAL_SECTIONS_FOOTER_CONTENT_TYPE = 'globalFooterSections'
10
10
 
11
11
  export type GlobalSectionsData = {
12
12
  sections: Section[]
13
+ settings?: Record<string, unknown>
13
14
  }
14
15
 
15
16
  export const getGlobalSectionsByType = async (
@@ -12,9 +12,9 @@ import dynamic from 'next/dynamic'
12
12
  import { useRouter } from 'next/router'
13
13
  import useTTI from 'src/sdk/performance/useTTI'
14
14
  import { isContentPlatformSource } from 'src/server/content/utils'
15
+ import COMPONENTS from './global/Components'
15
16
  import SectionBoundary from './SectionBoundary'
16
17
  import ViewportObserver from './ViewportObserver'
17
- import COMPONENTS from './global/Components'
18
18
 
19
19
  interface Props {
20
20
  components?: Record<string, ComponentType<any>>
@@ -23,7 +23,7 @@ interface Props {
23
23
  isInteractive?: boolean
24
24
  }
25
25
 
26
- const SECTIONS_OUT_OF_VIEWPORT = ['CartSidebar', 'RegionModal']
26
+ const SECTIONS_OUT_OF_VIEWPORT = ['CartSidebar', 'RegionModal', 'RegionSlider']
27
27
 
28
28
  const Toast = dynamic(
29
29
  () => import(/* webpackChunkName: "Toast" */ '../common/Toast'),
@@ -67,12 +67,16 @@ export const LazyLoadingSection = ({
67
67
  debug?: boolean
68
68
  isInteractive?: boolean
69
69
  }) => {
70
- const { cart: displayCart, modal: displayModal } = useUI()
70
+ const { cart: displayCart, modal: displayModal, regionSlider } = useUI()
71
+
71
72
  if (SECTIONS_OUT_OF_VIEWPORT.includes(sectionName)) {
72
73
  const shouldLoad =
73
74
  isInteractive ||
74
75
  (sectionName === 'CartSidebar' && displayCart) ||
75
- (sectionName === 'RegionModal' && displayModal)
76
+ (sectionName === 'RegionModal' && displayModal) ||
77
+ (sectionName === 'RegionSlider' &&
78
+ regionSlider.isOpen &&
79
+ regionSlider.type !== 'none')
76
80
 
77
81
  if (debug) {
78
82
  console.log(
@@ -28,6 +28,13 @@ const Footer = dynamic(
28
28
  import(/* webpackChunkName: "Footer" */ 'src/components/sections/Footer'),
29
29
  { ssr: false }
30
30
  )
31
+ const RegionSlider = dynamic(
32
+ () =>
33
+ import(
34
+ /* webpackChunkName: "RegionSlider" */ 'src/components/region/RegionSlider'
35
+ ),
36
+ { ssr: false }
37
+ )
31
38
 
32
39
  const COMPONENTS: Record<string, ComponentType<any>> = {
33
40
  Alert,
@@ -36,6 +43,7 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
36
43
  RegionPopover,
37
44
  CartSidebar, // out of viewport
38
45
  RegionModal, // out of viewport
46
+ RegionSlider, // out of viewport
39
47
  Footer, // out of viewport
40
48
  ...PLUGINS_COMPONENTS,
41
49
  ...CUSTOM_COMPONENTS,
@@ -5,12 +5,12 @@
5
5
  @import "@faststore/ui/src/components/molecules/Tag/styles.scss";
6
6
 
7
7
  [data-fs-preview-tag] {
8
- box-shadow: var(--fs-shadow-darker);
9
- backdrop-filter: blur(var(--fs-spacing-1));
10
8
  position: fixed;
11
9
  top: 1rem;
12
10
  right: 1rem;
13
11
  z-index: 10000;
12
+ box-shadow: var(--fs-shadow-darker);
13
+ backdrop-filter: blur(var(--fs-spacing-1));
14
14
  }
15
15
  }
16
16
  }
@@ -1,20 +1,19 @@
1
1
  import { useCallback, useRef, useState } from 'react'
2
+ import dynamic from 'next/dynamic'
2
3
 
3
4
  import { Icon as UIIcon, useScrollDirection, useUI } from '@faststore/ui'
4
5
 
5
6
  import type { SearchInputRef } from 'src/components/search/SearchInput'
6
7
  import SearchInput from 'src/components/search/SearchInput'
7
-
8
8
  import CartToggle from 'src/components/cart/CartToggle'
9
9
  import Link from 'src/components/ui/Link'
10
10
  import Logo from 'src/components/ui/Logo'
11
- import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
12
-
13
- import storeConfig from 'discovery.config'
14
- import dynamic from 'next/dynamic'
15
11
  import { OrganizationSignInButton } from 'src/components/account/MyAccountDrawer/OrganizationSignInButton'
12
+ import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
16
13
  import { useSession } from 'src/sdk/session'
17
14
  import useScreenResize from 'src/sdk/ui/useScreenResize'
15
+
16
+ import storeConfig from 'discovery.config'
18
17
  import type { NavbarProps as SectionNavbarProps } from '../../sections/Navbar'
19
18
 
20
19
  const NavbarLinks = dynamic(
@@ -101,7 +100,7 @@ function Navbar({
101
100
  const scrollDirection = useScrollDirection()
102
101
  const { openNavbar, navbar: displayNavbar } = useUI()
103
102
  const { isDesktop, isMobile } = useScreenResize()
104
- const { person, b2b } = useSession()
103
+ const { b2b } = useSession()
105
104
 
106
105
  const searchMobileRef = useRef<SearchInputRef>(null)
107
106
  const [searchExpanded, setSearchExpanded] = useState(false)
@@ -1,13 +1,19 @@
1
1
  import type { AnchorHTMLAttributes } from 'react'
2
+ import { useRouter } from 'next/router'
2
3
 
3
- import type { NavbarLinksProps as UINavbarLinksProps } from '@faststore/ui'
4
- import { NavbarLinksListItem as UINavbarLinksListItem } from '@faststore/ui'
4
+ import {
5
+ NavbarLinksListItem as UINavbarLinksListItem,
6
+ type NavbarLinksProps as UINavbarLinksProps,
7
+ } from '@faststore/ui'
5
8
 
6
9
  import type { NavbarProps } from 'src/components/navigation/Navbar'
7
10
  import RegionButton from 'src/components/region/RegionButton'
11
+ import RegionFilterButton from 'src/components/region/RegionFilterButton'
8
12
  import Link from 'src/components/ui/Link'
9
-
10
13
  import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
14
+ import { useSession } from 'src/sdk/session'
15
+ import { useDeliveryPromise } from 'src/sdk/deliveryPromise'
16
+ import { getGlobalSettings } from 'src/utils/globalSettings'
11
17
 
12
18
  interface NavbarLinksProps extends UINavbarLinksProps {
13
19
  links: NavbarProps['links']
@@ -26,18 +32,31 @@ function NavbarLinks({
26
32
  }: NavbarLinksProps) {
27
33
  const { NavbarLinks: NavbarLinksWrapper, NavbarLinksList } =
28
34
  useOverrideComponents<'Navbar'>()
35
+ const router = useRouter()
36
+ const { postalCode } = useSession()
37
+ const {
38
+ deliveryPromise: { filterByPickupPoint } = {},
39
+ } = getGlobalSettings()
40
+ const { isEnabled: isDeliveryPromiseEnabled } = useDeliveryPromise()
41
+
42
+ const shouldDisplayGlobalFilter =
43
+ isDeliveryPromiseEnabled && !!postalCode && filterByPickupPoint?.enabled
44
+
29
45
  return (
30
46
  <NavbarLinksWrapper.Component {...otherProps} {...NavbarLinksWrapper.props}>
31
47
  <div data-fs-navbar-links-wrapper data-fs-content="navbar">
32
48
  {shouldDisplayRegion && (
33
49
  <RegionButton icon={regionIcon} label={regionLabel} />
34
50
  )}
51
+ {shouldDisplayGlobalFilter && (
52
+ <RegionFilterButton filterByPickupPoint={filterByPickupPoint} />
53
+ )}
35
54
  <NavbarLinksList.Component {...NavbarLinksList.props}>
36
55
  {links.map(({ url, text }) => (
37
56
  <UINavbarLinksListItem key={text}>
38
57
  <Link
39
58
  variant="display"
40
- href={url}
59
+ href={router.asPath.includes(url) ? '#' : url}
41
60
  prefetch={false}
42
61
  onClick={onClickLink}
43
62
  >
@@ -1,18 +1,23 @@
1
- import type { RegionBarProps as UIRegionBarProps } from '@faststore/ui'
1
+ import {
2
+ regionSliderTypes,
3
+ type RegionBarProps as UIRegionBarProps,
4
+ } from '@faststore/ui'
2
5
  import { useEffect, useRef } from 'react'
3
6
 
4
7
  import { useUI } from '@faststore/ui'
5
8
  import { useSession } from 'src/sdk/session'
9
+ import { useDeliveryPromise } from 'src/sdk/deliveryPromise'
6
10
 
7
11
  import { deliveryPromise, session as initialSession } from 'discovery.config'
8
12
  import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
9
13
  import { textToTitleCase } from 'src/utils/utilities'
14
+ import { getGlobalSettings } from 'src/utils/globalSettings'
10
15
 
11
16
  import { useRegionModal } from '../RegionModal/useRegionModal'
12
17
 
13
18
  export interface RegionBarProps {
14
19
  /**
15
- * A React component that will be rendered as an icon.
20
+ * A React component that will be rendered as the location icon.
16
21
  */
17
22
  icon?: {
18
23
  icon: string
@@ -24,6 +29,7 @@ export interface RegionBarProps {
24
29
  label: UIRegionBarProps['label']
25
30
  /**
26
31
  * Specifies a label for the edit text.
32
+ * @deprecated
27
33
  */
28
34
  editLabel?: UIRegionBarProps['editLabel']
29
35
  /**
@@ -37,24 +43,31 @@ export interface RegionBarProps {
37
43
 
38
44
  function RegionBar({
39
45
  icon: { icon: locationIcon, alt: locationIconAlt },
40
- buttonIcon: { icon: buttonIcon, alt: buttonIconAlt },
41
- label,
42
- editLabel,
46
+ buttonIcon = undefined,
47
+ label: locationLabel,
48
+ editLabel = undefined,
43
49
  ...otherProps
44
50
  }: RegionBarProps) {
45
51
  const {
46
52
  RegionBar: RegionBarWrapper,
47
53
  LocationIcon,
48
54
  ButtonIcon,
55
+ FilterButtonIcon,
49
56
  } = useOverrideComponents<'RegionBar'>()
50
57
 
51
- const { openModal, openPopover } = useUI()
58
+ const { openModal, openPopover, openRegionSlider } = useUI()
52
59
  const { city, postalCode } = useSession()
53
60
  const { isValidationComplete } = useRegionModal()
61
+ const { globalPickupPoint } = useDeliveryPromise()
62
+ const {
63
+ deliveryPromise: { filterByPickupPoint } = {},
64
+ } = getGlobalSettings()
54
65
  const regionBarRef = useRef<HTMLDivElement>(null)
55
66
 
56
67
  const defaultPostalCode =
57
68
  !!initialSession?.postalCode && postalCode === initialSession.postalCode
69
+ const shouldDisplayGlobalFilter =
70
+ deliveryPromise.enabled && !!postalCode && filterByPickupPoint?.enabled
58
71
 
59
72
  // If location is not mandatory, and default zipCode is provided or if the user has not set a zipCode, show the popover.
60
73
  const displayRegionPopover =
@@ -87,14 +100,37 @@ function RegionBar({
87
100
  />
88
101
  }
89
102
  buttonIcon={
90
- <ButtonIcon.Component
91
- {...ButtonIcon.props}
92
- name={buttonIcon ?? ButtonIcon.props.name}
93
- aria-label={buttonIconAlt ?? ButtonIcon.props['aria-label']}
94
- />
103
+ buttonIcon?.icon ? (
104
+ <ButtonIcon.Component
105
+ {...ButtonIcon.props}
106
+ name={buttonIcon?.icon ?? ButtonIcon.props.name}
107
+ aria-label={buttonIcon?.alt ?? ButtonIcon.props['aria-label']}
108
+ />
109
+ ) : undefined
95
110
  }
111
+ filterButton={{
112
+ label: filterByPickupPoint?.label,
113
+ icon: (
114
+ <FilterButtonIcon.Component
115
+ {...FilterButtonIcon.props}
116
+ name={
117
+ filterByPickupPoint?.icon?.icon ?? FilterButtonIcon.props.name
118
+ }
119
+ aria-label={
120
+ filterByPickupPoint?.icon?.alt ??
121
+ FilterButtonIcon.props['aria-label']
122
+ }
123
+ />
124
+ ),
125
+ selectedFilter:
126
+ (globalPickupPoint?.name || globalPickupPoint?.address?.street) ??
127
+ undefined,
128
+ shouldDisplayFilterButton: shouldDisplayGlobalFilter,
129
+ onClick: () =>
130
+ openRegionSlider(regionSliderTypes.globalChangePickupPoint),
131
+ }}
96
132
  {...RegionBarWrapper.props}
97
- label={label ?? RegionBarWrapper.props.label}
133
+ label={locationLabel ?? RegionBarWrapper.props.label}
98
134
  editLabel={editLabel ?? RegionBarWrapper.props.editLabel}
99
135
  // Dynamic props shouldn't be overridable
100
136
  // This decision can be reviewed later if needed
@@ -0,0 +1,57 @@
1
+ import { useRef } from 'react'
2
+
3
+ import {
4
+ Button as UIButton,
5
+ Icon as UIIcon,
6
+ useUI,
7
+ regionSliderTypes,
8
+ } from '@faststore/ui'
9
+
10
+ import { useDeliveryPromise } from 'src/sdk/deliveryPromise'
11
+
12
+ type RegionFilterButtonProps = {
13
+ filterByPickupPoint?: {
14
+ enabled?: boolean
15
+ label?: string
16
+ icon?: {
17
+ icon?: string
18
+ alt?: string
19
+ }
20
+ }
21
+ }
22
+
23
+ function RegionFilterButton({
24
+ filterByPickupPoint: {
25
+ label: filterByPickupPointLabel,
26
+ icon: { icon: filterByPickupPointIcon, alt: filterByPickupPointAlt } = {},
27
+ } = {},
28
+ }: RegionFilterButtonProps) {
29
+ const { openRegionSlider } = useUI()
30
+ const { globalPickupPoint } = useDeliveryPromise()
31
+ const regionFilterButtonRef = useRef<HTMLButtonElement>(null)
32
+
33
+ return (
34
+ <UIButton
35
+ variant="tertiary"
36
+ size="small"
37
+ icon={
38
+ <UIIcon
39
+ name={filterByPickupPointIcon}
40
+ width={18}
41
+ height={18}
42
+ weight="bold"
43
+ aria-label={filterByPickupPointAlt}
44
+ />
45
+ }
46
+ iconPosition="left"
47
+ onClick={() =>
48
+ openRegionSlider(regionSliderTypes.globalChangePickupPoint)
49
+ }
50
+ ref={regionFilterButtonRef}
51
+ >
52
+ {globalPickupPoint?.name ?? filterByPickupPointLabel}
53
+ </UIButton>
54
+ )
55
+ }
56
+
57
+ export default RegionFilterButton
@@ -0,0 +1 @@
1
+ export { default } from './RegionFilterButton'
@@ -5,10 +5,12 @@ import type { RegionModalProps as UIRegionModalProps } from '@faststore/ui'
5
5
  import { Icon, useUI } from '@faststore/ui'
6
6
 
7
7
  import { deliveryPromise } from 'discovery.config'
8
+ import { useDeliveryPromise } from 'src/sdk/deliveryPromise'
8
9
  import { useSession } from 'src/sdk/session'
9
10
 
10
11
  import useRegion from './useRegion'
11
12
 
13
+ import { getGlobalSettings } from 'src/utils/globalSettings'
12
14
  import styles from './section.module.scss'
13
15
 
14
16
  const UIRegionModal = dynamic<UIRegionModalProps>(
@@ -38,22 +40,29 @@ interface RegionModalProps {
38
40
  }
39
41
  }
40
42
 
41
- function RegionModal({
42
- title,
43
- description,
44
- closeButtonAriaLabel,
45
- inputField: {
46
- label: inputFieldLabel,
47
- errorMessage: inputFieldErrorMessage,
48
- noProductsAvailableErrorMessage: inputFieldNoProductsAvailableErrorMessage,
49
- buttonActionText: inputButtonActionText,
50
- },
51
- idkPostalCodeLink: {
52
- text: idkPostalCodeLinkText,
53
- to: idkPostalCodeLinkTo,
54
- icon: { icon: idkPostalCodeLinkIcon, alt: idkPostalCodeLinkIconAlt },
55
- },
56
- }: RegionModalProps) {
43
+ function RegionModal(regionModalProps: RegionModalProps) {
44
+ const { onPostalCodeChange } = useDeliveryPromise()
45
+ const { title, description, closeButtonAriaLabel, ...otherRegionModalProps } =
46
+ regionModalProps
47
+ const cmsData = getGlobalSettings(otherRegionModalProps)
48
+ const {
49
+ inputField: {
50
+ label: inputFieldLabel = '',
51
+ errorMessage: inputFieldErrorMessage = '',
52
+ noProductsAvailableErrorMessage:
53
+ inputFieldNoProductsAvailableErrorMessage = '',
54
+ buttonActionText: inputButtonActionText = '',
55
+ } = {},
56
+ idkPostalCodeLink: {
57
+ text: idkPostalCodeLinkText = '',
58
+ to: idkPostalCodeLinkTo = '',
59
+ icon: {
60
+ icon: idkPostalCodeLinkIcon = '',
61
+ alt: idkPostalCodeLinkIconAlt = '',
62
+ } = {},
63
+ } = {},
64
+ } = cmsData?.regionalization ?? {}
65
+
57
66
  const inputRef = useRef<HTMLInputElement>(null)
58
67
  const { isValidating, ...session } = useSession()
59
68
  const { modal: displayModal, closeModal } = useUI()
@@ -70,6 +79,7 @@ function RegionModal({
70
79
  await setRegion({
71
80
  session,
72
81
  onSuccess: () => {
82
+ onPostalCodeChange()
73
83
  setInput('')
74
84
  closeModal()
75
85
  },