@faststore/core 3.0.47 → 3.0.49

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 (147) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +13 -12
  3. package/.next/build-manifest.json +37 -37
  4. package/.next/cache/.tsbuildinfo +1 -1
  5. package/.next/cache/config.json +3 -3
  6. package/.next/cache/eslint/.cache_1gneedd +1 -1
  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/next-minimal-server.js.nft.json +1 -1
  12. package/.next/next-server.js.nft.json +1 -1
  13. package/.next/prerender-manifest.js +1 -1
  14. package/.next/prerender-manifest.json +1 -1
  15. package/.next/react-loadable-manifest.json +1 -1
  16. package/.next/routes-manifest.json +1 -1
  17. package/.next/server/app/_not-found.html +14 -1
  18. package/.next/server/app/_not-found.js +1 -1
  19. package/.next/server/app/_not-found.js.nft.json +1 -1
  20. package/.next/server/app/_not-found.rsc +9 -6
  21. package/.next/server/app/_not-found_client-reference-manifest.js +1 -1
  22. package/.next/server/app/fs-next-update/page.js +1 -1
  23. package/.next/server/app/fs-next-update/page.js.nft.json +1 -1
  24. package/.next/server/app/fs-next-update/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/fs-next-update.html +14 -1
  26. package/.next/server/app/fs-next-update.rsc +9 -6
  27. package/.next/server/chunks/{8352.js → 1259.js} +1 -1
  28. package/.next/server/chunks/1488.js +1 -1
  29. package/.next/server/chunks/{2053.js → 2827.js} +1 -1
  30. package/.next/server/chunks/513.js +1 -1
  31. package/.next/server/chunks/522.js +1 -1
  32. package/.next/server/chunks/{3131.js → 5553.js} +1 -1
  33. package/.next/server/chunks/5640.js +1 -1
  34. package/.next/server/chunks/{6414.js → 6942.js} +1 -1
  35. package/.next/server/chunks/7088.js +1 -0
  36. package/.next/server/chunks/8360.js +1 -0
  37. package/.next/server/chunks/8365.js +8 -0
  38. package/.next/server/chunks/8609.js +1 -1
  39. package/.next/server/chunks/9239.js +1 -1
  40. package/.next/server/middleware-build-manifest.js +1 -1
  41. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  42. package/.next/server/pages/404.html +14 -1
  43. package/.next/server/pages/404.js +1 -1
  44. package/.next/server/pages/404.js.nft.json +1 -1
  45. package/.next/server/pages/500.js +1 -1
  46. package/.next/server/pages/500.js.nft.json +1 -1
  47. package/.next/server/pages/[...slug].js +1 -1
  48. package/.next/server/pages/[...slug].js.nft.json +1 -1
  49. package/.next/server/pages/[slug]/p.js +1 -1
  50. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  51. package/.next/server/pages/_app.js +1 -1
  52. package/.next/server/pages/_app.js.nft.json +1 -1
  53. package/.next/server/pages/_document.js +1 -1
  54. package/.next/server/pages/_document.js.nft.json +1 -1
  55. package/.next/server/pages/_error.js +1 -1
  56. package/.next/server/pages/_error.js.nft.json +1 -1
  57. package/.next/server/pages/account.js +1 -1
  58. package/.next/server/pages/account.js.nft.json +1 -1
  59. package/.next/server/pages/api/graphql.js +1 -1
  60. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  61. package/.next/server/pages/api/health/live.js.nft.json +1 -1
  62. package/.next/server/pages/api/health/ready.js.nft.json +1 -1
  63. package/.next/server/pages/api/preview.js.nft.json +1 -1
  64. package/.next/server/pages/checkout.js +1 -1
  65. package/.next/server/pages/checkout.js.nft.json +1 -1
  66. package/.next/server/pages/en-US/404.html +2 -2
  67. package/.next/server/pages/en-US/404.json +1 -1
  68. package/.next/server/pages/en-US/500.html +2 -2
  69. package/.next/server/pages/en-US/500.json +1 -1
  70. package/.next/server/pages/en-US/account.html +2 -2
  71. package/.next/server/pages/en-US/account.json +1 -1
  72. package/.next/server/pages/en-US/checkout.html +2 -2
  73. package/.next/server/pages/en-US/checkout.json +1 -1
  74. package/.next/server/pages/en-US/login.html +2 -2
  75. package/.next/server/pages/en-US/login.json +1 -1
  76. package/.next/server/pages/en-US/s.html +2 -2
  77. package/.next/server/pages/en-US/s.json +1 -1
  78. package/.next/server/pages/en-US.html +3 -3
  79. package/.next/server/pages/en-US.json +1 -1
  80. package/.next/server/pages/index.js +1 -1
  81. package/.next/server/pages/index.js.nft.json +1 -1
  82. package/.next/server/pages/login.js +1 -1
  83. package/.next/server/pages/login.js.nft.json +1 -1
  84. package/.next/server/pages/s.js +1 -1
  85. package/.next/server/pages/s.js.nft.json +1 -1
  86. package/.next/server/pages-manifest.json +1 -1
  87. package/.next/static/DBfTJ0pmM5XIMOqyQAgU7/_buildManifest.js +1 -0
  88. package/.next/static/chunks/346-9ca6d5a6a8749dda.js +1 -0
  89. package/.next/static/chunks/{551-448d32b3b6393825.js → 551-162bba2358b63a62.js} +1 -1
  90. package/.next/static/chunks/{661.df439acd66dbae34.js → 661.238d10731eba48c4.js} +1 -1
  91. package/.next/static/chunks/799.b2681e75eb83b9bf.js +1 -0
  92. package/.next/static/chunks/907.c323825210f93a2f.js +1 -0
  93. package/.next/static/chunks/{913-4af007b10d50c50f.js → 913-024e149266ee79b9.js} +1 -1
  94. package/.next/static/chunks/app/fs-next-update/page-c0b2bfde3e62e7be.js +1 -0
  95. package/.next/static/chunks/app/layout-2191e8eb7903521a.js +9 -0
  96. package/.next/static/chunks/pages/{404-2e174f10fe6712cd.js → 404-28a52b92a626978b.js} +1 -1
  97. package/.next/static/chunks/pages/{500-52c42b827ed9693b.js → 500-0d28b814be7b9731.js} +1 -1
  98. package/.next/static/chunks/pages/{[...slug]-91cd643a14638b90.js → [...slug]-5e2a4e9dad048ff3.js} +1 -1
  99. package/.next/static/chunks/pages/{_app-88eac41033b6a613.js → _app-ddcbec71774555c4.js} +2 -2
  100. package/.next/static/chunks/pages/{index-d3008f576cb2fc9d.js → index-58951c53d8027e6e.js} +1 -1
  101. package/.next/static/chunks/pages/{login-7a53f93622c6fded.js → login-cf8e5aafcae9efd5.js} +1 -1
  102. package/.next/static/chunks/webpack-9f1c9c7cf9345782.js +1 -0
  103. package/.next/trace +128 -113
  104. package/.turbo/turbo-build.log +24 -10
  105. package/.turbo/turbo-test.log +9 -9
  106. package/app/layout.tsx +43 -4
  107. package/{src → app}/sdk/analytics/index.tsx +2 -0
  108. package/{src → app}/sdk/error/ErrorBoundary/ErrorBoundary.tsx +2 -0
  109. package/app/sdk/ui/UIProvider.tsx +11 -0
  110. package/package.json +2 -2
  111. package/src/components/cart/CartItem/CartItem.tsx +9 -9
  112. package/src/components/sections/ProductDetails/ProductDetails.tsx +5 -5
  113. package/src/components/sections/ProductTiles/ProductTiles.tsx +1 -1
  114. package/src/components/ui/ProductShelf/ProductShelf.tsx +1 -1
  115. package/src/pages/_app.tsx +2 -2
  116. package/src/pages/_document.tsx +1 -1
  117. package/src/sdk/cart/useBuyButton.ts +3 -3
  118. package/src/sdk/cart/useRemoveButton.ts +3 -3
  119. package/src/sdk/product/useProductGalleryQuery.ts +4 -5
  120. package/src/sdk/product/useProductLink.ts +5 -2
  121. package/src/sdk/search/Sentinel.tsx +3 -3
  122. package/src/sdk/search/useSuggestions.ts +1 -1
  123. package/.next/server/chunks/368.js +0 -1
  124. package/.next/server/chunks/8811.js +0 -1
  125. package/.next/server/chunks/9134.js +0 -1
  126. package/.next/static/chunks/119.e218828b0132b8b2.js +0 -1
  127. package/.next/static/chunks/346-94f30a4bb6dafd89.js +0 -1
  128. package/.next/static/chunks/576.bd044c1cd3af7bbc.js +0 -1
  129. package/.next/static/chunks/app/fs-next-update/page-9a2debb5dd829908.js +0 -1
  130. package/.next/static/chunks/app/layout-a5723c7cfcca3bdf.js +0 -1
  131. package/.next/static/chunks/webpack-31f87692f808967d.js +0 -1
  132. package/.next/static/ieYDvu46hXTqDayv0izz5/_buildManifest.js +0 -1
  133. /package/.next/static/{ieYDvu46hXTqDayv0izz5 → DBfTJ0pmM5XIMOqyQAgU7}/_ssgManifest.js +0 -0
  134. /package/.next/static/chunks/{503-e6db8cab6eb3bf60.js → 503-c781fed990b2a19d.js} +0 -0
  135. /package/.next/static/chunks/app/{_not-found-3649108cdca52b21.js → _not-found-2d32d7476da44280.js} +0 -0
  136. /package/.next/static/chunks/{fd9d1056-e4950b334bc218cf.js → fd9d1056-43c43818840d7811.js} +0 -0
  137. /package/.next/static/chunks/pages/[slug]/{p-436d394ddc268573.js → p-003fd9d91eec1798.js} +0 -0
  138. /package/{src → app}/components/ThirdPartyScripts/GoogleTagManager.tsx +0 -0
  139. /package/{src → app}/components/ThirdPartyScripts/ThirdPartyScripts.tsx +0 -0
  140. /package/{src → app}/components/ThirdPartyScripts/index.ts +0 -0
  141. /package/{src → app}/components/ThirdPartyScripts/vtex.tsx +0 -0
  142. /package/{src → app}/sdk/analytics/hooks/useViewItemListEvent.ts +0 -0
  143. /package/{src → app}/sdk/analytics/platform/vtex/index.ts +0 -0
  144. /package/{src → app}/sdk/analytics/platform/vtex/search.ts +0 -0
  145. /package/{src → app}/sdk/analytics/types.ts +0 -0
  146. /package/{src → app}/sdk/error/ErrorBoundary/index.ts +0 -0
  147. /package/{src → app}/utils/getCookie.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  $ yarn partytown & yarn generate && next build
