@akinon/projectzero 2.0.0-beta.0 → 2.0.0-beta.2

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 (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/app-template/CHANGELOG.md +50 -0
  3. package/app-template/next-env.d.ts +1 -1
  4. package/app-template/package.json +34 -34
  5. package/app-template/src/app/[commerce]/[locale]/[currency]/[...prettyurl]/page.tsx +6 -4
  6. package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/cancellation/page.tsx +5 -3
  7. package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/page.tsx +5 -3
  8. package/app-template/src/app/[commerce]/[locale]/[currency]/account/profile/page.tsx +1 -1
  9. package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +4 -1
  10. package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +3 -1
  11. package/app-template/src/app/[commerce]/[locale]/[currency]/forms/[pk]/generate/page.tsx +4 -2
  12. package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +7 -5
  13. package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/page.tsx +3 -1
  14. package/app-template/src/app/[commerce]/[locale]/[currency]/layout.tsx +3 -1
  15. package/app-template/src/app/[commerce]/[locale]/[currency]/list/page.tsx +3 -1
  16. package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/page.tsx +3 -7
  17. package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +8 -5
  18. package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +3 -1
  19. package/app-template/src/app/[commerce]/[locale]/[currency]/users/email-set-primary/[[...id]]/page.tsx +4 -1
  20. package/app-template/src/app/[commerce]/[locale]/[currency]/users/registration/account-confirm-email/[[...id]]/page.tsx +3 -1
  21. package/app-template/src/app/[commerce]/[locale]/[currency]/users/reset/[[...id]]/page.tsx +11 -3
  22. package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/[node]/route.ts +1 -1
  23. package/app-template/src/components/pwa-tags.tsx +0 -1
  24. package/app-template/src/redux/store.ts +4 -3
  25. package/app-template/src/views/account/address-form.tsx +2 -2
  26. package/app-template/src/views/account/contact-form.tsx +1 -1
  27. package/app-template/src/views/guest-login/index.tsx +1 -1
  28. package/app-template/src/views/header/mini-basket.tsx +1 -1
  29. package/app-template/src/views/otp-login/index.tsx +1 -1
  30. package/app-template/src/views/register/index.tsx +1 -1
  31. package/dist/commands/commerce-url.js +17 -7
  32. package/dist/commands/create.js +17 -7
  33. package/dist/commands/plugins.js +17 -7
  34. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @akinon/projectzero
2
2
 
3
+ ## 2.0.0-beta.2
4
+
5
+ ## 2.0.0-beta.1
6
+
7
+ ### Minor Changes
8
+
9
+ - ZERO-3091: Upgrade Next.js to v15 and React to v19
10
+
3
11
  ## 2.0.0-beta.0
4
12
 
5
13
  ### Major Changes
@@ -1,5 +1,55 @@
1
1
  # projectzeronext
2
2
 
3
+ ## 2.0.0-beta.2
4
+
5
+ ### Minor Changes
6
+
7
+ - dd69cc6: ZERO-3079: Modularize pre-order middleware
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [dd69cc6]
12
+ - @akinon/next@2.0.0-beta.2
13
+ - @akinon/pz-akifast@2.0.0-beta.2
14
+ - @akinon/pz-b2b@2.0.0-beta.2
15
+ - @akinon/pz-basket-gift-pack@2.0.0-beta.2
16
+ - @akinon/pz-bkm@2.0.0-beta.2
17
+ - @akinon/pz-checkout-gift-pack@2.0.0-beta.2
18
+ - @akinon/pz-click-collect@2.0.0-beta.2
19
+ - @akinon/pz-credit-payment@2.0.0-beta.2
20
+ - @akinon/pz-gpay@2.0.0-beta.2
21
+ - @akinon/pz-masterpass@2.0.0-beta.2
22
+ - @akinon/pz-one-click-checkout@2.0.0-beta.2
23
+ - @akinon/pz-otp@2.0.0-beta.2
24
+ - @akinon/pz-pay-on-delivery@2.0.0-beta.2
25
+ - @akinon/pz-saved-card@2.0.0-beta.2
26
+ - @akinon/pz-tabby-extension@2.0.0-beta.2
27
+
28
+ ## 2.0.0-beta.1
29
+
30
+ ### Minor Changes
31
+
32
+ - ZERO-3091: Upgrade Next.js to v15 and React to v19
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies
37
+ - @akinon/pz-checkout-gift-pack@2.0.0-beta.1
38
+ - @akinon/pz-one-click-checkout@2.0.0-beta.1
39
+ - @akinon/pz-basket-gift-pack@2.0.0-beta.1
40
+ - @akinon/pz-pay-on-delivery@2.0.0-beta.1
41
+ - @akinon/pz-tabby-extension@2.0.0-beta.1
42
+ - @akinon/pz-credit-payment@2.0.0-beta.1
43
+ - @akinon/pz-click-collect@2.0.0-beta.1
44
+ - @akinon/pz-masterpass@2.0.0-beta.1
45
+ - @akinon/pz-saved-card@2.0.0-beta.1
46
+ - @akinon/next@2.0.0-beta.1
47
+ - @akinon/pz-akifast@2.0.0-beta.1
48
+ - @akinon/pz-gpay@2.0.0-beta.1
49
+ - @akinon/pz-b2b@2.0.0-beta.1
50
+ - @akinon/pz-bkm@2.0.0-beta.1
51
+ - @akinon/pz-otp@2.0.0-beta.1
52
+
3
53
  ## 2.0.0-beta.0
4
54
 
5
55
  ### Major Changes
@@ -3,4 +3,4 @@
3
3
  /// <reference types="next/navigation-types/compat/navigation" />
4
4
 
5
5
  // NOTE: This file should not be edited
6
- // see https://nextjs.org/docs/basic-features/typescript for more information.
6
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projectzeronext",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -22,34 +22,34 @@
22
22
  "prestart": "pz-prestart"
23
23
  },
