@sprig-technologies/sprig-browser 2.26.5 → 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-1NW718SB.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
@@ -1467,6 +1467,11 @@ declare class ChunkedStreamIterable implements AsyncIterable<Blob> {
1467
1467
  get chunkByteSize(): number;
1468
1468
  [Symbol.asyncIterator](): AsyncIterator<Blob>;
1469
1469
  }
1470
+ /**
1471
+ * Checks if an upload chunk was partially received (HTTP 308) and needs a retry.
1472
+ * Validates against the 'Range' header to ensure the full chunk was processed.
1473
+ */
1474
+ declare const isIncompleteChunkUploadNeedingRetry: (res: XhrResponse | undefined, _options?: any) => res is XhrResponse;
1470
1475
  declare type EventName = 'attempt' | 'attemptFailure' | 'chunkSuccess' | 'error' | 'offline' | 'online' | 'progress' | 'success';
1471
1476
  declare type AllowedMethods = 'PUT' | 'POST' | 'PATCH';
1472
1477
  interface UpChunkOptions {
@@ -1564,9 +1569,10 @@ type _mux_upchunk_UpChunk = UpChunk;
1564
1569
  declare const _mux_upchunk_UpChunk: typeof UpChunk;
1565
1570
  type _mux_upchunk_UpChunkOptions = UpChunkOptions;
1566
1571
  declare const _mux_upchunk_getChunkSizeError: typeof getChunkSizeError;
1572
+ declare const _mux_upchunk_isIncompleteChunkUploadNeedingRetry: typeof isIncompleteChunkUploadNeedingRetry;
1567
1573
  declare const _mux_upchunk_isValidChunkSize: typeof isValidChunkSize;
1568
1574
  declare namespace _mux_upchunk {
1569
- 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 };
1575
+ 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_isIncompleteChunkUploadNeedingRetry as isIncompleteChunkUploadNeedingRetry, _mux_upchunk_isValidChunkSize as isValidChunkSize };
1570
1576
  }
1571
1577
 
