@faststore/core 3.67.0 → 3.68.1

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 (247) 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 +86 -71
  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.nft.json +1 -1
  68. package/.next/server/pages/checkout.js +1 -1
  69. package/.next/server/pages/checkout.js.nft.json +1 -1
  70. package/.next/server/pages/en-US/404.html +1 -1
  71. package/.next/server/pages/en-US/500.html +1 -1
  72. package/.next/server/pages/en-US/checkout.html +1 -1
  73. package/.next/server/pages/en-US/login.html +1 -1
  74. package/.next/server/pages/en-US/s.html +1 -1
  75. package/.next/server/pages/en-US.html +1 -1
  76. package/.next/server/pages/index.js +1 -1
  77. package/.next/server/pages/index.js.nft.json +1 -1
  78. package/.next/server/pages/login.js +1 -1
  79. package/.next/server/pages/login.js.nft.json +1 -1
  80. package/.next/server/pages/s.js +1 -1
  81. package/.next/server/pages/s.js.nft.json +1 -1
  82. package/.next/server/pages-manifest.json +1 -1
  83. package/.next/static/chunks/2284.6dd050e60172189a.js +1 -0
  84. package/.next/static/chunks/3155.243c7558a71f0695.js +1 -0
  85. package/.next/static/chunks/3166-6af5e854c2f2913a.js +1 -0
  86. package/.next/static/chunks/3399.93804fb74f79436c.js +1 -0
  87. package/.next/static/chunks/353.7f2181843462717d.js +1 -0
  88. package/.next/static/chunks/4803.412bf2a7e15626a6.js +1 -0
  89. package/.next/static/chunks/5781.28d03feacead66ad.js +1 -0
  90. package/.next/static/chunks/6355.57d1a07f50ee6cc9.js +1 -0
  91. package/.next/static/chunks/{6393.361c44eb0818eb7e.js → 6393.53e9ea4f29d1bf23.js} +1 -1
  92. package/.next/static/chunks/6700.f046aa86e2c83b53.js +1 -0
  93. package/.next/static/chunks/6857.b2c06171638955ea.js +1 -0
  94. package/.next/static/chunks/7191-9bdd5f0c18fbd942.js +1 -0
  95. package/.next/static/chunks/{6410.bd3fa399df59cc80.js → 7351.e90a4cc21797c136.js} +1 -1
  96. package/.next/static/chunks/7481.3c4ad3642e346232.js +1 -0
  97. package/.next/static/chunks/7498-0dc4f9a9ed199d3a.js +1 -0
  98. package/.next/static/chunks/83.ee1fdbe283ac65b6.js +1 -0
  99. package/.next/static/chunks/9173-9fc2b806c0ac0b8d.js +1 -0
  100. package/.next/static/chunks/BannerNewsletter.a9ea51c53885c80f.js +1 -0
  101. package/.next/static/chunks/{BannerText.695d4d4b6a3f7309.js → BannerText.21f106b180339df1.js} +1 -1
  102. package/.next/static/chunks/CartSidebar.55cc31a37ffa6ee6.js +1 -0
  103. package/.next/static/chunks/{Footer.5ed205d931401110.js → Footer.09dddd47ce6c816f.js} +1 -1
  104. package/.next/static/chunks/Newsletter.2c79d1813e9f9c95.js +1 -0
  105. package/.next/static/chunks/ProductShelf.299d0989eea49a79.js +1 -0
  106. package/.next/static/chunks/ProductTiles.ab99b919f3c0215f.js +1 -0
  107. package/.next/static/chunks/RegionModal.503f063f2e19b936.js +1 -0
  108. package/.next/static/chunks/RegionSlider.00de4571775d04cc.js +1 -0
  109. package/.next/static/chunks/Toast.75a18f47eb23b703.js +1 -0
  110. package/.next/static/chunks/UIBannerText.f4167ceafb96cf67.js +1 -0
  111. package/.next/static/chunks/UISKUMatrixSidebar.8b6fac58c48f999c.js +1 -0
  112. package/.next/static/chunks/UIToast.a49584c87d3adc17.js +1 -0
  113. package/.next/static/chunks/pages/{404-3582ed9196afdf1e.js → 404-dca50618ea3e6fb6.js} +1 -1
  114. package/.next/static/chunks/pages/{500-1b4eca062588da7f.js → 500-ae6697c7631fb07a.js} +1 -1
  115. package/.next/static/chunks/pages/[...slug]-debd8b208a0e3d02.js +1 -0
  116. package/.next/static/chunks/pages/[slug]/p-d782ecb21200f200.js +1 -0
  117. package/.next/static/chunks/pages/_app-728289774860e9d9.js +1 -0
  118. package/.next/static/chunks/pages/account/{403-c791997011f970b6.js → 403-a3d8b31b4e9ee8a6.js} +1 -1
  119. package/.next/static/chunks/pages/account/{404-74e64bb12e8f5a68.js → 404-22b789f04fcdce39.js} +1 -1
  120. package/.next/static/chunks/pages/account/orders/[id]-a2f44ba3963b81cd.js +1 -0
  121. package/.next/static/chunks/pages/account/orders-ec040e06c4b516d0.js +1 -0
  122. package/.next/static/chunks/pages/account/profile-29f93f4c5a55bd87.js +1 -0
  123. package/.next/static/chunks/pages/account/security-94874fc477520f74.js +1 -0
  124. package/.next/static/chunks/pages/account/{user-details-6f9fe72e02f5c5df.js → user-details-143cb45d5080d1d9.js} +1 -1
  125. package/.next/static/chunks/pages/checkout-b0637ee59b1cdca8.js +1 -0
  126. package/.next/static/chunks/pages/index-b45c9535696b5ab1.js +1 -0
  127. package/.next/static/chunks/pages/login-bae3a4cdaaed110c.js +1 -0
  128. package/.next/static/chunks/pages/s-011eedb19dcdccc6.js +1 -0
  129. package/.next/static/chunks/webpack-8b6c086380cf1398.js +1 -0
  130. package/.next/static/css/{e4b714970415f2eb.css → 2a4b7072e47636f1.css} +1 -1
  131. package/.next/static/css/{8a3f440e0ff9cd8e.css → 3d41485722b4e3f5.css} +1 -1
  132. package/.next/static/css/{2841bab51b99dd53.css → 92960607d6088082.css} +1 -1
  133. package/.next/static/css/d26cb0a54378b3d9.css +1 -0
  134. package/.next/static/css/f93cf36b16950027.css +1 -0
  135. package/.next/static/xNn8gOkRDimAnfL8TiLx0/_buildManifest.js +1 -0
  136. package/.next/trace +135 -132
  137. package/.turbo/turbo-build.log +36 -33
  138. package/.turbo/turbo-test.log +5 -5
  139. package/@generated/gql.ts +8 -0
  140. package/@generated/graphql.ts +83 -0
  141. package/@generated/persisted-documents.json +1 -0
  142. package/@generated/schema.graphql +51 -0
  143. package/CHANGELOG.md +12 -0
  144. package/cms/faststore/content-types.json +238 -1
  145. package/cms/faststore/sections.json +34 -33
  146. package/cypress/integration/plp.test.js +2 -2
  147. package/index.ts +9 -0
  148. package/package.json +5 -5
  149. package/src/components/account/MyAccountDrawer/OrganizationDrawer/OrganizationDrawer.tsx +3 -3
  150. package/src/components/cms/GlobalSections.tsx +1 -0
  151. package/src/components/cms/RenderSections.tsx +8 -4
  152. package/src/components/cms/global/Components.ts +8 -0
  153. package/src/components/navigation/Navbar/Navbar.tsx +5 -6
  154. package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +23 -4
  155. package/src/components/region/RegionBar/RegionBar.tsx +48 -12
  156. package/src/components/region/RegionFilterButton/RegionFilterButton.tsx +57 -0
  157. package/src/components/region/RegionFilterButton/index.ts +1 -0
  158. package/src/components/region/RegionModal/RegionModal.tsx +26 -16
  159. package/src/components/region/RegionModal/useRegion.ts +12 -11
  160. package/src/components/region/RegionPopover/RegionPopover.tsx +37 -22
  161. package/src/components/region/RegionSlider/RegionSlider.tsx +407 -0
  162. package/src/components/region/RegionSlider/index.ts +1 -0
  163. package/src/components/region/RegionSlider/section.module.scss +72 -0
  164. package/src/components/search/Filter/FilterDeliveryMethodFacet.tsx +68 -0
  165. package/src/components/search/Filter/FilterDesktop.tsx +148 -90
  166. package/src/components/search/Filter/FilterSlider.tsx +193 -104
  167. package/src/components/search/Filter/section.module.scss +2 -0
  168. package/src/components/sections/ProductGallery/section.module.scss +2 -0
  169. package/src/components/sections/RegionBar/DefaultComponents.ts +1 -0
  170. package/src/components/sections/RegionBar/RegionBar.tsx +2 -1
  171. package/src/components/templates/LandingPage/LandingPage.tsx +6 -3
  172. package/src/components/templates/ProductListingPage/ProductListing.tsx +4 -1
  173. package/src/components/templates/ProductListingPage/ProductListingPage.tsx +3 -0
  174. package/src/components/templates/SearchPage/SearchPage.tsx +3 -0
  175. package/src/components/templates/SearchPage/SearchWrapper.tsx +15 -7
  176. package/src/components/ui/PickupPoints/PickupPointCard.tsx +39 -0
  177. package/src/components/ui/PickupPoints/PickupPointCards.tsx +102 -0
  178. package/src/components/ui/PickupPoints/index.ts +5 -0
  179. package/src/components/ui/ProductGallery/ProductGallery.tsx +6 -9
  180. package/src/experimental/index.ts +6 -0
  181. package/src/pages/404.tsx +15 -6
  182. package/src/pages/500.tsx +15 -6
  183. package/src/pages/[...slug].tsx +14 -5
  184. package/src/pages/[slug]/p.tsx +6 -3
  185. package/src/pages/_app.tsx +15 -10
  186. package/src/pages/account/403.tsx +30 -27
  187. package/src/pages/account/404.tsx +27 -20
  188. package/src/pages/account/orders/[id].tsx +22 -19
  189. package/src/pages/account/orders/index.tsx +25 -22
  190. package/src/pages/account/profile.tsx +27 -23
  191. package/src/pages/account/security.tsx +28 -23
  192. package/src/pages/account/user-details.tsx +20 -17
  193. package/src/pages/checkout.tsx +11 -8
  194. package/src/pages/index.tsx +7 -4
  195. package/src/pages/login.tsx +16 -7
  196. package/src/pages/s.tsx +5 -2
  197. package/src/sdk/deliveryPromise/index.ts +22 -0
  198. package/src/sdk/deliveryPromise/provider.tsx +119 -0
  199. package/src/sdk/deliveryPromise/queries.ts +80 -0
  200. package/src/sdk/deliveryPromise/reducer.ts +137 -0
  201. package/src/sdk/deliveryPromise/useDeliveryPromise.ts +419 -0
  202. package/src/sdk/overrides/PageProvider.tsx +9 -4
  203. package/src/sdk/product/useLocalizedVariables.ts +20 -6
  204. package/src/sdk/search/useFilter.ts +12 -1
  205. package/src/typings/overrides.ts +2 -1
  206. package/src/utils/globalSettings.ts +74 -0
  207. package/test/server/index.test.ts +1 -0
  208. package/.next/server/chunks/6272.js +0 -1
  209. package/.next/static/auvpWeN2p6A4M2zTGhXzk/_buildManifest.js +0 -1
  210. package/.next/static/chunks/2284.1b43aea18c23c79e.js +0 -1
  211. package/.next/static/chunks/3155.ea52e06317dab557.js +0 -1
  212. package/.next/static/chunks/3166-50d81179a0f5a894.js +0 -1
  213. package/.next/static/chunks/3399.13a97fefb512c902.js +0 -1
  214. package/.next/static/chunks/3465.af28497e8069330f.js +0 -1
  215. package/.next/static/chunks/353.52612dbf516cbaee.js +0 -1
  216. package/.next/static/chunks/4803.de5b14237d616808.js +0 -1
  217. package/.next/static/chunks/6355.c0b326c539dbaa90.js +0 -1
  218. package/.next/static/chunks/6700.4e9426fe8b826dab.js +0 -1
  219. package/.next/static/chunks/7191-2a7b8ddbd07128b6.js +0 -1
  220. package/.next/static/chunks/7498-5246b607527180dd.js +0 -1
  221. package/.next/static/chunks/83.b87d797323ff2034.js +0 -1
  222. package/.next/static/chunks/9173-ae6b6ebdc42876f1.js +0 -1
  223. package/.next/static/chunks/9540.69781e999f27cc05.js +0 -1
  224. package/.next/static/chunks/BannerNewsletter.7c592f132e7048e5.js +0 -1
  225. package/.next/static/chunks/CartSidebar.a00083c44c87c268.js +0 -1
  226. package/.next/static/chunks/Newsletter.1004055f09f76d3c.js +0 -1
  227. package/.next/static/chunks/ProductShelf.d51ba3e6a1b4a57d.js +0 -1
  228. package/.next/static/chunks/ProductTiles.77284431e2b8c898.js +0 -1
  229. package/.next/static/chunks/RegionModal.f61aa62e0a09182a.js +0 -1
  230. package/.next/static/chunks/Toast.6116bc845cd67f49.js +0 -1
  231. package/.next/static/chunks/UIBannerText.6cc5c00d4ba9b64e.js +0 -1
  232. package/.next/static/chunks/UISKUMatrixSidebar.782c55a97889e84a.js +0 -1
  233. package/.next/static/chunks/UIToast.494d0b0ce2c6106a.js +0 -1
  234. package/.next/static/chunks/pages/[...slug]-d0f23d907ec6fbe3.js +0 -1
  235. package/.next/static/chunks/pages/[slug]/p-a255e4a7352455df.js +0 -1
  236. package/.next/static/chunks/pages/_app-1885a948b243078c.js +0 -1
  237. package/.next/static/chunks/pages/account/orders/[id]-b9feb0c860ff1cec.js +0 -1
  238. package/.next/static/chunks/pages/account/orders-1d8409a8b4b0e581.js +0 -1
  239. package/.next/static/chunks/pages/account/profile-5a919fa02b76a422.js +0 -1
  240. package/.next/static/chunks/pages/account/security-b5ab3d1ecbbea9d9.js +0 -1
  241. package/.next/static/chunks/pages/checkout-3a4983b22625c4e3.js +0 -1
  242. package/.next/static/chunks/pages/index-6e68be53d1fef20e.js +0 -1
  243. package/.next/static/chunks/pages/login-de3dd10c6b35159a.js +0 -1
  244. package/.next/static/chunks/pages/s-9b0f606f120d66b0.js +0 -1
  245. package/.next/static/chunks/webpack-f661e0efeacf6028.js +0 -1
  246. package/.next/static/css/202a74b80e6ce63f.css +0 -1
  247. /package/.next/static/{auvpWeN2p6A4M2zTGhXzk → xNn8gOkRDimAnfL8TiLx0}/_ssgManifest.js +0 -0
