@akinon/projectzero 1.64.0 → 1.65.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @akinon/projectzero
2
2
 
3
+ ## 1.65.0
4
+
3
5
  ## 1.64.0
4
6
 
5
7
  ## 1.63.0
@@ -1,5 +1,36 @@
1
1
  # projectzeronext
2
2
 
3
+ ## 1.65.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5a4c607: ZERO-2764: Add case-warning rule to eslint-plugin-projectzero
8
+ - 74a1269: ZERO-2658:Edit product name clickability on completed order page
9
+ - d13fd36: ZERO-2614: Refactor Price component to remove unnecessary code and improve readability also fix the decimal scale
10
+ - 902d828: ZERO-2621:edit position of loaderSpinner in favorites page
11
+ - 4614eee: ZERO-2602: The script that checks the build for standalone projects
12
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [d13fd36]
17
+ - Updated dependencies [86d2531]
18
+ - @akinon/next@1.65.0
19
+ - @akinon/pz-akifast@1.65.0
20
+ - @akinon/pz-b2b@1.65.0
21
+ - @akinon/pz-basket-gift-pack@1.65.0
22
+ - @akinon/pz-bkm@1.65.0
23
+ - @akinon/pz-checkout-gift-pack@1.65.0
24
+ - @akinon/pz-click-collect@1.65.0
25
+ - @akinon/pz-credit-payment@1.65.0
26
+ - @akinon/pz-gpay@1.65.0
27
+ - @akinon/pz-masterpass@1.65.0
28
+ - @akinon/pz-one-click-checkout@1.65.0
29
+ - @akinon/pz-otp@1.65.0
30
+ - @akinon/pz-pay-on-delivery@1.65.0
31
+ - @akinon/pz-saved-card@1.65.0
32
+ - @akinon/pz-tabby-extension@1.65.0
33
+
3
34
  ## 1.64.0
4
35
 
5
36
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projectzeronext",
3
- "version": "1.64.0",
3
+ "version": "1.65.0",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -22,27 +22,26 @@
22
22
  "prestart": "pz-prestart"
23
23
  },
24
24
  "dependencies": {
25
- "@akinon/next": "1.64.0",
26
- "@akinon/pz-akifast": "1.64.0",
27
- "@akinon/pz-b2b": "1.64.0",
28
- "@akinon/pz-basket-gift-pack": "1.64.0",
29
- "@akinon/pz-bkm": "1.64.0",
30
- "@akinon/pz-checkout-gift-pack": "1.64.0",
31
- "@akinon/pz-click-collect": "1.64.0",
32
- "@akinon/pz-credit-payment": "1.64.0",
33
- "@akinon/pz-gpay": "1.64.0",
34
- "@akinon/pz-masterpass": "1.64.0",
35
- "@akinon/pz-one-click-checkout": "1.64.0",
36
- "@akinon/pz-otp": "1.64.0",
37
- "@akinon/pz-pay-on-delivery": "1.64.0",
38
- "@akinon/pz-saved-card": "1.64.0",
39
- "@akinon/pz-tabby-extension": "1.64.0",
25
+ "@akinon/next": "1.65.0",
26
+ "@akinon/pz-akifast": "1.65.0",
27
+ "@akinon/pz-b2b": "1.65.0",
28
+ "@akinon/pz-basket-gift-pack": "1.65.0",
29
+ "@akinon/pz-bkm": "1.65.0",
30
+ "@akinon/pz-checkout-gift-pack": "1.65.0",
31
+ "@akinon/pz-click-collect": "1.65.0",
32
+ "@akinon/pz-credit-payment": "1.65.0",
33
+ "@akinon/pz-gpay": "1.65.0",
34
+ "@akinon/pz-masterpass": "1.65.0",
35
+ "@akinon/pz-one-click-checkout": "1.65.0",
36
+ "@akinon/pz-otp": "1.65.0",
37
+ "@akinon/pz-pay-on-delivery": "1.65.0",
38
+ "@akinon/pz-saved-card": "1.65.0",
39
+ "@akinon/pz-tabby-extension": "1.65.0",
40
40
  "@hookform/resolvers": "2.9.0",
41
41
  "@next/third-parties": "14.1.0",
42
42
  "@react-google-maps/api": "2.17.1",
43
43
  "@sentry/nextjs": "7.116.0",
44
44
  "dayjs": "1.11.5",
45
- "eslint-config-next": "14.2.2",
46
45
  "lossless-json": "2.0.5",
47
46
  "next": "14.2.5",
48
47
  "next-auth": "4.24.5",
@@ -61,7 +60,7 @@
61
60
  "yup": "0.32.11"
62
61
  },
