@sprig-technologies/sprig-browser 2.24.11 → 2.25.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 +17 -17
- package/dist/index.d.ts +77 -13
- package/dist/index.js +4128 -3862
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1884,6 +1884,7 @@ declare enum DismissReason {
|
|
|
1884
1884
|
Override = "override"
|
|
1885
1885
|
}
|
|
1886
1886
|
declare enum SprigEvent {
|
|
1887
|
+
ReplayCapture = "replay.capture",
|
|
1887
1888
|
SDKReady = "sdk.ready",
|
|
1888
1889
|
SurveyAppeared = "survey.appeared",
|
|
1889
1890
|
SurveyClosed = "survey.closed",
|
|
@@ -1892,6 +1893,7 @@ declare enum SprigEvent {
|
|
|
1892
1893
|
SurveyHeight = "survey.height",
|
|
1893
1894
|
SurveyPresented = "survey.presented",
|
|
1894
1895
|
SurveyLifeCycle = "survey.lifeCycle",
|
|
1896
|
+
SurveyWidth = "survey.width",
|
|
1895
1897
|
SurveyWillClose = "survey.willClose",
|
|
1896
1898
|
SurveyWillPresent = "survey.will.present",
|
|
1897
1899
|
CloseSurveyOnOverlayClick = "close.survey.overlayClick",
|
|
@@ -1913,6 +1915,7 @@ declare const EVENTS: {
|
|
|
1913
1915
|
SURVEY_WILL_CLOSE: SprigEvent;
|
|
1914
1916
|
SURVEY_WILL_PRESENT: SprigEvent;
|
|
1915
1917
|
QUESTION_ANSWERED: SprigEvent;
|
|
1918
|
+
REPLAY_CAPTURE: SprigEvent;
|
|
1916
1919
|
CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
|
|
1917
1920
|
VISITOR_ID_UPDATED: SprigEvent;
|
|
1918
1921
|
DATA: {
|
|
@@ -2024,6 +2027,7 @@ declare enum BooleanOperator {
|
|
|
2024
2027
|
declare const enum CardType {
|
|
2025
2028
|
ConsentLegal = "consentlegal",
|
|
2026
2029
|
Likert = "likert",
|
|
2030
|
+
Matrix = "matrix",
|
|
2027
2031
|
MultipleChoice = "multiplechoice",
|
|
2028
2032
|
MultipleSelect = "multipleselect",
|
|
2029
2033
|
NPS = "nps",
|
|
@@ -2043,20 +2047,21 @@ interface BaseCard {
|
|
|
2043
2047
|
}
|
|
2044
2048
|
declare const enum Comparator {
|
|
2045
2049
|
Answered = "answered",
|
|
2050
|
+
Contains = "contains",
|
|
2051
|
+
DoesNotContain = "notcontains",
|
|
2052
|
+
DoesNotInclude = "list_dni",
|
|
2046
2053
|
Equal = "eq",
|
|
2047
|
-
NotEqual = "neq",
|
|
2048
|
-
Skipped = "skipped",
|
|
2049
|
-
LessThan = "lt",
|
|
2050
|
-
LessThanOrEqual = "lte",
|
|
2051
2054
|
GivenUp = "given_up",
|
|
2052
2055
|
GreaterThan = "gt",
|
|
2053
2056
|
GreaterThanOrEqual = "gte",
|
|
2057
|
+
LessThan = "lt",
|
|
2058
|
+
LessThanOrEqual = "lte",
|
|
2054
2059
|
ListAll = "list_all",
|
|
2055
2060
|
ListAtLeastOne = "list_alo",
|
|
2056
2061
|
ListExact = "list_exact",
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2062
|
+
NotEqual = "neq",
|
|
2063
|
+
Partial = "partial",
|
|
2064
|
+
Skipped = "skipped"
|
|
2060
2065
|
}
|
|
2061
2066
|
type DefaultComparator = Comparator.Answered | Comparator.Skipped;
|
|
2062
2067
|
type RoutingOption<C extends Comparator = DefaultComparator> = OldRoutingOption<C> | GroupRoutingOption;
|
|
@@ -2279,6 +2284,25 @@ interface MultipleChoiceSingleSelectCard extends MultiChoiceCard<Comparator.Equa
|
|
|
2279
2284
|
interface MultipleChoiceMultiSelectCard extends MultiChoiceCard<Comparator.ListAll | Comparator.ListAtLeastOne | Comparator.ListExact | Comparator.DoesNotInclude> {
|
|
2280
2285
|
type: CardType.MultipleSelect;
|
|
2281
2286
|
}
|
|
2287
|
+
interface MatrixCard extends BaseCard {
|
|
2288
|
+
props: {
|
|
2289
|
+
options: MultipleChoiceOption[];
|
|
2290
|
+
message: string;
|
|
2291
|
+
routingOptions: RoutingOptions<Comparator.Skipped | Comparator.Partial | Comparator.Answered>;
|
|
2292
|
+
properties: {
|
|
2293
|
+
buttonText?: string;
|
|
2294
|
+
captionText: string;
|
|
2295
|
+
conceptUrl: ConceptUrl;
|
|
2296
|
+
matrixColumn: {
|
|
2297
|
+
label: string;
|
|
2298
|
+
value: string;
|
|
2299
|
+
}[];
|
|
2300
|
+
randomize: "none" | "all";
|
|
2301
|
+
required: boolean;
|
|
2302
|
+
};
|
|
2303
|
+
};
|
|
2304
|
+
type: CardType.Matrix;
|
|
2305
|
+
}
|
|
2282
2306
|
interface NPSCard extends BaseCard {
|
|
2283
2307
|
props: {
|
|
2284
2308
|
labels: {
|
|
@@ -2319,7 +2343,7 @@ interface VideoVoiceCard extends BaseCard {
|
|
|
2319
2343
|
};
|
|
2320
2344
|
type: CardType.VideoVoice;
|
|
2321
2345
|
}
|
|
2322
|
-
type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | VideoVoiceCard;
|
|
2346
|
+
type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MatrixCard | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | VideoVoiceCard;
|
|
2323
2347
|
|
|
2324
2348
|
interface RecordedTaskResponseType {
|
|
2325
2349
|
questionId: number;
|
|
@@ -2327,6 +2351,14 @@ interface RecordedTaskResponseType {
|
|
|
2327
2351
|
value: RecordedTaskResponseValueType;
|
|
2328
2352
|
}
|
|
2329
2353
|
|
|
2354
|
+
interface MobileReplayConfig {
|
|
2355
|
+
maxMobileReplayDurationSeconds?: number;
|
|
2356
|
+
mobileReplaySettings?: {
|
|
2357
|
+
hideAllFormContents: boolean;
|
|
2358
|
+
hidePasswordsOnly: boolean;
|
|
2359
|
+
hideAllImages: boolean;
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2330
2362
|
type SprigEventMap = {
|
|
2331
2363
|
[InternalEventName.CurrentQuestion]: [
|
|
2332
2364
|
{
|
|
@@ -2343,8 +2375,13 @@ type SprigEventMap = {
|
|
|
2343
2375
|
}
|
|
2344
2376
|
];
|
|
2345
2377
|
[SprigEvent.CloseSurveyOnOverlayClick]: [];
|
|
2346
|
-
[SprigEvent.SDKReady]: [];
|
|
2347
|
-
[SprigEvent.SurveyAppeared]: [
|
|
2378
|
+
[SprigEvent.SDKReady]: [MobileReplayConfig];
|
|
2379
|
+
[SprigEvent.SurveyAppeared]: [
|
|
2380
|
+
{
|
|
2381
|
+
name: string;
|
|
2382
|
+
[SprigEventData.SurveyId]: number;
|
|
2383
|
+
}
|
|
2384
|
+
];
|
|
2348
2385
|
[SprigEvent.SurveyDimensions]: [
|
|
2349
2386
|
{
|
|
2350
2387
|
contentFrameHeight: number;
|
|
@@ -2365,12 +2402,19 @@ type SprigEventMap = {
|
|
|
2365
2402
|
contentFrameHeight: number;
|
|
2366
2403
|
}
|
|
2367
2404
|
];
|
|
2405
|
+
[SprigEvent.SurveyWidth]: [
|
|
2406
|
+
{
|
|
2407
|
+
name: string;
|
|
2408
|
+
contentFrameWidth: number;
|
|
2409
|
+
}
|
|
2410
|
+
];
|
|
2368
2411
|
[SprigEvent.SurveyLifeCycle]: [{
|
|
2369
2412
|
state: string;
|
|
2370
2413
|
}];
|
|
2371
2414
|
[SprigEvent.SurveyPresented]: [
|
|
2372
2415
|
{
|
|
2373
2416
|
name: string;
|
|
2417
|
+
[SprigEventData.SurveyId]: number;
|
|
2374
2418
|
}
|
|
2375
2419
|
];
|
|
2376
2420
|
[SprigEvent.SurveyWillClose]: [
|
|
@@ -2382,7 +2426,7 @@ type SprigEventMap = {
|
|
|
2382
2426
|
[SprigEvent.SurveyWillPresent]: [
|
|
2383
2427
|
{
|
|
2384
2428
|
name: string;
|
|
2385
|
-
|
|
2429
|
+
[SprigEventData.SurveyId]: number;
|
|
2386
2430
|
}
|
|
2387
2431
|
];
|
|
2388
2432
|
[SprigEvent.VisitorIDUpdated]: [{
|
|
@@ -2395,6 +2439,17 @@ type SprigEventMap = {
|
|
|
2395
2439
|
value: unknown;
|
|
2396
2440
|
}
|
|
2397
2441
|
];
|
|
2442
|
+
[SprigEvent.ReplayCapture]: [
|
|
2443
|
+
{
|
|
2444
|
+
responseGroupUid: string;
|
|
2445
|
+
hasQuestions: boolean;
|
|
2446
|
+
uploadId: string;
|
|
2447
|
+
seconds: number;
|
|
2448
|
+
replayType: ReplayDurationType;
|
|
2449
|
+
generateVideoUploadUrlPayload: object;
|
|
2450
|
+
surveyId: number;
|
|
2451
|
+
}
|
|
2452
|
+
];
|
|
2398
2453
|
[SprigRecordingEvent.AvPermission]: [
|
|
2399
2454
|
{
|
|
2400
2455
|
[SprigRecordingEventData.StreamReadyCallback]: (avStream: MediaStream | null, captureStream?: MediaStream | null) => void;
|
|
@@ -2490,7 +2545,7 @@ interface Answer {
|
|
|
2490
2545
|
questionId: number;
|
|
2491
2546
|
value: unknown;
|
|
2492
2547
|
}
|
|
2493
|
-
interface Config {
|
|
2548
|
+
interface Config extends MobileReplayConfig {
|
|
2494
2549
|
allResponses: unknown[];
|
|
2495
2550
|
answers?: Answer[];
|
|
2496
2551
|
apiURL: string;
|
|
@@ -2526,6 +2581,7 @@ interface Config {
|
|
|
2526
2581
|
frame: HTMLIFrameElement & {
|
|
2527
2582
|
eventEmitter?: SprigEventEmitter;
|
|
2528
2583
|
setHeight?: (height: number) => void;
|
|
2584
|
+
setWidth?: (width: number) => void;
|
|
2529
2585
|
};
|
|
2530
2586
|
framePosition: FramePosition;
|
|
2531
2587
|
headers: {
|
|
@@ -2541,6 +2597,8 @@ interface Config {
|
|
|
2541
2597
|
[HttpHeader.PreviewMode]?: string;
|
|
2542
2598
|
/** @example "2.18.0" */
|
|
2543
2599
|
"x-ul-sdk-version": string;
|
|
2600
|
+
/** For web-bundled sdk */
|
|
2601
|
+
"x-ul-bundled-sdk-version"?: string;
|
|
2544
2602
|
[HttpHeader.UserID]?: string;
|
|
2545
2603
|
[HttpHeader.VisitorID]?: UUID;
|
|
2546
2604
|
};
|
|
@@ -2593,6 +2651,11 @@ interface Config {
|
|
|
2593
2651
|
};
|
|
2594
2652
|
}
|
|
2595
2653
|
|
|
2654
|
+
declare enum ReplayDurationType {
|
|
2655
|
+
After = "after",
|
|
2656
|
+
Before = "before",
|
|
2657
|
+
BeforeAndAfter = "beforeAndAfter"
|
|
2658
|
+
}
|
|
2596
2659
|
declare enum ReplayEventType {
|
|
2597
2660
|
Click = "Sprig_Click",
|
|
2598
2661
|
Event = "Sprig_TrackEvent",
|
|
@@ -2697,6 +2760,7 @@ declare namespace sprigConfig {
|
|
|
2697
2760
|
surveyId?: number;
|
|
2698
2761
|
updatedAt?: string;
|
|
2699
2762
|
visitorId?: string | null;
|
|
2763
|
+
isReplay?: boolean;
|
|
2700
2764
|
}) => Promise<string | null>;
|
|
2701
2765
|
_previewSurvey: (surveyTemplateId: UUID) => void;
|
|
2702
2766
|
_reviewSurvey: (surveyId: number) => void;
|
|
@@ -2788,7 +2852,6 @@ declare namespace sprigConfig {
|
|
|
2788
2852
|
frameId: string;
|
|
2789
2853
|
loaded: boolean;
|
|
2790
2854
|
locale?: string;
|
|
2791
|
-
localStorageAvailable: boolean;
|
|
2792
2855
|
maxHeight?: number | string;
|
|
2793
2856
|
maxInflightReplayRequests?: number;
|
|
2794
2857
|
mobileHeadersJSON?: string;
|
|
@@ -2872,6 +2935,7 @@ declare class SprigAPI {
|
|
|
2872
2935
|
SURVEY_WILL_CLOSE: SprigEvent;
|
|
2873
2936
|
SURVEY_WILL_PRESENT: SprigEvent;
|
|
2874
2937
|
QUESTION_ANSWERED: SprigEvent;
|
|
2938
|
+
REPLAY_CAPTURE: SprigEvent;
|
|
2875
2939
|
CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
|
|
2876
2940
|
VISITOR_ID_UPDATED: SprigEvent;
|
|
2877
2941
|
DATA: {
|