@sprig-technologies/sprig-bundled 1.0.2 → 1.1.1
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-BuamjNZy.js +8588 -0
- package/dist/index.d.ts +211 -235
- package/dist/index.js +5 -14461
- package/dist/view-e6qhXinS.js +3959 -0
- package/package.json +2 -4
- package/dist/index.cjs +0 -65
package/dist/index.d.ts
CHANGED
|
@@ -992,38 +992,7 @@ declare const utils_d_shadowHostInDom: typeof shadowHostInDom;
|
|
|
992
992
|
declare const utils_d_throttle: typeof throttle;
|
|
993
993
|
declare const utils_d_uniqueTextMutations: typeof uniqueTextMutations;
|
|
994
994
|
declare namespace utils_d {
|
|
995
|
-
export {
|
|
996
|
-
utils_d_AppendedIframe as AppendedIframe,
|
|
997
|
-
utils_d_StyleSheetMirror as StyleSheetMirror,
|
|
998
|
-
utils_d__mirror as _mirror,
|
|
999
|
-
utils_d_getBaseDimension as getBaseDimension,
|
|
1000
|
-
utils_d_getNestedRule as getNestedRule,
|
|
1001
|
-
utils_d_getPositionsAndIndex as getPositionsAndIndex,
|
|
1002
|
-
utils_d_getRootShadowHost as getRootShadowHost,
|
|
1003
|
-
utils_d_getShadowHost as getShadowHost,
|
|
1004
|
-
utils_d_getWindowHeight as getWindowHeight,
|
|
1005
|
-
utils_d_getWindowScroll as getWindowScroll,
|
|
1006
|
-
utils_d_getWindowWidth as getWindowWidth,
|
|
1007
|
-
utils_d_hasShadowRoot as hasShadowRoot,
|
|
1008
|
-
utils_d_hookSetter as hookSetter,
|
|
1009
|
-
utils_d_inDom as inDom,
|
|
1010
|
-
utils_d_isAncestorRemoved as isAncestorRemoved,
|
|
1011
|
-
utils_d_isBlocked as isBlocked,
|
|
1012
|
-
utils_d_isIgnored as isIgnored,
|
|
1013
|
-
utils_d_isSerialized as isSerialized,
|
|
1014
|
-
utils_d_isSerializedIframe as isSerializedIframe,
|
|
1015
|
-
utils_d_isSerializedStylesheet as isSerializedStylesheet,
|
|
1016
|
-
utils_d_iterateResolveTree as iterateResolveTree,
|
|
1017
|
-
utils_d_legacy_isTouchEvent as legacy_isTouchEvent,
|
|
1018
|
-
utils_d_nowTimestamp as nowTimestamp,
|
|
1019
|
-
utils_d_on as on,
|
|
1020
|
-
utils_d_patch as patch,
|
|
1021
|
-
utils_d_polyfill as polyfill,
|
|
1022
|
-
utils_d_queueToResolveTrees as queueToResolveTrees,
|
|
1023
|
-
utils_d_shadowHostInDom as shadowHostInDom,
|
|
1024
|
-
utils_d_throttle as throttle,
|
|
1025
|
-
utils_d_uniqueTextMutations as uniqueTextMutations,
|
|
1026
|
-
};
|
|
995
|
+
export { type utils_d_AppendedIframe as AppendedIframe, utils_d_StyleSheetMirror as StyleSheetMirror, utils_d__mirror as _mirror, utils_d_getBaseDimension as getBaseDimension, utils_d_getNestedRule as getNestedRule, utils_d_getPositionsAndIndex as getPositionsAndIndex, utils_d_getRootShadowHost as getRootShadowHost, utils_d_getShadowHost as getShadowHost, utils_d_getWindowHeight as getWindowHeight, utils_d_getWindowScroll as getWindowScroll, utils_d_getWindowWidth as getWindowWidth, utils_d_hasShadowRoot as hasShadowRoot, utils_d_hookSetter as hookSetter, utils_d_inDom as inDom, utils_d_isAncestorRemoved as isAncestorRemoved, utils_d_isBlocked as isBlocked, utils_d_isIgnored as isIgnored, utils_d_isSerialized as isSerialized, utils_d_isSerializedIframe as isSerializedIframe, utils_d_isSerializedStylesheet as isSerializedStylesheet, utils_d_iterateResolveTree as iterateResolveTree, utils_d_legacy_isTouchEvent as legacy_isTouchEvent, utils_d_nowTimestamp as nowTimestamp, utils_d_on as on, utils_d_patch as patch, utils_d_polyfill as polyfill, utils_d_queueToResolveTrees as queueToResolveTrees, utils_d_shadowHostInDom as shadowHostInDom, utils_d_throttle as throttle, utils_d_uniqueTextMutations as uniqueTextMutations };
|
|
1027
996
|
}
|
|
1028
997
|
|
|
1029
998
|
declare class Timer {
|
|
@@ -1458,28 +1427,7 @@ declare const rrweb_record: typeof record;
|
|
|
1458
1427
|
type rrweb_recordOptions<T> = recordOptions<T>;
|
|
1459
1428
|
declare const rrweb_unpack: typeof unpack;
|
|
1460
1429
|
declare namespace rrweb {
|
|
1461
|
-
export {
|
|
1462
|
-
rrweb_EventType as EventType,
|
|
1463
|
-
rrweb_IncrementalSource as IncrementalSource,
|
|
1464
|
-
rrweb_LogData as LogData,
|
|
1465
|
-
rrweb_LogLevel as LogLevel,
|
|
1466
|
-
rrweb_Logger as Logger,
|
|
1467
|
-
rrweb_MouseInteractions as MouseInteractions,
|
|
1468
|
-
rrweb_PLUGIN_NAME as PLUGIN_NAME,
|
|
1469
|
-
rrweb_Replayer as Replayer,
|
|
1470
|
-
rrweb_ReplayerEvents as ReplayerEvents,
|
|
1471
|
-
rrweb_StringifyOptions as StringifyOptions,
|
|
1472
|
-
rrweb_addCustomEvent as addCustomEvent,
|
|
1473
|
-
rrweb_freezePage as freezePage,
|
|
1474
|
-
rrweb_getRecordConsolePlugin as getRecordConsolePlugin,
|
|
1475
|
-
rrweb_getReplayConsolePlugin as getReplayConsolePlugin,
|
|
1476
|
-
_mirror as mirror,
|
|
1477
|
-
rrweb_pack as pack,
|
|
1478
|
-
rrweb_record as record,
|
|
1479
|
-
rrweb_recordOptions as recordOptions,
|
|
1480
|
-
rrweb_unpack as unpack,
|
|
1481
|
-
utils_d as utils,
|
|
1482
|
-
};
|
|
1430
|
+
export { rrweb_EventType as EventType, rrweb_IncrementalSource as IncrementalSource, type rrweb_LogData as LogData, type rrweb_LogLevel as LogLevel, type rrweb_Logger as Logger, rrweb_MouseInteractions as MouseInteractions, rrweb_PLUGIN_NAME as PLUGIN_NAME, rrweb_Replayer as Replayer, rrweb_ReplayerEvents as ReplayerEvents, type rrweb_StringifyOptions as StringifyOptions, rrweb_addCustomEvent as addCustomEvent, rrweb_freezePage as freezePage, rrweb_getRecordConsolePlugin as getRecordConsolePlugin, rrweb_getReplayConsolePlugin as getReplayConsolePlugin, _mirror as mirror, rrweb_pack as pack, rrweb_record as record, type rrweb_recordOptions as recordOptions, rrweb_unpack as unpack, utils_d as utils };
|
|
1483
1431
|
}
|
|
1484
1432
|
|
|
1485
1433
|
interface XhrResponse {
|
|
@@ -1608,7 +1556,7 @@ declare class UpChunk {
|
|
|
1608
1556
|
*/
|
|
1609
1557
|
private sendChunks;
|
|
1610
1558
|
}
|
|
1611
|
-
declare
|
|
1559
|
+
declare function createUpload$1(options: UpChunkOptions): UpChunk;
|
|
1612
1560
|
|
|
1613
1561
|
type _mux_upchunk_ChunkedStreamIterable = ChunkedStreamIterable;
|
|
1614
1562
|
declare const _mux_upchunk_ChunkedStreamIterable: typeof ChunkedStreamIterable;
|
|
@@ -1619,15 +1567,7 @@ type _mux_upchunk_UpChunkOptions = UpChunkOptions;
|
|
|
1619
1567
|
declare const _mux_upchunk_getChunkSizeError: typeof getChunkSizeError;
|
|
1620
1568
|
declare const _mux_upchunk_isValidChunkSize: typeof isValidChunkSize;
|
|
1621
1569
|
declare namespace _mux_upchunk {
|
|
1622
|
-
export {
|
|
1623
|
-
_mux_upchunk_ChunkedStreamIterable as ChunkedStreamIterable,
|
|
1624
|
-
_mux_upchunk_ChunkedStreamIterableOptions as ChunkedStreamIterableOptions,
|
|
1625
|
-
_mux_upchunk_UpChunk as UpChunk,
|
|
1626
|
-
_mux_upchunk_UpChunkOptions as UpChunkOptions,
|
|
1627
|
-
createUpload$1 as createUpload,
|
|
1628
|
-
_mux_upchunk_getChunkSizeError as getChunkSizeError,
|
|
1629
|
-
_mux_upchunk_isValidChunkSize as isValidChunkSize,
|
|
1630
|
-
};
|
|
1570
|
+
export { _mux_upchunk_ChunkedStreamIterable as ChunkedStreamIterable, type _mux_upchunk_ChunkedStreamIterableOptions as ChunkedStreamIterableOptions, _mux_upchunk_UpChunk as UpChunk, type _mux_upchunk_UpChunkOptions as UpChunkOptions, createUpload$1 as createUpload, _mux_upchunk_getChunkSizeError as getChunkSizeError, _mux_upchunk_isValidChunkSize as isValidChunkSize };
|
|
1631
1571
|
}
|
|
1632
1572
|
|
|
1633
1573
|
declare enum NOTIFICATION_TYPES {
|
|
@@ -1876,73 +1816,6 @@ declare class Emitter<Events extends EventMap> {
|
|
|
1876
1816
|
rawListeners<EventName extends keyof Events>(eventName: EventName): Array<Listener<Events[EventName]>>;
|
|
1877
1817
|
}
|
|
1878
1818
|
|
|
1879
|
-
declare enum DismissReason {
|
|
1880
|
-
Closed = "close.click",
|
|
1881
|
-
Complete = "survey.completed",
|
|
1882
|
-
PageChange = "page.change",
|
|
1883
|
-
API = "api",
|
|
1884
|
-
Override = "override"
|
|
1885
|
-
}
|
|
1886
|
-
declare enum SprigEvent {
|
|
1887
|
-
ReplayCapture = "replay.capture",
|
|
1888
|
-
SDKReady = "sdk.ready",
|
|
1889
|
-
SurveyAppeared = "survey.appeared",
|
|
1890
|
-
SurveyClosed = "survey.closed",
|
|
1891
|
-
SurveyDimensions = "survey.dimensions",
|
|
1892
|
-
SurveyFadingOut = "survey.fadingOut",
|
|
1893
|
-
SurveyHeight = "survey.height",
|
|
1894
|
-
SurveyPresented = "survey.presented",
|
|
1895
|
-
SurveyLifeCycle = "survey.lifeCycle",
|
|
1896
|
-
SurveyWillClose = "survey.willClose",
|
|
1897
|
-
SurveyWillPresent = "survey.will.present",
|
|
1898
|
-
CloseSurveyOnOverlayClick = "close.survey.overlayClick",
|
|
1899
|
-
VisitorIDUpdated = "visitor.id.updated",
|
|
1900
|
-
QuestionAnswered = "question.answered"
|
|
1901
|
-
}
|
|
1902
|
-
declare enum SprigEventData {
|
|
1903
|
-
SurveyId = "survey.id"
|
|
1904
|
-
}
|
|
1905
|
-
declare const EVENTS: {
|
|
1906
|
-
SDK_READY: SprigEvent;
|
|
1907
|
-
SURVEY_APPEARED: SprigEvent;
|
|
1908
|
-
SURVEY_CLOSED: SprigEvent;
|
|
1909
|
-
SURVEY_DIMENSIONS: SprigEvent;
|
|
1910
|
-
SURVEY_FADING_OUT: SprigEvent;
|
|
1911
|
-
SURVEY_HEIGHT: SprigEvent;
|
|
1912
|
-
SURVEY_PRESENTED: SprigEvent;
|
|
1913
|
-
SURVEY_LIFE_CYCLE: SprigEvent;
|
|
1914
|
-
SURVEY_WILL_CLOSE: SprigEvent;
|
|
1915
|
-
SURVEY_WILL_PRESENT: SprigEvent;
|
|
1916
|
-
QUESTION_ANSWERED: SprigEvent;
|
|
1917
|
-
REPLAY_CAPTURE: SprigEvent;
|
|
1918
|
-
CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
|
|
1919
|
-
VISITOR_ID_UPDATED: SprigEvent;
|
|
1920
|
-
DATA: {
|
|
1921
|
-
DISMISS_REASONS: {
|
|
1922
|
-
API: DismissReason;
|
|
1923
|
-
CLOSED: DismissReason;
|
|
1924
|
-
COMPLETE: DismissReason;
|
|
1925
|
-
PAGE_CHANGE: DismissReason;
|
|
1926
|
-
OVERRIDE: DismissReason;
|
|
1927
|
-
};
|
|
1928
|
-
SURVEY_ID: SprigEventData;
|
|
1929
|
-
};
|
|
1930
|
-
};
|
|
1931
|
-
declare const enum InternalEventName {
|
|
1932
|
-
VerifyViewVersion = "verify.view.version",
|
|
1933
|
-
CurrentQuestion = "survey.question",
|
|
1934
|
-
ViewPrototypeClick = "question.prototype.click",
|
|
1935
|
-
ViewAgreementClick = "question.agreement.click",
|
|
1936
|
-
RecordedTaskStart = "recorded.task.start",
|
|
1937
|
-
RecordedTaskPermissionScreen = "recorded.task.permission.screen",
|
|
1938
|
-
SurveyComplete = "survey.complete"
|
|
1939
|
-
}
|
|
1940
|
-
declare const enum InternalEventData {
|
|
1941
|
-
ViewVersion = "view.version",
|
|
1942
|
-
QuestionId = "qid",
|
|
1943
|
-
Props = "props"
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
1819
|
declare const enum MediaType {
|
|
1947
1820
|
Video = "video",
|
|
1948
1821
|
Audio = "audio",
|
|
@@ -1985,34 +1858,6 @@ interface PassthroughData {
|
|
|
1985
1858
|
responseGroupUid: UUID;
|
|
1986
1859
|
}
|
|
1987
1860
|
|
|
1988
|
-
interface Experiment {
|
|
1989
|
-
id: string;
|
|
1990
|
-
variation?: string;
|
|
1991
|
-
}
|
|
1992
|
-
|
|
1993
|
-
type QueueItem = [string, ...unknown[]] | (() => void);
|
|
1994
|
-
declare class SprigQueue {
|
|
1995
|
-
paused: boolean;
|
|
1996
|
-
queue: QueueItem[];
|
|
1997
|
-
ul: WindowSprig;
|
|
1998
|
-
constructor(ul: WindowSprig, queue: QueueItem[]);
|
|
1999
|
-
flush(queue: QueueItem[]): void;
|
|
2000
|
-
isPaused(): boolean;
|
|
2001
|
-
pause(): void;
|
|
2002
|
-
unpause(): void;
|
|
2003
|
-
push(action: QueueItem): void;
|
|
2004
|
-
perform(func: () => void): void | Promise<unknown>;
|
|
2005
|
-
/**
|
|
2006
|
-
* Removes all queued items
|
|
2007
|
-
*/
|
|
2008
|
-
empty(): void;
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
declare enum SurveyState {
|
|
2012
|
-
Ready = "ready",
|
|
2013
|
-
NoSurvey = "no survey"
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
1861
|
interface RecordedTaskResponseValueType {
|
|
2017
1862
|
mediaRecordingUids?: string[] | null;
|
|
2018
1863
|
taskDurationMillisecond?: number;
|
|
@@ -2026,6 +1871,7 @@ declare enum BooleanOperator {
|
|
|
2026
1871
|
declare const enum CardType {
|
|
2027
1872
|
ConsentLegal = "consentlegal",
|
|
2028
1873
|
Likert = "likert",
|
|
1874
|
+
Matrix = "matrix",
|
|
2029
1875
|
MultipleChoice = "multiplechoice",
|
|
2030
1876
|
MultipleSelect = "multipleselect",
|
|
2031
1877
|
NPS = "nps",
|
|
@@ -2045,20 +1891,21 @@ interface BaseCard {
|
|
|
2045
1891
|
}
|
|
2046
1892
|
declare const enum Comparator {
|
|
2047
1893
|
Answered = "answered",
|
|
1894
|
+
Contains = "contains",
|
|
1895
|
+
DoesNotContain = "notcontains",
|
|
1896
|
+
DoesNotInclude = "list_dni",
|
|
2048
1897
|
Equal = "eq",
|
|
2049
|
-
NotEqual = "neq",
|
|
2050
|
-
Skipped = "skipped",
|
|
2051
|
-
LessThan = "lt",
|
|
2052
|
-
LessThanOrEqual = "lte",
|
|
2053
1898
|
GivenUp = "given_up",
|
|
2054
1899
|
GreaterThan = "gt",
|
|
2055
1900
|
GreaterThanOrEqual = "gte",
|
|
1901
|
+
LessThan = "lt",
|
|
1902
|
+
LessThanOrEqual = "lte",
|
|
2056
1903
|
ListAll = "list_all",
|
|
2057
1904
|
ListAtLeastOne = "list_alo",
|
|
2058
1905
|
ListExact = "list_exact",
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
1906
|
+
NotEqual = "neq",
|
|
1907
|
+
Partial = "partial",
|
|
1908
|
+
Skipped = "skipped"
|
|
2062
1909
|
}
|
|
2063
1910
|
type DefaultComparator = Comparator.Answered | Comparator.Skipped;
|
|
2064
1911
|
type RoutingOption<C extends Comparator = DefaultComparator> = OldRoutingOption<C> | GroupRoutingOption;
|
|
@@ -2281,6 +2128,25 @@ interface MultipleChoiceSingleSelectCard extends MultiChoiceCard<Comparator.Equa
|
|
|
2281
2128
|
interface MultipleChoiceMultiSelectCard extends MultiChoiceCard<Comparator.ListAll | Comparator.ListAtLeastOne | Comparator.ListExact | Comparator.DoesNotInclude> {
|
|
2282
2129
|
type: CardType.MultipleSelect;
|
|
2283
2130
|
}
|
|
2131
|
+
interface MatrixCard extends BaseCard {
|
|
2132
|
+
props: {
|
|
2133
|
+
options: MultipleChoiceOption[];
|
|
2134
|
+
message: string;
|
|
2135
|
+
routingOptions: RoutingOptions<Comparator.Skipped | Comparator.Partial | Comparator.Answered>;
|
|
2136
|
+
properties: {
|
|
2137
|
+
buttonText?: string;
|
|
2138
|
+
captionText: string;
|
|
2139
|
+
conceptUrl: ConceptUrl;
|
|
2140
|
+
matrixColumn: {
|
|
2141
|
+
label: string;
|
|
2142
|
+
value: string;
|
|
2143
|
+
}[];
|
|
2144
|
+
randomize: "none" | "all";
|
|
2145
|
+
required: boolean;
|
|
2146
|
+
};
|
|
2147
|
+
};
|
|
2148
|
+
type: CardType.Matrix;
|
|
2149
|
+
}
|
|
2284
2150
|
interface NPSCard extends BaseCard {
|
|
2285
2151
|
props: {
|
|
2286
2152
|
labels: {
|
|
@@ -2321,7 +2187,93 @@ interface VideoVoiceCard extends BaseCard {
|
|
|
2321
2187
|
};
|
|
2322
2188
|
type: CardType.VideoVoice;
|
|
2323
2189
|
}
|
|
2324
|
-
type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | VideoVoiceCard;
|
|
2190
|
+
type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MatrixCard | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | VideoVoiceCard;
|
|
2191
|
+
|
|
2192
|
+
type MatchType = "exactly" | "legacy";
|
|
2193
|
+
interface InteractiveEvent {
|
|
2194
|
+
id: number;
|
|
2195
|
+
matchType: MatchType;
|
|
2196
|
+
name: string;
|
|
2197
|
+
pattern: string;
|
|
2198
|
+
properties: {
|
|
2199
|
+
innerText: string;
|
|
2200
|
+
selector?: string;
|
|
2201
|
+
type?: "click";
|
|
2202
|
+
};
|
|
2203
|
+
}
|
|
2204
|
+
interface PageUrlEvent {
|
|
2205
|
+
id: number;
|
|
2206
|
+
matchType: MatchType | "contains" | "notContains" | "regex" | "startsWith";
|
|
2207
|
+
pattern: string;
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
declare enum DismissReason {
|
|
2211
|
+
Closed = "close.click",
|
|
2212
|
+
Complete = "survey.completed",
|
|
2213
|
+
PageChange = "page.change",
|
|
2214
|
+
API = "api",
|
|
2215
|
+
Override = "override"
|
|
2216
|
+
}
|
|
2217
|
+
declare enum SprigEvent {
|
|
2218
|
+
ReplayCapture = "replay.capture",
|
|
2219
|
+
SDKReady = "sdk.ready",
|
|
2220
|
+
SurveyAppeared = "survey.appeared",
|
|
2221
|
+
SurveyClosed = "survey.closed",
|
|
2222
|
+
SurveyDimensions = "survey.dimensions",
|
|
2223
|
+
SurveyFadingOut = "survey.fadingOut",
|
|
2224
|
+
SurveyHeight = "survey.height",
|
|
2225
|
+
SurveyPresented = "survey.presented",
|
|
2226
|
+
SurveyLifeCycle = "survey.lifeCycle",
|
|
2227
|
+
SurveyWidth = "survey.width",
|
|
2228
|
+
SurveyWillClose = "survey.willClose",
|
|
2229
|
+
SurveyWillPresent = "survey.will.present",
|
|
2230
|
+
CloseSurveyOnOverlayClick = "close.survey.overlayClick",
|
|
2231
|
+
VisitorIDUpdated = "visitor.id.updated",
|
|
2232
|
+
QuestionAnswered = "question.answered"
|
|
2233
|
+
}
|
|
2234
|
+
declare enum SprigEventData {
|
|
2235
|
+
SurveyId = "survey.id"
|
|
2236
|
+
}
|
|
2237
|
+
declare const EVENTS: {
|
|
2238
|
+
SDK_READY: SprigEvent;
|
|
2239
|
+
SURVEY_APPEARED: SprigEvent;
|
|
2240
|
+
SURVEY_CLOSED: SprigEvent;
|
|
2241
|
+
SURVEY_DIMENSIONS: SprigEvent;
|
|
2242
|
+
SURVEY_FADING_OUT: SprigEvent;
|
|
2243
|
+
SURVEY_HEIGHT: SprigEvent;
|
|
2244
|
+
SURVEY_PRESENTED: SprigEvent;
|
|
2245
|
+
SURVEY_LIFE_CYCLE: SprigEvent;
|
|
2246
|
+
SURVEY_WILL_CLOSE: SprigEvent;
|
|
2247
|
+
SURVEY_WILL_PRESENT: SprigEvent;
|
|
2248
|
+
QUESTION_ANSWERED: SprigEvent;
|
|
2249
|
+
REPLAY_CAPTURE: SprigEvent;
|
|
2250
|
+
CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
|
|
2251
|
+
VISITOR_ID_UPDATED: SprigEvent;
|
|
2252
|
+
DATA: {
|
|
2253
|
+
DISMISS_REASONS: {
|
|
2254
|
+
API: DismissReason;
|
|
2255
|
+
CLOSED: DismissReason;
|
|
2256
|
+
COMPLETE: DismissReason;
|
|
2257
|
+
PAGE_CHANGE: DismissReason;
|
|
2258
|
+
OVERRIDE: DismissReason;
|
|
2259
|
+
};
|
|
2260
|
+
SURVEY_ID: SprigEventData;
|
|
2261
|
+
};
|
|
2262
|
+
};
|
|
2263
|
+
declare const enum InternalEventName {
|
|
2264
|
+
VerifyViewVersion = "verify.view.version",
|
|
2265
|
+
CurrentQuestion = "survey.question",
|
|
2266
|
+
ViewPrototypeClick = "question.prototype.click",
|
|
2267
|
+
ViewAgreementClick = "question.agreement.click",
|
|
2268
|
+
RecordedTaskStart = "recorded.task.start",
|
|
2269
|
+
RecordedTaskPermissionScreen = "recorded.task.permission.screen",
|
|
2270
|
+
SurveyComplete = "survey.complete"
|
|
2271
|
+
}
|
|
2272
|
+
declare const enum InternalEventData {
|
|
2273
|
+
ViewVersion = "view.version",
|
|
2274
|
+
QuestionId = "qid",
|
|
2275
|
+
Props = "props"
|
|
2276
|
+
}
|
|
2325
2277
|
|
|
2326
2278
|
interface RecordedTaskResponseType {
|
|
2327
2279
|
questionId: number;
|
|
@@ -2329,6 +2281,40 @@ interface RecordedTaskResponseType {
|
|
|
2329
2281
|
value: RecordedTaskResponseValueType;
|
|
2330
2282
|
}
|
|
2331
2283
|
|
|
2284
|
+
declare enum ReplayDurationType {
|
|
2285
|
+
After = "after",
|
|
2286
|
+
Before = "before",
|
|
2287
|
+
BeforeAndAfter = "beforeAndAfter"
|
|
2288
|
+
}
|
|
2289
|
+
declare enum ReplayEventType {
|
|
2290
|
+
Click = "Sprig_Click",
|
|
2291
|
+
Event = "Sprig_TrackEvent",
|
|
2292
|
+
PageView = "Sprig_PageView",
|
|
2293
|
+
SurveyShown = "Sprig_ShowSurvey",
|
|
2294
|
+
SurveySubmitted = "Sprig_SubmitSurvey",
|
|
2295
|
+
Noop = "Sprig_Noop"
|
|
2296
|
+
}
|
|
2297
|
+
type EventDigest = {
|
|
2298
|
+
timestamp: number;
|
|
2299
|
+
type: ReplayEventType.Click;
|
|
2300
|
+
} | {
|
|
2301
|
+
timestamp: number;
|
|
2302
|
+
name: string;
|
|
2303
|
+
type: ReplayEventType.Event;
|
|
2304
|
+
} | {
|
|
2305
|
+
timestamp: number;
|
|
2306
|
+
type: ReplayEventType.PageView;
|
|
2307
|
+
url: string;
|
|
2308
|
+
} | {
|
|
2309
|
+
timestamp: number;
|
|
2310
|
+
surveyId: string;
|
|
2311
|
+
type: ReplayEventType.SurveyShown;
|
|
2312
|
+
} | {
|
|
2313
|
+
timestamp: number;
|
|
2314
|
+
surveyId: string;
|
|
2315
|
+
type: ReplayEventType.SurveySubmitted;
|
|
2316
|
+
};
|
|
2317
|
+
|
|
2332
2318
|
interface MobileReplayConfig {
|
|
2333
2319
|
maxMobileReplayDurationSeconds?: number;
|
|
2334
2320
|
mobileReplaySettings?: {
|
|
@@ -2354,7 +2340,12 @@ type SprigEventMap = {
|
|
|
2354
2340
|
];
|
|
2355
2341
|
[SprigEvent.CloseSurveyOnOverlayClick]: [];
|
|
2356
2342
|
[SprigEvent.SDKReady]: [MobileReplayConfig];
|
|
2357
|
-
[SprigEvent.SurveyAppeared]: [
|
|
2343
|
+
[SprigEvent.SurveyAppeared]: [
|
|
2344
|
+
{
|
|
2345
|
+
name: string;
|
|
2346
|
+
[SprigEventData.SurveyId]: number;
|
|
2347
|
+
}
|
|
2348
|
+
];
|
|
2358
2349
|
[SprigEvent.SurveyDimensions]: [
|
|
2359
2350
|
{
|
|
2360
2351
|
contentFrameHeight: number;
|
|
@@ -2375,12 +2366,19 @@ type SprigEventMap = {
|
|
|
2375
2366
|
contentFrameHeight: number;
|
|
2376
2367
|
}
|
|
2377
2368
|
];
|
|
2369
|
+
[SprigEvent.SurveyWidth]: [
|
|
2370
|
+
{
|
|
2371
|
+
name: string;
|
|
2372
|
+
contentFrameWidth: number;
|
|
2373
|
+
}
|
|
2374
|
+
];
|
|
2378
2375
|
[SprigEvent.SurveyLifeCycle]: [{
|
|
2379
2376
|
state: string;
|
|
2380
2377
|
}];
|
|
2381
2378
|
[SprigEvent.SurveyPresented]: [
|
|
2382
2379
|
{
|
|
2383
2380
|
name: string;
|
|
2381
|
+
[SprigEventData.SurveyId]: number;
|
|
2384
2382
|
}
|
|
2385
2383
|
];
|
|
2386
2384
|
[SprigEvent.SurveyWillClose]: [
|
|
@@ -2392,7 +2390,7 @@ type SprigEventMap = {
|
|
|
2392
2390
|
[SprigEvent.SurveyWillPresent]: [
|
|
2393
2391
|
{
|
|
2394
2392
|
name: string;
|
|
2395
|
-
|
|
2393
|
+
[SprigEventData.SurveyId]: number;
|
|
2396
2394
|
}
|
|
2397
2395
|
];
|
|
2398
2396
|
[SprigEvent.VisitorIDUpdated]: [{
|
|
@@ -2457,24 +2455,6 @@ type SprigEventMap = {
|
|
|
2457
2455
|
declare const eventEmitter: Emitter<SprigEventMap>;
|
|
2458
2456
|
type SprigEventEmitter = typeof eventEmitter;
|
|
2459
2457
|
|
|
2460
|
-
type MatchType = "exactly" | "legacy";
|
|
2461
|
-
interface InteractiveEvent {
|
|
2462
|
-
id: number;
|
|
2463
|
-
matchType: MatchType;
|
|
2464
|
-
name: string;
|
|
2465
|
-
pattern: string;
|
|
2466
|
-
properties: {
|
|
2467
|
-
innerText: string;
|
|
2468
|
-
selector?: string;
|
|
2469
|
-
type?: "click";
|
|
2470
|
-
};
|
|
2471
|
-
}
|
|
2472
|
-
interface PageUrlEvent {
|
|
2473
|
-
id: number;
|
|
2474
|
-
matchType: MatchType | "contains" | "notContains" | "regex" | "startsWith";
|
|
2475
|
-
pattern: string;
|
|
2476
|
-
}
|
|
2477
|
-
|
|
2478
2458
|
declare const enum FramePosition {
|
|
2479
2459
|
BottomLeft = "bottomLeft",
|
|
2480
2460
|
BottomRight = "bottomRight",
|
|
@@ -2547,6 +2527,7 @@ interface Config extends MobileReplayConfig {
|
|
|
2547
2527
|
frame: HTMLIFrameElement & {
|
|
2548
2528
|
eventEmitter?: SprigEventEmitter;
|
|
2549
2529
|
setHeight?: (height: number) => void;
|
|
2530
|
+
setWidth?: (width: number) => void;
|
|
2550
2531
|
};
|
|
2551
2532
|
framePosition: FramePosition;
|
|
2552
2533
|
headers: {
|
|
@@ -2563,7 +2544,7 @@ interface Config extends MobileReplayConfig {
|
|
|
2563
2544
|
/** @example "2.18.0" */
|
|
2564
2545
|
"x-ul-sdk-version": string;
|
|
2565
2546
|
/** For web-bundled sdk */
|
|
2566
|
-
"x-ul-
|
|
2547
|
+
"x-ul-package-version"?: string;
|
|
2567
2548
|
[HttpHeader.UserID]?: string;
|
|
2568
2549
|
[HttpHeader.VisitorID]?: UUID;
|
|
2569
2550
|
};
|
|
@@ -2616,39 +2597,33 @@ interface Config extends MobileReplayConfig {
|
|
|
2616
2597
|
};
|
|
2617
2598
|
}
|
|
2618
2599
|
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
BeforeAndAfter = "beforeAndAfter"
|
|
2600
|
+
interface Experiment {
|
|
2601
|
+
id: string;
|
|
2602
|
+
variation?: string;
|
|
2623
2603
|
}
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2604
|
+
|
|
2605
|
+
type QueueItem = [string, ...unknown[]] | (() => void);
|
|
2606
|
+
declare class SprigQueue {
|
|
2607
|
+
paused: boolean;
|
|
2608
|
+
queue: QueueItem[];
|
|
2609
|
+
ul: WindowSprig;
|
|
2610
|
+
constructor(ul: WindowSprig, queue: QueueItem[]);
|
|
2611
|
+
flush(queue: QueueItem[]): void;
|
|
2612
|
+
isPaused(): boolean;
|
|
2613
|
+
pause(): void;
|
|
2614
|
+
unpause(): void;
|
|
2615
|
+
push(action: QueueItem): void;
|
|
2616
|
+
perform(func: () => void): void | Promise<unknown>;
|
|
2617
|
+
/**
|
|
2618
|
+
* Removes all queued items
|
|
2619
|
+
*/
|
|
2620
|
+
empty(): void;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
declare enum SurveyState {
|
|
2624
|
+
Ready = "ready",
|
|
2625
|
+
NoSurvey = "no survey"
|
|
2631
2626
|
}
|
|
2632
|
-
type EventDigest = {
|
|
2633
|
-
timestamp: number;
|
|
2634
|
-
type: ReplayEventType.Click;
|
|
2635
|
-
} | {
|
|
2636
|
-
timestamp: number;
|
|
2637
|
-
name: string;
|
|
2638
|
-
type: ReplayEventType.Event;
|
|
2639
|
-
} | {
|
|
2640
|
-
timestamp: number;
|
|
2641
|
-
type: ReplayEventType.PageView;
|
|
2642
|
-
url: string;
|
|
2643
|
-
} | {
|
|
2644
|
-
timestamp: number;
|
|
2645
|
-
surveyId: string;
|
|
2646
|
-
type: ReplayEventType.SurveyShown;
|
|
2647
|
-
} | {
|
|
2648
|
-
timestamp: number;
|
|
2649
|
-
surveyId: string;
|
|
2650
|
-
type: ReplayEventType.SurveySubmitted;
|
|
2651
|
-
};
|
|
2652
2627
|
|
|
2653
2628
|
declare namespace optimizely {
|
|
2654
2629
|
interface Optimizely {
|
|
@@ -2745,7 +2720,7 @@ declare namespace sprigConfig {
|
|
|
2745
2720
|
importLaunchDarklyData: (data: Record<string, number | undefined>) => void;
|
|
2746
2721
|
integrateOptimizely: (
|
|
2747
2722
|
strData: string | { experiments: Experiment[] },
|
|
2748
|
-
isOverride?: boolean
|
|
2723
|
+
isOverride?: boolean,
|
|
2749
2724
|
) => void;
|
|
2750
2725
|
integrateOptimizelyClient: (client: Client) => void;
|
|
2751
2726
|
logoutUser: () => void;
|
|
@@ -2755,22 +2730,22 @@ declare namespace sprigConfig {
|
|
|
2755
2730
|
removeAttributes: (attributes: SprigAttributes) => IdentifyResult;
|
|
2756
2731
|
removeListener: (
|
|
2757
2732
|
event: SprigEvent,
|
|
2758
|
-
listener: SprigListener
|
|
2733
|
+
listener: SprigListener,
|
|
2759
2734
|
) => Promise<void>;
|
|
2760
2735
|
removeSurveyListener: (listener: SprigListener) => Promise<void>;
|
|
2761
2736
|
reviewSurvey: (surveyId: number) => void;
|
|
2762
2737
|
setAttribute: (attribute: string, value: string | number) => IdentifyResult;
|
|
2763
2738
|
setAttributes: (attributes?: SprigAttributes) => IdentifyResult;
|
|
2764
2739
|
setPartnerAnonymousId: (
|
|
2765
|
-
partnerAnonymousId: string
|
|
2740
|
+
partnerAnonymousId: string,
|
|
2766
2741
|
) => Promise<{ success: boolean; message?: string }>;
|
|
2767
2742
|
setVisitorAttribute: (
|
|
2768
2743
|
attribute: string,
|
|
2769
|
-
value: string | number
|
|
2744
|
+
value: string | number,
|
|
2770
2745
|
) => IdentifyResult;
|
|
2771
2746
|
setWindowDimensions: (
|
|
2772
2747
|
width: number | string,
|
|
2773
|
-
height: number | string
|
|
2748
|
+
height: number | string,
|
|
2774
2749
|
) => void;
|
|
2775
2750
|
setEmail: (email: string) => IdentifyResult;
|
|
2776
2751
|
setPreviewKey: (previewKey: string) => void;
|
|
@@ -2782,12 +2757,12 @@ declare namespace sprigConfig {
|
|
|
2782
2757
|
eventName: string,
|
|
2783
2758
|
properties?: TrackPayload["properties"],
|
|
2784
2759
|
metadata?: SprigMetadata,
|
|
2785
|
-
showSurveyCallback?: (surveyId?: number) => Promise<boolean
|
|
2760
|
+
showSurveyCallback?: (surveyId?: number) => Promise<boolean>,
|
|
2786
2761
|
) => IdentifyResult;
|
|
2787
2762
|
trackPageView: (
|
|
2788
2763
|
url: string,
|
|
2789
2764
|
properties?: SprigProperties,
|
|
2790
|
-
showSurveyCallback?: (surveyId?: number) => Promise<boolean
|
|
2765
|
+
showSurveyCallback?: (surveyId?: number) => Promise<boolean>,
|
|
2791
2766
|
) => void;
|
|
2792
2767
|
unmute: () => void;
|
|
2793
2768
|
}
|
|
@@ -2839,16 +2814,19 @@ type ArgumentType<T> = T extends (arg1: infer U, ...args: unknown[]) => unknown
|
|
|
2839
2814
|
? U
|
|
2840
2815
|
: unknown;
|
|
2841
2816
|
type PublicOf<T> = { [K in keyof T]: T[K] };
|
|
2842
|
-
type createUpload = typeof _mux_upchunk["createUpload"];
|
|
2843
|
-
type rrwebRecord = typeof rrweb["record"];
|
|
2844
|
-
type rrwebCustomEvent = typeof rrweb["record"]["addCustomEvent"];
|
|
2817
|
+
type createUpload = (typeof _mux_upchunk)["createUpload"];
|
|
2818
|
+
type rrwebRecord = (typeof rrweb)["record"];
|
|
2819
|
+
type rrwebCustomEvent = (typeof rrweb)["record"]["addCustomEvent"];
|
|
2845
2820
|
declare global {
|
|
2846
2821
|
interface Window {
|
|
2847
2822
|
__cfg: Config;
|
|
2848
2823
|
attachEvent?: typeof window.addEventListener;
|
|
2824
|
+
Backbone: {
|
|
2825
|
+
history: typeof window.history;
|
|
2826
|
+
};
|
|
2849
2827
|
Intercom: { ul_wasVisible?: boolean } & ((
|
|
2850
2828
|
method: string,
|
|
2851
|
-
data: unknown
|
|
2829
|
+
data: unknown,
|
|
2852
2830
|
) => void);
|
|
2853
2831
|
optimizely?: optimizely.Optimizely;
|
|
2854
2832
|
optimizelyDatafile?: object;
|
|
@@ -2866,7 +2844,7 @@ declare global {
|
|
|
2866
2844
|
...args: ArgumentTypes<rrwebCustomEvent>
|
|
2867
2845
|
) => PublicOf<ReturnType<rrwebCustomEvent>>;
|
|
2868
2846
|
} & ((
|
|
2869
|
-
arg: Omit<ArgumentType<rrwebRecord>, "hooks"
|
|
2847
|
+
arg: Omit<ArgumentType<rrwebRecord>, "hooks">,
|
|
2870
2848
|
) => PublicOf<ReturnType<rrwebRecord>>);
|
|
2871
2849
|
sprigAPI?: object;
|
|
2872
2850
|
}
|
|
@@ -2901,9 +2879,7 @@ declare class SprigAPI {
|
|
|
2901
2879
|
SURVEY_WILL_PRESENT: SprigEvent;
|
|
2902
2880
|
QUESTION_ANSWERED: SprigEvent;
|
|
2903
2881
|
REPLAY_CAPTURE: SprigEvent;
|
|
2904
|
-
CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
|
|
2905
|
-
* Attach a user id to the visitor
|
|
2906
|
-
*/
|
|
2882
|
+
CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
|
|
2907
2883
|
VISITOR_ID_UPDATED: SprigEvent;
|
|
2908
2884
|
DATA: {
|
|
2909
2885
|
DISMISS_REASONS: {
|
|
@@ -3026,4 +3002,4 @@ declare const sprig: {
|
|
|
3026
3002
|
};
|
|
3027
3003
|
type WindowSprig$1 = typeof window.Sprig;
|
|
3028
3004
|
|
|
3029
|
-
export { DismissReason, SprigAPI, SprigEvent, WindowSprig$1 as WindowSprig, sprig };
|
|
3005
|
+
export { DismissReason, SprigAPI, SprigEvent, type WindowSprig$1 as WindowSprig, sprig };
|