@sprig-technologies/sprig-browser 2.26.6 → 2.27.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 CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-CqSba42x.cjs");exports.DismissReason=e.DismissReason;exports.SprigAPI=e.SprigAPI;exports.SprigEvent=e.SprigEvent;exports.default=e.index;exports.sprig=e.sprig;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-CbFaIXGg.cjs");exports.DismissReason=e.DismissReason;exports.SprigAPI=e.SprigAPI;exports.SprigEvent=e.SprigEvent;exports.default=e.index;exports.sprig=e.sprig;
package/dist/index.d.ts CHANGED
@@ -2087,6 +2087,7 @@ interface OpenTextCard extends BaseCard {
2087
2087
  buttonText?: string;
2088
2088
  captionText?: string;
2089
2089
  conceptUrl: ConceptUrl;
2090
+ footerHtml?: string;
2090
2091
  openTextPlaceholder?: string;
2091
2092
  required: boolean;
2092
2093
  richTextBody: RichTextBody;
@@ -2196,10 +2197,11 @@ interface VideoVoiceCard extends BaseCard {
2196
2197
  }
2197
2198
  type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MatrixCard | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | VideoVoiceCard;
2198
2199
 
2199
- type MatchType = "exactly" | "legacy";
2200
+ type InteractiveMatchType = "exactly" | "legacy";
2201
+ type PageUrlMatchType = "contains" | "exactly" | "legacy" | "notContains" | "regex" | "startsWith";
2200
2202
  interface InteractiveEvent {
2201
2203
  id: number;
2202
- matchType: MatchType;
2204
+ matchType: InteractiveMatchType;
2203
2205
  name: string;
2204
2206
  pattern: string;
2205
2207
  properties: {
@@ -2210,17 +2212,22 @@ interface InteractiveEvent {
2210
2212
  }
2211
2213
  interface PageUrlEvent {
2212
2214
  id: number;
2213
- matchType: MatchType | "contains" | "notContains" | "regex" | "startsWith";
2215
+ matchType: PageUrlMatchType;
2214
2216
  pattern: string;
2215
2217
  }
2216
2218
 
2217
2219
  declare enum DismissReason {
2218
2220
  Closed = "close.click",
2219
2221
  Complete = "survey.completed",
2222
+ FeedbackClosed = "feedback.closed",
2220
2223
  PageChange = "page.change",
2221
2224
  API = "api",
2222
2225
  Override = "override"
2223
2226
  }
2227
+ declare enum StudyType {
2228
+ Feedback = "feedbackButton",
2229
+ IPS = "inProductSurvey"
2230
+ }
2224
2231
  declare enum SprigEvent {
2225
2232
  ReplayCapture = "replay.capture",
2226
2233
  SDKReady = "sdk.ready",
@@ -2283,10 +2290,14 @@ declare const enum InternalEventData {
2283
2290
  Props = "props"
2284
2291
  }
2285
2292
 
2286
- interface RecordedTaskResponseType {
2287
- questionId: number;
2288
- type: CardType;
2289
- value: RecordedTaskResponseValueType;
2293
+ declare const enum ThresholdType {
2294
+ Max = "max",
2295
+ Min = "min"
2296
+ }
2297
+ interface MetricThreshold {
2298
+ metric: string;
2299
+ type: ThresholdType;
2300
+ value: number;
2290
2301
  }
2291
2302
 
2292
2303
  declare enum ReplayDurationType {
@@ -2323,7 +2334,16 @@ type EventDigest = {
2323
2334
  type: ReplayEventType.SurveySubmitted;
2324
2335
  };
2325
2336
 
2337
+ interface RecordedTaskResponseType {
2338
+ questionId: number;
2339
+ type: CardType;
2340
+ value: RecordedTaskResponseValueType;
2341
+ }
2342
+
2326
2343
  interface MobileReplayConfig {
2344
+ mobileMetricsReportingEnabled?: boolean;
2345
+ metricsReportingInterval?: number;
2346
+ metricsThresholds?: MetricThreshold[];
2327
2347
  maxMobileReplayDurationSeconds?: number;
2328
2348
  mobileReplaySettings?: {
2329
2349
  hideAllFormContents: boolean;
@@ -2365,6 +2385,7 @@ type SprigEventMap = {
2365
2385
  {
2366
2386
  initiator?: string;
2367
2387
  name: string;
2388
+ studyType?: StudyType;
2368
2389
  }
2369
2390
  ];
2370
2391
  [SprigEvent.SurveyFadingOut]: [];
@@ -2393,6 +2414,7 @@ type SprigEventMap = {
2393
2414
  {
2394
2415
  initiator: DismissReason;
2395
2416
  name?: string;
2417
+ studyType?: StudyType;
2396
2418
  }
2397
2419
  ];
2398
2420
  [SprigEvent.SurveyWillPresent]: [
@@ -2507,6 +2529,21 @@ interface Answer {
2507
2529
  questionId: number;
2508
2530
  value: unknown;
2509
2531
  }
2532
+ declare enum FeedbackPlacement {
2533
+ CenterLeft = "center-left",
2534
+ CenterRight = "center-right",
2535
+ BottomLeft = "bottom-left",
2536
+ BottomRight = "bottom-right"
2537
+ }
2538
+ declare enum FeedbackDesktopDisplay {
2539
+ CenterModal = "center-modal",
2540
+ Slider = "slider"
2541
+ }
2542
+ interface AppProductConfig {
2543
+ framePosition?: FramePosition;
2544
+ desktopDisplay?: FeedbackDesktopDisplay;
2545
+ placement?: FeedbackPlacement;
2546
+ }
2510
2547
  interface Config extends MobileReplayConfig {
2511
2548
  allResponses: unknown[];
2512
2549
  answers?: Answer[];
@@ -2567,6 +2604,7 @@ interface Config extends MobileReplayConfig {
2567
2604
  installationMethod?: InstallationMethod;
2568
2605
  interactiveEvents: InteractiveEvent[];
2569
2606
  interactiveEventsHandler?: (e: MouseEvent) => void;
2607
+ isOnQuestionsTab?: boolean;
2570
2608
  isPreview?: boolean;
2571
2609
  launchDarklyEnabled?: boolean;
2572
2610
  locale: string;
@@ -2590,6 +2628,7 @@ interface Config extends MobileReplayConfig {
2590
2628
  platform?: Platform;
2591
2629
  previewKey?: string | null;
2592
2630
  previewLanguage?: string;
2631
+ productConfig?: AppProductConfig;
2593
2632
  replayNonce?: string;
2594
2633
  replaySettings?: object;
2595
2634
  requireUserIdForTracking: boolean;
@@ -2599,6 +2638,7 @@ interface Config extends MobileReplayConfig {
2599
2638
  slugName: null;
2600
2639
  startingQuestionIdx?: number | null;
2601
2640
  styleNonce?: string;
2641
+ studyType?: StudyType;
2602
2642
  surveyId: number;
2603
2643
  tabTitle: string;
2604
2644
  ulEvents: typeof SprigEvent;
@@ -2722,6 +2762,7 @@ declare namespace sprigConfig {
2722
2762
  }) => Promise<string | null>;
2723
2763
  _previewSurvey: (surveyTemplateId: UUID) => void;
2724
2764
  _reviewSurvey: (surveyId: number) => void;
2765
+ _reportMetric: (name: string, value: number) => void;
2725
2766
 
2726
2767
  // external apis
2727
2768
  addListener: (event: SprigEvent, listener: SprigListener) => Promise<void>;
@@ -2897,7 +2938,9 @@ declare class SprigAPI {
2897
2938
  SURVEY_WIDTH: SprigEvent;
2898
2939
  SURVEY_PRESENTED: SprigEvent;
2899
2940
  SURVEY_LIFE_CYCLE: SprigEvent;
2900
- SURVEY_WILL_CLOSE: SprigEvent;
2941
+ SURVEY_WILL_CLOSE: SprigEvent; /**
2942
+ * Attach a user id to the visitor
2943
+ */
2901
2944
  SURVEY_WILL_PRESENT: SprigEvent;
2902
2945
  QUESTION_ANSWERED: SprigEvent;
2903
2946
  REPLAY_CAPTURE: SprigEvent;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as i, w as r, S as e, y as p, x as g } from "./index-Dc62vWMo.js";
1
+ import { D as i, x as r, S as e, z as p, y as g } from "./index-Co-eH2O1.js";
2
2
  export {
3
3
  i as DismissReason,
4
4
  r as SprigAPI,