@inappstory/slide-api 0.1.42 → 0.1.43
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 +38 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +38 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -521,6 +521,7 @@ declare class WidgetProductCarousel extends WidgetBase<WidgetProductCarouselOpti
|
|
|
521
521
|
private $carousel;
|
|
522
522
|
private $track;
|
|
523
523
|
private isTouchListenersInit;
|
|
524
|
+
private productsView;
|
|
524
525
|
constructor(element: HTMLElement, options: Partial<WidgetProductCarouselOptions>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps);
|
|
525
526
|
onRefreshUserData(localData: Record<string, any>): void;
|
|
526
527
|
onStart(): void;
|
|
@@ -549,6 +550,8 @@ declare class WidgetProductCarousel extends WidgetBase<WidgetProductCarouselOpti
|
|
|
549
550
|
private renderCardTitle;
|
|
550
551
|
private renderCardPrices;
|
|
551
552
|
private renderPurchaseButton;
|
|
553
|
+
private mountBottomSheet;
|
|
554
|
+
private createProductsView;
|
|
552
555
|
private withTimeout;
|
|
553
556
|
private addToCart;
|
|
554
557
|
private getBottomSheetParams;
|
|
@@ -1233,6 +1236,7 @@ declare global {
|
|
|
1233
1236
|
__sdkSupportFileAssetsProtocol: boolean;
|
|
1234
1237
|
__sdkSupportTimelineOnBeforeStart: boolean;
|
|
1235
1238
|
__sdkSupportCorrectPauseResumeLifecycle: boolean;
|
|
1239
|
+
__sdkSupportVerticalSwipeGestureControl: boolean;
|
|
1236
1240
|
_isSdkSupportProductCart: boolean;
|
|
1237
1241
|
_share(id: string, config: {
|
|
1238
1242
|
url?: string | null;
|
|
@@ -1411,6 +1415,7 @@ interface SDKApi {
|
|
|
1411
1415
|
getCardFonts(): Array<FontDTO>;
|
|
1412
1416
|
disableVerticalSwipeGesture(): void;
|
|
1413
1417
|
enableVerticalSwipeGesture(): void;
|
|
1418
|
+
isSdkSupportVerticalSwipeGestureControl(): boolean;
|
|
1414
1419
|
disableHorizontalSwipeGesture(): void;
|
|
1415
1420
|
enableHorizontalSwipeGesture(): void;
|
|
1416
1421
|
disableBackpress(): void;
|
|
@@ -1458,6 +1463,7 @@ interface ISlideApiDeps {
|
|
|
1458
1463
|
vibrate: SDKApi["vibrate"];
|
|
1459
1464
|
disableVerticalSwipeGesture: SDKApi["disableVerticalSwipeGesture"];
|
|
1460
1465
|
enableVerticalSwipeGesture: SDKApi["enableVerticalSwipeGesture"];
|
|
1466
|
+
isSdkSupportVerticalSwipeGestureControl: SDKApi["isSdkSupportVerticalSwipeGestureControl"];
|
|
1461
1467
|
disableBackpress: SDKApi["disableBackpress"];
|
|
1462
1468
|
enableBackpress: SDKApi["enableBackpress"];
|
|
1463
1469
|
sendApiRequest: SDKApi["sendApiRequest"];
|
package/dist/index.d.ts
CHANGED
|
@@ -521,6 +521,7 @@ declare class WidgetProductCarousel extends WidgetBase<WidgetProductCarouselOpti
|
|
|
521
521
|
private $carousel;
|
|
522
522
|
private $track;
|
|
523
523
|
private isTouchListenersInit;
|
|
524
|
+
private productsView;
|
|
524
525
|
constructor(element: HTMLElement, options: Partial<WidgetProductCarouselOptions>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps);
|
|
525
526
|
onRefreshUserData(localData: Record<string, any>): void;
|
|
526
527
|
onStart(): void;
|
|
@@ -549,6 +550,8 @@ declare class WidgetProductCarousel extends WidgetBase<WidgetProductCarouselOpti
|
|
|
549
550
|
private renderCardTitle;
|
|
550
551
|
private renderCardPrices;
|
|
551
552
|
private renderPurchaseButton;
|
|
553
|
+
private mountBottomSheet;
|
|
554
|
+
private createProductsView;
|
|
552
555
|
private withTimeout;
|
|
553
556
|
private addToCart;
|
|
554
557
|
private getBottomSheetParams;
|
|
@@ -1233,6 +1236,7 @@ declare global {
|
|
|
1233
1236
|
__sdkSupportFileAssetsProtocol: boolean;
|
|
1234
1237
|
__sdkSupportTimelineOnBeforeStart: boolean;
|
|
1235
1238
|
__sdkSupportCorrectPauseResumeLifecycle: boolean;
|
|
1239
|
+
__sdkSupportVerticalSwipeGestureControl: boolean;
|
|
1236
1240
|
_isSdkSupportProductCart: boolean;
|
|
1237
1241
|
_share(id: string, config: {
|
|
1238
1242
|
url?: string | null;
|
|
@@ -1411,6 +1415,7 @@ interface SDKApi {
|
|
|
1411
1415
|
getCardFonts(): Array<FontDTO>;
|
|
1412
1416
|
disableVerticalSwipeGesture(): void;
|
|
1413
1417
|
enableVerticalSwipeGesture(): void;
|
|
1418
|
+
isSdkSupportVerticalSwipeGestureControl(): boolean;
|
|
1414
1419
|
disableHorizontalSwipeGesture(): void;
|
|
1415
1420
|
enableHorizontalSwipeGesture(): void;
|
|
1416
1421
|
disableBackpress(): void;
|
|
@@ -1458,6 +1463,7 @@ interface ISlideApiDeps {
|
|
|
1458
1463
|
vibrate: SDKApi["vibrate"];
|
|
1459
1464
|
disableVerticalSwipeGesture: SDKApi["disableVerticalSwipeGesture"];
|
|
1460
1465
|
enableVerticalSwipeGesture: SDKApi["enableVerticalSwipeGesture"];
|
|
1466
|
+
isSdkSupportVerticalSwipeGestureControl: SDKApi["isSdkSupportVerticalSwipeGestureControl"];
|
|
1461
1467
|
disableBackpress: SDKApi["disableBackpress"];
|
|
1462
1468
|
enableBackpress: SDKApi["enableBackpress"];
|
|
1463
1469
|
sendApiRequest: SDKApi["sendApiRequest"];
|
package/dist/index.js
CHANGED
|
@@ -1200,6 +1200,9 @@ class EsModuleSdkApi {
|
|
|
1200
1200
|
isSdkSupportCorrectPauseResumeLifecycle() {
|
|
1201
1201
|
return true;
|
|
1202
1202
|
}
|
|
1203
|
+
isSdkSupportVerticalSwipeGestureControl() {
|
|
1204
|
+
return true;
|
|
1205
|
+
}
|
|
1203
1206
|
emitEvent(name, event) {
|
|
1204
1207
|
this.sdkBinding.onEvent(name, event);
|
|
1205
1208
|
}
|
|
@@ -3800,6 +3803,7 @@ class SlideTimeline {
|
|
|
3800
3803
|
if (this.isSDKSupportUpdateTimeline) {
|
|
3801
3804
|
this.timelineDisabledState = TimelineDisabledState.enabled;
|
|
3802
3805
|
this.timeSpent = 0;
|
|
3806
|
+
this.resumedAt = new Date().getTime();
|
|
3803
3807
|
this.updateTimeline("start" /* TIMELINE_ACTION.START */);
|
|
3804
3808
|
}
|
|
3805
3809
|
else {
|
|
@@ -5848,6 +5852,9 @@ class SlideApiDepsMultiSlideMode {
|
|
|
5848
5852
|
enableVerticalSwipeGesture() {
|
|
5849
5853
|
this.sdkApi.enableVerticalSwipeGesture();
|
|
5850
5854
|
}
|
|
5855
|
+
isSdkSupportVerticalSwipeGestureControl() {
|
|
5856
|
+
return this.sdkApi.isSdkSupportVerticalSwipeGestureControl();
|
|
5857
|
+
}
|
|
5851
5858
|
disableBackpress() {
|
|
5852
5859
|
this.sdkApi.disableBackpress();
|
|
5853
5860
|
}
|
|
@@ -6022,6 +6029,9 @@ class SlideApiDepsSingleSlideMode {
|
|
|
6022
6029
|
enableVerticalSwipeGesture() {
|
|
6023
6030
|
this.sdkApi.enableVerticalSwipeGesture();
|
|
6024
6031
|
}
|
|
6032
|
+
isSdkSupportVerticalSwipeGestureControl() {
|
|
6033
|
+
return this.sdkApi.isSdkSupportVerticalSwipeGestureControl();
|
|
6034
|
+
}
|
|
6025
6035
|
disableBackpress() {
|
|
6026
6036
|
this.sdkApi.disableBackpress();
|
|
6027
6037
|
}
|
|
@@ -20786,7 +20796,7 @@ class ProductDetailsBottomSheet extends RenderableComponent {
|
|
|
20786
20796
|
});
|
|
20787
20797
|
}
|
|
20788
20798
|
renderTemplate() {
|
|
20789
|
-
return
|
|
20799
|
+
return this.bottomSheet.render();
|
|
20790
20800
|
}
|
|
20791
20801
|
open(params) {
|
|
20792
20802
|
this.showProductDetails(params);
|
|
@@ -20864,7 +20874,7 @@ class ProductCheckoutBottomSheet extends RenderableComponent {
|
|
|
20864
20874
|
});
|
|
20865
20875
|
}
|
|
20866
20876
|
renderTemplate() {
|
|
20867
|
-
return
|
|
20877
|
+
return this.bottomSheet.render();
|
|
20868
20878
|
}
|
|
20869
20879
|
open() {
|
|
20870
20880
|
const productCheckout = this.factory.createProductCheckout(this.bottomSheet);
|
|
@@ -21641,6 +21651,7 @@ class WidgetProductCarousel extends WidgetBase {
|
|
|
21641
21651
|
$carousel = null;
|
|
21642
21652
|
$track = null;
|
|
21643
21653
|
isTouchListenersInit = false;
|
|
21654
|
+
productsView = null;
|
|
21644
21655
|
constructor(element, options, widgetCallbacks, widgetDeps) {
|
|
21645
21656
|
super(element, options, widgetCallbacks, widgetDeps);
|
|
21646
21657
|
this.captionView = this.element.querySelector(".narrative-element-text-lines");
|
|
@@ -21858,10 +21869,7 @@ class WidgetProductCarousel extends WidgetBase {
|
|
|
21858
21869
|
}
|
|
21859
21870
|
showProductDetails = ({ offer, card }) => {
|
|
21860
21871
|
const bs = new ProductDetailsBottomSheet(this.widgetDeps, this.getBottomSheetParams());
|
|
21861
|
-
|
|
21862
|
-
if (!bsNode)
|
|
21863
|
-
throw new BottomSheetMountingError();
|
|
21864
|
-
this.slide.appendChild(bsNode);
|
|
21872
|
+
this.mountBottomSheet(bs);
|
|
21865
21873
|
bs.open({ offer, isCartSupported: this.isCartSupported() });
|
|
21866
21874
|
this.isBottomSheetOpened = true;
|
|
21867
21875
|
this.disableHostUIInteraction();
|
|
@@ -21932,6 +21940,22 @@ class WidgetProductCarousel extends WidgetBase {
|
|
|
21932
21940
|
});
|
|
21933
21941
|
return button;
|
|
21934
21942
|
}
|
|
21943
|
+
mountBottomSheet(bs) {
|
|
21944
|
+
if (this.productsView)
|
|
21945
|
+
return;
|
|
21946
|
+
const bsNode = bs.render();
|
|
21947
|
+
if (!bsNode)
|
|
21948
|
+
throw new BottomSheetMountingError();
|
|
21949
|
+
this.productsView = this.createProductsView();
|
|
21950
|
+
this.productsView.appendChild(bsNode);
|
|
21951
|
+
this.slide.appendChild(this.productsView);
|
|
21952
|
+
}
|
|
21953
|
+
createProductsView() {
|
|
21954
|
+
const containerView = document.createElement("div");
|
|
21955
|
+
containerView.classList.add("ias-products-container-view");
|
|
21956
|
+
containerView.dir = this.layoutDirection;
|
|
21957
|
+
return containerView;
|
|
21958
|
+
}
|
|
21935
21959
|
async withTimeout(promise, timeout) {
|
|
21936
21960
|
await Promise.race([promise, new Promise((resolve, reject) => setTimeout(reject, timeout))]);
|
|
21937
21961
|
}
|
|
@@ -21947,10 +21971,7 @@ class WidgetProductCarousel extends WidgetBase {
|
|
|
21947
21971
|
offerId: offerDto.offerId,
|
|
21948
21972
|
quantity: 1,
|
|
21949
21973
|
}), ADD_TO_CART_TIMEOUT);
|
|
21950
|
-
|
|
21951
|
-
if (!bsNode)
|
|
21952
|
-
throw new BottomSheetMountingError();
|
|
21953
|
-
this.slide.appendChild(bsNode);
|
|
21974
|
+
this.mountBottomSheet(bs);
|
|
21954
21975
|
bs.open();
|
|
21955
21976
|
this.isBottomSheetOpened = true;
|
|
21956
21977
|
this.disableHostUIInteraction();
|
|
@@ -21988,6 +22009,10 @@ class WidgetProductCarousel extends WidgetBase {
|
|
|
21988
22009
|
}
|
|
21989
22010
|
this.isBottomSheetOpened = false;
|
|
21990
22011
|
this.enableHostUIInteraction();
|
|
22012
|
+
if (this.productsView) {
|
|
22013
|
+
this.slide.removeChild(this.productsView);
|
|
22014
|
+
this.productsView = null;
|
|
22015
|
+
}
|
|
21991
22016
|
},
|
|
21992
22017
|
};
|
|
21993
22018
|
}
|
|
@@ -26651,6 +26676,9 @@ class WidgetScratchCard extends WidgetBase {
|
|
|
26651
26676
|
this.widgetDeps.slideApiDeps.disableHorizontalSwipeGesture();
|
|
26652
26677
|
this.widgetDeps.slideApiDeps.disableVerticalSwipeGesture();
|
|
26653
26678
|
this._isClickCaptured = true;
|
|
26679
|
+
if (!this.widgetDeps.slideApiDeps.isSdkSupportVerticalSwipeGestureControl()) {
|
|
26680
|
+
this.scratchLayer?.startCompleteReveal();
|
|
26681
|
+
}
|
|
26654
26682
|
}
|
|
26655
26683
|
static api = {
|
|
26656
26684
|
widgetClassName: WidgetScratchCard.widgetClassName,
|