@namiml/web-sdk 1.4.0 → 1.5.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 CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.1 (October 2, 2024)
4
+
5
+ ## Enhancements
6
+ - Add `TOGGLE_CHANGE` and `PAGE_CHANGE` paywall events
7
+
8
+ ## Bugfixes
9
+ - Fix carousel component swiper
10
+ - Fix flex alignment
11
+ - Fix hero video not redenering correctly in Safari
12
+
13
+ ## 1.5.0 (September 26, 2024)
14
+
15
+ ## New Features
16
+ - Support for advanced video features
17
+ - Support for carousel component
18
+
19
+ ## Enhancements
20
+ - Improve fallback data handling
21
+ - Support repeatable list inside collapse component
22
+ - Support vertical alignment on product container
23
+ - Align `removeAllListeners` behavior with RN SDK
24
+
25
+ ## Bugfixes
26
+ - Fix segment picker cursor
27
+ - Fix hidden component handling
28
+ - Fix responsive grid spacing and scrolling
29
+ - Fix background video and gradient container
30
+ - Fix background video position
31
+
3
32
  ## 1.4.0 (September 5, 2024)
4
33
 
5
34
  ## New Features
@@ -19,8 +19,9 @@ declare class ContextProvider implements ReactiveController {
19
19
  private setState;
20
20
  setProductDetails(details: NamiProductDetails[]): void;
21
21
  getProductDetails(): NamiProductDetails[];
22
- setCurrentGroupId(currentGroupId: string): void;
22
+ setCurrentGroupData(currentGroupId: string, currentGroupName: string): void;
23
23
  getCurrentGroupId(): string;
24
+ getCurrentGroupName(): string;
24
25
  setSelectedProdcuts(products: {
25
26
  [currentGroupId: string]: string;
26
27
  }): void;
@@ -10,6 +10,7 @@ declare class PaywallComponent extends NamiElement {
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;
@@ -0,0 +1,12 @@
1
+ import { CSSResult } from 'lit';
2
+ import Swiper from 'swiper';
3
+ import { TCarouselContainer } from '../../types/components/containers';
4
+ import { NamiElement } from '../NamiElement';
5
+ export declare class NamiCarouselContainer extends NamiElement {
6
+ component: TCarouselContainer;
7
+ inFocusedState: boolean;
8
+ swiperInstance: Swiper;
9
+ protected styles(): CSSResult;
10
+ protected updated(): void;
11
+ render(): import("lit-html").TemplateResult<1>;
12
+ }
@@ -4,6 +4,14 @@ import { TResponsiveGrid } from '../../types/components/containers';
4
4
  export declare class NamiResponsiveGrid extends NamiElement {
5
5
  component: TResponsiveGrid;
6
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;
7
15
  protected styles(): CSSResult;
8
16
  render(): any[][];
9
17
  }
@@ -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
+ }
@@ -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
+ }
@@ -13,6 +13,9 @@ import { NamiSegmentPickerItem } from "./elements/SegmentPickerItem";
13
13
  import { NamiVideo } from "./elements/Video";
14
14
  import { NamiCollapseContainer } from "./containers/CollapseContainer";
15
15
  import { NamiResponsiveGrid } from "./containers/ResponsiveGrid";
16
+ import { NamiCarouselContainer } from "./containers/CarouselContainer";
17
+ import { NamiVolumeButton } from "./elements/VolumeButton";
18
+ import { NamiPlayPauseButton } from "./elements/PlayPauseButton";
16
19
  declare global {
17
20
  interface HTMLElementTagNameMap {
18
21
  "nami-spacer": NamiSpacer;
@@ -31,6 +34,9 @@ declare global {
31
34
  "nami-video": NamiVideo;
32
35
  "nami-collapse-container": NamiCollapseContainer;
33
36
  "nami-responsive-grid": NamiResponsiveGrid;
37
+ "nami-carousel-container": NamiCarouselContainer;
38
+ "nami-volume-button": NamiVolumeButton;
39
+ "nami-play-pause-button": NamiPlayPauseButton;
34
40
  }
35
41
  }
36
- export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid };
42
+ export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid, NamiCarouselContainer, NamiPlayPauseButton, NamiVolumeButton };
@@ -7,7 +7,10 @@ export declare const signIn: () => void;
7
7
  export declare const deepLink: (url?: string) => void;
