@shopify/hydrogen 2025.7.2 → 2025.7.3

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.
@@ -605,7 +605,7 @@ function getPrivacyBanner() {
605
605
  }
606
606
 
607
607
  // package.json
608
- var version = "2025.7.2";
608
+ var version = "2025.7.3";
609
609
 
610
610
  // src/analytics-manager/ShopifyAnalytics.tsx
611
611
  function getCustomerPrivacyRequired() {
@@ -1998,7 +1998,7 @@ function generateUUID() {
1998
1998
  }
1999
1999
 
2000
2000
  // src/version.ts
2001
- var LIB_VERSION = "2025.7.2";
2001
+ var LIB_VERSION = "2025.7.3";
2002
2002
 
2003
2003
  // src/utils/graphql.ts
2004
2004
  function minifyQuery(string) {
@@ -4030,12 +4030,13 @@ function createCustomerAccountClient({
4030
4030
  );
4031
4031
  loginUrl.searchParams.append("state", state);
4032
4032
  loginUrl.searchParams.append("nonce", nonce);
4033
- const uiLocales = getMaybeUILocales({
4033
+ const locale = getMaybeLocale({
4034
4034
  contextLanguage: language ?? null,
4035
+ localeOverride: options?.locale ?? null,
4035
4036
  uiLocalesOverride: options?.uiLocales ?? null
4036
4037
  });
4037
- if (uiLocales != null) {
4038
- loginUrl.searchParams.append("ui_locales", uiLocales);
4038
+ if (locale != null) {
4039
+ loginUrl.searchParams.append("locale", locale);
4039
4040
  }
4040
4041
  if (options?.countryCode) {
4041
4042
  loginUrl.searchParams.append("region_country", options.countryCode);
@@ -4045,6 +4046,12 @@ function createCustomerAccountClient({
4045
4046
  }
4046
4047
  if (options?.loginHint) {
4047
4048
  loginUrl.searchParams.append("login_hint", options.loginHint);
4049
+ if (options?.loginHintMode) {
4050
+ loginUrl.searchParams.append(
4051
+ "login_hint_mode",
4052
+ options.loginHintMode
4053
+ );
4054
+ }
4048
4055
  }
4049
4056
  const verifier = generateCodeVerifier();
4050
4057
  const challenge = await generateCodeChallenge(verifier);
@@ -4228,32 +4235,28 @@ function createIfInvalidCredentialThrowError(getCustomerAccountUrl, customerAcco
4228
4235
  }
4229
4236
  };
4230
4237
  }
4231
- function getMaybeUILocales(params) {
4232
- const contextLocale = toMaybeLocaleString(params.contextLanguage ?? null);
4233
- const optionsLocale = toMaybeLocaleString(params.uiLocalesOverride);
4234
- return optionsLocale ?? contextLocale ?? null;
4235
- }
4236
- function toMaybeLocaleString(language) {
4237
- if (language == null) {
4238
- return null;
4238
+ function getMaybeLocale(params) {
4239
+ if (params.localeOverride != null) {
4240
+ return toLocaleString(params.localeOverride);
4241
+ }
4242
+ if (params.uiLocalesOverride != null) {
4243
+ return toLocaleString(params.uiLocalesOverride);
4239
4244
  }
4240
- const normalizedLanguage = maybeEnforceRegionalVariant(language);
4241
- const base = normalizedLanguage.toLowerCase().replaceAll("_", "-");
4245
+ if (params.contextLanguage != null) {
4246
+ return toLocaleString(params.contextLanguage);
4247
+ }
4248
+ return null;
4249
+ }
4250
+ function toLocaleString(language) {
4251
+ const base = language.toLowerCase().replaceAll("_", "-");
4242
4252
  const tokens = base.split("-");
4243
- const langToken = tokens.at(0) ?? null;
4244
- const regionToken = tokens.at(1) ?? null;
4253
+ const langToken = tokens[0];
4254
+ const regionToken = tokens[1];
4245
4255
  if (regionToken) {
4246
4256
  return `${langToken}-${regionToken.toUpperCase()}`;
4247
4257
  }
4248
4258
  return langToken;
4249
4259
  }
4250
- var regionalLanguageOverrides = {
4251
- PT: "PT_PT",
4252
- ZH: "ZH_CN"
4253
- };
4254
- function maybeEnforceRegionalVariant(language) {
4255
- return regionalLanguageOverrides[language] ?? language;
4256
- }
4257
4260
  function createHydrogenContext(options, additionalContext) {
4258
4261
  const {
4259
4262
  env,