@namiml/web-sdk 1.5.1 → 1.5.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 (40) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/components/ContextProvider.d.ts +2 -0
  3. package/dist/components/Paywall.d.ts +1 -0
  4. package/dist/components/TemplateComponent.d.ts +1 -1
  5. package/dist/components/containers/BackgroundContainer.d.ts +1 -0
  6. package/dist/components/containers/CarouselContainer.d.ts +5 -0
  7. package/dist/components/containers/CollapseContainer.d.ts +1 -0
  8. package/dist/components/containers/Container.d.ts +3 -0
  9. package/dist/components/containers/Content.d.ts +2 -0
  10. package/dist/components/containers/Footer.d.ts +1 -0
  11. package/dist/components/containers/Header.d.ts +1 -0
  12. package/dist/components/containers/ProductContainer.d.ts +1 -1
  13. package/dist/components/containers/ResponsiveGrid.d.ts +1 -0
  14. package/dist/components/elements/Button.d.ts +1 -0
  15. package/dist/components/elements/Image.d.ts +1 -0
  16. package/dist/components/elements/PlayPauseButton.d.ts +1 -0
  17. package/dist/components/elements/SegmentPicker.d.ts +1 -0
  18. package/dist/components/elements/SegmentPickerItem.d.ts +1 -0
  19. package/dist/components/elements/Spacer.d.ts +1 -0
  20. package/dist/components/elements/Stack.d.ts +9 -0
  21. package/dist/components/elements/Text.d.ts +7 -0
  22. package/dist/components/elements/Video.d.ts +2 -0
  23. package/dist/components/elements/VolumeButton.d.ts +1 -0
  24. package/dist/components/index.d.ts +3 -1
  25. package/dist/components/utils/actionTap.d.ts +2 -1
  26. package/dist/components/utils/helpers.d.ts +3 -1
  27. package/dist/components/utils/products.d.ts +3 -3
  28. package/dist/components/utils/state.d.ts +6 -2
  29. package/dist/components/utils/styles.d.ts +10 -8
  30. package/dist/nami-web.cjs +30 -17
  31. package/dist/nami-web.js +30 -17
  32. package/dist/nami-web.mjs +30 -17
  33. package/dist/nami-web.umd.js +31 -18
  34. package/dist/services/video.service.d.ts +4 -1
  35. package/dist/types/components/containers.d.ts +6 -2
  36. package/dist/types/components/index.d.ts +3 -1
  37. package/dist/types/externals/campaign.d.ts +2 -2
  38. package/dist/types/sku.d.ts +1 -1
  39. package/dist/utils/device.d.ts +1 -0
  40. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.3 (November 21, 2024)
4
+
5
+ ## Bugfixes
6
+ - Resolve an issue where the collapse component caret icon was not updating when expanded
7
+
8
+ ## Enahncements
9
+ - Support scaling on TV devices for optimal display on 720p, 1080p, 4K, and 8K devices
10
+
11
+ ## 1.5.2 (October 24, 2024)
12
+
13
+ ## Bugfixes
14
+ - Fix an issue where the wrong campaign rule was being used for a given placement label
15
+ - Fix issue where the wrong initial config campaign rule was being used
16
+ - Fix an issue where background video on mobile goes into full screen player
17
+ - Fix an issue with focus events on connected TV platforms
18
+ - Fix an issue with login / logout state handling
19
+ - Fix an issue with free trial and promotional offer display
20
+ - Fix several UI issues with carousel and stack components
21
+
3
22
  ## 1.5.1 (October 2, 2024)
4
23
 
5
24
  ## Enhancements
@@ -49,6 +49,8 @@ declare class ContextProvider implements ReactiveController {
49
49
  setAppSuppliedVideoDetails({ url, name }: NamiAppSuppliedVideoDetails): void;
50
50
  resetAppSuppliedVideoDetails(): void;
51
51
  setLaunchDetails(value: string, type?: string): void;
52
+ setOpenHeaderIds(id: string, sku?: NamiSKU): void;
53
+ getCurrentCollapsibleSku(): NamiSKU;
52
54
  }
53
55
  declare const contextProvider: ContextProvider;
54
56
  export default contextProvider;
@@ -6,6 +6,7 @@ import { NamiCampaign } from '../types/externals/campaign';
6
6
  import { NamiPaywallEvent } from '../types/externals/paywall';
