@namiml/web-sdk 3.4.0-dev.202604010118 → 3.4.0-dev.202604170506

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 (135) hide show
  1. package/dist/adapters/index.d.ts +1 -0
  2. package/dist/adapters/web-device.adapter.d.ts +14 -0
  3. package/dist/adapters/web-storage.adapter.d.ts +8 -0
  4. package/dist/adapters/web-ui.adapter.d.ts +9 -0
  5. package/dist/components/ContextConsumer.d.ts +1 -1
  6. package/dist/components/ContextProvider.d.ts +32 -87
  7. package/dist/components/NamiElement.d.ts +1 -1
  8. package/dist/components/Paywall.d.ts +1 -5
  9. package/dist/components/PaywallScreen.d.ts +2 -4
  10. package/dist/components/TemplateComponent.d.ts +2 -2
  11. package/dist/components/containers/BackgroundContainer.d.ts +1 -2
  12. package/dist/components/containers/CarouselContainer.d.ts +3 -3
  13. package/dist/components/containers/CollapseContainer.d.ts +3 -3
  14. package/dist/components/containers/Container.d.ts +3 -3
  15. package/dist/components/containers/Content.d.ts +1 -2
  16. package/dist/components/containers/Footer.d.ts +2 -2
  17. package/dist/components/containers/Header.d.ts +2 -2
  18. package/dist/components/containers/ProductContainer.d.ts +2 -2
  19. package/dist/components/containers/RepeatingGrid.d.ts +1 -2
  20. package/dist/components/containers/ResponsiveGrid.d.ts +2 -2
  21. package/dist/components/elements/Button.d.ts +3 -3
  22. package/dist/components/elements/CountdownTimerText.d.ts +2 -3
  23. package/dist/components/elements/Image.d.ts +1 -1
  24. package/dist/components/elements/PlayPauseButton.d.ts +2 -2
  25. package/dist/components/elements/ProgressBar.d.ts +2 -2
  26. package/dist/components/elements/ProgressIndicator.d.ts +2 -2
  27. package/dist/components/elements/QRCode.d.ts +2 -2
  28. package/dist/components/elements/RadioButton.d.ts +2 -2
  29. package/dist/components/elements/SegmentPicker.d.ts +3 -3
  30. package/dist/components/elements/SegmentPickerItem.d.ts +2 -2
  31. package/dist/components/elements/Spacer.d.ts +2 -2
  32. package/dist/components/elements/Stack.d.ts +2 -2
  33. package/dist/components/elements/Text.d.ts +2 -2
  34. package/dist/components/elements/ToggleButton.d.ts +2 -2
  35. package/dist/components/elements/ToggleSwitch.d.ts +2 -2
  36. package/dist/components/elements/Video.d.ts +1 -1
  37. package/dist/components/elements/VolumeButton.d.ts +2 -2
  38. package/dist/components/productDetails.d.ts +1 -1
  39. package/dist/components/utils/actionTap.d.ts +1 -1
  40. package/dist/components/utils/helpers.d.ts +5 -5
  41. package/dist/components/utils/impression.d.ts +2 -2
  42. package/dist/components/utils/products.d.ts +1 -2
  43. package/dist/components/utils/state.d.ts +4 -4
  44. package/dist/components/utils/styles.d.ts +12 -4
  45. package/dist/legacy-support.cjs +213 -25528
  46. package/dist/legacy-support.d.ts +48 -1
  47. package/dist/legacy-support.mjs +213 -25528
  48. package/dist/nami-web.cjs +26 -26
  49. package/dist/nami-web.d.ts +606 -10
  50. package/dist/nami-web.mjs +26 -26
  51. package/dist/nami-web.umd.js +91 -91
  52. package/dist/polyfills.cjs +50 -25519
  53. package/dist/polyfills.js +50 -25519
  54. package/dist/translations/translate.d.ts +1 -6
  55. package/dist/types/externals/campaign.d.ts +2 -62
  56. package/dist/types/externals/config.d.ts +1 -41
  57. package/dist/types/externals/customer.d.ts +1 -18
  58. package/dist/types/externals/entitlement.d.ts +1 -38
  59. package/dist/types/externals/errors.d.ts +1 -12
  60. package/dist/types/externals/flow.d.ts +2 -51
  61. package/dist/types/externals/languages.d.ts +1 -197
  62. package/dist/types/externals/loglevel.d.ts +2 -10
  63. package/dist/types/externals/paywall.d.ts +2 -109
  64. package/dist/types/externals/product.d.ts +1 -32
  65. package/dist/types/externals/purchase.d.ts +1 -42
  66. package/dist/types/externals/sku.d.ts +1 -31
  67. package/dist/utils/animations.d.ts +1 -1
  68. package/dist/utils/fonts.d.ts +1 -1
  69. package/package.json +35 -51
  70. package/dist/core/errors.d.ts +0 -55
  71. package/dist/core/withRetry.d.ts +0 -2
  72. package/dist/decorators/index.d.ts +0 -2
  73. package/dist/nami/api.d.ts +0 -20
  74. package/dist/nami/campaign.d.ts +0 -87
  75. package/dist/nami/customer.d.ts +0 -136
  76. package/dist/nami/emitter.d.ts +0 -13
  77. package/dist/nami/entitlement.d.ts +0 -46
  78. package/dist/nami/flow/NamiFlow.d.ts +0 -77
  79. package/dist/nami/flow/NamiFlowManager.d.ts +0 -77
  80. package/dist/nami/index.d.ts +0 -19
  81. package/dist/nami/namiRefs.d.ts +0 -17
  82. package/dist/nami/paywalls.d.ts +0 -77
  83. package/dist/nami/profile.d.ts +0 -12
  84. package/dist/nami/purchase.d.ts +0 -9
  85. package/dist/nami/utils/campaign.d.ts +0 -29
  86. package/dist/nami/utils/entitlement.d.ts +0 -55
  87. package/dist/nami/utils/index.d.ts +0 -1
  88. package/dist/nami/utils/paywall.d.ts +0 -21
  89. package/dist/nami/utils/purchase.d.ts +0 -4
  90. package/dist/nami/utils/resolvers/BaseNamespaceResolver.d.ts +0 -7
  91. package/dist/nami/utils/resolvers/ConditionalEvaluator.d.ts +0 -19
  92. package/dist/nami/utils/resolvers/DeviceResolver.d.ts +0 -10
  93. package/dist/nami/utils/resolvers/FlowLiquidResolver.d.ts +0 -19
  94. package/dist/nami/utils/resolvers/FormStateResolver.d.ts +0 -7
  95. package/dist/nami/utils/resolvers/LaunchContextResolver.d.ts +0 -8
  96. package/dist/nami/utils/resolvers/PlacementLabelResolver.d.ts +0 -8
  97. package/dist/nami/utils/resolvers/URLParamsResolver.d.ts +0 -7
  98. package/dist/repositories/campaignRule.repository.d.ts +0 -21
  99. package/dist/repositories/config.repository.d.ts +0 -5
  100. package/dist/repositories/customerJourney.repository.d.ts +0 -5
  101. package/dist/repositories/device.repository.d.ts +0 -16
  102. package/dist/repositories/entitlement.repository.d.ts +0 -11
  103. package/dist/repositories/paywall.repository.d.ts +0 -10
  104. package/dist/repositories/products.repository.d.ts +0 -6
  105. package/dist/services/logger.service.d.ts +0 -13
  106. package/dist/services/session.service.d.ts +0 -4
  107. package/dist/services/storage.service.d.ts +0 -90
  108. package/dist/types/api.d.ts +0 -30
  109. package/dist/types/campaign.d.ts +0 -16
  110. package/dist/types/components/animation.d.ts +0 -40
  111. package/dist/types/components/containers.d.ts +0 -182
  112. package/dist/types/components/elements.d.ts +0 -188
  113. package/dist/types/components/index.d.ts +0 -137
  114. package/dist/types/conditions.d.ts +0 -26
  115. package/dist/types/config.d.ts +0 -38
  116. package/dist/types/customer.d.ts +0 -2
  117. package/dist/types/device.d.ts +0 -36
  118. package/dist/types/entitlements.d.ts +0 -21
  119. package/dist/types/flow.d.ts +0 -108
  120. package/dist/types/paywall.d.ts +0 -201
  121. package/dist/types/products.d.ts +0 -6
  122. package/dist/types/profile.d.ts +0 -21
  123. package/dist/types/purchase.d.ts +0 -32
  124. package/dist/types/sku.d.ts +0 -26
  125. package/dist/types/utils.d.ts +0 -1
  126. package/dist/utils/anonymousMode.d.ts +0 -25
  127. package/dist/utils/config.d.ts +0 -10
  128. package/dist/utils/const.d.ts +0 -1
  129. package/dist/utils/device.d.ts +0 -10
  130. package/dist/utils/events.d.ts +0 -30
  131. package/dist/utils/feature-flags.d.ts +0 -1
  132. package/dist/utils/helpers.d.ts +0 -1
  133. package/dist/utils/parsers.d.ts +0 -26
  134. package/dist/utils/simple-event-target.d.ts +0 -7
  135. package/dist/utils/url-params.d.ts +0 -11
