@faststore/core 3.0.48 → 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 (138) 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/middleware-build-manifest.js +1 -1
  40. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  41. package/.next/server/pages/404.html +14 -1
  42. package/.next/server/pages/404.js +1 -1
  43. package/.next/server/pages/404.js.nft.json +1 -1
  44. package/.next/server/pages/500.js +1 -1
  45. package/.next/server/pages/500.js.nft.json +1 -1
  46. package/.next/server/pages/[...slug].js +1 -1
  47. package/.next/server/pages/[...slug].js.nft.json +1 -1
  48. package/.next/server/pages/[slug]/p.js +1 -1
  49. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  50. package/.next/server/pages/_app.js +1 -1
  51. package/.next/server/pages/_app.js.nft.json +1 -1
  52. package/.next/server/pages/_document.js +1 -1
  53. package/.next/server/pages/_document.js.nft.json +1 -1
  54. package/.next/server/pages/_error.js +1 -1
  55. package/.next/server/pages/_error.js.nft.json +1 -1
  56. package/.next/server/pages/account.js +1 -1
  57. package/.next/server/pages/account.js.nft.json +1 -1
  58. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  59. package/.next/server/pages/api/health/live.js.nft.json +1 -1
  60. package/.next/server/pages/api/health/ready.js.nft.json +1 -1
  61. package/.next/server/pages/api/preview.js.nft.json +1 -1
  62. package/.next/server/pages/checkout.js +1 -1
  63. package/.next/server/pages/checkout.js.nft.json +1 -1
  64. package/.next/server/pages/en-US/404.html +2 -2
  65. package/.next/server/pages/en-US/500.html +2 -2
  66. package/.next/server/pages/en-US/account.html +2 -2
  67. package/.next/server/pages/en-US/checkout.html +2 -2
  68. package/.next/server/pages/en-US/login.html +2 -2
  69. package/.next/server/pages/en-US/s.html +2 -2
  70. package/.next/server/pages/en-US.html +2 -2
  71. package/.next/server/pages/index.js +1 -1
  72. package/.next/server/pages/index.js.nft.json +1 -1
  73. package/.next/server/pages/login.js +1 -1
  74. package/.next/server/pages/login.js.nft.json +1 -1
  75. package/.next/server/pages/s.js +1 -1
  76. package/.next/server/pages/s.js.nft.json +1 -1
  77. package/.next/server/pages-manifest.json +1 -1
  78. package/.next/static/DBfTJ0pmM5XIMOqyQAgU7/_buildManifest.js +1 -0
  79. package/.next/static/chunks/346-9ca6d5a6a8749dda.js +1 -0
  80. package/.next/static/chunks/{551-448d32b3b6393825.js → 551-162bba2358b63a62.js} +1 -1
  81. package/.next/static/chunks/{661.df439acd66dbae34.js → 661.238d10731eba48c4.js} +1 -1
  82. package/.next/static/chunks/799.b2681e75eb83b9bf.js +1 -0
  83. package/.next/static/chunks/907.c323825210f93a2f.js +1 -0
  84. package/.next/static/chunks/{913-4af007b10d50c50f.js → 913-024e149266ee79b9.js} +1 -1
  85. package/.next/static/chunks/app/fs-next-update/page-c0b2bfde3e62e7be.js +1 -0
  86. package/.next/static/chunks/app/layout-2191e8eb7903521a.js +9 -0
  87. package/.next/static/chunks/pages/{404-2e174f10fe6712cd.js → 404-28a52b92a626978b.js} +1 -1
  88. package/.next/static/chunks/pages/{500-52c42b827ed9693b.js → 500-0d28b814be7b9731.js} +1 -1
  89. package/.next/static/chunks/pages/{[...slug]-91cd643a14638b90.js → [...slug]-5e2a4e9dad048ff3.js} +1 -1
  90. package/.next/static/chunks/pages/{_app-88eac41033b6a613.js → _app-ddcbec71774555c4.js} +2 -2
  91. package/.next/static/chunks/pages/{index-d3008f576cb2fc9d.js → index-58951c53d8027e6e.js} +1 -1
  92. package/.next/static/chunks/pages/{login-7a53f93622c6fded.js → login-cf8e5aafcae9efd5.js} +1 -1
  93. package/.next/static/chunks/webpack-9f1c9c7cf9345782.js +1 -0
  94. package/.next/trace +128 -113
  95. package/.turbo/turbo-build.log +11 -11
  96. package/.turbo/turbo-test.log +9 -9
  97. package/app/layout.tsx +43 -4
  98. package/{src → app}/sdk/analytics/index.tsx +2 -0
  99. package/{src → app}/sdk/error/ErrorBoundary/ErrorBoundary.tsx +2 -0
  100. package/app/sdk/ui/UIProvider.tsx +11 -0
  101. package/package.json +2 -2
  102. package/src/components/cart/CartItem/CartItem.tsx +8 -8
  103. package/src/components/sections/ProductDetails/ProductDetails.tsx +5 -5
  104. package/src/components/sections/ProductTiles/ProductTiles.tsx +1 -1
  105. package/src/components/ui/ProductShelf/ProductShelf.tsx +1 -1
  106. package/src/pages/_app.tsx +2 -2
  107. package/src/pages/_document.tsx +1 -1
  108. package/src/sdk/cart/useBuyButton.ts +3 -3
  109. package/src/sdk/cart/useRemoveButton.ts +3 -3
  110. package/src/sdk/product/useProductGalleryQuery.ts +4 -5
  111. package/src/sdk/product/useProductLink.ts +5 -2
  112. package/src/sdk/search/Sentinel.tsx +3 -3
  113. package/src/sdk/search/useSuggestions.ts +1 -1
  114. package/.next/server/chunks/368.js +0 -1
  115. package/.next/server/chunks/8811.js +0 -1
  116. package/.next/server/chunks/9134.js +0 -1
  117. package/.next/static/S-n12r3ICzmxSZIG0sqmF/_buildManifest.js +0 -1
  118. package/.next/static/chunks/119.e218828b0132b8b2.js +0 -1
  119. package/.next/static/chunks/346-94f30a4bb6dafd89.js +0 -1
  120. package/.next/static/chunks/576.bd044c1cd3af7bbc.js +0 -1
  121. package/.next/static/chunks/app/fs-next-update/page-9a2debb5dd829908.js +0 -1
  122. package/.next/static/chunks/app/layout-a5723c7cfcca3bdf.js +0 -1
  123. package/.next/static/chunks/webpack-31f87692f808967d.js +0 -1
  124. /package/.next/static/{S-n12r3ICzmxSZIG0sqmF → DBfTJ0pmM5XIMOqyQAgU7}/_ssgManifest.js +0 -0
  125. /package/.next/static/chunks/{503-e6db8cab6eb3bf60.js → 503-c781fed990b2a19d.js} +0 -0
  126. /package/.next/static/chunks/app/{_not-found-3649108cdca52b21.js → _not-found-2d32d7476da44280.js} +0 -0
  127. /package/.next/static/chunks/{fd9d1056-e4950b334bc218cf.js → fd9d1056-43c43818840d7811.js} +0 -0
  128. /package/.next/static/chunks/pages/[slug]/{p-436d394ddc268573.js → p-003fd9d91eec1798.js} +0 -0
  129. /package/{src → app}/components/ThirdPartyScripts/GoogleTagManager.tsx +0 -0
  130. /package/{src → app}/components/ThirdPartyScripts/ThirdPartyScripts.tsx +0 -0
  131. /package/{src → app}/components/ThirdPartyScripts/index.ts +0 -0
  132. /package/{src → app}/components/ThirdPartyScripts/vtex.tsx +0 -0
  133. /package/{src → app}/sdk/analytics/hooks/useViewItemListEvent.ts +0 -0
  134. /package/{src → app}/sdk/analytics/platform/vtex/index.ts +0 -0
  135. /package/{src → app}/sdk/analytics/platform/vtex/search.ts +0 -0
  136. /package/{src → app}/sdk/analytics/types.ts +0 -0
  137. /package/{src → app}/sdk/error/ErrorBoundary/index.ts +0 -0
  138. /package/{src → app}/utils/getCookie.ts +0 -0