2
- $ partytown copylib ./public/~partytown
3
2
  $ faststore generate-graphql -c
3
+ $ partytown copylib ./public/~partytown
4
4
  Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
5
5
  success - GraphQL schema, types, and optimizations successfully generated 🎉
6
6
  ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
@@ -26,24 +26,38 @@ Browserslist: caniuse-lite is outdated. Please run:
26
26
  Collecting page data ...
27
27
  Generating static pages (0/9) ...
28
28
 
29
29
  Generating static pages (2/9)
30
+ warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
31
+ warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
32
+ warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
33
+ warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
34
+ warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
35
+ warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
30
36
 
31
37
  Generating static pages (4/9)
32
38
  Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
39
+ warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
40
+ warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
33
41
 
34
42
  Generating static pages (6/9)
43
+ warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
44
+ warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
45
+ warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
46
+ warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
47
+ warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
48
+ warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
35
49
 
36
50
  ✓ Generating static pages (9/9)
37
51
  Finalizing page optimization ...
38
52
  Collecting build traces ...
39
53
 
40
54
  Route (app) Size First Load JS
41
55
  ┌ ○ /_not-found 875 B 83 kB
42
- └ ○ /fs-next-update 142 B 82.3 kB
43
- + First Load JS shared by all 82.1 kB
44
- ├ chunks/503-e6db8cab6eb3bf60.js 28.4 kB
45
- ├ chunks/fd9d1056-e4950b334bc218cf.js 51.1 kB
56
+ └ ○ /fs-next-update 138 B 82.3 kB
57
+ + First Load JS shared by all 82.2 kB
58
+ ├ chunks/503-c781fed990b2a19d.js 28.4 kB
59
+ ├ chunks/fd9d1056-43c43818840d7811.js 51.1 kB
46
60
  ├ chunks/main-app-7b31a9960d0fa675.js 232 B
