@akinon/next 1.46.0 → 1.47.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +371 -0
  2. package/api/client.ts +39 -9
  3. package/assets/styles/index.css +49 -0
  4. package/assets/styles/index.css.map +1 -0
  5. package/assets/styles/index.scss +50 -26
  6. package/components/file-input.tsx +8 -0
  7. package/components/index.ts +1 -0
  8. package/components/input.tsx +21 -7
  9. package/components/link.tsx +17 -13
  10. package/components/pagination.tsx +1 -2
  11. package/components/price.tsx +11 -4
  12. package/components/selected-payment-option-view.tsx +26 -38
  13. package/data/client/account.ts +10 -9
  14. package/data/client/address.ts +32 -8
  15. package/data/client/api.ts +2 -2
  16. package/data/client/b2b.ts +35 -2
  17. package/data/client/basket.ts +6 -5
  18. package/data/client/checkout.ts +47 -4
  19. package/data/client/user.ts +3 -2
  20. package/data/client/wishlist.ts +70 -2
  21. package/data/server/category.ts +2 -2
  22. package/data/server/list.ts +2 -2
  23. package/data/server/product.ts +15 -13
  24. package/data/server/special-page.ts +2 -2
  25. package/data/urls.ts +17 -3
  26. package/hooks/index.ts +2 -1
  27. package/hooks/use-message-listener.ts +24 -0
  28. package/hooks/use-payment-options.ts +2 -1
  29. package/lib/cache-handler.mjs +33 -0
  30. package/lib/cache.ts +18 -6
  31. package/middlewares/default.ts +50 -2
  32. package/middlewares/locale.ts +32 -30
  33. package/middlewares/pretty-url.ts +4 -0
  34. package/middlewares/url-redirection.ts +4 -0
  35. package/package.json +5 -4
  36. package/plugins.d.ts +1 -0
  37. package/redux/middlewares/checkout.ts +70 -11
  38. package/redux/reducers/checkout.ts +24 -5
  39. package/redux/reducers/config.ts +2 -0
  40. package/routes/pretty-url.tsx +194 -0
  41. package/types/commerce/account.ts +1 -0
  42. package/types/commerce/address.ts +1 -1
  43. package/types/commerce/b2b.ts +12 -2
  44. package/types/commerce/checkout.ts +30 -0
  45. package/types/commerce/misc.ts +2 -0
  46. package/types/commerce/order.ts +12 -0
  47. package/types/index.ts +30 -2
  48. package/utils/app-fetch.ts +1 -1
  49. package/utils/generate-commerce-search-params.ts +6 -2
  50. package/utils/index.ts +27 -6
  51. package/utils/menu-generator.ts +2 -2
  52. package/utils/redirection-iframe.ts +85 -0
  53. package/utils/server-translation.ts +5 -1
  54. package/with-pz-config.js +11 -1
package/CHANGELOG.md CHANGED
@@ -1,12 +1,189 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.47.0-rc.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
8
+
9
+ ## 1.47.0-rc.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
14
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
15
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
16
+ - fda5b92: ZERO-2725: fix invalid import
17
+ - 2d9b2b2: ZERO-2816: Add segment to headers
18
+ - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
19
+ - 8d9ac9a: ZERO-2794: Add field to order type
20
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
21
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
22
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
23
+ - 3bf2dd9: ZERO-2551: Fix search page
24
+ - e9541a1: ZERO-2816: Add headers to url
25
+ - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
26
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
27
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
28
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
29
+ - 1448a96e: ZERO-2612: add errors type in CheckoutState
30
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
31
+ - d3474c6: ZERO-2655: Add data source shipping option
32
+ - 75080fd6: ZERO-2630: Add max limit to postcode area
33
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
34
+ - c45b62c: ZERO-2818: Add upload and download support for b2b package
35
+ - 91265bba: ZERO-2551: Improve pretty url and caching performance
36
+ - bbe18b9f: ZERO-2575: Fix build error
37
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
38
+ - 4920742: Disable getCachedTranslations
39
+ - 7e56d6b: ZERO-2841: Update api tagTypes
40
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
41
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
42
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
43
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
44
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
45
+ - fad2768: ZERO-2739: add gpay to payment plugin map
46
+ - dff0d595: ZERO-2659: add formData support to proxy api requests
47
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
48
+ - f2c325c: ZERO-2838: Move file input component into @akinon/next
49
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
50
+ - beb499e6: ZERO-2551: Add new tsconfig paths
51
+ - 948eb42: ZERO-2852: Add out of stock endpoints
52
+ - 146ea39: ZERO-2774: Update imports
53
+ - f2c92d5: ZERO-2816: Update cookie name
54
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
55
+ - c47be30: ZERO-2744: Update Order and OrderItem types
56
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
57
+ - f046f8e0: ZERO-2575: update version for react-number-format
58
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
59
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
60
+
3
61
  ## 1.46.0
