@bigbinary/neeto-site-blocks 1.1.0 → 1.1.2

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
@@ -15536,6 +15536,51 @@ var Typography = function Typography(_ref) {
15536
15536
  Typography.displayName = "Typography";
15537
15537
  var Typography$1 = withConditionalRender(Typography, prop("children"));
15538
15538
 
15539
+ var BlogContent = function BlogContent(_ref) {
15540
+ var configurations = _ref.configurations,
15541
+ _ref$className = _ref.className,
15542
+ className = _ref$className === void 0 ? "" : _ref$className,
15543
+ id = _ref.id;
15544
+ var properties = configurations.properties,
15545
+ design = configurations.design;
15546
+ var _properties$content = properties.content,
15547
+ title = _properties$content.title,
15548
+ description = _properties$content.description,
15549
+ content = _properties$content.content,
15550
+ enableAnimation = properties.enableAnimation,
15551
+ imageSrc = properties.image.src,
15552
+ src = properties.backgroundImage.src;
15553
+ var baseClasses = "grid grid-cols-12 items-center";
15554
+ var textClasses = "col-span-12 sm:col-span-8 sm:col-start-3 lg:col-span-6 lg:col-start-4";
15555
+ return /*#__PURE__*/React__default.createElement(BlockWrapper, {
15556
+ className: className,
15557
+ enableAnimation: enableAnimation,
15558
+ id: id,
15559
+ backgroundImage: mergeLeft({
15560
+ src: src
15561
+ }, design.backgroundImage),
15562
+ design: design.body,
15563
+ nestedClassName: baseClasses
15564
+ }, /*#__PURE__*/React__default.createElement(Typography$1, {
15565
+ isTitle: true,
15566
+ className: textClasses,
15567
+ component: "h1",
15568
+ style: design.title
15569
+ }, title), /*#__PURE__*/React__default.createElement(Typography$1, {
15570
+ isTitle: true,
15571
+ className: textClasses,
15572
+ style: design.description
15573
+ }, description), /*#__PURE__*/React__default.createElement("div", {
15574
+ className: "col-span-12 flex justify-center sm:col-span-8 sm:col-start-3"
15575
+ }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
15576
+ design: design.image,
15577
+ src: imageSrc
15578
+ })), /*#__PURE__*/React__default.createElement(Typography$1, {
15579
+ className: textClasses,
15580
+ style: design.content
15581
+ }, content));
15582
+ };
15583
+
15539
15584
  var CardsClassic = function CardsClassic(_ref) {
15540
15585
  var configurations = _ref.configurations,
15541
15586
  _ref$className = _ref.className,
@@ -15978,6 +16023,16 @@ function elementParents(el, selector) {
15978
16023
  }
15979
16024
  return parents;
15980
16025
  }
16026
+ function elementTransitionEnd(el, callback) {
16027
+ function fireCallBack(e) {
16028
+ if (e.target !== el) return;
16029
+ callback.call(el, e);
16030
+ el.removeEventListener('transitionend', fireCallBack);
16031
+ }
16032
+ if (callback) {
16033
+ el.addEventListener('transitionend', fireCallBack);
16034
+ }
16035
+ }
15981
16036
  function elementOuterSize(el, size, includeMargins) {
15982
16037
  const window = getWindow();
15983
16038
  if (includeMargins) {
@@ -39930,6 +39985,239 @@ function Thumb(_ref) {
39930
39985
  });
39931
39986
  }
39932
39987
 