1572
1578
  declare enum NOTIFICATION_TYPES {
@@ -2081,6 +2087,7 @@ interface OpenTextCard extends BaseCard {
2081
2087
  buttonText?: string;
2082
2088
  captionText?: string;
2083
2089
  conceptUrl: ConceptUrl;
2090
+ footerHtml?: string;
2084
2091
  openTextPlaceholder?: string;
2085
2092
  required: boolean;
2086
2093
  richTextBody: RichTextBody;
@@ -2190,10 +2197,11 @@ interface VideoVoiceCard extends BaseCard {
2190
2197
  }
2191
2198
  type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MatrixCard | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | VideoVoiceCard;
2192
2199
 
2193
- type MatchType = "exactly" | "legacy";
2200
+ type InteractiveMatchType = "exactly" | "legacy";
2201
+ type PageUrlMatchType = "contains" | "exactly" | "legacy" | "notContains" | "regex" | "startsWith";
2194
2202
  interface InteractiveEvent {
2195
2203
  id: number;
2196
- matchType: MatchType;
2204
+ matchType: InteractiveMatchType;
2197
2205
  name: string;
2198
2206
  pattern: string;
2199
2207
  properties: {
@@ -2204,17 +2212,22 @@ interface InteractiveEvent {
2204
2212
  }
2205
2213
  interface PageUrlEvent {
2206
2214
  id: number;
2207
- matchType: MatchType | "contains" | "notContains" | "regex" | "startsWith";
2215
+ matchType: PageUrlMatchType;
2208
2216
  pattern: string;
2209
2217
  }
2210
2218
 
2211
2219
  declare enum DismissReason {
2212
2220
  Closed = "close.click",
2213
2221
  Complete = "survey.completed",
2222
+ FeedbackClosed = "feedback.closed",
2214
2223
  PageChange = "page.change",
2215
2224
  API = "api",
2216
2225
  Override = "override"
2217
2226
  }
2227
+ declare enum StudyType {
2228
+ Feedback = "feedbackButton",
2229
+ IPS = "inProductSurvey"
2230
+ }
2218
2231
  declare enum SprigEvent {
2219
2232
  ReplayCapture = "replay.capture",
2220
2233
  SDKReady = "sdk.ready",
@@ -2277,10 +2290,14 @@ declare const enum InternalEventData {
2277
2290
  Props = "props"
2278
2291
  }
2279
2292
 
2280
- interface RecordedTaskResponseType {
2281
- questionId: number;
2282
- type: CardType;
2283
- 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;
2284
2301
  }
2285
2302
 
2286
2303
  declare enum ReplayDurationType {
@@ -2317,7 +2334,16 @@ type EventDigest = {
2317
2334
  type: ReplayEventType.SurveySubmitted;
2318
2335
  };
2319
2336
 
2337
+ interface RecordedTaskResponseType {
2338
+ questionId: number;
2339
+ type: CardType;
2340
+ value: RecordedTaskResponseValueType;
2341
+ }
2342
+
2320
2343
  interface MobileReplayConfig {
2344
+ mobileMetricsReportingEnabled?: boolean;
2345
+ metricsReportingInterval?: number;
2346
+ metricsThresholds?: MetricThreshold[];
2321
2347
  maxMobileReplayDurationSeconds?: number;
2322
2348
  mobileReplaySettings?: {
2323
2349
  hideAllFormContents: boolean;
@@ -2359,6 +2385,7 @@ type SprigEventMap = {
2359
2385
  {
2360
2386
  initiator?: string;
2361
2387
  name: string;
2388
+ studyType?: StudyType;
2362
2389
  }
2363
2390
  ];
2364
2391
  [SprigEvent.SurveyFadingOut]: [];
@@ -2387,6 +2414,7 @@ type SprigEventMap = {
2387
2414
  {
2388
2415
  initiator: DismissReason;
2389
2416
  name?: string;
2417
+ studyType?: StudyType;
2390
2418
  }
2391
2419
  ];
2392
2420
  [SprigEvent.SurveyWillPresent]: [
@@ -2501,6 +2529,21 @@ interface Answer {
2501
2529
  questionId: number;
2502
2530
  value: unknown;
2503
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
+ }
2504
2547
  interface Config extends MobileReplayConfig {
2505
2548
  allResponses: unknown[];
2506
2549
  answers?: Answer[];
@@ -2561,6 +2604,7 @@ interface Config extends MobileReplayConfig {
2561
2604
  installationMethod?: InstallationMethod;
2562
2605
  interactiveEvents: InteractiveEvent[];
2563
2606
  interactiveEventsHandler?: (e: MouseEvent) => void;
2607
+ isOnQuestionsTab?: boolean;
2564
2608
  isPreview?: boolean;
2565
2609
  launchDarklyEnabled?: boolean;
2566
2610
  locale: string;
@@ -2584,6 +2628,7 @@ interface Config extends MobileReplayConfig {
2584
2628
  platform?: Platform;
2585
2629
  previewKey?: string | null;
2586
2630
  previewLanguage?: string;
2631
+ productConfig?: AppProductConfig;
2587
2632
  replayNonce?: string;
2588
2633
  replaySettings?: object;
2589
2634
  requireUserIdForTracking: boolean;
@@ -2593,6 +2638,7 @@ interface Config extends MobileReplayConfig {
2593
2638
  slugName: null;
2594
2639
  startingQuestionIdx?: number | null;
2595
2640
  styleNonce?: string;
2641
+ studyType?: StudyType;
2596
2642
  surveyId: number;
2597
2643
  tabTitle: string;
2598
2644
  ulEvents: typeof SprigEvent;
@@ -2716,6 +2762,7 @@ declare namespace sprigConfig {
2716
2762
  }) => Promise<string | null>;
2717
2763
  _previewSurvey: (surveyTemplateId: UUID) => void;
2718
2764
  _reviewSurvey: (surveyId: number) => void;
2765
+ _reportMetric: (name: string, value: number) => void;
2719
2766
 
2720
2767
  // external apis
2721
2768
  addListener: (event: SprigEvent, listener: SprigListener) => Promise<void>;
@@ -2841,7 +2888,7 @@ declare global {
2841
2888
  };
2842
2889
  Intercom: { ul_wasVisible?: boolean } & ((
2843
2890
  method: string,
2844
- data: unknown,
2891
+ data?: unknown,
2845
2892
  ) => void);
2846
2893
  optimizely?: optimizely.Optimizely;
2847
2894
  optimizelyDatafile?: object;
@@ -2891,7 +2938,9 @@ declare class SprigAPI {
2891
2938
  SURVEY_WIDTH: SprigEvent;
2892
2939
  SURVEY_PRESENTED: SprigEvent;
2893
2940
  SURVEY_LIFE_CYCLE: SprigEvent;
2894
- SURVEY_WILL_CLOSE: SprigEvent;
2941
+ SURVEY_WILL_CLOSE: SprigEvent; /**
2942
+ * Attach a user id to the visitor
2943
+ */
2895
2944
  SURVEY_WILL_PRESENT: SprigEvent;
2896
2945
  QUESTION_ANSWERED: SprigEvent;
2897
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-IMQ1RWe8.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,