24
24
  "dependencies": {
25
- "@akinon/next": "2.0.0-beta.0",
26
- "@akinon/pz-akifast": "2.0.0-beta.0",
27
- "@akinon/pz-b2b": "2.0.0-beta.0",
28
- "@akinon/pz-basket-gift-pack": "2.0.0-beta.0",
29
- "@akinon/pz-bkm": "2.0.0-beta.0",
30
- "@akinon/pz-checkout-gift-pack": "2.0.0-beta.0",
31
- "@akinon/pz-click-collect": "2.0.0-beta.0",
32
- "@akinon/pz-credit-payment": "2.0.0-beta.0",
33
- "@akinon/pz-gpay": "2.0.0-beta.0",
34
- "@akinon/pz-masterpass": "2.0.0-beta.0",
35
- "@akinon/pz-one-click-checkout": "2.0.0-beta.0",
36
- "@akinon/pz-otp": "2.0.0-beta.0",
37
- "@akinon/pz-pay-on-delivery": "2.0.0-beta.0",
38
- "@akinon/pz-saved-card": "2.0.0-beta.0",
39
- "@akinon/pz-tabby-extension": "2.0.0-beta.0",
25
+ "@akinon/next": "2.0.0-beta.2",
26
+ "@akinon/pz-akifast": "2.0.0-beta.2",
27
+ "@akinon/pz-b2b": "2.0.0-beta.2",
28
+ "@akinon/pz-basket-gift-pack": "2.0.0-beta.2",
29
+ "@akinon/pz-bkm": "2.0.0-beta.2",
30
+ "@akinon/pz-checkout-gift-pack": "2.0.0-beta.2",
31
+ "@akinon/pz-click-collect": "2.0.0-beta.2",
32
+ "@akinon/pz-credit-payment": "2.0.0-beta.2",
33
+ "@akinon/pz-gpay": "2.0.0-beta.2",
34
+ "@akinon/pz-masterpass": "2.0.0-beta.2",
35
+ "@akinon/pz-one-click-checkout": "2.0.0-beta.2",
36
+ "@akinon/pz-otp": "2.0.0-beta.2",
37
+ "@akinon/pz-pay-on-delivery": "2.0.0-beta.2",
38
+ "@akinon/pz-saved-card": "2.0.0-beta.2",
39
+ "@akinon/pz-tabby-extension": "2.0.0-beta.2",
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
45
  "lossless-json": "2.0.5",
46
- "next": "14.2.5",
47
- "next-auth": "4.24.5",
46
+ "next": "15.1.2",
47
+ "next-auth": "4.24.11",
48
48
  "next-pwa": "5.6.0",
49
49
  "pino": "8.11.0",
50
- "postcss": "8.4.49",
51
- "react": "18.2.0",
52
- "react-dom": "18.2.0",
50
+ "postcss": "8.4.31",
51
+ "react": "19.0.0",
52
+ "react-dom": "19.0.0",
53
53
  "react-google-recaptcha": "2.1.0",
54
54
  "react-hook-form": "7.31.3",
55
55
  "react-intersection-observer": "9.4.0",
@@ -61,7 +61,7 @@
61
61
  "yup": "0.32.11"
62
62
  },