4
62
 
5
63
  ## 1.45.0
6
64
 
7
65
  ### Minor Changes
8
66
 
67
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
68
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
69
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
70
+ - fda5b92: ZERO-2725: fix invalid import
71
+ - 2d9b2b2: ZERO-2816: Add segment to headers
72
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
73
+ - 8d9ac9a: ZERO-2794: Add field to order type
74
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
75
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
76
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
77
+ - 3bf2dd9: ZERO-2551: Fix search page
78
+ - e9541a1: ZERO-2816: Add headers to url
79
+ - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
80
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
81
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
82
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
83
+ - 1448a96e: ZERO-2612: add errors type in CheckoutState
84
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
85
+ - d3474c6: ZERO-2655: Add data source shipping option
86
+ - 75080fd6: ZERO-2630: Add max limit to postcode area
87
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
88
+ - c45b62c: ZERO-2818: Add upload and download support for b2b package
89
+ - 91265bba: ZERO-2551: Improve pretty url and caching performance
90
+ - bbe18b9f: ZERO-2575: Fix build error
91
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
92
+ - 4920742: Disable getCachedTranslations
93
+ - 7e56d6b: ZERO-2841: Update api tagTypes
94
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
95
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
96
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
97
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
98
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
99
+ - fad2768: ZERO-2739: add gpay to payment plugin map
100
+ - dff0d595: ZERO-2659: add formData support to proxy api requests
101
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
102
+ - f2c325c: ZERO-2838: Move file input component into @akinon/next
103
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
104
+ - beb499e6: ZERO-2551: Add new tsconfig paths
105
+ - 948eb42: ZERO-2852: Add out of stock endpoints
106
+ - 146ea39: ZERO-2774: Update imports
107
+ - f2c92d5: ZERO-2816: Update cookie name
108
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
109
+ - c47be30: ZERO-2744: Update Order and OrderItem types
110
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
111
+ - f046f8e0: ZERO-2575: update version for react-number-format
112
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
113
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
114
+
115
+ ## 1.45.0-rc.4
116
+
117
+ ### Minor Changes
118
+
119
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
120
+
121
+ ## 1.45.0-rc.3
122
+
123
+ ### Minor Changes
124
+
125
+ - 948eb42: ZERO-2852: Add out of stock endpoints
126
+
127
+ ## 1.45.0-rc.2
128
+
129
+ ### Minor Changes
130
+
131
+ - c45b62c: ZERO-2818: Add upload and download support for b2b package
132
+ - f2c325c: ZERO-2838: Move file input component into @akinon/next
133
+
134
+ ## 1.45.0-rc.1
135
+
136
+ ### Minor Changes
137
+
138
+ - 7e56d6b: ZERO-2841: Update api tagTypes
139
+
140
+ ## 1.45.0-rc.0
141
+
142
+ ### Minor Changes
143
+
144
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
145
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
146
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
147
+ - fda5b92: ZERO-2725: fix invalid import
148
+ - 2d9b2b2: ZERO-2816: Add segment to headers
149
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
150
+ - 8d9ac9a: ZERO-2794: Add field to order type
151
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
152
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
153
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
154
+ - 3bf2dd9: ZERO-2551: Fix search page
155
+ - e9541a1: ZERO-2816: Add headers to url
156
+ - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
157
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
158
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
159
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
160
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
9
161
  - 2ab6e08: ZERO-2841: Update getBasketDetail query
