@adriansteffan/reactive 0.1.1 → 0.1.2

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/dist/mod.d.ts CHANGED
@@ -1,7 +1,12 @@
1
1
  import { ComponentType } from 'react';
2
+ import { CSSProperties } from 'react';
2
3
  import { default as default_2 } from 'react';
4
+ import { ForwardRefExoticComponent } from 'react';
3
5
  import { JSX as JSX_2 } from 'react/jsx-runtime';
4
6
  import { ReactNode } from 'react';
7
+ import { RefAttributes } from 'react';
8
+
9
+ declare type ApertureShape = 'circle' | 'ellipse' | 'square' | 'rectangle';
5
10
 
6
11
  export declare function arrayFlattener(item: TrialData): any[];
7
12
 
@@ -163,6 +168,8 @@ export declare const MicCheck: ({ next }: {
163
168
  next: (data: object) => void;
164
169
  }) => JSX_2.Element;
165
170
 
171
+ export declare type NoiseMovement = 'randomTeleport' | 'randomWalk' | 'randomDirection';
172
+
166
173
  export declare const noopSimulate: SimulateFunction;
167
174
 
168
175
  export declare function now(): number;
@@ -212,6 +219,96 @@ export declare function Quest({ next, surveyJson, customQuestions, }: {
212
219
  customQuestions?: ComponentsMap;
213
220
  }): JSX_2.Element;
214
221
 
