@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
package/dist/mod.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
|
7
7
|
import { ReactNode } from 'react';
|
|
8
8
|
import { RefAttributes } from 'react';
|
|
9
9
|
|
|
10
|
+
/** Generate a random alphanumeric string of the given length. Uses the seedable uniform PRNG so simulations are reproducible. */
|
|
11
|
+
export declare function alphanumericId(length: number): string;
|
|
12
|
+
|
|
10
13
|
declare type ApertureShape = 'circle' | 'ellipse' | 'square' | 'rectangle';
|
|
11
14
|
|
|
12
15
|
export declare function arrayFlattener(item: TrialData): any[];
|
|
@@ -159,7 +162,7 @@ export declare function draw(spec: DimensionSpec): number;
|
|
|
159
162
|
|
|
160
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3MqpWRgIfsDV4YBUIo5OBAPGACKE40Hcyql5SyE1S2QFAo5SBAQWACKE40Hcyqla+8h2o+iaxgKOVgQEZgAihONB3MqpeqdUAtSaZmdKAo5OBAS2ACKFIA0bVUn3Jmsi7ollwo5OBAUGACKE40Hcyql6pt6b1uh3oo5WBAVWACKEvEORd+9/La7aeTKZnv/CjlYEBaYAIoTjO/AZGOE9OIX9kO96+gKOTgQF9gAihONB3MqpekAQ00UpCUKOTgQGRgAihSANG1VJz2oSiMZRZKqOQgQGlgAihONB3MqpeqbeK3KORgQG5gAihLxDkXfvfy2sJCQyjmoEBzYAIosXU/J/RyZHEovOUhd6Ypj7UPC8Bo5uBAeGACKRIuuxKsgM4Wle7xUaBZDTNWofASYGgAQAAAAAAABuhkoEB9QAIBkQ+QjevBKpbiF1qJHWihADN/mAcU7trkbuPs4EAt4r3gQHxggHg8IED";
|
|
161
164
|
|
|
162
|
-
export declare function EnterFullscreen({ content, buttonText, className, containerClass, centered, animate, next, data, updateStore, delayMs, }: {
|
|
165
|
+
export declare function EnterFullscreen({ content, buttonText, className, containerClass, centered, animate, next, data, updateStore, delayMs, keepFullscreen, }: {
|
|
163
166
|
prolificCode?: string;
|
|
164
167
|
content?: default_2.ReactNode;
|
|
165
168
|
buttonText?: string;
|
|
@@ -168,9 +171,13 @@ export declare function EnterFullscreen({ content, buttonText, className, contai
|
|
|
168
171
|
centered?: boolean;
|
|
169
172
|
animate?: boolean;
|
|
170
173
|
delayMs?: number;
|
|
174
|
+
/** Show a prompt to re-enter fullscreen on every subsequent trial until ExitFullscreen runs.
|
|
175
|
+
* `true` renders a small top-left button with default text.
|
|
176
|
+
* Pass a config to customize the button text, or switch to a full-screen overlay with custom content. */
|
|
177
|
+
keepFullscreen?: boolean | FullscreenGuardConfig;
|
|
171
178
|
} & BaseComponentProps): JSX_2.Element;
|
|
172
179
|
|
|
173
|
-
export declare function ExitFullscreen({ next, delayMs, }: {
|
|
180
|
+
export declare function ExitFullscreen({ next, updateStore, delayMs, }: {
|
|
174
181
|
delayMs?: number;
|
|
175
182
|
} & BaseComponentProps): null;
|
|
176
183
|
|
|
@@ -205,6 +212,12 @@ export declare interface FileUpload {
|
|
|
205
212
|
_alreadyUploaded?: boolean;
|
|
206
213
|
}
|
|
207
214
|
|
|
215
|
+
declare interface FullscreenGuardConfig {
|
|
216
|
+
mode?: 'button' | 'overlay';
|
|
217
|
+
buttonText?: string;
|
|
218
|
+
content?: default_2.ReactNode;
|
|
219
|
+
}
|
|
220
|
+
|
|
208
221
|
export declare function getBackendUrl(): string;
|
|
209
222
|
|
|
210
223
|
export declare function getInitialParticipant(): ParticipantState | undefined;
|
|
@@ -266,8 +279,9 @@ declare interface MarkerItem {
|
|
|
266
279
|
*/
|
|
267
280
|
export declare function mean(array: number[]): number;
|
|
268
281
|
|
|
269
|
-
export declare const MicCheck: ({ next, updateStore, animate }: BaseComponentProps & {
|
|
282
|
+
export declare const MicCheck: ({ next, updateStore, animate, discardLabel }: BaseComponentProps & {
|
|
270
283
|
animate?: boolean;
|
|
284
|
+
discardLabel?: string;
|
|
271
285
|
}) => JSX_2.Element;
|
|
272
286
|
|
|
273
287
|
export declare type NoiseMovement = 'randomTeleport' | 'randomWalk' | 'randomDirection';
|
|
@@ -292,6 +306,12 @@ export declare function now(): number;
|
|
|
292
306
|
|
|
293
307
|
export declare function orchestrateSimulation(config: RunSimulationConfig, scriptPath: string): Promise<void>;
|
|
294
308
|
|
|
309
|
+
export declare interface OverlayProps {
|
|
310
|
+
store: Store;
|
|
311
|
+
updateStore: (mergeIn: Store) => void;
|
|
312
|
+
data: any[];
|
|
313
|
+
}
|
|
314
|
+
|
|
295
315
|
export declare class Param {
|
|
296
316
|
static getRegistry(): any[];
|
|
297
317
|
static getTimelineRepresentation(): {
|
|
@@ -313,11 +333,12 @@ export declare type ParticipantState = Record<string, any>;
|
|
|
313
333
|
*/
|
|
314
334
|
export declare function pipe<T, U>(array: T[], fn: (arr: T[]) => U): U;
|
|
315
335
|
|
|
316
|
-
export declare function PlainInput({ content, buttonText, className, next, updateStore, animate, storeupdate, placeholder, }: BaseComponentProps & {
|
|
336
|
+
export declare function PlainInput({ content, buttonText, className, centered, next, updateStore, animate, storeupdate, placeholder, }: BaseComponentProps & {
|
|
317
337
|
content: React.ReactNode;
|
|
318
338
|
buttonText?: string;
|
|
319
339
|
onButtonClick?: () => void;
|
|
320
340
|
className?: string;
|
|
341
|
+
centered?: boolean;
|
|
321
342
|
animate?: boolean;
|
|
322
343
|
storeupdate?: (entry: string) => {
|
|
323
344
|
[key: string]: any;
|
|
@@ -354,6 +375,9 @@ export declare function ProlificEnding({ prolificCode, className, containerClass
|
|
|
354
375
|
animate?: boolean;
|
|
355
376
|
} & BaseComponentProps): JSX_2.Element;
|
|
356
377
|
|
|
378
|
+
/** Generate a Prolific-style 24-character alphanumeric ID */
|
|
379
|
+
export declare function prolificId(): string;
|
|
380
|
+
|
|
357
381
|
export declare function Quest({ next, surveyJson, customQuestions, theme, containerClass, }: {
|
|
358
382
|
next: (data: object) => void;
|
|
359
383
|
surveyJson: object;
|
|
@@ -496,6 +520,8 @@ export declare function registerExperimentParams(experiment: any[]): void;
|
|
|
496
520
|
|
|
497
521
|
export declare function registerFlattener(type: string, csv: string | null, flatten?: (item: TrialData) => any[]): void;
|
|
498
522
|
|
|
523
|
+
export declare function registerOverlay(component: ComponentType<OverlayProps>): void;
|
|
524
|
+
|
|
499
525
|
export declare function registerSimulation(type: string, simulate: SimulateFunction, defaultSimulators: Record<string, any>): void;
|
|
500
526
|
|
|
501
527
|
declare type ReinsertType = 'random' | 'opposite' | 'oppositeSimple' | 'wrap';
|
|
@@ -852,7 +878,7 @@ export declare const useTutorialSlide: ({ locked }?: {
|
|
|
852
878
|
}) => void;
|
|
853
879
|
};
|
|
854
880
|
|
|
855
|
-
export declare function VoiceRecording({ content, buttonText, shortButtonText, className, containerClass, next, store, minDuration, shortRecordingWarning, showVisualizer, eagerUpload, animate, name, }: BaseComponentProps & {
|
|
881
|
+
export declare function VoiceRecording({ content, buttonText, shortButtonText, className, containerClass, next, store, minDuration, shortRecordingWarning, showVisualizer, eagerUpload, animate, name, silenceWarningSec, silenceWarningText, }: BaseComponentProps & {
|
|
856
882
|
content?: default_2.ReactNode;
|
|
857
883
|
buttonText?: string;
|
|
858
884
|
/** Button text when recording is shorter than minDuration. Defaults to buttonText. */
|
|
@@ -869,6 +895,10 @@ export declare function VoiceRecording({ content, buttonText, shortButtonText, c
|
|
|
869
895
|
eagerUpload?: boolean;
|
|
870
896
|
animate?: boolean;
|
|
871
897
|
name?: string;
|
|
898
|
+
/** Seconds of continuous silence before a "speak up" banner appears. Disabled when undefined. */
|
|
899
|
+
silenceWarningSec?: number;
|
|
900
|
+
/** Text shown in the silence banner. */
|
|
901
|
+
silenceWarningText?: string;
|
|
872
902
|
}): JSX_2.Element;
|
|
873
903
|
|
|
874
904
|
declare interface WhileBlockItem {
|
package/dist/reactive.es.js
CHANGED
|
@@ -1,84 +1,87 @@
|
|
|
1
|
-
import { A as e, H as
|
|
1
|
+
import { A as e, H as i, C as t, a as r, D as o, c as n, d as l, e as m, f as u, g as c, h as p, Y as d, z as D, L as T, M as g, P as C, i as P, j as S, Q as v, R as A, k as h, l as x, F as _, T as k, m as B, n as E, o as I, p as f, U as M, V as F, X as L, q as R, r as U, s as b, t as w, u as G, v as K, w as y, x as O, y as q, B as H, G as j, I as N, J as Q, K as V, N as Y, O as Z, S as z, Z as J, _ as W, $ as X, a0 as $, a1 as aa, a2 as sa, a3 as ea, a4 as ia, a5 as ta, a6 as ra, a7 as oa, a8 as na, a9 as la, aa as ma, ab as ua, ac as ca, ad as pa, ae as da, af as Da, ag as Ta, ah as ga, ai as Ca, aj as Pa, ak as Sa, al as va, am as Aa, an as ha, ao as xa, ap as _a, aq as ka, ar as Ba, as as Ea, at as Ia, au as fa, av as Ma, aw as Fa } from "./mod-BTpABl23.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AudioDeviceContext,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
i as Bounce,
|
|
5
|
+
t as CanvasBlock,
|
|
6
|
+
r as CheckDevice,
|
|
7
|
+
o as DARK_BG_CLASS,
|
|
8
8
|
n as DARK_BG_PLAIN_CLASS,
|
|
9
9
|
l as DUMMY_AUDIO_BASE64,
|
|
10
10
|
m as EnterFullscreen,
|
|
11
11
|
u as ExitFullscreen,
|
|
12
12
|
c as ExperimentProvider,
|
|
13
13
|
p as ExperimentRunner,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
d as Flip,
|
|
15
|
+
D as Icons,
|
|
16
16
|
T as LIGHT_DOT_BG_CLASS,
|
|
17
17
|
g as MicCheck,
|
|
18
18
|
C as Param,
|
|
19
19
|
P as PlainInput,
|
|
20
20
|
S as ProlificEnding,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
v as Quest,
|
|
22
|
+
A as RDKCanvas,
|
|
23
|
+
h as RandomDotKinematogram,
|
|
24
24
|
x as RequestFilePermission,
|
|
25
25
|
_ as Slide,
|
|
26
26
|
k as THEME,
|
|
27
27
|
B as Text,
|
|
28
28
|
E as ThemeContext,
|
|
29
|
-
|
|
29
|
+
I as ToastContainer,
|
|
30
30
|
f as Tutorial,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
M as Upload,
|
|
32
|
+
F as VoiceRecording,
|
|
33
33
|
L as Zoom,
|
|
34
|
-
R as
|
|
35
|
-
U as
|
|
36
|
-
b as
|
|
34
|
+
R as alphanumericId,
|
|
35
|
+
U as arrayFlattener,
|
|
36
|
+
b as canvasCountdown,
|
|
37
|
+
w as chunk,
|
|
37
38
|
G as collapseToast,
|
|
38
39
|
K as cssTransition,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
y as draw,
|
|
41
|
+
O as getBackendUrl,
|
|
42
|
+
q as getInitialParticipant,
|
|
42
43
|
H as getParam,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
j as getPlatform,
|
|
45
|
+
N as getSimulation,
|
|
46
|
+
Q as halton,
|
|
47
|
+
V as invokeLLM,
|
|
48
|
+
Y as isDesktop,
|
|
49
|
+
Z as isFullscreen,
|
|
50
|
+
z as mapDDMChoice,
|
|
51
|
+
J as mean,
|
|
52
|
+
W as noopSimulate,
|
|
53
|
+
X as normal,
|
|
54
|
+
$ as now,
|
|
55
|
+
aa as orchestrateSimulation,
|
|
56
|
+
sa as pipe,
|
|
57
|
+
ea as poisson,
|
|
58
|
+
ia as prepareTimeline,
|
|
58
59
|
ta as probeAudioDurationMs,
|
|
59
|
-
|
|
60
|
-
oa as
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Da as
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Aa as
|
|
76
|
-
ha as
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
ra as prolificId,
|
|
61
|
+
oa as registerArrayExtensions,
|
|
62
|
+
na as registerComponentParams,
|
|
63
|
+
la as registerExperimentParams,
|
|
64
|
+
ma as registerFlattener,
|
|
65
|
+
ua as registerOverlay,
|
|
66
|
+
ca as registerSimulation,
|
|
67
|
+
pa as resolveSimulation,
|
|
68
|
+
da as sample,
|
|
69
|
+
Da as sampleParticipants,
|
|
70
|
+
Ta as seedDistributions,
|
|
71
|
+
ga as selectPrevTrialData,
|
|
72
|
+
Ca as setBackendUrl,
|
|
73
|
+
Pa as shuffle,
|
|
74
|
+
Sa as simulateDDMTrial,
|
|
75
|
+
va as simulateParticipant,
|
|
76
|
+
Aa as sobol,
|
|
77
|
+
ha as sum,
|
|
78
|
+
xa as t,
|
|
79
|
+
_a as textToWebmBase64,
|
|
80
|
+
ka as toast,
|
|
81
|
+
Ba as uniform,
|
|
82
|
+
Ea as useAudioDeviceId,
|
|
83
|
+
Ia as useTheme,
|
|
84
|
+
fa as useToast,
|
|
85
|
+
Ma as useToastContainer,
|
|
86
|
+
Fa as useTutorialSlide
|
|
84
87
|
};
|