@akinon/projectzero 2.0.41-rc.0 → 2.0.42-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +2 -6
  2. package/app-template/.env.example +0 -1
  3. package/app-template/AGENTS.md +0 -8
  4. package/app-template/CHANGELOG.md +65 -78
  5. package/app-template/README.md +1 -25
  6. package/app-template/next.config.mjs +1 -7
  7. package/app-template/package.json +41 -41
  8. package/app-template/src/app/[pz]/account/(dashboard)/layout.tsx +20 -0
  9. package/app-template/src/app/[pz]/account/account-page-slot.tsx +34 -0
  10. package/app-template/src/app/[pz]/account/address/layout.tsx +18 -0
  11. package/app-template/src/app/[pz]/account/change-email/layout.tsx +18 -0
  12. package/app-template/src/app/[pz]/account/change-password/layout.tsx +18 -0
  13. package/app-template/src/app/[pz]/account/contact/layout.tsx +18 -0
  14. package/app-template/src/app/[pz]/account/coupons/layout.tsx +18 -0
  15. package/app-template/src/app/[pz]/account/faq/layout.tsx +15 -0
  16. package/app-template/src/app/[pz]/account/favourite-products/layout.tsx +18 -0
  17. package/app-template/src/app/[pz]/account/layout.tsx +23 -2
  18. package/app-template/src/app/[pz]/account/orders/(list)/layout.tsx +20 -0
  19. package/app-template/src/app/[pz]/account/orders/[id]/{layout.tsx → (detail)/layout.tsx} +11 -1
  20. package/app-template/src/app/[pz]/account/profile/layout.tsx +18 -0
  21. package/app-template/src/app/[pz]/layout.tsx +12 -2
  22. package/app-template/src/hooks/index.ts +0 -2
  23. package/app-template/src/plugins.js +0 -1
  24. package/app-template/src/proxy.ts +1 -2
  25. package/app-template/src/views/header/search/index.tsx +5 -13
  26. package/app-template/src/views/product/slider.tsx +38 -85
  27. package/commands/plugins.ts +0 -4
  28. package/dist/commands/plugins.js +0 -4
  29. package/package.json +1 -1
  30. package/app-template/src/app/api/client-env/route.ts +0 -5
  31. package/app-template/src/app/global-error.tsx +0 -22
  32. /package/app-template/src/app/[pz]/account/{page.tsx → (dashboard)/page.tsx} +0 -0
  33. /package/app-template/src/app/[pz]/account/orders/{page.tsx → (list)/page.tsx} +0 -0
  34. /package/app-template/src/app/[pz]/account/orders/[id]/{page.tsx → (detail)/page.tsx} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,12 +1,8 @@
1
1
  # @akinon/projectzero
2
2
 
3
- ## 2.0.41-rc.0
3
+ ## 2.0.42-beta.0
4
4
 
5
- ### Patch Changes
6
-
7
- - 143be2b9d: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
8
- - d99a6a7d5: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
9
- - e18836b2: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
5
+ ## 2.0.41
10
6
 
11
7
  ## 2.0.40
12
8
 
@@ -7,7 +7,6 @@ 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
- NEXT_PUBLIC_ENABLE_IMAGE_SEARCH=true
11
10
 
12
11
  # PZ Dashboard dataLayer observability (unset = observer disabled)
13
12
  # NEXT_PUBLIC_PZ_DASHBOARD_URL=http://localhost:3005
@@ -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,83 +1,70 @@
1
1
  # projectzeronext
2
2
 
