@graphcommerce/magento-product 9.0.0-canary.101 → 9.0.0-canary.103
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 +83 -1254
- package/components/AddProductsToCart/AddProductsToCartButton.tsx +4 -5
- package/components/AddProductsToCart/AddProductsToCartError.tsx +2 -1
- package/components/AddProductsToCart/AddProductsToCartFab.tsx +5 -6
- package/components/AddProductsToCart/AddProductsToCartForm.tsx +15 -19
- package/components/AddProductsToCart/AddProductsToCartQuantity.tsx +5 -3
- package/components/AddProductsToCart/AddProductsToCartSnackbar.tsx +2 -1
- package/components/AddProductsToCart/AddProductsToCartSnackbarMessage.tsx +3 -4
- package/components/AddProductsToCart/findAddedItems.ts +2 -2
- package/components/AddProductsToCart/toUserErrors.ts +2 -2
- package/components/AddProductsToCart/useAddProductsToCartAction.ts +4 -3
- package/components/AddProductsToCart/useFormAddProductsToCart.ts +2 -2
- package/components/JsonLdProduct/ProductPageJsonLd.tsx +1 -1
- package/components/JsonLdProduct/jsonLdProduct.tsx +2 -2
- package/components/ProductAddToCart/ProductAddToCart.tsx +6 -3
- package/components/ProductCustomizable/CustomizableAreaOption.tsx +4 -3
- package/components/ProductCustomizable/CustomizableCheckboxOption.tsx +3 -7
- package/components/ProductCustomizable/CustomizableDateOption.tsx +2 -2
- package/components/ProductCustomizable/CustomizableDropDownOption.tsx +5 -5
- package/components/ProductCustomizable/CustomizableFieldOption.tsx +2 -2
- package/components/ProductCustomizable/CustomizableMultipleOption.tsx +3 -7
- package/components/ProductCustomizable/CustomizableRadioOption.tsx +3 -7
- package/components/ProductCustomizable/ProductCustomizable.tsx +5 -4
- package/components/ProductFiltersPro/PriceSlider.tsx +4 -2
- package/components/ProductFiltersPro/ProductFiltersPro.tsx +10 -19
- package/components/ProductFiltersPro/ProductFiltersProAggregations.tsx +2 -2
- package/components/ProductFiltersPro/ProductFiltersProAllFiltersChip.tsx +5 -6
- package/components/ProductFiltersPro/ProductFiltersProAllFiltersSidebar.tsx +7 -12
- package/components/ProductFiltersPro/ProductFiltersProCategorySection.tsx +6 -8
- package/components/ProductFiltersPro/ProductFiltersProChips.tsx +1 -1
- package/components/ProductFiltersPro/ProductFiltersProClearAll.tsx +2 -2
- package/components/ProductFiltersPro/ProductFiltersProLayoutSidebar.tsx +4 -2
- package/components/ProductFiltersPro/ProductFiltersProLimitChip.tsx +4 -2
- package/components/ProductFiltersPro/ProductFiltersProLimitSection.tsx +3 -2
- package/components/ProductFiltersPro/ProductFiltersProNoResults.tsx +3 -2
- package/components/ProductFiltersPro/ProductFiltersProSortChip.tsx +4 -2
- package/components/ProductFiltersPro/ProductFiltersProSortDirectionArrow.tsx +1 -1
- package/components/ProductFiltersPro/ProductFiltersProSortSection.tsx +3 -2
- package/components/ProductFiltersPro/activeAggregations.ts +2 -2
- package/components/ProductFiltersPro/applyAggregationCount.ts +2 -2
- package/components/ProductFiltersPro/useProductFiltersProClearAllAction.ts +1 -1
- package/components/ProductFiltersPro/useProductFiltersProSort.tsx +3 -3
- package/components/ProductListCount/ProductListCount.tsx +3 -2
- package/components/ProductListFilters/FilterCheckboxType.tsx +4 -3
- package/components/ProductListFilters/FilterEqualType.tsx +5 -4
- package/components/ProductListFilters/FilterRangeType.tsx +3 -2
- package/components/ProductListFilters/ProductListFilters.tsx +3 -3
- package/components/ProductListFiltersContainer/ProductListFiltersContainer.tsx +3 -2
- package/components/ProductListItem/ProductDiscountLabel.tsx +3 -2
- package/components/ProductListItem/ProductListItem.tsx +10 -15
- package/components/ProductListItem/ProductListItemImage.tsx +4 -2
- package/components/ProductListItem/ProductListItemImageContainer.tsx +7 -6
- package/components/ProductListItem/ProductListItemLinkOrDiv.tsx +2 -1
- package/components/ProductListItem/ProductListItemTitleAndPrice.tsx +4 -3
- package/components/ProductListItems/ProductListItemsBase.tsx +5 -4
- package/components/ProductListItems/ProductListParamsProvider.tsx +1 -1
- package/components/ProductListItems/filteredProductList.tsx +2 -2
- package/components/ProductListItems/getFilterTypes.ts +2 -1
- package/components/ProductListItems/productListApplyCategoryDefaults.ts +5 -4
- package/components/ProductListItems/renderer.tsx +2 -2
- package/components/ProductListLink/ProductListLink.tsx +5 -3
- package/components/ProductListPagination/ProductListPagination.tsx +5 -4
- package/components/ProductListPrice/ProductListPrice.tsx +3 -2
- package/components/ProductListSort/ProductListSort.tsx +7 -5
- package/components/ProductListSuggestions/ProductListSuggestions.tsx +1 -1
- package/components/ProductPage/ProductPageAddToCartRow.tsx +3 -2
- package/components/ProductPageBreadcrumb/ProductPageBreadcrumb.tsx +3 -2
- package/components/ProductPageBreadcrumb/ProductPageBreadcrumbs.tsx +3 -3
- package/components/ProductPageCategory/productPageCategory.ts +1 -1
- package/components/ProductPageDescription/ProductPageDescription.tsx +5 -4
- package/components/ProductPageGallery/ProductImage.tsx +1 -1
- package/components/ProductPageGallery/ProductPageGallery.tsx +3 -7
- package/components/ProductPageGallery/ProductVideo.tsx +1 -1
- package/components/ProductPageMeta/ProductPageMeta.tsx +2 -2
- package/components/ProductPageName/ProductPageName.tsx +2 -2
- package/components/ProductPagePrice/ProductPagePrice.tsx +5 -6
- package/components/ProductPagePrice/ProductPagePriceTiers.tsx +2 -2
- package/components/ProductPagePrice/getProductTierPrice.ts +2 -2
- package/components/ProductPagePrice/useCustomizableOptionPrice.ts +6 -5
- package/components/ProductScroller/ProductScroller.tsx +6 -13
- package/components/ProductShortDescription/ProductShortDescription.tsx +3 -2
- package/components/ProductSidebarDelivery/ProductSidebarDelivery.tsx +2 -2
- package/components/ProductSpecs/ProductSpecs.tsx +4 -3
- package/components/ProductSpecs/ProductSpecsAggregations.tsx +2 -2
- package/components/ProductSpecs/ProductSpecsCustomAttributes.tsx +2 -2
- package/components/ProductStaticPaths/getProductStaticPaths.ts +4 -3
- package/components/ProductStaticPaths/getSitemapPaths.ts +2 -2
- package/components/ProductWeight/ProductWeight.tsx +3 -2
- package/context/productListParamsContext.ts +1 -1
- package/hooks/useProductLink.ts +1 -1
- package/hooks/useProductList.ts +10 -13
- package/hooks/useProductListLink.ts +7 -5
- package/hooks/useProductListLinkReplace.ts +1 -1
- package/package.json +14 -14
- package/test/productURL.fixture.ts +1 -1
- package/tsconfig.json +1 -1
@@ -1,10 +1,9 @@
|
|
1
1
|
import { useCartEnabled } from '@graphcommerce/magento-cart'
|
2
|
-
import {
|
2
|
+
import type { ButtonProps } from '@graphcommerce/next-ui'
|
3
|
+
import { Button } from '@graphcommerce/next-ui'
|
3
4
|
import { Trans } from '@lingui/macro'
|
4
|
-
import {
|
5
|
-
|
6
|
-
UseAddProductsToCartActionProps,
|
7
|
-
} from './useAddProductsToCartAction'
|
5
|
+
import type { UseAddProductsToCartActionProps } from './useAddProductsToCartAction'
|
6
|
+
import { useAddProductsToCartAction } from './useAddProductsToCartAction'
|
8
7
|
|
9
8
|
export type AddProductsToCartButtonProps = UseAddProductsToCartActionProps &
|
10
9
|
Pick<
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { useFormState } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { FormHelperText } from '@mui/material'
|
3
|
-
import { AddToCartItemSelector
|
3
|
+
import type { AddToCartItemSelector } from './useFormAddProductsToCart'
|
4
|
+
import { useFormAddProductsToCart } from './useFormAddProductsToCart'
|
4
5
|
|
5
6
|
type AddProductsToCartErrorProps = {
|
6
7
|
children?: React.ReactNode
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { useCartEnabled } from '@graphcommerce/magento-cart'
|
2
|
-
import {
|
2
|
+
import type { FabProps } from '@graphcommerce/next-ui'
|
3
|
+
import { Fab, iconShoppingBag, iconCheckmark } from '@graphcommerce/next-ui'
|
3
4
|
import { t } from '@lingui/macro'
|
4
|
-
import { SxProps, Theme } from '@mui/material'
|
5
|
-
import {
|
6
|
-
|
7
|
-
UseAddProductsToCartActionProps,
|
8
|
-
} from './useAddProductsToCartAction'
|
5
|
+
import type { SxProps, Theme } from '@mui/material'
|
6
|
+
import type { UseAddProductsToCartActionProps } from './useAddProductsToCartAction'
|
7
|
+
import { useAddProductsToCartAction } from './useAddProductsToCartAction'
|
9
8
|
|
10
9
|
export type AddProductsToCartFabProps = {
|
11
10
|
sx?: SxProps<Theme>
|
@@ -1,25 +1,21 @@
|
|
1
|
-
import { UseFormGraphQlOptions } from '@graphcommerce/ecommerce-ui'
|
2
|
-
import { ApolloQueryResult
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
} from '@graphcommerce/
|
8
|
-
import {
|
9
|
-
import { Box
|
1
|
+
import type { UseFormGraphQlOptions } from '@graphcommerce/ecommerce-ui'
|
2
|
+
import type { ApolloQueryResult } from '@graphcommerce/graphql'
|
3
|
+
import { useApolloClient } from '@graphcommerce/graphql'
|
4
|
+
import type { CrosssellsQuery } from '@graphcommerce/magento-cart'
|
5
|
+
import { useFormGqlMutationCart, CrosssellsDocument } from '@graphcommerce/magento-cart'
|
6
|
+
import type { ErrorSnackbarProps, MessageSnackbarProps } from '@graphcommerce/next-ui'
|
7
|
+
import { nonNullable } from '@graphcommerce/next-ui'
|
8
|
+
import type { SxProps, Theme } from '@mui/material'
|
9
|
+
import { Box } from '@mui/material'
|
10
10
|
import { useRouter } from 'next/router'
|
11
11
|
import { useMemo, useRef } from 'react'
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
|
15
|
-
|
16
|
-
} from './AddProductsToCartSnackbar'
|
12
|
+
import type { AddProductsToCartMutation } from './AddProductsToCart.gql'
|
13
|
+
import { AddProductsToCartDocument } from './AddProductsToCart.gql'
|
14
|
+
import type { AddProductsToCartSnackbarProps } from './AddProductsToCartSnackbar'
|
15
|
+
import { AddProductsToCartSnackbar } from './AddProductsToCartSnackbar'
|
17
16
|
import { toUserErrors } from './toUserErrors'
|
18
|
-
import {
|
19
|
-
|
20
|
-
AddProductsToCartFields,
|
21
|
-
RedirectType,
|
22
|
-
} from './useFormAddProductsToCart'
|
17
|
+
import type { AddProductsToCartFields, RedirectType } from './useFormAddProductsToCart'
|
18
|
+
import { AddProductsToCartContext } from './useFormAddProductsToCart'
|
23
19
|
|
24
20
|
export type AddProductsToCartFormProps = {
|
25
21
|
children: React.ReactNode
|
@@ -1,7 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import type { NumberFieldElementProps } from '@graphcommerce/ecommerce-ui'
|
2
|
+
import { NumberFieldElement } from '@graphcommerce/ecommerce-ui'
|
2
3
|
import { i18n } from '@lingui/core'
|
3
|
-
import { AddProductsToCartMutationVariables } from './AddProductsToCart.gql'
|
4
|
-
import { AddToCartItemSelector
|
4
|
+
import type { AddProductsToCartMutationVariables } from './AddProductsToCart.gql'
|
5
|
+
import type { AddToCartItemSelector } from './useFormAddProductsToCart'
|
6
|
+
import { useFormAddProductsToCart } from './useFormAddProductsToCart'
|
5
7
|
|
6
8
|
type AddToCartQuantityProps = Omit<
|
7
9
|
NumberFieldElementProps<AddProductsToCartMutationVariables>,
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { useFormState } from '@graphcommerce/ecommerce-ui'
|
2
|
-
import { ErrorSnackbarProps, MessageSnackbarProps
|
2
|
+
import type { ErrorSnackbarProps, MessageSnackbarProps } from '@graphcommerce/next-ui'
|
3
|
+
import { nonNullable } from '@graphcommerce/next-ui'
|
3
4
|
import { useMemo } from 'react'
|
4
5
|
import { AddProductsToCartSnackbarMessage } from './AddProductsToCartSnackbarMessage'
|
5
6
|
import { findAddedItems } from './findAddedItems'
|
@@ -1,14 +1,13 @@
|
|
1
|
-
import { ApolloError } from '@graphcommerce/graphql'
|
2
|
-
import { CartUserInputError } from '@graphcommerce/graphql-mesh'
|
1
|
+
import type { ApolloError } from '@graphcommerce/graphql'
|
2
|
+
import type { CartUserInputError } from '@graphcommerce/graphql-mesh'
|
3
3
|
import { ApolloCartErrorSnackbar } from '@graphcommerce/magento-cart'
|
4
|
+
import type { ErrorSnackbarProps, MessageSnackbarProps } from '@graphcommerce/next-ui'
|
4
5
|
import {
|
5
6
|
Button,
|
6
7
|
ErrorSnackbar,
|
7
|
-
ErrorSnackbarProps,
|
8
8
|
IconSvg,
|
9
9
|
ListFormat,
|
10
10
|
MessageSnackbar,
|
11
|
-
MessageSnackbarProps,
|
12
11
|
iconChevronRight,
|
13
12
|
} from '@graphcommerce/next-ui'
|
14
13
|
import { Plural, Trans } from '@lingui/macro'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { filterNonNullableKeys, isTypename } from '@graphcommerce/next-ui'
|
2
|
-
import { AddProductsToCartMutation } from './AddProductsToCart.gql'
|
3
|
-
import { AddProductsToCartFields } from './useFormAddProductsToCart'
|
2
|
+
import type { AddProductsToCartMutation } from './AddProductsToCart.gql'
|
3
|
+
import type { AddProductsToCartFields } from './useFormAddProductsToCart'
|
4
4
|
|
5
5
|
export function findAddedItems(
|
6
6
|
data: AddProductsToCartMutation | null | undefined,
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { CartUserInputError } from '@graphcommerce/graphql-mesh'
|
1
|
+
import type { CartUserInputError } from '@graphcommerce/graphql-mesh'
|
2
2
|
import { filterNonNullableKeys } from '@graphcommerce/next-ui'
|
3
|
-
import { AddProductsToCartMutation } from './AddProductsToCart.gql'
|
3
|
+
import type { AddProductsToCartMutation } from './AddProductsToCart.gql'
|
4
4
|
|
5
5
|
export function toUserErrors(data?: AddProductsToCartMutation | null): CartUserInputError[] {
|
6
6
|
const cartItemErrors = filterNonNullableKeys(data?.addProductsToCart?.cart.items)
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { useFormState } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { useEventCallback } from '@mui/material'
|
3
3
|
import { startTransition, useEffect, useState } from 'react'
|
4
|
-
import { UseAddProductsToCartActionFragment } from './UseAddProductsToCartAction.gql'
|
4
|
+
import type { UseAddProductsToCartActionFragment } from './UseAddProductsToCartAction.gql'
|
5
5
|
import { toUserErrors } from './toUserErrors'
|
6
|
-
import { AddToCartItemSelector
|
6
|
+
import type { AddToCartItemSelector } from './useFormAddProductsToCart'
|
7
|
+
import { useFormAddProductsToCart } from './useFormAddProductsToCart'
|
7
8
|
|
8
9
|
export type UseAddProductsToCartActionProps = AddToCartItemSelector & {
|
9
10
|
disabled?: boolean
|
@@ -66,7 +67,7 @@ export function useAddProductsToCartAction(
|
|
66
67
|
e.stopPropagation()
|
67
68
|
if (formState.isSubmitting) return
|
68
69
|
if (process.env.NODE_ENV !== 'production') {
|
69
|
-
if (!sku) console.warn(
|
70
|
+
if (!sku) console.warn("You must provide a 'sku' to useAddProductsToCartAction")
|
70
71
|
}
|
71
72
|
// TODO should be removed, setting the form value on submission isn't a great idea.
|
72
73
|
if (!getValues(`cartItems.${index}.sku`)) setValue(`cartItems.${index}.sku`, sku ?? '')
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { UseFormGqlMutationReturn } from '@graphcommerce/ecommerce-ui'
|
1
|
+
import type { UseFormGqlMutationReturn } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { createContext, useContext } from 'react'
|
3
3
|
import type { Simplify, LiteralUnion } from 'type-fest'
|
4
|
-
import {
|
4
|
+
import type {
|
5
5
|
AddProductsToCartMutation,
|
6
6
|
AddProductsToCartMutationVariables,
|
7
7
|
} from './AddProductsToCart.gql'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { ProductImage } from '@graphcommerce/graphql-mesh'
|
2
2
|
import type { Product } from 'schema-dts'
|
3
|
-
import { JsonLdProductFragment } from './JsonLdProduct.gql'
|
4
|
-
import { JsonLdProductOfferFragment } from './JsonLdProductOffer.gql'
|
3
|
+
import type { JsonLdProductFragment } from './JsonLdProduct.gql'
|
4
|
+
import type { JsonLdProductOfferFragment } from './JsonLdProductOffer.gql'
|
5
5
|
|
6
6
|
export function jsonLdProduct(props: JsonLdProductFragment): Product {
|
7
7
|
const { name, sku, media_gallery, categories, description } = props
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { NumberFieldElement } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import type { ProductInterface } from '@graphcommerce/graphql-mesh'
|
3
3
|
import { ApolloCartErrorAlert, useFormGqlMutationCart } from '@graphcommerce/magento-cart'
|
4
|
-
import {
|
4
|
+
import type { MoneyProps } from '@graphcommerce/magento-store'
|
5
|
+
import { Money } from '@graphcommerce/magento-store'
|
5
6
|
import {
|
6
7
|
Button,
|
7
8
|
MessageSnackbar,
|
@@ -10,9 +11,11 @@ import {
|
|
10
11
|
extendableComponent,
|
11
12
|
} from '@graphcommerce/next-ui'
|
12
13
|
import { Trans } from '@lingui/macro'
|
13
|
-
import {
|
14
|
+
import type { ButtonProps } from '@mui/material'
|
15
|
+
import { Divider, Typography, Box, Alert } from '@mui/material'
|
14
16
|
import React from 'react'
|
15
|
-
import {
|
17
|
+
import type { ProductAddToCartMutationVariables } from './ProductAddToCart.gql'
|
18
|
+
import { ProductAddToCartDocument } from './ProductAddToCart.gql'
|
16
19
|
|
17
20
|
const { classes, selectors } = extendableComponent('ProductAddToCart', [
|
18
21
|
'root',
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { TextFieldElement } from '@graphcommerce/ecommerce-ui'
|
2
|
-
import { CurrencyEnum } from '@graphcommerce/graphql-mesh'
|
2
|
+
import type { CurrencyEnum } from '@graphcommerce/graphql-mesh'
|
3
3
|
import { Money } from '@graphcommerce/magento-store'
|
4
|
-
import {
|
4
|
+
import type { TypeRenderer } from '@graphcommerce/next-ui'
|
5
|
+
import { SectionHeader } from '@graphcommerce/next-ui'
|
5
6
|
import { i18n } from '@lingui/core'
|
6
7
|
import { Box } from '@mui/material'
|
7
8
|
import React from 'react'
|
8
9
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
9
|
-
import { ProductCustomizableFragment } from './ProductCustomizable.gql'
|
10
|
+
import type { ProductCustomizableFragment } from './ProductCustomizable.gql'
|
10
11
|
|
11
12
|
export type OptionTypeRenderer = TypeRenderer<
|
12
13
|
NonNullable<NonNullable<ProductCustomizableFragment['options']>[number]> & {
|
@@ -1,15 +1,11 @@
|
|
1
1
|
import { ActionCardListForm } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { Money } from '@graphcommerce/magento-store'
|
3
|
-
import {
|
4
|
-
|
5
|
-
ActionCardProps,
|
6
|
-
filterNonNullableKeys,
|
7
|
-
SectionHeader,
|
8
|
-
} from '@graphcommerce/next-ui'
|
3
|
+
import type { ActionCardProps } from '@graphcommerce/next-ui'
|
4
|
+
import { ActionCard, filterNonNullableKeys, SectionHeader } from '@graphcommerce/next-ui'
|
9
5
|
import { i18n } from '@lingui/core'
|
10
6
|
import { Box, Checkbox } from '@mui/material'
|
11
7
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
12
|
-
import { OptionTypeRenderer } from './CustomizableAreaOption'
|
8
|
+
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
13
9
|
|
14
10
|
type CustomizableCheckboxOptionProps = React.ComponentProps<
|
15
11
|
OptionTypeRenderer['CustomizableCheckboxOption']
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { TextFieldElement } from '@graphcommerce/ecommerce-ui'
|
2
|
+
import { Money } from '@graphcommerce/magento-store'
|
2
3
|
import { SectionHeader } from '@graphcommerce/next-ui'
|
3
4
|
import { Trans } from '@lingui/react'
|
4
5
|
import { Box } from '@mui/material'
|
5
6
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
6
|
-
import { OptionTypeRenderer } from './CustomizableAreaOption'
|
7
|
-
import { Money } from '@graphcommerce/magento-store'
|
7
|
+
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
8
8
|
|
9
9
|
type CustomizableDateOptionProps = React.ComponentProps<
|
10
10
|
OptionTypeRenderer['CustomizableDateOption']
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { useController } from '@graphcommerce/ecommerce-ui'
|
2
|
+
import { Money } from '@graphcommerce/magento-store'
|
2
3
|
import { SectionHeader, filterNonNullableKeys } from '@graphcommerce/next-ui'
|
3
|
-
import { Box,
|
4
|
+
import { Box, MenuItem, TextField } from '@mui/material'
|
4
5
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
5
|
-
import { OptionTypeRenderer } from './CustomizableAreaOption'
|
6
|
-
import { Money } from '@graphcommerce/magento-store'
|
6
|
+
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
7
7
|
|
8
8
|
type CustomizableDropDownOptionProps = React.ComponentProps<
|
9
9
|
OptionTypeRenderer['CustomizableDropDownOption']
|
@@ -11,7 +11,7 @@ type CustomizableDropDownOptionProps = React.ComponentProps<
|
|
11
11
|
|
12
12
|
export function CustomizableDropDownOption(props: CustomizableDropDownOptionProps) {
|
13
13
|
const { uid, required, index, title, dropdownValue, productPrice, currency } = props
|
14
|
-
const { control
|
14
|
+
const { control } = useFormAddProductsToCart()
|
15
15
|
|
16
16
|
const {
|
17
17
|
field: { onChange, value, ref, ...field },
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { Money } from '@graphcommerce/magento-store'
|
2
1
|
import { TextFieldElement } from '@graphcommerce/ecommerce-ui'
|
2
|
+
import { Money } from '@graphcommerce/magento-store'
|
3
3
|
import { SectionHeader } from '@graphcommerce/next-ui'
|
4
4
|
import { i18n } from '@lingui/core'
|
5
5
|
import { Box } from '@mui/material'
|
6
6
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
7
|
-
import { OptionTypeRenderer } from './CustomizableAreaOption'
|
7
|
+
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
8
8
|
|
9
9
|
type CustomizableFieldOptionProps = React.ComponentProps<
|
10
10
|
OptionTypeRenderer['CustomizableFieldOption']
|
@@ -1,15 +1,11 @@
|
|
1
1
|
import { ActionCardListForm } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { Money } from '@graphcommerce/magento-store'
|
3
|
-
import {
|
4
|
-
|
5
|
-
ActionCardProps,
|
6
|
-
filterNonNullableKeys,
|
7
|
-
SectionHeader,
|
8
|
-
} from '@graphcommerce/next-ui'
|
3
|
+
import type { ActionCardProps } from '@graphcommerce/next-ui'
|
4
|
+
import { ActionCard, filterNonNullableKeys, SectionHeader } from '@graphcommerce/next-ui'
|
9
5
|
import { i18n } from '@lingui/core'
|
10
6
|
import { Box } from '@mui/material'
|
11
7
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
12
|
-
import { OptionTypeRenderer } from './CustomizableAreaOption'
|
8
|
+
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
13
9
|
|
14
10
|
type CustomizableMultipleOptionProps = React.ComponentProps<
|
15
11
|
OptionTypeRenderer['CustomizableMultipleOption']
|
@@ -1,15 +1,11 @@
|
|
1
1
|
import { ActionCardListForm } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { Money } from '@graphcommerce/magento-store'
|
3
|
-
import {
|
4
|
-
|
5
|
-
ActionCardProps,
|
6
|
-
filterNonNullableKeys,
|
7
|
-
SectionHeader,
|
8
|
-
} from '@graphcommerce/next-ui'
|
3
|
+
import type { ActionCardProps } from '@graphcommerce/next-ui'
|
4
|
+
import { ActionCard, filterNonNullableKeys, SectionHeader } from '@graphcommerce/next-ui'
|
9
5
|
import { i18n } from '@lingui/core'
|
10
6
|
import { Box } from '@mui/material'
|
11
7
|
import { useFormAddProductsToCart } from '../AddProductsToCart'
|
12
|
-
import { OptionTypeRenderer } from './CustomizableAreaOption'
|
8
|
+
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
13
9
|
|
14
10
|
type CustomizableRadioOptionProps = React.ComponentProps<
|
15
11
|
OptionTypeRenderer['CustomizableRadioOption']
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import { filterNonNullableKeys, RenderType } from '@graphcommerce/next-ui'
|
2
|
-
import { AddToCartItemSelector } from '../AddProductsToCart'
|
3
|
-
import { ProductPagePriceFragment } from '../ProductPagePrice'
|
4
|
-
import {
|
2
|
+
import type { AddToCartItemSelector } from '../AddProductsToCart'
|
3
|
+
import type { ProductPagePriceFragment } from '../ProductPagePrice'
|
4
|
+
import type { OptionTypeRenderer } from './CustomizableAreaOption'
|
5
|
+
import { CustomizableAreaOption } from './CustomizableAreaOption'
|
5
6
|
import { CustomizableCheckboxOption } from './CustomizableCheckboxOption'
|
6
7
|
import { CustomizableDateOption } from './CustomizableDateOption'
|
7
8
|
import { CustomizableDropDownOption } from './CustomizableDropDownOption'
|
8
9
|
import { CustomizableFieldOption } from './CustomizableFieldOption'
|
9
10
|
import { CustomizableMultipleOption } from './CustomizableMultipleOption'
|
10
11
|
import { CustomizableRadioOption } from './CustomizableRadioOption'
|
11
|
-
import { ProductCustomizableFragment } from './ProductCustomizable.gql'
|
12
|
+
import type { ProductCustomizableFragment } from './ProductCustomizable.gql'
|
12
13
|
|
13
14
|
const defaultRenderer = {
|
14
15
|
CustomizableAreaOption,
|
@@ -1,12 +1,14 @@
|
|
1
|
-
import { FilterRangeTypeInput } from '@graphcommerce/graphql-mesh'
|
1
|
+
import type { FilterRangeTypeInput } from '@graphcommerce/graphql-mesh'
|
2
2
|
import { Money } from '@graphcommerce/magento-store'
|
3
3
|
import { extendableComponent, filterNonNullableKeys } from '@graphcommerce/next-ui'
|
4
|
-
import {
|
4
|
+
import type { SxProps, Theme } from '@mui/material'
|
5
|
+
import { Box, Slider, useEventCallback } from '@mui/material'
|
5
6
|
import { useCallback } from 'react'
|
6
7
|
import type { FilterProps } from './ProductFiltersProAggregations'
|
7
8
|
|
8
9
|
export type PriceSliderProps = {
|
9
10
|
value: FilterRangeTypeInput | null | undefined
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
10
12
|
onChange: (...event: any[]) => void
|
11
13
|
sx?: SxProps<Theme>
|
12
14
|
options: FilterProps['aggregation']['options']
|
@@ -1,32 +1,23 @@
|
|
1
|
-
import {
|
1
|
+
import type {
|
2
2
|
DeepPartial,
|
3
|
-
FormAutoSubmit,
|
4
|
-
useForm,
|
5
3
|
UseFormProps,
|
6
4
|
UseFormReturn,
|
7
5
|
WatchObserver,
|
8
6
|
} from '@graphcommerce/ecommerce-ui'
|
7
|
+
import { FormAutoSubmit, useForm } from '@graphcommerce/ecommerce-ui'
|
9
8
|
import { useMatchMediaMotionValue, useMemoObject } from '@graphcommerce/next-ui'
|
10
|
-
import { Theme
|
9
|
+
import type { Theme } from '@mui/material'
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
11
|
+
import { useEventCallback, useMediaQuery, useTheme } from '@mui/material'
|
11
12
|
import { m, useTransform } from 'framer-motion'
|
12
13
|
import { useRouter } from 'next/router'
|
13
|
-
import
|
14
|
-
|
15
|
-
createContext,
|
16
|
-
MutableRefObject,
|
17
|
-
useContext,
|
18
|
-
useEffect,
|
19
|
-
useMemo,
|
20
|
-
useRef,
|
21
|
-
} from 'react'
|
14
|
+
import type { BaseSyntheticEvent, MutableRefObject } from 'react'
|
15
|
+
import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react'
|
22
16
|
import type { Subscription } from 'react-hook-form/dist/utils/createSubject'
|
23
17
|
import { productListLinkFromFilter } from '../../hooks/useProductListLink'
|
24
|
-
import { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql'
|
25
|
-
import {
|
26
|
-
|
27
|
-
ProductListParams,
|
28
|
-
toFilterParams,
|
29
|
-
} from '../ProductListItems/filterTypes'
|
18
|
+
import type { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql'
|
19
|
+
import type { ProductFilterParams, ProductListParams } from '../ProductListItems/filterTypes'
|
20
|
+
import { toFilterParams } from '../ProductListItems/filterTypes'
|
30
21
|
|
31
22
|
type DataProps = {
|
32
23
|
filterTypes: Record<string, string | undefined>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { AttributeFrontendInputEnum } from '@graphcommerce/graphql-mesh'
|
2
|
-
import { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql'
|
1
|
+
import type { AttributeFrontendInputEnum } from '@graphcommerce/graphql-mesh'
|
2
|
+
import type { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql'
|
3
3
|
import { ProductFilterEqualChip } from './ProductFilterEqualChip'
|
4
4
|
import { ProductFilterEqualSection } from './ProductFilterEqualSection'
|
5
5
|
import { ProductFilterRangeChip } from './ProductFilterRangeChip'
|
@@ -1,16 +1,15 @@
|
|
1
|
-
import {
|
1
|
+
import type { ChipOverlayOrPopperProps } from '@graphcommerce/next-ui'
|
2
|
+
import { ChipOverlayOrPopper } from '@graphcommerce/next-ui'
|
2
3
|
import { Trans } from '@lingui/react'
|
3
4
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
5
|
+
import type { ProductFiltersProAggregationsProps } from './ProductFiltersProAggregations'
|
4
6
|
import {
|
5
7
|
ProductFiltersProAggregations,
|
6
|
-
ProductFiltersProAggregationsProps,
|
7
8
|
productFiltersProSectionRenderer,
|
8
9
|
} from './ProductFiltersProAggregations'
|
9
10
|
import { ProductFiltersProLimitSection } from './ProductFiltersProLimitSection'
|
10
|
-
import {
|
11
|
-
|
12
|
-
ProductFiltersProSortSectionProps,
|
13
|
-
} from './ProductFiltersProSortSection'
|
11
|
+
import type { ProductFiltersProSortSectionProps } from './ProductFiltersProSortSection'
|
12
|
+
import { ProductFiltersProSortSection } from './ProductFiltersProSortSection'
|
14
13
|
import { activeAggregations } from './activeAggregations'
|
15
14
|
import { applyAggregationCount } from './applyAggregationCount'
|
16
15
|
import { useProductFiltersProClearAllAction } from './useProductFiltersProClearAllAction'
|
@@ -1,20 +1,15 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
1
|
+
import type { SxProps, Theme } from '@mui/material'
|
2
|
+
import { Box } from '@mui/material'
|
3
|
+
import type { ProductFiltersProAggregationsProps } from './ProductFiltersProAggregations'
|
4
4
|
import {
|
5
5
|
ProductFiltersProAggregations,
|
6
|
-
ProductFiltersProAggregationsProps,
|
7
6
|
productFiltersProSectionRenderer,
|
8
7
|
} from './ProductFiltersProAggregations'
|
9
|
-
import {
|
10
|
-
|
11
|
-
ProductFiltersProCategorySection,
|
12
|
-
} from './ProductFiltersProCategorySection'
|
8
|
+
import type { ProductFiltersCategorySectionProps } from './ProductFiltersProCategorySection'
|
9
|
+
import { ProductFiltersProCategorySection } from './ProductFiltersProCategorySection'
|
13
10
|
import { ProductFiltersProLimitSection } from './ProductFiltersProLimitSection'
|
14
|
-
import {
|
15
|
-
|
16
|
-
ProductFiltersProSortSectionProps,
|
17
|
-
} from './ProductFiltersProSortSection'
|
11
|
+
import type { ProductFiltersProSortSectionProps } from './ProductFiltersProSortSection'
|
12
|
+
import { ProductFiltersProSortSection } from './ProductFiltersProSortSection'
|
18
13
|
|
19
14
|
export type ProductFiltersProAllFiltersSidebarProps = ProductFiltersProAggregationsProps &
|
20
15
|
ProductFiltersProSortSectionProps &
|
@@ -1,13 +1,10 @@
|
|
1
1
|
import { useWatch } from '@graphcommerce/ecommerce-ui'
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
useCategoryTree,
|
6
|
-
} from '@graphcommerce/magento-category'
|
2
|
+
import type { CategoryTreeItem, UseCategoryTreeProps } from '@graphcommerce/magento-category'
|
3
|
+
import { useCategoryTree } from '@graphcommerce/magento-category'
|
4
|
+
import type { ActionCardAccordionProps } from '@graphcommerce/next-ui'
|
7
5
|
import {
|
8
6
|
ActionCard,
|
9
7
|
ActionCardAccordion,
|
10
|
-
ActionCardAccordionProps,
|
11
8
|
ActionCardList,
|
12
9
|
Button,
|
13
10
|
IconSvg,
|
@@ -15,7 +12,8 @@ import {
|
|
15
12
|
responsiveVal,
|
16
13
|
} from '@graphcommerce/next-ui'
|
17
14
|
import { Trans } from '@lingui/react'
|
18
|
-
import {
|
15
|
+
import type { SxProps, Theme } from '@mui/material'
|
16
|
+
import { Box } from '@mui/material'
|
19
17
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
20
18
|
|
21
19
|
export type ProductFiltersProCategoryAccordionProps = {
|
@@ -29,7 +27,7 @@ export function ProductFiltersProCategoryAccordion(props: ProductFiltersProCateg
|
|
29
27
|
const { hideTitle, sx, categoryTree, onChange, defaultExpanded } = props
|
30
28
|
const { form } = useProductFiltersPro()
|
31
29
|
|
32
|
-
const name =
|
30
|
+
const name = 'filters.category_uid.in'
|
33
31
|
const currentFilter = useWatch({ control: form.control, name })
|
34
32
|
|
35
33
|
return (
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Button } from '@graphcommerce/next-ui'
|
2
2
|
import { Trans } from '@lingui/react'
|
3
|
-
import { SxProps, Theme } from '@mui/material'
|
4
|
-
import { ProductFiltersProAggregationsProps } from './ProductFiltersProAggregations'
|
3
|
+
import type { SxProps, Theme } from '@mui/material'
|
4
|
+
import type { ProductFiltersProAggregationsProps } from './ProductFiltersProAggregations'
|
5
5
|
import { useProductFiltersProClearAllAction } from './useProductFiltersProClearAllAction'
|
6
6
|
import { useProductFilterProHasFiltersApplied } from './useProductFiltersProHasFiltersApplied'
|
7
7
|
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { FormAutoSubmit } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { extendableComponent, StickyBelowHeader } from '@graphcommerce/next-ui'
|
3
|
-
import {
|
3
|
+
import type { Theme } from '@mui/material'
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
5
|
+
import { Box, Container, useMediaQuery } from '@mui/material'
|
4
6
|
import React from 'react'
|
5
7
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
6
8
|
|
@@ -19,7 +21,7 @@ type OwnerProps = {
|
|
19
21
|
headerPosition: 'before'
|
20
22
|
}
|
21
23
|
|
22
|
-
const name = 'ProductFiltersProLayoutSidebar'
|
24
|
+
const name = 'ProductFiltersProLayoutSidebar'
|
23
25
|
const parts = ['root', 'content'] as const
|
24
26
|
const { withState } = extendableComponent<OwnerProps, typeof name, typeof parts>(name, parts)
|
25
27
|
|
@@ -1,7 +1,9 @@
|
|
1
|
-
import { ActionCardItemBase
|
1
|
+
import type { ActionCardItemBase } from '@graphcommerce/ecommerce-ui'
|
2
|
+
import { ActionCardListForm, useWatch } from '@graphcommerce/ecommerce-ui'
|
2
3
|
import { useQuery } from '@graphcommerce/graphql'
|
3
4
|
import { StoreConfigDocument } from '@graphcommerce/magento-store'
|
4
|
-
import {
|
5
|
+
import type { ChipOverlayOrPopperProps } from '@graphcommerce/next-ui'
|
6
|
+
import { ActionCard, ChipOverlayOrPopper } from '@graphcommerce/next-ui'
|
5
7
|
import { Trans } from '@lingui/react'
|
6
8
|
import { useMemo } from 'react'
|
7
9
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { ActionCardItemBase
|
1
|
+
import type { ActionCardItemBase } from '@graphcommerce/ecommerce-ui'
|
2
|
+
import { ActionCardListForm, useWatch } from '@graphcommerce/ecommerce-ui'
|
2
3
|
import { useQuery } from '@graphcommerce/graphql'
|
3
4
|
import { StoreConfigDocument } from '@graphcommerce/magento-store'
|
4
5
|
import { ActionCard, ActionCardAccordion, Button } from '@graphcommerce/next-ui'
|
5
6
|
import { Trans } from '@lingui/react'
|
6
|
-
import { SxProps, Theme } from '@mui/material'
|
7
|
+
import type { SxProps, Theme } from '@mui/material'
|
7
8
|
import { useMemo } from 'react'
|
8
9
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
9
10
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { extendableComponent } from '@graphcommerce/next-ui'
|
2
2
|
import { Trans } from '@lingui/macro'
|
3
|
-
import {
|
3
|
+
import type { SxProps, Theme } from '@mui/material'
|
4
|
+
import { Box, Link, Typography } from '@mui/material'
|
4
5
|
import { useProductFiltersProClearAllAction } from './useProductFiltersProClearAllAction'
|
5
6
|
import { useProductFilterProHasFiltersApplied } from './useProductFiltersProHasFiltersApplied'
|
6
7
|
|
7
8
|
export type ProductFitlersProNoResultProps = { search?: string | null; sx?: SxProps<Theme> }
|
8
9
|
|
9
|
-
const name = 'ProductFiltersProNoResults'
|
10
|
+
const name = 'ProductFiltersProNoResults'
|
10
11
|
const parts = ['root'] as const
|
11
12
|
const { classes } = extendableComponent(name, parts)
|
12
13
|
|