@adriansteffan/reactive 0.1.31 → 0.1.33
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/.claude/settings.local.json +3 -1
- package/dist/{mod-CUZcjHfZ.js → mod-BI0gtRcG.js} +8183 -8135
- package/dist/mod.d.ts +73 -2
- package/dist/reactive.es.js +49 -48
- package/dist/reactive.umd.js +628 -628
- package/dist/style.css +1 -1
- package/dist/{web-Dz1I9Wa3.js → web-C3D6toM6.js} +1 -1
- package/dist/{web-BEDMfcxc.js → web-D5dD50rU.js} +1 -1
- package/package.json +1 -1
- package/src/components/index.ts +1 -1
- package/src/components/quest.tsx +2 -2
- package/src/components/randomdotkinetogram.tsx +168 -73
- package/src/components/text.tsx +16 -2
- package/src/index.css +4 -0
- package/src/mod.tsx +1 -1
- package/src/utils/theme.ts +32 -23
package/dist/mod.d.ts
CHANGED
|
@@ -104,6 +104,8 @@ declare type ControlFlowItem = MarkerItem | IfGotoItem | UpdateStoreItem | IfBlo
|
|
|
104
104
|
|
|
105
105
|
export declare const DARK_BG_CLASS = "reactive-dark-bg";
|
|
106
106
|
|
|
107
|
+
export declare const DARK_BG_PLAIN_CLASS = "reactive-dark-bg-plain";
|
|
108
|
+
|
|
107
109
|
export declare interface DDMTrialParams {
|
|
108
110
|
driftRate: ParameterDef;
|
|
109
111
|
boundaries: BoundaryDef;
|
|
@@ -355,6 +357,20 @@ export declare interface RDKCanvasProps {
|
|
|
355
357
|
className?: string;
|
|
356
358
|
}
|
|
357
359
|
|
|
360
|
+
export declare interface RDKFeedback {
|
|
361
|
+
/** Shown when rt === null (no response within duration) */
|
|
362
|
+
onTimeout?: RDKMessage;
|
|
363
|
+
/** Shown when the response was incorrect (correct === false) */
|
|
364
|
+
onIncorrect?: RDKMessage;
|
|
365
|
+
/** Shown when the response was correct (correct === true) */
|
|
366
|
+
onCorrect?: RDKMessage;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export declare interface RDKMessage {
|
|
370
|
+
content: string;
|
|
371
|
+
duration: number;
|
|
372
|
+
}
|
|
373
|
+
|
|
358
374
|
export declare interface RDKProps extends BaseComponentProps {
|
|
359
375
|
validKeys?: string[];
|
|
360
376
|
correctResponse?: string | string[];
|
|
@@ -392,6 +408,10 @@ export declare interface RDKProps extends BaseComponentProps {
|
|
|
392
408
|
borderWidth?: number;
|
|
393
409
|
borderColor?: string;
|
|
394
410
|
responseHint?: string;
|
|
411
|
+
/** Timed message shown before the fixation cross. Useful for per-trial condition cues. */
|
|
412
|
+
preTrialMessage?: RDKMessage;
|
|
413
|
+
/** Post-response feedback. Evaluated after response/timeout, displayed before calling next(). */
|
|
414
|
+
feedback?: RDKFeedback;
|
|
395
415
|
}
|
|
396
416
|
|
|
397
417
|
/**
|
|
@@ -520,7 +540,30 @@ export declare function t(theme: Theme): {
|
|
|
520
540
|
readonly dotInactive: "rgba(0,0,0,0.2)";
|
|
521
541
|
readonly toastTheme: "light";
|
|
522
542
|
} | {
|
|
543
|
+
readonly text: "text-[#f5f5f5]";
|
|
544
|
+
readonly prose: "prose-invert";
|
|
545
|
+
readonly proseLink: "prose-a:text-blue-400";
|
|
546
|
+
readonly buttonBg: "bg-white";
|
|
547
|
+
readonly buttonText: "text-black";
|
|
548
|
+
readonly buttonBorder: "border-black";
|
|
549
|
+
readonly buttonShadow: "shadow-[2px_2px_0px_rgba(0,0,0,1)]";
|
|
550
|
+
readonly buttonDisabledBg: "bg-gray-700";
|
|
551
|
+
readonly buttonDisabledText: "text-gray-500";
|
|
552
|
+
readonly buttonDisabledBorder: "border-gray-600";
|
|
553
|
+
readonly buttonDisabledShadow: "shadow-[2px_2px_0px_rgba(75,85,99,1)]";
|
|
554
|
+
readonly error: "text-red-400";
|
|
555
|
+
readonly focusRing: "focus:ring-blue-400";
|
|
556
|
+
readonly inputBg: "bg-gray-700";
|
|
557
|
+
readonly inputBorder: "border-gray-500";
|
|
558
|
+
readonly inputText: "text-[#f5f5f5]";
|
|
559
|
+
readonly progressBg: "bg-gray-700";
|
|
560
|
+
readonly progressStripe1: "#374151";
|
|
561
|
+
readonly progressStripe2: "#4B5563";
|
|
562
|
+
readonly dotActive: "#fff";
|
|
563
|
+
readonly dotInactive: "rgba(255,255,255,0.3)";
|
|
564
|
+
readonly toastTheme: "dark";
|
|
523
565
|
readonly containerBg: "reactive-dark-bg";
|
|
566
|
+
} | {
|
|
524
567
|
readonly text: "text-[#f5f5f5]";
|
|
525
568
|
readonly prose: "prose-invert";
|
|
526
569
|
readonly proseLink: "prose-a:text-blue-400";
|
|
@@ -543,9 +586,10 @@ export declare function t(theme: Theme): {
|
|
|
543
586
|
readonly dotActive: "#fff";
|
|
544
587
|
readonly dotInactive: "rgba(255,255,255,0.3)";
|
|
545
588
|
readonly toastTheme: "dark";
|
|
589
|
+
readonly containerBg: "reactive-dark-bg-plain";
|
|
546
590
|
};
|
|
547
591
|
|
|
548
|
-
declare function Text_2({ content, buttonText, className, containerClass, centered, next, animate, allowedKeys, }: {
|
|
592
|
+
declare function Text_2({ content, buttonText, className, containerClass, centered, next, animate, allowedKeys, duration, }: {
|
|
549
593
|
content: default_2.ReactNode;
|
|
550
594
|
buttonText?: string;
|
|
551
595
|
onButtonClick?: () => void;
|
|
@@ -554,6 +598,8 @@ declare function Text_2({ content, buttonText, className, containerClass, center
|
|
|
554
598
|
centered?: boolean;
|
|
555
599
|
animate?: boolean;
|
|
556
600
|
allowedKeys?: string[] | boolean;
|
|
601
|
+
/** Auto-advance after N ms. When set, no button is shown and key presses are ignored. */
|
|
602
|
+
duration?: number;
|
|
557
603
|
} & BaseComponentProps): JSX_2.Element;
|
|
558
604
|
export { Text_2 as Text }
|
|
559
605
|
|
|
@@ -584,7 +630,31 @@ export declare const THEME: {
|
|
|
584
630
|
readonly toastTheme: "light";
|
|
585
631
|
};
|
|
586
632
|
readonly dark: {
|
|
633
|
+
readonly text: "text-[#f5f5f5]";
|
|
634
|
+
readonly prose: "prose-invert";
|
|
635
|
+
readonly proseLink: "prose-a:text-blue-400";
|
|
636
|
+
readonly buttonBg: "bg-white";
|
|
637
|
+
readonly buttonText: "text-black";
|
|
638
|
+
readonly buttonBorder: "border-black";
|
|
639
|
+
readonly buttonShadow: "shadow-[2px_2px_0px_rgba(0,0,0,1)]";
|
|
640
|
+
readonly buttonDisabledBg: "bg-gray-700";
|
|
641
|
+
readonly buttonDisabledText: "text-gray-500";
|
|
642
|
+
readonly buttonDisabledBorder: "border-gray-600";
|
|
643
|
+
readonly buttonDisabledShadow: "shadow-[2px_2px_0px_rgba(75,85,99,1)]";
|
|
644
|
+
readonly error: "text-red-400";
|
|
645
|
+
readonly focusRing: "focus:ring-blue-400";
|
|
646
|
+
readonly inputBg: "bg-gray-700";
|
|
647
|
+
readonly inputBorder: "border-gray-500";
|
|
648
|
+
readonly inputText: "text-[#f5f5f5]";
|
|
649
|
+
readonly progressBg: "bg-gray-700";
|
|
650
|
+
readonly progressStripe1: "#374151";
|
|
651
|
+
readonly progressStripe2: "#4B5563";
|
|
652
|
+
readonly dotActive: "#fff";
|
|
653
|
+
readonly dotInactive: "rgba(255,255,255,0.3)";
|
|
654
|
+
readonly toastTheme: "dark";
|
|
587
655
|
readonly containerBg: "reactive-dark-bg";
|
|
656
|
+
};
|
|
657
|
+
readonly 'dark-plain': {
|
|
588
658
|
readonly text: "text-[#f5f5f5]";
|
|
589
659
|
readonly prose: "prose-invert";
|
|
590
660
|
readonly proseLink: "prose-a:text-blue-400";
|
|
@@ -607,10 +677,11 @@ export declare const THEME: {
|
|
|
607
677
|
readonly dotActive: "#fff";
|
|
608
678
|
readonly dotInactive: "rgba(255,255,255,0.3)";
|
|
609
679
|
readonly toastTheme: "dark";
|
|
680
|
+
readonly containerBg: "reactive-dark-bg-plain";
|
|
610
681
|
};
|
|
611
682
|
};
|
|
612
683
|
|
|
613
|
-
export declare type Theme = 'light' | 'dark';
|
|
684
|
+
export declare type Theme = 'light' | 'dark' | 'dark-plain';
|
|
614
685
|
|
|
615
686
|
export declare const ThemeContext: Context<Theme>;
|
|
616
687
|
|
package/dist/reactive.es.js
CHANGED
|
@@ -1,71 +1,72 @@
|
|
|
1
|
-
import { H as e, C as t, a as i, D as n, c as r, d as o, e as l, f as m,
|
|
1
|
+
import { H as e, C as t, a as i, D as n, c as r, d as o, e as l, f as m, g as u, Y as c, z as p, M as P, P as g, h as C, i as T, Q as d, R as D, j as S, k as h, F as x, T as E, l as f, m as k, n as B, o as F, U as v, X as A, p as R, q as _, r as I, s as K, t as M, u as b, v as y, w as L, x as U, y as w, A as G, B as q, G as H, I as N, J as Q, K as Z, L as j, N as z, O as J, S as O, V, Z as X, _ as Y, $, a0 as W, a1 as aa, a2 as sa, a3 as ea, a4 as ta, a5 as ia, a6 as na, a7 as ra, a8 as oa, a9 as la, aa as ma, ab as ua, ac as ca, ad as pa, ae as Pa, af as ga, ag as Ca, ah as Ta } from "./mod-BI0gtRcG.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Bounce,
|
|
4
4
|
t as CanvasBlock,
|
|
5
5
|
i as CheckDevice,
|
|
6
6
|
n as DARK_BG_CLASS,
|
|
7
|
-
r as
|
|
8
|
-
o as
|
|
9
|
-
l as
|
|
10
|
-
m as
|
|
11
|
-
u as
|
|
12
|
-
c as
|
|
13
|
-
p as
|
|
7
|
+
r as DARK_BG_PLAIN_CLASS,
|
|
8
|
+
o as EnterFullscreen,
|
|
9
|
+
l as ExitFullscreen,
|
|
10
|
+
m as ExperimentProvider,
|
|
11
|
+
u as ExperimentRunner,
|
|
12
|
+
c as Flip,
|
|
13
|
+
p as Icons,
|
|
14
|
+
P as MicCheck,
|
|
14
15
|
g as Param,
|
|
15
|
-
|
|
16
|
+
C as PlainInput,
|
|
16
17
|
T as ProlificEnding,
|
|
17
18
|
d as Quest,
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
D as RDKCanvas,
|
|
20
|
+
S as RandomDotKinematogram,
|
|
20
21
|
h as RequestFilePermission,
|
|
21
22
|
x as Slide,
|
|
22
23
|
E as THEME,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
f as Text,
|
|
25
|
+
k as ThemeContext,
|
|
26
|
+
B as ToastContainer,
|
|
26
27
|
F as Tutorial,
|
|
27
28
|
v as Upload,
|
|
28
|
-
|
|
29
|
+
A as Zoom,
|
|
29
30
|
R as arrayFlattener,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
_ as canvasCountdown,
|
|
32
|
+
I as chunk,
|
|
33
|
+
K as collapseToast,
|
|
34
|
+
M as cssTransition,
|
|
35
|
+
b as getBackendUrl,
|
|
36
|
+
y as getInitialParticipant,
|
|
37
|
+
L as getParam,
|
|
38
|
+
U as getPlatform,
|
|
39
|
+
w as getSimulation,
|
|
40
|
+
G as halton,
|
|
41
|
+
q as isDesktop,
|
|
41
42
|
H as isFullscreen,
|
|
42
|
-
|
|
43
|
+
N as mapDDMChoice,
|
|
43
44
|
Q as noopSimulate,
|
|
44
45
|
Z as normal,
|
|
45
46
|
j as now,
|
|
46
47
|
z as orchestrateSimulation,
|
|
47
48
|
J as pipe,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
O as poisson,
|
|
50
|
+
V as registerArrayExtensions,
|
|
51
|
+
X as registerComponentParams,
|
|
52
|
+
Y as registerExperimentParams,
|
|
53
|
+
$ as registerFlattener,
|
|
54
|
+
W as registerSimulation,
|
|
55
|
+
aa as resolveSimulation,
|
|
56
|
+
sa as sample,
|
|
57
|
+
ea as sampleParticipants,
|
|
58
|
+
ta as seedDistributions,
|
|
59
|
+
ia as setBackendUrl,
|
|
60
|
+
na as shuffle,
|
|
61
|
+
ra as simulateDDMTrial,
|
|
62
|
+
oa as simulateParticipant,
|
|
63
|
+
la as sobol,
|
|
64
|
+
ma as subsetExperimentByParam,
|
|
65
|
+
ua as t,
|
|
66
|
+
ca as toast,
|
|
67
|
+
pa as uniform,
|
|
68
|
+
Pa as useTheme,
|
|
68
69
|
ga as useToast,
|
|
69
|
-
|
|
70
|
+
Ca as useToastContainer,
|
|
70
71
|
Ta as useTutorialSlide
|
|
71
72
|
};
|