47
- └ chunks/webpack-31f87692f808967d.js 2.45 kB
61
+ └ chunks/webpack-9f1c9c7cf9345782.js 2.45 kB
48
62
 
49
63
  Route (pages) Size First Load JS
50
- ┌ ● / 3.39 kB 144 kB
64
+ ┌ ● / 3.38 kB 144 kB
51
65
  ├ └ css/6ce7302d311d7d68.css 6.57 kB
52
66
  ├ /_app 0 B 93.5 kB
53
67
  ├ ● /[...slug] 4.5 kB 156 kB
@@ -58,13 +72,13 @@ Route (pages) Size First Load JS
58
72
  ├ λ /api/health/ready 0 B 93.5 kB
59
73
  ├ λ /api/preview 0 B 93.5 kB
60
74
  ├ ● /checkout 660 B 126 kB
61
- ├ ● /login 1.58 kB 127 kB
75
+ ├ ● /login 1.59 kB 127 kB
62
76
  └ ● /s 4.97 kB 141 kB
63
77
  + First Load JS shared by all 96.5 kB
64
78
  ├ chunks/framework-21e9365486ba23a6.js 45.4 kB
65
79
  ├ chunks/main-5e45f8a409e3ce1c.js 33.1 kB
66
- ├ chunks/pages/_app-88eac41033b6a613.js 12.6 kB
67
- ├ chunks/webpack-31f87692f808967d.js 2.45 kB
80
+ ├ chunks/pages/_app-ddcbec71774555c4.js 12.6 kB
81
+ ├ chunks/webpack-9f1c9c7cf9345782.js 2.45 kB
68
82
  └ css/5d1f64b61ea581f4.css 3.05 kB
