@graphcommerce/magento-product 8.1.0-canary.3 → 8.1.0-canary.6
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 +97 -2
- package/components/AddProductsToCart/AddProductsToCartSnackbar.tsx +13 -14
- package/components/AddProductsToCart/findAddedItems.ts +81 -0
- package/components/AddProductsToCart/index.ts +3 -0
- package/components/AddProductsToCart/useAddProductsToCartAction.ts +4 -2
- package/components/JsonLdProduct/JsonLdProductOffer.graphql +2 -3
- package/components/JsonLdProduct/ProductPageJsonLd.tsx +9 -4
- package/components/JsonLdProduct/index.ts +1 -0
- package/components/ProductAddToCart/ProductAddToCart.tsx +6 -4
- package/components/ProductCustomizable/CustomizableAreaOption.tsx +41 -7
- package/components/ProductCustomizable/CustomizableDateOption.tsx +60 -7
- package/components/ProductCustomizable/CustomizableDropDownOption.tsx +63 -15
- package/components/ProductCustomizable/CustomizableFieldOption.tsx +40 -4
- package/components/ProductFiltersPro/ProductFiltersPro.tsx +25 -10
- package/components/ProductFiltersPro/ProductFiltersProAllFiltersChip.tsx +6 -2
- package/components/ProductFiltersPro/ProductFiltersProAllFiltersSidebar.tsx +6 -2
- package/components/ProductFiltersPro/ProductFiltersProSortChip.tsx +9 -28
- package/components/ProductFiltersPro/ProductFiltersProSortDirectionArrow.tsx +17 -0
- package/components/ProductFiltersPro/ProductFiltersProSortSection.tsx +7 -32
- package/components/ProductFiltersPro/useProductFiltersProSort.tsx +74 -0
- package/components/ProductListItems/CategoryDefault.graphql +5 -0
- package/components/ProductListItems/ProductListItemsBase.tsx +1 -1
- package/components/ProductListItems/filterTypes.tsx +1 -1
- package/components/ProductListItems/filteredProductList.tsx +1 -1
- package/components/ProductListItems/productListApplyCategoryDefaults.ts +28 -0
- package/components/ProductPageBreadcrumb/ProductPageBreadcrumb.tsx +5 -3
- package/components/ProductPagePrice/ProductPagePrice.graphql +3 -0
- package/components/ProductPagePrice/ProductPagePrice.tsx +11 -4
- package/components/ProductPagePrice/useCustomizableOptionPrice.ts +127 -0
- package/components/index.ts +2 -0
- package/hooks/useProductListLink.ts +10 -5
- package/hooks/useProductListLinkReplace.ts +3 -0
- package/package.json +13 -13
- package/tsconfig.json +1 -1
package/components/index.ts
CHANGED
@@ -13,6 +13,8 @@ export * from './ProductListItems/filterTypes'
|
|
13
13
|
export * from './ProductListItems/getFilterTypes'
|
14
14
|
export * from './ProductListItems/ProductListItems.gql'
|
15
15
|
export * from './ProductListItems/ProductListItemsBase'
|
16
|
+
export * from './ProductListItems/productListApplyCategoryDefaults'
|
17
|
+
export * from './ProductListItems/CategoryDefault.gql'
|
16
18
|
export * from './ProductListItems/ProductListParamsProvider'
|
17
19
|
export * from './ProductListItems/renderer'
|
18
20
|
export * from './ProductListLink/ProductListLink'
|
@@ -2,11 +2,13 @@ import {
|
|
2
2
|
isFilterTypeEqual,
|
3
3
|
isFilterTypeMatch,
|
4
4
|
isFilterTypeRange,
|
5
|
+
ProductFilterParams,
|
5
6
|
ProductListParams,
|
7
|
+
toFilterParams,
|
6
8
|
} from '../components/ProductListItems/filterTypes'
|
7
9
|
|
8
|
-
export function
|
9
|
-
const { url, sort, currentPage, pageSize, filters: incoming } = props
|
10
|
+
export function productListLinkFromFilter(props: ProductFilterParams): string {
|
11
|
+
const { url, sort, dir, currentPage, pageSize, filters: incoming } = props
|
10
12
|
const isSearch = url.startsWith('search')
|
11
13
|
const filters = isSearch ? incoming : { ...incoming, category_uid: undefined }
|
12
14
|
const uid = incoming?.category_uid?.eq || incoming?.category_uid?.in?.[0]
|
@@ -19,9 +21,8 @@ export function productListLink(props: ProductListParams): string {
|
|
19
21
|
|
20
22
|
// todo(paales): How should the URL look like with multiple sorts?
|
21
23
|
// Something like: /sort/position,price/dir/asc,asc
|
22
|
-
|
23
|
-
if (
|
24
|
-
if (sort && sortBy && sort[sortBy] && sort[sortBy] === 'DESC') query += `/dir/desc`
|
24
|
+
if (sort) query += `/sort/${sort}`
|
25
|
+
if (dir) query += `/dir/desc`
|
25
26
|
if (pageSize) query += `/page-size/${pageSize}`
|
26
27
|
|
27
28
|
// Apply filters
|
@@ -42,6 +43,10 @@ export function productListLink(props: ProductListParams): string {
|
|
42
43
|
return query ? `/${url}${paginateSort}/q${query}` : `/${url}${paginateSort}`
|
43
44
|
}
|
44
45
|
|
46
|
+
export function productListLink(props: ProductListParams): string {
|
47
|
+
return productListLinkFromFilter(toFilterParams(props))
|
48
|
+
}
|
49
|
+
|
45
50
|
export function useProductListLink(props: ProductListParams): string {
|
46
51
|
return productListLink({ ...props, url: `${props.url}` })
|
47
52
|
}
|
@@ -9,6 +9,9 @@ type UseProductLinkPushProps = {
|
|
9
9
|
scroll?: boolean
|
10
10
|
}
|
11
11
|
|
12
|
+
/**
|
13
|
+
* @deprecated replaced by custom function inside ProductFiltersPro
|
14
|
+
*/
|
12
15
|
export function useProductListLinkReplace(props?: UseProductLinkPushProps) {
|
13
16
|
const { setParams } = useProductListParamsContext()
|
14
17
|
const router = useRouter()
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@graphcommerce/magento-product",
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
5
|
-
"version": "8.1.0-canary.
|
5
|
+
"version": "8.1.0-canary.6",
|
6
6
|
"sideEffects": false,
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
8
8
|
"eslintConfig": {
|
@@ -18,18 +18,18 @@
|
|
18
18
|
"typescript": "5.3.3"
|
19
19
|
},
|
20
20
|
"peerDependencies": {
|
21
|
-
"@graphcommerce/ecommerce-ui": "^8.1.0-canary.
|
22
|
-
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.
|
23
|
-
"@graphcommerce/framer-next-pages": "^8.1.0-canary.
|
24
|
-
"@graphcommerce/framer-scroller": "^8.1.0-canary.
|
25
|
-
"@graphcommerce/graphql": "^8.1.0-canary.
|
26
|
-
"@graphcommerce/graphql-mesh": "^8.1.0-canary.
|
27
|
-
"@graphcommerce/image": "^8.1.0-canary.
|
28
|
-
"@graphcommerce/magento-cart": "^8.1.0-canary.
|
29
|
-
"@graphcommerce/magento-store": "^8.1.0-canary.
|
30
|
-
"@graphcommerce/next-ui": "^8.1.0-canary.
|
31
|
-
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.
|
32
|
-
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.
|
21
|
+
"@graphcommerce/ecommerce-ui": "^8.1.0-canary.6",
|
22
|
+
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.6",
|
23
|
+
"@graphcommerce/framer-next-pages": "^8.1.0-canary.6",
|
24
|
+
"@graphcommerce/framer-scroller": "^8.1.0-canary.6",
|
25
|
+
"@graphcommerce/graphql": "^8.1.0-canary.6",
|
26
|
+
"@graphcommerce/graphql-mesh": "^8.1.0-canary.6",
|
27
|
+
"@graphcommerce/image": "^8.1.0-canary.6",
|
28
|
+
"@graphcommerce/magento-cart": "^8.1.0-canary.6",
|
29
|
+
"@graphcommerce/magento-store": "^8.1.0-canary.6",
|
30
|
+
"@graphcommerce/next-ui": "^8.1.0-canary.6",
|
31
|
+
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.6",
|
32
|
+
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.6",
|
33
33
|
"@lingui/core": "^4.2.1",
|
34
34
|
"@lingui/macro": "^4.2.1",
|
35
35
|
"@lingui/react": "^4.2.1",
|
package/tsconfig.json
CHANGED