@shopify/hydrogen 0.11.1-experimental.0 → 0.11.1-experimental.1
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 +2 -1
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +2 -2
- package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +1 -1
- package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +1 -1
- package/dist/esnext/components/Metafield/Metafield.client.d.ts +3 -3
- package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +3 -3
- package/dist/esnext/components/Money/Money.client.d.ts +3 -3
- package/dist/esnext/components/ProductMetafield/ProductMetafield.client.d.ts +2 -2
- package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +2 -2
- package/dist/esnext/components/ProductTitle/ProductTitle.client.d.ts +1 -1
- package/dist/esnext/components/RawHtml/RawHtml.d.ts +3 -3
- package/dist/esnext/components/UnitPrice/UnitPrice.client.d.ts +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,10 +7,11 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
<!-- ## [Unreleased] -->
|
|
9
9
|
|
|
10
|
-
## 0.11.1-experimental.
|
|
10
|
+
## 0.11.1-experimental.1
|
|
11
11
|
|
|
12
12
|
### Patch Changes
|
|
13
13
|
|
|
14
|
+
- 11426471: Fix issue with components that take in the `as` prop not validating other props when a component is passed to `as`.
|
|
14
15
|
- b96179fd: Ensure ProductSeo knows how to handle `featuredImage = null`
|
|
15
16
|
- 2e487b7e: Switch to using Changesets for changelogs.
|
|
16
17
|
- 2d8ab7e2: Hydrogen docs: Preloaded queries and query timing
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { MoneyProps } from '../Money';
|
|
3
3
|
import { Props } from '../types';
|
|
4
|
-
export interface CartLinePriceProps extends Omit<MoneyProps
|
|
4
|
+
export interface CartLinePriceProps<TTag> extends Omit<MoneyProps<TTag>, 'data'> {
|
|
5
5
|
/** The type of price. Valid values:`regular` (default) or `compareAt`. */
|
|
6
6
|
priceType?: 'regular' | 'compareAt';
|
|
7
7
|
}
|
|
@@ -9,4 +9,4 @@ export interface CartLinePriceProps extends Omit<MoneyProps, 'data'> {
|
|
|
9
9
|
* The `CartLinePrice` component renders a `Money` component for the cart line merchandise's price or
|
|
10
10
|
* compare at price. It must be a descendent of a `CartLineProvider` component.
|
|
11
11
|
*/
|
|
12
|
-
export declare function CartLinePrice<TTag extends ElementType>(props: Props<TTag> & CartLinePriceProps): JSX.Element | null;
|
|
12
|
+
export declare function CartLinePrice<TTag extends ElementType>(props: Props<TTag> & CartLinePriceProps<TTag>): JSX.Element | null;
|
|
@@ -6,5 +6,5 @@ import { Props } from '../types';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function CartLineProductTitle<TTag extends ElementType>(props: Props<TTag> & {
|
|
8
8
|
/** An HTML tag to be rendered as the base element wrapper. The default is `span`. */
|
|
9
|
-
as?:
|
|
9
|
+
as?: TTag;
|
|
10
10
|
}): JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { Props } from '../types';
|
|
3
3
|
import { ParsedMetafield } from '../../types';
|
|
4
|
-
export interface MetafieldProps {
|
|
4
|
+
export interface MetafieldProps<TTag> {
|
|
5
5
|
/** A [Metafield object](/api/storefront/reference/common-objects/metafield) from the Storefront API. */
|
|
6
6
|
data: ParsedMetafield;
|
|
7
7
|
/** An HTML tag to be rendered as the base element wrapper. The default value varies depending on [metafield.type](/apps/metafields/types). */
|
|
8
|
-
as?:
|
|
8
|
+
as?: TTag;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* The `Metafield` component renders the value of a Storefront
|
|
@@ -14,7 +14,7 @@ export interface MetafieldProps {
|
|
|
14
14
|
* Renders a smart default of the
|
|
15
15
|
* Metafield's `value`. For more information, refer to the [Default Output](#default-output) section.
|
|
16
16
|
*/
|
|
17
|
-
export declare function Metafield<TTag extends ElementType>(props: Props<TTag> & MetafieldProps): JSX.Element | null;
|
|
17
|
+
export declare function Metafield<TTag extends ElementType>(props: Props<TTag> & MetafieldProps<TTag>): JSX.Element | null;
|
|
18
18
|
export declare namespace Metafield {
|
|
19
19
|
var Fragment: string;
|
|
20
20
|
}
|
|
@@ -3,12 +3,12 @@ import { Props } from '../../../types';
|
|
|
3
3
|
import { Rating } from '../../../../types';
|
|
4
4
|
export declare const STAR_EMPTY = "\u2606";
|
|
5
5
|
export declare const STAR_FILLED = "\u2605";
|
|
6
|
-
export interface StarRatingProps {
|
|
6
|
+
export interface StarRatingProps<TTag> {
|
|
7
7
|
rating: Rating;
|
|
8
8
|
/** An HTML tag to be rendered as the base element wrapper. The default is `div`. */
|
|
9
|
-
as?:
|
|
9
|
+
as?: TTag;
|
|
10
10
|
}
|
|
11
|
-
export declare function StarRating<TTag extends ElementType>(props: Props<TTag> & StarRatingProps): JSX.Element;
|
|
11
|
+
export declare function StarRating<TTag extends ElementType>(props: Props<TTag> & StarRatingProps<TTag>): JSX.Element;
|
|
12
12
|
export declare function Star({ percentFilled }: {
|
|
13
13
|
percentFilled: number;
|
|
14
14
|
}): JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { Props } from '../types';
|
|
3
3
|
import { MoneyV2 } from '../../graphql/types/types';
|
|
4
|
-
export interface MoneyProps {
|
|
4
|
+
export interface MoneyProps<TTag> {
|
|
5
5
|
/** An HTML tag to be rendered as the base element wrapper. The default is `div`. */
|
|
6
|
-
as?:
|
|
6
|
+
as?: TTag;
|
|
7
7
|
/** A [`MoneyV2` object](/api/storefront/reference/common-objects/moneyv2). */
|
|
8
8
|
data: MoneyV2;
|
|
9
9
|
}
|
|
@@ -12,7 +12,7 @@ export interface MoneyProps {
|
|
|
12
12
|
* [`MoneyV2` object](/api/storefront/reference/common-objects/moneyv2) according to the
|
|
13
13
|
* `defaultLocale` in the `shopify.config.js` file.
|
|
14
14
|
*/
|
|
15
|
-
export declare function Money<TTag extends ElementType>(props: Props<TTag> & MoneyProps): JSX.Element;
|
|
15
|
+
export declare function Money<TTag extends ElementType>(props: Props<TTag> & MoneyProps<TTag>): JSX.Element;
|
|
16
16
|
export declare namespace Money {
|
|
17
17
|
var Fragment: string;
|
|
18
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { Props } from '../types';
|
|
3
3
|
import { MetafieldProps } from '../Metafield/Metafield.client';
|
|
4
|
-
export interface ProductMetafieldProps extends Omit<MetafieldProps
|
|
4
|
+
export interface ProductMetafieldProps<TTag> extends Omit<MetafieldProps<TTag>, 'metafield'> {
|
|
5
5
|
/** A string corresponding to the [key](/api/storefront/reference/common-objects/metafield) of the product's
|
|
6
6
|
* metafield.
|
|
7
7
|
*/
|
|
@@ -18,4 +18,4 @@ export interface ProductMetafieldProps extends Omit<MetafieldProps, 'metafield'>
|
|
|
18
18
|
* [`Metafield`](/api/hydrogen/components/primitive/metafield) component with the product metafield.
|
|
19
19
|
* It must be a descendent of a `ProductProvider` component.
|
|
20
20
|
*/
|
|
21
|
-
export declare function ProductMetafield<TTag extends ElementType>(props: Props<TTag> & Omit<ProductMetafieldProps
|
|
21
|
+
export declare function ProductMetafield<TTag extends ElementType>(props: Props<TTag> & Omit<ProductMetafieldProps<TTag>, 'data'>): JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { MoneyProps } from '../Money';
|
|
3
3
|
import { Props } from '../types';
|
|
4
|
-
export interface ProductPriceProps extends Omit<MoneyProps
|
|
4
|
+
export interface ProductPriceProps<TTag> extends Omit<MoneyProps<TTag>, 'data'> {
|
|
5
5
|
/** The type of price. Valid values: `regular` (default) or `compareAt`. */
|
|
6
6
|
priceType?: 'regular' | 'compareAt';
|
|
7
7
|
/** The type of value. Valid values: `min` (default), `max` or `unit`. */
|
|
@@ -13,4 +13,4 @@ export interface ProductPriceProps extends Omit<MoneyProps, 'data'> {
|
|
|
13
13
|
* The `ProductPrice` component renders a `Money` component with the product
|
|
14
14
|
* [`priceRange`](/api/storefront/reference/products/productpricerange)'s `maxVariantPrice` or `minVariantPrice`, for either the regular price or compare at price range. It must be a descendent of the `ProductProvider` component.
|
|
15
15
|
*/
|
|
16
|
-
export declare function ProductPrice<TTag extends ElementType>(props: Props<TTag> & ProductPriceProps): JSX.Element | null;
|
|
16
|
+
export declare function ProductPrice<TTag extends ElementType>(props: Props<TTag> & ProductPriceProps<TTag>): JSX.Element | null;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { Props } from '../types';
|
|
3
|
-
export interface RawHtmlProps {
|
|
3
|
+
export interface RawHtmlProps<TTag> {
|
|
4
4
|
/** An HTML string. */
|
|
5
5
|
string: string;
|
|
6
6
|
/** Whether the HTML string should be sanitized with `isomorphic-dompurify`. */
|
|
7
7
|
unsanitized?: boolean;
|
|
8
8
|
/** An HTML tag to be rendered as the base element wrapper. The default is `div`. */
|
|
9
|
-
as?:
|
|
9
|
+
as?: TTag;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* The `RawHtml` component renders an HTML string as HTML DOM elements. This should be used for
|
|
@@ -16,4 +16,4 @@ export interface RawHtmlProps {
|
|
|
16
16
|
* [isomorphic-dompurify](https://github.com/kkomelin/isomorphic-dompurify) by default.
|
|
17
17
|
* To keep the text unsanitized, set the `unsanitized` prop to `true`.
|
|
18
18
|
*/
|
|
19
|
-
export declare function RawHtml<TTag extends ElementType>(props: Props<TTag> & RawHtmlProps): JSX.Element;
|
|
19
|
+
export declare function RawHtml<TTag extends ElementType>(props: Props<TTag> & RawHtmlProps<TTag>): JSX.Element;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { Props } from '../types';
|
|
3
3
|
import { UnitPriceMeasurement, MoneyV2 } from '../../graphql/types/types';
|
|
4
|
-
export interface UnitPriceProps {
|
|
4
|
+
export interface UnitPriceProps<TTag> {
|
|
5
5
|
/** A [`MoneyV2` object](/api/storefront/reference/common-objects/moneyv2). */
|
|
6
6
|
data: MoneyV2;
|
|
7
7
|
/** A [`UnitPriceMeasurement` object](/api/storefront/reference/products/unitpricemeasurement). */
|
|
8
8
|
measurement: UnitPriceMeasurement;
|
|
9
9
|
/** An HTML tag to be rendered as the base element wrapper. The default is `div`. */
|
|
10
|
-
as?:
|
|
10
|
+
as?: TTag;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* The `UnitPrice` component renders a string with a [UnitPrice](/themes/pricing-payments/unit-pricing) as the
|
|
14
14
|
* [Storefront API's `MoneyV2` object](/api/storefront/reference/common-objects/moneyv2) with a reference unit from the [Storefront API's `UnitPriceMeasurement` object](/api/storefront/reference/products/unitpricemeasurement).
|
|
15
15
|
*/
|
|
16
|
-
export declare function UnitPrice<TTag extends ElementType>(props: Props<TTag> & UnitPriceProps): JSX.Element;
|
|
16
|
+
export declare function UnitPrice<TTag extends ElementType>(props: Props<TTag> & UnitPriceProps<TTag>): JSX.Element;
|
|
17
17
|
export declare namespace UnitPrice {
|
|
18
18
|
var Fragment: string;
|
|
19
19
|
}
|