@@ -1,30 +0,0 @@
1
- export interface ApiResponse<T> {
2
- count: number;
3
- next: number;
4
- page_number: number;
5
- previous: null;
6
- results: T;
7
- total_pages: number;
8
- }
9
- export type LoginPayload = {
10
- external_id: string;
11
- };
12
- export type LoginResponse = {
13
- external_id: string;
14
- user_id: string;
15
- };
16
- export type Session = {
17
- id?: string;
18
- app_env?: string;
19
- start_time?: Date;
20
- end_time?: Date;
21
- };
22
- export type Impression = {
23
- id?: string;
24
- session?: string;
25
- segment?: string;
26
- call_to_action?: string;
27
- app_env?: string;
28
- url_params?: Record<string, string>;
29
- launch_id?: string;
30
- };
@@ -1,16 +0,0 @@
1
- import { NamiCampaign } from "./externals/campaign";
2
- export interface FormFactor {
3
- form_factor: string;
4
- supports_portrait: boolean;
5
- supports_landscape: boolean;
6
- }
7
- export type AvailableCampaignsResponseHandler = (campaigns: NamiCampaign[]) => void;
8
- export declare enum CampaignRuleType {
9
- DEFAULT = "default",
10
- LABEL = "label",
11
- URL = "url"
12
- }
13
- export declare enum CampaignRuleConversionEventType {
14
- DEEPLINK = "deeplink",
15
- IN_APP = "in_app"
16
- }
@@ -1,40 +0,0 @@
1
- export declare const NamiAnimationType: {
2
- readonly Wave: "wave";
3
- readonly Pulse: "pulse";
4
- readonly None: "none";
5
- };
6
- export type NamiAnimationType = typeof NamiAnimationType[keyof typeof NamiAnimationType];
7
- export type PulseSpec = typeof NamiAnimationType.Pulse | {
8
- type: typeof NamiAnimationType.Pulse;
9
- duration?: number;
10
- scale?: number;
11
- };
12
- export type WaveSpec = typeof NamiAnimationType.Wave | {
13
- type: typeof NamiAnimationType.Wave;
14
- duration?: number;
15
- delay?: number;
16
- circle1Color?: string;
17
- circle2Color?: string;
18
- lineWidth?: number;
19
- };
20
- export type NoneSpec = typeof NamiAnimationType.None | {
21
- type: typeof NamiAnimationType.None;
22
- };
23
- export type NamiAnimationSpec = WaveSpec | PulseSpec | NoneSpec;
24
- export type NamiAnimationObjectSpec = Extract<WaveSpec, {
25
- type: typeof NamiAnimationType.Wave;
26
- }> | Extract<PulseSpec, {
27
- type: typeof NamiAnimationType.Pulse;
28
- }> | Extract<NoneSpec, {
29
- type: typeof NamiAnimationType.None;
30
- }>;
31
- export type Wave = Required<Extract<WaveSpec, {
32
- type: typeof NamiAnimationType.Wave;
33
- }>>;
34
- export type Pulse = Required<Extract<PulseSpec, {
35
- type: typeof NamiAnimationType.Pulse;
36
- }>>;
37
- export type None = Required<Extract<NoneSpec, {
38
- type: typeof NamiAnimationType.None;
39
- }>>;
40
- export type NamiAnimation = Wave | Pulse | None;
@@ -1,182 +0,0 @@
1
- import { NamiSKU } from "../../types/externals/sku";
2
- import { TBaseComponent, TComponent, TContainer, TTestObject } from ".";
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;
6
- type Button = TBaseComponent & {
7
- id?: string;
8
- sku?: NamiSKU;
9
- url?: string;
10
- components: Array<TTextComponent | TTextListComponent | TSpacerComponent | TImageComponent | TContainer | TConditionalComponent | TSymbolComponent>;
11
- screenreaderText?: string;
12
- screenreaderHint?: string;
13
- text?: string | null;
14
- actionTap?: string | null;
15
- };
16
- export type TButtonContainer = Button & TDisabledButton & {
17
- component: "button";
18
- focused?: boolean;
19
- };
20
- export type TDisabledButton = {
21
- disabled?: boolean;
22
- disabledFillColor?: string;
23
- disabledLinkColor?: string;
24
- disabledBorderColor?: string;
25
- disabledBorderWidth?: number;
26
- disabledFontColor?: string;
27
- disabledFontSize?: number;
28
- disabledDropShadow?: string;
29
- };
30
- export type TPlayPauseButton = Button & {
31
- component: "playPauseButton";
32
- pausedOnTap: UserAction;
33
- playingOnTap: UserAction;
34
- pausedComponents: TComponent[];
35
- playingComponents: TComponent[];
36
- };
37
- export type TVolumeButton = Button & {
38
- component: "volumeButton";
39
- mutedComponents: TComponent[];
40
- volumeComponents: TComponent[];
41
- mutedOnTap: UserAction;
42
- volumeOnTap: UserAction;
43
- };
44
- export type UserAction = {
45
- function: string;
46
- parameters?: UserActionParameters;
47
- };
48
- export type UserActionParameters = {
49
- formId?: string;
50
- value?: string;
51
- partialState?: Record<string, any>;
52
- url?: string;
53
- screen?: string;
54
- promo?: string;
55
- confirmationMessage?: string;
56
- confirmBeforePurchase?: TTestObject[];
57
- };
58
- export type SKUActionHandler = (sku: NamiSKU) => void;
59
- export type DeepLinkUrlHandler = (url: string) => void;
60
- export type CloseHandler = (body?: any) => void;
61
- export type Callback = () => void;
62
- type CarouselIndicator = {
63
- width: number;
64
- height: number;
65
- borderRadius: number;
66
- fillColor: string;
67
- component: "container";
68
- };
69
- export type TCarouselContainer = Omit<TContainer, "component"> & {
70
- component: "carouselContainer";
71
- indicatorColor: string;
72
- activeIndicatorColor: string;
73
- autoplay: boolean;
74
- autoplaySeconds: number;
75
- loopSource?: string | TCarouselSlide[];
76
- loopVariable?: string;
77
- loopSourceConditions?: TTestObject[];
78
- showIndicators?: boolean;
79
- inactiveSlideScale?: number;
80
- nextSlidePadding?: number;
81
- previousSlidePadding?: number;
82
- slideSpacing?: number;
83
- onChange?: UserAction;
84
- indicator?: CarouselIndicator;
85
- activeIndicator?: CarouselIndicator;
86
- };
87
- export type TCarouselSlidesState = {
88
- [groupId: string]: {
89
- [carouselName: string]: TCarouselSlide[];
90
- };
91
- };
92
- export type TCarouselSlide = {
93
- id: string;
94
- title?: string;
95
- [slideAttr: string]: any;
96
- };
97
- export type TFlexProductContainer = Omit<TContainer, "component"> & {
98
- component: "flexProductContainer";
99
- products: "all" | "subset";
100
- flexDirection: FlexDirectionObject;
101
- subsetGroup?: string;
102
- productFeaturedComponents?: TContainer[];
103
- productBaseComponents?: TContainer[];
104
- };
105
- export type FlexDirectionObject = {
106
- small: "vertical" | "horizontal";
107
- medium: "vertical" | "horizontal";
108
- large: "vertical" | "horizontal";
109
- xlarge: "vertical" | "horizontal";
110
- };
111
- export type TProductContainer = Omit<TContainer, "component"> & {
112
- component: "productContainer";
113
- products: "all" | "subset";
114
- subsetGroup?: string;
115
- productFeaturedComponents?: TContainer[];
116
- productBaseComponents?: TContainer[];
117
- };
118
- export type TStack = Omit<TContainer, "component"> & {
119
- component: "stack";
120
- };
121
- export type TCollapseContainer = TBaseComponent & {
122
- component: "collapseContainer";
123
- collapseHeader: TContainer;
124
- components: TComponent[];
125
- open: "collapse" | "open";
126
- backgroundBlur?: number | null;
127
- };
128
- export type TResponsiveGrid = TBaseComponent & {
129
- component: "responsiveGrid";
130
- components: any;
131
- loopVariable?: string;
132
- loopSource?: string;
133
- loopSourceConditions: TTestObject[];
134
- };
135
- export type TRepeatingGrid = TBaseComponent & {
136
- component: "repeatingGrid";
137
- components: any;
138
- loopVariable?: string;
139
- loopSource?: string;
140
- loopSourceConditions: TTestObject[];
141
- columns: number;
142
- columnSpacing?: number;
143
- rowSpacing?: number;
144
- itemAlignment?: string;
145
- };
146
- export type TToggleSwitch = TBaseComponent & {
147
- component: 'toggleSwitch';
148
- checked?: boolean;
149
- formId: string;
150
- innerPadding?: TVariablePattern | number;
151
- activeHandleFillColor?: string;
152
- activeHandleBorderColor?: string;
153
- activeHandleBorderWidth?: number;
154
- activePlateFillColor?: string;
155
- activePlateBorderColor?: string;
156
- activePlateBorderWidth?: number;
157
- activePlateBorderRadius?: number;
158
- inactiveHandleFillColor?: string;
159
- inactiveHandleBorderColor?: string;
160
- inactiveHandleBorderWidth?: number;
161
- inactivePlateFillColor?: string;
162
- inactivePlateBorderColor?: string;
163
- inactivePlateBorderWidth?: number;
164
- inactivePlateBorderRadius?: number;
165
- disabled?: boolean;
166
- };
167
- export type TRadioButton = TBaseComponent & {
168
- component: 'radio';
169
- components: TComponent[];
170
- active?: boolean;
171
- innerPadding?: TVariablePattern | number;
172
- activeFillColor?: string;
173
- activeBorderColor?: string;
174
- activeBorderWidth?: number;
175
- activeDropShadow?: string;
176
- inactiveFillColor?: string;
177
- inactiveBorderColor?: string;
178
- inactiveBorderWidth?: number;
179
- inactiveDropShadow?: string;
180
- sku?: NamiSKU;
181
- };
182
- export {};
@@ -1,188 +0,0 @@
1
- import { AlignmentType, BorderLocationType, TBaseComponent, TComponent, TTestObject } from ".";
2
- export type TImageComponent = TBaseComponent & {
3
- component: "image";
4
- url?: string | null;
5
- aspectRatio?: number;
6
- imageCropping?: "fill" | "fit";
7
- alt?: string | null;
8
- blur?: string | null;
9
- };
10
- export type TSegmentPicker = TBaseComponent & {
11
- component: "segmentPicker" | "formSegmentPicker";
12
- formId?: string;
13
- components: TSegmentPickerItem[];
14
- };
15
- export type TSegmentPickerItem = TBaseComponent & {
16
- component: "segmentPickerItem";
17
- ref?: any;
18
- text?: string;
19
- alignment?: AlignmentType;
20
- activeFillColor?: string;
21
- activeBorderColor?: string;
22
- activeBorderRadius?: number;
23
- activeBorderWidth?: number;
24
- activeRoundBorders?: Array<BorderLocationType>;
25
- activeFontSize?: number;
26
- activeFontColor?: string;
27
- activeFontName?: string;
28
- activeDropShadow?: string;
29
- inactiveBorderRadius?: number;
30
- inactiveBorderColor?: string;
31
- inactiveBorderWidth?: number;
32
- inactiveRoundBorders?: Array<BorderLocationType>;
33
- inactiveFontSize?: number;
34
- inactiveFontName?: string;
35
- inactiveFontColor?: string;
36
- inactiveDropShadow?: string;
37
- leftPadding?: number;
38
- rightPadding?: number;
39
- topPadding?: number;
40
- bottomPadding?: number;
41
- formId?: string;
42
- checked?: boolean;
43
- };
44
- export type TSpacerComponent = TBaseComponent & {
45
- component: "spacer";
46
- };
47
- export type TSvgImageComponent = TBaseComponent & {
48
- component: "svgImage";
49
- url?: string | null;
50
- fontColor?: string;
51
- };
52
- export type TSymbolComponent = Omit<TTextComponent, "component" | "textType" | "text"> & {
53
- component: "symbol";
54
- name: string;
55
- };
56
- export type TTextComponent = TBaseComponent & {
57
- component: "text";
58
- textType: "title" | "body" | "legal" | "text";
59
- androidFontSize?: number;
60
- fontSize?: number;
61
- activeFontColor?: string;
62
- fontColor?: string;
63
- fontName?: string;
64
- text: string;
65
- strikethrough?: boolean | string;
66
- linkColor?: string;
67
- dateTimeFormat?: string;
68
- blur?: number | null;
69
- capitalize?: boolean;
70
- };
71
- export type TTextLikeComponent = TTextComponent | TTextListComponent | TSymbolComponent;
72
- export type TTextListComponent = Omit<TTextComponent, "component" | "text"> & {
73
- component: "text-list";
74
- texts: string[];
75
- bulletComponent?: TSymbolComponent;
76
- };
77
- export type TVideoComponent = TBaseComponent & {
78
- component: "videoUrl";
79
- url?: string | null;
80
- aspectRatio?: number;
81
- imageCropping?: "fill" | "fit";
82
- autoplayVideo?: boolean;
83
- controlsType?: string;
84
- fallbackImage?: string | null;
85
- loopVideo?: boolean;
86
- mute?: boolean;
87
- screenreaderText?: string;
88
- };
89
- export type TConditionalComponent = TBaseComponent & {
90
- component: "condition";
91
- components?: TComponent[];
92
- assertions?: TTestObject[];
93
- orAssertions?: TTestObject[] | undefined;
94
- };
95
- export type TQRCodeComponent = TBaseComponent & {
96
- component: "qrCode";
97
- url: string;
98
- height: number | string;
99
- width: number | string;
100
- color?: string;
101
- fillColor?: string;
102
- borderWidth?: number;
103
- borderColor?: string;
104
- };
105
- export type TProgressIndicatorComponent = TBaseComponent & {
106
- component: "progressIndicator";
107
- activeBorderRadius?: number;
108
- activeFillColor?: string;
109
- activeFillColorFallback?: string;
110
- inactiveBorderRadius?: number;
111
- inactiveFillColor?: string;
112
- inactiveFillColorFallback?: string;
113
- percentage?: "auto" | number;
114
- innerPadding?: number;
115
- activeDropShadow?: string;
116
- inactiveDropShadow?: string;
117
- };
118
- export type TProgressBarComponent = TBaseComponent & {
119
- component: "progressBar";
120
- mode: "determinate" | "indeterminate";
121
- activeBorderRadius?: number;
122
- activeFillColor?: string;
123
- activeFillColorFallback?: string;
124
- inactiveBorderRadius?: number;
125
- inactiveFillColor?: string;
126
- inactiveFillColorFallback?: string;
127
- percentage?: "auto" | number;
128
- innerPadding?: number;
129
- activeDropShadow?: string;
130
- inactiveDropShadow?: string;
131
- duration?: "auto" | number;
132
- delay?: number;
133
- activeWidth?: number | string;
134
- screenreaderText?: string;
135
- };
136
- export type TToggleButtonComponent = TBaseComponent & {
137
- component: "toggleButton";
138
- components: TComponent[];
139
- checked?: boolean;
140
- activeFillColor?: string;
141
- activeFillColorFallback?: string;
142
- inactiveFillColor?: string;
143
- inactiveFillColorFallback?: string;
144
- activeBorderColor?: string;
145
- inactiveBorderColor?: string;
146
- activeBorderWidth?: number;
147
- inactiveBorderWidth?: number;
148
- activeDropShadow?: string;
149
- inactiveDropShadow?: string;
150
- formId?: string;
151
- screenreaderText?: string;
152
- screenreaderHint?: string;
153
- mode?: "radio" | "toggle";
154
- value?: string;
155
- };
156
- export type TCountdownTimerTextComponent = TBaseComponent & {
157
- component: "countdownTimerText";
158
- mode?: "duration" | "targetDateTime";
159
- durationSeconds?: number;
160
- resetOnRemount?: boolean;
161
- targetDateTime?: string;
162
- separator?: string;
163
- zeroPad?: boolean;
164
- direction?: "horizontal" | "vertical";
165
- labelPosition?: "none" | "top" | "bottom" | "below" | "above";
166
- units?: {
167
- days?: boolean;
168
- hours?: boolean;
169
- minutes?: boolean;
170
- seconds?: boolean;
171
- };
172
- labels?: {
173
- days?: string;
174
- hours?: string;
175
- minutes?: string;
176
- seconds?: string;
177
- };
178
- fontSize?: number;
179
- fontColor?: string;
180
- fontName?: string;
181
- labelFontSize?: number;
182
- labelFontColor?: string;
183
- labelFontName?: string;
184
- labelSpacing?: number;
185
- showWhenCompleted?: "zero" | "hidden";
186
- screenreaderText?: string;
187
- screenreaderHint?: string;
188
- };
@@ -1,137 +0,0 @@
1
- import { NamiAnimationSpec } from "./animation";
2
- import { TButtonContainer, TCarouselContainer, TCarouselSlide, TCollapseContainer, TFlexProductContainer, TPlayPauseButton, TProductContainer, TRadioButton, TRepeatingGrid, TResponsiveGrid, TStack, TToggleSwitch, TVolumeButton, UserAction } from "./containers";
3
- import { TConditionalComponent, TCountdownTimerTextComponent, TImageComponent, TProgressIndicatorComponent, TProgressBarComponent, TQRCodeComponent, TSegmentPicker, TSegmentPickerItem, TSpacerComponent, TSvgImageComponent, TSymbolComponent, TTextComponent, TTextListComponent, TToggleButtonComponent, TVideoComponent } from "./elements";
4
- export interface TBaseComponent {
5
- id?: string;
6
- title?: string;
7
- testId?: string;
8
- component: string;
9
- namiComponentType?: string;
10
- grow?: boolean;
11
- flag?: null | string;
12
- context?: {
13
- [key: string]: any;
14
- };
15
- moveX?: number | string;
16
- moveY?: string | number;
17
- direction?: DirectionType;
18
- spacing?: number;
19
- alignment?: AlignmentType;
20
- horizontalAlignment?: AlignmentType;
21
- verticalAlignment?: AlignmentType;
22
- leftPadding?: number | string;
23
- rightPadding?: number | string;
24
- topPadding?: number | string;
25
- bottomPadding?: number | string;
26
- leftMargin?: number | string;
27
- rightMargin?: number | string;
28
- topMargin?: number | string;
29
- bottomMargin?: number | string;
30
- fillColor?: string;
31
- borderWidth?: number;
32
- borderRadius?: number;
33
- borderColor?: string;
34
- borders?: Array<BorderSideType>;
35
- focusedBorders?: Array<BorderSideType>;
36
- focusedFillColor?: string;
37
- focusedFontColor?: string;
38
- focusedBorderColor?: string;
39
- focusedBorderWidth?: number;
40
- focusedBorderRadius?: number;
41
- roundBorders?: Array<BorderLocationType>;
42
- focusedRoundBorders?: Array<BorderLocationType>;
43
- fillColorFallback?: string;
44
- focusedFillColorFallback?: string;
45
- zIndex?: number;
46
- conditionAttributes?: TConditionalAttributes;
47
- height?: number | string;
48
- width?: number | string;
49
- dropShadow?: string;
50
- onTap?: UserAction;
51
- actionTap?: string;
52
- refId?: string;
53
- _fields?: {
54
- [attribute: string]: TFieldSettings;
55
- } & {
56
- _group: string;
57
- _label: string;
58
- _toggleAttr: string | null;
59
- _toggleValue: any;
60
- _collapsible: boolean;
61
- _hint: string | null;
62
- };
63
- _fieldGroupLabel?: string;
64
- _fieldLabel?: string;
65
- _fieldHint?: string;
66
- _fieldReadOnly?: boolean;
67
- _fieldPlaceholder?: string;
68
- _fieldDescription?: string;
69
- _fieldOmit?: string[];
70
- fixedHeight?: number;
71
- fixedWidth?: number | "fitContent";
72
- hidden?: boolean;
73
- animation?: NamiAnimationSpec;
74
- }
75
- export type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer | TResponsiveGrid | TRepeatingGrid | TVolumeButton | TPlayPauseButton | TQRCodeComponent | TToggleSwitch | TRadioButton | TProgressIndicatorComponent | TToggleButtonComponent | TCountdownTimerTextComponent | TProgressBarComponent;
76
- export type DirectionType = "vertical" | "horizontal";
77
- export type AlignmentType = "center" | "right" | "left" | "top" | "bottom";
78
- export type BorderLocationType = "upperLeft" | "upperRight" | "lowerLeft" | "lowerRight";
79
- export type BorderSideType = 'left' | 'right' | 'top' | 'bottom';
80
- export type TContainerPosition = `${'center' | 'start' | 'end'}-${'top' | 'bottom' | 'left' | 'right'}`;
81
- export declare const BorderMap: Record<BorderLocationType, string>;
82
- export declare const BorderSideMap: Record<BorderSideType, string>;
83
- export type TTestObject = {
84
- value: any;
85
- expected: any;
86
- operator: "equals" | "contains" | "notEquals" | "set" | "notSet" | "notContains" | 'gt' | 'lt' | 'gte' | 'lte';
87
- };
88
- type TransformToString<T> = {
89
- [P in keyof T]: T[P] extends number | boolean ? T[P] | string : T[P];
90
- };
91
- export type TConditionalAttributes = Array<Omit<TConditionalComponent, "components"> & {
92
- attributes: Partial<TransformToString<TBaseComponent>> & {
93
- name?: string;
94
- text?: string;
95
- texts?: string[];
96
- url?: string;
97
- fontSize?: number;
98
- screenreaderText?: string;
99
- fontColor?: string;
100
- linkColor?: string;
101
- };
102
- }>;
103
- export type TField = "image" | "listContainerComponent" | "text" | "url" | "textArea" | "fontSelect" | "splitTextArea" | "color" | "colorGradient" | "number" | "alignment" | "carouselSlides" | "option" | "iconSelect" | "toggle";
104
- export type TContainer = TBaseComponent & {
105
- component: "container" | "formContainer";
106
- position?: TContainerPosition;
107
- fillColor?: string;
108
- fillImage?: string | null;
109
- components?: TComponent[];
110
- loopVariable?: string;
111
- loopSource?: string | any[];
112
- backgroundBlur?: number | null;
113
- };
114
- export type TFieldSettings = {
115
- type: TField;
116
- label: string;
117
- hint: string | null;
118
- description: string | null;
119
- placeholder: string | null;
120
- variable: string;
121
- readOnly: boolean;
122
- markdownHint: boolean;
123
- options: {
124
- label: string;
125
- value: any;
126
- }[] | null;
127
- maxLimit: number | null;
128
- minLimit: number | null;
129
- aspectRatio: number | null;
130
- newSlide?: TCarouselSlide;
131
- carousel?: string;
132
- darkModeVariable?: string;
133
- conditions?: TTestObject[];
134
- showOpacity?: boolean;
135
- newRow?: any;
136
- };
137
- export {};
@@ -1,26 +0,0 @@
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
- readonly SET: "set";
15
- readonly NOT_SET: "notSet";
16
- };
17
- export type FilterOperator = (typeof FilterOperator)[keyof typeof FilterOperator];
18
- export interface NamiConditionFilter {
19
- identifier: string;
20
- operator: FilterOperator;
21
- values: string[];
22
- }
23
- export interface NamiConditions {
24
- filter?: NamiConditionFilter[];
25
- operator?: LogicalOperator;
26
- }
@@ -1,38 +0,0 @@
1
- import { NamiAnonymousCampaign } from "../types/externals/campaign";
2
- import { IPaywall } from "./paywall";
3
- import { PaywallSKU } from "./sku";
4
- export interface IConfig {
5
- id: string;
6
- capabilities: string[];
7
- marketplace_app_id?: string | null;
8
- campaign_cache_ttl?: number | null;
9
- }
10
- export type InitialConfig = {
11
- appConfig?: IConfig;
12
- platform_config?: IConfig;
13
- products?: PaywallSKU[];
14
- paywalls?: IPaywall[];
15
- campaign_rules?: NamiAnonymousCampaign[];
16
- };
17
- export type InitialConfigCompressed = {
18
- initial_config: string;
19
- };
20
- export declare const isInitialConfigCompressed: (config: InitialConfig | InitialConfigCompressed) => config is InitialConfigCompressed;
21
- export type NamiConfigurationState = {
22
- sdkInitialized: boolean;
23
- configureState: string;
24
- };
25
- export type ExtendedPlatformInfo = {
26
- platform: string;
27
- version: string;
28
- };
29
- export declare enum Capabilities {
30
- SDK = "sdk",
31
- ML = "ml",
32
- THIRD_PARTY_ANALYTICS = "third_party_analytics",
33
- THIRD_PARTY_TRANSACTIONS = "third_party_transactions",
34
- PAYWALL_PERSONALIZATION = "paywall_personalization",
35
- ANONYMOUS_MODE_CAPABILITY = "anonymous_allowed",
36
- LANGUAGE_MANAGEMENT = "language_management",
37
- ENTITLEMENT_MANAGEMENT = "entitlement_management"
38
- }
@@ -1,2 +0,0 @@
1
- import { CustomerJourneyState } from "./externals";
2
- export type NamiCustomerJourneyStateHandler = (customerJourneyState: CustomerJourneyState) => void;