@faststore/core 2.0.139-alpha.0 → 2.0.141-alpha.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 (166) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/build-manifest.json +132 -0
  3. package/.next/cache/.tsbuildinfo +1 -0
  4. package/.next/cache/config.json +7 -0
  5. package/.next/cache/eslint/.cache_1gneedd +1 -0
  6. package/.next/cache/next-server.js.nft.json +1 -0
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/export-marker.json +1 -0
  12. package/.next/images-manifest.json +1 -0
  13. package/.next/next-server.js.nft.json +1 -0
  14. package/.next/package.json +1 -0
  15. package/.next/prerender-manifest.json +1 -0
  16. package/.next/react-loadable-manifest.json +48 -0
  17. package/.next/required-server-files.json +1 -0
  18. package/.next/routes-manifest.json +1 -0
  19. package/.next/server/chunks/104.js +703 -0
  20. package/.next/server/chunks/123.js +58 -0
  21. package/.next/server/chunks/143.js +106 -0
  22. package/.next/server/chunks/183.js +80 -0
  23. package/.next/server/chunks/247.js +61 -0
  24. package/.next/server/chunks/280.js +324 -0
  25. package/.next/server/chunks/287.js +58 -0
  26. package/.next/server/chunks/312.js +670 -0
  27. package/.next/server/chunks/336.js +821 -0
  28. package/.next/server/chunks/350.js +142 -0
  29. package/.next/server/chunks/368.js +253 -0
  30. package/.next/server/chunks/401.js +7241 -0
  31. package/.next/server/chunks/431.js +7241 -0
  32. package/.next/server/chunks/502.js +600 -0
  33. package/.next/server/chunks/557.js +132 -0
  34. package/.next/server/chunks/576.js +80 -0
  35. package/.next/server/chunks/597.js +169 -0
  36. package/.next/server/chunks/608.js +644 -0
  37. package/.next/server/chunks/644.js +235 -0
  38. package/.next/server/chunks/664.js +3401 -0
  39. package/.next/server/chunks/676.js +32 -0
  40. package/.next/server/chunks/701.js +87 -0
  41. package/.next/server/chunks/74.js +2520 -0
  42. package/.next/server/chunks/746.js +225 -0
  43. package/.next/server/chunks/82.js +371 -0
  44. package/.next/server/chunks/854.js +72 -0
  45. package/.next/server/chunks/859.js +959 -0
  46. package/.next/server/chunks/874.js +487 -0
  47. package/.next/server/chunks/886.js +120 -0
  48. package/.next/server/chunks/907.js +1723 -0
  49. package/.next/server/chunks/98.js +124 -0
  50. package/.next/server/chunks/font-manifest.json +1 -0
  51. package/.next/server/font-manifest.json +1 -0
  52. package/.next/server/middleware-build-manifest.js +1 -0
  53. package/.next/server/middleware-manifest.json +6 -0
  54. package/.next/server/middleware-react-loadable-manifest.js +1 -0
  55. package/.next/server/pages/404.js +393 -0
  56. package/.next/server/pages/404.js.nft.json +1 -0
  57. package/.next/server/pages/500.js +395 -0
  58. package/.next/server/pages/500.js.nft.json +1 -0
  59. package/.next/server/pages/[...slug].js +725 -0
  60. package/.next/server/pages/[...slug].js.nft.json +1 -0
  61. package/.next/server/pages/[slug]/p.js +2386 -0
  62. package/.next/server/pages/[slug]/p.js.nft.json +1 -0
  63. package/.next/server/pages/_app.js +368 -0
  64. package/.next/server/pages/_app.js.nft.json +1 -0
  65. package/.next/server/pages/_document.js +304 -0
  66. package/.next/server/pages/_document.js.nft.json +1 -0
  67. package/.next/server/pages/_error.js +164 -0
  68. package/.next/server/pages/_error.js.nft.json +1 -0
  69. package/.next/server/pages/account.js +370 -0
  70. package/.next/server/pages/account.js.nft.json +1 -0
  71. package/.next/server/pages/api/graphql.js +315 -0
  72. package/.next/server/pages/api/graphql.js.nft.json +1 -0
  73. package/.next/server/pages/api/preview.js +118 -0
  74. package/.next/server/pages/api/preview.js.nft.json +1 -0
  75. package/.next/server/pages/checkout.js +370 -0
  76. package/.next/server/pages/checkout.js.nft.json +1 -0
  77. package/.next/server/pages/en-US/404.html +81 -0
  78. package/.next/server/pages/en-US/404.json +1 -0
  79. package/.next/server/pages/en-US/500.html +81 -0
  80. package/.next/server/pages/en-US/500.json +1 -0
  81. package/.next/server/pages/en-US/account.html +81 -0
  82. package/.next/server/pages/en-US/account.json +1 -0
  83. package/.next/server/pages/en-US/checkout.html +81 -0
  84. package/.next/server/pages/en-US/checkout.json +1 -0
  85. package/.next/server/pages/en-US/login.html +81 -0
  86. package/.next/server/pages/en-US/login.json +1 -0
  87. package/.next/server/pages/en-US/s.html +81 -0
  88. package/.next/server/pages/en-US/s.json +1 -0
  89. package/.next/server/pages/en-US.html +81 -0
  90. package/.next/server/pages/en-US.json +1 -0
  91. package/.next/server/pages/index.js +966 -0
  92. package/.next/server/pages/index.js.nft.json +1 -0
  93. package/.next/server/pages/login.js +375 -0
  94. package/.next/server/pages/login.js.nft.json +1 -0
  95. package/.next/server/pages/s.js +457 -0
  96. package/.next/server/pages/s.js.nft.json +1 -0
  97. package/.next/server/pages-manifest.json +16 -0
  98. package/.next/server/webpack-api-runtime.js +229 -0
  99. package/.next/server/webpack-runtime.js +229 -0
  100. package/.next/static/aYsUeJebfxFmPYaCwqdKq/_buildManifest.js +1 -0
  101. package/.next/static/aYsUeJebfxFmPYaCwqdKq/_ssgManifest.js +1 -0
  102. package/.next/static/chunks/143.dd8a556e6957baa1.js +1 -0
  103. package/.next/static/chunks/170.c17ce564bb568265.js +1 -0
  104. package/.next/static/chunks/202-80a2f2380b08e20d.js +1 -0
  105. package/.next/static/chunks/226.b57e10ad9932f88c.js +1 -0
  106. package/.next/static/chunks/327-43715af4f3fffaf6.js +1 -0
  107. package/.next/static/chunks/336.0846f48eccce57e4.js +1 -0
  108. package/.next/static/chunks/366-4a0572a47e2225d9.js +1 -0
  109. package/.next/static/chunks/391-47b923ef44945418.js +1 -0
  110. package/.next/static/chunks/495.8ffebac98e9475dc.js +1 -0
  111. package/.next/static/chunks/502.7fd4f230c33d8eca.js +1 -0
  112. package/.next/static/chunks/545-1d3d08edfd2ee4c6.js +1 -0
  113. package/.next/static/chunks/597.c5cf3fbeae5ceb63.js +1 -0
  114. package/.next/static/chunks/651.7142f31ce1e052b3.js +1 -0
  115. package/.next/static/chunks/741.52f7fb873418346f.js +1 -0
  116. package/.next/static/chunks/98.97381d2021f86cd9.js +1 -0
  117. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +1 -0
  118. package/.next/static/chunks/main-fd466221927468fd.js +1 -0
  119. package/.next/static/chunks/pages/404-eb7e8c41c852c36d.js +1 -0
  120. package/.next/static/chunks/pages/500-7dc597fd3f74e419.js +1 -0
  121. package/.next/static/chunks/pages/[...slug]-229b8537827404bc.js +1 -0
  122. package/.next/static/chunks/pages/[slug]/p-a3a8af1949dc6eca.js +1 -0
  123. package/.next/static/chunks/pages/_app-3e4e7e579cb0681a.js +1 -0
  124. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +1 -0
  125. package/.next/static/chunks/pages/account-7f4c51b747b4edd0.js +1 -0
  126. package/.next/static/chunks/pages/checkout-cb8871ab88a1471f.js +1 -0
  127. package/.next/static/chunks/pages/index-7587d2684d1f1de4.js +1 -0
  128. package/.next/static/chunks/pages/login-9490b01a047906c0.js +1 -0
  129. package/.next/static/chunks/pages/s-9582cfca21ff2718.js +1 -0
  130. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +1 -0
  131. package/.next/static/chunks/webpack-d73d5e1e07f9bee2.js +1 -0
  132. package/.next/static/css/13a4da555ff5e3be.css +1 -0
  133. package/.next/static/css/2257f9a5bf751bf1.css +1 -0
  134. package/.next/static/css/2e00f7ba49c754b3.css +1 -0
  135. package/.next/static/css/2e9de35e0cb999e0.css +1 -0
  136. package/.next/static/css/43b1b3821e21630c.css +1 -0
  137. package/.next/static/css/48af598df5fe042d.css +1 -0
  138. package/.next/static/css/587c27bbda64e700.css +1 -0
  139. package/.next/static/css/7701d01af31e31d1.css +1 -0
  140. package/.next/static/css/e02cdad8fc000339.css +1 -0
  141. package/.next/static/css/e434797816e17065.css +1 -0
  142. package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
  143. package/.next/trace +68 -0
  144. package/.turbo/turbo-build.log +5 -5
  145. package/CHANGELOG.md +10 -0
  146. package/cms/faststore/content-types.json +5 -0
  147. package/package.json +4 -4
  148. package/public/~partytown/debug/partytown-atomics.js +556 -0
  149. package/public/~partytown/debug/partytown-media.js +374 -0
  150. package/public/~partytown/debug/partytown-sandbox-sw.js +543 -0
  151. package/public/~partytown/debug/partytown-sw.js +59 -0
  152. package/public/~partytown/debug/partytown-ww-atomics.js +1789 -0
  153. package/public/~partytown/debug/partytown-ww-sw.js +1781 -0
  154. package/public/~partytown/debug/partytown.js +72 -0
  155. package/public/~partytown/partytown-atomics.js +2 -0
  156. package/public/~partytown/partytown-media.js +2 -0
  157. package/public/~partytown/partytown-sw.js +2 -0
  158. package/public/~partytown/partytown.js +2 -0
  159. package/src/components/sections/Breadcrumb/Breadcrumb.tsx +30 -10
  160. package/src/components/sections/ProductDetails/ProductDetails.tsx +1 -3
  161. package/src/components/ui/Breadcrumb/Breadcrumb.tsx +15 -17
  162. package/src/pages/[...slug].tsx +41 -22
  163. package/src/pages/[slug]/p.tsx +9 -8
  164. package/src/pages/index.tsx +10 -9
  165. package/src/pages/s.tsx +29 -10
  166. package/src/server/cms.ts +3 -1
