@akinon/projectzero 1.48.0-rc.2 → 1.48.0-rc.4

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @akinon/projectzero
2
2
 
3
+ ## 1.48.0-rc.4
4
+
5
+ ## 1.48.0-rc.3
6
+
7
+ ### Minor Changes
8
+
9
+ - 90282b53: ZERO-2729: Audit packages for yarn and npm and also update app-template
10
+ - 03c4c3eb: ZERO-2731: Update Project Zero CLI command
11
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
12
+ - 9b6bf91e: ZERO-2660: Change campaings to campaigns
13
+ - 00ffde2f: ZERO-2637: enhance create command with improved messaging
14
+ - d2f0f15c: ZERO-2723: Update sentry version and dependencies
15
+
3
16
  ## 1.48.0-rc.2
4
17
 
5
18
  ## 1.48.0-rc.1
@@ -1,5 +1,145 @@
1
1
  # projectzeronext
2
2
 
3
+ ## 1.48.0-rc.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [5dfeea0]
8
+ - @akinon/next@1.48.0-rc.4
9
+ - @akinon/pz-akifast@1.48.0-rc.4
10
+ - @akinon/pz-b2b@1.48.0-rc.4
11
+ - @akinon/pz-basket-gift-pack@1.48.0-rc.4
12
+ - @akinon/pz-bkm@1.48.0-rc.4
13
+ - @akinon/pz-checkout-gift-pack@1.48.0-rc.4
14
+ - @akinon/pz-click-collect@1.48.0-rc.4
15
+ - @akinon/pz-credit-payment@1.48.0-rc.4
16
+ - @akinon/pz-gpay@1.48.0-rc.4
17
+ - @akinon/pz-masterpass@1.48.0-rc.4
18
+ - @akinon/pz-one-click-checkout@1.48.0-rc.4
19
+ - @akinon/pz-otp@1.48.0-rc.4
20
+ - @akinon/pz-pay-on-delivery@1.48.0-rc.4
21
+
22
+ ## 1.48.0-rc.3
23
+
24
+ ### Minor Changes
25
+
26
+ - 90282b53: ZERO-2729: Audit packages for yarn and npm and also update app-template
27
+ - 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
28
+ - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
29
+ - 97b8bdc9: ZERO-2724: Remove onClick event in shipping options component
30
+ - 714e0b46: ZERO-2759: update pz-click-collect peer dependencies
31
+ - 7521265: ZERO-2787: Fix hover classname for favorite item
32
+ - 8217463: ZERO-2887: Add LoaderSpinner to Filters component
33
+ - 27a5296d: ZERO-2631:Fix Checkbox Click
34
+ - 5a4c607: ZERO-2764: Add case-warning rule to eslint-plugin-projectzero
35
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
36
+ - e665a0a: ZERO-2625: Add click outside functionality to close mobile menu
37
+ - 52c1373: ZERO-2619: Added fix flag for the staged linter
38
+ - 552ee8a: ZERO-2777: fix link component usage
39
+ - 03c4c3eb: ZERO-2731: Update Project Zero CLI command
40
+ - 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
41
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
42
+ - 0d3a913e: ZERO-2725: Update decimal scale in Price component
43
+ - 778a9a0b: ZERO-2740: Upgrade next to 14.2.4
44
+ - 9b6bf91e: ZERO-2660: Change campaings to campaigns
45
+ - 06650ca: ZERO-2620: Remove unnecessary pointer-events-none class
46
+ - 74a12699: ZERO-2658:Edit product name clickability on completed order page
47
+ - 4e1c15c: ZERO-2617: Remove TODO comment in ProductInfo component
48
+ - d3474c64: ZERO-2655: Add data source shipping option
49
+ - d2f0f15c: ZERO-2723: Update sentry version and dependencies
50
+ - 75080fd6: ZERO-2630: Add max limit to postcode area
51
+ - 9609eb2: ZERO-2779: Upgrade for tailwind
52
+ - 91265bba: ZERO-2551: Improve pretty url and caching performance
53
+ - 38a634e: ZERO-2893: Refactor category filter handling and URL parameters
54
+ - 959e1fa: ZERO-2778: Upgrade for nextjs
55
+ - 902d828a: ZERO-2621:edit position of loaderSpinner in favorites page
56
+ - 7a4bb764: ZERO-2610:Refactor FilterItem component for better readability and efficiency
57
+ - dfabc06: ZERO-2836: Upgrade version for tailwind
58
+ - dff0d595: ZERO-2659: add formData support to proxy api requests
59
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
60
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
61
+ - beb499e6: ZERO-2551: Add new tsconfig paths
62
+ - f45aa87: ZERO-2904: Upgrade version for tailwindcss
63
+ - fac2e5b: ZERO-2622: Add isMenuOpen state to Category reducer and update CategoryInfo component
64
+ - 4614eeeb: ZERO-2602: The script that checks the build for standalone projects
65
+ - e9a46acb: ZERO-2738: add CVC input to registered cards in Masterpass
66
+ - f046f8e0: ZERO-2575: update version for react-number-format
67
+ - b9273fd: ZERO-2889: add host headers to requests
68
+ - 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
69
+
70
+ ### Patch Changes
71
+
72
+ - Updated dependencies [90282b53]
73
+ - Updated dependencies [50b9069]
74
+ - Updated dependencies [572d2e84]
75
+ - Updated dependencies [a4c8d6a9]
76
+ - Updated dependencies [fda5b92]
77
+ - Updated dependencies [2d9b2b2]
78
+ - Updated dependencies [c53ea3e6]
79
+ - Updated dependencies [d93a507]
80
+ - Updated dependencies [8d9ac9a]
81
+ - Updated dependencies [18e8197]
82
+ - Updated dependencies [714e0b46]
83
+ - Updated dependencies [70279e7]
84
+ - Updated dependencies [6c25f66]
85
+ - Updated dependencies [bc2b411]
86
+ - Updated dependencies [3bf2dd9]
87
+ - Updated dependencies [e9541a1]
88
+ - Updated dependencies [c53ef7b9]
89
+ - Updated dependencies [9d94f7e]
90
+ - Updated dependencies [2e6104d]
91
+ - Updated dependencies [64699d3]
92
+ - Updated dependencies [0d3a913e]
93
+ - Updated dependencies [1448a96e]
94
+ - Updated dependencies [1ec2e9d]
95
+ - Updated dependencies [d6edb1d]
96
+ - Updated dependencies [d3474c64]
97
+ - Updated dependencies [75080fd6]
98
+ - Updated dependencies [17f8752]
99
+ - Updated dependencies [c45b62c]
100
+ - Updated dependencies [91265bba]
101
+ - Updated dependencies [bbe18b9f]
102
+ - Updated dependencies [d409996]
103
+ - Updated dependencies [4920742]
104
+ - Updated dependencies [12a873e]
105
+ - Updated dependencies [69ca080]
106
+ - Updated dependencies [7e56d6b]
107
+ - Updated dependencies [94b6928]
108
+ - Updated dependencies [98bb8dcd]
109
+ - Updated dependencies [46b7aad]
110
+ - Updated dependencies [dcc8a150]
111
+ - Updated dependencies [8f47cca]
112
+ - Updated dependencies [fad27689]
113
+ - Updated dependencies [dff0d595]
114
+ - Updated dependencies [fdd0b41]
115
+ - Updated dependencies [eecb282]
116
+ - Updated dependencies [f2c325c]
117
+ - Updated dependencies [9e25a64]
118
+ - Updated dependencies [beb499e6]
119
+ - Updated dependencies [146ea39]
120
+ - Updated dependencies [f2c92d5]
121
+ - Updated dependencies [7bd3d99]
122
+ - Updated dependencies [c47be30d]
123
+ - Updated dependencies [e9a46acb]
124
+ - Updated dependencies [f046f8e0]
125
+ - Updated dependencies [b9273fd]
126
+ - Updated dependencies [86d25315]
127
+ - Updated dependencies [c670bd4]
128
+ - Updated dependencies [3f9b8d7]
129
+ - @akinon/next@1.48.0-rc.3
130
+ - @akinon/pz-checkout-gift-pack@1.48.0-rc.3
131
+ - @akinon/pz-one-click-checkout@1.48.0-rc.3
132
+ - @akinon/pz-basket-gift-pack@1.48.0-rc.3
133
+ - @akinon/pz-click-collect@1.48.0-rc.3
134
+ - @akinon/pz-masterpass@1.48.0-rc.3
135
+ - @akinon/pz-akifast@1.48.0-rc.3
136
+ - @akinon/pz-gpay@1.48.0-rc.3
137
+ - @akinon/pz-b2b@1.48.0-rc.3
138
+ - @akinon/pz-bkm@1.48.0-rc.3
139
+ - @akinon/pz-otp@1.48.0-rc.3
140
+ - @akinon/pz-pay-on-delivery@1.48.0-rc.3
141
+ - @akinon/pz-credit-payment@1.48.0-rc.3
142
+
3
143
  ## 1.48.0-rc.2
