@sprig-technologies/sprig-browser 2.24.4 → 2.24.5
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 +36 -17
- package/dist/index.d.ts +17 -57
- package/dist/index.js +7497 -4226
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -374,7 +374,7 @@ declare const enum CardType {
|
|
|
374
374
|
Uploading = "uploading",
|
|
375
375
|
VideoVoice = "videovoice"
|
|
376
376
|
}
|
|
377
|
-
|
|
377
|
+
type ConceptUrl = string | null;
|
|
378
378
|
interface BaseCard {
|
|
379
379
|
name: number;
|
|
380
380
|
surveyId: number;
|
|
@@ -398,28 +398,28 @@ declare const enum Comparator {
|
|
|
398
398
|
Contains = "contains",
|
|
399
399
|
DoesNotContain = "notcontains"
|
|
400
400
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
type DefaultComparator = Comparator.Answered | Comparator.Skipped;
|
|
402
|
+
type RoutingOption<C extends Comparator = DefaultComparator> = OldRoutingOption<C> | GroupRoutingOption;
|
|
403
|
+
type OldRoutingOption<C extends Comparator = DefaultComparator> = {
|
|
404
404
|
comparator: C;
|
|
405
405
|
target: number;
|
|
406
406
|
/** @example '', 'option_2', ['option_1'] */
|
|
407
407
|
value: number | string | string[];
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
type GroupRoutingOption = {
|
|
410
410
|
group: (RoutingGroupOption | BooleanOperator)[];
|
|
411
411
|
target: number;
|
|
412
412
|
};
|
|
413
|
-
|
|
413
|
+
type RoutingGroupOption = {
|
|
414
414
|
comparator: Comparator;
|
|
415
415
|
questionIndex: number;
|
|
416
416
|
value: number | string | string[] | {
|
|
417
417
|
skipped: true;
|
|
418
418
|
} | null | undefined;
|
|
419
419
|
};
|
|
420
|
-
|
|
420
|
+
type RoutingOptions<C extends Comparator = DefaultComparator> = RoutingOption<C | DefaultComparator>[] | null;
|
|
421
421
|
/** @example <p>Body</p> */
|
|
422
|
-
|
|
422
|
+
type RichTextBody = string;
|
|
423
423
|
declare const enum PromptActionType {
|
|
424
424
|
Continue = "CONTINUE",
|
|
425
425
|
External = "EXTERNAL"
|
|
@@ -514,7 +514,7 @@ interface CompleteTaskPage extends BaseTaskPage {
|
|
|
514
514
|
taskDetail: string;
|
|
515
515
|
type: RecordedTaskPageType.CompleteTask;
|
|
516
516
|
}
|
|
517
|
-
|
|
517
|
+
type RecordedTaskPage = PermissionTaskPage | ScreenTaskPage | StartTaskPage | CompleteTaskPage;
|
|
518
518
|
interface RecordedTaskCardProperties {
|
|
519
519
|
captionText: string;
|
|
520
520
|
conceptUrl: ConceptUrl;
|
|
@@ -659,7 +659,7 @@ interface VideoVoiceCard extends BaseCard {
|
|
|
659
659
|
};
|
|
660
660
|
type: CardType.VideoVoice;
|
|
661
661
|
}
|
|
662
|
-
|
|
662
|
+
type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | VideoVoiceCard;
|
|
663
663
|
|
|
664
664
|
interface RecordedTaskResponseType {
|
|
665
665
|
questionId: number;
|
|
@@ -667,7 +667,7 @@ interface RecordedTaskResponseType {
|
|
|
667
667
|
value: RecordedTaskResponseValueType;
|
|
668
668
|
}
|
|
669
669
|
|
|
670
|
-
|
|
670
|
+
type SprigEventMap = {
|
|
671
671
|
[InternalEventName.CurrentQuestion]: [
|
|
672
672
|
{
|
|
673
673
|
[InternalEventData.QuestionId]: number;
|
|
@@ -774,9 +774,9 @@ declare type SprigEventMap = {
|
|
|
774
774
|
[SprigRecordingEvent.StartTask]: [];
|
|
775
775
|
};
|
|
776
776
|
declare const eventEmitter: Emitter<SprigEventMap>;
|
|
777
|
-
|
|
777
|
+
type SprigEventEmitter = typeof eventEmitter;
|
|
778
778
|
|
|
779
|
-
|
|
779
|
+
type MatchType = "exactly" | "legacy";
|
|
780
780
|
interface InteractiveEvent {
|
|
781
781
|
id: number;
|
|
782
782
|
matchType: MatchType;
|
|
@@ -914,7 +914,6 @@ interface Config {
|
|
|
914
914
|
surveyId: number;
|
|
915
915
|
tabTitle: string;
|
|
916
916
|
ulEvents: typeof SprigEvent;
|
|
917
|
-
UpChunk: Window["UpChunk"];
|
|
918
917
|
useDesktopPrototype?: boolean;
|
|
919
918
|
useMobileStyling: boolean;
|
|
920
919
|
userId: UUID | null;
|
|
@@ -937,7 +936,7 @@ interface Experiment {
|
|
|
937
936
|
variation?: string;
|
|
938
937
|
}
|
|
939
938
|
|
|
940
|
-
|
|
939
|
+
type QueueItem = [string, ...unknown[]] | (() => void);
|
|
941
940
|
declare class SprigQueue {
|
|
942
941
|
paused: boolean;
|
|
943
942
|
queue: QueueItem[];
|
|
@@ -994,44 +993,6 @@ declare namespace optimizely {
|
|
|
994
993
|
}
|
|
995
994
|
}
|
|
996
995
|
|
|
997
|
-
declare namespace upchunk {
|
|
998
|
-
type AllowedMethods = "PUT" | "POST" | "PATCH";
|
|
999
|
-
|
|
1000
|
-
//Adapted from here: https://github.com/muxinc/upchunk/blob/master/src/upchunk.ts
|
|
1001
|
-
interface UpChunkOptions {
|
|
1002
|
-
endpoint: string | ((file?: File) => Promise<string>);
|
|
1003
|
-
file: File;
|
|
1004
|
-
method?: AllowedMethods;
|
|
1005
|
-
headers?: Headers;
|
|
1006
|
-
maxFileSize?: number;
|
|
1007
|
-
chunkSize?: number;
|
|
1008
|
-
attempts?: number;
|
|
1009
|
-
delayBeforeAttempt?: number;
|
|
1010
|
-
retryCodes?: number[];
|
|
1011
|
-
dynamicChunkSize?: boolean;
|
|
1012
|
-
maxChunkSize?: number;
|
|
1013
|
-
minChunkSize?: number;
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
type UpChunkEventName =
|
|
1017
|
-
| "attempt"
|
|
1018
|
-
| "attemptFailure"
|
|
1019
|
-
| "chunkSuccess"
|
|
1020
|
-
| "error"
|
|
1021
|
-
| "offline"
|
|
1022
|
-
| "online"
|
|
1023
|
-
| "progress"
|
|
1024
|
-
| "success";
|
|
1025
|
-
|
|
1026
|
-
interface UpChunk {
|
|
1027
|
-
startTime: number;
|
|
1028
|
-
on: (eventName: UpChunkEventName, fn: (event: CustomEvent) => void) => void;
|
|
1029
|
-
}
|
|
1030
|
-
interface UpChunkModule {
|
|
1031
|
-
createUpload: (options: UpChunkOptions) => UpChunk;
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
996
|
declare namespace sprigConfig {
|
|
1036
997
|
type IdentifyResult = Promise<
|
|
1037
998
|
{ success: boolean; message?: string } | undefined
|
|
@@ -1147,7 +1108,7 @@ declare namespace sprigConfig {
|
|
|
1147
1108
|
partnerAnonymousId: string | null;
|
|
1148
1109
|
replayNonce?: string;
|
|
1149
1110
|
reportError: (name: string, err: Error, extraInfo?: object) => void;
|
|
1150
|
-
sampleRate?:
|
|
1111
|
+
sampleRate?: number;
|
|
1151
1112
|
token: string | null;
|
|
1152
1113
|
UPDATES: typeof EVENTS;
|
|
1153
1114
|
viewSDKURL?: string;
|
|
@@ -1169,7 +1130,6 @@ declare global {
|
|
|
1169
1130
|
optimizely?: optimizely.Optimizely;
|
|
1170
1131
|
optimizelyDatafile?: object;
|
|
1171
1132
|
previewMode?: unknown;
|
|
1172
|
-
UpChunk: upchunk.UpChunkModule;
|
|
1173
1133
|
_Sprig?: sprigConfig.WindowSprig;
|
|
1174
1134
|
Sprig: sprigConfig.WindowSprig;
|
|
1175
1135
|
UserLeap: sprigConfig.WindowSprig;
|
|
@@ -1315,7 +1275,7 @@ declare class SprigAPI {
|
|
|
1315
1275
|
*/
|
|
1316
1276
|
teardown(): void;
|
|
1317
1277
|
}
|
|
1318
|
-
|
|
1278
|
+
type NpmConfig = {
|
|
1319
1279
|
envId?: string;
|
|
1320
1280
|
environmentId?: string;
|
|
1321
1281
|
path?: string;
|
|
@@ -1328,7 +1288,7 @@ declare const sprig: {
|
|
|
1328
1288
|
*/
|
|
1329
1289
|
configure: (config: NpmConfig) => sprigConfig.WindowSprig;
|
|
1330
1290
|
};
|
|
1331
|
-
|
|
1291
|
+
type WindowSprig$1 = typeof window.Sprig;
|
|
1332
1292
|
|
|
1333
1293
|
declare const _default: {
|
|
1334
1294
|
sprig: {
|