@namiml/web-sdk 1.7.1 → 1.7.3

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 (42) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/components/ContextProvider.d.ts +1 -0
  3. package/dist/components/Paywall.d.ts +1 -0
  4. package/dist/components/PaywallScreen.d.ts +1 -0
  5. package/dist/components/TemplateComponent.d.ts +2 -1
  6. package/dist/components/containers/BackgroundContainer.d.ts +2 -0
  7. package/dist/components/containers/CarouselContainer.d.ts +2 -0
  8. package/dist/components/containers/CollapseContainer.d.ts +2 -0
  9. package/dist/components/containers/Container.d.ts +3 -1
  10. package/dist/components/containers/Content.d.ts +2 -0
  11. package/dist/components/containers/Footer.d.ts +2 -0
  12. package/dist/components/containers/Header.d.ts +2 -0
  13. package/dist/components/containers/ProductContainer.d.ts +2 -0
  14. package/dist/components/containers/ResponsiveGrid.d.ts +2 -0
  15. package/dist/components/elements/Button.d.ts +2 -0
  16. package/dist/components/elements/PlayPauseButton.d.ts +2 -0
  17. package/dist/components/elements/SegmentPicker.d.ts +2 -0
  18. package/dist/components/elements/Spacer.d.ts +2 -0
  19. package/dist/components/elements/Stack.d.ts +2 -0
  20. package/dist/components/elements/Text.d.ts +3 -0
  21. package/dist/components/elements/VolumeButton.d.ts +2 -0
  22. package/dist/components/utils/styles.d.ts +6 -3
  23. package/dist/nami/campaign.d.ts +23 -0
  24. package/dist/nami/namiRefs.d.ts +2 -0
  25. package/dist/nami/paywalls.d.ts +2 -0
  26. package/dist/nami/utils/resolvers/FlowLiquidResolver.d.ts +1 -0
  27. package/dist/nami/utils/resolvers/URLParamsResolver.d.ts +7 -0
  28. package/dist/nami-web.cjs +31 -27
  29. package/dist/nami-web.mjs +31 -27
  30. package/dist/nami-web.umd.js +33 -29
  31. package/dist/repositories/campaignRule.repository.d.ts +4 -2
  32. package/dist/repositories/device.repository.d.ts +4 -1
  33. package/dist/services/storage.service.d.ts +3 -0
  34. package/dist/types/api.d.ts +2 -0
  35. package/dist/types/components/containers.d.ts +1 -0
  36. package/dist/types/externals/paywall.d.ts +1 -0
  37. package/dist/types/paywall.d.ts +5 -5
  38. package/dist/utils/const.d.ts +1 -1
  39. package/dist/utils/device.d.ts +4 -0
  40. package/dist/utils/parsers.d.ts +9 -0
  41. package/dist/utils/url-params.d.ts +11 -0
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Nami Web SDK Changelog
2
2
 
3
+ ## 1.7.3
4
+ **Release Date:** October 13, 2025
5
+
6
+ ### Bug Fixes
7
+ - Fix issue with hidden components not being hidden
8
+ - Fix issue with deeplink handler
9
+ - Fix issue preventing black bar and double scrolling in certain situations
10
+
11
+ ### Enhancements
12
+ - Swipe and animation improements
13
+ - Support for custom carousel indicators
14
+ - Add support for launch id to group flow transitions
15
+ - Add support for disabled field on toggle switch
16
+ - Add `NamiCampaignManager.isFlow` for checking if a placement is a flow or not
17
+
18
+ ## 1.7.2
19
+ **Release Date:** September 17, 2025
20
+
21
+ ### Enhancements
22
+ - Improve handling of device creation failures and latency
23
+ - Add `disableCampaignUpdates` namiCommand
24
+ - Add forced A/B testing via `splitPosition` namiCommand
25
+ - Standardize `NamiPaywallManager.emitter`
26
+ - Support smart variables derived from URL query parameters and related analytics
27
+
28
+ ### Bug Fixes
29
+ - Fix CTV scaling and spacing issues
30
+ - Styling improvements
31
+
3
32
  ## 1.7.1