@@ -8,22 +8,23 @@ import {
8
8
  } from 'src/components/cms/GlobalSections'
9
9
 
10
10
  import { LinkButton } from '@faststore/ui'
11
+ import { gql } from '@generated/gql'
12
+ import type {
13
+ ServerAccountPageQueryQuery,
14
+ ServerAccountPageQueryQueryVariables,
15
+ } from '@generated/graphql'
11
16
  import { MyAccountLayout } from 'src/components/account'
12
17
  import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
13
18
  import RenderSections from 'src/components/cms/RenderSections'
14
19
  import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
15
20
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
16
21
  import PLUGINS_COMPONENTS from 'src/plugins'
22
+ import { validateUser } from 'src/sdk/account/validateUser'
23
+ import PageProvider from 'src/sdk/overrides/PageProvider'
24
+ import { execute } from 'src/server'
17
25
  import { type PageContentType, getPage } from 'src/server/cms'
18
26
  import { injectGlobalSections } from 'src/server/cms/global'
19
27
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
20
- import { gql } from '@generated/gql'
21
- import { execute } from 'src/server'
22
- import type {
23
- ServerAccountPageQueryQuery,
24
- ServerAccountPageQueryQueryVariables,
25
- } from '@generated/graphql'
26
- import { validateUser } from 'src/sdk/account/validateUser'
27
28
 
