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.
Files changed (53) hide show
  1. package/dist/asset-manifest.json +9 -9
  2. package/dist/assets/directive-bitflow/{EditorElement-CE3Yr86b.js → EditorElement-BNwEKIvk.js} +143 -143
  3. package/dist/assets/directive-bitflow/{ReportElements-eYGRtw6N.js → ReportElements-CAvHx5xm.js} +2 -2
  4. package/dist/assets/directive-bitflow/{bitLoaders-CxvZkGrY.js → bitLoaders-7qanePQL.js} +41 -41
  5. package/dist/assets/directive-bitflow/{dom-uYx_3K1r.js → dom-B6NPWBb1.js} +1558 -1551
  6. package/dist/assets/directive-bitflow/editor.js +3 -3
  7. package/dist/assets/directive-bitflow/flow.js +4 -4
  8. package/dist/assets/directive-bitflow/{index-oNmOArKu.js → index-4JaKZ7WT.js} +2 -2
  9. package/dist/assets/directive-bitflow/{index-EKIgFddO.js → index-6CQr_atd.js} +19 -19
  10. package/dist/assets/directive-bitflow/{index-BadyFTU5.js → index-B9iG-a48.js} +2 -2
  11. package/dist/assets/directive-bitflow/{index-D4PdXMcj.js → index-BFYoOtcY.js} +5 -5
  12. package/dist/assets/directive-bitflow/{index-d5ebPDeY.js → index-BI6aFdIS.js} +10 -10
  13. package/dist/assets/directive-bitflow/{index-DruC5d43.js → index-Bf078mfo.js} +2 -2
  14. package/dist/assets/directive-bitflow/{index-CWe2GjBK.js → index-BinE5Wvd.js} +7 -7
  15. package/dist/assets/directive-bitflow/{index-BG0PL-Z6.js → index-BoX5-jkC.js} +7 -7
  16. package/dist/assets/directive-bitflow/{index-ledofrbo.js → index-BqRsXShM.js} +4 -4
  17. package/dist/assets/directive-bitflow/{index-CjKhq7gY.js → index-BxihQ8Oo.js} +13 -13
  18. package/dist/assets/directive-bitflow/{index-BNdpL6Ss.js → index-C5YguHZU.js} +28 -28
  19. package/dist/assets/directive-bitflow/{index-xTX3CXJW.js → index-C8zwSmE6.js} +7 -7
  20. package/dist/assets/directive-bitflow/{index-D9LOuqr2.js → index-C9JSBTNc.js} +21 -21
  21. package/dist/assets/directive-bitflow/{index-BydYlLy4.js → index-CCMI6UK4.js} +8 -8
  22. package/dist/assets/directive-bitflow/{index-WbE9UOFa.js → index-CGDt8H6s.js} +5 -5
  23. package/dist/assets/directive-bitflow/{index-D_QhyFcx.js → index-Ca1v0pjV.js} +5 -5
  24. package/dist/assets/directive-bitflow/{index-88c3K20U.js → index-CaYn3Gmh.js} +12 -12
  25. package/dist/assets/directive-bitflow/{index-C7RJxxAx.js → index-CbQue0If.js} +30 -30
  26. package/dist/assets/directive-bitflow/{index-CfKpkSVC.js → index-CjH3h0OO.js} +28 -28
  27. package/dist/assets/directive-bitflow/{index-TUXuIR22.js → index-CkO3QfOS.js} +4 -4
  28. package/dist/assets/directive-bitflow/{index-DIb3CXwC.js → index-Cz4i5rfe.js} +6 -6
  29. package/dist/assets/directive-bitflow/{index-HXNGIC7K.js → index-D0NtgeiX.js} +17 -17
  30. package/dist/assets/directive-bitflow/{index-CLHtOGrW.js → index-D1C_1SPY.js} +4 -4
  31. package/dist/assets/directive-bitflow/{index-Dn5hHVuT.js → index-D45u7EVR.js} +13 -13
  32. package/dist/assets/directive-bitflow/{index-IsMJtrUT.js → index-D9Ox4YpM.js} +10 -10
  33. package/dist/assets/directive-bitflow/{index-B61LKxr1.js → index-DJ1w2Xcm.js} +15 -15
  34. package/dist/assets/directive-bitflow/{index-BwBVUdJ9.js → index-DUqW2fmV.js} +2 -2
  35. package/dist/assets/directive-bitflow/{index-DUOrQfVe.js → index-Deedj9EF.js} +6 -6
  36. package/dist/assets/directive-bitflow/{index-DQP0cUsP.js → index-Dg6nnY_v.js} +14 -14
  37. package/dist/assets/directive-bitflow/{index-DW3cUBvZ.js → index-DgxEzomz.js} +2 -2
  38. package/dist/assets/directive-bitflow/{index-D0U3nepG.js → index-Dl0-ZAT5.js} +20 -20
  39. package/dist/assets/directive-bitflow/{index-ISbOe239.js → index-Do6dmZyj.js} +2 -2
  40. package/dist/assets/directive-bitflow/{index-Bw0pL0hW.js → index-DqnGC-DU.js} +6 -6
  41. package/dist/assets/directive-bitflow/{index-rp4UTV85.js → index-DwXXeSwk.js} +19 -19
  42. package/dist/assets/directive-bitflow/{index-BZhNY0lo.js → index-b6qwcTj9.js} +9 -9
  43. package/dist/assets/directive-bitflow/{index-BO-d4HVC.js → index-d105UFQI.js} +21 -21
  44. package/dist/assets/directive-bitflow/{index-BuQ-K_tR.js → index-jijMWQB6.js} +2 -2
  45. package/dist/assets/directive-bitflow/{index-DYWo0PUv.js → index-kxO5_U9Y.js} +2 -2
  46. package/dist/assets/directive-bitflow/{index-Cm4w1Zyc.js → index-p5AOgOal.js} +21 -21
  47. package/dist/assets/directive-bitflow/{index-BlT1EcFH.js → index-q2APknM6.js} +15 -15
  48. package/dist/assets/directive-bitflow/{index-CERSJ9uS.js → index-zVkWgm5I.js} +11 -11
  49. package/dist/assets/directive-bitflow/index.js +6 -6
  50. package/dist/assets/directive-bitflow/report.js +1 -1
  51. package/dist/assets/directive-bitflow/{shareableReport-vjEU4OvA.js → shareableReport-mdyEMdsJ.js} +6 -6
  52. package/dist/index.js +1 -1
  53. package/package.json +4 -4
