@qaiddev/quests-embed 1.10.0 → 1.10.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.
- package/README.md +24 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
A zero-dependency, lightweight questionnaire embed that renders step-by-step forms from a JSON definition. Drop it inline on a page or open it as a modal — answers are autosaved as the user types and submitted to your API endpoint or the [QAid.dev hosted dashboard](https://qaid.dev).
|
|
7
7
|
|
|
8
|
+
It needs 16.8 KB (gzipped) to show a quest: a 0.8 KB tag, then the quest code once the quest is near the screen. See [What loads when](#what-loads-when).
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
8
12
|
## Install
|
|
9
13
|
|
|
10
14
|
### npm
|
|
@@ -43,6 +47,19 @@ The embed auto-initializes when it detects a `data-endpoint` attribute on its sc
|
|
|
43
47
|
|
|
44
48
|
`dist/embed.js` is a 0.8 KB loader (gzipped). It loads the quest code (about 16 KB) when the container comes within a screen's height of the viewport, or once the page has loaded and the browser is idle, whichever is first. Without a `data-container` it loads at once. It starts fetching the questions (`data-config-url`) and theme (`data-theme-url`) at the same moment as the quest code, so they arrive together. A questionnaire may also carry its theme as `themeDocument`, so one request brings both; a `themeUrl` or `themeDocument` set on the tag still wins. Pointing the tag straight at `dist/qaid-quests.umd.cjs` still works and loads everything up front.
|
|
45
49
|
|
|
50
|
+
### What loads when
|
|
51
|
+
|
|
52
|
+
Sizes are gzipped, for 1.10. Times are rough estimates for a first visit on a typical 4G phone (100 ms round trip, 9 Mbps).
|
|
53
|
+
|
|
54
|
+
| When | Size | What it brings | About |
|
|
55
|
+
|------|------|----------------|-------|
|
|
56
|
+
| Before paint | 0 KB | nothing; the tag waits (`defer`) | 0 s |
|
|
57
|
+
| After paint | 0.8 KB | the tag (`embed.js`) | 0.5 s |
|
|
58
|
+
| Quest near the screen, or browser idle | 16 KB | the quest code | 0.1 s |
|
|
59
|
+
| Same moment | +1 KB | the questions and theme, in one request | 0.3 s |
|
|
60
|
+
|
|
61
|
+
The quest is ready about 0.9 s after paint. The questions come from your server on a new connection, so they finish a little after the code even though they start together.
|
|
62
|
+
|
|
46
63
|
### JSON Config (Script Tag)
|
|
47
64
|
|
|
48
65
|
For complex configurations or inline questionnaires, use a separate JSON config element:
|
|
@@ -86,6 +103,8 @@ For complex configurations or inline questionnaires, use a separate JSON config
|
|
|
86
103
|
|
|
87
104
|
If `container` is set, the form renders inline inside that element. If not, it opens as a centered modal with a backdrop.
|
|
88
105
|
|
|
106
|
+

|
|
107
|
+
|
|
89
108
|
## Questionnaire Definition
|
|
90
109
|
|
|
91
110
|
A `Questionnaire` is the JSON document that describes the form. It can be loaded inline via the `questionnaire` config option, or fetched from a URL via `configUrl`.
|
|
@@ -513,6 +532,10 @@ The embed renders inside a Shadow DOM, so your page's CSS can't leak in. To them
|
|
|
513
532
|
|
|
514
533
|
The variable names are shared with `@qaiddev/thumbs-embed`, so a single theme can drive both embeds.
|
|
515
534
|
|
|
535
|
+
For a quick change, the tag takes a preset, a light or dark theme and an accent color. This is `data-preset="pill" data-theme="dark" data-accent-color="#d97706"`:
|
|
536
|
+
|
|
537
|
+

|
|
538
|
+
|
|
516
539
|
## Hosted Dashboard
|
|
517
540
|
|
|
518
541
|
[Qaid](https://qaid.dev) provides a hosted dashboard for managing responses collected by this embed:
|
|
@@ -525,15 +548,7 @@ The variable names are shared with `@qaiddev/thumbs-embed`, so a single theme ca
|
|
|
525
548
|
|
|
526
549
|
### Plans
|
|
527
550
|
|
|
528
|
-
|
|
529
|
-
|---|---|---|---|
|
|
530
|
-
| Projects | 1 | Unlimited | Unlimited |
|
|
531
|
-
| Responses | 100/mo | Unlimited | Unlimited |
|
|
532
|
-
| Data retention | 7 days | 1 year | Unlimited |
|
|
533
|
-
| Notifications | - | Email/Text | Email/Text |
|
|
534
|
-
| Integrations | - | GitHub + more | Custom |
|
|
535
|
-
|
|
536
|
-
Sign up at [qaid.dev](https://qaid.dev). You can also self-host — the embed works with any endpoint that accepts the protocol described above.
|
|
551
|
+
There is a free Cadet plan, a Commander plan at $9 per seat per month, and an Admiral plan for larger teams. See [qaid.dev/pricing](https://qaid.dev/pricing) for what each includes. Sign up at [qaid.dev](https://qaid.dev). You can also self-host — the embed works with any endpoint that accepts the protocol described above.
|
|
537
552
|
|
|
538
553
|
## Self-Hosting
|
|
539
554
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qaiddev/quests-embed",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Any Questions for your Users?",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/qaid-quests.umd.cjs",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@vitest/coverage-v8": "^5.0.3",
|
|
42
42
|
"axe-core": "^4.12.1",
|
|
43
|
-
"happy-dom": "^
|
|
43
|
+
"happy-dom": "^21.0.4",
|
|
44
44
|
"jsdom": "^29.1.1",
|
|
45
45
|
"typescript": "^5.3.3",
|
|
46
46
|
"vite": "^7.3.1",
|