@bigbinary/neeto-site-blocks 1.6.6 → 1.6.8

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/index.cjs.js CHANGED
@@ -4683,6 +4683,10 @@ var isEditorEmpty = function isEditorEmpty(htmlContent) {
4683
4683
  })) return false;
4684
4684
  return neetoCist.isNotPresent(htmlContent.replace(/<[^>]*>/g, ""));
4685
4685
  };
4686
+ var isLinkHighlighted = function isLinkHighlighted(to, currentPath) {
4687
+ if (!(to && currentPath)) return false;
4688
+ return currentPath.pathName === to && isEmpty(currentPath.hash) || currentPath.hash === to;
4689
+ };
4686
4690
 
4687
4691
  function ownKeys$a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4688
4692
  function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$a(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -41799,7 +41803,7 @@ var HeaderWithButtons = function HeaderWithButtons(_ref) {
41799
41803
  })
41800
41804
  }, properties.links.map(function (link, index) {
41801
41805
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
41802
- isHighlighted: link.to && currentPath === link.to,
41806
+ isHighlighted: isLinkHighlighted(link.to, currentPath),
41803
41807
  key: getUniqueKey(link.label, index),
41804
41808
  style: design.links
41805
41809
  }, link, otherProps));
@@ -41823,7 +41827,7 @@ var HeaderWithButtons = function HeaderWithButtons(_ref) {
41823
41827
  className: "fadeIn col-span-2 col-start-1 ml-2 mt-4 flex flex-col gap-y-6 lg:hidden"
41824
41828
  }, properties.links.map(function (button, index) {
41825
41829
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
41826
- isHighlighted: button.to && currentPath === button.to,
41830
+ isHighlighted: isLinkHighlighted(button.to, currentPath),
41827
41831
  key: getUniqueKey(button.to, button.label, index),
41828
41832
  style: (mergeRight(design.links), {
41829
41833
  fontSize: "1.25em",
@@ -41970,7 +41974,7 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
41970
41974
  className: "col-span-4 col-start-1 hidden items-center gap-6 lg:flex"
41971
41975
  }, properties.links.map(function (link, index) {
41972
41976
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
41973
- isHighlighted: link.to && currentPath === link.to,
41977
+ isHighlighted: isLinkHighlighted(link.to, currentPath),
41974
41978
  key: getUniqueKey(link.label, index),
41975
41979
  style: design.links
41976
41980
  }, link, otherProps));
@@ -42017,7 +42021,7 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
42017
42021
  }, properties.links.map(function (icon, index) {
42018
42022
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
42019
42023
  className: "w-full",
42020
- isHighlighted: icon.to && currentPath === icon.to,
42024
+ isHighlighted: isLinkHighlighted(icon.to, currentPath),
42021
42025
  key: getUniqueKey(icon.url, icon.label, index),
42022
42026
  setIsMenuOpen: setIsLinksOpen,
42023
42027
  style: (mergeRight(design.links), {
@@ -42097,7 +42101,7 @@ var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
42097
42101
  }, properties.links.map(function (link, index) {
42098
42102
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
42099
42103
  className: "hidden lg:inline",
42100
- isHighlighted: link.to && currentPath === link.to,
42104
+ isHighlighted: isLinkHighlighted(link.to, currentPath),
42101
42105
  key: getUniqueKey(link.label, link.to, index),
42102
42106
  style: design.links
42103
42107
  }, link, otherProps));
@@ -42126,7 +42130,7 @@ var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
42126
42130
  label: label,
42127
42131
  setIsMenuOpen: setIsMenuOpen,
42128
42132
  to: to,
42129
- isHighlighted: to && currentPath === to,
42133
+ isHighlighted: isLinkHighlighted(to, currentPath),
42130
42134
  key: getUniqueKey(to, label, index),
42131
42135
  style: (mergeRight(design.links), {
42132
42136
  fontSize: "1.25em",