@akinon/next 1.46.0 → 1.47.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +365 -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/wishlist.ts +70 -2
  20. package/data/server/category.ts +2 -2
  21. package/data/server/list.ts +2 -2
  22. package/data/server/product.ts +15 -13
  23. package/data/server/special-page.ts +2 -2
  24. package/data/urls.ts +17 -3
  25. package/hooks/index.ts +2 -1
  26. package/hooks/use-message-listener.ts +24 -0
  27. package/hooks/use-payment-options.ts +2 -1
  28. package/lib/cache-handler.mjs +33 -0
  29. package/lib/cache.ts +18 -6
  30. package/middlewares/default.ts +50 -2
  31. package/middlewares/locale.ts +32 -30
  32. package/middlewares/pretty-url.ts +4 -0
  33. package/middlewares/url-redirection.ts +4 -0
  34. package/package.json +5 -4
  35. package/plugins.d.ts +1 -0
  36. package/redux/middlewares/checkout.ts +70 -11
  37. package/redux/reducers/checkout.ts +24 -5
  38. package/redux/reducers/config.ts +2 -0
  39. package/routes/pretty-url.tsx +194 -0
  40. package/types/commerce/account.ts +1 -0
  41. package/types/commerce/address.ts +1 -1
  42. package/types/commerce/b2b.ts +12 -2
  43. package/types/commerce/checkout.ts +30 -0
  44. package/types/commerce/misc.ts +2 -0
  45. package/types/commerce/order.ts +12 -0
  46. package/types/index.ts +30 -2
  47. package/utils/app-fetch.ts +1 -1
  48. package/utils/generate-commerce-search-params.ts +6 -2
  49. package/utils/index.ts +27 -6
  50. package/utils/menu-generator.ts +2 -2
  51. package/utils/redirection-iframe.ts +85 -0
  52. package/utils/server-translation.ts +5 -1
  53. package/with-pz-config.js +11 -1
package/CHANGELOG.md CHANGED
@@ -1,12 +1,183 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.47.0-rc.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
8
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
9
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
10
+ - fda5b92: ZERO-2725: fix invalid import
11
+ - 2d9b2b2: ZERO-2816: Add segment to headers
12
+ - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
13
+ - 8d9ac9a: ZERO-2794: Add field to order type
14
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
15
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
16
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
17
+ - 3bf2dd9: ZERO-2551: Fix search page
18
+ - e9541a1: ZERO-2816: Add headers to url
19
+ - 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.
20
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
21
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
22
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
23
+ - 1448a96e: ZERO-2612: add errors type in CheckoutState
24
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
25
+ - d3474c6: ZERO-2655: Add data source shipping option
26
+ - 75080fd6: ZERO-2630: Add max limit to postcode area
27
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
28
+ - c45b62c: ZERO-2818: Add upload and download support for b2b package
29
+ - 91265bba: ZERO-2551: Improve pretty url and caching performance
30
+ - bbe18b9f: ZERO-2575: Fix build error
31
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
32
+ - 4920742: Disable getCachedTranslations
33
+ - 7e56d6b: ZERO-2841: Update api tagTypes
34
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
35
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
36
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
37
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
38
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
39
+ - fad2768: ZERO-2739: add gpay to payment plugin map
40
+ - dff0d595: ZERO-2659: add formData support to proxy api requests
41
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
42
+ - f2c325c: ZERO-2838: Move file input component into @akinon/next
43
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
44
+ - beb499e6: ZERO-2551: Add new tsconfig paths
45
+ - 948eb42: ZERO-2852: Add out of stock endpoints
46
+ - 146ea39: ZERO-2774: Update imports
47
+ - f2c92d5: ZERO-2816: Update cookie name
48
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
49
+ - c47be30: ZERO-2744: Update Order and OrderItem types
50
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
51
+ - f046f8e0: ZERO-2575: update version for react-number-format
52
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
53
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
54
+
3
55
  ## 1.46.0
4
56
 
5
57
  ## 1.45.0
6
58
 
7
59
  ### Minor Changes
8
60
 
