hyperbook 0.113.2 → 0.113.3
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/asset-manifest.json +9 -9
- package/dist/assets/directive-bitflow/{EditorElement-CE3Yr86b.js → EditorElement-BNwEKIvk.js} +143 -143
- package/dist/assets/directive-bitflow/{ReportElements-eYGRtw6N.js → ReportElements-CAvHx5xm.js} +2 -2
- package/dist/assets/directive-bitflow/{bitLoaders-CxvZkGrY.js → bitLoaders-7qanePQL.js} +41 -41
- package/dist/assets/directive-bitflow/{dom-uYx_3K1r.js → dom-B6NPWBb1.js} +1558 -1551
- package/dist/assets/directive-bitflow/editor.js +3 -3
- package/dist/assets/directive-bitflow/flow.js +4 -4
- package/dist/assets/directive-bitflow/{index-oNmOArKu.js → index-4JaKZ7WT.js} +2 -2
- package/dist/assets/directive-bitflow/{index-EKIgFddO.js → index-6CQr_atd.js} +19 -19
- package/dist/assets/directive-bitflow/{index-BadyFTU5.js → index-B9iG-a48.js} +2 -2
- package/dist/assets/directive-bitflow/{index-D4PdXMcj.js → index-BFYoOtcY.js} +5 -5
- package/dist/assets/directive-bitflow/{index-d5ebPDeY.js → index-BI6aFdIS.js} +10 -10
- package/dist/assets/directive-bitflow/{index-DruC5d43.js → index-Bf078mfo.js} +2 -2
- package/dist/assets/directive-bitflow/{index-CWe2GjBK.js → index-BinE5Wvd.js} +7 -7
- package/dist/assets/directive-bitflow/{index-BG0PL-Z6.js → index-BoX5-jkC.js} +7 -7
- package/dist/assets/directive-bitflow/{index-ledofrbo.js → index-BqRsXShM.js} +4 -4
- package/dist/assets/directive-bitflow/{index-CjKhq7gY.js → index-BxihQ8Oo.js} +13 -13
- package/dist/assets/directive-bitflow/{index-BNdpL6Ss.js → index-C5YguHZU.js} +28 -28
- package/dist/assets/directive-bitflow/{index-xTX3CXJW.js → index-C8zwSmE6.js} +7 -7
- package/dist/assets/directive-bitflow/{index-D9LOuqr2.js → index-C9JSBTNc.js} +21 -21
- package/dist/assets/directive-bitflow/{index-BydYlLy4.js → index-CCMI6UK4.js} +8 -8
- package/dist/assets/directive-bitflow/{index-WbE9UOFa.js → index-CGDt8H6s.js} +5 -5
- package/dist/assets/directive-bitflow/{index-D_QhyFcx.js → index-Ca1v0pjV.js} +5 -5
- package/dist/assets/directive-bitflow/{index-88c3K20U.js → index-CaYn3Gmh.js} +12 -12
- package/dist/assets/directive-bitflow/{index-C7RJxxAx.js → index-CbQue0If.js} +30 -30
- package/dist/assets/directive-bitflow/{index-CfKpkSVC.js → index-CjH3h0OO.js} +28 -28
- package/dist/assets/directive-bitflow/{index-TUXuIR22.js → index-CkO3QfOS.js} +4 -4
- package/dist/assets/directive-bitflow/{index-DIb3CXwC.js → index-Cz4i5rfe.js} +6 -6
- package/dist/assets/directive-bitflow/{index-HXNGIC7K.js → index-D0NtgeiX.js} +17 -17
- package/dist/assets/directive-bitflow/{index-CLHtOGrW.js → index-D1C_1SPY.js} +4 -4
- package/dist/assets/directive-bitflow/{index-Dn5hHVuT.js → index-D45u7EVR.js} +13 -13
- package/dist/assets/directive-bitflow/{index-IsMJtrUT.js → index-D9Ox4YpM.js} +10 -10
- package/dist/assets/directive-bitflow/{index-B61LKxr1.js → index-DJ1w2Xcm.js} +15 -15
- package/dist/assets/directive-bitflow/{index-BwBVUdJ9.js → index-DUqW2fmV.js} +2 -2
- package/dist/assets/directive-bitflow/{index-DUOrQfVe.js → index-Deedj9EF.js} +6 -6
- package/dist/assets/directive-bitflow/{index-DQP0cUsP.js → index-Dg6nnY_v.js} +14 -14
- package/dist/assets/directive-bitflow/{index-DW3cUBvZ.js → index-DgxEzomz.js} +2 -2
- package/dist/assets/directive-bitflow/{index-D0U3nepG.js → index-Dl0-ZAT5.js} +20 -20
- package/dist/assets/directive-bitflow/{index-ISbOe239.js → index-Do6dmZyj.js} +2 -2
- package/dist/assets/directive-bitflow/{index-Bw0pL0hW.js → index-DqnGC-DU.js} +6 -6
- package/dist/assets/directive-bitflow/{index-rp4UTV85.js → index-DwXXeSwk.js} +19 -19
- package/dist/assets/directive-bitflow/{index-BZhNY0lo.js → index-b6qwcTj9.js} +9 -9
- package/dist/assets/directive-bitflow/{index-BO-d4HVC.js → index-d105UFQI.js} +21 -21
- package/dist/assets/directive-bitflow/{index-BuQ-K_tR.js → index-jijMWQB6.js} +2 -2
- package/dist/assets/directive-bitflow/{index-DYWo0PUv.js → index-kxO5_U9Y.js} +2 -2
- package/dist/assets/directive-bitflow/{index-Cm4w1Zyc.js → index-p5AOgOal.js} +21 -21
- package/dist/assets/directive-bitflow/{index-BlT1EcFH.js → index-q2APknM6.js} +15 -15
- package/dist/assets/directive-bitflow/{index-CERSJ9uS.js → index-zVkWgm5I.js} +11 -11
- package/dist/assets/directive-bitflow/index.js +6 -6
- package/dist/assets/directive-bitflow/report.js +1 -1
- package/dist/assets/directive-bitflow/{shareableReport-vjEU4OvA.js → shareableReport-mdyEMdsJ.js} +6 -6
- package/dist/index.js +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { e as ke, g as R, F as
|
|
1
|
+
import { P as A, ak as he, Y as L, a2 as O, ac as we, ad as ne, a9 as q, a4 as pe, j as i, a as x, a5 as ve, b as P, aj as E, aa as xe, s as ge } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { e as ke, g as R, F as Y, M as je, r as G, i as K, P as ye, B as Ne, y as Le, U as Te, H as Se } from "./bitLoaders-7qanePQL.js";
|
|
3
3
|
const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
4
4
|
/** Stable across edits, so a placed marker and an answer keep pointing at
|
|
5
5
|
* the same item even after the author reorders the list. */
|
|
@@ -10,21 +10,21 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
10
10
|
/** The correct position, in the line's own units — never a fraction of the
|
|
11
11
|
* line's length. The author types an expression in the form ("3/4",
|
|
12
12
|
* "sqrt(2)"); this is always the evaluated number. */
|
|
13
|
-
value:
|
|
13
|
+
value: L(),
|
|
14
14
|
/** Overrides `tolerance` for this one item — a harder root among easier
|
|
15
15
|
* fractions, say. Absent means the line's own tolerance applies. */
|
|
16
|
-
tolerance:
|
|
16
|
+
tolerance: L().min(0).optional()
|
|
17
17
|
}), He = A({
|
|
18
18
|
instruction: O().default(""),
|
|
19
19
|
/** The line's extent, in its own units. */
|
|
20
|
-
min:
|
|
21
|
-
max:
|
|
20
|
+
min: L().default(-2),
|
|
21
|
+
max: L().default(2),
|
|
22
22
|
/** Spacing of the labelled ticks. Always positive: a step of zero would
|
|
23
23
|
* ask for infinitely many of them. */
|
|
24
|
-
tickStep:
|
|
24
|
+
tickStep: L().positive().default(1),
|
|
25
25
|
/** Unlabelled ticks between two major ones. Capped at 10 — past that the
|
|
26
26
|
* line reads as a smear of lines rather than a scale. */
|
|
27
|
-
minorTicks:
|
|
27
|
+
minorTicks: L().int().min(0).max(10).default(0),
|
|
28
28
|
labelTicks: q().default(!0),
|
|
29
29
|
items: pe(Ce).default([]),
|
|
30
30
|
/**
|
|
@@ -36,7 +36,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
36
36
|
* `toleranceFor` in `evaluate.ts` falls back to the same formula for a
|
|
37
37
|
* document that predates a field, or one written by hand.
|
|
38
38
|
*/
|
|
39
|
-
tolerance:
|
|
39
|
+
tolerance: L().min(0).optional(),
|
|
40
40
|
/** Where a placed marker actually lands. `"minor"` with no minor ticks
|
|
41
41
|
* drawn is the same as `"major"` — there is nothing finer to snap to. */
|
|
42
42
|
snap: Me.default("minor"),
|
|
@@ -79,7 +79,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
79
79
|
});
|
|
80
80
|
}), at = A({
|
|
81
81
|
/** Item id → where the learner placed it, in the line's own units. */
|
|
82
|
-
positions: he(O(),
|
|
82
|
+
positions: he(O(), L()).default({})
|
|
83
83
|
}), ze = (e) => e.tolerance ?? e.tickStep / 4, Pe = (e, r) => r.tolerance ?? ze(e), We = 1e-9, F = (e, r) => {
|
|
84
84
|
const c = {};
|
|
85
85
|
for (const n of e.items) {
|
|
@@ -244,14 +244,14 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
244
244
|
n[u] = o.view, a[o.id] = u;
|
|
245
245
|
}
|
|
246
246
|
return a;
|
|
247
|
-
}, ee = 9, Be = 36, Z = 14, te = 7, ie = 40, Ue = 26, Xe = 22, _e = 70, qe = 4,
|
|
247
|
+
}, ee = 9, Be = 36, Z = 14, te = 7, ie = 40, Ue = 26, Xe = 22, _e = 70, qe = 4, Ye = 560, Ge = 2.2, Ke = (e) => {
|
|
248
248
|
const [r, c] = x.useState(1);
|
|
249
249
|
return x.useLayoutEffect(() => {
|
|
250
250
|
const n = e.current;
|
|
251
251
|
if (!n || typeof ResizeObserver > "u") return;
|
|
252
252
|
const a = () => {
|
|
253
253
|
const u = n.getBoundingClientRect().width;
|
|
254
|
-
u && c(Math.min(
|
|
254
|
+
u && c(Math.min(Ge, Math.max(1, Ye / u)));
|
|
255
255
|
};
|
|
256
256
|
a();
|
|
257
257
|
const o = new ResizeObserver(a);
|
|
@@ -265,9 +265,9 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
265
265
|
readonly: a,
|
|
266
266
|
onPlace: o
|
|
267
267
|
}) => {
|
|
268
|
-
const u = (t, s) => P(V, t, n, s), b = x.useRef(null), d =
|
|
268
|
+
const u = (t, s) => P(V, t, n, s), b = x.useRef(null), d = Ke(b), k = x.useId(), j = r?.positions ?? {}, [M, l] = x.useState(
|
|
269
269
|
() => e.items.find((t) => j[t.id] === void 0)?.id ?? e.items[0]?.id
|
|
270
|
-
), [f, p] = x.useState(""), g = x.useRef(null), [, h] = x.useReducer((t) => t + 1, 0),
|
|
270
|
+
), [f, p] = x.useState(""), g = x.useRef(null), [, h] = x.useReducer((t) => t + 1, 0), N = !!o && !a, D = Ae(e), X = (t) => {
|
|
271
271
|
const s = b.current?.getBoundingClientRect();
|
|
272
272
|
if (!s || s.width === 0) return;
|
|
273
273
|
const m = (t - s.left) / s.width * $;
|
|
@@ -282,13 +282,13 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
282
282
|
w && l(w.id);
|
|
283
283
|
}
|
|
284
284
|
}, me = (t) => {
|
|
285
|
-
if (!
|
|
285
|
+
if (!N || !M) return;
|
|
286
286
|
const s = e.items.find((v) => v.id === M), m = X(t.clientX);
|
|
287
287
|
!s || m === void 0 || I(s, m, j[s.id] === void 0 ? "placed" : "moved");
|
|
288
288
|
}, de = (t, s, m) => {
|
|
289
|
-
!
|
|
289
|
+
!N || t.button !== 0 || (t.stopPropagation(), l(s.id), g.current = { itemId: s.id, startClientX: t.clientX, value: m, moved: !1 }, h());
|
|
290
290
|
};
|
|
291
|
-
|
|
291
|
+
Le((t) => {
|
|
292
292
|
const s = g.current;
|
|
293
293
|
if (!s) return;
|
|
294
294
|
const m = s.moved || Math.abs(t.clientX - s.startClientX) > qe, v = X(t.clientX), w = v === void 0 ? s.value : J(e, v);
|
|
@@ -300,7 +300,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
300
300
|
s && I(s, t.value, "moved");
|
|
301
301
|
});
|
|
302
302
|
const be = (t, s, m) => {
|
|
303
|
-
if (!
|
|
303
|
+
if (!N) return;
|
|
304
304
|
const v = t.shiftKey ? e.tickStep : Ze(e);
|
|
305
305
|
let w;
|
|
306
306
|
t.key === "ArrowLeft" ? w = m - v : t.key === "ArrowRight" ? w = m + v : t.key === "Home" ? w = e.min : t.key === "End" && (w = e.max), w !== void 0 && (t.preventDefault(), I(s, w, "moved"));
|
|
@@ -312,7 +312,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
312
312
|
_e
|
|
313
313
|
);
|
|
314
314
|
return /* @__PURE__ */ i.jsxs("div", { className: "bitflow-number-line", children: [
|
|
315
|
-
|
|
315
|
+
N && /* @__PURE__ */ i.jsx(
|
|
316
316
|
"div",
|
|
317
317
|
{
|
|
318
318
|
className: "bitflow-number-line-palette",
|
|
@@ -381,7 +381,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
381
381
|
},
|
|
382
382
|
`label-${t}`
|
|
383
383
|
)) }),
|
|
384
|
-
|
|
384
|
+
N && /* @__PURE__ */ i.jsx(
|
|
385
385
|
"rect",
|
|
386
386
|
{
|
|
387
387
|
x: S.left,
|
|
@@ -431,7 +431,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
431
431
|
children: m === "correct" ? "✓" : "✗"
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
|
-
|
|
434
|
+
N && /* @__PURE__ */ i.jsx(
|
|
435
435
|
"circle",
|
|
436
436
|
{
|
|
437
437
|
r: Be,
|
|
@@ -575,10 +575,10 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
575
575
|
value: (e.min + e.max) / 2
|
|
576
576
|
}
|
|
577
577
|
]
|
|
578
|
-
}), d = (l, f, p, g, h) => /* @__PURE__ */ i.jsx(
|
|
578
|
+
}), d = (l, f, p, g, h) => /* @__PURE__ */ i.jsx(G, { label: l, error: g, hint: h, children: (N) => /* @__PURE__ */ i.jsx(
|
|
579
579
|
ae,
|
|
580
580
|
{
|
|
581
|
-
...
|
|
581
|
+
...N,
|
|
582
582
|
className: "bitflow-input bitflow-number-line-number",
|
|
583
583
|
value: f,
|
|
584
584
|
onChange: p
|
|
@@ -623,7 +623,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
623
623
|
)
|
|
624
624
|
] }),
|
|
625
625
|
/* @__PURE__ */ i.jsx(
|
|
626
|
-
|
|
626
|
+
Y,
|
|
627
627
|
{
|
|
628
628
|
label: a("labelTicksLabel"),
|
|
629
629
|
hint: a("labelTicksHint"),
|
|
@@ -640,7 +640,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
640
640
|
onChange: (l) => o({ snap: l })
|
|
641
641
|
}
|
|
642
642
|
),
|
|
643
|
-
/* @__PURE__ */ i.jsx(
|
|
643
|
+
/* @__PURE__ */ i.jsx(G, { label: a("toleranceLabel"), hint: a("toleranceHint"), children: (l) => /* @__PURE__ */ i.jsx(
|
|
644
644
|
le,
|
|
645
645
|
{
|
|
646
646
|
...l,
|
|
@@ -657,7 +657,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
657
657
|
/* @__PURE__ */ i.jsxs("fieldset", { className: "bitflow-field", children: [
|
|
658
658
|
/* @__PURE__ */ i.jsx("legend", { className: "bitflow-label", children: a("itemsLabel") }),
|
|
659
659
|
/* @__PURE__ */ i.jsx("span", { className: "bitflow-hint", children: a("itemsHint") }),
|
|
660
|
-
|
|
660
|
+
K(n, "items") && /* @__PURE__ */ i.jsx("span", { className: "bitflow-field-error", role: "alert", children: K(n, "items") }),
|
|
661
661
|
M.map((l) => /* @__PURE__ */ i.jsx("span", { className: "bitflow-field-error", role: "alert", children: l }, l)),
|
|
662
662
|
e.items.length === 0 && /* @__PURE__ */ i.jsx("p", { className: "bitflow-text-muted", children: a("noItems") }),
|
|
663
663
|
e.items.map((l, f) => {
|
|
@@ -712,7 +712,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
712
712
|
] }),
|
|
713
713
|
/* @__PURE__ */ i.jsxs(ye, { summary: a("advanced"), children: [
|
|
714
714
|
/* @__PURE__ */ i.jsx(
|
|
715
|
-
|
|
715
|
+
Y,
|
|
716
716
|
{
|
|
717
717
|
label: a("partialCreditLabel"),
|
|
718
718
|
hint: a("partialCreditHint"),
|
|
@@ -721,7 +721,7 @@ const re = ["none", "minor", "major"], Me = ve(re), Ce = A({
|
|
|
721
721
|
}
|
|
722
722
|
),
|
|
723
723
|
/* @__PURE__ */ i.jsx(
|
|
724
|
-
|
|
724
|
+
Ne,
|
|
725
725
|
{
|
|
726
726
|
evaluation: e.evaluation,
|
|
727
727
|
locale: r,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as L, C as b, e as w, P as K, M as O, F as E, U as T, H as z } from "./bitLoaders-
|
|
1
|
+
import { P as g, a4 as k, a2 as c, j as a, a as q, b as f, E as v, a5 as y, a9 as N, s as C, aa as H } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { $ as L, C as b, e as w, P as K, M as O, F as E, U as T, H as z } from "./bitLoaders-7qanePQL.js";
|
|
3
3
|
const A = ".bitflow-identify{display:flex;flex-direction:column;gap:var(--bitflow-space-small);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard);padding:var(--bitflow-space-small);margin:0}.bitflow-identify-required{margin:0;min-height:1.5em;color:var(--bitflow-color-warning);font-size:var(--bitflow-font-size-small)}", p = {
|
|
4
4
|
en: {
|
|
5
5
|
name: "Who you are",
|
|
@@ -99,7 +99,7 @@ const A = ".bitflow-identify{display:flex;flex-direction:column;gap:var(--bitflo
|
|
|
99
99
|
const t = (r?.[s.id] ?? "").trim();
|
|
100
100
|
if (t !== "") return t;
|
|
101
101
|
}
|
|
102
|
-
},
|
|
102
|
+
}, P = {
|
|
103
103
|
en: {
|
|
104
104
|
titleLabel: "Title",
|
|
105
105
|
markdownLabel: "Introduction",
|
|
@@ -138,7 +138,7 @@ const A = ".bitflow-identify{display:flex;flex-direction:column;gap:var(--bitflo
|
|
|
138
138
|
removeField: "Diese Frage entfernen",
|
|
139
139
|
fieldUnnamed: "Frage ohne Text"
|
|
140
140
|
}
|
|
141
|
-
},
|
|
141
|
+
}, W = ({
|
|
142
142
|
data: e,
|
|
143
143
|
answer: r,
|
|
144
144
|
readonly: s,
|
|
@@ -192,7 +192,7 @@ const A = ".bitflow-identify{display:flex;flex-direction:column;gap:var(--bitflo
|
|
|
192
192
|
locale: r,
|
|
193
193
|
onChange: s
|
|
194
194
|
}) => {
|
|
195
|
-
const t = (i) => f(
|
|
195
|
+
const t = (i) => f(P, i, r), h = L(e.fields.map((i) => i.id)), d = (i, n) => s({
|
|
196
196
|
...e,
|
|
197
197
|
fields: e.fields.map(
|
|
198
198
|
(o) => o.id === i ? { ...o, ...n } : o
|
|
@@ -310,7 +310,7 @@ H({
|
|
|
310
310
|
type: j,
|
|
311
311
|
kind: "start",
|
|
312
312
|
schema: R,
|
|
313
|
-
Task:
|
|
313
|
+
Task: W,
|
|
314
314
|
Form: U,
|
|
315
315
|
info: (e) => ({
|
|
316
316
|
name: f(p, "name", e),
|
|
@@ -340,7 +340,7 @@ export {
|
|
|
340
340
|
R as DataSchema,
|
|
341
341
|
U as Form,
|
|
342
342
|
j as TYPE,
|
|
343
|
-
|
|
343
|
+
W as Task,
|
|
344
344
|
I as identityOf,
|
|
345
345
|
x as isFilledIn,
|
|
346
346
|
p as messages
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as ge, e as xe, g as F, P as _, C as J, M as ve, F as ke, B as ye, U as je, H as Ne } from "./bitLoaders-
|
|
3
|
-
const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-crossword-columns{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:var(--bitflow-space-medium);align-items:start}.bitflow-crossword-grid{display:flex;flex-direction:column;width:min(100%,calc(var(--bitflow-crossword-columns, 10) * 2.25rem));border:var(--bitflow-border-width) solid var(--bitflow-color-neutral-900);background:var(--bitflow-color-neutral-900);gap:1px}.bitflow-crossword-row{display:flex;gap:1px}.bitflow-crossword-cell,.bitflow-crossword-blank{position:relative;flex:1 1 0;min-width:0;aspect-ratio:1;container-type:inline-size}.bitflow-crossword-blank{background:var(--bitflow-color-neutral-900)}.bitflow-crossword-cell{display:flex;align-items:center;justify-content:center;background:var(--bitflow-color-surface)}.bitflow-crossword-cell-word{background:var(--bitflow-color-primary-light)}.bitflow-crossword-cell-here{box-shadow:inset 0 0 0 2px var(--bitflow-color-primary)}.bitflow-crossword-cell-correct{background:var(--bitflow-color-correct-surface)}.bitflow-crossword-cell-wrong{background:var(--bitflow-color-wrong-surface)}.bitflow-crossword-number{position:absolute;top:1px;left:2px;font-size:max(.5rem,22cqw);line-height:1;color:var(--bitflow-color-text-muted);pointer-events:none}.bitflow-crossword-input{width:100%;height:100%;padding:0;font:inherit;font-size:60cqw;font-weight:var(--bitflow-font-weight-medium);line-height:1;text-align:center;text-transform:uppercase;color:var(--bitflow-color-text);background:none;border:0;border-radius:0;cursor:pointer}.bitflow-crossword-input:focus{outline:none}.bitflow-crossword-input:disabled{cursor:default;-webkit-text-fill-color:var(--bitflow-color-text);opacity:1}.bitflow-crossword-clues{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-crossword-clue-list{display:flex;flex-direction:column;gap:var(--bitflow-space-xxsmall);padding:0;margin:var(--bitflow-space-xxsmall) 0 0;list-style:none}.bitflow-crossword-clue{display:flex;gap:var(--bitflow-space-xsmall);align-items:center;padding:var(--bitflow-space-xxsmall);border-radius:var(--bitflow-radius-small)}.bitflow-crossword-clue-current{background:var(--bitflow-color-primary-light)}.bitflow-crossword-clue-text{display:flex;gap:var(--bitflow-space-xsmall);flex:1;padding:0;font:inherit;text-align:start;color:inherit;background:none;border:0;cursor:pointer}.bitflow-crossword-clue .bitflow-crossword-number{position:static;font-size:inherit;font-weight:var(--bitflow-font-weight-bold);color:var(--bitflow-color-text-muted)}.bitflow-crossword-word{box-sizing:border-box;width:calc(var(--bitflow-crossword-letters, 8) * (1ch + .15em) + 2 * var(--bitflow-space-xxsmall) + 2 * var(--bitflow-border-width));padding:var(--bitflow-space-xxsmall);font-family:var(--bitflow-font-family-mono);font-size:var(--bitflow-font-size-standard);text-transform:uppercase;letter-spacing:.15em;color:var(--bitflow-color-text);background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-small)}.bitflow-crossword-mark{font-size:var(--bitflow-font-size-small)}.bitflow-crossword-mark-correct{color:var(--bitflow-color-correct)}.bitflow-crossword-mark-wrong{color:var(--bitflow-color-wrong)}.bitflow-crossword-preview{margin-top:var(--bitflow-space-xxsmall)}.bitflow-crossword-solution{font-size:60cqw;font-weight:var(--bitflow-font-weight-medium);line-height:1;text-transform:uppercase}", Ce = Q(["across", "down"]),
|
|
1
|
+
import { P as q, ak as ue, a2 as A, a as D, j as w, ac as me, ad as X, a9 as fe, a4 as he, a5 as Q, Y as Z, b as B, aa as be, s as pe } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { $ as ge, e as xe, g as F, P as _, C as J, M as ve, F as ke, B as ye, U as je, H as Ne } from "./bitLoaders-7qanePQL.js";
|
|
3
|
+
const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-crossword-columns{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:var(--bitflow-space-medium);align-items:start}.bitflow-crossword-grid{display:flex;flex-direction:column;width:min(100%,calc(var(--bitflow-crossword-columns, 10) * 2.25rem));border:var(--bitflow-border-width) solid var(--bitflow-color-neutral-900);background:var(--bitflow-color-neutral-900);gap:1px}.bitflow-crossword-row{display:flex;gap:1px}.bitflow-crossword-cell,.bitflow-crossword-blank{position:relative;flex:1 1 0;min-width:0;aspect-ratio:1;container-type:inline-size}.bitflow-crossword-blank{background:var(--bitflow-color-neutral-900)}.bitflow-crossword-cell{display:flex;align-items:center;justify-content:center;background:var(--bitflow-color-surface)}.bitflow-crossword-cell-word{background:var(--bitflow-color-primary-light)}.bitflow-crossword-cell-here{box-shadow:inset 0 0 0 2px var(--bitflow-color-primary)}.bitflow-crossword-cell-correct{background:var(--bitflow-color-correct-surface)}.bitflow-crossword-cell-wrong{background:var(--bitflow-color-wrong-surface)}.bitflow-crossword-number{position:absolute;top:1px;left:2px;font-size:max(.5rem,22cqw);line-height:1;color:var(--bitflow-color-text-muted);pointer-events:none}.bitflow-crossword-input{width:100%;height:100%;padding:0;font:inherit;font-size:60cqw;font-weight:var(--bitflow-font-weight-medium);line-height:1;text-align:center;text-transform:uppercase;color:var(--bitflow-color-text);background:none;border:0;border-radius:0;cursor:pointer}.bitflow-crossword-input:focus{outline:none}.bitflow-crossword-input:disabled{cursor:default;-webkit-text-fill-color:var(--bitflow-color-text);opacity:1}.bitflow-crossword-clues{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-crossword-clue-list{display:flex;flex-direction:column;gap:var(--bitflow-space-xxsmall);padding:0;margin:var(--bitflow-space-xxsmall) 0 0;list-style:none}.bitflow-crossword-clue{display:flex;gap:var(--bitflow-space-xsmall);align-items:center;padding:var(--bitflow-space-xxsmall);border-radius:var(--bitflow-radius-small)}.bitflow-crossword-clue-current{background:var(--bitflow-color-primary-light)}.bitflow-crossword-clue-text{display:flex;gap:var(--bitflow-space-xsmall);flex:1;padding:0;font:inherit;text-align:start;color:inherit;background:none;border:0;cursor:pointer}.bitflow-crossword-clue .bitflow-crossword-number{position:static;font-size:inherit;font-weight:var(--bitflow-font-weight-bold);color:var(--bitflow-color-text-muted)}.bitflow-crossword-word{box-sizing:border-box;width:calc(var(--bitflow-crossword-letters, 8) * (1ch + .15em) + 2 * var(--bitflow-space-xxsmall) + 2 * var(--bitflow-border-width));padding:var(--bitflow-space-xxsmall);font-family:var(--bitflow-font-family-mono);font-size:var(--bitflow-font-size-standard);text-transform:uppercase;letter-spacing:.15em;color:var(--bitflow-color-text);background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-small)}.bitflow-crossword-mark{font-size:var(--bitflow-font-size-small)}.bitflow-crossword-mark-correct{color:var(--bitflow-color-correct)}.bitflow-crossword-mark-wrong{color:var(--bitflow-color-wrong)}.bitflow-crossword-preview{margin-top:var(--bitflow-space-xxsmall)}.bitflow-crossword-solution{font-size:60cqw;font-weight:var(--bitflow-font-weight-medium);line-height:1;text-transform:uppercase}", Ce = Q(["across", "down"]), We = q({
|
|
4
4
|
/** Stable across edits, so an answer keeps pointing at the same word. */
|
|
5
5
|
id: A().min(1),
|
|
6
6
|
clue: A().default(""),
|
|
@@ -13,10 +13,10 @@ const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitf
|
|
|
13
13
|
row: Z().int().min(0).default(0),
|
|
14
14
|
column: Z().int().min(0).default(0),
|
|
15
15
|
orientation: Ce.default("across")
|
|
16
|
-
}),
|
|
16
|
+
}), Le = Q(["words", "letters"]), O = (e) => e.trim().toUpperCase().slice(0, 1), W = (e) => [...e.trim().toUpperCase()].filter((l) => l !== " "), Ae = q({
|
|
17
17
|
instruction: A().default(""),
|
|
18
|
-
words: he(
|
|
19
|
-
scoring:
|
|
18
|
+
words: he(We).default([]),
|
|
19
|
+
scoring: Le.default("words"),
|
|
20
20
|
/**
|
|
21
21
|
* Whether a wrong letter costs a point. Off by default: a crossword
|
|
22
22
|
* rewards care already, and a learner who guesses at the last clue should
|
|
@@ -38,7 +38,7 @@ const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitf
|
|
|
38
38
|
input: s,
|
|
39
39
|
path: ["words", o, "clue"],
|
|
40
40
|
message: "Give this word a clue."
|
|
41
|
-
}),
|
|
41
|
+
}), W(s.answer).length < 2 && e.issues.push({
|
|
42
42
|
code: "custom",
|
|
43
43
|
input: s,
|
|
44
44
|
path: ["words", o, "answer"],
|
|
@@ -69,7 +69,7 @@ const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitf
|
|
|
69
69
|
* adds a word.
|
|
70
70
|
*/
|
|
71
71
|
letters: ue(A(), A()).default({})
|
|
72
|
-
}), k = (e, l) => `${e},${l}`, ee = (e) =>
|
|
72
|
+
}), k = (e, l) => `${e},${l}`, ee = (e) => W(e.answer).map((l, n) => ({
|
|
73
73
|
row: e.row + (e.orientation === "down" ? n : 0),
|
|
74
74
|
column: e.column + (e.orientation === "across" ? n : 0)
|
|
75
75
|
})), ze = (e) => {
|
|
@@ -77,7 +77,7 @@ const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitf
|
|
|
77
77
|
e.map((c, b) => [b, /* @__PURE__ */ new Set()])
|
|
78
78
|
);
|
|
79
79
|
e.forEach((c, b) => {
|
|
80
|
-
const g =
|
|
80
|
+
const g = W(c.answer);
|
|
81
81
|
ee(c).forEach((r, t) => {
|
|
82
82
|
const i = k(r.row, r.column), f = n.get(i);
|
|
83
83
|
if (!f) {
|
|
@@ -110,22 +110,22 @@ const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitf
|
|
|
110
110
|
const m = /* @__PURE__ */ new Set();
|
|
111
111
|
return l.filter((c) => m.has(c.index) ? !1 : (m.add(c.index), !0));
|
|
112
112
|
}, S = (e) => {
|
|
113
|
-
const l = e.words.filter((i) =>
|
|
113
|
+
const l = e.words.filter((i) => W(i.answer).length > 0);
|
|
114
114
|
if (l.length === 0)
|
|
115
115
|
return { rows: 0, columns: 0, cells: /* @__PURE__ */ new Map(), words: [] };
|
|
116
116
|
const n = l.map(ee), s = n.flat(), o = Math.min(...s.map((i) => i.row)), u = Math.min(...s.map((i) => i.column)), m = /* @__PURE__ */ new Map();
|
|
117
117
|
l.forEach((i, f) => {
|
|
118
|
-
const x =
|
|
118
|
+
const x = W(i.answer);
|
|
119
119
|
n[f].forEach((y, N) => {
|
|
120
|
-
const H = y.row - o, C = y.column - u,
|
|
121
|
-
M[i.orientation] = i.id, m.set(
|
|
120
|
+
const H = y.row - o, C = y.column - u, L = k(H, C), M = m.get(L) ?? { row: H, column: C, solution: x[N] };
|
|
121
|
+
M[i.orientation] = i.id, m.set(L, M);
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
124
|
const c = Math.max(...[...m.values()].map((i) => i.row)) + 1, b = Math.max(...[...m.values()].map((i) => i.column)) + 1, g = l.map((i, f) => ({
|
|
125
125
|
word: i,
|
|
126
126
|
row: n[f][0].row - o,
|
|
127
127
|
column: n[f][0].column - u,
|
|
128
|
-
letters:
|
|
128
|
+
letters: W(i.answer)
|
|
129
129
|
})).sort((i, f) => i.row - f.row || i.column - f.column), r = /* @__PURE__ */ new Map(), t = [];
|
|
130
130
|
for (const i of g) {
|
|
131
131
|
const f = k(i.row, i.column), x = r.get(f) ?? r.size + 1;
|
|
@@ -241,10 +241,10 @@ const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitf
|
|
|
241
241
|
column: g?.column ?? 0
|
|
242
242
|
}), [i, f] = D.useState(
|
|
243
243
|
g?.orientation ?? "across"
|
|
244
|
-
), x = D.useRef(/* @__PURE__ */ new Map()), y = D.useRef(null), N = (d) => c.cells.get(k(d.row, d.column)), H = (d) => l.letters[k(d.row, d.column)] ?? "", C = N(r) ? r : { row: g?.row ?? 0, column: g?.column ?? 0 },
|
|
244
|
+
), x = D.useRef(/* @__PURE__ */ new Map()), y = D.useRef(null), N = (d) => c.cells.get(k(d.row, d.column)), H = (d) => l.letters[k(d.row, d.column)] ?? "", C = N(r) ? r : { row: g?.row ?? 0, column: g?.column ?? 0 }, L = (() => {
|
|
245
245
|
const d = N(C), a = d?.[i] ?? d?.[i === "across" ? "down" : "across"];
|
|
246
246
|
return c.words.find((p) => p.id === a);
|
|
247
|
-
})(), M =
|
|
247
|
+
})(), M = L ? $(c, L.id) : [], se = (d) => M.some(
|
|
248
248
|
(a) => a.row === d.row && a.column === d.column
|
|
249
249
|
), G = (d) => {
|
|
250
250
|
t(d), x.current.get(k(d.row, d.column))?.focus();
|
|
@@ -381,7 +381,7 @@ const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitf
|
|
|
381
381
|
(d) => b[d].length === 0 ? null : /* @__PURE__ */ w.jsxs("section", { children: [
|
|
382
382
|
/* @__PURE__ */ w.jsx("h3", { className: "bitflow-label", children: m(d) }),
|
|
383
383
|
/* @__PURE__ */ w.jsx("ul", { className: "bitflow-crossword-clue-list", children: b[d].map((a) => {
|
|
384
|
-
const p = de(a.id), h =
|
|
384
|
+
const p = de(a.id), h = L?.id === a.id;
|
|
385
385
|
return /* @__PURE__ */ w.jsxs(
|
|
386
386
|
"li",
|
|
387
387
|
{
|
|
@@ -495,7 +495,7 @@ const Me = ".bitflow-crossword{display:flex;flex-direction:column;gap:var(--bitf
|
|
|
495
495
|
penaliseHint: "Ein leeres Feld kostet nie etwas, damit Auslassen nie mehr wert ist als Versuchen."
|
|
496
496
|
}
|
|
497
497
|
}, z = (e) => e === "across" ? { row: 0, column: 1 } : { row: 1, column: 0 }, re = (e) => e === "across" ? "down" : "across", V = (e) => {
|
|
498
|
-
const l = e.map((r) => ({ word: r, letters:
|
|
498
|
+
const l = e.map((r) => ({ word: r, letters: W(r.answer) })).filter((r) => r.letters.length > 1);
|
|
499
499
|
if (l.length === 0) return { words: e, unplaced: [] };
|
|
500
500
|
const n = [...l].sort(
|
|
501
501
|
(r, t) => t.letters.length - r.letters.length || r.word.id.localeCompare(t.word.id)
|
|
@@ -805,10 +805,10 @@ export {
|
|
|
805
805
|
Ae as DataSchema,
|
|
806
806
|
Oe as Form,
|
|
807
807
|
Ce as OrientationSchema,
|
|
808
|
-
|
|
808
|
+
Le as ScoringSchema,
|
|
809
809
|
te as TYPE,
|
|
810
810
|
Be as Task,
|
|
811
|
-
|
|
811
|
+
We as WordSchema,
|
|
812
812
|
k as cellKey,
|
|
813
813
|
U as cellOutcome,
|
|
814
814
|
ee as cellsOf,
|
|
@@ -818,7 +818,7 @@ export {
|
|
|
818
818
|
S as gridOf,
|
|
819
819
|
V as layout,
|
|
820
820
|
Ee as letterAt,
|
|
821
|
-
|
|
821
|
+
W as lettersOf,
|
|
822
822
|
K as messages,
|
|
823
823
|
O as normalise,
|
|
824
824
|
oe as outcomes,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as oe, e as de, M as ce, g as z, i as U, P as $, C as Q, F as T, r as pe, B as he, U as ue, H as be } from "./bitLoaders-
|
|
1
|
+
import { P as F, a4 as H, ac as se, ad as J, Y as re, a9 as P, a2 as N, j as s, b as I, a5 as ne, a as C, aa as ie, s as le } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { $ as oe, e as de, M as ce, g as z, i as U, P as $, C as Q, F as T, r as pe, B as he, U as ue, H as be } from "./bitLoaders-7qanePQL.js";
|
|
3
3
|
const we = ["rearrange", "write"], fe = ne(we), me = F({
|
|
4
4
|
/** Stable across edits, so an answer keeps pointing at the same step. */
|
|
5
5
|
id: N().min(1),
|
|
@@ -413,7 +413,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = F({
|
|
|
413
413
|
}
|
|
414
414
|
)
|
|
415
415
|
] });
|
|
416
|
-
}, G = (e) => e.join(", "), K = (e) => e.split(",").map((t) => t.trim()).filter((t) => t.length > 0),
|
|
416
|
+
}, G = (e) => e.join(", "), K = (e) => e.split(",").map((t) => t.trim()).filter((t) => t.length > 0), Y = ({
|
|
417
417
|
values: e,
|
|
418
418
|
onChange: t,
|
|
419
419
|
...r
|
|
@@ -436,7 +436,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = F({
|
|
|
436
436
|
const r = `step-${t}`;
|
|
437
437
|
if (!e.includes(r)) return r;
|
|
438
438
|
}
|
|
439
|
-
},
|
|
439
|
+
}, Z = ({
|
|
440
440
|
values: e,
|
|
441
441
|
t
|
|
442
442
|
}) => /* @__PURE__ */ s.jsx("p", { className: "bitflow-text-muted", children: e.length > 0 ? t("parsedAs", { list: e.join(" · "), count: e.length }) : t("parsedEmpty") }), He = ({
|
|
@@ -484,7 +484,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = F({
|
|
|
484
484
|
),
|
|
485
485
|
/* @__PURE__ */ s.jsxs("div", { className: "bitflow-field", children: [
|
|
486
486
|
/* @__PURE__ */ s.jsx(
|
|
487
|
-
|
|
487
|
+
Y,
|
|
488
488
|
{
|
|
489
489
|
label: a("initialLabel"),
|
|
490
490
|
hint: a("initialHint"),
|
|
@@ -494,7 +494,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = F({
|
|
|
494
494
|
onChange: (n) => i({ initial: n })
|
|
495
495
|
}
|
|
496
496
|
),
|
|
497
|
-
/* @__PURE__ */ s.jsx(
|
|
497
|
+
/* @__PURE__ */ s.jsx(Z, { values: e.initial, t: a })
|
|
498
498
|
] }),
|
|
499
499
|
/* @__PURE__ */ s.jsxs("fieldset", { className: "bitflow-field", children: [
|
|
500
500
|
/* @__PURE__ */ s.jsx("legend", { className: "bitflow-label", children: a("stepsLabel") }),
|
|
@@ -519,7 +519,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = F({
|
|
|
519
519
|
),
|
|
520
520
|
/* @__PURE__ */ s.jsxs("div", { className: "bitflow-field", children: [
|
|
521
521
|
/* @__PURE__ */ s.jsx(
|
|
522
|
-
|
|
522
|
+
Y,
|
|
523
523
|
{
|
|
524
524
|
label: a("stepExpectedLabel"),
|
|
525
525
|
hint: a("stepExpectedHint"),
|
|
@@ -528,7 +528,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = F({
|
|
|
528
528
|
onChange: (c) => h(n.id, { expected: c })
|
|
529
529
|
}
|
|
530
530
|
),
|
|
531
|
-
/* @__PURE__ */ s.jsx(
|
|
531
|
+
/* @__PURE__ */ s.jsx(Z, { values: n.expected, t: a })
|
|
532
532
|
] }),
|
|
533
533
|
/* @__PURE__ */ s.jsxs("div", { className: "bitflow-row", children: [
|
|
534
534
|
/* @__PURE__ */ s.jsx(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { e as m, g, P
|
|
1
|
+
import { P as j, ak as C, a2 as u, ac as T, ad as A, a9 as h, a4 as S, j as r, a as x, b as k, aa as B, s as E } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { e as m, g, P, F as w, B as z, U as I, H as R } from "./bitLoaders-7qanePQL.js";
|
|
3
3
|
const F = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bitflow-blank-wrapper{display:inline}.bitflow-blank{display:inline-block;width:auto;max-width:100%;min-height:0;padding:2px var(--bitflow-space-xxsmall);vertical-align:baseline}.bitflow-input.bitflow-blank-correct{border-color:var(--bitflow-color-correct);background:var(--bitflow-color-correct-surface)}.bitflow-input.bitflow-blank-wrong{border-color:var(--bitflow-color-wrong);background:var(--bitflow-color-wrong-surface)}", y = /\[\[(\w+)\]\]/g, f = (e) => {
|
|
4
4
|
const t = [];
|
|
5
5
|
for (const n of e.matchAll(y))
|
|
@@ -119,7 +119,7 @@ const F = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
119
119
|
}) => {
|
|
120
120
|
const d = x.useId(), a = n?.detail?.blanks ?? {}, b = (i, c) => o({ blanks: { ...t?.blanks, [i]: c } });
|
|
121
121
|
return /* @__PURE__ */ r.jsxs("div", { className: "bitflow-stack", children: [
|
|
122
|
-
/* @__PURE__ */ r.jsx(
|
|
122
|
+
/* @__PURE__ */ r.jsx(I, { markdown: e.instruction }),
|
|
123
123
|
/* @__PURE__ */ r.jsx("p", { className: "bitflow-blank-text", children: $(e.text).map(
|
|
124
124
|
(i, c) => "text" in i ? /* @__PURE__ */ r.jsx(x.Fragment, { children: i.text }, c) : /* @__PURE__ */ r.jsxs("span", { className: "bitflow-blank-wrapper", children: [
|
|
125
125
|
/* @__PURE__ */ r.jsx(
|
|
@@ -192,7 +192,7 @@ const F = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
192
192
|
a
|
|
193
193
|
))
|
|
194
194
|
] }),
|
|
195
|
-
/* @__PURE__ */ r.jsxs(
|
|
195
|
+
/* @__PURE__ */ r.jsxs(P, { summary: l("advanced"), children: [
|
|
196
196
|
/* @__PURE__ */ r.jsx(
|
|
197
197
|
w,
|
|
198
198
|
{
|
|
@@ -219,7 +219,7 @@ const F = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
219
219
|
}
|
|
220
220
|
),
|
|
221
221
|
/* @__PURE__ */ r.jsx(
|
|
222
|
-
|
|
222
|
+
z,
|
|
223
223
|
{
|
|
224
224
|
evaluation: e.evaluation,
|
|
225
225
|
locale: t,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { e as H, g as F, C as
|
|
1
|
+
import { P as A, ak as R, a2 as x, a4 as B, a5 as I, ac as K, ad as $, ab as X, a9 as z, Y as _, j as o, a as w, s as q, b as y, aa as Y } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { e as H, g as F, C as Z, M as U, r as G, P as J, F as P, B as Q, U as ee, H as ae } from "./bitLoaders-7qanePQL.js";
|
|
3
3
|
let C;
|
|
4
4
|
const te = async () => (C ??= import("./compute-engine.min.esm-B8GYsYEC-Bk85Berc.js").then((e) => {
|
|
5
5
|
const a = new e.ComputeEngine();
|
|
@@ -539,7 +539,7 @@ const we = (e) => {
|
|
|
539
539
|
/* @__PURE__ */ o.jsx("legend", { className: "bitflow-label", children: d.length > 0 ? t("blanksHeading") : t("singleHeading") }),
|
|
540
540
|
m.map((l) => /* @__PURE__ */ o.jsxs("div", { className: "bitflow-stack-small bitflow-stack", children: [
|
|
541
541
|
/* @__PURE__ */ o.jsx(
|
|
542
|
-
|
|
542
|
+
Z,
|
|
543
543
|
{
|
|
544
544
|
label: l === g ? t("expectedLabel") : t("expectedFor", { name: l }),
|
|
545
545
|
value: e.blanks[l]?.expected ?? "",
|
|
@@ -564,7 +564,7 @@ const we = (e) => {
|
|
|
564
564
|
] }, l))
|
|
565
565
|
] }),
|
|
566
566
|
/* @__PURE__ */ o.jsx(
|
|
567
|
-
|
|
567
|
+
U,
|
|
568
568
|
{
|
|
569
569
|
label: t("compareLabel"),
|
|
570
570
|
hint: h,
|
|
@@ -643,7 +643,7 @@ const we = (e) => {
|
|
|
643
643
|
};
|
|
644
644
|
q("bitflow-styles-task-math", me);
|
|
645
645
|
const V = "task-math";
|
|
646
|
-
|
|
646
|
+
Y({
|
|
647
647
|
type: V,
|
|
648
648
|
kind: "task",
|
|
649
649
|
schema: ie,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { e as g, g as p, M, C as R, P as H, F as h, B as F, U as I, H as T } from "./bitLoaders-
|
|
3
|
-
const z = "",
|
|
1
|
+
import { P as m, a2 as o, a4 as x, ab as j, ac as C, ad as w, a9 as d, a5 as y, j as i, a as S, b as c, s as E, aa as A } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { e as g, g as p, M, C as R, P as H, F as h, B as F, U as I, H as T } from "./bitLoaders-7qanePQL.js";
|
|
3
|
+
const z = "", P = ({
|
|
4
4
|
data: e,
|
|
5
5
|
answer: n
|
|
6
6
|
}) => {
|
|
7
7
|
if (e.evaluation.mode === "skip")
|
|
8
8
|
return { state: "unknown", allowRetry: !1 };
|
|
9
|
-
const s = f(n?.input ?? "", e), l =
|
|
9
|
+
const s = f(n?.input ?? "", e), l = U(s, e), t = [];
|
|
10
10
|
if (e.evaluation.showFeedback)
|
|
11
11
|
for (const r of e.patternFeedback)
|
|
12
12
|
v(r.pattern, s, e.caseSensitive) && t.push(r.feedback);
|
|
@@ -16,7 +16,7 @@ const z = "", U = ({
|
|
|
16
16
|
allowRetry: e.evaluation.enableRetry,
|
|
17
17
|
feedback: t.length > 0 ? t : void 0
|
|
18
18
|
};
|
|
19
|
-
}, f = (e, n) => n.trim ? e.trim() : e,
|
|
19
|
+
}, f = (e, n) => n.trim ? e.trim() : e, U = (e, n) => {
|
|
20
20
|
if (n.matchMode === "regex")
|
|
21
21
|
return v(n.pattern, e, n.caseSensitive);
|
|
22
22
|
const s = (t) => n.caseSensitive ? t : t.toLowerCase(), l = s(e);
|
|
@@ -79,13 +79,13 @@ const z = "", U = ({
|
|
|
79
79
|
it: { name: "Risposta breve", description: "Una breve risposta scritta.", answerLabel: "La tua risposta" },
|
|
80
80
|
pt: { name: "Resposta curta", description: "Uma resposta curta escrita.", answerLabel: "A tua resposta" },
|
|
81
81
|
tr: { name: "Kısa yanıt", description: "Kısa, yazılan bir yanıt.", answerLabel: "Yanıtın" }
|
|
82
|
-
},
|
|
82
|
+
}, K = (e) => {
|
|
83
83
|
try {
|
|
84
84
|
return new RegExp(e), !0;
|
|
85
85
|
} catch {
|
|
86
86
|
return !1;
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, N = m({
|
|
89
89
|
instruction: o().default(""),
|
|
90
90
|
/**
|
|
91
91
|
* How the answer is checked. The old version only offered a raw regular
|
|
@@ -113,7 +113,7 @@ const z = "", U = ({
|
|
|
113
113
|
const { matchMode: n, pattern: s, expected: l, evaluation: t } = e.value;
|
|
114
114
|
if (t.mode === "auto") {
|
|
115
115
|
if (n === "regex") {
|
|
116
|
-
s ?
|
|
116
|
+
s ? K(s) || e.issues.push({
|
|
117
117
|
code: "custom",
|
|
118
118
|
input: s,
|
|
119
119
|
path: ["pattern"],
|
|
@@ -255,8 +255,8 @@ const k = "task-input";
|
|
|
255
255
|
A({
|
|
256
256
|
type: k,
|
|
257
257
|
kind: "task",
|
|
258
|
-
schema:
|
|
259
|
-
evaluate:
|
|
258
|
+
schema: N,
|
|
259
|
+
evaluate: P,
|
|
260
260
|
Task: D,
|
|
261
261
|
Form: G,
|
|
262
262
|
info: (e) => ({
|
|
@@ -278,10 +278,10 @@ A({
|
|
|
278
278
|
T(k);
|
|
279
279
|
export {
|
|
280
280
|
B as AnswerSchema,
|
|
281
|
-
|
|
281
|
+
N as DataSchema,
|
|
282
282
|
G as Form,
|
|
283
283
|
k as TYPE,
|
|
284
284
|
D as Task,
|
|
285
|
-
|
|
285
|
+
P as evaluate,
|
|
286
286
|
u as messages
|
|
287
287
|
};
|