@sprig-technologies/sprig-bundled 2.40.4 → 2.41.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.
@@ -6029,7 +6029,7 @@ const Tf = (e) => e._config && e._config.installationMethod ? e._config.installa
6029
6029
  ru = !0, nu = e;
6030
6030
  };
6031
6031
  function Te(e = {}) {
6032
- const t = { "Content-Type": "application/json", "userleap-platform": "web", "x-ul-sdk-version": "2.40.4", "x-ul-installation-method": Tf(e), "sprig-modules": Mf(), "x-ul-package-version": "2.40.4" };
6032
+ const t = { "Content-Type": "application/json", "userleap-platform": "web", "x-ul-sdk-version": "2.41.1", "x-ul-installation-method": Tf(e), "sprig-modules": Mf(), "x-ul-package-version": "2.41.1" };
6033
6033
  if (e.envId && (t["x-ul-environment-id"] = e.envId), e.token && (t.Authorization = "Bearer " + e.token), e.userId && (t["x-ul-user-id"] = e.userId), e.visitorId && (t["x-ul-visitor-id"] = e.visitorId), e.partnerAnonymousId && (t["x-ul-anonymous-id"] = e.partnerAnonymousId), e.mobileHeadersJSON) {
6034
6034
  const r = JSON.parse(e.mobileHeadersJSON);
6035
6035
  Object.assign(t, r);
@@ -6158,7 +6158,7 @@ const tr = async (e, t, r) => {
6158
6158
  window.UserLeap.container && Object.assign(window.UserLeap.container.style, { display: "flex" });
6159
6159
  };
6160
6160
  if (w.installationMethod === "web-npm" || w.installationMethod === "web-npm-bundled") {
6161
- const { default: V } = await import("./view-DBZAWIZk.js").then((ge) => ge.v);
6161
+ const { default: V } = await import("./view-CocVngjw.js").then((ge) => ge.z);
6162
6162
  V.configure(w), S && window.UserLeap.container && O();
6163
6163
  } else U && (j.src = `${U}${window.UserLeap.isMobileSDK ? "" : `?t=${Date.now()}`}`, S && j.addEventListener("load", () => {
6164
6164
  window.UserLeap.container && O();
@@ -6979,7 +6979,7 @@ function og(e = {}) {
6979
6979
  var m;
6980
6980
  await ze(Me("1", [ot], "metrics"), { body: I, method: "POST", headers: { "x-ul-replay-enabled": `${!!((m = re.replay) != null && m.isReplayRecording())}` }, shouldDropOnRateLimit: !0 });
6981
6981
  } }), !c) {
6982
- const I = u.alwaysOnReplay ? { userAgent: window.navigator.userAgent, surveyId: u.alwaysOnReplay.surveyId, responseGroupUuid: u.alwaysOnReplay.responseGroupUuid, sdkVersion: "2.40.4", maxDurationSeconds: u.alwaysOnReplay.maxDurationSeconds } : void 0;
6982
+ const I = u.alwaysOnReplay ? { userAgent: window.navigator.userAgent, surveyId: u.alwaysOnReplay.surveyId, responseGroupUuid: u.alwaysOnReplay.responseGroupUuid, sdkVersion: "2.41.1", maxDurationSeconds: u.alwaysOnReplay.maxDurationSeconds } : void 0;
6983
6983
  await ((v = re.replay) == null ? void 0 : v.initializeReplay({ maxReplayDurationSeconds: u.maxReplayDurationSeconds, maxInflightRequests: window.UserLeap.maxInflightReplayRequests ?? 2, replaySettings: u.replaySettings, apiUrl: window.UserLeap._API_URL, alwaysOnConfig: I })), so = u.replaySettings;
6984
6984
  }
6985
6985
  sg(u), await ng(u), window.UserLeap._queue.unpause(), (p = window.SprigLoggerCallback) == null || p.call(window, "SdkReady"), z.emit(B.SDKReady, { mobileMetricsReportingEnabled: !!u.mobileMetricsReportingEnabled, metricsReportingInterval: u.metricsReportingIntervalSeconds || 0, metricsThresholds: u.metricThresholds || [], maxMobileReplayDurationSeconds: u.maxMobileReplayDurationSeconds, mobileReplaySettings: u.mobileReplaySettings }), z.emit(B.VisitorIDUpdated, { visitorId: window.UserLeap.visitorId }), z.on(B.VisitorIDUpdated, () => {
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-m2P75rlk.cjs");exports.DismissReason=e.DismissReason,exports.SprigAPI=e.SprigAPI,exports.SprigEvent=e.SprigEvent,exports.sprig=e.sprig;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D2QLhKHZ.cjs");exports.DismissReason=e.DismissReason,exports.SprigAPI=e.SprigAPI,exports.SprigEvent=e.SprigEvent,exports.sprig=e.sprig;
package/dist/index.d.ts CHANGED
@@ -1012,18 +1012,56 @@ interface PassthroughData {
1012
1012
  type MultiChoiceSecondaryValueType = Record<string, {
1013
1013
  userText: string;
1014
1014
  }> | null;
1015
+ declare const enum MaxDiffChoice {
1016
+ RIGHT = "right",
1017
+ LEFT = "left"
1018
+ }
1019
+ type MaxDiffValueType = {
1020
+ id: number;
1021
+ option: string;
1022
+ selected: MaxDiffChoice | null;
1023
+ };
1024
+ type MaxDiffResponseType = Array<Array<MaxDiffValueType>>;
1015
1025
  interface RecordedTaskResponseValueType {
1016
1026
  mediaRecordingUids?: string[] | null;
1017
1027
  taskDurationMillisecond?: number;
1018
1028
  taskStatus: TaskStatus;
1019
1029
  }
1030
+ type TextUrlPromptResponse = undefined | {
1031
+ skipped?: true;
1032
+ };
1033
+ type ConsentLegalResponse = {
1034
+ submitted: true;
1035
+ } | null;
1036
+ type RecordedTaskResponse = {
1037
+ mediaRecordingUids: string[];
1038
+ taskDurationMillisecond: number;
1039
+ taskStatus: TaskStatus;
1040
+ };
1041
+ type LikertResponse = number | null;
1042
+ type OpenTextResponse = string;
1043
+ type AiDynamicFollowUpResponse = string;
1044
+ type MultiChoiceresponse = string | undefined;
1045
+ type MultiSelectResponse = string[];
1046
+ type MatrixResponse = {
1047
+ [rowId: number]: string | null;
1048
+ };
1049
+ type NpsResponse = number | null;
1050
+ type RankOrderResponse = {
1051
+ [optionId: string]: number | null;
1052
+ };
1053
+ type VideoVoiceResponse = {
1054
+ mediaRecordingUid: string;
1055
+ };
1056
+ type CardResponse = TextUrlPromptResponse | ConsentLegalResponse | RecordedTaskResponse | LikertResponse | OpenTextResponse | AiDynamicFollowUpResponse | MultiChoiceresponse | MultiSelectResponse | MatrixResponse | NpsResponse | RankOrderResponse | MaxDiffResponseType | VideoVoiceResponse;
1057
+
1020
1058
  declare const BOOLEAN_OPERATOR: {
1021
1059
  readonly And: 1;
1022
1060
  readonly Or: 2;
1023
1061
  };
1024
1062
  type BooleanOperator = (typeof BOOLEAN_OPERATOR)[keyof typeof BOOLEAN_OPERATOR];
1025
1063
 
1026
- type CardType = "consentlegal" | "likert" | "matrix" | "maxdiff" | "multiplechoice" | "multipleselect" | "nps" | "open" | "rankorder" | "recordedtask" | "texturlprompt" | "thanks" | "uploading" | "videovoice";
1064
+ type CardType = "aidynamicfollowup" | "consentlegal" | "likert" | "matrix" | "maxdiff" | "multiplechoice" | "multipleselect" | "nps" | "open" | "rankorder" | "recordedtask" | "texturlprompt" | "thanks" | "uploading" | "videovoice";
1027
1065
  type ConceptUrl = string | null;
1028
1066
  type GroupType = "page";
1029
1067
  interface BaseCard {
@@ -1032,9 +1070,11 @@ interface BaseCard {
1032
1070
  updatedAt: string;
1033
1071
  value?: unknown;
1034
1072
  type: CardType;
1035
- groupId?: number;
1073
+ groupId?: number | null;
1036
1074
  secondaryValue?: MultiChoiceSecondaryValueType | null;
1037
1075
  groupType?: GroupType;
1076
+ childId?: number | null;
1077
+ parentId?: number | null;
1038
1078
  }
1039
1079
  type Comparator = "answered" | "contains" | "notcontains" | "list_dni" | "eq" | "given_up" | "gt" | "gte" | "lt" | "lte" | "list_all" | "list_alo" | "list_exact" | "neq" | "partial" | "skipped";
1040
1080
  type Randomize = "none" | "all";
@@ -1052,7 +1092,7 @@ type GroupRoutingOption = {
1052
1092
  };
1053
1093
  type RoutingGroupOption = {
1054
1094
  comparator: Comparator;
1055
- questionIndex: number;
1095
+ questionIndex: number | string;
1056
1096
  value: number | string | string[] | {
1057
1097
  skipped: true;
1058
1098
  } | null | undefined;
@@ -1220,6 +1260,19 @@ interface OpenTextCard extends BaseCard {
1220
1260
  };
1221
1261
  type: "open";
1222
1262
  }
1263
+ /**
1264
+ * DynamicQuestionCard loading:
1265
+ * - `true` — DQ network request inflight
1266
+ * - `false` - successful DQ network request
1267
+ * - `undefined` - network call not yet triggered
1268
+ * - `null` - unsuccessful DQ network call
1269
+ */
1270
+ interface DynamicQuestionCard extends BaseCard {
1271
+ props: OpenTextCard["props"] & {
1272
+ loading?: boolean | null;
1273
+ };
1274
+ type: "aidynamicfollowup";
1275
+ }
1223
1276
  interface MultipleChoiceOption {
1224
1277
  createdAt: string;
1225
1278
  deletedAt: null;
@@ -1402,7 +1455,7 @@ interface VideoVoiceCard extends BaseCard {
1402
1455
  };
1403
1456
  type: "videovoice";
1404
1457
  }
1405
- type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MatrixCard | MaxDiffType | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | RankOrderType | VideoVoiceCard;
1458
+ type Card = TextUrlPromptCard | ConsentLegalCard | DynamicQuestionCard | RecordedTaskCard | LikertCard | OpenTextCard | MatrixCard | MaxDiffType | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | RankOrderType | VideoVoiceCard;
1406
1459
 
1407
1460
  type InteractiveMatchType = "exactly" | "legacy";
1408
1461
  type PageUrlMatchType = "contains" | "exactly" | "legacy" | "notContains" | "regex" | "startsWith";
@@ -1703,7 +1756,8 @@ interface AppProductConfig {
1703
1756
  }
1704
1757
  interface Config extends MobileReplayConfig {
1705
1758
  addResponseGroupMeta?: () => Promise<JSONObject>;
1706
- allResponses: unknown[];
1759
+ allResponses: CardResponse[];
1760
+ allResponsesRaw: Record<string | number, string>;
1707
1761
  answers?: Answer[];
1708
1762
  apiURL: string;
1709
1763
  avatars: Avatars;
@@ -1720,6 +1774,10 @@ interface Config extends MobileReplayConfig {
1720
1774
  outcome: string;
1721
1775
  };
1722
1776
  };
1777
+ createDynamicQuestion: (s: {
1778
+ parentQuestionId: number;
1779
+ parentResponseConfig?: Config["allResponsesRaw"];
1780
+ }) => void;
1723
1781
  customMetadata?: Record<string, unknown>;
1724
1782
  customStyles?: string;
1725
1783
  dismissOnPageChange: boolean;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { d as i, n as r, S as o, o as p } from "./index-BOM0UM95.js";
1
+ import { d as i, n as r, S as o, o as p } from "./index-Dm5Q2JaO.js";
2
2
  export {
3
3
  i as DismissReason,
4
4
  r as SprigAPI,