@inappstory/slide-api 0.1.23 → 0.1.24
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 +131 -476
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -14
- package/dist/index.d.ts +39 -14
- package/dist/index.js +131 -476
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Player } from '@inappstory/video-player';
|
|
2
2
|
|
|
3
3
|
interface IAnimation {
|
|
4
|
+
init(slide: HTMLElement, animate?: boolean): void;
|
|
4
5
|
start(slide: HTMLElement, animate?: boolean): void | ((isStop: boolean) => () => void);
|
|
5
6
|
stop(slide: HTMLElement, animate?: boolean): void;
|
|
6
7
|
pause(slide: HTMLElement): void;
|
|
@@ -1889,21 +1890,34 @@ declare class Layer {
|
|
|
1889
1890
|
get isLayerForcePaused(): boolean;
|
|
1890
1891
|
}
|
|
1891
1892
|
|
|
1893
|
+
declare const enum STATE {
|
|
1894
|
+
INIT = 0,
|
|
1895
|
+
INITED = 1,
|
|
1896
|
+
START = 2,
|
|
1897
|
+
STARTED = 3,
|
|
1898
|
+
RESUME = 4,
|
|
1899
|
+
RESUMED = 5,
|
|
1900
|
+
APP_PAUSE = 6,
|
|
1901
|
+
APP_PAUSED = 7,
|
|
1902
|
+
USER_PAUSE = 8,
|
|
1903
|
+
USER_PAUSED = 9,
|
|
1904
|
+
FORCE_PAUSED = 10,
|
|
1905
|
+
STOP = 11,
|
|
1906
|
+
STOPPED = 12,
|
|
1907
|
+
DESTROYED = 13
|
|
1908
|
+
}
|
|
1892
1909
|
declare class SlideApi$1 {
|
|
1893
1910
|
private readonly config;
|
|
1894
1911
|
get layoutDirection(): "ltr" | "rtl";
|
|
1895
1912
|
private static renderedBoxClassName;
|
|
1896
1913
|
private static prerenderBoxClassName;
|
|
1897
|
-
private readonly
|
|
1914
|
+
private readonly _slideWrapper;
|
|
1898
1915
|
private readonly _viewport;
|
|
1899
1916
|
private readonly _getViewportWidth;
|
|
1900
1917
|
private readonly _getViewportHeight;
|
|
1901
1918
|
private readonly _overlappingActionBarHeight;
|
|
1902
1919
|
private readonly _separateUserAndAppPause;
|
|
1903
1920
|
readonly sdkApi: SDKApi;
|
|
1904
|
-
private activeCard;
|
|
1905
|
-
private cards;
|
|
1906
|
-
private multiCardsMode;
|
|
1907
1921
|
constructor(config: {
|
|
1908
1922
|
sdkApi: SDKApi;
|
|
1909
1923
|
slideWrapper: HTMLElement;
|
|
@@ -1925,10 +1939,7 @@ declare class SlideApi$1 {
|
|
|
1925
1939
|
getViewportHeight: () => number;
|
|
1926
1940
|
overlappingActionBarHeight?: number;
|
|
1927
1941
|
separateUserAndAppPause: boolean;
|
|
1928
|
-
root: HTMLElement;
|
|
1929
|
-
nonce?: string;
|
|
1930
1942
|
});
|
|
1931
|
-
get state(): number;
|
|
1932
1943
|
destroy(): Promise<void>;
|
|
1933
1944
|
private initListeners;
|
|
1934
1945
|
private destroyListeners;
|
|
@@ -1941,16 +1952,22 @@ declare class SlideApi$1 {
|
|
|
1941
1952
|
result: boolean;
|
|
1942
1953
|
reason?: string;
|
|
1943
1954
|
}>;
|
|
1944
|
-
private cardsSlider;
|
|
1945
|
-
showSlides(cards: Array<string>, cardAppearance: Record<string, any>): Promise<{
|
|
1946
|
-
cardId: number;
|
|
1947
|
-
slideIndex: number;
|
|
1948
|
-
result: boolean;
|
|
1949
|
-
reason?: string;
|
|
1950
|
-
}>;
|
|
1951
1955
|
handleBackpress(): void;
|
|
1952
1956
|
private get layoutService();
|
|
1953
1957
|
private getLocalData;
|
|
1958
|
+
private _fontsInit;
|
|
1959
|
+
private _initAndLoadFonts;
|
|
1960
|
+
private _slide;
|
|
1961
|
+
private _slideInInit;
|
|
1962
|
+
private _state;
|
|
1963
|
+
private _afterStartInitQueue;
|
|
1964
|
+
private _afterAppResumeQueue;
|
|
1965
|
+
get state(): STATE;
|
|
1966
|
+
private _onAllMediaLoaded;
|
|
1967
|
+
private _init;
|
|
1968
|
+
private _slideInRender;
|
|
1969
|
+
private _slideBoxRenderComplete;
|
|
1970
|
+
private _slideConfig;
|
|
1954
1971
|
slideStart(config: {
|
|
1955
1972
|
muted?: boolean;
|
|
1956
1973
|
}): Promise<{
|
|
@@ -1961,6 +1978,7 @@ declare class SlideApi$1 {
|
|
|
1961
1978
|
}): Promise<{
|
|
1962
1979
|
currentTime: number;
|
|
1963
1980
|
}>;
|
|
1981
|
+
private _pauseCbTimer;
|
|
1964
1982
|
slideUserPause(): Promise<void>;
|
|
1965
1983
|
slideUserResume(): Promise<void>;
|
|
1966
1984
|
/**
|
|
@@ -1975,6 +1993,8 @@ declare class SlideApi$1 {
|
|
|
1975
1993
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
1976
1994
|
}): Promise<void>;
|
|
1977
1995
|
slideTimerEnd(): void;
|
|
1996
|
+
private slidePauseUI;
|
|
1997
|
+
private slideResumeUI;
|
|
1978
1998
|
enableAudio(): void;
|
|
1979
1999
|
disableAudio(): void;
|
|
1980
2000
|
get isStopped(): boolean;
|
|
@@ -1986,6 +2006,11 @@ declare class SlideApi$1 {
|
|
|
1986
2006
|
slideClickHandler(targetElement: HTMLElement | null, navigationDirection: "forward" | "backward"): {
|
|
1987
2007
|
canClickNext: boolean;
|
|
1988
2008
|
};
|
|
2009
|
+
/**
|
|
2010
|
+
* Handle click or swipeUp on linkable elements (elements with data: linkType & linkTarget)
|
|
2011
|
+
* And click or swipeUp on SwipeUp elements (WidgetProducts, WidgetGoods)
|
|
2012
|
+
*/
|
|
2013
|
+
private _handleLinkAndSwipeUpActivation;
|
|
1989
2014
|
slideSwipeUpHandler(): boolean;
|
|
1990
2015
|
setTextInputResult(id: string, text: string): void;
|
|
1991
2016
|
setShareComplete(id: string, isSuccess: boolean): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Player } from '@inappstory/video-player';
|
|
2
2
|
|
|
3
3
|
interface IAnimation {
|
|
4
|
+
init(slide: HTMLElement, animate?: boolean): void;
|
|
4
5
|
start(slide: HTMLElement, animate?: boolean): void | ((isStop: boolean) => () => void);
|
|
5
6
|
stop(slide: HTMLElement, animate?: boolean): void;
|
|
6
7
|
pause(slide: HTMLElement): void;
|
|
@@ -1889,21 +1890,34 @@ declare class Layer {
|
|
|
1889
1890
|
get isLayerForcePaused(): boolean;
|
|
1890
1891
|
}
|
|
1891
1892
|
|
|
1893
|
+
declare const enum STATE {
|
|
1894
|
+
INIT = 0,
|
|
1895
|
+
INITED = 1,
|
|
1896
|
+
START = 2,
|
|
1897
|
+
STARTED = 3,
|
|
1898
|
+
RESUME = 4,
|
|
1899
|
+
RESUMED = 5,
|
|
1900
|
+
APP_PAUSE = 6,
|
|
1901
|
+
APP_PAUSED = 7,
|
|
1902
|
+
USER_PAUSE = 8,
|
|
1903
|
+
USER_PAUSED = 9,
|
|
1904
|
+
FORCE_PAUSED = 10,
|
|
1905
|
+
STOP = 11,
|
|
1906
|
+
STOPPED = 12,
|
|
1907
|
+
DESTROYED = 13
|
|
1908
|
+
}
|
|
1892
1909
|
declare class SlideApi$1 {
|
|
1893
1910
|
private readonly config;
|
|
1894
1911
|
get layoutDirection(): "ltr" | "rtl";
|
|
1895
1912
|
private static renderedBoxClassName;
|
|
1896
1913
|
private static prerenderBoxClassName;
|
|
1897
|
-
private readonly
|
|
1914
|
+
private readonly _slideWrapper;
|
|
1898
1915
|
private readonly _viewport;
|
|
1899
1916
|
private readonly _getViewportWidth;
|
|
1900
1917
|
private readonly _getViewportHeight;
|
|
1901
1918
|
private readonly _overlappingActionBarHeight;
|
|
1902
1919
|
private readonly _separateUserAndAppPause;
|
|
1903
1920
|
readonly sdkApi: SDKApi;
|
|
1904
|
-
private activeCard;
|
|
1905
|
-
private cards;
|
|
1906
|
-
private multiCardsMode;
|
|
1907
1921
|
constructor(config: {
|
|
1908
1922
|
sdkApi: SDKApi;
|
|
1909
1923
|
slideWrapper: HTMLElement;
|
|
@@ -1925,10 +1939,7 @@ declare class SlideApi$1 {
|
|
|
1925
1939
|
getViewportHeight: () => number;
|
|
1926
1940
|
overlappingActionBarHeight?: number;
|
|
1927
1941
|
separateUserAndAppPause: boolean;
|
|
1928
|
-
root: HTMLElement;
|
|
1929
|
-
nonce?: string;
|
|
1930
1942
|
});
|
|
1931
|
-
get state(): number;
|
|
1932
1943
|
destroy(): Promise<void>;
|
|
1933
1944
|
private initListeners;
|
|
1934
1945
|
private destroyListeners;
|
|
@@ -1941,16 +1952,22 @@ declare class SlideApi$1 {
|
|
|
1941
1952
|
result: boolean;
|
|
1942
1953
|
reason?: string;
|
|
1943
1954
|
}>;
|
|
1944
|
-
private cardsSlider;
|
|
1945
|
-
showSlides(cards: Array<string>, cardAppearance: Record<string, any>): Promise<{
|
|
1946
|
-
cardId: number;
|
|
1947
|
-
slideIndex: number;
|
|
1948
|
-
result: boolean;
|
|
1949
|
-
reason?: string;
|
|
1950
|
-
}>;
|
|
1951
1955
|
handleBackpress(): void;
|
|
1952
1956
|
private get layoutService();
|
|
1953
1957
|
private getLocalData;
|
|
1958
|
+
private _fontsInit;
|
|
1959
|
+
private _initAndLoadFonts;
|
|
1960
|
+
private _slide;
|
|
1961
|
+
private _slideInInit;
|
|
1962
|
+
private _state;
|
|
1963
|
+
private _afterStartInitQueue;
|
|
1964
|
+
private _afterAppResumeQueue;
|
|
1965
|
+
get state(): STATE;
|
|
1966
|
+
private _onAllMediaLoaded;
|
|
1967
|
+
private _init;
|
|
1968
|
+
private _slideInRender;
|
|
1969
|
+
private _slideBoxRenderComplete;
|
|
1970
|
+
private _slideConfig;
|
|
1954
1971
|
slideStart(config: {
|
|
1955
1972
|
muted?: boolean;
|
|
1956
1973
|
}): Promise<{
|
|
@@ -1961,6 +1978,7 @@ declare class SlideApi$1 {
|
|
|
1961
1978
|
}): Promise<{
|
|
1962
1979
|
currentTime: number;
|
|
1963
1980
|
}>;
|
|
1981
|
+
private _pauseCbTimer;
|
|
1964
1982
|
slideUserPause(): Promise<void>;
|
|
1965
1983
|
slideUserResume(): Promise<void>;
|
|
1966
1984
|
/**
|
|
@@ -1975,6 +1993,8 @@ declare class SlideApi$1 {
|
|
|
1975
1993
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
1976
1994
|
}): Promise<void>;
|
|
1977
1995
|
slideTimerEnd(): void;
|
|
1996
|
+
private slidePauseUI;
|
|
1997
|
+
private slideResumeUI;
|
|
1978
1998
|
enableAudio(): void;
|
|
1979
1999
|
disableAudio(): void;
|
|
1980
2000
|
get isStopped(): boolean;
|
|
@@ -1986,6 +2006,11 @@ declare class SlideApi$1 {
|
|
|
1986
2006
|
slideClickHandler(targetElement: HTMLElement | null, navigationDirection: "forward" | "backward"): {
|
|
1987
2007
|
canClickNext: boolean;
|
|
1988
2008
|
};
|
|
2009
|
+
/**
|
|
2010
|
+
* Handle click or swipeUp on linkable elements (elements with data: linkType & linkTarget)
|
|
2011
|
+
* And click or swipeUp on SwipeUp elements (WidgetProducts, WidgetGoods)
|
|
2012
|
+
*/
|
|
2013
|
+
private _handleLinkAndSwipeUpActivation;
|
|
1989
2014
|
slideSwipeUpHandler(): boolean;
|
|
1990
2015
|
setTextInputResult(id: string, text: string): void;
|
|
1991
2016
|
setShareComplete(id: string, isSuccess: boolean): void;
|