@akinon/projectzero 2.0.43-rc.0 → 2.0.44
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 +8 -4
- package/app-template/.env.example +0 -1
- package/app-template/AGENTS.md +0 -8
- package/app-template/CHANGELOG.md +64 -78
- 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/src/app/[pz]/orders/checkout/layout.tsx +30 -11
- package/app-template/src/app/[pz]/orders/checkout/page.tsx +31 -18
- package/app-template/src/components/checkbox.tsx +21 -2
- 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/checkout/__tests__/part-style-reachability.test.ts +121 -0
- package/app-template/src/views/checkout/step-button.tsx +13 -2
- package/app-template/src/views/checkout/step-list.tsx +5 -1
- package/app-template/src/views/checkout/steps/payment/agreements.tsx +9 -1
- package/app-template/src/views/checkout/steps/payment/index.tsx +10 -2
- package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +2 -0
- package/app-template/src/views/checkout/steps/payment/options/funds-transfer.tsx +2 -0
- package/app-template/src/views/checkout/steps/payment/payment-header.tsx +5 -1
- package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +16 -4
- package/app-template/src/views/checkout/steps/shipping/addresses.tsx +2 -1
- package/app-template/src/views/checkout/steps/shipping/index.tsx +2 -0
- package/app-template/src/views/checkout/steps/shipping/shipping-options.tsx +2 -0
- package/app-template/src/views/checkout/summary.tsx +56 -18
- package/app-template/src/views/checkout/variants/__tests__/registry.test.tsx +82 -0
- package/app-template/src/views/checkout/variants/__tests__/use-resolved-config.test.tsx +208 -0
- package/app-template/src/views/checkout/variants/basket-and-checkout/index.tsx +7 -4
- package/app-template/src/views/checkout/variants/multi-step/index.tsx +7 -2
- package/app-template/src/views/checkout/variants/one-page/accordion-section.tsx +22 -0
- package/app-template/src/views/checkout/variants/one-page/index.tsx +7 -4
- package/app-template/src/views/checkout/variants/one-page/one-page-summary.tsx +80 -18
- package/app-template/src/views/checkout/variants/one-page/payment-options-grid.tsx +34 -22
- package/app-template/src/views/checkout/variants/one-page/sections/address-section.tsx +2 -0
- package/app-template/src/views/checkout/variants/one-page/sections/payment-section.tsx +2 -0
- package/app-template/src/views/checkout/variants/one-page/sections/shipping-section.tsx +2 -0
- package/app-template/src/views/checkout/variants/registry.ts +13 -2
- package/app-template/src/views/checkout/variants/use-resolved-config.ts +77 -5
- 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/api/client-env/route.ts +0 -5
- package/app-template/src/app/global-error.tsx +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
# @akinon/projectzero
|
|
2
2
|
|
|
3
|
-
## 2.0.
|
|
3
|
+
## 2.0.44
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
- 867e7873: ZERO-4731: Ship the composable checkout wiring in the CLI scaffold. 2.0.43 published the renderer half before the scaffold port merged, so a generated project still referenced the removed checkout summary placeholder and could not type-check.
|
|
8
|
+
|
|
9
|
+
## 2.0.43
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- c44604f6a: ZERO-4731: Wire the composable checkout into the CLI scaffold's checkout route
|
|
10
14
|
|
|
11
15
|
## 2.0.42
|
|
12
16
|
|
|
@@ -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
|
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,83 +1,69 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
-
## 2.0.
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- Updated dependencies [
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
- @akinon/pz-
|
|
55
|
-
- @akinon/
|
|
56
|
-
- @akinon/pz-
|
|
57
|
-
- @akinon/pz-masterpass-rest@2.0.43
|
|
58
|
-
- @akinon/pz-
|
|
59
|
-
- @akinon/pz-
|
|
60
|
-
- @akinon/pz-
|
|
61
|
-
- @akinon/pz-
|
|
62
|
-
- @akinon/pz-
|
|
63
|
-
- @akinon/pz-
|
|
64
|
-
- @akinon/pz-
|
|
65
|
-
- @akinon/pz-
|
|
66
|
-
- @akinon/pz-
|
|
67
|
-
- @akinon/pz-bkm@2.0.43-rc.0
|
|
68
|
-
- @akinon/pz-otp@2.0.43-rc.0
|
|
69
|
-
- @akinon/pz-similar-products@2.0.43-rc.0
|
|
70
|
-
- @akinon/pz-virtual-try-on@2.0.43-rc.0
|
|
71
|
-
- @akinon/pz-theme@2.0.43-rc.0
|
|
72
|
-
- @akinon/pz-akifast@2.0.43-rc.0
|
|
73
|
-
- @akinon/pz-apple-pay@2.0.43-rc.0
|
|
74
|
-
- @akinon/pz-cybersource-uc@2.0.43-rc.0
|
|
75
|
-
- @akinon/pz-flow-payment@2.0.43-rc.0
|
|
76
|
-
- @akinon/pz-google-pay@2.0.43-rc.0
|
|
77
|
-
- @akinon/pz-haso@2.0.43-rc.0
|
|
78
|
-
- @akinon/pz-hepsipay@2.0.43-rc.0
|
|
79
|
-
- @akinon/pz-saved-card@2.0.43-rc.0
|
|
80
|
-
- @akinon/pz-tamara-extension@2.0.43-rc.0
|
|
3
|
+
## 2.0.44
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @akinon/next@2.0.44
|
|
8
|
+
- @akinon/pz-akifast@2.0.44
|
|
9
|
+
- @akinon/pz-apple-pay@2.0.44
|
|
10
|
+
- @akinon/pz-b2b@2.0.44
|
|
11
|
+
- @akinon/pz-basket-gift-pack@2.0.44
|
|
12
|
+
- @akinon/pz-bkm@2.0.44
|
|
13
|
+
- @akinon/pz-checkout-gift-pack@2.0.44
|
|
14
|
+
- @akinon/pz-click-collect@2.0.44
|
|
15
|
+
- @akinon/pz-credit-payment@2.0.44
|
|
16
|
+
- @akinon/pz-cybersource-uc@2.0.44
|
|
17
|
+
- @akinon/pz-flow-payment@2.0.44
|
|
18
|
+
- @akinon/pz-google-pay@2.0.44
|
|
19
|
+
- @akinon/pz-gpay@2.0.44
|
|
20
|
+
- @akinon/pz-haso@2.0.44
|
|
21
|
+
- @akinon/pz-hepsipay@2.0.44
|
|
22
|
+
- @akinon/pz-masterpass@2.0.44
|
|
23
|
+
- @akinon/pz-masterpass-rest@2.0.44
|
|
24
|
+
- @akinon/pz-multi-basket@2.0.44
|
|
25
|
+
- @akinon/pz-one-click-checkout@2.0.44
|
|
26
|
+
- @akinon/pz-otp@2.0.44
|
|
27
|
+
- @akinon/pz-pay-on-delivery@2.0.44
|
|
28
|
+
- @akinon/pz-saved-card@2.0.44
|
|
29
|
+
- @akinon/pz-similar-products@2.0.44
|
|
30
|
+
- @akinon/pz-tabby-extension@2.0.44
|
|
31
|
+
- @akinon/pz-tamara-extension@2.0.44
|
|
32
|
+
- @akinon/pz-theme@2.0.44
|
|
33
|
+
- @akinon/pz-virtual-try-on@2.0.44
|
|
34
|
+
|
|
35
|
+
## 2.0.43
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [0e384d73c]
|
|
40
|
+
- @akinon/pz-theme@2.0.43
|
|
41
|
+
- @akinon/next@2.0.43
|
|
42
|
+
- @akinon/pz-akifast@2.0.43
|
|
43
|
+
- @akinon/pz-apple-pay@2.0.43
|
|
44
|
+
- @akinon/pz-b2b@2.0.43
|
|
45
|
+
- @akinon/pz-basket-gift-pack@2.0.43
|
|
46
|
+
- @akinon/pz-bkm@2.0.43
|
|
47
|
+
- @akinon/pz-checkout-gift-pack@2.0.43
|
|
48
|
+
- @akinon/pz-click-collect@2.0.43
|
|
49
|
+
- @akinon/pz-credit-payment@2.0.43
|
|
50
|
+
- @akinon/pz-cybersource-uc@2.0.43
|
|
51
|
+
- @akinon/pz-flow-payment@2.0.43
|
|
52
|
+
- @akinon/pz-google-pay@2.0.43
|
|
53
|
+
- @akinon/pz-gpay@2.0.43
|
|
54
|
+
- @akinon/pz-haso@2.0.43
|
|
55
|
+
- @akinon/pz-hepsipay@2.0.43
|
|
56
|
+
- @akinon/pz-masterpass@2.0.43
|
|
57
|
+
- @akinon/pz-masterpass-rest@2.0.43
|
|
58
|
+
- @akinon/pz-multi-basket@2.0.43
|
|
59
|
+
- @akinon/pz-one-click-checkout@2.0.43
|
|
60
|
+
- @akinon/pz-otp@2.0.43
|
|
61
|
+
- @akinon/pz-pay-on-delivery@2.0.43
|
|
62
|
+
- @akinon/pz-saved-card@2.0.43
|
|
63
|
+
- @akinon/pz-similar-products@2.0.43
|
|
64
|
+
- @akinon/pz-tabby-extension@2.0.43
|
|
65
|
+
- @akinon/pz-tamara-extension@2.0.43
|
|
66
|
+
- @akinon/pz-virtual-try-on@2.0.43
|
|
81
67
|
|
|
82
68
|
## 2.0.42
|
|
83
69
|
|
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.
|
|
3
|
+
"version": "2.0.44",
|
|
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.
|
|
28
|
-
"@akinon/pz-akifast": "2.0.
|
|
29
|
-
"@akinon/pz-apple-pay": "2.0.
|
|
30
|
-
"@akinon/pz-b2b": "2.0.
|
|
31
|
-
"@akinon/pz-basket-gift-pack": "2.0.
|
|
32
|
-
"@akinon/pz-bkm": "2.0.
|
|
33
|
-
"@akinon/pz-checkout-gift-pack": "2.0.
|
|
34
|
-
"@akinon/pz-click-collect": "2.0.
|
|
35
|
-
"@akinon/pz-credit-payment": "2.0.
|
|
36
|
-
"@akinon/pz-cybersource-uc": "2.0.
|
|
37
|
-
"@akinon/pz-flow-payment": "2.0.
|
|
38
|
-
"@akinon/pz-google-pay": "2.0.
|
|
39
|
-
"@akinon/pz-gpay": "2.0.
|
|
40
|
-
"@akinon/pz-haso": "2.0.
|
|
41
|
-
"@akinon/pz-hepsipay": "2.0.
|
|
42
|
-
"@akinon/pz-masterpass": "2.0.
|
|
43
|
-
"@akinon/pz-masterpass-rest": "2.0.
|
|
44
|
-
"@akinon/pz-multi-basket": "2.0.
|
|
45
|
-
"@akinon/pz-one-click-checkout": "2.0.
|
|
46
|
-
"@akinon/pz-otp": "2.0.
|
|
47
|
-
"@akinon/pz-pay-on-delivery": "2.0.
|
|
48
|
-
"@akinon/pz-saved-card": "2.0.
|
|
49
|
-
"@akinon/pz-similar-products": "2.0.
|
|
50
|
-
"@akinon/pz-tabby-extension": "2.0.
|
|
51
|
-
"@akinon/pz-tamara-extension": "2.0.
|
|
52
|
-
"@akinon/pz-theme": "2.0.
|
|
53
|
-
"@akinon/pz-virtual-try-on": "2.0.
|
|
27
|
+
"@akinon/next": "2.0.44",
|
|
28
|
+
"@akinon/pz-akifast": "2.0.44",
|
|
29
|
+
"@akinon/pz-apple-pay": "2.0.44",
|
|
30
|
+
"@akinon/pz-b2b": "2.0.44",
|
|
31
|
+
"@akinon/pz-basket-gift-pack": "2.0.44",
|
|
32
|
+
"@akinon/pz-bkm": "2.0.44",
|
|
33
|
+
"@akinon/pz-checkout-gift-pack": "2.0.44",
|
|
34
|
+
"@akinon/pz-click-collect": "2.0.44",
|
|
35
|
+
"@akinon/pz-credit-payment": "2.0.44",
|
|
36
|
+
"@akinon/pz-cybersource-uc": "2.0.44",
|
|
37
|
+
"@akinon/pz-flow-payment": "2.0.44",
|
|
38
|
+
"@akinon/pz-google-pay": "2.0.44",
|
|
39
|
+
"@akinon/pz-gpay": "2.0.44",
|
|
40
|
+
"@akinon/pz-haso": "2.0.44",
|
|
41
|
+
"@akinon/pz-hepsipay": "2.0.44",
|
|
42
|
+
"@akinon/pz-masterpass": "2.0.44",
|
|
43
|
+
"@akinon/pz-masterpass-rest": "2.0.44",
|
|
44
|
+
"@akinon/pz-multi-basket": "2.0.44",
|
|
45
|
+
"@akinon/pz-one-click-checkout": "2.0.44",
|
|
46
|
+
"@akinon/pz-otp": "2.0.44",
|
|
47
|
+
"@akinon/pz-pay-on-delivery": "2.0.44",
|
|
48
|
+
"@akinon/pz-saved-card": "2.0.44",
|
|
49
|
+
"@akinon/pz-similar-products": "2.0.44",
|
|
50
|
+
"@akinon/pz-tabby-extension": "2.0.44",
|
|
51
|
+
"@akinon/pz-tamara-extension": "2.0.44",
|
|
52
|
+
"@akinon/pz-theme": "2.0.44",
|
|
53
|
+
"@akinon/pz-virtual-try-on": "2.0.44",
|
|
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.
|
|
77
|
+
"@akinon/eslint-plugin-projectzero": "2.0.44",
|
|
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",
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ChromeSlot from '@akinon/pz-theme/src/chrome/chrome-slot';
|
|
3
|
-
import
|
|
3
|
+
import ComposableRegion from '@akinon/pz-theme/src/chrome/composable-region';
|
|
4
4
|
import { PLACEHOLDER_SLUGS } from '@akinon/pz-theme/src/chrome/placeholder-slugs';
|
|
5
5
|
import { LiveCheckoutPageContext } from '@akinon/pz-theme/src/chrome/live-checkout-page-context';
|
|
6
|
+
import { CheckoutPiecesProvider } from '@akinon/pz-theme/src/chrome/checkout-pieces-provider';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
* Checkout
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Checkout internals are sealed, checkout placement is composable. The body
|
|
10
|
+
* slot's composition positions the real flow, steps and summary through
|
|
11
|
+
* checkout outlet blocks; the flow itself always renders — in an outlet when
|
|
12
|
+
* one claims it, in its default place below otherwise. No slot takes the
|
|
13
|
+
* flow as its fallback: a composition may move the payment steps, never
|
|
14
|
+
* replace them. Ordering is load-bearing: the body slot mounts BEFORE
|
|
15
|
+
* `children`, so outlet targets register before the flow's first paint.
|
|
16
|
+
*
|
|
17
|
+
* The body's takeover is offered on the flow itself, by the region wrapping
|
|
18
|
+
* it: the designer hovers the real checkout content and gets the same
|
|
19
|
+
* affordance every other page has, instead of a dashed band above content
|
|
20
|
+
* that answers a hover with nothing. Starting a composition that way is why
|
|
21
|
+
* the body slot's own band is suppressed — one slug, one CTA.
|
|
12
22
|
*/
|
|
13
23
|
export default function CheckoutLayout({
|
|
14
24
|
children
|
|
@@ -17,12 +27,21 @@ export default function CheckoutLayout({
|
|
|
17
27
|
}) {
|
|
18
28
|
return (
|
|
19
29
|
<LiveCheckoutPageContext>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
<CheckoutPiecesProvider>
|
|
31
|
+
<ChromeSlot slug={PLACEHOLDER_SLUGS.checkoutTop} />
|
|
32
|
+
<ChromeSlot
|
|
33
|
+
slug={PLACEHOLDER_SLUGS.checkoutBody}
|
|
34
|
+
emptyZoneBand={false}
|
|
35
|
+
/>
|
|
36
|
+
<ComposableRegion
|
|
37
|
+
slug={PLACEHOLDER_SLUGS.checkoutBody}
|
|
38
|
+
label="The checkout flow stays code-owned — take this area over to arrange where the flow, steps and summary render"
|
|
39
|
+
composedNote="The checkout flow renders here until a checkout flow outlet places it — it stays code-owned and inert on the canvas"
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</ComposableRegion>
|
|
43
|
+
<ChromeSlot slug={PLACEHOLDER_SLUGS.checkoutBottom} />
|
|
44
|
+
</CheckoutPiecesProvider>
|
|
26
45
|
</LiveCheckoutPageContext>
|
|
27
46
|
);
|
|
28
47
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useEffect, useMemo } from 'react';
|
|
3
|
+
import { useEffect, useMemo, type ReactNode } from 'react';
|
|
4
4
|
import dynamic from 'next/dynamic';
|
|
5
|
+
import { CheckoutPiece } from '@akinon/pz-theme/src/chrome/checkout-piece';
|
|
6
|
+
import { isThemeEditorDesigner } from '@akinon/pz-theme/src/chrome/checkout-pieces';
|
|
5
7
|
import { useAppDispatch } from '@akinon/next/redux/hooks';
|
|
6
8
|
import { resetCheckoutState } from '@akinon/next/redux/reducers/checkout';
|
|
7
9
|
import {
|
|
@@ -66,21 +68,31 @@ const Checkout = () => {
|
|
|
66
68
|
UNIFIED_VARIANTS.has(variantId) ||
|
|
67
69
|
UNIFIED_VARIANTS.has(baselineVariant ?? '');
|
|
68
70
|
|
|
69
|
-
|
|
71
|
+
// The designer canvas edits the checkout page itself — an empty test basket
|
|
72
|
+
// must never navigate the iframe to the basket page, or the composition
|
|
73
|
+
// being authored disappears mid-edit. Live keeps the redirect untouched.
|
|
74
|
+
if (
|
|
75
|
+
!isUnifiedCheckout &&
|
|
76
|
+
checkoutData?.redirect_url?.includes('basket') &&
|
|
77
|
+
!isThemeEditorDesigner()
|
|
78
|
+
) {
|
|
70
79
|
router.push(ROUTES.BASKET);
|
|
71
80
|
return null;
|
|
72
81
|
}
|
|
73
82
|
|
|
83
|
+
// One stable CheckoutPiece instance hosts every gate below: the latch runs
|
|
84
|
+
// once, and the loading-to-variant transition is a child swap under the same
|
|
85
|
+
// (possibly portaled) position — no remounts mid-session.
|
|
86
|
+
let body: ReactNode;
|
|
87
|
+
|
|
74
88
|
if (checkoutData?.template_name === 'orders/index.html') {
|
|
75
|
-
|
|
89
|
+
body = (
|
|
76
90
|
<section className="container px-4 my-7 md:mt-20 lg:px-0 lg:mx-auto">
|
|
77
91
|
<CheckoutAuth />
|
|
78
92
|
</section>
|
|
79
93
|
);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (isError) {
|
|
83
|
-
return (
|
|
94
|
+
} else if (isError) {
|
|
95
|
+
body = (
|
|
84
96
|
<div className="flex flex-col items-center justify-center h-80">
|
|
85
97
|
<div>{t('checkout.error.title')}</div>
|
|
86
98
|
<div className="mt-5">
|
|
@@ -90,19 +102,20 @@ const Checkout = () => {
|
|
|
90
102
|
</div>
|
|
91
103
|
</div>
|
|
92
104
|
);
|
|
105
|
+
} else if (isResetStateLoading || isCheckoutLoading) {
|
|
106
|
+
body =
|
|
107
|
+
variantId === 'multi-step' ? (
|
|
108
|
+
<div className="flex flex-col items-center justify-center h-80">
|
|
109
|
+
<LoaderSpinner />
|
|
110
|
+
</div>
|
|
111
|
+
) : (
|
|
112
|
+
<CheckoutOnePageSkeleton />
|
|
113
|
+
);
|
|
114
|
+
} else {
|
|
115
|
+
body = <CheckoutVariant options={variantOptions} />;
|
|
93
116
|
}
|
|
94
117
|
|
|
95
|
-
|
|
96
|
-
return variantId === 'multi-step' ? (
|
|
97
|
-
<div className="flex flex-col items-center justify-center h-80">
|
|
98
|
-
<LoaderSpinner />
|
|
99
|
-
</div>
|
|
100
|
-
) : (
|
|
101
|
-
<CheckoutOnePageSkeleton />
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return <CheckoutVariant options={variantOptions} />;
|
|
118
|
+
return <CheckoutPiece piece="flow">{body}</CheckoutPiece>;
|
|
106
119
|
};
|
|
107
120
|
|
|
108
121
|
export default Checkout;
|
|
@@ -3,10 +3,29 @@ import { CheckboxProps } from '@theme/components/types';
|
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
|
|
5
5
|
const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
6
|
-
|
|
6
|
+
// Part styling names the ROW, not the native box: when a caller stamps a
|
|
7
|
+
// checkbox (see `partAttrs`), the attributes ride the label wrapper so the
|
|
8
|
+
// whole line — box, text, links, spacing — is restylable, and the input
|
|
9
|
+
// keeps every other prop it has today. No caller that omits them is
|
|
10
|
+
// affected: both values are simply undefined and React drops them.
|
|
11
|
+
const {
|
|
12
|
+
children,
|
|
13
|
+
checked = false,
|
|
14
|
+
error,
|
|
15
|
+
'data-part': partName,
|
|
16
|
+
'data-state': partState,
|
|
17
|
+
...rest
|
|
18
|
+
} = props as CheckboxProps & {
|
|
19
|
+
'data-part'?: string;
|
|
20
|
+
'data-state'?: string;
|
|
21
|
+
};
|
|
7
22
|
|
|
8
23
|
return (
|
|
9
|
-
<label
|
|
24
|
+
<label
|
|
25
|
+
className={twMerge('flex flex-col text-xs', props.className)}
|
|
26
|
+
data-part={partName}
|
|
27
|
+
data-state={partState}
|
|
28
|
+
>
|
|
10
29
|
<div className="flex items-center">
|
|
11
30
|
<input
|
|
12
31
|
data-testid="checkbox"
|
|
@@ -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
|
|