@shopify/hydrogen-react 0.0.0-next-4b4aedb → 0.0.0-next-b381faf

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.
@@ -2,36 +2,85 @@ import type { CurrencyCode, LanguageCode, Product, ProductVariant } from './stor
2
2
  import { AnalyticsEventName, ShopifySalesChannel } from './analytics-constants.js';
3
3
  import { SHOPIFY_Y, SHOPIFY_S } from './cart-constants.js';
4
4
  export type ClientBrowserParameters = {
5
- /** Shopify unique user token: Value of `_shopify_y` cookie. Use `getClientBrowserParameters()` to collect this value. */
5
+ /**
6
+ * Shopify unique user token: Value of `_shopify_y` cookie.
7
+ *
8
+ * Use `getClientBrowserParameters()` to collect this value.
9
+ **/
6
10
  uniqueToken: string;
7
- /** Shopify session token: Value of `_shopify_s` cookie. Use `getClientBrowserParameters()` to collect this value. */
11
+ /**
12
+ * Shopify session token: Value of `_shopify_s` cookie.
13
+ *
14
+ * Use `getClientBrowserParameters()` to collect this value.
15
+ **/
8
16
  visitToken: string;
9
- /** `window.location.href`. Use `getClientBrowserParameters()` to collect this value. */
17
+ /**
18
+ * Value of `window.location.href`.
19
+ *
20
+ * Use `getClientBrowserParameters()` to collect this value.
21
+ **/
10
22
  url: string;
11
- /** `window.location.pathname`. Use `getClientBrowserParameters()` to collect this value. */
23
+ /**
24
+ * Value of `window.location.pathname`.
25
+ *
26
+ * Use `getClientBrowserParameters()` to collect this value.
27
+ **/
12
28
  path: string;
13
- /** `window.location.search`. Use `getClientBrowserParameters()` to collect this value. */
29
+ /**
30
+ * Value of `window.location.search`.
31
+ *
32
+ * Use `getClientBrowserParameters()` to collect this value.
33
+ **/
14
34
  search: string;
15
- /** `window.location.referrer`. Use `getClientBrowserParameters()` to collect this value. */
35
+ /**
36
+ * Value of `window.location.referrer`.
37
+ *
38
+ * Use `getClientBrowserParameters()` to collect this value.
39
+ **/
16
40
  referrer: string;
17
- /** `document.title`. Use `getClientBrowserParameters()` to collect this value. */
41
+ /**
42
+ * Value of `document.title`.
43
+ *
44
+ * Use `getClientBrowserParameters()` to collect this value.
45
+ **/
18
46
  title: string;
19
- /** `navigator.userAgent`. Use `getClientBrowserParameters()` to collect this value. */
47
+ /**
48
+ * Value of `navigator.userAgent`.
49
+ *
50
+ * Use `getClientBrowserParameters()` to collect this value.
51
+ **/
20
52
  userAgent: string;
21
- /** Navigation type: 'navigate' | 'reload' | 'back_forward' | 'prerender' | 'unknown <number>'. Use `getClientBrowserParameters()` to collect this value. */
53
+ /**
54
+ * Navigation type: `'navigate' | 'reload' | 'back_forward' | 'prerender' | 'unknown'`.
55
+ *
56
+ * Use `getClientBrowserParameters()` to collect this value.
57
+ **/
22
58
  navigationType: string;
23
- /** Navigation api: 'PerformanceNavigationTiming' | 'performance.navigation'. Use `getClientBrowserParameters()` to collect this value. */
59
+ /**
60
+ * Navigation api: `'PerformanceNavigationTiming' | 'performance.navigation'`.
61
+ *
62
+ * Use `getClientBrowserParameters()` to collect this value.
63
+ **/
24
64
  navigationApi: string;
25
65
  };
26
66
  export type ShopifyAnalyticsProduct = {
67
+ /** Product id in the form of `gid://shopify/Product/<id>`. */
27
68
  productGid: Product['id'];
69
+ /** Variant id in the form of `gid://shopify/ProductVariant/<id>`. */
28
70
  variantGid?: ProductVariant['id'];
71
+ /** Product name. */
29
72
  name: Product['title'];
73
+ /** Variant name. */
30
74
  variantName?: ProductVariant['title'];
75
+ /** Product brand or vendor. */
31
76
  brand: Product['vendor'];
77
+ /** Product category or type. */
32
78
  category?: Product['productType'];
79
+ /** Product price. */
33
80
  price: ProductVariant['price']['amount'];
81
+ /** Product sku. */
34
82
  sku?: ProductVariant['sku'];
83
+ /** Quantity of the product in this event. */
35
84
  quantity?: number;
36
85
  };
37
86
  type ShopifyAnalyticsBase = {
@@ -51,7 +100,7 @@ type ShopifyAnalyticsBase = {
51
100
  customerId?: string;
52
101
  /** Total value of products. */
53
102
  totalValue?: number;
54
- /** Shopify products. */
103
+ /** Product list. */
55
104
  products?: ShopifyAnalyticsProduct[];
56
105
  };
57
106
  export type ShopifySalesChannels = keyof typeof ShopifySalesChannel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/hydrogen-react",
3
- "version": "0.0.0-next-4b4aedb",
3
+ "version": "0.0.0-next-b381faf",
4
4
  "description": "React components, hooks, and utilities for creating custom Shopify storefronts",
5
5
  "homepage": "https://github.com/Shopify/hydrogen-react/tree/main/packages/react",
6
6
  "license": "MIT",