@bigbinary/neeto-site-blocks 1.16.9 → 1.16.11

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.js CHANGED
@@ -7,7 +7,7 @@ import { motion, AnimatePresence } from 'framer-motion';
7
7
  import { has, __, isEmpty, mergeRight, pickBy, identity, mergeAll, prop, dissoc, equals, mergeLeft, omit } from 'ramda';
8
8
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
9
9
  import React, { useState, useEffect, useSyncExternalStore, createElement as createElement$1, forwardRef, useRef, useLayoutEffect, createContext, Fragment } from 'react';
10
- import { isNotPresent, isPresent, isNotEmpty } from '@bigbinary/neeto-cist';
10
+ import { isNotPresent, isPresent, isNotEmpty, existsBy } from '@bigbinary/neeto-cist';
11
11
  import Frame, { useFrame } from 'react-frame-component';
12
12
  import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
13
13
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
@@ -5527,7 +5527,7 @@ var StyledWrapper = styled.div.attrs(function (props) {
5527
5527
  className: generateResponsiveStyles(props.design)
5528
5528
  };
5529
5529
  })(function (_ref) {
5530
- var _design$border, _design$borderTop, _design$borderTop2, _design$borderTop3, _design$borderBottom, _design$borderBottom2, _design$borderBottom3, _design$borderRight, _design$borderLeft, _design$border2;
5530
+ var _design$border, _design$borderTop, _design$borderTop2, _design$border2, _design$borderTop3, _design$borderBottom, _design$borderBottom2, _design$borderBottom3, _design$borderRight, _design$borderLeft, _design$border3;
5531
5531
  var _ref$design = _ref.design,
5532
5532
  design = _ref$design === void 0 ? {} : _ref$design,
5533
5533
  _ref$backgroundImage = _ref.backgroundImage,
@@ -5536,13 +5536,14 @@ var StyledWrapper = styled.div.attrs(function (props) {
5536
5536
  borderColor: (_design$border = design.border) === null || _design$border === void 0 ? void 0 : _design$border.borderColor,
5537
5537
  borderTopColor: (_design$borderTop = design.borderTop) === null || _design$borderTop === void 0 ? void 0 : _design$borderTop.borderColor,
5538
5538
  borderTopWidth: (_design$borderTop2 = design.borderTop) === null || _design$borderTop2 === void 0 ? void 0 : _design$borderTop2.borderWidth,
5539
+ borderStyle: (_design$border2 = design.border) === null || _design$border2 === void 0 ? void 0 : _design$border2.borderStyle,
5539
5540
  borderTopStyle: (_design$borderTop3 = design.borderTop) === null || _design$borderTop3 === void 0 ? void 0 : _design$borderTop3.borderStyle,
5540
5541
  borderBottomStyle: (_design$borderBottom = design.borderBottom) === null || _design$borderBottom === void 0 ? void 0 : _design$borderBottom.borderStyle,
5541
5542
  borderBottomWidth: (_design$borderBottom2 = design.borderBottom) === null || _design$borderBottom2 === void 0 ? void 0 : _design$borderBottom2.borderWidth,
5542
5543
  borderBottomColor: (_design$borderBottom3 = design.borderBottom) === null || _design$borderBottom3 === void 0 ? void 0 : _design$borderBottom3.borderColor,
5543
5544
  borderRightColor: (_design$borderRight = design.borderRight) === null || _design$borderRight === void 0 ? void 0 : _design$borderRight.borderColor,
5544
5545
  borderLeftColor: (_design$borderLeft = design.borderLeft) === null || _design$borderLeft === void 0 ? void 0 : _design$borderLeft.borderColor,
5545
- borderWidth: (_design$border2 = design.border) === null || _design$border2 === void 0 ? void 0 : _design$border2.borderWidth
5546
+ borderWidth: (_design$border3 = design.border) === null || _design$border3 === void 0 ? void 0 : _design$border3.borderWidth
5546
5547
  };
5547
5548
  var borderColorStyles = pickBy(identity, borderColors);
5548
5549
  var backgroundStyles = _objectSpread$G({
@@ -13042,6 +13043,7 @@ var CardsInGridView = function CardsInGridView(_ref) {
13042
13043
  isStart: true,
13043
13044
  Icon: ArrowLeft$1,
13044
13045
  className: "flex-shrink-0",
13046
+ design: design.navigationButtons,
13045
13047
  isActive: activeIndex > 0,
13046
13048
  onClick: function onClick() {
13047
13049
  var _swiperRef$current;
@@ -13081,6 +13083,7 @@ var CardsInGridView = function CardsInGridView(_ref) {
13081
13083
  }), isNavigationButtonEnabled && /*#__PURE__*/jsx(ArrowButton, {
13082
13084
  Icon: ArrowRight$1,
13083
13085
  className: "flex-shrink-0",
13086
+ design: design.navigationButtons,
13084
13087
  isActive: activeIndex < cards.length - 2,
13085
13088
  onClick: function onClick() {
13086
13089
  var _swiperRef$current2;
@@ -14546,13 +14549,14 @@ var _excluded$e = ["configurations", "className", "id", "image"];
14546
14549
  function ownKeys$e(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; }
14547
14550
  function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
14548
14551
  var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14552
+ var _features, _features2, _features3, _features4, _features5;
14549
14553
  var configurations = _ref.configurations,
14550
14554
  _ref$className = _ref.className,
14551
14555
  className = _ref$className === void 0 ? "" : _ref$className,
14552
14556
  id = _ref.id,
14553
14557
  image = _ref.image,
14554
14558
  otherProps = _objectWithoutProperties(_ref, _excluded$e);
14555
- var _useState = useState(configurations.properties.features[0].id),
14559
+ var _useState = useState(configurations.properties.features[0].position),
14556
14560
  _useState2 = _slicedToArray(_useState, 2),
14557
14561
  selectedTabId = _useState2[0],
14558
14562
  setSelectedTabId = _useState2[1];
@@ -14600,6 +14604,15 @@ var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14600
14604
  return clearInterval(id);
14601
14605
  };
14602
14606
  }, [selectedTabId]);
14607
+ useEffect(function () {
14608
+ var tabExists = existsBy({
14609
+ position: selectedTabId
14610
+ }, features);
14611
+ if (!tabExists && isNotEmpty(features)) {
14612
+ clearInterval(intervalId);
14613
+ setSelectedTabId(features[0].position);
14614
+ }
14615
+ }, [features.length]);
14603
14616
  var imageBaseClasses = classnames("col-span-12 flex justify-center", {
14604
14617
  "lg:col-start-7": contentPosition === POSITIONS.LEFT.label,
14605
14618
  "lg:col-span-6": contentPosition === POSITIONS.RIGHT.label
@@ -14633,13 +14646,13 @@ var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14633
14646
  children: description
14634
14647
  })), features.map(function (_ref2, index) {
14635
14648
  var featureTitle = _ref2.title,
14636
- id = _ref2.id;
14649
+ position = _ref2.position;
14637
14650
  return /*#__PURE__*/createElement$1(MotionWrapper, {
14638
14651
  enableAnimation: enableAnimation,
14639
14652
  className: "relative cursor-pointer",
14640
14653
  key: getUniqueKey(featureTitle, index),
14641
14654
  onClick: function onClick() {
14642
- return handleTabClick(id);
14655
+ return handleTabClick(position);
14643
14656
  }
14644
14657
  }, /*#__PURE__*/jsx(Typography$1, _objectSpread$e(_objectSpread$e({
14645
14658
  index: index,
@@ -14655,7 +14668,7 @@ var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14655
14668
  backgroundColor: "#E6E6E6",
14656
14669
  height: "1px"
14657
14670
  },
14658
- children: selectedTabId === id && /*#__PURE__*/jsx(StyledWrapper, {
14671
+ children: selectedTabId === position && /*#__PURE__*/jsx(StyledWrapper, {
14659
14672
  className: "h-full rounded-xl transition-all duration-300 ease-in-out",
14660
14673
  design: {
14661
14674
  width: "0%",
@@ -14669,16 +14682,16 @@ var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14669
14682
  className: imageBaseClasses,
14670
14683
  children: /*#__PURE__*/jsx(Media, {
14671
14684
  image: image,
14672
- alt: features[selectedTabId - 1].media.alt,
14673
- autoPlay: features[selectedTabId - 1].media.autoPlay,
14685
+ alt: (_features = features[selectedTabId - 1]) === null || _features === void 0 ? void 0 : _features.media.alt,
14686
+ autoPlay: (_features2 = features[selectedTabId - 1]) === null || _features2 === void 0 ? void 0 : _features2.media.autoPlay,
14674
14687
  design: design.media,
14675
14688
  disableButtonAndLinks: otherProps.disableButtonAndLinks,
14676
14689
  id: "feature-with-progress-bar-".concat(selectedTabId - 1, "-media"),
14677
14690
  index: selectedTabId - 1,
14678
14691
  isAddNewPane: otherProps.isAddNewPane,
14679
- isEmbedded: features[selectedTabId - 1].media.isEmbedded,
14680
- src: features[selectedTabId - 1].media.src,
14681
- videoUrl: features[selectedTabId - 1].media.videoUrl,
14692
+ isEmbedded: (_features3 = features[selectedTabId - 1]) === null || _features3 === void 0 ? void 0 : _features3.media.isEmbedded,
14693
+ src: (_features4 = features[selectedTabId - 1]) === null || _features4 === void 0 ? void 0 : _features4.media.src,
14694
+ videoUrl: (_features5 = features[selectedTabId - 1]) === null || _features5 === void 0 ? void 0 : _features5.media.videoUrl,
14682
14695
  wrapperClassName: "h-full w-full"
14683
14696
  })
14684
14697
  })]