hyperbook 0.113.1 → 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-zyz99U6n.js → EditorElement-BNwEKIvk.js} +258 -258
- package/dist/assets/directive-bitflow/{ReportElements-BnX14NtV.js → ReportElements-CAvHx5xm.js} +2 -2
- package/dist/assets/directive-bitflow/{bitLoaders-DIGwTcpd.js → bitLoaders-7qanePQL.js} +1138 -1073
- 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-BseSaQlX.js → index-4JaKZ7WT.js} +2 -2
- package/dist/assets/directive-bitflow/{index-e_8twLaN.js → index-6CQr_atd.js} +120 -120
- package/dist/assets/directive-bitflow/{index-COndsSPW.js → index-B9iG-a48.js} +9 -9
- package/dist/assets/directive-bitflow/{index-C5czXkRd.js → index-BFYoOtcY.js} +36 -36
- package/dist/assets/directive-bitflow/{index-YPMWh-1B.js → index-BI6aFdIS.js} +21 -21
- package/dist/assets/directive-bitflow/{index-D7m-hJZ9.js → index-Bf078mfo.js} +69 -69
- package/dist/assets/directive-bitflow/{index-Bf_FQRbK.js → index-BinE5Wvd.js} +19 -19
- package/dist/assets/directive-bitflow/{index-CFcRAa3F.js → index-BoX5-jkC.js} +31 -31
- package/dist/assets/directive-bitflow/{index-NyNuXp4C.js → index-BqRsXShM.js} +34 -34
- package/dist/assets/directive-bitflow/{index-Fr7yl4Vn.js → index-BxihQ8Oo.js} +21 -21
- package/dist/assets/directive-bitflow/{index-B3jMTk1o.js → index-C5YguHZU.js} +101 -101
- package/dist/assets/directive-bitflow/{index-XxGfBwJe.js → index-C8zwSmE6.js} +27 -27
- package/dist/assets/directive-bitflow/{index-BLcJNyog.js → index-C9JSBTNc.js} +91 -91
- package/dist/assets/directive-bitflow/{index-CjscG0z6.js → index-CCMI6UK4.js} +75 -75
- package/dist/assets/directive-bitflow/{index-CK1UMcfT.js → index-CGDt8H6s.js} +24 -24
- package/dist/assets/directive-bitflow/{index-xapm2BQE.js → index-Ca1v0pjV.js} +102 -92
- package/dist/assets/directive-bitflow/{index-IQHOi2fr.js → index-CaYn3Gmh.js} +31 -31
- package/dist/assets/directive-bitflow/{index-BpG316Ls.js → index-CbQue0If.js} +67 -67
- package/dist/assets/directive-bitflow/{index-CzdZQibq.js → index-CjH3h0OO.js} +79 -79
- package/dist/assets/directive-bitflow/{index-B7Z6Q-PQ.js → index-CkO3QfOS.js} +8 -8
- package/dist/assets/directive-bitflow/{index-BIJ7VfD2.js → index-Cz4i5rfe.js} +39 -39
- package/dist/assets/directive-bitflow/{index-8jTO-NJA.js → index-D0NtgeiX.js} +85 -85
- package/dist/assets/directive-bitflow/{index-DtsDy2By.js → index-D1C_1SPY.js} +14 -14
- package/dist/assets/directive-bitflow/{index-BdBBCZSy.js → index-D45u7EVR.js} +227 -194
- package/dist/assets/directive-bitflow/{index-cnRM_JDB.js → index-D9Ox4YpM.js} +33 -33
- package/dist/assets/directive-bitflow/{index-Bqf-kixT.js → index-DJ1w2Xcm.js} +46 -46
- package/dist/assets/directive-bitflow/{index-BQ5h4nDN.js → index-DUqW2fmV.js} +94 -94
- package/dist/assets/directive-bitflow/{index-ChgzyMHe.js → index-Deedj9EF.js} +25 -25
- package/dist/assets/directive-bitflow/{index-CZyaFdD2.js → index-Dg6nnY_v.js} +68 -68
- package/dist/assets/directive-bitflow/{index-kRpwcprB.js → index-DgxEzomz.js} +2 -2
- package/dist/assets/directive-bitflow/{index-D5yZNeIg.js → index-Dl0-ZAT5.js} +52 -52
- package/dist/assets/directive-bitflow/{index-DnVYIuen.js → index-Do6dmZyj.js} +42 -42
- package/dist/assets/directive-bitflow/{index-DjWNEPDL.js → index-DqnGC-DU.js} +31 -31
- package/dist/assets/directive-bitflow/{index-ivI25bnR.js → index-DwXXeSwk.js} +73 -73
- package/dist/assets/directive-bitflow/{index-Bf_NXJjq.js → index-b6qwcTj9.js} +15 -15
- package/dist/assets/directive-bitflow/{index-Fq7njn6_.js → index-d105UFQI.js} +58 -58
- package/dist/assets/directive-bitflow/{index-CW9iev-_.js → index-jijMWQB6.js} +8 -8
- package/dist/assets/directive-bitflow/{index-C_ZTSeqv.js → index-kxO5_U9Y.js} +24 -24
- package/dist/assets/directive-bitflow/{index-DoKlIgCD.js → index-p5AOgOal.js} +35 -35
- package/dist/assets/directive-bitflow/{index-CvCZVgKv.js → index-q2APknM6.js} +46 -46
- package/dist/assets/directive-bitflow/{index-eN2S_MLj.js → index-zVkWgm5I.js} +70 -70
- package/dist/assets/directive-bitflow/index.js +6 -6
- package/dist/assets/directive-bitflow/katex-DSLAjWZH-CHGN3Pr6.js +11314 -0
- package/dist/assets/directive-bitflow/katex-Dv-tcU2S-Dv-tcU2S.js +4 -0
- package/dist/assets/directive-bitflow/report.js +1 -1
- package/dist/assets/directive-bitflow/{shareableReport-ArQU1XjG.js → shareableReport-mdyEMdsJ.js} +6 -6
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitflow-space-
|
|
1
|
+
import { P as C, a4 as F, a as x, j as r, ac as J, ad as Z, a2 as P, am as ee, a5 as te, b as L, aa as ae, s as ie } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { $ as re, e as ne, g as z, P as G, B as le, U as se, M as oe, h as ce, C as de, H as he } from "./bitLoaders-7qanePQL.js";
|
|
3
|
+
const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-matching-columns{position:relative;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--bitflow-space-large)}.bitflow-matching-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}.bitflow-matching-line{stroke:var(--bitflow-color-primary);stroke-width:2;stroke-linecap:round}.bitflow-matching-line-correct{stroke:var(--bitflow-color-correct)}.bitflow-matching-line-wrong{stroke:var(--bitflow-color-wrong)}.bitflow-matching-column{display:flex;flex-direction:column;gap:var(--bitflow-space-xxsmall);padding:0;margin:var(--bitflow-space-xxsmall) 0 0;list-style:none}.bitflow-matching-card{display:flex;gap:var(--bitflow-space-xsmall);align-items:center;width:100%;padding:var(--bitflow-space-xsmall);font:inherit;color:var(--bitflow-color-text);text-align:left;cursor:pointer;background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-matching-card:disabled{cursor:default}.bitflow-matching-image{max-height:4rem}.bitflow-matching-index{flex:none;width:1.5rem;height:1.5rem;font-size:var(--bitflow-font-size-small);font-variant-numeric:tabular-nums;line-height:1.5rem;color:var(--bitflow-color-on-primary);text-align:center;background:var(--bitflow-color-primary);border-radius:50%}.bitflow-matching-card.bitflow-matching-card-held{background:var(--bitflow-color-neutral-100);border-color:var(--bitflow-color-primary);box-shadow:0 0 0 2px var(--bitflow-color-primary)}.bitflow-matching-card.bitflow-matching-card-matched{background:var(--bitflow-color-neutral-100);border-style:dashed}.bitflow-matching-card.bitflow-matching-card-correct{background:color-mix(in srgb,var(--bitflow-color-correct) 12%,var(--bitflow-color-surface));border-style:solid;border-color:var(--bitflow-color-correct)}.bitflow-matching-card.bitflow-matching-card-wrong{background:color-mix(in srgb,var(--bitflow-color-wrong) 12%,var(--bitflow-color-surface));border-style:solid;border-color:var(--bitflow-color-wrong)}.bitflow-matching-status{position:sticky;bottom:0;z-index:1;margin:0;padding:var(--bitflow-space-xsmall) var(--bitflow-space-small);color:var(--bitflow-color-text);background:var(--bitflow-color-surface);border-top:var(--bitflow-border-width) solid var(--bitflow-color-primary);box-shadow:var(--bitflow-shadow-medium)}", U = (t) => t.leftId === t.rightId, me = ({
|
|
4
4
|
data: t,
|
|
5
5
|
answer: l
|
|
6
6
|
}) => {
|
|
7
7
|
if (t.evaluation.mode === "skip")
|
|
8
8
|
return { state: "unknown", allowRetry: !1 };
|
|
9
|
-
const h = l?.matches ?? [], s = h.filter(
|
|
9
|
+
const h = l?.matches ?? [], s = h.filter(U), n = t.pairs.length;
|
|
10
10
|
return {
|
|
11
11
|
state: n > 0 && s.length === n ? "correct" : "wrong",
|
|
12
12
|
score: { earned: s.length, possible: n },
|
|
@@ -14,10 +14,10 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
14
14
|
detail: {
|
|
15
15
|
// Which pairings held, so each can be marked where it sits rather than
|
|
16
16
|
// the learner being given a number to reverse-engineer.
|
|
17
|
-
matches: h.map((o) => ({ ...o, correct:
|
|
17
|
+
matches: h.map((o) => ({ ...o, correct: U(o) }))
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
},
|
|
20
|
+
}, R = {
|
|
21
21
|
en: {
|
|
22
22
|
name: "Match up",
|
|
23
23
|
description: "Two columns the learner pairs off.",
|
|
@@ -58,24 +58,24 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
58
58
|
matchRight: "richtig",
|
|
59
59
|
matchWrong: "nicht richtig"
|
|
60
60
|
}
|
|
61
|
-
},
|
|
61
|
+
}, Y = C({
|
|
62
62
|
kind: te(["text", "image"]).default("text"),
|
|
63
63
|
/**
|
|
64
64
|
* The words on the card, or — for a picture — what the picture shows. One
|
|
65
65
|
* field either way, so an image can never be shipped undescribed.
|
|
66
66
|
*/
|
|
67
|
-
label:
|
|
67
|
+
label: P().default(""),
|
|
68
68
|
image: ee.optional()
|
|
69
|
-
}), fe =
|
|
69
|
+
}), fe = C({
|
|
70
70
|
/** Stable across edits, so an answer keeps pointing at the same pair. */
|
|
71
|
-
id:
|
|
72
|
-
left:
|
|
73
|
-
right:
|
|
74
|
-
}), ge =
|
|
75
|
-
instruction:
|
|
71
|
+
id: P().min(1),
|
|
72
|
+
left: Y,
|
|
73
|
+
right: Y
|
|
74
|
+
}), ge = C({
|
|
75
|
+
instruction: P().default(""),
|
|
76
76
|
/** Written as pairs; the learner is given the two columns shuffled. */
|
|
77
|
-
pairs:
|
|
78
|
-
evaluation: J.default(
|
|
77
|
+
pairs: F(fe).default([]),
|
|
78
|
+
evaluation: J.default(Z)
|
|
79
79
|
}).check((t) => {
|
|
80
80
|
const l = t.value.pairs.map((h) => h.id);
|
|
81
81
|
new Set(l).size !== l.length && t.issues.push({
|
|
@@ -104,13 +104,13 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
104
104
|
path: ["pairs"],
|
|
105
105
|
message: "Add at least two pairs. With one there is nothing to match."
|
|
106
106
|
});
|
|
107
|
-
}), be =
|
|
107
|
+
}), be = C({
|
|
108
108
|
/** The pair the left card came from. */
|
|
109
|
-
leftId:
|
|
109
|
+
leftId: P().min(1),
|
|
110
110
|
/** The pair the right card came from — the same one, when it is right. */
|
|
111
|
-
rightId:
|
|
112
|
-
}), ze =
|
|
113
|
-
matches:
|
|
111
|
+
rightId: P().min(1)
|
|
112
|
+
}), ze = C({
|
|
113
|
+
matches: F(be).default([])
|
|
114
114
|
}), we = ({
|
|
115
115
|
pairs: t,
|
|
116
116
|
leftOrder: l,
|
|
@@ -118,50 +118,50 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
118
118
|
matches: s,
|
|
119
119
|
results: n,
|
|
120
120
|
locale: o,
|
|
121
|
-
readonly:
|
|
121
|
+
readonly: k,
|
|
122
122
|
onChange: g
|
|
123
123
|
}) => {
|
|
124
|
-
const u = (e, a) =>
|
|
124
|
+
const u = (e, a) => L(R, e, o, a), [i, d] = x.useState(null), [w, c] = x.useState(""), b = x.useRef(null), T = x.useRef(/* @__PURE__ */ new Map()), [Q, H] = x.useState([]), p = (e) => t.find((a) => a.id === e), v = (e) => e.label, E = n !== void 0, M = i ? v(p(i).left) : null, $ = (e) => s.find((a) => a.leftId === e), A = (e) => s.find((a) => a.rightId === e), K = (e) => e && n?.find(
|
|
125
125
|
(a) => a.leftId === e.leftId && a.rightId === e.rightId
|
|
126
126
|
)?.correct;
|
|
127
127
|
x.useEffect(() => {
|
|
128
128
|
if (i === null) return;
|
|
129
129
|
const e = (a) => {
|
|
130
|
-
a.key === "Escape" && (d(null), c(
|
|
130
|
+
a.key === "Escape" && (d(null), c(L(R, "putDown", o)));
|
|
131
131
|
};
|
|
132
132
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
133
133
|
}, [i, o]);
|
|
134
|
-
const
|
|
134
|
+
const S = x.useCallback(() => {
|
|
135
135
|
const e = b.current;
|
|
136
|
-
if (!e) return
|
|
136
|
+
if (!e) return H([]);
|
|
137
137
|
const a = e.getBoundingClientRect(), f = [];
|
|
138
138
|
for (const m of s) {
|
|
139
139
|
const I = T.current.get(`left:${m.leftId}`), N = T.current.get(`right:${m.rightId}`);
|
|
140
140
|
if (!I || !N) continue;
|
|
141
|
-
const j = I.getBoundingClientRect(),
|
|
142
|
-
if (
|
|
141
|
+
const j = I.getBoundingClientRect(), y = N.getBoundingClientRect();
|
|
142
|
+
if (y.left < j.right) return H([]);
|
|
143
143
|
f.push({
|
|
144
144
|
id: `${m.leftId}:${m.rightId}`,
|
|
145
145
|
x1: j.right - a.left,
|
|
146
146
|
y1: j.top + j.height / 2 - a.top,
|
|
147
|
-
x2:
|
|
148
|
-
y2:
|
|
149
|
-
correct:
|
|
147
|
+
x2: y.left - a.left,
|
|
148
|
+
y2: y.top + y.height / 2 - a.top,
|
|
149
|
+
correct: K(m)
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
H(f);
|
|
153
153
|
}, [s, n]);
|
|
154
154
|
x.useLayoutEffect(() => {
|
|
155
|
-
|
|
156
|
-
const e = () =>
|
|
155
|
+
S();
|
|
156
|
+
const e = () => S();
|
|
157
157
|
window.addEventListener("resize", e);
|
|
158
158
|
const a = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(e);
|
|
159
159
|
return a && b.current && a.observe(b.current), () => {
|
|
160
160
|
window.removeEventListener("resize", e), a?.disconnect();
|
|
161
161
|
};
|
|
162
|
-
}, [
|
|
163
|
-
const
|
|
164
|
-
|
|
162
|
+
}, [S]);
|
|
163
|
+
const W = (e) => {
|
|
164
|
+
k || (g(
|
|
165
165
|
s.filter(
|
|
166
166
|
(a) => !(a.leftId === e.leftId && a.rightId === e.rightId)
|
|
167
167
|
)
|
|
@@ -172,10 +172,10 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
172
172
|
})
|
|
173
173
|
));
|
|
174
174
|
}, V = (e) => {
|
|
175
|
-
if (
|
|
175
|
+
if (k) return;
|
|
176
176
|
const a = $(e);
|
|
177
177
|
if (a) {
|
|
178
|
-
|
|
178
|
+
W(a);
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
181
|
const f = i === e ? null : e;
|
|
@@ -183,10 +183,10 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
183
183
|
f ? u("holding", { card: v(p(e).left) }) : u("putDown")
|
|
184
184
|
);
|
|
185
185
|
}, X = (e) => {
|
|
186
|
-
if (
|
|
186
|
+
if (k) return;
|
|
187
187
|
const a = A(e);
|
|
188
188
|
if (a && i === null) {
|
|
189
|
-
|
|
189
|
+
W(a);
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
192
|
if (i === null) return;
|
|
@@ -199,20 +199,20 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
199
199
|
right: v(p(e).right)
|
|
200
200
|
})
|
|
201
201
|
);
|
|
202
|
-
},
|
|
203
|
-
const m = f === "left" ? $(a) : A(a), I = m ? s.indexOf(m) + 1 : void 0, N = m ? f === "left" ? p(m.rightId)?.right : p(m.leftId)?.left : void 0, j =
|
|
204
|
-
return m &&
|
|
202
|
+
}, D = (e, a, f) => {
|
|
203
|
+
const m = f === "left" ? $(a) : A(a), I = m ? s.indexOf(m) + 1 : void 0, N = m ? f === "left" ? p(m.rightId)?.right : p(m.leftId)?.left : void 0, j = K(m), y = ["bitflow-matching-card"];
|
|
204
|
+
return m && y.push("bitflow-matching-card-matched"), i === a && f === "left" && y.push("bitflow-matching-card-held"), E && m && y.push(
|
|
205
205
|
j ? "bitflow-matching-card-correct" : "bitflow-matching-card-wrong"
|
|
206
206
|
), /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsxs(
|
|
207
207
|
"button",
|
|
208
208
|
{
|
|
209
209
|
type: "button",
|
|
210
|
-
ref: (
|
|
211
|
-
const
|
|
212
|
-
|
|
210
|
+
ref: (B) => {
|
|
211
|
+
const O = `${f}:${a}`;
|
|
212
|
+
B ? T.current.set(O, B) : T.current.delete(O);
|
|
213
213
|
},
|
|
214
|
-
className:
|
|
215
|
-
disabled:
|
|
214
|
+
className: y.join(" "),
|
|
215
|
+
disabled: k,
|
|
216
216
|
"aria-pressed": f === "left" ? i === a : void 0,
|
|
217
217
|
"aria-label": N ? u("matchedWith", { card: v(e), other: v(N) }) : u("unmatched", { card: v(e) }),
|
|
218
218
|
onClick: () => f === "left" ? V(a) : X(a),
|
|
@@ -227,7 +227,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
227
227
|
draggable: !1
|
|
228
228
|
}
|
|
229
229
|
) : /* @__PURE__ */ r.jsx("span", { children: v(e) }),
|
|
230
|
-
|
|
230
|
+
E && m && /* @__PURE__ */ r.jsxs("span", { className: "bitflow-visually-hidden", children: [
|
|
231
231
|
" ",
|
|
232
232
|
u(j ? "matchRight" : "matchWrong")
|
|
233
233
|
] })
|
|
@@ -236,9 +236,9 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
236
236
|
) }, a);
|
|
237
237
|
};
|
|
238
238
|
return /* @__PURE__ */ r.jsxs("div", { className: "bitflow-matching", children: [
|
|
239
|
-
/* @__PURE__ */ r.jsx("p", { className: "bitflow-hint", children: u(
|
|
239
|
+
/* @__PURE__ */ r.jsx("p", { className: "bitflow-hint", children: u(k ? "howToReadonly" : "howTo") }),
|
|
240
240
|
/* @__PURE__ */ r.jsxs("div", { className: "bitflow-matching-columns", ref: b, children: [
|
|
241
|
-
/* @__PURE__ */ r.jsx("svg", { className: "bitflow-matching-lines", "aria-hidden": "true", children:
|
|
241
|
+
/* @__PURE__ */ r.jsx("svg", { className: "bitflow-matching-lines", "aria-hidden": "true", children: Q.map((e) => /* @__PURE__ */ r.jsx(
|
|
242
242
|
"line",
|
|
243
243
|
{
|
|
244
244
|
className: e.correct === void 0 ? "bitflow-matching-line" : `bitflow-matching-line bitflow-matching-line-${e.correct ? "correct" : "wrong"}`,
|
|
@@ -253,14 +253,14 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
253
253
|
/* @__PURE__ */ r.jsx("h3", { className: "bitflow-label", children: u("leftHeading") }),
|
|
254
254
|
/* @__PURE__ */ r.jsx("ul", { className: "bitflow-matching-column", children: l.map((e) => {
|
|
255
255
|
const a = p(e);
|
|
256
|
-
return a ?
|
|
256
|
+
return a ? D(a.left, e, "left") : null;
|
|
257
257
|
}) })
|
|
258
258
|
] }),
|
|
259
259
|
/* @__PURE__ */ r.jsxs("section", { children: [
|
|
260
260
|
/* @__PURE__ */ r.jsx("h3", { className: "bitflow-label", children: u("rightHeading") }),
|
|
261
261
|
/* @__PURE__ */ r.jsx("ul", { className: "bitflow-matching-column", children: h.map((e) => {
|
|
262
262
|
const a = p(e);
|
|
263
|
-
return a ?
|
|
263
|
+
return a ? D(a.right, e, "right") : null;
|
|
264
264
|
}) })
|
|
265
265
|
] })
|
|
266
266
|
] }),
|
|
@@ -308,7 +308,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
308
308
|
unnamedPair: "Leeres Paar",
|
|
309
309
|
pairSummary: "{left} → {right}"
|
|
310
310
|
}
|
|
311
|
-
},
|
|
311
|
+
}, q = (t, l) => {
|
|
312
312
|
const h = xe(ve(l)), s = [...t];
|
|
313
313
|
for (let n = s.length - 1; n > 0; n--) {
|
|
314
314
|
const o = Math.floor(h() * (n + 1));
|
|
@@ -324,21 +324,21 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
324
324
|
t |= 0, t = t + 1831565813 | 0;
|
|
325
325
|
let l = Math.imul(t ^ t >>> 15, 1 | t);
|
|
326
326
|
return l = l + Math.imul(l ^ l >>> 7, 61 | l) ^ l, ((l ^ l >>> 14) >>> 0) / 4294967296;
|
|
327
|
-
},
|
|
327
|
+
}, ke = ({
|
|
328
328
|
data: t,
|
|
329
329
|
answer: l,
|
|
330
330
|
result: h,
|
|
331
331
|
readonly: s,
|
|
332
332
|
locale: n,
|
|
333
333
|
attempt: o,
|
|
334
|
-
onAnswerChange:
|
|
334
|
+
onAnswerChange: k
|
|
335
335
|
}) => {
|
|
336
336
|
const g = t.pairs.map((c) => c.id), u = o?.attemptId ?? "bitflow", i = x.useMemo(
|
|
337
|
-
() =>
|
|
337
|
+
() => q(g, `${u}:left`),
|
|
338
338
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
339
339
|
[g.join(), u]
|
|
340
340
|
), d = x.useMemo(
|
|
341
|
-
() =>
|
|
341
|
+
() => q(g, `${u}:right`),
|
|
342
342
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
343
343
|
[g.join(), u]
|
|
344
344
|
), w = (l?.matches ?? []).filter(
|
|
@@ -356,11 +356,11 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
356
356
|
results: h?.detail?.matches,
|
|
357
357
|
locale: n,
|
|
358
358
|
readonly: s,
|
|
359
|
-
onChange: (c) =>
|
|
359
|
+
onChange: (c) => k({ matches: c })
|
|
360
360
|
}
|
|
361
361
|
)
|
|
362
362
|
] });
|
|
363
|
-
},
|
|
363
|
+
}, ye = (t) => {
|
|
364
364
|
for (let l = t.length + 1; ; l++) {
|
|
365
365
|
const h = `pair-${l}`;
|
|
366
366
|
if (!t.includes(h)) return h;
|
|
@@ -371,7 +371,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
371
371
|
onChange: h,
|
|
372
372
|
errors: s
|
|
373
373
|
}) => {
|
|
374
|
-
const n = (i, d) =>
|
|
374
|
+
const n = (i, d) => L(pe, i, l, d), o = (i) => h({ ...t, ...i }), k = re(t.pairs.map((i) => i.id)), g = (i, d, w) => o({
|
|
375
375
|
pairs: t.pairs.map(
|
|
376
376
|
(c) => c.id === i ? { ...c, [d]: { ...c[d], ...w } } : c
|
|
377
377
|
)
|
|
@@ -436,9 +436,9 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
436
436
|
z(s, "pairs") && /* @__PURE__ */ r.jsx("span", { className: "bitflow-field-error", role: "alert", children: z(s, "pairs") }),
|
|
437
437
|
t.pairs.length === 0 && /* @__PURE__ */ r.jsx("p", { className: "bitflow-text-muted", children: n("noPairs") }),
|
|
438
438
|
t.pairs.map((i, d) => /* @__PURE__ */ r.jsx("div", { className: "bitflow-rule", children: /* @__PURE__ */ r.jsxs(
|
|
439
|
-
|
|
439
|
+
G,
|
|
440
440
|
{
|
|
441
|
-
...
|
|
441
|
+
...k.props(i.id),
|
|
442
442
|
summary: i.left.label || i.right.label ? n("pairSummary", {
|
|
443
443
|
left: i.left.label || "…",
|
|
444
444
|
right: i.right.label || "…"
|
|
@@ -469,7 +469,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
469
469
|
pairs: [
|
|
470
470
|
...t.pairs,
|
|
471
471
|
{
|
|
472
|
-
id:
|
|
472
|
+
id: ye(t.pairs.map((i) => i.id)),
|
|
473
473
|
left: { kind: "text", label: "" },
|
|
474
474
|
right: { kind: "text", label: "" }
|
|
475
475
|
}
|
|
@@ -479,7 +479,7 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
479
479
|
}
|
|
480
480
|
)
|
|
481
481
|
] }),
|
|
482
|
-
/* @__PURE__ */ r.jsx(
|
|
482
|
+
/* @__PURE__ */ r.jsx(G, { summary: n("advanced"), children: /* @__PURE__ */ r.jsx(
|
|
483
483
|
le,
|
|
484
484
|
{
|
|
485
485
|
evaluation: t.evaluation,
|
|
@@ -488,25 +488,25 @@ const ue = ".bitflow-matching{display:flex;flex-direction:column;gap:var(--bitfl
|
|
|
488
488
|
}
|
|
489
489
|
) })
|
|
490
490
|
] });
|
|
491
|
-
},
|
|
491
|
+
}, _ = "task-matching";
|
|
492
492
|
ae({
|
|
493
|
-
type:
|
|
493
|
+
type: _,
|
|
494
494
|
kind: "task",
|
|
495
495
|
schema: ge,
|
|
496
496
|
evaluate: me,
|
|
497
|
-
Task:
|
|
497
|
+
Task: ke,
|
|
498
498
|
Form: je,
|
|
499
499
|
info: (t) => ({
|
|
500
|
-
name:
|
|
501
|
-
description:
|
|
500
|
+
name: L(R, "name", t),
|
|
501
|
+
description: L(R, "description", t)
|
|
502
502
|
}),
|
|
503
503
|
defaultData: () => ({
|
|
504
504
|
instruction: "",
|
|
505
505
|
pairs: [],
|
|
506
|
-
evaluation:
|
|
506
|
+
evaluation: Z()
|
|
507
507
|
})
|
|
508
508
|
});
|
|
509
|
-
he(
|
|
509
|
+
he(_);
|
|
510
510
|
ie("bitflow-styles-task-matching", ue);
|
|
511
511
|
export {
|
|
512
512
|
ze as AnswerSchema,
|
|
@@ -515,12 +515,12 @@ export {
|
|
|
515
515
|
je as Form,
|
|
516
516
|
be as MatchSchema,
|
|
517
517
|
fe as PairSchema,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
518
|
+
Y as SideSchema,
|
|
519
|
+
_ as TYPE,
|
|
520
|
+
ke as Task,
|
|
521
521
|
me as evaluate,
|
|
522
522
|
pe as formMessages,
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
523
|
+
U as isRight,
|
|
524
|
+
R as messages,
|
|
525
|
+
q as seededShuffle
|
|
526
526
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
1
|
+
import { P as v, a9 as g, a2 as r, j as n, a as k, b as o, s as y, aa as L } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { C as m, e as j, F as x, U as A, H } from "./bitLoaders-7qanePQL.js";
|
|
3
|
+
const F = ".bitflow-download-state{margin:0;min-height:var(--bitflow-space-small);font-size:var(--bitflow-font-size-small);color:var(--bitflow-color-text-muted)}", h = {
|
|
4
4
|
en: {
|
|
5
5
|
name: "Finish and save",
|
|
6
6
|
description: "Closing screen that lets the learner save their attempt as a file.",
|
|
@@ -73,7 +73,7 @@ const N = ".bitflow-download-state{margin:0;min-height:var(--bitflow-space-small
|
|
|
73
73
|
saved: "{filename} olarak kaydedildi.",
|
|
74
74
|
failed: "Dosya kaydedilemedi."
|
|
75
75
|
}
|
|
76
|
-
},
|
|
76
|
+
}, N = v({
|
|
77
77
|
title: r().default(""),
|
|
78
78
|
markdown: r().default(""),
|
|
79
79
|
/** Leave empty for the wording this bit ships with. */
|
|
@@ -208,12 +208,12 @@ const N = ".bitflow-download-state{margin:0;min-height:var(--bitflow-space-small
|
|
|
208
208
|
)
|
|
209
209
|
] });
|
|
210
210
|
};
|
|
211
|
-
|
|
211
|
+
y("bitflow-styles-end-download", F);
|
|
212
212
|
const w = "end-download";
|
|
213
|
-
|
|
213
|
+
L({
|
|
214
214
|
type: w,
|
|
215
215
|
kind: "end",
|
|
216
|
-
schema:
|
|
216
|
+
schema: N,
|
|
217
217
|
Task: z,
|
|
218
218
|
Form: D,
|
|
219
219
|
info: (e) => ({
|
|
@@ -230,7 +230,7 @@ y({
|
|
|
230
230
|
});
|
|
231
231
|
H(w);
|
|
232
232
|
export {
|
|
233
|
-
|
|
233
|
+
N as DataSchema,
|
|
234
234
|
D as Form,
|
|
235
235
|
w as TYPE,
|
|
236
236
|
z as Task,
|