@namiml/web-sdk 1.4.0 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
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
+
3
22
  ## 1.4.0 (September 5, 2024)
4
23
 
5
24
  ## New Features
@@ -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,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
+ }
@@ -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 };
@@ -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;
@@ -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
  }