162
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
163
+ - d3474c6: ZERO-2655: Add data source shipping option
164
+ - 75080fd: ZERO-2630: Add max limit to postcode area
165
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
166
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
167
+ - bbe18b9: ZERO-2575: Fix build error
168
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
169
+ - 4920742: Disable getCachedTranslations
170
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
171
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
172
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
173
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
174
+ - fad2768: ZERO-2739: add gpay to payment plugin map
175
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
176
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
177
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
178
+ - beb499e: ZERO-2551: Add new tsconfig paths
179
+ - 146ea39: ZERO-2774: Update imports
180
+ - f2c92d5: ZERO-2816: Update cookie name
181
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
182
+ - c47be30: ZERO-2744: Update Order and OrderItem types
183
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
184
+ - f046f8e0: ZERO-2575: update version for react-number-format
185
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
186
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
10
187
 
11
188
  ## 1.44.0
12
189
 
@@ -14,7 +191,201 @@
14
191
 
15
192
  ### Minor Changes
16
193
 
194
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
195
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
196
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
197
+ - fda5b92: ZERO-2725: fix invalid import
198
+ - 2d9b2b2: ZERO-2816: Add segment to headers
199
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
200
+ - 8d9ac9a: ZERO-2794: Add field to order type
201
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
202
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
203
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
204
+ - 3bf2dd9: ZERO-2551: Fix search page
205
+ - e9541a1: ZERO-2816: Add headers to url
206
+ - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
207
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
208
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
209
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
210
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
211
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
212
+ - d3474c6: ZERO-2655: Add data source shipping option
213
+ - 75080fd: ZERO-2630: Add max limit to postcode area
214
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
215
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
216
+ - bbe18b9: ZERO-2575: Fix build error
217
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
218
+ - 4920742: Disable getCachedTranslations
219
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
220
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
221
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
222
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
223
+ - fad2768: ZERO-2739: add gpay to payment plugin map
224
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
225
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
226
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
227
+ - beb499e: ZERO-2551: Add new tsconfig paths
228
+ - 146ea39: ZERO-2774: Update imports
229
+ - f2c92d5: ZERO-2816: Update cookie name
230
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
231
+ - c47be30: ZERO-2744: Update Order and OrderItem types
232
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
233
+ - f046f8e0: ZERO-2575: update version for react-number-format
234
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
235
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
236
+
237
+ ## 1.43.0-rc.15
238
+
239
+ ## 1.43.0-rc.14
240
+
241
+ ### Minor Changes
242
+
243
+ - 3bf2dd9: ZERO-2551: Fix search page
244
+
245
+ ## 1.43.0-rc.13
246
+
247
+ ### Minor Changes
248
+
249
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
250
+
251
+ ## 1.43.0-rc.12
252
+
253
+ ### Minor Changes
254
+
255
+ - 4920742: Disable getCachedTranslations
256
+
257
+ ## 1.43.0-rc.11
258
+
259
+ ### Minor Changes
260
+
261
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
262
+
263
+ ## 1.43.0-rc.10
264
+
265
+ ### Minor Changes
266
+
267
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
268
+
269
+ ## 1.43.0-rc.9
270
+
271
+ ### Minor Changes
272
+
273
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
274
+
275
+ ## 1.43.0-rc.8
276
+
277
+ ### Minor Changes
278
+
279
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
280
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
281
+
282
+ ## 1.43.0-rc.7
283
+
284
+ ### Minor Changes
285
+
286
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
287
+
288
+ ## 1.43.0-rc.6
289
+
290
+ ### Minor Changes
291
+
292
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
293
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
294
+ - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
295
+ - fda5b92: ZERO-2725: fix invalid import
296
+ - 2d9b2b2: ZERO-2816: Add segment to headers
297
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
298
+ - 8d9ac9a: ZERO-2794: Add field to order type
299
+ - e9541a1: ZERO-2816: Add headers to url
300
+ - c53ef7b: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
301
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
302
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
303
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
304
+ - d3474c6: ZERO-2655: Add data source shipping option
305
+ - 75080fd: ZERO-2630: Add max limit to postcode area
306
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
307
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
308
+ - bbe18b9: ZERO-2575: Fix build error
309
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
310
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
311
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
312
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
313
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
314
+ - fad2768: ZERO-2739: add gpay to payment plugin map
315
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
316
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
17
317
  - 4a163f2: ZERO-2761: Add condition for basket summary