3
- ## 2.0.41-rc.0
4
-
5
- ### Patch Changes
6
-
7
- - 1a8622a9b: ZERO-3392: Implemented AI Search functionality and update env
8
- - 2fea4143: ZERO-4620: Add runtime access to `NEXT_PUBLIC_*` environment variables from Client Components
9
- - b55acb768: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
10
- - 143be2b9d: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
11
- - 9f8cd3bc5: ZERO-3449: AI Search Active Filters & Crop Style changes have been implemented
12
- - d99a6a7d5: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
13
- - ccf21475: ZERO-4404: Add Next.js 16.2 AI improvements
14
- - c0228aff: ZERO-4159: Upgrade the package versions
15
- - b05c35435: ZERO-2570: Category filters routes to absolute url
16
- - e18836b2: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
17
- - c3244a310: ZERO-4013: Update runtime version to node:25-alpine in project configuration
18
- - Updated dependencies [a3e2acbf]
19
- - Updated dependencies [0cf9ea23]
20
- - Updated dependencies [324f97d5]
21
- - Updated dependencies [51ea0688]
22
- - Updated dependencies
23
- - Updated dependencies [c97525a3]
24
- - Updated dependencies [eba125b2]
25
- - Updated dependencies [2fea4143]
26
- - Updated dependencies [119f0c11]
27
- - Updated dependencies [823a4449]
28
- - Updated dependencies [b55acb768]
29
- - Updated dependencies [760258c1]
30
- - Updated dependencies [5da13fff]
31
- - Updated dependencies [143be2b9d]
32
- - Updated dependencies [7889b08f]
33
- - Updated dependencies [fb4aa9b4]
34
- - Updated dependencies [9f8cd3bc5]
35
- - Updated dependencies [bfafa3f4]
36
- - Updated dependencies [00b9f488]
37
- - Updated dependencies [57d7eb30]
38
- - Updated dependencies [d99a6a7d5]
39
- - Updated dependencies [9db81a71]
40
- - Updated dependencies [591e345e1]
41
- - Updated dependencies [0df6bc1f]
42
- - Updated dependencies [4de5303c5]
43
- - Updated dependencies [63a72000]
44
- - Updated dependencies [95b139dc1]
45
- - Updated dependencies [1d00f2d0]
46
- - Updated dependencies [4ac7b2a1]
47
- - Updated dependencies [e9598c71]
48
- - Updated dependencies [4998a963]
49
- - Updated dependencies [804d2bd6]
50
- - Updated dependencies [c0228aff]
51
- - Updated dependencies [3909d3224]
52
- - Updated dependencies [6a3d8a63]
53
- - Updated dependencies [e18836b2]
54
- - @akinon/pz-tabby-extension@2.0.41-rc.0
55
- - @akinon/next@2.0.41-rc.0
56
- - @akinon/pz-checkout-gift-pack@2.0.41-rc.0
57
- - @akinon/pz-masterpass-rest@2.0.41-rc.0
58
- - @akinon/pz-one-click-checkout@2.0.41-rc.0
59
- - @akinon/pz-basket-gift-pack@2.0.41-rc.0
60
- - @akinon/pz-pay-on-delivery@2.0.41-rc.0
61
- - @akinon/pz-credit-payment@2.0.41-rc.0
62
- - @akinon/pz-click-collect@2.0.41-rc.0
63
- - @akinon/pz-multi-basket@2.0.41-rc.0
64
- - @akinon/pz-masterpass@2.0.41-rc.0
65
- - @akinon/pz-gpay@2.0.41-rc.0
66
- - @akinon/pz-b2b@2.0.41-rc.0
67
- - @akinon/pz-bkm@2.0.41-rc.0
68
- - @akinon/pz-otp@2.0.41-rc.0
69
- - @akinon/pz-similar-products@2.0.41-rc.0
70
- - @akinon/pz-virtual-try-on@2.0.41-rc.0
71
- - @akinon/pz-theme@2.0.41-rc.0
72
- - @akinon/pz-akifast@2.0.41-rc.0
73
- - @akinon/pz-apple-pay@2.0.41-rc.0
74
- - @akinon/pz-cybersource-uc@2.0.41-rc.0
75
- - @akinon/pz-flow-payment@2.0.41-rc.0
76
- - @akinon/pz-google-pay@2.0.41-rc.0
77
- - @akinon/pz-haso@2.0.41-rc.0
78
- - @akinon/pz-hepsipay@2.0.41-rc.0
79
- - @akinon/pz-saved-card@2.0.41-rc.0
80
- - @akinon/pz-tamara-extension@2.0.41-rc.0
3
+ ## 2.0.42-beta.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [cbbbfd75]
8
+ - @akinon/next@2.0.42-beta.0
9
+ - @akinon/pz-theme@2.0.42-beta.0
10
+ - @akinon/pz-virtual-try-on@2.0.42-beta.0
11
+ - @akinon/pz-akifast@2.0.42-beta.0
12
+ - @akinon/pz-apple-pay@2.0.42-beta.0
13
+ - @akinon/pz-b2b@2.0.42-beta.0
14
+ - @akinon/pz-basket-gift-pack@2.0.42-beta.0
15
+ - @akinon/pz-bkm@2.0.42-beta.0
16
+ - @akinon/pz-checkout-gift-pack@2.0.42-beta.0
17
+ - @akinon/pz-click-collect@2.0.42-beta.0
18
+ - @akinon/pz-credit-payment@2.0.42-beta.0
19
+ - @akinon/pz-cybersource-uc@2.0.42-beta.0
20
+ - @akinon/pz-flow-payment@2.0.42-beta.0
21
+ - @akinon/pz-google-pay@2.0.42-beta.0
22
+ - @akinon/pz-gpay@2.0.42-beta.0
23
+ - @akinon/pz-haso@2.0.42-beta.0
24
+ - @akinon/pz-hepsipay@2.0.42-beta.0
25
+ - @akinon/pz-masterpass@2.0.42-beta.0
26
+ - @akinon/pz-masterpass-rest@2.0.42-beta.0
27
+ - @akinon/pz-multi-basket@2.0.42-beta.0
28
+ - @akinon/pz-one-click-checkout@2.0.42-beta.0
29
+ - @akinon/pz-otp@2.0.42-beta.0
30
+ - @akinon/pz-pay-on-delivery@2.0.42-beta.0
31
+ - @akinon/pz-saved-card@2.0.42-beta.0
32
+ - @akinon/pz-similar-products@2.0.42-beta.0
33
+ - @akinon/pz-tabby-extension@2.0.42-beta.0
34
+ - @akinon/pz-tamara-extension@2.0.42-beta.0
35
+
36
+ ## 2.0.41
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [02840711]
41
+ - @akinon/pz-theme@2.0.41
42
+ - @akinon/next@2.0.41
43
+ - @akinon/pz-akifast@2.0.41
44
+ - @akinon/pz-apple-pay@2.0.41
45
+ - @akinon/pz-b2b@2.0.41
46
+ - @akinon/pz-basket-gift-pack@2.0.41
47
+ - @akinon/pz-bkm@2.0.41
48
+ - @akinon/pz-checkout-gift-pack@2.0.41
49
+ - @akinon/pz-click-collect@2.0.41
50
+ - @akinon/pz-credit-payment@2.0.41
51
+ - @akinon/pz-cybersource-uc@2.0.41
52
+ - @akinon/pz-flow-payment@2.0.41
53
+ - @akinon/pz-google-pay@2.0.41
54
+ - @akinon/pz-gpay@2.0.41
55
+ - @akinon/pz-haso@2.0.41
56
+ - @akinon/pz-hepsipay@2.0.41
57
+ - @akinon/pz-masterpass@2.0.41
58
+ - @akinon/pz-masterpass-rest@2.0.41
59
+ - @akinon/pz-multi-basket@2.0.41
60
+ - @akinon/pz-one-click-checkout@2.0.41
61
+ - @akinon/pz-otp@2.0.41
62
+ - @akinon/pz-pay-on-delivery@2.0.41
63
+ - @akinon/pz-saved-card@2.0.41
64
+ - @akinon/pz-similar-products@2.0.41
65
+ - @akinon/pz-tabby-extension@2.0.41
66
+ - @akinon/pz-tamara-extension@2.0.41
67
+ - @akinon/pz-virtual-try-on@2.0.41
81
68
 