63
63
  "devDependencies": {
64
- "@akinon/eslint-plugin-projectzero": "2.0.0-beta.0",
64
+ "@akinon/eslint-plugin-projectzero": "2.0.0-beta.2",
65
65
  "@semantic-release/changelog": "6.0.2",
66
66
  "@semantic-release/exec": "6.0.3",
67
67
  "@semantic-release/git": "10.0.1",
@@ -72,23 +72,23 @@
72
72
  "@testing-library/user-event": "14.1.1",
73
73
  "@types/googlemaps": "3.43.3",
74
74
  "@types/jest": "27.4.1",
75
- "@types/react": "18.2.27",
76
- "@types/react-dom": "18.2.12",
77
- "@typescript-eslint/eslint-plugin": "6.7.4",
78
- "@typescript-eslint/parser": "6.7.4",
79
- "autoprefixer": "10.4.20",
75
+ "@types/react": "19.0.2",
76
+ "@types/react-dom": "19.0.2",
77
+ "@typescript-eslint/eslint-plugin": "8.18.2",
78
+ "@typescript-eslint/parser": "8.18.2",
79
+ "autoprefixer": "10.4.13",
80
80
  "client-only": "0.0.1",
81
81
  "clsx": "1.1.1",
82
82
  "currency-symbol-map": "5.1.0",
83
- "eslint": "8.14.0",
84
- "eslint-config-next": "14.2.3",
85
- "eslint-config-prettier": "8.5.0",
83
+ "eslint": "9.17.0",
84
+ "eslint-config-next": "15.1.2",
85
+ "eslint-config-prettier": "9.1.0",
86
86
  "husky": "8.0.0",
87
87
  "jest": "29.7.0",
88
88
  "jest-css-modules-transform": "4.3.0",
89
89
  "lint-staged": "13.1.0",
90
- "prettier": "2.6.2",
91
- "react-number-format": "5.3.4",
90
+ "prettier": "3.4.2",
91
+ "react-number-format": "5.4.2",
92
92
  "sass": "1.49.9",
93
93
  "semantic-release": "19.0.5",
94
94
  "server-only": "0.0.1",
@@ -100,10 +100,10 @@
100
100
  "tailwindcss": "3.4.14",
101
101
  "ts-jest": "29.1.1",
102
102
  "ts-node": "10.7.0",
103
- "typescript": "5.2.2"
103
+ "typescript": "5.7.2"
104
104
  },
105
105
  "resolutions": {
106
106
  "**/postcss": "8.4.31"
107
107
  },
108
- "packageManager": "yarn@1.22.17"
108
+ "packageManager": "yarn@1.22.22"
109
109
  }
@@ -56,7 +56,8 @@ const resolvePrettyUrlHandler =
56
56
  return prettyUrlResult;
57
57
  };
58
58
 