318
+ - beb499e: ZERO-2551: Add new tsconfig paths
319
+ - 146ea39: ZERO-2774: Update imports
320
+ - f2c92d5: ZERO-2816: Update cookie name
321
+ - c47be30: ZERO-2744: Update Order and OrderItem types
322
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
323
+ - f046f8e: ZERO-2575: update version for react-number-format
324
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
325
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
326
+
327
+ ## 1.43.0-rc.5
328
+
329
+ ### Minor Changes
330
+
331
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
332
+
333
+ ## 1.43.0-rc.4
334
+
335
+ ### Minor Changes
336
+
337
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
338
+
339
+ ## 1.43.0-rc.3
340
+
341
+ ### Minor Changes
342
+
343
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
344
+
345
+ ## 1.43.0-rc.2
346
+
347
+ ### Minor Changes
348
+
349
+ - f2c92d5: ZERO-2816: Update cookie name
350
+
351
+ ## 1.43.0-rc.1
352
+
353
+ ### Minor Changes
354
+
355
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
356
+
357
+ ## 1.43.0-rc.0
358
+
359
+ ### Minor Changes
360
+
361
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
362
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
363
+ - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
364
+ - fda5b92: ZERO-2725: fix invalid import
365
+ - 2d9b2b2: ZERO-2816: Add segment to headers
366
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
367
+ - 8d9ac9a: ZERO-2794: Add field to order type
368
+ - e9541a1: ZERO-2816: Add headers to url
369
+ - c53ef7b: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
370
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
371
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
372
+ - d3474c6: ZERO-2655: Add data source shipping option
373
+ - 75080fd: ZERO-2630: Add max limit to postcode area
374
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
375
+ - bbe18b9: ZERO-2575: Fix build error
376
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
377
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
378
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
379
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
380
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
381
+ - fad2768: ZERO-2739: add gpay to payment plugin map
382
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
383
+ - beb499e: ZERO-2551: Add new tsconfig paths
384
+ - 146ea39: ZERO-2774: Update imports
385
+ - c47be30: ZERO-2744: Update Order and OrderItem types
386
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
387
+ - f046f8e: ZERO-2575: update version for react-number-format
388
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
18
389
 
19
390
  ## 1.42.0
20
391
 
package/api/client.ts CHANGED
@@ -4,6 +4,7 @@ import settings from 'settings';
4
4
  import logger from '../utils/log';
5
5
  import formatCookieString from '../utils/format-cookie-string';
6
6
  import cookieParser from 'set-cookie-parser';
7
+ import { cookies } from 'next/headers';
7
8
 
