@qaiddev/quests-embed 1.2.0 → 1.4.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/README.md +21 -0
- package/dist/embed.d.ts +6 -0
- package/dist/overflow.d.ts +49 -0
- package/dist/qaid-quests.js +164 -114
- package/dist/qaid-quests.js.map +1 -1
- package/dist/qaid-quests.umd.cjs +4 -4
- package/dist/qaid-quests.umd.cjs.map +1 -1
- package/dist/types.d.ts +23 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -254,6 +254,27 @@ export interface QuestsConfig {
|
|
|
254
254
|
* Same precedence as `themeUrl` (explicit config wins).
|
|
255
255
|
*/
|
|
256
256
|
themeDocument?: ResolvedQuestTheme;
|
|
257
|
+
/**
|
|
258
|
+
* Extra key/value pairs sent verbatim in the create-response POST
|
|
259
|
+
* body (alongside `apiKey` / `questId` / …). Lets a host correlate
|
|
260
|
+
* the response with something on its side — e.g. the thumbs-embed
|
|
261
|
+
* widget passes `{ feedbackId }` so the backend can join the quest
|
|
262
|
+
* answers to the feedback record. The server decides which keys it
|
|
263
|
+
* persists; unknown keys are ignored.
|
|
264
|
+
*/
|
|
265
|
+
metadata?: Record<string, unknown>;
|
|
266
|
+
/**
|
|
267
|
+
* Called once when the quest is completed and submitted (right after
|
|
268
|
+
* the final "thank you" screen renders). Receives a copy of the
|
|
269
|
+
* collected answers. Fired in both modal and inline modes.
|
|
270
|
+
*/
|
|
271
|
+
onComplete?: (answers: Answers) => void;
|
|
272
|
+
/**
|
|
273
|
+
* Called once when the embed is torn down — whether the visitor
|
|
274
|
+
* closed the modal, the host called `destroy()`, or teardown followed
|
|
275
|
+
* completion. Lets a host that launched the quest drop its reference.
|
|
276
|
+
*/
|
|
277
|
+
onClose?: () => void;
|
|
257
278
|
}
|
|
258
279
|
/**
|
|
259
280
|
* Shape of a single quest-theme document, as served by the docs site
|
|
@@ -306,6 +327,8 @@ export interface CreateResponsePayload {
|
|
|
306
327
|
pageUrl: string;
|
|
307
328
|
visitorId: string;
|
|
308
329
|
userAgent?: string;
|
|
330
|
+
/** Host-supplied correlation fields (see QuestsConfig.metadata) */
|
|
331
|
+
metadata?: Record<string, unknown>;
|
|
309
332
|
}
|
|
310
333
|
export interface CreateResponseResult {
|
|
311
334
|
/** Server-assigned id used for subsequent answer updates */
|