59
- export async function generateMetadata({ params }: PageProps) {
59
+ export async function generateMetadata(props: PageProps) {
60
+ const params = await props.params;
60
61
  let result: Metadata = {};
61
62
  const { prettyurl } = params;
62
63
  const pageSlug = prettyurl
@@ -81,7 +82,7 @@ export async function generateMetadata({ params }: PageProps) {
81
82
  ...params,
82
83
  pk: prettyUrlResult.pk
83
84
  },
84
- searchParams
85
+ searchParams: Promise.resolve(searchParams)
85
86
  };
86
87
 
87
88
  try {
@@ -123,7 +124,8 @@ export async function generateMetadata({ params }: PageProps) {
123
124
  export const dynamic = 'force-static';
124
125
  export const revalidate = 300;
125
126
 
126
- export default async function Page({ params }) {
127
+ export default async function Page(props) {
128
+ const params = await props.params;
127
129
  const { prettyurl } = params;
128
130
  const pageSlug = prettyurl
129
131
  .filter((x) => !x.startsWith('searchparams'))
@@ -159,7 +161,7 @@ export default async function Page({ params }) {
159
161
  ...params,
160
162
  pk: result.pk
161
163
  },
162
- searchParams: urlSearchParams
164
+ searchParams: Promise.resolve(urlSearchParams)
163
165
  };
164
166
 
165
167
  if (result.path.startsWith('/category/')) {
@@ -8,7 +8,7 @@ import {
8
8
  useGetOrderQuery,
9
9
  useGetCancellationReasonsQuery
10
10
  } from '@akinon/next/data/client/account';
11
- import { AccountOrderCancellation } from '@akinon/next/types';
11
+ import type { AccountOrderCancellation } from '@akinon/next/types';
12
12
  import {
13
13
  Button,
14
14
  Checkbox,
@@ -17,7 +17,7 @@ import {
17
17
  LoaderSpinner,
18
18
  Link
19
19
  } from '@theme/components';
20
- import { useState } from 'react';
20
+ import { useState, use } from 'react';
21
21
  import { OrderDetailHeader } from '@theme/views/account/orders/order-detail-header';
22
22
  import { OrderCancellationItem } from '@theme/views/account/orders/order-cancellation-item';
23
23
  import { useLocalization } from '@akinon/next/hooks';
@@ -27,6 +27,8 @@ const accountOrderCancellationSchema = yup.object().shape({
27
27
  });
28
28
 
29
29
  const AccountOrderCancellation = ({ params }) => {
30
+ const pageParams = use(params) as { id: string };
31
+
30
32
  const { t } = useLocalization();
31
33
  const {
32
34
  register,
@@ -46,7 +48,7 @@ const AccountOrderCancellation = ({ params }) => {
46
48
  data: order,
47
49
  isLoading,
48
50
  isSuccess: orderSuccess
49
- } = useGetOrderQuery(params.id);
51
+ } = useGetOrderQuery(pageParams.id);
50
52
 
51
53
  const [isModalOpen, setIsModalOpen] = useState(false);
52
54
  const [responseMessage, setResponseMessage] = useState({
@@ -5,7 +5,7 @@ import { Image } from '@akinon/next/components/image';
5
5
  import clsx from 'clsx';
6
6
  import { SalesContractModal } from '@theme/views/sales-contract-modal';
7
7
  import { useGetOrderQuery } from '@akinon/next/data/client/account';
8
- import { useEffect, useState } from 'react';
8
+ import { useEffect, useState, use } from 'react';
9
9
 
10
10
  import { OrderDetailHeader } from '@theme/views/account/orders/order-detail-header';
11
11
  import { ROUTES } from '@theme/routes';
@@ -13,7 +13,9 @@ import { useLocalization } from '@akinon/next/hooks';
13
13
  import settings from 'settings';
14
14
  import { getOrderStatus } from 'utils';
15
15
 
16
- const AccountOrderDetail = ({ params: { id } }) => {
16
+ const AccountOrderDetail = ({ params }) => {
17
+ const pageParams = use(params) as { id: string };
18
+
17
19
  const { locale, t } = useLocalization();
18
20
 
19
21
  const localeValue = settings.localization.locales.find(
@@ -25,7 +27,7 @@ const AccountOrderDetail = ({ params: { id } }) => {
25
27
  isLoading,
26
28
  isSuccess,
27
29
  isFetching
28
- } = useGetOrderQuery(id);
30
+ } = useGetOrderQuery(pageParams.id);
29
31
  const [orderDate, setOrderDate] = useState('');
30
32
 
31
33
  const groupedOrder = [];
@@ -252,7 +252,7 @@ export default function Page() {
252
252
  <Input
253
253
  label={t('account.my_profile.form.phone.placeholder')}
254
254
  type="tel"
255
- format={user_phone_format.replace(/\9/g, '#')}
255
+ format={user_phone_format.replace(/9/g, '#')}
256
256
  mask="_"
257
257
  allowEmptyFormatting={true}
258
258
  control={control}
@@ -3,7 +3,10 @@ import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { PageProps } from '@akinon/next/types';
4
4
  import CategoryLayout from '@theme/views/category/layout';
5
5
 
6
- async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
6
+ async function Page(props: PageProps<{ pk: number }>) {
7
+ const params = await props.params;
8
+ const searchParams = await props.searchParams;
9
+
7
10
  const { data, breadcrumbData } = await getCategoryData({
8
11
  pk: params.pk,
9
12
  searchParams
@@ -2,7 +2,9 @@ import { getFlatPageData } from '@akinon/next/data/server';
2
2
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { PageProps } from '@akinon/next/types';
4
4
 
5
- async function Page({ params }: PageProps<{ pk: number }>) {
5
+ async function Page(props: PageProps<{ pk: number }>) {
6
+ const params = await props.params;
7
+
6
8
  const data = await getFlatPageData({ pk: params.pk });
7
9
 
8
10
  return (
@@ -2,7 +2,9 @@ import { getFormData } from '@akinon/next/data/server';
2
2
  import { t } from '@akinon/next/utils/server-translation';
3
3
  import { GenerateFormFields } from '@theme/components/generate-form-fields';
4
4
 
5
- export default async function Page({ params }) {
5
+ export default async function Page(props) {
6
+ const params = await props.params;
7
+
6
8
  const data = await getFormData({ pk: params.pk });
7
9
  const { schema, is_active, name, pk } = data;
8
10
 
@@ -39,7 +41,7 @@ export default async function Page({ params }) {
39
41
  formProperties={{
40
42
  actionUrl: `/api/form/${pk}/`,
41
43
  className:
42
- 'w-[calc(100%-36px)] md:w-[570px] px-[18px] py-[60px] md:p-[100px] border border-[#cbc8c8] border-t-[3px] border-t-[#e95151] mx-auto -mt-[100px] bg-white mb-14',
44
+ 'w-[calc(100%-36px)] md:w-[570px] px-[18px] py-[60px] md:p-[100px] border border-[#cbc8c8] border-t-[3px] border-t-[#e95151] mx-auto -mt-[100px] bg-white mb-14'
43
45
  }}
44
46
  submitButtonText={t('form.form_page.submit_button_text')}
45
47
  />
@@ -5,11 +5,10 @@ import { withSegmentDefaults } from '@akinon/next/hocs/server';
5
5
  import { PageProps, Metadata } from '@akinon/next/types';
6
6
  import { generateJsonLd } from '@theme/utils/generate-jsonld';
7
7
 
8
- export async function generateMetadata({
9
- params,
10
- searchParams
11
- }: PageProps<{ pk: number }>) {
8
+ export async function generateMetadata(props: PageProps): Promise<Metadata> {
12
9
  let result: Metadata = {};
10
+ const searchParams = await props.searchParams;
11
+ const params = await props.params;
13
12
 
14
13
  try {
15
14
  const {
@@ -41,7 +40,10 @@ export async function generateMetadata({
41
40
  return result;
42
41
  }
43
42
 
44
- async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
43
+ async function Page(props: PageProps<{ pk: number }>) {
44
+ const params = await props.params;
45
+ const searchParams = await props.searchParams;
46
+
45
47
  const [{ data, breadcrumbData }, deliveryReturn] = await Promise.all([
46
48
  getProductData({
47
49
  pk: params.pk,
@@ -2,7 +2,9 @@ import { getLandingPageData } from '@akinon/next/data/server';
2
2
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { PageProps } from '@akinon/next/types';
4
4
 
5
- async function Page({ params }: PageProps<{ pk: number }>) {
5
+ async function Page(props: PageProps<{ pk: number }>) {
6
+ const params = await props.params;
7
+
6
8
  const data = await getLandingPageData({ pk: params.pk });
7
9
 
8
10
  const content = data.landing_page;
@@ -48,11 +48,13 @@ async function RootLayout({
48
48
  translations,
49
49
  children
50
50
  }: RootLayoutProps) {
51
+ const layoutParams = await params;
52
+
51
53
  return (
52
54
  <html lang={locale.isoCode} {...(locale.rtl ? { dir: 'rtl' } : {})}>
53
55
  <head />
54
56
  <body className="overflow-x-hidden">
55
- <PzRoot translations={translations} {...params}>
57
+ <PzRoot translations={translations} {...layoutParams}>
56
58
  <ClientRoot>
57
59
  <div className="overflow-x-hidden">
58
60
  <MobileAppToggler>
@@ -3,7 +3,9 @@ import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { PageProps } from '@akinon/next/types';
4
4
  import CategoryLayout from '@theme/views/category/layout';
5
5
 
6
- async function Page({ searchParams }: PageProps) {
6
+ async function Page(props: PageProps) {
7
+ const searchParams = await props.searchParams;
8
+
7
9
  const data = await getListData({ searchParams });
8
10
 
9
11
  return (
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { useEffect, useRef } from 'react';
3
+ import { useEffect, useRef, use } from 'react';
4
4
  import { useAppDispatch } from '@akinon/next/redux/hooks';
5
5
  import { setCurrentStep } from '@akinon/next/redux/reducers/checkout';
6
6
  import { ROUTES } from '@theme/routes';
@@ -14,14 +14,10 @@ import { Image } from '@akinon/next/components/image';
14
14
  import { Trans } from '@akinon/next/components/trans';
15
15
  import { pushPurchaseEvent } from '@theme/utils/gtm';
16
16
 
17
- const CheckoutCompleted = ({
18
- params
19
- }: PageProps<{
20
- token: string;
21
- }>) => {
17
+ const CheckoutCompleted = (props) => {
22
18
  const { t } = useLocalization();
23
19
  const dispatch = useAppDispatch();
24
-
20
+ const params = use(props.params) as { token: string };
25
21
  const { data, isLoading } = useFetchCheckoutResultQuery(String(params.token));
26
22
 
27
23
  const carouselRef = useRef(null);
@@ -5,12 +5,12 @@ import { generateJsonLd } from '@theme/utils/generate-jsonld';
5
5
  import { AccordionWrapper, ProductInfo } from '@theme/views/product';
6
6
  import ProductLayout from '@theme/views/product/layout';
7
7
 
8
- export async function generateMetadata({
9
- params,
10
- searchParams
11
- }: PageProps<{ pk: number }>) {
8
+ export async function generateMetadata(props: PageProps): Promise<Metadata> {
12
9
  let result: Metadata = {};
13
10
 
11
+ const params = await props.params;
12
+ const searchParams = await props.searchParams;
13
+
14
14
  try {
15
15
  const {
16
16
  data: { product }
@@ -40,7 +40,10 @@ export async function generateMetadata({
40
40
  return result;
41
41
  }
42
42
 
43
- async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
43
+ async function Page(props: PageProps<{ pk: number }>) {
44
+ const params = await props.params;
45
+ const searchParams = await props.searchParams;
46
+
44
47
  const [{ data, breadcrumbData }, deliveryReturn] = await Promise.all([
45
48
  getProductData({
46
49
  pk: params.pk,
@@ -5,7 +5,9 @@ import CategoryLayout from '@theme/views/category/layout';
5
5
  import SpecialPageBanner from '@theme/widgets/special-page-banner';
6
6
  import SpecialPageCarousel from '@theme/widgets/special-page-carousel';
7
7
 
8
- async function Page({ params, searchParams }: PageProps<{ pk: number }>) {
8
+ async function Page(props: PageProps<{ pk: number }>) {
9
+ const params = await props.params;
10
+ const searchParams = await props.searchParams;
9
11
  const data = await getSpecialPageData({ pk: params.pk, searchParams });
10
12
 
11
13
  return (
@@ -2,8 +2,11 @@
2
2
  import { Icon, Link, LoaderSpinner } from '@theme/components';
3
3
  import { useLocalization } from '@akinon/next/hooks';
4
4
  import { useChangeEmailVerificationQuery } from '@akinon/next/data/client/user';
5
+ import { use } from 'react';
6
+
7
+ export default function Page(props) {
8
+ const { id } = use(props.params) as { id: string[] };
5
9
 
6
- export default function Page({ params: { id } }) {
7
10
  const { t } = useLocalization();
8
11
  const { isSuccess, isLoading } = useChangeEmailVerificationQuery(
9
12
  id.join('/')
@@ -2,8 +2,10 @@
2
2
  import { Icon, Link, LoaderSpinner } from '@theme/components';
3
3
  import { useLocalization } from '@akinon/next/hooks';
4
4
  import { useConfirmEmailVerificationQuery } from '@akinon/next/data/client/user';
5
+ import { use } from 'react';
5
6
 
6
- export default function Page({ params: { id } }) {
7
+ export default function Page(props) {
8
+ const { id } = use(props.params) as { id: string[] };
7
9
  const { t } = useLocalization();
8
10
  const { isSuccess, isLoading } = useConfirmEmailVerificationQuery(
9
11
  id.join('/')
@@ -10,8 +10,10 @@ import {
10
10
  } from '@akinon/next/data/client/account';
11
11
  import { useLocalization } from '@akinon/next/hooks';
12
12
  import PasswordRulesFeedback from '@theme/components/password-rules-feedback';
13
+ import { use } from 'react';
13
14
 
14
- export default function NewPassword({ params: { id } }) {
15
+ export default function NewPassword(props) {
16
+ const { id } = use(props.params) as { id: string };
15
17
  const { t } = useLocalization();
16
18
  const [newPassword, { isSuccess: formSuccess }] = usePasswordResetMutation();
17
19
 
@@ -24,7 +26,10 @@ export default function NewPassword({ params: { id } }) {
24
26
  /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{6,}$/,
25
27
  t('forgot_password.create_new_password.form.error.password_rule')
26
28
  )
27
- .max(50, t('forgot_password.create_new_password.form.error.password_max')),
29
+ .max(
30
+ 50,
31
+ t('forgot_password.create_new_password.form.error.password_max')
32
+ ),
28
33
  repeatPassword: yup
29
34
  .string()
30
35
  .required(t('forgot_password.create_new_password.form.error.required'))
@@ -79,7 +84,10 @@ export default function NewPassword({ params: { id } }) {
79
84
  required
80
85
  />
81
86
 
82
- <PasswordRulesFeedback password={passwordValue} isVisible={errors?.password ? true : false}/>
87
+ <PasswordRulesFeedback
88
+ password={passwordValue}
89
+ isVisible={errors?.password ? true : false}
90
+ />
83
91
  </div>
84
92
 
85
93
  <div className="mb-2 text-left">
@@ -3,7 +3,7 @@ import { urlLocaleMatcherRegex } from '@akinon/next/utils';
3
3
  export const dynamic = 'force-dynamic';
4
4
 
5
5
  export async function GET(request: Request, context: { params }) {
6
- const node = context.params.node;
6
+ const node = (await context.params).node;
7
7
  const url = new URL(request.url);
8
8
  const matchedLocale = url.pathname.match(urlLocaleMatcherRegex);
9
9
 
@@ -2,7 +2,6 @@ import { Metadata } from '@akinon/next/types';
2
2
 
3
3
  const pwaTags: Metadata = {
4
4
  manifest: '/manifest.json',
5
- themeColor: '#FFFFFF',
6
5
  formatDetection: {
7
6
  telephone: false
8
7
  },
@@ -6,6 +6,7 @@ import {
6
6
  Action,
7
7
  AnyAction,
8
8
  configureStore,
9
+ Middleware,
9
10
  Store,
10
11
  ThunkAction,
11
12
  ThunkDispatch
@@ -13,20 +14,20 @@ import {
13
14
  import categoryReducer from '@theme/redux/reducers/category';
14
15
  import categoryMiddleware from '@theme/redux/middlewares/category';
15
16
 
17
+ const _middlewares: Middleware[] = [...middlewares, categoryMiddleware];
18
+
16
19
  const _reducers = {
17
20
  ...reducers,
18
21
  category: categoryReducer
19
22
  };
20
23
 
21
- const _middlewares = [...middlewares, categoryMiddleware];
22
-
23
24
  export const makeStore = (): Store<{
24
25
  [key in keyof typeof _reducers]: ReturnType<typeof _reducers[key]>;
25
26
  }> =>
26
27
  configureStore({
27
28
  reducer: _reducers,
28
29
  middleware: (getDefaultMiddleware) =>
29
- getDefaultMiddleware().concat([..._middlewares])
30
+ getDefaultMiddleware().concat(_middlewares)
30
31
  });
31
32
 
32
33
  export type AppStore = ReturnType<typeof makeStore>;
@@ -247,7 +247,7 @@ export const AddressForm = (props: Props) => {
247
247
  />
248
248
  <Input
249
249
  label={t('account.address_book.form.phone.placeholder')}
250
- format={config.user_phone_format.replaceAll(/\9/g, '#')}
250
+ format={config.user_phone_format.replaceAll(/9/g, '#')}
251
251
  mask="_"
252
252
  allowEmptyFormatting={true}
253
253
  control={control}
@@ -339,7 +339,7 @@ export const AddressForm = (props: Props) => {
339
339
  error={errors.postcode}
340
340
  data-testid="address-form-post-code"
341
341
  required
342
- format={config.user_post_code_format.replaceAll(/\9/g, '#')}
342
+ format={config.user_post_code_format.replaceAll(/9/g, '#')}
343
343
  control={control}
344
344
  mask="_"
345
345
  allowEmptyFormatting
@@ -192,7 +192,7 @@ const ContactForm = () => {
192
192
  label={t('account.contact.form.phone.placeholder')}
193
193
  type="tel"
194
194
  className="mb-1"
195
- format={user_phone_format.replace(/\9/g, '#')}
195
+ format={user_phone_format.replace(/9/g, '#')}
196
196
  mask="_"
197
197
  allowEmptyFormatting={true}
198
198
  control={control}
@@ -83,7 +83,7 @@ const GuestLogin = () => {
83
83
  className="h-14"
84
84
  name="phone_number"
85
85
  type="tel"
86
- format={user_phone_format.replace(/\9/g, '#')}
86
+ format={user_phone_format.replace(/9/g, '#')}
87
87
  mask="_"
88
88
  control={control}
89
89
  {...register('phone_number')}
@@ -157,7 +157,7 @@ export default function MiniBasket() {
157
157
  const [sortedBasket, setSortedBasket] = useState([]);
158
158
 
159
159
  const totalQuantity = useMemo(() => basket?.total_quantity ?? 0, [basket]);
160
- const miniBasketList = useRef();
160
+ const miniBasketList = useRef(null);
161
161
 
162
162
  useEffect(() => {
163
163
  if (highlightedItem > 0) {
@@ -108,7 +108,7 @@ export const OtpLogin = () => {
108
108
  className="h-14"
109
109
  label={t('auth.login.form.phone.placeholder')}
110
110
  type="tel"
111
- format={user_phone_format.replace(/\9/g, '#')}
111
+ format={user_phone_format.replace(/9/g, '#')}
112
112
  mask="_"
113
113
  allowEmptyFormatting={true}
114
114
  control={control}
@@ -303,7 +303,7 @@ export const Register = () => {
303
303
  labelStyle="floating"
304
304
  label={t('auth.register.form.phone.placeholder')}
305
305
  className="h-14"
306
- format={user_phone_format.replace(/\9/g, '#')}
306
+ format={user_phone_format.replace(/9/g, '#')}
307
307
  allowEmptyFormatting
308
308
  mask="_"
309
309
  control={control}
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.2",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {