@bigbinary/neeto-site-blocks 1.16.10 → 1.16.12

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
@@ -14568,13 +14568,14 @@ var _excluded$e = ["configurations", "className", "id", "image"];
14568
14568
  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; }
14569
14569
  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__default["default"](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; }
14570
14570
  var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14571
+ var _configurations$prope, _features, _features2, _features3, _features4, _features5;
14571
14572
  var configurations = _ref.configurations,
14572
14573
  _ref$className = _ref.className,
14573
14574
  className = _ref$className === void 0 ? "" : _ref$className,
14574
14575
  id = _ref.id,
14575
14576
  image = _ref.image,
14576
14577
  otherProps = _objectWithoutProperties__default["default"](_ref, _excluded$e);
14577
- var _useState = React.useState(configurations.properties.features[0].id),
14578
+ var _useState = React.useState(((_configurations$prope = configurations.properties.features[0]) === null || _configurations$prope === void 0 ? void 0 : _configurations$prope.position) || 1),
14578
14579
  _useState2 = _slicedToArray__default["default"](_useState, 2),
14579
14580
  selectedTabId = _useState2[0],
14580
14581
  setSelectedTabId = _useState2[1];
@@ -14622,6 +14623,15 @@ var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14622
14623
  return clearInterval(id);
14623
14624
  };
14624
14625
  }, [selectedTabId]);
14626
+ React.useEffect(function () {
14627
+ var tabExists = neetoCist.existsBy({
14628
+ position: selectedTabId
14629
+ }, features);
14630
+ if (!tabExists && neetoCist.isNotEmpty(features)) {
14631
+ clearInterval(intervalId);
14632
+ setSelectedTabId(features[0].position);
14633
+ }
14634
+ }, [features.length]);
14625
14635
  var imageBaseClasses = classnames__default["default"]("col-span-12 flex justify-center", {
14626
14636
  "lg:col-start-7": contentPosition === POSITIONS.LEFT.label,
14627
14637
  "lg:col-span-6": contentPosition === POSITIONS.RIGHT.label
@@ -14655,13 +14665,13 @@ var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14655
14665
  children: description
14656
14666
  })), features.map(function (_ref2, index) {
14657
14667
  var featureTitle = _ref2.title,
14658
- id = _ref2.id;
14668
+ position = _ref2.position;
14659
14669
  return /*#__PURE__*/React.createElement(MotionWrapper, {
14660
14670
  enableAnimation: enableAnimation,
14661
14671
  className: "relative cursor-pointer",
14662
14672
  key: getUniqueKey(featureTitle, index),
14663
14673
  onClick: function onClick() {
14664
- return handleTabClick(id);
14674
+ return handleTabClick(position);
14665
14675
  }
14666
14676
  }, /*#__PURE__*/jsxRuntime.jsx(Typography$1, _objectSpread$e(_objectSpread$e({
14667
14677
  index: index,
@@ -14677,7 +14687,7 @@ var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14677
14687
  backgroundColor: "#E6E6E6",
14678
14688
  height: "1px"
14679
14689
  },
14680
- children: selectedTabId === id && /*#__PURE__*/jsxRuntime.jsx(StyledWrapper, {
14690
+ children: selectedTabId === position && /*#__PURE__*/jsxRuntime.jsx(StyledWrapper, {
14681
14691
  className: "h-full rounded-xl transition-all duration-300 ease-in-out",
14682
14692
  design: {
14683
14693
  width: "0%",
@@ -14691,16 +14701,16 @@ var FeatureWithProgressBar = function FeatureWithProgressBar(_ref) {
14691
14701
  className: imageBaseClasses,
14692
14702
  children: /*#__PURE__*/jsxRuntime.jsx(Media, {
14693
14703
  image: image,
14694
- alt: features[selectedTabId - 1].media.alt,
14695
- autoPlay: features[selectedTabId - 1].media.autoPlay,
14704
+ alt: (_features = features[selectedTabId - 1]) === null || _features === void 0 ? void 0 : _features.media.alt,
14705
+ autoPlay: (_features2 = features[selectedTabId - 1]) === null || _features2 === void 0 ? void 0 : _features2.media.autoPlay,
14696
14706
  design: design.media,
14697
14707
  disableButtonAndLinks: otherProps.disableButtonAndLinks,
14698
14708
  id: "feature-with-progress-bar-".concat(selectedTabId - 1, "-media"),
14699
14709
  index: selectedTabId - 1,
14700
14710
  isAddNewPane: otherProps.isAddNewPane,
14701
- isEmbedded: features[selectedTabId - 1].media.isEmbedded,
14702
- src: features[selectedTabId - 1].media.src,
14703
- videoUrl: features[selectedTabId - 1].media.videoUrl,
14711
+ isEmbedded: (_features3 = features[selectedTabId - 1]) === null || _features3 === void 0 ? void 0 : _features3.media.isEmbedded,
14712
+ src: (_features4 = features[selectedTabId - 1]) === null || _features4 === void 0 ? void 0 : _features4.media.src,
14713
+ videoUrl: (_features5 = features[selectedTabId - 1]) === null || _features5 === void 0 ? void 0 : _features5.media.videoUrl,
14704
14714
  wrapperClassName: "h-full w-full"
14705
14715
  })
14706
14716
  })]