@adriansteffan/reactive 0.0.33 → 0.0.35

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.
@@ -12,7 +12,7 @@ var al = (d, h, p, f) => ({
12
12
  }
13
13
  });
14
14
  import * as pi from "react";
15
- import tt, { useRef as dt, useEffect as tr, useState as Vt, useCallback as qt, createElement as U0, useSyncExternalStore as z0, useLayoutEffect as sg, isValidElement as _o, cloneElement as Mc, useMemo as Nc } from "react";
15
+ import tt, { useRef as dt, useEffect as tr, useState as Vt, useCallback as qt, createElement as U0, useLayoutEffect as sg, useSyncExternalStore as z0, isValidElement as _o, cloneElement as Mc, useMemo as Nc } from "react";
16
16
  import W0 from "react-dom";
17
17
  function $0(d, h = 1) {
18
18
  const p = [];
@@ -1124,61 +1124,62 @@ function rp({
1124
1124
  content: d,
1125
1125
  buttonText: h = "Click me",
1126
1126
  className: p = "",
1127
- next: f,
1128
- animate: g = !1,
1129
- allowedKeys: C = !1
1127
+ containerClass: f = "",
1128
+ next: g,
1129
+ animate: C = !1,
1130
+ allowedKeys: x = !1
1130
1131
  }) {
1131
- const x = dt(0);
1132
+ const w = dt(0);
1132
1133
  tr(() => {
1133
- x.current = br();
1134
- const V = (b) => {
1135
- const S = br();
1136
- if (C === !0 || Array.isArray(C) && C.includes(b.key)) {
1137
- const k = S - x.current;
1138
- f({
1139
- key: b.key,
1140
- time: S,
1141
- reactionTime: k
1134
+ w.current = br();
1135
+ const b = (S) => {
1136
+ const D = br();
1137
+ if (x === !0 || Array.isArray(x) && x.includes(S.key)) {
1138
+ const W = D - w.current;
1139
+ g({
1140
+ key: S.key,
1141
+ time: D,
1142
+ reactionTime: W
1142
1143
  });
1143
1144
  }
1144
1145
  };
1145
- return C && window.addEventListener("keydown", V), () => {
1146
- C && window.removeEventListener("keydown", V);
1146
+ return x && window.addEventListener("keydown", b), () => {
1147
+ x && window.removeEventListener("keydown", b);
1147
1148
  };
1148
- }, [f, C]);
1149
- const w = () => {
1150
- const V = br(), b = V - x.current;
1151
- f({
1149
+ }, [g, x]);
1150
+ const V = () => {
1151
+ const b = br(), S = b - w.current;
1152
+ g({
1152
1153
  key: "button",
1153
- time: V,
1154
- reactionTime: b
1154
+ time: b,
1155
+ reactionTime: S
1155
1156
  });
1156
1157
  };
1157
- return /* @__PURE__ */ z.jsxs("div", { className: `max-w-prose mx-auto ${p} mt-20 mb-20 px-4 `, children: [
1158
+ return /* @__PURE__ */ z.jsx("div", { className: `${f}`, children: /* @__PURE__ */ z.jsxs("div", { className: `max-w-prose mx-auto ${p} mt-20 mb-20 px-4 `, children: [
1158
1159
  /* @__PURE__ */ z.jsx(
1159
1160
  "article",
1160
1161
  {
1161
1162
  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
1162
- ${g ? "animate-slide-down opacity-0" : ""}`,
1163
+ ${C ? "animate-slide-down opacity-0" : ""}`,
1163
1164
  children: d
1164
1165
  }
1165
1166
  ),
1166
1167
  h && /* @__PURE__ */ z.jsx(
1167
1168
  "div",
1168
1169
  {
1169
- className: `mt-16 flex justify-center ${g ? "animate-fade-in opacity-0" : ""}`,
1170
- style: g ? { animationDelay: "1s" } : {},
1170
+ className: `mt-16 flex justify-center ${C ? "animate-fade-in opacity-0" : ""}`,
1171
+ style: C ? { animationDelay: "1s" } : {},
1171
1172
  children: /* @__PURE__ */ z.jsx(
1172
1173
  "button",
1173
1174
  {
1174
- onClick: w,
1175
+ onClick: V,
1175
1176
  className: "bg-white cursor-pointer px-8 py-3 border-2 border-black font-bold text-black text-lg rounded-xl shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none",
1176
1177
  children: h
1177
1178
  }
1178
1179
  )
1179
1180
  }
1180
1181
  )
1181
- ] });
1182
+ ] }) });
1182
1183
  }
1183
1184
  function u1({
1184
1185
  content: d,
@@ -70879,7 +70880,7 @@ var Yc;
70879
70880
  d.UTF8 = "utf8", d.ASCII = "ascii", d.UTF16 = "utf16";
70880
70881
  })(Yc || (Yc = {}));
70881
70882
  const Yi = na("Filesystem", {
70882
- web: () => import("./web-a2dmy96o.js").then((d) => new d.FilesystemWeb())
70883
+ web: () => import("./web-BDYezuEB.js").then((d) => new d.FilesystemWeb())
70883
70884
  });
70884
70885
  ug("Upload", [
70885
70886
  {
@@ -71188,7 +71189,7 @@ var Wh;
71188
71189
  d.None = "NONE", d.Slide = "SLIDE", d.Fade = "FADE";
71189
71190
  })(Wh || (Wh = {}));
71190
71191
  const vm = na("StatusBar"), bm = na("ImmersiveMode", {
71191
- web: () => import("./web-CPiYvLVz.js").then((d) => new d.ImmersiveModeWeb())
71192
+ web: () => import("./web-rfSabFi1.js").then((d) => new d.ImmersiveModeWeb())
71192
71193
  });
71193
71194
  function $x({
71194
71195
  content: d,
@@ -71560,11 +71561,7 @@ const r5 = typeof window < "u" ? sg : tr, Cl = (d) => {
71560
71561
  }(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 })));
71561
71562
  }, Ul = function(d, h) {
71562
71563
  return h === void 0 && (h = !1), { enter: `Toastify--animate Toastify__${d}-enter`, exit: `Toastify--animate Toastify__${d}-exit`, appendPosition: h };
71563
- }, i5 = Ql(Ul("bounce", !0));
71564
- Ql(Ul("slide", !0));
71565
- Ql(Ul("zoom"));
71566
- Ql(Ul("flip"));
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" };
71564
+ }, i5 = Ql(Ul("bounce", !0)), S5 = Ql(Ul("slide", !0)), j5 = Ql(Ul("zoom")), E5 = Ql(Ul("flip")), 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
71565
  function s5(d) {
71569
71566
  let h = { ...o5, ...d };
71570
71567
  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;
@@ -72092,7 +72089,7 @@ const a5 = ({
72092
72089
  ) })
72093
72090
  ] });
72094
72091
  }, l5 = new Z1();
72095
- function S5({ children: d, disableSettings: h }) {
72092
+ function V5({ children: d, disableSettings: h }) {
72096
72093
  return window.location.pathname.endsWith("/settings") && !h ? /* @__PURE__ */ z.jsx(
72097
72094
  a5,
72098
72095
  {
@@ -72779,7 +72776,7 @@ const g5 = {
72779
72776
  function Jh(d) {
72780
72777
  return typeof d == "object" && d !== null && typeof d.type == "string";
72781
72778
  }
72782
- function j5({
72779
+ function O5({
72783
72780
  timeline: d,
72784
72781
  config: h = {
72785
72782
  showProgressBar: !1
@@ -72974,13 +72971,19 @@ export {
72974
72971
  Rt as B,
72975
72972
  f5 as C,
72976
72973
  Yc as E,
72974
+ S5 as F,
72975
+ i5 as H,
72976
+ Kx as L,
72977
72977
  S1 as M,
72978
+ Yx as N,
72978
72979
  Fc as P,
72979
72980
  V1 as Q,
72980
72981
  u5 as R,
72981
72982
  rp as T,
72982
72983
  Wx as U,
72983
72984
  ag as W,
72985
+ j5 as X,
72986
+ E5 as Y,
72984
72987
  G0 as a,
72985
72988
  i1 as b,
72986
72989
  J0 as c,
@@ -73000,7 +73003,11 @@ export {
73000
73003
  Gx as q,
73001
73004
  C5 as r,
73002
73005
  $0 as s,
73003
- S5 as t,
73004
- j5 as u,
73005
- d5 as v
73006
+ V5 as t,
73007
+ O5 as u,
73008
+ d5 as v,
73009
+ s5 as w,
73010
+ Zx as x,
73011
+ Ql as y,
73012
+ kc as z
73006
73013
  };
package/dist/mod.d.ts CHANGED
@@ -2,7 +2,6 @@ import { ComponentType } from 'react';
2
2
  import { default as default_2 } from 'react';
3
3
  import { JSX as JSX_2 } from 'react/jsx-runtime';
4
4
  import { ReactNode } from 'react';
5
- import { toast } from 'react-toastify';
6
5
 
7
6
  export declare interface BaseComponentProps {
8
7
  next: (data?: object, actualStartTime?: number, actualStopTime?: number) => void;
@@ -244,11 +243,12 @@ declare type StoreUpdateFunction = (data?: RefinedTrialData[], store?: Store_2)
244
243
 
245
244
  export declare function subsetExperimentByParam(experiment: any[]): any[];
246
245
 
247
- declare function Text_2({ content, buttonText, className, next, animate, allowedKeys, }: {
246
+ declare function Text_2({ content, buttonText, className, containerClass, next, animate, allowedKeys, }: {
248
247
  content: default_2.ReactNode;
249
248
  buttonText?: string;
250
249
  onButtonClick?: () => void;
251
250
  className?: string;
251
+ containerClass?: string;
252
252
  animate?: boolean;
253
253
  allowedKeys?: string[] | boolean;
254
254
  } & BaseComponentProps): JSX_2.Element;
@@ -256,8 +256,6 @@ export { Text_2 as Text }
256
256
 
257
257
  declare type TimelineItem = ControlFlowItem | any;
258
258
 
259
- export { toast }
260
-
261
259
  export declare interface TrialData {
262
260
  index: number;
263
261
  trialNumber: number;
@@ -293,6 +291,9 @@ declare interface WhileBlockItem {
293
291
  timeline: TimelineItem[];
294
292
  }
295
293
 
294
+
295
+ export * from "react-toastify";
296
+
296
297
  export { }
297
298
 
298
299
  declare global {
@@ -1,32 +1,42 @@
1
- import { C as e, v as r, o as n, q as t, t as i, 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 B, h as R, f as q, s as w, a as y, j as D, B as M } from "./mod-E7J43-ME.js";
1
+ import { H as e, C as n, v as r, o as t, q as i, t as o, u as l, Y as c, z as m, M as p, P as u, l as P, m as x, Q as C, R as E, F as g, T, w as d, U as f, X as k, k as F, c as h, x as v, y as B, g as w, e as y, d as R, i as q, n as D, p as I, r as M, h as Q, f as U, s as b, a as j, j as z, B as A, N as H, L } from "./mod-bwTFfeeq.js";
2
2
  export {
3
- e as CanvasBlock,
3
+ e as Bounce,
4
+ n as CanvasBlock,
4
5
  r as CheckDevice,
5
- n as EnterFullscreen,
6
- t as ExitFullscreen,
7
- i as ExperimentProvider,
8
- o as ExperimentRunner,
9
- l as MicCheck,
10
- m as Param,
11
- p as PlainInput,
12
- c as ProlificEnding,
13
- u as Quest,
14
- P as RequestFilePermission,
15
- x as Text,
16
- E as Upload,
17
- g as canvasCountdown,
18
- f as chunk,
19
- k as getParam,
20
- C as getPlatform,
21
- d as isDesktop,
22
- h as isFullscreen,
23
- v as now,
24
- F as pipe,
25
- B as registerArrayExtensions,
26
- R as registerComponentParams,
27
- q as registerExperimentParams,
28
- w as sample,
29
- y as shuffle,
30
- D as subsetExperimentByParam,
31
- M as toast
6
+ t as EnterFullscreen,
7
+ i as ExitFullscreen,
8
+ o as ExperimentProvider,
9
+ l as ExperimentRunner,
10
+ c as Flip,
11
+ m as Icons,
12
+ p as MicCheck,
13
+ u as Param,
14
+ P as PlainInput,
15
+ x as ProlificEnding,
16
+ C as Quest,
17
+ E as RequestFilePermission,
18
+ g as Slide,
19
+ T as Text,
20
+ d as ToastContainer,
21
+ f as Upload,
22
+ k as Zoom,
23
+ F as canvasCountdown,
24
+ h as chunk,
25
+ v as collapseToast,
26
+ B as cssTransition,
27
+ w as getParam,
28
+ y as getPlatform,
29
+ R as isDesktop,
30
+ q as isFullscreen,
31
+ D as now,
32
+ I as pipe,
33
+ M as registerArrayExtensions,
34
+ Q as registerComponentParams,
35
+ U as registerExperimentParams,
36
+ b as sample,
37
+ j as shuffle,
38
+ z as subsetExperimentByParam,
39
+ A as toast,
40
+ H as useToast,
41
+ L as useToastContainer
32
42
  };