@namiml/web-sdk 1.3.2 → 1.5.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 (86) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/components/ContextConsumer.d.ts +1 -1
  3. package/dist/components/ContextProvider.d.ts +7 -7
  4. package/dist/components/Paywall.d.ts +5 -4
  5. package/dist/components/TemplateComponent.d.ts +1 -1
  6. package/dist/components/containers/BackgroundContainer.d.ts +2 -1
  7. package/dist/components/containers/CarouselContainer.d.ts +9 -0
  8. package/dist/components/containers/CollapseContainer.d.ts +1 -1
  9. package/dist/components/containers/Container.d.ts +6 -2
  10. package/dist/components/containers/Content.d.ts +1 -1
  11. package/dist/components/containers/Footer.d.ts +1 -1
  12. package/dist/components/containers/Header.d.ts +1 -1
  13. package/dist/components/containers/ProductContainer.d.ts +1 -1
  14. package/dist/components/containers/ResponsiveGrid.d.ts +17 -0
  15. package/dist/components/elements/Button.d.ts +4 -1
  16. package/dist/components/elements/Image.d.ts +1 -1
  17. package/dist/components/elements/PlayPauseButton.d.ts +15 -0
  18. package/dist/components/elements/SegmentPicker.d.ts +1 -1
  19. package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
  20. package/dist/components/elements/Spacer.d.ts +1 -1
  21. package/dist/components/elements/Text.d.ts +1 -1
  22. package/dist/components/elements/Video.d.ts +2 -1
  23. package/dist/components/elements/VolumeButton.d.ts +15 -0
  24. package/dist/components/index.d.ts +9 -1
  25. package/dist/components/productDetails.d.ts +2 -2
  26. package/dist/components/utils/actionTap.d.ts +2 -2
  27. package/dist/components/utils/dateTIme.d.ts +3 -0
  28. package/dist/components/utils/eventConst.d.ts +1 -1
  29. package/dist/components/utils/helpers.d.ts +9 -6
  30. package/dist/components/utils/impression.d.ts +2 -2
  31. package/dist/components/utils/products.d.ts +4 -3
  32. package/dist/components/utils/state.d.ts +6 -6
  33. package/dist/components/utils/styles.d.ts +5 -3
  34. package/dist/nami/api.d.ts +4 -3
  35. package/dist/nami/campaign.d.ts +36 -10
  36. package/dist/nami/customer.d.ts +58 -14
  37. package/dist/nami/emitter.d.ts +1 -0
  38. package/dist/nami/entitlement.d.ts +22 -5
  39. package/dist/nami/index.d.ts +7 -1
  40. package/dist/nami/namiRefs.d.ts +1 -1
  41. package/dist/nami/paywalls.d.ts +49 -18
  42. package/dist/nami/purchase.d.ts +5 -1
  43. package/dist/nami/utils/campaign.d.ts +2 -2
  44. package/dist/nami/utils/entitlement.d.ts +4 -4
  45. package/dist/nami/utils/paywall.d.ts +1 -1
  46. package/dist/nami/utils/purchase.d.ts +2 -2
  47. package/dist/nami-web.cjs +22 -15
  48. package/dist/nami-web.d.ts +8 -880
  49. package/dist/nami-web.js +22 -15
  50. package/dist/nami-web.mjs +22 -15
  51. package/dist/nami-web.umd.js +22 -15
  52. package/dist/repositories/campaignRule.repository.d.ts +3 -3
  53. package/dist/repositories/config.repository.d.ts +1 -1
  54. package/dist/repositories/customerJourney.repository.d.ts +5 -0
  55. package/dist/repositories/device.repository.d.ts +1 -1
  56. package/dist/repositories/entitlement.repository.d.ts +1 -1
  57. package/dist/repositories/paywall.repository.d.ts +1 -1
  58. package/dist/repositories/products.repository.d.ts +1 -1
  59. package/dist/services/logger.service.d.ts +1 -1
  60. package/dist/services/storage.service.d.ts +7 -1
  61. package/dist/services/video.service.d.ts +17 -0
  62. package/dist/types/components/containers.d.ts +35 -4
  63. package/dist/types/components/elements.d.ts +1 -0
  64. package/dist/types/components/index.d.ts +4 -2
  65. package/dist/types/config.d.ts +2 -2
  66. package/dist/types/customer.d.ts +2 -0
  67. package/dist/types/entitlements.d.ts +2 -0
  68. package/dist/types/externals/campaign.d.ts +9 -1
  69. package/dist/types/externals/config.d.ts +27 -1
  70. package/dist/types/externals/customer.d.ts +18 -0
  71. package/dist/types/externals/entitlement.d.ts +27 -0
  72. package/dist/types/externals/index.d.ts +3 -0
  73. package/dist/types/externals/languages.d.ts +197 -1
  74. package/dist/types/{loglevel.d.ts → externals/loglevel.d.ts} +3 -0
  75. package/dist/types/externals/paywall.d.ts +32 -0
  76. package/dist/types/externals/product.d.ts +4 -0
  77. package/dist/types/externals/purchase.d.ts +24 -0
  78. package/dist/types/externals/sku.d.ts +14 -0
  79. package/dist/types/paywall.d.ts +4 -3
  80. package/dist/types/profile.d.ts +2 -1
  81. package/dist/utils/config.d.ts +2 -1
  82. package/dist/utils/const.d.ts +1 -1
  83. package/dist/utils/device.d.ts +1 -1
  84. package/dist/utils/fonts.d.ts +1 -1
  85. package/package.json +6 -4
  86. /package/dist/types/{errors.d.ts → externals/errors.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.0 (September 26, 2024)
4
+
5
+ ## New Features
6
+ - Support for advanced video features
7
+ - Support for carousel component
8
+
9
+ ## Enhancements
10
+ - Improve fallback data handling
11
+ - Support repeatable list inside collapse component
12
+ - Support vertical alignment on product container
13
+ - Align `removeAllListeners` behavior with RN SDK
14
+
15
+ ## Bugfixes
16
+ - Fix segment picker cursor
17
+ - Fix hidden component handling
18
+ - Fix responsive grid spacing and scrolling
19
+ - Fix background video and gradient container
20
+ - Fix background video position
21
+
22
+ ## 1.4.0 (September 5, 2024)
23
+
24
+ ## New Features
25
+ - Support for HLS in Video component
26
+ - Support for Responsive Grid component
27
+ - Add `NamiCustomerManager.deviceId`
28
+ - Add `NamiCustomerManager.registerJourneyStateHandler`, `journeyState` (subscription management-only)
29
+ - Add `NamiEntitlementManager.clearProvisionalEntitlementGrants` (subscription management-only)
30
+
31
+ ## Enhancements
32
+ - Allow passing product groups to paywall via campaign launch
33
+
34
+ ## Bug Fixes
35
+ - Find product by id rather than name
36
+ - Fix text component spacing issue
37
+
38
+ ## Improvements
39
+ - Modify type definitions for `NamiPaywallManager.registerSignInHandler`, `NamiPaywallManager.registerCloseHandler`, `NamiPaywallManager.registerBuySkuHandler`, `NamiPaywallManager.registerDeeplinkActionHandler`, `NamiCustomerManager.registerAccountStateHandler`, `NamiCampaignManager.launch` handlers to match Nami React Native SDK
40
+
3
41
  ## 1.3.2 (August 14, 2024)
4
42
 
5
43
  ### Bug Fixes
@@ -1,5 +1,5 @@
1
1
  import { ReactiveController, ReactiveControllerHost } from 'lit';
2
- import { TPaywallContext } from 'src/types/paywall';
2
+ import { TPaywallContext } from '../types/paywall';
3
3
  declare class ContextConsumer implements ReactiveController {
4
4
  host: ReactiveControllerHost;
5
5
  state: TPaywallContext;
@@ -1,11 +1,11 @@
1
1
  import { ReactiveController, ReactiveControllerHost } from 'lit';
2
- import { IPaywall, NamiAppSuppliedVideoDetails, TPaywallContext, TPaywallLaunchContext, TPaywallMedia } from 'src/types/paywall';
3
- import { NamiProductDetails } from 'src/types/externals/product';
4
- import { NamiSKU } from 'src/types/externals/sku';
5
- import { NamiCampaign } from 'src/types/externals/campaign';
6
- import { TDevice } from 'src/types/device';
2
+ import { IPaywall, NamiAppSuppliedVideoDetails, TPaywallContext, TPaywallLaunchContext, TPaywallMedia } from '../types/paywall';
3
+ import { NamiProductDetails } from '../types/externals/product';
4
+ import { NamiSKU } from '../types/externals/sku';
5
+ import { NamiCampaign } from '../types/externals/campaign';
6
+ import { TDevice } from '../types/device';
7
+ import { Callback } from '../types/components/containers';
7
8
  export declare const initialState: TPaywallContext;
8
- type Callback = () => void;
9
9
  declare class ContextProvider implements ReactiveController {
10
10
  host: ReactiveControllerHost | null;
11
11
  state: TPaywallContext;
@@ -20,7 +20,7 @@ declare class ContextProvider implements ReactiveController {
20
20
  setProductDetails(details: NamiProductDetails[]): void;
21
21
  getProductDetails(): NamiProductDetails[];
22
22
  setCurrentGroupId(currentGroupId: string): void;
23
- currentGroupId(): string;
23
+ getCurrentGroupId(): string;
24
24
  setSelectedProdcuts(products: {
25
25
  [currentGroupId: string]: string;
26
26
  }): void;
@@ -1,15 +1,16 @@
1
- import { IPaywall, TPaywallLaunchContext } from 'src/types/paywall';
2
- import { TDevice } from 'src/types/device';
1
+ import { IPaywall, TPaywallLaunchContext } from '../types/paywall';
2
+ import { TDevice } from '../types/device';
3
3
  import { NamiElement } from './NamiElement';
4
4
  import { TemplateResult } from 'lit';
5
- import { NamiCampaign } from 'src/types/externals/campaign';
6
- import { NamiPaywallEvent } from 'src/types/externals/paywall';
5
+ import { NamiCampaign } from '../types/externals/campaign';
6
+ import { NamiPaywallEvent } from '../types/externals/paywall';
7
7
  declare class PaywallComponent extends NamiElement {
8
8
  formFactor: TDevice;
9
9
  campaign: NamiCampaign;
10
10
  paywall: IPaywall;
11
11
  paywallEvent: Partial<NamiPaywallEvent>;
12
12
  constructor(paywall: IPaywall, event: Partial<NamiPaywallEvent>, campaign?: NamiCampaign, context?: TPaywallLaunchContext);
13
+ disconnectedCallback(): void;
13
14
  setPaywallData(paywall: IPaywall, campaign: NamiCampaign): void;
14
15
  firstUpdated(): void;
15
16
  private postImpression;
@@ -1,2 +1,2 @@
1
- import { TComponent } from "src/types/components";
1
+ import { TComponent } from "../types/components";
2
2
  export declare function TemplateComponent(component: TComponent, inFocusedState?: boolean): any;
@@ -1,4 +1,4 @@
1
- import { TContainer } from "src/types/components";
1
+ import { TContainer } from "../../types/components";
2
2
  import { NamiElement } from "../NamiElement";
3
3
  import { CSSResult } from "lit";
4
4
  export declare class NamiBackgroundContainer extends NamiElement {
@@ -6,5 +6,6 @@ export declare class NamiBackgroundContainer extends NamiElement {
6
6
  fullscreen: boolean;
7
7
  inFocusedState: boolean;
8
8
  protected styles(): CSSResult;
9
+ protected updated(): void;
9
10
  render(): any[];
10
11
  }
@@ -0,0 +1,9 @@
1
+ import { CSSResult } from 'lit';
2
+ import { TCarouselContainer } from '../../types/components/containers';
3
+ import { NamiElement } from '../NamiElement';
4
+ export declare class NamiCarouselContainer extends NamiElement {
5
+ component: TCarouselContainer;
6
+ inFocusedState: boolean;
7
+ protected styles(): CSSResult;
8
+ render(): import("lit-html").TemplateResult<1>;
9
+ }
@@ -1,6 +1,6 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { NamiElement } from '../NamiElement';
3
- import { TCollapseContainer } from 'src/types/components/containers';
3
+ import { TCollapseContainer } from '../../types/components/containers';
4
4
  export declare class NamiCollapseContainer extends NamiElement {
5
5
  component: TCollapseContainer;
6
6
  inFocusedState: boolean;
@@ -1,10 +1,14 @@
1
1
  import { CSSResult } from 'lit';
2
- import { TContainer } from 'src/types/components';
2
+ import { TContainer } from '../../types/components';
3
3
  import { NamiElement } from '../NamiElement';
4
- import { TProductContainer } from 'src/types/components/containers';
4
+ import { TProductContainer } from '../../types/components/containers';
5
5
  export declare class NamiContainer extends NamiElement {
6
6
  component: TContainer | TProductContainer;
7
7
  inFocusedState: boolean;
8
+ constructor();
9
+ private _handleFocusChanged;
10
+ private _handleFocus;
11
+ private _handleBlur;
8
12
  protected styles(): CSSResult;
9
13
  render(): any[];
10
14
  }
@@ -1,6 +1,6 @@
1
1
  import { CSSResult } from "lit";
2
2
  import { NamiElement } from "../NamiElement";
3
- import { TContainer } from "src/types/components";
3
+ import { TContainer } from "../../types/components";
4
4
  export declare class NamiContentContainer extends NamiElement {
5
5
  component: TContainer;
6
6
  zIndex: number;
@@ -1,6 +1,6 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { NamiElement } from '../NamiElement';
3
- import { THeaderFooter } from 'src/types/components/containers';
3
+ import { THeaderFooter } from '../../types/components/containers';
4
4
  export declare class NamiFooter extends NamiElement {
5
5
  components: THeaderFooter;
6
6
  zIndex: string;
@@ -1,6 +1,6 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { NamiElement } from '../NamiElement';
3
- import { THeaderFooter } from 'src/types/components/containers';
3
+ import { THeaderFooter } from '../../types/components/containers';
4
4
  export declare class NamiHeader extends NamiElement {
5
5
  components: THeaderFooter;
6
6
  zIndex: string;
@@ -1,6 +1,6 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { NamiElement } from '../NamiElement';
3
- import { TProductContainer } from 'src/types/components/containers';
3
+ import { TProductContainer } from '../../types/components/containers';
4
4
  export declare class NamiProductContainer extends NamiElement {
5
5
  component: TProductContainer;
6
6
  inFocusedState: boolean;
@@ -0,0 +1,17 @@
1
+ import { CSSResult } from 'lit';
2
+ import { NamiElement } from '../NamiElement';
3
+ import { TResponsiveGrid } from '../../types/components/containers';
4
+ export declare class NamiResponsiveGrid extends NamiElement {
5
+ component: TResponsiveGrid;
6
+ inFocusedState: boolean;
7
+ private mouseDown;
8
+ private startX;
9
+ scrollLeft: any;
10
+ connectedCallback(): void;
11
+ disconnectedCallback(): void;
12
+ startDragging: (e: any) => void;
13
+ stopDragging: () => void;
14
+ move: (e: any) => void;
15
+ protected styles(): CSSResult;
16
+ render(): any[][];
17
+ }
@@ -1,10 +1,13 @@
1
1
  import { CSSResult } from 'lit';
2
- import { TButtonContainer } from 'src/types/components/containers';
2
+ import { TButtonContainer } from '../../types/components/containers';
3
3
  import { NamiElement } from '../NamiElement';
4
4
  export declare class NamiButton extends NamiElement {
5
5
  component: TButtonContainer;
6
6
  inFocusedState: boolean;
7
7
  constructor();
8
+ updated(): void;
9
+ private _handleFocus;
10
+ private _handleBlur;
8
11
  private _handleClick;
9
12
  protected styles(): CSSResult;
10
13
  render(): any[] | import("lit-html").TemplateResult<1>;
@@ -1,4 +1,4 @@
1
- import { TImageComponent } from "src/types/components/elements";
1
+ import { TImageComponent } from "../../types/components/elements";
2
2
  import { NamiElement } from "../NamiElement";
3
3
  import { CSSResult, TemplateResult } from "lit";
4
4
  export declare class NamiImage extends NamiElement {
@@ -0,0 +1,15 @@
1
+ import { TPlayPauseButton } from '../../types/components/containers';
2
+ import { NamiElement } from '../NamiElement';
3
+ import { CSSResult } from 'lit';
4
+ export declare class NamiPlayPauseButton extends NamiElement {
5
+ component: TPlayPauseButton;
6
+ inFocusedState: boolean;
7
+ private playing;
8
+ constructor();
9
+ private _handleFocus;
10
+ private _handleBlur;
11
+ private _handleClick;
12
+ updated(): void;
13
+ protected styles(): CSSResult;
14
+ render(): any[];
15
+ }
@@ -1,5 +1,5 @@
1
1
  import { CSSResult } from 'lit';
2
- import { TSegmentPicker } from 'src/types/components/elements';
2
+ import { TSegmentPicker } from '../../types/components/elements';
3
3
  import { NamiElement } from '../NamiElement';
4
4
  export declare class NamiSegmentPicker extends NamiElement {
5
5
  component: TSegmentPicker;
@@ -1,5 +1,5 @@
1
1
  import { CSSResult } from 'lit';
2
- import { TSegmentPickerItem } from 'src/types/components/elements';
2
+ import { TSegmentPickerItem } from '../../types/components/elements';
3
3
  import { NamiElement } from '../NamiElement';
4
4
  export declare class NamiSegmentPickerItem extends NamiElement {
5
5
  component: TSegmentPickerItem;
@@ -1,6 +1,6 @@
1
1
  import { CSSResult, TemplateResult } from 'lit';
2
2
  import { NamiElement } from '../NamiElement';
3
- import { TSpacerComponent } from 'src/types/components/elements';
3
+ import { TSpacerComponent } from '../../types/components/elements';
4
4
  export declare class NamiSpacer extends NamiElement {
5
5
  component: TSpacerComponent;
6
6
  inFocusedState: boolean;
@@ -1,5 +1,5 @@
1
1
  import { TemplateResult, CSSResult } from 'lit';
2
- import { TSymbolComponent, TTextComponent, TTextListComponent } from 'src/types/components/elements';
2
+ import { TSymbolComponent, TTextComponent, TTextListComponent } from '../../types/components/elements';
3
3
  import { NamiElement } from '../NamiElement';
4
4
  export declare class NamiText extends NamiElement {
5
5
  component: TTextComponent;
@@ -1,10 +1,11 @@
1
- import { TVideoComponent } from "src/types/components/elements";
1
+ import { TVideoComponent } from "../../types/components/elements";
2
2
  import { NamiElement } from "../NamiElement";
3
3
  import { CSSResult, TemplateResult } from "lit";
4
4
  export declare class NamiVideo extends NamiElement {
5
5
  component: TVideoComponent;
6
6
  inFocusedState: boolean;
7
7
  protected styles(): CSSResult;
8
+ loadMediaSrc(video: HTMLVideoElement): void;
8
9
  updated(): void;
9
10
  protected render(): TemplateResult;
10
11
  }
@@ -0,0 +1,15 @@
1
+ import { TVolumeButton } from '../../types/components/containers';
2
+ import { NamiElement } from '../NamiElement';
3
+ import { CSSResult } from 'lit';
4
+ export declare class NamiVolumeButton extends NamiElement {
5
+ component: TVolumeButton;
6
+ inFocusedState: boolean;
7
+ private muted;
8
+ constructor();
9
+ private _handleFocus;
10
+ private _handleBlur;
11
+ private _handleClick;
12
+ updated(): void;
13
+ protected styles(): CSSResult;
14
+ render(): any[];
15
+ }
@@ -12,6 +12,10 @@ import { NamiSegmentPicker } from "./elements/SegmentPicker";
12
12
  import { NamiSegmentPickerItem } from "./elements/SegmentPickerItem";
13
13
  import { NamiVideo } from "./elements/Video";
14
14
  import { NamiCollapseContainer } from "./containers/CollapseContainer";
15
+ import { NamiResponsiveGrid } from "./containers/ResponsiveGrid";
16
+ import { NamiCarouselContainer } from "./containers/CarouselContainer";
17
+ import { NamiVolumeButton } from "./elements/VolumeButton";
18
+ import { NamiPlayPauseButton } from "./elements/PlayPauseButton";
15
19
  declare global {
16
20
  interface HTMLElementTagNameMap {
17
21
  "nami-spacer": NamiSpacer;
@@ -29,6 +33,10 @@ declare global {
29
33
  "nami-symbol": NamiSymbol;
30
34
  "nami-video": NamiVideo;
31
35
  "nami-collapse-container": NamiCollapseContainer;
36
+ "nami-responsive-grid": NamiResponsiveGrid;
37
+ "nami-carousel-container": NamiCarouselContainer;
38
+ "nami-volume-button": NamiVolumeButton;
39
+ "nami-play-pause-button": NamiPlayPauseButton;
32
40
  }
33
41
  }
34
- export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer };
42
+ export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid, NamiCarouselContainer, NamiPlayPauseButton, NamiVolumeButton };
@@ -1,3 +1,3 @@
1
- import { NamiProductDetails } from "src/types/externals/product";
2
- import { PaywallSKU } from "src/types/sku";
1
+ import { NamiProductDetails } from "../types/externals/product";
2
+ import { PaywallSKU } from "../types/sku";
3
3
  export declare const getProductDetail: (variableName: string, product?: NamiProductDetails | null, referenceId?: string, skus?: PaywallSKU[]) => unknown;
@@ -1,5 +1,5 @@
1
- import { UserAction } from "src/types/components/containers";
2
- import { NamiSKU } from "src/types/externals/sku";
1
+ import { UserAction } from "../../types/components/containers";
2
+ import { NamiSKU } from "../../types/externals/sku";
3
3
  export declare const handleAction: (onTap?: UserAction, sku?: NamiSKU) => void;
4
4
  export declare const closePaywallHandler: () => void;
5
5
  export declare const restorePurchase: () => void;
@@ -0,0 +1,3 @@
1
+ export declare const formatDate: (text: string, dateFormat: string) => string;
2
+ export declare const isValidISODate: (isoDate: string) => boolean;
3
+ export declare const convertLocale: (locale: string) => string;
@@ -2,4 +2,4 @@ export declare const
2
2
  /**
3
3
  * Constant value of action taps
4
4
  */
5
- NAMI_CLOSE_PAYWALL: string, NAMI_RESTORE_PURCHASES: string, NAMI_SIGN_IN: string, NAMI_BUY_SKU: string, SET_STATE: string, NAMI_SELECT_SKU: string, NAMI_PURCHASE_SELECTED_SKU: string, NAMI_DEEP_LINK: string, NAMI_NAVIGATE_TO_SCREEN: string, NAMI_RELOAD_PRODUCTS: string, UNSUPPORTED: string, NAMI_PURCHASE_SUCCESS: string, NAMI_PURCHASE_CANCELLED: string, NAMI_PURCHASE_FAILED: string, NAMI_PURCHASE_PENDING: string, NAMI_PURCHASE_UNKNOWN: string, NAMI_SHOW_PAYWALL: string, NAMI_PAGE_CHANGE: string, NAMI_TOGGLE_CHANGE: string, NAMI_SLIDE_CHANGE: string;
5
+ NAMI_CLOSE_PAYWALL: string, NAMI_RESTORE_PURCHASES: string, NAMI_SIGN_IN: string, NAMI_BUY_SKU: string, SET_STATE: string, NAMI_SELECT_SKU: string, NAMI_PURCHASE_SELECTED_SKU: string, NAMI_DEEP_LINK: string, NAMI_NAVIGATE_TO_SCREEN: string, NAMI_RELOAD_PRODUCTS: string, UNSUPPORTED: string, NAMI_PURCHASE_SUCCESS: string, NAMI_PURCHASE_CANCELLED: string, NAMI_PURCHASE_FAILED: string, NAMI_PURCHASE_PENDING: string, NAMI_PURCHASE_UNKNOWN: string, NAMI_SHOW_PAYWALL: string, NAMI_PAGE_CHANGE: string, NAMI_TOGGLE_CHANGE: string, NAMI_SLIDE_CHANGE: string, NAMI_PLAY_VIDEO: string, NAMI_PAUSE_VIDEO: string, NAMI_MUTE_VIDEO: string, NAMI_UNMUTE_VIDEO: string;
@@ -1,8 +1,8 @@
1
- import { TBaseComponent, TComponent } from "src/types/components";
2
- import { TButtonContainer, TProductContainer } from "src/types/components/containers";
3
- import { TConditionalComponent } from "src/types/components/elements";
4
- import { TPaywallMedia } from "src/types/paywall";
5
- import { PaywallSKU } from "src/types/sku";
1
+ import { TBaseComponent, TComponent } from "../../types/components";
2
+ import { TButtonContainer, TCarouselContainer, TProductContainer, TResponsiveGrid } from "../../types/components/containers";
3
+ import { TConditionalComponent } from "../../types/components/elements";
4
+ import { TPaywallMedia } from "../../types/paywall";
5
+ import { PaywallSKU } from "../../types/sku";
6
6
  type ReplacementsType = {
7
7
  [type: string]: any extends Array<any> ? never : any;
8
8
  };
@@ -11,7 +11,10 @@ export declare function getInterpolatedButtonComponents(component: TButtonContai
11
11
  export declare function getSkuButtonComponents(items: PaywallSKU[], component: TProductContainer, mediaList?: {
12
12
  [mediaName: string]: Pick<TPaywallMedia, 'content'>;
13
13
  }, additionalVariableStates?: object): [boolean, TComponent[]][];
14
+ export declare function getRepeatingListBlocks(component: TResponsiveGrid): TComponent[][];
15
+ export declare function getCarouselSlides(component: TCarouselContainer): TComponent[][];
14
16
  export declare function conditionComponentMatches(condition: TConditionalComponent): boolean;
15
17
  export declare function withOverrides<T extends TBaseComponent>({ conditionAttributes, ...component }: T): T;
16
- export declare function valueFromSmartText<T>(value: T, sku?: PaywallSKU): T;
18
+ export declare function valueFromSmartText<T>(value: T, sku?: PaywallSKU, block?: any): T;
19
+ export declare const totalTimeSpentOnPaywall: () => number | undefined;
17
20
  export {};
@@ -1,4 +1,4 @@
1
- import { Impression } from "src/types/api";
2
- import { TransactionRequest } from "src/types/purchase";
1
+ import { Impression } from "../../types/api";
2
+ import { TransactionRequest } from "../../types/purchase";
3
3
  export declare const postImpression: (options: Impression) => Promise<void>;
4
4
  export declare const postConversion: (transactionInfo: TransactionRequest) => Promise<void>;
@@ -1,6 +1,7 @@
1
- import { NamiProductDetails, NamiProductOffer, NamiSubscriptionPeriod } from "src/types/externals/product";
2
- import { PricingPhase } from "src/types/products";
3
- import { PaywallSKU } from "src/types/sku";
1
+ import { NamiProductDetails, NamiProductOffer, NamiSubscriptionPeriod } from "../../types/externals/product";
2
+ import { PricingPhase } from "../../types/products";
3
+ import { PaywallSKU } from "../../types/sku";
4
+ export declare const isSubscription: (productType?: string) => productType is "subscription";
4
5
  export declare function getStandardBillingPeriod(product: NamiProductDetails): string | undefined;
5
6
  export declare function getFreeTrialPeriod(product: NamiProductDetails): string | undefined;
6
7
  export declare function getFreeTrialOffer(product: NamiProductDetails): NamiProductOffer | undefined;
@@ -1,7 +1,7 @@
1
- import { InitiateStateGroup, ISkuMenu, TInitialState } from "src/types/paywall";
2
- import { NamiProductDetails } from "src/types/externals/product";
3
- import { PaywallSKU } from "src/types/sku";
4
- import { NamiPaywallLaunchContext } from "src/nami-web";
1
+ import { InitiateStateGroup, ISkuMenu, TInitialState } from "../../types/paywall";
2
+ import { NamiProductDetails } from "../../types/externals/product";
3
+ import { PaywallSKU } from "../../types/sku";
4
+ import { NamiPaywallLaunchContext } from "../../nami-web";
5
5
  export declare function currentSku(productDetails: NamiProductDetails[], initialState: TInitialState, skuMenus: ISkuMenu[], skus: PaywallSKU[]): {
6
6
  [key: string]: any;
7
7
  };
@@ -11,5 +11,5 @@ export declare function getSkuSmartTextValue(productDetail?: NamiProductDetails
11
11
  };
12
12
  export declare function checkAnySkuHasTrialOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[], productGroups: string[]): boolean;
13
13
  export declare function checkAnySkuHasPromoOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[], productGroups: string[]): boolean;
14
- export declare function productDetail(details: NamiProductDetails[] | undefined, skuName: string): NamiProductDetails | null;
15
- export declare function launchContext(groups: InitiateStateGroup[], stateLaunch: NamiPaywallLaunchContext, context?: NamiPaywallLaunchContext): NamiPaywallLaunchContext;
14
+ export declare function productDetail(details: NamiProductDetails[] | undefined, refId: string): NamiProductDetails | null;
15
+ export declare function launchContext(groups: InitiateStateGroup[], stateContext: NamiPaywallLaunchContext, context?: NamiPaywallLaunchContext): NamiPaywallLaunchContext;
@@ -1,9 +1,10 @@
1
- import { TBaseComponent, TContainerPosition } from "src/types/components";
2
- import { TSegmentPickerItem, TTextLikeComponent } from "src/types/components/elements";
1
+ import { TBaseComponent, TContainerPosition } from "../../types/components";
2
+ import { TSegmentPickerItem, TTextLikeComponent } from "../../types/components/elements";
3
3
  export declare function parseSize(value: string | number): string;
4
4
  export declare function backgroundColor(value: string): string;
5
5
  export declare function pickAndApplyBackgroundColor(component: TBaseComponent, inFocusedState?: boolean): string;
6
6
  export declare function flexDirection({ direction }: TBaseComponent): string;
7
+ export declare function flexAlignments(component: TBaseComponent): string;
7
8
  export declare function applyTextOverflow(component: TTextLikeComponent): string;
8
9
  export declare function transition(): string;
9
10
  export declare function grow({ grow }: TBaseComponent): string;
@@ -18,8 +19,9 @@ export declare function dropShadow(component: TBaseComponent): string;
18
19
  export declare function textStrikethrough(value: boolean | undefined): string;
19
20
  export declare function font({ fontName }: TTextLikeComponent): string;
20
21
  export declare function applyStyles(component: TBaseComponent, inFocusedState?: boolean): string;
22
+ export declare function applyGridStyles(component: TBaseComponent, inFocusedState?: boolean): string;
21
23
  export declare function parsePosition(position?: TContainerPosition): string;
22
24
  export declare function getComponentStyles(prefix: string, component: TSegmentPickerItem): TSegmentPickerItem;
23
25
  export declare function formatKey(key: string, prefix: string): string;
24
26
  export declare function applySegmentStyles(styles: any, inFocusedState: boolean): string;
25
- export declare function appySegmentFontStyles(styles: any): string;
27
+ export declare function applySegmentFontStyles(styles: any): string;
@@ -1,11 +1,12 @@
1
- import { NamiConfiguration } from "src/types/config";
2
- import { Impression, LoginResponse } from "src/types/api";
3
- import { PurchaseValidationRequest, TransactionRequest } from "src/types/purchase";
1
+ import { NamiConfiguration } from "../types/config";
2
+ import { Impression, LoginResponse } from "../types/api";
3
+ import { PurchaseValidationRequest, TransactionRequest } from "../types/purchase";
4
4
  export declare class NamiAPI {
5
5
  static instance: NamiAPI;
6
6
  private baseURL;
7
7
  private platformID;
8
8
  private get deviceID();
9
+ constructor();
9
10
  static configure(config: NamiConfiguration): void;
10
11
  protected configure(config: NamiConfiguration): void;
11
12
  login(externalId: string): Promise<LoginResponse>;
@@ -1,38 +1,64 @@
1
- import { AvailableCampaignsResponseHandler } from "src/types/campaign";
2
- import { TPaywallLaunchContext, PaywallResultHandler } from "src/types/paywall";
3
- import { PaywallComponent } from "src/components/Paywall";
4
- import { Callback } from "src/types/components/containers";
5
- import { NamiPaywallActionHandler } from "src/types/externals/paywall";
6
- import { NamiCampaign } from "src/types/externals/campaign";
1
+ import { AvailableCampaignsResponseHandler } from "../types/campaign";
2
+ import { TPaywallLaunchContext, PaywallResultHandler } from "../types/paywall";
3
+ import { PaywallComponent } from "../components/Paywall";
4
+ import { Callback } from "../types/components/containers";
5
+ import { NamiPaywallActionHandler } from "../types/externals/paywall";
6
+ import { NamiCampaign } from "../types/externals/campaign";
7
+ /**
8
+ * @class NamiCampaignManager
9
+ * Provides methods for managing all aspects of a campaign.
10
+ */
7
11
  export declare class NamiCampaignManager {
8
12
  static instance: NamiCampaignManager;
9
13
  private emitter;
14
+ /**
15
+ * @returns {NamiCampaign[]} A list of NamiCampaign
16
+ */
10
17
  static allCampaigns(): NamiCampaign[];
11
18
  /**
12
19
  * Checks if a campaign is available for a given argument.
13
20
  * The argument can be a label string, or a deeplink URL.
14
21
  *
15
22
  * @param label - The argument to check. Can be a label string, or a deeplink URL.
16
- * @returns True if the campaign is available, false otherwise.
23
+ * @returns {boolean} True if the campaign is available, False otherwise.
17
24
  */
18
25
  static isCampaignAvailable(label: string): boolean;
19
26
  /**
20
- * Asks Nami to fetch the latest active campaigns for this device
27
+ * Fetches the latest active campaigns for the current device.
21
28
  *
22
- * @returns list of campaigns
29
+ * @returns {Promise<NamiCampaign[]>} A promise that resolves to a list of active campaigns.
23
30
  */
24
31
  static refresh(): Promise<NamiCampaign[]>;
32
+ /**
33
+ * Registers a handler that will be called whenever there is an update
34
+ * in the list of active campaigns. The Nami SDK will trigger this callback
35
+ * with the updated list of active campaigns.
36
+ *
37
+ * The handler will receive an array of `NamiCampaign` objects representing
38
+ * the current active campaigns.
39
+ *
40
+ * @param {AvailableCampaignsResponseHandler} handler - The callback function that will be invoked when the campaign list is updated.
41
+ * @returns {Callback} A function that can be called to unregister the handler.
42
+ */
25
43
  static registerAvailableCampaignsHandler(handler: AvailableCampaignsResponseHandler): Callback;
26
44
  /**
27
45
  * Launches a campaign with a given label.
28
46
  * @param label - The label of the campaign to launch.
29
47
  * @param withUrl - The deeplink URL of the campaign to launch.
30
48
  * @param actionCallback - Optional handler for paywall actions.
31
- * @returns - The launched paywall web component.
49
+ * @returns {PaywallComponent | void} The launched paywall web component.
32
50
  */
33
51
  static launch(label?: string, withUrl?: string, context?: TPaywallLaunchContext, resultCallback?: PaywallResultHandler, actionCallback?: NamiPaywallActionHandler): PaywallComponent | void;
52
+ /**
53
+ * Provide the list of product groups supported by the provided placement label or URL.
54
+ * @param label Campaign placement label defined in Nami Control Center for launching a specific campaign.
55
+ * @param uri Campaign placement URI defined in Nami Control Center for launching a specific campaign.
56
+ * @return List of product groups associated with the specified campaign placement.
57
+ */
58
+ static getProductGroups(label?: string, withUrl?: string): string[];
34
59
  /**
35
60
  * Private Instance Methods
36
61
  */
37
62
  private get sdkInitialized();
63
+ private campaignTypeAndLabel;
38
64
  }