@pie-element/match 13.0.5-next.20261014231219 → 13.0.5
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/{Typography-CsW9nycK.js → Typography-CciAMX_U.js} +5 -3
- package/dist/browser/{Typography-CsW9nycK.js.map → Typography-CciAMX_U.js.map} +1 -1
- package/dist/browser/author/index.js +6669 -6636
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +5 -2
- package/dist/browser/delivery/index.js +116 -113
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/editor-runtime/{Typography-DihCWw-7.js → Typography-D94viwfW.js} +5 -3
- package/dist/browser/editor-runtime/{Typography-DihCWw-7.js.map → Typography-D94viwfW.js.map} +1 -1
- package/dist/browser/editor-runtime/author/index.js +4134 -4101
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +5 -2
- package/dist/browser/editor-runtime/delivery/index.js +116 -113
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -1
- package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-BN-5U8S7.js → mathjax-CptWnMbQ-CahddD6F.js} +2 -2
- package/dist/browser/editor-runtime/{mathjax-CptWnMbQ-BN-5U8S7.js.map → mathjax-CptWnMbQ-CahddD6F.js.map} +1 -1
- package/dist/browser/{mathjax-CptWnMbQ-BI1nc47N.js → mathjax-CptWnMbQ-DCzzNLKH.js} +2 -2
- package/dist/browser/{mathjax-CptWnMbQ-BI1nc47N.js.map → mathjax-CptWnMbQ-DCzzNLKH.js.map} +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/schemas/configuration.schema.json +1 -1
- package/dist/schemas/model.schema.json +1 -1
- package/dist/schemas/session.schema.json +1 -1
- package/package.json +16 -16
|
@@ -267,8 +267,11 @@ var F = (e, t) => new Promise((n) => {
|
|
|
267
267
|
let n = t + 1;
|
|
268
268
|
f[n] = "", l && I(e).length > l && (f[n] += `Content length should be maximum ${l} characters. `), e ? m.slice(0, t).some((t) => t === e) && (f[t + 1] += "Content should be unique.") : f[n] += "Content should not be empty.";
|
|
269
269
|
}), Object.values(d).some((e) => (e || "").length) && (p.rowsErrors = d, Object.values(d).some((e) => (e || "").includes("No correct response defined.")) && (p.correctResponseError = r === "radio" ? "There should be a correct response defined for every row." : "There should be at least one correct response defined for every row.")), Object.values(f).some((e) => (e || "").length) && (p.columnsErrors = f), p;
|
|
270
|
-
}
|
|
270
|
+
}, z = Object.freeze({
|
|
271
|
+
name: "@pie-element/match",
|
|
272
|
+
version: "13.0.5"
|
|
273
|
+
});
|
|
271
274
|
//#endregion
|
|
272
|
-
export { F as createCorrectResponseSession, M as createDefaultModel, A as getLogTrace, P as model, N as normalize, j as outcome, R as validate };
|
|
275
|
+
export { F as createCorrectResponseSession, M as createDefaultModel, A as getLogTrace, P as model, N as normalize, j as outcome, z as piePackage, R as validate };
|
|
273
276
|
|
|
274
277
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as e } from "../browser-kkT1XVKw.js";
|
|
2
|
-
import { A as t, B as n, Ct as r, O as i, St as a, Tt as o, Ut as s, a as c, bt as l, d as u, f as
|
|
3
|
-
import
|
|
4
|
-
import { createRoot as
|
|
5
|
-
import { jsx as
|
|
2
|
+
import { A as t, B as n, Ct as r, O as i, St as a, Tt as o, Ut as s, a as c, bt as l, d as u, f as d, k as f, n as ee, p, r as te, t as ne, u as m, x as h, xt as g } from "../Typography-CciAMX_U.js";
|
|
3
|
+
import _, { useRef as re } from "react";
|
|
4
|
+
import { createRoot as ie } from "react-dom/client";
|
|
5
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
6
6
|
//#region ../../lib-react/correct-answer-toggle/dist/expander.js
|
|
7
|
-
var
|
|
7
|
+
var b = /* @__PURE__ */ e(s(), 1), x = "height ease-in 300ms, opacity ease-in 300ms", S = o("div")(() => ({
|
|
8
8
|
position: "relative",
|
|
9
9
|
height: 0,
|
|
10
10
|
overflow: "hidden",
|
|
@@ -12,7 +12,7 @@ var y = /* @__PURE__ */ e(s(), 1), b = "height ease-in 300ms, opacity ease-in 30
|
|
|
12
12
|
visibility: "hidden",
|
|
13
13
|
width: 0,
|
|
14
14
|
"&.enter": {
|
|
15
|
-
transition:
|
|
15
|
+
transition: x,
|
|
16
16
|
opacity: 1,
|
|
17
17
|
height: "auto",
|
|
18
18
|
width: "auto",
|
|
@@ -26,7 +26,7 @@ var y = /* @__PURE__ */ e(s(), 1), b = "height ease-in 300ms, opacity ease-in 30
|
|
|
26
26
|
minHeight: "25px"
|
|
27
27
|
},
|
|
28
28
|
"&.exit": {
|
|
29
|
-
transition:
|
|
29
|
+
transition: x,
|
|
30
30
|
opacity: 0,
|
|
31
31
|
height: 0,
|
|
32
32
|
visibility: "visible",
|
|
@@ -38,9 +38,9 @@ var y = /* @__PURE__ */ e(s(), 1), b = "height ease-in 300ms, opacity ease-in 30
|
|
|
38
38
|
height: 0,
|
|
39
39
|
width: 0
|
|
40
40
|
}
|
|
41
|
-
})),
|
|
42
|
-
let { show: t, children: n, className: i } = e, a =
|
|
43
|
-
return /* @__PURE__ */
|
|
41
|
+
})), C = (e) => {
|
|
42
|
+
let { show: t, children: n, className: i } = e, a = re(null);
|
|
43
|
+
return /* @__PURE__ */ v(r, {
|
|
44
44
|
nodeRef: a,
|
|
45
45
|
in: t,
|
|
46
46
|
appear: !0,
|
|
@@ -52,21 +52,21 @@ var y = /* @__PURE__ */ e(s(), 1), b = "height ease-in 300ms, opacity ease-in 30
|
|
|
52
52
|
exit: "exit",
|
|
53
53
|
exitDone: "exit-done"
|
|
54
54
|
},
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ v(S, {
|
|
56
56
|
ref: a,
|
|
57
57
|
className: i,
|
|
58
58
|
children: n
|
|
59
59
|
})
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
|
-
|
|
63
|
-
show:
|
|
64
|
-
className:
|
|
65
|
-
children:
|
|
62
|
+
C.propTypes = {
|
|
63
|
+
show: b.default.bool.isRequired,
|
|
64
|
+
className: b.default.string,
|
|
65
|
+
children: b.default.oneOfType([b.default.arrayOf(b.default.node), b.default.node]).isRequired
|
|
66
66
|
};
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region ../../lib-react/icons/dist/correct-response-icon.js
|
|
69
|
-
var
|
|
69
|
+
var w = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ y("svg", {
|
|
70
70
|
"aria-hidden": "true",
|
|
71
71
|
focusable: "false",
|
|
72
72
|
preserveAspectRatio: "xMinYMin meet",
|
|
@@ -74,27 +74,27 @@ var S = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ v("svg", {
|
|
|
74
74
|
viewBox: "-283 359 34 35",
|
|
75
75
|
style: { enableBackground: "new -283 359 34 35" },
|
|
76
76
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ v("circle", {
|
|
78
78
|
cx: "-266",
|
|
79
79
|
cy: "375.9",
|
|
80
80
|
r: "14",
|
|
81
81
|
fill: e
|
|
82
82
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ v("path", {
|
|
84
84
|
d: "M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",
|
|
85
85
|
fill: e
|
|
86
86
|
}),
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ v("polygon", {
|
|
88
88
|
points: "-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6",
|
|
89
89
|
fill: t
|
|
90
90
|
})
|
|
91
91
|
]
|
|
92
92
|
});
|
|
93
|
-
|
|
94
|
-
bgFill:
|
|
95
|
-
fgFill:
|
|
93
|
+
w.propTypes = {
|
|
94
|
+
bgFill: b.default.string.isRequired,
|
|
95
|
+
fgFill: b.default.string.isRequired
|
|
96
96
|
};
|
|
97
|
-
var
|
|
97
|
+
var T = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ y("svg", {
|
|
98
98
|
"aria-hidden": "true",
|
|
99
99
|
focusable: "false",
|
|
100
100
|
preserveAspectRatio: "xMinYMin meet",
|
|
@@ -102,7 +102,7 @@ var C = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ v("svg", {
|
|
|
102
102
|
viewBox: "-129.5 127 34 35",
|
|
103
103
|
style: { enableBackground: "new -129.5 127 34 35" },
|
|
104
104
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ v("path", {
|
|
106
106
|
style: {
|
|
107
107
|
fill: "#D0CAC5",
|
|
108
108
|
stroke: "#E6E3E0",
|
|
@@ -111,7 +111,7 @@ var C = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ v("svg", {
|
|
|
111
111
|
},
|
|
112
112
|
d: "M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\n C-97.4,153.5-104.3,160.4-112.9,160.4z"
|
|
113
113
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ v("path", {
|
|
115
115
|
style: {
|
|
116
116
|
fill: "#B3ABA4",
|
|
117
117
|
stroke: "#CDC7C2",
|
|
@@ -120,64 +120,64 @@ var C = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ v("svg", {
|
|
|
120
120
|
},
|
|
121
121
|
d: "M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"
|
|
122
122
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ v("circle", {
|
|
124
124
|
cx: "-114.2",
|
|
125
125
|
cy: "143.5",
|
|
126
126
|
r: "14",
|
|
127
127
|
fill: e
|
|
128
128
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ v("path", {
|
|
130
130
|
d: "M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",
|
|
131
131
|
fill: n
|
|
132
132
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ v("polygon", {
|
|
134
134
|
points: "-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",
|
|
135
135
|
fill: t
|
|
136
136
|
})
|
|
137
137
|
]
|
|
138
138
|
});
|
|
139
|
-
|
|
140
|
-
bgFill:
|
|
141
|
-
fgFill:
|
|
142
|
-
borderFill:
|
|
139
|
+
T.propTypes = {
|
|
140
|
+
bgFill: b.default.string.isRequired,
|
|
141
|
+
fgFill: b.default.string.isRequired,
|
|
142
|
+
borderFill: b.default.string.isRequired
|
|
143
143
|
};
|
|
144
|
-
var
|
|
144
|
+
var E = o("div")(({ size: e }) => ({
|
|
145
145
|
width: e || "25px",
|
|
146
146
|
height: e || "25px"
|
|
147
|
-
})),
|
|
147
|
+
})), D = ({ open: e, size: t }) => /* @__PURE__ */ v(E, {
|
|
148
148
|
size: t,
|
|
149
|
-
children: e ? /* @__PURE__ */
|
|
149
|
+
children: e ? /* @__PURE__ */ v(w, {
|
|
150
150
|
bgFill: "#bce2ff",
|
|
151
151
|
fgFill: "#1a9cff"
|
|
152
|
-
}) : /* @__PURE__ */
|
|
152
|
+
}) : /* @__PURE__ */ v(T, {
|
|
153
153
|
bgFill: "white",
|
|
154
154
|
fgFill: "#1a9cff",
|
|
155
155
|
borderFill: "#bce2ff"
|
|
156
156
|
})
|
|
157
157
|
});
|
|
158
|
-
|
|
159
|
-
open:
|
|
160
|
-
size:
|
|
161
|
-
},
|
|
158
|
+
D.propTypes = {
|
|
159
|
+
open: b.default.bool,
|
|
160
|
+
size: b.default.string
|
|
161
|
+
}, D.defaultProps = { open: !1 };
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region ../../lib-react/correct-answer-toggle/dist/index.js
|
|
164
|
-
function
|
|
164
|
+
function O(e) {
|
|
165
165
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
return !e ||
|
|
167
|
+
function k(e, t) {
|
|
168
|
+
return !e || O(e) ? e : O(e.default) ? e.default : t && O(e[t]) ? e[t] : t && O(e[t]?.default) ? e[t].default : e;
|
|
169
169
|
}
|
|
170
|
-
var
|
|
170
|
+
var A = c, j = A.default, ae = j && typeof j == "object" ? j : A, oe = k(d, "Readable") || k(ae.Readable, "Readable"), { translator: M } = f, se = {
|
|
171
171
|
WebkitTouchCallout: "none",
|
|
172
172
|
WebkitUserSelect: "none",
|
|
173
173
|
KhtmlUserSelect: "none",
|
|
174
174
|
MozUserSelect: "none",
|
|
175
175
|
msUserSelect: "none",
|
|
176
176
|
userSelect: "none"
|
|
177
|
-
},
|
|
177
|
+
}, ce = o("div")(() => ({
|
|
178
178
|
width: "100%",
|
|
179
179
|
cursor: "pointer"
|
|
180
|
-
})),
|
|
180
|
+
})), le = o("button")(() => ({
|
|
181
181
|
margin: "0 auto",
|
|
182
182
|
textAlign: "center",
|
|
183
183
|
display: "flex",
|
|
@@ -200,7 +200,7 @@ var O = c, k = O.default, se = k && typeof k == "object" ? k : O, ce = D(ee, "Re
|
|
|
200
200
|
verticalAlign: "middle",
|
|
201
201
|
color: `var(--correct-answer-toggle-label-color, ${a.text()})`,
|
|
202
202
|
fontWeight: "normal",
|
|
203
|
-
...
|
|
203
|
+
...se
|
|
204
204
|
})), P = o("div")(() => ({
|
|
205
205
|
position: "absolute",
|
|
206
206
|
width: "25px",
|
|
@@ -219,15 +219,15 @@ var O = c, k = O.default, se = k && typeof k == "object" ? k : O, ce = D(ee, "Re
|
|
|
219
219
|
marginRight: "5px",
|
|
220
220
|
display: "flex",
|
|
221
221
|
alignItems: "center"
|
|
222
|
-
})), I = class e extends
|
|
222
|
+
})), I = class e extends _.Component {
|
|
223
223
|
static propTypes = {
|
|
224
|
-
onToggle:
|
|
225
|
-
toggled:
|
|
226
|
-
show:
|
|
227
|
-
hideMessage:
|
|
228
|
-
showMessage:
|
|
229
|
-
className:
|
|
230
|
-
language:
|
|
224
|
+
onToggle: b.default.func,
|
|
225
|
+
toggled: b.default.bool,
|
|
226
|
+
show: b.default.bool,
|
|
227
|
+
hideMessage: b.default.string,
|
|
228
|
+
showMessage: b.default.string,
|
|
229
|
+
className: b.default.string,
|
|
230
|
+
language: b.default.string
|
|
231
231
|
};
|
|
232
232
|
static defaultProps = {
|
|
233
233
|
showMessage: "Show correct answer",
|
|
@@ -236,10 +236,10 @@ var O = c, k = O.default, se = k && typeof k == "object" ? k : O, ce = D(ee, "Re
|
|
|
236
236
|
toggled: !1
|
|
237
237
|
};
|
|
238
238
|
constructor(t) {
|
|
239
|
-
super(t), this.state = { show: t.show }, this.openIconRef =
|
|
239
|
+
super(t), this.state = { show: t.show }, this.openIconRef = _.createRef(), this.closedIconRef = _.createRef(), e.defaultProps = {
|
|
240
240
|
...e.defaultProps,
|
|
241
|
-
showMessage:
|
|
242
|
-
hideMessage:
|
|
241
|
+
showMessage: M.t("common:showCorrectAnswer", { lng: t.language }),
|
|
242
|
+
hideMessage: M.t("common:hideCorrectAnswer", { lng: t.language })
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
245
|
onClick() {
|
|
@@ -251,22 +251,22 @@ var O = c, k = O.default, se = k && typeof k == "object" ? k : O, ce = D(ee, "Re
|
|
|
251
251
|
UNSAFE_componentWillReceiveProps(t) {
|
|
252
252
|
this.setState({ show: t.show }), t.language !== this.props?.language && (e.defaultProps = {
|
|
253
253
|
...e.defaultProps,
|
|
254
|
-
showMessage:
|
|
255
|
-
hideMessage:
|
|
254
|
+
showMessage: M.t("common:showCorrectAnswer", { lng: t.language }),
|
|
255
|
+
hideMessage: M.t("common:hideCorrectAnswer", { lng: t.language })
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
render() {
|
|
259
259
|
let { className: e, toggled: t, hideMessage: n, showMessage: i } = this.props;
|
|
260
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ v(ce, {
|
|
261
261
|
className: e,
|
|
262
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ v(C, {
|
|
263
263
|
show: this.state.show,
|
|
264
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ y(le, {
|
|
265
265
|
type: "button",
|
|
266
266
|
"aria-pressed": !!t,
|
|
267
267
|
onClick: this.onClick.bind(this),
|
|
268
268
|
onTouchEnd: this.onTouch.bind(this),
|
|
269
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ y(F, { children: [/* @__PURE__ */ v(r, {
|
|
270
270
|
nodeRef: this.openIconRef,
|
|
271
271
|
timeout: 400,
|
|
272
272
|
in: t,
|
|
@@ -277,11 +277,11 @@ var O = c, k = O.default, se = k && typeof k == "object" ? k : O, ce = D(ee, "Re
|
|
|
277
277
|
exit: "exit",
|
|
278
278
|
exitActive: "exit-active"
|
|
279
279
|
},
|
|
280
|
-
children: /* @__PURE__ */
|
|
280
|
+
children: /* @__PURE__ */ v(P, {
|
|
281
281
|
ref: this.openIconRef,
|
|
282
|
-
children: /* @__PURE__ */
|
|
282
|
+
children: /* @__PURE__ */ v(D, { open: t }, "correct-open")
|
|
283
283
|
})
|
|
284
|
-
}), /* @__PURE__ */
|
|
284
|
+
}), /* @__PURE__ */ v(r, {
|
|
285
285
|
nodeRef: this.closedIconRef,
|
|
286
286
|
timeout: 5e3,
|
|
287
287
|
in: !t,
|
|
@@ -292,13 +292,13 @@ var O = c, k = O.default, se = k && typeof k == "object" ? k : O, ce = D(ee, "Re
|
|
|
292
292
|
exit: "exit",
|
|
293
293
|
exitActive: "exit-active"
|
|
294
294
|
},
|
|
295
|
-
children: /* @__PURE__ */
|
|
295
|
+
children: /* @__PURE__ */ v(P, {
|
|
296
296
|
ref: this.closedIconRef,
|
|
297
|
-
children: /* @__PURE__ */
|
|
297
|
+
children: /* @__PURE__ */ v(D, { open: t }, "correct-closed")
|
|
298
298
|
})
|
|
299
|
-
})] }), /* @__PURE__ */
|
|
299
|
+
})] }), /* @__PURE__ */ v(oe, {
|
|
300
300
|
false: !0,
|
|
301
|
-
children: /* @__PURE__ */
|
|
301
|
+
children: /* @__PURE__ */ v(N, {
|
|
302
302
|
"aria-hidden": !this.state.show,
|
|
303
303
|
children: t ? n : i
|
|
304
304
|
})
|
|
@@ -312,7 +312,7 @@ var O = c, k = O.default, se = k && typeof k == "object" ? k : O, ce = D(ee, "Re
|
|
|
312
312
|
marginRight: "auto",
|
|
313
313
|
marginTop: e.spacing(1),
|
|
314
314
|
marginBottom: e.spacing(1)
|
|
315
|
-
})), R = o("td")({ padding: "5px 0" }), z = o(
|
|
315
|
+
})), R = o("td")({ padding: "5px 0" }), z = o(ne)(({ theme: e }) => ({ margin: e.spacing(2) })), B = o("th")({ padding: 0 }), V = o("div")(({ theme: e, isQuestionText: t }) => ({
|
|
316
316
|
padding: e.spacing(1.5),
|
|
317
317
|
textAlign: t ? "left" : "center"
|
|
318
318
|
})), H = o("tr")({
|
|
@@ -325,17 +325,17 @@ var O = c, k = O.default, se = k && typeof k == "object" ? k : O, ce = D(ee, "Re
|
|
|
325
325
|
borderCollapse: "collapse",
|
|
326
326
|
borderSpacing: 0,
|
|
327
327
|
marginBottom: 0
|
|
328
|
-
}), ue = class extends
|
|
328
|
+
}), ue = class extends _.Component {
|
|
329
329
|
static propTypes = {
|
|
330
|
-
correctAnswers:
|
|
331
|
-
view:
|
|
332
|
-
showCorrect:
|
|
333
|
-
disabled:
|
|
334
|
-
onAnswerChange:
|
|
335
|
-
choiceMode:
|
|
336
|
-
rows:
|
|
337
|
-
headers:
|
|
338
|
-
answers:
|
|
330
|
+
correctAnswers: b.default.object,
|
|
331
|
+
view: b.default.bool.isRequired,
|
|
332
|
+
showCorrect: b.default.bool.isRequired,
|
|
333
|
+
disabled: b.default.bool.isRequired,
|
|
334
|
+
onAnswerChange: b.default.func.isRequired,
|
|
335
|
+
choiceMode: b.default.string.isRequired,
|
|
336
|
+
rows: b.default.array.isRequired,
|
|
337
|
+
headers: b.default.array.isRequired,
|
|
338
|
+
answers: b.default.object.isRequired
|
|
339
339
|
};
|
|
340
340
|
instanceId = n("match-grid");
|
|
341
341
|
onRowValueChange = (e, t) => (n) => {
|
|
@@ -356,36 +356,36 @@ var O = c, k = O.default, se = k && typeof k == "object" ? k : O, ce = D(ee, "Re
|
|
|
356
356
|
return r && t === !0 || s && this.answerIsCorrect(e, t, n) ? a.correct() : s && this.answerIsIncorrect(e, t, n) ? a.incorrect() : t === !0 && !s ? a.primary() : i ? a.disabled() : a.text();
|
|
357
357
|
};
|
|
358
358
|
render() {
|
|
359
|
-
let { headers: e, rows: t, choiceMode: n, answers: r, disabled: i } = this.props, o = n === "radio" ?
|
|
360
|
-
return !t || t.length === 0 ? /* @__PURE__ */
|
|
359
|
+
let { headers: e, rows: t, choiceMode: n, answers: r, disabled: i } = this.props, o = n === "radio" ? te : ee, s = (e) => `${this.instanceId}-header-${e}`, c = (e) => `${this.instanceId}-row-${e}`, l = (e) => n === "radio" ? `${this.instanceId}-row-${e}-choice` : void 0;
|
|
360
|
+
return !t || t.length === 0 ? /* @__PURE__ */ v(L, { children: /* @__PURE__ */ v(z, {
|
|
361
361
|
component: "div",
|
|
362
362
|
children: "There are currently no questions to show."
|
|
363
|
-
}) }) : /* @__PURE__ */
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
/* @__PURE__ */
|
|
363
|
+
}) }) : /* @__PURE__ */ v(L, { children: /* @__PURE__ */ y(U, { children: [
|
|
364
|
+
/* @__PURE__ */ v("colgroup", { children: (e || []).map((e, t) => /* @__PURE__ */ v("col", {}, `col-${t}`)) }),
|
|
365
|
+
/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ v("tr", { children: (e || []).map((e, t) => /* @__PURE__ */ v(B, {
|
|
366
366
|
id: s(t),
|
|
367
367
|
"data-colno": `${t}`,
|
|
368
368
|
scope: "col",
|
|
369
|
-
children: /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ v(V, {
|
|
370
370
|
isQuestionText: t === 0,
|
|
371
|
-
dangerouslySetInnerHTML: { __html:
|
|
371
|
+
dangerouslySetInnerHTML: { __html: g(e) }
|
|
372
372
|
})
|
|
373
373
|
}, `th-${t}`)) }) }),
|
|
374
|
-
(t || []).map((e, t) => /* @__PURE__ */
|
|
374
|
+
(t || []).map((e, t) => /* @__PURE__ */ v("tbody", {
|
|
375
375
|
role: n === "radio" ? "radiogroup" : "group",
|
|
376
376
|
"aria-labelledby": c(t),
|
|
377
|
-
children: /* @__PURE__ */
|
|
377
|
+
children: /* @__PURE__ */ y(H, { children: [/* @__PURE__ */ v("td", {
|
|
378
378
|
id: c(t),
|
|
379
379
|
"data-colno": "0",
|
|
380
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ v(V, {
|
|
381
381
|
isQuestionText: !0,
|
|
382
|
-
dangerouslySetInnerHTML: { __html:
|
|
382
|
+
dangerouslySetInnerHTML: { __html: g(e.title) }
|
|
383
383
|
})
|
|
384
384
|
}, `td-title-${t}`), (r[e.id] || []).map((n, r) => {
|
|
385
385
|
let u = this.controlColor(e.id, n, r);
|
|
386
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ v(R, {
|
|
387
387
|
"data-colno": `${r + 1}`,
|
|
388
|
-
children: /* @__PURE__ */
|
|
388
|
+
children: /* @__PURE__ */ v(V, { children: /* @__PURE__ */ v(o, {
|
|
389
389
|
sx: {
|
|
390
390
|
padding: "6px",
|
|
391
391
|
color: u,
|
|
@@ -417,11 +417,11 @@ function W(e) {
|
|
|
417
417
|
function G(e, t) {
|
|
418
418
|
return !e || W(e) ? e : W(e.default) ? e.default : t && W(e[t]) ? e[t] : t && W(e[t]?.default) ? e[t].default : e;
|
|
419
419
|
}
|
|
420
|
-
var K = c, q = K.default, J = q && typeof q == "object" ? q : K, de = G(
|
|
420
|
+
var K = c, q = K.default, J = q && typeof q == "object" ? q : K, de = G(h, "UiLayout") || G(J.UiLayout, "UiLayout"), Y = G(p, "PreviewPrompt") || G(J.PreviewPrompt, "PreviewPrompt"), fe = G(l, "Feedback") || G(J.Feedback, "Feedback"), X = G(i, "Collapsible") || G(J.Collapsible, "Collapsible"), { translator: Z } = f, pe = o("div")({ verticalAlign: "middle" }), me = o(X)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Q = class extends _.Component {
|
|
421
421
|
static propTypes = {
|
|
422
|
-
session:
|
|
423
|
-
onSessionChange:
|
|
424
|
-
model:
|
|
422
|
+
session: b.default.object.isRequired,
|
|
423
|
+
onSessionChange: b.default.func,
|
|
424
|
+
model: b.default.object.isRequired
|
|
425
425
|
};
|
|
426
426
|
constructor(e) {
|
|
427
427
|
super(e), this.state = {
|
|
@@ -468,25 +468,25 @@ var K = c, q = K.default, J = q && typeof q == "object" ? q : K, de = G(m, "UiLa
|
|
|
468
468
|
} }), this.callOnSessionChange);
|
|
469
469
|
};
|
|
470
470
|
render() {
|
|
471
|
-
let { model: e } = this.props, { showCorrect: t, session: n } = this.state, { correctness: r = {}, extraCSSRules: i, language: a } = e, o = r.correctness && r.correctness !== "correct", s = e.rationale && (u(e.rationale) ||
|
|
472
|
-
return /* @__PURE__ */
|
|
471
|
+
let { model: e } = this.props, { showCorrect: t, session: n } = this.state, { correctness: r = {}, extraCSSRules: i, language: a } = e, o = r.correctness && r.correctness !== "correct", s = e.rationale && (u(e.rationale) || m(e.rationale));
|
|
472
|
+
return /* @__PURE__ */ y(de, {
|
|
473
473
|
extraCSSRules: i,
|
|
474
474
|
children: [
|
|
475
|
-
e.teacherInstructions && (u(e.teacherInstructions) ||
|
|
475
|
+
e.teacherInstructions && (u(e.teacherInstructions) || m(e.teacherInstructions)) && /* @__PURE__ */ v(me, {
|
|
476
476
|
labels: {
|
|
477
477
|
hidden: Z.t("common:showTeacherInstructions", { lng: a }),
|
|
478
478
|
visible: Z.t("common:hideTeacherInstructions", { lng: a })
|
|
479
479
|
},
|
|
480
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ v(Y, { prompt: e.teacherInstructions })
|
|
481
481
|
}),
|
|
482
|
-
e.prompt && /* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
482
|
+
e.prompt && /* @__PURE__ */ v(pe, { children: /* @__PURE__ */ v(Y, { prompt: e.prompt }) }),
|
|
483
|
+
/* @__PURE__ */ v(I, {
|
|
484
484
|
language: a,
|
|
485
485
|
show: o,
|
|
486
486
|
toggled: t,
|
|
487
487
|
onToggle: this.toggleShowCorrect
|
|
488
488
|
}),
|
|
489
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ v(ue, {
|
|
490
490
|
showCorrect: t,
|
|
491
491
|
correctAnswers: e.correctResponse,
|
|
492
492
|
disabled: e.disabled,
|
|
@@ -497,14 +497,14 @@ var K = c, q = K.default, J = q && typeof q == "object" ? q : K, de = G(m, "UiLa
|
|
|
497
497
|
headers: e.headers,
|
|
498
498
|
rows: e.rows
|
|
499
499
|
}),
|
|
500
|
-
s && /* @__PURE__ */
|
|
500
|
+
s && /* @__PURE__ */ v(X, {
|
|
501
501
|
labels: {
|
|
502
502
|
hidden: Z.t("common:showRationale", { lng: a }),
|
|
503
503
|
visible: Z.t("common:hideRationale", { lng: a })
|
|
504
504
|
},
|
|
505
|
-
children: /* @__PURE__ */
|
|
505
|
+
children: /* @__PURE__ */ v(Y, { prompt: e.rationale })
|
|
506
506
|
}),
|
|
507
|
-
e.feedback && /* @__PURE__ */
|
|
507
|
+
e.feedback && /* @__PURE__ */ v(fe, {
|
|
508
508
|
correctness: r.correctness,
|
|
509
509
|
feedback: e.feedback
|
|
510
510
|
})
|
|
@@ -572,20 +572,23 @@ var he = class e extends CustomEvent {
|
|
|
572
572
|
}
|
|
573
573
|
_render() {
|
|
574
574
|
if (!this._model || !this._session) return;
|
|
575
|
-
let e =
|
|
575
|
+
let e = _.createElement(Q, {
|
|
576
576
|
model: this._model,
|
|
577
577
|
session: this._session,
|
|
578
578
|
onSessionChange: this.sessionChanged.bind(this)
|
|
579
579
|
});
|
|
580
|
-
this._root ||=
|
|
580
|
+
this._root ||= ie(this), this._root.render(e), queueMicrotask(() => {
|
|
581
581
|
t(this);
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
584
|
disconnectedCallback() {
|
|
585
585
|
this._root &&= (this._root.unmount(), null);
|
|
586
586
|
}
|
|
587
|
-
}
|
|
587
|
+
}, _e = Object.freeze({
|
|
588
|
+
name: "@pie-element/match",
|
|
589
|
+
version: "13.0.5"
|
|
590
|
+
});
|
|
588
591
|
//#endregion
|
|
589
|
-
export { Q as Component, ge as default, $ as isComplete };
|
|
592
|
+
export { Q as Component, ge as default, $ as isComplete, _e as piePackage };
|
|
590
593
|
|
|
591
594
|
//# sourceMappingURL=index.js.map
|