@adriansteffan/reactive 0.2.5 → 0.2.7
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/.playwright-mcp/console-2026-09-20T12-17-32-043Z.log +1 -0
- package/.playwright-mcp/page-2026-09-20T12-17-32-084Z.yml +10 -0
- package/README.md +22 -0
- package/dist/{mod-CHZCELgX.js → mod-BTpABl23.js} +9013 -8910
- package/dist/mod.d.ts +35 -5
- package/dist/reactive.es.js +62 -59
- package/dist/reactive.umd.js +625 -625
- package/dist/style.css +1 -1
- package/dist/{web-DabPva5b.js → web-DV4cj_8Q.js} +1 -1
- package/dist/{web-BNJX4siP.js → web-DprbPn6i.js} +1 -1
- package/package.json +1 -1
- package/src/components/enterfullscreen.tsx +77 -1
- package/src/components/exitfullscreen.tsx +2 -0
- package/src/components/experimentrunner.tsx +4 -0
- package/src/components/microphonecheck.tsx +12 -9
- package/src/components/plaininput.tsx +5 -3
- package/src/components/voicerecorder.tsx +57 -1
- package/src/components/voicerecording.tsx +8 -0
- package/src/mod.tsx +3 -0
- package/src/utils/common.ts +5 -1
- package/src/utils/ids.ts +17 -0
- package/src/utils/overlays.ts +19 -0
- package/src/utils/simulation.ts +22 -9
- package/src/utils/upload.ts +5 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[ 22ms] [ERROR] Failed to load resource: the server responded with a status of 404 (File not found) @ http://localhost:8799/favicon.ico:0
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
- generic [active] [ref=e1]:
|
|
2
|
+
- generic [ref=e3]:
|
|
3
|
+
- paragraph [ref=e4]: Name?
|
|
4
|
+
- textbox "x" [ref=e5]
|
|
5
|
+
- generic [ref=e7]:
|
|
6
|
+
- paragraph [ref=e8]: Name?
|
|
7
|
+
- textbox "x" [ref=e9]
|
|
8
|
+
- generic [ref=e11]:
|
|
9
|
+
- paragraph [ref=e12]: Name?
|
|
10
|
+
- textbox "x" [ref=e13]
|
package/README.md
CHANGED
|
@@ -62,6 +62,28 @@ export const simulationConfig = {
|
|
|
62
62
|
};
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
### Simulating URL params (e.g. Prolific IDs)
|
|
66
|
+
|
|
67
|
+
To produce simulated runs whose session CSV matches real Prolific runs (so payout/analysis scripts work on both), attach a `urlParams` object to each simulated participant. These flow into the metadata trial as unregistered params and land in the CSV with a `url_` prefix.
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { sampleParticipants, prolificId } from '@adriansteffan/reactive';
|
|
71
|
+
|
|
72
|
+
export const simulationConfig = {
|
|
73
|
+
seed: 42,
|
|
74
|
+
participants: () => sampleParticipants('sobol', 10, {
|
|
75
|
+
needForCognition: { distribution: 'normal', mean: 3.5, sd: 0.8 },
|
|
76
|
+
}).map((p) => ({
|
|
77
|
+
...p,
|
|
78
|
+
urlParams: {
|
|
79
|
+
PROLIFIC_PID: prolificId(),
|
|
80
|
+
},
|
|
81
|
+
})),
|
|
82
|
+
};
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Available generators: `prolificId()` (24-char alphanumeric), `alphanumericId(length)` for custom lengths.
|
|
86
|
+
|
|
65
87
|
Run the simulation:
|
|
66
88
|
|
|
67
89
|
```
|