package/src/pages/s.tsx CHANGED
@@ -1,25 +1,38 @@
1
+ import type { SearchState } from '@faststore/sdk'
1
2
  import { parseSearchState, SearchProvider } from '@faststore/sdk'
3
+ import { SROnly as UISROnly } from '@faststore/ui'
2
4
  import { NextSeo } from 'next-seo'
3
5
  import { useRouter } from 'next/router'
6
+ import type { ComponentType } from 'react'
4
7
  import { useEffect, useState } from 'react'
5
- import type { SearchState } from '@faststore/sdk'
6
- import { SROnly as UISROnly } from '@faststore/ui'
7
8
 
8
9
  import Breadcrumb from 'src/components/sections/Breadcrumb'
9
10
  import ProductGallery from 'src/components/sections/ProductGallery'
10
11
  import { ITEMS_PER_PAGE } from 'src/constants'
12
+ import CUSTOM_COMPONENTS from 'src/customizations/components'
11
13
  import { useApplySearchState } from 'src/sdk/search/state'
12
14
  import { mark } from 'src/sdk/tests/mark'
13
15
 
14
- import storeConfig from '../../faststore.config'
16
+ import { Locator } from '@vtex/client-cms'
17
+ import { GetStaticProps } from 'next'
15
18
  import GlobalSections, {
16
19
  getGlobalSectionsData,
17
20
  GlobalSectionsData,
18
21
  } from 'src/components/cms/GlobalSections'