69
83
 
70
84
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
@@ -1,23 +1,23 @@
1
1
  $ jest
2
- PASS test/server/index.test.ts (27.469 s)
2
+ PASS test/server/index.test.ts (26.402 s)
3
3
  FastStore GraphQL Layer
4
4
  @faststore/api
5
- ✓ should return a valid GraphQL schema (13 ms)
5
+ ✓ should return a valid GraphQL schema (10 ms)
6
6
  ✓ should return a valid GraphQL schema contain all expected types (19 ms)
7
- ✓ should return a valid GraphQL schema contain all expected queries (2 ms)
7
+ ✓ should return a valid GraphQL schema contain all expected queries (1 ms)
8
8
  ✓ should return a valid GraphQL schema contain all expected mutations (1 ms)
9
9
  VTEX API Extension
10
- ✓ getTypeDefsFromFolder function should return an Array (11 ms)
10
+ ✓ getTypeDefsFromFolder function should return an Array (8 ms)
11
11
  Third Party API Extension
12
- ✓ getTypeDefsFromFolder function should return an Array (9 ms)
12
+ ✓ getTypeDefsFromFolder function should return an Array (4 ms)
13
13
  Final Schema after merging
14
- ✓ should return a valid merged GraphQL schema (47 ms)
14
+ ✓ should return a valid merged GraphQL schema (30 ms)
15
15
  Envelop
16
- ✓ should exist with its plugins (54 ms)
17
- ✓ should handle options and execute (706 ms)
16
+ ✓ should exist with its plugins (49 ms)
17
+ ✓ should handle options and execute (426 ms)
18
18
 
19
19
  Test Suites: 1 passed, 1 total
20
20
  Tests: 9 passed, 9 total
21
21
  Snapshots: 0 total
22
- Time: 27.645 s
22
+ Time: 26.542 s
23
23
  Ran all test suites.
