@sprig-technologies/sprig-browser 2.19.7 → 2.20.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.cjs +687 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6580 -0
- package/dist/index.js.map +1 -0
- package/dist/sprig-browser/index.d.ts +168 -0
- package/dist/src/constants/css.d.ts +43 -0
- package/dist/src/constants/sprigEvents.d.ts +62 -0
- package/dist/src/constants/sprigRecordingEvents.d.ts +40 -0
- package/dist/src/controller/OptimizelyIntegration.d.ts +40 -0
- package/dist/src/controller/Queue.d.ts +18 -0
- package/dist/src/controller/controller.d.ts +9 -0
- package/dist/src/controller/iframe.d.ts +17 -0
- package/dist/src/helpers/Deferred.d.ts +9 -0
- package/dist/src/helpers/conflicting_widgets/index.d.ts +4 -0
- package/dist/src/helpers/conflicting_widgets/intercom.d.ts +2 -0
- package/dist/src/helpers/document.d.ts +6 -0
- package/dist/src/helpers/eventEmitter.d.ts +85 -0
- package/dist/src/helpers/general.d.ts +9 -0
- package/dist/src/helpers/network.d.ts +15 -0
- package/dist/src/types/card.d.ts +292 -0
- package/dist/src/types/config.d.ts +232 -0
- package/dist/src/types/event.d.ts +18 -0
- package/dist/src/types/global.d.ts +179 -0
- package/dist/src/view/app.d.ts +3 -0
- package/dist/src/view/cards/consentLegalCard.d.ts +6 -0
- package/dist/src/view/cards/index.d.ts +10 -0
- package/dist/src/view/cards/likertCard/index.d.ts +1 -0
- package/dist/src/view/cards/likertCard/likertCard.d.ts +6 -0
- package/dist/src/view/cards/likertCard/likertOption.d.ts +16 -0
- package/dist/src/view/cards/multipleChoice/baseMultiChoiceCard.d.ts +15 -0
- package/dist/src/view/cards/multipleChoice/index.d.ts +2 -0
- package/dist/src/view/cards/multipleChoice/multiSelectCard.d.ts +5 -0
- package/dist/src/view/cards/multipleChoice/singleSelectCard.d.ts +5 -0
- package/dist/src/view/cards/npsCard.d.ts +8 -0
- package/dist/src/view/cards/openTextCard.d.ts +6 -0
- package/dist/src/view/cards/recordedTask/actions.d.ts +21 -0
- package/dist/src/view/cards/recordedTask/card.d.ts +5 -0
- package/dist/src/view/cards/recordedTask/components.d.ts +37 -0
- package/dist/src/view/cards/recordedTask/constants.d.ts +5 -0
- package/dist/src/view/cards/recordedTask/helpers.d.ts +6 -0
- package/dist/src/view/cards/recordedTask/index.d.ts +1 -0
- package/dist/src/view/cards/recordedTask/store.d.ts +24 -0
- package/dist/src/view/cards/textUrlPromptCard.d.ts +6 -0
- package/dist/src/view/cards/thanksCard.d.ts +5 -0
- package/dist/src/view/cards/types.d.ts +34 -0
- package/dist/src/view/cards/uploadingCard.d.ts +5 -0
- package/dist/src/view/cards/videoVoiceCard.d.ts +6 -0
- package/dist/src/view/components/header.d.ts +8 -0
- package/dist/src/view/components/index.d.ts +3 -0
- package/dist/src/view/components/mobileEmbedView.d.ts +19 -0
- package/dist/src/view/components/select.d.ts +25 -0
- package/dist/src/view/footer.d.ts +2 -0
- package/dist/src/view/helpers/card.d.ts +6 -0
- package/dist/src/view/helpers/getAttributedUrl.d.ts +6 -0
- package/dist/src/view/helpers/skipLogicHelpers.d.ts +34 -0
- package/dist/src/view/hooks/index.d.ts +1 -0
- package/dist/src/view/hooks/useAutoSize.d.ts +2 -0
- package/dist/src/view/logo.d.ts +5 -0
- package/dist/src/view/recorder/recorder.d.ts +2 -0
- package/dist/src/view/store.d.ts +2 -0
- package/dist/src/view/view.d.ts +6 -0
- package/dist/style.css +1 -0
- package/package.json +12 -10
- package/LICENSE.md +0 -176
- package/index.d.ts +0 -160
- package/index.js +0 -680
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
export declare const enum CardType {
|
|
2
|
+
ConsentLegal = "consentlegal",
|
|
3
|
+
Likert = "likert",
|
|
4
|
+
MultipleChoice = "multiplechoice",
|
|
5
|
+
MultipleSelect = "multipleselect",
|
|
6
|
+
NPS = "nps",
|
|
7
|
+
Open = "open",
|
|
8
|
+
RecordedTask = "recordedtask",
|
|
9
|
+
TextUrlPrompt = "texturlprompt",
|
|
10
|
+
Thanks = "thanks",
|
|
11
|
+
Uploading = "uploading",
|
|
12
|
+
VideoVoice = "videovoice"
|
|
13
|
+
}
|
|
14
|
+
export declare type ConceptUrl = string | null;
|
|
15
|
+
interface BaseCard {
|
|
16
|
+
name: number;
|
|
17
|
+
surveyId: number;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
value?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export declare const enum Comparator {
|
|
22
|
+
Answered = "answered",
|
|
23
|
+
Equal = "eq",
|
|
24
|
+
NotEqual = "neq",
|
|
25
|
+
Skipped = "skipped",
|
|
26
|
+
LessThan = "lt",
|
|
27
|
+
LessThanOrEqual = "lte",
|
|
28
|
+
GivenUp = "given_up",
|
|
29
|
+
GreaterThan = "gt",
|
|
30
|
+
GreaterThanOrEqual = "gte",
|
|
31
|
+
ListAll = "list_all",
|
|
32
|
+
ListAtLeastOne = "list_alo",
|
|
33
|
+
ListExact = "list_exact"
|
|
34
|
+
}
|
|
35
|
+
export declare type DefaultComparator = Comparator.Answered | Comparator.Skipped;
|
|
36
|
+
export interface RoutingOption<C extends Comparator = DefaultComparator> {
|
|
37
|
+
comparator: C;
|
|
38
|
+
target: number;
|
|
39
|
+
/** @example '', 'option_2', ['option_1'] */
|
|
40
|
+
value: number | string | string[];
|
|
41
|
+
}
|
|
42
|
+
declare type RoutingOptions<C extends Comparator = DefaultComparator> = RoutingOption<C | DefaultComparator>[] | null;
|
|
43
|
+
/** @example <p>Body</p> */
|
|
44
|
+
declare type RichTextBody = string;
|
|
45
|
+
export declare const enum PromptActionType {
|
|
46
|
+
Continue = "CONTINUE",
|
|
47
|
+
External = "EXTERNAL"
|
|
48
|
+
}
|
|
49
|
+
export interface TextUrlPromptCard extends BaseCard {
|
|
50
|
+
props: {
|
|
51
|
+
message: string;
|
|
52
|
+
options: [];
|
|
53
|
+
properties: {
|
|
54
|
+
body: string;
|
|
55
|
+
buttonText?: string;
|
|
56
|
+
buttonUrl?: string;
|
|
57
|
+
conceptUrl: ConceptUrl;
|
|
58
|
+
promptActionType: PromptActionType;
|
|
59
|
+
required: boolean;
|
|
60
|
+
richTextBody: RichTextBody;
|
|
61
|
+
};
|
|
62
|
+
routingOptions: RoutingOptions;
|
|
63
|
+
};
|
|
64
|
+
type: CardType.TextUrlPrompt;
|
|
65
|
+
}
|
|
66
|
+
export declare const enum AvPermission {
|
|
67
|
+
Camera = "camera",
|
|
68
|
+
Microphone = "microphone",
|
|
69
|
+
Screen = "screen"
|
|
70
|
+
}
|
|
71
|
+
export interface ConsentLegalCard extends BaseCard {
|
|
72
|
+
props: {
|
|
73
|
+
message: string;
|
|
74
|
+
options: [];
|
|
75
|
+
properties: {
|
|
76
|
+
body: string;
|
|
77
|
+
captionText: string;
|
|
78
|
+
collectName: boolean;
|
|
79
|
+
conceptUrl: ConceptUrl;
|
|
80
|
+
consentText: string;
|
|
81
|
+
nameLabelText: string;
|
|
82
|
+
required: boolean;
|
|
83
|
+
richTextBody: RichTextBody;
|
|
84
|
+
skipButtonText: string;
|
|
85
|
+
submitButtonText: string;
|
|
86
|
+
};
|
|
87
|
+
routingOptions: RoutingOptions;
|
|
88
|
+
};
|
|
89
|
+
type: CardType.ConsentLegal;
|
|
90
|
+
}
|
|
91
|
+
interface BaseTaskPage {
|
|
92
|
+
buttonText: string;
|
|
93
|
+
headline: string;
|
|
94
|
+
}
|
|
95
|
+
export declare const enum RecordedTaskPageType {
|
|
96
|
+
AvPermission = "av_permission",
|
|
97
|
+
ScreenPermission = "screen_permission",
|
|
98
|
+
StartTask = "start_task",
|
|
99
|
+
CompleteTask = "complete_task"
|
|
100
|
+
}
|
|
101
|
+
export interface PermissionTaskPage extends BaseTaskPage {
|
|
102
|
+
captionText: string;
|
|
103
|
+
headline: string;
|
|
104
|
+
permissionDeniedBody: string;
|
|
105
|
+
permissionDeniedHeadline: string;
|
|
106
|
+
permissionDescriptors: AvPermission[];
|
|
107
|
+
permissionGrantedCaptionText?: string;
|
|
108
|
+
permissionGrantedHeadline?: string;
|
|
109
|
+
skipButtonText?: string;
|
|
110
|
+
svg: string;
|
|
111
|
+
tryAgainButtonText: string;
|
|
112
|
+
type: RecordedTaskPageType.AvPermission;
|
|
113
|
+
}
|
|
114
|
+
export interface ScreenTaskPage extends BaseTaskPage {
|
|
115
|
+
captionText: string;
|
|
116
|
+
permissionDeniedCaptionText: string;
|
|
117
|
+
permissionDeniedHeadline: string;
|
|
118
|
+
selectTabText: string;
|
|
119
|
+
skipButtonText: string;
|
|
120
|
+
type: RecordedTaskPageType.ScreenPermission;
|
|
121
|
+
}
|
|
122
|
+
export interface StartTaskPage extends BaseTaskPage {
|
|
123
|
+
captionText?: string;
|
|
124
|
+
taskDetail: string;
|
|
125
|
+
type: RecordedTaskPageType.StartTask;
|
|
126
|
+
}
|
|
127
|
+
export interface CompleteTaskPage extends BaseTaskPage {
|
|
128
|
+
captionText?: string;
|
|
129
|
+
skipButtonText: string;
|
|
130
|
+
taskDetail: string;
|
|
131
|
+
type: RecordedTaskPageType.CompleteTask;
|
|
132
|
+
}
|
|
133
|
+
export declare type RecordedTaskPage = PermissionTaskPage | ScreenTaskPage | StartTaskPage | CompleteTaskPage;
|
|
134
|
+
export interface RecordedTaskCardProperties {
|
|
135
|
+
captionText: string;
|
|
136
|
+
conceptUrl: ConceptUrl;
|
|
137
|
+
pages: RecordedTaskPage[];
|
|
138
|
+
permissions: AvPermission[];
|
|
139
|
+
required: boolean;
|
|
140
|
+
taskDetail: string;
|
|
141
|
+
}
|
|
142
|
+
export interface RecordedTaskCard extends BaseCard {
|
|
143
|
+
props: {
|
|
144
|
+
message: string;
|
|
145
|
+
options: [];
|
|
146
|
+
properties: RecordedTaskCardProperties;
|
|
147
|
+
routingOptions: RoutingOptions<Comparator.GivenUp>;
|
|
148
|
+
};
|
|
149
|
+
type: CardType.RecordedTask;
|
|
150
|
+
}
|
|
151
|
+
interface Labels {
|
|
152
|
+
left: string;
|
|
153
|
+
right: string;
|
|
154
|
+
}
|
|
155
|
+
export interface RatingIcon {
|
|
156
|
+
idx?: number;
|
|
157
|
+
svg: string;
|
|
158
|
+
}
|
|
159
|
+
export declare enum ScaleLabelType {
|
|
160
|
+
Number = "number",
|
|
161
|
+
Smiley = "smiley",
|
|
162
|
+
Star = "star"
|
|
163
|
+
}
|
|
164
|
+
export interface LikertCard extends BaseCard {
|
|
165
|
+
props: {
|
|
166
|
+
labels: Labels;
|
|
167
|
+
message: string;
|
|
168
|
+
options: [];
|
|
169
|
+
properties: {
|
|
170
|
+
captionText: string;
|
|
171
|
+
buttonText?: string;
|
|
172
|
+
conceptUrl: ConceptUrl;
|
|
173
|
+
labels: Labels;
|
|
174
|
+
range: string;
|
|
175
|
+
ratingIcons: RatingIcon[];
|
|
176
|
+
scaleLabelType: ScaleLabelType;
|
|
177
|
+
required: boolean;
|
|
178
|
+
};
|
|
179
|
+
routingOptions: RoutingOptions<Comparator.Equal | Comparator.GivenUp | Comparator.GreaterThan | Comparator.GreaterThanOrEqual | Comparator.LessThan | Comparator.LessThanOrEqual | Comparator.NotEqual>;
|
|
180
|
+
};
|
|
181
|
+
type: CardType.Likert;
|
|
182
|
+
}
|
|
183
|
+
export interface OpenTextCard extends BaseCard {
|
|
184
|
+
props: {
|
|
185
|
+
message: string;
|
|
186
|
+
options: [];
|
|
187
|
+
properties: {
|
|
188
|
+
body: string;
|
|
189
|
+
buttonText?: string;
|
|
190
|
+
captionText?: string;
|
|
191
|
+
conceptUrl: ConceptUrl;
|
|
192
|
+
openTextPlaceholder?: string;
|
|
193
|
+
required: boolean;
|
|
194
|
+
richTextBody: RichTextBody;
|
|
195
|
+
skipButtonText?: string;
|
|
196
|
+
};
|
|
197
|
+
routingOptions: RoutingOptions;
|
|
198
|
+
};
|
|
199
|
+
type: CardType.Open;
|
|
200
|
+
}
|
|
201
|
+
export interface MultipleChoiceOption {
|
|
202
|
+
createdAt: string;
|
|
203
|
+
deletedAt: null;
|
|
204
|
+
id: number;
|
|
205
|
+
label: string;
|
|
206
|
+
optionProperties: null | {
|
|
207
|
+
allowsTextEntry: boolean;
|
|
208
|
+
};
|
|
209
|
+
order: number;
|
|
210
|
+
productId: number;
|
|
211
|
+
surveyId: number;
|
|
212
|
+
surveyQuestionId: number;
|
|
213
|
+
updatedAt: string;
|
|
214
|
+
value: string;
|
|
215
|
+
}
|
|
216
|
+
export interface CommonMultipleChoiceProps {
|
|
217
|
+
message: string;
|
|
218
|
+
options: MultipleChoiceOption[];
|
|
219
|
+
properties: {
|
|
220
|
+
buttonText?: string;
|
|
221
|
+
captionText: string;
|
|
222
|
+
conceptUrl: ConceptUrl;
|
|
223
|
+
randomize: "none" | "keeplast" | "all";
|
|
224
|
+
required: true;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
export interface MultiChoiceCard<C extends Comparator = DefaultComparator> extends BaseCard {
|
|
228
|
+
props: CommonMultipleChoiceProps & {
|
|
229
|
+
routingOptions: RoutingOptions<C>;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
export interface MultipleChoiceSingleSelectCard extends MultiChoiceCard<Comparator.Equal | Comparator.NotEqual> {
|
|
233
|
+
type: CardType.MultipleChoice;
|
|
234
|
+
}
|
|
235
|
+
export interface MultipleChoiceMultiSelectCard extends MultiChoiceCard<Comparator.ListAll | Comparator.ListAtLeastOne | Comparator.ListExact> {
|
|
236
|
+
type: CardType.MultipleSelect;
|
|
237
|
+
}
|
|
238
|
+
export interface NPSCard extends BaseCard {
|
|
239
|
+
props: {
|
|
240
|
+
labels: {
|
|
241
|
+
left: string;
|
|
242
|
+
right: string;
|
|
243
|
+
};
|
|
244
|
+
message: string;
|
|
245
|
+
options: [];
|
|
246
|
+
properties: {
|
|
247
|
+
buttonText?: string;
|
|
248
|
+
captionText: string;
|
|
249
|
+
conceptUrl: null;
|
|
250
|
+
labels: {
|
|
251
|
+
left: string;
|
|
252
|
+
right: string;
|
|
253
|
+
};
|
|
254
|
+
required: boolean;
|
|
255
|
+
};
|
|
256
|
+
routingOptions: RoutingOptions<Comparator.Equal | Comparator.GreaterThan | Comparator.GreaterThanOrEqual | Comparator.LessThan | Comparator.LessThanOrEqual | Comparator.NotEqual>;
|
|
257
|
+
};
|
|
258
|
+
type: CardType.NPS;
|
|
259
|
+
}
|
|
260
|
+
export interface VideoVoiceCard extends BaseCard {
|
|
261
|
+
props: {
|
|
262
|
+
message: string;
|
|
263
|
+
options: [];
|
|
264
|
+
properties: {
|
|
265
|
+
buttonText: string;
|
|
266
|
+
captionText: string;
|
|
267
|
+
conceptUrl: null;
|
|
268
|
+
mediaType: "video" | "audio";
|
|
269
|
+
required: boolean;
|
|
270
|
+
skipButtonText: string;
|
|
271
|
+
uploadId: string;
|
|
272
|
+
videoUrl: string;
|
|
273
|
+
};
|
|
274
|
+
routingOptions: RoutingOptions;
|
|
275
|
+
};
|
|
276
|
+
type: CardType.VideoVoice;
|
|
277
|
+
}
|
|
278
|
+
export interface UploadingCard extends Pick<BaseCard, "name"> {
|
|
279
|
+
props: {
|
|
280
|
+
routingOptions: [];
|
|
281
|
+
};
|
|
282
|
+
type: CardType.Uploading;
|
|
283
|
+
}
|
|
284
|
+
export interface ThanksCard extends Pick<BaseCard, "name"> {
|
|
285
|
+
props: {
|
|
286
|
+
routingOptions: [];
|
|
287
|
+
};
|
|
288
|
+
type: CardType.Thanks;
|
|
289
|
+
}
|
|
290
|
+
export declare type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | VideoVoiceCard;
|
|
291
|
+
export declare type AppCard = Card | UploadingCard | ThanksCard;
|
|
292
|
+
export {};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { DismissReason, SprigEvent } from "../constants/sprigEvents";
|
|
2
|
+
import { SprigEventEmitter } from "../helpers/eventEmitter";
|
|
3
|
+
import { AppCard, Card, CardType } from "./card";
|
|
4
|
+
import { InteractiveEvent, PageUrlEvent } from "./event";
|
|
5
|
+
export declare const enum FramePosition {
|
|
6
|
+
BottomLeft = "bottomLeft",
|
|
7
|
+
BottomRight = "bottomRight",
|
|
8
|
+
Center = "center",
|
|
9
|
+
TopLeft = "topLeft",
|
|
10
|
+
TopRight = "topRight"
|
|
11
|
+
}
|
|
12
|
+
export declare const enum HttpHeader {
|
|
13
|
+
Error = "x-ul-error",
|
|
14
|
+
EnvironmentID = "x-ul-environment-id",
|
|
15
|
+
InstallationMethod = "x-ul-installation-method",
|
|
16
|
+
PartnerAnonymousId = "x-ul-anonymous-id",
|
|
17
|
+
Platform = "userleap-platform",
|
|
18
|
+
PreviewMode = "x-ul-preview-mode",
|
|
19
|
+
UserID = "x-ul-user-id",
|
|
20
|
+
VisitorID = "x-ul-visitor-id"
|
|
21
|
+
}
|
|
22
|
+
export declare const enum Platform {
|
|
23
|
+
Email = "email",
|
|
24
|
+
Link = "link",
|
|
25
|
+
Web = "web"
|
|
26
|
+
}
|
|
27
|
+
export declare const enum InstallationMethod {
|
|
28
|
+
Npm = "web-npm",
|
|
29
|
+
Gtm = "web-gtm",
|
|
30
|
+
Segment = "web-segment",
|
|
31
|
+
Snippet = "web-snippet"
|
|
32
|
+
}
|
|
33
|
+
interface Answer {
|
|
34
|
+
questionId: number;
|
|
35
|
+
value: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface Config {
|
|
38
|
+
answers?: Answer[];
|
|
39
|
+
apiURL: string;
|
|
40
|
+
/** @example "#000000" */
|
|
41
|
+
border: string;
|
|
42
|
+
cards: Card[];
|
|
43
|
+
configureExitOnOverlayClick: (cb: () => void) => void;
|
|
44
|
+
context: {
|
|
45
|
+
outcome: string;
|
|
46
|
+
product: {
|
|
47
|
+
name: string;
|
|
48
|
+
};
|
|
49
|
+
visitor: {
|
|
50
|
+
outcome: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
customMetadata?: Record<string, unknown>;
|
|
54
|
+
customStyles: string;
|
|
55
|
+
dismissOnPageChange: boolean;
|
|
56
|
+
endCard: {
|
|
57
|
+
headline: string;
|
|
58
|
+
subheader?: string;
|
|
59
|
+
};
|
|
60
|
+
/** @example "SJcVfq-7QQ" */
|
|
61
|
+
envId: string;
|
|
62
|
+
environmentId?: string;
|
|
63
|
+
eventEmitFn: SprigEventEmitter["emit"];
|
|
64
|
+
fontFamily?: string;
|
|
65
|
+
fontFamilyURL: undefined;
|
|
66
|
+
frame: HTMLIFrameElement & {
|
|
67
|
+
eventEmitter?: SprigEventEmitter;
|
|
68
|
+
setHeight?: (height: number) => void;
|
|
69
|
+
};
|
|
70
|
+
framePosition: FramePosition;
|
|
71
|
+
headers: {
|
|
72
|
+
"accept-language"?: string;
|
|
73
|
+
/** @example "Bearer 123" */
|
|
74
|
+
Authorization?: string;
|
|
75
|
+
"Content-Type": string;
|
|
76
|
+
"userleap-platform": Platform;
|
|
77
|
+
/** @example "SJcVfq-7QQ" */
|
|
78
|
+
[HttpHeader.EnvironmentID]?: string;
|
|
79
|
+
[HttpHeader.InstallationMethod]: InstallationMethod;
|
|
80
|
+
[HttpHeader.PartnerAnonymousId]?: string;
|
|
81
|
+
[HttpHeader.PreviewMode]?: string;
|
|
82
|
+
/** @example "2.18.0" */
|
|
83
|
+
"x-ul-sdk-version": string;
|
|
84
|
+
[HttpHeader.UserID]?: string;
|
|
85
|
+
[HttpHeader.VisitorID]?: UUID;
|
|
86
|
+
};
|
|
87
|
+
installationMethod?: InstallationMethod;
|
|
88
|
+
interactiveEvents: InteractiveEvent[];
|
|
89
|
+
interactiveEventsHandler?: (e: MouseEvent) => void;
|
|
90
|
+
isPreview?: boolean;
|
|
91
|
+
locale: string;
|
|
92
|
+
marketingUrl?: string;
|
|
93
|
+
maxAttrNameLength: number;
|
|
94
|
+
maxAttrValueLength: number;
|
|
95
|
+
maxEmailLength: number;
|
|
96
|
+
maxEventLength: number;
|
|
97
|
+
maxUserIdLength: number;
|
|
98
|
+
mobileSDKVersion: undefined;
|
|
99
|
+
mode?: string;
|
|
100
|
+
mute?: boolean;
|
|
101
|
+
optimizelyEnabled: boolean;
|
|
102
|
+
overlayStyle: "light";
|
|
103
|
+
overlayStyleMobile: "none";
|
|
104
|
+
pageUrlEvents: PageUrlEvent[];
|
|
105
|
+
path?: string;
|
|
106
|
+
platform?: Platform;
|
|
107
|
+
requireUserIdForTracking: boolean;
|
|
108
|
+
responseGroupUid: UUID;
|
|
109
|
+
showStripes: boolean;
|
|
110
|
+
showSurveyBrand: boolean;
|
|
111
|
+
slugName: null;
|
|
112
|
+
startingQuestionIdx?: number | null;
|
|
113
|
+
styleNonce?: string;
|
|
114
|
+
surveyId: number;
|
|
115
|
+
tabTitle: string;
|
|
116
|
+
ulEvents: SprigEvent;
|
|
117
|
+
UpChunk: Window["UpChunk"];
|
|
118
|
+
useDesktopPrototype?: boolean;
|
|
119
|
+
useMobileStyling: boolean;
|
|
120
|
+
userId: UUID | null;
|
|
121
|
+
visitorId: UUID | null;
|
|
122
|
+
viewDocument: Document;
|
|
123
|
+
viewWindow: Window;
|
|
124
|
+
visitorAttributes: {
|
|
125
|
+
email?: string;
|
|
126
|
+
externalUserId?: string;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export interface ResponseData {
|
|
130
|
+
answeredAt?: number;
|
|
131
|
+
questionId: number;
|
|
132
|
+
value: unknown;
|
|
133
|
+
type: CardType;
|
|
134
|
+
}
|
|
135
|
+
export interface Submission {
|
|
136
|
+
completedAt: number;
|
|
137
|
+
response: {
|
|
138
|
+
answeredAt?: number;
|
|
139
|
+
value: unknown;
|
|
140
|
+
};
|
|
141
|
+
responseGroupUid: AppConfig["responseGroupUid"];
|
|
142
|
+
}
|
|
143
|
+
export interface AppConfig {
|
|
144
|
+
apiURL: Config["apiURL"];
|
|
145
|
+
answers: Config["answers"];
|
|
146
|
+
border: Config["border"];
|
|
147
|
+
cards: AppCard[];
|
|
148
|
+
configureExitOnOverlayClick: Config["configureExitOnOverlayClick"];
|
|
149
|
+
customMetadata: Config["customMetadata"];
|
|
150
|
+
endCard: Config["endCard"];
|
|
151
|
+
envId: Config["envId"];
|
|
152
|
+
eventEmitFn: Config["eventEmitFn"];
|
|
153
|
+
fontFamily?: Config["fontFamily"];
|
|
154
|
+
frame: Config["frame"];
|
|
155
|
+
headers: Config["headers"];
|
|
156
|
+
index: number;
|
|
157
|
+
hasViewedEmbed: boolean;
|
|
158
|
+
isPreview: Config["isPreview"];
|
|
159
|
+
marketingUrl: Config["marketingUrl"];
|
|
160
|
+
meta: {
|
|
161
|
+
ch: number;
|
|
162
|
+
cw: number;
|
|
163
|
+
l: string;
|
|
164
|
+
mode: Config["mode"] | null;
|
|
165
|
+
p: string;
|
|
166
|
+
sh: number;
|
|
167
|
+
sw: number;
|
|
168
|
+
};
|
|
169
|
+
mode: Config["mode"];
|
|
170
|
+
recorderEventEmitter: SprigEventEmitter;
|
|
171
|
+
responseGroupUid: Config["responseGroupUid"];
|
|
172
|
+
slugName: Config["slugName"];
|
|
173
|
+
showStripes: Config["showStripes"];
|
|
174
|
+
showSurveyBrand: Config["showSurveyBrand"];
|
|
175
|
+
styleNonce: Config["styleNonce"];
|
|
176
|
+
surveyId: Config["surveyId"];
|
|
177
|
+
tabTitle: Config["tabTitle"];
|
|
178
|
+
uploadingCardViewed: boolean;
|
|
179
|
+
uploadProgress: Record<string, {
|
|
180
|
+
isComplete: boolean;
|
|
181
|
+
isSubmitted: boolean;
|
|
182
|
+
progressPct: number;
|
|
183
|
+
}>;
|
|
184
|
+
useDesktopPrototype: Config["useDesktopPrototype"];
|
|
185
|
+
useMobileStyling: Config["useMobileStyling"];
|
|
186
|
+
userId: Config["userId"];
|
|
187
|
+
viewDocument: Config["viewDocument"];
|
|
188
|
+
viewedCardCount: number;
|
|
189
|
+
visitorAttributes?: Config["visitorAttributes"];
|
|
190
|
+
close: (id?: string) => void;
|
|
191
|
+
handleClickEmbedButton: (id: string) => void;
|
|
192
|
+
/**
|
|
193
|
+
* If the current card is not the uploading card, update the given upload state for this mediaRecordingUid directly in state,
|
|
194
|
+
* without using update, which would reset video player.
|
|
195
|
+
* If the current card is the uploading card,
|
|
196
|
+
* check if upload is complete: if so and there's no end card, destroy the app.
|
|
197
|
+
* since we're on the end card, update the state using store, which allows for dynamic progress updates.
|
|
198
|
+
*/
|
|
199
|
+
handleUploadUpdate: (options: {
|
|
200
|
+
mediaRecordingUid: UUID;
|
|
201
|
+
isComplete?: boolean;
|
|
202
|
+
progressPct?: number;
|
|
203
|
+
isSubmitted?: boolean;
|
|
204
|
+
}) => void;
|
|
205
|
+
destroy: (id: string) => void;
|
|
206
|
+
fadeout: (id: string) => void;
|
|
207
|
+
recorder: () => void;
|
|
208
|
+
remove: (options: {
|
|
209
|
+
initiator: DismissReason;
|
|
210
|
+
}) => void;
|
|
211
|
+
next: (options: {
|
|
212
|
+
completeSurvey: () => void;
|
|
213
|
+
data: ResponseData;
|
|
214
|
+
endCard?: AppConfig["endCard"];
|
|
215
|
+
}) => void;
|
|
216
|
+
submit: (submission: Submission) => Promise<void>;
|
|
217
|
+
trackHistory: (options: {
|
|
218
|
+
event: string;
|
|
219
|
+
index?: number;
|
|
220
|
+
isNew?: boolean;
|
|
221
|
+
}) => void;
|
|
222
|
+
update: (id?: string) => void;
|
|
223
|
+
}
|
|
224
|
+
export interface ProductConfig {
|
|
225
|
+
customStyles: string;
|
|
226
|
+
exitOnOverlayClick: boolean;
|
|
227
|
+
exitOnOverlayClickMobile: boolean;
|
|
228
|
+
framePosition: FramePosition;
|
|
229
|
+
overlayStyle: "dark" | "light";
|
|
230
|
+
overlayStyleMobile: "dark" | "light" | "none";
|
|
231
|
+
}
|
|
232
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare type MatchType = "exactly" | "legacy";
|
|
2
|
+
export interface InteractiveEvent {
|
|
3
|
+
id: number;
|
|
4
|
+
matchType: MatchType;
|
|
5
|
+
name: string;
|
|
6
|
+
pattern: string;
|
|
7
|
+
properties: {
|
|
8
|
+
innerText: string;
|
|
9
|
+
selector?: string;
|
|
10
|
+
type?: "click";
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface PageUrlEvent {
|
|
14
|
+
id: number;
|
|
15
|
+
matchType: MatchType | "contains" | "notContains" | "regex" | "startsWith";
|
|
16
|
+
pattern: string;
|
|
17
|
+
}
|
|
18
|
+
export {};
|