@namiml/web-sdk 1.6.3 → 1.7.0

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +173 -160
  2. package/dist/components/ContextConsumer.d.ts +4 -2
  3. package/dist/components/ContextProvider.d.ts +27 -7
  4. package/dist/components/NamiElement.d.ts +3 -0
  5. package/dist/components/Paywall.d.ts +27 -15
  6. package/dist/components/PaywallContext.d.ts +4 -0
  7. package/dist/components/PaywallScreen.d.ts +23 -0
  8. package/dist/components/TemplateComponent.d.ts +2 -1
  9. package/dist/components/containers/BackgroundContainer.d.ts +0 -1
  10. package/dist/components/containers/CarouselContainer.d.ts +5 -2
  11. package/dist/components/containers/CollapseContainer.d.ts +1 -1
  12. package/dist/components/containers/Header.d.ts +1 -0
  13. package/dist/components/elements/Button.d.ts +3 -2
  14. package/dist/components/elements/QRCode.d.ts +4 -1
  15. package/dist/components/elements/RadioButton.d.ts +12 -0
  16. package/dist/components/elements/SegmentPicker.d.ts +1 -1
  17. package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
  18. package/dist/components/elements/ToggleSwitch.d.ts +18 -0
  19. package/dist/components/elements/Video.d.ts +1 -0
  20. package/dist/components/index.d.ts +7 -1
  21. package/dist/components/utils/actionTap.d.ts +15 -7
  22. package/dist/components/utils/helpers.d.ts +9 -9
  23. package/dist/components/utils/state.d.ts +5 -5
  24. package/dist/components/utils/swipe.d.ts +74 -0
  25. package/dist/nami/campaign.d.ts +3 -3
  26. package/dist/nami/flow/NamiFlow.d.ts +10 -6
  27. package/dist/nami/flow/NamiFlowManager.d.ts +1 -1
  28. package/dist/nami/utils/campaign.d.ts +18 -0
  29. package/dist/nami/utils/paywall.d.ts +17 -0
  30. package/dist/nami-web-ssr.d.ts +1 -0
  31. package/dist/nami-web.cjs +100 -38
  32. package/dist/nami-web.mjs +101 -39
  33. package/dist/nami-web.umd.js +101 -39
  34. package/dist/services/storage.service.d.ts +2 -2
  35. package/dist/services/video.service.d.ts +8 -6
  36. package/dist/types/components/containers.d.ts +53 -6
  37. package/dist/types/components/elements.d.ts +1 -1
  38. package/dist/types/components/index.d.ts +8 -5
  39. package/dist/types/conditions.d.ts +16 -14
  40. package/dist/types/externals/product.d.ts +2 -2
  41. package/dist/types/flow.d.ts +30 -7
  42. package/dist/types/paywall.d.ts +5 -6
  43. package/package.json +19 -13
  44. package/dist/nami-web.js +0 -96
@@ -7,7 +7,6 @@ export declare class NamiBackgroundContainer extends NamiElement {
7
7
  inFocusedState: boolean;
8
8
  scaleFactor: number;
9
9
  connectedCallback(): void;
10
- disconnectedCallback(): void;
11
10
  protected styles(): CSSResult;
12
11
  protected updated(): void;
13
12
  render(): 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
- render(): import("lit-html").TemplateResult<1>;
16
+ private handleSlideChange;
17
+ private getCarouselOnChange;
18
+ private getCarouselSlides;
19
+ render(): import("lit").TemplateResult<1>;
17
20
  }
@@ -9,5 +9,5 @@ export declare class NamiCollapseContainer extends NamiElement {
9
9
  private isCollapsed;
10
10
  private _handleClick;
11
11
  protected styles(): CSSResult;
12
- render(): import("lit-html").TemplateResult<1>;
12
+ render(): import("lit").TemplateResult<1>;
13
13
  }
@@ -7,6 +7,7 @@ export declare class NamiHeader extends NamiElement {
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
  }
@@ -14,8 +14,9 @@ export declare class NamiButton extends NamiElement {
14
14
  private _handleFocus;
15
15
  private _handleBlur;
16
16
  private _dispatchFocusChange;
17
- private _handleKeyDown;
17
+ private _dispatchPageChange;
18
+ private _handleKeyUp;
18
19
  private _handleClick;
19
20
  protected styles(): CSSResult;
20
- render(): any[] | import("lit-html").TemplateResult<1>;
21
+ render(): any[] | import("lit").TemplateResult<1>;
21
22
  }
@@ -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
- render(): import("lit-html").TemplateResult<1>;
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
+ }
@@ -8,5 +8,5 @@ export declare class NamiSegmentPicker extends NamiElement {
8
8
  constructor();
9
9
  private _handleClick;
10
10
  protected styles(): CSSResult;
11
- render(): import("lit-html").TemplateResult<1>;
11
+ render(): import("lit").TemplateResult<1>;
12
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-html").TemplateResult<1>;
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
+ }
@@ -6,6 +6,7 @@ export declare class NamiVideo extends NamiElement {
6
6
  inFocusedState: boolean;
7
7
  scaleFactor: number;
8
8
  private bgVideo;
9
+ disconnectedCallback(): void;
9
10
  protected styles(): CSSResult;
10
11
  loadMediaSrc(video: HTMLVideoElement): void;
11
12
  updated(): void;
@@ -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
- export declare const handleAction: (onTap?: UserAction, sku?: NamiSKU, componentChange?: NamiPaywallComponentChange | undefined) => void;
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, TCarouselContainer, TProductContainer, TResponsiveGrid } from "../../types/components/containers";
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 getCarouselSlides(component: TCarouselContainer): TComponent[][];
16
- export declare function conditionComponentMatches(condition: TConditionalComponent): boolean;
17
- export declare function withOverrides<T extends TBaseComponent>({ conditionAttributes, ...component }: T): T;
18
- export declare function valueFromSmartText<T>(value: T, sku?: PaywallSKU, block?: any): T;
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[], productGroups: string[]): boolean;
17
- export declare function checkAnySkuHasPromoOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[], productGroups: string[]): boolean;
18
- export declare function productDetail(details: NamiProductDetails[] | undefined, refId: string): NamiProductDetails | null;
19
- export declare function launchContext(stateContext: NamiPaywallLaunchContext, context?: NamiPaywallLaunchContext): NamiPaywallLaunchContext;
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;
@@ -1,8 +1,8 @@
1
1
  import { AvailableCampaignsResponseHandler } from "../types/campaign";
