@graphcommerce/magento-cart-items 9.0.0-canary.100 → 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.
@@ -1,10 +1,6 @@
1
1
  import { useCrosssellItems } from '@graphcommerce/magento-cart/components/CartAdded/useCrosssellItems'
2
- import {
3
- AddProductsToCartForm,
4
- ProductListItemRenderer,
5
- ProductScroller,
6
- ProductScrollerProps,
7
- } from '@graphcommerce/magento-product'
2
+ import type { ProductListItemRenderer, ProductScrollerProps } from '@graphcommerce/magento-product'
3
+ import { AddProductsToCartForm, ProductScroller } from '@graphcommerce/magento-product'
8
4
  import { Trans } from '@lingui/macro'
9
5
 
10
6
  export type CartItemCrosssellsProps = {
@@ -13,7 +9,7 @@ export type CartItemCrosssellsProps = {
13
9
 
14
10
  export function CartCrosssellsScroller(props: CartItemCrosssellsProps) {
15
11
  const { renderer, sx = [], title, titleProps } = props
16
- const [addedItem, crossSellItems] = useCrosssellItems()
12
+ const [, crossSellItems] = useCrosssellItems()
17
13
 
18
14
  const crossSellsHideCartItems = Boolean(import.meta.graphCommerce.crossSellsHideCartItems)
19
15
  if (crossSellItems.length === 0 || crossSellsHideCartItems === true) return null
@@ -8,8 +8,9 @@ import {
8
8
  filterNonNullableKeys,
9
9
  NextLink,
10
10
  } from '@graphcommerce/next-ui'
11
- import { Badge, Box, Link, SxProps, Theme } from '@mui/material'
12
- import { CartItemFragment } from '../../Api/CartItem.gql'
11
+ import type { SxProps, Theme } from '@mui/material'
12
+ import { Badge, Box, Link } from '@mui/material'
13
+ import type { CartItemFragment } from '../../Api/CartItem.gql'
13
14
  import { RemoveItemFromCartFab } from '../RemoveItemFromCart/RemoveItemFromCartFab'
14
15
  import { UpdateItemQuantity } from '../UpdateItemQuantity/UpdateItemQuantity'
15
16
 
@@ -21,7 +22,7 @@ export type CartItemProps = CartItemFragment & {
21
22
  } & OwnerState
22
23
 
23
24
  type OwnerState = { withOptions?: boolean }
24
- const compName = 'CartItem' as const
25
+ const compName = 'CartItem'
25
26
  const parts = [
26
27
  'item',
27
28
  'picture',
@@ -1,16 +1,12 @@
1
1
  import { Image } from '@graphcommerce/image'
2
2
  import { useDisplayInclTax } from '@graphcommerce/magento-cart/hooks'
3
- import { ProductLinkProps } from '@graphcommerce/magento-product'
3
+ import type { ProductLinkProps } from '@graphcommerce/magento-product'
4
4
  import { Money } from '@graphcommerce/magento-store'
5
- import {
6
- ActionCard,
7
- ActionCardProps,
8
- filterNonNullableKeys,
9
- actionCardImageSizes,
10
- } from '@graphcommerce/next-ui'
5
+ import type { ActionCardProps } from '@graphcommerce/next-ui'
6
+ import { ActionCard, filterNonNullableKeys, actionCardImageSizes } from '@graphcommerce/next-ui'
11
7
  import { Trans } from '@lingui/react'
12
8
  import { Box, Button, Link } from '@mui/material'
13
- import { CartItemFragment } from '../../Api/CartItem.gql'
9
+ import type { CartItemFragment } from '../../Api/CartItem.gql'
14
10
  import { RemoveItemFromCart } from '../RemoveItemFromCart/RemoveItemFromCart'
15
11
  import { UpdateItemQuantity } from '../UpdateItemQuantity/UpdateItemQuantity'
16
12
 
@@ -1,6 +1,7 @@
1
- import { RenderType, TypeRenderer } from '@graphcommerce/next-ui'
1
+ import type { TypeRenderer } from '@graphcommerce/next-ui'
2
+ import { RenderType } from '@graphcommerce/next-ui'
2
3
  import { Box } from '@mui/material'
3
- import { CartItemsFragment } from '../../Api/CartItems.gql'
4
+ import type { CartItemsFragment } from '../../Api/CartItems.gql'
4
5
 
5
6
  export type CartItemRenderer = TypeRenderer<NonNullable<NonNullable<CartItemsFragment['items']>[0]>>
6
7
 
@@ -1,9 +1,8 @@
1
- import { ActionCardLayout, ActionCardLayoutProps, nonNullable } from '@graphcommerce/next-ui'
2
- import { CartItemsFragment } from '../../Api/CartItems.gql'
3
- import {
4
- CartItemActionCard,
5
- CartItemActionCardProps,
6
- } from '../CartItemActionCard/CartItemActionCard'
1
+ import type { ActionCardLayoutProps } from '@graphcommerce/next-ui'
2
+ import { ActionCardLayout, nonNullable } from '@graphcommerce/next-ui'
3
+ import type { CartItemsFragment } from '../../Api/CartItems.gql'
4
+ import type { CartItemActionCardProps } from '../CartItemActionCard/CartItemActionCard'
5
+ import { CartItemActionCard } from '../CartItemActionCard/CartItemActionCard'
7
6
 
8
7
  export type CartProps = Omit<ActionCardLayoutProps, 'className'> & {
9
8
  cart?: CartItemsFragment | null
@@ -1,7 +1,5 @@
1
- import {
2
- AddProductsToCartButton,
3
- AddProductsToCartButtonProps,
4
- } from '@graphcommerce/magento-product'
1
+ import type { AddProductsToCartButtonProps } from '@graphcommerce/magento-product'
2
+ import { AddProductsToCartButton } from '@graphcommerce/magento-product'
5
3
  import { Trans } from '@lingui/react'
6
4
 
7
5
  export function EditCartItemButton(props: AddProductsToCartButtonProps) {
@@ -1,21 +1,17 @@
1
- import { UseHistoryLink, useHistoryGo } from '@graphcommerce/framer-next-pages'
2
- import {
3
- useFormAddProductsToCart,
1
+ import type { UseHistoryLink } from '@graphcommerce/framer-next-pages'
2
+ import { useHistoryGo } from '@graphcommerce/framer-next-pages'
3
+ import type {
4
4
  AddProductsToCartFormProps,
5
5
  AddToCartItemSelector,
6
- AddProductsToCartForm,
7
6
  } from '@graphcommerce/magento-product'
7
+ import { useFormAddProductsToCart, AddProductsToCartForm } from '@graphcommerce/magento-product'
8
8
  import { useRouter } from 'next/router'
9
9
  import { useEffect, useRef } from 'react'
10
- import { CartItemsFragment } from '../../../Api/CartItems.gql'
11
- import {
12
- UseRemoveItemFromCartProps,
13
- useRemoveItemFromCart,
14
- } from '../../../hooks/useRemoveItemFromCart'
15
- import {
16
- CartItemToCartItemInputProps,
17
- cartItemToCartItemInput,
18
- } from '../../../utils/cartItemToCartItemInput'
10
+ import type { CartItemsFragment } from '../../../Api/CartItems.gql'
11
+ import type { UseRemoveItemFromCartProps } from '../../../hooks/useRemoveItemFromCart'
12
+ import { useRemoveItemFromCart } from '../../../hooks/useRemoveItemFromCart'
13
+ import type { CartItemToCartItemInputProps } from '../../../utils/cartItemToCartItemInput'
14
+ import { cartItemToCartItemInput } from '../../../utils/cartItemToCartItemInput'
19
15
 
20
16
  type EditInitProps = CartItemToCartItemInputProps & AddToCartItemSelector
21
17
 
@@ -1,11 +1,11 @@
1
1
  import { ApolloCartErrorSnackbar } from '@graphcommerce/magento-cart'
2
- import { Button, ButtonProps } from '@graphcommerce/next-ui'
2
+ import type { ButtonProps } from '@graphcommerce/next-ui'
3
+ import { Button } from '@graphcommerce/next-ui'
3
4
  import { Trans } from '@lingui/react'
4
- import { SxProps, Theme, styled } from '@mui/material'
5
- import {
6
- UseRemoveItemFromCartProps,
7
- useRemoveItemFromCart,
8
- } from '../../hooks/useRemoveItemFromCart'
5
+ import type { SxProps, Theme } from '@mui/material'
6
+ import { styled } from '@mui/material'
7
+ import type { UseRemoveItemFromCartProps } from '../../hooks/useRemoveItemFromCart'
8
+ import { useRemoveItemFromCart } from '../../hooks/useRemoveItemFromCart'
9
9
 
10
10
  export type RemoveItemFromCartProps = UseRemoveItemFromCartProps & {
11
11
  sx?: SxProps<Theme>
@@ -1,11 +1,11 @@
1
1
  import { ApolloCartErrorSnackbar } from '@graphcommerce/magento-cart'
2
- import { Fab, FabProps, iconClose } from '@graphcommerce/next-ui'
2
+ import type { FabProps } from '@graphcommerce/next-ui'
3
+ import { Fab, iconClose } from '@graphcommerce/next-ui'
3
4
  import { i18n } from '@lingui/core'
4
- import { SxProps, Theme, styled } from '@mui/material'
5
- import {
6
- UseRemoveItemFromCartProps,
7
- useRemoveItemFromCart,
8
- } from '../../hooks/useRemoveItemFromCart'
5
+ import type { SxProps, Theme } from '@mui/material'
6
+ import { styled } from '@mui/material'
7
+ import type { UseRemoveItemFromCartProps } from '../../hooks/useRemoveItemFromCart'
8
+ import { useRemoveItemFromCart } from '../../hooks/useRemoveItemFromCart'
9
9
 
10
10
  export type RemoveItemFromCartFabProps = UseRemoveItemFromCartProps & {
11
11
  sx?: SxProps<Theme>
@@ -1,8 +1,8 @@
1
1
  import { Money } from '@graphcommerce/magento-store'
2
2
  import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui'
3
3
  import { Box } from '@mui/material'
4
- import { CartItemFragment } from '../../Api/CartItem.gql'
5
- import { SelectedCustomizableOptionFragment } from './SelectedCustomizableOption.gql'
4
+ import type { CartItemFragment } from '../../Api/CartItem.gql'
5
+ import type { SelectedCustomizableOptionFragment } from './SelectedCustomizableOption.gql'
6
6
 
7
7
  type SelectedCustomizableOptionProps = CartItemFragment & {
8
8
  customizable_options?: (SelectedCustomizableOptionFragment | null | undefined)[] | null
@@ -1,13 +1,15 @@
1
- import { NumberFieldElement, NumberFieldElementProps } from '@graphcommerce/ecommerce-ui'
1
+ import type { NumberFieldElementProps } from '@graphcommerce/ecommerce-ui'
2
+ import { NumberFieldElement } from '@graphcommerce/ecommerce-ui'
2
3
  import { ApolloCartErrorSnackbar, useFormGqlMutationCart } from '@graphcommerce/magento-cart'
3
- import { FormAutoSubmit, UseFormGraphQlOptions } from '@graphcommerce/react-hook-form'
4
- import { SxProps, Theme } from '@mui/material'
4
+ import type { UseFormGraphQlOptions } from '@graphcommerce/react-hook-form'
5
+ import { FormAutoSubmit } from '@graphcommerce/react-hook-form'
6
+ import type { SxProps, Theme } from '@mui/material'
5
7
  import React from 'react'
6
- import {
7
- UpdateItemQuantityDocument,
8
+ import type {
8
9
  UpdateItemQuantityMutation,
9
10
  UpdateItemQuantityMutationVariables,
10
11
  } from './UpdateItemQuantity.gql'
12
+ import { UpdateItemQuantityDocument } from './UpdateItemQuantity.gql'
11
13
 
12
14
  type UpdateItemQuantityFormReturn = UseFormGraphQlOptions<
13
15
  UpdateItemQuantityMutation,
@@ -1,12 +1,12 @@
1
1
  import { useFormGqlMutationCart } from '@graphcommerce/magento-cart/hooks'
2
- import { UseFormGraphQlOptions } from '@graphcommerce/react-hook-form'
2
+ import type { UseFormGraphQlOptions } from '@graphcommerce/react-hook-form'
3
3
  import type { DistributedOmit } from 'type-fest'
4
- import { CartItemFragment } from '../Api/CartItem.gql'
5
- import {
4
+ import type { CartItemFragment } from '../Api/CartItem.gql'
5
+ import type {
6
6
  RemoveItemFromCartMutation,
7
7
  RemoveItemFromCartMutationVariables,
8
- RemoveItemFromCartDocument,
9
8
  } from '../components/RemoveItemFromCart/RemoveItemFromCart.gql'
9
+ import { RemoveItemFromCartDocument } from '../components/RemoveItemFromCart/RemoveItemFromCart.gql'
10
10
 
11
11
  export type UseRemoveItemFromCartProps = DistributedOmit<CartItemFragment, '__typename'> &
12
12
  Omit<
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart-items",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.0.0-canary.100",
5
+ "version": "9.0.0-canary.103",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,28 +12,29 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.100",
16
- "@graphcommerce/framer-next-pages": "^9.0.0-canary.100",
17
- "@graphcommerce/graphql": "^9.0.0-canary.100",
18
- "@graphcommerce/image": "^9.0.0-canary.100",
19
- "@graphcommerce/magento-cart": "^9.0.0-canary.100",
20
- "@graphcommerce/magento-customer": "^9.0.0-canary.100",
21
- "@graphcommerce/magento-product": "^9.0.0-canary.100",
22
- "@graphcommerce/magento-store": "^9.0.0-canary.100",
23
- "@graphcommerce/next-ui": "^9.0.0-canary.100",
24
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.100",
25
- "@graphcommerce/react-hook-form": "^9.0.0-canary.100",
26
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.100",
15
+ "@graphcommerce/ecommerce-ui": "^9.0.0-canary.103",
16
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.103",
17
+ "@graphcommerce/framer-next-pages": "^9.0.0-canary.103",
18
+ "@graphcommerce/graphql": "^9.0.0-canary.103",
19
+ "@graphcommerce/image": "^9.0.0-canary.103",
20
+ "@graphcommerce/magento-cart": "^9.0.0-canary.103",
21
+ "@graphcommerce/magento-customer": "^9.0.0-canary.103",
22
+ "@graphcommerce/magento-product": "^9.0.0-canary.103",
23
+ "@graphcommerce/magento-store": "^9.0.0-canary.103",
24
+ "@graphcommerce/next-ui": "^9.0.0-canary.103",
25
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.103",
26
+ "@graphcommerce/react-hook-form": "^9.0.0-canary.103",
27
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.103",
27
28
  "@lingui/core": "^4.2.1",
28
29
  "@lingui/macro": "^4.2.1",
29
30
  "@lingui/react": "^4.2.1",
30
31
  "@mui/material": "^5.10.16",
31
- "framer-motion": "^10.0.0",
32
+ "framer-motion": "^11.0.0",
32
33
  "next": "*",
33
34
  "react": "^18.2.0",
34
35
  "react-dom": "^18.2.0"
35
36
  },
36
37
  "devDependencies": {
37
- "type-fest": "^4.22.0"
38
+ "type-fest": "^4.26.1"
38
39
  }
39
40
  }
@@ -1,14 +1,14 @@
1
- import {
1
+ import type {
2
2
  AddProductsToCartFields,
3
3
  AnyOption,
4
4
  CustomizableProductOptionBase,
5
5
  OptionValueSelector,
6
6
  SelectorsProp,
7
- productCustomizableSelectors,
8
7
  } from '@graphcommerce/magento-product'
8
+ import { productCustomizableSelectors } from '@graphcommerce/magento-product'
9
9
  import { isTypename, filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui'
10
- import { CartItemFragment } from '../Api/CartItem.gql'
11
- import { EditCartItemFormFragment } from '../components/EditCartItem/EditCartItemForm/EditCartItemForm.gql'
10
+ import type { CartItemFragment } from '../Api/CartItem.gql'
11
+ import type { EditCartItemFormFragment } from '../components/EditCartItem/EditCartItemForm/EditCartItemForm.gql'
12
12
 
13
13
  type CartItemInput = AddProductsToCartFields['cartItems'][number]
14
14