61
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
62
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
63
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
64
+ - fda5b92: ZERO-2725: fix invalid import
65
+ - 2d9b2b2: ZERO-2816: Add segment to headers
66
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
67
+ - 8d9ac9a: ZERO-2794: Add field to order type
68
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
69
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
70
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
71
+ - 3bf2dd9: ZERO-2551: Fix search page
72
+ - e9541a1: ZERO-2816: Add headers to url
73
+ - 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.
74
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
75
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
76
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
77
+ - 1448a96e: ZERO-2612: add errors type in CheckoutState
78
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
79
+ - d3474c6: ZERO-2655: Add data source shipping option
80
+ - 75080fd6: ZERO-2630: Add max limit to postcode area
81
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
82
+ - c45b62c: ZERO-2818: Add upload and download support for b2b package
83
+ - 91265bba: ZERO-2551: Improve pretty url and caching performance
84
+ - bbe18b9f: ZERO-2575: Fix build error
85
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
86
+ - 4920742: Disable getCachedTranslations
87
+ - 7e56d6b: ZERO-2841: Update api tagTypes
88
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
89
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
90
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
91
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
92
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
93
+ - fad2768: ZERO-2739: add gpay to payment plugin map
94
+ - dff0d595: ZERO-2659: add formData support to proxy api requests
95
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
96
+ - f2c325c: ZERO-2838: Move file input component into @akinon/next
97
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
98
+ - beb499e6: ZERO-2551: Add new tsconfig paths
99
+ - 948eb42: ZERO-2852: Add out of stock endpoints
100
+ - 146ea39: ZERO-2774: Update imports
101
+ - f2c92d5: ZERO-2816: Update cookie name
102
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
103
+ - c47be30: ZERO-2744: Update Order and OrderItem types
104
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
105
+ - f046f8e0: ZERO-2575: update version for react-number-format
106
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
107
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
108
+
109
+ ## 1.45.0-rc.4
110
+
111
+ ### Minor Changes
112
+
113
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
114
+
115
+ ## 1.45.0-rc.3
116
+
117
+ ### Minor Changes
118
+
119
+ - 948eb42: ZERO-2852: Add out of stock endpoints
120
+
121
+ ## 1.45.0-rc.2
122
+
123
+ ### Minor Changes
124
+
125
+ - c45b62c: ZERO-2818: Add upload and download support for b2b package
126
+ - f2c325c: ZERO-2838: Move file input component into @akinon/next
127
+
128
+ ## 1.45.0-rc.1
129
+
130
+ ### Minor Changes
131
+
132
+ - 7e56d6b: ZERO-2841: Update api tagTypes
133
+
134
+ ## 1.45.0-rc.0
135
+
136
+ ### Minor Changes
137
+
138
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
139
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
140
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
141
+ - fda5b92: ZERO-2725: fix invalid import
142
+ - 2d9b2b2: ZERO-2816: Add segment to headers
143
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
144
+ - 8d9ac9a: ZERO-2794: Add field to order type
145
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
146
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
147
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
148
+ - 3bf2dd9: ZERO-2551: Fix search page
149
+ - e9541a1: ZERO-2816: Add headers to url
150
+ - 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.
151
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
152
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
153
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
154
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
9
155
  - 2ab6e08: ZERO-2841: Update getBasketDetail query
156
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
157
+ - d3474c6: ZERO-2655: Add data source shipping option
158
+ - 75080fd: ZERO-2630: Add max limit to postcode area
159
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
160
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
161
+ - bbe18b9: ZERO-2575: Fix build error
162
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
163
+ - 4920742: Disable getCachedTranslations
164
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
165
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
166
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
167
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
168
+ - fad2768: ZERO-2739: add gpay to payment plugin map
169
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
170
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
171
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
172
+ - beb499e: ZERO-2551: Add new tsconfig paths
173
+ - 146ea39: ZERO-2774: Update imports
174
+ - f2c92d5: ZERO-2816: Update cookie name
175
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
176
+ - c47be30: ZERO-2744: Update Order and OrderItem types
177
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
178
+ - f046f8e0: ZERO-2575: update version for react-number-format
179
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
180
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
10
181
 
11
182
  ## 1.44.0
12
183
 
@@ -14,7 +185,201 @@
14
185
 
15
186
  ### Minor Changes
16
187
 