2
- import { TPaywallLaunchContext, PaywallResultHandler } from "../types/paywall";
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?: TPaywallLaunchContext, resultCallback?: PaywallResultHandler, actionCallback?: NamiPaywallActionHandler): PaywallComponent;
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
  }
@@ -33,19 +35,21 @@ export declare class NamiFlow extends BasicNamiFlow {
33
35
  get nextStepAvailable(): boolean;
34
36
  get previousStepAvailable(): boolean;
35
37
  get previousFlowStep(): NamiFlowStep | undefined;
38
+ get nextFlowStep(): NamiFlowStep | undefined;
36
39
  getStep(stepId: string): NamiFlowStep | undefined;
37
40
  private findStepByType;
38
41
  private isStepActive;
39
42
  finished(): void;
40
43
  back(): void;
44
+ next(): void;
41
45
  private backToPreviousScreenStep;
42
46
  forward(stepId: string): void;
43
- executeLifecycle(step: NamiFlowStep, key: string): void;
47
+ executeLifecycle(step: NamiFlowStep, key: string, data?: Record<string, any>): void;
44
48
  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;
49
+ triggerActions(actionId: string, component?: NamiButton, data?: Record<string, any>): void;
50
+ executeFullLifecycles(lifecycles: NamiFlowOn[], data?: Record<string, any>): void;
51
+ triggerBeforeActions(actionId: string, component?: NamiButton, data?: Record<string, any>): void;
52
+ triggerAfterActions(actionId: string, component?: NamiButton, data?: Record<string, any>): void;
49
53
  currentStepHasHoistedPrimaryActions(actionId: string): boolean;
50
54
  private shouldRun;
51
55
  private performAction;
@@ -1,4 +1,4 @@
1
- import type { NamiFlowEventHandler, NamiFlowHandoffStepHandler } from "../../types/flow";
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';
@@ -4,7 +4,25 @@ import type { TDevice } from '../../types/device';
4
4
  export declare const isValidUrl: (label: string) => boolean;
5
5
  export declare const selectSegment: (segments: NamiCampaignSegment[], splitPosition: number) => NamiCampaignSegment;
6
6
  export declare const mapAnonymousCampaigns: (campaigns: NamiAnonymousCampaign[], splitPosition: number, formFactor?: TDevice) => NamiCampaign[];
7
+ /**
8
+ *
9
+ * @returns A combined list of unique campaigns based on both API and Initial, filtered by form factor.
10
+ * This is used to get all campaigns that are applicable to the current device.
11
+ *
12
+ * Note: Since this function returns a unique list of campaigns, and API campaigns take precedence,
13
+ * there may be times when API campaigns are returned that do not yet have paywalls but initial campaigns would.
14
+ */
7
15
  export declare const allCampaigns: () => NamiCampaign[];
16
+ export declare const getInitialCampaigns: () => NamiCampaign[];
17
+ export declare const getApiCampaigns: () => NamiCampaign[];
18
+ /**
19
+ * Get paywall data from label. This function continues to search for both the campaign and paywall
20
+ * based on the provided label and type. It first checks API data, then falls back to initial data.
21
+ *
22
+ * @param value Campaign label to search for
23
+ * @param type Campaign type to filter by
24
+ * @returns An object containing the currently available campaign and paywall data
25
+ */
8
26
  export declare const getPaywallDataFromLabel: (value: string, type?: string) => {
9
27
  campaign: NamiCampaign | undefined;
10
28
  paywall: IPaywall | undefined;
@@ -1,4 +1,21 @@
1
1
  import { IPaywall } from "../../types/paywall";
2
+ /**
3
+ * Get initial paywalls from storage service.
4
+ * @returns An array of initial paywalls from storage service.
5
+ */
6
+ export declare const getInitialPaywalls: () => IPaywall[];
7
+ /**
8
+ * Get all API paywalls from storage service.
9
+ * @returns An array of API paywalls from storage service.
10
+ */
11
+ export declare const getApiPaywalls: () => IPaywall[];
12
+ /**
13
+ * Get all paywalls from both API and Initial sources, ensuring uniqueness.
14
+ * This function combines paywalls from both sources and filters out duplicates.
15
+ * API Data takes precedence over Initial Data.
16
+ *
17
+ * @returns A combined list of unique paywalls based on both API and Initial data.
18
+ */
2
19
  export declare const allPaywalls: () => IPaywall[];
3
20
  export declare const getPaywall: (paywallId: string) => IPaywall | undefined;
4
21
  export declare const hasAllPaywalls: (paywallIds: string[]) => boolean;
@@ -0,0 +1 @@
1
+ export * from './nami-web';