@akinon/next 1.14.0 → 1.14.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 (119) hide show
  1. package/.eslintrc.js +40 -40
  2. package/.prettierrc +13 -13
  3. package/CHANGELOG.md +6 -0
  4. package/api/auth.ts +231 -231
  5. package/api/cache.ts +44 -44
  6. package/api/client.ts +174 -174
  7. package/api/logout.ts +42 -42
  8. package/bin/pz-check-dependencies.js +98 -98
  9. package/bin/pz-install-plugins.js +33 -33
  10. package/bin/pz-install-theme.js +58 -58
  11. package/bin/pz-postbuild.js +1 -1
  12. package/bin/pz-postdev.js +1 -1
  13. package/bin/pz-postinstall.js +6 -6
  14. package/bin/pz-poststart.js +1 -1
  15. package/bin/pz-prebuild.js +4 -4
  16. package/bin/pz-predev.js +4 -4
  17. package/bin/pz-prestart.js +1 -1
  18. package/bin/run-script.js +44 -44
  19. package/components/accordion.tsx +52 -52
  20. package/components/button.tsx +46 -46
  21. package/components/client-root.tsx +19 -19
  22. package/components/icon.tsx +18 -18
  23. package/components/image.tsx +133 -133
  24. package/components/index.ts +17 -17
  25. package/components/input.tsx +110 -110
  26. package/components/lazy-component.tsx +33 -33
  27. package/components/loader-spinner.tsx +23 -23
  28. package/components/mobile-app-toggler.tsx +26 -26
  29. package/components/oauth-login.tsx +24 -24
  30. package/components/price.tsx +55 -55
  31. package/components/pz-providers.tsx +24 -24
  32. package/components/pz-root.tsx +21 -21
  33. package/components/radio.tsx +18 -18
  34. package/components/react-portal.tsx +45 -45
  35. package/components/redirect-three-d/content/index.tsx +74 -74
  36. package/components/redirect-three-d/index.tsx +17 -17
  37. package/components/trans.tsx +39 -39
  38. package/data/client/account.ts +208 -208
  39. package/data/client/api.ts +85 -85
  40. package/data/client/basket.ts +82 -82
  41. package/data/client/misc.ts +101 -101
  42. package/data/client/product.ts +89 -89
  43. package/data/client/user.ts +99 -99
  44. package/data/client/wishlist.ts +118 -118
  45. package/data/server/category.ts +132 -132
  46. package/data/server/flatpage.ts +21 -21
  47. package/data/server/form.ts +22 -22
  48. package/data/server/index.ts +10 -10
  49. package/data/server/landingpage.ts +24 -24
  50. package/data/server/list.ts +67 -67
  51. package/data/server/menu.ts +35 -35
  52. package/data/server/product.ts +86 -86
  53. package/data/server/seo.ts +48 -48
  54. package/data/server/special-page.ts +47 -47
  55. package/data/server/widget.ts +27 -27
  56. package/data/urls.ts +221 -221
  57. package/hocs/client/index.ts +1 -1
  58. package/hocs/client/with-segment-defaults.tsx +25 -25
  59. package/hocs/server/index.ts +1 -1
  60. package/hocs/server/with-segment-defaults.tsx +85 -85
  61. package/hooks/index.ts +10 -10
  62. package/hooks/use-captcha.tsx +76 -76
  63. package/hooks/use-common-product-attributes.ts +36 -36
  64. package/hooks/use-debounce.ts +20 -20
  65. package/hooks/use-localization.ts +78 -78
  66. package/hooks/use-media-query.ts +36 -36
  67. package/hooks/use-mobile-iframe-handler.ts +23 -23
  68. package/hooks/use-on-click-outside.tsx +28 -28
  69. package/hooks/use-router.ts +45 -45
  70. package/hooks/use-translation.ts +14 -14
  71. package/lib/cache.ts +215 -215
  72. package/localization/index.ts +5 -5
  73. package/localization/provider.tsx +58 -58
  74. package/middlewares/currency.ts +100 -100
  75. package/middlewares/default.ts +256 -256
  76. package/middlewares/index.ts +29 -29
  77. package/middlewares/locale.ts +68 -68
  78. package/middlewares/oauth-login.ts +79 -79
  79. package/middlewares/pretty-url.ts +104 -104
  80. package/middlewares/redirection-payment.ts +160 -160
  81. package/middlewares/three-d-redirection.ts +159 -159
  82. package/middlewares/url-redirection.ts +65 -65
  83. package/package.json +2 -2
  84. package/redux/hooks.ts +7 -7
  85. package/redux/middlewares/index.ts +50 -50
  86. package/redux/reducers/checkout.ts +184 -184
  87. package/redux/reducers/config.ts +28 -28
  88. package/redux/reducers/header.ts +59 -59
  89. package/redux/reducers/root.ts +61 -61
  90. package/sentry/index.ts +27 -27
  91. package/tailwind/rtl.js +137 -137
  92. package/types/commerce/account.ts +64 -64
  93. package/types/commerce/address.ts +94 -94
  94. package/types/commerce/basket.ts +43 -43
  95. package/types/commerce/category.ts +114 -114
  96. package/types/commerce/checkout.ts +143 -143
  97. package/types/commerce/flatpage.ts +7 -7
  98. package/types/commerce/form.ts +66 -66
  99. package/types/commerce/index.ts +12 -12
  100. package/types/commerce/landingpage.ts +7 -7
  101. package/types/commerce/misc.ts +127 -127
  102. package/types/commerce/order.ts +119 -119
  103. package/types/commerce/product.ts +109 -109
  104. package/types/commerce/widget.ts +28 -28
  105. package/types/gtm.ts +16 -16
  106. package/types/index.ts +274 -274
  107. package/types/metadata.ts +7 -7
  108. package/types/next-auth.d.ts +24 -24
  109. package/utils/app-fetch.ts +69 -69
  110. package/utils/deep-merge.js +24 -24
  111. package/utils/image-loader.ts +31 -31
  112. package/utils/index.ts +150 -150
  113. package/utils/localization.ts +29 -29
  114. package/utils/log.ts +138 -138
  115. package/utils/menu-generator.ts +27 -27
  116. package/utils/mobile-3d-iframe.ts +77 -77
  117. package/utils/server-translation.ts +57 -57
  118. package/utils/server-variables.ts +9 -9
  119. package/with-pz-config.js +94 -94
@@ -1,64 +1,64 @@
1
- export type AccountCancellationReason = {
2
- id: number;
3
- uuid: string;
4
- cancellation_type: string;
5
- created_date: string;
6
- extra_information_needed: boolean;
7
- is_active: boolean;
8
- modified_date: string;
9
- order: number;
10
- subject: string;
11
- translations: object;
12
- };
13
-
14
- export type AccountOrderCancellation = {
15
- return_policy: boolean;
16
- id: string;
17
- cancel_order_items: Array<{
18
- cancellation_type: string;
19
- description: string;
20
- order_item: string;
21
- reason: string;
22
- }>;
23
- };
24
-
25
- export type AccountOrderCancellationReason = {
26
- count: number;
27
- next: string;
28
- previous: null | string;
29
- results: AccountCancellationReason[];
30
- };
31
-
32
- export type AccountChangeEmailFormType = {
33
- email: string;
34
- emailConfirm: string;
35
- password: string;
36
- };
37
-
38
- export type AccountChangePasswordFormType = {
39
- old_password: string;
40
- new_password1: string;
41
- new_password2: string;
42
- };
43
-
44
- export type AccountProfileFormType = {
45
- date_of_birth: string;
46
- email_allowed: boolean;
47
- first_name: string;
48
- gender: string;
49
- last_name: string;
50
- phone: string;
51
- sms_allowed: boolean;
52
- [key: string]: any;
53
- };
54
-
55
- export type ContactFormType = {
56
- full_name: string;
57
- email: string;
58
- phone: string;
59
- subject: string;
60
- message: string;
61
- order?: string;
62
- country_code?: string;
63
- order_needed?: boolean;
64
- };
1
+ export type AccountCancellationReason = {
2
+ id: number;
3
+ uuid: string;
4
+ cancellation_type: string;
5
+ created_date: string;
6
+ extra_information_needed: boolean;
7
+ is_active: boolean;
8
+ modified_date: string;
9
+ order: number;
10
+ subject: string;
11
+ translations: object;
12
+ };
13
+
14
+ export type AccountOrderCancellation = {
15
+ return_policy: boolean;
16
+ id: string;
17
+ cancel_order_items: Array<{
18
+ cancellation_type: string;
19
+ description: string;
20
+ order_item: string;
21
+ reason: string;
22
+ }>;
23
+ };
24
+
25
+ export type AccountOrderCancellationReason = {
26
+ count: number;
27
+ next: string;
28
+ previous: null | string;
29
+ results: AccountCancellationReason[];
30
+ };
31
+
32
+ export type AccountChangeEmailFormType = {
33
+ email: string;
34
+ emailConfirm: string;
35
+ password: string;
36
+ };
37
+
38
+ export type AccountChangePasswordFormType = {
39
+ old_password: string;
40
+ new_password1: string;
41
+ new_password2: string;
42
+ };
43
+
44
+ export type AccountProfileFormType = {
45
+ date_of_birth: string;
46
+ email_allowed: boolean;
47
+ first_name: string;
48
+ gender: string;
49
+ last_name: string;
50
+ phone: string;
51
+ sms_allowed: boolean;
52
+ [key: string]: any;
53
+ };
54
+
55
+ export type ContactFormType = {
56
+ full_name: string;
57
+ email: string;
58
+ phone: string;
59
+ subject: string;
60
+ message: string;
61
+ order?: string;
62
+ country_code?: string;
63
+ order_needed?: boolean;
64
+ };
@@ -1,94 +1,94 @@
1
- export enum AddressType {
2
- individual = 'false',
3
- company = 'true'
4
- }
5
-
6
- export type AddressFormType = {
7
- type: string;
8
- is_corporate: AddressType;
9
- title: string;
10
- first_name: string;
11
- last_name: string;
12
- phone_number: string;
13
- country: string;
14
- city: string;
15
- township: string;
16
- district: string;
17
- line: string;
18
- postcode: string;
19
- company_name?: string;
20
- tax_no?: number;
21
- tax_office?: string;
22
- e_bill_taxpayer?: boolean;
23
- country_code?: string;
24
- };
25
-
26
- export type Country = {
27
- code: string;
28
- is_active: boolean;
29
- name: string;
30
- pk: number;
31
- translations: string | null;
32
- };
33
-
34
- export type City = {
35
- country: Country;
36
- is_active: boolean;
37
- name: string;
38
- pk: number;
39
- postcode: number;
40
- priority: null;
41
- translations: string | null;
42
- };
43
-
44
- export type Township = {
45
- city: City;
46
- is_active: boolean;
47
- name: string;
48
- pk: number;
49
- postcode: number;
50
- };
51
-
52
- export type District = {
53
- city: number;
54
- is_active: boolean;
55
- name: string;
56
- pk: number;
57
- postcode: number;
58
- township: number;
59
- };
60
-
61
- export interface Address {
62
- address_type: string;
63
- city: City;
64
- company_name: string;
65
- country: Country;
66
- district: District;
67
- e_bill_taxpayer: boolean;
68
- email: string;
69
- extra_field: null;
70
- first_name: string;
71
- hash_data: string;
72
- identity_number: number | null;
73
- is_corporate: 'true' | 'false';
74
- last_name: string;
75
- line: string;
76
- notes: string | null;
77
- phone_number: string;
78
- pk: number;
79
- postcode: string;
80
- primary: boolean;
81
- remote_id: null;
82
- retail_store: null;
83
- tax_no: string;
84
- tax_office: string;
85
- title: string;
86
- township: Township;
87
- user: { pk: number };
88
- latitude: string;
89
- longitude: string;
90
- name: string;
91
- address: string;
92
- fax_phone_number: string;
93
- image: string;
94
- }
1
+ export enum AddressType {
2
+ individual = 'false',
3
+ company = 'true'
4
+ }
5
+
6
+ export type AddressFormType = {
7
+ type: string;
8
+ is_corporate: AddressType;
9
+ title: string;
10
+ first_name: string;
11
+ last_name: string;
12
+ phone_number: string;
13
+ country: string;
14
+ city: string;
15
+ township: string;
16
+ district: string;
17
+ line: string;
18
+ postcode: string;
19
+ company_name?: string;
20
+ tax_no?: number;
21
+ tax_office?: string;
22
+ e_bill_taxpayer?: boolean;
23
+ country_code?: string;
24
+ };
25
+
26
+ export type Country = {
27
+ code: string;
28
+ is_active: boolean;
29
+ name: string;
30
+ pk: number;
31
+ translations: string | null;
32
+ };
33
+
34
+ export type City = {
35
+ country: Country;
36
+ is_active: boolean;
37
+ name: string;
38
+ pk: number;
39
+ postcode: number;
40
+ priority: null;
41
+ translations: string | null;
42
+ };
43
+
44
+ export type Township = {
45
+ city: City;
46
+ is_active: boolean;
47
+ name: string;
48
+ pk: number;
49
+ postcode: number;
50
+ };
51
+
52
+ export type District = {
53
+ city: number;
54
+ is_active: boolean;
55
+ name: string;
56
+ pk: number;
57
+ postcode: number;
58
+ township: number;
59
+ };
60
+
61
+ export interface Address {
62
+ address_type: string;
63
+ city: City;
64
+ company_name: string;
65
+ country: Country;
66
+ district: District;
67
+ e_bill_taxpayer: boolean;
68
+ email: string;
69
+ extra_field: null;
70
+ first_name: string;
71
+ hash_data: string;
72
+ identity_number: number | null;
73
+ is_corporate: 'true' | 'false';
74
+ last_name: string;
75
+ line: string;
76
+ notes: string | null;
77
+ phone_number: string;
78
+ pk: number;
79
+ postcode: string;
80
+ primary: boolean;
81
+ remote_id: null;
82
+ retail_store: null;
83
+ tax_no: string;
84
+ tax_office: string;
85
+ title: string;
86
+ township: Township;
87
+ user: { pk: number };
88
+ latitude: string;
89
+ longitude: string;
90
+ name: string;
91
+ address: string;
92
+ fax_phone_number: string;
93
+ image: string;
94
+ }
@@ -1,43 +1,43 @@
1
- import { Discount, UpsellDetail } from './misc';
2
- import { Product } from './product';
3
-
4
- export interface Basket {
5
- segment: { pk: number; price_list: number; stock_list: number };
6
- unavailable_basket_products: any[];
7
- upsell_details: UpsellDetail[];
8
- voucher_code: string | null;
9
- total_amount: string;
10
- total_quantity: number;
11
- basketitem_set: BasketItem[];
12
- created_date: string;
13
- discounts: Discount[];
14
- modified_date: string;
15
- pk: number;
16
- total_discount_amount: string;
17
- total_product_amount: string;
18
- upsell_messages: any[];
19
- }
20
-
21
- export interface BasketItem {
22
- attributes: object;
23
- attributes_kwargs: object;
24
- discount_amount: string;
25
- offer_badges: {
26
- description: string;
27
- discount: string;
28
- }[];
29
- parent: any | null;
30
- price: string;
31
- retail_price: string;
32
- stock: number;
33
- id: number;
34
- quantity: number;
35
- product: Product;
36
- currency_type: string;
37
- currency_type_label: string;
38
- image: string;
39
- shipping_discount: string;
40
- tax_rate: string;
41
- total_amount: string;
42
- unit_price: string;
43
- }
1
+ import { Discount, UpsellDetail } from './misc';
2
+ import { Product } from './product';
3
+
4
+ export interface Basket {
5
+ segment: { pk: number; price_list: number; stock_list: number };
6
+ unavailable_basket_products: any[];
7
+ upsell_details: UpsellDetail[];
8
+ voucher_code: string | null;
9
+ total_amount: string;
10
+ total_quantity: number;
11
+ basketitem_set: BasketItem[];
12
+ created_date: string;
13
+ discounts: Discount[];
14
+ modified_date: string;
15
+ pk: number;
16
+ total_discount_amount: string;
17
+ total_product_amount: string;
18
+ upsell_messages: any[];
19
+ }
20
+
21
+ export interface BasketItem {
22
+ attributes: object;
23
+ attributes_kwargs: object;
24
+ discount_amount: string;
25
+ offer_badges: {
26
+ description: string;
27
+ discount: string;
28
+ }[];
29
+ parent: any | null;
30
+ price: string;
31
+ retail_price: string;
32
+ stock: number;
33
+ id: number;
34
+ quantity: number;
35
+ product: Product;
36
+ currency_type: string;
37
+ currency_type_label: string;
38
+ image: string;
39
+ shipping_discount: string;
40
+ tax_rate: string;
41
+ total_amount: string;
42
+ unit_price: string;
43
+ }
@@ -1,114 +1,114 @@
1
- import { Pagination } from './misc';
2
- import { Product } from './product';
3
-
4
- export type SortOption = {
5
- is_selected: boolean;
6
- label: string;
7
- value: string;
8
- };
9
-
10
- export interface Category {
11
- pk: number;
12
- name: string;
13
- menuitemmodel: string;
14
- absolute_url: string;
15
- sort_option: number;
16
- uuid: string;
17
- depth: number;
18
- attributes: {
19
- category_seo_title?: {
20
- value: {
21
- page_break_desc: null | string;
22
- text: null | string;
23
- };
24
- kwargs: {
25
- value: object;
26
- data_type: 'nested';
27
- };
28
- };
29
- [key: string]: any;
30
- };
31
- }
32
-
33
- export type FacetChoice = {
34
- label: string;
35
- value: string | number;
36
- quantity: number;
37
- is_selected: boolean;
38
- url?: string;
39
- [key: string]: any;
40
- };
41
-
42
- export type Facet = {
43
- data: {
44
- choices: Array<FacetChoice>;
45
- key: string;
46
- name: string;
47
- order: number;
48
- search_key: string;
49
- widget_type: string;
50
- };
51
- extra_params: any;
52
- key: string;
53
- name: string;
54
- order: number | null;
55
- search_key: string;
56
- widget_type: 'category' | 'multiselect';
57
- };
58
-
59
- export interface SpecialPageType {
60
- banner: string;
61
- banner_mobile: string;
62
- banner_description: string;
63
- video_embedded_code: string;
64
- banner_url: string;
65
- name: string;
66
- pretty_url: {
67
- pk: number;
68
- new_path: string;
69
- old_path: string;
70
- parent: string | null;
71
- language: string;
72
- func_module: string;
73
- func_name: string;
74
- func_initkwargs: any;
75
- args: any[];
76
- kwargs: {
77
- [key: string]: any;
78
- };
79
- query_params: any;
80
- viewname: string;
81
- created_date: string;
82
- modified_date: string;
83
- prettyurl_set: any[];
84
- };
85
- [key: string]: any;
86
- }
87
-
88
- export interface GetCategoryResponse {
89
- category: Category;
90
- facets: Facet[];
91
- pagination: Pagination;
92
- products: Product[];
93
- search_text: string | null;
94
- sorters: SortOption[];
95
- special_page: SpecialPageType;
96
- }
97
-
98
- export type BreadcrumbResultType = {
99
- label: string;
100
- url: string;
101
- level: number;
102
- pk: string;
103
- sort_order: number;
104
- path: string;
105
- parent_pk: null | string;
106
- parent: null | BreadcrumbResultType;
107
- generator_name: string;
108
- extra_context: {
109
- attributes: {
110
- category_id: number;
111
- };
112
- numchild: number;
113
- };
114
- };
1
+ import { Pagination } from './misc';
2
+ import { Product } from './product';
3
+
4
+ export type SortOption = {
5
+ is_selected: boolean;
6
+ label: string;
7
+ value: string;
8
+ };
9
+
10
+ export interface Category {
11
+ pk: number;
12
+ name: string;
13
+ menuitemmodel: string;
14
+ absolute_url: string;
15
+ sort_option: number;
16
+ uuid: string;
17
+ depth: number;
18
+ attributes: {
19
+ category_seo_title?: {
20
+ value: {
21
+ page_break_desc: null | string;
22
+ text: null | string;
23
+ };
24
+ kwargs: {
25
+ value: object;
26
+ data_type: 'nested';
27
+ };
28
+ };
29
+ [key: string]: any;
30
+ };
31
+ }
32
+
33
+ export type FacetChoice = {
34
+ label: string;
35
+ value: string | number;
36
+ quantity: number;
37
+ is_selected: boolean;
38
+ url?: string;
39
+ [key: string]: any;
40
+ };
41
+
42
+ export type Facet = {
43
+ data: {
44
+ choices: Array<FacetChoice>;
45
+ key: string;
46
+ name: string;
47
+ order: number;
48
+ search_key: string;
49
+ widget_type: string;
50
+ };
51
+ extra_params: any;
52
+ key: string;
53
+ name: string;
54
+ order: number | null;
55
+ search_key: string;
56
+ widget_type: 'category' | 'multiselect';
57
+ };
58
+
59
+ export interface SpecialPageType {
60
+ banner: string;
61
+ banner_mobile: string;
62
+ banner_description: string;
63
+ video_embedded_code: string;
64
+ banner_url: string;
65
+ name: string;
66
+ pretty_url: {
67
+ pk: number;
68
+ new_path: string;
69
+ old_path: string;
70
+ parent: string | null;
71
+ language: string;
72
+ func_module: string;
73
+ func_name: string;
74
+ func_initkwargs: any;
75
+ args: any[];
76
+ kwargs: {
77
+ [key: string]: any;
78
+ };
79
+ query_params: any;
80
+ viewname: string;
81
+ created_date: string;
82
+ modified_date: string;
83
+ prettyurl_set: any[];
84
+ };
85
+ [key: string]: any;
86
+ }
87
+
88
+ export interface GetCategoryResponse {
89
+ category: Category;
90
+ facets: Facet[];
91
+ pagination: Pagination;
92
+ products: Product[];
93
+ search_text: string | null;
94
+ sorters: SortOption[];
95
+ special_page: SpecialPageType;
96
+ }
97
+
98
+ export type BreadcrumbResultType = {
99
+ label: string;
100
+ url: string;
101
+ level: number;
102
+ pk: string;
103
+ sort_order: number;
104
+ path: string;
105
+ parent_pk: null | string;
106
+ parent: null | BreadcrumbResultType;
107
+ generator_name: string;
108
+ extra_context: {
109
+ attributes: {
110
+ category_id: number;
111
+ };
112
+ numchild: number;
113
+ };
114
+ };