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