19
- import { Locator } from '@vtex/client-cms'
20
- import { GetStaticProps } from 'next'
22
+ import RenderSections from 'src/components/cms/RenderSections'
23
+ import { getPage, SearchContentType } from 'src/server/cms'
24
+ import storeConfig from '../../faststore.config'
25
+
26
+ /**
27
+ * Sections: Components imported from each store's custom components and '../components/sections' only.
28
+ * Do not import or render components from any other folder in here.
29
+ */
30
+ const COMPONENTS: Record<string, ComponentType<any>> = {
31
+ Breadcrumb,
32
+ ...CUSTOM_COMPONENTS,
33
+ }
21
34
 
22
- type Props = {
35
+ type Props = SearchContentType & {
23
36
  globalSections: GlobalSectionsData
24
37
  }
25
38
 
@@ -36,7 +49,7 @@ const useSearchParams = () => {
36
49
  return params
37
50
  }
38
51
 
39
- function Page({ globalSections }: Props) {
52
+ function Page({ sections, globalSections }: Props) {
40
53
  const searchParams = useSearchParams()
41
54
  const applySearchState = useApplySearchState()
42
55
  const title = 'Search Results'
@@ -79,7 +92,7 @@ function Page({ globalSections }: Props) {
79
92
  If needed, wrap your component in a <Section /> component
80
93
  (not the HTML tag) before rendering it here.
81
94
  */}
82
- <Breadcrumb name="All Products" />
95
+ <RenderSections sections={sections} components={COMPONENTS} />
83
96
 
84
97
  <ProductGallery
85
98
  title="Search Results"
@@ -95,10 +108,16 @@ export const getStaticProps: GetStaticProps<
95
108
  Record<string, string>,
96
109
  Locator
97
110
  > = async ({ previewData }) => {
98
- const globalSections = await getGlobalSectionsData(previewData)
111
+ const [cmsPage, globalSections] = await Promise.all([
112
+ getPage<SearchContentType>({
113
+ ...(previewData?.contentType === 'search' ? previewData : null),
114
+ contentType: 'search',
115
+ }),
116
+ getGlobalSectionsData(previewData),
117
+ ])
99
118
 
100
119
  return {
101
- props: { globalSections },
120
+ props: { ...cmsPage, globalSections },
102
121
  }
103
122
  }
104
123
 
package/src/server/cms.ts CHANGED
@@ -1,5 +1,5 @@
1
- import ClientCMS from '@vtex/client-cms'
2
1
  import type { ContentData, Locator } from '@vtex/client-cms'
2
+ import ClientCMS from '@vtex/client-cms'
3
3
 
4
4
  import config from '../../faststore.config'
5
5
 
@@ -54,6 +54,8 @@ export const getPage = async <T extends ContentData>(options: Options) => {
54
54
  }
55
55
 
56
56
  export type PDPContentType = ContentData
57
+ export type PLPContentType = ContentData
58
+ export type SearchContentType = ContentData
57
59
 
58
60
  export type PageContentType = ContentData & {
59
61
  settings: {