Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/hydrogen-react/src/CartProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ import {useShop} from './ShopifyProvider.js';

export const CartContext = createContext<CartWithActions | null>(null);

/**
* `useCart` hook must be a descendent of a `CartProvider` component.
* @publicDocs
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type UseCartDocs = () => CartWithActionsDocs;

Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen-react/src/ExternalVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {Entries, PartialDeep} from 'type-fest';
import {forwardRef, IframeHTMLAttributes} from 'react';

/**
* The `ExternalVideo` component renders an embedded video for the Storefront API's [ExternalVideo object](https://shopify.dev/api/storefront/reference/products/externalvideo).
* Takes in the same props as a native `<iframe>` element, except for `src`.
* @publicDocs
*/
export interface ExternalVideoBaseProps {
Expand Down
1 change: 1 addition & 0 deletions packages/hydrogen-react/src/ShopifyProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export interface ShopifyProviderBase {

/**
* Shopify-specific values that are used in various Hydrogen React components and hooks.
* @publicDocs
*/
export interface ShopifyProviderProps extends ShopifyProviderBase {
/** React children to render. */
Expand Down
12 changes: 12 additions & 0 deletions packages/hydrogen-react/src/analytics-constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* Analytics event names accepted by Shopify analytics.
* @publicDocs
*/
export const AnalyticsEventName = {
PAGE_VIEW: 'PAGE_VIEW',
ADD_TO_CART: 'ADD_TO_CART',
Expand All @@ -7,6 +11,10 @@ export const AnalyticsEventName = {
SEARCH_VIEW: 'SEARCH_VIEW',
} as const;

/**
* Analytics page type values accepted by Shopify analytics.
* @publicDocs
*/
export const AnalyticsPageType: AnalyticsPageType = {
article: 'article',
blog: 'blog',
Expand All @@ -32,6 +40,10 @@ export const AnalyticsPageType: AnalyticsPageType = {
search: 'search',
} as const;

/**
* Analytics sales channel values accepted by Shopify analytics.
* @publicDocs
*/
export const ShopifySalesChannel: ShopifySalesChannel = {
hydrogen: 'hydrogen',
headless: 'headless',
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen-react/src/analytics-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export type ShopifyAnalyticsPayloadWithPrivacyFields =
export type ShopifyAnalytics = ShopifyPageView | ShopifyAddToCart;

/**
* The Shopify analytics cookie values containing the unique user token and session token.
* Shopify cookies names
* @publicDocs
*/
export type ShopifyCookies = {
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen-react/src/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function sendToShopify(
}

/**
* Gathers client browser values commonly used for analytics.
* If executed on server, this method will return empty string for each field.
* @publicDocs
*/
export function getClientBrowserParameters(): ClientBrowserParameters {
Expand Down
119 changes: 71 additions & 48 deletions packages/hydrogen/docs/generated/generated_docs_data.json

Large diffs are not rendered by default.

Loading
Loading