@akinon/projectzero 2.0.39-rc.0 → 2.0.39

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 (35) hide show
  1. package/CHANGELOG.md +1 -7
  2. package/app-template/.env.example +0 -1
  3. package/app-template/AGENTS.md +0 -8
  4. package/app-template/CHANGELOG.md +32 -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/layout.tsx +13 -2
  9. package/app-template/src/app/[pz]/account/orders/[id]/layout.tsx +26 -2
  10. package/app-template/src/app/[pz]/basket/layout.tsx +25 -0
  11. package/app-template/src/app/[pz]/category/[pk]/page.tsx +1 -1
  12. package/app-template/src/app/[pz]/client-root.tsx +2 -0
  13. package/app-template/src/app/[pz]/configure-page-context.ts +17 -0
  14. package/app-template/src/app/[pz]/flat-page/[pk]/page.tsx +14 -3
  15. package/app-template/src/app/[pz]/layout.tsx +1 -0
  16. package/app-template/src/app/[pz]/list/page.tsx +1 -1
  17. package/app-template/src/app/[pz]/orders/checkout/layout.tsx +23 -0
  18. package/app-template/src/app/[pz]/orders/completed/[token]/layout.tsx +24 -2
  19. package/app-template/src/app/[pz]/page.tsx +1 -1
  20. package/app-template/src/app/[pz]/pages/[slug]/page.tsx +1 -1
  21. package/app-template/src/app/[pz]/special-page/[pk]/page.tsx +10 -1
  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/category/layout.tsx +12 -2
  26. package/app-template/src/views/header/search/index.tsx +5 -13
  27. package/app-template/src/views/product/layout.tsx +8 -5
  28. package/app-template/src/views/product/slider.tsx +38 -85
  29. package/commands/plugins.ts +0 -4
  30. package/dist/commands/plugins.js +0 -4
  31. package/package.json +1 -1
  32. package/app-template/src/app/api/client-env/route.ts +0 -5
  33. package/app-template/src/app/global-error.tsx +0 -22
  34. package/app-template/src/utils/__tests__/theme-page-context.test.ts +0 -148
  35. package/app-template/src/utils/theme-page-context.ts +0 -309
package/CHANGELOG.md CHANGED
@@ -1,12 +1,6 @@
1
1
  # @akinon/projectzero
2
2
 
3
- ## 2.0.39-rc.0
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
3
+ ## 2.0.39
10
4
 
11
5
  ## 2.0.38
12
6
 
@@ -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,37 @@
1
1
  # projectzeronext
2
2
 