39988
+ function freeMode(_ref) {
39989
+ let {
39990
+ swiper,
39991
+ extendParams,
39992
+ emit,
39993
+ once
39994
+ } = _ref;
39995
+ extendParams({
39996
+ freeMode: {
39997
+ enabled: false,
39998
+ momentum: true,
39999
+ momentumRatio: 1,
40000
+ momentumBounce: true,
40001
+ momentumBounceRatio: 1,
40002
+ momentumVelocityRatio: 1,
40003
+ sticky: false,
40004
+ minimumVelocity: 0.02
40005
+ }
40006
+ });
40007
+ function onTouchStart() {
40008
+ if (swiper.params.cssMode) return;
40009
+ const translate = swiper.getTranslate();
40010
+ swiper.setTranslate(translate);
40011
+ swiper.setTransition(0);
40012
+ swiper.touchEventsData.velocities.length = 0;
40013
+ swiper.freeMode.onTouchEnd({
40014
+ currentPos: swiper.rtl ? swiper.translate : -swiper.translate
40015
+ });
40016
+ }
40017
+ function onTouchMove() {
40018
+ if (swiper.params.cssMode) return;
40019
+ const {
40020
+ touchEventsData: data,
40021
+ touches
40022
+ } = swiper;
40023
+ // Velocity
40024
+ if (data.velocities.length === 0) {
40025
+ data.velocities.push({
40026
+ position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
40027
+ time: data.touchStartTime
40028
+ });
40029
+ }
40030
+ data.velocities.push({
40031
+ position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
40032
+ time: now()
40033
+ });
40034
+ }
40035
+ function onTouchEnd(_ref2) {
40036
+ let {
40037
+ currentPos
40038
+ } = _ref2;
40039
+ if (swiper.params.cssMode) return;
40040
+ const {
40041
+ params,
40042
+ wrapperEl,
40043
+ rtlTranslate: rtl,
40044
+ snapGrid,
40045
+ touchEventsData: data
40046
+ } = swiper;
40047
+ // Time diff
40048
+ const touchEndTime = now();
40049
+ const timeDiff = touchEndTime - data.touchStartTime;
40050
+ if (currentPos < -swiper.minTranslate()) {
40051
+ swiper.slideTo(swiper.activeIndex);
40052
+ return;
40053
+ }
40054
+ if (currentPos > -swiper.maxTranslate()) {
40055
+ if (swiper.slides.length < snapGrid.length) {
40056
+ swiper.slideTo(snapGrid.length - 1);
40057
+ } else {
40058
+ swiper.slideTo(swiper.slides.length - 1);
40059
+ }
40060
+ return;
40061
+ }
40062
+ if (params.freeMode.momentum) {
40063
+ if (data.velocities.length > 1) {
40064
+ const lastMoveEvent = data.velocities.pop();
40065
+ const velocityEvent = data.velocities.pop();
40066
+ const distance = lastMoveEvent.position - velocityEvent.position;
40067
+ const time = lastMoveEvent.time - velocityEvent.time;
40068
+ swiper.velocity = distance / time;
40069
+ swiper.velocity /= 2;
40070
+ if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) {
40071
+ swiper.velocity = 0;
40072
+ }
40073
+ // this implies that the user stopped moving a finger then released.
40074
+ // There would be no events with distance zero, so the last event is stale.
40075
+ if (time > 150 || now() - lastMoveEvent.time > 300) {
40076
+ swiper.velocity = 0;
40077
+ }
40078
+ } else {
40079
+ swiper.velocity = 0;
40080
+ }
40081
+ swiper.velocity *= params.freeMode.momentumVelocityRatio;
40082
+ data.velocities.length = 0;
40083
+ let momentumDuration = 1000 * params.freeMode.momentumRatio;
40084
+ const momentumDistance = swiper.velocity * momentumDuration;
40085
+ let newPosition = swiper.translate + momentumDistance;
40086
+ if (rtl) newPosition = -newPosition;
40087
+ let doBounce = false;
40088
+ let afterBouncePosition;
40089
+ const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio;
40090
+ let needsLoopFix;
40091
+ if (newPosition < swiper.maxTranslate()) {
40092
+ if (params.freeMode.momentumBounce) {
40093
+ if (newPosition + swiper.maxTranslate() < -bounceAmount) {
40094
+ newPosition = swiper.maxTranslate() - bounceAmount;
40095
+ }
40096
+ afterBouncePosition = swiper.maxTranslate();
40097
+ doBounce = true;
40098
+ data.allowMomentumBounce = true;
40099
+ } else {
40100
+ newPosition = swiper.maxTranslate();
40101
+ }
40102
+ if (params.loop && params.centeredSlides) needsLoopFix = true;
40103
+ } else if (newPosition > swiper.minTranslate()) {
40104
+ if (params.freeMode.momentumBounce) {
40105
+ if (newPosition - swiper.minTranslate() > bounceAmount) {
40106
+ newPosition = swiper.minTranslate() + bounceAmount;
40107
+ }
40108
+ afterBouncePosition = swiper.minTranslate();
40109
+ doBounce = true;
40110
+ data.allowMomentumBounce = true;
40111
+ } else {
40112
+ newPosition = swiper.minTranslate();
40113
+ }
40114
+ if (params.loop && params.centeredSlides) needsLoopFix = true;
40115
+ } else if (params.freeMode.sticky) {
40116
+ let nextSlide;
40117
+ for (let j = 0; j < snapGrid.length; j += 1) {
40118
+ if (snapGrid[j] > -newPosition) {
40119
+ nextSlide = j;
40120
+ break;
40121
+ }
40122
+ }
40123
+ if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
40124
+ newPosition = snapGrid[nextSlide];
40125
+ } else {
40126
+ newPosition = snapGrid[nextSlide - 1];
40127
+ }
40128
+ newPosition = -newPosition;
40129
+ }
40130
+ if (needsLoopFix) {
40131
+ once('transitionEnd', () => {
40132
+ swiper.loopFix();
40133
+ });
40134
+ }
40135
+ // Fix duration
40136
+ if (swiper.velocity !== 0) {
40137
+ if (rtl) {
40138
+ momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
40139
+ } else {
40140
+ momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
40141
+ }
40142
+ if (params.freeMode.sticky) {
40143
+ // If freeMode.sticky is active and the user ends a swipe with a slow-velocity
40144
+ // event, then durations can be 20+ seconds to slide one (or zero!) slides.
40145
+ // It's easy to see this when simulating touch with mouse events. To fix this,
40146
+ // limit single-slide swipes to the default slide duration. This also has the
40147
+ // nice side effect of matching slide speed if the user stopped moving before
40148
+ // lifting finger or mouse vs. moving slowly before lifting the finger/mouse.
40149
+ // For faster swipes, also apply limits (albeit higher ones).
40150
+ const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
40151
+ const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
40152
+ if (moveDistance < currentSlideSize) {
40153
+ momentumDuration = params.speed;
40154
+ } else if (moveDistance < 2 * currentSlideSize) {
40155
+ momentumDuration = params.speed * 1.5;
40156
+ } else {
40157
+ momentumDuration = params.speed * 2.5;
40158
+ }
40159
+ }
40160
+ } else if (params.freeMode.sticky) {
40161
+ swiper.slideToClosest();
40162
+ return;
40163
+ }
40164
+ if (params.freeMode.momentumBounce && doBounce) {
40165
+ swiper.updateProgress(afterBouncePosition);
40166
+ swiper.setTransition(momentumDuration);
40167
+ swiper.setTranslate(newPosition);
40168
+ swiper.transitionStart(true, swiper.swipeDirection);
40169
+ swiper.animating = true;
40170
+ elementTransitionEnd(wrapperEl, () => {
40171
+ if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;
40172
+ emit('momentumBounce');
40173
+ swiper.setTransition(params.speed);
40174
+ setTimeout(() => {
40175
+ swiper.setTranslate(afterBouncePosition);
40176
+ elementTransitionEnd(wrapperEl, () => {
40177
+ if (!swiper || swiper.destroyed) return;
40178
+ swiper.transitionEnd();
40179
+ });
40180
+ }, 0);
40181
+ });
40182
+ } else if (swiper.velocity) {
40183
+ emit('_freeModeNoMomentumRelease');
40184
+ swiper.updateProgress(newPosition);
40185
+ swiper.setTransition(momentumDuration);
40186
+ swiper.setTranslate(newPosition);
40187
+ swiper.transitionStart(true, swiper.swipeDirection);
40188
+ if (!swiper.animating) {
40189
+ swiper.animating = true;
40190
+ elementTransitionEnd(wrapperEl, () => {
40191
+ if (!swiper || swiper.destroyed) return;
40192
+ swiper.transitionEnd();
40193
+ });
40194
+ }
40195
+ } else {
40196
+ swiper.updateProgress(newPosition);
40197
+ }
40198
+ swiper.updateActiveIndex();
40199
+ swiper.updateSlidesClasses();
40200
+ } else if (params.freeMode.sticky) {
40201
+ swiper.slideToClosest();
40202
+ return;
40203
+ } else if (params.freeMode) {
40204
+ emit('_freeModeNoMomentumRelease');
40205
+ }
40206
+ if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) {
40207
+ swiper.updateProgress();
40208
+ swiper.updateActiveIndex();
40209
+ swiper.updateSlidesClasses();
40210
+ }
40211
+ }
40212
+ Object.assign(swiper, {
40213
+ freeMode: {
40214
+ onTouchStart,
40215
+ onTouchMove,
40216
+ onTouchEnd
40217
+ }
40218
+ });
40219
+ }
40220
+
39933
40221
  var GalleryClassic = function GalleryClassic(_ref) {
39934
40222
  var configurations = _ref.configurations,
39935
40223
  _ref$className = _ref.className,
@@ -40042,14 +40330,14 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
40042
40330
  src = properties.backgroundImage.src;
40043
40331
  var baseClasses = "grid grid-cols-12 items-center gap-y-8";
40044
40332
  return /*#__PURE__*/React__default.createElement(BlockWrapper, {
40333
+ className: className,
40334
+ enableAnimation: enableAnimation,
40335
+ id: id,
40045
40336
  as: "footer",
40046
40337
  backgroundImage: mergeLeft({
40047
40338
  src: src
40048
40339
  }, design.backgroundImage),
40049
- className: className,
40050
40340
  design: design.body,
40051
- enableAnimation: enableAnimation,
40052
- id: id,
40053
40341
  nestedClassName: baseClasses
40054
40342
  }, /*#__PURE__*/React__default.createElement("div", {
40055
40343
  className: "col-span-12 col-start-1 sm:col-span-6 sm:col-start-4"
@@ -40063,50 +40351,49 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
40063
40351
  }, description)), /*#__PURE__*/React__default.createElement("div", {
40064
40352
  className: "ns-gallery-with-sliding-images col-span-12 space-y-6 sm:col-span-10 sm:col-start-2"
40065
40353
  }, /*#__PURE__*/React__default.createElement(Swiper, {
40354
+ autoplay: {
40355
+ delay: 5000,
40356
+ disableOnInteraction: false
40357
+ },
40066
40358
  modules: [Thumb, Autoplay, Mousewheel, Pagination],
40359
+ mousewheel: {
40360
+ sensitivity: 0.5
40361
+ },
40067
40362
  pagination: !isThumbsView && {
40068
40363
  clickable: true
40069
40364
  },
40070
40365
  spaceBetween: 10,
40071
40366
  thumbs: {
40072
40367
  swiper: thumbsSwiper
40073
- },
40074
- autoplay: {
40075
- delay: 5000,
40076
- enabled: true,
40077
- disableOnInteraction: false
40078
- },
40079
- mouseWheel: {
40080
- sensitivity: 0.5,
40081
- enabled: true
40082
40368
  }
40083
40369
  }, images.map(function (_ref2, index) {
40084
40370
  var src = _ref2.src,
40085
40371
  alt = _ref2.alt,
40086
40372
  title = _ref2.title;
40087
40373
  return /*#__PURE__*/React__default.createElement(SwiperSlide, {
40374
+ className: "swiper__wrapper",
40088
40375
  key: getUniqueKey(src, title, index)
40089
40376
  }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
40090
40377
  alt: alt,
40091
- className: "sliding-image",
40092
40378
  src: src,
40093
- title: title
40379
+ title: title,
40380
+ className: "sliding-image"
40094
40381
  }));
40095
40382
  }))), /*#__PURE__*/React__default.createElement("div", {
40096
40383
  className: "ns-gallery-with-sliding-images sm:col-span-6 sm:col-start-4"
40097
40384
  }, isThumbsView && /*#__PURE__*/React__default.createElement(Swiper, {
40385
+ freeMode: true,
40098
40386
  watchSlidesProgress: true,
40099
40387
  className: "hidden sm:block",
40100
- modules: [Thumb, Pagination, Mousewheel],
40388
+ modules: [Thumb, Pagination, Mousewheel, freeMode],
40389
+ mousewheel: {
40390
+ sensitivity: 0.5
40391
+ },
40101
40392
  pagination: {
40102
40393
  clickable: true
40103
40394
  },
40104
40395
  slidesPerView: 4,
40105
40396
  spaceBetween: 12,
40106
- mouseWheel: {
40107
- sensitivity: 0.5,
40108
- enabled: true
40109
- },
40110
40397
  onSwiper: setThumbsSwiper
40111
40398
  }, images.map(function (_ref3, index) {
40112
40399
  var src = _ref3.src,
@@ -40117,9 +40404,9 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
40117
40404
  key: getUniqueKey(src, title, index)
40118
40405
  }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
40119
40406
  alt: alt,
40120
- className: "clickable-image",
40121
40407
  src: src,
40122
- title: title
40408
+ title: title,
40409
+ className: "clickable-image"
40123
40410
  }));