8
8
  export declare const buySKU: (onTap: UserAction, sku: NamiSKU) => NamiSKU;
9
9
  export declare const navigateToScreen: (screen?: string) => void;
10
- export declare const setState: () => void;
10
+ export declare const setState: () => {
11
+ id: string;
12
+ name: string;
13
+ };
11
14
  export declare const selectSKU: (sku: NamiSKU) => void;
12
15
  export declare const purchaseSelectedSKU: (sku: NamiSKU) => void;
13
16
  export declare const reloadProducts: () => void;
@@ -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,5 +1,5 @@
1
1
  import { TBaseComponent, TComponent } from "../../types/components";
2
- import { TButtonContainer, TProductContainer, TResponsiveGrid } from "../../types/components/containers";
2
+ import { TButtonContainer, TCarouselContainer, 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";
@@ -11,8 +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 getRepeatingListComponents(component: TResponsiveGrid): TComponent[][];
14
+ export declare function getRepeatingListBlocks(component: TResponsiveGrid): TComponent[][];
15
+ export declare function getCarouselSlides(component: TCarouselContainer): TComponent[][];
15
16
  export declare function conditionComponentMatches(condition: TConditionalComponent): boolean;
16
17
  export declare function withOverrides<T extends TBaseComponent>({ conditionAttributes, ...component }: T): T;
17
- 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;
18
20
  export {};
@@ -12,4 +12,4 @@ export declare function getSkuSmartTextValue(productDetail?: NamiProductDetails
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
14
  export declare function productDetail(details: NamiProductDetails[] | undefined, refId: string): NamiProductDetails | null;
15
- export declare function launchContext(groups: InitiateStateGroup[], context?: NamiPaywallLaunchContext): NamiPaywallLaunchContext;
15
+ export declare function launchContext(groups: InitiateStateGroup[], stateContext: NamiPaywallLaunchContext, context?: NamiPaywallLaunchContext): NamiPaywallLaunchContext;
@@ -4,6 +4,7 @@ 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;
@@ -1,4 +1,4 @@
1
- import { NamiConfiguration } from "../types/config";
1
+ import { NamiConfiguration } from "../types/externals/config";
2
2
  import { Impression, LoginResponse } from "../types/api";
3
3
  import { PurchaseValidationRequest, TransactionRequest } from "../types/purchase";
4
4
  export declare class NamiAPI {
@@ -7,6 +7,7 @@ export declare class NamiEventEmitter {
7
7
  emit(eventName: string, ...args: any[]): void;
8
8
  addListener(eventName: string, listener: (...args: any[]) => void): void;
9
9
  removeListener(eventName: string, listener: (...args: any[]) => void): void;
10
+ removeAllListeners(eventName?: string): void;
10
11
  listeners(eventName: string): any[];
11
12
  listenerCount(eventName: string): number;
12
13
  }
@@ -1,4 +1,5 @@
1
- import { NamiConfiguration, NamiConfigurationState } from "../types/config";
1
+ import { NamiConfigurationState } from "../types/config";
2
+ import { NamiConfiguration } from "../types/externals/config";
2
3
  export declare class Nami {
3
4
  #private;
4
5
  static instance: Nami;
@@ -1,4 +1,4 @@
1
- import { NamiConfiguration } from "../types/config";
1
+ import { NamiConfiguration } from "../types/externals/config";
2
2
  export declare class NamiRefs {
3
3
  static instance: NamiRefs;
4
4
  init(config: NamiConfiguration): Promise<void>;