@bigbinary/neeto-site-blocks 1.10.11 → 1.10.13

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
@@ -11,8 +11,8 @@ var _defineProperty$1 = require('@babel/runtime/helpers/defineProperty');
11
11
  var neetoCist = require('@bigbinary/neeto-cist');
12
12
  var ramda = require('ramda');
13
13
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
14
- var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
15
14
  var reactFrameComponent = require('react-frame-component');
15
+ var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
16
16
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
17
17
  var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
18
18
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
@@ -73,7 +73,7 @@ var ArrowButton = function ArrowButton(_ref) {
73
73
  }, /*#__PURE__*/React__default["default"].createElement(StyledIcon, {
74
74
  className: "rounded-full border p-1",
75
75
  fill: (design === null || design === void 0 ? void 0 : design.navigationActiveColor) || "#1F2433",
76
- size: 27
76
+ size: 25
77
77
  }));
78
78
  };
79
79
 
@@ -13952,6 +13952,8 @@ var useElementClick = function useElementClick(_ref) {
13952
13952
  index = _ref$index === void 0 ? undefined : _ref$index,
13953
13953
  _ref$isTitle = _ref.isTitle,
13954
13954
  isTitle = _ref$isTitle === void 0 ? false : _ref$isTitle;
13955
+ var _useFrame = reactFrameComponent.useFrame(),
13956
+ iframeDocument = _useFrame.document;
13955
13957
  var getScrollableParent = function getScrollableParent(element) {
13956
13958
  if (!element) return null;
13957
13959
  var isScrollable = function isScrollable(el) {
@@ -13981,11 +13983,24 @@ var useElementClick = function useElementClick(_ref) {
13981
13983
  };
13982
13984
  scrollableParent.scrollTo(scrollOptions);
13983
13985
  };
13986
+ var addHighlightClass = function addHighlightClass(id) {
13987
+ var previousHighlightedElement = iframeDocument === null || iframeDocument === void 0 ? void 0 : iframeDocument.querySelector(".persist-highlight");
13988
+ if (previousHighlightedElement) {
13989
+ previousHighlightedElement.classList.remove("persist-highlight");
13990
+ }
13991
+
13992
+ // Add the 'persist-highlight' class to the target element
13993
+ var targetElement = iframeDocument === null || iframeDocument === void 0 ? void 0 : iframeDocument.getElementById(id);
13994
+ if (targetElement) {
13995
+ targetElement.classList.add("persist-highlight");
13996
+ }
13997
+ };
13984
13998
 
13985
13999
  // This function is used as the click handler for "Link" and "Button" elements in the to highlight the element
13986
14000
  var handleClick = function handleClick(event) {
13987
14001
  event.preventDefault();
13988
14002
  if (!id) return;
14003
+ addHighlightClass(id);
13989
14004
  setTimeout(function () {
13990
14005
  var accordion = document.querySelector("[data-accordion-id=".concat(id === null || id === void 0 ? void 0 : id.replace(/-[^-]+$/, ""), "]"));
13991
14006
  var element = document.querySelector("[data-element-id=".concat(id, "]"));
@@ -14026,6 +14041,8 @@ var useElementClick = function useElementClick(_ref) {
14026
14041
 
14027
14042
  // This function is used as the click handler for "Typography" to highlight the element
14028
14043
  var handleTitleClick = function handleTitleClick() {
14044
+ if (!id) return;
14045
+ addHighlightClass(id);
14029
14046
  setTimeout(function () {
14030
14047
  if (!document) return;
14031
14048
  var accordion = document.querySelector("[data-accordion-id=".concat(id === null || id === void 0 ? void 0 : id.replace(/-[^-]+$/, ""), "]"));
@@ -14075,7 +14092,9 @@ var useElementClick = function useElementClick(_ref) {
14075
14092
 
14076
14093
  // This function is used as the click handler for "Image" elements to highlight the element`
14077
14094
  var handleImageClick = function handleImageClick(event) {
14095
+ if (!id) return;
14078
14096
  event.preventDefault();
14097
+ addHighlightClass(id);
14079
14098
  setTimeout(function () {
14080
14099
  if (neetoCist.isPresent(index)) {
14081
14100
  var accordion = document.querySelector("[data-accordion-id=".concat(id === null || id === void 0 ? void 0 : id.replace(/-[^-]+$/, ""), "]"));
@@ -14161,6 +14180,7 @@ var StyledImageWithWrapper = function StyledImageWithWrapper(_ref2) {
14161
14180
  }),
14162
14181
  handleImageClick = _useElementClick.handleImageClick;
14163
14182
  return /*#__PURE__*/React__default["default"].createElement(StyledWrapper, {
14183
+ id: id,
14164
14184
  className: classnames__default["default"]("flex justify-center", _defineProperty__default["default"]({
14165
14185
  "neeto-site-highlight__element": disableButtonAndLinks && !isAddNewPane
14166
14186
  }, wrapperClassName, wrapperClassName)),
@@ -15394,7 +15414,8 @@ var Button = function Button(_ref) {
15394
15414
  href: to !== null && to !== void 0 ? to : "",
15395
15415
  rel: "noreferrer",
15396
15416
  isButton: true,
15397
- onClick: disableButtonAndLinks && handleClick
15417
+ onClick: disableButtonAndLinks && handleClick,
15418
+ id: id
15398
15419
  };
15399
15420
  if (action === "external") {
15400
15421
  return /*#__PURE__*/React__default["default"].createElement(StyledAnchor, _extends__default["default"]({}, commonProps, {
@@ -15510,7 +15531,8 @@ var LinkElement = function LinkElement(_ref) {
15510
15531
  percentage: 0.1,
15511
15532
  isHighlighted: isHighlighted,
15512
15533
  disableHovering: disableHovering,
15513
- onClick: handleLinkClick
15534
+ onClick: handleLinkClick,
15535
+ id: id
15514
15536
  }, otherProps);
15515
15537
  if (action === "external") {
15516
15538
  return /*#__PURE__*/React__default["default"].createElement(StyledAnchor, _extends__default["default"]({}, commonProps, {
@@ -21153,13 +21175,14 @@ var CardsInGridView = function CardsInGridView(_ref) {
21153
21175
  }, title), /*#__PURE__*/React__default["default"].createElement(ArrowButton, {
21154
21176
  isStart: true,
21155
21177
  Icon: ArrowLeft$1,
21178
+ className: "flex-shrink-0",
21156
21179
  isActive: activeIndex > 0,
21157
21180
  onClick: function onClick() {
21158
21181
  var _swiperRef$current;
21159
21182
  return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
21160
21183
  }
21161
21184
  }), /*#__PURE__*/React__default["default"].createElement("div", {
21162
- className: "col-span-8 col-start-3 sm:col-span-10 sm:col-start-2"
21185
+ className: "col-span-10 col-start-2"
21163
21186
  }, /*#__PURE__*/React__default["default"].createElement(Swiper, {
21164
21187
  loop: true,
21165
21188
  breakpointsBase: "container",
@@ -21188,6 +21211,7 @@ var CardsInGridView = function CardsInGridView(_ref) {
21188
21211
  })));
21189
21212
  }))), /*#__PURE__*/React__default["default"].createElement(ArrowButton, {
21190
21213
  Icon: ArrowRight$1,
21214
+ className: "flex-shrink-0",
21191
21215
  isActive: activeIndex < cards.length - 2,
21192
21216
  onClick: function onClick() {
21193
21217
  var _swiperRef$current2;