28
29
  /* A list of components that can be used in the CMS. */
29
30
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -37,27 +38,29 @@ type Props = {
37
38
  accountName: ServerAccountPageQueryQuery['accountName']
38
39
  }
39
40
 
40
- function Page({ globalSections, accountName }: Props) {
41
+ function Page({ globalSections: globalSectionsProp, accountName }: Props) {
42
+ const { sections: globalSections, settings: globalSettings } =
43
+ globalSectionsProp ?? {}
44
+
41
45
  return (
42
- <RenderSections
43
- globalSections={globalSections.sections}
44
- components={COMPONENTS}
45
- >
46
- <NextSeo noindex nofollow />
47
-
48
- <MyAccountLayout accountName={accountName}>
49
- <EmptyState
50
- title="Unauthorized Access"
51
- titleIcon={{ icon: 'ShoppingCart', alt: 'Shopping Cart' }}
52
- subtitle="You don't have permission to access this page."
53
- showLoader={false}
54
- >
55
- <LinkButton variant="secondary" href="/account">
56
- Back to Account
57
- </LinkButton>
58
- </EmptyState>
59
- </MyAccountLayout>
60
- </RenderSections>
46
+ <PageProvider context={{ globalSettings }}>
47
+ <RenderSections globalSections={globalSections} components={COMPONENTS}>
48
+ <NextSeo noindex nofollow />
49
+
50
+ <MyAccountLayout accountName={accountName}>
51
+ <EmptyState
52
+ title="Unauthorized Access"
53
+ titleIcon={{ icon: 'ShoppingCart', alt: 'Shopping Cart' }}
54
+ subtitle="You don't have permission to access this page."
55
+ showLoader={false}
56
+ >
57
+ <LinkButton variant="secondary" href="/account">
58
+ Back to Account
59
+ </LinkButton>
60
+ </EmptyState>
61
+ </MyAccountLayout>
62
+ </RenderSections>
63
+ </PageProvider>
61
64
  )
62
65
  }
63
66
 
@@ -7,6 +7,11 @@ import {
7
7
  getGlobalSectionsData,
8
8
  } from 'src/components/cms/GlobalSections'
9
9
 
10
+ import { gql } from '@generated/gql'
11
+ import type {
12
+ ServerAccountPageQueryQuery,
13
+ ServerAccountPageQueryQueryVariables,
14
+ } from '@generated/graphql'
10
15
  import { MyAccountLayout } from 'src/components/account'
11
16
  import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
12
17
  import RenderSections, {
@@ -15,16 +20,12 @@ import RenderSections, {
15
20
  import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
16
21
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
17
22
  import PLUGINS_COMPONENTS from 'src/plugins'
23
+ import { validateUser } from 'src/sdk/account/validateUser'
24
+ import PageProvider from 'src/sdk/overrides/PageProvider'
25
+ import { execute } from 'src/server'
18
26
  import { type PageContentType, getPage } from 'src/server/cms'
19
27
  import { injectGlobalSections } from 'src/server/cms/global'
20
28
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
21
- import { gql } from '@generated/gql'
22
- import { execute } from 'src/server'
23
- import type {
24
- ServerAccountPageQueryQuery,
25
- ServerAccountPageQueryQueryVariables,
26
- } from '@generated/graphql'
27
- import { validateUser } from 'src/sdk/account/validateUser'
28
29
 
29
30
  /* A list of components that can be used in the CMS. */
30
31
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -40,20 +41,26 @@ type Props = {
40
41
  accountName: ServerAccountPageQueryQuery['accountName']
41
42
  }
42
43
 
43
- function Page({ page: { sections }, globalSections, accountName }: Props) {
44
+ function Page({
45
+ page: { sections },
46
+ globalSections: globalSectionsProp,
47
+ accountName,
48
+ }: Props) {
49
+ const { sections: globalSections, settings: globalSettings } =
50
+ globalSectionsProp ?? {}
51
+
44
52
  return (
45
- <RenderSections
46
- globalSections={globalSections.sections}
47
- components={COMPONENTS}
48
- >
49
- <NextSeo noindex nofollow />
50
-
51
- <MyAccountLayout accountName={accountName}>
52
- {sections && sections.length > 0 && (
53
- <RenderSectionsBase sections={sections} components={COMPONENTS} />
54
- )}
55
- </MyAccountLayout>
56
- </RenderSections>
53
+ <PageProvider context={{ globalSettings }}>
54
+ <RenderSections globalSections={globalSections} components={COMPONENTS}>
55
+ <NextSeo noindex nofollow />
56
+
57
+ <MyAccountLayout accountName={accountName}>
58
+ {sections && sections.length > 0 && (
59
+ <RenderSectionsBase sections={sections} components={COMPONENTS} />
60
+ )}
61
+ </MyAccountLayout>
62
+ </RenderSections>
63
+ </PageProvider>
57
64
  )
58
65
  }
59
66
 
@@ -11,19 +11,20 @@ import type { MyAccountProps } from 'src/experimental/myAccountSeverSideProps'
11
11
  import { validateUser } from 'src/sdk/account/validateUser'
12
12
 
13
13
  import { gql } from '@generated'
14
+ import type {
15
+ ServerOrderDetailsQueryQuery,
16
+ ServerOrderDetailsQueryQueryVariables,
17
+ } from '@generated/graphql'
14
18
  import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
15
19
  import { default as AfterSection } from 'src/customizations/src/myAccount/extensions/orders/[id]/after'
16
20
  import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/orders/[id]/before'
17
21
  import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
22
+ import PageProvider from 'src/sdk/overrides/PageProvider'
18
23
  import { execute } from 'src/server'
19
24
  import { injectGlobalSections } from 'src/server/cms/global'
20
25
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
21
26
  import { extractStatusFromError } from 'src/utils/utilities'
22
27
  import storeConfig from '../../../../discovery.config'
23
- import type {
24
- ServerOrderDetailsQueryQuery,
25
- ServerOrderDetailsQueryQueryVariables,
26
- } from '@generated/graphql'
27
28
 
28
29
  const COMPONENTS: Record<string, ComponentType<any>> = {
29
30
  ...GLOBAL_COMPONENTS,
@@ -35,27 +36,29 @@ type OrderDetailsPageProps = {
35
36
  } & MyAccountProps
36
37
 
37
38
  export default function OrderDetailsPage({
38
- globalSections,
39
+ globalSections: globalSectionsProp,
39
40
  order,
40
41
  accountName,
41
42
  isRepresentative,
42
43
  }: OrderDetailsPageProps) {
44
+ const { sections: globalSections, settings: globalSettings } =
45
+ globalSectionsProp ?? {}
46
+
43
47
  return (
44
- <RenderSections
45
- globalSections={globalSections.sections}
46
- components={COMPONENTS}
47
- >
48
- <NextSeo noindex nofollow />
48
+ <PageProvider context={{ globalSettings }}>
49
+ <RenderSections globalSections={globalSections} components={COMPONENTS}>
50
+ <NextSeo noindex nofollow />
49
51
 
50
- <MyAccountLayout
51
- isRepresentative={isRepresentative}
52
- accountName={accountName}
53
- >
54
- <BeforeSection />
55
- <MyAccountOrderDetails order={order} />
56
- <AfterSection />
57
- </MyAccountLayout>
58
- </RenderSections>
52
+ <MyAccountLayout
53
+ isRepresentative={isRepresentative}
54
+ accountName={accountName}
55
+ >
56
+ <BeforeSection />
57
+ <MyAccountOrderDetails order={order} />
58
+ <AfterSection />
59
+ </MyAccountLayout>
60
+ </RenderSections>
61
+ </PageProvider>
59
62
  )
60
63
  }
61
64
 
@@ -24,9 +24,10 @@ import { groupOrderStatusByLabel } from 'src/utils/userOrderStatus'
24
24
 
25
25
  import { MyAccountListOrders } from 'src/components/account/orders/MyAccountListOrders'
26
26
  import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
27
- import storeConfig from '../../../../discovery.config'
28
27
  import { validateUser } from 'src/sdk/account/validateUser'
28
+ import PageProvider from 'src/sdk/overrides/PageProvider'
29
29
  import { extractStatusFromError } from 'src/utils/utilities'
30
+ import storeConfig from '../../../../discovery.config'
30
31
 
31
32
  /* A list of components that can be used in the CMS. */
32
33
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -49,7 +50,7 @@ type ListOrdersPageProps = {
49
50
  } & MyAccountProps
50
51
 
51
52
  export default function ListOrdersPage({
52
- globalSections,
53
+ globalSections: globalSectionsProp,
53
54
  accountName,
54
55
  listOrders,
55
56
  total,
@@ -57,27 +58,29 @@ export default function ListOrdersPage({
57
58
  filters,
58
59
  isRepresentative,
59
60
  }: ListOrdersPageProps) {
61
+ const { sections: globalSections, settings: globalSettings } =
62
+ globalSectionsProp ?? {}
63
+
60
64
  return (
61
- <RenderSections
62
- globalSections={globalSections.sections}
63
- components={COMPONENTS}
64
- >
65
- <NextSeo noindex nofollow />
66
-
67
- <MyAccountLayout
68
- isRepresentative={isRepresentative}
69
- accountName={accountName}
70
- >
71
- <BeforeSection />
72
- <MyAccountListOrders
73
- listOrders={listOrders}
74
- filters={filters}
75
- perPage={perPage}
76
- total={total}
77
- />
78
- <AfterSection />
79
- </MyAccountLayout>
80
- </RenderSections>
65
+ <PageProvider context={{ globalSettings }}>
66
+ <RenderSections globalSections={globalSections} components={COMPONENTS}>
67
+ <NextSeo noindex nofollow />
68
+
69
+ <MyAccountLayout
70
+ isRepresentative={isRepresentative}
71
+ accountName={accountName}
72
+ >
73
+ <BeforeSection />
74
+ <MyAccountListOrders
75
+ listOrders={listOrders}
76
+ filters={filters}
77
+ perPage={perPage}
78
+ total={total}
79
+ />
80
+ <AfterSection />
81
+ </MyAccountLayout>
82
+ </RenderSections>
83
+ </PageProvider>
81
84
  )
82
85
  }
83
86
 
@@ -6,26 +6,28 @@ import type { GetServerSideProps } from 'next'
6
6
  import { NextSeo } from 'next-seo'
7
7
  import type { ComponentType } from 'react'
8
8
  import { MyAccountLayout } from 'src/components/account'
9
+ import { ProfileSection } from 'src/components/account/profile'
9
10
  import RenderSections from 'src/components/cms/RenderSections'
10
11
  import { default as GLOBAL_COMPONENTS } from 'src/components/cms/global/Components'
11
12
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
12
- import { ProfileSection } from 'src/components/account/profile'
13
13
 
14
14
  import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
15
15
 
16
+ import { gql } from '@generated/gql'
17
+ import type {
18
+ ServerProfileQueryQuery,
19
+ ServerProfileQueryQueryVariables,
20
+ } from '@generated/graphql'
16
21
  import { default as AfterSection } from 'src/customizations/src/myAccount/extensions/profile/after'
17
22
  import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/profile/before'
18
23
  import type { MyAccountProps } from 'src/experimental/myAccountSeverSideProps'
19
24
  import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
25
+ import { validateUser } from 'src/sdk/account/validateUser'
20
26
  import { injectGlobalSections } from 'src/server/cms/global'
21
27
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
22
- import { gql } from '@generated/gql'
28
+
29
+ import PageProvider from 'src/sdk/overrides/PageProvider'
23
30
  import { execute } from 'src/server'
24
- import type {
25
- ServerProfileQueryQuery,
26
- ServerProfileQueryQueryVariables,
27
- } from '@generated/graphql'
28
- import { validateUser } from 'src/sdk/account/validateUser'
29
31
  import storeConfig from '../../../discovery.config'
30
32
 
31
33
  /* A list of components that can be used in the CMS. */
@@ -43,27 +45,29 @@ type ProfilePagePros = {
43
45
  } & MyAccountProps
44
46
 
45
47
  export default function Profile({
46
- globalSections,
48
+ globalSections: globalSectionsProp,
47
49
  accountName,
48
50
  accountProfile,
49
51
  isRepresentative,
50
52
  }: ProfilePagePros) {
53
+ const { sections: globalSections, settings: globalSettings } =
54
+ globalSectionsProp ?? {}
55
+
51
56
  return (
52
- <RenderSections
53
- globalSections={globalSections.sections}
54
- components={COMPONENTS}
55
- >
56
- <NextSeo noindex nofollow />
57
-
58
- <MyAccountLayout
59
- isRepresentative={isRepresentative}
60
- accountName={accountName}
61
- >
62
- <BeforeSection />
63
- <ProfileSection profile={accountProfile} />
64
- <AfterSection />
65
- </MyAccountLayout>
66
- </RenderSections>
57
+ <PageProvider context={{ globalSettings }}>
58
+ <RenderSections globalSections={globalSections} components={COMPONENTS}>
59
+ <NextSeo noindex nofollow />
60
+
61
+ <MyAccountLayout
62
+ isRepresentative={isRepresentative}
63
+ accountName={accountName}
64
+ >
65
+ <BeforeSection />
66
+ <ProfileSection profile={accountProfile} />
67
+ <AfterSection />
68
+ </MyAccountLayout>
69
+ </RenderSections>
70
+ </PageProvider>
67
71
  )
68
72
  }
69
73
 
@@ -13,21 +13,24 @@ import type { GetServerSideProps } from 'next'
13
13
 
14
14
  import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
15
15
 
16
+ import { gql } from '@generated/gql'
17
+ import type {
18
+ ServerSecurityQueryQuery,
19
+ ServerSecurityQueryQueryVariables,
20
+ } from '@generated/graphql'
16
21
  import { default as AfterSection } from 'src/customizations/src/myAccount/extensions/security/after'
17
22
  import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/security/before'
18
23
  import type { MyAccountProps } from 'src/experimental/myAccountSeverSideProps'
19
24
  import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
25
+ import { execute } from 'src/server'
20
26
  import { injectGlobalSections } from 'src/server/cms/global'
21
27
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
22
- import { execute } from 'src/server'
23
- import { gql } from '@generated/gql'
24
- import type {
25
- ServerSecurityQueryQuery,
26
- ServerSecurityQueryQueryVariables,
27
- } from '@generated/graphql'
28
+
28
29
  import { validateUser } from 'src/sdk/account/validateUser'
29
- import storeConfig from '../../../discovery.config'
30
+ import PageProvider from 'src/sdk/overrides/PageProvider'
31
+
30
32
  import { SecuritySection } from 'src/components/account/security'
33
+ import storeConfig from '../../../discovery.config'
31
34
 
32
35
  /* A list of components that can be used in the CMS. */
33
36
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -40,26 +43,28 @@ type SecurityPageProps = {
40
43
  } & MyAccountProps
41
44
 
42
45
  export default function Page({
43
- globalSections,
46
+ globalSections: globalSectionsProp,
44
47
  accountName,
45
48
  isRepresentative,
46
49
  }: SecurityPageProps) {
50
+ const { sections: globalSections, settings: globalSettings } =
51
+ globalSectionsProp ?? {}
52
+
47
53
  return (
48
- <RenderSections
49
- globalSections={globalSections.sections}
50
- components={COMPONENTS}
51
- >
52
- <NextSeo noindex nofollow />
53
-
54
- <MyAccountLayout
55
- isRepresentative={isRepresentative}
56
- accountName={accountName}
57
- >
58
- <BeforeSection />
59
- <SecuritySection />
60
- <AfterSection />
61
- </MyAccountLayout>
62
- </RenderSections>
54
+ <PageProvider context={{ globalSettings }}>
55
+ <RenderSections globalSections={globalSections} components={COMPONENTS}>
56
+ <NextSeo noindex nofollow />
57
+
58
+ <MyAccountLayout
59
+ isRepresentative={isRepresentative}
60
+ accountName={accountName}
61
+ >
62
+ <BeforeSection />
63
+ <SecuritySection />
64
+ <AfterSection />
65
+ </MyAccountLayout>
66
+ </RenderSections>
67
+ </PageProvider>
63
68
  )
64
69
  }
65
70
 
@@ -20,11 +20,12 @@ import { default as AfterSection } from 'src/customizations/src/myAccount/extens
20
20
  import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/user-details/before'
21
21
  import type { MyAccountProps } from 'src/experimental/myAccountSeverSideProps'
22
22
  import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
23
+ import { validateUser } from 'src/sdk/account/validateUser'
24
+ import PageProvider from 'src/sdk/overrides/PageProvider'
23
25
  import { execute } from 'src/server'
24
26
  import { injectGlobalSections } from 'src/server/cms/global'
25
27
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
26
28
  import storeConfig from '../../../discovery.config'
27
- import { validateUser } from 'src/sdk/account/validateUser'
28
29
 
29
30
  /* A list of components that can be used in the CMS. */
30
31
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -42,27 +43,29 @@ type UserDetailsPagePros = {
42
43
  } & MyAccountProps
43
44
 
44
45
  export default function Page({
45
- globalSections,
46
+ globalSections: globalSectionsProp,
46
47
  accountName,
47
48
  isRepresentative,
48
49
  userDetails,
49
50
  }: UserDetailsPagePros) {
51
+ const { sections: globalSections, settings: globalSettings } =
52
+ globalSectionsProp ?? {}
53
+
50
54
  return (
51
- <RenderSections
52
- globalSections={globalSections.sections}
53
- components={COMPONENTS}
54
- >
55
- <NextSeo noindex nofollow />
56
-
57
- <MyAccountLayout
58
- isRepresentative={isRepresentative}
59
- accountName={accountName}
60
- >
61
- <BeforeSection />
62
- <MyAccountUserDetails userDetails={userDetails} />
63
- <AfterSection />
64
- </MyAccountLayout>
65
- </RenderSections>
55
+ <PageProvider context={{ globalSettings }}>
56
+ <RenderSections globalSections={globalSections} components={COMPONENTS}>
57
+ <NextSeo noindex nofollow />
58
+
59
+ <MyAccountLayout
60
+ isRepresentative={isRepresentative}
61
+ accountName={accountName}
62
+ >
63
+ <BeforeSection />
64
+ <MyAccountUserDetails userDetails={userDetails} />
65
+ <AfterSection />
66
+ </MyAccountLayout>
67
+ </RenderSections>
68
+ </PageProvider>
66
69
  )
67
70
  }
68
71
 
@@ -12,6 +12,7 @@ import {
12
12
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
13
13
 
14
14
  import RenderSections from 'src/components/cms/RenderSections'
15
+ import PageProvider from 'src/sdk/overrides/PageProvider'
15
16
  import { injectGlobalSections } from 'src/server/cms/global'
16
17
  import storeConfig from '../../discovery.config'
17
18
 
@@ -25,20 +26,22 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
25
26
  ...CUSTOM_COMPONENTS,
26
27
  }
27
28
 
28
- function Page({ globalSections }: Props) {
29
+ function Page({ globalSections: globalSectionsProp }: Props) {
30
+ const { sections: globalSections, settings: globalSettings } =
31
+ globalSectionsProp ?? {}
32
+
29
33
  useEffect(() => {
30
34
  window.location.href = storeConfig.checkoutUrl
31
35
  }, [])
32
36
 
33
37
  return (
34
- <RenderSections
35
- globalSections={globalSections.sections}
36
- components={COMPONENTS}
37
- >
38
- <NextSeo noindex nofollow />
38
+ <PageProvider context={{ globalSettings }}>
39
+ <RenderSections globalSections={globalSections} components={COMPONENTS}>
40
+ <NextSeo noindex nofollow />
39
41
 
40
- <div>loading...</div>
41
- </RenderSections>
42
+ <div>loading...</div>
43
+ </RenderSections>
44
+ </PageProvider>
42
45
  )
43
46
  }
44
47
 
@@ -11,10 +11,10 @@ import {
11
11
  import COMPONENTS from 'src/components/cms/home/Components'
12
12
  import PageProvider from 'src/sdk/overrides/PageProvider'
13
13
  import { injectGlobalSections } from 'src/server/cms/global'
14
- import { getDynamicContent } from 'src/utils/dynamicContent'
15
- import storeConfig from '../../discovery.config'
16
14
  import { contentService } from 'src/server/content/service'
17
15
  import type { PreviewData } from 'src/server/content/types'
16
+ import { getDynamicContent } from 'src/utils/dynamicContent'
17
+ import storeConfig from '../../discovery.config'
18
18
 
19
19
  type Props = {
20
20
  page: PageContentType
@@ -24,11 +24,14 @@ type Props = {
24
24
 
25
25
  function Page({
26
26
  page: { sections, settings },
27
- globalSections,
27
+ globalSections: globalSectionsProp,
28
28
  serverData,
29
29
  }: Props) {
30
+ const { sections: globalSections, settings: globalSettings } =
31
+ globalSectionsProp ?? {}
30
32
  const context = {
31
33
  data: serverData,
34
+ globalSettings,
32
35
  }
33
36
 
34
37
  const publisherId = settings?.seo?.publisherId ?? storeConfig.seo.publisherId
@@ -134,7 +137,7 @@ function Page({
134
137
  */}
135
138
  <PageProvider context={context}>
136
139
  <RenderSections
137
- globalSections={globalSections.sections}
140
+ globalSections={globalSections}
138
141
  sections={sections}
139
142
  components={COMPONENTS}
140
143
  />
@@ -12,11 +12,12 @@ import RenderSections from 'src/components/cms/RenderSections'
12
12
  import { OverriddenDefaultEmptyState as EmptyState } from 'src/components/sections/EmptyState/OverriddenDefaultEmptyState'
13
13
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
14
14
  import PLUGINS_COMPONENTS from 'src/plugins'
15
+ import PageProvider from 'src/sdk/overrides/PageProvider'
15
16
  import type { PageContentType } from 'src/server/cms'
16
17
  import { injectGlobalSections } from 'src/server/cms/global'
17
- import storeConfig from '../../discovery.config'
18
18
  import { contentService } from 'src/server/content/service'
19
19
  import type { PreviewData } from 'src/server/content/types'
20
+ import storeConfig from '../../discovery.config'
20
21
 
21
22
  /* A list of components that can be used in the CMS. */
22
23
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -31,7 +32,13 @@ type Props = {
31
32
  globalSections: GlobalSectionsData
32
33
  }
33
34
 
34
- function Page({ page: { sections }, globalSections }: Props) {
35
+ function Page({
36
+ page: { sections },
37
+ globalSections: globalSectionsProp,
38
+ }: Props) {
39
+ const { sections: globalSections, settings: globalSettings } =
40
+ globalSectionsProp ?? {}
41
+
35
42
  useEffect(() => {
36
43
  const loginUrl = new URL(storeConfig.loginUrl)
37
44
  const incomingParams = new URLSearchParams(window.location.search)
@@ -57,11 +64,13 @@ function Page({ page: { sections }, globalSections }: Props) {
57
64
  If needed, wrap your component in a <Section /> component
58
65
  (not the HTML tag) before rendering it here.
59
66
  */}
60
- <RenderSections
61
- sections={sections}
62
- globalSections={globalSections.sections}
63
- components={COMPONENTS}
64
- />
67
+ <PageProvider context={{ globalSettings }}>
68
+ <RenderSections
69
+ sections={sections}
70
+ globalSections={globalSections}
71
+ components={COMPONENTS}
72
+ />
73
+ </PageProvider>
65
74
  </>
66
75
  )
67
76
  }
package/src/pages/s.tsx CHANGED
@@ -97,9 +97,11 @@ function generateSEOData(storeConfig: StoreConfig, searchTerm?: string) {
97
97
 
98
98
  function Page({
99
99
  page: searchContentType,
100
- globalSections,
100
+ globalSections: globalSectionsProp,
101
101
  searchTerm,
102
102
  }: SearchPageProps) {
103
+ const { sections: globalSections, settings: globalSettings } =
104
+ globalSectionsProp ?? {}
103
105
  const { settings } = searchContentType
104
106
  const applySearchState = useApplySearchState()
105
107
  const searchParams = useSearchParams({
@@ -146,7 +148,8 @@ function Page({
146
148
  title: seoData.title,
147
149
  searchTerm: searchTerm ?? searchParams.term ?? undefined,
148
150
  }}
149
- globalSections={globalSections.sections}
151
+ globalSections={globalSections}
152
+ globalSettings={globalSettings}
150
153
  />
151
154
  </SearchProvider>
152
155
  )