@namiml/web-sdk 3.5.0-dev.202611011853 → 3.5.0-dev.202611021820

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.
@@ -0,0 +1,8 @@
1
+ import type { PaywallComponent } from '../components/Paywall';
2
+ /** Mounts `element` over the page (its `:host` is fixed, full viewport), replacing any previous one. */
3
+ export declare function mountPresented(element: PaywallComponent): void;
4
+ /**
5
+ * Removes the SDK-presented paywall, finishing its flow first when that flow is still the open one
6
+ * (a close tapped mid-flow), so the flow does not stay open behind it. Returns whether one was mounted.
7
+ */
8
+ export declare function dismissPresented(): boolean;
@@ -15,5 +15,8 @@ export declare class WebDeviceAdapter implements IDeviceAdapter {
15
15
  * analogue of an app returning from the background. Inert server-side.
16
16
  */
17
17
  onAppForeground(listener: () => void): () => void;
18
+ /** Background = the tab becoming hidden (`visibilitychange` → `hidden`). Inert server-side. */
19
+ onAppBackground(listener: () => void): () => void;
20
+ isAppVisible(): boolean;
18
21
  generateUUID(): string;
19
22
  }
@@ -1,9 +1,16 @@
1
1
  import type { IUIAdapter, PaywallHandle, FlowNavigationOptions } from '@namiml/sdk-core';
2
2
  import type { IPaywall } from '@namiml/sdk-core';
3
- import type { NamiPaywallLaunchContext } from '@namiml/sdk-core';
3
+ import type { NamiCampaign, NamiPaywallLaunchContext } from '@namiml/sdk-core';
4
4
  export declare class WebUIAdapter implements IUIAdapter {
5
5
  createPaywall(type: string | undefined, value: string, context: NamiPaywallLaunchContext): PaywallHandle;
6
6
  reRenderPaywall(): void;
7
7
  flowNavigateToScreen(paywall: IPaywall, options: FlowNavigationOptions): void;
8
8
  postConfigure(): void;
9
+ /**
10
+ * Mounts a journey's paywall on `document.body` (NAM-3233). Unlike `launch()`, there is no host
11
+ * call to hand the element to, so the SDK mounts it and removes it on close or flow finish.
12
+ */
13
+ presentCampaign(campaign: NamiCampaign, context: NamiPaywallLaunchContext): boolean;
14
+ onFlowFinished(): void;
15
+ onReset(): void;
9
16
  }
@@ -13,6 +13,7 @@ declare class PaywallComponent extends LitElement {
13
13
  private timeSpentOnPaywall;
14
14
  private type;
15
15
  private value;
16
+ private presetCampaign?;
16
17
  private animation;
17
18
  private _originalBodyStyles;
18
19
  private _originalDocumentStyles;
@@ -24,7 +25,7 @@ declare class PaywallComponent extends LitElement {
24
25
  private _dismissThreshold;
25
26
  private _detachFocusSpeechListeners?;
26
27
  private _boundHandleKeyDownEvent;
27
- constructor(type: string | undefined, value: string, context: NamiPaywallLaunchContext);
28
+ constructor(type: string | undefined, value: string, context: NamiPaywallLaunchContext, campaign?: NamiCampaign);
28
29
  private applyPresentationHostClasses;
29
30
  setPaywallData(): void;
30
31
  private getPresentationStyle;