@namiml/web-sdk 1.6.3 → 1.7.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 +173 -160
- package/dist/components/ContextConsumer.d.ts +4 -2
- package/dist/components/ContextProvider.d.ts +27 -7
- package/dist/components/NamiElement.d.ts +3 -0
- package/dist/components/Paywall.d.ts +27 -15
- package/dist/components/PaywallContext.d.ts +4 -0
- package/dist/components/PaywallScreen.d.ts +23 -0
- package/dist/components/TemplateComponent.d.ts +2 -1
- package/dist/components/containers/BackgroundContainer.d.ts +0 -1
- package/dist/components/containers/CarouselContainer.d.ts +5 -2
- package/dist/components/containers/CollapseContainer.d.ts +1 -1
- package/dist/components/containers/Header.d.ts +1 -0
- package/dist/components/elements/Button.d.ts +3 -2
- package/dist/components/elements/QRCode.d.ts +4 -1
- package/dist/components/elements/RadioButton.d.ts +12 -0
- package/dist/components/elements/SegmentPicker.d.ts +1 -1
- package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
- package/dist/components/elements/ToggleSwitch.d.ts +18 -0
- package/dist/components/elements/Video.d.ts +1 -0
- package/dist/components/index.d.ts +7 -1
- package/dist/components/utils/actionTap.d.ts +15 -7
- package/dist/components/utils/helpers.d.ts +9 -9
- package/dist/components/utils/state.d.ts +5 -5
- package/dist/components/utils/swipe.d.ts +74 -0
- package/dist/nami/campaign.d.ts +3 -3
- package/dist/nami/flow/NamiFlow.d.ts +10 -6
- package/dist/nami/flow/NamiFlowManager.d.ts +1 -1
- package/dist/nami/utils/campaign.d.ts +18 -0
- package/dist/nami/utils/paywall.d.ts +17 -0
- package/dist/nami-web-ssr.d.ts +1 -0
- package/dist/nami-web.cjs +100 -38
- package/dist/nami-web.mjs +101 -39
- package/dist/nami-web.umd.js +101 -39
- package/dist/services/storage.service.d.ts +2 -2
- package/dist/services/video.service.d.ts +8 -6
- package/dist/types/components/containers.d.ts +53 -6
- package/dist/types/components/elements.d.ts +1 -1
- package/dist/types/components/index.d.ts +8 -5
- package/dist/types/conditions.d.ts +16 -14
- package/dist/types/externals/product.d.ts +2 -2
- package/dist/types/flow.d.ts +30 -7
- package/dist/types/paywall.d.ts +5 -6
- package/package.json +19 -13
- package/dist/nami-web.js +0 -96
|
@@ -30,8 +30,8 @@ export declare class StorageService {
|
|
|
30
30
|
setProducts(key: string, products: SKU[]): void;
|
|
31
31
|
getProducts(key: string): SKU[] | null;
|
|
32
32
|
getCachedProducts(): SKU[] | null;
|
|
33
|
-
setNamiConfig(config: NamiConfiguration): void;
|
|
34
|
-
getNamiConfig(): NamiConfiguration | null;
|
|
33
|
+
setNamiConfig(config: Omit<NamiConfiguration, "initialConfig">): void;
|
|
34
|
+
getNamiConfig(): Omit<NamiConfiguration, "initialConfig"> | null;
|
|
35
35
|
setCustomerAttribute<T>(attribute: string, value: T): void;
|
|
36
36
|
getCustomerAttribute<T>(attribute: string): T | null;
|
|
37
37
|
getAllCustomerAttributes(): string[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NamiPaywallAction } from "../types/externals/paywall";
|
|
2
|
+
import type { PaywallContextProvider } from "../components/ContextProvider";
|
|
2
3
|
export declare class VideoService {
|
|
3
4
|
video: HTMLVideoElement;
|
|
4
5
|
playing: boolean;
|
|
@@ -10,11 +11,12 @@ export declare class VideoService {
|
|
|
10
11
|
videoComponentId: string;
|
|
11
12
|
videoSrc: string;
|
|
12
13
|
toggling: boolean;
|
|
13
|
-
static instance: VideoService;
|
|
14
|
-
constructor(video: HTMLVideoElement, name?: string, id?: string);
|
|
15
|
-
handleVideoEvents: () => void;
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
static instance: VideoService | null;
|
|
15
|
+
constructor(contextProvider: PaywallContextProvider, video: HTMLVideoElement, name?: string, id?: string);
|
|
16
|
+
handleVideoEvents: (contextProvider: PaywallContextProvider) => void;
|
|
17
|
+
removeVideoEvents: () => void;
|
|
18
|
+
togglePlayVideo(contextProvider: PaywallContextProvider): void;
|
|
19
|
+
toggleMuteVideo(contextProvider: PaywallContextProvider): void;
|
|
18
20
|
videoPlayingAction(): NamiPaywallAction.VIDEO_STARTED | NamiPaywallAction.VIDEO_PAUSED | NamiPaywallAction.VIDEO_RESUMED | NamiPaywallAction.VIDEO_ENDED | NamiPaywallAction.UNKNOWN;
|
|
19
|
-
handlePlayerAnalytics(action?: NamiPaywallAction): void;
|
|
21
|
+
handlePlayerAnalytics(contextProvider: PaywallContextProvider, action?: NamiPaywallAction): void;
|
|
20
22
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { NamiSKU } from "../../types/externals/sku";
|
|
2
2
|
import { TBaseComponent, TComponent, TContainer, TTestObject } from ".";
|
|
3
|
-
import { TConditionalComponent, TImageComponent, TSpacerComponent, TTextComponent, TTextListComponent } from "./elements";
|
|
4
|
-
export type
|
|
3
|
+
import { TConditionalComponent, TImageComponent, TSpacerComponent, TSymbolComponent, TTextComponent, TTextListComponent } from "./elements";
|
|
4
|
+
export type TVariablePattern = `\${var.${string}}`;
|
|
5
|
+
export type THeaderFooter = (TContainer | TButtonContainer | TSpacerComponent | TTextComponent | TConditionalComponent)[] | null;
|
|
5
6
|
type Button = TBaseComponent & {
|
|
6
7
|
id?: string;
|
|
7
8
|
sku?: NamiSKU;
|
|
8
9
|
url?: string;
|
|
9
|
-
components: Array<TTextComponent | TTextListComponent | TSpacerComponent | TImageComponent | TContainer | TConditionalComponent>;
|
|
10
|
+
components: Array<TTextComponent | TTextListComponent | TSpacerComponent | TImageComponent | TContainer | TConditionalComponent | TSymbolComponent>;
|
|
10
11
|
screenreaderText?: string;
|
|
11
12
|
screenreaderHint?: string;
|
|
13
|
+
text?: string | null;
|
|
14
|
+
actionTap?: string | null;
|
|
12
15
|
};
|
|
13
16
|
export type TButtonContainer = Button & {
|
|
14
17
|
component: "button";
|
|
@@ -44,20 +47,30 @@ export type SKUActionHandler = (sku: NamiSKU) => void;
|
|
|
44
47
|
export type DeepLinkUrlHandler = (url: string) => void;
|
|
45
48
|
export type CloseHandler = (body?: any) => void;
|
|
46
49
|
export type Callback = () => void;
|
|
50
|
+
type CarouselIndicator = {
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
53
|
+
borderRadius: number;
|
|
54
|
+
fillColor: string;
|
|
55
|
+
component: "container";
|
|
56
|
+
};
|
|
47
57
|
export type TCarouselContainer = Omit<TContainer, "component"> & {
|
|
48
58
|
component: "carouselContainer";
|
|
49
59
|
indicatorColor: string;
|
|
50
60
|
activeIndicatorColor: string;
|
|
51
61
|
autoplay: boolean;
|
|
52
62
|
autoplaySeconds: number;
|
|
53
|
-
loopSource?: TCarouselSlide[]
|
|
63
|
+
loopSource?: string | TCarouselSlide[];
|
|
54
64
|
loopVariable?: string;
|
|
55
|
-
loopSourceConditions
|
|
65
|
+
loopSourceConditions?: TTestObject[];
|
|
56
66
|
showIndicators?: boolean;
|
|
57
67
|
inactiveSlideScale?: number;
|
|
58
68
|
nextSlidePadding?: number;
|
|
59
69
|
previousSlidePadding?: number;
|
|
60
70
|
slideSpacing?: number;
|
|
71
|
+
onChange?: UserAction;
|
|
72
|
+
indicator?: CarouselIndicator;
|
|
73
|
+
activeIndicator?: CarouselIndicator;
|
|
61
74
|
};
|
|
62
75
|
export type TCarouselSlidesState = {
|
|
63
76
|
[groupId: string]: {
|
|
@@ -66,7 +79,7 @@ export type TCarouselSlidesState = {
|
|
|
66
79
|
};
|
|
67
80
|
export type TCarouselSlide = {
|
|
68
81
|
id: string;
|
|
69
|
-
title
|
|
82
|
+
title?: string;
|
|
70
83
|
[slideAttr: string]: any;
|
|
71
84
|
};
|
|
72
85
|
export type TFlexProductContainer = Omit<TContainer, "component"> & {
|
|
@@ -107,4 +120,38 @@ export type TResponsiveGrid = TBaseComponent & {
|
|
|
107
120
|
loopSource?: string;
|
|
108
121
|
loopSourceConditions: TTestObject[];
|
|
109
122
|
};
|
|
123
|
+
export type TToggleSwitch = TBaseComponent & {
|
|
124
|
+
component: 'toggleSwitch';
|
|
125
|
+
checked?: boolean;
|
|
126
|
+
innerPadding?: TVariablePattern | number;
|
|
127
|
+
activeHandleFillColor?: string;
|
|
128
|
+
activeHandleBorderColor?: string;
|
|
129
|
+
activeHandleBorderWidth?: number;
|
|
130
|
+
activePlateFillColor?: string;
|
|
131
|
+
activePlateBorderColor?: string;
|
|
132
|
+
activePlateBorderWidth?: number;
|
|
133
|
+
activePlateBorderRadius?: number;
|
|
134
|
+
inactiveHandleFillColor?: string;
|
|
135
|
+
inactiveHandleBorderColor?: string;
|
|
136
|
+
inactiveHandleBorderWidth?: number;
|
|
137
|
+
inactivePlateFillColor?: string;
|
|
138
|
+
inactivePlateBorderColor?: string;
|
|
139
|
+
inactivePlateBorderWidth?: number;
|
|
140
|
+
inactivePlateBorderRadius?: number;
|
|
141
|
+
};
|
|
142
|
+
export type TRadioButton = TBaseComponent & {
|
|
143
|
+
component: 'radio';
|
|
144
|
+
components: TComponent[];
|
|
145
|
+
active?: boolean;
|
|
146
|
+
innerPadding?: TVariablePattern | number;
|
|
147
|
+
activeFillColor?: string;
|
|
148
|
+
activeBorderColor?: string;
|
|
149
|
+
activeBorderWidth?: number;
|
|
150
|
+
activeDropShadow?: string;
|
|
151
|
+
inactiveFillColor?: string;
|
|
152
|
+
inactiveBorderColor?: string;
|
|
153
|
+
inactiveBorderWidth?: number;
|
|
154
|
+
inactiveDropShadow?: string;
|
|
155
|
+
sku?: NamiSKU;
|
|
156
|
+
};
|
|
110
157
|
export {};
|
|
@@ -75,7 +75,7 @@ export type TVideoComponent = TBaseComponent & {
|
|
|
75
75
|
imageCropping?: "fill" | "fit";
|
|
76
76
|
autoplayVideo?: boolean;
|
|
77
77
|
controlsType?: string;
|
|
78
|
-
fallbackImage?: string;
|
|
78
|
+
fallbackImage?: string | null;
|
|
79
79
|
loopVideo?: boolean;
|
|
80
80
|
mute?: boolean;
|
|
81
81
|
screenreaderText?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TButtonContainer, TCarouselContainer, TCarouselSlide, TCollapseContainer, TFlexProductContainer, TPlayPauseButton, TProductContainer, TResponsiveGrid, TStack, TVolumeButton, UserAction } from "./containers";
|
|
1
|
+
import { TButtonContainer, TCarouselContainer, TCarouselSlide, TCollapseContainer, TFlexProductContainer, TPlayPauseButton, TProductContainer, TRadioButton, TResponsiveGrid, TStack, TToggleSwitch, TVolumeButton, UserAction } from "./containers";
|
|
2
2
|
import { TConditionalComponent, TImageComponent, TQRCodeComponent, TSegmentPicker, TSegmentPickerItem, TSpacerComponent, TSvgImageComponent, TSymbolComponent, TTextComponent, TTextListComponent, TVideoComponent } from "./elements";
|
|
3
3
|
export interface TBaseComponent {
|
|
4
4
|
id?: string;
|
|
@@ -46,6 +46,7 @@ export interface TBaseComponent {
|
|
|
46
46
|
width?: number | string;
|
|
47
47
|
dropShadow?: string;
|
|
48
48
|
onTap?: UserAction;
|
|
49
|
+
actionTap?: string;
|
|
49
50
|
refId?: string;
|
|
50
51
|
_fields?: {
|
|
51
52
|
[attribute: string]: TFieldSettings;
|
|
@@ -68,7 +69,7 @@ export interface TBaseComponent {
|
|
|
68
69
|
fixedWidth?: number | "fitContent";
|
|
69
70
|
hidden?: boolean;
|
|
70
71
|
}
|
|
71
|
-
export type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer | TResponsiveGrid | TVolumeButton | TPlayPauseButton | TQRCodeComponent;
|
|
72
|
+
export type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer | TResponsiveGrid | TVolumeButton | TPlayPauseButton | TQRCodeComponent | TToggleSwitch | TRadioButton;
|
|
72
73
|
export type DirectionType = "vertical" | "horizontal";
|
|
73
74
|
export type AlignmentType = "center" | "right" | "left" | "top" | "bottom";
|
|
74
75
|
export type BorderLocationType = "upperLeft" | "upperRight" | "lowerLeft" | "lowerRight";
|
|
@@ -79,7 +80,7 @@ export declare const BorderSideMap: Record<BorderSideType, string>;
|
|
|
79
80
|
export type TTestObject = {
|
|
80
81
|
value: any;
|
|
81
82
|
expected: any;
|
|
82
|
-
operator: "equals" | "contains" | "notEquals" | "set" | "notSet" | "notContains";
|
|
83
|
+
operator: "equals" | "contains" | "notEquals" | "set" | "notSet" | "notContains" | 'gt' | 'lt' | 'gte' | 'lte';
|
|
83
84
|
};
|
|
84
85
|
type TransformToString<T> = {
|
|
85
86
|
[P in keyof T]: T[P] extends number | boolean ? T[P] | string : T[P];
|
|
@@ -92,17 +93,19 @@ export type TConditionalAttributes = Array<Omit<TConditionalComponent, "componen
|
|
|
92
93
|
url?: string;
|
|
93
94
|
fontSize?: number;
|
|
94
95
|
screenreaderText?: string;
|
|
96
|
+
fontColor?: string;
|
|
97
|
+
linkColor?: string;
|
|
95
98
|
};
|
|
96
99
|
}>;
|
|
97
100
|
export type TField = "image" | "listContainerComponent" | "text" | "url" | "textArea" | "fontSelect" | "splitTextArea" | "color" | "colorGradient" | "number" | "alignment" | "carouselSlides" | "option" | "iconSelect" | "toggle";
|
|
98
101
|
export type TContainer = TBaseComponent & {
|
|
99
|
-
component: "container";
|
|
102
|
+
component: "container" | "formContainer";
|
|
100
103
|
position?: TContainerPosition;
|
|
101
104
|
fillColor?: string;
|
|
102
105
|
fillImage?: string | null;
|
|
103
106
|
components?: TComponent[];
|
|
104
107
|
loopVariable?: string;
|
|
105
|
-
loopSource?: any[];
|
|
108
|
+
loopSource?: string | any[];
|
|
106
109
|
backgroundBlur?: number | null;
|
|
107
110
|
};
|
|
108
111
|
export type TFieldSettings = {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
NONE
|
|
3
|
-
AND
|
|
4
|
-
OR
|
|
5
|
-
}
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
export declare const LogicalOperator: {
|
|
2
|
+
readonly NONE: "none";
|
|
3
|
+
readonly AND: "and";
|
|
4
|
+
readonly OR: "or";
|
|
5
|
+
};
|
|
6
|
+
export type LogicalOperator = (typeof LogicalOperator)[keyof typeof LogicalOperator];
|
|
7
|
+
export declare const FilterOperator: {
|
|
8
|
+
readonly I_CONTAINS: "i_contains";
|
|
9
|
+
readonly EQUALS: "equals";
|
|
10
|
+
readonly I_EQUALS: "i_equals";
|
|
11
|
+
readonly NOT_EQUALS: "not_equals";
|
|
12
|
+
readonly NOT_I_EQUALS: "not_i_equals";
|
|
13
|
+
readonly NOT_CONTAINS: "not_contains";
|
|
14
|
+
};
|
|
15
|
+
export type FilterOperator = (typeof FilterOperator)[keyof typeof FilterOperator];
|
|
14
16
|
export interface NamiConditionFilter {
|
|
15
17
|
identifier: string;
|
|
16
18
|
operator: FilterOperator;
|
|
@@ -18,5 +20,5 @@ export interface NamiConditionFilter {
|
|
|
18
20
|
}
|
|
19
21
|
export interface NamiConditions {
|
|
20
22
|
filter?: NamiConditionFilter[];
|
|
21
|
-
|
|
23
|
+
operator?: LogicalOperator;
|
|
22
24
|
}
|
|
@@ -13,7 +13,7 @@ export interface NamiProductDetails {
|
|
|
13
13
|
}
|
|
14
14
|
export type NamiProductOffer = NamiOfferPrice & {
|
|
15
15
|
offer_ref_id?: string;
|
|
16
|
-
offer_type: 'promo' | 'default';
|
|
16
|
+
offer_type: 'promo' | 'default' | (string & {});
|
|
17
17
|
promo_period?: NamiOfferPeriod;
|
|
18
18
|
promo_price?: NamiOfferPrice;
|
|
19
19
|
};
|
|
@@ -22,7 +22,7 @@ type NamiOfferPrice = {
|
|
|
22
22
|
currency: string;
|
|
23
23
|
};
|
|
24
24
|
type NamiOfferPeriod = NamiSubscriptionPeriod;
|
|
25
|
-
export type NamiSubscriptionInterval = 'day' | 'week' | 'month' | 'year' | 'unknown';
|
|
25
|
+
export type NamiSubscriptionInterval = 'day' | 'week' | 'month' | 'year' | 'unknown' | (string & {});
|
|
26
26
|
export type NamiSubscriptionPeriod = {
|
|
27
27
|
type: NamiSubscriptionInterval;
|
|
28
28
|
count: number;
|
package/dist/types/flow.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { NamiConditions } from "./conditions";
|
|
2
2
|
import { FormFactor } from "./campaign";
|
|
3
|
-
export declare
|
|
4
|
-
ENTRY
|
|
5
|
-
SCREEN
|
|
6
|
-
BRANCH
|
|
7
|
-
EXIT
|
|
8
|
-
UNKNOWN
|
|
9
|
-
}
|
|
3
|
+
export declare const NamiFlowStepType: {
|
|
4
|
+
readonly ENTRY: "entry";
|
|
5
|
+
readonly SCREEN: "screen";
|
|
6
|
+
readonly BRANCH: "branch";
|
|
7
|
+
readonly EXIT: "exit";
|
|
8
|
+
readonly UNKNOWN: "unknown";
|
|
9
|
+
};
|
|
10
|
+
export type NamiFlowStepType = (typeof NamiFlowStepType)[keyof typeof NamiFlowStepType];
|
|
10
11
|
export declare enum NamiFlowActionFunction {
|
|
11
12
|
NAVIGATE = "flowNav",
|
|
12
13
|
BACK = "flowPrev",
|
|
@@ -41,6 +42,7 @@ export interface NamiFlowObjectDTO {
|
|
|
41
42
|
form_factors?: FormFactor[];
|
|
42
43
|
version?: string;
|
|
43
44
|
steps?: NamiFlowStep[];
|
|
45
|
+
transition?: NamiFlowTransition;
|
|
44
46
|
}
|
|
45
47
|
type SetVideoAction = {
|
|
46
48
|
name?: string;
|
|
@@ -56,6 +58,7 @@ export interface NamiFlowAction {
|
|
|
56
58
|
step?: string;
|
|
57
59
|
eventName?: string;
|
|
58
60
|
delay?: string | number;
|
|
61
|
+
[key: string]: any;
|
|
59
62
|
} & SetVideoAction;
|
|
60
63
|
conditions?: NamiConditions[];
|
|
61
64
|
}
|
|
@@ -73,4 +76,24 @@ export interface NamiFlowStep {
|
|
|
73
76
|
actions: Partial<Record<string, NamiFlowOn[]>>;
|
|
74
77
|
allow_back_to?: boolean;
|
|
75
78
|
}
|
|
79
|
+
export type NamiFlowTransition = 'none' | 'slide' | 'verticalSlide' | 'fade';
|
|
80
|
+
export type NamiFlowTransitionDirection = 'forward' | 'backward';
|
|
81
|
+
export interface NamiFlowAnimation {
|
|
82
|
+
transition: NamiFlowTransition;
|
|
83
|
+
direction: NamiFlowTransitionDirection;
|
|
84
|
+
}
|
|
85
|
+
export declare const NamiReservedActions: {
|
|
86
|
+
readonly BUY_SKU: "__buy_sku__";
|
|
87
|
+
readonly DEFAULT: "__default__";
|
|
88
|
+
readonly APPEAR: "__appear__";
|
|
89
|
+
readonly DISAPPEAR: "__disappear__";
|
|
90
|
+
readonly LOGIN_SUCCESS: "__login_success__";
|
|
91
|
+
readonly LOGIN_FAILURE: "__login_failure__";
|
|
92
|
+
readonly LOGOUT_SUCCESS: "__logout_success__";
|
|
93
|
+
readonly LOGOUT_FAILURE: "__logout_failure__";
|
|
94
|
+
readonly PURCHASE_SUCCESS: "__purchase_success__";
|
|
95
|
+
readonly PURCHASE_FAILURE: "__purchase_failure__";
|
|
96
|
+
readonly RESUME: "__resume__";
|
|
97
|
+
readonly REMOTE_BACK: "__remoteback__";
|
|
98
|
+
};
|
|
76
99
|
export {};
|
package/dist/types/paywall.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NamiCampaign } from "./externals/campaign";
|
|
2
2
|
import { TComponent, TContainer } from "./components";
|
|
3
|
-
import {
|
|
4
|
-
import { TSpacerComponent, TTextComponent } from "./components/elements";
|
|
3
|
+
import { TCarouselSlidesState, THeaderFooter } from "./components/containers";
|
|
5
4
|
import { TDeviceOrientation } from "./device";
|
|
6
5
|
import { PaywallSKU } from "./sku";
|
|
7
6
|
import { NamiPurchase } from "./externals/purchase";
|
|
@@ -53,7 +52,7 @@ export type TPaywallContext = TInitialState & {
|
|
|
53
52
|
timeSpentOnPaywall?: number;
|
|
54
53
|
userInteractionEnabled?: boolean;
|
|
55
54
|
};
|
|
56
|
-
export type TPaywallLaunchContext = NamiPaywallLaunchContext
|
|
55
|
+
export type TPaywallLaunchContext = Required<NamiPaywallLaunchContext>;
|
|
57
56
|
export type ProductGroup = {
|
|
58
57
|
id: string;
|
|
59
58
|
products: PaywallSKU[];
|
|
@@ -96,7 +95,7 @@ export type FontDetails = {
|
|
|
96
95
|
export type TPaywallTemplate = {
|
|
97
96
|
id: string;
|
|
98
97
|
orgs?: string | null;
|
|
99
|
-
org_id
|
|
98
|
+
org_id?: string | null;
|
|
100
99
|
changelog?: string;
|
|
101
100
|
userHasAccess?: boolean;
|
|
102
101
|
media?: {
|
|
@@ -120,9 +119,9 @@ export type TPaywallTemplate = {
|
|
|
120
119
|
};
|
|
121
120
|
export type TPages = {
|
|
122
121
|
name: string;
|
|
123
|
-
header:
|
|
122
|
+
header: THeaderFooter;
|
|
124
123
|
contentContainer: TContainer | null;
|
|
125
|
-
footer:
|
|
124
|
+
footer: THeaderFooter;
|
|
126
125
|
backgroundContainer: TContainer | null;
|
|
127
126
|
};
|
|
128
127
|
export type TInitialState = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namiml/web-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"source": "src/nami-web.ts",
|
|
6
6
|
"description": "Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing",
|
|
7
7
|
"scripts": {
|
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
"test": "yarn clear-test-cache && TZ=UTC jest --coverage -i --forceExit",
|
|
10
10
|
"build-sdk": "rm -rf dist && rollup -c",
|
|
11
11
|
"watch": "microbundle --tsconfig tsconfig.dev.json --output ./dist/nami-web.mjs --watch --no-compress --format modern --define NAMI_SDK_ENV='development'",
|
|
12
|
-
"
|
|
13
|
-
"build
|
|
12
|
+
"dev": "NAMI_SDK_ENV=development rollup -c -w",
|
|
13
|
+
"build": "NAMI_SDK_ENV=production rollup -c",
|
|
14
|
+
"build:dev": "NAMI_SDK_ENV=development rollup -c",
|
|
15
|
+
"build:prod": "NAMI_SDK_ENV=production rollup -c",
|
|
14
16
|
"react-dev": "yarn build:dev && yarn copy-react && cd examples/react-demo && yarn start",
|
|
15
17
|
"react-prod": "yarn build:dev && yarn copy-react && cd examples/react-demo && yarn start",
|
|
16
18
|
"vue-dev": "yarn build:dev && yarn copy-vue && cd examples/vue-demo && yarn serve",
|
|
@@ -21,15 +23,18 @@
|
|
|
21
23
|
"copy-lit": "cd examples/lit && rm -rf nami-dist && mkdir nami-dist && cp -r ../../dist/nami-web.mjs nami-dist/",
|
|
22
24
|
"copy-vue": "cd examples/vue-demo && rm -rf nami-dist && mkdir nami-dist && cp -r ../../dist/nami-web.* nami-dist/"
|
|
23
25
|
},
|
|
26
|
+
"main": "./dist/nami-web.cjs",
|
|
27
|
+
"module": "./dist/nami-web.mjs",
|
|
28
|
+
"types": "dist/nami-web.d.ts",
|
|
24
29
|
"exports": {
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/nami-web.d.ts",
|
|
32
|
+
"import": "./dist/nami-web.mjs",
|
|
33
|
+
"require": "./dist/nami-web.cjs",
|
|
34
|
+
"umd": "./dist/nami-web.umd.js",
|
|
35
|
+
"default": "./dist/nami-web.mjs"
|
|
36
|
+
}
|
|
28
37
|
},
|
|
29
|
-
"main": "dist/nami-web.cjs",
|
|
30
|
-
"module": "dist/nami-web.js",
|
|
31
|
-
"unpkg": "dist/nami-web.umd.js",
|
|
32
|
-
"types": "dist/nami-web.d.ts",
|
|
33
38
|
"files": [
|
|
34
39
|
"dist",
|
|
35
40
|
"CHANGELOG.md"
|
|
@@ -83,11 +88,12 @@
|
|
|
83
88
|
"wrangler": "^3.66.0"
|
|
84
89
|
},
|
|
85
90
|
"dependencies": {
|
|
86
|
-
"@lit-labs/ssr-dom-shim": "^1.
|
|
91
|
+
"@lit-labs/ssr-dom-shim": "^1.4.0",
|
|
92
|
+
"@lit/context": "^1.1.6",
|
|
87
93
|
"bowser": "^2.11.0",
|
|
88
|
-
"date-fns-tz": "^3.
|
|
94
|
+
"date-fns-tz": "^3.2.0",
|
|
89
95
|
"hls.js": "^1.5.15",
|
|
90
|
-
"lit": "^3.1
|
|
96
|
+
"lit": "^3.3.1",
|
|
91
97
|
"lodash-es": "^4.17.21",
|
|
92
98
|
"marked": "^12.0.2",
|
|
93
99
|
"pako": "^2.1.0",
|