@pie-element/categorize 14.0.2-next.20261007003844 → 14.0.2
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/browser/{alert-dialog-B_AU6vyZ.js → alert-dialog-D0yw28Pr.js} +3324 -2401
- package/dist/browser/alert-dialog-D0yw28Pr.js.map +1 -0
- package/dist/browser/author/index.js +7090 -7090
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/delivery/index.js +366 -366
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/editor-runtime/{alert-dialog-CKGs1CCV.js → alert-dialog-CRKaOfl7.js} +3324 -2401
- package/dist/browser/editor-runtime/alert-dialog-CRKaOfl7.js.map +1 -0
- package/dist/browser/editor-runtime/author/index.js +1172 -1172
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +366 -366
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -1
- package/dist/delivery/categorize/categories.js +26 -25
- package/dist/delivery/categorize/choice.js +18 -17
- package/dist/delivery/categorize/choices.js +17 -16
- package/dist/delivery/categorize/index.js +42 -41
- package/dist/index.iife.js +52 -50
- package/package.json +16 -15
- package/dist/browser/alert-dialog-B_AU6vyZ.js.map +0 -1
- package/dist/browser/editor-runtime/alert-dialog-CKGs1CCV.js.map +0 -1
|
@@ -6,8 +6,9 @@ import a from "prop-types";
|
|
|
6
6
|
import { styled as o } from "@mui/material/styles";
|
|
7
7
|
import { uid as s } from "@pie-lib/drag";
|
|
8
8
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
import { sanitizeModelHtml as u } from "@pie-element/shared-utils";
|
|
9
10
|
//#region src/delivery/categorize/categories.tsx
|
|
10
|
-
var
|
|
11
|
+
var d = class extends r.Component {
|
|
11
12
|
static propTypes = {
|
|
12
13
|
categories: a.arrayOf(a.shape(n)),
|
|
13
14
|
model: a.shape({ categoriesPerRow: a.number }),
|
|
@@ -22,58 +23,58 @@ var u = class extends r.Component {
|
|
|
22
23
|
};
|
|
23
24
|
static defaultProps = { model: { categoriesPerRow: 1 } };
|
|
24
25
|
render() {
|
|
25
|
-
let { categories: n, model: r, disabled: i, onDropChoice: a, onRemoveChoice: o, rowLabels: s, selectedItem:
|
|
26
|
-
for (let e = 0; e <
|
|
27
|
-
let
|
|
26
|
+
let { categories: n, model: r, disabled: i, onDropChoice: a, onRemoveChoice: o, rowLabels: s, selectedItem: d, onSelectClick: h, onPlacementClick: g, uid: _ } = this.props, { categoriesPerRow: v, minRowHeight: y } = r, b = [], x = n || [];
|
|
27
|
+
for (let e = 0; e < x.length; e += v) b.push(x.slice(e, e + v));
|
|
28
|
+
let S = (e) => {
|
|
28
29
|
let t = !1;
|
|
29
30
|
return (e || []).forEach((e) => {
|
|
30
31
|
typeof e == "string" && e.trim() !== "" && e.trim() !== "<div></div>" && (t = !0);
|
|
31
32
|
}), t;
|
|
32
33
|
};
|
|
33
34
|
return /* @__PURE__ */ c(e, {
|
|
34
|
-
columns:
|
|
35
|
-
rows: Math.ceil(n.length /
|
|
35
|
+
columns: v,
|
|
36
|
+
rows: Math.ceil(n.length / v) * 2,
|
|
36
37
|
extraStyle: { flex: 1 },
|
|
37
|
-
children:
|
|
38
|
+
children: b.map((e, n) => {
|
|
38
39
|
let r = [];
|
|
39
|
-
return e.forEach((e,
|
|
40
|
-
let
|
|
40
|
+
return e.forEach((e, v) => {
|
|
41
|
+
let b = `categorize-${_}-category-label-${n}-${v}`;
|
|
41
42
|
r.push(/* @__PURE__ */ l("div", {
|
|
42
43
|
style: { display: "flex" },
|
|
43
|
-
children: [
|
|
44
|
-
id:
|
|
45
|
-
dangerouslySetInnerHTML: { __html: e.label }
|
|
46
|
-
}, `category-label-${n}-${
|
|
47
|
-
minRowHeight:
|
|
48
|
-
labelId:
|
|
44
|
+
children: [v === 0 && S(s) ? /* @__PURE__ */ c(p, { dangerouslySetInnerHTML: { __html: u(s[n]) } }, n) : null, /* @__PURE__ */ l(m, { children: [/* @__PURE__ */ c(f, {
|
|
45
|
+
id: b,
|
|
46
|
+
dangerouslySetInnerHTML: { __html: u(e.label) }
|
|
47
|
+
}, `category-label-${n}-${v}`), /* @__PURE__ */ c(t, {
|
|
48
|
+
minRowHeight: y,
|
|
49
|
+
labelId: b,
|
|
49
50
|
onDropChoice: (t) => a(e.id, t),
|
|
50
51
|
onRemoveChoice: o,
|
|
51
52
|
disabled: i,
|
|
52
|
-
selectedItem:
|
|
53
|
-
onSelectClick:
|
|
54
|
-
onPlacementClick:
|
|
53
|
+
selectedItem: d,
|
|
54
|
+
onSelectClick: h,
|
|
55
|
+
onPlacementClick: g,
|
|
55
56
|
...e
|
|
56
|
-
}, `category-element-${n}-${
|
|
57
|
+
}, `category-element-${n}-${v}`)] })]
|
|
57
58
|
}));
|
|
58
|
-
}), r = r.concat(Array(
|
|
59
|
+
}), r = r.concat(Array(v - e.length).fill(/* @__PURE__ */ c("div", {})).map((e, t) => /* @__PURE__ */ c("div", {}, `fill-space-final-${t}`))), r;
|
|
59
60
|
})
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
|
-
},
|
|
63
|
+
}, f = o("div")(({ theme: e }) => ({
|
|
63
64
|
color: i.text(),
|
|
64
65
|
backgroundColor: i.background(),
|
|
65
66
|
textAlign: "center",
|
|
66
67
|
paddingTop: e.spacing(1)
|
|
67
|
-
})),
|
|
68
|
+
})), p = o("div")({
|
|
68
69
|
alignItems: "center",
|
|
69
70
|
display: "flex",
|
|
70
71
|
justifyContent: "center",
|
|
71
72
|
flex: .5,
|
|
72
73
|
marginRight: "12px"
|
|
73
|
-
}),
|
|
74
|
+
}), m = o("div")({
|
|
74
75
|
display: "flex",
|
|
75
76
|
flex: "2",
|
|
76
77
|
flexDirection: "column"
|
|
77
|
-
}),
|
|
78
|
+
}), h = s.withUid(d);
|
|
78
79
|
//#endregion
|
|
79
|
-
export {
|
|
80
|
+
export { d as Categories, n as CategoryType, h as default };
|
|
@@ -8,12 +8,13 @@ import { uid as o } from "@pie-lib/drag";
|
|
|
8
8
|
import { jsx as s } from "react/jsx-runtime";
|
|
9
9
|
import c from "@mui/material/Card";
|
|
10
10
|
import l from "@mui/material/CardContent";
|
|
11
|
+
import { sanitizeModelHtml as u } from "@pie-element/shared-utils";
|
|
11
12
|
//#region src/delivery/categorize/choice.tsx
|
|
12
13
|
r("@pie-ui:categorize:choice");
|
|
13
|
-
var
|
|
14
|
+
var d = {
|
|
14
15
|
content: n.string.isRequired,
|
|
15
16
|
id: n.string
|
|
16
|
-
},
|
|
17
|
+
}, f = i("div", { shouldForwardProp: (e) => ![
|
|
17
18
|
"isDragging",
|
|
18
19
|
"disabled",
|
|
19
20
|
"correct",
|
|
@@ -26,21 +27,21 @@ var u = {
|
|
|
26
27
|
...i && { border: `solid 2px ${t.buttonFocusOutline()}` },
|
|
27
28
|
...r === !0 && { border: `solid 2px ${t.correct()}` },
|
|
28
29
|
...r === !1 && { border: `solid 2px ${t.incorrect()}` }
|
|
29
|
-
})),
|
|
30
|
+
})), p = i(c, { shouldForwardProp: (e) => e !== "isSelected" })(({ isSelected: e }) => ({
|
|
30
31
|
color: t.text(),
|
|
31
32
|
backgroundColor: t.background(),
|
|
32
33
|
width: "100%",
|
|
33
34
|
opacity: e ? .5 : 1
|
|
34
|
-
})),
|
|
35
|
+
})), m = i(l)(({ theme: e }) => ({
|
|
35
36
|
color: t.text(),
|
|
36
37
|
backgroundColor: t.v("pie")("background", t.defaults.WHITE),
|
|
37
38
|
"&:last-child": { paddingBottom: e.spacing(2) },
|
|
38
39
|
borderRadius: "4px",
|
|
39
40
|
border: "1px solid",
|
|
40
41
|
"& p": { margin: "0px" }
|
|
41
|
-
})),
|
|
42
|
+
})), h = class extends e.Component {
|
|
42
43
|
static propTypes = {
|
|
43
|
-
...
|
|
44
|
+
...d,
|
|
44
45
|
disabled: n.bool,
|
|
45
46
|
correct: n.bool,
|
|
46
47
|
isDragging: n.bool,
|
|
@@ -49,18 +50,18 @@ var u = {
|
|
|
49
50
|
static defaultProps = {};
|
|
50
51
|
render() {
|
|
51
52
|
let { content: e, isDragging: t, disabled: n, correct: r, isSelected: i, showsSelectionBorder: a } = this.props;
|
|
52
|
-
return /* @__PURE__ */ s(
|
|
53
|
+
return /* @__PURE__ */ s(f, {
|
|
53
54
|
isDragging: t,
|
|
54
55
|
disabled: n,
|
|
55
56
|
correct: r,
|
|
56
57
|
isSelected: i,
|
|
57
|
-
children: /* @__PURE__ */ s(
|
|
58
|
+
children: /* @__PURE__ */ s(p, {
|
|
58
59
|
isSelected: i,
|
|
59
|
-
children: /* @__PURE__ */ s(
|
|
60
|
+
children: /* @__PURE__ */ s(m, { dangerouslySetInnerHTML: { __html: u(e) } })
|
|
60
61
|
})
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
|
-
},
|
|
64
|
+
}, g = ({ id: e, content: t, disabled: n, correct: r, extraStyle: i, categoryId: o, choiceIndex: c, selectedItem: l, onSelectClick: u }) => {
|
|
64
65
|
let d = o === void 0 ? `choice-${e}-board` : `choice-${e}-${o}-${c}`, f = {
|
|
65
66
|
id: e,
|
|
66
67
|
categoryId: o,
|
|
@@ -68,7 +69,7 @@ var u = {
|
|
|
68
69
|
value: t,
|
|
69
70
|
itemType: "categorize",
|
|
70
71
|
type: "choice"
|
|
71
|
-
}, { attributes: p, listeners:
|
|
72
|
+
}, { attributes: p, listeners: m, setNodeRef: g, isDragging: _ } = a({
|
|
72
73
|
id: d,
|
|
73
74
|
data: f,
|
|
74
75
|
disabled: n
|
|
@@ -88,9 +89,9 @@ var u = {
|
|
|
88
89
|
...i
|
|
89
90
|
},
|
|
90
91
|
onClick: y,
|
|
91
|
-
...
|
|
92
|
+
...m,
|
|
92
93
|
...p,
|
|
93
|
-
children: /* @__PURE__ */ s(
|
|
94
|
+
children: /* @__PURE__ */ s(h, {
|
|
94
95
|
id: e,
|
|
95
96
|
content: t,
|
|
96
97
|
disabled: n,
|
|
@@ -100,8 +101,8 @@ var u = {
|
|
|
100
101
|
})
|
|
101
102
|
});
|
|
102
103
|
};
|
|
103
|
-
|
|
104
|
-
...
|
|
104
|
+
g.propTypes = {
|
|
105
|
+
...d,
|
|
105
106
|
extraStyle: n.object,
|
|
106
107
|
categoryId: n.string,
|
|
107
108
|
choiceIndex: n.number,
|
|
@@ -109,6 +110,6 @@ h.propTypes = {
|
|
|
109
110
|
selectedItem: n.object,
|
|
110
111
|
onSelectClick: n.func
|
|
111
112
|
};
|
|
112
|
-
var
|
|
113
|
+
var _ = o.withUid(g);
|
|
113
114
|
//#endregion
|
|
114
|
-
export {
|
|
115
|
+
export { d as ChoiceType, h as Layout, _ as default };
|
|
@@ -5,15 +5,16 @@ import i from "prop-types";
|
|
|
5
5
|
import { styled as a } from "@mui/material/styles";
|
|
6
6
|
import { uid as o } from "@pie-lib/drag";
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
import { sanitizeModelHtml as l } from "@pie-element/shared-utils";
|
|
8
9
|
//#region src/delivery/categorize/choices.tsx
|
|
9
|
-
var
|
|
10
|
+
var u = a("div")({
|
|
10
11
|
flex: 1,
|
|
11
12
|
touchAction: "none"
|
|
12
|
-
}),
|
|
13
|
+
}), d = a("div")(({ theme: e }) => ({
|
|
13
14
|
margin: "0 auto",
|
|
14
15
|
textAlign: "center",
|
|
15
16
|
paddingTop: e.spacing(1)
|
|
16
|
-
})),
|
|
17
|
+
})), f = class extends r.Component {
|
|
17
18
|
static propTypes = {
|
|
18
19
|
choices: i.arrayOf(i.oneOfType([i.shape(t), i.shape({ empty: i.bool })])),
|
|
19
20
|
model: i.shape({
|
|
@@ -35,30 +36,30 @@ var l = a("div")({
|
|
|
35
36
|
choicesLabel: ""
|
|
36
37
|
} };
|
|
37
38
|
render() {
|
|
38
|
-
let { choices: t = [], model: r, disabled: i, onDropChoice: a, onRemoveChoice: o, choicePosition:
|
|
39
|
-
return
|
|
39
|
+
let { choices: t = [], model: r, disabled: i, onDropChoice: a, onRemoveChoice: o, choicePosition: f, correct: p, selectedItem: m, onSelectClick: h, onPlacementClick: g, uid: _ } = this.props, v = !!r.choicesLabel && r.choicesLabel !== "", y = v ? `categorize-${_}-choices-label` : void 0, b = { textAlign: "center" };
|
|
40
|
+
return f === "left" && (b.direction = "rtl"), /* @__PURE__ */ s(u, { children: /* @__PURE__ */ c(n, {
|
|
40
41
|
id: "choices-board",
|
|
41
|
-
labelId:
|
|
42
|
+
labelId: y,
|
|
42
43
|
onDropChoice: a,
|
|
43
44
|
onRemoveChoice: o,
|
|
44
45
|
disabled: i,
|
|
45
46
|
style: { background: "none" },
|
|
46
47
|
choiceBoard: !0,
|
|
47
|
-
correct:
|
|
48
|
-
selectedItem:
|
|
49
|
-
onPlacementClick:
|
|
50
|
-
children: [
|
|
51
|
-
id:
|
|
52
|
-
dangerouslySetInnerHTML: { __html: r.choicesLabel }
|
|
48
|
+
correct: p,
|
|
49
|
+
selectedItem: m,
|
|
50
|
+
onPlacementClick: g,
|
|
51
|
+
children: [v && /* @__PURE__ */ s(d, {
|
|
52
|
+
id: y,
|
|
53
|
+
dangerouslySetInnerHTML: { __html: l(r.choicesLabel) }
|
|
53
54
|
}), t.map((t, n) => t.empty ? /* @__PURE__ */ s("div", {}, n) : /* @__PURE__ */ s(e, {
|
|
54
55
|
disabled: i,
|
|
55
56
|
extraStyle: { maxWidth: `${95 / r.categoriesPerRow}%` },
|
|
56
|
-
selectedItem:
|
|
57
|
-
onSelectClick:
|
|
57
|
+
selectedItem: m,
|
|
58
|
+
onSelectClick: h,
|
|
58
59
|
...t
|
|
59
60
|
}, n))]
|
|
60
61
|
}) });
|
|
61
62
|
}
|
|
62
|
-
},
|
|
63
|
+
}, p = o.withUid(f);
|
|
63
64
|
//#endregion
|
|
64
|
-
export { t as ChoiceType,
|
|
65
|
+
export { t as ChoiceType, f as Choices, p as default };
|
|
@@ -18,14 +18,15 @@ import { DragProvider as T, createDragCollision as E, uid as D } from "@pie-lib/
|
|
|
18
18
|
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
19
19
|
import A from "@pie-lib/translator";
|
|
20
20
|
import { AlertDialog as j } from "@pie-lib/config-ui";
|
|
21
|
+
import { sanitizeModelHtml as M } from "@pie-element/shared-utils";
|
|
21
22
|
//#region src/delivery/categorize/index.tsx
|
|
22
|
-
function
|
|
23
|
+
function N(e) {
|
|
23
24
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
return !e ||
|
|
26
|
+
function P(e, t) {
|
|
27
|
+
return !e || N(e) ? e : N(e.default) ? e.default : t && N(e[t]) ? e[t] : t && N(e[t]?.default) ? e[t].default : e;
|
|
27
28
|
}
|
|
28
|
-
var
|
|
29
|
+
var F = P(d, "UiLayout") || P(V.UiLayout, "UiLayout"), I = P(u, "PreviewPrompt") || P(V.PreviewPrompt, "PreviewPrompt"), L = P(c, "Collapsible") || P(V.Collapsible, "Collapsible"), R = P(l, "Feedback") || P(V.Feedback, "Feedback"), z = s, B = z.default, V = B && typeof B == "object" ? B : z, { translator: H } = A, U = _("@pie-ui:categorize"), W = 250, G = class extends a.Component {
|
|
29
30
|
static propTypes = { children: g.node };
|
|
30
31
|
containerRef = a.createRef();
|
|
31
32
|
componentDidMount() {
|
|
@@ -37,7 +38,7 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
|
|
|
37
38
|
children: this.props.children
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
|
-
},
|
|
41
|
+
}, K = class extends a.Component {
|
|
41
42
|
static propTypes = {
|
|
42
43
|
model: g.object,
|
|
43
44
|
session: g.shape({ answers: g.arrayOf(g.shape({
|
|
@@ -61,19 +62,19 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
|
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
removeChoice = (e) => {
|
|
64
|
-
|
|
65
|
+
U("[removeChoice]: ", e);
|
|
65
66
|
let { onAnswersChange: t, session: n } = this.props;
|
|
66
67
|
t(w(e.id, e.categoryId, e.choiceIndex, n.answers));
|
|
67
68
|
};
|
|
68
69
|
dropChoice = (e, t) => {
|
|
69
70
|
let { session: n, onAnswersChange: r, model: i } = this.props, { maxChoicesPerCategory: a = 0 } = i || {}, { answers: o = [] } = n || {}, s;
|
|
70
|
-
t ?
|
|
71
|
+
t ? U("[dropChoice] category: ", t.categoryId, "choice: ", t) : U("[dropChoice] category: ", void 0, "choice: ", void 0);
|
|
71
72
|
let c = o.find((t) => t.category === e);
|
|
72
73
|
t && a === 1 && c && c.choices && c.choices.length === 1 ? (s = C(t.id, t.categoryId, e, t.choiceIndex, o), s = w(c.choices[0], e, 0, s)) : t && a > 1 && c && c.choices && c.choices.length === a ? (s = t.categoryId ? C(t.id, t.categoryId, t.categoryId, t.choiceIndex, o) : w(t.id, t.categoryId, t.choiceIndex, o), this.setState({ showMaxChoiceAlert: !0 })) : a !== 0 && c && c.choices && c.choices.length > a ? (s = o, this.setState({ showMaxChoiceAlert: !0 })) : s = t ? C(t.id, t.categoryId, e, t.choiceIndex, o) : this.removeChoice(e), t && r(s);
|
|
73
74
|
};
|
|
74
75
|
UNSAFE_componentWillReceiveProps(e) {
|
|
75
76
|
let { model: t } = this.props, { model: n } = e;
|
|
76
|
-
t.note && t.language && t.language !== n.language && t.note ===
|
|
77
|
+
t.note && t.language && t.language !== n.language && t.note === H.t("common:commonCorrectAnswerWithAlternates", { lng: t.language }) && (t.note = H.t("common:commonCorrectAnswerWithAlternates", { lng: n.language })), this.setState({ showCorrect: !1 });
|
|
77
78
|
}
|
|
78
79
|
toggleShowCorrect = () => this.setState({ showCorrect: !this.state.showCorrect }, () => {
|
|
79
80
|
this.props.onShowCorrectToggle();
|
|
@@ -101,38 +102,38 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
|
|
|
101
102
|
let { model: e, session: r, selectedItem: i, onSelectClick: o, onPlacementClick: s } = this.props, { showCorrect: c, showMaxChoiceAlert: l } = this.state, { choicesPosition: u, extraCSSRules: d, note: f, showNote: p, env: g, language: _, maxChoicesPerCategory: v, autoplayAudioEnabled: y, customAudioButton: b } = e, { mode: C, role: w } = g || {}, T = u || "above", E = {
|
|
102
103
|
flexDirection: this.getPositionDirection(T),
|
|
103
104
|
gap: "8px"
|
|
104
|
-
}, { categories: D, choices: A, correct:
|
|
105
|
-
|
|
106
|
-
let { rowLabels:
|
|
105
|
+
}, { categories: D, choices: A, correct: N } = S(e.categories, e.choices, c ? e.correctResponse : r.answers, e.correctResponse);
|
|
106
|
+
U("[render] disabled: ", e.disabled);
|
|
107
|
+
let { rowLabels: P, categoriesPerRow: F, correctResponse: L, fontSizeFactor: z } = e, B = D && Math.ceil(D.length / F) || 0, V = this.existAlternateResponse(L) || !1, W = (c || C === "view" && w === "instructor") && p && f && V, G = H.t("translation:categorize:limitMaxChoicesPerCategory", {
|
|
107
108
|
lng: e.language,
|
|
108
109
|
maxChoicesPerCategory: v
|
|
109
|
-
}),
|
|
110
|
-
return /* @__PURE__ */ k(
|
|
110
|
+
}), K = H.t("common:warning", { lng: e.language }), q = H.t("common:cancel", { lng: e.language }), $ = e.rationale && (h(e.rationale) || m(e.rationale)), ee = e.teacherInstructions && (h(e.teacherInstructions) || m(e.teacherInstructions));
|
|
111
|
+
return /* @__PURE__ */ k(J, {
|
|
111
112
|
extraCSSRules: d,
|
|
112
113
|
id: this.mainContainerId,
|
|
113
114
|
className: "main-container",
|
|
114
|
-
fontSizeFactor:
|
|
115
|
+
fontSizeFactor: z,
|
|
115
116
|
children: [
|
|
116
|
-
|
|
117
|
+
ee && /* @__PURE__ */ O(a.Fragment, { children: /* @__PURE__ */ O(Q, {
|
|
117
118
|
labels: {
|
|
118
|
-
hidden:
|
|
119
|
-
visible:
|
|
119
|
+
hidden: H.t("common:showTeacherInstructions", { lng: _ }),
|
|
120
|
+
visible: H.t("common:hideTeacherInstructions", { lng: _ })
|
|
120
121
|
},
|
|
121
|
-
children: /* @__PURE__ */ O(
|
|
122
|
+
children: /* @__PURE__ */ O(I, { prompt: e.teacherInstructions })
|
|
122
123
|
}) }),
|
|
123
|
-
e.prompt && /* @__PURE__ */ O(
|
|
124
|
+
e.prompt && /* @__PURE__ */ O(I, {
|
|
124
125
|
prompt: e.prompt,
|
|
125
126
|
autoplayAudioEnabled: y,
|
|
126
127
|
customAudioButton: b,
|
|
127
128
|
language: _
|
|
128
129
|
}),
|
|
129
130
|
/* @__PURE__ */ O(x, {
|
|
130
|
-
show: c ||
|
|
131
|
+
show: c || N === !1,
|
|
131
132
|
toggled: c,
|
|
132
133
|
onToggle: this.toggleShowCorrect,
|
|
133
134
|
language: _
|
|
134
135
|
}),
|
|
135
|
-
/* @__PURE__ */ O(
|
|
136
|
+
/* @__PURE__ */ O(X, { children: /* @__PURE__ */ k(Z, {
|
|
136
137
|
style: E,
|
|
137
138
|
children: [/* @__PURE__ */ O("div", {
|
|
138
139
|
style: {
|
|
@@ -145,7 +146,7 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
|
|
|
145
146
|
categories: D,
|
|
146
147
|
onDropChoice: this.dropChoice,
|
|
147
148
|
onRemoveChoice: this.removeChoice,
|
|
148
|
-
rowLabels: (
|
|
149
|
+
rowLabels: (P || []).slice(0, B),
|
|
149
150
|
selectedItem: i,
|
|
150
151
|
onSelectClick: o,
|
|
151
152
|
onPlacementClick: s
|
|
@@ -157,35 +158,35 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
|
|
|
157
158
|
choicePosition: T,
|
|
158
159
|
onDropChoice: this.dropChoice,
|
|
159
160
|
onRemoveChoice: this.removeChoice,
|
|
160
|
-
correct:
|
|
161
|
+
correct: N,
|
|
161
162
|
selectedItem: i,
|
|
162
163
|
onSelectClick: o,
|
|
163
164
|
onPlacementClick: s
|
|
164
165
|
})]
|
|
165
166
|
}) }),
|
|
166
|
-
|
|
167
|
-
|
|
167
|
+
W && /* @__PURE__ */ O(Y, { dangerouslySetInnerHTML: { __html: M(f) } }),
|
|
168
|
+
$ && /* @__PURE__ */ O(Q, {
|
|
168
169
|
labels: {
|
|
169
|
-
hidden:
|
|
170
|
-
visible:
|
|
170
|
+
hidden: H.t("common:showRationale", { lng: _ }),
|
|
171
|
+
visible: H.t("common:hideRationale", { lng: _ })
|
|
171
172
|
},
|
|
172
|
-
children: /* @__PURE__ */ O(
|
|
173
|
+
children: /* @__PURE__ */ O(I, { prompt: e.rationale })
|
|
173
174
|
}),
|
|
174
|
-
e.correctness && e.feedback && !c && /* @__PURE__ */ O(
|
|
175
|
+
e.correctness && e.feedback && !c && /* @__PURE__ */ O(R, {
|
|
175
176
|
correctness: e.correctness,
|
|
176
177
|
feedback: e.feedback
|
|
177
178
|
}),
|
|
178
179
|
/* @__PURE__ */ O(j, {
|
|
179
|
-
title:
|
|
180
|
-
text:
|
|
180
|
+
title: K,
|
|
181
|
+
text: G,
|
|
181
182
|
open: l,
|
|
182
|
-
onCloseText:
|
|
183
|
+
onCloseText: q,
|
|
183
184
|
onClose: () => this.setState({ showMaxChoiceAlert: !1 })
|
|
184
185
|
})
|
|
185
186
|
]
|
|
186
187
|
});
|
|
187
188
|
}
|
|
188
|
-
},
|
|
189
|
+
}, q = class extends a.Component {
|
|
189
190
|
static propTypes = {
|
|
190
191
|
model: g.object,
|
|
191
192
|
session: g.shape({ answers: g.arrayOf(g.shape({
|
|
@@ -263,7 +264,7 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
|
|
|
263
264
|
let { selectedItem: t } = this.state;
|
|
264
265
|
t && (this.commitPlacement(t, e), this.cancelSelection(), this.endAnyLiveKeyboardDrag());
|
|
265
266
|
};
|
|
266
|
-
isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt <
|
|
267
|
+
isClickSoonAfterDragEnd = () => Date.now() - this.lastDragEndAt < W;
|
|
267
268
|
onItemClick = (e) => {
|
|
268
269
|
this.isClickSoonAfterDragEnd() || (this.endAnyLiveKeyboardDrag(), this.toggleItemSelection(e));
|
|
269
270
|
};
|
|
@@ -299,7 +300,7 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
|
|
|
299
300
|
modifiers: this.dragCollision.modifiers,
|
|
300
301
|
children: /* @__PURE__ */ k(D.Provider, {
|
|
301
302
|
value: this.uid,
|
|
302
|
-
children: [/* @__PURE__ */ O(
|
|
303
|
+
children: [/* @__PURE__ */ O(K, {
|
|
303
304
|
ref: (e) => this.categorizeRef = e,
|
|
304
305
|
...this.props,
|
|
305
306
|
selectedItem: t,
|
|
@@ -307,23 +308,23 @@ var P = N(d, "UiLayout") || N(B.UiLayout, "UiLayout"), F = N(u, "PreviewPrompt")
|
|
|
307
308
|
onPlacementClick: this.onPlacementClick
|
|
308
309
|
}), /* @__PURE__ */ O(y, {
|
|
309
310
|
dropAnimation: n,
|
|
310
|
-
children: /* @__PURE__ */ O(
|
|
311
|
+
children: /* @__PURE__ */ O(G, { children: this.renderDragOverlay() })
|
|
311
312
|
})]
|
|
312
313
|
})
|
|
313
314
|
});
|
|
314
315
|
}
|
|
315
|
-
},
|
|
316
|
+
}, J = v(F)({
|
|
316
317
|
color: f.text(),
|
|
317
318
|
backgroundColor: f.background(),
|
|
318
319
|
position: "relative"
|
|
319
|
-
}),
|
|
320
|
+
}), Y = v("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), X = v("div")(({ theme: e }) => ({
|
|
320
321
|
marginBottom: e.spacing(1),
|
|
321
322
|
maxWidth: "100%",
|
|
322
323
|
overflowX: "auto",
|
|
323
324
|
overflowY: "hidden"
|
|
324
|
-
})),
|
|
325
|
+
})), Z = v("div")(() => ({
|
|
325
326
|
display: "flex",
|
|
326
327
|
minWidth: "min-content"
|
|
327
|
-
})),
|
|
328
|
+
})), Q = v(L)(({ theme: e }) => ({ paddingBottom: e.spacing(2) }));
|
|
328
329
|
//#endregion
|
|
329
|
-
export {
|
|
330
|
+
export { K as Categorize, q as default };
|