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

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.
Files changed (34) hide show
  1. package/dist/browser-dev/AddToCartButton.mjs.map +1 -1
  2. package/dist/browser-dev/BaseButton.mjs.map +1 -1
  3. package/dist/browser-dev/BuyNowButton.mjs.map +1 -1
  4. package/dist/browser-dev/CartCheckoutButton.mjs.map +1 -1
  5. package/dist/browser-prod/AddToCartButton.mjs.map +1 -1
  6. package/dist/browser-prod/BaseButton.mjs.map +1 -1
  7. package/dist/browser-prod/BuyNowButton.mjs.map +1 -1
  8. package/dist/browser-prod/CartCheckoutButton.mjs.map +1 -1
  9. package/dist/node-dev/AddToCartButton.js.map +1 -1
  10. package/dist/node-dev/AddToCartButton.mjs.map +1 -1
  11. package/dist/node-dev/BaseButton.js.map +1 -1
  12. package/dist/node-dev/BaseButton.mjs.map +1 -1
  13. package/dist/node-dev/BuyNowButton.js.map +1 -1
  14. package/dist/node-dev/BuyNowButton.mjs.map +1 -1
  15. package/dist/node-dev/CartCheckoutButton.js.map +1 -1
  16. package/dist/node-dev/CartCheckoutButton.mjs.map +1 -1
  17. package/dist/node-prod/AddToCartButton.js.map +1 -1
  18. package/dist/node-prod/AddToCartButton.mjs.map +1 -1
  19. package/dist/node-prod/BaseButton.js.map +1 -1
  20. package/dist/node-prod/BaseButton.mjs.map +1 -1
  21. package/dist/node-prod/BuyNowButton.js.map +1 -1
  22. package/dist/node-prod/BuyNowButton.mjs.map +1 -1
  23. package/dist/node-prod/CartCheckoutButton.js.map +1 -1
  24. package/dist/node-prod/CartCheckoutButton.mjs.map +1 -1
  25. package/dist/types/AddToCartButton.d.ts +4 -1
  26. package/dist/types/BaseButton.d.ts +2 -2
  27. package/dist/types/BuyNowButton.d.ts +3 -1
  28. package/dist/types/CartCheckoutButton.d.ts +3 -1
  29. package/dist/types/analytics-types.d.ts +60 -11
  30. package/dist/umd/hydrogen-react.dev.js +2 -2
  31. package/dist/umd/hydrogen-react.dev.js.map +1 -1
  32. package/dist/umd/hydrogen-react.prod.js +8 -8
  33. package/dist/umd/hydrogen-react.prod.js.map +1 -1
  34. package/package.json +1 -1
@@ -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;
@@ -2319,7 +2319,7 @@
2319
2319
  }
2320
2320
  ]);
2321
2321
  }, [linesAdd, quantity, variantId, attributes, sellingPlanId]);
2322
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
2322
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
2323
2323
  BaseButton,
2324
2324
  {
2325
2325
  ...passthroughProps,
@@ -2328,7 +2328,7 @@
2328
2328
  defaultOnClick: handleAddItem
2329
2329
  },
2330
2330
  children
2331
- ), accessibleAddingToCartLabel ? /* @__PURE__ */ React.createElement(
2331
+ ), accessibleAddingToCartLabel ? /* @__PURE__ */ React__namespace.createElement(
2332
2332
  "p",
2333
2333
  {
2334
2334
  style: {