40124
40411
  }))));
40125
40412
  };
@@ -41031,5 +41318,5 @@ var index = /*#__PURE__*/Object.freeze({
41031
41318
  Outlined: OutlineIcons
41032
41319
  });
41033
41320
 
41034
- export { CardsClassic, CardsInGridView, CardsWithCustomizableGrid, CardsWithImage, CtaClassic, CtaWithEmailAction, CtaWithLogo, index$1 as DESIGN_OPTIONS, Embed, FaqWithHamburgerView as FaqWithAccordion, FeatureWithDetails, FeatureWithGrid, FeatureWithImage, FeatureWithJumboText, FeatureWithList, FeatureWithProgressBar, FooterClassic, FooterWithIcons, FooterWithLinks, GalleryClassic, GalleryWithAutoplay, HeaderWithButtons, HeaderWithIcons, HeaderWithLogoTitle, HeroWithCallToAction, HeroWithMultipleLayouts, index as Icons, LogoClouds, Paragraph, PricingInCardView, TestimonialWithSlider, TestimonialWithVerticalView };
41321
+ export { BlogContent, CardsClassic, CardsInGridView, CardsWithCustomizableGrid, CardsWithImage, CtaClassic, CtaWithEmailAction, CtaWithLogo, index$1 as DESIGN_OPTIONS, Embed, FaqWithHamburgerView as FaqWithAccordion, FeatureWithDetails, FeatureWithGrid, FeatureWithImage, FeatureWithJumboText, FeatureWithList, FeatureWithProgressBar, FooterClassic, FooterWithIcons, FooterWithLinks, GalleryClassic, GalleryWithAutoplay, HeaderWithButtons, HeaderWithIcons, HeaderWithLogoTitle, HeroWithCallToAction, HeroWithMultipleLayouts, index as Icons, LogoClouds, Paragraph, PricingInCardView, TestimonialWithSlider, TestimonialWithVerticalView };
41035
41322
  //# sourceMappingURL=index.js.map