@@ -33,8 +33,6 @@ warn - CustomIconsAlert not found. Add a new component for this section or remov
33
33
  warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
34
34
  warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
35
35
 
36
36
  Generating static pages (4/9)
37
- warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
38
- warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
39
37
  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.
40
38
  warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
41
39
  warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
@@ -42,6 +40,8 @@ warn - CustomIconsAlert not found. Add a new component for this section or remov
42
40
  warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
43
41
  warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
44
42
  warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
43
+ warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
44
+ warn - AlertWithImage not found. Add a new component for this section or remove it from the CMS
45
45
  warn - CustomIconsAlert not found. Add a new component for this section or remove it from the CMS
46
46
 
47
47
  ✓ Generating static pages (9/9)
48
48
  Finalizing page optimization ...
@@ -49,15 +49,15 @@ warn - CustomIconsAlert not found. Add a new component for this section or remov
49
49
 
50
50
  Route (app) Size First Load JS
51
51
  ┌ ○ /_not-found 875 B 83 kB
52
- └ ○ /fs-next-update 142 B 82.3 kB
53
- + First Load JS shared by all 82.1 kB
54
- ├ chunks/503-e6db8cab6eb3bf60.js 28.4 kB
55
- ├ chunks/fd9d1056-e4950b334bc218cf.js 51.1 kB
52
+ └ ○ /fs-next-update 138 B 82.3 kB
53
+ + First Load JS shared by all 82.2 kB
54
+ ├ chunks/503-c781fed990b2a19d.js 28.4 kB
55
+ ├ chunks/fd9d1056-43c43818840d7811.js 51.1 kB
56
56
  ├ chunks/main-app-7b31a9960d0fa675.js 232 B