63
62
  "devDependencies": {
64
- "@akinon/eslint-plugin-projectzero": "1.64.0",
63
+ "@akinon/eslint-plugin-projectzero": "1.65.0",
65
64
  "@semantic-release/changelog": "6.0.2",
66
65
  "@semantic-release/exec": "6.0.3",
67
66
  "@semantic-release/git": "10.0.1",
@@ -81,7 +80,7 @@
81
80
  "clsx": "1.1.1",
82
81
  "currency-symbol-map": "5.1.0",
83
82
  "eslint": "8.14.0",
84
- "eslint-config-next": "14.0.3",
83
+ "eslint-config-next": "14.2.3",
85
84
  "eslint-config-prettier": "8.5.0",
86
85
  "husky": "8.0.0",
87
86
  "jest": "29.7.0",
@@ -182,21 +182,25 @@ const CheckoutCompleted = ({
182
182
  }}
183
183
  >
184
184
  {data.order.orderitem_set.map((item) => (
185
- <div key={`order-item-${item.id}`} className="flex">
186
- <Link href={item.product.absolute_url} passHref>
185
+ <div
186
+ key={`order-item-${item.id}`}
187
+ className="flex justify-between gap-x-4 w-full"
188
+ >
189
+ <Link
190
+ className="flex justify-between gap-x-4 flex-1 items-center transition-all text-xs text-black-800 hover:text-secondary"
191
+ href={item.product.absolute_url}
192
+ passHref
193
+ >
187
194
  <Image
188
195
  src={item.product.image}
189
196
  alt={item.product.name}
190
197
  width={64}
191
198
  height={96}
192
199
  />
200
+
201
+ <span>{item.product.name}</span>
193
202
  </Link>
194
- <div className="flex justify-between flex-1 items-center ml-4">
195
- <>
196
- <div className="text-xs text-black-800 transition-all w-full hover:text-secondary">
197
- {item.product.name}
198
- </div>
199
- </>
203
+ <div className="flex justify-end items-center">
200
204
  <div>
201
205
  {item.retail_price !== item.price && (
202
206
  <div className="text-black-800 line-through text-xs min-w-max sm:text-sm">
@@ -1,8 +1,8 @@
1
1
  import { useMemo } from 'react';
2
2
  import NumberFormat, { NumberFormatProps } from 'react-number-format';
3
3
  import { getCurrency } from '@akinon/next/utils';
4
- import { PriceProps } from '@theme/types';
5
4
  import { useLocalization } from '@akinon/next/hooks';
5
+ import { PriceProps } from '../types';
6
6
  import Settings from '@theme/settings';
7
7
 
8
8
  export const Price = (props: NumberFormatProps & PriceProps) => {
@@ -21,12 +21,10 @@ export const Price = (props: NumberFormatProps & PriceProps) => {
21
21
  fixedDecimalScale = true,
22
22
  ...rest
23
23
  } = props;
24
+
24
25
  const { currency: selectedCurrencyCode } = useLocalization();
25
26
  const currencyCode_ = currencyCode || selectedCurrencyCode;
26
27
 
27
- // TODO: This is very bad practice. It broke decimalScale.
28
- const _value = value?.toString().replace('.', ',');
29
-
30
28
  const currency = useMemo(
31
29
  () =>
32
30
  getCurrency({
@@ -38,21 +36,39 @@ export const Price = (props: NumberFormatProps & PriceProps) => {
38
36
  [currencyCode_, useCurrencySymbol, useCurrencyAfterPrice, useCurrencySpace]
39
37
  );
40
38
 
39
+ const numericValue =
40
+ typeof value === 'string'
41
+ ? parseFloat(value)
42
+ : typeof value === 'number'
43
+ ? value
44
+ : 0;
45
+
46
+ const formattedValue = Number.isFinite(numericValue)
47
+ ? numericValue.toFixed(decimalScale)
48
+ : '0';
49
+
50
+ const displayValue =
51
+ useNegative && numericValue < 0
52
+ ? `-${useNegativeSpace ? ' ' : ''}${Math.abs(numericValue).toFixed(
53
+ decimalScale
54
+ )}`
55
+ : formattedValue;
56
+
41
57
  const currentCurrencyDecimalScale = Settings.localization.currencies.find(
42
58
  (currency) => currency.code === currencyCode_
43
59
  ).decimalScale;
44
60
 
45
61
  return (
46
62
  <NumberFormat
47
- value={useNegative ? `-${useNegativeSpace}${_value}` : _value}
48
- {...{
49
- [useCurrencyAfterPrice ? 'suffix' : 'prefix']: currency
50
- }}
63
+ value={displayValue}
51
64
  displayType={displayType}
52
65
  thousandSeparator={thousandSeparator}
53
66
  decimalScale={currentCurrencyDecimalScale ?? decimalScale}
54
67
  decimalSeparator={decimalSeparator}
55
68
  fixedDecimalScale={fixedDecimalScale}
69
+ prefix={!useCurrencyAfterPrice ? currency : undefined}
70
+ suffix={useCurrencyAfterPrice ? currency : undefined}
71
+ isNumericString={true}
56
72
  {...rest}
57
73
  />
58
74
  );
@@ -30,7 +30,11 @@ const FavoriteProductsList = () => {
30
30
  }
31
31
 
32
32
  if (isLoading || isFetching) {
33
- return <LoaderSpinner />; // TODO: Fix loader spinner position
33
+ return (
34
+ <div className="flex items-center justify-center h-80">
35
+ <LoaderSpinner />
36
+ </div>
37
+ );
34
38
  }
35
39
 
36
40
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "1.64.0",
3
+ "version": "1.65.0",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {