@inappstory/slide-api 0.1.8 → 0.1.9
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 +168 -128
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -19
- package/dist/index.d.ts +34 -19
- package/dist/index.js +168 -128
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -817,9 +817,9 @@ declare class SlideTimeline {
|
|
|
817
817
|
private readonly slideDuration;
|
|
818
818
|
private readonly slideDisabledTimer;
|
|
819
819
|
private readonly slideReady;
|
|
820
|
-
private readonly
|
|
820
|
+
private readonly _afterAppResumeQueuePush;
|
|
821
821
|
private readonly sdkApi;
|
|
822
|
-
constructor(slideIndex: number, slideDuration: number, slideDisabledTimer: boolean, slideReady: Promise<void>,
|
|
822
|
+
constructor(slideIndex: number, slideDuration: number, slideDisabledTimer: boolean, slideReady: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, sdkApi: SDKApi);
|
|
823
823
|
private resumedAt;
|
|
824
824
|
private timeSpent;
|
|
825
825
|
private timelineDisabledState;
|
|
@@ -1559,13 +1559,13 @@ declare class Video implements IElement {
|
|
|
1559
1559
|
declare class Slide {
|
|
1560
1560
|
private readonly _slidesNodesRefs;
|
|
1561
1561
|
private readonly _slideReadyPromise;
|
|
1562
|
-
private readonly
|
|
1562
|
+
private readonly _afterAppResumeQueuePush;
|
|
1563
1563
|
private readonly _afterStartInitQueuePush;
|
|
1564
1564
|
private readonly _showNextSlide;
|
|
1565
1565
|
readonly sdkApi: SDKApi;
|
|
1566
1566
|
private readonly _layers;
|
|
1567
1567
|
private _start;
|
|
1568
|
-
constructor(_slidesNodesRefs: Array<HTMLElement>, _slideReadyPromise: Promise<void>,
|
|
1568
|
+
constructor(_slidesNodesRefs: Array<HTMLElement>, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void, _showNextSlide: (duration: number) => void, sdkApi: SDKApi);
|
|
1569
1569
|
private _activeLayer;
|
|
1570
1570
|
get activeLayer(): Layer;
|
|
1571
1571
|
get layers(): Array<Layer>;
|
|
@@ -1591,7 +1591,7 @@ declare class Layer {
|
|
|
1591
1591
|
private readonly _nodeRef;
|
|
1592
1592
|
private readonly _slide;
|
|
1593
1593
|
private readonly _slideReadyPromise;
|
|
1594
|
-
private readonly
|
|
1594
|
+
private readonly _afterAppResumeQueuePush;
|
|
1595
1595
|
private readonly _afterStartInitQueuePush;
|
|
1596
1596
|
private readonly _showNextSlide;
|
|
1597
1597
|
readonly sdkApi: SDKApi;
|
|
@@ -1604,7 +1604,7 @@ declare class Layer {
|
|
|
1604
1604
|
private readonly _disabledNavigation;
|
|
1605
1605
|
private _elements;
|
|
1606
1606
|
private readonly _timeline;
|
|
1607
|
-
constructor(_nodeRef: HTMLElement, _slide: Slide, _slideReadyPromise: Promise<void>,
|
|
1607
|
+
constructor(_nodeRef: HTMLElement, _slide: Slide, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void, _showNextSlide: (duration: number) => void, sdkApi: SDKApi);
|
|
1608
1608
|
init(localData: LocalData): Array<Promise<boolean>>;
|
|
1609
1609
|
get nodeRef(): HTMLElement;
|
|
1610
1610
|
get elements(): Array<IElement>;
|
|
@@ -1646,7 +1646,7 @@ declare class Layer {
|
|
|
1646
1646
|
stopInternal(options: {
|
|
1647
1647
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
1648
1648
|
}): void;
|
|
1649
|
-
pause(resetVideoTime?: boolean, stopAnimation?: boolean): Promise<{
|
|
1649
|
+
pause(resetVideoTime?: boolean, stopAnimation?: boolean, updateTimeline?: boolean): Promise<{
|
|
1650
1650
|
currentTime: number | null;
|
|
1651
1651
|
}>;
|
|
1652
1652
|
resume(): Promise<unknown>;
|
|
@@ -1662,11 +1662,14 @@ declare const enum STATE {
|
|
|
1662
1662
|
STARTED = 3,
|
|
1663
1663
|
RESUME = 4,
|
|
1664
1664
|
RESUMED = 5,
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1665
|
+
APP_PAUSE = 6,
|
|
1666
|
+
APP_PAUSED = 7,
|
|
1667
|
+
USER_PAUSE = 8,
|
|
1668
|
+
USER_PAUSED = 9,
|
|
1669
|
+
FORCE_PAUSED = 10,
|
|
1670
|
+
STOP = 11,
|
|
1671
|
+
STOPPED = 12,
|
|
1672
|
+
DESTROYED = 13
|
|
1670
1673
|
}
|
|
1671
1674
|
declare class SlideApi {
|
|
1672
1675
|
private readonly config;
|
|
@@ -1678,6 +1681,7 @@ declare class SlideApi {
|
|
|
1678
1681
|
private readonly _getViewportWidth;
|
|
1679
1682
|
private readonly _getViewportHeight;
|
|
1680
1683
|
private readonly _overlappingActionBarHeight;
|
|
1684
|
+
private readonly _separateUserAndAppPause;
|
|
1681
1685
|
readonly sdkApi: SDKApi;
|
|
1682
1686
|
constructor(config: {
|
|
1683
1687
|
sdkApi: SDKApi;
|
|
@@ -1691,20 +1695,23 @@ declare class SlideApi {
|
|
|
1691
1695
|
slideRatio: number;
|
|
1692
1696
|
isFullscreen: boolean;
|
|
1693
1697
|
slideLoadedCb?: (data: {
|
|
1694
|
-
|
|
1698
|
+
cardId: number;
|
|
1699
|
+
slideIndex: number;
|
|
1695
1700
|
result: boolean;
|
|
1696
1701
|
reason?: string;
|
|
1697
1702
|
}) => void;
|
|
1698
1703
|
getViewportWidth: () => number;
|
|
1699
1704
|
getViewportHeight: () => number;
|
|
1700
1705
|
overlappingActionBarHeight?: number;
|
|
1706
|
+
separateUserAndAppPause: boolean;
|
|
1701
1707
|
});
|
|
1702
1708
|
destroy(): void;
|
|
1703
1709
|
private initListeners;
|
|
1704
1710
|
private destroyListeners;
|
|
1705
1711
|
private refreshSizes;
|
|
1706
1712
|
showSlide(html: string): Promise<{
|
|
1707
|
-
|
|
1713
|
+
cardId: number;
|
|
1714
|
+
slideIndex: number;
|
|
1708
1715
|
result: boolean;
|
|
1709
1716
|
reason?: string;
|
|
1710
1717
|
}>;
|
|
@@ -1713,17 +1720,17 @@ declare class SlideApi {
|
|
|
1713
1720
|
private getLocalData;
|
|
1714
1721
|
private _fontsInit;
|
|
1715
1722
|
private _initAndLoadFonts;
|
|
1723
|
+
// todo nullable
|
|
1716
1724
|
private _slide;
|
|
1717
1725
|
private _slideInInit;
|
|
1718
1726
|
private _state;
|
|
1719
1727
|
private _afterStartInitQueue;
|
|
1720
|
-
private
|
|
1728
|
+
private _afterAppResumeQueue;
|
|
1721
1729
|
get state(): STATE;
|
|
1722
1730
|
private _onAllMediaLoaded;
|
|
1723
1731
|
private _init;
|
|
1724
1732
|
private _slideInRender;
|
|
1725
1733
|
private _slideBoxRenderComplete;
|
|
1726
|
-
private _slideBoxRenderError;
|
|
1727
1734
|
private _slideConfig;
|
|
1728
1735
|
slideStart(config: {
|
|
1729
1736
|
muted?: boolean;
|
|
@@ -1736,8 +1743,16 @@ declare class SlideApi {
|
|
|
1736
1743
|
currentTime: number;
|
|
1737
1744
|
}>;
|
|
1738
1745
|
private _pauseCbTimer;
|
|
1739
|
-
|
|
1740
|
-
|
|
1746
|
+
slideUserPause(): Promise<void>;
|
|
1747
|
+
slideUserResume(): Promise<void>;
|
|
1748
|
+
/**
|
|
1749
|
+
* Call on app gone background
|
|
1750
|
+
*/
|
|
1751
|
+
slideAppPause(): Promise<void>;
|
|
1752
|
+
/**
|
|
1753
|
+
* Call on app gone foreground after a background
|
|
1754
|
+
*/
|
|
1755
|
+
slideAppResume(): Promise<void>;
|
|
1741
1756
|
slideStop(options: {
|
|
1742
1757
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
1743
1758
|
}): Promise<void>;
|
|
@@ -1752,7 +1767,7 @@ declare class SlideApi {
|
|
|
1752
1767
|
disableAudio(): void;
|
|
1753
1768
|
get isStopped(): boolean;
|
|
1754
1769
|
afterStartInitQueuePush(cb: () => void): false | undefined;
|
|
1755
|
-
|
|
1770
|
+
afterAppResumeQueuePush(cb: () => void): false | undefined;
|
|
1756
1771
|
get activeLayer(): Layer;
|
|
1757
1772
|
get slide(): Slide;
|
|
1758
1773
|
showLayer(index: number): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -817,9 +817,9 @@ declare class SlideTimeline {
|
|
|
817
817
|
private readonly slideDuration;
|
|
818
818
|
private readonly slideDisabledTimer;
|
|
819
819
|
private readonly slideReady;
|
|
820
|
-
private readonly
|
|
820
|
+
private readonly _afterAppResumeQueuePush;
|
|
821
821
|
private readonly sdkApi;
|
|
822
|
-
constructor(slideIndex: number, slideDuration: number, slideDisabledTimer: boolean, slideReady: Promise<void>,
|
|
822
|
+
constructor(slideIndex: number, slideDuration: number, slideDisabledTimer: boolean, slideReady: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, sdkApi: SDKApi);
|
|
823
823
|
private resumedAt;
|
|
824
824
|
private timeSpent;
|
|
825
825
|
private timelineDisabledState;
|
|
@@ -1559,13 +1559,13 @@ declare class Video implements IElement {
|
|
|
1559
1559
|
declare class Slide {
|
|
1560
1560
|
private readonly _slidesNodesRefs;
|
|
1561
1561
|
private readonly _slideReadyPromise;
|
|
1562
|
-
private readonly
|
|
1562
|
+
private readonly _afterAppResumeQueuePush;
|
|
1563
1563
|
private readonly _afterStartInitQueuePush;
|
|
1564
1564
|
private readonly _showNextSlide;
|
|
1565
1565
|
readonly sdkApi: SDKApi;
|
|
1566
1566
|
private readonly _layers;
|
|
1567
1567
|
private _start;
|
|
1568
|
-
constructor(_slidesNodesRefs: Array<HTMLElement>, _slideReadyPromise: Promise<void>,
|
|
1568
|
+
constructor(_slidesNodesRefs: Array<HTMLElement>, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void, _showNextSlide: (duration: number) => void, sdkApi: SDKApi);
|
|
1569
1569
|
private _activeLayer;
|
|
1570
1570
|
get activeLayer(): Layer;
|
|
1571
1571
|
get layers(): Array<Layer>;
|
|
@@ -1591,7 +1591,7 @@ declare class Layer {
|
|
|
1591
1591
|
private readonly _nodeRef;
|
|
1592
1592
|
private readonly _slide;
|
|
1593
1593
|
private readonly _slideReadyPromise;
|
|
1594
|
-
private readonly
|
|
1594
|
+
private readonly _afterAppResumeQueuePush;
|
|
1595
1595
|
private readonly _afterStartInitQueuePush;
|
|
1596
1596
|
private readonly _showNextSlide;
|
|
1597
1597
|
readonly sdkApi: SDKApi;
|
|
@@ -1604,7 +1604,7 @@ declare class Layer {
|
|
|
1604
1604
|
private readonly _disabledNavigation;
|
|
1605
1605
|
private _elements;
|
|
1606
1606
|
private readonly _timeline;
|
|
1607
|
-
constructor(_nodeRef: HTMLElement, _slide: Slide, _slideReadyPromise: Promise<void>,
|
|
1607
|
+
constructor(_nodeRef: HTMLElement, _slide: Slide, _slideReadyPromise: Promise<void>, _afterAppResumeQueuePush: (cb: () => void) => void, _afterStartInitQueuePush: (cb: () => void) => void, _showNextSlide: (duration: number) => void, sdkApi: SDKApi);
|
|
1608
1608
|
init(localData: LocalData): Array<Promise<boolean>>;
|
|
1609
1609
|
get nodeRef(): HTMLElement;
|
|
1610
1610
|
get elements(): Array<IElement>;
|
|
@@ -1646,7 +1646,7 @@ declare class Layer {
|
|
|
1646
1646
|
stopInternal(options: {
|
|
1647
1647
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
1648
1648
|
}): void;
|
|
1649
|
-
pause(resetVideoTime?: boolean, stopAnimation?: boolean): Promise<{
|
|
1649
|
+
pause(resetVideoTime?: boolean, stopAnimation?: boolean, updateTimeline?: boolean): Promise<{
|
|
1650
1650
|
currentTime: number | null;
|
|
1651
1651
|
}>;
|
|
1652
1652
|
resume(): Promise<unknown>;
|
|
@@ -1662,11 +1662,14 @@ declare const enum STATE {
|
|
|
1662
1662
|
STARTED = 3,
|
|
1663
1663
|
RESUME = 4,
|
|
1664
1664
|
RESUMED = 5,
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1665
|
+
APP_PAUSE = 6,
|
|
1666
|
+
APP_PAUSED = 7,
|
|
1667
|
+
USER_PAUSE = 8,
|
|
1668
|
+
USER_PAUSED = 9,
|
|
1669
|
+
FORCE_PAUSED = 10,
|
|
1670
|
+
STOP = 11,
|
|
1671
|
+
STOPPED = 12,
|
|
1672
|
+
DESTROYED = 13
|
|
1670
1673
|
}
|
|
1671
1674
|
declare class SlideApi {
|
|
1672
1675
|
private readonly config;
|
|
@@ -1678,6 +1681,7 @@ declare class SlideApi {
|
|
|
1678
1681
|
private readonly _getViewportWidth;
|
|
1679
1682
|
private readonly _getViewportHeight;
|
|
1680
1683
|
private readonly _overlappingActionBarHeight;
|
|
1684
|
+
private readonly _separateUserAndAppPause;
|
|
1681
1685
|
readonly sdkApi: SDKApi;
|
|
1682
1686
|
constructor(config: {
|
|
1683
1687
|
sdkApi: SDKApi;
|
|
@@ -1691,20 +1695,23 @@ declare class SlideApi {
|
|
|
1691
1695
|
slideRatio: number;
|
|
1692
1696
|
isFullscreen: boolean;
|
|
1693
1697
|
slideLoadedCb?: (data: {
|
|
1694
|
-
|
|
1698
|
+
cardId: number;
|
|
1699
|
+
slideIndex: number;
|
|
1695
1700
|
result: boolean;
|
|
1696
1701
|
reason?: string;
|
|
1697
1702
|
}) => void;
|
|
1698
1703
|
getViewportWidth: () => number;
|
|
1699
1704
|
getViewportHeight: () => number;
|
|
1700
1705
|
overlappingActionBarHeight?: number;
|
|
1706
|
+
separateUserAndAppPause: boolean;
|
|
1701
1707
|
});
|
|
1702
1708
|
destroy(): void;
|
|
1703
1709
|
private initListeners;
|
|
1704
1710
|
private destroyListeners;
|
|
1705
1711
|
private refreshSizes;
|
|
1706
1712
|
showSlide(html: string): Promise<{
|
|
1707
|
-
|
|
1713
|
+
cardId: number;
|
|
1714
|
+
slideIndex: number;
|
|
1708
1715
|
result: boolean;
|
|
1709
1716
|
reason?: string;
|
|
1710
1717
|
}>;
|
|
@@ -1713,17 +1720,17 @@ declare class SlideApi {
|
|
|
1713
1720
|
private getLocalData;
|
|
1714
1721
|
private _fontsInit;
|
|
1715
1722
|
private _initAndLoadFonts;
|
|
1723
|
+
// todo nullable
|
|
1716
1724
|
private _slide;
|
|
1717
1725
|
private _slideInInit;
|
|
1718
1726
|
private _state;
|
|
1719
1727
|
private _afterStartInitQueue;
|
|
1720
|
-
private
|
|
1728
|
+
private _afterAppResumeQueue;
|
|
1721
1729
|
get state(): STATE;
|
|
1722
1730
|
private _onAllMediaLoaded;
|
|
1723
1731
|
private _init;
|
|
1724
1732
|
private _slideInRender;
|
|
1725
1733
|
private _slideBoxRenderComplete;
|
|
1726
|
-
private _slideBoxRenderError;
|
|
1727
1734
|
private _slideConfig;
|
|
1728
1735
|
slideStart(config: {
|
|
1729
1736
|
muted?: boolean;
|
|
@@ -1736,8 +1743,16 @@ declare class SlideApi {
|
|
|
1736
1743
|
currentTime: number;
|
|
1737
1744
|
}>;
|
|
1738
1745
|
private _pauseCbTimer;
|
|
1739
|
-
|
|
1740
|
-
|
|
1746
|
+
slideUserPause(): Promise<void>;
|
|
1747
|
+
slideUserResume(): Promise<void>;
|
|
1748
|
+
/**
|
|
1749
|
+
* Call on app gone background
|
|
1750
|
+
*/
|
|
1751
|
+
slideAppPause(): Promise<void>;
|
|
1752
|
+
/**
|
|
1753
|
+
* Call on app gone foreground after a background
|
|
1754
|
+
*/
|
|
1755
|
+
slideAppResume(): Promise<void>;
|
|
1741
1756
|
slideStop(options: {
|
|
1742
1757
|
prepareForRestart: ON_SLIDE_STOP_PREPARE_FOR_RESTART;
|
|
1743
1758
|
}): Promise<void>;
|
|
@@ -1752,7 +1767,7 @@ declare class SlideApi {
|
|
|
1752
1767
|
disableAudio(): void;
|
|
1753
1768
|
get isStopped(): boolean;
|
|
1754
1769
|
afterStartInitQueuePush(cb: () => void): false | undefined;
|
|
1755
|
-
|
|
1770
|
+
afterAppResumeQueuePush(cb: () => void): false | undefined;
|
|
1756
1771
|
get activeLayer(): Layer;
|
|
1757
1772
|
get slide(): Slide;
|
|
1758
1773
|
showLayer(index: number): void;
|