@inappstory/slide-api 0.1.41 → 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.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;
@@ -1086,6 +1089,45 @@ declare class WidgetReactions extends WidgetBase<WidgetReactionsOptions> {
1086
1089
  };
1087
1090
  }
1088
1091
 
1092
+ type WidgetScratchCardOptions = WidgetOptionsBase;
1093
+
1094
+ declare class WidgetScratchCard extends WidgetBase<WidgetScratchCardOptions> {
1095
+ static DEFAULTS: WidgetScratchCardOptions;
1096
+ static widgetClassName: string;
1097
+ private scratchContainer;
1098
+ private scratchLayer;
1099
+ private localDataKeys;
1100
+ private readonly model;
1101
+ private _isClickCaptured;
1102
+ constructor(element: HTMLElement, options: Partial<WidgetScratchCardOptions>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps);
1103
+ get isClickCaptured(): boolean;
1104
+ onRefreshUserData(localData: Record<string, any>): void;
1105
+ isDone(): boolean;
1106
+ onStart(): void;
1107
+ onStop(): void;
1108
+ private init;
1109
+ private calcBrushSize;
1110
+ private handleResize;
1111
+ private mountScratchContainer;
1112
+ private renderScratchLayer;
1113
+ private getImage;
1114
+ private hideGeometry;
1115
+ private completeWidget;
1116
+ private disablePointerEventsOnGeometry;
1117
+ private sendStatEvent;
1118
+ private saveToLocalData;
1119
+ private handleMouseUp;
1120
+ private handleMouseDown;
1121
+ static api: {
1122
+ widgetClassName: string;
1123
+ onRefreshUserData: typeof WidgetBase.onRefreshUserData;
1124
+ init: (element: HTMLElement, localData: Record<string, any>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps) => void;
1125
+ onStart: (element: HTMLElement) => void;
1126
+ onStop: (element: HTMLElement) => void;
1127
+ isClickCaptured: (element: HTMLElement) => boolean;
1128
+ };
1129
+ }
1130
+
1089
1131
  interface ILayoutApi {
1090
1132
  get widgetCopyApi(): typeof WidgetCopy.api | undefined;
1091
1133
  get widgetBarcodeApi(): typeof WidgetBarcode.api | undefined;
@@ -1107,6 +1149,7 @@ interface ILayoutApi {
1107
1149
  get widgetTooltipApi(): typeof WidgetTooltip.api | undefined;
1108
1150
  get widgetTimerApi(): typeof WidgetTimer.api | undefined;
1109
1151
  get widgetReactionsApi(): typeof WidgetReactions.api | undefined;
1152
+ get widgetScratchCardApi(): typeof WidgetScratchCard.api | undefined;
1110
1153
  get VideoPlayer(): typeof Player | undefined;
1111
1154
  }
1112
1155
 
@@ -1193,6 +1236,7 @@ declare global {
1193
1236
  __sdkSupportFileAssetsProtocol: boolean;
1194
1237
  __sdkSupportTimelineOnBeforeStart: boolean;
1195
1238
  __sdkSupportCorrectPauseResumeLifecycle: boolean;
1239
+ __sdkSupportVerticalSwipeGestureControl: boolean;
1196
1240
  _isSdkSupportProductCart: boolean;
1197
1241
  _share(id: string, config: {
1198
1242
  url?: string | null;
@@ -1371,6 +1415,7 @@ interface SDKApi {
1371
1415
  getCardFonts(): Array<FontDTO>;
1372
1416
  disableVerticalSwipeGesture(): void;
1373
1417
  enableVerticalSwipeGesture(): void;
1418
+ isSdkSupportVerticalSwipeGestureControl(): boolean;
1374
1419
  disableHorizontalSwipeGesture(): void;
1375
1420
  enableHorizontalSwipeGesture(): void;
1376
1421
  disableBackpress(): void;
@@ -1418,6 +1463,7 @@ interface ISlideApiDeps {
1418
1463
  vibrate: SDKApi["vibrate"];
1419
1464
  disableVerticalSwipeGesture: SDKApi["disableVerticalSwipeGesture"];
1420
1465
  enableVerticalSwipeGesture: SDKApi["enableVerticalSwipeGesture"];
1466
+ isSdkSupportVerticalSwipeGestureControl: SDKApi["isSdkSupportVerticalSwipeGestureControl"];
1421
1467
  disableBackpress: SDKApi["disableBackpress"];
1422
1468
  enableBackpress: SDKApi["enableBackpress"];
1423
1469
  sendApiRequest: SDKApi["sendApiRequest"];
@@ -1476,7 +1522,8 @@ declare const enum Widgets {
1476
1522
  DateCountdown = "dateCountdown",
1477
1523
  Quest = "quest",
1478
1524
  Timer = "timer",
1479
- Reactions = "reactions"
1525
+ Reactions = "reactions",
1526
+ ScratchCard = "scratchCard"
1480
1527
  }
1481
1528
  interface WidgetsSharedDataMap {
1482
1529
  rangeSlider: WidgetRangeSliderSharedData;
@@ -2178,6 +2225,28 @@ declare class Slide {
2178
2225
  get disabledNavigation(): boolean;
2179
2226
  }
2180
2227
 
2228
+ declare class ScratchCard implements IElement {
2229
+ private readonly _elementNodeRef;
2230
+ private readonly _widgetApi;
2231
+ private readonly _widgetCallbacks;
2232
+ private readonly _widgetDeps;
2233
+ private static readonly _className;
2234
+ static className(): string;
2235
+ static isTypeOf(element: IElement): element is ScratchCard;
2236
+ constructor(_elementNodeRef: HTMLElement, _widgetApi: typeof WidgetScratchCard.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
2237
+ mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
2238
+ get nodeRef(): HTMLElement;
2239
+ init(localData: LocalData): Promise<boolean>;
2240
+ onPause(): void;
2241
+ onResume(): void;
2242
+ onStart(): void;
2243
+ onStop(): void;
2244
+ onBeforeUnmount(): Promise<void>;
2245
+ handleClick(): boolean;
2246
+ get isLayerForcePaused(): boolean;
2247
+ get isClickCaptured(): boolean;
2248
+ }
2249
+
2181
2250
  declare const enum ON_SLIDE_STOP_PREPARE_FOR_RESTART {
2182
2251
  UNKNOWN = 0,
2183
2252
  PREPARE = 1,
@@ -2225,6 +2294,7 @@ declare class Layer {
2225
2294
  get disabledNavigation(): boolean;
2226
2295
  get videoElement(): Video | null;
2227
2296
  get rangeSliderElement(): RangeSlider | null;
2297
+ get scratchCardElements(): ScratchCard[];
2228
2298
  get quizElement(): Quiz | null;
2229
2299
  get quizGroupedElement(): QuizGrouped | null;
2230
2300
  get questElement(): Quest | null;
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;
@@ -1086,6 +1089,45 @@ declare class WidgetReactions extends WidgetBase<WidgetReactionsOptions> {
1086
1089
  };
1087
1090
  }
1088
1091
 
1092
+ type WidgetScratchCardOptions = WidgetOptionsBase;
1093
+
1094
+ declare class WidgetScratchCard extends WidgetBase<WidgetScratchCardOptions> {
1095
+ static DEFAULTS: WidgetScratchCardOptions;
1096
+ static widgetClassName: string;
1097
+ private scratchContainer;
1098
+ private scratchLayer;
1099
+ private localDataKeys;
1100
+ private readonly model;
1101
+ private _isClickCaptured;
1102
+ constructor(element: HTMLElement, options: Partial<WidgetScratchCardOptions>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps);
1103
+ get isClickCaptured(): boolean;
1104
+ onRefreshUserData(localData: Record<string, any>): void;
1105
+ isDone(): boolean;
1106
+ onStart(): void;
1107
+ onStop(): void;
1108
+ private init;
1109
+ private calcBrushSize;
1110
+ private handleResize;
1111
+ private mountScratchContainer;
1112
+ private renderScratchLayer;
1113
+ private getImage;
1114
+ private hideGeometry;
1115
+ private completeWidget;
1116
+ private disablePointerEventsOnGeometry;
1117
+ private sendStatEvent;
1118
+ private saveToLocalData;
1119
+ private handleMouseUp;
1120
+ private handleMouseDown;
1121
+ static api: {
1122
+ widgetClassName: string;
1123
+ onRefreshUserData: typeof WidgetBase.onRefreshUserData;
1124
+ init: (element: HTMLElement, localData: Record<string, any>, widgetCallbacks: WidgetCallbacks, widgetDeps: WidgetDeps) => void;
1125
+ onStart: (element: HTMLElement) => void;
1126
+ onStop: (element: HTMLElement) => void;
1127
+ isClickCaptured: (element: HTMLElement) => boolean;
1128
+ };
1129
+ }
1130
+
1089
1131
  interface ILayoutApi {
1090
1132
  get widgetCopyApi(): typeof WidgetCopy.api | undefined;
1091
1133
  get widgetBarcodeApi(): typeof WidgetBarcode.api | undefined;
@@ -1107,6 +1149,7 @@ interface ILayoutApi {
1107
1149
  get widgetTooltipApi(): typeof WidgetTooltip.api | undefined;
1108
1150
  get widgetTimerApi(): typeof WidgetTimer.api | undefined;
1109
1151
  get widgetReactionsApi(): typeof WidgetReactions.api | undefined;
1152
+ get widgetScratchCardApi(): typeof WidgetScratchCard.api | undefined;
1110
1153
  get VideoPlayer(): typeof Player | undefined;
1111
1154
  }
1112
1155
 
@@ -1193,6 +1236,7 @@ declare global {
1193
1236
  __sdkSupportFileAssetsProtocol: boolean;
1194
1237
  __sdkSupportTimelineOnBeforeStart: boolean;
1195
1238
  __sdkSupportCorrectPauseResumeLifecycle: boolean;
1239
+ __sdkSupportVerticalSwipeGestureControl: boolean;
1196
1240
  _isSdkSupportProductCart: boolean;
1197
1241
  _share(id: string, config: {
1198
1242
  url?: string | null;
@@ -1371,6 +1415,7 @@ interface SDKApi {
1371
1415
  getCardFonts(): Array<FontDTO>;
1372
1416
  disableVerticalSwipeGesture(): void;
1373
1417
  enableVerticalSwipeGesture(): void;
1418
+ isSdkSupportVerticalSwipeGestureControl(): boolean;
1374
1419
  disableHorizontalSwipeGesture(): void;
1375
1420
  enableHorizontalSwipeGesture(): void;
1376
1421
  disableBackpress(): void;
@@ -1418,6 +1463,7 @@ interface ISlideApiDeps {
1418
1463
  vibrate: SDKApi["vibrate"];
1419
1464
  disableVerticalSwipeGesture: SDKApi["disableVerticalSwipeGesture"];
1420
1465
  enableVerticalSwipeGesture: SDKApi["enableVerticalSwipeGesture"];
1466
+ isSdkSupportVerticalSwipeGestureControl: SDKApi["isSdkSupportVerticalSwipeGestureControl"];
1421
1467
  disableBackpress: SDKApi["disableBackpress"];
1422
1468
  enableBackpress: SDKApi["enableBackpress"];
1423
1469
  sendApiRequest: SDKApi["sendApiRequest"];
@@ -1476,7 +1522,8 @@ declare const enum Widgets {
1476
1522
  DateCountdown = "dateCountdown",
1477
1523
  Quest = "quest",
1478
1524
  Timer = "timer",
1479
- Reactions = "reactions"
1525
+ Reactions = "reactions",
1526
+ ScratchCard = "scratchCard"
1480
1527
  }
1481
1528
  interface WidgetsSharedDataMap {
1482
1529
  rangeSlider: WidgetRangeSliderSharedData;
@@ -2178,6 +2225,28 @@ declare class Slide {
2178
2225
  get disabledNavigation(): boolean;
2179
2226
  }
2180
2227
 
2228
+ declare class ScratchCard implements IElement {
2229
+ private readonly _elementNodeRef;
2230
+ private readonly _widgetApi;
2231
+ private readonly _widgetCallbacks;
2232
+ private readonly _widgetDeps;
2233
+ private static readonly _className;
2234
+ static className(): string;
2235
+ static isTypeOf(element: IElement): element is ScratchCard;
2236
+ constructor(_elementNodeRef: HTMLElement, _widgetApi: typeof WidgetScratchCard.api, _widgetCallbacks: WidgetCallbacks, _widgetDeps: WidgetDeps);
2237
+ mediaElementsLoadingPromises: Array<Promise<HTMLImageElement | HTMLVideoElement>>;
2238
+ get nodeRef(): HTMLElement;
2239
+ init(localData: LocalData): Promise<boolean>;
2240
+ onPause(): void;
2241
+ onResume(): void;
2242
+ onStart(): void;
2243
+ onStop(): void;
2244
+ onBeforeUnmount(): Promise<void>;
2245
+ handleClick(): boolean;
2246
+ get isLayerForcePaused(): boolean;
2247
+ get isClickCaptured(): boolean;
2248
+ }
2249
+
2181
2250
  declare const enum ON_SLIDE_STOP_PREPARE_FOR_RESTART {
2182
2251
  UNKNOWN = 0,
2183
2252
  PREPARE = 1,
@@ -2225,6 +2294,7 @@ declare class Layer {
2225
2294
  get disabledNavigation(): boolean;
2226
2295
  get videoElement(): Video | null;
2227
2296
  get rangeSliderElement(): RangeSlider | null;
2297
+ get scratchCardElements(): ScratchCard[];
2228
2298
  get quizElement(): Quiz | null;
2229
2299
  get quizGroupedElement(): QuizGrouped | null;
2230
2300
  get questElement(): Quest | null;