@akinon/projectzero 1.116.0 → 1.117.0-rc.1
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 +9 -0
- package/app-template/.env.example +1 -0
- package/app-template/CHANGELOG.md +104 -0
- package/app-template/README.md +25 -1
- package/app-template/package.json +28 -27
- package/app-template/public/locales/en/account.json +3 -1
- package/app-template/public/locales/en/product.json +18 -0
- package/app-template/public/locales/tr/account.json +3 -1
- package/app-template/public/locales/tr/product.json +18 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/page.tsx +20 -1
- package/app-template/src/app/api/barcode-search/route.ts +1 -0
- package/app-template/src/components/modal.tsx +2 -0
- package/app-template/src/components/select.tsx +1 -1
- package/app-template/src/hooks/index.ts +2 -0
- package/app-template/src/plugins.js +1 -0
- package/app-template/src/views/account/orders/order-detail-header.tsx +1 -1
- package/app-template/src/views/checkout/steps/shipping/address-box.tsx +30 -17
- package/app-template/src/views/checkout/steps/shipping/addresses.tsx +1 -1
- package/app-template/src/views/header/search/index.tsx +13 -5
- package/app-template/src/views/product/slider.tsx +84 -37
- package/commands/plugins.ts +4 -0
- package/dist/commands/plugins.js +256 -184
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @akinon/projectzero
|
|
2
2
|
|
|
3
|
+
## 1.117.0-rc.1
|
|
4
|
+
|
|
5
|
+
## 1.117.0-rc.0
|
|
6
|
+
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
- 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
|
|
10
|
+
- d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
|
|
11
|
+
|
|
3
12
|
## 1.116.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -7,6 +7,7 @@ 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
|
|
10
11
|
|
|
11
12
|
# LOG_LEVEL_DEV=debug # For more details, please refer to the Logging documentation.
|
|
12
13
|
|
|
@@ -1,5 +1,109 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
+
## 1.117.0-rc.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 36143125: ZERO-3987: Add barcode scanner functionality with modal and button
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [36143125]
|
|
12
|
+
- @akinon/pz-virtual-try-on@1.117.0-rc.1
|
|
13
|
+
- @akinon/next@1.117.0-rc.1
|
|
14
|
+
- @akinon/pz-akifast@1.117.0-rc.1
|
|
15
|
+
- @akinon/pz-apple-pay@1.117.0-rc.1
|
|
16
|
+
- @akinon/pz-b2b@1.117.0-rc.1
|
|
17
|
+
- @akinon/pz-basket-gift-pack@1.117.0-rc.1
|
|
18
|
+
- @akinon/pz-bkm@1.117.0-rc.1
|
|
19
|
+
- @akinon/pz-checkout-gift-pack@1.117.0-rc.1
|
|
20
|
+
- @akinon/pz-click-collect@1.117.0-rc.1
|
|
21
|
+
- @akinon/pz-credit-payment@1.117.0-rc.1
|
|
22
|
+
- @akinon/pz-cybersource-uc@1.117.0-rc.1
|
|
23
|
+
- @akinon/pz-flow-payment@1.117.0-rc.1
|
|
24
|
+
- @akinon/pz-google-pay@1.117.0-rc.1
|
|
25
|
+
- @akinon/pz-gpay@1.117.0-rc.1
|
|
26
|
+
- @akinon/pz-haso@1.117.0-rc.1
|
|
27
|
+
- @akinon/pz-hepsipay@1.117.0-rc.1
|
|
28
|
+
- @akinon/pz-masterpass@1.117.0-rc.1
|
|
29
|
+
- @akinon/pz-masterpass-rest@1.117.0-rc.1
|
|
30
|
+
- @akinon/pz-multi-basket@1.117.0-rc.1
|
|
31
|
+
- @akinon/pz-one-click-checkout@1.117.0-rc.1
|
|
32
|
+
- @akinon/pz-otp@1.117.0-rc.1
|
|
33
|
+
- @akinon/pz-pay-on-delivery@1.117.0-rc.1
|
|
34
|
+
- @akinon/pz-saved-card@1.117.0-rc.1
|
|
35
|
+
- @akinon/pz-similar-products@1.117.0-rc.1
|
|
36
|
+
- @akinon/pz-tabby-extension@1.117.0-rc.1
|
|
37
|
+
- @akinon/pz-tamara-extension@1.117.0-rc.1
|
|
38
|
+
|
|
39
|
+
## 1.117.0-rc.0
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- 4449f3a3: ZERO-3681: Add order details localization and improve order handling in AccountOrderDetail
|
|
44
|
+
- 1a8622a9: ZERO-3392: Implemented AI Search functionality and update env
|
|
45
|
+
- b55acb76: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
|
|
46
|
+
- 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
|
|
47
|
+
- 9f8cd3bc: ZERO-3449: AI Search Active Filters & Crop Style changes have been implemented
|
|
48
|
+
- 5fb34b5c: ZERO-3955: Add aspect ratio validation and error handling for image cropping
|
|
49
|
+
- d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
|
|
50
|
+
- b87517ff: ZERO-3680: Enhance select component styling to ensure focus state is consistent
|
|
51
|
+
- b05c3543: ZERO-2570: Category filters routes to absolute url
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies [5514352a]
|
|
56
|
+
- Updated dependencies [d2c0e759]
|
|
57
|
+
- Updated dependencies [86f2570b]
|
|
58
|
+
- Updated dependencies [90b1dd7a]
|
|
59
|
+
- Updated dependencies [5514352a]
|
|
60
|
+
- Updated dependencies [b55acb76]
|
|
61
|
+
- Updated dependencies [572f4f7b]
|
|
62
|
+
- Updated dependencies [143be2b9]
|
|
63
|
+
- Updated dependencies [c706a270]
|
|
64
|
+
- Updated dependencies [9f8cd3bc]
|
|
65
|
+
- Updated dependencies [0d33d9ac]
|
|
66
|
+
- Updated dependencies [644a2fa2]
|
|
67
|
+
- Updated dependencies [729fe756]
|
|
68
|
+
- Updated dependencies [5fb34b5c]
|
|
69
|
+
- Updated dependencies [88cb4f62]
|
|
70
|
+
- Updated dependencies [d99a6a7d]
|
|
71
|
+
- Updated dependencies [d7e5178b]
|
|
72
|
+
- Updated dependencies [187208d2]
|
|
73
|
+
- Updated dependencies [ee191e6f]
|
|
74
|
+
- Updated dependencies [4de5303c]
|
|
75
|
+
- Updated dependencies [89b9d839]
|
|
76
|
+
- Updated dependencies [95b139dc]
|
|
77
|
+
- Updated dependencies [3909d322]
|
|
78
|
+
- Updated dependencies [6b73b050]
|
|
79
|
+
- Updated dependencies [5ae86358]
|
|
80
|
+
- @akinon/pz-masterpass-rest@1.117.0-rc.0
|
|
81
|
+
- @akinon/next@1.117.0-rc.0
|
|
82
|
+
- @akinon/pz-masterpass@1.117.0-rc.0
|
|
83
|
+
- @akinon/pz-similar-products@1.117.0-rc.0
|
|
84
|
+
- @akinon/pz-virtual-try-on@1.117.0-rc.0
|
|
85
|
+
- @akinon/pz-akifast@1.117.0-rc.0
|
|
86
|
+
- @akinon/pz-apple-pay@1.117.0-rc.0
|
|
87
|
+
- @akinon/pz-b2b@1.117.0-rc.0
|
|
88
|
+
- @akinon/pz-basket-gift-pack@1.117.0-rc.0
|
|
89
|
+
- @akinon/pz-bkm@1.117.0-rc.0
|
|
90
|
+
- @akinon/pz-checkout-gift-pack@1.117.0-rc.0
|
|
91
|
+
- @akinon/pz-click-collect@1.117.0-rc.0
|
|
92
|
+
- @akinon/pz-credit-payment@1.117.0-rc.0
|
|
93
|
+
- @akinon/pz-cybersource-uc@1.117.0-rc.0
|
|
94
|
+
- @akinon/pz-flow-payment@1.117.0-rc.0
|
|
95
|
+
- @akinon/pz-google-pay@1.117.0-rc.0
|
|
96
|
+
- @akinon/pz-gpay@1.117.0-rc.0
|
|
97
|
+
- @akinon/pz-haso@1.117.0-rc.0
|
|
98
|
+
- @akinon/pz-hepsipay@1.117.0-rc.0
|
|
99
|
+
- @akinon/pz-multi-basket@1.117.0-rc.0
|
|
100
|
+
- @akinon/pz-one-click-checkout@1.117.0-rc.0
|
|
101
|
+
- @akinon/pz-otp@1.117.0-rc.0
|
|
102
|
+
- @akinon/pz-pay-on-delivery@1.117.0-rc.0
|
|
103
|
+
- @akinon/pz-saved-card@1.117.0-rc.0
|
|
104
|
+
- @akinon/pz-tabby-extension@1.117.0-rc.0
|
|
105
|
+
- @akinon/pz-tamara-extension@1.117.0-rc.0
|
|
106
|
+
|
|
3
107
|
## 1.116.0
|
|
4
108
|
|
|
5
109
|
### Minor Changes
|
package/app-template/README.md
CHANGED
|
@@ -12,6 +12,30 @@ 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
|
+
|
|
15
39
|
### Build
|
|
16
40
|
|
|
17
41
|
To build the app, run the following command:
|
|
@@ -19,7 +43,7 @@ To build the app, run the following command:
|
|
|
19
43
|
```bash
|
|
20
44
|
cd projectzeronext # Project root
|
|
21
45
|
yarn build
|
|
22
|
-
|
|
46
|
+
````
|
|
23
47
|
|
|
24
48
|
### Develop
|
|
25
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.117.0-rc.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -24,31 +24,32 @@
|
|
|
24
24
|
"test:middleware": "jest middleware-matcher.test.ts --bail"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@akinon/next": "1.
|
|
28
|
-
"@akinon/pz-akifast": "1.
|
|
29
|
-
"@akinon/pz-apple-pay": "1.
|
|
30
|
-
"@akinon/pz-b2b": "1.
|
|
31
|
-
"@akinon/pz-basket-gift-pack": "1.
|
|
32
|
-
"@akinon/pz-bkm": "1.
|
|
33
|
-
"@akinon/pz-checkout-gift-pack": "1.
|
|
34
|
-
"@akinon/pz-click-collect": "1.
|
|
35
|
-
"@akinon/pz-credit-payment": "1.
|
|
36
|
-
"@akinon/pz-cybersource-uc": "1.
|
|
37
|
-
"@akinon/pz-flow-payment": "1.
|
|
38
|
-
"@akinon/pz-
|
|
39
|
-
"@akinon/pz-
|
|
40
|
-
"@akinon/pz-
|
|
41
|
-
"@akinon/pz-
|
|
42
|
-
"@akinon/pz-masterpass
|
|
43
|
-
"@akinon/pz-
|
|
44
|
-
"@akinon/pz-
|
|
45
|
-
"@akinon/pz-
|
|
46
|
-
"@akinon/pz-
|
|
47
|
-
"@akinon/pz-
|
|
48
|
-
"@akinon/pz-
|
|
49
|
-
"@akinon/pz-
|
|
50
|
-
"@akinon/pz-
|
|
51
|
-
"@akinon/pz-
|
|
27
|
+
"@akinon/next": "1.117.0-rc.1",
|
|
28
|
+
"@akinon/pz-akifast": "1.117.0-rc.1",
|
|
29
|
+
"@akinon/pz-apple-pay": "1.117.0-rc.1",
|
|
30
|
+
"@akinon/pz-b2b": "1.117.0-rc.1",
|
|
31
|
+
"@akinon/pz-basket-gift-pack": "1.117.0-rc.1",
|
|
32
|
+
"@akinon/pz-bkm": "1.117.0-rc.1",
|
|
33
|
+
"@akinon/pz-checkout-gift-pack": "1.117.0-rc.1",
|
|
34
|
+
"@akinon/pz-click-collect": "1.117.0-rc.1",
|
|
35
|
+
"@akinon/pz-credit-payment": "1.117.0-rc.1",
|
|
36
|
+
"@akinon/pz-cybersource-uc": "1.117.0-rc.1",
|
|
37
|
+
"@akinon/pz-flow-payment": "1.117.0-rc.1",
|
|
38
|
+
"@akinon/pz-google-pay": "1.117.0-rc.1",
|
|
39
|
+
"@akinon/pz-gpay": "1.117.0-rc.1",
|
|
40
|
+
"@akinon/pz-haso": "1.117.0-rc.1",
|
|
41
|
+
"@akinon/pz-hepsipay": "1.117.0-rc.1",
|
|
42
|
+
"@akinon/pz-masterpass": "1.117.0-rc.1",
|
|
43
|
+
"@akinon/pz-masterpass-rest": "1.117.0-rc.1",
|
|
44
|
+
"@akinon/pz-multi-basket": "1.117.0-rc.1",
|
|
45
|
+
"@akinon/pz-one-click-checkout": "1.117.0-rc.1",
|
|
46
|
+
"@akinon/pz-otp": "1.117.0-rc.1",
|
|
47
|
+
"@akinon/pz-pay-on-delivery": "1.117.0-rc.1",
|
|
48
|
+
"@akinon/pz-saved-card": "1.117.0-rc.1",
|
|
49
|
+
"@akinon/pz-similar-products": "1.117.0-rc.1",
|
|
50
|
+
"@akinon/pz-tabby-extension": "1.117.0-rc.1",
|
|
51
|
+
"@akinon/pz-tamara-extension": "1.117.0-rc.1",
|
|
52
|
+
"@akinon/pz-virtual-try-on": "1.117.0-rc.1",
|
|
52
53
|
"@hookform/resolvers": "2.9.0",
|
|
53
54
|
"@next/third-parties": "14.1.0",
|
|
54
55
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"yup": "0.32.11"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
|
-
"@akinon/eslint-plugin-projectzero": "1.
|
|
75
|
+
"@akinon/eslint-plugin-projectzero": "1.117.0-rc.1",
|
|
75
76
|
"@semantic-release/changelog": "6.0.2",
|
|
76
77
|
"@semantic-release/exec": "6.0.3",
|
|
77
78
|
"@semantic-release/git": "10.0.1",
|
|
@@ -242,7 +242,9 @@
|
|
|
242
242
|
"total": "Total",
|
|
243
243
|
"items": "items",
|
|
244
244
|
"packages": "Packages",
|
|
245
|
-
"package_no": "Package no"
|
|
245
|
+
"package_no": "Package no",
|
|
246
|
+
"back_to_orders": "Back to Orders",
|
|
247
|
+
"no_orders_found": "No orders found"
|
|
246
248
|
},
|
|
247
249
|
"return": {
|
|
248
250
|
"title": "Return Items",
|
|
@@ -86,6 +86,8 @@
|
|
|
86
86
|
"multiple_results_subtitle": "Try-on completed for {{count}} products",
|
|
87
87
|
"error_incompatible": "Image Not Compatible",
|
|
88
88
|
"error_auto_reported": "Error automatically reported",
|
|
89
|
+
"error_aspect_ratio_too_tall": "The image is too tall. Maximum allowed ratio is 9:16 (portrait). Please crop or use a different image.",
|
|
90
|
+
"error_aspect_ratio_too_wide": "The image is too wide. Maximum allowed ratio is 21:9 (landscape). Please crop or use a different image.",
|
|
89
91
|
"feedback_question": "How was the result?",
|
|
90
92
|
"feedback_success": "Success",
|
|
91
93
|
"feedback_failed": "Failed",
|
|
@@ -96,5 +98,21 @@
|
|
|
96
98
|
"starting": "Starting...",
|
|
97
99
|
"will_start": "will start virtual try-on for",
|
|
98
100
|
"products_count": "products"
|
|
101
|
+
},
|
|
102
|
+
"barcode_scanner": {
|
|
103
|
+
"title": "Scan Barcode",
|
|
104
|
+
"button_label": "Barcode Scanner",
|
|
105
|
+
"button_text": "Try on products in store",
|
|
106
|
+
"help_text": "Point your camera at the product barcode",
|
|
107
|
+
"scan_more_help": "To scan another product, point your camera at the new barcode.",
|
|
108
|
+
"searching": "Searching for product...",
|
|
109
|
+
"continue_to_vto": "Continue to Virtual Cabin",
|
|
110
|
+
"permission_denied_title": "Camera Permission Required",
|
|
111
|
+
"permission_denied_message": "You need to allow camera access for the barcode scanner.",
|
|
112
|
+
"try_again": "Try Again",
|
|
113
|
+
"errors": {
|
|
114
|
+
"product_not_found": "No product found for this barcode.",
|
|
115
|
+
"search_failed": "Search failed. Please try again."
|
|
116
|
+
}
|
|
99
117
|
}
|
|
100
118
|
}
|
|
@@ -242,7 +242,9 @@
|
|
|
242
242
|
"total": "Toplam",
|
|
243
243
|
"items": "adet",
|
|
244
244
|
"packages": "paket",
|
|
245
|
-
"package_no": "Paket no"
|
|
245
|
+
"package_no": "Paket no",
|
|
246
|
+
"back_to_orders": "Siparişlere geri dön",
|
|
247
|
+
"no_orders_found": "Sipariş bulunamadı"
|
|
246
248
|
},
|
|
247
249
|
"return": {
|
|
248
250
|
"title": "İade Ürünleri",
|
|
@@ -88,6 +88,8 @@
|
|
|
88
88
|
"multiple_results_subtitle": "{{count}} ürün için deneme tamamlandı",
|
|
89
89
|
"error_incompatible": "Görüntü Uyumlu Değil",
|
|
90
90
|
"error_auto_reported": "Hata otomatik olarak bildirildi",
|
|
91
|
+
"error_aspect_ratio_too_tall": "Görsel çok uzun. Dikey görseller için izin verilen maksimum oran 9:16'dır. Lütfen kırpın veya farklı bir görsel seçin.",
|
|
92
|
+
"error_aspect_ratio_too_wide": "Görsel çok geniş. Yatay görseller için izin verilen maksimum oran 21:9'dur. Lütfen kırpın veya farklı bir görsel seçin.",
|
|
91
93
|
"feedback_question": "Sonuç nasıldı?",
|
|
92
94
|
"feedback_success": "Başarılı",
|
|
93
95
|
"feedback_failed": "Başarısız",
|
|
@@ -98,5 +100,21 @@
|
|
|
98
100
|
"starting": "Başlatılıyor...",
|
|
99
101
|
"will_start": "için sanal deneme başlatılacak",
|
|
100
102
|
"products_count": "ürün"
|
|
103
|
+
},
|
|
104
|
+
"barcode_scanner": {
|
|
105
|
+
"title": "Barkodu Okut",
|
|
106
|
+
"button_label": "Barkod Tarayıcı",
|
|
107
|
+
"button_text": "Mağazadaki ürünü üstünde dene",
|
|
108
|
+
"help_text": "Ürün barkodunu kameraya yaklaştırın",
|
|
109
|
+
"scan_more_help": "Bir ürün daha okutmak isterseniz, yeni barkodu da kameranıza yaklaştırın.",
|
|
110
|
+
"searching": "Ürün aranıyor...",
|
|
111
|
+
"continue_to_vto": "Sanal Kabine Devam Et",
|
|
112
|
+
"permission_denied_title": "Kamera İzni Gerekli",
|
|
113
|
+
"permission_denied_message": "Barkod okuyucu için kamera erişimine izin vermeniz gerekmektedir.",
|
|
114
|
+
"try_again": "Tekrar Dene",
|
|
115
|
+
"errors": {
|
|
116
|
+
"product_not_found": "Bu barkoda ait ürün bulunamadı.",
|
|
117
|
+
"search_failed": "Arama başarısız oldu. Lütfen tekrar deneyin."
|
|
118
|
+
}
|
|
101
119
|
}
|
|
102
120
|
}
|
|
@@ -61,7 +61,26 @@ const AccountOrderDetail = ({ params: { id } }) => {
|
|
|
61
61
|
}, [order, isSuccess, localeValue]);
|
|
62
62
|
|
|
63
63
|
if (isLoading && isFetching) {
|
|
64
|
-
return
|
|
64
|
+
return (
|
|
65
|
+
<div className="flex flex-col items-center justify-center h-96">
|
|
66
|
+
<LoaderSpinner />
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (!order) {
|
|
72
|
+
return (
|
|
73
|
+
<div className="flex flex-col items-center justify-center h-96">
|
|
74
|
+
<p className="mt-5 text-start text-lg mb-4">
|
|
75
|
+
{t('account.my_orders.detail.no_orders_found')}
|
|
76
|
+
</p>
|
|
77
|
+
<Link href={`/account/orders/`}>
|
|
78
|
+
<Button className="px-4" appearance="filled">
|
|
79
|
+
{t('account.my_orders.detail.back_to_orders')}
|
|
80
|
+
</Button>
|
|
81
|
+
</Link>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
65
84
|
}
|
|
66
85
|
|
|
67
86
|
return (
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@akinon/next/api/barcode-search';
|
|
@@ -41,12 +41,14 @@ export const Modal = (props: ModalProps) => {
|
|
|
41
41
|
'fixed top-0 left-0 w-screen h-screen bg-primary bg-opacity-60 z-50',
|
|
42
42
|
overlayClassName
|
|
43
43
|
)}
|
|
44
|
+
onClick={(e) => e.stopPropagation()}
|
|
44
45
|
/>
|
|
45
46
|
<section
|
|
46
47
|
className={twMerge(
|
|
47
48
|
'fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 bg-white',
|
|
48
49
|
className
|
|
49
50
|
)}
|
|
51
|
+
onClick={(e) => e.stopPropagation()}
|
|
50
52
|
>
|
|
51
53
|
{(showCloseButton || title) && (
|
|
52
54
|
<div
|
|
@@ -48,7 +48,7 @@ const Select = forwardRef<HTMLSelectElement, SelectProps>((props, ref) => {
|
|
|
48
48
|
clsx(
|
|
49
49
|
'cursor-pointer truncate h-10 w-40 px-2.5 shrink-0 outline-none',
|
|
50
50
|
!borderless &&
|
|
51
|
-
'border border-gray-200 transition-all duration-150 hover:border-primary',
|
|
51
|
+
'border border-gray-200 transition-all duration-150 hover:border-primary focus:border-primary',
|
|
52
52
|
'appearance-none bg-transparent'
|
|
53
53
|
),
|
|
54
54
|
className
|
|
@@ -21,7 +21,7 @@ export const OrderDetailHeader = ({ title, order, children }: Props) => {
|
|
|
21
21
|
<div>
|
|
22
22
|
<span>{t('account.my_orders.detail.order_number')}</span>:{' '}
|
|
23
23
|
<span data-testid="account-orders-return-order-id">
|
|
24
|
-
{order
|
|
24
|
+
{order?.number}
|
|
25
25
|
</span>
|
|
26
26
|
</div>
|
|
27
27
|
|
|
@@ -85,7 +85,7 @@ const AddressBox = ({
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
const onSubmit = (data) => {
|
|
88
|
-
editAddress({ ...data, invalidateTag: '
|
|
88
|
+
editAddress({ ...data, invalidateTag: 'Checkout' })
|
|
89
89
|
.unwrap()
|
|
90
90
|
.then((editAddressResponse) => {
|
|
91
91
|
handleAddressClick(addressType, editAddressResponse);
|
|
@@ -96,7 +96,7 @@ const AddressBox = ({
|
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
const handleRemoveAddress = async (addressPk: number) => {
|
|
99
|
-
await removeAddress({ id: addressPk, invalidateTag: '
|
|
99
|
+
await removeAddress({ id: addressPk, invalidateTag: 'Checkout' });
|
|
100
100
|
setRemoveAddressModalOpen(false);
|
|
101
101
|
dispatch(resetCheckoutState());
|
|
102
102
|
|
|
@@ -168,7 +168,10 @@ const AddressBox = ({
|
|
|
168
168
|
<Button
|
|
169
169
|
appearance="ghost"
|
|
170
170
|
className="italic underline hover:text-secondary-500 hover:!bg-white hover:!border-white p-0 h-auto"
|
|
171
|
-
onClick={() =>
|
|
171
|
+
onClick={(e) => {
|
|
172
|
+
e.stopPropagation();
|
|
173
|
+
setIsEditAddressModalOpen(true);
|
|
174
|
+
}}
|
|
172
175
|
data-testid="checkout-address-edit"
|
|
173
176
|
>
|
|
174
177
|
{t('checkout.address.box.edit')}
|
|
@@ -180,21 +183,26 @@ const AddressBox = ({
|
|
|
180
183
|
setOpen={setIsEditAddressModalOpen}
|
|
181
184
|
className="w-full sm:w-[28rem] max-h-[90vh] overflow-y-auto"
|
|
182
185
|
>
|
|
183
|
-
<
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
<div onClick={(e) => e.stopPropagation()}>
|
|
187
|
+
<AddressForm
|
|
188
|
+
data={{
|
|
189
|
+
...address,
|
|
190
|
+
country: address.country?.pk,
|
|
191
|
+
city: address.city?.pk,
|
|
192
|
+
township: address.township?.pk,
|
|
193
|
+
district: address.district?.pk
|
|
194
|
+
}}
|
|
195
|
+
onSubmit={onSubmit}
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
193
198
|
</Modal>
|
|
194
199
|
<Button
|
|
195
200
|
appearance="ghost"
|
|
196
201
|
className="italic underline hover:text-secondary-500 hover:!bg-white hover:!border-white p-0 h-auto"
|
|
197
|
-
onClick={() =>
|
|
202
|
+
onClick={(e) => {
|
|
203
|
+
e.stopPropagation();
|
|
204
|
+
setRemoveAddressModalOpen(true);
|
|
205
|
+
}}
|
|
198
206
|
data-testid="checkout-address-remove"
|
|
199
207
|
>
|
|
200
208
|
{t('checkout.address.box.remove')}
|
|
@@ -207,14 +215,18 @@ const AddressBox = ({
|
|
|
207
215
|
setOpen={setRemoveAddressModalOpen}
|
|
208
216
|
showCloseButton={false}
|
|
209
217
|
>
|
|
210
|
-
<div
|
|
218
|
+
<div
|
|
219
|
+
className="text-center px-6 py-10"
|
|
220
|
+
onClick={(e) => e.stopPropagation()}
|
|
221
|
+
>
|
|
211
222
|
<p className="mb-4">
|
|
212
223
|
{t('account.address_book.modal.delete_description')}
|
|
213
224
|
</p>
|
|
214
225
|
<div className="space-x-3 flex justify-center">
|
|
215
226
|
<Button
|
|
216
227
|
appearance="outlined"
|
|
217
|
-
onClick={() => {
|
|
228
|
+
onClick={(e) => {
|
|
229
|
+
e.stopPropagation();
|
|
218
230
|
setRemoveAddressModalOpen(false);
|
|
219
231
|
}}
|
|
220
232
|
data-testid="remove-address-modal-cancel"
|
|
@@ -224,7 +236,8 @@ const AddressBox = ({
|
|
|
224
236
|
<Button
|
|
225
237
|
appearance="filled"
|
|
226
238
|
disabled={removeAddressLoading}
|
|
227
|
-
onClick={() => {
|
|
239
|
+
onClick={(e) => {
|
|
240
|
+
e.stopPropagation();
|
|
228
241
|
handleRemoveAddress(address.pk);
|
|
229
242
|
}}
|
|
230
243
|
className={
|
|
@@ -77,7 +77,7 @@ const Addresses = () => {
|
|
|
77
77
|
}, [billing_and_shipping_same]);
|
|
78
78
|
|
|
79
79
|
const onSubmit = (data) => {
|
|
80
|
-
addAddress({ ...data, invalidateTag: '
|
|
80
|
+
addAddress({ ...data, invalidateTag: 'Checkout' })
|
|
81
81
|
.unwrap()
|
|
82
82
|
.then((addAddressResponse) => {
|
|
83
83
|
if (addressList.length === 0) {
|
|
@@ -4,8 +4,7 @@ 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
|
-
|
|
8
|
-
import { Icon } from '@theme/components';
|
|
7
|
+
import { Icon, Input } from '@theme/components';
|
|
9
8
|
import Results from './results';
|
|
10
9
|
import { ROUTES } from '@theme/routes';
|
|
11
10
|
import { useLocalization, useRouter } from '@akinon/next/hooks';
|
|
@@ -42,6 +41,14 @@ export default function Search() {
|
|
|
42
41
|
};
|
|
43
42
|
}, [isSearchOpen, dispatch]);
|
|
44
43
|
|
|
44
|
+
const handleSearchTextChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
45
|
+
setSearchText(e.target.value);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const handleCloseSearch = () => {
|
|
49
|
+
dispatch(closeSearch());
|
|
50
|
+
};
|
|
51
|
+
|
|
45
52
|
return (
|
|
46
53
|
<>
|
|
47
54
|
<div
|
|
@@ -67,9 +74,9 @@ export default function Search() {
|
|
|
67
74
|
{t('common.search.results_for')}
|
|
68
75
|
</span>
|
|
69
76
|
<div className="flex items-center">
|
|
70
|
-
<
|
|
77
|
+
<Input
|
|
71
78
|
value={searchText}
|
|
72
|
-
onChange={
|
|
79
|
+
onChange={handleSearchTextChange}
|
|
73
80
|
onKeyDown={(e) => {
|
|
74
81
|
if (e.key === 'Enter' && searchText.trim() !== '') {
|
|
75
82
|
router.push(`${ROUTES.LIST}/?search_text=${searchText}`);
|
|
@@ -91,11 +98,12 @@ export default function Search() {
|
|
|
91
98
|
<Icon
|
|
92
99
|
name="close"
|
|
93
100
|
size={14}
|
|
94
|
-
onClick={
|
|
101
|
+
onClick={handleCloseSearch}
|
|
95
102
|
className="cursor-pointer"
|
|
96
103
|
/>
|
|
97
104
|
</div>
|
|
98
105
|
</div>
|
|
106
|
+
|
|
99
107
|
<Results searchText={searchText} />
|
|
100
108
|
</div>
|
|
101
109
|
</div>
|
|
@@ -36,53 +36,100 @@ export default function ProductInfoSlider({ product }: ProductSliderItem) {
|
|
|
36
36
|
carouselRef.current?.next();
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const handleThumbnailClick = (index) => {
|
|
39
|
+
const handleThumbnailClick = (index: number) => {
|
|
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
|
-
|
|
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 }}
|
|
55
117
|
>
|
|
56
|
-
|
|
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) => (
|
|
118
|
+
{product?.productimage_set?.map((item, i) => (
|
|
60
119
|
<Image
|
|
61
|
-
key={
|
|
120
|
+
key={i}
|
|
62
121
|
src={item.image}
|
|
63
|
-
alt={
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
|
70
130
|
/>
|
|
71
131
|
))}
|
|
72
|
-
</
|
|
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>
|
|
132
|
+
</CarouselCore>
|
|
86
133
|
</div>
|
|
87
134
|
</div>
|
|
88
135
|
|
package/commands/plugins.ts
CHANGED
package/dist/commands/plugins.js
CHANGED
|
@@ -1,208 +1,280 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (
|
|
9
|
+
!desc ||
|
|
10
|
+
('get' in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
11
|
+
) {
|
|
12
|
+
desc = {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return m[k];
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}
|
|
21
|
+
: function (o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
});
|
|
25
|
+
var __setModuleDefault =
|
|
26
|
+
(this && this.__setModuleDefault) ||
|
|
27
|
+
(Object.create
|
|
28
|
+
? function (o, v) {
|
|
29
|
+
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
30
|
+
}
|
|
31
|
+
: function (o, v) {
|
|
32
|
+
o['default'] = v;
|
|
33
|
+
});
|
|
34
|
+
var __importStar =
|
|
35
|
+
(this && this.__importStar) ||
|
|
36
|
+
function (mod) {
|
|
19
37
|
if (mod && mod.__esModule) return mod;
|
|
20
38
|
var result = {};
|
|
21
|
-
if (mod != null)
|
|
39
|
+
if (mod != null)
|
|
40
|
+
for (var k in mod)
|
|
41
|
+
if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k))
|
|
42
|
+
__createBinding(result, mod, k);
|
|
22
43
|
__setModuleDefault(result, mod);
|
|
23
44
|
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter =
|
|
26
|
-
|
|
45
|
+
};
|
|
46
|
+
var __awaiter =
|
|
47
|
+
(this && this.__awaiter) ||
|
|
48
|
+
function (thisArg, _arguments, P, generator) {
|
|
49
|
+
function adopt(value) {
|
|
50
|
+
return value instanceof P
|
|
51
|
+
? value
|
|
52
|
+
: new P(function (resolve) {
|
|
53
|
+
resolve(value);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
27
56
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const fs = __importStar(require("fs"));
|
|
39
|
-
const path_1 = __importDefault(require("path"));
|
|
40
|
-
const child_process_1 = require("child_process");
|
|
41
|
-
const semver_1 = __importDefault(require("semver"));
|
|
42
|
-
const prompts_1 = require("@inquirer/prompts");
|
|
43
|
-
const rootDir = path_1.default.resolve(process.cwd());
|
|
44
|
-
function checkVersion(pkg) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const packageName = '@akinon/next';
|
|
47
|
-
const registryUrl = `https://registry.npmjs.org/${packageName}`;
|
|
57
|
+
function fulfilled(value) {
|
|
48
58
|
try {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (!semver_1.default.satisfies(pkg.dependencies['@akinon/next'], latestVersion)) {
|
|
53
|
-
console.warn(`\x1b[43mWarning: The "${packageName}" package is currently at version ${pkg.dependencies['@akinon/next']}. Please upgrade it to the latest version (${latestVersion}) to ensure plugin compatibility.`, '\x1b[0m\n');
|
|
54
|
-
}
|
|
59
|
+
step(generator.next(value));
|
|
60
|
+
} catch (e) {
|
|
61
|
+
reject(e);
|
|
55
62
|
}
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
}
|
|
64
|
+
function rejected(value) {
|
|
65
|
+
try {
|
|
66
|
+
step(generator['throw'](value));
|
|
67
|
+
} catch (e) {
|
|
68
|
+
reject(e);
|
|
58
69
|
}
|
|
70
|
+
}
|
|
71
|
+
function step(result) {
|
|
72
|
+
result.done
|
|
73
|
+
? resolve(result.value)
|
|
74
|
+
: adopt(result.value).then(fulfilled, rejected);
|
|
75
|
+
}
|
|
76
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59
77
|
});
|
|
78
|
+
};
|
|
79
|
+
var __importDefault =
|
|
80
|
+
(this && this.__importDefault) ||
|
|
81
|
+
function (mod) {
|
|
82
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
83
|
+
};
|
|
84
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
85
|
+
const fs = __importStar(require('fs'));
|
|
86
|
+
const path_1 = __importDefault(require('path'));
|
|
87
|
+
const child_process_1 = require('child_process');
|
|
88
|
+
const semver_1 = __importDefault(require('semver'));
|
|
89
|
+
const prompts_1 = require('@inquirer/prompts');
|
|
90
|
+
const rootDir = path_1.default.resolve(process.cwd());
|
|
91
|
+
function checkVersion(pkg) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const packageName = '@akinon/next';
|
|
94
|
+
const registryUrl = `https://registry.npmjs.org/${packageName}`;
|
|
95
|
+
try {
|
|
96
|
+
const response = yield fetch(registryUrl);
|
|
97
|
+
const pkgInfo = yield response.json();
|
|
98
|
+
const latestVersion = pkgInfo['dist-tags'].latest;
|
|
99
|
+
if (
|
|
100
|
+
!semver_1.default.satisfies(
|
|
101
|
+
pkg.dependencies['@akinon/next'],
|
|
102
|
+
latestVersion
|
|
103
|
+
)
|
|
104
|
+
) {
|
|
105
|
+
console.warn(
|
|
106
|
+
`\x1b[43mWarning: The "${packageName}" package is currently at version ${pkg.dependencies['@akinon/next']}. Please upgrade it to the latest version (${latestVersion}) to ensure plugin compatibility.`,
|
|
107
|
+
'\x1b[0m\n'
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error(
|
|
112
|
+
`\x1b[41mError: ${error === null || error === void 0 ? void 0 : error.message}`,
|
|
113
|
+
'\x1b[0m\n'
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
60
117
|
}
|
|
61
|
-
exports.default = () =>
|
|
118
|
+
exports.default = () =>
|
|
119
|
+
__awaiter(void 0, void 0, void 0, function* () {
|
|
62
120
|
function findPluginsFilePath() {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
121
|
+
const option1 = path_1.default.resolve(rootDir, './src/plugins.js');
|
|
122
|
+
const option2 = path_1.default.resolve(
|
|
123
|
+
rootDir,
|
|
124
|
+
'./packages/akinon-next/plugins.js'
|
|
125
|
+
);
|
|
126
|
+
if (fs.existsSync(option1)) {
|
|
127
|
+
return option1;
|
|
128
|
+
} else if (fs.existsSync(option2)) {
|
|
129
|
+
return option2;
|
|
130
|
+
} else {
|
|
131
|
+
throw new Error(
|
|
132
|
+
'plugins.js was not found in either of the expected locations.'
|
|
133
|
+
);
|
|
134
|
+
}
|
|
74
135
|
}
|
|
75
136
|
const pkg = require(path_1.default.resolve(rootDir, './package.json'));
|
|
76
137
|
yield checkVersion(pkg);
|
|
77
138
|
const pluginsFilePath = findPluginsFilePath();
|
|
78
139
|
let installedPlugins = [];
|
|
79
140
|
try {
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
process.exit(1);
|
|
141
|
+
installedPlugins = require(pluginsFilePath);
|
|
142
|
+
} catch (error) {
|
|
143
|
+
console.error('Error loading installed plugins:', error);
|
|
144
|
+
process.exit(1);
|
|
85
145
|
}
|
|
86
146
|
const definedPlugins = [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
147
|
+
{
|
|
148
|
+
name: 'Akifast',
|
|
149
|
+
value: 'pz-akifast'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'Apple Pay',
|
|
153
|
+
value: 'pz-apple-pay'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'B2B',
|
|
157
|
+
value: 'pz-b2b'
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'Basket Gift Pack',
|
|
161
|
+
value: 'pz-basket-gift-pack'
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'BKM Express',
|
|
165
|
+
value: 'pz-bkm'
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'Checkout Gift Pack',
|
|
169
|
+
value: 'pz-checkout-gift-pack'
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'Click & Collect',
|
|
173
|
+
value: 'pz-click-collect'
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'Credit Payment',
|
|
177
|
+
value: 'pz-credit-payment'
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'Garanti Pay',
|
|
181
|
+
value: 'pz-gpay'
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'Masterpass',
|
|
185
|
+
value: 'pz-masterpass'
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: 'Multi Basket',
|
|
189
|
+
value: 'pz-multi-basket'
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'One Click Checkout',
|
|
193
|
+
value: 'pz-one-click-checkout'
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: 'Otp',
|
|
197
|
+
value: 'pz-otp'
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: 'Pay On Delivery',
|
|
201
|
+
value: 'pz-pay-on-delivery'
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'Saved Card',
|
|
205
|
+
value: 'pz-saved-card'
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: 'Tabby Payment Extension',
|
|
209
|
+
value: 'pz-tabby-extension'
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'Tamara Payment Extension',
|
|
213
|
+
value: 'pz-tamara-extension'
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: 'Similar Products',
|
|
217
|
+
value: 'pz-similar-products'
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: 'Hepsipay',
|
|
221
|
+
value: 'pz-hepsipay'
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'Flow Payment',
|
|
225
|
+
value: 'pz-flow-payment'
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: 'Virtual Try-On',
|
|
229
|
+
value: 'pz-virtual-try-on'
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: 'Masterpass Rest',
|
|
233
|
+
value: 'pz-masterpass-rest'
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'Similar Products',
|
|
237
|
+
value: 'pz-similar-products'
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: 'Haso Payment Gateway',
|
|
241
|
+
value: 'pz-haso'
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'Google Pay',
|
|
245
|
+
value: 'pz-google-pay'
|
|
246
|
+
}
|
|
183
247
|
];
|
|
184
248
|
try {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
249
|
+
const answers = yield (0, prompts_1.checkbox)({
|
|
250
|
+
message: 'Please check/uncheck plugins to install/uninstall.',
|
|
251
|
+
choices: definedPlugins.map((plugin) => ({
|
|
252
|
+
name: plugin.name,
|
|
253
|
+
value: plugin.value,
|
|
254
|
+
checked: installedPlugins.includes(plugin.value)
|
|
255
|
+
}))
|
|
256
|
+
});
|
|
257
|
+
if (!answers.length) {
|
|
258
|
+
console.log('\x1b[33m%s\x1b[0m', `\nUninstalling all plugins.`);
|
|
259
|
+
}
|
|
260
|
+
console.log('\x1b[36m%s\x1b[0m', `\nPlease wait...`);
|
|
261
|
+
fs.writeFileSync(
|
|
262
|
+
pluginsFilePath,
|
|
263
|
+
`module.exports = ${JSON.stringify(answers)};\n`,
|
|
264
|
+
{
|
|
265
|
+
encoding: 'utf-8'
|
|
195
266
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
267
|
+
);
|
|
268
|
+
(0, child_process_1.execSync)('yarn install', { stdio: 'pipe' });
|
|
269
|
+
console.log(
|
|
270
|
+
'\x1b[32m%s\x1b[0m',
|
|
271
|
+
`\n✓ ${
|
|
272
|
+
answers.length
|
|
202
273
|
? 'Installed selected plugins'
|
|
203
|
-
: 'Uninstalled all plugins'
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
274
|
+
: 'Uninstalled all plugins'
|
|
275
|
+
}.\n`
|
|
276
|
+
);
|
|
277
|
+
} catch (error) {
|
|
278
|
+
process.exit(1);
|
|
207
279
|
}
|
|
208
|
-
});
|
|
280
|
+
});
|