@shopify/hydrogen 2026.1.3 → 2026.4.0
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/dist/customer-account-api-types.d.ts +23 -1
- package/dist/customer-account.schema.json +1 -1
- package/dist/development/index.cjs +135 -58
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +135 -58
- package/dist/development/index.js.map +1 -1
- package/dist/oxygen/index.d.ts +62 -9
- package/dist/oxygen/index.js +21 -30
- package/dist/production/index.cjs +52 -52
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.d.cts +126 -115
- package/dist/production/index.d.ts +126 -115
- package/dist/production/index.js +52 -52
- package/dist/production/index.js.map +1 -1
- package/dist/storefront-api-types.d.ts +1467 -443
- package/dist/storefront.schema.json +1 -1
- package/dist/vite/request-events.d.ts +61 -1
- package/package.json +6 -6
|
@@ -1,4 +1,62 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import { CountryCode, LanguageCode } from '@shopify/hydrogen-react/storefront-api-types';
|
|
3
|
+
|
|
4
|
+
type ConsentStatus = boolean | undefined;
|
|
5
|
+
type VisitorConsent = {
|
|
6
|
+
marketing: ConsentStatus;
|
|
7
|
+
analytics: ConsentStatus;
|
|
8
|
+
preferences: ConsentStatus;
|
|
9
|
+
sale_of_data: ConsentStatus;
|
|
10
|
+
};
|
|
11
|
+
type CustomerPrivacyConsentConfig = {
|
|
12
|
+
checkoutRootDomain: string;
|
|
13
|
+
storefrontRootDomain?: string;
|
|
14
|
+
storefrontAccessToken: string;
|
|
15
|
+
country?: CountryCode;
|
|
16
|
+
/** The privacyBanner refers to `language` as `locale` */
|
|
17
|
+
locale?: LanguageCode;
|
|
18
|
+
};
|
|
19
|
+
type SetConsentHeadlessParams = VisitorConsent & CustomerPrivacyConsentConfig & {
|
|
20
|
+
headlessStorefront?: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
Ideally this type should come from the Custoemr Privacy API sdk
|
|
24
|
+
analyticsProcessingAllowed -
|
|
25
|
+
currentVisitorConsent
|
|
26
|
+
doesMerchantSupportGranularConsent
|
|
27
|
+
firstPartyMarketingAllowed
|
|
28
|
+
getCCPAConsent
|
|
29
|
+
getTrackingConsent
|
|
30
|
+
marketingAllowed
|
|
31
|
+
preferencesProcessingAllowed
|
|
32
|
+
saleOfDataAllowed
|
|
33
|
+
saleOfDataRegion
|
|
34
|
+
setTrackingConsent
|
|
35
|
+
shouldShowBanner
|
|
36
|
+
shouldShowGDPRBanner
|
|
37
|
+
thirdPartyMarketingAllowed
|
|
38
|
+
**/
|
|
39
|
+
type OriginalCustomerPrivacy = {
|
|
40
|
+
currentVisitorConsent: () => VisitorConsent;
|
|
41
|
+
preferencesProcessingAllowed: () => boolean;
|
|
42
|
+
saleOfDataAllowed: () => boolean;
|
|
43
|
+
marketingAllowed: () => boolean;
|
|
44
|
+
analyticsProcessingAllowed: () => boolean;
|
|
45
|
+
setTrackingConsent: (consent: SetConsentHeadlessParams, callback: (data: {
|
|
46
|
+
error: string;
|
|
47
|
+
} | undefined) => void) => void;
|
|
48
|
+
shouldShowBanner: () => boolean;
|
|
49
|
+
};
|
|
50
|
+
type CustomerPrivacy = Omit<OriginalCustomerPrivacy, 'setTrackingConsent'> & {
|
|
51
|
+
setTrackingConsent: (consent: VisitorConsent, // we have already applied the headlessStorefront in the override
|
|
52
|
+
callback: (data: {
|
|
53
|
+
error: string;
|
|
54
|
+
} | undefined) => void) => void;
|
|
55
|
+
};
|
|
56
|
+
type PrivacyBanner = {
|
|
57
|
+
loadBanner: (options?: Partial<CustomerPrivacyConsentConfig>) => void;
|
|
58
|
+
showPreferences: (options?: Partial<CustomerPrivacyConsentConfig>) => void;
|
|
59
|
+
};
|
|
2
60
|
|
|
3
61
|
type WaitUntil = (promise: Promise<unknown>) => void;
|
|
4
62
|
|
|
@@ -6,7 +64,9 @@ declare global {
|
|
|
6
64
|
interface Window {
|
|
7
65
|
privacyBanner: PrivacyBanner;
|
|
8
66
|
Shopify: {
|
|
9
|
-
customerPrivacy
|
|
67
|
+
customerPrivacy?: Partial<CustomerPrivacy> & {
|
|
68
|
+
backendConsentEnabled?: boolean;
|
|
69
|
+
};
|
|
10
70
|
};
|
|
11
71
|
}
|
|
12
72
|
interface Document {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"@shopify:registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
7
7
|
"type": "module",
|
|
8
|
-
"version": "2026.
|
|
8
|
+
"version": "2026.4.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "dist/index.cjs",
|
|
11
11
|
"module": "dist/production/index.js",
|
|
@@ -80,21 +80,21 @@
|
|
|
80
80
|
"use-resize-observer": "^9.1.0",
|
|
81
81
|
"worktop": "^0.7.3",
|
|
82
82
|
"@shopify/graphql-client": "1.4.1",
|
|
83
|
-
"@shopify/hydrogen-react": "2026.
|
|
83
|
+
"@shopify/hydrogen-react": "2026.4.0"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"react-router": "7.12.0",
|
|
87
87
|
"@react-router/dev": "7.12.0",
|
|
88
88
|
"@shopify/generate-docs": "0.16.4",
|
|
89
89
|
"@testing-library/jest-dom": "^6.6.3",
|
|
90
|
-
"@types/node": "
|
|
90
|
+
"@types/node": "22.19.15",
|
|
91
91
|
"@types/react": "^18.3.28",
|
|
92
92
|
"@types/react-dom": "^18.3.7",
|
|
93
93
|
"@testing-library/react": "^14.0.0",
|
|
94
94
|
"@types/source-map-support": "^0.5.10",
|
|
95
95
|
"formdata-polyfill": "^4.0.10",
|
|
96
96
|
"graphql": "^16.12.0",
|
|
97
|
-
"happy-dom": "^20.
|
|
97
|
+
"happy-dom": "^20.8.9",
|
|
98
98
|
"react": "^18.3.1",
|
|
99
99
|
"react-dom": "^18.3.1",
|
|
100
100
|
"schema-dts": "^1.1.2",
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"@shopify/hydrogen-codegen": "0.3.3"
|
|
103
103
|
},
|
|
104
104
|
"peerDependencies": {
|
|
105
|
-
"react-router": "7.12.0",
|
|
106
|
-
"@react-router/dev": "7.12.0",
|
|
105
|
+
"react-router": "^7.12.0",
|
|
106
|
+
"@react-router/dev": "^7.12.0",
|
|
107
107
|
"react": "^18.3.1 || ~19.0.3 || ~19.1.4 || ^19.2.3",
|
|
108
108
|
"vite": "^5.1.0 || ^6.2.1"
|
|
109
109
|
},
|