4
144
 
5
145
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projectzeronext",
3
- "version": "1.48.0-rc.2",
3
+ "version": "1.48.0-rc.4",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -22,19 +22,19 @@
22
22
  "prestart": "pz-prestart"
23
23
  },
24
24
  "dependencies": {
25
- "@akinon/next": "1.48.0-rc.2",
26
- "@akinon/pz-akifast": "1.48.0-rc.2",
27
- "@akinon/pz-b2b": "1.48.0-rc.2",
28
- "@akinon/pz-basket-gift-pack": "1.48.0-rc.2",
29
- "@akinon/pz-bkm": "1.48.0-rc.2",
30
- "@akinon/pz-checkout-gift-pack": "1.48.0-rc.2",
31
- "@akinon/pz-click-collect": "1.48.0-rc.2",
32
- "@akinon/pz-credit-payment": "1.48.0-rc.2",
33
- "@akinon/pz-gpay": "1.48.0-rc.2",
34
- "@akinon/pz-masterpass": "1.48.0-rc.2",
35
- "@akinon/pz-one-click-checkout": "1.48.0-rc.2",
36
- "@akinon/pz-otp": "1.48.0-rc.2",
37
- "@akinon/pz-pay-on-delivery": "1.48.0-rc.2",
25
+ "@akinon/next": "1.48.0-rc.4",
26
+ "@akinon/pz-akifast": "1.48.0-rc.4",
27
+ "@akinon/pz-b2b": "1.48.0-rc.4",
28
+ "@akinon/pz-basket-gift-pack": "1.48.0-rc.4",
29
+ "@akinon/pz-bkm": "1.48.0-rc.4",
30
+ "@akinon/pz-checkout-gift-pack": "1.48.0-rc.4",
31
+ "@akinon/pz-click-collect": "1.48.0-rc.4",
32
+ "@akinon/pz-credit-payment": "1.48.0-rc.4",
33
+ "@akinon/pz-gpay": "1.48.0-rc.4",
34
+ "@akinon/pz-masterpass": "1.48.0-rc.4",
35
+ "@akinon/pz-one-click-checkout": "1.48.0-rc.4",
36
+ "@akinon/pz-otp": "1.48.0-rc.4",
37
+ "@akinon/pz-pay-on-delivery": "1.48.0-rc.4",
38
38
  "@hookform/resolvers": "2.9.0",
39
39
  "@next/third-parties": "14.1.0",
40
40
  "@react-google-maps/api": "2.17.1",
@@ -58,7 +58,7 @@
58
58
  "yup": "0.32.11"
59
59
  },