222
+ export declare const RandomDotKinematogram: (rawProps: RDKProps) => JSX_2.Element;
223
+
224
+ export declare const RDKCanvas: ForwardRefExoticComponent<RDKCanvasProps & RefAttributes<RDKCanvasHandle>>;
225
+
226
+ export declare interface RDKCanvasHandle {
227
+ getStats: () => {
228
+ framesDisplayed: number;
229
+ measuredRefreshRate: number | null;
230
+ };
231
+ }
232
+
233
+ export declare interface RDKCanvasProps {
234
+ width: number;
235
+ height: number;
236
+ dotCount?: number;
237
+ dotSetCount?: number;
238
+ direction?: number;
239
+ coherence?: number;
240
+ opposite?: number;
241
+ speed?: number;
242
+ dotLifetime?: number;
243
+ updateRate?: number;
244
+ dotRadius?: number;
245
+ dotCharacter?: string;
246
+ dotColor?: string;
247
+ coherentDotColor?: string;
248
+ backgroundColor?: string;
249
+ apertureShape?: ApertureShape;
250
+ apertureWidth?: number;
251
+ apertureHeight?: number;
252
+ apertureCenterX?: number;
253
+ apertureCenterY?: number;
254
+ reinsertMode?: ReinsertType;
255
+ noiseMovement?: NoiseMovement;
256
+ reassignEveryMs?: number;
257
+ showFixation?: boolean;
258
+ fixationWidth?: number;
259
+ fixationHeight?: number;
260
+ fixationColor?: string;
261
+ fixationThickness?: number;
262
+ showBorder?: boolean;
263
+ borderWidth?: number;
264
+ borderColor?: string;
265
+ /** When true (default), dots are animated and visible. When false, only background (+ fixation if enabled) is shown. */
266
+ active?: boolean;
267
+ /** Seed the refresh-rate estimator (e.g. from a prior calibration). */
268
+ initialRefreshRate?: number;
269
+ style?: CSSProperties;
270
+ className?: string;
271
+ }
272
+
273
+ export declare interface RDKProps extends BaseComponentProps {
274
+ validKeys?: string[];
275
+ correctResponse?: string | string[];
276
+ duration?: number;
277
+ stimulusDuration?: number;
278
+ responseEndsTrial?: boolean;
279
+ dotCount?: number;
280
+ dotSetCount?: number;
281
+ direction?: number;
282
+ coherence?: number;
283
+ opposite?: number;
284
+ speed?: number;
285
+ dotLifetime?: number;
286
+ updateRate?: number;
287
+ dotRadius?: number;
288
+ dotCharacter?: string;
289
+ dotColor?: string;
290
+ coherentDotColor?: string;
291
+ backgroundColor?: string;
292
+ apertureShape?: ApertureShape;
293
+ apertureWidth?: number;
294
+ apertureHeight?: number;
295
+ apertureCenterX?: number;
296
+ apertureCenterY?: number;
297
+ reinsertMode?: ReinsertType;
298
+ noiseMovement?: NoiseMovement;
299
+ reassignEveryMs?: number;
300
+ showFixation?: boolean;
301
+ fixationTime?: number;
302
+ fixationWidth?: number;
303
+ fixationHeight?: number;
304
+ fixationColor?: string;
305
+ fixationThickness?: number;
306
+ showBorder?: boolean;
307
+ borderWidth?: number;
308
+ borderColor?: string;
309
+ responseHint?: string;
310
+ }
311
+
215
312
  /**
216
313
  * Registers array methods on the Array prototype.
217
314
  * Call this function once to make array methods available globally.
@@ -240,6 +337,8 @@ export declare function registerFlattener(type: string, csv: string | null, flat
240
337
 
241
338
  export declare function registerSimulation(type: string, simulate: SimulateFunction, defaultSimulators: Record<string, any>): void;
242
339
 
340
+ declare type ReinsertType = 'random' | 'opposite' | 'oppositeSimple' | 'wrap';
341
+
243
342
  export declare function RequestFilePermission({ next }: BaseComponentProps): JSX_2.Element | null;
244
343
 
245
344
  export declare function resolveSimulation(content: any, data: TrialResult[], store: Store_2): {
@@ -321,6 +420,22 @@ export declare interface TrialData {
321
420
 
322
421
  declare type TrialResult = ComponentResultData | CanvasResultData;
323
422
 
423
+ export declare const Tutorial: ({ next, slides, fadeDuration, finishText, containerClass, nextKey, backKey, theme, }: TutorialProps) => JSX_2.Element;
424
+
425
+ export declare interface TutorialProps extends BaseComponentProps {
426
+ slides: ReactNode[];
427
+ /** Fade duration in seconds (default: 0.3) */
428
+ fadeDuration?: number;
429
+ finishText?: string;
430
+ containerClass?: string;
431
+ /** Key to go forward (default: 'ArrowRight', set to false to disable) */
432
+ nextKey?: string | false;
433
+ /** Key to go back (default: 'ArrowLeft', set to false to disable) */
434
+ backKey?: string | false;
435
+ /** Color mode for dot indicators (default: 'light') */
436
+ theme?: 'light' | 'dark';
437
+ }
438
+
324
439
  declare interface UpdateStoreItem {
325
440
  type: 'UPDATE_STORE';
326
441
  fun: StoreUpdateFunction;
@@ -335,6 +450,21 @@ export declare function Upload({ data, next, store, sessionID, generateFiles, se
335
450
  androidFolderName?: string;
336
451
  }): JSX_2.Element;
337
452
 
453
+ /**
454
+ * Hook for interactive slide components.
455
+ * Call with `{ locked: true }` to start with the next button disabled.
456
+ * Then call `unlock()` when the interaction is complete.
457
+ * Call `unlock({ autoAdvanceMs: 1000 })` to auto-advance after a delay.
458
+ */
459
+ export declare const useTutorialSlide: ({ locked }?: {
460
+ locked?: boolean | undefined;
461
+ }) => {
462
+ setData: (data: Record<string, unknown>) => void;
463
+ unlock: ({ autoAdvanceMs }?: {
464
+ autoAdvanceMs?: number;
465
+ }) => void;
466
+ };
467
+
338
468
  declare interface WhileBlockItem {
339
469
  type: 'WHILE_BLOCK';
340
470
  cond: ConditionalFunction;
@@ -1,53 +1,57 @@
1
- import { H as e, C as t, a as r, c as i, d as n, e as o, f as l, Y as m, z as c, M as u, P as p, g as P, h as g, Q as x, R as d, F as k, T as C, i as E, U as F, X as S, j as T, k as f, l as h, m as v, n as B, o as y, p as I, q as U, r as w, s as D, t as R, u as q, v as A, w as M, x as Q, y as Z, A as b, B as j, D as z, G, I as H, J, K, L, N, O, S as V, V as X, Z as Y, _ } from "./mod-Beb0Bz3s.js";
1
+ import { H as e, C as t, a as i, c as r, d as n, e as o, f as l, Y as m, z as u, M as c, P as p, g, h as P, Q as d, R as x, i as C, j as T, F as k, T as E, k as F, l as S, U as v, X as f, m as h, n as B, o as D, p as R, q as y, r as I, s as U, t as w, u as K, v as q, w as A, x as M, y as Q, A as Z, B as b, D as j, G as z, I as G, J as H, K as J, L, N, O, S as V, V as X, Z as Y, _, $, a0 as W, a1 as aa, a2 as sa } from "./mod-Bb_FAy0j.js";
2
2
  export {
3
3
  e as Bounce,
4
4
  t as CanvasBlock,
5
- r as CheckDevice,
6
- i as EnterFullscreen,
5
+ i as CheckDevice,
6
+ r as EnterFullscreen,
7
7
  n as ExitFullscreen,
8
8
  o as ExperimentProvider,
9
9
  l as ExperimentRunner,
10
10
  m as Flip,
11
- c as Icons,
12
- u as MicCheck,
11
+ u as Icons,
12
+ c as MicCheck,
13
13
  p as Param,
14
- P as PlainInput,
15
- g as ProlificEnding,
16
- x as Quest,
17
- d as RequestFilePermission,
14
+ g as PlainInput,
15
+ P as ProlificEnding,
16
+ d as Quest,
17
+ x as RDKCanvas,
18
+ C as RandomDotKinematogram,
19
+ T as RequestFilePermission,
18
20
  k as Slide,
19
- C as Text,
20
- E as ToastContainer,
21
- F as Upload,
22
- S as Zoom,
23
- T as arrayFlattener,
24
- f as canvasCountdown,
25
- h as chunk,
26
- v as collapseToast,
27
- B as cssTransition,
28
- y as getBackendUrl,
29
- I as getInitialParticipant,
30
- U as getParam,
31
- w as getPlatform,
32
- D as getSimulation,
33
- R as isDesktop,
34
- q as isFullscreen,
35
- A as noopSimulate,
36
- M as now,
37
- Q as orchestrateSimulation,
38
- Z as pipe,
39
- b as registerArrayExtensions,
40
- j as registerComponentParams,
41
- z as registerExperimentParams,
42
- G as registerFlattener,
43
- H as registerSimulation,
44
- J as resolveSimulation,
45
- K as sample,
46
- L as setBackendUrl,
47
- N as shuffle,
48
- O as simulateParticipant,
49
- V as subsetExperimentByParam,
50
- X as toast,
51
- Y as useToast,
52
- _ as useToastContainer
21
+ E as Text,
22
+ F as ToastContainer,
23
+ S as Tutorial,
24
+ v as Upload,
25
+ f as Zoom,
26
+ h as arrayFlattener,
27
+ B as canvasCountdown,
28
+ D as chunk,
29
+ R as collapseToast,
30
+ y as cssTransition,
31
+ I as getBackendUrl,
32
+ U as getInitialParticipant,
33
+ w as getParam,
34
+ K as getPlatform,
35
+ q as getSimulation,
36
+ A as isDesktop,
37
+ M as isFullscreen,
38
+ Q as noopSimulate,
39
+ Z as now,
40
+ b as orchestrateSimulation,
41
+ j as pipe,
42
+ z as registerArrayExtensions,
43
+ G as registerComponentParams,
44
+ H as registerExperimentParams,
45
+ J as registerFlattener,
46
+ L as registerSimulation,
47
+ N as resolveSimulation,
48
+ O as sample,
49
+ V as setBackendUrl,
50
+ X as shuffle,
51
+ Y as simulateParticipant,
52
+ _ as subsetExperimentByParam,
53
+ $ as toast,
54
+ W as useToast,
55
+ aa as useToastContainer,
56
+ sa as useTutorialSlide
53
57
  };