@qaiddev/quests-embed 1.6.1 → 1.9.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 +10 -3
- package/dist/embed-loader.d.ts +28 -0
- package/dist/embed.d.ts +7 -0
- package/dist/embed.js +2 -0
- package/dist/embed.js.map +1 -0
- package/dist/qaid-quests.js +120 -105
- package/dist/qaid-quests.js.map +1 -1
- package/dist/qaid-quests.umd.cjs +2 -2
- package/dist/qaid-quests.umd.cjs.map +1 -1
- package/dist/types.d.ts +22 -1
- package/package.json +4 -4
package/dist/types.d.ts
CHANGED
|
@@ -270,8 +270,27 @@ export interface QuestsConfig {
|
|
|
270
270
|
* widget passes `{ feedbackId }` so the backend can join the quest
|
|
271
271
|
* answers to the feedback record. The server decides which keys it
|
|
272
272
|
* persists; unknown keys are ignored.
|
|
273
|
+
*
|
|
274
|
+
* May be a promise. Only the background create waits for it; the form
|
|
275
|
+
* renders at once. That lets a host open the quest before it has the ids
|
|
276
|
+
* to send (thumbs-embed opens it while its own feedback POST is still in
|
|
277
|
+
* flight). A rejected promise sends no metadata. Hosts can check
|
|
278
|
+
* `QaidQuests.supports.asyncMetadata` before passing one.
|
|
273
279
|
*/
|
|
274
|
-
metadata?: Record<string, unknown>;
|
|
280
|
+
metadata?: Record<string, unknown> | Promise<Record<string, unknown> | undefined>;
|
|
281
|
+
/**
|
|
282
|
+
* The page the response is about, stored with it and checked against the
|
|
283
|
+
* project's Domain Restriction. Default: `window.location.href`. Set it
|
|
284
|
+
* when the quest runs somewhere other than that page — inside a native
|
|
285
|
+
* app's web view, the page is qaid's, but the response is about the app.
|
|
286
|
+
*/
|
|
287
|
+
pageUrl?: string;
|
|
288
|
+
/**
|
|
289
|
+
* The visitor id sent with the response. Default: one kept in this
|
|
290
|
+
* browser's storage. A host that already has an id (a native app that sent
|
|
291
|
+
* the feedback the quest follows) passes it so both rows name one visitor.
|
|
292
|
+
*/
|
|
293
|
+
visitorId?: string;
|
|
275
294
|
/**
|
|
276
295
|
* Called once when the quest is completed and the server accepted the
|
|
277
296
|
* submit (right after the final "thank you" screen renders). Receives
|
|
@@ -330,6 +349,8 @@ export interface ResolvedQuestsConfig {
|
|
|
330
349
|
theme: "light" | "dark" | "auto";
|
|
331
350
|
unstyled: boolean;
|
|
332
351
|
preset: "default" | "minimal" | "pill" | "dense";
|
|
352
|
+
/** The host's page URL; empty means this page's own, read when the response is created. */
|
|
353
|
+
pageUrl: string;
|
|
333
354
|
}
|
|
334
355
|
/** Initial payload sent to create the response */
|
|
335
356
|
export interface CreateResponsePayload {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qaiddev/quests-embed",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Any Questions for your Users?",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/qaid-quests.umd.cjs",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"dev": "vite build --watch",
|
|
32
|
-
"build": "vite build && tsc -p tsconfig.build.json",
|
|
32
|
+
"build": "vite build && vite build --config vite.config.embed.ts && tsc -p tsconfig.build.json",
|
|
33
33
|
"preview": "vite preview",
|
|
34
34
|
"test": "vitest",
|
|
35
35
|
"test:run": "vitest run",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"prepublishOnly": "npm run test:run && npm run build"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@vitest/coverage-v8": "^
|
|
41
|
+
"@vitest/coverage-v8": "^5.0.3",
|
|
42
42
|
"axe-core": "^4.12.1",
|
|
43
43
|
"happy-dom": "^20.5.1",
|
|
44
44
|
"jsdom": "^29.1.1",
|
|
45
45
|
"typescript": "^5.3.3",
|
|
46
46
|
"vite": "^7.3.1",
|
|
47
|
-
"vitest": "^
|
|
47
|
+
"vitest": "^5.0.3"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
50
50
|
"quests",
|