60
60
  "devDependencies": {
61
- "@akinon/eslint-plugin-projectzero": "1.48.0-rc.2",
61
+ "@akinon/eslint-plugin-projectzero": "1.48.0-rc.4",
62
62
  "@semantic-release/changelog": "6.0.2",
63
63
  "@semantic-release/exec": "6.0.3",
64
64
  "@semantic-release/git": "10.0.1",
@@ -94,7 +94,7 @@
94
94
  "stylelint-config-standard": "25.0.0",
95
95
  "stylelint-scss": "4.2.0",
96
96
  "stylelint-selector-bem-pattern": "2.1.1",
97
- "tailwindcss": "3.4.10",
97
+ "tailwindcss": "3.4.12",
98
98
  "ts-jest": "29.1.1",
99
99
  "ts-node": "10.7.0",
100
100
  "typescript": "5.2.2"
@@ -22,17 +22,28 @@ const CategoryActiveFilters = () => {
22
22
  const handleRemoveFilter = ({ facet, choice }) => {
23
23
  if (facet.widget_type === WIDGET_TYPE.category) {
24
24
  dispatch(removeCategoryFacet({ facet, choice }));
25
- return;
25
+ } else {
26
+ dispatch(toggleFacet({ facet, choice }));
26
27
  }
27
28
 
28
- dispatch(toggleFacet({ facet, choice }));
29
+ const urlSearchParams = new URLSearchParams(window.location.search);
30
+ urlSearchParams.delete(facet.search_key);
31
+ router.replace(pathname + '?' + urlSearchParams.toString());
29
32
  };
30
33
 
31
34
  const url = useMemo(() => {
32
- const facetSearchParams =
33
- convertFacetSearchParams(selectedFacets).toString();
35
+ const facetSearchParams = convertFacetSearchParams(selectedFacets);
36
+ const urlSearchParams = new URLSearchParams(searchParams.toString());
34
37
 
35
- const urlSearchParams = new URLSearchParams(facetSearchParams);
38
+ for (const key of Array.from(urlSearchParams.keys())) {
39
+ if (facetSearchParams.has(key)) {
40
+ urlSearchParams.delete(key);
41
+ }
42
+ }
43
+
44
+ for (const [key, value] of Array.from(facetSearchParams.entries())) {
45
+ urlSearchParams.append(key, value);
46
+ }
36
47
 
37
48
  const searchText = searchParams.get('search_text');
38
49
  const page = searchParams.get('page');
@@ -53,7 +64,6 @@ const CategoryActiveFilters = () => {
53
64
 
54
65
  useEffect(() => {
55
66
  router.push(url);
56
-
57
67
  // eslint-disable-next-line react-hooks/exhaustive-deps
58
68
  }, [url]);
59
69
 
@@ -1,12 +1,14 @@
1
1
  import clsx from 'clsx';
2
2
  import { useAppDispatch } from '@akinon/next/redux/hooks';
3
3
  import { Facet, FacetChoice } from '@akinon/next/types';
4
- import { Accordion, Radio, Checkbox } from '../../../components';
4
+ import { Accordion, Radio, Checkbox, LoaderSpinner } from '../../../components';
5
5
  import { WIDGET_TYPE } from '../../../types';
6
6
  import { SizeFilter } from './size-filter';
7
7
  import { toggleFacet } from '@theme/redux/reducers/category';
8
8
  import { commonProductAttributes } from '@theme/settings';
9
9
  import { useRouter } from '@akinon/next/hooks';
10
+ import { usePathname } from 'next/navigation';
11
+ import { useState } from 'react';
10
12
 
11
13
  const COMPONENT_TYPES = {
12
14
  [WIDGET_TYPE.category]: Radio,
@@ -19,6 +21,8 @@ const sizeKey = commonProductAttributes.find(
19
21
 
20
22
  interface Props {
21
23
  facet: Facet;
24
+ isPending: boolean;
25
+ startTransition: (callback: () => void) => void;
22
26
  }
23
27
 
24
28
  const sortByPredefinedOrder = (
@@ -78,16 +82,33 @@ const getComponentByWidgetType = (widgetType: string, facetKey: string) => {
78
82
  return COMPONENT_TYPES[widgetType] || COMPONENT_TYPES[WIDGET_TYPE.category];
79
83
  };
80
84
 
81
- export const FilterItem = ({ facet }: Props) => {
85
+ export const FilterItem = ({ facet, isPending, startTransition }: Props) => {
82
86
  const dispatch = useAppDispatch();
83
87
  const router = useRouter();
84
-
85
- const handleSelectFilter = (choice: FacetChoice) => {
86
- if (facet.key === 'category_ids') {
87
- router.push(choice.url);
88
- } else {
89
- dispatch(toggleFacet({ facet, choice }));
90
- }
88
+ const pathname = usePathname();
89
+
90
+ const [pendingChoice, setPendingChoice] = useState<string | null>(null);
91
+
92
+ const handleSelectFilter = ({
93
+ facet,
94
+ choice
95
+ }: {
96
+ facet: Facet;
97
+ choice: FacetChoice;
98
+ }) => {
99
+ setPendingChoice(choice.label);
100
+ startTransition(() => {
101
+ if (facet.key === 'category_ids') {
102
+ router.push(choice.url);
103
+ } else {
104
+ dispatch(toggleFacet({ facet, choice }));
105
+ }
106
+ setPendingChoice(null);
107
+
108
+ const urlSearchParams = new URLSearchParams(window.location.search);
109
+ urlSearchParams.delete(facet.search_key);
110
+ router.replace(pathname + '?' + urlSearchParams.toString());
111
+ });
91
112
  };
92
113
 
93
114
  const Component = getComponentByWidgetType(facet.widget_type, facet.key);
@@ -107,23 +128,34 @@ export const FilterItem = ({ facet }: Props) => {
107
128
  })}
108
129
  >
109
130
  {choices.map((choice, index) => (
110
- <Component
111
- key={choice.label}
112
- data={choice}
113
- name={facet.key}
114
- onChange={() => facet.key !== sizeKey && handleSelectFilter(choice)}
115
- onClick={() => facet.key === sizeKey && handleSelectFilter(choice)}
116
- checked={choice.is_selected}
117
- data-testid={`${choice.label.trim()}`}
118
- >
119
- {choice.label} (
120
- <span
121
- data-testid={`filter-count-${facet.name.toLowerCase()}-${index}`}
131
+ <div key={choice.label} className="relative">
132
+ <Component
133
+ key={choice.label}
134
+ data={choice}
135
+ name={facet.key}
136
+ onChange={() => handleSelectFilter({ facet, choice })}
137
+ onClick={() =>
138
+ facet.key === sizeKey && handleSelectFilter({ facet, choice })
139
+ }
140
+ checked={choice.is_selected}
141
+ data-testid={`${choice.label.trim()}`}
142
+ disabled={isPending}
122
143
  >
123
- {choice.quantity}
124
- </span>
125
- )
126
- </Component>
144
+ {choice.label} (
145
+ <span
146
+ data-testid={`filter-count-${facet.name.toLowerCase()}-${index}`}
147
+ >
148
+ {choice.quantity}
149
+ </span>
150
+ )
151
+ </Component>
152
+
153
+ {isPending && pendingChoice === choice.label && (
154
+ <div className="absolute inset-0 flex items-center justify-center z-50">
155
+ <LoaderSpinner />
156
+ </div>
157
+ )}
158
+ </div>
127
159
  ))}
128
160
  </div>
129
161
  </Accordion>
@@ -1,13 +1,12 @@
1
1
  'use client';
2
2
 
3
3
  import clsx from 'clsx';
4
-
5
4
  import { Button, Icon } from '@theme/components';
6
5
  import { useLocalization } from '@akinon/next/hooks';
7
6
  import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
8
7
  import { resetSelectedFacets } from '@theme/redux/reducers/category';
9
8
  import CategoryActiveFilters from '@theme/views/category/category-active-filters';
10
- import { useMemo } from 'react';
9
+ import { useMemo, useState, useTransition } from 'react';
11
10
  import { FilterItem } from './filter-item';
12
11
 
13
12
  interface Props {
@@ -21,12 +20,11 @@ export const Filters = (props: Props) => {
21
20
  const { t } = useLocalization();
22
21
  const { isMenuOpen, setIsMenuOpen } = props;
23
22
 
23
+ const [isPending, startTransition] = useTransition();
24
+
24
25
  const haveFilter = useMemo(() => {
25
- return (
26
- facets.filter(
27
- (facet) =>
28
- facet.data.choices.filter((choice) => choice.is_selected).length > 0
29
- ).length > 0
26
+ return facets.some((facet) =>
27
+ facet.data.choices.some((choice) => choice.is_selected)
30
28
  );
31
29
  }, [facets]);
32
30
 
@@ -51,12 +49,22 @@ export const Filters = (props: Props) => {
51
49
  <span className="text-sm">1 {t('category.filters.results')}</span>
52
50
  <span>{t('category.filters.ready_to_wear')}</span>
53
51
  </div>
52
+
54
53
  {facets.map((facet) => {
55
- return <FilterItem key={facet.key} facet={facet} />;
54
+ return (
55
+ <FilterItem
56
+ key={facet.key}
57
+ facet={facet}
58
+ isPending={isPending}
59
+ startTransition={startTransition}
60
+ />
61
+ );
56
62
  })}
63
+
57
64
  <div className="lg:hidden">
58
65
  <CategoryActiveFilters />
59
66
  </div>
67
+
60
68
  {haveFilter && (
61
69
  <div className="lg:hidden">
62
70
  <Button
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "1.48.0-rc.2",
3
+ "version": "1.48.0-rc.4",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {