@qaiddev/quests-embed 1.7.0 → 1.10.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 +9 -2
- package/dist/embed-loader.d.ts +33 -0
- package/dist/embed.js +2 -0
- package/dist/embed.js.map +1 -0
- package/dist/prefetch.d.ts +13 -0
- package/dist/qaid-quests.js +135 -131
- package/dist/qaid-quests.js.map +1 -1
- package/dist/qaid-quests.umd.cjs +3 -3
- package/dist/qaid-quests.umd.cjs.map +1 -1
- package/dist/types.d.ts +21 -0
- package/package.json +4 -4
package/dist/types.d.ts
CHANGED
|
@@ -144,6 +144,12 @@ export interface Questionnaire {
|
|
|
144
144
|
/** Back button label. Default "Back" */
|
|
145
145
|
backLabel?: string;
|
|
146
146
|
questions: Question[];
|
|
147
|
+
/**
|
|
148
|
+
* A theme document sent with the questionnaire, so one request brings
|
|
149
|
+
* both (qaid.dev's `/definition?theme=<id>`). Used when the host set no
|
|
150
|
+
* `themeUrl` or `themeDocument` of its own.
|
|
151
|
+
*/
|
|
152
|
+
themeDocument?: ResolvedQuestTheme | null;
|
|
147
153
|
}
|
|
148
154
|
/**
|
|
149
155
|
* Configuration for the QaidQuests embed.
|
|
@@ -278,6 +284,19 @@ export interface QuestsConfig {
|
|
|
278
284
|
* `QaidQuests.supports.asyncMetadata` before passing one.
|
|
279
285
|
*/
|
|
280
286
|
metadata?: Record<string, unknown> | Promise<Record<string, unknown> | undefined>;
|
|
287
|
+
/**
|
|
288
|
+
* The page the response is about, stored with it and checked against the
|
|
289
|
+
* project's Domain Restriction. Default: `window.location.href`. Set it
|
|
290
|
+
* when the quest runs somewhere other than that page — inside a native
|
|
291
|
+
* app's web view, the page is qaid's, but the response is about the app.
|
|
292
|
+
*/
|
|
293
|
+
pageUrl?: string;
|
|
294
|
+
/**
|
|
295
|
+
* The visitor id sent with the response. Default: one kept in this
|
|
296
|
+
* browser's storage. A host that already has an id (a native app that sent
|
|
297
|
+
* the feedback the quest follows) passes it so both rows name one visitor.
|
|
298
|
+
*/
|
|
299
|
+
visitorId?: string;
|
|
281
300
|
/**
|
|
282
301
|
* Called once when the quest is completed and the server accepted the
|
|
283
302
|
* submit (right after the final "thank you" screen renders). Receives
|
|
@@ -336,6 +355,8 @@ export interface ResolvedQuestsConfig {
|
|
|
336
355
|
theme: "light" | "dark" | "auto";
|
|
337
356
|
unstyled: boolean;
|
|
338
357
|
preset: "default" | "minimal" | "pill" | "dense";
|
|
358
|
+
/** The host's page URL; empty means this page's own, read when the response is created. */
|
|
359
|
+
pageUrl: string;
|
|
339
360
|
}
|
|
340
361
|
/** Initial payload sent to create the response */
|
|
341
362
|
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.10.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",
|