82
69
  ## 2.0.40
83
70
 
@@ -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.41-rc.0",
3
+ "version": "2.0.42-beta.0",
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.41-rc.0",
28
- "@akinon/pz-akifast": "2.0.41-rc.0",
29
- "@akinon/pz-apple-pay": "2.0.41-rc.0",
30
- "@akinon/pz-b2b": "2.0.41-rc.0",
31
- "@akinon/pz-basket-gift-pack": "2.0.41-rc.0",
32
- "@akinon/pz-bkm": "2.0.41-rc.0",
33
- "@akinon/pz-checkout-gift-pack": "2.0.41-rc.0",
34
- "@akinon/pz-click-collect": "2.0.41-rc.0",
35
- "@akinon/pz-credit-payment": "2.0.41-rc.0",
36
- "@akinon/pz-cybersource-uc": "2.0.41-rc.0",
37
- "@akinon/pz-flow-payment": "2.0.41-rc.0",
38
- "@akinon/pz-google-pay": "2.0.41-rc.0",
39
- "@akinon/pz-gpay": "2.0.41-rc.0",
40
- "@akinon/pz-haso": "2.0.41-rc.0",
41
- "@akinon/pz-hepsipay": "2.0.41-rc.0",
42
- "@akinon/pz-masterpass": "2.0.41-rc.0",
43
- "@akinon/pz-masterpass-rest": "2.0.41-rc.0",
44
- "@akinon/pz-multi-basket": "2.0.41-rc.0",
45
- "@akinon/pz-one-click-checkout": "2.0.41-rc.0",
46
- "@akinon/pz-otp": "2.0.41-rc.0",
47
- "@akinon/pz-pay-on-delivery": "2.0.41-rc.0",
48
- "@akinon/pz-saved-card": "2.0.41-rc.0",
49
- "@akinon/pz-similar-products": "2.0.41-rc.0",
50
- "@akinon/pz-tabby-extension": "2.0.41-rc.0",
51
- "@akinon/pz-tamara-extension": "2.0.41-rc.0",
52
- "@akinon/pz-theme": "2.0.41-rc.0",
53
- "@akinon/pz-virtual-try-on": "2.0.41-rc.0",
27
+ "@akinon/next": "2.0.42-beta.0",
28
+ "@akinon/pz-akifast": "2.0.42-beta.0",
29
+ "@akinon/pz-apple-pay": "2.0.42-beta.0",
30
+ "@akinon/pz-b2b": "2.0.42-beta.0",
31
+ "@akinon/pz-basket-gift-pack": "2.0.42-beta.0",
32
+ "@akinon/pz-bkm": "2.0.42-beta.0",
33
+ "@akinon/pz-checkout-gift-pack": "2.0.42-beta.0",
34
+ "@akinon/pz-click-collect": "2.0.42-beta.0",
35
+ "@akinon/pz-credit-payment": "2.0.42-beta.0",
36
+ "@akinon/pz-cybersource-uc": "2.0.42-beta.0",
37
+ "@akinon/pz-flow-payment": "2.0.42-beta.0",
38
+ "@akinon/pz-google-pay": "2.0.42-beta.0",
39
+ "@akinon/pz-gpay": "2.0.42-beta.0",
40
+ "@akinon/pz-haso": "2.0.42-beta.0",
41
+ "@akinon/pz-hepsipay": "2.0.42-beta.0",
42
+ "@akinon/pz-masterpass": "2.0.42-beta.0",
43
+ "@akinon/pz-masterpass-rest": "2.0.42-beta.0",
44
+ "@akinon/pz-multi-basket": "2.0.42-beta.0",
45
+ "@akinon/pz-one-click-checkout": "2.0.42-beta.0",
46
+ "@akinon/pz-otp": "2.0.42-beta.0",
47
+ "@akinon/pz-pay-on-delivery": "2.0.42-beta.0",
48
+ "@akinon/pz-saved-card": "2.0.42-beta.0",
49
+ "@akinon/pz-similar-products": "2.0.42-beta.0",
50
+ "@akinon/pz-tabby-extension": "2.0.42-beta.0",
51
+ "@akinon/pz-tamara-extension": "2.0.42-beta.0",
52
+ "@akinon/pz-theme": "2.0.42-beta.0",
53
+ "@akinon/pz-virtual-try-on": "2.0.42-beta.0",
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.21.0",
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.5",
71
- "react-string-replace": "1.1.1",
72
- "start-server-and-test": "2.0.8",
73
- "tailwind-merge": "1.14.0",
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.41-rc.0",
77
+ "@akinon/eslint-plugin-projectzero": "2.0.42-beta.0",
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.2.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.4.2",
99
+ "jest-css-modules-transform": "4.3.0",
100
100
  "jest-environment-jsdom": "29.7.0",