4
33
  **Release Date:** September 3, 2025
5
34
 
@@ -18,6 +18,7 @@ export declare class PaywallContextProvider extends EventTarget implements React
18
18
  filteredSkuMenus: ISkuMenu[];
19
19
  static create(paywall: IPaywall, context: NamiPaywallLaunchContext, campaign: NamiCampaign): PaywallContextProvider;
20
20
  static remove(provider: PaywallContextProvider): void;
21
+ static get currentProvider(): PaywallContextProvider | undefined;
21
22
  static setCustomerAttribute(attributes: {
22
23
  [key: string]: string;
23
24
  }): void;
@@ -18,6 +18,7 @@ declare class PaywallComponent extends LitElement {
18
18
  private value;
19
19
  private animation;
20
20
  private _originalBodyStyles;
21
+ private _originalDocumentStyles;
21
22
  private _swipeHandler;
22
23
  constructor(type: string | undefined, value: string, context: NamiPaywallLaunchContext);
23
24
  setPaywallData(): void;
@@ -8,6 +8,7 @@ export declare class NamiPaywallScreen extends LitElement {
8
8
  context: TPaywallLaunchContext;
9
9
  private contextProvider;
10
10
  private contextConsumer;
11
+ private minSDKVersion;
11
12
  timeSpentOnPaywall: number;
12
13
  flow?: NamiFlow;
13
14
  private teardownEvent;
@@ -1,3 +1,4 @@
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;
3
+ import type { TSemverObj } from "../utils/parsers";
4
+ export declare function TemplateComponent(contextProvider: PaywallContextProvider, component: TComponent, scaleFactor: number, inFocusedState?: boolean, minSDKVersion?: TSemverObj): any;
@@ -1,11 +1,13 @@
1
1
  import { TContainer } from "../../types/components";
2
2
  import { NamiElement } from "../NamiElement";
3
3
  import { CSSResult } from "lit";
4
+ import type { TSemverObj } from "../../utils/parsers";
4
5
  export declare class NamiBackgroundContainer extends NamiElement {
5
6
  component: TContainer;
6
7
  fullscreen: boolean;
7
8
  inFocusedState: boolean;
8
9
  scaleFactor: number;
10
+ minSDKVersion: TSemverObj;
9
11
  connectedCallback(): void;
10
12
  protected styles(): CSSResult;
11
13
  protected updated(): void;
@@ -2,10 +2,12 @@ import { CSSResult } from 'lit';
2
2
  import Swiper from 'swiper';
3
3
  import type { TCarouselContainer } from '../../types/components/containers';
4
4
  import { NamiElement } from '../NamiElement';
5
+ import type { TSemverObj } from '../../utils/parsers';
5
6
  export declare class NamiCarouselContainer extends NamiElement {
6
7
  component: TCarouselContainer;
7
8
  inFocusedState: boolean;
8
9
  scaleFactor: number;
10
+ minSDKVersion: TSemverObj;
9
11
  swiperInstance: Swiper;
10
12
  slideSpacing: number;
11
13
  connectedCallback(): void;
@@ -1,11 +1,13 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { NamiElement } from '../NamiElement';
3
3
  import { TCollapseContainer } from '../../types/components/containers';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiCollapseContainer extends NamiElement {
5
6
  component: TCollapseContainer;
6
7
  inFocusedState: boolean;
7
8
  height: number;
8
9
  scaleFactor: number;
10
+ minSDKVersion: TSemverObj;
9
11
  private isCollapsed;
10
12
  private _handleClick;
11
13
  protected styles(): CSSResult;
@@ -1,11 +1,13 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { TContainer } from '../../types/components';
3
3
  import { NamiElement } from '../NamiElement';
4
- import { TProductContainer } from '../../types/components/containers';
4
+ import type { TProductContainer } from '../../types/components/containers';
5
+ import type { TSemverObj } from '../../utils/parsers';
5
6
  export declare class NamiContainer extends NamiElement {
6
7
  component: TContainer | TProductContainer;
7
8
  inFocusedState: boolean;
8
9
  scaleFactor: number;
10
+ minSDKVersion: TSemverObj;
9
11
  constructor();
10
12
  protected styles(): CSSResult;
11
13
  render(): any[];
@@ -1,11 +1,13 @@
1
1
  import { CSSResult } from "lit";
2
2
  import { NamiElement } from "../NamiElement";
3
3
  import { TContainer } from "../../types/components";
4
+ import type { TSemverObj } from "../../utils/parsers";
4
5
  export declare class NamiContentContainer extends NamiElement {
5
6
  component: TContainer;
6
7
  zIndex: number;
7
8
  inFocusedState: boolean;
8
9
  scaleFactor: number;
10
+ minSDKVersion: TSemverObj;
9
11
  protected styles(): CSSResult;
10
12
  firstUpdated(): void;
11
13
  render(): any[];
@@ -1,11 +1,13 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { NamiElementBase } from '../NamiElement';
3
3
  import { THeaderFooter } from '../../types/components/containers';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiFooter extends NamiElementBase {
5
6
  components: THeaderFooter;
6
7
  zIndex: string;
7
8
  inFocusedState: boolean;
8
9
  scaleFactor: number;
10
+ minSDKVersion: TSemverObj;
9
11
  protected styles(): CSSResult;
10
12
  render(): any[];
11
13
  }
@@ -1,12 +1,14 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { NamiElementBase } from '../NamiElement';
3
3
  import { THeaderFooter } from '../../types/components/containers';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiHeader extends NamiElementBase {
5
6
  components: THeaderFooter;
6
7
  zIndex: string;
7
8
  inFullScreen: boolean;
8
9
  inFocusedState: boolean;
9
10
  scaleFactor: number;
11
+ minSDKVersion: TSemverObj;
10
12
  private formFactor;
11
13
  protected styles(): CSSResult;
12
14
  render(): any[];
@@ -1,10 +1,12 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { NamiElement } from '../NamiElement';
3
3
  import { TProductContainer } from '../../types/components/containers';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiProductContainer extends NamiElement {
5
6
  component: TProductContainer;
6
7
  inFocusedState: boolean;
7
8
  scaleFactor: number;
9
+ minSDKVersion: TSemverObj;
8
10
  private currentGroupId;
9
11
  protected styles(): CSSResult;
10
12
  updated(): void;
@@ -1,10 +1,12 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { NamiElement } from '../NamiElement';
3
3
  import { TResponsiveGrid } from '../../types/components/containers';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiResponsiveGrid extends NamiElement {
5
6
  component: TResponsiveGrid;
6
7
  inFocusedState: boolean;
7
8
  scaleFactor: number;
9
+ minSDKVersion: TSemverObj;
8
10
  private mouseDown;
9
11
  private startX;
10
12
  scrollLeft: any;
@@ -1,10 +1,12 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { TButtonContainer } from '../../types/components/containers';
3
3
  import { NamiElement } from '../NamiElement';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiButton extends NamiElement {
5
6
  component: TButtonContainer;
6
7
  inFocusedState: boolean;
7
8
  scaleFactor: number;
9
+ minSDKVersion: TSemverObj;
8
10
  constructor();
9
11
  firstTextValue(): string | undefined;
10
12
  connectedCallback(): void;
@@ -1,10 +1,12 @@
1
1
  import { TPlayPauseButton } from '../../types/components/containers';
2
2
  import { NamiElement } from '../NamiElement';
3
3
  import { CSSResult } from 'lit';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiPlayPauseButton extends NamiElement {
5
6
  component: TPlayPauseButton;
6
7
  inFocusedState: boolean;
7
8
  scaleFactor: number;
9
+ minSDKVersion: TSemverObj;
8
10
  private playing;
9
11
  constructor();
10
12
  private _handleFocus;
@@ -1,10 +1,12 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { TSegmentPicker } from '../../types/components/elements';
3
3
  import { NamiElement } from '../NamiElement';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiSegmentPicker extends NamiElement {
5
6
  component: TSegmentPicker;
6
7
  inFocusedState: boolean;
7
8
  scaleFactor: number;
9
+ minSDKVersion: TSemverObj;
8
10
  constructor();
9
11
  private _handleClick;
10
12
  protected styles(): CSSResult;
@@ -1,10 +1,12 @@
1
1
  import { CSSResult, TemplateResult } from 'lit';
2
2
  import { NamiElement } from '../NamiElement';
3
3
  import { TSpacerComponent } from '../../types/components/elements';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiSpacer extends NamiElement {
5
6
  component: TSpacerComponent;
6
7
  inFocusedState: boolean;
7
8
  scaleFactor: number;
9
+ minSDKVersion: TSemverObj;
8
10
  protected styles(): CSSResult;
9
11
  render(): TemplateResult;
10
12
  }
@@ -1,9 +1,11 @@
1
1
  import { NamiElement } from "../NamiElement";
2
2
  import { TStack } from "../../types/components/containers";
3
+ import type { TSemverObj } from "../../utils/parsers";
3
4
  export declare class NamiStack extends NamiElement {
4
5
  component: TStack;
5
6
  inFocusedState: boolean;
6
7
  scaleFactor: number;
8
+ minSDKVersion: TSemverObj;
7
9
  protected styles(): import("lit").CSSResult;
8
10
  protected render(): any[];
9
11
  }
@@ -1,16 +1,19 @@
1
1
  import { TemplateResult, CSSResult } from 'lit';
2
2
  import { TSymbolComponent, TTextComponent, TTextListComponent } from '../../types/components/elements';
3
3
  import { NamiElement } from '../NamiElement';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiText extends NamiElement {
5
6
  component: TTextComponent;
6
7
  inFocusedState: boolean;
7
8
  scaleFactor: number;
9
+ minSDKVersion: TSemverObj;
8
10
  protected styles(): CSSResult;
9
11
  render(): TemplateResult;
10
12
  }
11
13
  export declare class TextListItemWrapper extends NamiElement {
12
14
  component: TTextListComponent;
13
15
  inFocusedState: boolean;
16
+ scaleFactor: number;
14
17
  protected styles(): CSSResult;
15
18
  render(): TemplateResult;
16
19
  }
@@ -1,10 +1,12 @@
1
1
  import { TVolumeButton } from '../../types/components/containers';
2
2
  import { NamiElement } from '../NamiElement';
3
3
  import { CSSResult } from 'lit';
4
+ import type { TSemverObj } from '../../utils/parsers';
4
5
  export declare class NamiVolumeButton extends NamiElement {
5
6
  component: TVolumeButton;
6
7
  inFocusedState: boolean;
7
8
  scaleFactor: number;
9
+ minSDKVersion: TSemverObj;
8
10
  private muted;
9
11
  constructor();
10
12
  private _handleFocus;
@@ -1,11 +1,14 @@
1
- import { TCarouselContainer } from "../../types/components/containers";
2
- import { TBaseComponent, TContainerPosition } from "../../types/components";
3
- import { TSegmentPickerItem, TTextLikeComponent } from "../../types/components/elements";
1
+ import type { TCarouselContainer } from "../../types/components/containers";
2
+ import { type TBaseComponent, type TContainerPosition } from "../../types/components";
3
+ import type { TSegmentPickerItem, TTextLikeComponent } from "../../types/components/elements";
4
+ import type { TSemverObj } from "../../utils/parsers";
4
5
  export declare function parseSize(value: string | number, scaleFactor: number): string;
5
6
  export declare function backgroundColor(value: string, fallback?: string): string;
6
7
  export declare function pickAndApplyBackgroundColor(component: TBaseComponent, inFocusedState?: boolean): string;
7
8
  export declare function flexDirection({ direction }: TBaseComponent): string;
8
9
  export declare function alignAndJustifyItems(component: TBaseComponent): string;
10
+ export declare function applyTextWidth(minSDKVersion: TSemverObj): string;
11
+ export declare function applyChildSizing(minSDKVersion: TSemverObj, sizeKey: string): string;
9
12
  export declare function applyTextOverflow(component: TTextLikeComponent): string;
10
13
  export declare function transition(): string;
11
14
  export declare function grow({ grow }: TBaseComponent): string;
@@ -23,6 +23,15 @@ export declare class NamiCampaignManager {
23
23
  * @returns {boolean} True if the campaign is available, False otherwise.
24
24
  */
25
25
  static isCampaignAvailable(label: string): boolean;
26
+ /**
27
+ * Checks if a campaign is a Flow campaign for a given argument.
28
+ * The argument can be a label string, or a deeplink URL.
29
+ *
30
+ * @param label - The label of the campaign to check. Can be a label string.
31
+ * @param withUrl - The deeplink URL of the campaign to check.
32
+ * @returns {boolean} True if the campaign is a Flow campaign, False otherwise.
33
+ */
34
+ static isFlow(label?: string, withUrl?: string): boolean;
26
35
  /**
27
36
  * Fetches the latest active campaigns for the current device.
28
37
  *
@@ -56,6 +65,20 @@ export declare class NamiCampaignManager {
56
65
  * @return List of product groups associated with the specified campaign placement.
57
66
  */
58
67
  static getProductGroups(label?: string, withUrl?: string): string[];
68
+ /**
69
+ * Get all product SKUs associated with the provided placement label or URL.
70
+ * @param label Campaign placement label defined in Nami Control Center for launching a specific campaign.
71
+ * @param withUrl Campaign placement URI defined in Nami Control Center for launching a specific campaign.
72
+ * @returns List of product SKUs associated with the specified campaign placement.
73
+ */
74
+ static getAllProducts(label?: string, withUrl?: string): string[];
75
+ /**
76
+ * Get the list of currently active product SKUs associated with the provided placement label or URL.
77
+ * @param label Campaign placement label defined in Nami Control Center for launching a specific campaign.
78
+ * @param withUrl Campaign placement URI defined in Nami Control Center for launching a specific campaign.
79
+ * @returns List of current product SKUs associated with the specified campaign placement.
80
+ */
81
+ static getCurrentProducts(label?: string, withUrl?: string): string[];
59
82
  /**
60
83
  * Private Instance Methods
61
84
  */
@@ -3,6 +3,8 @@ export declare class NamiRefs {
3
3
  static instance: NamiRefs;
4
4
  init(config: NamiConfiguration): Promise<void>;
5
5
  private setInitialValues;
6
+ private initAnonymousDevice;
7
+ private initIdentifiedDevice;
6
8
  private initAndFetchRequiredData;
7
9
  private reRenderPaywall;
8
10
  }
@@ -1,5 +1,6 @@
1
1
  import { IPaywall } from "../types/paywall";
2
2
  import { NamiProductDetails } from "../types/externals/product";
3
+ import { NamiEventEmitter } from "./emitter";
3
4
  import { Callback, CloseHandler, DeepLinkUrlHandler, SKUActionHandler } from "../types/components/containers";
4
5
  import { NamiPurchaseDetails } from "../types/externals/purchase";
5
6
  /**
@@ -8,6 +9,7 @@ import { NamiPurchaseDetails } from "../types/externals/purchase";
8
9
  */
9
10
  export declare class NamiPaywallManager {
10
11
  static instance: NamiPaywallManager;
12
+ static emitter: NamiEventEmitter;
11
13
  private emitter;
12
14
  productDetails: NamiProductDetails[];
13
15
  /**
@@ -5,6 +5,7 @@ import type { NamiFlowManager } from "../../../nami/flow/NamiFlowManager";
5
5
  */
6
6
  export declare class FlowLiquidResolver {
7
7
  flowManager: NamiFlowManager;
8
+ urlParams: Record<string, string>;
8
9
  constructor(flowManager: NamiFlowManager);
9
10
  resolve(key: string): string | undefined;
10
11
  /**
@@ -0,0 +1,7 @@
1
+ import { BaseNamespaceResolver } from "./BaseNameSpaceResolver";
2
+ export declare class URLParamsResolver extends BaseNamespaceResolver {
3
+ protected readonly namespace = "urlParams";
4
+ private readonly context;
5
+ constructor();
6
+ protected resolveValue(keyPath: string): any;
7
+ }