3
- ## 2.0.39-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.39-rc.0
55
- - @akinon/next@2.0.39-rc.0
56
- - @akinon/pz-checkout-gift-pack@2.0.39-rc.0
57
- - @akinon/pz-masterpass-rest@2.0.39-rc.0
58
- - @akinon/pz-one-click-checkout@2.0.39-rc.0
59
- - @akinon/pz-basket-gift-pack@2.0.39-rc.0
60
- - @akinon/pz-pay-on-delivery@2.0.39-rc.0
61
- - @akinon/pz-credit-payment@2.0.39-rc.0
62
- - @akinon/pz-click-collect@2.0.39-rc.0
63
- - @akinon/pz-multi-basket@2.0.39-rc.0
64
- - @akinon/pz-masterpass@2.0.39-rc.0
65
- - @akinon/pz-gpay@2.0.39-rc.0
66
- - @akinon/pz-b2b@2.0.39-rc.0
67
- - @akinon/pz-bkm@2.0.39-rc.0
68
- - @akinon/pz-otp@2.0.39-rc.0
69
- - @akinon/pz-similar-products@2.0.39-rc.0
70
- - @akinon/pz-virtual-try-on@2.0.39-rc.0
71
- - @akinon/pz-theme@2.0.39-rc.0
72
- - @akinon/pz-akifast@2.0.39-rc.0
73
- - @akinon/pz-apple-pay@2.0.39-rc.0
74
- - @akinon/pz-cybersource-uc@2.0.39-rc.0
75
- - @akinon/pz-flow-payment@2.0.39-rc.0
76
- - @akinon/pz-google-pay@2.0.39-rc.0
77
- - @akinon/pz-haso@2.0.39-rc.0
78
- - @akinon/pz-hepsipay@2.0.39-rc.0
79
- - @akinon/pz-saved-card@2.0.39-rc.0
80
- - @akinon/pz-tamara-extension@2.0.39-rc.0
3
+ ## 2.0.39
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [115c5602]
8
+ - @akinon/pz-theme@2.0.39
9
+ - @akinon/next@2.0.39
10
+ - @akinon/pz-akifast@2.0.39
11
+ - @akinon/pz-apple-pay@2.0.39
12
+ - @akinon/pz-b2b@2.0.39
13
+ - @akinon/pz-basket-gift-pack@2.0.39
14
+ - @akinon/pz-bkm@2.0.39
15
+ - @akinon/pz-checkout-gift-pack@2.0.39
16
+ - @akinon/pz-click-collect@2.0.39
17
+ - @akinon/pz-credit-payment@2.0.39
18
+ - @akinon/pz-cybersource-uc@2.0.39
19
+ - @akinon/pz-flow-payment@2.0.39
20
+ - @akinon/pz-google-pay@2.0.39
21
+ - @akinon/pz-gpay@2.0.39
22
+ - @akinon/pz-haso@2.0.39
23
+ - @akinon/pz-hepsipay@2.0.39
24
+ - @akinon/pz-masterpass@2.0.39
25
+ - @akinon/pz-masterpass-rest@2.0.39
26
+ - @akinon/pz-multi-basket@2.0.39
27
+ - @akinon/pz-one-click-checkout@2.0.39
28
+ - @akinon/pz-otp@2.0.39
29
+ - @akinon/pz-pay-on-delivery@2.0.39
30
+ - @akinon/pz-saved-card@2.0.39
31
+ - @akinon/pz-similar-products@2.0.39
32
+ - @akinon/pz-tabby-extension@2.0.39
33
+ - @akinon/pz-tamara-extension@2.0.39
34
+ - @akinon/pz-virtual-try-on@2.0.39
81
35
 
82
36
  ## 2.0.38
83
37
 
@@ -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.39-rc.0",
3
+ "version": "2.0.39",
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.39-rc.0",
28
- "@akinon/pz-akifast": "2.0.39-rc.0",
29
- "@akinon/pz-apple-pay": "2.0.39-rc.0",
30
- "@akinon/pz-b2b": "2.0.39-rc.0",
31
- "@akinon/pz-basket-gift-pack": "2.0.39-rc.0",
32
- "@akinon/pz-bkm": "2.0.39-rc.0",
33
- "@akinon/pz-checkout-gift-pack": "2.0.39-rc.0",
34
- "@akinon/pz-click-collect": "2.0.39-rc.0",
35
- "@akinon/pz-credit-payment": "2.0.39-rc.0",
36
- "@akinon/pz-cybersource-uc": "2.0.39-rc.0",
37
- "@akinon/pz-flow-payment": "2.0.39-rc.0",
38
- "@akinon/pz-google-pay": "2.0.39-rc.0",
39
- "@akinon/pz-gpay": "2.0.39-rc.0",
40
- "@akinon/pz-haso": "2.0.39-rc.0",
41
- "@akinon/pz-hepsipay": "2.0.39-rc.0",
42
- "@akinon/pz-masterpass": "2.0.39-rc.0",
43
- "@akinon/pz-masterpass-rest": "2.0.39-rc.0",
44
- "@akinon/pz-multi-basket": "2.0.39-rc.0",
45
- "@akinon/pz-one-click-checkout": "2.0.39-rc.0",
46
- "@akinon/pz-otp": "2.0.39-rc.0",
47
- "@akinon/pz-pay-on-delivery": "2.0.39-rc.0",
48
- "@akinon/pz-saved-card": "2.0.39-rc.0",
49
- "@akinon/pz-similar-products": "2.0.39-rc.0",
50
- "@akinon/pz-tabby-extension": "2.0.39-rc.0",
51
- "@akinon/pz-tamara-extension": "2.0.39-rc.0",
52
- "@akinon/pz-theme": "2.0.39-rc.0",
53
- "@akinon/pz-virtual-try-on": "2.0.39-rc.0",
27
+ "@akinon/next": "2.0.39",
28
+ "@akinon/pz-akifast": "2.0.39",
29
+ "@akinon/pz-apple-pay": "2.0.39",
30
+ "@akinon/pz-b2b": "2.0.39",
31
+ "@akinon/pz-basket-gift-pack": "2.0.39",
32
+ "@akinon/pz-bkm": "2.0.39",
33
+ "@akinon/pz-checkout-gift-pack": "2.0.39",
34
+ "@akinon/pz-click-collect": "2.0.39",
35
+ "@akinon/pz-credit-payment": "2.0.39",
36
+ "@akinon/pz-cybersource-uc": "2.0.39",
37
+ "@akinon/pz-flow-payment": "2.0.39",
38
+ "@akinon/pz-google-pay": "2.0.39",
39
+ "@akinon/pz-gpay": "2.0.39",
40
+ "@akinon/pz-haso": "2.0.39",
41
+ "@akinon/pz-hepsipay": "2.0.39",
42
+ "@akinon/pz-masterpass": "2.0.39",
43
+ "@akinon/pz-masterpass-rest": "2.0.39",
44
+ "@akinon/pz-multi-basket": "2.0.39",
45
+ "@akinon/pz-one-click-checkout": "2.0.39",
46
+ "@akinon/pz-otp": "2.0.39",
47
+ "@akinon/pz-pay-on-delivery": "2.0.39",
48
+ "@akinon/pz-saved-card": "2.0.39",
49
+ "@akinon/pz-similar-products": "2.0.39",
50
+ "@akinon/pz-tabby-extension": "2.0.39",
51
+ "@akinon/pz-tamara-extension": "2.0.39",
52
+ "@akinon/pz-theme": "2.0.39",
53
+ "@akinon/pz-virtual-try-on": "2.0.39",
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.39-rc.0",
77
+ "@akinon/eslint-plugin-projectzero": "2.0.39",
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",
@@ -1,6 +1,8 @@
1
1
  import AccountBackButton from '@theme/views/account/back-button';