7
7
  declare class PaywallComponent extends NamiElement {
8
8
  formFactor: TDevice;
9
+ scaleFactor: number;
9
10
  campaign: NamiCampaign;
10
11
  paywall: IPaywall;
11
12
  paywallEvent: Partial<NamiPaywallEvent>;
@@ -1,2 +1,2 @@
1
1
  import { TComponent } from "../types/components";
2
- export declare function TemplateComponent(component: TComponent, inFocusedState?: boolean): any;
2
+ export declare function TemplateComponent(component: TComponent, scaleFactor: number, inFocusedState?: boolean): any;
@@ -5,6 +5,7 @@ export declare class NamiBackgroundContainer extends NamiElement {
5
5
  component: TContainer;
6
6
  fullscreen: boolean;
7
7
  inFocusedState: boolean;
8
+ scaleFactor: number;
8
9
  protected styles(): CSSResult;
9
10
  protected updated(): void;
10
11
  render(): any[];
@@ -5,7 +5,12 @@ import { NamiElement } from '../NamiElement';
5
5
  export declare class NamiCarouselContainer extends NamiElement {
6
6
  component: TCarouselContainer;
7
7
  inFocusedState: boolean;
8
+ scaleFactor: number;
8
9
  swiperInstance: Swiper;
10
+ slideSpacing: number;
11
+ connectedCallback(): void;
12
+ disconnectedCallback(): void;
13
+ updateSpacing: (e: CustomEvent) => void;
9
14
  protected styles(): CSSResult;
10
15
  protected updated(): void;
11
16
  render(): import("lit-html").TemplateResult<1>;
@@ -5,6 +5,7 @@ export declare class NamiCollapseContainer extends NamiElement {
5
5
  component: TCollapseContainer;
6
6
  inFocusedState: boolean;
7
7
  height: number;
8
+ scaleFactor: number;
8
9
  constructor();
9
10
  private _handleClick;
10
11
  protected styles(): CSSResult;
@@ -5,7 +5,10 @@ import { TProductContainer } from '../../types/components/containers';
5
5
  export declare class NamiContainer extends NamiElement {
6
6
  component: TContainer | TProductContainer;
7
7
  inFocusedState: boolean;
8
+ scaleFactor: number;
8
9
  constructor();
10
+ connectedCallback(): void;
11
+ disconnectedCallback(): void;
9
12
  private _handleFocusChanged;
10
13
  private _handleFocus;
11
14
  private _handleBlur;
@@ -5,6 +5,8 @@ export declare class NamiContentContainer extends NamiElement {
5
5
  component: TContainer;
6
6
  zIndex: number;
7
7
  inFocusedState: boolean;
8
+ scaleFactor: number;
8
9
  protected styles(): CSSResult;
10
+ firstUpdated(): void;
9
11
  render(): any[];
10
12
  }
@@ -5,6 +5,7 @@ export declare class NamiFooter extends NamiElement {
5
5
  components: THeaderFooter;
6
6
  zIndex: string;
7
7
  inFocusedState: boolean;
8
+ scaleFactor: number;
8
9
  protected styles(): CSSResult;
9
10
  render(): any[];
10
11
  }
@@ -6,6 +6,7 @@ export declare class NamiHeader extends NamiElement {
6
6
  zIndex: string;
7
7
  inFullScreen: boolean;
8
8
  inFocusedState: boolean;
9
+ scaleFactor: number;
9
10
  protected styles(): CSSResult;
10
11
  render(): any[];
11
12
  }
@@ -4,9 +4,9 @@ import { TProductContainer } from '../../types/components/containers';
4
4
  export declare class NamiProductContainer extends NamiElement {
5
5
  component: TProductContainer;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  private currentGroupId;
8
9
  protected styles(): CSSResult;
9
10
  updated(): void;
10
- private _offerState;
11
11
  render(): any[][];
12
12
  }
@@ -4,6 +4,7 @@ import { TResponsiveGrid } from '../../types/components/containers';
4
4
  export declare class NamiResponsiveGrid extends NamiElement {
5
5
  component: TResponsiveGrid;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  private mouseDown;
8
9
  private startX;
9
10
  scrollLeft: any;
@@ -4,6 +4,7 @@ import { NamiElement } from '../NamiElement';
4
4
  export declare class NamiButton extends NamiElement {
5
5
  component: TButtonContainer;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  constructor();
8
9
  updated(): void;
9
10
  private _handleFocus;
@@ -4,6 +4,7 @@ import { CSSResult, TemplateResult } from "lit";
4
4
  export declare class NamiImage extends NamiElement {
5
5
  component: TImageComponent;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  protected styles(): CSSResult;
8
9
  protected render(): TemplateResult;
9
10
  }
@@ -4,6 +4,7 @@ import { CSSResult } from 'lit';
4
4
  export declare class NamiPlayPauseButton extends NamiElement {
5
5
  component: TPlayPauseButton;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  private playing;
8
9
  constructor();
9
10
  private _handleFocus;
@@ -4,6 +4,7 @@ import { NamiElement } from '../NamiElement';
4
4
  export declare class NamiSegmentPicker extends NamiElement {
5
5
  component: TSegmentPicker;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  constructor();
8
9
  private _handleClick;
9
10
  protected styles(): CSSResult;
@@ -4,6 +4,7 @@ import { NamiElement } from '../NamiElement';
4
4
  export declare class NamiSegmentPickerItem extends NamiElement {
5
5
  component: TSegmentPickerItem;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  constructor();
8
9
  private _handleClick;
9
10
  private _handleHover;
@@ -4,6 +4,7 @@ import { TSpacerComponent } from '../../types/components/elements';
4
4
  export declare class NamiSpacer extends NamiElement {
5
5
  component: TSpacerComponent;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  protected styles(): CSSResult;
8
9
  render(): TemplateResult;
9
10
  }
@@ -0,0 +1,9 @@
1
+ import { NamiElement } from "../NamiElement";
2
+ import { TStack } from "../../types/components/containers";
3
+ export declare class NamiStack extends NamiElement {
4
+ component: TStack;
5
+ inFocusedState: boolean;
6
+ scaleFactor: number;
7
+ protected styles(): import("lit").CSSResult;
8
+ protected render(): any[];
9
+ }
@@ -4,6 +4,7 @@ import { NamiElement } from '../NamiElement';
4
4
  export declare class NamiText extends NamiElement {
5
5
  component: TTextComponent;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  protected styles(): CSSResult;
8
9
  render(): TemplateResult;
9
10
  }
@@ -16,12 +17,18 @@ export declare class TextListItemWrapper extends NamiElement {
16
17
  export declare class NamiSymbol extends NamiElement {
17
18
  component: TSymbolComponent;
18
19
  inFocusedState: boolean;
20
+ scaleFactor: number;
21
+ previousSymbolName: string;
19
22
  protected styles(): CSSResult;
23
+ protected updated(): void;
24
+ private shouldRenderCurrentIcon;
25
+ private renderSvgIcon;
20
26
  render(): TemplateResult;
21
27
  }
22
28
  export declare class NamiTextList extends NamiElement {
23
29
  component: TTextListComponent;
24
30
  inFocusedState: boolean;
31
+ scaleFactor: number;
25
32
  protected styles(): CSSResult;
26
33
  render(): TemplateResult;
27
34
  }
@@ -4,6 +4,8 @@ import { CSSResult, TemplateResult } from "lit";
4
4
  export declare class NamiVideo extends NamiElement {
5
5
  component: TVideoComponent;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
8
+ private bgVideo;
7
9
  protected styles(): CSSResult;
8
10
  loadMediaSrc(video: HTMLVideoElement): void;
9
11
  updated(): void;
@@ -4,6 +4,7 @@ import { CSSResult } from 'lit';
4
4
  export declare class NamiVolumeButton extends NamiElement {
5
5
  component: TVolumeButton;
6
6
  inFocusedState: boolean;
7
+ scaleFactor: number;
7
8
  private muted;
8
9
  constructor();
9
10
  private _handleFocus;
@@ -16,6 +16,7 @@ import { NamiResponsiveGrid } from "./containers/ResponsiveGrid";
16
16
  import { NamiCarouselContainer } from "./containers/CarouselContainer";
17
17
  import { NamiVolumeButton } from "./elements/VolumeButton";
18
18
  import { NamiPlayPauseButton } from "./elements/PlayPauseButton";
19
+ import { NamiStack } from "./elements/Stack";
19
20
  declare global {
20
21
  interface HTMLElementTagNameMap {
21
22
  "nami-spacer": NamiSpacer;
@@ -37,6 +38,7 @@ declare global {
37
38
  "nami-carousel-container": NamiCarouselContainer;
38
39
  "nami-volume-button": NamiVolumeButton;
39
40
  "nami-play-pause-button": NamiPlayPauseButton;
41
+ "nami-stack": NamiStack;
40
42
  }
41
43
  }
42
- export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid, NamiCarouselContainer, NamiPlayPauseButton, NamiVolumeButton };
44
+ export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid, NamiCarouselContainer, NamiPlayPauseButton, NamiVolumeButton, NamiStack };
@@ -1,6 +1,7 @@
1
1
  import { UserAction } from "../../types/components/containers";
2
2
  import { NamiSKU } from "../../types/externals/sku";
3
- export declare const handleAction: (onTap?: UserAction, sku?: NamiSKU) => void;
3
+ import { NamiPaywallComponentChange } from "../../types/externals/paywall";
4
+ export declare const handleAction: (onTap?: UserAction, sku?: NamiSKU, componentChange?: NamiPaywallComponentChange | undefined) => void;
4
5
  export declare const closePaywallHandler: () => void;
5
6
  export declare const restorePurchase: () => void;
6
7
  export declare const signIn: () => void;
@@ -10,11 +10,13 @@ export declare function interpolate<T>(value: T, replacements: ReplacementsType)
10
10
  export declare function getInterpolatedButtonComponents(component: TButtonContainer): TComponent[];
11
11
  export declare function getSkuButtonComponents(items: PaywallSKU[], component: TProductContainer, mediaList?: {
12
12
  [mediaName: string]: Pick<TPaywallMedia, 'content'>;
13
- }, additionalVariableStates?: object): [boolean, TComponent[]][];
13
+ }): [boolean, TComponent[]][];
14
14
  export declare function getRepeatingListBlocks(component: TResponsiveGrid): TComponent[][];
15
15
  export declare function getCarouselSlides(component: TCarouselContainer): TComponent[][];
16
16
  export declare function conditionComponentMatches(condition: TConditionalComponent): boolean;
17
17
  export declare function withOverrides<T extends TBaseComponent>({ conditionAttributes, ...component }: T): T;
18
18
  export declare function valueFromSmartText<T>(value: T, sku?: PaywallSKU, block?: any): T;
19
19
  export declare const totalTimeSpentOnPaywall: () => number | undefined;
20
+ export declare const rgbaToHex: (rgba?: string) => string | null;
21
+ export declare const sameColors: (color1?: string, color2?: string) => boolean;
20
22
  export {};
@@ -2,12 +2,12 @@ import { NamiProductDetails, NamiProductOffer, NamiSubscriptionPeriod } from "..
2
2
  import { PricingPhase } from "../../types/products";
3
3
  import { PaywallSKU } from "../../types/sku";
4
4
  export declare const isSubscription: (productType?: string) => productType is "subscription";
5
- export declare function getStandardBillingPeriod(product: NamiProductDetails): string | undefined;
6
- export declare function getFreeTrialPeriod(product: NamiProductDetails): string | undefined;
5
+ export declare function getStandardBillingPeriod(product: NamiProductDetails): string | null;
6
+ export declare function getFreeTrialPeriod(product: NamiProductDetails): string | null;
7
7
  export declare function getFreeTrialOffer(product: NamiProductDetails): NamiProductOffer | undefined;
8
8
  export declare function extractStandardPricingPhases(product: NamiProductDetails): PricingPhase[];
9
9
  export declare function convertOfferToPricingPhase(offer: NamiProductOffer | null, subPeriod?: NamiSubscriptionPeriod): PricingPhase;
10
- export declare function convertISO8601PeriodToText(iso8601Period?: string, singular?: boolean, justPeriod?: boolean, justNumber?: boolean): string | null;
10
+ export declare function convertISO8601PeriodToText(iso8601Period: string | null, singular?: boolean, justPeriod?: boolean, justNumber?: boolean): string | null;
11
11
  export declare function getCurrencyFormat(priceCurrencyCode: string): Intl.NumberFormat;
12
12
  export declare const getPriceDifference: (currentSkuPricePerMonth?: number, referencedSkuPricePerMonth?: number, currencyFormat?: Intl.NumberFormat) => string | null;
13
13
  export declare const getPercentagePriceDifference: (currentSkuPrice?: number, currentSkuDurationInMonths?: number, referencedSkuPrice?: number, referencedSkuPeriodInMonths?: number) => string | null;
@@ -1,7 +1,8 @@
1
- import { InitiateStateGroup, ISkuMenu, TInitialState } from "../../types/paywall";
1
+ import { ISkuMenu, TInitialState } from "../../types/paywall";
2
2
  import { NamiProductDetails } from "../../types/externals/product";
3
3
  import { PaywallSKU } from "../../types/sku";
4
4
  import { NamiPaywallLaunchContext } from "../../nami-web";
5
+ import { TCarouselSlide } from "src/types/components/containers";
5
6
  export declare function currentSku(productDetails: NamiProductDetails[], initialState: TInitialState, skuMenus: ISkuMenu[], skus: PaywallSKU[]): {
6
7
  [key: string]: any;
7
8
  };
@@ -9,7 +10,10 @@ export declare function skuItems(productDetails: NamiProductDetails[], skuMenus:
9
10
  export declare function getSkuSmartTextValue(productDetail?: NamiProductDetails | null, sku?: PaywallSKU, skus?: PaywallSKU[]): {
10
11
  [key: string]: any;
11
12
  };
13
+ export declare function getSlideSmartTextValue(productDetail?: NamiProductDetails | null, slide?: TCarouselSlide, skus?: PaywallSKU[]): {
14
+ [key: string]: any;
15
+ };
12
16
  export declare function checkAnySkuHasTrialOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[], productGroups: string[]): boolean;
13
17
  export declare function checkAnySkuHasPromoOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[], productGroups: string[]): boolean;
14
18
  export declare function productDetail(details: NamiProductDetails[] | undefined, refId: string): NamiProductDetails | null;
15
- export declare function launchContext(groups: InitiateStateGroup[], stateContext: NamiPaywallLaunchContext, context?: NamiPaywallLaunchContext): NamiPaywallLaunchContext;
19
+ export declare function launchContext(stateContext: NamiPaywallLaunchContext, context?: NamiPaywallLaunchContext): NamiPaywallLaunchContext;
@@ -1,6 +1,7 @@
1
+ import { TCarouselContainer } from "src/types/components/containers";
1
2
  import { TBaseComponent, TContainerPosition } from "../../types/components";
2
3
  import { TSegmentPickerItem, TTextLikeComponent } from "../../types/components/elements";
3
- export declare function parseSize(value: string | number): string;
4
+ export declare function parseSize(value: string | number, scaleFactor: number): string;
4
5
  export declare function backgroundColor(value: string): string;
5
6
  export declare function pickAndApplyBackgroundColor(component: TBaseComponent, inFocusedState?: boolean): string;
6
7
  export declare function flexDirection({ direction }: TBaseComponent): string;
@@ -8,20 +9,21 @@ export declare function flexAlignments(component: TBaseComponent): string;
8
9
  export declare function applyTextOverflow(component: TTextLikeComponent): string;
9
10
  export declare function transition(): string;
10
11
  export declare function grow({ grow }: TBaseComponent): string;
11
- export declare function paddingAndMargin(component: TBaseComponent): string;
12
+ export declare function paddingAndMargin(component: TBaseComponent, scaleFactor: number): string;
13
+ export declare function slidePaddingAndMargin(component: TCarouselContainer, scaleFactor: number): string;
12
14
  export declare function transform({ moveX, moveY, }: TBaseComponent): string;
13
- export declare function borders(component: TBaseComponent, inFocusedState?: boolean): string;
15
+ export declare function borders(component: TBaseComponent, scaleFactor: number, inFocusedState?: boolean): string;
14
16
  export declare function alignItems({ alignment, }: TBaseComponent): string;
15
17
  export declare function justifyContent({ alignment, }: TBaseComponent): string;
16
- export declare function widthAndHeight(component: TBaseComponent): string;
18
+ export declare function widthAndHeight(component: TBaseComponent, scaleFactor: number): string;
17
19
  export declare function zIndex({ zIndex }: TBaseComponent): string;
18
20
  export declare function dropShadow(component: TBaseComponent): string;
19
21
  export declare function textStrikethrough(value: boolean | undefined): string;
20
22
  export declare function font({ fontName }: TTextLikeComponent): string;
21
- export declare function applyStyles(component: TBaseComponent, inFocusedState?: boolean): string;
22
- export declare function applyGridStyles(component: TBaseComponent, inFocusedState?: boolean): string;
23
+ export declare function applyStyles(component: TBaseComponent, scaleFactor: number, inFocusedState?: boolean): string;
24
+ export declare function applyGridStyles(component: TBaseComponent, inFocusedState?: boolean, scaleFactor?: number): string;
23
25
  export declare function parsePosition(position?: TContainerPosition): string;
24
26
  export declare function getComponentStyles(prefix: string, component: TSegmentPickerItem): TSegmentPickerItem;
25
27
  export declare function formatKey(key: string, prefix: string): string;
26
- export declare function applySegmentStyles(styles: any, inFocusedState: boolean): string;
27
- export declare function applySegmentFontStyles(styles: any): string;
28
+ export declare function applySegmentStyles(styles: any, scaleFactor: number, inFocusedState: boolean): string;
29
+ export declare function applySegmentFontStyles(styles: any, scaleFactor: number): string;