@inappstory/slide-api 0.1.38 → 0.1.40
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 +36 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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"
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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();
|
|
@@ -17799,8 +17817,19 @@ class WidgetCopy extends WidgetBase {
|
|
|
17799
17817
|
}
|
|
17800
17818
|
onStart() {
|
|
17801
17819
|
super.onStart();
|
|
17802
|
-
|
|
17803
|
-
|
|
17820
|
+
/**
|
|
17821
|
+
* Prevent showing resultLayer on SlideStart when widget has animation
|
|
17822
|
+
* Clean up all possible animation classes (.narrative-element-animation-fade-in-up, etc.)
|
|
17823
|
+
*/
|
|
17824
|
+
// TODO this is temporal workaround, in future - move animation on separated layer, prevent intersection with widget css properties
|
|
17825
|
+
this.resultLayer?.classList.remove("narrative-element-animation", "active", "animated");
|
|
17826
|
+
const toDelete = [];
|
|
17827
|
+
this.resultLayer?.classList.forEach(item => {
|
|
17828
|
+
if (item.includes("narrative-element-animation-")) {
|
|
17829
|
+
toDelete.push(item);
|
|
17830
|
+
}
|
|
17831
|
+
});
|
|
17832
|
+
this.resultLayer?.classList.remove(...toDelete);
|
|
17804
17833
|
if (this.isPromotionalCode) {
|
|
17805
17834
|
this.fetchPromoCode();
|
|
17806
17835
|
}
|
|
@@ -24333,7 +24362,7 @@ class WidgetReactions extends WidgetBase {
|
|
|
24333
24362
|
createReactionsModel() {
|
|
24334
24363
|
return {
|
|
24335
24364
|
icons: getTagData(this.element, "icons")?.split(",") ?? [],
|
|
24336
|
-
showAnimationAfterSelection:
|
|
24365
|
+
showAnimationAfterSelection: getTagData(this.element, "showAnimationAfterSelection") === "true",
|
|
24337
24366
|
resultDisplayMode: getTagData(this.element, "resultDisplayMode"),
|
|
24338
24367
|
resultDisplayFormat: getTagData(this.element, "resultDisplayFormat"),
|
|
24339
24368
|
};
|