@faststore/core 2.1.84 → 2.1.87
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.
- package/.turbo/turbo-build.log +2 -2
- package/faststore.config.js +1 -1
- package/package.json +2 -2
- package/src/sdk/analytics/platform/vtex/search.ts +15 -11
- package/src/utils/getCookie.ts +14 -0
- package/.next/BUILD_ID +0 -1
- package/.next/build-manifest.json +0 -129
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/config.json +0 -7
- package/.next/cache/eslint/.cache_1gneedd +0 -1
- package/.next/cache/next-server.js.nft.json +0 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/export-marker.json +0 -1
- package/.next/images-manifest.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -1
- package/.next/react-loadable-manifest.json +0 -44
- package/.next/required-server-files.json +0 -1
- package/.next/routes-manifest.json +0 -1
- package/.next/server/chunks/143.js +0 -106
- package/.next/server/chunks/177.js +0 -120
- package/.next/server/chunks/183.js +0 -94
- package/.next/server/chunks/184.js +0 -61
- package/.next/server/chunks/186.js +0 -113
- package/.next/server/chunks/289.js +0 -239
- package/.next/server/chunks/312.js +0 -697
- package/.next/server/chunks/350.js +0 -143
- package/.next/server/chunks/483.js +0 -650
- package/.next/server/chunks/487.js +0 -9142
- package/.next/server/chunks/53.js +0 -61
- package/.next/server/chunks/530.js +0 -626
- package/.next/server/chunks/576.js +0 -94
- package/.next/server/chunks/650.js +0 -9142
- package/.next/server/chunks/676.js +0 -32
- package/.next/server/chunks/693.js +0 -58
- package/.next/server/chunks/71.js +0 -1254
- package/.next/server/chunks/74.js +0 -4065
- package/.next/server/chunks/753.js +0 -509
- package/.next/server/chunks/779.js +0 -58
- package/.next/server/chunks/825.js +0 -4039
- package/.next/server/chunks/854.js +0 -72
- package/.next/server/chunks/859.js +0 -959
- package/.next/server/chunks/907.js +0 -1911
- package/.next/server/chunks/933.js +0 -517
- package/.next/server/chunks/98.js +0 -124
- package/.next/server/chunks/988.js +0 -211
- package/.next/server/chunks/font-manifest.json +0 -1
- package/.next/server/font-manifest.json +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/pages/404.js +0 -386
- package/.next/server/pages/404.js.nft.json +0 -1
- package/.next/server/pages/500.js +0 -388
- package/.next/server/pages/500.js.nft.json +0 -1
- package/.next/server/pages/[...slug].js +0 -1005
- package/.next/server/pages/[...slug].js.nft.json +0 -1
- package/.next/server/pages/[slug]/p.js +0 -2269
- package/.next/server/pages/[slug]/p.js.nft.json +0 -1
- package/.next/server/pages/_app.js +0 -280
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -374
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -164
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages/account.js +0 -363
- package/.next/server/pages/account.js.nft.json +0 -1
- package/.next/server/pages/api/graphql.js +0 -365
- package/.next/server/pages/api/graphql.js.nft.json +0 -1
- package/.next/server/pages/api/health/live.js +0 -31
- package/.next/server/pages/api/health/live.js.nft.json +0 -1
- package/.next/server/pages/api/health/ready.js +0 -31
- package/.next/server/pages/api/health/ready.js.nft.json +0 -1
- package/.next/server/pages/api/preview.js +0 -148
- package/.next/server/pages/api/preview.js.nft.json +0 -1
- package/.next/server/pages/checkout.js +0 -363
- package/.next/server/pages/checkout.js.nft.json +0 -1
- package/.next/server/pages/en-US/404.html +0 -81
- package/.next/server/pages/en-US/404.json +0 -1
- package/.next/server/pages/en-US/500.html +0 -81
- package/.next/server/pages/en-US/500.json +0 -1
- package/.next/server/pages/en-US/account.html +0 -81
- package/.next/server/pages/en-US/account.json +0 -1
- package/.next/server/pages/en-US/checkout.html +0 -81
- package/.next/server/pages/en-US/checkout.json +0 -1
- package/.next/server/pages/en-US/login.html +0 -81
- package/.next/server/pages/en-US/login.json +0 -1
- package/.next/server/pages/en-US/s.html +0 -81
- package/.next/server/pages/en-US/s.json +0 -1
- package/.next/server/pages/en-US.html +0 -81
- package/.next/server/pages/en-US.json +0 -1
- package/.next/server/pages/index.js +0 -439
- package/.next/server/pages/index.js.nft.json +0 -1
- package/.next/server/pages/login.js +0 -368
- package/.next/server/pages/login.js.nft.json +0 -1
- package/.next/server/pages/s.js +0 -466
- package/.next/server/pages/s.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -18
- package/.next/server/webpack-api-runtime.js +0 -229
- package/.next/server/webpack-runtime.js +0 -229
- package/.next/static/UFCNzAvjHLcTNmP8sQK5l/_buildManifest.js +0 -1
- package/.next/static/UFCNzAvjHLcTNmP8sQK5l/_ssgManifest.js +0 -1
- package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
- package/.next/static/chunks/148.582eaa81293ee470.js +0 -1
- package/.next/static/chunks/238-39630714f5d70169.js +0 -1
- package/.next/static/chunks/243-b4f8e506d156ee41.js +0 -1
- package/.next/static/chunks/530.ec68de379130c11e.js +0 -1
- package/.next/static/chunks/548-4ee971bf7bdb3e81.js +0 -1
- package/.next/static/chunks/603-072c8fb73ac35775.js +0 -1
- package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
- package/.next/static/chunks/709.7bc5a25ce30abda6.js +0 -1
- package/.next/static/chunks/738-a5ff304828f20cbf.js +0 -1
- package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
- package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
- package/.next/static/chunks/988.afda042dd9ba11d1.js +0 -1
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
- package/.next/static/chunks/main-fd466221927468fd.js +0 -1
- package/.next/static/chunks/pages/404-af78f7cd1d3c1f60.js +0 -1
- package/.next/static/chunks/pages/500-f6346ca5f9dc4fef.js +0 -1
- package/.next/static/chunks/pages/[...slug]-3f4e5f74ff9436ec.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-8e20c206fb84d184.js +0 -1
- package/.next/static/chunks/pages/_app-895781b1c7b5bf56.js +0 -1
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
- package/.next/static/chunks/pages/account-05bd79fb78365e88.js +0 -1
- package/.next/static/chunks/pages/checkout-c973786e68f25a39.js +0 -1
- package/.next/static/chunks/pages/index-73110361a184aa10.js +0 -1
- package/.next/static/chunks/pages/login-8deb9243376b6aa1.js +0 -1
- package/.next/static/chunks/pages/s-94691e1fdc9521a4.js +0 -1
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
- package/.next/static/chunks/webpack-504557a0a7373460.js +0 -1
- package/.next/static/css/20e4a3a45cdd65f4.css +0 -1
- package/.next/static/css/4b7138899cd07c63.css +0 -1
- package/.next/static/css/527e334fa69cf40a.css +0 -1
- package/.next/static/css/6e1a7434f061d0ef.css +0 -1
- package/.next/static/css/9e76fef1c9ca89af.css +0 -1
- package/.next/static/css/a2eefb25a4608343.css +0 -1
- package/.next/static/css/cb7d1fcea42fab9c.css +0 -1
- package/.next/static/css/df588bb98c0b0ca6.css +0 -1
- package/.next/static/css/e3b039e8f5daf95f.css +0 -1
- package/.next/static/css/f0e2d1b8832e935d.css +0 -1
- package/.next/trace +0 -80
- package/public/~partytown/debug/partytown-atomics.js +0 -556
- package/public/~partytown/debug/partytown-media.js +0 -374
- package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
- package/public/~partytown/debug/partytown-sw.js +0 -59
- package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
- package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
- package/public/~partytown/debug/partytown.js +0 -72
- package/public/~partytown/partytown-atomics.js +0 -2
- package/public/~partytown/partytown-media.js +0 -2
- package/public/~partytown/partytown-sw.js +0 -2
- package/public/~partytown/partytown.js +0 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -40,8 +40,8 @@ Route (pages) Size First Load JS
|
|
|
40
40
|
+ First Load JS shared by all 81 kB
|
|
41
41
|
├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
|
|
42
42
|
├ chunks/main-fd466221927468fd.js 23.9 kB
|
|
43
|
-
├ chunks/pages/_app-
|
|
44
|
-
├ chunks/webpack-
|
|
43
|
+
├ chunks/pages/_app-6d0e6ab9a4dd8106.js 6.45 kB
|
|
44
|
+
├ chunks/webpack-352e624909554726.js 2.29 kB
|
|
45
45
|
└ css/9e76fef1c9ca89af.css 3.06 kB
|
|
46
46
|
|
|
47
47
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/faststore.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.87",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"browserslist": "supports es6-module and not dead",
|
|
6
6
|
"scripts": {
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"msw": {
|
|
111
111
|
"workerDirectory": "public"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "d554a6382827ae7f8e5eaa03d55f6873eb0f2d11"
|
|
114
114
|
}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* More info at: https://www.notion.so/vtexhandbook/Event-API-Documentation-48eee26730cf4d7f80f8fd7262231f84
|
|
3
3
|
*/
|
|
4
4
|
import type { AnalyticsEvent } from '@faststore/sdk'
|
|
5
|
+
import type { SearchSelectItemEvent } from '../../types'
|
|
5
6
|
|
|
6
7
|
import config from '../../../../../faststore.config'
|
|
7
|
-
import
|
|
8
|
+
import { getCookie } from '../../../../utils/getCookie'
|
|
8
9
|
|
|
9
10
|
const THIRTY_MINUTES_S = 30 * 60
|
|
10
11
|
const ONE_YEAR_S = 365 * 24 * 3600
|
|
@@ -14,27 +15,30 @@ const randomUUID = () =>
|
|
|
14
15
|
? crypto.randomUUID()
|
|
15
16
|
: (Math.random() * 1e6).toFixed(0)
|
|
16
17
|
|
|
17
|
-
const
|
|
18
|
-
|
|
18
|
+
const createCookie = (key: string, expiresSecond: number) => {
|
|
19
|
+
// Setting the domain attribute specifies which host can receive it; we need it to make the cookies available on the `secure` subdomain.
|
|
20
|
+
// Although https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie mentioned leading dot (.) is not needed and ignored. I couldn't set the cookies without it.
|
|
21
|
+
const urlDomain = `.${new URL(config.storeUrl).hostname}`
|
|
19
22
|
|
|
20
23
|
return () => {
|
|
21
|
-
const
|
|
22
|
-
const isExpired = !item || timelapsed(item.createdAt) > expiresSecond
|
|
23
|
-
const payload: string = isExpired ? randomUUID() : item.payload
|
|
24
|
+
const isExpired = getCookie(key) === undefined
|
|
24
25
|
|
|
25
26
|
if (isExpired) {
|
|
26
|
-
const
|
|
27
|
+
const value = randomUUID()
|
|
28
|
+
|
|
29
|
+
document.cookie = `${key}=${value}; max-age=${expiresSecond}; domain=${urlDomain}; path=/;`
|
|
30
|
+
// Setting the `path=/` makes the cookie accessible on any path of the domain/subdomain
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
return value
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
return
|
|
35
|
+
return getCookie(key)
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
const user = {
|
|
36
|
-
anonymous:
|
|
37
|
-
session:
|
|
40
|
+
anonymous: createCookie('vtex-faststore-anonymous', ONE_YEAR_S),
|
|
41
|
+
session: createCookie('vtex-faststore-session', THIRTY_MINUTES_S),
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
type SearchEvent =
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function getCookie(name: string): string | undefined {
|
|
2
|
+
const cookieString = decodeURIComponent(document.cookie)
|
|
3
|
+
const cookies = cookieString.split(';')
|
|
4
|
+
|
|
5
|
+
for (const cookie of cookies) {
|
|
6
|
+
const [cookieName, cookieValue] = cookie.trim().split('=')
|
|
7
|
+
|
|
8
|
+
if (cookieName === name) {
|
|
9
|
+
return cookieValue
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return undefined // Cookie not found
|
|
14
|
+
}
|
package/.next/BUILD_ID
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
UFCNzAvjHLcTNmP8sQK5l
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"polyfillFiles": [
|
|
3
|
-
"static/chunks/polyfills-c67a75d1b6f99dc8.js"
|
|
4
|
-
],
|
|
5
|
-
"devFiles": [],
|
|
6
|
-
"ampDevFiles": [],
|
|
7
|
-
"lowPriorityFiles": [
|
|
8
|
-
"static/UFCNzAvjHLcTNmP8sQK5l/_buildManifest.js",
|
|
9
|
-
"static/UFCNzAvjHLcTNmP8sQK5l/_ssgManifest.js"
|
|
10
|
-
],
|
|
11
|
-
"rootMainFiles": [],
|
|
12
|
-
"pages": {
|
|
13
|
-
"/": [
|
|
14
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
15
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
16
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
17
|
-
"static/chunks/738-a5ff304828f20cbf.js",
|
|
18
|
-
"static/chunks/548-4ee971bf7bdb3e81.js",
|
|
19
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
20
|
-
"static/chunks/243-b4f8e506d156ee41.js",
|
|
21
|
-
"static/css/20e4a3a45cdd65f4.css",
|
|
22
|
-
"static/chunks/238-39630714f5d70169.js",
|
|
23
|
-
"static/css/a2eefb25a4608343.css",
|
|
24
|
-
"static/chunks/pages/index-73110361a184aa10.js"
|
|
25
|
-
],
|
|
26
|
-
"/404": [
|
|
27
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
28
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
29
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
30
|
-
"static/chunks/738-a5ff304828f20cbf.js",
|
|
31
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
32
|
-
"static/chunks/243-b4f8e506d156ee41.js",
|
|
33
|
-
"static/css/df588bb98c0b0ca6.css",
|
|
34
|
-
"static/chunks/pages/404-af78f7cd1d3c1f60.js"
|
|
35
|
-
],
|
|
36
|
-
"/500": [
|
|
37
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
38
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
39
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
40
|
-
"static/chunks/738-a5ff304828f20cbf.js",
|
|
41
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
42
|
-
"static/chunks/243-b4f8e506d156ee41.js",
|
|
43
|
-
"static/css/df588bb98c0b0ca6.css",
|
|
44
|
-
"static/chunks/pages/500-f6346ca5f9dc4fef.js"
|
|
45
|
-
],
|
|
46
|
-
"/[...slug]": [
|
|
47
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
48
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
49
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
50
|
-
"static/chunks/738-a5ff304828f20cbf.js",
|
|
51
|
-
"static/chunks/548-4ee971bf7bdb3e81.js",
|
|
52
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
53
|
-
"static/chunks/243-b4f8e506d156ee41.js",
|
|
54
|
-
"static/css/20e4a3a45cdd65f4.css",
|
|
55
|
-
"static/chunks/238-39630714f5d70169.js",
|
|
56
|
-
"static/css/f0e2d1b8832e935d.css",
|
|
57
|
-
"static/chunks/603-072c8fb73ac35775.js",
|
|
58
|
-
"static/css/a2eefb25a4608343.css",
|
|
59
|
-
"static/css/527e334fa69cf40a.css",
|
|
60
|
-
"static/chunks/pages/[...slug]-3f4e5f74ff9436ec.js"
|
|
61
|
-
],
|
|
62
|
-
"/[slug]/p": [
|
|
63
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
64
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
65
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
66
|
-
"static/chunks/738-a5ff304828f20cbf.js",
|
|
67
|
-
"static/chunks/548-4ee971bf7bdb3e81.js",
|
|
68
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
69
|
-
"static/chunks/243-b4f8e506d156ee41.js",
|
|
70
|
-
"static/css/20e4a3a45cdd65f4.css",
|
|
71
|
-
"static/chunks/238-39630714f5d70169.js",
|
|
72
|
-
"static/css/4b7138899cd07c63.css",
|
|
73
|
-
"static/chunks/pages/[slug]/p-8e20c206fb84d184.js"
|
|
74
|
-
],
|
|
75
|
-
"/_app": [
|
|
76
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
77
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
78
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
79
|
-
"static/css/9e76fef1c9ca89af.css",
|
|
80
|
-
"static/chunks/pages/_app-895781b1c7b5bf56.js"
|
|
81
|
-
],
|
|
82
|
-
"/_error": [
|
|
83
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
84
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
85
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
86
|
-
"static/chunks/pages/_error-a7a0c1d9bfbb4f38.js"
|
|
87
|
-
],
|
|
88
|
-
"/account": [
|
|
89
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
90
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
91
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
92
|
-
"static/chunks/738-a5ff304828f20cbf.js",
|
|
93
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
94
|
-
"static/chunks/243-b4f8e506d156ee41.js",
|
|
95
|
-
"static/chunks/pages/account-05bd79fb78365e88.js"
|
|
96
|
-
],
|
|
97
|
-
"/checkout": [
|
|
98
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
99
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
100
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
101
|
-
"static/chunks/738-a5ff304828f20cbf.js",
|
|
102
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
103
|
-
"static/chunks/243-b4f8e506d156ee41.js",
|
|
104
|
-
"static/chunks/pages/checkout-c973786e68f25a39.js"
|
|
105
|
-
],
|
|
106
|
-
"/login": [
|
|
107
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
108
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
109
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
110
|
-
"static/chunks/738-a5ff304828f20cbf.js",
|
|
111
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
112
|
-
"static/chunks/243-b4f8e506d156ee41.js",
|
|
113
|
-
"static/css/df588bb98c0b0ca6.css",
|
|
114
|
-
"static/chunks/pages/login-8deb9243376b6aa1.js"
|
|
115
|
-
],
|
|
116
|
-
"/s": [
|
|
117
|
-
"static/chunks/webpack-504557a0a7373460.js",
|
|
118
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
119
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
120
|
-
"static/chunks/738-a5ff304828f20cbf.js",
|
|
121
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
122
|
-
"static/chunks/243-b4f8e506d156ee41.js",
|
|
123
|
-
"static/css/f0e2d1b8832e935d.css",
|
|
124
|
-
"static/chunks/603-072c8fb73ac35775.js",
|
|
125
|
-
"static/chunks/pages/s-94691e1fdc9521a4.js"
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
"ampFirstPages": []
|
|
129
|
-
}
|