@akinon/projectzero 2.0.34-rc.0 → 2.0.34
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/CHANGELOG.md +1 -7
- package/app-template/.env.example +5 -1
- package/app-template/AGENTS.md +0 -8
- package/app-template/CHANGELOG.md +33 -74
- package/app-template/README.md +1 -25
- package/app-template/next.config.mjs +1 -7
- package/app-template/package.json +41 -41
- package/app-template/public/locales/en/product.json +3 -1
- package/app-template/public/locales/tr/product.json +3 -1
- package/app-template/src/app/[pz]/template.tsx +2 -0
- package/app-template/src/app/api/virtual-try-on/limited-categories/route.ts +1 -1
- package/app-template/src/app/api/virtual-try-on/route.ts +6 -1
- package/app-template/src/components/datalayer-observer.tsx +169 -0
- package/app-template/src/hooks/index.ts +0 -2
- package/app-template/src/plugins.js +0 -1
- package/app-template/src/proxy.ts +1 -2
- package/app-template/src/views/header/search/index.tsx +5 -13
- package/app-template/src/views/product/slider.tsx +38 -85
- package/commands/plugins.ts +0 -4
- package/dist/commands/plugins.js +0 -4
- package/package.json +1 -1
- package/app-template/src/app/global-error.tsx +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
# @akinon/projectzero
|
|
2
2
|
|
|
3
|
-
## 2.0.34
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
|
|
8
|
-
- d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
|
|
9
|
-
- e18836b20: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
|
|
3
|
+
## 2.0.34
|
|
10
4
|
|
|
11
5
|
## 2.0.33
|
|
12
6
|
|
|
@@ -7,7 +7,11 @@ NEXT_PUBLIC_URL=http://localhost:3000
|
|
|
7
7
|
SERVICE_BACKEND_URL=https://02fde10fee4440269e695aa10707dfaf.lb.akinoncloud.com
|
|
8
8
|
SITEMAP_S3_BUCKET_NAME=0fb534
|
|
9
9
|
NEXT_PUBLIC_VIRTUAL_TRY_ON_API_URL=https://d2a26507c7094f359aba349b96a96881.lb.akinoncloud.com
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
# PZ Dashboard dataLayer observability (unset = observer disabled)
|
|
12
|
+
# NEXT_PUBLIC_PZ_DASHBOARD_URL=http://localhost:3005
|
|
13
|
+
# NEXT_PUBLIC_PZ_PROJECT_NAME=projectzeronext
|
|
14
|
+
# NEXT_PUBLIC_PZ_DATALAYER_SAMPLE=1
|
|
11
15
|
|
|
12
16
|
# LOG_LEVEL_DEV=debug # For more details, please refer to the Logging documentation.
|
|
13
17
|
|
package/app-template/AGENTS.md
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
<!-- BEGIN:nextjs-agent-rules -->
|
|
2
|
-
|
|
3
|
-
# Next.js: ALWAYS read docs before coding
|
|
4
|
-
|
|
5
|
-
Before any Next.js work, find and read the relevant doc in `node_modules/next/dist/docs/`. Your training data is outdated — the docs are the source of truth.
|
|
6
|
-
|
|
7
|
-
<!-- END:nextjs-agent-rules -->
|
|
8
|
-
|
|
9
1
|
# Project Zero Next.js - Developer Instructions
|
|
10
2
|
|
|
11
3
|
## 📚 Available Instruction Files
|
|
@@ -1,79 +1,38 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
-
## 2.0.34
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
- Updated dependencies [9db81a71]
|
|
37
|
-
- Updated dependencies [591e345e]
|
|
38
|
-
- Updated dependencies [0df6bc1f8]
|
|
39
|
-
- Updated dependencies [4de5303c5]
|
|
40
|
-
- Updated dependencies [63a72000]
|
|
41
|
-
- Updated dependencies [95b139dc]
|
|
42
|
-
- Updated dependencies [1d00f2d0]
|
|
43
|
-
- Updated dependencies [4ac7b2a1e]
|
|
44
|
-
- Updated dependencies [4998a9631]
|
|
45
|
-
- Updated dependencies [804d2bd6]
|
|
46
|
-
- Updated dependencies [c0228aff0]
|
|
47
|
-
- Updated dependencies [3909d3224]
|
|
48
|
-
- Updated dependencies [6a3d8a63]
|
|
49
|
-
- Updated dependencies [e18836b20]
|
|
50
|
-
- @akinon/pz-tabby-extension@2.0.34-rc.0
|
|
51
|
-
- @akinon/next@2.0.34-rc.0
|
|
52
|
-
- @akinon/pz-checkout-gift-pack@2.0.34-rc.0
|
|
53
|
-
- @akinon/pz-one-click-checkout@2.0.34-rc.0
|
|
54
|
-
- @akinon/pz-basket-gift-pack@2.0.34-rc.0
|
|
55
|
-
- @akinon/pz-masterpass-rest@2.0.34-rc.0
|
|
56
|
-
- @akinon/pz-pay-on-delivery@2.0.34-rc.0
|
|
57
|
-
- @akinon/pz-credit-payment@2.0.34-rc.0
|
|
58
|
-
- @akinon/pz-click-collect@2.0.34-rc.0
|
|
59
|
-
- @akinon/pz-multi-basket@2.0.34-rc.0
|
|
60
|
-
- @akinon/pz-masterpass@2.0.34-rc.0
|
|
61
|
-
- @akinon/pz-gpay@2.0.34-rc.0
|
|
62
|
-
- @akinon/pz-b2b@2.0.34-rc.0
|
|
63
|
-
- @akinon/pz-bkm@2.0.34-rc.0
|
|
64
|
-
- @akinon/pz-otp@2.0.34-rc.0
|
|
65
|
-
- @akinon/pz-similar-products@2.0.34-rc.0
|
|
66
|
-
- @akinon/pz-virtual-try-on@2.0.34-rc.0
|
|
67
|
-
- @akinon/pz-theme@2.0.34-rc.0
|
|
68
|
-
- @akinon/pz-akifast@2.0.34-rc.0
|
|
69
|
-
- @akinon/pz-apple-pay@2.0.34-rc.0
|
|
70
|
-
- @akinon/pz-cybersource-uc@2.0.34-rc.0
|
|
71
|
-
- @akinon/pz-flow-payment@2.0.34-rc.0
|
|
72
|
-
- @akinon/pz-google-pay@2.0.34-rc.0
|
|
73
|
-
- @akinon/pz-haso@2.0.34-rc.0
|
|
74
|
-
- @akinon/pz-hepsipay@2.0.34-rc.0
|
|
75
|
-
- @akinon/pz-saved-card@2.0.34-rc.0
|
|
76
|
-
- @akinon/pz-tamara-extension@2.0.34-rc.0
|
|
3
|
+
## 2.0.34
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4e2ea16b: ZERO-4582: enhance virtual try-on functionality with single and async mutations
|
|
8
|
+
- Updated dependencies [4e2ea16b]
|
|
9
|
+
- @akinon/pz-virtual-try-on@2.0.34
|
|
10
|
+
- @akinon/next@2.0.34
|
|
11
|
+
- @akinon/pz-theme@2.0.34
|
|
12
|
+
- @akinon/pz-akifast@2.0.34
|
|
13
|
+
- @akinon/pz-apple-pay@2.0.34
|
|
14
|
+
- @akinon/pz-b2b@2.0.34
|
|
15
|
+
- @akinon/pz-basket-gift-pack@2.0.34
|
|
16
|
+
- @akinon/pz-bkm@2.0.34
|
|
17
|
+
- @akinon/pz-checkout-gift-pack@2.0.34
|
|
18
|
+
- @akinon/pz-click-collect@2.0.34
|
|
19
|
+
- @akinon/pz-credit-payment@2.0.34
|
|
20
|
+
- @akinon/pz-cybersource-uc@2.0.34
|
|
21
|
+
- @akinon/pz-flow-payment@2.0.34
|
|
22
|
+
- @akinon/pz-google-pay@2.0.34
|
|
23
|
+
- @akinon/pz-gpay@2.0.34
|
|
24
|
+
- @akinon/pz-haso@2.0.34
|
|
25
|
+
- @akinon/pz-hepsipay@2.0.34
|
|
26
|
+
- @akinon/pz-masterpass@2.0.34
|
|
27
|
+
- @akinon/pz-masterpass-rest@2.0.34
|
|
28
|
+
- @akinon/pz-multi-basket@2.0.34
|
|
29
|
+
- @akinon/pz-one-click-checkout@2.0.34
|
|
30
|
+
- @akinon/pz-otp@2.0.34
|
|
31
|
+
- @akinon/pz-pay-on-delivery@2.0.34
|
|
32
|
+
- @akinon/pz-saved-card@2.0.34
|
|
33
|
+
- @akinon/pz-similar-products@2.0.34
|
|
34
|
+
- @akinon/pz-tabby-extension@2.0.34
|
|
35
|
+
- @akinon/pz-tamara-extension@2.0.34
|
|
77
36
|
|
|
78
37
|
## 2.0.33
|
|
79
38
|
|
package/app-template/README.md
CHANGED
|
@@ -12,30 +12,6 @@ Run `cp .env.example .env && yarn` command at project root and all dependencies
|
|
|
12
12
|
|
|
13
13
|
- `SITEMAP_S3_BUCKET_NAME`: S3 bucket name for XML sitemaps (e.g., "0fb534"). This is required for the sitemap route to function correctly.
|
|
14
14
|
|
|
15
|
-
### Optional Environment Variables
|
|
16
|
-
|
|
17
|
-
- `NEXT_PUBLIC_ENABLE_IMAGE_SEARCH`: Set to `true` to enable image search feature for all users. If not set or `false`, the feature will only be visible to users who have enabled it via localStorage.
|
|
18
|
-
|
|
19
|
-
## Image Search Feature
|
|
20
|
-
|
|
21
|
-
The image search functionality allows users to search for similar products by uploading images or cropping existing product images.
|
|
22
|
-
|
|
23
|
-
### Feature Visibility Control
|
|
24
|
-
|
|
25
|
-
The image search feature can be controlled in two ways:
|
|
26
|
-
|
|
27
|
-
1. **Environment Variable (Global)**: Set `NEXT_PUBLIC_ENABLE_IMAGE_SEARCH=true` to enable for all users
|
|
28
|
-
2. **localStorage (Individual Users)**: Users can enable it locally using browser developer tools
|
|
29
|
-
|
|
30
|
-
````
|
|
31
|
-
|
|
32
|
-
### Feature Locations
|
|
33
|
-
|
|
34
|
-
When enabled, the image search feature appears in:
|
|
35
|
-
|
|
36
|
-
- **Header Search**: Camera icon next to the search input
|
|
37
|
-
- **Product Detail Page**: "View Similar Styles" button on product images
|
|
38
|
-
|
|
39
15
|
### Build
|
|
40
16
|
|
|
41
17
|
To build the app, run the following command:
|
|
@@ -43,7 +19,7 @@ To build the app, run the following command:
|
|
|
43
19
|
```bash
|
|
44
20
|
cd projectzeronext # Project root
|
|
45
21
|
yarn build
|
|
46
|
-
|
|
22
|
+
```
|
|
47
23
|
|
|
48
24
|
### Develop
|
|
49
25
|
|
|
@@ -38,9 +38,6 @@ const nextConfig = {
|
|
|
38
38
|
]
|
|
39
39
|
}
|
|
40
40
|
];
|
|
41
|
-
},
|
|
42
|
-
logging: {
|
|
43
|
-
browserToTerminal: 'error'
|
|
44
41
|
}
|
|
45
42
|
};
|
|
46
43
|
|
|
@@ -53,12 +50,9 @@ const withSerwist = withSerwistInit({
|
|
|
53
50
|
const sentryConfig = {
|
|
54
51
|
silent: true,
|
|
55
52
|
dryRun: !process.env.SENTRY_DSN,
|
|
56
|
-
org: 'akinon'
|
|
53
|
+
org: 'akinon'
|
|
57
54
|
// project: 'enter_your_project_name_here',
|
|
58
55
|
// authToken: 'enter_your_auth_token_here'
|
|
59
|
-
sourcemaps: {
|
|
60
|
-
deleteSourcemapsAfterUpload: true
|
|
61
|
-
}
|
|
62
56
|
};
|
|
63
57
|
|
|
64
58
|
const enhancedConfig = withPzConfig(nextConfig);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "2.0.34
|
|
3
|
+
"version": "2.0.34",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -24,33 +24,33 @@
|
|
|
24
24
|
"test:middleware": "jest middleware-matcher.test.ts --bail"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@akinon/next": "2.0.34
|
|
28
|
-
"@akinon/pz-akifast": "2.0.34
|
|
29
|
-
"@akinon/pz-apple-pay": "2.0.34
|
|
30
|
-
"@akinon/pz-b2b": "2.0.34
|
|
31
|
-
"@akinon/pz-basket-gift-pack": "2.0.34
|
|
32
|
-
"@akinon/pz-bkm": "2.0.34
|
|
33
|
-
"@akinon/pz-checkout-gift-pack": "2.0.34
|
|
34
|
-
"@akinon/pz-click-collect": "2.0.34
|
|
35
|
-
"@akinon/pz-credit-payment": "2.0.34
|
|
36
|
-
"@akinon/pz-cybersource-uc": "2.0.34
|
|
37
|
-
"@akinon/pz-flow-payment": "2.0.34
|
|
38
|
-
"@akinon/pz-google-pay": "2.0.34
|
|
39
|
-
"@akinon/pz-gpay": "2.0.34
|
|
40
|
-
"@akinon/pz-haso": "2.0.34
|
|
41
|
-
"@akinon/pz-hepsipay": "2.0.34
|
|
42
|
-
"@akinon/pz-masterpass": "2.0.34
|
|
43
|
-
"@akinon/pz-masterpass-rest": "2.0.34
|
|
44
|
-
"@akinon/pz-multi-basket": "2.0.34
|
|
45
|
-
"@akinon/pz-one-click-checkout": "2.0.34
|
|
46
|
-
"@akinon/pz-otp": "2.0.34
|
|
47
|
-
"@akinon/pz-pay-on-delivery": "2.0.34
|
|
48
|
-
"@akinon/pz-saved-card": "2.0.34
|
|
49
|
-
"@akinon/pz-similar-products": "2.0.34
|
|
50
|
-
"@akinon/pz-tabby-extension": "2.0.34
|
|
51
|
-
"@akinon/pz-tamara-extension": "2.0.34
|
|
52
|
-
"@akinon/pz-theme": "2.0.34
|
|
53
|
-
"@akinon/pz-virtual-try-on": "2.0.34
|
|
27
|
+
"@akinon/next": "2.0.34",
|
|
28
|
+
"@akinon/pz-akifast": "2.0.34",
|
|
29
|
+
"@akinon/pz-apple-pay": "2.0.34",
|
|
30
|
+
"@akinon/pz-b2b": "2.0.34",
|
|
31
|
+
"@akinon/pz-basket-gift-pack": "2.0.34",
|
|
32
|
+
"@akinon/pz-bkm": "2.0.34",
|
|
33
|
+
"@akinon/pz-checkout-gift-pack": "2.0.34",
|
|
34
|
+
"@akinon/pz-click-collect": "2.0.34",
|
|
35
|
+
"@akinon/pz-credit-payment": "2.0.34",
|
|
36
|
+
"@akinon/pz-cybersource-uc": "2.0.34",
|
|
37
|
+
"@akinon/pz-flow-payment": "2.0.34",
|
|
38
|
+
"@akinon/pz-google-pay": "2.0.34",
|
|
39
|
+
"@akinon/pz-gpay": "2.0.34",
|
|
40
|
+
"@akinon/pz-haso": "2.0.34",
|
|
41
|
+
"@akinon/pz-hepsipay": "2.0.34",
|
|
42
|
+
"@akinon/pz-masterpass": "2.0.34",
|
|
43
|
+
"@akinon/pz-masterpass-rest": "2.0.34",
|
|
44
|
+
"@akinon/pz-multi-basket": "2.0.34",
|
|
45
|
+
"@akinon/pz-one-click-checkout": "2.0.34",
|
|
46
|
+
"@akinon/pz-otp": "2.0.34",
|
|
47
|
+
"@akinon/pz-pay-on-delivery": "2.0.34",
|
|
48
|
+
"@akinon/pz-saved-card": "2.0.34",
|
|
49
|
+
"@akinon/pz-similar-products": "2.0.34",
|
|
50
|
+
"@akinon/pz-tabby-extension": "2.0.34",
|
|
51
|
+
"@akinon/pz-tamara-extension": "2.0.34",
|
|
52
|
+
"@akinon/pz-theme": "2.0.34",
|
|
53
|
+
"@akinon/pz-virtual-try-on": "2.0.34",
|
|
54
54
|
"@hookform/resolvers": "2.9.0",
|
|
55
55
|
"@next/third-parties": "16.2.6",
|
|
56
56
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"next": "16.2.6",
|
|
60
60
|
"@serwist/next": "9.5.11",
|
|
61
61
|
"next-auth": "5.0.0-beta.30",
|
|
62
|
-
"pino": "8.
|
|
62
|
+
"pino": "8.11.0",
|
|
63
63
|
"serwist": "9.5.11",
|
|
64
64
|
"postcss": "8.4.49",
|
|
65
65
|
"react": "19.2.5",
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"react-google-recaptcha": "2.1.0",
|
|
68
68
|
"react-hook-form": "7.71.2",
|
|
69
69
|
"react-intersection-observer": "9.4.0",
|
|
70
|
-
"react-multi-carousel": "2.8.
|
|
71
|
-
"react-string-replace": "1.1.
|
|
72
|
-
"start-server-and-test": "2.0.
|
|
73
|
-
"tailwind-merge": "1.
|
|
70
|
+
"react-multi-carousel": "2.8.4",
|
|
71
|
+
"react-string-replace": "1.1.0",
|
|
72
|
+
"start-server-and-test": "2.0.3",
|
|
73
|
+
"tailwind-merge": "1.8.0",
|
|
74
74
|
"yup": "0.32.11"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@akinon/eslint-plugin-projectzero": "2.0.34
|
|
77
|
+
"@akinon/eslint-plugin-projectzero": "2.0.34",
|
|
78
78
|
"@semantic-release/changelog": "6.0.2",
|
|
79
79
|
"@semantic-release/exec": "6.0.3",
|
|
80
80
|
"@semantic-release/git": "10.0.1",
|
|
@@ -89,25 +89,25 @@
|
|
|
89
89
|
"@types/react": "19.2.14",
|
|
90
90
|
"@types/react-dom": "19.2.3",
|
|
91
91
|
"client-only": "0.0.1",
|
|
92
|
-
"clsx": "1.
|
|
92
|
+
"clsx": "1.1.1",
|
|
93
93
|
"currency-symbol-map": "5.1.0",
|
|
94
94
|
"eslint": "9.39.4",
|
|
95
95
|
"eslint-config-next": "16.2.4",
|
|
96
96
|
"eslint-config-prettier": "10.1.1",
|
|
97
97
|
"husky": "8.0.0",
|
|
98
98
|
"jest": "29.7.0",
|
|
99
|
-
"jest-css-modules-transform": "4.
|
|
99
|
+
"jest-css-modules-transform": "4.3.0",
|
|
100
100
|
"jest-environment-jsdom": "29.7.0",
|
|
101
|
-
"lint-staged": "13.
|
|
102
|
-
"prettier": "2.
|
|
101
|
+
"lint-staged": "13.1.0",
|
|
102
|
+
"prettier": "2.6.2",
|
|
103
103
|
"react-number-format": "5.3.4",
|
|
104
|
-
"sass": "1.
|
|
104
|
+
"sass": "1.49.9",
|
|
105
105
|
"semantic-release": "19.0.5",
|
|
106
106
|
"server-only": "0.0.1",
|
|
107
|
-
"stylelint": "14.
|
|
107
|
+
"stylelint": "14.6.0",
|
|
108
108
|
"stylelint-config-sass-guidelines": "9.0.1",
|
|
109
109
|
"stylelint-config-standard": "25.0.0",
|
|
110
|
-
"stylelint-scss": "4.
|
|
110
|
+
"stylelint-scss": "4.2.0",
|
|
111
111
|
"stylelint-selector-bem-pattern": "2.1.1",
|
|
112
112
|
"tailwindcss": "4.2.0",
|
|
113
113
|
"ts-jest": "29.2.6",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"instructions": "Upload a clear photo of yourself for the best virtual try-on experience. Make sure you are facing the camera directly.",
|
|
52
52
|
"try_on": "Try On",
|
|
53
53
|
"virtual_cabin": "Virtual Cabin",
|
|
54
|
+
"usage_info": "Usage: {{used}}/{{limit}}",
|
|
54
55
|
"upload_info": "Your photo is used solely for generating the virtual try-on and is not stored permanently.",
|
|
55
56
|
"edit_photo": "Edit Photo",
|
|
56
57
|
"processing": "Processing...",
|
|
@@ -101,7 +102,8 @@
|
|
|
101
102
|
"change_photo": "Change",
|
|
102
103
|
"starting": "Starting...",
|
|
103
104
|
"will_start": "will start virtual try-on for",
|
|
104
|
-
"products_count": "products"
|
|
105
|
+
"products_count": "products",
|
|
106
|
+
"limit_exceeded": "You have reached the try-on limit for this product."
|
|
105
107
|
},
|
|
106
108
|
"barcode_scanner": {
|
|
107
109
|
"title": "Scan Barcode",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"processing_message": "En iyi sonucu sunabilmek için fotoğrafınızı işliyoruz. Lütfen bekleyiniz.",
|
|
58
58
|
"result_title": "Sanal Kabin Sonuç",
|
|
59
59
|
"virtual_cabin": "Sanal Kabin",
|
|
60
|
+
"usage_info": "Kullanım: {{used}}/{{limit}}",
|
|
60
61
|
"result_placeholder": "Sonucu görmek için fotoğrafınızı yükleyin",
|
|
61
62
|
"error": "Sanal deneme başarısız oldu. Lütfen tekrar deneyin.",
|
|
62
63
|
"error_message": "Modelin net bir şekilde göründüğü daha sade bir arka plana sahip görselle tekrar deneyin.",
|
|
@@ -103,7 +104,8 @@
|
|
|
103
104
|
"change_photo": "Değiştir",
|
|
104
105
|
"starting": "Başlatılıyor...",
|
|
105
106
|
"will_start": "için sanal deneme başlatılacak",
|
|
106
|
-
"products_count": "ürün"
|
|
107
|
+
"products_count": "ürün",
|
|
108
|
+
"limit_exceeded": "Bu ürün için deneme hakkınız doldu."
|
|
107
109
|
},
|
|
108
110
|
"barcode_scanner": {
|
|
109
111
|
"title": "Barkodu Okut",
|
|
@@ -9,6 +9,7 @@ import { ROUTES } from '@theme/routes';
|
|
|
9
9
|
import { GoogleTagManager } from '@next/third-parties/google';
|
|
10
10
|
import { pushPageView } from '@theme/utils/gtm';
|
|
11
11
|
import { serializeJsonLd } from '@theme/utils/generate-jsonld';
|
|
12
|
+
import { DataLayerObserver } from '@theme/components/datalayer-observer';
|
|
12
13
|
|
|
13
14
|
export default function RootTemplate({
|
|
14
15
|
children
|
|
@@ -62,6 +63,7 @@ export default function RootTemplate({
|
|
|
62
63
|
gtmId={process.env.NEXT_PUBLIC_GTM_KEY || 'GTM-W8JJWXD'}
|
|
63
64
|
/>
|
|
64
65
|
{/* End Google Tag Manager */}
|
|
66
|
+
<DataLayerObserver />
|
|
65
67
|
<script
|
|
66
68
|
type="application/ld+json"
|
|
67
69
|
dangerouslySetInnerHTML={{ __html: serializeJsonLd(jsonLdWebSite) }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { GET, POST, PUT, OPTIONS } from '@akinon/next/api/virtual-try-on';
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { auth } from 'auth';
|
|
2
|
+
import { createVirtualTryOnHandlers } from '@akinon/next/api/virtual-try-on';
|
|
3
|
+
|
|
4
|
+
export const { GET, POST, PUT, OPTIONS } = createVirtualTryOnHandlers({
|
|
5
|
+
auth
|
|
6
|
+
});
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { usePathname } from 'next/navigation';
|
|
5
|
+
import { ROUTES } from '@theme/routes';
|
|
6
|
+
|
|
7
|
+
const DASHBOARD_URL = process.env.NEXT_PUBLIC_PZ_DASHBOARD_URL;
|
|
8
|
+
const SERVICE = process.env.NEXT_PUBLIC_PZ_PROJECT_NAME || 'projectzeronext';
|
|
9
|
+
const SAMPLE_RATE = Number(process.env.NEXT_PUBLIC_PZ_DATALAYER_SAMPLE ?? '1');
|
|
10
|
+
|
|
11
|
+
// Sampling never drops these — the dashboard's silence alarms watch them.
|
|
12
|
+
const CRITICAL_EVENTS = ['purchase', 'begin_checkout'];
|
|
13
|
+
|
|
14
|
+
// Only these payload keys are forwarded; dataLayer objects can carry PII
|
|
15
|
+
// (email, phone) that must never leave the browser.
|
|
16
|
+
const PAYLOAD_WHITELIST = ['ecommerce', 'currency', 'value', 'items'];
|
|
17
|
+
|
|
18
|
+
const FLUSH_INTERVAL_MS = 10_000;
|
|
19
|
+
const MAX_BATCH = 200;
|
|
20
|
+
|
|
21
|
+
// GA4 ecommerce events imply the page type more reliably than the pretty
|
|
22
|
+
// URL (which only the backend can resolve to product/category).
|
|
23
|
+
const EVENT_PAGE_TYPES: Record<string, string> = {
|
|
24
|
+
view_item: 'pdp',
|
|
25
|
+
select_item: 'plp',
|
|
26
|
+
view_item_list: 'plp',
|
|
27
|
+
view_cart: 'basket',
|
|
28
|
+
begin_checkout: 'checkout',
|
|
29
|
+
add_shipping_info: 'checkout',
|
|
30
|
+
add_payment_info: 'checkout',
|
|
31
|
+
purchase: 'order-success'
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type QueuedEvent = {
|
|
35
|
+
event: string;
|
|
36
|
+
pageType: string;
|
|
37
|
+
pageUrl: string;
|
|
38
|
+
sessionId: string;
|
|
39
|
+
timestamp: number;
|
|
40
|
+
payload?: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const queue: QueuedEvent[] = [];
|
|
44
|
+
|
|
45
|
+
// The observer remounts with the app template on every route change and
|
|
46
|
+
// replays the persistent dataLayer array; this keeps replays idempotent.
|
|
47
|
+
const captured = new WeakSet<object>();
|
|
48
|
+
|
|
49
|
+
const resolvePageTypeFromPath = (pathname: string): string => {
|
|
50
|
+
if (pathname === ROUTES.HOME) return 'home';
|
|
51
|
+
if (pathname.startsWith(ROUTES.LIST)) return 'plp';
|
|
52
|
+
if (pathname.startsWith(ROUTES.BASKET)) return 'basket';
|
|
53
|
+
if (pathname.startsWith(ROUTES.CHECKOUT_COMPLETED)) return 'order-success';
|
|
54
|
+
if (pathname.startsWith(ROUTES.CHECKOUT)) return 'checkout';
|
|
55
|
+
if (pathname.startsWith('/account') || pathname.startsWith('/users')) {
|
|
56
|
+
return 'account';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return 'other';
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const getSessionId = () => {
|
|
63
|
+
try {
|
|
64
|
+
let id = sessionStorage.getItem('pz.dl.sid');
|
|
65
|
+
|
|
66
|
+
if (!id) {
|
|
67
|
+
id = crypto.randomUUID();
|
|
68
|
+
sessionStorage.setItem('pz.dl.sid', id);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return id;
|
|
72
|
+
} catch {
|
|
73
|
+
return 'no-session';
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const flush = () => {
|
|
78
|
+
if (!queue.length || !DASHBOARD_URL) return;
|
|
79
|
+
|
|
80
|
+
const events = queue.splice(0, MAX_BATCH);
|
|
81
|
+
const body = JSON.stringify({ service: SERVICE, events });
|
|
82
|
+
|
|
83
|
+
// String body → text/plain → no CORS preflight; survives page unload.
|
|
84
|
+
if (!navigator.sendBeacon(`${DASHBOARD_URL}/api/datalayer`, body)) {
|
|
85
|
+
fetch(`${DASHBOARD_URL}/api/datalayer`, {
|
|
86
|
+
method: 'POST',
|
|
87
|
+
body,
|
|
88
|
+
keepalive: true
|
|
89
|
+
}).catch(() => {
|
|
90
|
+
// Observability must never break the storefront.
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const DataLayerObserver = () => {
|
|
96
|
+
const pathname = usePathname();
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (!DASHBOARD_URL) return;
|
|
100
|
+
|
|
101
|
+
const sessionId = getSessionId();
|
|
102
|
+
// Deterministic per-session sampling: same session, same decision.
|
|
103
|
+
const sampled =
|
|
104
|
+
sessionId === 'no-session' ||
|
|
105
|
+
(parseInt(sessionId.slice(0, 8), 16) & 0xffff) / 0xffff < SAMPLE_RATE;
|
|
106
|
+
|
|
107
|
+
const capture = (item: unknown) => {
|
|
108
|
+
if (!item || typeof item !== 'object') return;
|
|
109
|
+
if (captured.has(item)) return;
|
|
110
|
+
captured.add(item);
|
|
111
|
+
const record = item as Record<string, unknown>;
|
|
112
|
+
if (typeof record.event !== 'string' || !record.event) return;
|
|
113
|
+
// GTM internals (gtm.js, gtm.dom, gtm.load...) are noise, not tags.
|
|
114
|
+
if (record.event.startsWith('gtm.')) return;
|
|
115
|
+
if (!sampled && !CRITICAL_EVENTS.includes(record.event)) return;
|
|
116
|
+
|
|
117
|
+
const payload: Record<string, unknown> = {};
|
|
118
|
+
PAYLOAD_WHITELIST.forEach((key) => {
|
|
119
|
+
if (record[key] !== undefined) payload[key] = record[key];
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
queue.push({
|
|
123
|
+
event: record.event,
|
|
124
|
+
pageType:
|
|
125
|
+
(typeof record.page_type === 'string' && record.page_type) ||
|
|
126
|
+
EVENT_PAGE_TYPES[record.event] ||
|
|
127
|
+
resolvePageTypeFromPath(window.location.pathname),
|
|
128
|
+
pageUrl: window.location.href,
|
|
129
|
+
sessionId,
|
|
130
|
+
timestamp: Date.now(),
|
|
131
|
+
payload: Object.keys(payload).length ? payload : undefined
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
window.dataLayer = window.dataLayer || [];
|
|
136
|
+
// Replay events pushed before the observer mounted (early page_views).
|
|
137
|
+
window.dataLayer.forEach(capture);
|
|
138
|
+
|
|
139
|
+
const original = window.dataLayer.push.bind(window.dataLayer);
|
|
140
|
+
window.dataLayer.push = (...items: unknown[]) => {
|
|
141
|
+
items.forEach(capture);
|
|
142
|
+
return original(...items);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const timer = setInterval(flush, FLUSH_INTERVAL_MS);
|
|
146
|
+
const onVisibilityChange = () => {
|
|
147
|
+
if (document.visibilityState === 'hidden') flush();
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
document.addEventListener('visibilitychange', onVisibilityChange);
|
|
151
|
+
window.addEventListener('pagehide', flush);
|
|
152
|
+
|
|
153
|
+
return () => {
|
|
154
|
+
clearInterval(timer);
|
|
155
|
+
document.removeEventListener('visibilitychange', onVisibilityChange);
|
|
156
|
+
window.removeEventListener('pagehide', flush);
|
|
157
|
+
window.dataLayer.push = original;
|
|
158
|
+
flush();
|
|
159
|
+
};
|
|
160
|
+
// Mount once; route changes are read from window.location at capture time.
|
|
161
|
+
}, []);
|
|
162
|
+
|
|
163
|
+
// Route change = fresh page view context; flush the previous page's batch.
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
flush();
|
|
166
|
+
}, [pathname]);
|
|
167
|
+
|
|
168
|
+
return null;
|
|
169
|
+
};
|
|
@@ -14,8 +14,7 @@ export const config = {
|
|
|
14
14
|
'/((?!api|_next|[\\w-\\/*]+\\.\\w+).*)',
|
|
15
15
|
'/(.*sitemap\\.xml)',
|
|
16
16
|
'/(.+\\.)(html|htm|aspx|asp|php)',
|
|
17
|
-
'/(.*orders\\/checkout-with-token.*)'
|
|
18
|
-
'/(.*orders\\/post-checkout.*)'
|
|
17
|
+
'/(.*orders\\/checkout-with-token.*)'
|
|
19
18
|
]
|
|
20
19
|
};
|
|
21
20
|
|
|
@@ -4,7 +4,8 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
4
4
|
import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
|
|
5
5
|
import { closeSearch } from '@akinon/next/redux/reducers/header';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { Icon } from '@theme/components';
|
|
8
9
|
import Results from './results';
|
|
9
10
|
import { ROUTES } from '@theme/routes';
|
|
10
11
|
import { useLocalization, useRouter } from '@akinon/next/hooks';
|
|
@@ -41,14 +42,6 @@ export default function Search() {
|
|
|
41
42
|
};
|
|
42
43
|
}, [isSearchOpen, dispatch]);
|
|
43
44
|
|
|
44
|
-
const handleSearchTextChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
45
|
-
setSearchText(e.target.value);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const handleCloseSearch = () => {
|
|
49
|
-
dispatch(closeSearch());
|
|
50
|
-
};
|
|
51
|
-
|
|
52
45
|
return (
|
|
53
46
|
<>
|
|
54
47
|
<div
|
|
@@ -74,9 +67,9 @@ export default function Search() {
|
|
|
74
67
|
{t('common.search.results_for')}
|
|
75
68
|
</span>
|
|
76
69
|
<div className="flex items-center">
|
|
77
|
-
<
|
|
70
|
+
<input
|
|
78
71
|
value={searchText}
|
|
79
|
-
onChange={
|
|
72
|
+
onChange={(e) => setSearchText(e.target.value)}
|
|
80
73
|
onKeyDown={(e) => {
|
|
81
74
|
if (e.key === 'Enter' && searchText.trim() !== '') {
|
|
82
75
|
router.push(`${ROUTES.LIST}/?search_text=${searchText}`);
|
|
@@ -98,12 +91,11 @@ export default function Search() {
|
|
|
98
91
|
<Icon
|
|
99
92
|
name="close"
|
|
100
93
|
size={14}
|
|
101
|
-
onClick={
|
|
94
|
+
onClick={() => dispatch(closeSearch())}
|
|
102
95
|
className="cursor-pointer"
|
|
103
96
|
/>
|
|
104
97
|
</div>
|
|
105
98
|
</div>
|
|
106
|
-
|
|
107
99
|
<Results searchText={searchText} />
|
|
108
100
|
</div>
|
|
109
101
|
</div>
|
|
@@ -36,100 +36,53 @@ export default function ProductInfoSlider({ product }: ProductSliderItem) {
|
|
|
36
36
|
carouselRef.current?.next();
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const handleThumbnailClick = (index
|
|
39
|
+
const handleThumbnailClick = (index) => {
|
|
40
40
|
setActiveIndex(index);
|
|
41
41
|
carouselRef.current?.goToSlide(index);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
|
-
|
|
46
|
-
<div className="lg:
|
|
47
|
-
<div className="
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
disabled={activeIndex === 0}
|
|
56
|
-
>
|
|
57
|
-
<Icon name="chevron-up" size={15} className="fill-[#000000]" />
|
|
58
|
-
</button>
|
|
59
|
-
<div className="hidden flex-col items-center overflow-scroll w-[80px] max-h-[620px] lg:block">
|
|
60
|
-
{product?.productimage_set?.map((item, index) => (
|
|
61
|
-
<Image
|
|
62
|
-
key={index}
|
|
63
|
-
src={item.image}
|
|
64
|
-
alt={`Thumbnail ${index}`}
|
|
65
|
-
width={80}
|
|
66
|
-
height={128}
|
|
67
|
-
aspectRatio={80 / 128}
|
|
68
|
-
className={twMerge('cursor-pointer', [
|
|
69
|
-
activeIndex === index && 'border-2 border-primary'
|
|
70
|
-
])}
|
|
71
|
-
onClick={() => handleThumbnailClick(index)}
|
|
72
|
-
/>
|
|
73
|
-
))}
|
|
74
|
-
</div>
|
|
75
|
-
<button
|
|
76
|
-
onClick={goToNext}
|
|
77
|
-
className={twMerge(
|
|
78
|
-
'hidden justify-center p-2 mt-3 border border-gray-100 rounded-full cursor-pointer lg:block',
|
|
79
|
-
[
|
|
80
|
-
activeIndex === product.productimage_set.length - 1 &&
|
|
81
|
-
'cursor-not-allowed opacity-45'
|
|
82
|
-
]
|
|
83
|
-
)}
|
|
84
|
-
disabled={activeIndex === product.productimage_set.length - 1}
|
|
85
|
-
>
|
|
86
|
-
<Icon name="chevron-down" size={15} className="fill-[#000000]" />
|
|
87
|
-
</button>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<div className="relative lg:col-span-5">
|
|
92
|
-
<FavButton className="absolute right-8 top-6 z-[20] sm:hidden" />
|
|
93
|
-
|
|
94
|
-
<PluginModule
|
|
95
|
-
component={Component.ProductImageSearchFeature}
|
|
96
|
-
props={{
|
|
97
|
-
product,
|
|
98
|
-
activeIndex,
|
|
99
|
-
showResetButton: true
|
|
100
|
-
}}
|
|
101
|
-
/>
|
|
102
|
-
|
|
103
|
-
<CarouselCore
|
|
104
|
-
responsive={{
|
|
105
|
-
all: {
|
|
106
|
-
breakpoint: { max: 5000, min: 0 },
|
|
107
|
-
items: 1
|
|
108
|
-
}
|
|
109
|
-
}}
|
|
110
|
-
arrows={false}
|
|
111
|
-
swipeable={true}
|
|
112
|
-
ref={carouselRef}
|
|
113
|
-
afterChange={(previousSlide, { currentSlide }) => {
|
|
114
|
-
setActiveIndex(currentSlide);
|
|
115
|
-
}}
|
|
116
|
-
containerAspectRatio={{ mobile: 520 / 798, desktop: 484 / 726 }}
|
|
45
|
+
<div className="lg:grid lg:grid-cols-6">
|
|
46
|
+
<div className="lg:col-span-1">
|
|
47
|
+
<div className="flex flex-col items-center justify-center md:mr-[6px]">
|
|
48
|
+
<button
|
|
49
|
+
onClick={goToPrev}
|
|
50
|
+
className={twMerge(
|
|
51
|
+
'hidden justify-center p-2 mb-3 border border-gray-100 rounded-full cursor-pointer lg:block',
|
|
52
|
+
[activeIndex === 0 && 'cursor-not-allowed opacity-45']
|
|
53
|
+
)}
|
|
54
|
+
disabled={activeIndex === 0}
|
|
117
55
|
>
|
|
118
|
-
{
|
|
56
|
+
<Icon name="chevron-up" size={15} className="fill-[#000000]" />
|
|
57
|
+
</button>
|
|
58
|
+
<div className="hidden flex-col items-center overflow-scroll w-[80px] max-h-[620px] lg:block">
|
|
59
|
+
{product?.productimage_set?.map((item, index) => (
|
|
119
60
|
<Image
|
|
120
|
-
key={
|
|
61
|
+
key={index}
|
|
121
62
|
src={item.image}
|
|
122
|
-
alt={
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
fill
|
|
63
|
+
alt={`Thumbnail ${index}`}
|
|
64
|
+
width={80}
|
|
65
|
+
height={128}
|
|
66
|
+
className={twMerge('cursor-pointer', [
|
|
67
|
+
activeIndex === index && 'border-2 border-primary'
|
|
68
|
+
])}
|
|
69
|
+
onClick={() => handleThumbnailClick(index)}
|
|
130
70
|
/>
|
|
131
71
|
))}
|
|
132
|
-
</
|
|
72
|
+
</div>
|
|
73
|
+
<button
|
|
74
|
+
onClick={goToNext}
|
|
75
|
+
className={twMerge(
|
|
76
|
+
'hidden justify-center p-2 mt-3 border border-gray-100 rounded-full cursor-pointer lg:block',
|
|
77
|
+
[
|
|
78
|
+
activeIndex === product.productimage_set.length - 1 &&
|
|
79
|
+
'cursor-not-allowed opacity-45'
|
|
80
|
+
]
|
|
81
|
+
)}
|
|
82
|
+
disabled={activeIndex === product.productimage_set.length - 1}
|
|
83
|
+
>
|
|
84
|
+
<Icon name="chevron-down" size={15} className="fill-[#000000]" />
|
|
85
|
+
</button>
|
|
133
86
|
</div>
|
|
134
87
|
</div>
|
|
135
88
|
|
|
@@ -187,6 +140,6 @@ export default function ProductInfoSlider({ product }: ProductSliderItem) {
|
|
|
187
140
|
))}
|
|
188
141
|
</CarouselCore>
|
|
189
142
|
</div>
|
|
190
|
-
|
|
143
|
+
</div>
|
|
191
144
|
);
|
|
192
145
|
}
|
package/commands/plugins.ts
CHANGED
package/dist/commands/plugins.js
CHANGED
|
@@ -183,10 +183,6 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
183
183
|
name: 'Tamara Payment Extension',
|
|
184
184
|
value: 'pz-tamara-extension'
|
|
185
185
|
},
|
|
186
|
-
{
|
|
187
|
-
name: 'Similar Products',
|
|
188
|
-
value: 'pz-similar-products'
|
|
189
|
-
},
|
|
190
186
|
{
|
|
191
187
|
name: 'Hepsipay',
|
|
192
188
|
value: 'pz-hepsipay'
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useSentryUncaughtErrors } from '@akinon/next/hooks';
|
|
4
|
-
|
|
5
|
-
export default function GlobalError({
|
|
6
|
-
error,
|
|
7
|
-
reset
|
|
8
|
-
}: {
|
|
9
|
-
error: Error & { digest?: string };
|
|
10
|
-
reset: () => void;
|
|
11
|
-
}) {
|
|
12
|
-
useSentryUncaughtErrors(error);
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<html>
|
|
16
|
-
<body>
|
|
17
|
-
<h2>Something went wrong!</h2>
|
|
18
|
-
<button onClick={() => reset()}>Try again</button>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
|
21
|
-
);
|
|
22
|
-
}
|