@@ -1,9 +1,9 @@
1
- import { L as z, ak as ge, a2 as j, P as I, ac as ve, ad as me, a9 as Q, a4 as ie, a as P, j as t, a5 as ye, b as A, aa as je, s as ke } from "./dom-uYx_3K1r.js";
2
- import { e as Ne, i as R, g as le, r as X, P as Ce, F as oe, B as Pe, U as Le, H as Ae } from "./bitLoaders-CxvZkGrY.js";
1
+ import { P as z, ak as ge, a2 as j, Y, ac as ve, ad as me, a9 as Q, a4 as ie, a as P, j as t, a5 as ye, b as A, aa as je, s as ke } from "./dom-B6NPWBb1.js";
2
+ import { e as Ne, i as R, g as le, r as X, P as Ce, F as oe, B as Pe, U as Le, H as Ae } from "./bitLoaders-7qanePQL.js";
3
3
  const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a-fA-F]{6}$/, ze = j().regex($e, "A colour is six hex digits after a #, like #017460."), ne = z({
4
4
  label: j().default(""),
5
- min: I().default(0),
6
- max: I().default(10)
5
+ min: Y().default(0),
6
+ max: Y().default(10)
7
7
  }).prefault({}), Se = z({
8
8
  x: ne,
9
9
  y: ne
@@ -16,8 +16,8 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
16
16
  }), He = z({
17
17
  id: j().min(1),
18
18
  /** In axis units, never pixels — the plot is drawn at whatever size it is given. */
19
- x: I(),
20
- y: I(),
19
+ x: Y(),
20
+ y: Y(),
21
21
  label: j().optional(),
22
22
  /** Set on a known point: shown filled, in this class's shape and colour. */
23
23
  class: j().optional(),
@@ -29,7 +29,7 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
29
29
  expected: j().optional(),
30
30
  /** A cluster centre. Drawn larger and apart from ordinary points; never open. */
31
31
  centroid: Q().default(!1)
32
- }), U = (e) => e.centroid ? "centroid" : e.expected !== void 0 ? "open" : "known", Te = z({
32
+ }), I = (e) => e.centroid ? "centroid" : e.expected !== void 0 ? "open" : "known", Te = z({
33
33
  instruction: j().default(""),
34
34
  axes: Se,
35
35
  classes: ie(Ke).default([]),
@@ -126,7 +126,7 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
126
126
  }), it = z({
127
127
  /** Open point id → the class the learner assigned it. */
128
128
  assignments: ge(j(), j()).default({})
129
- }), _ = (e, s) => s === void 0 ? void 0 : e.classes.find((o) => o.id === s), Y = (e, s) => _(e, s)?.label || s || "", he = (e) => e.points.filter((s) => s.expected !== void 0), re = (e) => e.points.filter((s) => s.centroid), ce = (e) => e.points.filter((s) => !s.centroid && s.class !== void 0), ae = (e, s) => {
129
+ }), _ = (e, s) => s === void 0 ? void 0 : e.classes.find((o) => o.id === s), U = (e, s) => _(e, s)?.label || s || "", he = (e) => e.points.filter((s) => s.expected !== void 0), re = (e) => e.points.filter((s) => s.centroid), ce = (e) => e.points.filter((s) => !s.centroid && s.class !== void 0), ae = (e, s) => {
130
130
  const o = {};
131
131
  for (const n of he(e)) {
132
132
  const a = s?.assignments?.[n.id];
@@ -338,14 +338,14 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
338
338
  }, fe = (e) => {
339
339
  const s = Math.round(e * 100) / 100;
340
340
  return String(s);
341
- }, Z = 16, T = 26, We = 42, Ie = 560, Ue = 2.2, Ye = (e) => {
341
+ }, Z = 16, T = 26, We = 42, Ye = 560, Ie = 2.2, Ue = (e) => {
342
342
  const [s, o] = P.useState(1);
343
343
  return P.useLayoutEffect(() => {
344
344
  const n = e.current;
345
345
  if (!n || typeof ResizeObserver > "u") return;
346
346
  const a = () => {
347
347
  const r = n.getBoundingClientRect().width;
348
- r && o(Math.min(Ue, Math.max(1, Ie / r)));
348
+ r && o(Math.min(Ie, Math.max(1, Ye / r)));
349
349
  };
350
350
  a();
351
351
  const p = new ResizeObserver(a);
@@ -375,12 +375,12 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
375
375
  onAssign: p,
376
376
  onPlacePoint: r
377
377
  }) => {
378
- const f = (l, d) => A($, l, n, d), u = P.useRef(null), w = Ye(u), [v, k] = P.useState(e.classes[0]?.id), [x, N] = P.useState(""), C = !!p && !a, g = s?.assignments ?? {}, S = de(e.axes.x), F = de(e.axes.y), K = (l, d) => {
378
+ const f = (l, d) => A($, l, n, d), u = P.useRef(null), w = Ue(u), [v, k] = P.useState(e.classes[0]?.id), [x, N] = P.useState(""), C = !!p && !a, g = s?.assignments ?? {}, S = de(e.axes.x), F = de(e.axes.y), K = (l, d) => {
379
379
  if (!p) return;
380
380
  p(l.id, d);
381
381
  const L = l.label || l.id;
382
382
  N(
383
- d === void 0 ? f("openUnassigned", { label: L }) : f("openAssigned", { label: L, class: Y(e, d) })
383
+ d === void 0 ? f("openUnassigned", { label: L }) : f("openAssigned", { label: L, class: U(e, d) })
384
384
  );
385
385
  }, E = (l, d) => K(l, g[l.id] === d ? void 0 : d), V = (l) => {
386
386
  if (!r) return;
@@ -500,7 +500,7 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
500
500
  }
501
501
  ),
502
502
  b.map((l) => {
503
- const d = U(l), L = g[l.id], H = o?.[l.id], B = _(e, d === "known" ? l.class : L);
503
+ const d = I(l), L = g[l.id], H = o?.[l.id], B = _(e, d === "known" ? l.class : L);
504
504
  return /* @__PURE__ */ t.jsxs(
505
505
  "g",
506
506
  {
@@ -566,7 +566,7 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
566
566
  transform: `translate(${i(l)} ${c(l)}) scale(${w})`,
567
567
  style: { "--bitflow-point-plot-color": d.color },
568
568
  children: [
569
- /* @__PURE__ */ t.jsx("title", { children: f("centroidTitle", { class: Y(e, l.class) }) }),
569
+ /* @__PURE__ */ t.jsx("title", { children: f("centroidTitle", { class: U(e, l.class) }) }),
570
570
  /* @__PURE__ */ t.jsx("circle", { r: T }),
571
571
  /* @__PURE__ */ t.jsx("line", { x1: -T * 0.6, y1: 0, x2: T * 0.6, y2: 0 }),
572
572
  /* @__PURE__ */ t.jsx("line", { x1: 0, y1: -T * 0.6, x2: 0, y2: T * 0.6 }),
@@ -706,7 +706,7 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
706
706
  e.axes.x.label && /* @__PURE__ */ t.jsx("p", { className: "bitflow-text", children: o("xAxisNote", { label: e.axes.x.label }) }),
707
707
  e.axes.y.label && /* @__PURE__ */ t.jsx("p", { className: "bitflow-text", children: o("yAxisNote", { label: e.axes.y.label }) }),
708
708
  /* @__PURE__ */ t.jsx("ul", { children: e.points.map((a, p) => {
709
- const r = `(${a.x}, ${a.y})`, f = U(a), u = f === "centroid" ? o("centroidTitle", { class: Y(e, a.class) }) : f === "known" ? o("knownTitle", { label: n(a, p), class: Y(e, a.class) }) : o("openUnassigned", { label: n(a, p) });
709
+ const r = `(${a.x}, ${a.y})`, f = I(a), u = f === "centroid" ? o("centroidTitle", { class: U(e, a.class) }) : f === "known" ? o("knownTitle", { label: n(a, p), class: U(e, a.class) }) : o("openUnassigned", { label: n(a, p) });
710
710
  return /* @__PURE__ */ t.jsxs("li", { children: [
711
711
  u,
712
712
  " ",
@@ -781,7 +781,7 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
781
781
  return [...i].sort((b, h) => c(b) - c(h));
782
782
  }, S = (i) => p({
783
783
  points: e.points.map(
784
- (c) => U(c) === "open" ? { ...c, expected: i(c) ?? c.expected } : c
784
+ (c) => I(c) === "open" ? { ...c, expected: i(c) ?? c.expected } : c
785
785
  )
786
786
  }), F = {
787
787
  circle: a("shapeCircle"),
@@ -922,7 +922,7 @@ const q = ["circle", "square", "triangle", "diamond"], Oe = ye(q), $e = /^#[0-9a
922
922
  V.map((i) => /* @__PURE__ */ t.jsx("span", { className: "bitflow-field-error", role: "alert", children: i }, i)),
923
923
  e.points.length === 0 && /* @__PURE__ */ t.jsx("p", { className: "bitflow-text-muted", children: a("noPoints") }),
924
924
  e.points.map((i, c) => {
925
- const b = U(i), h = c + 1, l = b === "open" ? "expected" : "class";
925
+ const b = I(i), h = c + 1, l = b === "open" ? "expected" : "class";
926
926
  return /* @__PURE__ */ t.jsxs("div", { className: "bitflow-point-plot-editor-row", children: [
927
927
  /* @__PURE__ */ t.jsx(
928
928
  J,
@@ -1122,7 +1122,7 @@ export {
1122
1122
  Fe as allCorrect,
1123
1123
  re as centroids,
1124
1124
  _ as classById,
1125
- Y as classLabel,
1125
+ U as classLabel,
1126
1126
  ee as distance,
1127
1127
  Ee as evaluate,
1128
1128
  De as formMessages,
@@ -1132,6 +1132,6 @@ export {
1132
1132
  Re as nearestCentroid,
1133
1133
  he as openPoints,
1134
1134
  ae as pointStates,
1135
- U as roleOf,
1135
+ I as roleOf,
1136
1136
  Me as scoreOf
1137
1137
  };
@@ -1,5 +1,5 @@
1
- import { L as v, a2 as b, a9 as m, j as i, $ as k, b as u, s as H, aa as L } from "./dom-uYx_3K1r.js";
2
- import { C as f, e as x, F as h, U as y, H as N } from "./bitLoaders-CxvZkGrY.js";
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", z = (e, s) => {
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
- }, F = (e) => {
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
- }, P = {
122
+ }, F = {
123
123
  en: {
124
124
  titleLabel: "Heading on the certificate",
125
125
  markdownLabel: "Message",
@@ -152,7 +152,7 @@ const S = ".bitflow-certificate{border:var(--bitflow-border-width) solid var(--b
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 ? z(n, t) : void 0, o = e.showDate ? F(t) : void 0, l = [];
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
@@ -191,7 +191,7 @@ const S = ".bitflow-certificate{border:var(--bitflow-border-width) solid var(--b
191
191
  locale: s,
192
192
  onChange: t
193
193
  }) => {
194
- const n = (a) => u(P, a, s);
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,
@@ -283,7 +283,7 @@ export {
283
283
  C as Form,
284
284
  g as TYPE,
285
285
  T as Task,
286
- F as finishedAt,
286
+ z as finishedAt,
287
287
  p as messages,
288
- z as nameIn
288
+ P as nameIn
289
289
  };
@@ -1,5 +1,5 @@
1
- import { L 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, P as K, a5 as ne, b as O, aa as oe, s as se } from "./dom-uYx_3K1r.js";
2
- import { e as le, M as re, i as L, P as de, F as ce, B as he, U as fe, H as me } from "./bitLoaders-CxvZkGrY.js";
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"],
@@ -77,7 +77,7 @@ const pe = {
77
77
  message: `Choose the answer for this end: one of ${u.join(", ")}.`
78
78
  });
79
79
  });
80
- }), T = (e, n) => `${e}:${n}`, He = R({
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 = T(o.id, a);
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;
@@ -147,7 +147,7 @@ const pe = {
147
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
- }), I = (e, n) => {
150
+ }), Y = (e, n) => {
151
151
  const s = n.x - e.x, o = n.y - e.y;
152
152
  if (s === 0 && o === 0) return e;
153
153
  const a = Math.min(
@@ -161,7 +161,7 @@ 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
- }, Le = (e, n, s) => s("relationshipName", {
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 || "?"
@@ -174,7 +174,7 @@ const pe = {
174
174
  showAnswers: h,
175
175
  onChange: w
176
176
  }) => {
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?.[T(f.id, m)];
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",
@@ -189,7 +189,7 @@ 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 = $(m, b), c = $(i, b), l = I(d, c), r = I(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);
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: [
@@ -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 = H(f, v), z = h ? void 0 : s?.[T(f.id, v)];
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
  {
@@ -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: Le(e, f, u) }),
245
+ /* @__PURE__ */ t.jsx("legend", { className: "bitflow-label", children: Te(e, f, u) }),
246
246
  ["from", "to"].map((m) => {
247
- const i = T(f.id, m), d = C(e, f[m]), c = s?.[i], l = `${g}-${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
- }, Te = {
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.",
@@ -364,7 +364,7 @@ const pe = {
364
364
  }
365
365
  )
366
366
  ] });
367
- }, Y = (e, n) => {
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;
@@ -385,7 +385,7 @@ const pe = {
385
385
  }
386
386
  }
387
387
  ), Me = ({ data: e, locale: n, onChange: s, errors: o }) => {
388
- const a = (i, d) => O(Te, 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({
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: Y("entity", e.entities.map((d) => d.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]
@@ -453,7 +453,7 @@ const pe = {
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
- L(o, "entities") && /* @__PURE__ */ t.jsx("span", { className: "bitflow-field-error", role: "alert", children: L(o, "entities") }),
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;
@@ -488,7 +488,7 @@ 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
- L(o, "relationships") && /* @__PURE__ */ t.jsx("span", { className: "bitflow-field-error", role: "alert", children: L(o, "relationships") }),
491
+ T(o, "relationships") && /* @__PURE__ */ t.jsx("span", { className: "bitflow-field-error", role: "alert", children: T(o, "relationships") }),
492
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) => {
@@ -543,7 +543,7 @@ const pe = {
543
543
  relationships: [
544
544
  ...e.relationships,
545
545
  {
546
- id: Y("relationship", e.relationships.map((i) => i.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 ?? "",
@@ -614,12 +614,12 @@ export {
614
614
  be as RelationshipSchema,
615
615
  _ as TYPE,
616
616
  Ae as Task,
617
- T as endKey,
617
+ L as endKey,
618
618
  ge as endStates,
619
619
  ve as evaluate,
620
- Te as formMessages,
620
+ Le as formMessages,
621
621
  E as labelsOf,
622
622
  M as messages,
623
- Le as relationshipName,
623
+ Te as relationshipName,
624
624
  ye as sameLabel
625
625
  };
@@ -1,5 +1,5 @@
1
- import { L as h, a9 as k, a2 as m, j as n, b as r, w as p, s as b, aa as w } from "./dom-uYx_3K1r.js";
2
- import { C as g, e as f, F as v, U as L, H as N } from "./bitLoaders-CxvZkGrY.js";
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",
@@ -1,5 +1,5 @@
1
- import { L as j, a2 as S, ac as M, ad as T, a9 as p, P as O, j as o, a5 as C, a as U, b as w, aa as $, s as Z } from "./dom-uYx_3K1r.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-CxvZkGrY.js";
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
3
  const A = [
4
4
  "decimal",
5
5
  "binary",
@@ -1,5 +1,5 @@
1
- import { L as P, a4 as z, ac as W, ad as q, a2 as k, j as r, am as G, a5 as Z, a as j, b as N, aa as _, s as J } from "./dom-uYx_3K1r.js";
2
- import { $ as Q, e as V, g as y, P as L, M as ee, h as te, C as ie, B as ne, q as oe, y as re, U as ae, H as se } from "./bitLoaders-CxvZkGrY.js";
1
+ import { P as I, a4 as z, ac as W, ad as q, a2 as k, j as r, am as G, a5 as Z, a as j, b as N, aa as _, s as J } from "./dom-B6NPWBb1.js";
2
+ import { $ as Q, e as V, g as y, P as $, M as ee, h as te, C as ie, B as ne, q as oe, y as re, U as ae, H as se } from "./bitLoaders-7qanePQL.js";
3
3
  const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-ordering-list{display:flex;flex-direction:column;gap:var(--bitflow-space-xxsmall);padding:0;margin:0;list-style:none}.bitflow-ordering-item{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:grab;background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard);touch-action:manipulation}.bitflow-ordering-grip{flex:none;align-self:stretch;display:flex;align-items:center;justify-content:center;width:2rem;margin-block:calc(-1 * var(--bitflow-space-xsmall));margin-inline-start:calc(-1 * var(--bitflow-space-xsmall));touch-action:none;cursor:grab}.bitflow-ordering-grip:before{content:"";width:12px;height:18px;background:radial-gradient(circle,var(--bitflow-color-neutral-400) 1.5px,transparent 2px) 0 0 / 6px 6px}.bitflow-ordering-item:disabled{cursor:default}.bitflow-ordering-position{flex:none;width:1.75rem;height:1.75rem;font-variant-numeric:tabular-nums;line-height:1.75rem;text-align:center;background:var(--bitflow-color-neutral-100);border-radius:50%}.bitflow-ordering-image{max-height:4rem}.bitflow-ordering-item.bitflow-ordering-item-gap{background:var(--bitflow-color-neutral-100);border-style:dashed;border-color:var(--bitflow-color-primary)}.bitflow-ordering-lifted{position:fixed;top:0;left:0;z-index:10;cursor:grabbing;pointer-events:none;box-shadow:var(--bitflow-shadow-medium)}.bitflow-ordering-item.bitflow-ordering-item-correct{background:color-mix(in srgb,var(--bitflow-color-correct) 12%,var(--bitflow-color-surface));border-color:var(--bitflow-color-correct)}.bitflow-ordering-item.bitflow-ordering-item-wrong{background:color-mix(in srgb,var(--bitflow-color-wrong) 12%,var(--bitflow-color-surface));border-color:var(--bitflow-color-wrong)}', de = (e, n) => e.items.filter((a, s) => n[s] === a.id).map((a) => a.id), me = ({
4
4
  data: e,
5
5
  answer: n
@@ -17,7 +17,7 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
17
17
  correct: s
18
18
  }
19
19
  };
20
- }, I = {
20
+ }, P = {
21
21
  en: {
22
22
  name: "Put in order",
23
23
  description: "Items the learner arranges into the right order.",
@@ -38,7 +38,7 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
38
38
  itemRight: "an der richtigen Stelle",
39
39
  itemWrong: "nicht an der richtigen Stelle"
40
40
  }
41
- }, ce = P({
41
+ }, ce = I({
42
42
  /** Stable across edits, so an answer keeps pointing at the same item. */
43
43
  id: k().min(1),
44
44
  kind: Z(["text", "image"]).default("text"),
@@ -48,7 +48,7 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
48
48
  */
49
49
  label: k().default(""),
50
50
  image: G.optional()
51
- }), ue = P({
51
+ }), ue = I({
52
52
  instruction: k().default(""),
53
53
  /**
54
54
  * In the order they belong. The learner never sees this order; it is the
@@ -81,7 +81,7 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
81
81
  path: ["items"],
82
82
  message: "Add at least three items. Fewer than that is not an ordering."
83
83
  });
84
- }), Me = P({
84
+ }), Me = I({
85
85
  /**
86
86
  * The item ids in the order the learner has put them.
87
87
  *
@@ -137,7 +137,7 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
137
137
  readonly: o,
138
138
  onReorder: h
139
139
  }) => {
140
- const f = (t, l) => N(I, t, s, l), [g, x] = j.useState(""), w = j.useRef(null), i = j.useRef(null), [, m] = j.useReducer((t) => t + 1, 0), d = (t) => e.find((l) => l.id === t), p = (t) => t.label || t.id, E = a !== void 0, u = i.current, C = u ? u.order : n, A = (t, l) => {
140
+ const f = (t, l) => N(P, t, s, l), [g, x] = j.useState(""), w = j.useRef(null), i = j.useRef(null), [, m] = j.useReducer((t) => t + 1, 0), d = (t) => e.find((l) => l.id === t), p = (t) => t.label || t.id, E = a !== void 0, u = i.current, C = u ? u.order : n, A = (t, l) => {
141
141
  const c = d(t);
142
142
  x(
143
143
  f("moved", {
@@ -186,17 +186,17 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
186
186
  // slow drag moves a pixel at a time and would otherwise never count as
187
187
  // a drag at all.
188
188
  moved: l.moved || Math.abs(t.clientX - l.fromX) > 3 || Math.abs(t.clientY - l.fromY) > 3
189
- }, i.current.moved && S.follow(w.current, t.clientX, t.clientY), m();
189
+ }, i.current.moved && Y.follow(w.current, t.clientX, t.clientY), m();
190
190
  }, K = () => {
191
- S.stop();
191
+ Y.stop();
192
192
  const t = i.current;
193
193
  i.current = null, m(), !(!t || !t.moved) && t.order.join() !== n.join() && (h(t.order), A(t.id, t.order));
194
- }, S = oe(() => {
194
+ }, Y = oe(() => {
195
195
  const t = i.current;
196
196
  t && D({ clientX: t.x, clientY: t.y });
197
197
  });
198
198
  re(D, K);
199
- const Y = u?.moved ? d(u.id) : void 0;
199
+ const S = u?.moved ? d(u.id) : void 0;
200
200
  return /* @__PURE__ */ r.jsxs("div", { className: "bitflow-ordering", children: [
201
201
  /* @__PURE__ */ r.jsx("p", { className: "bitflow-hint", children: f(o ? "howToReadonly" : "howTo") }),
202
202
  /* @__PURE__ */ r.jsx("ol", { className: "bitflow-ordering-list", ref: w, children: C.map((t, l) => {
@@ -224,7 +224,7 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
224
224
  },
225
225
  children: [
226
226
  !R && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
227
- !o && /* @__PURE__ */ r.jsx($, {}),
227
+ !o && /* @__PURE__ */ r.jsx(L, {}),
228
228
  /* @__PURE__ */ r.jsx("span", { className: "bitflow-ordering-position", "aria-hidden": "true", children: l + 1 }),
229
229
  X(c)
230
230
  ] }),
@@ -236,7 +236,7 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
236
236
  }
237
237
  ) }, t);
238
238
  }) }),
239
- Y && u && /* @__PURE__ */ r.jsxs(
239
+ S && u && /* @__PURE__ */ r.jsxs(
240
240
  "div",
241
241
  {
242
242
  className: "bitflow-ordering-item bitflow-ordering-lifted",
@@ -247,15 +247,15 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
247
247
  transform: `translate(${u.x - u.grabX}px, ${u.y - u.grabY}px)`
248
248
  },
249
249
  children: [
250
- /* @__PURE__ */ r.jsx($, {}),
250
+ /* @__PURE__ */ r.jsx(L, {}),
251
251
  /* @__PURE__ */ r.jsx("span", { className: "bitflow-ordering-position", children: u.order.indexOf(u.id) + 1 }),
252
- X(Y)
252
+ X(S)
253
253
  ]
254
254
  }
255
255
  ),
256
256
  /* @__PURE__ */ r.jsx("div", { className: "bitflow-visually-hidden", role: "status", "aria-live": "polite", children: g })
257
257
  ] });
258
- }, $ = () => /* @__PURE__ */ r.jsx("span", { className: "bitflow-ordering-grip", "aria-hidden": "true" }), be = (e) => e === "touch" || e === "pen", fe = (e) => e instanceof Element && e.closest(".bitflow-ordering-grip") !== null, X = (e) => e.kind === "image" && e.image?.src ? /* @__PURE__ */ r.jsx(
258
+ }, L = () => /* @__PURE__ */ r.jsx("span", { className: "bitflow-ordering-grip", "aria-hidden": "true" }), be = (e) => e === "touch" || e === "pen", fe = (e) => e instanceof Element && e.closest(".bitflow-ordering-grip") !== null, X = (e) => e.kind === "image" && e.image?.src ? /* @__PURE__ */ r.jsx(
259
259
  "img",
260
260
  {
261
261
  className: "bitflow-ordering-image",
@@ -373,7 +373,7 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
373
373
  y(s, "items") && /* @__PURE__ */ r.jsx("span", { className: "bitflow-field-error", role: "alert", children: y(s, "items") }),
374
374
  e.items.length === 0 && /* @__PURE__ */ r.jsx("p", { className: "bitflow-text-muted", children: o("noItems") }),
375
375
  e.items.map((i, m) => /* @__PURE__ */ r.jsx("div", { className: "bitflow-rule", children: /* @__PURE__ */ r.jsxs(
376
- L,
376
+ $,
377
377
  {
378
378
  ...f.props(i.id),
379
379
  summary: i.label || o("unnamedItem"),
@@ -474,7 +474,7 @@ const le = '.bitflow-ordering{display:flex;flex-direction:column;gap:var(--bitfl
474
474
  )
475
475
  ] })
476
476
  ] }),
477
- /* @__PURE__ */ r.jsx(L, { summary: o("advanced"), children: /* @__PURE__ */ r.jsx(
477
+ /* @__PURE__ */ r.jsx($, { summary: o("advanced"), children: /* @__PURE__ */ r.jsx(
478
478
  ne,
479
479
  {
480
480
  evaluation: e.evaluation,
@@ -492,8 +492,8 @@ _({
492
492
  Task: ye,
493
493
  Form: Ne,
494
494
  info: (e) => ({
495
- name: N(I, "name", e),
496
- description: N(I, "description", e)
495
+ name: N(P, "name", e),
496
+ description: N(P, "description", e)
497
497
  }),
498
498
  defaultData: () => ({
499
499
  instruction: "",
@@ -514,7 +514,7 @@ export {
514
514
  de as correctPositions,
515
515
  me as evaluate,
516
516
  he as formMessages,
517
- I as messages,
517
+ P as messages,
518
518
  we as seededShuffle,
519
519
  pe as shuffledAwayFrom
520
520
  };