@adriansteffan/reactive 0.0.29 → 0.0.31

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Adrian Steffan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -21,12 +21,20 @@ Then follow the instructions shown there and in the created `README.md`
21
21
 
22
22
  ### Usage
23
23
 
24
- For now, refer to the `App.tsx` in the template project to find out how to define an experiment, and add custom trials and questions!
24
+ For now, refer to the `Experiment.tsx` in the template project to find out how to define an experiment, and add custom trials and questions!
25
25
 
26
26
  Premade components available so far:
27
27
 
28
28
  * Text: A simple display of Text and a Button
29
29
  * MicCheck: used to test the voice recording feature and choose a preferred microphone to use
30
+ * CanvasBlock: TODO DOC
31
+ * IF_BLOCK: TODO DOC
32
+ * IF_GOTO: TODO DOC
33
+ * MARKER: TODO DOC
34
+ * UPDATE_STORE: TODO DOC
35
+ * StoreUI: TODO DOC
36
+ * DeviceCheck: TODO DOC
37
+ * ProlificEnd: TODO DOC
30
38
  * Quest: SurveyJS questionnaires
31
39
  * ... all questiontypes supported by SurveyJS can be used
32
40
  * voicerecorder: a custom question type that allows participants to record voice
@@ -42,7 +42,7 @@ function J0(d, h) {
42
42
  (f, g) => d.slice(g * p, g * p + p)
43
43
  );
44
44
  }