57
- └ chunks/webpack-31f87692f808967d.js 2.45 kB
57
+ └ chunks/webpack-9f1c9c7cf9345782.js 2.45 kB
58
58
 
59
59
  Route (pages) Size First Load JS
60
- ┌ ● / 3.39 kB 144 kB
60
+ ┌ ● / 3.38 kB 144 kB
61
61
  ├ └ css/6ce7302d311d7d68.css 6.57 kB
62
62
  ├ /_app 0 B 93.5 kB
63
63
  ├ ● /[...slug] 4.5 kB 156 kB
@@ -72,13 +72,13 @@ Route (pages) Size First Load JS
72
72
  ├ λ /api/health/ready 0 B 93.5 kB
73
73
  ├ λ /api/preview 0 B 93.5 kB
74
74
  ├ ● /checkout 660 B 126 kB
75
- ├ ● /login 1.58 kB 127 kB
75
+ ├ ● /login 1.59 kB 127 kB
76
76
  └ ● /s 4.97 kB 141 kB
77
77
  + First Load JS shared by all 96.5 kB
78
78
  ├ chunks/framework-21e9365486ba23a6.js 45.4 kB
79
79
  ├ chunks/main-5e45f8a409e3ce1c.js 33.1 kB
80
- ├ chunks/pages/_app-88eac41033b6a613.js 12.6 kB
81
- ├ chunks/webpack-31f87692f808967d.js 2.45 kB
80
+ ├ chunks/pages/_app-ddcbec71774555c4.js 12.6 kB
81
+ ├ chunks/webpack-9f1c9c7cf9345782.js 2.45 kB
82
82
  └ css/5d1f64b61ea581f4.css 3.05 kB
83
83
 
84
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 (26.656 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 (9 ms)
6
- ✓ should return a valid GraphQL schema contain all expected types (27 ms)
5
+ ✓ should return a valid GraphQL schema (10 ms)
6
+ ✓ should return a valid GraphQL schema contain all expected types (19 ms)
7
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 (12 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 (42 ms)
14
+ ✓ should return a valid merged GraphQL schema (30 ms)
15
15
  Envelop
16
- ✓ should exist with its plugins (60 ms)
17
- ✓ should handle options and execute (207 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: 26.762 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.48",
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": "b9f3d0a140309be1a31e17a15890403bc6f5ea36"
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 {
@@ -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})})}}};