188
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
189
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
190
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
191
+ - fda5b92: ZERO-2725: fix invalid import
192
+ - 2d9b2b2: ZERO-2816: Add segment to headers
193
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
194
+ - 8d9ac9a: ZERO-2794: Add field to order type
195
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
196
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
197
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
198
+ - 3bf2dd9: ZERO-2551: Fix search page
199
+ - e9541a1: ZERO-2816: Add headers to url
200
+ - 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.
201
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
202
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
203
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
204
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
205
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
206
+ - d3474c6: ZERO-2655: Add data source shipping option
207
+ - 75080fd: ZERO-2630: Add max limit to postcode area
208
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
209
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
210
+ - bbe18b9: ZERO-2575: Fix build error
211
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
212
+ - 4920742: Disable getCachedTranslations
213
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
214
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
215
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
216
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
217
+ - fad2768: ZERO-2739: add gpay to payment plugin map
218
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
219
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
220
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
221
+ - beb499e: ZERO-2551: Add new tsconfig paths
222
+ - 146ea39: ZERO-2774: Update imports
223
+ - f2c92d5: ZERO-2816: Update cookie name
224
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
225
+ - c47be30: ZERO-2744: Update Order and OrderItem types
226
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
227
+ - f046f8e0: ZERO-2575: update version for react-number-format
228
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
229
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
230
+
231
+ ## 1.43.0-rc.15
232
+
233
+ ## 1.43.0-rc.14
234
+
235
+ ### Minor Changes
236
+
237
+ - 3bf2dd9: ZERO-2551: Fix search page
238
+
239
+ ## 1.43.0-rc.13
240
+
241
+ ### Minor Changes
242
+
243
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
244
+
245
+ ## 1.43.0-rc.12
246
+
247
+ ### Minor Changes
248
+
249
+ - 4920742: Disable getCachedTranslations
250
+
251
+ ## 1.43.0-rc.11
252
+
253
+ ### Minor Changes
254
+
255
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
256
+
257
+ ## 1.43.0-rc.10
258
+
259
+ ### Minor Changes
260
+
261
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
262
+
263
+ ## 1.43.0-rc.9
264
+
265
+ ### Minor Changes
266
+
267
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
268
+
269
+ ## 1.43.0-rc.8
270
+
271
+ ### Minor Changes
272
+
273
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
274
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
275
+
276
+ ## 1.43.0-rc.7
277
+
278
+ ### Minor Changes
279
+
280
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
281
+
282
+ ## 1.43.0-rc.6
283
+
284
+ ### Minor Changes
285
+
286
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
287
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
288
+ - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
289
+ - fda5b92: ZERO-2725: fix invalid import
290
+ - 2d9b2b2: ZERO-2816: Add segment to headers
291
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
292
+ - 8d9ac9a: ZERO-2794: Add field to order type
293
+ - e9541a1: ZERO-2816: Add headers to url
294
+ - 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.
295
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
296
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
297
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
298
+ - d3474c6: ZERO-2655: Add data source shipping option
299
+ - 75080fd: ZERO-2630: Add max limit to postcode area
300
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
301
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
302
+ - bbe18b9: ZERO-2575: Fix build error
303
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
304
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
305
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
306
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
307
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
308
+ - fad2768: ZERO-2739: add gpay to payment plugin map
309
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
310
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
17
311
  - 4a163f2: ZERO-2761: Add condition for basket summary
312
+ - beb499e: ZERO-2551: Add new tsconfig paths
313
+ - 146ea39: ZERO-2774: Update imports
314
+ - f2c92d5: ZERO-2816: Update cookie name
315
+ - c47be30: ZERO-2744: Update Order and OrderItem types
316
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
317
+ - f046f8e: ZERO-2575: update version for react-number-format
318
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
319
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
320
+
321
+ ## 1.43.0-rc.5
322
+
323
+ ### Minor Changes
324
+
325
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
326
+
327
+ ## 1.43.0-rc.4
328
+
329
+ ### Minor Changes
330
+
331
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
332
+
333
+ ## 1.43.0-rc.3
334
+
335
+ ### Minor Changes
336
+
337
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
338
+
339
+ ## 1.43.0-rc.2
340
+
341
+ ### Minor Changes
342
+
343
+ - f2c92d5: ZERO-2816: Update cookie name
344
+
345
+ ## 1.43.0-rc.1
346
+
347
+ ### Minor Changes
348
+
349
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
350
+
351
+ ## 1.43.0-rc.0
352
+
353
+ ### Minor Changes
354
+
355
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
356
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
357
+ - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
358
+ - fda5b92: ZERO-2725: fix invalid import
359
+ - 2d9b2b2: ZERO-2816: Add segment to headers
360
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
361
+ - 8d9ac9a: ZERO-2794: Add field to order type
362
+ - e9541a1: ZERO-2816: Add headers to url
363
+ - 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.
364
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
365
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
366
+ - d3474c6: ZERO-2655: Add data source shipping option
367
+ - 75080fd: ZERO-2630: Add max limit to postcode area
368
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
369
+ - bbe18b9: ZERO-2575: Fix build error
370
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
371
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
372
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
373
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
374
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
375
+ - fad2768: ZERO-2739: add gpay to payment plugin map
376
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
377
+ - beb499e: ZERO-2551: Add new tsconfig paths
378
+ - 146ea39: ZERO-2774: Update imports
379
+ - c47be30: ZERO-2744: Update Order and OrderItem types
380
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
381
+ - f046f8e: ZERO-2575: update version for react-number-format
382
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
18
383
 
19
384
  ## 1.42.0
20
385
 
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
  />