45
- function v5() {
45
+ function C5() {
46
46
  typeof Array.prototype.sample != "function" && (Array.prototype.sample = function(d) {
47
47
  return $0(this, d);
48
48
  }), typeof Array.prototype.shuffle != "function" && (Array.prototype.shuffle = function() {
@@ -376,7 +376,7 @@ function br() {
376
376
  function zs() {
377
377
  return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement);
378
378
  }
379
- function b5() {
379
+ function x5() {
380
380
  return window.electronAPI !== void 0;
381
381
  }
382
382
  const Vl = [];
@@ -447,7 +447,7 @@ function s1(d) {
447
447
  function ug(d, h) {
448
448
  lg[d] = h;
449
449
  }
450
- function C5(d) {
450
+ function w5(d) {
451
451
  s1(d), _c.length = 0, d.forEach((g) => {
452
452
  _c.push({
453
453
  type: g.type ?? "NoTypeSpecified",
@@ -478,7 +478,7 @@ function C5(d) {
478
478
  }
479
479
  return f;
480
480
  }
481
- function x5(d) {
481
+ function P5(d) {
482
482
  return d <= 0 ? [] : Array.from({ length: d }, (h, p) => {
483
483
  const f = d - p;
484
484
  return {
@@ -70879,7 +70879,7 @@ var Yc;
70879
70879
  d.UTF8 = "utf8", d.ASCII = "ascii", d.UTF16 = "utf16";
70880
70880
  })(Yc || (Yc = {}));
70881
70881
  const Yi = na("Filesystem", {
70882
- web: () => import("./web-Crj4uOnK.js").then((d) => new d.FilesystemWeb())
70882
+ web: () => import("./web-GcUUyn5k.js").then((d) => new d.FilesystemWeb())
70883
70883
  });
70884
70884
  ug("Upload", [
70885
70885
  {
@@ -70918,22 +70918,27 @@ function ym(d) {
70918
70918
  return [f, ...g].join(`
70919
70919
  `);
70920
70920
  }
70921
- function Fx(d, h, p, f) {
70922
- const g = p.flatMap((C) => {
70923
- var w;
70924
- const x = (w = d.find((V) => V.name === C)) == null ? void 0 : w.responseData;
70925
- return Array.isArray(x) ? x.map((V) => ({
70926
- block: C,
70927
- ...V
70921
+ const Fx = {
70922
+ CanvasBlock: (d) => {
70923
+ const h = d.responseData;
70924
+ return Array.isArray(h) ? h.map((p) => ({
70925
+ block: d.name,
70926
+ ...p
70928
70927
  })) : [];
70929
- }).map((C) => f ? f(C) : C);
70928
+ }
70929
+ }, qx = ({ responseData: d, ...h }) => ({ ...h, ...Object.entries(d || {}).reduce((p, [f, g]) => ({ ...p, [`data_${f}`]: g }), {}) });
70930
+ function Bx(d, h, p, f, g) {
70931
+ const C = p.flatMap((x) => d.filter((V) => V.name === x).flatMap((V) => {
70932
+ const b = V.type && f[V.type];
70933
+ return b ? b(V) : qx(V);
70934
+ })).map((x) => g ? g(x) : x);
70930
70935
  return {
70931
70936
  filename: h,
70932
70937
  encoding: "utf8",
70933
- content: ym(g)
70938
+ content: ym(C)
70934
70939
  };
70935
70940
  }
70936
- const qx = () => {
70941
+ const Hx = () => {
70937
70942
  const d = window.electronAPI;
70938
70943
  return {
70939
70944
  directoryExists: async (h) => {
@@ -70947,7 +70952,7 @@ const qx = () => {
70947
70952
  await d.saveFile(h, p, f);
70948
70953
  }
70949
70954
  };
70950
- }, Bx = (d) => {
70955
+ }, Qx = (d) => {
70951
70956
  const h = (p) => d ? p ? `${d}/${p}` : d : p;
70952
70957
  return {
70953
70958
  directoryExists: async (p) => {
@@ -71001,17 +71006,17 @@ const qx = () => {
71001
71006
  });
71002
71007
  }
71003
71008
  };
71004
- }, Hx = (d) => {
71009
+ }, Ux = (d) => {
71005
71010
  const h = _l();
71006
71011
  switch (h) {
71007
71012
  case "desktop":
71008
- return { backend: qx(), type: h };
71013
+ return { backend: Hx(), type: h };
71009
71014
  case "mobile":
71010
- return { backend: Bx(d), type: h };
71015
+ return { backend: Qx(d), type: h };
71011
71016
  case "web":
71012
71017
  return { backend: null, type: h };
71013
71018
  }
71014
- }, Qx = async (d, h) => {
71019
+ }, zx = async (d, h) => {
71015
71020
  let p = h;
71016
71021
  if (await d.directoryExists(p)) {
71017
71022
  let f = 1;
@@ -71020,14 +71025,14 @@ const qx = () => {
71020
71025
  }
71021
71026
  return p;
71022
71027
  };
71023
- function Ux({
71028
+ function Wx({
71024
71029
  data: d,
71025
71030
  next: h,
71026
71031
  store: p,
71027
71032
  sessionID: f,
71028
71033
  generateFiles: g,
71029
71034
  sessionCSVBuilder: C,
71030
- trialCSVBuilders: x,
71035
+ trialCSVBuilder: x,
71031
71036
  uploadRaw: w = !0,
71032
71037
  autoUpload: V = !1,
71033
71038
  androidFolderName: b
@@ -71091,12 +71096,13 @@ function Ux({
71091
71096
  });
71092
71097
  }
71093
71098
  if (x)
71094
- for (const Q of x)
71099
+ for (const Q of x.builders)
71095
71100
  M.push(
71096
- Fx(
71101
+ Bx(
71097
71102
  d,
71098
71103
  `${L}${Q.filename}.csv`,
71099
71104
  Q.trials ?? [],
71105
+ { ...Fx, ...x.flatteners },
71100
71106
  Q.fun
71101
71107
  )
71102
71108
  );
@@ -71109,12 +71115,12 @@ function Ux({
71109
71115
  h({});
71110
71116
  return;
71111
71117
  }
71112
- const { backend: G, type: H } = Hx(b);
71118
+ const { backend: G, type: H } = Ux(b);
71113
71119
  if (H === "web")
71114
71120
  A.mutate(Q);
71115
71121
  else if (G)
71116
71122
  try {
71117
- const B = await Qx(G, L);
71123
+ const B = await zx(G, L);
71118
71124
  await G.createDirectory(B);
71119
71125
  for (const ee of M)
71120
71126
  await G.saveFile(ee.filename, ee.content, B);
@@ -71182,9 +71188,9 @@ var Wh;
71182
71188
  d.None = "NONE", d.Slide = "SLIDE", d.Fade = "FADE";
71183
71189
  })(Wh || (Wh = {}));
71184
71190
  const vm = na("StatusBar"), bm = na("ImmersiveMode", {
71185
- web: () => import("./web-D4yetCSC.js").then((d) => new d.ImmersiveModeWeb())
71191
+ web: () => import("./web-D0E0X8r4.js").then((d) => new d.ImmersiveModeWeb())
71186
71192
  });
71187
- function zx({
71193
+ function $x({
71188
71194
  content: d,
71189
71195
  buttonText: h,
71190
71196
  next: p,
@@ -71235,7 +71241,7 @@ function zx({
71235
71241
  }
71236
71242
  );
71237
71243
  }
71238
- function Wx({
71244
+ function Gx({
71239
71245
  next: d,
71240
71246
  delayMs: h = 0
71241
71247
  }) {
@@ -71286,7 +71292,7 @@ function bi() {
71286
71292
  return f;
71287
71293
  }
71288
71294
  const Xs = (d) => typeof d == "number" && !isNaN(d), no = (d) => typeof d == "string", Gr = (d) => typeof d == "function", El = (d) => no(d) || Gr(d) ? d : null, Xc = (d) => _o(d) || no(d) || Gr(d) || Xs(d);
71289
- function $x(d, h, p) {
71295
+ function Zx(d, h, p) {
71290
71296
  p === void 0 && (p = 300);
71291
71297
  const { scrollHeight: f, style: g } = d;
71292
71298
  requestAnimationFrame(() => {
@@ -71307,7 +71313,7 @@ function Ql(d) {
71307
71313
  I.classList.add(...L), I.addEventListener("animationend", M), I.addEventListener("animationcancel", M);
71308
71314
  }, []), tr(() => {
71309
71315
  const I = D.current, L = () => {
71310
- I.removeEventListener("animationend", L), g ? $x(I, S, C) : S();
71316
+ I.removeEventListener("animationend", L), g ? Zx(I, S, C) : S();
71311
71317
  };
71312
71318
  k || (b ? L() : (P.current = 1, I.className += ` ${A}`, I.addEventListener("animationend", L)));
71313
71319
  }, [k]), tt.createElement(tt.Fragment, null, w);
@@ -71318,7 +71324,7 @@ function $h(d, h) {
71318
71324
  }
71319
71325
  const Ir = /* @__PURE__ */ new Map();
71320
71326
  let ea = [];
71321
- const ep = /* @__PURE__ */ new Set(), Gx = (d) => ep.forEach((h) => h(d)), xm = () => Ir.size > 0;
71327
+ const ep = /* @__PURE__ */ new Set(), Jx = (d) => ep.forEach((h) => h(d)), xm = () => Ir.size > 0;
71322
71328
  function wm(d, h) {
71323
71329
  var p;
71324
71330
  if (h) return !((p = Ir.get(h)) == null || !p.isToastActive(d));
@@ -71337,7 +71343,7 @@ function Gh(d, h) {
71337
71343
  h != null && h != null && h.containerId ? (h == null ? void 0 : h.containerId) === p.id && p.toggle(d, h == null ? void 0 : h.id) : p.toggle(d, h == null ? void 0 : h.id);
71338
71344
  });
71339
71345
  }
71340
- function Zx(d) {
71346
+ function Kx(d) {
71341
71347
  const { subscribe: h, getSnapshot: p, setProps: f } = dt(function(C) {
71342
71348
  const x = C.containerId || 1;
71343
71349
  return { subscribe(w) {
@@ -71387,7 +71393,7 @@ function Zx(d) {
71387
71393
  }, setToggle: (H, B) => {
71388
71394
  M.get(H).toggle = B;
71389
71395
  }, isToastActive: (H) => P.some((B) => B === H), getSnapshot: () => I };
71390
- }(x, C, Gx);
71396
+ }(x, C, Jx);
71391
71397
  Ir.set(x, V);
71392
71398
  const b = V.observe(w);
71393
71399
  return ea.forEach((S) => Pm(S.content, S.options)), ea = [], () => {
@@ -71412,7 +71418,7 @@ function Zx(d) {
71412
71418
  }), Array.from(x, (w) => C(w[0], w[1]));
71413
71419
  }, isToastActive: wm, count: g == null ? void 0 : g.length };
71414
71420
  }
71415
- function Jx(d) {
71421
+ function Yx(d) {
71416
71422
  const [h, p] = Vt(!1), [f, g] = Vt(!1), C = dt(null), x = dt({ start: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, didMove: !1 }).current, { autoClose: w, pauseOnHover: V, closeToast: b, onClick: S, closeOnClick: D } = d;
71417
71423
  var k, W;
71418
71424
  function q() {
@@ -71452,7 +71458,7 @@ function Jx(d) {
71452
71458
  S && S(M), x.canCloseOnClick && b();
71453
71459
  }), { playToast: q, pauseToast: A, isRunning: h, preventExitTransition: f, toastRef: C, eventHandlers: L };
71454
71460
  }
71455
- function Kx(d) {
71461
+ function Xx(d) {
71456
71462
  let { delay: h, isRunning: p, closeToast: f, type: g = "default", hide: C, className: x, style: w, controlledProgress: V, progress: b, rtl: S, isIn: D, theme: k } = d;
71457
71463
  const W = C || V && b === 0, q = { ...w, animationDuration: `${h}ms`, animationPlayState: p ? "running" : "paused" };
71458
71464
  V && (q.transform = `scaleX(${b})`);
@@ -71461,16 +71467,16 @@ function Kx(d) {
71461
71467
  } };
71462
71468
  return tt.createElement("div", { className: "Toastify__progress-bar--wrp", "data-hidden": W }, tt.createElement("div", { className: `Toastify__progress-bar--bg Toastify__progress-bar-theme--${k} Toastify__progress-bar--${g}` }), tt.createElement("div", { role: "progressbar", "aria-hidden": W ? "true" : "false", "aria-label": "notification timer", className: P, style: q, ...I }));
71463
71469
  }
71464
- let Yx = 1;
71465
- const Sm = () => "" + Yx++;
71466
- function Xx(d) {
71470
+ let e5 = 1;
71471
+ const Sm = () => "" + e5++;
71472
+ function t5(d) {
71467
71473
  return d && (no(d.toastId) || Xs(d.toastId)) ? d.toastId : Sm();
71468
71474
  }
71469
71475
  function Us(d, h) {
71470
71476
  return Pm(d, h), h.toastId;
71471
71477
  }
71472
71478
  function Nl(d, h) {
71473
- return { ...h, type: h && h.type || d, toastId: Xx(h) };
71479
+ return { ...h, type: h && h.type || d, toastId: t5(h) };
71474
71480
  }
71475
71481
  function bl(d) {
71476
71482
  return (h, p) => Us(h, Nl(d, p));
@@ -71526,7 +71532,7 @@ Rt.loading = (d, h) => Us(d, Nl("default", { isLoading: !0, autoClose: !1, close
71526
71532
  ep.delete(d);
71527
71533
  };
71528
71534
  }, Rt.play = (d) => Gh(!0, d), Rt.pause = (d) => Gh(!1, d);
71529
- const e5 = typeof window < "u" ? sg : tr, Cl = (d) => {
71535
+ const r5 = typeof window < "u" ? sg : tr, Cl = (d) => {
71530
71536
  let { theme: h, type: p, isLoading: f, ...g } = d;
71531
71537
  return tt.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: h === "colored" ? "currentColor" : `var(--toastify-icon-color-${p})`, ...g });
71532
71538
  }, kc = { info: function(d) {
@@ -71539,8 +71545,8 @@ const e5 = typeof window < "u" ? sg : tr, Cl = (d) => {
71539
71545
  return tt.createElement(Cl, { ...d }, tt.createElement("path", { d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" }));
71540
71546
  }, spinner: function() {
71541
71547
  return tt.createElement("div", { className: "Toastify__spinner" });
71542
- } }, t5 = (d) => {
71543
- const { isRunning: h, preventExitTransition: p, toastRef: f, eventHandlers: g, playToast: C } = Jx(d), { closeButton: x, children: w, autoClose: V, onClick: b, type: S, hideProgressBar: D, closeToast: k, transition: W, position: q, className: A, style: P, bodyClassName: I, bodyStyle: L, progressClassName: M, progressStyle: K, updateId: J, role: Q, progress: G, rtl: H, toastId: B, deleteToast: ee, isIn: ie, isLoading: ae, closeOnClick: $, theme: te } = d, X = bi("Toastify__toast", `Toastify__toast-theme--${te}`, `Toastify__toast--${S}`, { "Toastify__toast--rtl": H }, { "Toastify__toast--close-on-click": $ }), N = Gr(A) ? A({ rtl: H, position: q, type: S, defaultClassName: X }) : bi(X, A), ue = function(Le) {
71548
+ } }, n5 = (d) => {
71549
+ const { isRunning: h, preventExitTransition: p, toastRef: f, eventHandlers: g, playToast: C } = Yx(d), { closeButton: x, children: w, autoClose: V, onClick: b, type: S, hideProgressBar: D, closeToast: k, transition: W, position: q, className: A, style: P, bodyClassName: I, bodyStyle: L, progressClassName: M, progressStyle: K, updateId: J, role: Q, progress: G, rtl: H, toastId: B, deleteToast: ee, isIn: ie, isLoading: ae, closeOnClick: $, theme: te } = d, X = bi("Toastify__toast", `Toastify__toast-theme--${te}`, `Toastify__toast--${S}`, { "Toastify__toast--rtl": H }, { "Toastify__toast--close-on-click": $ }), N = Gr(A) ? A({ rtl: H, position: q, type: S, defaultClassName: X }) : bi(X, A), ue = function(Le) {
71544
71550
  let { theme: xe, type: Re, isLoading: We, icon: Fe } = Le, be = null;
71545
71551
  const qe = { theme: xe, type: Re };
71546
71552
  return Fe === !1 || (Gr(Fe) ? be = Fe({ ...qe, isLoading: We }) : _o(Fe) ? be = Mc(Fe, qe) : We ? be = kc.spinner() : ((ot) => ot in kc)(Re) && (be = kc[Re](qe))), be;
@@ -71551,17 +71557,17 @@ const e5 = typeof window < "u" ? sg : tr, Cl = (d) => {
71551
71557
  return tt.createElement("button", { className: `Toastify__close-button Toastify__close-button--${Re}`, type: "button", onClick: (Fe) => {
71552
71558
  Fe.stopPropagation(), xe(Fe);
71553
71559
  }, "aria-label": We }, tt.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, tt.createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" })));
71554
- }(De)), tt.createElement(W, { isIn: ie, done: ee, position: q, preventExitTransition: p, nodeRef: f, playToast: C }, tt.createElement("div", { id: B, onClick: b, "data-in": ie, className: N, ...g, style: P, ref: f }, tt.createElement("div", { ...ie && { role: Q }, className: Gr(I) ? I({ type: S }) : bi("Toastify__toast-body", I), style: L }, ue != null && tt.createElement("div", { className: bi("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !ae }) }, ue), tt.createElement("div", null, w)), ce, tt.createElement(Kx, { ...J && !he ? { key: `pb-${J}` } : {}, rtl: H, theme: te, delay: V, isRunning: h, isIn: ie, closeToast: k, hide: D, type: S, style: K, className: M, controlledProgress: he, progress: G || 0 })));
71560
+ }(De)), tt.createElement(W, { isIn: ie, done: ee, position: q, preventExitTransition: p, nodeRef: f, playToast: C }, tt.createElement("div", { id: B, onClick: b, "data-in": ie, className: N, ...g, style: P, ref: f }, tt.createElement("div", { ...ie && { role: Q }, className: Gr(I) ? I({ type: S }) : bi("Toastify__toast-body", I), style: L }, ue != null && tt.createElement("div", { className: bi("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !ae }) }, ue), tt.createElement("div", null, w)), ce, tt.createElement(Xx, { ...J && !he ? { key: `pb-${J}` } : {}, rtl: H, theme: te, delay: V, isRunning: h, isIn: ie, closeToast: k, hide: D, type: S, style: K, className: M, controlledProgress: he, progress: G || 0 })));
71555
71561
  }, Ul = function(d, h) {
71556
71562
  return h === void 0 && (h = !1), { enter: `Toastify--animate Toastify__${d}-enter`, exit: `Toastify--animate Toastify__${d}-exit`, appendPosition: h };
71557
- }, r5 = Ql(Ul("bounce", !0));
71563
+ }, i5 = Ql(Ul("bounce", !0));
71558
71564
  Ql(Ul("slide", !0));
71559
71565
  Ql(Ul("zoom"));
71560
71566
  Ql(Ul("flip"));
71561
- const n5 = { position: "top-right", transition: r5, autoClose: 5e3, closeButton: !0, pauseOnHover: !0, pauseOnFocusLoss: !0, draggable: "touch", draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" };
71562
- function i5(d) {
71563
- let h = { ...n5, ...d };
71564
- const p = d.stacked, [f, g] = Vt(!0), C = dt(null), { getToastToRender: x, isToastActive: w, count: V } = Zx(h), { className: b, style: S, rtl: D, containerId: k } = h;
71567
+ const o5 = { position: "top-right", transition: i5, autoClose: 5e3, closeButton: !0, pauseOnHover: !0, pauseOnFocusLoss: !0, draggable: "touch", draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" };
71568
+ function s5(d) {
71569
+ let h = { ...o5, ...d };
71570
+ const p = d.stacked, [f, g] = Vt(!0), C = dt(null), { getToastToRender: x, isToastActive: w, count: V } = Kx(h), { className: b, style: S, rtl: D, containerId: k } = h;
71565
71571
  function W(A) {
71566
71572
  const P = bi("Toastify__toast-container", `Toastify__toast-container--${A}`, { "Toastify__toast-container--rtl": D });
71567
71573
  return Gr(b) ? b({ position: A, rtl: D, defaultClassName: P }) : bi(P, El(b));
@@ -71569,7 +71575,7 @@ function i5(d) {
71569
71575
  function q() {
71570
71576
  p && (g(!0), Rt.play());
71571
71577
  }
71572
- return e5(() => {
71578
+ return r5(() => {
71573
71579
  if (p) {
71574
71580
  var A;
71575
71581
  const P = C.current.querySelectorAll('[data-in="true"]'), I = 12, L = (A = h.position) == null ? void 0 : A.includes("top");
@@ -71587,11 +71593,11 @@ function i5(d) {
71587
71593
  const I = P.length ? { ...S } : { ...S, pointerEvents: "none" };
71588
71594
  return tt.createElement("div", { className: W(A), style: I, key: `container-${A}` }, P.map((L) => {
71589
71595
  let { content: M, props: K } = L;
71590
- return tt.createElement(t5, { ...K, stacked: p, collapseAll: q, isIn: w(K.toastId, K.containerId), style: K.style, key: `toast-${K.key}` }, M);
71596
+ return tt.createElement(n5, { ...K, stacked: p, collapseAll: q, isIn: w(K.toastId, K.containerId), style: K.style, key: `toast-${K.key}` }, M);
71591
71597
  }));
71592
71598
  }));
71593
71599
  }
71594
- const o5 = ({
71600
+ const a5 = ({
71595
71601
  paramRegistry: d,
71596
71602
  timelineRepresentation: h
71597
71603
  }) => {
@@ -72085,18 +72091,18 @@ const o5 = ({
72085
72091
  }
72086
72092
  ) })
72087
72093
  ] });
72088
- }, s5 = new Z1();
72089
- function w5({ children: d, disableSettings: h }) {
72094
+ }, l5 = new Z1();
72095
+ function S5({ children: d, disableSettings: h }) {
72090
72096
  return window.location.pathname.endsWith("/settings") && !h ? /* @__PURE__ */ z.jsx(
72091
- o5,
72097
+ a5,
72092
72098
  {
72093
72099
  paramRegistry: Fc.getRegistry(),
72094
72100
  timelineRepresentation: Fc.getTimelineRepresentation()
72095
72101
  }
72096
- ) : /* @__PURE__ */ z.jsxs(Y1, { client: s5, children: [
72102
+ ) : /* @__PURE__ */ z.jsxs(Y1, { client: l5, children: [
72097
72103
  d,
72098
72104
  /* @__PURE__ */ z.jsx(
72099
- i5,
72105
+ s5,
72100
72106
  {
72101
72107
  position: "top-center",
72102
72108
  autoClose: 3e3,
@@ -72196,7 +72202,7 @@ function jm(d) {
72196
72202
  }
72197
72203
  return w(d), { instructions: h, markers: p };
72198
72204
  }
72199
- function a5({ next: d }) {
72205
+ function u5({ next: d }) {
72200
72206
  const [h, p] = Vt("checking");
72201
72207
  return tr(() => {
72202
72208
  if (h !== "checking") return;
@@ -72251,13 +72257,13 @@ function a5({ next: d }) {
72251
72257
  )
72252
72258
  ] });
72253
72259
  }
72254
- function l5(d) {
72260
+ function c5(d) {
72255
72261
  return typeof d == "function";
72256
72262
  }
72257
- function u5(d) {
72263
+ function p5(d) {
72258
72264
  return typeof d == "object" && d !== null && typeof d.draw == "function";
72259
72265
  }
72260
- function c5({
72266
+ function f5({
72261
72267
  next: d,
72262
72268
  updateStore: h,
72263
72269
  timeline: p,
@@ -72276,13 +72282,13 @@ function c5({
72276
72282
  (ae) => {
72277
72283
  if (ae.type !== "ExecuteContent") return null;
72278
72284
  const $ = ae.content;
72279
- if (l5($))
72285
+ if (c5($))
72280
72286
  try {
72281
72287
  return $(A.current, P.current);
72282
72288
  } catch (te) {
72283
72289
  return console.error("Error executing dynamic canvas slide generator:", te), null;
72284
72290
  }
72285
- else if (u5($))
72291
+ else if (p5($))
72286
72292
  return $;
72287
72293
  return console.warn(
72288
72294
  "ExecuteContent instruction content is not a valid CanvasSlide or Generator:",
@@ -72514,7 +72520,7 @@ function c5({
72514
72520
  }
72515
72521
  );
72516
72522
  }
72517
- function p5({
72523
+ function d5({
72518
72524
  check: d,
72519
72525
  content: h = /* @__PURE__ */ z.jsx("div", { children: "Your device doesn't meet the requirements for this experiment." }),
72520
72526
  data: p,
@@ -72581,7 +72587,7 @@ function p5({
72581
72587
  })();
72582
72588
  }, [d, p, g, C]), x ? /* @__PURE__ */ z.jsx("div", { className: "max-w-prose mx-auto mt-20 mb-20 px-4", children: /* @__PURE__ */ z.jsx("article", { className: "prose prose-2xl prose-slate text-xl prose-a:text-blue-600 prose-a:underline prose-h1:text-4xl prose-h1:mb-10 prose-h1:font-bold prose-p:mb-4 prose-strong:font-bold text-black leading-relaxed", children: h }) }) : null;
72583
72589
  }
72584
- function f5({
72590
+ function h5({
72585
72591
  next: d,
72586
72592
  updateStore: h,
72587
72593
  store: p,
@@ -72754,26 +72760,26 @@ function f5({
72754
72760
  ) })
72755
72761
  ] });
72756
72762
  }
72757
- const d5 = {
72763
+ const g5 = {
72758
72764
  Text: rp,
72759
72765
  ProlificEnding: c1,
72760
- EnterFullscreen: zx,
72761
- ExitFullscreen: Wx,
72766
+ EnterFullscreen: $x,
72767
+ ExitFullscreen: Gx,
72762
72768
  Quest: V1,
72763
- Upload: Ux,
72769
+ Upload: Wx,
72764
72770
  MicrophoneCheck: S1,
72765
72771
  PlainInput: u1,
72766
- RequestFilePermission: a5,
72767
- CanvasBlock: c5,
72768
- CheckDevice: p5,
72769
- StoreUI: f5
72770
- }, h5 = {
72772
+ RequestFilePermission: u5,
72773
+ CanvasBlock: f5,
72774
+ CheckDevice: d5,
72775
+ StoreUI: h5
72776
+ }, m5 = {
72771
72777
  voicerecorder: w1
72772
72778
  };
72773
72779
  function Jh(d) {
72774
72780
  return typeof d == "object" && d !== null && typeof d.type == "string";
72775
72781
  }
72776
- function P5({
72782
+ function j5({
72777
72783
  timeline: d,
72778
72784
  config: h = {
72779
72785
  showProgressBar: !1
@@ -72815,7 +72821,7 @@ function P5({
72815
72821
  params: H
72816
72822
  }
72817
72823
  }];
72818
- })()), [V, b] = Vt(0), S = dt(br()), D = dt({}), k = { ...d5, ...p }, W = { ...h5, ...f }, q = Nc(() => {
72824
+ })()), [V, b] = Vt(0), S = dt(br()), D = dt({}), k = { ...g5, ...p }, W = { ...m5, ...f }, q = Nc(() => {
72819
72825
  const J = g.instructions.length;
72820
72826
  return J > 0 ? C / J : 0;
72821
72827
  }, [C, g.instructions]);
@@ -72965,35 +72971,35 @@ function P5({
72965
72971
  ] });
72966
72972
  }
72967
72973
  export {
72968
- c5 as C,
72974
+ f5 as C,
72969
72975
  Yc as E,
72970
72976
  S1 as M,
72971
72977
  Fc as P,
72972
72978
  V1 as Q,
72973
- a5 as R,
72979
+ u5 as R,
72974
72980
  rp as T,
72975
- Ux as U,
72981
+ Wx as U,
72976
72982
  ag as W,
72977
72983
  G0 as a,
72978
72984
  i1 as b,
72979
72985
  J0 as c,
72980
- b5 as d,
72986
+ x5 as d,
72981
72987
  _l as e,
72982
72988
  s1 as f,
72983
72989
  Ws as g,
72984
72990
  ug as h,
72985
72991
  zs as i,
72986
- C5 as j,
72987
- x5 as k,
72992
+ w5 as j,
72993
+ P5 as k,
72988
72994
  u1 as l,
72989
72995
  c1 as m,
72990
72996
  br as n,
72991
- zx as o,
72997
+ $x as o,
72992
72998
  Z0 as p,
72993
- Wx as q,
72994
- v5 as r,
72999
+ Gx as q,
73000
+ C5 as r,
72995
73001
  $0 as s,
72996
- w5 as t,
72997
- P5 as u,
72998
- p5 as v
73002
+ S5 as t,
73003
+ j5 as u,
73004
+ d5 as v
72999
73005
  };
package/dist/mod.d.ts CHANGED
@@ -271,11 +271,14 @@ declare interface UpdateStoreItem {
271
271
  fun: StoreUpdateFunction;
272
272
  }
273
273
 
274
- export declare function Upload({ data, next, store, sessionID, generateFiles, sessionCSVBuilder, trialCSVBuilders, uploadRaw, autoUpload, androidFolderName, }: BaseComponentProps & {
274
+ export declare function Upload({ data, next, store, sessionID, generateFiles, sessionCSVBuilder, trialCSVBuilder, uploadRaw, autoUpload, androidFolderName, }: BaseComponentProps & {
275
275
  sessionID?: string | null;
276
276
  generateFiles: (sessionID: string, data: TrialData[], store?: Store) => FileUpload[];
277
277
  sessionCSVBuilder: CSVBuilder;
278
- trialCSVBuilders: CSVBuilder[];
278
+ trialCSVBuilder: {
279
+ flatteners: Record<string, ((item: TrialData) => Record<string, any>[])>;
280
+ builders: CSVBuilder[];
281
+ };
279
282
  uploadRaw: boolean;
280
283
  autoUpload: boolean;
281
284
  androidFolderName?: string;
@@ -1,4 +1,4 @@
1
- import { C as e, v as r, o as n, q as i, t, u as o, M as l, P as m, l as p, m as c, Q as u, R as P, T as x, U as E, k as g, c as f, g as k, e as C, d, i as h, n as v, p as F, r as R, h as q, f as w, s as y, a as B, j as D } from "./mod-BY9yD0Pz.js";
1
+ import { C as e, v as r, o as n, q as i, t, u as o, M as l, P as m, l as p, m as c, Q as u, R as P, T as x, U as E, k as g, c as f, g as k, e as C, d, i as h, n as v, p as F, r as R, h as q, f as w, s as y, a as B, j as D } from "./mod-OYK5S6rI.js";
2
2
  export {
3
3
  e as CanvasBlock,
4
4
  r as CheckDevice,