101
- "lint-staged": "13.3.0",
102
- "prettier": "2.8.8",
101
+ "lint-staged": "13.1.0",
102
+ "prettier": "2.6.2",
103
103
  "react-number-format": "5.3.4",
104
- "sass": "1.83.0",
104
+ "sass": "1.49.9",
105
105
  "semantic-release": "19.0.5",
106
106
  "server-only": "0.0.1",
107
- "stylelint": "14.16.1",
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.7.0",
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",
@@ -0,0 +1,20 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../account-page-slot';
4
+
5
+ // The account root screen lives in its own route group so its takeover slug
6
+ // covers exactly this screen, not the whole account subtree.
7
+ export default function DashboardLayout({
8
+ children
9
+ }: {
10
+ children: React.ReactNode;
11
+ }) {
12
+ return (
13
+ <AccountPageSlot
14
+ slug={PLACEHOLDER_SLUGS.accountDashboard}
15
+ path={ROUTES.ACCOUNT}
16
+ >
17
+ {children}
18
+ </AccountPageSlot>
19
+ );
20
+ }
@@ -0,0 +1,34 @@
1
+ import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
2
+ import { buildAccountPageContext } from '@akinon/pz-theme/src/chrome/page-context';
3
+ import { auth } from 'auth';
4
+
5
+ /**
6
+ * Shared takeover slot for the account subpages. Each subpage keeps its own
7
+ * layout so a composition replaces exactly one screen — a single slot higher
8
+ * up would leak one composition across every account route.
9
+ */
10
+ export default async function AccountPageSlot({
11
+ slug,
12
+ path,
13
+ children
14
+ }: {
15
+ slug: string;
16
+ path: string;
17
+ children: React.ReactNode;
18
+ }) {
19
+ // The account layout above already gates auth; this read only feeds the
20
+ // context's user fields. Null-safe on purpose: nested layouts render in
21
+ // parallel with the parent's redirect for signed-out visitors.
22
+ const session = await auth();
23
+
24
+ return (
25
+ <ChromeSlot
26
+ slug={slug}
27
+ fallback={children}
28
+ pageContext={buildAccountPageContext({
29
+ path,
30
+ sessionUser: (session?.user as Record<string, unknown>) ?? null
31
+ })}
32
+ />
33
+ );
34
+ }
@@ -0,0 +1,18 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../account-page-slot';
4
+
5
+ export default function AddressLayout({
6
+ children
7
+ }: {
8
+ children: React.ReactNode;
9
+ }) {
10
+ return (
11
+ <AccountPageSlot
12
+ slug={PLACEHOLDER_SLUGS.accountAddresses}
13
+ path={ROUTES.ACCOUNT_ADDRESS}
14
+ >
15
+ {children}
16
+ </AccountPageSlot>
17
+ );
18
+ }
@@ -0,0 +1,18 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../account-page-slot';
4
+
5
+ export default function ChangeEmailLayout({
6
+ children
7
+ }: {
8
+ children: React.ReactNode;
9
+ }) {
10
+ return (
11
+ <AccountPageSlot
12
+ slug={PLACEHOLDER_SLUGS.accountChangeEmail}
13
+ path={ROUTES.ACCOUNT_CHANGE_EMAIL}
14
+ >
15
+ {children}
16
+ </AccountPageSlot>
17
+ );
18
+ }
@@ -0,0 +1,18 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../account-page-slot';
4
+
5
+ export default function ChangePasswordLayout({
6
+ children
7
+ }: {
8
+ children: React.ReactNode;
9
+ }) {
10
+ return (
11
+ <AccountPageSlot
12
+ slug={PLACEHOLDER_SLUGS.accountChangePassword}
13
+ path={ROUTES.ACCOUNT_CHANGE_PASSWORD}
14
+ >
15
+ {children}
16
+ </AccountPageSlot>
17
+ );
18
+ }
@@ -0,0 +1,18 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../account-page-slot';
4
+
5
+ export default function ContactLayout({
6
+ children
7
+ }: {
8
+ children: React.ReactNode;
9
+ }) {
10
+ return (
11
+ <AccountPageSlot
12
+ slug={PLACEHOLDER_SLUGS.accountContact}
13
+ path={ROUTES.ACCOUNT_CONTACT}
14
+ >
15
+ {children}
16
+ </AccountPageSlot>
17
+ );
18
+ }
@@ -0,0 +1,18 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../account-page-slot';
4
+
5
+ export default function CouponsLayout({
6
+ children
7
+ }: {
8
+ children: React.ReactNode;
9
+ }) {
10
+ return (
11
+ <AccountPageSlot
12
+ slug={PLACEHOLDER_SLUGS.accountCoupons}
13
+ path={ROUTES.ACCOUNT_COUPONS}
14
+ >
15
+ {children}
16
+ </AccountPageSlot>
17
+ );
18
+ }
@@ -0,0 +1,15 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../account-page-slot';
4
+
5
+ export default function FaqLayout({
6
+ children
7
+ }: {
8
+ children: React.ReactNode;
9
+ }) {
10
+ return (
11
+ <AccountPageSlot slug={PLACEHOLDER_SLUGS.accountFaq} path={ROUTES.ACCOUNT_FAQ}>
12
+ {children}
13
+ </AccountPageSlot>
14
+ );
15
+ }
@@ -0,0 +1,18 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../account-page-slot';
4
+
5
+ export default function FavouriteProductsLayout({
6
+ children
7
+ }: {
8
+ children: React.ReactNode;
9
+ }) {
10
+ return (
11
+ <AccountPageSlot
12
+ slug={PLACEHOLDER_SLUGS.accountFavourites}
13
+ path={ROUTES.ACCOUNT_WISHLIST}
14
+ >
15
+ {children}
16
+ </AccountPageSlot>
17
+ );
18
+ }
@@ -19,13 +19,34 @@ export default async function AccountLayout({
19
19
  }
20
20
 
21
21
  return (
22
- <div className="container flex py-10 px-4 xl:px-0">
23
- <AccountMenu />
22
+ // Stacked on mobile, two columns on desktop. The brand markup hides
23
+ // itself on the breakpoints it does not serve, but a COMPOSED menu or
24
+ // page body has no such classes — in a no-wrap row it would render
25
+ // crushed next to its sibling on a phone; in a column it stacks.
26
+ <div className="container flex flex-col lg:flex-row py-10 px-4 xl:px-0">
27
+ {/* The menu keeps its own responsive column classes (incl. hiding
28
+ itself on mobile subpages), so the slot chain must stay
29
+ layout-transparent — hence `contents` on both wrappers. A menu
30
+ takeover renders on every account screen and replaces the logout
31
+ button too; the designer rebuilds it from the block vocabulary. */}
32
+ <ChromeSlot
33
+ slug={PLACEHOLDER_SLUGS.accountMenu}
34
+ fallback={<AccountMenu />}
35
+ className="contents"
36
+ fallbackClassName="contents"
37
+ pageContext={buildAccountPageContext({
38
+ path: ROUTES.ACCOUNT,
39
+ sessionUser: session.user as Record<string, unknown>
40
+ })}
41
+ />
24
42
  <div className="w-full flex-1">
25
43
  <AccountBackButton />
26
44
  {/* The session is already awaited above, so the account context costs
27
45
  no extra fetch. Profile-only fields (phone, gender) stay empty
28
46
  until a live provider merges them in. */}
47
+ {/* Layout-level band on EVERY account screen. Never give this slot a
48
+ `fallback`: taking the shell over would replace `children` — and
49
+ with it every per-subpage slot mounted below. */}
29
50
  <ChromeSlot
30
51
  slug={PLACEHOLDER_SLUGS.accountShell}
31
52
  pageContext={buildAccountPageContext({
@@ -0,0 +1,20 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../../account-page-slot';
4
+
5
+ // The order list lives in its own route group so its takeover slug cannot
6
+ // swallow the order detail and cancellation screens under the same segment.
7
+ export default function OrdersLayout({
8
+ children
9
+ }: {
10
+ children: React.ReactNode;
11
+ }) {
12
+ return (
13
+ <AccountPageSlot
14
+ slug={PLACEHOLDER_SLUGS.accountOrders}
15
+ path={ROUTES.ACCOUNT_ORDERS}
16
+ >
17
+ {children}
18
+ </AccountPageSlot>
19
+ );
20
+ }
@@ -2,10 +2,15 @@ import React from 'react';
2
2
  import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
3
3
  import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
4
4
  import { LiveAccountOrderPageContext } from '@akinon/pz-theme/src/chrome/live-order-page-context';
5
+ import { buildAccountPageContext } from '@akinon/pz-theme/src/chrome/page-context';
6
+ import { auth } from 'auth';
7
+ import { ROUTES } from 'routes';
5
8
 
6
9
  /**
7
10
  * Account order detail. Publishes the SAME `order` root as the success page,
8
- * so a composition authored on one resolves on the other.
11
+ * so a composition authored on one resolves on the other. Scoped to its own
12
+ * route group so a composed detail page cannot swallow the cancellation
13
+ * screen under the same order segment.
9
14
  */
10
15
  export default async function Layout({
11
16
  children,
@@ -15,6 +20,7 @@ export default async function Layout({
15
20
  params: Promise<{ id: string }>;
16
21
  }) {
17
22
  const { id } = await params;
23
+ const session = await auth();
18
24
 
19
25
  return (
20
26
  <div>
@@ -22,6 +28,10 @@ export default async function Layout({
22
28
  <ChromeSlot
23
29
  slug={PLACEHOLDER_SLUGS.accountOrderDetail}
24
30
  fallback={children}
31
+ pageContext={buildAccountPageContext({
32
+ path: ROUTES.ACCOUNT_ORDERS,
33
+ sessionUser: (session?.user as Record<string, unknown>) ?? null
34
+ })}
25
35
  />
26
36
  </LiveAccountOrderPageContext>
27
37
  </div>
@@ -0,0 +1,18 @@
1
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
2
+ import { ROUTES } from 'routes';
3
+ import AccountPageSlot from '../account-page-slot';
4
+
5
+ export default function ProfileLayout({
6
+ children
7
+ }: {
8
+ children: React.ReactNode;
9
+ }) {
10
+ return (
11
+ <AccountPageSlot
12
+ slug={PLACEHOLDER_SLUGS.accountProfile}
13
+ path={ROUTES.ACCOUNT_PROFILE}
14
+ >
15
+ {children}
16
+ </AccountPageSlot>
17
+ );
18
+ }
@@ -16,6 +16,9 @@ import { InstallPrompt } from '@theme/components/install-prompt';
16
16
  import type { Viewport } from 'next';
17
17
  import settings from '@theme/settings';
18
18
  import RouteHandler from '@theme/components/route-handler';
19
+ import { PreviewAuthStateReporter } from '@akinon/pz-theme/src/chrome/preview-auth-state';
20
+ import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
21
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
19
22
  import './configure-page-context';
20
23
 
21
24
  export const viewport: Viewport = {
@@ -59,15 +62,22 @@ async function RootLayout({
59
62
  <ClientRoot>
60
63
  <div className="overflow-x-clip">
61
64
  <MobileAppToggler>
62
- <Header />
65
+ <ChromeSlot
66
+ slug={PLACEHOLDER_SLUGS.header}
67
+ fallback={<Header />}
68
+ />
63
69
  </MobileAppToggler>
64
70
  <main>
65
71
  <OfflineFallback>{children}</OfflineFallback>
66
72
  <RouteHandler />
73
+ <PreviewAuthStateReporter />
67
74
  <RootModal />
68
75
  </main>
69
76
  <MobileAppToggler>
70
- <Footer />
77
+ <ChromeSlot
78
+ slug={PLACEHOLDER_SLUGS.footer}
79
+ fallback={<Footer />}
80
+ />
71
81
  </MobileAppToggler>
72
82
  <MobileAppToggler>
73
83
  <InstallPrompt />
@@ -1,3 +1 @@
1
- export * from './use-contract';
2
- export * from './use-fav-button';
3
1
  export * from './use-add-product-to-basket';
@@ -19,7 +19,6 @@ module.exports = [
19
19
  'pz-hepsipay',
20
20
  'pz-flow-payment',
21
21
  'pz-virtual-try-on',
22
- 'pz-similar-products',
23
22
  'pz-cybersource-uc',
24
23
  'pz-hepsipay',
25
24
  'pz-masterpass-rest',
@@ -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
- import { Icon, Input } from '@theme/components';
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
- <Input
70
+ <input
78
71
  value={searchText}
79
- onChange={handleSearchTextChange}
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={handleCloseSearch}
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: number) => {
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:grid lg:grid-cols-6">
47
- <div className="lg:col-span-1">
48
- <div className="flex flex-col items-center justify-center md:mr-[6px]">
49
- <button
50
- onClick={goToPrev}
51
- className={twMerge(
52
- 'hidden justify-center p-2 mb-3 border border-gray-100 rounded-full cursor-pointer lg:block',
53
- [activeIndex === 0 && 'cursor-not-allowed opacity-45']
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
- {product?.productimage_set?.map((item, i) => (
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={i}
61
+ key={index}
121
62
  src={item.image}
122
- alt={product?.name || 'Product image'}
123
- draggable={false}
124
- aspectRatio={484 / 726}
125
- sizes="(min-width: 425px) 512px,
126
- (min-width: 601px) 576px,
127
- (min-width: 768px) 336px,
128
- (min-width: 1024px) 484px, 368px"
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
- </CarouselCore>
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
  }
@@ -164,10 +164,6 @@ export default async () => {
164
164
  name: 'Tamara Payment Extension',
165
165
  value: 'pz-tamara-extension'
166
166
  },
167
- {
168
- name: 'Similar Products',
169
- value: 'pz-similar-products'
170
- },
171
167
  {
172
168
  name: 'Hepsipay',
173
169
  value: 'pz-hepsipay'
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "2.0.41-rc.0",
3
+ "version": "2.0.42-beta.0",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {
@@ -1,5 +0,0 @@
1
- export { GET } from '@akinon/next/api/client-env';
2
-
3
- // NEXT_PUBLIC_* values are read from the server runtime, not the build. Force
4
- // dynamic so Next never statically caches an (empty) build-time response.
5
- export const dynamic = 'force-dynamic';
@@ -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
- }