@sprig-technologies/sprig-browser 2.14.3 → 2.14.4

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.
@@ -0,0 +1,9 @@
1
+ export function createContainer(): void;
2
+ export function removeContainer(initiator: any): void;
3
+ export function removeContainerOnClose(): void;
4
+ /**
5
+ * Create iframe
6
+ * @return {Object}
7
+ */
8
+ export function createFrame(productConfig: any, useMobileStyling: any): any;
9
+ //# sourceMappingURL=iframe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iframe.d.ts","sourceRoot":"","sources":["../../../sprig-browser/controller/iframe.js"],"names":[],"mappings":"AA0BA,wCAKC;AACD,sDAYC;AAED,+CAIC;AAED;;;GAGG;AACH,4EA+HC"}
@@ -0,0 +1,18 @@
1
+ export const UserLeapQueue: {
2
+ new (ul: any, queue: any): {
3
+ ul: any;
4
+ paused: boolean;
5
+ queue: any[];
6
+ flush(queue: any): void;
7
+ isPaused(): boolean;
8
+ pause(): void;
9
+ unpause(): void;
10
+ push(action: any): void;
11
+ perform(func: any): any;
12
+ /**
13
+ * Removes all queued items
14
+ */
15
+ empty(): void;
16
+ };
17
+ };
18
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../sprig-browser/controller/queue.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;QA6EE;;WAEG;;;EAIH"}
package/index.d.ts ADDED
@@ -0,0 +1,127 @@
1
+ declare namespace _default {
2
+ function configure(config: any): SprigAPI;
3
+ }
4
+ export default _default;
5
+ declare class SprigAPI {
6
+ /**
7
+ * Triggers displaying specified survey. Does submit answers!
8
+ * @param {Number} surveyId
9
+ * @returns
10
+ */
11
+ displaySurvey(surveyId: number): void;
12
+ /**
13
+ * Triggers displaying specified survey template. Does not submit answers
14
+ * @param {String} surveyTemplateId
15
+ */
16
+ previewSurvey(surveyTemplateId: string): void;
17
+ /**
18
+ * Triggers displaying specified survey. Does not submit answers
19
+ * @param {Number} surveyId
20
+ */
21
+ reviewSurvey(surveyId: number): void;
22
+ /**
23
+ * pauses api interactions
24
+ */
25
+ mute(): void;
26
+ /**
27
+ * restart api interactions
28
+ */
29
+ unmute(): void;
30
+ /**
31
+ * Manually dismiss an opened survey
32
+ */
33
+ dismissActiveSurvey(): void;
34
+ /**
35
+ * Set an arbitrary attribute on the visitor
36
+ * @param {String} attribute
37
+ * @param {String} value
38
+ */
39
+ setAttribute(attribute: string, value: string): void;
40
+ /**
41
+ * Set attributes on visitor
42
+ * @param {Object} attributes
43
+ */
44
+ setAttributes(attributes: any): void;
45
+ /**
46
+ * Set identifiers and attributes on visitor
47
+ * @param {Object} payload
48
+ * @param {Object} payload.attributes visitor attributes to set
49
+ * @param {String} payload.userId userId (optional)
50
+ * @param {String} payload.anonymousId anonymousId (optional)
51
+ */
52
+ identifyAndSetAttributes(payload: {
53
+ attributes: any;
54
+ userId: string;
55
+ anonymousId: string;
56
+ }): void;
57
+ /**
58
+ * Remove attributes on visitor
59
+ * @param {Object} attributes
60
+ */
61
+ removeAttributes(attributes: any): void;
62
+ /**
63
+ * Add a listener for an event defined in ulEvents
64
+ * @param {String} event
65
+ * @param {Function} listener
66
+ */
67
+ addListener(event: string, listener: Function): void;
68
+ /**
69
+ * Remove a listener for an event defined in ulEvents
70
+ * @param {String} event
71
+ * @param {Function} listener
72
+ */
73
+ removeListener(event: string, listener: Function): void;
74
+ /**
75
+ * Remove all listeners set on Sprig
76
+ */
77
+ removeAllListeners(): void;
78
+ /**
79
+ * Attach an email address to visitor
80
+ */
81
+ setEmail(email: any): void;
82
+ /**
83
+ * Attach a user id to the visitor
84
+ */
85
+ setUserId(userId: any): void;
86
+ /**
87
+ * Set a partner anonymous id for future requests.
88
+ */
89
+ setPartnerAnonymousId(partnerAnonymousId: any): void;
90
+ /**
91
+ * track an event to show survey if eligible
92
+ * @param {String} eventName
93
+ * @param {Object} metadata
94
+ * @returns
95
+ */
96
+ track(eventName: string, metadata?: any): void;
97
+ /**
98
+ * optionally set userId and/or anonymousId, track an event to show survey if eligible
99
+ * @param {Object} payload
100
+ * @param {String} payload.eventName name of event to track
101
+ * @param {Object} payload.metadata event metadata (optional)
102
+ * @param {String} payload.userId userId (optional)
103
+ * @param {String} payload.anonymousId anonymousId (optional)
104
+ * @returns
105
+ */
106
+ identifyAndTrack(payload: {
107
+ eventName: string;
108
+ metadata: any;
109
+ userId: string;
110
+ anonymousId: string;
111
+ }): void;
112
+ /**
113
+ * @param {String} styleString css string representing the customized styles
114
+ */
115
+ applyStyles(styleString: string): void;
116
+ /**
117
+ set viewport dimensions, in int pixels. necessary if Sprig is installed in an iframe/component defaulting to 0 width and height.
118
+ * @param {Number} width
119
+ * @param {Number} height
120
+ */
121
+ setWindowDimensions(width: number, height: number): void;
122
+ /**
123
+ * clears Sprig from window
124
+ */
125
+ teardown(): void;
126
+ }
127
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../sprig-browser/index.js"],"names":[],"mappings":";IA2La,0CAmBV;;;AAzMH;IACE;;;;OAIG;IACH,sCAEC;IAED;;;OAGG;IACH,8CAEC;IAED;;;OAGG;IACH,qCAEC;IAED;;OAEG;IACH,aAEC;IAED;;OAEG;IACH,eAEC;IAED;;OAEG;IACH,4BAEC;IAED;;;;OAIG;IACH,qDAEC;IAED;;;OAGG;IACH,qCAEC;IAED;;;;;;OAMG;IACH;QAJ2B,UAAU;QACV,MAAM;QACN,WAAW;aAIrC;IAED;;;OAGG;IACH,wCAEC;IAED;;;;OAIG;IACH,qDAEC;IAED;;;;OAIG;IACH,wDAEC;IAED;;OAEG;IACH,2BAEC;IAED;;OAEG;IACH,2BAEC;IAED;;OAEG;IACH,6BAEC;IAED;;OAEG;IACH,qDAEC;IAED;;;;;OAKG;IACH,+CAEC;IAED;;;;;;;;OAQG;IACH;QAN2B,SAAS;QACV,QAAQ;QACP,MAAM;QACN,WAAW;aAKrC;IAED;;OAEG;IACH,uCAEC;IAED;;;;MAIE;IACF,yDAEC;IAED;;OAEG;IACH,iBAEC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprig-technologies/sprig-browser",
3
- "version": "2.14.3",
3
+ "version": "2.14.4",
4
4
  "description": "npm package for the sprig web sdk",
