@nuskin/nextgen-header 1.22.0 → 1.23.1

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.
@@ -100807,7 +100807,7 @@ var live_preview_utils_default = /*#__PURE__*/__webpack_require__.n(live_preview
100807
100807
  const utils_namespaceObject = require("@contentstack/utils");
100808
100808
  ;// ./src/utils/constants.js
100809
100809
  var HEADER_CONTENT_ENTRY_UID = "global_header";
100810
- var referenceFields = (/* unused pure expression or super */ null && (["top_navigation", "top_navigation.menu_items.menu_item", "top_navigation.menu_items.menu_item.sub_categories.category_section.items.product_category.category", "market_selector.regions.markets.languages"]));
100810
+ var referenceFields = (/* unused pure expression or super */ null && (["top_navigation", "top_navigation.menu_items.menu_item", "top_navigation.menu_items.menu_item.sub_categories.category_section.items.product_category.category", "market_selector.regions.markets.languages", "utility_links", "utility_links.loyalty_menu"]));
100811
100811
  var CONTENTSTACK_API_KEY = process.env.CONTENTSTACK_API_KEY;
100812
100812
  var CONTENTSTACK_DELIVERY_TOKEN = process.env.CONTENTSTACK_DELIVERY_TOKEN;
100813
100813
  var CONTENTSTACK_ENVIRONMENT = process.env.CONTENTSTACK_ENVIRONMENT;
@@ -101132,6 +101132,7 @@ Brand.defaultProps = {
101132
101132
  $: null
101133
101133
  };
101134
101134
  ;// ./src/components/brand/brand.helpers.js
101135
+ function brand_helpers_typeof(o) { "@babel/helpers - typeof"; return brand_helpers_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, brand_helpers_typeof(o); }
101135
101136
  function parseLogoData(logoData) {
101136
101137
  if (!logoData) {
101137
101138
  return {
@@ -101153,8 +101154,14 @@ function parseLogoData(logoData) {
101153
101154
  var logoUrl;
101154
101155
  if (header_logo) {
101155
101156
  try {
101156
- var parsed = JSON.parse(header_logo);
101157
- var imageArray = parsed === null || parsed === void 0 ? void 0 : parsed.image;
101157
+ var _parsed;
101158
+ var parsed;
101159
+ if (typeof header_logo === "string") {
101160
+ parsed = JSON.parse(header_logo);
101161
+ } else if (brand_helpers_typeof(header_logo) === "object") {
101162
+ parsed = header_logo;
101163
+ }
101164
+ var imageArray = (_parsed = parsed) === null || _parsed === void 0 ? void 0 : _parsed.image;
101158
101165
  if (Array.isArray(imageArray) && imageArray.length > 0) {
101159
101166
  var _firstImage$selected, _firstImage$files, _firstImage$files2;
101160
101167
  var firstImage = imageArray[0];
@@ -101174,21 +101181,31 @@ function parseLogoData(logoData) {
101174
101181
  };
101175
101182
  }
101176
101183
  ;// ./src/components/header/regions/HeaderLoyaltyRegion.jsx
101184
+ function HeaderLoyaltyRegion_typeof(o) { "@babel/helpers - typeof"; return HeaderLoyaltyRegion_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, HeaderLoyaltyRegion_typeof(o); }
101185
+ function HeaderLoyaltyRegion_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
101186
+ function HeaderLoyaltyRegion_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? HeaderLoyaltyRegion_ownKeys(Object(t), !0).forEach(function (r) { HeaderLoyaltyRegion_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : HeaderLoyaltyRegion_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
101187
+ function HeaderLoyaltyRegion_defineProperty(e, r, t) { return (r = HeaderLoyaltyRegion_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
101188
+ function HeaderLoyaltyRegion_toPropertyKey(t) { var i = HeaderLoyaltyRegion_toPrimitive(t, "string"); return "symbol" == HeaderLoyaltyRegion_typeof(i) ? i : i + ""; }
101189
+ function HeaderLoyaltyRegion_toPrimitive(t, r) { if ("object" != HeaderLoyaltyRegion_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != HeaderLoyaltyRegion_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
101177
101190
 
101178
101191
 
101179
101192
 
101180
101193
 
101181
101194
  function HeaderLoyaltyRegion(_ref) {
101195
+ var _data$$;
101182
101196
  var data = _ref.data;
101183
- return /*#__PURE__*/(0,jsx_runtime_.jsx)(UtilityButton, {
101197
+ return /*#__PURE__*/(0,jsx_runtime_.jsx)(UtilityButton, HeaderLoyaltyRegion_objectSpread(HeaderLoyaltyRegion_objectSpread({
101184
101198
  type: "button",
101185
- children: data.link_label
101186
- });
101199
+ href: data === null || data === void 0 ? void 0 : data.url
101200
+ }, data === null || data === void 0 || (_data$$ = data.$) === null || _data$$ === void 0 ? void 0 : _data$$.label), {}, {
101201
+ children: data === null || data === void 0 ? void 0 : data.label
101202
+ }));
101187
101203
  }
101188
101204
  HeaderLoyaltyRegion.propTypes = {
101189
101205
  data: external_prop_types_default().shape({
101190
- link_label: (external_prop_types_default()).string.isRequired,
101191
- href: (external_prop_types_default()).string
101206
+ label: (external_prop_types_default()).string.isRequired,
101207
+ url: (external_prop_types_default()).string,
101208
+ $: (external_prop_types_default()).object
101192
101209
  }).isRequired
101193
101210
  };
101194
101211
  ;// ./src/components/header/HeaderIcons.jsx
@@ -105094,7 +105111,7 @@ var DEFAULT_TOP_RIBBON_LINKS = [{
105094
105111
  ariaLabel: "Shop Gifts"
105095
105112
  }];
105096
105113
  function HeaderView(_ref) {
105097
- var _headerEntry$logo, _headerEntry$locale_s, _headerEntry$loyalty, _headerEntry$account, _headerEntry$cart, _headerEntry$search, _headerEntry$top_ribb, _headerEntry$navigati, _headerEntry$market_s, _ref2, _headerEntry$locale, _headerEntry$$;
105114
+ var _headerEntry$logo, _headerEntry$locale_s, _headerEntry$utility_, _headerEntry$utility_2, _headerEntry$account, _headerEntry$cart, _headerEntry$search, _headerEntry$top_ribb, _headerEntry$navigati, _headerEntry$market_s, _ref2, _headerEntry$locale, _headerEntry$$;
105098
105115
  var country = _ref.country,
105099
105116
  language = _ref.language,
105100
105117
  locale = _ref.locale,
@@ -105106,7 +105123,9 @@ function HeaderView(_ref) {
105106
105123
  var mobileMarketTriggerMountRef = (0,external_react_.useRef)(null);
105107
105124
  var logoData = parseLogoData((_headerEntry$logo = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.logo) !== null && _headerEntry$logo !== void 0 ? _headerEntry$logo : DEFAULT_LOGO);
105108
105125
  var localeData = (_headerEntry$locale_s = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.locale_selector) !== null && _headerEntry$locale_s !== void 0 ? _headerEntry$locale_s : DEFAULT_LOCALE;
105109
- var loyaltyData = (_headerEntry$loyalty = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.loyalty) !== null && _headerEntry$loyalty !== void 0 ? _headerEntry$loyalty : DEFAULT_LOYALTY;
105126
+ var loyaltyData = (_headerEntry$utility_ = headerEntry === null || headerEntry === void 0 || (_headerEntry$utility_2 = headerEntry.utility_links) === null || _headerEntry$utility_2 === void 0 || (_headerEntry$utility_2 = _headerEntry$utility_2.find(function (link) {
105127
+ return link === null || link === void 0 ? void 0 : link.loyalty_menu;
105128
+ })) === null || _headerEntry$utility_2 === void 0 || (_headerEntry$utility_2 = _headerEntry$utility_2.loyalty_menu) === null || _headerEntry$utility_2 === void 0 ? void 0 : _headerEntry$utility_2[0]) !== null && _headerEntry$utility_ !== void 0 ? _headerEntry$utility_ : DEFAULT_LOYALTY;
105110
105129
  var accountData = (_headerEntry$account = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.account) !== null && _headerEntry$account !== void 0 ? _headerEntry$account : DEFAULT_ACCOUNT;
105111
105130
  var cartData = (_headerEntry$cart = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.cart) !== null && _headerEntry$cart !== void 0 ? _headerEntry$cart : DEFAULT_CART;
105112
105131
  var searchData = (_headerEntry$search = headerEntry === null || headerEntry === void 0 ? void 0 : headerEntry.search) !== null && _headerEntry$search !== void 0 ? _headerEntry$search : DEFAULT_SEARCH;