2
2
  import AccountMenu from '@theme/views/account/account-menu';
3
- import ThemePlaceholder from '@akinon/pz-theme/src/theme-placeholder';
3
+ import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
4
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
5
+ import { buildAccountPageContext } from '@akinon/pz-theme/src/chrome/page-context';
4
6
  import { auth } from 'auth';
5
7
  import { ROUTES } from 'routes';
6
8
  import { redirect } from '@akinon/next/utils/redirect';
@@ -21,7 +23,16 @@ export default async function AccountLayout({
21
23
  <AccountMenu />
22
24
  <div className="w-full flex-1">
23
25
  <AccountBackButton />
24
- <ThemePlaceholder slug="account-page-body" />
26
+ {/* The session is already awaited above, so the account context costs
27
+ no extra fetch. Profile-only fields (phone, gender) stay empty
28
+ until a live provider merges them in. */}
29
+ <ChromeSlot
30
+ slug={PLACEHOLDER_SLUGS.accountShell}
31
+ pageContext={buildAccountPageContext({
32
+ path: ROUTES.ACCOUNT,
33
+ sessionUser: session.user as Record<string, unknown>
34
+ })}
35
+ />
25
36
  {children}
26
37
  </div>
27
38
  </div>
@@ -1,5 +1,29 @@
1
1
  import React from 'react';
2
+ import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
3
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
4
+ import { LiveAccountOrderPageContext } from '@akinon/pz-theme/src/chrome/live-order-page-context';
2
5
 
3
- export default function Layout({ children }: { children: React.ReactNode }) {
4
- return <div>{children}</div>;
6
+ /**
7
+ * Account order detail. Publishes the SAME `order` root as the success page,
8
+ * so a composition authored on one resolves on the other.
9
+ */
10
+ export default async function Layout({
11
+ children,
12
+ params
13
+ }: {
14
+ children: React.ReactNode;
15
+ params: Promise<{ id: string }>;
16
+ }) {
17
+ const { id } = await params;
18
+
19
+ return (
20
+ <div>
21
+ <LiveAccountOrderPageContext orderId={id}>
22
+ <ChromeSlot
23
+ slug={PLACEHOLDER_SLUGS.accountOrderDetail}
24
+ fallback={children}
25
+ />
26
+ </LiveAccountOrderPageContext>
27
+ </div>
28
+ );
5
29
  }
@@ -0,0 +1,25 @@
1
+ import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
2
+ import { LiveBasketPageContext } from '@akinon/pz-theme/src/chrome/live-basket-page-context';
3
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
4
+ import { ROUTES } from '@theme/routes';
5
+
6
+ /**
7
+ * The basket body is handed to the theme editor here rather than in page.tsx,
8
+ * because the slot is an async server component and the page is a client one.
9
+ * With no composition published the slot renders the page untouched.
10
+ *
11
+ * The provider sits above the slot so the composition binds the shopper's live
12
+ * basket: the basket is session-scoped and has no server data module, so a
13
+ * server-built context would be a snapshot that never moves.
14
+ */
15
+ export default function BasketLayout({
16
+ children
17
+ }: {
18
+ children: React.ReactNode;
19
+ }) {
20
+ return (
21
+ <LiveBasketPageContext path={ROUTES.BASKET}>
22
+ <ChromeSlot slug={PLACEHOLDER_SLUGS.basket} fallback={children} />
23
+ </LiveBasketPageContext>
24
+ );
25
+ }
@@ -2,7 +2,7 @@ import { getCategoryData } from '@akinon/next/data/server';
2
2
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { ResolvedPageProps } from '@akinon/next/types';
4
4
  import CategoryLayout from '@theme/views/category/layout';
5
- import { buildListingPageContext } from '@theme/utils/theme-page-context';
5
+ import { buildListingPageContext } from '@akinon/pz-theme/src/chrome/page-context';
6
6
  import { notFound } from 'next/navigation';
7
7
 
8
8
  async function Page({ params, searchParams }: ResolvedPageProps<{ pk: number }>) {
@@ -1,5 +1,7 @@
1
1
  'use client';
2
2
 
3
+ import './configure-page-context';
4
+
3
5
  export default function ClientRoot({
4
6
  children
5
7
  }: {
@@ -0,0 +1,17 @@
1
+ import { configurePageContextRoutes } from '@akinon/pz-theme/src/chrome/page-context';
2
+ import { ROUTES, ORDER_ROUTES, ACCOUNT_ROUTES } from '@theme/routes';
3
+
4
+ /**
5
+ * The packaged page-context builders default to `/basket`; this storefront
6
+ * routes it at `/baskets/basket`. Without this the published context would
7
+ * carry a basket path no link block could follow.
8
+ *
9
+ * Imported from BOTH the server layout and the client root: the routes live in
10
+ * module state, and the client bundle gets its own copy of that module.
11
+ */
12
+ configurePageContextRoutes({
13
+ home: ROUTES.HOME,
14
+ basket: ROUTES.BASKET,
15
+ checkout: ORDER_ROUTES.CHECKOUT,
16
+ account: ACCOUNT_ROUTES.ACCOUNT
17
+ });
@@ -1,3 +1,6 @@
1
+ import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
2
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
3
+ import { buildFlatPageContext } from '@akinon/pz-theme/src/chrome/page-context';
1
4
  import { getFlatPageData, getSeoData } from '@akinon/next/data/server';
2
5
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
6
  import {
@@ -65,9 +68,17 @@ async function Page({ params }: ResolvedPageProps<{ pk: number }>) {
65
68
 
66
69
  return (
67
70
  <div className="container mx-auto py-6">
68
- <div
69
- className="mx-auto prose prose-headings:text-primary"
70
- dangerouslySetInnerHTML={{ __html: data.flat_page.content }}
71
+ <ChromeSlot
72
+ slug={PLACEHOLDER_SLUGS.flatPage}
73
+ pageContext={buildFlatPageContext(
74
+ data.flat_page as unknown as Record<string, unknown>
75
+ )}
76
+ fallback={
77
+ <div
78
+ className="mx-auto prose prose-headings:text-primary"
79
+ dangerouslySetInnerHTML={{ __html: data.flat_page.content }}
80
+ />
81
+ }
71
82
  />
72
83
  </div>
73
84
  );
@@ -16,6 +16,7 @@ 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 './configure-page-context';
19
20
 
20
21
  export const viewport: Viewport = {
21
22
  width: 'device-width',
@@ -3,7 +3,7 @@ import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { ResolvedPageProps } from '@akinon/next/types';
4
4
  import CategoryLayout from '@theme/views/category/layout';
5
5
  import { ROUTES } from '@theme/routes';
6
- import { buildListingPageContext } from '@theme/utils/theme-page-context';
6
+ import { buildListingPageContext } from '@akinon/pz-theme/src/chrome/page-context';
7
7
 
8
8
  async function Page({ searchParams }: ResolvedPageProps) {
9
9
  const data = await getListData({ searchParams });
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
3
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
4
+ import { LiveCheckoutPageContext } from '@akinon/pz-theme/src/chrome/live-checkout-page-context';
5
+
6
+ /**
7
+ * Checkout is code-owned: only the zones above and below the flow are
8
+ * composable, so neither slot takes `fallback={children}` — a published
9
+ * composition must never be able to replace the payment steps.
10
+ */
11
+ export default function CheckoutLayout({
12
+ children
13
+ }: {
14
+ children: React.ReactNode;
15
+ }) {
16
+ return (
17
+ <LiveCheckoutPageContext>
18
+ <ChromeSlot slug={PLACEHOLDER_SLUGS.checkoutTop} />
19
+ {children}
20
+ <ChromeSlot slug={PLACEHOLDER_SLUGS.checkoutBottom} />
21
+ </LiveCheckoutPageContext>
22
+ );
23
+ }
@@ -1,5 +1,27 @@
1
1
  import React from 'react';
2
+ import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
3
+ import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
4
+ import { LiveOrderSuccessPageContext } from '@akinon/pz-theme/src/chrome/live-order-page-context';
2
5
 
3
- export default function Layout({ children }: { children: React.ReactNode }) {
4
- return <div>{children}</div>;
6
+ /**
7
+ * The order-success body is composable and binds the shopper's own order.
8
+ * There is no server order fetcher, so the context comes from the client
9
+ * provider — which also keeps the order out of any cached shell.
10
+ */
11
+ export default async function Layout({
12
+ children,
13
+ params
14
+ }: {
15
+ children: React.ReactNode;
16
+ params: Promise<{ token: string }>;
17
+ }) {
18
+ const { token } = await params;
19
+
20
+ return (
21
+ <div>
22
+ <LiveOrderSuccessPageContext token={token}>
23
+ <ChromeSlot slug={PLACEHOLDER_SLUGS.orderSuccess} fallback={children} />
24
+ </LiveOrderSuccessPageContext>
25
+ </div>
26
+ );
5
27
  }
@@ -2,7 +2,7 @@ import 'server-only';
2
2
 
3
3
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
4
4
  import ThemePlaceholder from '@akinon/pz-theme/src/theme-placeholder';
5
- import { buildHomepagePageContext } from '@theme/utils/theme-page-context';
5
+ import { buildHomepagePageContext } from '@akinon/pz-theme/src/chrome/page-context';
6
6
 
7
7
  export const dynamic = 'force-static';
8
8
  export const revalidate = 600;
@@ -1,7 +1,7 @@
1
1
  import ThemePlaceholder from '@akinon/pz-theme/src/theme-placeholder';
2
2
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { ResolvedPageProps } from '@akinon/next/types';
4
- import { buildCustomPageContext } from '@theme/utils/theme-page-context';
4
+ import { buildCustomPageContext } from '@akinon/pz-theme/src/chrome/page-context';
5
5
 
6
6
  export const dynamic = 'force-dynamic';
7
7
 
@@ -2,6 +2,7 @@ import { getSpecialPageData } from '@akinon/next/data/server';
2
2
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { ResolvedPageProps } from '@akinon/next/types';
4
4
  import CategoryLayout from '@theme/views/category/layout';
5
+ import { buildListingPageContext } from '@akinon/pz-theme/src/chrome/page-context';
5
6
  import SpecialPageBanner from '@theme/widgets/special-page-banner';
6
7
  import SpecialPageCarousel from '@theme/widgets/special-page-carousel';
7
8
  import { notFound } from 'next/navigation';
@@ -12,7 +13,15 @@ async function Page({ params, searchParams }: ResolvedPageProps<{ pk: number }>)
12
13
 
13
14
  return (
14
15
  <>
15
- <CategoryLayout data={data}>
16
+ <CategoryLayout
17
+ data={data}
18
+ pageContext={buildListingPageContext({
19
+ data,
20
+ pageType: 'special',
21
+ path: `/special-page/${params.pk}`,
22
+ title: (data.special_page as { name?: string } | undefined)?.name
23
+ })}
24
+ >
16
25
  {data.special_page && (
17
26
  <>
18
27
  <SpecialPageBanner data={data.special_page} />
@@ -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