@inappstory/slide-api 0.1.38 → 0.1.39

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 CHANGED
@@ -6383,7 +6383,7 @@ class Slider {
6383
6383
  timer.classList.add("cards-slider__timer--reverse-direction");
6384
6384
  }
6385
6385
  const timeline = document.createElement("div");
6386
- timeline.classList.add("cards-slider__timer_timeline", "touchable");
6386
+ timeline.classList.add("cards-slider__timer_timeline");
6387
6387
  const timelineFill = document.createElement("div");
6388
6388
  timelineFill.classList.add("cards-slider__timer_timeline-fill");
6389
6389
  timeline.append(timelineFill);
@@ -6549,6 +6549,8 @@ class Slider {
6549
6549
  }
6550
6550
  }
6551
6551
  async updateTimeline(slideIndex, action, currentTime, duration, showLoader, showError) {
6552
+ // Don't use <activeSlide> and <activeIndex>, as <slideIndex> may differ from <activeIndex>
6553
+ const slide = this.slides[slideIndex];
6552
6554
  switch (action) {
6553
6555
  case "before_start" /* TIMELINE_ACTION.BEFORE_START */: {
6554
6556
  // switch timeline to active slide and wait for start (wait VOD loading)
@@ -6580,7 +6582,7 @@ class Slider {
6580
6582
  // we must resume timer - for trigger done callback and hide Card (SingleSlideTimer business logic)
6581
6583
  }
6582
6584
  if (resumeTimer) {
6583
- this.activeSlide?.timer.resume(currentTime, duration);
6585
+ slide?.timer.resume(currentTime, duration);
6584
6586
  }
6585
6587
  break;
6586
6588
  }
@@ -6588,7 +6590,7 @@ class Slider {
6588
6590
  if (showLoader) {
6589
6591
  this.config.onSlideDataWaiting();
6590
6592
  }
6591
- this.activeSlide?.timer.pause();
6593
+ slide?.timer.pause();
6592
6594
  if (this.isSingleSlideTimerActive) {
6593
6595
  this.pausedAt = new Date().getTime();
6594
6596
  }
@@ -6600,7 +6602,7 @@ class Slider {
6600
6602
  if (showError) {
6601
6603
  this.config.onSlideDataError();
6602
6604
  }
6603
- this.activeSlide?.timer.stop();
6605
+ slide?.timer.stop();
6604
6606
  // todo нужен STOP когда вручную переключаем слайд на другой
6605
6607
  // console.log("TIMELINE_ACTION.STOP", { activeSlide: this.activeSlide, duration });
6606
6608
  break;
@@ -6675,6 +6677,22 @@ class CardApi {
6675
6677
  this._overlappingActionBarHeight = config.overlappingActionBarHeight ?? 0;
6676
6678
  this._separateUserAndAppPause = config.separateUserAndAppPause;
6677
6679
  this._useSdkCacheForMultislideMode = config.useSdkCacheForMultislideMode;
6680
+ let isSafari = false;
6681
+ if (this.config.sdkApi.isIOS) {
6682
+ isSafari = true;
6683
+ }
6684
+ else {
6685
+ if (navigator.vendor &&
6686
+ navigator.vendor.indexOf("Apple") > -1 &&
6687
+ navigator.userAgent &&
6688
+ navigator.userAgent.indexOf("CriOS") == -1 &&
6689
+ navigator.userAgent.indexOf("FxiOS") == -1) {
6690
+ isSafari = true;
6691
+ }
6692
+ }
6693
+ if (isSafari) {
6694
+ this.config.root.classList.add("_isSafari");
6695
+ }
6678
6696
  this.refreshSizes = proxy(this.refreshSizes, this);
6679
6697
  this.getSdkClientVariables = proxy(this.getSdkClientVariables, this);
6680
6698
  this.refreshSizes();
@@ -24335,7 +24353,7 @@ class WidgetReactions extends WidgetBase {
24335
24353
  createReactionsModel() {
24336
24354
  return {
24337
24355
  icons: getTagData(this.element, "icons")?.split(",") ?? [],
24338
- showAnimationAfterSelection: Boolean(getTagData(this.element, "showAnimationAfterSelection")),
24356
+ showAnimationAfterSelection: getTagData(this.element, "showAnimationAfterSelection") === "true",
24339
24357
  resultDisplayMode: getTagData(this.element, "resultDisplayMode"),
24340
24358
  resultDisplayFormat: getTagData(this.element, "resultDisplayFormat"),
24341
24359
  };