@namiml/web-sdk 1.6.4 → 1.7.1
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/CHANGELOG.md +171 -163
- package/dist/components/ContextConsumer.d.ts +4 -2
- package/dist/components/ContextProvider.d.ts +25 -7
- package/dist/components/NamiElement.d.ts +13 -1
- package/dist/components/Paywall.d.ts +27 -16
- package/dist/components/PaywallContext.d.ts +4 -0
- package/dist/components/PaywallScreen.d.ts +23 -0
- package/dist/components/TemplateComponent.d.ts +2 -1
- package/dist/components/containers/BackgroundContainer.d.ts +0 -1
- package/dist/components/containers/CarouselContainer.d.ts +5 -2
- package/dist/components/containers/CollapseContainer.d.ts +1 -1
- package/dist/components/containers/Footer.d.ts +2 -2
- package/dist/components/containers/Header.d.ts +3 -2
- package/dist/components/elements/Button.d.ts +1 -1
- package/dist/components/elements/QRCode.d.ts +4 -1
- package/dist/components/elements/RadioButton.d.ts +12 -0
- package/dist/components/elements/SegmentPicker.d.ts +1 -1
- package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
- package/dist/components/elements/ToggleSwitch.d.ts +18 -0
- package/dist/components/elements/Video.d.ts +1 -0
- package/dist/components/index.d.ts +7 -1
- package/dist/components/styles/animations.d.ts +2 -0
- package/dist/components/utils/actionTap.d.ts +15 -7
- package/dist/components/utils/helpers.d.ts +9 -9
- package/dist/components/utils/state.d.ts +5 -5
- package/dist/components/utils/swipe.d.ts +74 -0
- package/dist/nami/campaign.d.ts +3 -3
- package/dist/nami/flow/NamiFlow.d.ts +14 -6
- package/dist/nami/flow/NamiFlowManager.d.ts +4 -2
- package/dist/nami-web-ssr.d.ts +1 -0
- package/dist/nami-web.cjs +172 -38
- package/dist/nami-web.mjs +173 -39
- package/dist/nami-web.umd.js +173 -39
- package/dist/services/video.service.d.ts +8 -6
- package/dist/types/components/animation.d.ts +40 -0
- package/dist/types/components/containers.d.ts +53 -6
- package/dist/types/components/elements.d.ts +1 -1
- package/dist/types/components/index.d.ts +10 -5
- package/dist/types/conditions.d.ts +16 -14
- package/dist/types/externals/flow.d.ts +6 -0
- package/dist/types/externals/product.d.ts +2 -2
- package/dist/types/flow.d.ts +33 -8
- package/dist/types/paywall.d.ts +5 -6
- package/dist/utils/animations.d.ts +2 -0
- package/package.json +19 -13
- package/dist/nami-web.js +0 -96
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IPaywall, TPaywallLaunchContext } from '../types/paywall';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import type { NamiCampaign } from '../types/externals/campaign';
|
|
4
|
+
import type { NamiFlow } from '../nami/flow/NamiFlow';
|
|
5
|
+
export declare class NamiPaywallScreen extends LitElement {
|
|
6
|
+
paywall: IPaywall;
|
|
7
|
+
campaign: NamiCampaign;
|
|
8
|
+
context: TPaywallLaunchContext;
|
|
9
|
+
private contextProvider;
|
|
10
|
+
private contextConsumer;
|
|
11
|
+
timeSpentOnPaywall: number;
|
|
12
|
+
flow?: NamiFlow;
|
|
13
|
+
private teardownEvent;
|
|
14
|
+
static styles: import("lit").CSSResult;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
private userInteractionListener;
|
|
18
|
+
firstUpdated(): void;
|
|
19
|
+
private postImpression;
|
|
20
|
+
private postPaywallScreenData;
|
|
21
|
+
private getTemplate;
|
|
22
|
+
render(): import("lit").TemplateResult<1>;
|
|
23
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { TComponent } from "../types/components";
|
|
2
|
-
|
|
2
|
+
import { PaywallContextProvider } from "./ContextProvider";
|
|
3
|
+
export declare function TemplateComponent(contextProvider: PaywallContextProvider, component: TComponent, scaleFactor: number, inFocusedState?: boolean): any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
2
|
import Swiper from 'swiper';
|
|
3
|
-
import { TCarouselContainer } from '../../types/components/containers';
|
|
3
|
+
import type { TCarouselContainer } from '../../types/components/containers';
|
|
4
4
|
import { NamiElement } from '../NamiElement';
|
|
5
5
|
export declare class NamiCarouselContainer extends NamiElement {
|
|
6
6
|
component: TCarouselContainer;
|
|
@@ -13,5 +13,8 @@ export declare class NamiCarouselContainer extends NamiElement {
|
|
|
13
13
|
updateSpacing: (e: CustomEvent) => void;
|
|
14
14
|
protected styles(): CSSResult;
|
|
15
15
|
protected updated(): void;
|
|
16
|
-
|
|
16
|
+
private handleSlideChange;
|
|
17
|
+
private getCarouselOnChange;
|
|
18
|
+
private getCarouselSlides;
|
|
19
|
+
render(): import("lit").TemplateResult<1>;
|
|
17
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { NamiElementBase } from '../NamiElement';
|
|
3
3
|
import { THeaderFooter } from '../../types/components/containers';
|
|
4
|
-
export declare class NamiFooter extends
|
|
4
|
+
export declare class NamiFooter extends NamiElementBase {
|
|
5
5
|
components: THeaderFooter;
|
|
6
6
|
zIndex: string;
|
|
7
7
|
inFocusedState: boolean;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { NamiElementBase } from '../NamiElement';
|
|
3
3
|
import { THeaderFooter } from '../../types/components/containers';
|
|
4
|
-
export declare class NamiHeader extends
|
|
4
|
+
export declare class NamiHeader extends NamiElementBase {
|
|
5
5
|
components: THeaderFooter;
|
|
6
6
|
zIndex: string;
|
|
7
7
|
inFullScreen: boolean;
|
|
8
8
|
inFocusedState: boolean;
|
|
9
9
|
scaleFactor: number;
|
|
10
|
+
private formFactor;
|
|
10
11
|
protected styles(): CSSResult;
|
|
11
12
|
render(): any[];
|
|
12
13
|
}
|
|
@@ -2,8 +2,11 @@ import { NamiElement } from "../NamiElement";
|
|
|
2
2
|
import { TQRCodeComponent } from "../../types/components/elements";
|
|
3
3
|
export declare class NamiQRCode extends NamiElement {
|
|
4
4
|
component: TQRCodeComponent;
|
|
5
|
+
scaleFactor: number;
|
|
5
6
|
protected styles(): import("lit").CSSResult;
|
|
6
7
|
private renderQr;
|
|
7
8
|
firstUpdated(): void;
|
|
8
|
-
|
|
9
|
+
protected updated(changedProps: Map<string, unknown>): void;
|
|
10
|
+
private get computedSize();
|
|
11
|
+
render(): import("lit").TemplateResult<1>;
|
|
9
12
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TRadioButton } from "../../types/components/containers";
|
|
2
|
+
import { NamiElement } from "../NamiElement";
|
|
3
|
+
import { type CSSResult } from "lit";
|
|
4
|
+
export declare class NamiRadioButton extends NamiElement {
|
|
5
|
+
component: TRadioButton;
|
|
6
|
+
inFocusedState: boolean;
|
|
7
|
+
scaleFactor: number;
|
|
8
|
+
constructor();
|
|
9
|
+
protected styles(): CSSResult;
|
|
10
|
+
private get isActive();
|
|
11
|
+
render(): import("lit").TemplateResult<1>;
|
|
12
|
+
}
|
|
@@ -12,5 +12,5 @@ export declare class NamiSegmentPickerItem extends NamiElement {
|
|
|
12
12
|
private _handleHover;
|
|
13
13
|
updated(changedProperties: PropertyValues): void;
|
|
14
14
|
protected styles(): CSSResult;
|
|
15
|
-
render(): import("lit
|
|
15
|
+
render(): import("lit").TemplateResult<1>;
|
|
16
16
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TToggleSwitch } from "../../types/components/containers";
|
|
2
|
+
import { NamiElement } from "../NamiElement";
|
|
3
|
+
import { type CSSResult } from "lit";
|
|
4
|
+
export declare class NamiToggleSwitch extends NamiElement {
|
|
5
|
+
component: TToggleSwitch;
|
|
6
|
+
inFocusedState: boolean;
|
|
7
|
+
scaleFactor: number;
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
constructor();
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
private _handleKeyDown;
|
|
13
|
+
private _handleClick;
|
|
14
|
+
protected styles(): CSSResult;
|
|
15
|
+
private applyPlateStyles;
|
|
16
|
+
private applyHandleStyles;
|
|
17
|
+
render(): import("lit").TemplateResult<1>;
|
|
18
|
+
}
|
|
@@ -17,7 +17,10 @@ import { NamiCarouselContainer } from "./containers/CarouselContainer";
|
|
|
17
17
|
import { NamiVolumeButton } from "./elements/VolumeButton";
|
|
18
18
|
import { NamiPlayPauseButton } from "./elements/PlayPauseButton";
|
|
19
19
|
import { NamiStack } from "./elements/Stack";
|
|
20
|
+
import { NamiPaywallScreen } from "./PaywallScreen";
|
|
20
21
|
import { NamiQRCode } from "./elements/QRCode";
|
|
22
|
+
import { NamiToggleSwitch } from "./elements/ToggleSwitch";
|
|
23
|
+
import { NamiRadioButton } from "./elements/RadioButton";
|
|
21
24
|
declare global {
|
|
22
25
|
interface HTMLElementTagNameMap {
|
|
23
26
|
"nami-spacer": NamiSpacer;
|
|
@@ -40,7 +43,10 @@ declare global {
|
|
|
40
43
|
"nami-volume-button": NamiVolumeButton;
|
|
41
44
|
"nami-play-pause-button": NamiPlayPauseButton;
|
|
42
45
|
"nami-stack": NamiStack;
|
|
46
|
+
"nami-paywall-screen": NamiPaywallScreen;
|
|
43
47
|
"nami-qr-code": NamiQRCode;
|
|
48
|
+
"nami-toggle-switch": NamiToggleSwitch;
|
|
49
|
+
"nami-radio-button": NamiRadioButton;
|
|
44
50
|
}
|
|
45
51
|
}
|
|
46
|
-
export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid, NamiCarouselContainer, NamiPlayPauseButton, NamiVolumeButton, NamiStack, NamiQRCode, };
|
|
52
|
+
export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid, NamiCarouselContainer, NamiPlayPauseButton, NamiVolumeButton, NamiStack, NamiPaywallScreen, NamiQRCode, NamiToggleSwitch, NamiRadioButton, };
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { UserAction } from "../../types/components/containers";
|
|
2
2
|
import { NamiSKU } from "../../types/externals/sku";
|
|
3
|
-
import { NamiPaywallComponentChange } from "../../types/externals/paywall";
|
|
4
|
-
|
|
3
|
+
import { type NamiPaywallComponentChange } from "../../types/externals/paywall";
|
|
4
|
+
import { PaywallContextProvider } from "../ContextProvider";
|
|
5
|
+
type HandleActionParams = {
|
|
6
|
+
onTap?: UserAction;
|
|
7
|
+
sku?: NamiSKU;
|
|
8
|
+
componentChange?: NamiPaywallComponentChange;
|
|
9
|
+
contextProvider: PaywallContextProvider;
|
|
10
|
+
};
|
|
11
|
+
export declare const handleAction: ({ onTap, sku, componentChange, contextProvider, }?: HandleActionParams) => void;
|
|
5
12
|
export declare const closePaywallHandler: () => void;
|
|
6
13
|
export declare const restorePurchase: () => void;
|
|
7
14
|
export declare const signIn: () => void;
|
|
8
15
|
export declare const deepLink: (url?: string) => void;
|
|
9
|
-
export declare const buySKU: (onTap: UserAction, sku: NamiSKU) => NamiSKU;
|
|
10
|
-
export declare const navigateToScreen: (screen?: string) => void;
|
|
11
|
-
export declare const setState: () => {
|
|
16
|
+
export declare const buySKU: (contextProvider: PaywallContextProvider, onTap: UserAction, sku: NamiSKU) => NamiSKU;
|
|
17
|
+
export declare const navigateToScreen: (contextProvider: PaywallContextProvider, screen?: string) => void;
|
|
18
|
+
export declare const setState: (contextProvider: PaywallContextProvider) => {
|
|
12
19
|
id: string;
|
|
13
20
|
name: string;
|
|
14
21
|
};
|
|
15
|
-
export declare const selectSKU: (sku: NamiSKU) => void;
|
|
16
|
-
export declare const purchaseSelectedSKU: (sku: NamiSKU) => void;
|
|
22
|
+
export declare const selectSKU: (contextProvider: PaywallContextProvider, sku: NamiSKU) => void;
|
|
23
|
+
export declare const purchaseSelectedSKU: (contextProvider: PaywallContextProvider, sku: NamiSKU) => void;
|
|
17
24
|
export declare const reloadProducts: () => void;
|
|
18
25
|
export declare function shouldHoist(onTap?: UserAction): boolean;
|
|
26
|
+
export {};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { TBaseComponent, TComponent } from "../../types/components";
|
|
2
|
-
import { TButtonContainer,
|
|
2
|
+
import { TButtonContainer, TProductContainer, TResponsiveGrid } from "../../types/components/containers";
|
|
3
3
|
import { TConditionalComponent } from "../../types/components/elements";
|
|
4
4
|
import { TPaywallMedia } from "../../types/paywall";
|
|
5
5
|
import { PaywallSKU } from "../../types/sku";
|
|
6
|
+
import { PaywallContextProvider } from "../ContextProvider";
|
|
6
7
|
type ReplacementsType = {
|
|
7
8
|
[type: string]: any extends Array<any> ? never : any;
|
|
8
9
|
};
|
|
9
10
|
export declare function interpolate<T>(value: T, replacements: ReplacementsType): T;
|
|
10
|
-
export declare function getInterpolatedButtonComponents(component: TButtonContainer): TComponent[];
|
|
11
|
-
export declare function getSkuButtonComponents(items: PaywallSKU[], component: TProductContainer, mediaList?: {
|
|
11
|
+
export declare function getInterpolatedButtonComponents(contextProvider: PaywallContextProvider, component: TButtonContainer): TComponent[];
|
|
12
|
+
export declare function getSkuButtonComponents(contextProvider: PaywallContextProvider, items: PaywallSKU[], component: TProductContainer, mediaList?: {
|
|
12
13
|
[mediaName: string]: Pick<TPaywallMedia, 'content'>;
|
|
13
14
|
}): [boolean, TComponent[]][];
|
|
14
|
-
export declare function getRepeatingListBlocks(component: TResponsiveGrid): TComponent[][];
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function
|
|
18
|
-
export declare
|
|
19
|
-
export declare const totalTimeSpentOnPaywall: () => number | undefined;
|
|
15
|
+
export declare function getRepeatingListBlocks(contextProvider: PaywallContextProvider, component: TResponsiveGrid): TComponent[][];
|
|
16
|
+
export declare function conditionComponentMatches(contextProvider: PaywallContextProvider, condition: TConditionalComponent): boolean;
|
|
17
|
+
export declare function withOverrides<T extends TBaseComponent>(contextProvider: PaywallContextProvider, { conditionAttributes, ...component }: T): T;
|
|
18
|
+
export declare function valueFromSmartText<T>(contextProvider: PaywallContextProvider, value: T, sku?: PaywallSKU, block?: any): T;
|
|
19
|
+
export declare const totalTimeSpentOnPaywall: (contextProvider: PaywallContextProvider) => number | undefined;
|
|
20
20
|
export declare const rgbaToHex: (rgba?: string) => string | null;
|
|
21
21
|
export declare const sameColors: (color1?: string, color2?: string) => boolean;
|
|
22
22
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISkuMenu, TInitialState } from "../../types/paywall";
|
|
1
|
+
import { ISkuMenu, TInitialState, TPaywallLaunchContext } from "../../types/paywall";
|
|
2
2
|
import { NamiProductDetails } from "../../types/externals/product";
|
|
3
3
|
import { PaywallSKU } from "../../types/sku";
|
|
4
4
|
import { NamiPaywallLaunchContext } from "../../nami-web";
|
|
@@ -13,7 +13,7 @@ export declare function getSkuSmartTextValue(productDetail?: NamiProductDetails
|
|
|
13
13
|
export declare function getSlideSmartTextValue(productDetail?: NamiProductDetails | null, slide?: TCarouselSlide, skus?: PaywallSKU[]): {
|
|
14
14
|
[key: string]: any;
|
|
15
15
|
};
|
|
16
|
-
export declare function checkAnySkuHasTrialOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[]
|
|
17
|
-
export declare function checkAnySkuHasPromoOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[]
|
|
18
|
-
export declare function productDetail(details
|
|
19
|
-
export declare function
|
|
16
|
+
export declare function checkAnySkuHasTrialOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[]): boolean;
|
|
17
|
+
export declare function checkAnySkuHasPromoOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[]): boolean;
|
|
18
|
+
export declare function productDetail(details?: NamiProductDetails[], refId?: string): NamiProductDetails | null;
|
|
19
|
+
export declare function normalizeLaunchContext(stateContext: NamiPaywallLaunchContext, context: NamiPaywallLaunchContext, skuMenus?: ISkuMenu[]): TPaywallLaunchContext;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export type SwipeDirection = 'left' | 'right' | 'up' | 'down';
|
|
2
|
+
export interface SwipeDetail {
|
|
3
|
+
direction: SwipeDirection;
|
|
4
|
+
distanceX: number;
|
|
5
|
+
distanceY: number;
|
|
6
|
+
absX: number;
|
|
7
|
+
absY: number;
|
|
8
|
+
duration: number;
|
|
9
|
+
velocity: number;
|
|
10
|
+
startX: number;
|
|
11
|
+
startY: number;
|
|
12
|
+
endX: number;
|
|
13
|
+
endY: number;
|
|
14
|
+
startedAt: number;
|
|
15
|
+
endedAt: number;
|
|
16
|
+
originalEvent: PointerEvent;
|
|
17
|
+
}
|
|
18
|
+
export type SwipeHandler = (detail: SwipeDetail) => void;
|
|
19
|
+
export interface SwipeOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Minimum distance in px along the primary axis to qualify as a swipe.
|
|
22
|
+
* Default: 30
|
|
23
|
+
*/
|
|
24
|
+
minDistance?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum allowed duration (ms) for a swipe gesture.
|
|
27
|
+
* Swipes slower than this are ignored. Default: 600
|
|
28
|
+
*/
|
|
29
|
+
maxDuration?: number;
|
|
30
|
+
/**
|
|
31
|
+
* If true, we’ll treat the first dominant axis as locked, which
|
|
32
|
+
* helps filter diagonal drags. Default: true
|
|
33
|
+
*/
|
|
34
|
+
lockAxis?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* If true, set `touch-action: none` on the element for the lifetime
|
|
37
|
+
* of the detector to avoid browser scroll interference. Default: false
|
|
38
|
+
*/
|
|
39
|
+
preventScrollOnSwipe?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Allowed pointer types. Default: ['touch'] (most common for swipes)
|
|
42
|
+
*/
|
|
43
|
+
pointerTypes?: Array<'touch' | 'mouse' | 'pen'>;
|
|
44
|
+
/**
|
|
45
|
+
* If true, listeners are registered as passive where sensible.
|
|
46
|
+
* We never rely on preventDefault; CSS touch-action is used instead.
|
|
47
|
+
* Default: true
|
|
48
|
+
*/
|
|
49
|
+
passiveListeners?: boolean;
|
|
50
|
+
/** We only care about vertical in your case */
|
|
51
|
+
/**
|
|
52
|
+
* Hint to the detector about which axis you care about most.
|
|
53
|
+
* - 'y' (default): prefer vertical gestures. Useful when the UI is
|
|
54
|
+
* primarily vertically scrolling and you want more aggressive vertical
|
|
55
|
+
* swipe detection.
|
|
56
|
+
* - 'x': prefer horizontal gestures.
|
|
57
|
+
* - 'both': do not bias; choose the axis based on the gesture's delta and
|
|
58
|
+
* the optional axis lock.
|
|
59
|
+
*
|
|
60
|
+
* This is a hint only. When set to 'both' the normal heuristics (dominant
|
|
61
|
+
* axis or axis-lock) determine the primary axis.
|
|
62
|
+
*/
|
|
63
|
+
axisHint?: 'x' | 'y' | 'both';
|
|
64
|
+
/**
|
|
65
|
+
* Extra pixels required *after* a scrollable child hits its edge
|
|
66
|
+
* before we treat it as a swipe. Helps avoid accidental edge triggers.
|
|
67
|
+
*/
|
|
68
|
+
edgeLeakThreshold?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface SwipeController {
|
|
71
|
+
destroy(): void;
|
|
72
|
+
updateOptions(next: Partial<SwipeOptions>): void;
|
|
73
|
+
}
|
|
74
|
+
export declare function onSwipe(element: HTMLElement | null | undefined, handler: SwipeHandler, options?: SwipeOptions): SwipeController;
|
package/dist/nami/campaign.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AvailableCampaignsResponseHandler } from "../types/campaign";
|
|
2
|
-
import {
|
|
2
|
+
import { PaywallResultHandler } from "../types/paywall";
|
|
3
3
|
import { PaywallComponent } from "../components/Paywall";
|
|
4
4
|
import { Callback } from "../types/components/containers";
|
|
5
|
-
import { NamiPaywallActionHandler } from "../types/externals/paywall";
|
|
5
|
+
import { NamiPaywallActionHandler, NamiPaywallLaunchContext } from "../types/externals/paywall";
|
|
6
6
|
import { NamiCampaign } from "../types/externals/campaign";
|
|
7
7
|
/**
|
|
8
8
|
* @class NamiCampaignManager
|
|
@@ -48,7 +48,7 @@ export declare class NamiCampaignManager {
|
|
|
48
48
|
* @param actionCallback - Optional handler for paywall actions.
|
|
49
49
|
* @returns {PaywallComponent | void} The launched paywall web component.
|
|
50
50
|
*/
|
|
51
|
-
static launch(label?: string, withUrl?: string, context?:
|
|
51
|
+
static launch(label?: string, withUrl?: string, context?: NamiPaywallLaunchContext, resultCallback?: PaywallResultHandler, actionCallback?: NamiPaywallActionHandler): PaywallComponent;
|
|
52
52
|
/**
|
|
53
53
|
* Provide the list of product groups supported by the provided placement label or URL.
|
|
54
54
|
* @param label Campaign placement label defined in Nami Control Center for launching a specific campaign.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NamiFlowObjectDTO, NamiFlowOn, NamiFlowStep } from "../../types/flow";
|
|
1
|
+
import type { NamiFlowObjectDTO, NamiFlowOn, NamiFlowStep, NamiFlowTransition } from "../../types/flow";
|
|
2
2
|
import type { NamiCampaign, NamiFlowCampaign } from '../../types/externals/campaign';
|
|
3
3
|
import type { NamiPaywallLaunchContext } from '../../types/externals/paywall';
|
|
4
4
|
import type { PaywallComponent } from "../../components/Paywall";
|
|
@@ -10,12 +10,14 @@ export declare class BasicNamiFlow implements NamiFlowObjectDTO {
|
|
|
10
10
|
steps: NamiFlowStep[];
|
|
11
11
|
screens: string[];
|
|
12
12
|
resumeFromBookmark: boolean;
|
|
13
|
+
transition: NamiFlowTransition;
|
|
13
14
|
constructor(flowObject?: Partial<{
|
|
14
15
|
id: string;
|
|
15
16
|
name: string;
|
|
16
17
|
steps: NamiFlowStep[];
|
|
17
18
|
screens: string[];
|
|
18
19
|
resume_from_bookmark: boolean;
|
|
20
|
+
transition?: NamiFlowTransition;
|
|
19
21
|
}>);
|
|
20
22
|
get allScreensAvailable(): boolean;
|
|
21
23
|
}
|
|
@@ -27,25 +29,31 @@ export declare class NamiFlow extends BasicNamiFlow {
|
|
|
27
29
|
component: PaywallComponent;
|
|
28
30
|
manager: NamiFlowManager;
|
|
29
31
|
currentButton?: NamiButton;
|
|
32
|
+
isPaused: boolean;
|
|
33
|
+
pausedStepID?: string;
|
|
30
34
|
constructor(campaign: NamiFlowCampaign, paywall: PaywallComponent, manager: NamiFlowManager, context?: NamiPaywallLaunchContext);
|
|
31
35
|
private registerResolvers;
|
|
32
36
|
get currentFlowStep(): NamiFlowStep | undefined;
|
|
33
37
|
get nextStepAvailable(): boolean;
|
|
34
38
|
get previousStepAvailable(): boolean;
|
|
35
39
|
get previousFlowStep(): NamiFlowStep | undefined;
|
|
40
|
+
get nextFlowStep(): NamiFlowStep | undefined;
|
|
36
41
|
getStep(stepId: string): NamiFlowStep | undefined;
|
|
37
42
|
private findStepByType;
|
|
38
43
|
private isStepActive;
|
|
39
44
|
finished(): void;
|
|
40
45
|
back(): void;
|
|
46
|
+
next(): void;
|
|
41
47
|
private backToPreviousScreenStep;
|
|
42
48
|
forward(stepId: string): void;
|
|
43
|
-
|
|
49
|
+
pause(): void;
|
|
50
|
+
resumeFromPause(): void;
|
|
51
|
+
executeLifecycle(step: NamiFlowStep, key: string, data?: Record<string, any>): void;
|
|
44
52
|
private lifecycles;
|
|
45
|
-
triggerActions(actionId: string, component?: NamiButton): void;
|
|
46
|
-
executeFullLifecycles(lifecycles: NamiFlowOn[]): void;
|
|
47
|
-
triggerBeforeActions(actionId: string, component?: NamiButton): void;
|
|
48
|
-
triggerAfterActions(actionId: string, component?: NamiButton): void;
|
|
53
|
+
triggerActions(actionId: string, component?: NamiButton, data?: Record<string, any>): void;
|
|
54
|
+
executeFullLifecycles(lifecycles: NamiFlowOn[], data?: Record<string, any>): void;
|
|
55
|
+
triggerBeforeActions(actionId: string, component?: NamiButton, data?: Record<string, any>): void;
|
|
56
|
+
triggerAfterActions(actionId: string, component?: NamiButton, data?: Record<string, any>): void;
|
|
49
57
|
currentStepHasHoistedPrimaryActions(actionId: string): boolean;
|
|
50
58
|
private shouldRun;
|
|
51
59
|
private performAction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type NamiFlowEventHandler, type NamiFlowHandoffStepHandler } from "../../types/flow";
|
|
2
2
|
import { NamiFlow } from "./NamiFlow";
|
|
3
3
|
import type { NamiFlowCampaign } from '../../types/externals/campaign';
|
|
4
4
|
import { NamiPaywallLaunchContext } from '../../types/externals/paywall';
|
|
@@ -14,7 +14,9 @@ export declare class NamiFlowManager {
|
|
|
14
14
|
eventHandler?: NamiFlowEventHandler;
|
|
15
15
|
static registerEventHandler(eventHandler: NamiFlowEventHandler): void;
|
|
16
16
|
static resume(): void;
|
|
17
|
-
presentFlow(campaign: NamiFlowCampaign, paywall: PaywallComponent, context?: NamiPaywallLaunchContext): NamiFlow;
|
|
18
17
|
static finish(): void;
|
|
18
|
+
static pause(): void;
|
|
19
19
|
static isFlowOpen(): boolean;
|
|
20
|
+
presentFlow(campaign: NamiFlowCampaign, paywall: PaywallComponent, context?: NamiPaywallLaunchContext): NamiFlow;
|
|
21
|
+
finishFlow(): void;
|
|
20
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './nami-web';
|