5
5
  "browser": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,5 @@
1
+ export default class ConflictingWidgets {
2
+ static disable(): void;
3
+ static enable(): void;
4
+ }
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../sprig-browser/shared/conflicting_widgets/index.js"],"names":[],"mappings":"AAIA;IACE,uBAEC;IAED,sBAEC;CACF"}
@@ -0,0 +1,3 @@
1
+ export function enable(): void;
2
+ export function disable(): void;
3
+ //# sourceMappingURL=intercom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intercom.d.ts","sourceRoot":"","sources":["../../../../sprig-browser/shared/conflicting_widgets/intercom.js"],"names":[],"mappings":"AAOO,+BASN;AAEM,gCASN"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Various modes that the app can be in. For now test is the
3
+ * only one that matters
4
+ * @type {Object}
5
+ */
6
+ export const APP_MODES: any;
7
+ export const PAGE_URL_EVENT_NAME: "pageUrl";
8
+ export namespace HEADERS {
9
+ const ENVIRONMENT_ID: string;
10
+ const PARTNER_ANONYMOUS_ID: string;
11
+ const USER_ID: string;
12
+ const VISITOR_ID: string;
13
+ const INSTALLATION_METHOD: string;
14
+ }
15
+ export namespace INSTALLATION_METHOD {
16
+ const NPM: string;
17
+ const GTM: string;
18
+ const SEGMENT: string;
19
+ const SNIPPET: string;
20
+ }
21
+ export namespace CSS_CONSTANTS {
22
+ const CUSTOM_STYLE_TAG_ID: string;
23
+ const CARD_CONTAINER_CLASS: string;
24
+ const VIDEO_CARD_CLASS: string;
25
+ const CLOSE_CONTAINER_CLASS: string;
26
+ const CLOSE_BUTTON_CLASS: string;
27
+ const LIKERT_NUMBER_CLASS: string;
28
+ const NPS_NUMBER_CLASS: string;
29
+ const CHOICE_CLASS: string;
30
+ const CHOICE_LABEL_CLASS: string;
31
+ const CHOICE_CHECKBOX_CLASS: string;
32
+ const CHOICE_RADIO_CLASS: string;
33
+ const CHOICE_GROUP_CLASS: string;
34
+ const OPEN_TEXT_INPUT: string;
35
+ const DESKTOP_SUFFIX: string;
36
+ const MOBILE_SUFFIX: string;
37
+ const QUESTION_HEADER_CLASS: string;
38
+ const CAPTION_CLASS: string;
39
+ const FADE_IN_CLASS: string;
40
+ }
41
+ export namespace EXPERIMENT_FLAGS {
42
+ const SURVEY_MOBILE_STYLING: string;
43
+ }
44
+ export const MOBILE_MAX_WIDTH: 500;
45
+ export function getClasses(baseClass: any, useMobileStyling: any): any[];
46
+ export const MOBILE_PLATFORM_HEADERS: string[];
47
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../sprig-browser/shared/constants.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,4BAEE;AAEF,4CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0C7C,mCAAoC;AAE7B,yEAIN;AAED,+CAA0D"}
@@ -0,0 +1,10 @@
1
+ export default Deferred;
2
+ declare class Deferred {
3
+ constructor(payload: any);
4
+ promise: Promise<any>;
5
+ payload: any;
6
+ reject: (reason?: any) => void;
7
+ resolve: (value: any) => void;
8
+ resolveRequest(result: any): void;
9
+ }
10
+ //# sourceMappingURL=deferred.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deferred.d.ts","sourceRoot":"","sources":["../../../sprig-browser/shared/deferred.js"],"names":[],"mappings":";AAAA;IACE,0BAMC;IALC,sBAIE;IAHA,aAAsB;IACtB,+BAAoB;IACpB,8BAAsB;IAI1B,kCAEC;CACF"}
@@ -0,0 +1,10 @@
1
+ export default instance;
2
+ declare const instance: ULEventEmitter;
3
+ declare class ULEventEmitter {
4
+ _events: {};
5
+ subscribe(name: any, listener: any): void;
6
+ removeListener(name: any, listenerToRemove: any): void;
7
+ removeAllListeners(): void;
8
+ emit(name: any, data: any): void;
9
+ }
10
+ //# sourceMappingURL=eventEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventEmitter.d.ts","sourceRoot":"","sources":["../../../sprig-browser/shared/eventEmitter.js"],"names":[],"mappings":";AAgDA,uCAAsC;AA7CtC;IAGM,YAAiB;IAOrB,0CAIC;IAED,uDAQC;IACD,2BAIC;IAED,iCAWC;CACF"}
@@ -0,0 +1,8 @@
1
+ export function killNetworkRequests(reason: any): void;
2
+ export function getHttpHeaders(Sprig?: {}): {
3
+ 'Content-Type': string;
4
+ 'userleap-platform': string;
5
+ 'x-ul-sdk-version': string;
6
+ };
7
+ export function ulFetch(url: any, options: any, attempt?: number, shouldDropOnRateLimit?: boolean, shouldRetryRequest?: boolean): any;
8
+ //# sourceMappingURL=network.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../sprig-browser/shared/network.js"],"names":[],"mappings":"AAkBA,uDAGC;AAED;;;;EAmBC;AAYD,sIA2EC"}
package/shared/network.js CHANGED
@@ -25,7 +25,7 @@ export function getHttpHeaders(Sprig = {}) {
25
25
  const headers = {
26
26
  'Content-Type': 'application/json',
27
27
  'userleap-platform': 'web',
28
- 'x-ul-sdk-version': '2.14.3', //version here doesn't matter. it is string-replaced when compiled
28
+ 'x-ul-sdk-version': '2.14.4', //version here doesn't matter. it is string-replaced when compiled
29
29
  };
30
30
  if (Sprig.envId) headers[HEADERS.ENVIRONMENT_ID] = Sprig.envId;
31
31
  if (Sprig.token) headers['Authorization'] = 'Bearer ' + Sprig.token;
@@ -0,0 +1,5 @@
1
+ export function delay(t: any, v: any): Promise<any>;
2
+ export namespace NETWORK_CONFIG {
3
+ const RATELIMIT_RESET_DEFAULT: number;
4
+ }
5
+ //# sourceMappingURL=networkHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkHelper.d.ts","sourceRoot":"","sources":["../../../sprig-browser/shared/networkHelper.js"],"names":[],"mappings":"AAAA,oDAIC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Get true or false for whether to direct embed from platform headers
3
+ * @param {Object} [options = {}]
4
+ * @return {Object} User meta information
5
+ */
6
+ export default function shouldDirectEmbed({ "userleap-platform": platform }?: any): any;
7
+ //# sourceMappingURL=shouldDirectEmbed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shouldDirectEmbed.d.ts","sourceRoot":"","sources":["../../../sprig-browser/shared/shouldDirectEmbed.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wFAEC"}
@@ -0,0 +1,3 @@
1
+ export function overrideStyles(document: any, styleString: any): void;
2
+ export function calculateFrameHeight(document: any): any;
3
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../sprig-browser/shared/tool.js"],"names":[],"mappings":"AAIO,sEAMN;AAEM,yDAMN"}
@@ -0,0 +1,33 @@
1
+ export namespace ulEvents {
2
+ const SURVEY_LIFE_CYCLE: string;
3
+ const SURVEY_DIMENSIONS: string;
4
+ const SURVEY_HEIGHT: string;
5
+ const SURVEY_PRESENTED: string;
6
+ const SURVEY_APPEARED: string;
7
+ const SURVEY_FADING_OUT: string;
8
+ const SURVEY_WILL_CLOSE: string;
9
+ const SURVEY_CLOSED: string;
10
+ const SDK_READY: string;
11
+ const CLOSE_SURVEY_ON_OVERLAY_CLICK: string;
12
+ const VISITOR_ID_UPDATED: string;
13
+ }
14
+ export namespace internalEvents {
15
+ namespace name {
16
+ const VERIFY_VIEW_VERSION: string;
17
+ }
18
+ namespace data {
19
+ const VIEW_VERSION: string;
20
+ }
21
+ }
22
+ export namespace DISMISS_REASONS {
23
+ const CLOSED: string;
24
+ const COMPLETE: string;
25
+ const PAGE_CHANGE: string;
26
+ const API: string;
27
+ const OVERRIDE: string;
28
+ }
29
+ export namespace SURVEY_STATE {
30
+ const READY: string;
31
+ const NO_SURVEY: string;
32
+ }
33
+ //# sourceMappingURL=ulEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ulEvents.d.ts","sourceRoot":"","sources":["../../../sprig-browser/shared/ulEvents.js"],"names":[],"mappings":""}