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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { P as v, a2 as b, a9 as m, j as i, $ as k, b as u, s as H, aa as L } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { C as f, e as x, F as h, U as y, H as N } from "./bitLoaders-7qanePQL.js";
|
|
3
3
|
const S = ".bitflow-certificate{border:var(--bitflow-border-width) solid var(--bitflow-color-primary-light);border-radius:var(--bitflow-radius-large);padding:var(--bitflow-space-large);background:var(--bitflow-color-surface);text-align:center}.bitflow-certificate-title{margin:0 0 var(--bitflow-space-small);font-size:var(--bitflow-font-size-xlarge);font-weight:var(--bitflow-font-weight-bold);color:var(--bitflow-color-primary-dark)}.bitflow-certificate-facts{display:flex;flex-direction:column;gap:var(--bitflow-space-small);margin:var(--bitflow-space-medium) 0 0}.bitflow-certificate-fact dt{font-size:var(--bitflow-font-size-small);text-transform:uppercase;letter-spacing:.06em;color:var(--bitflow-color-text-muted)}.bitflow-certificate-fact dd{margin:0;font-size:var(--bitflow-font-size-large);font-weight:var(--bitflow-font-weight-medium)}.bitflow-certificate-actions{display:flex;justify-content:center}@media print{.bitflow-certificate-actions{display:none}.bitflow-certificate{border-color:var(--bitflow-color-neutral-400);background:none}}", p = {
|
|
4
4
|
en: {
|
|
5
5
|
name: "Certificate",
|
|
@@ -99,7 +99,7 @@ const S = ".bitflow-certificate{border:var(--bitflow-border-width) solid var(--b
|
|
|
99
99
|
showDate: m().default(!0),
|
|
100
100
|
/** Leave empty for the wording this bit ships with. */
|
|
101
101
|
printLabel: b().default("")
|
|
102
|
-
}), D = "start-identify",
|
|
102
|
+
}), D = "start-identify", P = (e, s) => {
|
|
103
103
|
if (!(!e || !s))
|
|
104
104
|
for (const t of e.nodes) {
|
|
105
105
|
if (t.type !== D) continue;
|
|
@@ -114,12 +114,12 @@ const S = ".bitflow-certificate{border:var(--bitflow-border-width) solid var(--b
|
|
|
114
114
|
if (typeof o == "string" && o.trim() !== "") return o.trim();
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
},
|
|
117
|
+
}, z = (e) => {
|
|
118
118
|
const s = e?.completedAt ?? e?.updatedAt;
|
|
119
119
|
if (!s) return;
|
|
120
120
|
const t = new Date(s);
|
|
121
121
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
122
|
-
},
|
|
122
|
+
}, F = {
|
|
123
123
|
en: {
|
|
124
124
|
titleLabel: "Heading on the certificate",
|
|
125
125
|
markdownLabel: "Message",
|
|
@@ -146,13 +146,13 @@ const S = ".bitflow-certificate{border:var(--bitflow-border-width) solid var(--b
|
|
|
146
146
|
printLabelLabel: "Beschriftung der Druck-Schaltfläche",
|
|
147
147
|
printLabelHint: "Leer lassen für „Drucken“."
|
|
148
148
|
}
|
|
149
|
-
},
|
|
149
|
+
}, T = ({
|
|
150
150
|
data: e,
|
|
151
151
|
locale: s,
|
|
152
152
|
attempt: t,
|
|
153
153
|
flow: n
|
|
154
154
|
}) => {
|
|
155
|
-
const a = (c, w) => u(p, c, s, w), r = e.showScore && t ? k(t) : void 0, d = e.showName ?
|
|
155
|
+
const a = (c, w) => u(p, c, s, w), r = e.showScore && t ? k(t) : void 0, d = e.showName ? P(n, t) : void 0, o = e.showDate ? z(t) : void 0, l = [];
|
|
156
156
|
return d && l.push({ heading: a("nameHeading"), value: d }), r && r.possible > 0 && l.push({
|
|
157
157
|
heading: a("scoreHeading"),
|
|
158
158
|
// Partial credit produces fractions; two decimals is as fine as anyone
|
|
@@ -186,12 +186,12 @@ const S = ".bitflow-certificate{border:var(--bitflow-border-width) solid var(--b
|
|
|
186
186
|
}
|
|
187
187
|
) })
|
|
188
188
|
] });
|
|
189
|
-
},
|
|
189
|
+
}, C = ({
|
|
190
190
|
data: e,
|
|
191
191
|
locale: s,
|
|
192
192
|
onChange: t
|
|
193
193
|
}) => {
|
|
194
|
-
const n = (a) => u(
|
|
194
|
+
const n = (a) => u(F, a, s);
|
|
195
195
|
return /* @__PURE__ */ i.jsxs("div", { className: "bitflow-stack", children: [
|
|
196
196
|
/* @__PURE__ */ i.jsx(
|
|
197
197
|
f,
|
|
@@ -261,8 +261,8 @@ L({
|
|
|
261
261
|
type: g,
|
|
262
262
|
kind: "end",
|
|
263
263
|
schema: j,
|
|
264
|
-
Task:
|
|
265
|
-
Form:
|
|
264
|
+
Task: T,
|
|
265
|
+
Form: C,
|
|
266
266
|
info: (e) => ({
|
|
267
267
|
name: u(p, "name", e),
|
|
268
268
|
description: u(p, "description", e)
|
|
@@ -280,10 +280,10 @@ L({
|
|
|
280
280
|
N(g);
|
|
281
281
|
export {
|
|
282
282
|
j as DataSchema,
|
|
283
|
-
|
|
283
|
+
C as Form,
|
|
284
284
|
g as TYPE,
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
T as Task,
|
|
286
|
+
z as finishedAt,
|
|
287
287
|
p as messages,
|
|
288
|
-
|
|
288
|
+
P as nameIn
|
|
289
289
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { P as R, ak as te, a2 as y, ac as ie, ad as X, a9 as ae, a4 as U, a as A, j as t, Y as K, a5 as ne, b as O, aa as oe, s as se } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { e as le, M as re, i as T, P as de, F as ce, B as he, U as fe, H as me } from "./bitLoaders-7qanePQL.js";
|
|
3
3
|
const pe = {
|
|
4
4
|
/** Chen: 1, and n or m for "many". */
|
|
5
5
|
chen: ["1", "n", "m"],
|
|
@@ -7,14 +7,14 @@ const pe = {
|
|
|
7
7
|
minmax: ["(0,1)", "(1,1)", "(0,*)", "(1,*)"],
|
|
8
8
|
/** UML multiplicities, as class diagrams write them. */
|
|
9
9
|
uml: ["0..1", "1", "*", "1..*"]
|
|
10
|
-
}, we = ne(["chen", "minmax", "uml"]), E = (e) => pe[e], ue =
|
|
10
|
+
}, we = ne(["chen", "minmax", "uml"]), E = (e) => pe[e], ue = R({
|
|
11
11
|
/** Stable across edits, so a relationship keeps pointing at the same box. */
|
|
12
12
|
id: y().min(1),
|
|
13
13
|
name: y().default(""),
|
|
14
14
|
/** Where the box's middle sits, as fractions of the diagram (0–1). */
|
|
15
|
-
x:
|
|
16
|
-
y:
|
|
17
|
-
}), be =
|
|
15
|
+
x: K().min(0).max(1).default(0.5),
|
|
16
|
+
y: K().min(0).max(1).default(0.5)
|
|
17
|
+
}), be = R({
|
|
18
18
|
id: y().min(1),
|
|
19
19
|
/** The verb on the line or in the diamond: "borrows", "teaches". */
|
|
20
20
|
name: y().default(""),
|
|
@@ -24,11 +24,11 @@ const pe = {
|
|
|
24
24
|
expectedFrom: y().default(""),
|
|
25
25
|
/** The label that belongs at the `to` end. */
|
|
26
26
|
expectedTo: y().default("")
|
|
27
|
-
}), xe =
|
|
27
|
+
}), xe = R({
|
|
28
28
|
instruction: y().default(""),
|
|
29
29
|
notation: we.default("chen"),
|
|
30
|
-
entities:
|
|
31
|
-
relationships:
|
|
30
|
+
entities: U(ue).default([]),
|
|
31
|
+
relationships: U(be).default([]),
|
|
32
32
|
/** A point per end rather than one for the whole diagram. */
|
|
33
33
|
partialCredit: ae().default(!0),
|
|
34
34
|
evaluation: ie.default(X)
|
|
@@ -77,7 +77,7 @@ const pe = {
|
|
|
77
77
|
message: `Choose the answer for this end: one of ${u.join(", ")}.`
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
|
-
}),
|
|
80
|
+
}), L = (e, n) => `${e}:${n}`, He = R({
|
|
81
81
|
ends: te(y(), y()).default({})
|
|
82
82
|
}), C = (e, n) => e.entities.find((s) => s.id === n), ye = (e, n, s) => {
|
|
83
83
|
if (s === void 0) return !1;
|
|
@@ -90,7 +90,7 @@ const pe = {
|
|
|
90
90
|
const s = {};
|
|
91
91
|
for (const o of e.relationships)
|
|
92
92
|
for (const a of ["from", "to"]) {
|
|
93
|
-
const h = a === "from" ? o.expectedFrom : o.expectedTo, w =
|
|
93
|
+
const h = a === "from" ? o.expectedFrom : o.expectedTo, w = L(o.id, a);
|
|
94
94
|
s[w] = ye(e.notation, h, n?.ends?.[w]) ? "correct" : "wrong";
|
|
95
95
|
}
|
|
96
96
|
return s;
|
|
@@ -104,7 +104,7 @@ const pe = {
|
|
|
104
104
|
allowRetry: e.evaluation.enableRetry,
|
|
105
105
|
detail: { ends: s }
|
|
106
106
|
};
|
|
107
|
-
},
|
|
107
|
+
}, M = {
|
|
108
108
|
en: {
|
|
109
109
|
name: "Cardinalities",
|
|
110
110
|
description: "A diagram of entities and relationships whose ends the learner labels with cardinalities.",
|
|
@@ -129,7 +129,7 @@ const pe = {
|
|
|
129
129
|
correct: "richtig",
|
|
130
130
|
wrong: "falsch"
|
|
131
131
|
}
|
|
132
|
-
}, je = ".bitflow-cardinality{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-cardinality-diagram{width:100%;height:auto;background:var(--bitflow-color-surface);border:1px solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-cardinality-relationship line{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(2.5 * var(--bitflow-cardinality-scale, 1))}.bitflow-cardinality-diamond{fill:var(--bitflow-color-surface);stroke:var(--bitflow-color-neutral-700);stroke-width:calc(2.5 * var(--bitflow-cardinality-scale, 1))}.bitflow-cardinality-diagram text{fill:var(--bitflow-color-text);font-family:var(--bitflow-font-family);text-anchor:middle;dominant-baseline:central}.bitflow-cardinality-verb{font-size:calc(20px * var(--bitflow-cardinality-scale, 1));font-style:italic}.bitflow-cardinality-entity rect{fill:var(--bitflow-color-primary-light);stroke:var(--bitflow-color-primary);stroke-width:calc(2.5 * var(--bitflow-cardinality-scale, 1))}.bitflow-cardinality-entity text{font-size:calc(24px * var(--bitflow-cardinality-scale, 1));font-weight:var(--bitflow-font-weight-medium)}.bitflow-cardinality-end text{font-family:var(--bitflow-font-family-mono);font-size:calc(24px * var(--bitflow-cardinality-scale, 1));font-weight:var(--bitflow-font-weight-bold)}.bitflow-cardinality-end-correct text{fill:var(--bitflow-color-correct)}.bitflow-cardinality-end-wrong text{fill:var(--bitflow-color-wrong)}.bitflow-cardinality-row{display:flex;flex-wrap:wrap;gap:var(--bitflow-space-xsmall) var(--bitflow-space-small);margin:0;padding:var(--bitflow-space-xsmall) 0 0;border:0;border-top:1px solid var(--bitflow-color-border)}.bitflow-cardinality-row legend{float:left;width:100%;padding:0}.bitflow-cardinality-end-field{display:flex;flex-direction:column;gap:var(--bitflow-space-xxsmall);flex:1 1 10rem}.bitflow-select.bitflow-cardinality-select-correct{border-color:var(--bitflow-color-correct);background:var(--bitflow-color-correct-surface)}.bitflow-select.bitflow-cardinality-select-wrong{border-color:var(--bitflow-color-wrong);background:var(--bitflow-color-wrong-surface)}.bitflow-cardinality-editor-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-cardinality-editor-row>.bitflow-input,.bitflow-cardinality-editor-row>.bitflow-select{flex:1 1 var(--bitflow-cardinality-editor-min, 7rem);width:auto;min-width:0}.bitflow-cardinality-editor-row>.bitflow-cardinality-percent{flex:0 1 5rem}",
|
|
132
|
+
}, je = ".bitflow-cardinality{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-cardinality-diagram{width:100%;height:auto;background:var(--bitflow-color-surface);border:1px solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-cardinality-relationship line{stroke:var(--bitflow-color-neutral-700);stroke-width:calc(2.5 * var(--bitflow-cardinality-scale, 1))}.bitflow-cardinality-diamond{fill:var(--bitflow-color-surface);stroke:var(--bitflow-color-neutral-700);stroke-width:calc(2.5 * var(--bitflow-cardinality-scale, 1))}.bitflow-cardinality-diagram text{fill:var(--bitflow-color-text);font-family:var(--bitflow-font-family);text-anchor:middle;dominant-baseline:central}.bitflow-cardinality-verb{font-size:calc(20px * var(--bitflow-cardinality-scale, 1));font-style:italic}.bitflow-cardinality-entity rect{fill:var(--bitflow-color-primary-light);stroke:var(--bitflow-color-primary);stroke-width:calc(2.5 * var(--bitflow-cardinality-scale, 1))}.bitflow-cardinality-entity text{font-size:calc(24px * var(--bitflow-cardinality-scale, 1));font-weight:var(--bitflow-font-weight-medium)}.bitflow-cardinality-end text{font-family:var(--bitflow-font-family-mono);font-size:calc(24px * var(--bitflow-cardinality-scale, 1));font-weight:var(--bitflow-font-weight-bold)}.bitflow-cardinality-end-correct text{fill:var(--bitflow-color-correct)}.bitflow-cardinality-end-wrong text{fill:var(--bitflow-color-wrong)}.bitflow-cardinality-row{display:flex;flex-wrap:wrap;gap:var(--bitflow-space-xsmall) var(--bitflow-space-small);margin:0;padding:var(--bitflow-space-xsmall) 0 0;border:0;border-top:1px solid var(--bitflow-color-border)}.bitflow-cardinality-row legend{float:left;width:100%;padding:0}.bitflow-cardinality-end-field{display:flex;flex-direction:column;gap:var(--bitflow-space-xxsmall);flex:1 1 10rem}.bitflow-select.bitflow-cardinality-select-correct{border-color:var(--bitflow-color-correct);background:var(--bitflow-color-correct-surface)}.bitflow-select.bitflow-cardinality-select-wrong{border-color:var(--bitflow-color-wrong);background:var(--bitflow-color-wrong-surface)}.bitflow-cardinality-editor-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-cardinality-editor-row>.bitflow-input,.bitflow-cardinality-editor-row>.bitflow-select{flex:1 1 var(--bitflow-cardinality-editor-min, 7rem);width:auto;min-width:0}.bitflow-cardinality-editor-row>.bitflow-cardinality-percent{flex:0 1 5rem}", G = 1e3, Q = 600, Ne = 56, Ee = 34, Ce = 560, Oe = 2, ke = (e) => {
|
|
133
133
|
const [n, s] = A.useState(1);
|
|
134
134
|
return A.useLayoutEffect(() => {
|
|
135
135
|
const o = e.current;
|
|
@@ -142,9 +142,9 @@ const pe = {
|
|
|
142
142
|
const h = new ResizeObserver(a);
|
|
143
143
|
return h.observe(o), () => h.disconnect();
|
|
144
144
|
}, [e]), n;
|
|
145
|
-
},
|
|
146
|
-
x: e.x *
|
|
147
|
-
y: e.y *
|
|
145
|
+
}, $ = (e, n) => ({
|
|
146
|
+
x: e.x * G,
|
|
147
|
+
y: e.y * Q,
|
|
148
148
|
halfWidth: Math.max(120, e.name.length * 15 + 40) * n / 2,
|
|
149
149
|
halfHeight: Ne * n / 2
|
|
150
150
|
}), Y = (e, n) => {
|
|
@@ -161,11 +161,11 @@ const pe = {
|
|
|
161
161
|
x: e.x + (n.x - e.x) / o * s,
|
|
162
162
|
y: e.y + (n.y - e.y) / o * s
|
|
163
163
|
};
|
|
164
|
-
},
|
|
164
|
+
}, Te = (e, n, s) => s("relationshipName", {
|
|
165
165
|
from: C(e, n.from)?.name || "?",
|
|
166
166
|
name: n.name || "—",
|
|
167
167
|
to: C(e, n.to)?.name || "?"
|
|
168
|
-
}),
|
|
168
|
+
}), V = ({
|
|
169
169
|
data: e,
|
|
170
170
|
answer: n,
|
|
171
171
|
states: s,
|
|
@@ -174,14 +174,14 @@ const pe = {
|
|
|
174
174
|
showAnswers: h,
|
|
175
175
|
onChange: w
|
|
176
176
|
}) => {
|
|
177
|
-
const u = (f, m) => O(
|
|
177
|
+
const u = (f, m) => O(M, f, a, m), p = A.useRef(null), b = ke(p), g = A.useId(), F = e.notation !== "uml", H = (f, m) => h ? m === "from" ? f.expectedFrom : f.expectedTo : n?.ends?.[L(f.id, m)];
|
|
178
178
|
return /* @__PURE__ */ t.jsxs("div", { className: "bitflow-cardinality", children: [
|
|
179
179
|
/* @__PURE__ */ t.jsxs(
|
|
180
180
|
"svg",
|
|
181
181
|
{
|
|
182
182
|
ref: p,
|
|
183
183
|
className: "bitflow-cardinality-diagram",
|
|
184
|
-
viewBox: `0 0 ${
|
|
184
|
+
viewBox: `0 0 ${G} ${Q}`,
|
|
185
185
|
role: "img",
|
|
186
186
|
"aria-label": u("diagramLabel"),
|
|
187
187
|
style: { "--bitflow-cardinality-scale": b },
|
|
@@ -189,10 +189,10 @@ const pe = {
|
|
|
189
189
|
e.relationships.map((f) => {
|
|
190
190
|
const m = C(e, f.from), i = C(e, f.to);
|
|
191
191
|
if (!m || !i || m === i) return null;
|
|
192
|
-
const d =
|
|
192
|
+
const d = $(m, b), c = $(i, b), l = Y(d, c), r = Y(c, d), x = { x: (l.x + r.x) / 2, y: (l.y + r.y) / 2 }, B = Math.hypot(r.x - l.x, r.y - l.y), Z = Math.abs(r.y - l.y) > Math.abs(r.x - l.x), k = Math.min(28 * b, B * (Z ? 0.16 : 0.08)), J = Math.min(Ee * b, B * 0.22);
|
|
193
193
|
return /* @__PURE__ */ t.jsxs("g", { className: "bitflow-cardinality-relationship", children: [
|
|
194
194
|
/* @__PURE__ */ t.jsx("line", { x1: l.x, y1: l.y, x2: r.x, y2: r.y }),
|
|
195
|
-
|
|
195
|
+
F ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
196
196
|
/* @__PURE__ */ t.jsx(
|
|
197
197
|
"polygon",
|
|
198
198
|
{
|
|
@@ -206,7 +206,7 @@ const pe = {
|
|
|
206
206
|
const j = v === "from" ? l : r, N = v === "from" ? r : l, P = ze(j, N, J), S = Math.hypot(N.x - j.x, N.y - j.y) || 1, W = 18 * b, D = {
|
|
207
207
|
x: P.x - (N.y - j.y) / S * W,
|
|
208
208
|
y: P.y + (N.x - j.x) / S * W
|
|
209
|
-
}, ee =
|
|
209
|
+
}, ee = H(f, v), z = h ? void 0 : s?.[L(f.id, v)];
|
|
210
210
|
return /* @__PURE__ */ t.jsx(
|
|
211
211
|
"g",
|
|
212
212
|
{
|
|
@@ -223,7 +223,7 @@ const pe = {
|
|
|
223
223
|
] }, f.id);
|
|
224
224
|
}),
|
|
225
225
|
e.entities.map((f) => {
|
|
226
|
-
const m =
|
|
226
|
+
const m = $(f, b);
|
|
227
227
|
return /* @__PURE__ */ t.jsxs("g", { className: "bitflow-cardinality-entity", children: [
|
|
228
228
|
/* @__PURE__ */ t.jsx(
|
|
229
229
|
"rect",
|
|
@@ -242,9 +242,9 @@ const pe = {
|
|
|
242
242
|
}
|
|
243
243
|
),
|
|
244
244
|
w && !h && /* @__PURE__ */ t.jsx("div", { className: "bitflow-stack-small bitflow-stack", children: e.relationships.map((f) => /* @__PURE__ */ t.jsxs("fieldset", { className: "bitflow-cardinality-row", children: [
|
|
245
|
-
/* @__PURE__ */ t.jsx("legend", { className: "bitflow-label", children:
|
|
245
|
+
/* @__PURE__ */ t.jsx("legend", { className: "bitflow-label", children: Te(e, f, u) }),
|
|
246
246
|
["from", "to"].map((m) => {
|
|
247
|
-
const i =
|
|
247
|
+
const i = L(f.id, m), d = C(e, f[m]), c = s?.[i], l = `${g}-${i}`;
|
|
248
248
|
return /* @__PURE__ */ t.jsxs("div", { className: "bitflow-cardinality-end-field", children: [
|
|
249
249
|
/* @__PURE__ */ t.jsx("label", { htmlFor: l, children: u("endAt", { entity: d?.name || "?" }) }),
|
|
250
250
|
/* @__PURE__ */ t.jsxs(
|
|
@@ -269,7 +269,7 @@ const pe = {
|
|
|
269
269
|
})
|
|
270
270
|
] }, f.id)) })
|
|
271
271
|
] });
|
|
272
|
-
},
|
|
272
|
+
}, Le = {
|
|
273
273
|
en: {
|
|
274
274
|
instructionLabel: "Instruction",
|
|
275
275
|
instructionHint: "Shown above the diagram — usually the situation to model, in words. Markdown is allowed.",
|
|
@@ -348,12 +348,12 @@ const pe = {
|
|
|
348
348
|
locale: a,
|
|
349
349
|
onAnswerChange: h
|
|
350
350
|
}) => {
|
|
351
|
-
const w = (p) => O(
|
|
351
|
+
const w = (p) => O(M, p, a), u = s?.detail?.ends;
|
|
352
352
|
return /* @__PURE__ */ t.jsxs("div", { className: "bitflow-stack", children: [
|
|
353
353
|
/* @__PURE__ */ t.jsx(fe, { markdown: e.instruction }),
|
|
354
354
|
/* @__PURE__ */ t.jsx("p", { className: "bitflow-hint", children: w(o ? "howToReadonly" : "howTo") }),
|
|
355
355
|
/* @__PURE__ */ t.jsx(
|
|
356
|
-
|
|
356
|
+
V,
|
|
357
357
|
{
|
|
358
358
|
data: e,
|
|
359
359
|
answer: n,
|
|
@@ -364,12 +364,12 @@ const pe = {
|
|
|
364
364
|
}
|
|
365
365
|
)
|
|
366
366
|
] });
|
|
367
|
-
},
|
|
367
|
+
}, I = (e, n) => {
|
|
368
368
|
for (let s = n.length + 1; ; s++) {
|
|
369
369
|
const o = `${e}-${s}`;
|
|
370
370
|
if (!n.includes(o)) return o;
|
|
371
371
|
}
|
|
372
|
-
},
|
|
372
|
+
}, q = (e, n, s) => /* @__PURE__ */ t.jsx(
|
|
373
373
|
"input",
|
|
374
374
|
{
|
|
375
375
|
type: "number",
|
|
@@ -384,8 +384,8 @@ const pe = {
|
|
|
384
384
|
o.target.value !== "" && a >= 0 && a <= 100 && s(a / 100);
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
-
),
|
|
388
|
-
const a = (i, d) => O(
|
|
387
|
+
), Me = ({ data: e, locale: n, onChange: s, errors: o }) => {
|
|
388
|
+
const a = (i, d) => O(Le, i, n, d), h = (i) => s({ ...e, ...i }), w = E(e.notation), u = (i, d) => h({ entities: e.entities.map((c) => c.id === i ? { ...c, ...d } : c) }), p = (i, d) => h({
|
|
389
389
|
relationships: e.relationships.map(
|
|
390
390
|
(c) => c.id === i ? { ...c, ...d } : c
|
|
391
391
|
)
|
|
@@ -395,7 +395,7 @@ const pe = {
|
|
|
395
395
|
entities: [
|
|
396
396
|
...e.entities,
|
|
397
397
|
{
|
|
398
|
-
id:
|
|
398
|
+
id: I("entity", e.entities.map((d) => d.id)),
|
|
399
399
|
name: "",
|
|
400
400
|
x: [0.2, 0.8, 0.5][i % 3],
|
|
401
401
|
y: [0.25, 0.25, 0.75][i % 3]
|
|
@@ -407,14 +407,14 @@ const pe = {
|
|
|
407
407
|
relationships: e.relationships.filter(
|
|
408
408
|
(d) => d.from !== i && d.to !== i
|
|
409
409
|
)
|
|
410
|
-
}),
|
|
410
|
+
}), F = (i) => h({
|
|
411
411
|
notation: i,
|
|
412
412
|
relationships: e.relationships.map((d) => ({
|
|
413
413
|
...d,
|
|
414
414
|
expectedFrom: E(i).includes(d.expectedFrom) ? d.expectedFrom : "",
|
|
415
415
|
expectedTo: E(i).includes(d.expectedTo) ? d.expectedTo : ""
|
|
416
416
|
}))
|
|
417
|
-
}),
|
|
417
|
+
}), H = [
|
|
418
418
|
...new Set(
|
|
419
419
|
(o ?? []).filter((i) => /^relationships\.\d+\./.test(i.path)).map((i) => i.message)
|
|
420
420
|
)
|
|
@@ -447,13 +447,13 @@ const pe = {
|
|
|
447
447
|
{ value: "minmax", label: a("notationMinmax") },
|
|
448
448
|
{ value: "uml", label: a("notationUml") }
|
|
449
449
|
],
|
|
450
|
-
onChange:
|
|
450
|
+
onChange: F
|
|
451
451
|
}
|
|
452
452
|
),
|
|
453
453
|
/* @__PURE__ */ t.jsxs("fieldset", { className: "bitflow-field", children: [
|
|
454
454
|
/* @__PURE__ */ t.jsx("legend", { className: "bitflow-label", children: a("entitiesLabel") }),
|
|
455
455
|
/* @__PURE__ */ t.jsx("span", { className: "bitflow-hint", children: a("entitiesHint") }),
|
|
456
|
-
|
|
456
|
+
T(o, "entities") && /* @__PURE__ */ t.jsx("span", { className: "bitflow-field-error", role: "alert", children: T(o, "entities") }),
|
|
457
457
|
e.entities.length === 0 && /* @__PURE__ */ t.jsx("p", { className: "bitflow-text-muted", children: a("noEntities") }),
|
|
458
458
|
e.entities.map((i, d) => {
|
|
459
459
|
const c = d + 1;
|
|
@@ -469,8 +469,8 @@ const pe = {
|
|
|
469
469
|
onChange: (l) => u(i.id, { name: l.target.value })
|
|
470
470
|
}
|
|
471
471
|
),
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
q(i.x, a("entityXOf", { position: c }), (l) => u(i.id, { x: l })),
|
|
473
|
+
q(i.y, a("entityYOf", { position: c }), (l) => u(i.id, { y: l })),
|
|
474
474
|
/* @__PURE__ */ t.jsx(
|
|
475
475
|
"button",
|
|
476
476
|
{
|
|
@@ -488,8 +488,8 @@ const pe = {
|
|
|
488
488
|
/* @__PURE__ */ t.jsxs("fieldset", { className: "bitflow-field", children: [
|
|
489
489
|
/* @__PURE__ */ t.jsx("legend", { className: "bitflow-label", children: a("relationshipsLabel") }),
|
|
490
490
|
/* @__PURE__ */ t.jsx("span", { className: "bitflow-hint", children: a("relationshipsHint") }),
|
|
491
|
-
|
|
492
|
-
|
|
491
|
+
T(o, "relationships") && /* @__PURE__ */ t.jsx("span", { className: "bitflow-field-error", role: "alert", children: T(o, "relationships") }),
|
|
492
|
+
H.map((i) => /* @__PURE__ */ t.jsx("span", { className: "bitflow-field-error", role: "alert", children: i }, i)),
|
|
493
493
|
e.relationships.length === 0 && /* @__PURE__ */ t.jsx("p", { className: "bitflow-text-muted", children: a("noRelationships") }),
|
|
494
494
|
e.relationships.map((i, d) => {
|
|
495
495
|
const c = d + 1, l = (r) => p(i.id, r);
|
|
@@ -543,7 +543,7 @@ const pe = {
|
|
|
543
543
|
relationships: [
|
|
544
544
|
...e.relationships,
|
|
545
545
|
{
|
|
546
|
-
id:
|
|
546
|
+
id: I("relationship", e.relationships.map((i) => i.id)),
|
|
547
547
|
name: "",
|
|
548
548
|
from: e.entities[0]?.id ?? "",
|
|
549
549
|
to: e.entities[1]?.id ?? "",
|
|
@@ -558,7 +558,7 @@ const pe = {
|
|
|
558
558
|
] }),
|
|
559
559
|
/* @__PURE__ */ t.jsxs("div", { className: "bitflow-field", children: [
|
|
560
560
|
/* @__PURE__ */ t.jsx("span", { className: "bitflow-label", children: a("previewLabel") }),
|
|
561
|
-
/* @__PURE__ */ t.jsx(
|
|
561
|
+
/* @__PURE__ */ t.jsx(V, { data: e, locale: n, showAnswers: !0 })
|
|
562
562
|
] }),
|
|
563
563
|
/* @__PURE__ */ t.jsxs(de, { summary: a("advanced"), children: [
|
|
564
564
|
/* @__PURE__ */ t.jsx(
|
|
@@ -580,17 +580,17 @@ const pe = {
|
|
|
580
580
|
)
|
|
581
581
|
] })
|
|
582
582
|
] });
|
|
583
|
-
},
|
|
583
|
+
}, _ = "task-cardinality";
|
|
584
584
|
oe({
|
|
585
|
-
type:
|
|
585
|
+
type: _,
|
|
586
586
|
kind: "task",
|
|
587
587
|
schema: xe,
|
|
588
588
|
evaluate: ve,
|
|
589
589
|
Task: Ae,
|
|
590
|
-
Form:
|
|
590
|
+
Form: Me,
|
|
591
591
|
info: (e) => ({
|
|
592
|
-
name: O(
|
|
593
|
-
description: O(
|
|
592
|
+
name: O(M, "name", e),
|
|
593
|
+
description: O(M, "description", e)
|
|
594
594
|
}),
|
|
595
595
|
defaultData: () => ({
|
|
596
596
|
instruction: "",
|
|
@@ -601,25 +601,25 @@ oe({
|
|
|
601
601
|
evaluation: X()
|
|
602
602
|
})
|
|
603
603
|
});
|
|
604
|
-
me(
|
|
604
|
+
me(_);
|
|
605
605
|
se("bitflow-styles-task-cardinality", je);
|
|
606
606
|
export {
|
|
607
|
-
|
|
607
|
+
He as AnswerSchema,
|
|
608
608
|
xe as DataSchema,
|
|
609
|
-
|
|
609
|
+
V as Diagram,
|
|
610
610
|
ue as EntitySchema,
|
|
611
|
-
|
|
611
|
+
Me as Form,
|
|
612
612
|
pe as NOTATIONS,
|
|
613
613
|
we as NotationSchema,
|
|
614
614
|
be as RelationshipSchema,
|
|
615
|
-
|
|
615
|
+
_ as TYPE,
|
|
616
616
|
Ae as Task,
|
|
617
|
-
|
|
617
|
+
L as endKey,
|
|
618
618
|
ge as endStates,
|
|
619
619
|
ve as evaluate,
|
|
620
|
-
|
|
620
|
+
Le as formMessages,
|
|
621
621
|
E as labelsOf,
|
|
622
|
-
|
|
623
|
-
|
|
622
|
+
M as messages,
|
|
623
|
+
Te as relationshipName,
|
|
624
624
|
ye as sameLabel
|
|
625
625
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { P as h, a9 as k, a2 as m, j as n, b as r, k as p, s as b, aa as w } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { C as g, e as f, F as v, U as L, H as N } from "./bitLoaders-7qanePQL.js";
|
|
3
3
|
const B = ".bitflow-outline{border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard);padding:var(--bitflow-space-small)}.bitflow-outline-list{margin:var(--bitflow-space-xsmall) 0 0;padding-inline-start:var(--bitflow-space-medium);color:var(--bitflow-color-text-muted)}", H = {
|
|
4
4
|
en: {
|
|
5
5
|
titleLabel: "Title",
|
|
@@ -132,7 +132,7 @@ const B = ".bitflow-outline{border:var(--bitflow-border-width) solid var(--bitfl
|
|
|
132
132
|
timeLimit: t.meta.timeLimit,
|
|
133
133
|
canGoBack: t.meta.navigation !== "linear"
|
|
134
134
|
};
|
|
135
|
-
},
|
|
135
|
+
}, O = ({ data: t, flow: o, locale: a }) => {
|
|
136
136
|
const i = (u, s) => r(d, u, a, s), e = t.showOutline ? x(o) : void 0;
|
|
137
137
|
return /* @__PURE__ */ n.jsxs("div", { className: "bitflow-stack", children: [
|
|
138
138
|
t.title && /* @__PURE__ */ n.jsx("h1", { className: "bitflow-heading", children: t.title }),
|
|
@@ -153,7 +153,7 @@ const B = ".bitflow-outline{border:var(--bitflow-border-width) solid var(--bitfl
|
|
|
153
153
|
] })
|
|
154
154
|
] })
|
|
155
155
|
] });
|
|
156
|
-
},
|
|
156
|
+
}, M = ({
|
|
157
157
|
data: t,
|
|
158
158
|
locale: o,
|
|
159
159
|
onChange: a
|
|
@@ -195,8 +195,8 @@ w({
|
|
|
195
195
|
type: c,
|
|
196
196
|
kind: "start",
|
|
197
197
|
schema: j,
|
|
198
|
-
Task:
|
|
199
|
-
Form:
|
|
198
|
+
Task: O,
|
|
199
|
+
Form: M,
|
|
200
200
|
info: (t) => ({
|
|
201
201
|
name: r(d, "name", t),
|
|
202
202
|
description: r(d, "description", t)
|
|
@@ -206,9 +206,9 @@ w({
|
|
|
206
206
|
N(c);
|
|
207
207
|
export {
|
|
208
208
|
j as DataSchema,
|
|
209
|
-
|
|
209
|
+
M as Form,
|
|
210
210
|
c as TYPE,
|
|
211
|
-
|
|
211
|
+
O as Task,
|
|
212
212
|
H as formMessages,
|
|
213
213
|
d as messages,
|
|
214
214
|
x as outlineOf
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
1
|
+
import { P as j, a2 as S, ac as M, ad as T, a9 as p, Y as O, j as o, a5 as C, a as U, b as w, aa as $, s as Z } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { e as G, M as k, C as Y, g as b, r as _, F as f, P as J, B as K, U as Q, H as X } from "./bitLoaders-7qanePQL.js";
|
|
3
|
+
const A = [
|
|
4
4
|
"decimal",
|
|
5
5
|
"binary",
|
|
6
6
|
"octal",
|
|
@@ -15,7 +15,7 @@ const C = [
|
|
|
15
15
|
binary: ["0b"],
|
|
16
16
|
octal: ["0o"],
|
|
17
17
|
hex: ["0x"]
|
|
18
|
-
},
|
|
18
|
+
}, H = "0123456789abcdef", fe = [
|
|
19
19
|
"empty",
|
|
20
20
|
"badDigit",
|
|
21
21
|
"negative",
|
|
@@ -46,7 +46,7 @@ const C = [
|
|
|
46
46
|
n = n.slice(d.length);
|
|
47
47
|
}
|
|
48
48
|
if (n === "") return { ok: !1, reason: "empty" };
|
|
49
|
-
const c =
|
|
49
|
+
const c = H.slice(0, r);
|
|
50
50
|
if ([...n].some((d) => !c.includes(d)))
|
|
51
51
|
return { ok: !1, reason: "badDigit" };
|
|
52
52
|
const u = m(a.bitWidth, t);
|
|
@@ -56,7 +56,7 @@ const C = [
|
|
|
56
56
|
return { ok: !1, reason: "notFullWidth" };
|
|
57
57
|
}
|
|
58
58
|
let i = 0n;
|
|
59
|
-
for (const d of n) i = i * BigInt(r) + BigInt(
|
|
59
|
+
for (const d of n) i = i * BigInt(r) + BigInt(H.indexOf(d));
|
|
60
60
|
return !s && a.signed && a.bitWidth > 0 && t !== "decimal" && i >= g(a.bitWidth - 1) && (i -= g(a.bitWidth)), s && (i = -i), z(i, a.bitWidth, a.signed) ? { ok: !0, values: [i] } : { ok: !1, reason: "tooWide" };
|
|
61
61
|
}, x = (e, t, a) => {
|
|
62
62
|
if (t === "text") {
|
|
@@ -82,16 +82,16 @@ const C = [
|
|
|
82
82
|
if (r < 0n) return `-${(-r).toString(n)}`;
|
|
83
83
|
const l = r.toString(n), s = m(a.bitWidth, t);
|
|
84
84
|
return s > 0 ? l.padStart(s, "0") : l;
|
|
85
|
-
},
|
|
85
|
+
}, R = (e, t, a) => t === "text" ? e.map(
|
|
86
86
|
(n) => n >= 0n && n <= 0x10ffffn ? String.fromCodePoint(Number(n)) : "?"
|
|
87
|
-
).join("") : e.map((n) => ie(n, t, a)).join(" "), ne = (e, t) => e.length === t.length && e.every((a, n) => a === t[n]), re = (e) => e.map((t) => t.toString(10)).join(" "),
|
|
88
|
-
instruction:
|
|
89
|
-
sourceRepresentation:
|
|
87
|
+
).join("") : e.map((n) => ie(n, t, a)).join(" "), ne = (e, t) => e.length === t.length && e.every((a, n) => a === t[n]), re = (e) => e.map((t) => t.toString(10)).join(" "), D = C(A), B = C(["answer", "digits"]), F = j({
|
|
88
|
+
instruction: S().default(""),
|
|
89
|
+
sourceRepresentation: D.default("decimal"),
|
|
90
90
|
/** The value as the author writes it, in the source representation. */
|
|
91
|
-
sourceValue:
|
|
92
|
-
targetRepresentation:
|
|
91
|
+
sourceValue: S().default(""),
|
|
92
|
+
targetRepresentation: D.default("binary"),
|
|
93
93
|
/** Bits the value is held in. `0` for a plain integer of no fixed width. */
|
|
94
|
-
bitWidth:
|
|
94
|
+
bitWidth: O().int().min(0).max(64).default(8),
|
|
95
95
|
signed: p().default(!1),
|
|
96
96
|
/** Whether `0b`, `0o` and `0x` are accepted in front of the answer. */
|
|
97
97
|
allowPrefix: p().default(!0),
|
|
@@ -100,7 +100,7 @@ const C = [
|
|
|
100
100
|
/** Whether the leading zeros of the width have to be written out. */
|
|
101
101
|
requireFullWidth: p().default(!0),
|
|
102
102
|
scoring: B.default("answer"),
|
|
103
|
-
evaluation:
|
|
103
|
+
evaluation: M.default(T)
|
|
104
104
|
}).check((e) => {
|
|
105
105
|
if (e.value.evaluation.mode !== "auto") return;
|
|
106
106
|
const t = e.value;
|
|
@@ -137,7 +137,7 @@ const C = [
|
|
|
137
137
|
* stored copy that can disagree with the box after a reload is worse than
|
|
138
138
|
* reading it twice.
|
|
139
139
|
*/
|
|
140
|
-
raw:
|
|
140
|
+
raw: S().default("")
|
|
141
141
|
}), v = (e) => ({
|
|
142
142
|
bitWidth: e.bitWidth,
|
|
143
143
|
signed: e.signed,
|
|
@@ -152,16 +152,16 @@ const C = [
|
|
|
152
152
|
return t.ok ? t.values : void 0;
|
|
153
153
|
}, se = (e) => {
|
|
154
154
|
const t = V(e);
|
|
155
|
-
return t === void 0 ? "" :
|
|
155
|
+
return t === void 0 ? "" : R(t, e.targetRepresentation, v(e));
|
|
156
156
|
}, oe = (e, t) => {
|
|
157
157
|
const a = V(e);
|
|
158
158
|
if (a === void 0) return { correct: !1, reason: "empty" };
|
|
159
|
-
const n = v(e), r = x(t?.raw ?? "", e.targetRepresentation, n), l = e.scoring === "digits", s =
|
|
159
|
+
const n = v(e), r = x(t?.raw ?? "", e.targetRepresentation, n), l = e.scoring === "digits", s = R(a, e.targetRepresentation, n).toLowerCase();
|
|
160
160
|
if (!r.ok)
|
|
161
161
|
return l ? { correct: !1, reason: r.reason, rightDigits: 0, totalDigits: s.length } : { correct: !1, reason: r.reason };
|
|
162
162
|
const c = ne(r.values, a);
|
|
163
163
|
if (!l) return { correct: c, reason: c ? "correct" : "wrongValue" };
|
|
164
|
-
const u =
|
|
164
|
+
const u = R(r.values, e.targetRepresentation, n).toLowerCase();
|
|
165
165
|
let i = 0;
|
|
166
166
|
for (let d = 0; d < s.length; d++)
|
|
167
167
|
u[d] === s[d] && (i += 1);
|
|
@@ -316,7 +316,7 @@ const C = [
|
|
|
316
316
|
locale: r,
|
|
317
317
|
onAnswerChange: l
|
|
318
318
|
}) => {
|
|
319
|
-
const s = (h,
|
|
319
|
+
const s = (h, E) => w(L, h, r, E), c = U.useId(), u = N(e.targetRepresentation, s), i = m(e.bitWidth, e.targetRepresentation), d = x(t?.raw ?? "", e.targetRepresentation, v(e)), W = a?.detail?.reason, q = [
|
|
320
320
|
e.requireFullWidth && i > 0 ? s("fullWidthHint", { digits: i }) : "",
|
|
321
321
|
e.allowPrefix && e.targetRepresentation !== "text" ? s("prefixHint") : "",
|
|
322
322
|
e.allowSeparators && e.targetRepresentation !== "text" ? s("separatorHint") : ""
|
|
@@ -339,7 +339,7 @@ const C = [
|
|
|
339
339
|
/* @__PURE__ */ o.jsx("p", { className: "bitflow-text-muted", children: n ? s("howToReadonly") : s("howTo", { target: u }) }),
|
|
340
340
|
/* @__PURE__ */ o.jsxs("div", { className: "bitflow-field", children: [
|
|
341
341
|
/* @__PURE__ */ o.jsx("label", { className: "bitflow-label", htmlFor: c, children: s("answerLabel", { target: u }) }),
|
|
342
|
-
|
|
342
|
+
q.map((h) => /* @__PURE__ */ o.jsx("span", { className: "bitflow-hint", children: h }, h)),
|
|
343
343
|
/* @__PURE__ */ o.jsx(
|
|
344
344
|
"input",
|
|
345
345
|
{
|
|
@@ -377,7 +377,7 @@ const C = [
|
|
|
377
377
|
onChange: a,
|
|
378
378
|
errors: n
|
|
379
379
|
}) => {
|
|
380
|
-
const r = (i, d) => w(de, i, t, d), l = (i) => a({ ...e, ...i }), s =
|
|
380
|
+
const r = (i, d) => w(de, i, t, d), l = (i) => a({ ...e, ...i }), s = A.map((i) => ({
|
|
381
381
|
value: i,
|
|
382
382
|
label: r(
|
|
383
383
|
`representation${i[0].toUpperCase()}${i.slice(1)}`
|
|
@@ -541,8 +541,8 @@ export {
|
|
|
541
541
|
ge as Form,
|
|
542
542
|
y as RADIX,
|
|
543
543
|
fe as READ_FAILURES,
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
A as REPRESENTATIONS,
|
|
545
|
+
D as RepresentationSchema,
|
|
546
546
|
B as ScoringSchema,
|
|
547
547
|
P as TYPE,
|
|
548
548
|
ue as Task,
|
|
@@ -560,5 +560,5 @@ export {
|
|
|
560
560
|
x as read,
|
|
561
561
|
ne as sameValue,
|
|
562
562
|
I as sourceOptions,
|
|
563
|
-
|
|
563
|
+
R as write
|
|
564
564
|
};
|