speakid-build-a-sentence 1.0.9 → 1.0.10
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/index.d.ts +5 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/speakid-build-a-sentence.es.js +64 -68
- package/dist/speakid-build-a-sentence.es.js.map +1 -1
- package/dist/speakid-build-a-sentence.umd.js +6 -6
- package/dist/speakid-build-a-sentence.umd.js.map +1 -1
- package/package.json +9 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { GameProps } from "./Game";
|
|
6
|
-
declare function Game(props?: GameProps): React.FunctionComponentElement<{}>;
|
|
7
|
-
export default Game;
|
|
8
|
-
export { Game, ErrorBoundary };
|
|
9
|
-
export { useValidation };
|
|
10
|
-
export { createAriaLabel, handleKeyDown, announceToScreenReader };
|
|
1
|
+
export { default } from "./Game";
|
|
2
|
+
export { ErrorBoundary } from "./components/ErrorBoundary";
|
|
3
|
+
export { useValidation } from "./hooks/useValidation";
|
|
4
|
+
export { createAriaLabel, handleKeyDown, announceToScreenReader } from "./utils/accessibility";
|
|
11
5
|
export type { ValidationError, ValidationResult } from "./hooks/useValidation";
|
|
12
|
-
export type { GameProps };
|
|
6
|
+
export type { GameProps } from "./Game";
|
|
13
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAG/F,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import rn, { useState as g, useCallback as Ee, useRef as Ie, useEffect as ue, useMemo as on, Component as sn } from "react";
|
|
2
2
|
var ve = { exports: {} }, pe = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -13,7 +13,7 @@ var je;
|
|
|
13
13
|
function an() {
|
|
14
14
|
if (je) return pe;
|
|
15
15
|
je = 1;
|
|
16
|
-
var
|
|
16
|
+
var p = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
|
|
17
17
|
function S(T, W, w) {
|
|
18
18
|
var P = null;
|
|
19
19
|
if (w !== void 0 && (P = "" + w), W.key !== void 0 && (P = "" + W.key), "key" in W) {
|
|
@@ -22,7 +22,7 @@ function an() {
|
|
|
22
22
|
R !== "key" && (w[R] = W[R]);
|
|
23
23
|
} else w = W;
|
|
24
24
|
return W = w.ref, {
|
|
25
|
-
$$typeof:
|
|
25
|
+
$$typeof: p,
|
|
26
26
|
type: T,
|
|
27
27
|
key: P,
|
|
28
28
|
ref: W !== void 0 ? W : null,
|
|
@@ -44,7 +44,7 @@ var fe = {};
|
|
|
44
44
|
var Pe;
|
|
45
45
|
function dn() {
|
|
46
46
|
return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
-
function
|
|
47
|
+
function p(e) {
|
|
48
48
|
if (e == null) return null;
|
|
49
49
|
if (typeof e == "function")
|
|
50
50
|
return e.$$typeof === V ? null : e.displayName || e.name || null;
|
|
@@ -77,11 +77,11 @@ function dn() {
|
|
|
77
77
|
var a = e.render;
|
|
78
78
|
return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
79
|
case z:
|
|
80
|
-
return a = e.displayName || null, a !== null ? a :
|
|
80
|
+
return a = e.displayName || null, a !== null ? a : p(e.type) || "Memo";
|
|
81
81
|
case J:
|
|
82
82
|
a = e._payload, e = e._init;
|
|
83
83
|
try {
|
|
84
|
-
return
|
|
84
|
+
return p(e(a));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -112,7 +112,7 @@ function dn() {
|
|
|
112
112
|
if (typeof e == "object" && e !== null && e.$$typeof === J)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
|
-
var a =
|
|
115
|
+
var a = p(e);
|
|
116
116
|
return a ? "<" + a + ">" : "<...>";
|
|
117
117
|
} catch {
|
|
118
118
|
return "<...>";
|
|
@@ -145,7 +145,7 @@ function dn() {
|
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
function f() {
|
|
148
|
-
var e =
|
|
148
|
+
var e = p(this.type);
|
|
149
149
|
return F[e] || (F[e] = !0, console.error(
|
|
150
150
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
151
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
@@ -197,7 +197,7 @@ function dn() {
|
|
|
197
197
|
);
|
|
198
198
|
else I(x);
|
|
199
199
|
if (de.call(a, "key")) {
|
|
200
|
-
x =
|
|
200
|
+
x = p(e);
|
|
201
201
|
var O = Object.keys(a).filter(function(Se) {
|
|
202
202
|
return Se !== "key";
|
|
203
203
|
});
|
|
@@ -237,7 +237,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
237
237
|
function H(e) {
|
|
238
238
|
return typeof e == "object" && e !== null && e.$$typeof === oe;
|
|
239
239
|
}
|
|
240
|
-
var B =
|
|
240
|
+
var B = rn, oe = Symbol.for("react.transitional.element"), ge = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), he = Symbol.for("react.consumer"), se = Symbol.for("react.context"), me = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), ae = Symbol.for("react.suspense_list"), z = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), V = Symbol.for("react.client.reference"), we = B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, de = Object.prototype.hasOwnProperty, M = Array.isArray, A = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
243
|
B = {
|
|
@@ -312,8 +312,8 @@ const cn = `
|
|
|
312
312
|
}
|
|
313
313
|
`;
|
|
314
314
|
if (typeof document < "u" && !document.getElementById("magic-sentence-keyframes")) {
|
|
315
|
-
const
|
|
316
|
-
|
|
315
|
+
const p = document.createElement("style");
|
|
316
|
+
p.id = "magic-sentence-keyframes", p.innerHTML = cn, document.head.appendChild(p);
|
|
317
317
|
}
|
|
318
318
|
const Ce = {
|
|
319
319
|
spin: {
|
|
@@ -453,7 +453,7 @@ const Ce = {
|
|
|
453
453
|
// ===== Анимационные стили =====
|
|
454
454
|
...Ce
|
|
455
455
|
}, un = () => {
|
|
456
|
-
const [
|
|
456
|
+
const [p, l] = g([]), S = Ee((w, P, R) => {
|
|
457
457
|
const f = [];
|
|
458
458
|
w.trim() || f.push({
|
|
459
459
|
type: "empty",
|
|
@@ -489,21 +489,21 @@ const Ce = {
|
|
|
489
489
|
l([]);
|
|
490
490
|
}, []);
|
|
491
491
|
return {
|
|
492
|
-
errors:
|
|
492
|
+
errors: p,
|
|
493
493
|
validateSentence: S,
|
|
494
494
|
validateAllSentences: T,
|
|
495
495
|
clearErrors: W
|
|
496
496
|
};
|
|
497
|
-
}, pn = (
|
|
498
|
-
S.includes(
|
|
499
|
-
}, Y = (
|
|
497
|
+
}, pn = (p, l, S) => l && S ? `${p} word "${l}" ${S}` : l ? `${p} word "${l}"` : p, fn = (p, l, S = ["Enter", " "]) => {
|
|
498
|
+
S.includes(p.key) && (p.preventDefault(), l());
|
|
499
|
+
}, Y = (p) => {
|
|
500
500
|
const l = document.createElement("div");
|
|
501
|
-
l.setAttribute("aria-live", "polite"), l.setAttribute("aria-atomic", "true"), l.style.position = "absolute", l.style.left = "-10000px", l.style.width = "1px", l.style.height = "1px", l.style.overflow = "hidden", document.body.appendChild(l), l.textContent =
|
|
501
|
+
l.setAttribute("aria-live", "polite"), l.setAttribute("aria-atomic", "true"), l.style.position = "absolute", l.style.left = "-10000px", l.style.width = "1px", l.style.height = "1px", l.style.overflow = "hidden", document.body.appendChild(l), l.textContent = p, setTimeout(() => {
|
|
502
502
|
document.body.removeChild(l);
|
|
503
503
|
}, 1e3);
|
|
504
504
|
}, gn = () => {
|
|
505
|
-
const
|
|
506
|
-
|
|
505
|
+
const p = document.createElement("style");
|
|
506
|
+
p.textContent = `
|
|
507
507
|
#magic-sentence-root, #magic-sentence-root * {
|
|
508
508
|
box-sizing: border-box;
|
|
509
509
|
font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
|
|
@@ -529,10 +529,10 @@ const Ce = {
|
|
|
529
529
|
height: 100% !important;
|
|
530
530
|
overflow: hidden !important;
|
|
531
531
|
}
|
|
532
|
-
`, document.head.appendChild(
|
|
533
|
-
}, hn = (
|
|
534
|
-
function
|
|
535
|
-
const { logoUrl: l, showLogo: S = !0, baseURL: T } =
|
|
532
|
+
`, document.head.appendChild(p);
|
|
533
|
+
}, hn = (p) => [...p].sort(() => Math.random() - 0.5);
|
|
534
|
+
function wn(p = {}) {
|
|
535
|
+
const { logoUrl: l, showLogo: S = !0, baseURL: T } = p, W = Ie(null), { validateAllSentences: w, errors: P } = un(), R = () => r || window.innerWidth < 768, f = () => r || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, D = (n = "medium") => {
|
|
536
536
|
if (!f())
|
|
537
537
|
return {
|
|
538
538
|
padding: "12px 24px",
|
|
@@ -565,17 +565,17 @@ function mn(u = {}) {
|
|
|
565
565
|
}), []);
|
|
566
566
|
const [y, I] = g("select"), [H, B] = g(null), [oe, ge] = g(null), [E, U] = g([]), [_, he] = g(0), [se, me] = g([]), [j, ae] = g([]), [z, J] = g(20), [$, V] = g(0), [we, de] = g(null), [M, A] = g(null), [c, F] = g(!1), [X, xe] = g(
|
|
567
567
|
Number(localStorage.getItem("magicSentenceBest")) || 0
|
|
568
|
-
), L = Ie(null), [e, a] = g({ list: null, index: null, side: null }), [r, b] = g(!1), [le, G] = g(1), [x, O] = g(null), [ce, Se] = g(!1), [q,
|
|
568
|
+
), L = Ie(null), [e, a] = g({ list: null, index: null, side: null }), [r, b] = g(!1), [le, G] = g(1), [x, O] = g(null), [ce, Se] = g(!1), [q, Ae] = g(!1), [Z, De] = g(!1), [Q, _e] = g(!1), [K, Oe] = g(!1), [ee, ze] = g(!1), [ne, Me] = g(!1), [te, Le] = g(!1), [ie, Ne] = g(!1);
|
|
569
569
|
ue(() => {
|
|
570
570
|
const n = () => {
|
|
571
|
-
const i = window.innerWidth, t = window.innerHeight, o = i < 768 || i === 926 && t === 428 || i === 932 && t === 430, d = t < 700, v = i === 768 && t === 1024, k = i === 1024 && t === 768,
|
|
572
|
-
if (Se(
|
|
571
|
+
const i = window.innerWidth, t = window.innerHeight, o = i < 768 || i === 926 && t === 428 || i === 932 && t === 430, d = t < 700, v = i === 768 && t === 1024, k = i === 1024 && t === 768, u = i === 820 && t === 1180, m = i === 1180 && t === 820, re = i === 540 && t === 720, C = i === 720 && t === 540, Re = i === 1024 && t === 1366, en = i === 1366 && t === 1024, nn = i >= 1200 && t >= 600 && !o;
|
|
572
|
+
if (Se(nn), Ae(v), De(k), _e(u), Oe(m), ze(re), Me(C), Le(Re), Ne(en), b(o), o)
|
|
573
573
|
O(null), G(1);
|
|
574
574
|
else if (d)
|
|
575
575
|
O(null), G(1);
|
|
576
576
|
else {
|
|
577
|
-
const
|
|
578
|
-
O(
|
|
577
|
+
const tn = Math.min(1e3, Math.min(i, t) * 0.9);
|
|
578
|
+
O(tn), G(1);
|
|
579
579
|
}
|
|
580
580
|
};
|
|
581
581
|
return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
@@ -583,11 +583,11 @@ function mn(u = {}) {
|
|
|
583
583
|
const ye = (n, i, t, o) => {
|
|
584
584
|
if (c) return;
|
|
585
585
|
let d = [...se], v = [...j];
|
|
586
|
-
const k = n === "bank" ? d : v,
|
|
586
|
+
const k = n === "bank" ? d : v, u = i === "bank" ? d : v, m = k.findIndex((Re) => Re.id === t);
|
|
587
587
|
if (m === -1) return;
|
|
588
588
|
const [re] = k.splice(m, 1);
|
|
589
589
|
let C = o;
|
|
590
|
-
n === i && C !== null && C !== void 0 && C > m && (C = C - 1), C == null || C < 0 || C >
|
|
590
|
+
n === i && C !== null && C !== void 0 && C > m && (C = C - 1), C == null || C < 0 || C > u.length ? u.push(re) : u.splice(C, 0, re), n === "bank" ? d = k : v = k, i === "bank" ? d = u : v = u, me(d), ae(v);
|
|
591
591
|
}, be = (n, i, t) => {
|
|
592
592
|
if (n.preventDefault(), c) {
|
|
593
593
|
a({ list: null, index: null, side: null });
|
|
@@ -596,8 +596,8 @@ function mn(u = {}) {
|
|
|
596
596
|
const o = n.dataTransfer.getData("application/x-token") || (() => {
|
|
597
597
|
const d = n.dataTransfer.getData("text/plain");
|
|
598
598
|
if (!d) return "";
|
|
599
|
-
const v = se.some((m) => m.id === d), k = j.some((m) => m.id === d),
|
|
600
|
-
return
|
|
599
|
+
const v = se.some((m) => m.id === d), k = j.some((m) => m.id === d), u = v ? "bank" : k ? "selected" : null;
|
|
600
|
+
return u ? JSON.stringify({ from: u, id: d }) : "";
|
|
601
601
|
})();
|
|
602
602
|
if (o) {
|
|
603
603
|
try {
|
|
@@ -608,19 +608,19 @@ function mn(u = {}) {
|
|
|
608
608
|
}
|
|
609
609
|
a({ list: null, index: null, side: null });
|
|
610
610
|
}
|
|
611
|
-
},
|
|
611
|
+
}, Be = (n) => {
|
|
612
612
|
B(n), U(Array(n).fill("")), I("time");
|
|
613
|
-
},
|
|
613
|
+
}, $e = (n) => {
|
|
614
614
|
ge(n), I("type");
|
|
615
|
-
},
|
|
615
|
+
}, Fe = (n, i) => {
|
|
616
616
|
if (i.length > 41 || i && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(i))
|
|
617
617
|
return;
|
|
618
618
|
const o = [...E];
|
|
619
619
|
o[n] = i, U(o);
|
|
620
620
|
const d = w(o);
|
|
621
621
|
d.isValid || console.warn("Validation errors:", d.errors);
|
|
622
|
-
},
|
|
623
|
-
E.some((i) => i.trim().length === 0) || (U((i) => i.map((t) =>
|
|
622
|
+
}, Ge = (n) => n.trim().replace(/\s+/g, " "), Te = (n) => n <= 3 ? 20 : n <= 5 ? 18 : n <= 7 ? 16 : n <= 9 ? 14 : 12, Ye = () => {
|
|
623
|
+
E.some((i) => i.trim().length === 0) || (U((i) => i.map((t) => Ge(t))), V(0), he(0), de(null), I("getready"));
|
|
624
624
|
};
|
|
625
625
|
ue(() => {
|
|
626
626
|
if (y === "getready") {
|
|
@@ -645,21 +645,21 @@ function mn(u = {}) {
|
|
|
645
645
|
L.current = window.setTimeout(() => J((n) => n - 1), 1e3);
|
|
646
646
|
else {
|
|
647
647
|
F(!0);
|
|
648
|
-
const i = E[_].trim().split(/\s+/), t = j.map((
|
|
648
|
+
const i = E[_].trim().split(/\s+/), t = j.map((u) => u.text), o = i.filter((u) => !t.includes(u)).length, d = t.filter((u) => !i.includes(u)).length, v = i.filter((u, m) => u !== t[m]).length, k = o + d + v;
|
|
649
649
|
k === 0 ? (A("correct"), N("correct"), Y("Correct! Well done!")) : k === 1 ? (A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!"));
|
|
650
650
|
}
|
|
651
651
|
return () => {
|
|
652
652
|
L.current !== null && window.clearTimeout(L.current);
|
|
653
653
|
};
|
|
654
654
|
}, [y, z, c, E, _, j]);
|
|
655
|
-
const
|
|
655
|
+
const Ue = (n = !0) => {
|
|
656
656
|
if (c && n) {
|
|
657
657
|
_ + 1 < (H || 0) ? ke(_ + 1) : (I("results"), setTimeout(() => We(), 600));
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
660
660
|
if (n && !c) {
|
|
661
|
-
const t = E[_].trim().split(/\s+/), o = j.map((m) => m.text), d = t.filter((m) => !o.includes(m)).length, v = o.filter((m) => !t.includes(m)).length, k = t.filter((m, re) => m !== o[re]).length,
|
|
662
|
-
|
|
661
|
+
const t = E[_].trim().split(/\s+/), o = j.map((m) => m.text), d = t.filter((m) => !o.includes(m)).length, v = o.filter((m) => !t.includes(m)).length, k = t.filter((m, re) => m !== o[re]).length, u = d + v + k;
|
|
662
|
+
u === 0 && z > 0 ? (V((m) => m + 1), A("correct"), N("correct"), Y("Correct! Well done!")) : u === 1 ? (V((m) => m + 0.5), A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!")), _ + 1 < (H || 0) ? setTimeout(() => ke(_ + 1), 800) : (I("results"), setTimeout(() => We(), 600));
|
|
663
663
|
}
|
|
664
664
|
};
|
|
665
665
|
ue(() => {
|
|
@@ -696,12 +696,12 @@ function mn(u = {}) {
|
|
|
696
696
|
speed: 2 + Math.random() * 4,
|
|
697
697
|
tilt: Math.random() * 2 * Math.PI
|
|
698
698
|
})), k = () => {
|
|
699
|
-
d.clearRect(0, 0, o.width, o.height), v.forEach((
|
|
700
|
-
d.fillStyle =
|
|
699
|
+
d.clearRect(0, 0, o.width, o.height), v.forEach((u) => {
|
|
700
|
+
d.fillStyle = u.color, d.beginPath(), d.ellipse(u.x, u.y, u.size, u.size / 2, u.tilt, 0, 2 * Math.PI), d.fill(), u.y += u.speed, u.x += Math.sin(u.tilt);
|
|
701
701
|
}), Date.now() < i ? requestAnimationFrame(k) : document.body.removeChild(o);
|
|
702
702
|
};
|
|
703
703
|
k();
|
|
704
|
-
},
|
|
704
|
+
}, Je = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
705
705
|
/* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
706
706
|
/* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select number of rounds" }),
|
|
707
707
|
/* @__PURE__ */ s.jsx("div", { style: {
|
|
@@ -711,7 +711,7 @@ function mn(u = {}) {
|
|
|
711
711
|
}, children: [3, 4, 5].map((n) => /* @__PURE__ */ s.jsxs(
|
|
712
712
|
"button",
|
|
713
713
|
{
|
|
714
|
-
onClick: () =>
|
|
714
|
+
onClick: () => Be(n),
|
|
715
715
|
style: {
|
|
716
716
|
...h.gmButton,
|
|
717
717
|
...D("medium")
|
|
@@ -723,7 +723,7 @@ function mn(u = {}) {
|
|
|
723
723
|
},
|
|
724
724
|
n
|
|
725
725
|
)) })
|
|
726
|
-
] }),
|
|
726
|
+
] }), Ve = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
727
727
|
/* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
728
728
|
/* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select time per round" }),
|
|
729
729
|
/* @__PURE__ */ s.jsx("div", { style: {
|
|
@@ -733,7 +733,7 @@ function mn(u = {}) {
|
|
|
733
733
|
}, children: [15, 20, 30].map((n) => /* @__PURE__ */ s.jsxs(
|
|
734
734
|
"button",
|
|
735
735
|
{
|
|
736
|
-
onClick: () =>
|
|
736
|
+
onClick: () => $e(n),
|
|
737
737
|
style: {
|
|
738
738
|
...h.gmButton,
|
|
739
739
|
...D("medium")
|
|
@@ -745,7 +745,7 @@ function mn(u = {}) {
|
|
|
745
745
|
},
|
|
746
746
|
n
|
|
747
747
|
)) })
|
|
748
|
-
] }),
|
|
748
|
+
] }), Xe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
749
749
|
/* @__PURE__ */ s.jsxs("h2", { style: { ...h.gmBodyM, marginBottom: "0px" }, children: [
|
|
750
750
|
"Type down ",
|
|
751
751
|
H,
|
|
@@ -769,7 +769,7 @@ function mn(u = {}) {
|
|
|
769
769
|
{
|
|
770
770
|
value: n,
|
|
771
771
|
placeholder: `Sentence ${i + 1}`,
|
|
772
|
-
onChange: (t) =>
|
|
772
|
+
onChange: (t) => Fe(i, t.target.value),
|
|
773
773
|
style: {
|
|
774
774
|
...h.gmInput,
|
|
775
775
|
padding: f() ? "8px 12px" : "12px 16px",
|
|
@@ -785,7 +785,7 @@ function mn(u = {}) {
|
|
|
785
785
|
/* @__PURE__ */ s.jsx(
|
|
786
786
|
"button",
|
|
787
787
|
{
|
|
788
|
-
onClick:
|
|
788
|
+
onClick: Ye,
|
|
789
789
|
disabled: E.some((n) => n.trim().length === 0),
|
|
790
790
|
style: {
|
|
791
791
|
...h.gmButton,
|
|
@@ -797,7 +797,7 @@ function mn(u = {}) {
|
|
|
797
797
|
children: "PLAY"
|
|
798
798
|
}
|
|
799
799
|
)
|
|
800
|
-
] }),
|
|
800
|
+
] }), qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmReadyWrapper, children: [
|
|
801
801
|
/* @__PURE__ */ s.jsx("h1", { style: {
|
|
802
802
|
...h.gmHeadline1,
|
|
803
803
|
fontSize: f() ? "36px" : "72px",
|
|
@@ -806,7 +806,7 @@ function mn(u = {}) {
|
|
|
806
806
|
animation: "pulse 1s ease-in-out infinite"
|
|
807
807
|
}, children: "GET READY" }),
|
|
808
808
|
/* @__PURE__ */ s.jsx("div", { style: h.gmHourglass, children: "⏳" })
|
|
809
|
-
] }),
|
|
809
|
+
] }), Ze = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmGameLayout, children: [
|
|
810
810
|
/* @__PURE__ */ s.jsxs("h2", { style: {
|
|
811
811
|
marginBottom: f() ? "5px" : "10px",
|
|
812
812
|
fontSize: f() ? "16px" : "20px"
|
|
@@ -993,7 +993,7 @@ function mn(u = {}) {
|
|
|
993
993
|
/* @__PURE__ */ s.jsx(
|
|
994
994
|
"button",
|
|
995
995
|
{
|
|
996
|
-
onClick: () =>
|
|
996
|
+
onClick: () => Ue(!0),
|
|
997
997
|
disabled: !c && j.length === 0,
|
|
998
998
|
style: {
|
|
999
999
|
marginTop: f() ? "15px" : "30px",
|
|
@@ -1008,7 +1008,7 @@ function mn(u = {}) {
|
|
|
1008
1008
|
children: "NEXT"
|
|
1009
1009
|
}
|
|
1010
1010
|
)
|
|
1011
|
-
] }),
|
|
1011
|
+
] }), Qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
1012
1012
|
/* @__PURE__ */ s.jsx("h1", { style: {
|
|
1013
1013
|
...h.gmHeadline1,
|
|
1014
1014
|
marginTop: (r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie, "0px"),
|
|
@@ -1070,7 +1070,7 @@ function mn(u = {}) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
)
|
|
1072
1072
|
] })
|
|
1073
|
-
] }),
|
|
1073
|
+
] }), Ke = on(
|
|
1074
1074
|
() => {
|
|
1075
1075
|
let n = l;
|
|
1076
1076
|
return n || (T ? n = `${T.endsWith("/") ? T.slice(0, -1) : T}/logo.svg` : typeof window < "u" && window.origin && (n = `${window.origin}/browser/speakid/games/magic%20sentence/logo.svg`)), /* @__PURE__ */ s.jsx("div", { style: {
|
|
@@ -1135,13 +1135,13 @@ function mn(u = {}) {
|
|
|
1135
1135
|
alignItems: "center"
|
|
1136
1136
|
},
|
|
1137
1137
|
children: /* @__PURE__ */ s.jsxs("div", { id: "magic-sentence-root", children: [
|
|
1138
|
-
!r &&
|
|
1139
|
-
y === "select" &&
|
|
1140
|
-
y === "time" &&
|
|
1141
|
-
y === "type" &&
|
|
1142
|
-
y === "getready" &&
|
|
1143
|
-
y === "play" &&
|
|
1144
|
-
y === "results" &&
|
|
1138
|
+
!r && Ke,
|
|
1139
|
+
y === "select" && Je(),
|
|
1140
|
+
y === "time" && Ve(),
|
|
1141
|
+
y === "type" && Xe(),
|
|
1142
|
+
y === "getready" && qe(),
|
|
1143
|
+
y === "play" && Ze(),
|
|
1144
|
+
y === "results" && Qe()
|
|
1145
1145
|
] })
|
|
1146
1146
|
}
|
|
1147
1147
|
)
|
|
@@ -1220,15 +1220,11 @@ class xn extends sn {
|
|
|
1220
1220
|
] }) : this.props.children;
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
|
-
function yn(u = {}) {
|
|
1224
|
-
return Ae.createElement(mn, u);
|
|
1225
|
-
}
|
|
1226
1223
|
export {
|
|
1227
1224
|
xn as ErrorBoundary,
|
|
1228
|
-
yn as Game,
|
|
1229
1225
|
Y as announceToScreenReader,
|
|
1230
1226
|
pn as createAriaLabel,
|
|
1231
|
-
|
|
1227
|
+
wn as default,
|
|
1232
1228
|
fn as handleKeyDown,
|
|
1233
1229
|
un as useValidation
|
|
1234
1230
|
};
|