@appstorys/react-web 1.0.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/dist/index.d.mts +711 -0
- package/dist/index.d.ts +711 -0
- package/dist/index.js +100 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +100 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +42 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type CampaignType = 'BAN' | 'FLT' | 'PIP' | 'SUR' | 'CSAT' | 'WID' | 'MOD' | 'BTS' | 'SCRT' | 'STR' | 'TLTP' | 'TTP';
|
|
4
|
+
interface CrossButtonConfig {
|
|
5
|
+
color: {
|
|
6
|
+
cross: string;
|
|
7
|
+
fill: string;
|
|
8
|
+
stroke: string;
|
|
9
|
+
};
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
image: string;
|
|
12
|
+
margin: {
|
|
13
|
+
bottom: number;
|
|
14
|
+
left: number;
|
|
15
|
+
right: number;
|
|
16
|
+
top: number;
|
|
17
|
+
};
|
|
18
|
+
selectedStyle?: string;
|
|
19
|
+
size: number;
|
|
20
|
+
}
|
|
21
|
+
interface StorySlideCtaBorderRadius {
|
|
22
|
+
topLeft?: number;
|
|
23
|
+
topRight?: number;
|
|
24
|
+
bottomLeft?: number;
|
|
25
|
+
bottomRight?: number;
|
|
26
|
+
}
|
|
27
|
+
interface TriggerEventConfig {
|
|
28
|
+
key?: string;
|
|
29
|
+
operator?: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
30
|
+
value?: string;
|
|
31
|
+
back_press?: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface TriggerEventObject {
|
|
34
|
+
event: string;
|
|
35
|
+
event_config: TriggerEventConfig[];
|
|
36
|
+
}
|
|
37
|
+
type TriggerEvent = string | TriggerEventObject;
|
|
38
|
+
interface BaseCampaign {
|
|
39
|
+
id: string;
|
|
40
|
+
campaign_type: CampaignType;
|
|
41
|
+
trigger_event?: TriggerEvent;
|
|
42
|
+
position?: string;
|
|
43
|
+
screen?: string;
|
|
44
|
+
details: any;
|
|
45
|
+
}
|
|
46
|
+
interface CampaignBanner extends BaseCampaign {
|
|
47
|
+
campaign_type: 'BAN';
|
|
48
|
+
details: {
|
|
49
|
+
id: string;
|
|
50
|
+
image: string | null;
|
|
51
|
+
lottie_data: string | null;
|
|
52
|
+
width: null | number;
|
|
53
|
+
height: null | number;
|
|
54
|
+
link: null | string;
|
|
55
|
+
styling: {
|
|
56
|
+
bottomLeftRadius?: string;
|
|
57
|
+
bottomRightRadius?: string;
|
|
58
|
+
topLeftRadius?: string;
|
|
59
|
+
topRightRadius?: string;
|
|
60
|
+
marginBottom?: string;
|
|
61
|
+
marginLeft?: string;
|
|
62
|
+
marginRight?: string;
|
|
63
|
+
crossButton?: CrossButtonConfig;
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
interface Attributes {
|
|
69
|
+
[key: string]: any;
|
|
70
|
+
}
|
|
71
|
+
declare enum SdkState {
|
|
72
|
+
uninitialized = "uninitialized",
|
|
73
|
+
initializing = "initializing",
|
|
74
|
+
initialized = "initialized",
|
|
75
|
+
error = "error"
|
|
76
|
+
}
|
|
77
|
+
interface AppStorysStore {
|
|
78
|
+
userId: string;
|
|
79
|
+
appId: string;
|
|
80
|
+
accountId: string;
|
|
81
|
+
currentScreen: string;
|
|
82
|
+
campaigns: Campaign[];
|
|
83
|
+
allCampaigns: Campaign[];
|
|
84
|
+
campaignVersion: number;
|
|
85
|
+
trackedEvents: string[];
|
|
86
|
+
trackedEventMetadata: Record<string, Attributes[]>;
|
|
87
|
+
attributes?: Attributes;
|
|
88
|
+
isVisible: boolean;
|
|
89
|
+
isAnonymousUser: boolean;
|
|
90
|
+
variantMappings: Record<string, string>;
|
|
91
|
+
personalizationData: Record<string, string>;
|
|
92
|
+
screenCaptureEnabled?: boolean;
|
|
93
|
+
baseUrl?: string;
|
|
94
|
+
trackingUrl?: string;
|
|
95
|
+
}
|
|
96
|
+
interface StorySlideCtaContainer {
|
|
97
|
+
alignment?: string;
|
|
98
|
+
backgroundColor?: string;
|
|
99
|
+
borderColor?: string;
|
|
100
|
+
borderWidth?: number;
|
|
101
|
+
ctaFullWidth?: boolean;
|
|
102
|
+
ctaWidth?: number;
|
|
103
|
+
height?: number;
|
|
104
|
+
}
|
|
105
|
+
interface StorySlideCtaText {
|
|
106
|
+
color?: string;
|
|
107
|
+
fontDecoration?: string[];
|
|
108
|
+
fontFamily?: string;
|
|
109
|
+
fontSize?: number;
|
|
110
|
+
}
|
|
111
|
+
interface StorySlideCta {
|
|
112
|
+
container?: StorySlideCtaContainer;
|
|
113
|
+
cornerRadius?: StorySlideCtaBorderRadius;
|
|
114
|
+
margin?: {
|
|
115
|
+
bottom?: number;
|
|
116
|
+
left?: number;
|
|
117
|
+
right?: number;
|
|
118
|
+
top?: number;
|
|
119
|
+
};
|
|
120
|
+
text?: StorySlideCtaText;
|
|
121
|
+
}
|
|
122
|
+
interface StorySlideStyling {
|
|
123
|
+
cta?: StorySlideCta;
|
|
124
|
+
meta?: {
|
|
125
|
+
editorSource?: string;
|
|
126
|
+
};
|
|
127
|
+
pc_redirect_type?: string;
|
|
128
|
+
rdrType?: string;
|
|
129
|
+
}
|
|
130
|
+
interface StorySlide {
|
|
131
|
+
button_text?: string;
|
|
132
|
+
content?: any;
|
|
133
|
+
id: string;
|
|
134
|
+
image: string | null;
|
|
135
|
+
interactions?: any[];
|
|
136
|
+
link: string | null;
|
|
137
|
+
order: number;
|
|
138
|
+
parent: string;
|
|
139
|
+
personalizationData?: any;
|
|
140
|
+
styling?: StorySlideStyling;
|
|
141
|
+
video: string | null;
|
|
142
|
+
}
|
|
143
|
+
interface StoryGroupStyling {
|
|
144
|
+
cornerRadius?: {
|
|
145
|
+
bottomLeft?: number;
|
|
146
|
+
bottomRight?: number;
|
|
147
|
+
topLeft?: number;
|
|
148
|
+
topRight?: number;
|
|
149
|
+
};
|
|
150
|
+
crossButton?: CrossButtonConfig;
|
|
151
|
+
name?: {
|
|
152
|
+
font?: string;
|
|
153
|
+
fontFamily?: string;
|
|
154
|
+
size?: number;
|
|
155
|
+
};
|
|
156
|
+
ringWidth?: number;
|
|
157
|
+
share?: {
|
|
158
|
+
color?: {
|
|
159
|
+
cross?: string;
|
|
160
|
+
fill?: string;
|
|
161
|
+
stroke?: string;
|
|
162
|
+
};
|
|
163
|
+
enabled?: boolean;
|
|
164
|
+
image?: string;
|
|
165
|
+
margin?: {
|
|
166
|
+
right?: number;
|
|
167
|
+
top?: number;
|
|
168
|
+
};
|
|
169
|
+
selectedStyle?: string;
|
|
170
|
+
size?: number;
|
|
171
|
+
};
|
|
172
|
+
size?: number;
|
|
173
|
+
slideShowTime?: number;
|
|
174
|
+
soundToggle?: {
|
|
175
|
+
defaultSound?: string;
|
|
176
|
+
enabled?: boolean;
|
|
177
|
+
mute?: any;
|
|
178
|
+
unmute?: any;
|
|
179
|
+
};
|
|
180
|
+
storyGroupText?: string;
|
|
181
|
+
}
|
|
182
|
+
interface Story$1 {
|
|
183
|
+
cohorts: any;
|
|
184
|
+
id: string;
|
|
185
|
+
name: string;
|
|
186
|
+
nameColor: string;
|
|
187
|
+
order: number;
|
|
188
|
+
ringColor: string;
|
|
189
|
+
slides: StorySlide[];
|
|
190
|
+
styling?: StoryGroupStyling;
|
|
191
|
+
thumbnail: string;
|
|
192
|
+
}
|
|
193
|
+
interface CampaignStory extends BaseCampaign {
|
|
194
|
+
campaign_type: 'STR';
|
|
195
|
+
details: Story$1[];
|
|
196
|
+
}
|
|
197
|
+
interface WidgetImage {
|
|
198
|
+
cohorts: any;
|
|
199
|
+
id: string;
|
|
200
|
+
image: string;
|
|
201
|
+
link: string;
|
|
202
|
+
order: number;
|
|
203
|
+
}
|
|
204
|
+
interface CampaignWidget extends BaseCampaign {
|
|
205
|
+
campaign_type: 'WID';
|
|
206
|
+
details: {
|
|
207
|
+
height: number;
|
|
208
|
+
id: string;
|
|
209
|
+
styling: {
|
|
210
|
+
borderRadius: number;
|
|
211
|
+
bottomLeftRadius: number;
|
|
212
|
+
bottomMargin: number;
|
|
213
|
+
bottomRightRadius: number;
|
|
214
|
+
leftMargin: number;
|
|
215
|
+
rightMargin: number;
|
|
216
|
+
topLeftRadius: number;
|
|
217
|
+
topMargin: number;
|
|
218
|
+
topRightRadius: number;
|
|
219
|
+
type: string;
|
|
220
|
+
};
|
|
221
|
+
widget_images: WidgetImage[];
|
|
222
|
+
width: number;
|
|
223
|
+
type?: string;
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
interface TooltipStyling {
|
|
227
|
+
appearance?: {
|
|
228
|
+
arrowStyle?: {
|
|
229
|
+
height?: number;
|
|
230
|
+
width?: number;
|
|
231
|
+
};
|
|
232
|
+
backdropOpacity?: number;
|
|
233
|
+
colors?: {
|
|
234
|
+
arrow?: string;
|
|
235
|
+
backdrop?: string;
|
|
236
|
+
tooltip?: string;
|
|
237
|
+
};
|
|
238
|
+
cornerRadius?: {
|
|
239
|
+
bottomLeft?: number;
|
|
240
|
+
bottomRight?: number;
|
|
241
|
+
topLeft?: number;
|
|
242
|
+
topRight?: number;
|
|
243
|
+
};
|
|
244
|
+
highlight?: {
|
|
245
|
+
padding?: number;
|
|
246
|
+
radius?: number;
|
|
247
|
+
};
|
|
248
|
+
padding?: {
|
|
249
|
+
bottom?: number;
|
|
250
|
+
left?: number;
|
|
251
|
+
right?: number;
|
|
252
|
+
top?: number;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
cta?: {
|
|
256
|
+
container?: {
|
|
257
|
+
alignment?: string;
|
|
258
|
+
backgroundColor?: string;
|
|
259
|
+
borderColor?: string;
|
|
260
|
+
borderWidth?: number;
|
|
261
|
+
ctaFullWidth?: boolean;
|
|
262
|
+
ctaWidth?: number;
|
|
263
|
+
height?: number;
|
|
264
|
+
};
|
|
265
|
+
cornerRadius?: {
|
|
266
|
+
bottomLeft?: number;
|
|
267
|
+
bottomRight?: number;
|
|
268
|
+
topLeft?: number;
|
|
269
|
+
topRight?: number;
|
|
270
|
+
};
|
|
271
|
+
margin?: {
|
|
272
|
+
bottom?: number;
|
|
273
|
+
left?: number;
|
|
274
|
+
right?: number;
|
|
275
|
+
top?: number;
|
|
276
|
+
};
|
|
277
|
+
text?: {
|
|
278
|
+
color?: string;
|
|
279
|
+
fontDecoration?: string[];
|
|
280
|
+
fontFamily?: string;
|
|
281
|
+
fontSize?: number;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
subTitle?: {
|
|
285
|
+
color?: string;
|
|
286
|
+
fontDecoration?: string[];
|
|
287
|
+
fontFamily?: string;
|
|
288
|
+
fontSize?: number;
|
|
289
|
+
margin?: {
|
|
290
|
+
bottom?: number;
|
|
291
|
+
left?: number;
|
|
292
|
+
right?: number;
|
|
293
|
+
top?: number;
|
|
294
|
+
};
|
|
295
|
+
textAlign?: string;
|
|
296
|
+
};
|
|
297
|
+
title?: {
|
|
298
|
+
color?: string;
|
|
299
|
+
fontDecoration?: string[];
|
|
300
|
+
fontFamily?: string;
|
|
301
|
+
fontSize?: number;
|
|
302
|
+
margin?: {
|
|
303
|
+
bottom?: number;
|
|
304
|
+
left?: number;
|
|
305
|
+
right?: number;
|
|
306
|
+
top?: number;
|
|
307
|
+
};
|
|
308
|
+
textAlign?: string;
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
interface TooltipItem {
|
|
312
|
+
_id: string;
|
|
313
|
+
arrowPosition?: "left" | "right" | "top" | "bottom" | string;
|
|
314
|
+
clickAction?: "nextStep" | "close" | string;
|
|
315
|
+
ctaText?: string;
|
|
316
|
+
enableBackdrop?: boolean;
|
|
317
|
+
eventName?: string;
|
|
318
|
+
link?: string;
|
|
319
|
+
order?: number;
|
|
320
|
+
position?: string;
|
|
321
|
+
styling?: TooltipStyling;
|
|
322
|
+
subtitleText?: string;
|
|
323
|
+
target?: string;
|
|
324
|
+
titleText?: string;
|
|
325
|
+
url?: string | null;
|
|
326
|
+
}
|
|
327
|
+
interface CampaignTooltip extends BaseCampaign {
|
|
328
|
+
campaign_type: 'TTP';
|
|
329
|
+
details: {
|
|
330
|
+
tooltips?: TooltipItem[];
|
|
331
|
+
titleText?: string;
|
|
332
|
+
subtitleText?: string;
|
|
333
|
+
target?: string;
|
|
334
|
+
styling?: TooltipStyling;
|
|
335
|
+
} & Partial<TooltipItem>;
|
|
336
|
+
display_trigger?: boolean;
|
|
337
|
+
}
|
|
338
|
+
interface BottomSheetElement {
|
|
339
|
+
id: string;
|
|
340
|
+
type: 'image' | 'cta' | 'body' | string;
|
|
341
|
+
order: number;
|
|
342
|
+
[key: string]: any;
|
|
343
|
+
}
|
|
344
|
+
interface CampaignBottomSheet extends BaseCampaign {
|
|
345
|
+
campaign_type: 'BTS';
|
|
346
|
+
details: {
|
|
347
|
+
backdropColor?: string;
|
|
348
|
+
backdropOpacity?: number;
|
|
349
|
+
backgroundColor?: string;
|
|
350
|
+
bottomsheetType?: string;
|
|
351
|
+
cornerRadius?: {
|
|
352
|
+
bottomLeft?: number;
|
|
353
|
+
bottomRight?: number;
|
|
354
|
+
topLeft?: number;
|
|
355
|
+
topRight?: number;
|
|
356
|
+
};
|
|
357
|
+
crossButton?: CrossButtonConfig;
|
|
358
|
+
elements: BottomSheetElement[];
|
|
359
|
+
id: string;
|
|
360
|
+
name: string;
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
interface SurveyTextStyle {
|
|
364
|
+
color?: string;
|
|
365
|
+
fontDecoration?: string[];
|
|
366
|
+
fontFamily?: string;
|
|
367
|
+
fontSize?: number;
|
|
368
|
+
textAlign?: string;
|
|
369
|
+
margin?: {
|
|
370
|
+
bottom?: number;
|
|
371
|
+
left?: number;
|
|
372
|
+
right?: number;
|
|
373
|
+
top?: number;
|
|
374
|
+
};
|
|
375
|
+
borderwidth?: number;
|
|
376
|
+
}
|
|
377
|
+
interface SurveyOptionColors {
|
|
378
|
+
background?: string;
|
|
379
|
+
border?: string;
|
|
380
|
+
text?: string;
|
|
381
|
+
}
|
|
382
|
+
interface SurveyOptionStyle {
|
|
383
|
+
colors?: SurveyOptionColors;
|
|
384
|
+
textStyle?: SurveyTextStyle;
|
|
385
|
+
}
|
|
386
|
+
interface SurveySlideLogicRule {
|
|
387
|
+
redirectTo?: string;
|
|
388
|
+
selectOption?: string[];
|
|
389
|
+
}
|
|
390
|
+
interface SurveySlide {
|
|
391
|
+
additionalComment?: {
|
|
392
|
+
enabled?: boolean;
|
|
393
|
+
placeholder?: string;
|
|
394
|
+
};
|
|
395
|
+
id: string;
|
|
396
|
+
logic?: SurveySlideLogicRule[];
|
|
397
|
+
options?: Record<string, string>;
|
|
398
|
+
order: number;
|
|
399
|
+
parent: string;
|
|
400
|
+
question?: string;
|
|
401
|
+
submitButtonText?: string;
|
|
402
|
+
subtitle?: string;
|
|
403
|
+
title?: string;
|
|
404
|
+
}
|
|
405
|
+
interface SurveyThankYouButtonConfig {
|
|
406
|
+
action?: string;
|
|
407
|
+
enabled?: boolean;
|
|
408
|
+
redirectUrl?: string;
|
|
409
|
+
}
|
|
410
|
+
interface SurveyCampaignDetails {
|
|
411
|
+
id: string;
|
|
412
|
+
name?: string;
|
|
413
|
+
slides?: SurveySlide[];
|
|
414
|
+
styling?: {
|
|
415
|
+
appearance?: {
|
|
416
|
+
backdropColor?: string;
|
|
417
|
+
backdropOpacity?: number;
|
|
418
|
+
backgroundColor?: string;
|
|
419
|
+
cornerRadius?: {
|
|
420
|
+
topLeft?: number;
|
|
421
|
+
topRight?: number;
|
|
422
|
+
bottomLeft?: number;
|
|
423
|
+
bottomRight?: number;
|
|
424
|
+
};
|
|
425
|
+
displayDelay?: number;
|
|
426
|
+
};
|
|
427
|
+
content?: {
|
|
428
|
+
isIntroductionPage?: boolean;
|
|
429
|
+
isThankyouPage?: boolean;
|
|
430
|
+
};
|
|
431
|
+
crossButton?: CrossButtonConfig;
|
|
432
|
+
cta?: StorySlideCta;
|
|
433
|
+
options?: {
|
|
434
|
+
additionalComments?: SurveyOptionStyle;
|
|
435
|
+
bulletSpacing?: number;
|
|
436
|
+
cornerRadius?: StorySlideCtaBorderRadius;
|
|
437
|
+
nonSelectedOptions?: SurveyOptionStyle;
|
|
438
|
+
optionListStyle?: string;
|
|
439
|
+
optionsHeight?: number;
|
|
440
|
+
optionsSpacing?: number;
|
|
441
|
+
selectedOptions?: SurveyOptionStyle;
|
|
442
|
+
};
|
|
443
|
+
subtitle?: {
|
|
444
|
+
textStyle?: SurveyTextStyle;
|
|
445
|
+
};
|
|
446
|
+
thankyouPage?: {
|
|
447
|
+
cta?: StorySlideCta;
|
|
448
|
+
imageStyle?: {
|
|
449
|
+
height?: number;
|
|
450
|
+
width?: number;
|
|
451
|
+
};
|
|
452
|
+
subtitle?: {
|
|
453
|
+
textStyle?: SurveyTextStyle;
|
|
454
|
+
};
|
|
455
|
+
title?: {
|
|
456
|
+
textStyle?: SurveyTextStyle;
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
title?: {
|
|
460
|
+
textStyle?: SurveyTextStyle;
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
thankYouButtonConfig?: SurveyThankYouButtonConfig;
|
|
464
|
+
thankYouButtonText?: string;
|
|
465
|
+
thankYouImage?: string;
|
|
466
|
+
thankYouText?: string;
|
|
467
|
+
thankYouTitle?: string;
|
|
468
|
+
}
|
|
469
|
+
interface CampaignSurvey extends BaseCampaign {
|
|
470
|
+
campaign_type: 'SUR';
|
|
471
|
+
details: SurveyCampaignDetails;
|
|
472
|
+
}
|
|
473
|
+
interface CsatTextStyle {
|
|
474
|
+
color?: string;
|
|
475
|
+
fontDecoration?: string[];
|
|
476
|
+
fontFamily?: string;
|
|
477
|
+
fontSize?: number;
|
|
478
|
+
textAlign?: string;
|
|
479
|
+
}
|
|
480
|
+
interface CsatSpacing {
|
|
481
|
+
top?: number;
|
|
482
|
+
right?: number;
|
|
483
|
+
bottom?: number;
|
|
484
|
+
left?: number;
|
|
485
|
+
}
|
|
486
|
+
interface CsatCampaignDetails {
|
|
487
|
+
campaign?: string;
|
|
488
|
+
description_text?: string;
|
|
489
|
+
feedback_option?: Record<string, string>;
|
|
490
|
+
height?: number;
|
|
491
|
+
highStarText?: string;
|
|
492
|
+
id: string;
|
|
493
|
+
link?: string;
|
|
494
|
+
lowStarText?: string;
|
|
495
|
+
styling?: {
|
|
496
|
+
appearance?: {
|
|
497
|
+
backgroundColor?: string;
|
|
498
|
+
borderRadius?: number;
|
|
499
|
+
displayDelay?: number;
|
|
500
|
+
margin?: CsatSpacing;
|
|
501
|
+
padding?: CsatSpacing;
|
|
502
|
+
};
|
|
503
|
+
crossButton?: CrossButtonConfig;
|
|
504
|
+
feedbackPage?: {
|
|
505
|
+
additionalComments?: {
|
|
506
|
+
borderWidth?: number;
|
|
507
|
+
colors?: {
|
|
508
|
+
background?: string;
|
|
509
|
+
border?: string;
|
|
510
|
+
text?: string;
|
|
511
|
+
};
|
|
512
|
+
enabled?: boolean;
|
|
513
|
+
placeholder?: string;
|
|
514
|
+
textStyle?: CsatTextStyle;
|
|
515
|
+
};
|
|
516
|
+
options?: {
|
|
517
|
+
cornerRadius?: {
|
|
518
|
+
topLeft?: number;
|
|
519
|
+
topRight?: number;
|
|
520
|
+
bottomLeft?: number;
|
|
521
|
+
bottomRight?: number;
|
|
522
|
+
};
|
|
523
|
+
margin?: CsatSpacing;
|
|
524
|
+
nonSelectedOptions?: {
|
|
525
|
+
borderWidth?: number;
|
|
526
|
+
colors?: {
|
|
527
|
+
background?: string;
|
|
528
|
+
border?: string;
|
|
529
|
+
text?: string;
|
|
530
|
+
};
|
|
531
|
+
textStyle?: CsatTextStyle;
|
|
532
|
+
};
|
|
533
|
+
optionsHeight?: number;
|
|
534
|
+
optionsSpacing?: number;
|
|
535
|
+
selectedOptions?: {
|
|
536
|
+
borderWidth?: number;
|
|
537
|
+
colors?: {
|
|
538
|
+
background?: string;
|
|
539
|
+
border?: string;
|
|
540
|
+
text?: string;
|
|
541
|
+
};
|
|
542
|
+
textStyle?: CsatTextStyle;
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
submitButton?: {
|
|
546
|
+
cta?: StorySlideCta;
|
|
547
|
+
enabled?: boolean;
|
|
548
|
+
text?: string;
|
|
549
|
+
};
|
|
550
|
+
};
|
|
551
|
+
initialFeedback?: {
|
|
552
|
+
subtitle?: {
|
|
553
|
+
margin?: CsatSpacing;
|
|
554
|
+
textStyle?: CsatTextStyle;
|
|
555
|
+
};
|
|
556
|
+
title?: {
|
|
557
|
+
margin?: CsatSpacing;
|
|
558
|
+
textStyle?: CsatTextStyle;
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
rating?: {
|
|
562
|
+
emoji?: string[] | Record<string, string> | string | null;
|
|
563
|
+
highRatingSubtitle?: string;
|
|
564
|
+
highRatingTitle?: string;
|
|
565
|
+
lowRatingSubtitle?: string;
|
|
566
|
+
lowRatingTitle?: string;
|
|
567
|
+
number?: number | {
|
|
568
|
+
min?: number;
|
|
569
|
+
max?: number;
|
|
570
|
+
} | null;
|
|
571
|
+
ratingType?: string;
|
|
572
|
+
star?: {
|
|
573
|
+
high?: {
|
|
574
|
+
stylingContainer?: {
|
|
575
|
+
background?: string;
|
|
576
|
+
border?: string;
|
|
577
|
+
borderWidth?: number;
|
|
578
|
+
};
|
|
579
|
+
stylingStar?: {
|
|
580
|
+
background?: string;
|
|
581
|
+
border?: string;
|
|
582
|
+
borderWidth?: number;
|
|
583
|
+
};
|
|
584
|
+
};
|
|
585
|
+
low?: {
|
|
586
|
+
stylingContainer?: {
|
|
587
|
+
background?: string;
|
|
588
|
+
border?: string;
|
|
589
|
+
borderWidth?: number;
|
|
590
|
+
};
|
|
591
|
+
stylingStar?: {
|
|
592
|
+
background?: string;
|
|
593
|
+
border?: string;
|
|
594
|
+
borderWidth?: number;
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
unselected?: {
|
|
598
|
+
stylingContainer?: {
|
|
599
|
+
background?: string;
|
|
600
|
+
border?: string;
|
|
601
|
+
borderWidth?: number;
|
|
602
|
+
};
|
|
603
|
+
stylingStar?: {
|
|
604
|
+
background?: string;
|
|
605
|
+
border?: string;
|
|
606
|
+
borderWidth?: number;
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
thankyouPage?: {
|
|
612
|
+
doneButton?: {
|
|
613
|
+
cta?: StorySlideCta;
|
|
614
|
+
text?: string;
|
|
615
|
+
};
|
|
616
|
+
imageStyle?: {
|
|
617
|
+
height?: number;
|
|
618
|
+
width?: number;
|
|
619
|
+
};
|
|
620
|
+
subtitle?: {
|
|
621
|
+
margin?: CsatSpacing;
|
|
622
|
+
textStyle?: CsatTextStyle;
|
|
623
|
+
};
|
|
624
|
+
title?: {
|
|
625
|
+
margin?: CsatSpacing;
|
|
626
|
+
textStyle?: CsatTextStyle;
|
|
627
|
+
};
|
|
628
|
+
};
|
|
629
|
+
};
|
|
630
|
+
thankyouDescription?: string;
|
|
631
|
+
thankyouImage?: string;
|
|
632
|
+
thankyouText?: string;
|
|
633
|
+
title?: string;
|
|
634
|
+
width?: number;
|
|
635
|
+
}
|
|
636
|
+
interface CampaignCsat extends BaseCampaign {
|
|
637
|
+
campaign_type: 'CSAT';
|
|
638
|
+
details: CsatCampaignDetails;
|
|
639
|
+
}
|
|
640
|
+
type Campaign = CampaignBanner | CampaignStory | CampaignWidget | CampaignTooltip | CampaignBottomSheet | CampaignCsat | CampaignSurvey | BaseCampaign;
|
|
641
|
+
interface InitializationOptions {
|
|
642
|
+
appId: string;
|
|
643
|
+
accountId: string;
|
|
644
|
+
userId?: string;
|
|
645
|
+
baseUrl?: string;
|
|
646
|
+
trackingUrl?: string;
|
|
647
|
+
navigateToScreen?: (screen: string) => void;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
declare const Banner: React.FC;
|
|
651
|
+
|
|
652
|
+
declare const Pip: React.FC;
|
|
653
|
+
|
|
654
|
+
declare const Floater: React.FC;
|
|
655
|
+
|
|
656
|
+
declare function personalizeText(text: string): string;
|
|
657
|
+
|
|
658
|
+
declare global {
|
|
659
|
+
interface Window {
|
|
660
|
+
AppStorysShowWidgetElements?: () => void;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
declare const Story: React.FC;
|
|
665
|
+
|
|
666
|
+
interface WidgetProps {
|
|
667
|
+
position?: string;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Simple web widget component mirroring RN Widgets.tsx implementation
|
|
671
|
+
* - Accepts optional position prop
|
|
672
|
+
* - Fetches single campaign via useCampaigns hook
|
|
673
|
+
* - Renders carousel with auto-advance (full) or manual scroll (half)
|
|
674
|
+
* - Portals into host element if position target found
|
|
675
|
+
*/
|
|
676
|
+
declare const Widget: React.FC<WidgetProps>;
|
|
677
|
+
|
|
678
|
+
declare const Tooltip: React.FC;
|
|
679
|
+
|
|
680
|
+
declare const BottomSheet: React.FC;
|
|
681
|
+
|
|
682
|
+
declare const Csat: React.FC;
|
|
683
|
+
|
|
684
|
+
declare const Survey: React.FC;
|
|
685
|
+
|
|
686
|
+
declare class AppStorys {
|
|
687
|
+
private state;
|
|
688
|
+
private navigateToScreen?;
|
|
689
|
+
initialize(options: InitializationOptions): Promise<void>;
|
|
690
|
+
trackScreen(screenName: string): Promise<void>;
|
|
691
|
+
trackEvent(event: string, campaignId?: string, metadata?: Attributes): Promise<void>;
|
|
692
|
+
setUserProperties(attributes: Attributes): Promise<void>;
|
|
693
|
+
handleLink(link: string | any): void;
|
|
694
|
+
/**
|
|
695
|
+
* Gets the visibility status of the SDK.
|
|
696
|
+
* @returns boolean indicating whether the SDK is considered visible.
|
|
697
|
+
*/
|
|
698
|
+
get visibility(): boolean;
|
|
699
|
+
/**
|
|
700
|
+
* Manually sets the visibility status of the SDK.
|
|
701
|
+
* Useful for host apps that want to pause/resume SDK activities programmatically.
|
|
702
|
+
* @param isVisible - boolean indicating visibility status.
|
|
703
|
+
*/
|
|
704
|
+
set visibility(isVisible: boolean);
|
|
705
|
+
private ensureInitialized;
|
|
706
|
+
personalizeText(text: string): string;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
declare const instance: AppStorys;
|
|
710
|
+
|
|
711
|
+
export { instance as AppStorys, type AppStorysStore, type Attributes, Banner, type BaseCampaign, BottomSheet, type BottomSheetElement, type Campaign, type CampaignBanner, type CampaignBottomSheet, type CampaignCsat, type CampaignStory, type CampaignSurvey, type CampaignTooltip, type CampaignType, type CampaignWidget, type CrossButtonConfig, Csat, type CsatCampaignDetails, type CsatSpacing, type CsatTextStyle, Floater, type InitializationOptions, Pip, SdkState, Story, type StoryGroupStyling, type StorySlide, type StorySlideCta, type StorySlideCtaBorderRadius, type StorySlideCtaContainer, type StorySlideCtaText, type StorySlideStyling, Survey, type SurveyCampaignDetails, type SurveyOptionColors, type SurveyOptionStyle, type SurveySlide, type SurveySlideLogicRule, type SurveyTextStyle, type SurveyThankYouButtonConfig, Tooltip, type TooltipItem, type TooltipStyling, type TriggerEvent, type TriggerEventConfig, type TriggerEventObject, Widget, type WidgetImage, personalizeText };
|