@adriansteffan/reactive 0.1.22 → 0.1.23
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.
|
@@ -17923,6 +17923,7 @@ function wv({
|
|
|
17923
17923
|
const u = (h) => {
|
|
17924
17924
|
const c = Qs();
|
|
17925
17925
|
if (a === !0 || Array.isArray(a) && a.includes(h.key)) {
|
|
17926
|
+
h.preventDefault();
|
|
17926
17927
|
const f = c - o.current;
|
|
17927
17928
|
r({
|
|
17928
17929
|
key: h.key,
|
|
@@ -17961,6 +17962,10 @@ function wv({
|
|
|
17961
17962
|
"button",
|
|
17962
17963
|
{
|
|
17963
17964
|
onClick: l,
|
|
17965
|
+
tabIndex: -1,
|
|
17966
|
+
onKeyDown: (u) => {
|
|
17967
|
+
(u.key === " " || u.key === "Enter") && u.preventDefault();
|
|
17968
|
+
},
|
|
17964
17969
|
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",
|
|
17965
17970
|
children: e
|
|
17966
17971
|
}
|
|
@@ -78642,7 +78647,7 @@ var Ym;
|
|
|
78642
78647
|
i.UTF8 = "utf8", i.ASCII = "ascii", i.UTF16 = "utf16";
|
|
78643
78648
|
})(Ym || (Ym = {}));
|
|
78644
78649
|
const Ea = wu("Filesystem", {
|
|
78645
|
-
web: () => import("./web-
|
|
78650
|
+
web: () => import("./web-DWLF4kLx.js").then((i) => new i.FilesystemWeb())
|
|
78646
78651
|
});
|
|
78647
78652
|
vi("Upload", async (i, e, t, s) => {
|
|
78648
78653
|
const r = i.sessionID || `sim_${Date.now()}_${Math.floor(Lt(0, 2176782336)).toString(36)}`, n = VV({
|
|
@@ -78905,7 +78910,7 @@ var iw;
|
|
|
78905
78910
|
i.None = "NONE", i.Slide = "SLIDE", i.Fade = "FADE";
|
|
78906
78911
|
})(iw || (iw = {}));
|
|
78907
78912
|
const t7 = wu("StatusBar"), s7 = wu("ImmersiveMode", {
|
|
78908
|
-
web: () => import("./web-
|
|
78913
|
+
web: () => import("./web-jM3PxDy0.js").then((i) => new i.ImmersiveModeWeb())
|
|
78909
78914
|
});
|
|
78910
78915
|
Ai("EnterFullscreen", "session");
|
|
78911
78916
|
vi("EnterFullscreen", xu, {});
|
package/dist/reactive.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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 as P, h as g, Q as d, R as C, i as D, j as T, F as x, T as h, k, l as E, U as F, X as S, m as f, n as v, o as B, p as R, q as b, r as y, s as I, t as M, u as U, v as w, w as K, x as q, y as A, A as Q, B as Z, 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, a3 as ea, a4 as ta, a5 as ia, a6 as ra, a7 as na, a8 as oa, a9 as la, aa as ma, ab as ua } from "./mod-
|
|
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 as P, h as g, Q as d, R as C, i as D, j as T, F as x, T as h, k, l as E, U as F, X as S, m as f, n as v, o as B, p as R, q as b, r as y, s as I, t as M, u as U, v as w, w as K, x as q, y as A, A as Q, B as Z, 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, a3 as ea, a4 as ta, a5 as ia, a6 as ra, a7 as na, a8 as oa, a9 as la, aa as ma, ab as ua } from "./mod-CPp-Paa0.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Bounce,
|
|
4
4
|
t as CanvasBlock,
|
package/dist/reactive.umd.js
CHANGED
|
@@ -10178,8 +10178,8 @@ Check the top-level render call using <`+ge+">.")}return ne}}function Xd(F,ne){{
|
|
|
10178
10178
|
<%s {...props} />
|
|
10179
10179
|
React keys must be passed directly to JSX without using spread:
|
|
10180
10180
|
let props = %s;
|
|
10181
|
-
<%s key={someKey} {...props} />`,ku,cn,w0,cn),tp[cn+ku]=!0}}return F===s?g0(Wt):m0(Wt),Wt}}function v0(F,ne,ge){return sp(F,ne,ge,!0)}function y0(F,ne,ge){return sp(F,ne,ge,!1)}var C0=y0,b0=v0;Ml.Fragment=s,Ml.jsx=C0,Ml.jsxs=b0}()),Ml}process.env.NODE_ENV==="production"?bm.exports=une():bm.exports=hne();var A=bm.exports;ni("Text","text"),Qs("Text",(i,e,t,s)=>{const r=t.respond(i,s);return{responseData:r.value,participantState:r.participantState,duration:r.value.reactionTime}},{respond:(i,e)=>({value:{key:"button",reactionTime:X.uniform(500,2e3)},participantState:e})});function rc({content:i,buttonText:e="Click me",className:t="",containerClass:s="",next:r,animate:n=!1,allowedKeys:a=!1}){const o=T.useRef(0);T.useEffect(()=>{o.current=Ps();const u=h=>{const c=Ps();if(a===!0||Array.isArray(a)&&a.includes(h.key)){const f=c-o.current;r({key:h.key,time:c,reactionTime:f})}};return a&&window.addEventListener("keydown",u),()=>{a&&window.removeEventListener("keydown",u)}},[r,a]);const l=()=>{const u=Ps(),h=u-o.current;r({key:"button",time:u,reactionTime:h})};return A.jsx("div",{className:`min-h-screen ${s}`,children:A.jsxs("div",{className:`max-w-prose mx-auto ${t} pt-20 pb-20 px-4 `,children:[A.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
|
|
10182
|
-
${n?"animate-slide-down opacity-0":""}`,children:i}),e&&A.jsx("div",{className:`mt-16 flex justify-center ${n?"animate-fade-in opacity-0":""}`,style:n?{animationDelay:"1s"}:{},children:A.jsx("button",{onClick:l,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",children:e})})]})})}ni("PlainInput","session"),Qs("PlainInput",(i,e,t,s)=>{const r=t.respond(i,s),n=String(r.value).length*X.uniform(50,150);return{responseData:{value:r.value},participantState:r.participantState,storeUpdates:i.storeupdate?i.storeupdate(r.value):void 0,duration:n}},{respond:(i,e)=>({value:"simulated_input",participantState:e})});function $2({content:i,buttonText:e="Click me",className:t="",next:s,updateStore:r,animate:n=!1,storeupdate:a,placeholder:o="Enter your response here"}){const[l,u]=T.useState(""),h=d=>{u(d.target.value)},c=()=>{a&&r(a(l)),s({value:l})};return A.jsxs("div",{className:`max-w-prose mx-auto ${t} mt-20 mb-20 px-4 `,children:[A.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
|
|
10181
|
+
<%s key={someKey} {...props} />`,ku,cn,w0,cn),tp[cn+ku]=!0}}return F===s?g0(Wt):m0(Wt),Wt}}function v0(F,ne,ge){return sp(F,ne,ge,!0)}function y0(F,ne,ge){return sp(F,ne,ge,!1)}var C0=y0,b0=v0;Ml.Fragment=s,Ml.jsx=C0,Ml.jsxs=b0}()),Ml}process.env.NODE_ENV==="production"?bm.exports=une():bm.exports=hne();var A=bm.exports;ni("Text","text"),Qs("Text",(i,e,t,s)=>{const r=t.respond(i,s);return{responseData:r.value,participantState:r.participantState,duration:r.value.reactionTime}},{respond:(i,e)=>({value:{key:"button",reactionTime:X.uniform(500,2e3)},participantState:e})});function rc({content:i,buttonText:e="Click me",className:t="",containerClass:s="",next:r,animate:n=!1,allowedKeys:a=!1}){const o=T.useRef(0);T.useEffect(()=>{o.current=Ps();const u=h=>{const c=Ps();if(a===!0||Array.isArray(a)&&a.includes(h.key)){h.preventDefault();const f=c-o.current;r({key:h.key,time:c,reactionTime:f})}};return a&&window.addEventListener("keydown",u),()=>{a&&window.removeEventListener("keydown",u)}},[r,a]);const l=()=>{const u=Ps(),h=u-o.current;r({key:"button",time:u,reactionTime:h})};return A.jsx("div",{className:`min-h-screen ${s}`,children:A.jsxs("div",{className:`max-w-prose mx-auto ${t} pt-20 pb-20 px-4 `,children:[A.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
|
|
10182
|
+
${n?"animate-slide-down opacity-0":""}`,children:i}),e&&A.jsx("div",{className:`mt-16 flex justify-center ${n?"animate-fade-in opacity-0":""}`,style:n?{animationDelay:"1s"}:{},children:A.jsx("button",{onClick:l,tabIndex:-1,onKeyDown:u=>{(u.key===" "||u.key==="Enter")&&u.preventDefault()},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",children:e})})]})})}ni("PlainInput","session"),Qs("PlainInput",(i,e,t,s)=>{const r=t.respond(i,s),n=String(r.value).length*X.uniform(50,150);return{responseData:{value:r.value},participantState:r.participantState,storeUpdates:i.storeupdate?i.storeupdate(r.value):void 0,duration:n}},{respond:(i,e)=>({value:"simulated_input",participantState:e})});function $2({content:i,buttonText:e="Click me",className:t="",next:s,updateStore:r,animate:n=!1,storeupdate:a,placeholder:o="Enter your response here"}){const[l,u]=T.useState(""),h=d=>{u(d.target.value)},c=()=>{a&&r(a(l)),s({value:l})};return A.jsxs("div",{className:`max-w-prose mx-auto ${t} mt-20 mb-20 px-4 `,children:[A.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
|
|
10183
10183
|
${n?"animate-slide-down opacity-0":""}`,children:i}),A.jsx("div",{className:`mt-8 ${n?"animate-slide-down opacity-0":""}`,children:A.jsx("input",{type:"text",value:l,onChange:h,placeholder:o,className:"w-full px-4 py-3 border-2 border-black rounded-xl text-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})}),e&&A.jsx("div",{className:`mt-8 flex justify-center ${n?"animate-fade-in opacity-0":""}`,style:n?{animationDelay:"1s"}:{},children:A.jsx("button",{onClick:c,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",children:e})})]})}ni("ProlificEnding",null),Qs("ProlificEnding",ho,{}),vm("ProlificEnding",[{name:"cc",defaultValue:"",type:"string",description:"Completion code of the Profilic experiment (more commonly supplied via the code)"}]);function H2({prolificCode:i,className:e,containerClass:t,animate:s,data:r,updateStore:n}){let a=i??ma("cc","","string")??null;const o=A.jsxs("div",{className:"flex flex-col items-center",children:[A.jsx("svg",{className:"w-12 h-12",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:A.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),A.jsxs("p",{className:"",children:["Thank you! Your data has been successfully submitted. ",A.jsx("br",{})," You can go back to Prolific and enter the code ",a," to finish the study. Alternatively, you can click on this link:"," ",A.jsx("a",{target:"_blank",className:"text-blue-400",href:`https://app.prolific.com/submissions/complete?cc=${a}`,children:"Go to Prolific"})]})]});return A.jsx(rc,{data:r,updateStore:n,className:e,containerClass:t,animate:s,content:o,buttonText:"",next:()=>{}})}var Q2={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},U2=T.createContext&&T.createContext(Q2),cne=["attr","size","title"];function dne(i,e){if(i==null)return{};var t=pne(i,e),s,r;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);for(r=0;r<n.length;r++)s=n[r],!(e.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(i,s)&&(t[s]=i[s])}return t}function pne(i,e){if(i==null)return{};var t={};for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){if(e.indexOf(s)>=0)continue;t[s]=i[s]}return t}function nc(){return nc=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},nc.apply(this,arguments)}function z2(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,s)}return t}function ac(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?z2(Object(t),!0).forEach(function(s){fne(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):z2(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function fne(i,e,t){return e=mne(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function mne(i){var e=gne(i,"string");return typeof e=="symbol"?e:e+""}function gne(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var s=t.call(i,e);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function j2(i){return i&&i.map((e,t)=>T.createElement(e.tag,ac({key:t},e.attr),j2(e.child)))}function wm(i){return e=>T.createElement(vne,nc({attr:ac({},i.attr)},e),j2(i.child))}function vne(i){var e=t=>{var{attr:s,size:r,title:n}=i,a=dne(i,cne),o=r||t.size||"1em",l;return t.className&&(l=t.className),i.className&&(l=(l?l+" ":"")+i.className),T.createElement("svg",nc({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,s,a,{className:l,style:ac(ac({color:i.color||t.color},t.style),i.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),n&&T.createElement("title",null,n),i.children)};return U2!==void 0?T.createElement(U2.Consumer,null,t=>e(t)):e(Q2)}function yne(i){return wm({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M8.25 4.5a3.75 3.75 0 1 1 7.5 0v8.25a3.75 3.75 0 1 1-7.5 0V4.5Z"},child:[]},{tag:"path",attr:{d:"M6 10.5a.75.75 0 0 1 .75.75v1.5a5.25 5.25 0 1 0 10.5 0v-1.5a.75.75 0 0 1 1.5 0v1.5a6.751 6.751 0 0 1-6 6.709v2.291h3a.75.75 0 0 1 0 1.5h-7.5a.75.75 0 0 1 0-1.5h3v-2.291a6.751 6.751 0 0 1-6-6.709v-1.5A.75.75 0 0 1 6 10.5Z"},child:[]}]})(i)}function Cne(i){return wm({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z",clipRule:"evenodd"},child:[]}]})(i)}function bne(i){return wm({attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 0 1 3.878.512.75.75 0 1 1-.256 1.478l-.209-.035-1.005 13.07a3 3 0 0 1-2.991 2.77H8.084a3 3 0 0 1-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 0 1-.256-1.478A48.567 48.567 0 0 1 7.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 0 1 3.369 0c1.603.051 2.815 1.387 2.815 2.951Zm-6.136-1.452a51.196 51.196 0 0 1 3.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 0 0-6 0v-.113c0-.794.609-1.428 1.364-1.452Zm-.355 5.945a.75.75 0 1 0-1.5.058l.347 9a.75.75 0 1 0 1.499-.058l-.346-9Zm5.48.058a.75.75 0 1 0-1.498-.058l-.347 9a.75.75 0 0 0 1.5.058l.345-9Z",clipRule:"evenodd"},child:[]}]})(i)}const wne=({stream:i})=>{const e=T.useRef(null),t=T.useRef(null),s=T.useRef(null),r=T.useRef([]);return T.useEffect(()=>{if(!i||!e.current)return;const n=new(window.AudioContext||window.webkitAudioContext),a=n.createAnalyser(),o=n.createMediaStreamSource(i);a.fftSize=2048,o.connect(a),s.current=a;const l=e.current,u=l.getContext("2d",{alpha:!1});if(!u)return;u.imageSmoothingEnabled=!0,u.imageSmoothingQuality="high";const h=window.devicePixelRatio||1,c=l.getBoundingClientRect();l.width=c.width*h,l.height=c.height*h,u.scale(h,h),l.style.width=`${c.width}px`,l.style.height=`${c.height}px`;const d=new Uint8Array(a.frequencyBinCount);r.current=Array(a.frequencyBinCount).fill(128);const f=(m,g)=>g+(m-g)*.08,y=(m,g=3)=>{const b=new Array(m.length).fill(0);for(let x=0;x<m.length;x++){let P=0,L=0;for(let _=Math.max(0,x-g);_<Math.min(m.length,x+g+1);_++)P+=m[_],L++;b[x]=P/L}return b},v=()=>{const m=c.width,g=c.height,b=g/2;t.current=requestAnimationFrame(v),a.getByteTimeDomainData(d);const x=Array.from(d).map((k,S)=>f(k,r.current[S])),P=y(x);r.current=P,u.fillStyle="#ffffff",u.fillRect(0,0,m*h,g*h),u.beginPath(),u.strokeStyle="rgba(0, 0, 0, 0.1)",u.lineWidth=1,u.moveTo(0,b),u.lineTo(m,b),u.stroke(),u.beginPath(),u.lineWidth=2,u.strokeStyle="rgba(0, 0, 0, 0.85)";const L=4,_=[];for(let k=0;k<P.length;k+=L){const S=k/P.length*m,R=(P[k]-128)/128,N=b+R*g*4;_.push([S,N])}if(_.length>0){u.moveTo(_[0][0],_[0][1]);for(let k=1;k<_.length-2;k++){const S=(_[k][0]+_[k+1][0])/2,R=(_[k][1]+_[k+1][1])/2;u.quadraticCurveTo(_[k][0],_[k][1],S,R)}if(_.length>2){const k=_.length-1;u.quadraticCurveTo(_[k-1][0],_[k-1][1],_[k][0],_[k][1])}}u.stroke()};return v(),()=>{t.current&&cancelAnimationFrame(t.current),o.disconnect(),n.close()}},[i]),A.jsx("canvas",{ref:e,width:300,height:60,className:"mx-auto rounded-lg bg-white shadow-xs"})},W2=({question:i,handleSaveVoiceData:e,handleDiscardVoiceData:t})=>{const[s,r]=T.useState(!1),[n,a]=T.useState(null),[o,l]=T.useState(null),u=T.useRef(null),h=T.useRef([]),c=async()=>{try{const v=window.audioInputId,m={audio:v?{deviceId:{exact:v}}:!0},g=await navigator.mediaDevices.getUserMedia(m);l(g),u.current=new MediaRecorder(g),h.current=[],u.current.ondataavailable=b=>{b.data.size>0&&h.current.push(b.data)},u.current.onstop=()=>{const b=new Blob(h.current,{type:"audio/webm"}),x=URL.createObjectURL(b);a(x),l(null),f(b,x)},u.current.start(),r(!0)}catch(v){console.error("Error accessing microphone:",v)}},d=()=>{u.current&&s&&(u.current.stop(),u.current.stream.getTracks().forEach(v=>v.stop()),r(!1))},f=async(v,m)=>{if(v&&m){const g=await new Promise(b=>{const x=new FileReader;x.onloadend=()=>{var L;const P=((L=x.result)==null?void 0:L.toString().split(",")[1])||"";b(P)},x.readAsDataURL(v)});e({blob:v,type:"audiorecording",url:m,data64:g,timestamp:new Date().toISOString()})}},y=()=>{n&&URL.revokeObjectURL(n),a(null),i.value=null,t()};return A.jsxs("div",{className:"flex flex-col items-center space-y-4 p-4 bg-white px-8 ",children:[!n&&A.jsx("button",{onClick:s?d:c,className:`flex items-center justify-center space-x-2 p-4 rounded-full border-2 border-black shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none cursor-pointer
|
|
10184
10184
|
${s?"bg-red-500 hover:bg-red-600":""}
|
|
10185
10185
|
text-white transition-colors duration-200`,"aria-label":s?"Stop Recording":"Start Recording",children:s?A.jsx(Cne,{className:"w-6 h-6"}):A.jsx(yne,{className:"w-6 h-6 text-black"})}),s&&o&&A.jsx("div",{className:"w-full max-w-md mx-auto",children:A.jsx(wne,{stream:o})}),s&&A.jsxs("div",{className:"flex items-center space-x-2",children:[A.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full animate-pulse"}),A.jsx("span",{className:"text-sm text-black",children:"Recording..."})]}),n&&!s&&A.jsxs("div",{className:"flex flex-col items-center space-y-4 w-full max-w-md",children:[A.jsxs("audio",{controls:!0,preload:"none",className:"w-full",playsInline:!0,children:[A.jsx("source",{src:n,type:"audio/mp4"}),A.jsx("source",{src:n,type:"audio/webm"}),"Your browser does not support the audio element."]}),A.jsx("div",{className:"flex space-x-4",children:A.jsxs("button",{onClick:y,className:`border-2 border-black shadow-[2px_2px_0px_rgba(0,0,0,1)] hover:translate-x-[2px] hover:translate-y-[2px] hover:shadow-none cursor-pointer flex items-center space-x-2 px-4 py-2 text-black
|
package/package.json
CHANGED
package/src/components/text.tsx
CHANGED
|
@@ -45,6 +45,7 @@ function Text({
|
|
|
45
45
|
allowedKeys === true || (Array.isArray(allowedKeys) && allowedKeys.includes(event.key));
|
|
46
46
|
|
|
47
47
|
if (isKeyAllowed) {
|
|
48
|
+
event.preventDefault();
|
|
48
49
|
const reactionTime = keypressTime - startTimeRef.current;
|
|
49
50
|
|
|
50
51
|
next({
|
|
@@ -95,6 +96,8 @@ function Text({
|
|
|
95
96
|
>
|
|
96
97
|
<button
|
|
97
98
|
onClick={handleClick}
|
|
99
|
+
tabIndex={-1}
|
|
100
|
+
onKeyDown={(e) => { if (e.key === ' ' || e.key === 'Enter') e.preventDefault(); }}
|
|
98
101
|
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'
|
|
99
102
|
>
|
|
100
103
|
{buttonText}
|