8
9
  interface RouteParams {
9
10
  params: {
@@ -74,16 +75,33 @@ async function proxyRequest(...args) {
74
75
  }
75
76
  } as RequestInit;
76
77
 
78
+ const nextCookies = cookies();
79
+ const segment = nextCookies.get('pz-segment')?.value;
80
+ const currency = nextCookies.get('pz-external-currency')?.value;
81
+
82
+ if (segment) {
83
+ fetchOptions.headers['X-Segment-Id'] = segment;
84
+ }
85
+
86
+ if (currency) {
87
+ fetchOptions.headers = Object.assign({}, fetchOptions.headers, {
88
+ 'x-currency': currency
89
+ });
90
+ }
91
+
77
92
  if (options.contentType) {
78
93
  fetchOptions.headers['Content-Type'] = options.contentType;
79
94
  }
80
95
 
96
+ const isMultipartFormData = req.headers
97
+ .get('content-type')
98
+ ?.includes('multipart/form-data;');
99
+
81
100
  if (req.method !== 'GET') {
82
- const formData = new URLSearchParams();
83
- let body = {};
101
+ let body: Record<string, any> | FormData = {};
84
102
 
85
103
  try {
86
- body = await req.json();
104
+ body = isMultipartFormData ? await req.formData() : await req.json();
87
105
  } catch (error) {
88
106
  logger.error(
89
107
  `Client Proxy Request - Error while parsing request body to JSON`,
@@ -94,13 +112,25 @@ async function proxyRequest(...args) {
94
112
  );
95
113
  }
96
114
 
97
- Object.keys(body ?? {}).forEach((key) => {
98
- if (body[key]) {
99
- formData.append(key, body[key]);
100
- }
101
- });
115
+ if (isMultipartFormData) {
116
+ fetchOptions.body = body as FormData;
117
+ } else {
118
+ const formData = new FormData();
119
+
120
+ Object.keys(body ?? {}).forEach((key) => {
121
+ if (body[key]) {
122
+ if (typeof body[key] === 'object' && body[key] !== null) {
123
+ formData.append(key, JSON.stringify(body[key]));
124
+ } else {
125
+ formData.append(key, body[key]);
126
+ }
127
+ }
128
+ });
102
129
 
103
- fetchOptions.body = !options.useFormData ? JSON.stringify(body) : formData;
130
+ fetchOptions.body = !options.useFormData
131
+ ? JSON.stringify(body)
132
+ : formData;
133
+ }
104
134
  }
105
135
 
106
136
  let url = `${commerceUrl}/${slug.replace(/,/g, '/')}`;
@@ -0,0 +1,49 @@
1
+ .checkout-payment-iframe-wrapper {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ border: none;
8
+ z-index: 1000;
9
+ background-color: white;
10
+ }
11
+ .checkout-payment-iframe-wrapper iframe {
12
+ width: 100%;
13
+ height: 100%;
14
+ border: none;
15
+ background-color: white;
16
+ }
17
+ .checkout-payment-iframe-wrapper .close-button {
18
+ position: fixed;
19
+ top: 16px;
20
+ right: 16px;
21
+ width: 32px;
22
+ height: 32px;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ z-index: 1001;
27
+ }
28
+
29
+ .checkout-payment-redirection-iframe-wrapper {
30
+ width: 100%;
31
+ position: relative;
32
+ }
33
+ .checkout-payment-redirection-iframe-wrapper iframe {
34
+ width: 100%;
35
+ height: 100%;
36
+ border: none;
37
+ background-color: white;
38
+ }
39
+ .checkout-payment-redirection-iframe-wrapper .close-button {
40
+ position: absolute;
41
+ top: 16px;
42
+ right: 16px;
43
+ width: 32px;
44
+ height: 32px;
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ z-index: 1001;
49
+ }/*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.scss","index.css"],"names":[],"mappings":"AAAA;EACE,eAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,YAAA;EACA,aAAA;EACA,uBAAA;ACCF;ADCE;EACE,WAAA;EACA,YAAA;EACA,YAAA;EACA,uBAAA;ACCJ;ADEE;EACE,eAAA;EACA,SAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,aAAA;ACAJ;;ADIA;EACE,WAAA;EACA,kBAAA;ACDF;ADGE;EACE,WAAA;EACA,YAAA;EACA,YAAA;EACA,uBAAA;ACDJ;ADIE;EACE,kBAAA;EACA,SAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,aAAA;ACFJ","file":"index.css"}
@@ -1,29 +1,53 @@
1
1
  .checkout-payment-iframe-wrapper {
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- width: 100%;
6
- height: 100%;
7
- border: none;
8
- z-index: 1000;
9
- background-color: white;
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ border: none;
8
+ z-index: 1000;
9
+ background-color: white;
10
10
 
11
- iframe {
12
- width: 100%;
13
- height: 100%;
14
- border: none;
15
- background-color: white;
16
- }
11
+ iframe {
12
+ width: 100%;
13
+ height: 100%;
14
+ border: none;
15
+ background-color: white;
16
+ }
17
17
 
18
- .close-button {
19
- position: fixed;
20
- top: 16px;
21
- right: 16px;
22
- width: 32px;
23
- height: 32px;
24
- display: flex;
25
- align-items: center;
26
- justify-content: center;
27
- z-index: 1001;
28
- }
29
- }
18
+ .close-button {
19
+ position: fixed;
20
+ top: 16px;
21
+ right: 16px;
22
+ width: 32px;
23
+ height: 32px;
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ z-index: 1001;
28
+ }
29
+ }
30
+
31
+ .checkout-payment-redirection-iframe-wrapper {
32
+ width: 100%;
33
+ position: relative;
34
+
35
+ iframe {
36
+ width: 100%;
37
+ height: 100%;
38
+ border: none;
39
+ background-color: white;
40
+ }
41
+
42
+ .close-button {
43
+ position: absolute;
44
+ top: 16px;
45
+ right: 16px;
46
+ width: 32px;
47
+ height: 32px;
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ z-index: 1001;
52
+ }
53
+ }
@@ -0,0 +1,8 @@
1
+ import { forwardRef } from 'react';
2
+ import { FileInputProps } from '../types/index';
3
+
4
+ export const FileInput = forwardRef<HTMLInputElement, FileInputProps>(
5
+ function fileInput(props, ref) {
6
+ return <input type="file" {...props} ref={ref} />;
7
+ }
8
+ );
@@ -19,3 +19,4 @@ export * from './trans';
19
19
  export * from './link';
20
20
  export * from './pagination';
21
21
  export * from './live-commerce';
22
+ export * from './file-input';
@@ -1,17 +1,30 @@
1
1
  import clsx from 'clsx';
2
- import { forwardRef, FocusEvent, useState } from 'react';
2
+ import { forwardRef, FocusEvent, useState, Ref } from 'react';
3
3
  import { Controller } from 'react-hook-form';
4
- import NumberFormat, { NumberFormatProps } from 'react-number-format';
4
+
5
+ // @ts-ignore
6
+ import { PatternFormat, PatternFormatProps } from 'react-number-format';
5
7
  import { InputProps } from '../types';
6
8
  import { twMerge } from 'tailwind-merge';
7
9
 
10
+ const PatternFormatWithRef = forwardRef(
11
+ (props: PatternFormatProps, ref: Ref<HTMLInputElement>) => {
12
+ return <PatternFormat {...props} getInputRef={ref} />;
13
+ }
14
+ );
15
+ PatternFormatWithRef.displayName = 'PatternFormatWithRef';
16
+
8
17
  export const Input = forwardRef<
9
18
  HTMLInputElement,
10
19
  InputProps &
11
20
  Pick<
12
- NumberFormatProps,
13
- 'format' | 'mask' | 'allowEmptyFormatting' | 'onValueChange'
14
- >
21
+ PatternFormatProps,
22
+ 'mask' | 'allowEmptyFormatting' | 'onValueChange'
23
+ > & {
24
+ format?: string;
25
+ defaultValue?: string;
26
+ type?: string;
27
+ }
15
28
  >((props, ref) => {
16
29
  const [focused, setFocused] = useState(false);
17
30
  const [hasValue, setHasValue] = useState(false);
@@ -37,6 +50,7 @@ export const Input = forwardRef<
37
50
  ),
38
51
  props.className
39
52
  );
53
+
40
54
  const inputProps: any = {
41
55
  id,
42
56
  ref,
@@ -79,14 +93,14 @@ export const Input = forwardRef<
79
93
  <Controller
80
94
  name={props.name ?? ''}
81
95
  control={props.control}
82
- defaultValue={false}
83
96
  render={({ field }) => (
84
- <NumberFormat
97
+ <PatternFormatWithRef
85
98
  format={format}
86
99
  mask={mask ?? ''}
87
100
  {...rest}
88
101
  {...field}
89
102
  {...inputProps}
103
+ type={props.type as 'text' | 'password' | 'tel'}
90
104
  />
91
105
  )}
92
106
  />