package/app/layout.tsx CHANGED
@@ -1,11 +1,50 @@
1
- export default function RootLayout({
1
+ // FastStore UI's base styles
2
+ import 'src/styles/global/index.scss'
3
+
4
+ import 'src/customizations/src/themes/index.scss'
5
+
6
+ import ThirdPartyScripts from 'app/components/ThirdPartyScripts'
7
+ import AnalyticsHandler from 'app/sdk/analytics'
8
+ import ErrorBoundary from 'app/sdk/error/ErrorBoundary'
9
+ import UIProvider from 'app/sdk/ui/UIProvider'
10
+ import { WebFonts } from 'src/customizations/src/GlobalOverrides'
11
+
12
+ // import GlobalSections from './components/cms/GlobalSections'
13
+
14
+ export const GLOBAL_SECTIONS_CONTENT_TYPE = 'globalSections'
15
+
16
+ import { Section } from '@vtex/client-cms'
17
+
18
+ export type GlobalSectionsData = {
19
+ sections: Section[]
20
+ }
21
+
22
+ export default async function RootLayout({
2
23
  children,
3
24
  }: {
4
25
  children: React.ReactNode
5
26
  }) {
27
+ const globalSections = { sections: [] }
6
28
  return (
7
- <html lang="en">
8
- <body>{children}</body>
9
- </html>
29
+ <ErrorBoundary>
30
+ {/* TODO: we should use metadata api from Next 13 */}
31
+ {/* <DefaultSeo norobots={storeConfig.experimental.noRobots} /> */}
32
+
33
+ <AnalyticsHandler />
34
+
35
+ <html>
36
+ <head>
37
+ {!process.env.DISABLE_3P_SCRIPTS && <ThirdPartyScripts />}
38
+ <WebFonts />
39
+ </head>
40
+ <body className="theme">
41
+ <UIProvider>
42
+ <>
43
+ {/* <GlobalSections {...globalSections}>{children}</GlobalSections>*/}
44
+ </>
45
+ </UIProvider>
46
+ </body>
47
+ </html>
48
+ </ErrorBoundary>
10
49
  )
11
50
  }
@@ -1,3 +1,5 @@
1
+ 'use client'
2
+
1
3
  import type { AnalyticsEvent } from '@faststore/sdk'
2
4
  import { useAnalyticsEvent } from '@faststore/sdk'
3
5
 
@@ -1,3 +1,5 @@
1
+ 'use client'
2
+
1
3
  import { Component } from 'react'
2
4
  import type { ErrorInfo, ReactNode } from 'react'
3
5
 
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+
3
+ import { UIProvider as UIProviderWrapper } from '@faststore/ui'
4
+
5
+ export default function UIProvider({
6
+ children,
7
+ }: {
8
+ children: React.ReactNode
9
+ }) {
10
+ return <UIProviderWrapper>{children}</UIProviderWrapper>
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "3.0.47",
3
+ "version": "3.0.49",
4
4
  "license": "MIT",
5
5
  "repository": "vtex/faststore",
6
6
  "browserslist": "supports es6-module and not dead",
@@ -124,5 +124,5 @@
124
124
  "node": "18.19.0",
125
125
  "yarn": "1.19.1"
126
126
  },
127
- "gitHead": "bdb7b6cc92d39717ab8f583586859f5d34b85f16"
127
+ "gitHead": "c31943bce35ffc2fa2db72129bea771732ce15ff"
128
128
  }
@@ -1,3 +1,8 @@
1
+ import type {
2
+ AddToCartEvent,
3
+ CurrencyCode,
4
+ RemoveFromCartEvent,
5
+ } from '@faststore/sdk'
1
6
  import { sendAnalyticsEvent } from '@faststore/sdk'
2
7
  import {
3
8
  CartItem as UICartItem,
@@ -5,19 +10,14 @@ import {
5
10
  CartItemSummary as UICartItemSummary,
6
11
  } from '@faststore/ui'
7
12
  import { useCallback, useMemo } from 'react'
8
- import type {
9
- AddToCartEvent,
10
- CurrencyCode,
11
- RemoveFromCartEvent,
12
- } from '@faststore/sdk'
13
13
 
14
+ import type { AnalyticsItem } from 'app/sdk/analytics/types'
14
15
  import { Image } from 'src/components/ui/Image'
16
+ import type { CartItem as ICartItem } from 'src/sdk/cart'
15
17
  import { cartStore } from 'src/sdk/cart'
18
+ import { useRemoveButton } from 'src/sdk/cart/useRemoveButton'
16
19
  import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
17
20
  import { useSession } from 'src/sdk/session'
18
- import { useRemoveButton } from 'src/sdk/cart/useRemoveButton'
19
- import type { CartItem as ICartItem } from 'src/sdk/cart'
20
- import type { AnalyticsItem } from 'src/sdk/analytics/types'
21
21
 
22
22
  function useCartItemEvent() {
23
23
  const {
@@ -62,7 +62,7 @@ function useCartItemEvent() {
62
62
 
63
63
  interface Props {
64
64
  item: ICartItem
65
- useUnitMultiplier: boolean
65
+ useUnitMultiplier?: boolean
66
66
  }
67
67
 
68
68
  function CartItem({ item, useUnitMultiplier = false }: Props) {
@@ -1,23 +1,23 @@
1
- import { useEffect, useState, useMemo } from 'react'
1
+ import { useEffect, useMemo, useState } from 'react'
2
2
 
3
3
  import type { CurrencyCode, ViewItemEvent } from '@faststore/sdk'
4
4
  import { sendAnalyticsEvent } from '@faststore/sdk'
5
5
 
6
6
  import { gql } from '@generated'
7
- import type { AnalyticsItem } from 'src/sdk/analytics/types'
7
+ import type { AnalyticsItem } from 'app/sdk/analytics/types'
8
8
  import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
9
9
  import { useSession } from 'src/sdk/session'
10
10
 
11
- import Section from '../Section'
12
11
  import ProductDescription from '../../../components/ui/ProductDescription'
13
12
  import { ProductDetailsSettings } from '../../../components/ui/ProductDetails'
13
+ import Section from '../Section'
14
14
 
15
15
  import styles from './section.module.scss'
16
16
 
17
- import { usePDP } from '../../../sdk/overrides/PageProvider'
18
17
  import { useOverrideComponents } from '../../../sdk/overrides/OverrideContext'
19
- import { ProductDetailsDefaultComponents } from './DefaultComponents'
18
+ import { usePDP } from '../../../sdk/overrides/PageProvider'
20
19
  import { getOverridableSection } from '../../../sdk/overrides/getOverriddenSection'
20
+ import { ProductDetailsDefaultComponents } from './DefaultComponents'
21
21
 
22
22
  export interface ProductDetailsProps {
23
23
  productTitle: {
@@ -2,10 +2,10 @@ import { useEffect, useRef } from 'react'
2
2
  import { useInView } from 'react-intersection-observer'
3
3
 
4
4
  import type { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
5
+ import { useViewItemListEvent } from 'app/sdk/analytics/hooks/useViewItemListEvent'
5
6
  import ProductCard from 'src/components/product/ProductCard'
6
7
  import ProductTilesSkeleton from 'src/components/skeletons/ProductTilesSkeleton'
7
8
  import Tiles, { Tile } from 'src/components/ui/Tiles'
8
- import { useViewItemListEvent } from 'src/sdk/analytics/hooks/useViewItemListEvent'
9
9
  import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
10
10
 
11
11
  import Section from '../Section'
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useId, useRef } from 'react'
2
2
 
3
+ import { useViewItemListEvent } from 'app/sdk/analytics/hooks/useViewItemListEvent'
3
4
  import ProductShelfSkeleton from 'src/components/skeletons/ProductShelfSkeleton'
4
- import { useViewItemListEvent } from 'src/sdk/analytics/hooks/useViewItemListEvent'
5
5
  import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
6
6
  import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
7
7
  import { textToKebabCase } from 'src/utils/utilities'
@@ -7,9 +7,9 @@ import type { AppProps } from 'next/app'
7
7
  import NextNProgress from 'nextjs-progressbar'
8
8
 
9
9
  import { UIProvider } from '@faststore/ui'
10
+ import AnalyticsHandler from 'app/sdk/analytics'
11
+ import ErrorBoundary from 'app/sdk/error/ErrorBoundary'
10
12
  import Layout from 'src/Layout'
11
- import AnalyticsHandler from 'src/sdk/analytics'
12
- import ErrorBoundary from 'src/sdk/error/ErrorBoundary'
13
13
 
14
14
  import storeConfig from '../../faststore.config'
15
15
 
@@ -1,6 +1,6 @@
1
1
  import { Head, Html, Main, NextScript } from 'next/document'
2
2
 
3
- import ThirdPartyScripts from 'src/components/ThirdPartyScripts'
3
+ import ThirdPartyScripts from 'app/components/ThirdPartyScripts'
4
4
  import { WebFonts } from 'src/customizations/src/GlobalOverrides'
5
5
 
6
6
  function Document() {
@@ -1,12 +1,12 @@
1
+ import type { AddToCartEvent, CurrencyCode } from '@faststore/sdk'
1
2
  import { sendAnalyticsEvent } from '@faststore/sdk'
2
3
  import { useCallback } from 'react'
3
- import type { CurrencyCode, AddToCartEvent } from '@faststore/sdk'
4
4
 
5
- import type { AnalyticsItem } from 'src/sdk/analytics/types'
5
+ import type { AnalyticsItem } from 'app/sdk/analytics/types'
6
6
  import type { CartItem } from 'src/sdk/cart'
7
7
 
8
- import { useSession } from '../session'
9
8
  import { useUI } from '@faststore/ui'
9
+ import { useSession } from '../session'
10
10
  import { cartStore } from './index'
11
11
 
12
12
  export const useBuyButton = (item: CartItem | null) => {
@@ -1,12 +1,12 @@
1
+ import type { CurrencyCode, RemoveFromCartEvent } from '@faststore/sdk'
1
2
  import { sendAnalyticsEvent } from '@faststore/sdk'
2
3
  import { useCallback } from 'react'
3
- import type { CurrencyCode, RemoveFromCartEvent } from '@faststore/sdk'
4
4
 
5
- import type { AnalyticsItem } from 'src/sdk/analytics/types'
5
+ import type { AnalyticsItem } from 'app/sdk/analytics/types'
6
6
 
7
+ import type { CartItem } from '.'
7
8
  import { useSession } from '../session'
8
9
  import { cartStore } from './index'
9
- import type { CartItem } from '.'
10
10
 
11
11
  export const useRemoveButton = (item: CartItem | null) => {
12
12
  const {
@@ -1,17 +1,16 @@
1
- import { sendAnalyticsEvent } from '@faststore/sdk'
2
- import { useSearch, setFacet } from '@faststore/sdk'
1
+ import { sendAnalyticsEvent, useSearch } from '@faststore/sdk'
3
2
 
4
3
  import { gql } from '@generated'
5
4
  import { useQuery } from 'src/sdk/graphql/useQuery'
6
- import { useLocalizedVariables } from './useLocalizedVariables'
7
5
  import { useSession } from 'src/sdk/session'
6
+ import { useLocalizedVariables } from './useLocalizedVariables'
8
7
 
8
+ import type { Facet } from '@faststore/sdk/dist/types'
9
9
  import type {
10
10
  ClientProductGalleryQueryQuery as Query,
11
11
  ClientProductGalleryQueryQueryVariables as Variables,
12
12
  } from '@generated/graphql'
13
- import type { IntelligentSearchQueryEvent } from 'src/sdk/analytics/types'
14
- import type { Facet } from '@faststore/sdk/dist/types'
13
+ import type { IntelligentSearchQueryEvent } from 'app/sdk/analytics/types'
15
14
 
16
15
  /**
17
16
  * This query is run on the browser and contains
@@ -1,11 +1,14 @@
1
+ import type { CurrencyCode, SelectItemEvent } from '@faststore/sdk'
1
2
  import { sendAnalyticsEvent } from '@faststore/sdk'
2
3
  import { useCallback } from 'react'
3
- import type { CurrencyCode, SelectItemEvent } from '@faststore/sdk'
4
4
 
5
5
  import type { ProductSummary_ProductFragment } from '@generated/graphql'
6
6
 
7
+ import type {
8
+ AnalyticsItem,
9
+ SearchSelectItemEvent,
10
+ } from '../../../app/sdk/analytics/types'
7
11
  import { useSession } from '../session'
8
- import type { AnalyticsItem, SearchSelectItemEvent } from '../analytics/types'
9
12
 
10
13
  export type ProductLinkOptions = {
11
14
  index: number
@@ -1,12 +1,12 @@
1
1
  import { useSearch } from '@faststore/sdk'
2
- import { useEffect, useRef } from 'react'
3
- import { useInView } from 'react-intersection-observer'
4
2
  import type { NextRouter } from 'next/router'
5
3
  import { useRouter } from 'next/router'
4
+ import { useEffect, useRef } from 'react'
5
+ import { useInView } from 'react-intersection-observer'
6
6
 
7
7
  import type { ProductSummary_ProductFragment } from '@generated/graphql'
8
8
 
9
- import { useViewItemListEvent } from '../analytics/hooks/useViewItemListEvent'
9
+ import { useViewItemListEvent } from '../../../app/sdk/analytics/hooks/useViewItemListEvent'
10
10
 
11
11
  interface Props {
12
12
  page: number
@@ -8,7 +8,7 @@ import type {
8
8
  ClientSearchSuggestionsQueryQuery as Query,
9
9
  ClientSearchSuggestionsQueryQueryVariables as Variables,
10
10
  } from '@generated/graphql'
11
- import type { IntelligentSearchQueryEvent } from '../analytics/types'
11
+ import type { IntelligentSearchQueryEvent } from '../../../app/sdk/analytics/types'
12
12
 
13
13
  import { useSession } from '../session'
14
14
 
@@ -1 +0,0 @@
1
- exports.id=368,exports.ids=[368],exports.modules={6652:(e,t,r)=>{"use strict";r.d(t,{Z:()=>__WEBPACK_DEFAULT_EXPORT__,l:()=>useUI});var o=r(6689),a=r.n(o);let reducer=(e,t)=>{let{type:r}=t;switch(r){case"open":{let{payload:r}=t;return document.body.classList.add("no-scroll"),{...e,[r]:!0}}case"close":{let{payload:r}=t;return document.body.classList.remove("no-scroll"),{...e,[r]:!1}}case"pushToast":{let r=e.toasts.some(e=>e.message===t.payload.message&&e.status===t.payload.status);if(r)return e;return{...e,toasts:[...e.toasts,t.payload]}}case"popToast":return{...e,toasts:e.toasts.slice(1)};default:throw Error(`Action ${r} not implemented`)}},initializer=()=>({cart:!1,modal:!1,navbar:!1,filter:!1,toasts:[]}),n=(0,o.createContext)(void 0);function useUI(){let e=(0,o.useContext)(n);if(void 0===e)throw Error("Missing UI context on React tree");return e}let __WEBPACK_DEFAULT_EXPORT__=function({children:e}){let[t,r]=(0,o.useReducer)(reducer,void 0,initializer),s=(0,o.useMemo)(()=>({openFilter:()=>r({type:"open",payload:"filter"}),closeFilter:()=>r({type:"close",payload:"filter"}),openNavbar:()=>r({type:"open",payload:"navbar"}),closeNavbar:()=>r({type:"close",payload:"navbar"}),openCart:()=>r({type:"open",payload:"cart"}),closeCart:()=>r({type:"close",payload:"cart"}),openModal:()=>r({type:"open",payload:"modal"}),closeModal:()=>r({type:"close",payload:"modal"}),pushToast:e=>r({type:"pushToast",payload:e}),popToast:()=>r({type:"popToast"})}),[]),l=(0,o.useMemo)(()=>({...t,...s}),[s,t]);return a().createElement(n.Provider,{value:l},e)}},368:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>_app}),r(6968),r(1071);var o=r(8890),a=r.n(o),n=r(6652),s=r(997);let src_Layout=function({children:e}){return s.jsx(s.Fragment,{children:e})};var l=r(6689),c=r(4950);let useAnalyticsEvent=e=>{let t=(0,l.useCallback)(t=>{try{if(t.data.name!==c.vi)return;e((0,c.Wg)(t.data))}catch(e){console.error("Something went wrong while running Analytics handler")}},[e]);(0,l.useEffect)(()=>(window.addEventListener("message",t),()=>window.removeEventListener("message",t)),[t])};var i=r(9740),p=r.n(i);let analytics=()=>(useAnalyticsEvent(e=>{window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:e.name,ecommerce:e.params}),r(7661)(`./${p().platform}`).then(({default:t})=>{t(e)})}),null),getReloads=()=>Number(window.sessionStorage.getItem("store:reloads")??"0"),setReloads=e=>window.sessionStorage.setItem("store:reloads",`${e}`),canRecover=()=>2>getReloads(),isFrameworkLevelError=e=>e?.name==="ChunkLoadError";let ErrorBoundary=class ErrorBoundary extends l.Component{constructor(...e){super(...e),function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"state",{hasError:!1,error:null})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){if(console.error(`React Error: ${e.message} ${t.componentStack}`),window.location.pathname.startsWith("/404")||window.location.pathname.startsWith("/500"))return;let r=encodeURIComponent(window.location.pathname),o=e?.extensions?.exception?.status===404;isFrameworkLevelError(e)&&canRecover()?(setReloads(getReloads()+1),window.location.reload()):o?window.location.href=`/404?from=${r}`:window.location.href=`/500?from=${r}&errorId=unknown`}render(){return this.state.hasError?null:this.props.children}};var d=r(6641);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}let _app=function({Component:e,pageProps:t}){return(0,s.jsxs)(ErrorBoundary,{children:[s.jsx(a(),{color:"var(--fs-color-primary-bkg);",showOnShallow:!1,options:{showSpinner:!1}}),s.jsx(d.DefaultSeo,{norobots:p().experimental.noRobots}),s.jsx(analytics,{}),s.jsx(n.Z,{children:s.jsx(src_Layout,{children:s.jsx(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},t))})})]})}},1071:()=>{},6968:()=>{},7661:(e,t,r)=>{var o={"./vtex":[6414,6414],"./vtex/":[6414,6414],"./vtex/index":[6414,6414],"./vtex/index.ts":[6414,6414],"./vtex/search":[8352,8352],"./vtex/search.ts":[8352,8352]};function webpackAsyncContext(e){if(!r.o(o,e))return Promise.resolve().then(()=>{var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=o[e],a=t[0];return r.e(t[1]).then(()=>r(a))}webpackAsyncContext.keys=()=>Object.keys(o),webpackAsyncContext.id=7661,e.exports=webpackAsyncContext},4950:(e,t,r)=>{"use strict";r.d(t,{Wg:()=>unwrap,re:()=>wrap,vi:()=>a});let o="store:",a="AnalyticsEvent",wrap=e=>({name:a,params:{...e,name:`${o}${e.name}`}}),unwrap=e=>({...e.params,name:e.params.name.slice(o.length,e.params.name.length)})}};
@@ -1 +0,0 @@
1
- exports.id=8811,exports.ids=[8811],exports.modules={6034:(e,t,o)=>{Promise.resolve().then(o.t.bind(o,7337,23)),Promise.resolve().then(o.t.bind(o,114,23)),Promise.resolve().then(o.t.bind(o,7146,23)),Promise.resolve().then(o.t.bind(o,6151,23)),Promise.resolve().then(o.t.bind(o,4153,23)),Promise.resolve().then(o.t.bind(o,4859,23))},5303:()=>{},5375:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>RootLayout});var r=o(2925);function RootLayout({children:e}){return r.jsx("html",{lang:"en",children:r.jsx("body",{children:e})})}}};