@pie-element/math-inline 12.1.1-next.21 → 12.1.1-next.22
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/author/general-config-block.js +71 -71
- package/dist/browser/delivery/index.js +66 -16
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/delivery/index.js +9 -10
- package/dist/delivery/main.js +125 -125
- package/dist/index.iife.js +44 -44
- package/dist/print/index.js +6 -6
- package/package.json +2 -2
package/dist/delivery/main.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { ResponseTypes as e } from "./utils.js";
|
|
2
2
|
import { SimpleQuestionBlock as t } from "./simple-question-block.js";
|
|
3
3
|
import n from "react";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import o from "@pie-lib/
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
4
|
+
import r from "prop-types";
|
|
5
|
+
import i from "@pie-lib/correct-answer-toggle";
|
|
6
|
+
import { HorizontalKeypad as a, applyStaticMath as o, mq as s, registerEmbed as c, updateSpans as l } from "@pie-lib/math-input";
|
|
7
|
+
import * as u from "@pie-lib/render-ui";
|
|
8
|
+
import { Collapsible as d, Feedback as f, PreviewPrompt as p, Readable as m, UiLayout as h, color as g, hasMedia as _, hasText as v } from "@pie-lib/render-ui";
|
|
9
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
10
|
+
import { renderMath as x } from "@pie-element/shared-math-rendering-mathjax";
|
|
11
|
+
import { styled as S } from "@mui/material/styles";
|
|
12
|
+
import C from "@mui/material/Tooltip";
|
|
13
|
+
import { isEmpty as ee, isEqual as w } from "@pie-element/shared-lodash";
|
|
14
|
+
import T from "@pie-lib/translator";
|
|
15
|
+
import E from "react-dom";
|
|
16
16
|
//#region src/delivery/main.tsx
|
|
17
|
-
function
|
|
17
|
+
function D(e) {
|
|
18
18
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return !e ||
|
|
20
|
+
function O(e, t) {
|
|
21
|
+
return !e || D(e) ? e : D(e.default) ? e.default : t && D(e[t]) ? e[t] : t && D(e[t]?.default) ? e[t].default : e;
|
|
22
22
|
}
|
|
23
|
-
var
|
|
24
|
-
function
|
|
23
|
+
var k = O(h, "UiLayout") || O(P.UiLayout, "UiLayout"), A = O(p, "PreviewPrompt") || O(P.PreviewPrompt, "PreviewPrompt"), te = O(m, "Readable") || O(P.Readable, "Readable"), j = O(d, "Collapsible") || O(P.Collapsible, "Collapsible"), ne = O(f, "Feedback") || O(P.Feedback, "Feedback"), M = u, N = M.default, P = N && typeof N == "object" ? N : M, { translator: F } = T, I = !1, L = /\\newline/g, R = /{{response}}/gm, re = 6, z = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
24
|
+
function ie(e = []) {
|
|
25
25
|
return e.map((e) => ({
|
|
26
26
|
name: e,
|
|
27
27
|
latex: e,
|
|
@@ -29,7 +29,7 @@ function re(e = []) {
|
|
|
29
29
|
label: e
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function B(e, t) {
|
|
33
33
|
let n = e;
|
|
34
34
|
for (; n !== null;) {
|
|
35
35
|
if (t && n === t) return !0;
|
|
@@ -37,44 +37,44 @@ function V(e, t) {
|
|
|
37
37
|
}
|
|
38
38
|
return !1;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ae(e = [], t) {
|
|
41
41
|
return Math.floor(e.length / 5) * 30 + (t === "miscellaneous" ? 600 : 500);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function oe(e, t) {
|
|
44
44
|
let { config: n, disabled: r } = e || {}, { expression: i, responses: a, printMode: o, alwaysShowCorrect: s } = n || {};
|
|
45
45
|
if (n && i) {
|
|
46
46
|
let e = i;
|
|
47
47
|
if (t.showCorrect) return a && a.length && a[0].answer;
|
|
48
48
|
let n = 1;
|
|
49
|
-
return (e || "").replace(
|
|
49
|
+
return (e || "").replace(R, function() {
|
|
50
50
|
let e = t.session.answers[`r${n}`];
|
|
51
51
|
if (o && !s) {
|
|
52
52
|
let e = "\\ \\ ".repeat(30) + "\\newline ";
|
|
53
53
|
return `\\MathQuillMathField[r${n++}]{${e.repeat(3)}}`;
|
|
54
54
|
}
|
|
55
55
|
return r ? `\\embed{answerBlock}[r${n++}]` : `\\MathQuillMathField[r${n++}]{${e && e.value || ""}}`;
|
|
56
|
-
}).replace(
|
|
56
|
+
}).replace(L, "\\embed{newLine}[]");
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function V(e, t) {
|
|
60
60
|
let n = {};
|
|
61
61
|
if (t.config && t.config.expression) {
|
|
62
62
|
let r = 1;
|
|
63
|
-
(t.config.expression || "").replace(
|
|
63
|
+
(t.config.expression || "").replace(R, () => {
|
|
64
64
|
n[`r${r}`] = { value: e && e.answers && e.answers[`r${r}`] && e.answers[`r${r}`].value || "" }, r += 1;
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
return n;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
69
|
+
var H = class extends n.Component {
|
|
70
70
|
static propTypes = {
|
|
71
|
-
session:
|
|
72
|
-
onSessionChange:
|
|
73
|
-
model:
|
|
71
|
+
session: r.object.isRequired,
|
|
72
|
+
onSessionChange: r.func,
|
|
73
|
+
model: r.object.isRequired
|
|
74
74
|
};
|
|
75
75
|
constructor(e) {
|
|
76
76
|
super(e);
|
|
77
|
-
let { model: t, session: r } = e, i =
|
|
77
|
+
let { model: t, session: r } = e, i = V(r, t);
|
|
78
78
|
this.state = {
|
|
79
79
|
session: {
|
|
80
80
|
...e.session,
|
|
@@ -86,8 +86,8 @@ var U = class extends n.Component {
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
UNSAFE_componentWillMount() {
|
|
89
|
-
typeof window < "u" && (
|
|
90
|
-
let t =
|
|
89
|
+
typeof window < "u" && (I ||= (c("answerBlock", (e) => {
|
|
90
|
+
let t = U();
|
|
91
91
|
return {
|
|
92
92
|
htmlString: `<div class="${t.blockContainer}">
|
|
93
93
|
<div class="${t.blockResponse}" id="${e}Index">R</div>
|
|
@@ -106,25 +106,25 @@ var U = class extends n.Component {
|
|
|
106
106
|
let n = this.root.querySelector(`#${t}`), i = this.root.querySelector(`#${t}Index`);
|
|
107
107
|
if (n) {
|
|
108
108
|
let a = r[t];
|
|
109
|
-
|
|
109
|
+
o(n, a && a.value || ""), e.view && (n.parentElement.parentElement.classList.remove("correct"), n.parentElement.parentElement.classList.remove("incorrect")), i.textContent = "R";
|
|
110
110
|
}
|
|
111
|
-
}),
|
|
111
|
+
}), x(this.root);
|
|
112
112
|
};
|
|
113
113
|
countResponseOccurrences(e) {
|
|
114
114
|
let t = e?.match(/\{\{response\}\}/g);
|
|
115
115
|
return t ? t.length : 0;
|
|
116
116
|
}
|
|
117
117
|
UNSAFE_componentWillReceiveProps(e) {
|
|
118
|
-
let { config: t } = this.props.model, { config: n = {} } = e.model || {}, { session: r } = this.props, { session:
|
|
119
|
-
if (r &&
|
|
120
|
-
...
|
|
121
|
-
answers:
|
|
122
|
-
} }), t.note && t.language && t.language !== n.language && t.note ===
|
|
118
|
+
let { config: t } = this.props.model, { config: n = {} } = e.model || {}, { session: r } = this.props, { session: i = {} } = e || {};
|
|
119
|
+
if (r && i && !w(r.answers, i.answers) && this.setState({ session: {
|
|
120
|
+
...i,
|
|
121
|
+
answers: V(i, this.props.model)
|
|
122
|
+
} }), t.note && t.language && t.language !== n.language && t.note === F.t("mathInline.primaryCorrectWithAlternates", { lng: t.language }) && (t.note = F.t("mathInline.primaryCorrectWithAlternates", { lng: n.language })), (t.env && t.env.mode !== "evaluate" || n.env && n.env.mode !== "evaluate") && this.setState({
|
|
123
123
|
...this.state.session,
|
|
124
124
|
showCorrect: !1
|
|
125
125
|
}), n.alwaysShowCorrect && this.setState({ showCorrect: !0 }), this.countResponseOccurrences(t.expression) < this.countResponseOccurrences(n.expression) && setTimeout(() => this.updateAria(), 100), t && t.responses && t.responses.length !== n.responses.length || !t && n && n.responses || t && n && t.expression !== n.expression) {
|
|
126
126
|
let e = {}, t = this.state.session.answers, r = 1;
|
|
127
|
-
(n.expression || "").replace(
|
|
127
|
+
(n.expression || "").replace(R, () => {
|
|
128
128
|
e[`r${r}`] = { value: t && t[`r${r}`] && t[`r${r}`].value || "" }, r++;
|
|
129
129
|
}), this.setState((t) => ({ session: {
|
|
130
130
|
...t.session,
|
|
@@ -134,11 +134,11 @@ var U = class extends n.Component {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
shouldComponentUpdate(e, t) {
|
|
137
|
-
let n =
|
|
137
|
+
let n = w(this.props.model, e.model), r = w(this.state, t);
|
|
138
138
|
return !n || !r;
|
|
139
139
|
}
|
|
140
140
|
componentDidMount() {
|
|
141
|
-
this.handleAnswerBlockDomUpdate(), this.updateAria(), setTimeout(() =>
|
|
141
|
+
this.handleAnswerBlockDomUpdate(), this.updateAria(), setTimeout(() => x(this.root), 100);
|
|
142
142
|
}
|
|
143
143
|
componentDidUpdate(e, t) {
|
|
144
144
|
this.handleAnswerBlockDomUpdate(), e.model?.config?.responseType !== this.props.model?.config?.responseType && this.updateAria();
|
|
@@ -163,7 +163,7 @@ var U = class extends n.Component {
|
|
|
163
163
|
}, 0);
|
|
164
164
|
};
|
|
165
165
|
handleKeyDown = (e, t) => {
|
|
166
|
-
let n =
|
|
166
|
+
let n = B(e.target, this.root), r = this.mqStatic && this.mqStatic.inputRef?.current ? this.mqStatic.inputRef?.current.contains(document.activeElement) : document.activeElement?.getAttribute("aria-label") === "Enter answer.", { key: i, type: a } = e;
|
|
167
167
|
r && (i === "ArrowDown" || a === "click" || a === "touchstart") ? this.state.activeAnswerBlock !== t && n && (this.cleanupKeyDownListener(), this.setState({ activeAnswerBlock: t }, () => {
|
|
168
168
|
this.onSubFieldFocus(t), i === "ArrowDown" && this.focusFirstKeypadElement();
|
|
169
169
|
})) : e.key === "Escape" && this.setState({ activeAnswerBlock: "" });
|
|
@@ -216,7 +216,7 @@ var U = class extends n.Component {
|
|
|
216
216
|
this.setState({ showCorrect: e }, this.handleAnswerBlockDomUpdate);
|
|
217
217
|
};
|
|
218
218
|
subFieldChanged = (e, t) => {
|
|
219
|
-
if (
|
|
219
|
+
if (l(), e) {
|
|
220
220
|
let n = window.scrollX, r = window.scrollY;
|
|
221
221
|
this.setState((n) => ({ session: {
|
|
222
222
|
...n.session,
|
|
@@ -256,60 +256,60 @@ var U = class extends n.Component {
|
|
|
256
256
|
};
|
|
257
257
|
setTooltipRef(e) {
|
|
258
258
|
setTimeout(() => {
|
|
259
|
-
if (e &&
|
|
259
|
+
if (e && z) {
|
|
260
260
|
let e = document.querySelector("[role='tooltip']");
|
|
261
261
|
e && e.firstChild.setAttribute("tabindex", "-1");
|
|
262
262
|
}
|
|
263
263
|
}, 1);
|
|
264
264
|
}
|
|
265
265
|
render() {
|
|
266
|
-
let { model: n } = this.props, { activeAnswerBlock:
|
|
267
|
-
if (!
|
|
268
|
-
let { showNote:
|
|
266
|
+
let { model: n } = this.props, { activeAnswerBlock: r, showCorrect: i, session: o, tooltipContainerRef: c } = this.state, { config: l, correctness: u, disabled: d, extraCSSRules: f, view: p, teacherInstructions: m, rationale: h, feedback: x, animationsDisabled: S, printMode: w, alwaysShowCorrect: T, language: D } = n || {};
|
|
267
|
+
if (!l) return null;
|
|
268
|
+
let { showNote: O, note: k, prompt: M, responses: N, responseType: P, equationEditor: I, customKeys: L, id: R, env: { mode: z, role: B } = {} } = l || {}, V = (i || z === "view" && B === "instructor") && O && k, H = ee(N), U = !H && u && u.correctness !== "correct", ge = d && u, q = ie(L), J = u && u.correct, Y = oe(n, this.state) || "", X = d && !u, _e = w && !T, Z = h && (v(h) || _(h)), Q = m && (v(m) || _(m)), ve = /* @__PURE__ */ y(pe, { children: /* @__PURE__ */ y(s.Static, {
|
|
269
269
|
className: "static-math",
|
|
270
270
|
ref: (e) => {
|
|
271
271
|
e && (this.mqStatic = e);
|
|
272
272
|
},
|
|
273
|
-
latex:
|
|
273
|
+
latex: Y,
|
|
274
274
|
onSubFieldChange: this.subFieldChanged,
|
|
275
275
|
getFieldName: this.getFieldName,
|
|
276
276
|
setInput: this.setInput,
|
|
277
277
|
onSubFieldFocus: this.onSubFieldFocus,
|
|
278
278
|
onBlur: this.onBlur
|
|
279
|
-
}) }),
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
}) }), $ = /* @__PURE__ */ b(G, { children: [
|
|
280
|
+
z === "gather" && /* @__PURE__ */ y(me, { children: "Math Equation Response Question" }),
|
|
281
|
+
X && Q && (S ? /* @__PURE__ */ y("div", { dangerouslySetInnerHTML: { __html: m } }) : /* @__PURE__ */ y(K, {
|
|
282
282
|
labels: {
|
|
283
283
|
hidden: "Show Teacher Instructions",
|
|
284
284
|
visible: "Hide Teacher Instructions"
|
|
285
285
|
},
|
|
286
|
-
children: /* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ y("div", { dangerouslySetInnerHTML: { __html: m } })
|
|
287
287
|
})),
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
M && /* @__PURE__ */ y(ce, { children: /* @__PURE__ */ y(A, { prompt: M }) }),
|
|
289
|
+
_e ? ve : /* @__PURE__ */ y(te, {
|
|
290
290
|
false: !0,
|
|
291
|
-
children: /* @__PURE__ */
|
|
291
|
+
children: /* @__PURE__ */ b(fe, {
|
|
292
292
|
tabIndex: 0,
|
|
293
|
-
children: [
|
|
293
|
+
children: [P === e.simple && /* @__PURE__ */ y(t, {
|
|
294
294
|
onSimpleResponseChange: this.onSimpleResponseChange,
|
|
295
|
-
showCorrect:
|
|
296
|
-
emptyResponse:
|
|
295
|
+
showCorrect: i,
|
|
296
|
+
emptyResponse: H,
|
|
297
297
|
model: n,
|
|
298
298
|
session: o,
|
|
299
299
|
onSubFieldFocus: this.onSubFieldFocus,
|
|
300
|
-
showKeypad: !!
|
|
301
|
-
}),
|
|
300
|
+
showKeypad: !!r
|
|
301
|
+
}), P === e.advanced && /* @__PURE__ */ y(de, {
|
|
302
302
|
ref: c,
|
|
303
|
-
isIncorrect: !
|
|
304
|
-
isCorrect: !
|
|
305
|
-
showCorrectness: !
|
|
306
|
-
correctAnswerShown:
|
|
307
|
-
printCorrect: w &&
|
|
308
|
-
children: /* @__PURE__ */
|
|
303
|
+
isIncorrect: !H && !J && !i,
|
|
304
|
+
isCorrect: !H && (J || i),
|
|
305
|
+
showCorrectness: !H && d && u && !p,
|
|
306
|
+
correctAnswerShown: i,
|
|
307
|
+
printCorrect: w && T,
|
|
308
|
+
children: /* @__PURE__ */ y(C, {
|
|
309
309
|
ref: (e) => this.setTooltipRef(e),
|
|
310
310
|
enterTouchDelay: 0,
|
|
311
311
|
interactive: !0,
|
|
312
|
-
open: !!
|
|
312
|
+
open: !!r,
|
|
313
313
|
slotProps: {
|
|
314
314
|
popper: {
|
|
315
315
|
container: c?.current || void 0,
|
|
@@ -355,21 +355,21 @@ var U = class extends n.Component {
|
|
|
355
355
|
boxShadow: "none"
|
|
356
356
|
} }
|
|
357
357
|
},
|
|
358
|
-
title: Object.keys(o.answers).map((e) => e ===
|
|
358
|
+
title: Object.keys(o.answers).map((e) => e === r && !(i || d) && /* @__PURE__ */ y(ue, {
|
|
359
359
|
"data-keypad": !0,
|
|
360
|
-
style: { width:
|
|
361
|
-
children: /* @__PURE__ */
|
|
362
|
-
additionalKeys:
|
|
363
|
-
mode:
|
|
360
|
+
style: { width: ae(q, I) },
|
|
361
|
+
children: /* @__PURE__ */ y(a, {
|
|
362
|
+
additionalKeys: q,
|
|
363
|
+
mode: I || re,
|
|
364
364
|
onClick: this.onClick
|
|
365
365
|
})
|
|
366
366
|
}, e) || null),
|
|
367
|
-
children: /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ y("div", { children: /* @__PURE__ */ y(s.Static, {
|
|
368
368
|
className: "static-math",
|
|
369
369
|
ref: (e) => {
|
|
370
370
|
e && (this.mqStatic = e);
|
|
371
371
|
},
|
|
372
|
-
latex:
|
|
372
|
+
latex: Y,
|
|
373
373
|
onSubFieldChange: this.subFieldChanged,
|
|
374
374
|
getFieldName: this.getFieldName,
|
|
375
375
|
setInput: this.setInput,
|
|
@@ -380,31 +380,31 @@ var U = class extends n.Component {
|
|
|
380
380
|
})]
|
|
381
381
|
})
|
|
382
382
|
}),
|
|
383
|
-
|
|
384
|
-
|
|
383
|
+
X && V && /* @__PURE__ */ y(le, { dangerouslySetInnerHTML: { __html: `<strong>Note:</strong> ${k}` } }),
|
|
384
|
+
X && Z && (S ? /* @__PURE__ */ y("div", { dangerouslySetInnerHTML: { __html: h } }) : /* @__PURE__ */ y(j, {
|
|
385
385
|
labels: {
|
|
386
386
|
hidden: "Show Rationale",
|
|
387
387
|
visible: "Hide Rationale"
|
|
388
388
|
},
|
|
389
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ y("div", { dangerouslySetInnerHTML: { __html: h } })
|
|
390
390
|
}))
|
|
391
391
|
] });
|
|
392
|
-
return
|
|
393
|
-
extraCSSRules:
|
|
392
|
+
return ge && (U || Q || Z || x) ? /* @__PURE__ */ y(W, {
|
|
393
|
+
extraCSSRules: f,
|
|
394
394
|
ref: (e) => {
|
|
395
|
-
let t =
|
|
395
|
+
let t = E.findDOMNode(e);
|
|
396
396
|
this.root = t || this.root;
|
|
397
397
|
},
|
|
398
|
-
children: /* @__PURE__ */
|
|
398
|
+
children: /* @__PURE__ */ y(se, {
|
|
399
399
|
interactive: !0,
|
|
400
400
|
enterTouchDelay: 0,
|
|
401
401
|
placement: "bottom-start",
|
|
402
402
|
slotProps: {
|
|
403
403
|
tooltip: { sx: (e) => ({
|
|
404
|
-
background: `${
|
|
405
|
-
color:
|
|
404
|
+
background: `${g.primaryLight()} !important`,
|
|
405
|
+
color: g.text(),
|
|
406
406
|
padding: e.spacing(2),
|
|
407
|
-
border: `1px solid ${
|
|
407
|
+
border: `1px solid ${g.secondary()}`,
|
|
408
408
|
fontSize: "16px",
|
|
409
409
|
"& :not(.MathJax) > table tr": { "&:nth-child(2n)": { backgroundColor: "unset !important" } }
|
|
410
410
|
}) },
|
|
@@ -416,52 +416,52 @@ var U = class extends n.Component {
|
|
|
416
416
|
}]
|
|
417
417
|
}
|
|
418
418
|
},
|
|
419
|
-
title: /* @__PURE__ */
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
language:
|
|
419
|
+
title: /* @__PURE__ */ b("div", { children: [
|
|
420
|
+
/* @__PURE__ */ y(G, { children: U && /* @__PURE__ */ y(he, {
|
|
421
|
+
language: D,
|
|
422
422
|
show: !0,
|
|
423
|
-
toggled:
|
|
423
|
+
toggled: i,
|
|
424
424
|
onToggle: this.toggleShowCorrect
|
|
425
425
|
}) }),
|
|
426
|
-
|
|
426
|
+
Q && /* @__PURE__ */ y(K, {
|
|
427
427
|
labels: {
|
|
428
428
|
hidden: "Show Teacher Instructions",
|
|
429
429
|
visible: "Hide Teacher Instructions"
|
|
430
430
|
},
|
|
431
|
-
children: /* @__PURE__ */
|
|
431
|
+
children: /* @__PURE__ */ y(A, { prompt: m })
|
|
432
432
|
}, "collapsible-teacher-instructions"),
|
|
433
|
-
|
|
433
|
+
V && v(k) && /* @__PURE__ */ y(K, {
|
|
434
434
|
labels: {
|
|
435
|
-
hidden:
|
|
436
|
-
visible:
|
|
435
|
+
hidden: F.t("common:showNote", { lng: D }),
|
|
436
|
+
visible: F.t("common:hideNote", { lng: D })
|
|
437
437
|
},
|
|
438
|
-
children: /* @__PURE__ */
|
|
438
|
+
children: /* @__PURE__ */ y(A, { prompt: k })
|
|
439
439
|
}, "collapsible-note"),
|
|
440
|
-
|
|
440
|
+
Z && /* @__PURE__ */ y(K, {
|
|
441
441
|
labels: {
|
|
442
442
|
hidden: "Show Rationale",
|
|
443
443
|
visible: "Hide Rationale"
|
|
444
444
|
},
|
|
445
|
-
children: /* @__PURE__ */
|
|
445
|
+
children: /* @__PURE__ */ y(A, { prompt: h })
|
|
446
446
|
}, "collapsible-rationale"),
|
|
447
|
-
|
|
448
|
-
correctness:
|
|
449
|
-
feedback:
|
|
447
|
+
x && /* @__PURE__ */ y(ne, {
|
|
448
|
+
correctness: u.correctness,
|
|
449
|
+
feedback: x
|
|
450
450
|
})
|
|
451
451
|
] }),
|
|
452
|
-
children:
|
|
452
|
+
children: $
|
|
453
453
|
})
|
|
454
|
-
}) : /* @__PURE__ */
|
|
455
|
-
id:
|
|
456
|
-
extraCSSRules:
|
|
454
|
+
}) : /* @__PURE__ */ y(W, {
|
|
455
|
+
id: R,
|
|
456
|
+
extraCSSRules: f,
|
|
457
457
|
ref: (e) => {
|
|
458
|
-
let t =
|
|
458
|
+
let t = E.findDOMNode(e);
|
|
459
459
|
this.root = t || this.root;
|
|
460
460
|
},
|
|
461
|
-
children:
|
|
461
|
+
children: $
|
|
462
462
|
});
|
|
463
463
|
}
|
|
464
|
-
},
|
|
464
|
+
}, U = () => ({
|
|
465
465
|
blockContainer: "block-container",
|
|
466
466
|
blockResponse: "block-response",
|
|
467
467
|
blockMath: "block-math"
|
|
@@ -490,8 +490,8 @@ if (typeof document < "u") {
|
|
|
490
490
|
flex-basis: auto;
|
|
491
491
|
}
|
|
492
492
|
.block-math {
|
|
493
|
-
color: ${
|
|
494
|
-
background-color: ${
|
|
493
|
+
color: ${g.text()};
|
|
494
|
+
background-color: ${g.background()};
|
|
495
495
|
padding: 4px !important;
|
|
496
496
|
display: flex;
|
|
497
497
|
align-items: center;
|
|
@@ -510,32 +510,32 @@ if (typeof document < "u") {
|
|
|
510
510
|
overflow: hidden;
|
|
511
511
|
}
|
|
512
512
|
.static-math > .mq-root-block > .mq-editable-field {
|
|
513
|
-
border-color: ${
|
|
513
|
+
border-color: ${g.text()};
|
|
514
514
|
}
|
|
515
515
|
`, document.head.appendChild(t);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
var
|
|
519
|
-
color:
|
|
520
|
-
backgroundColor:
|
|
518
|
+
var W = S(k)(() => ({
|
|
519
|
+
color: g.text(),
|
|
520
|
+
backgroundColor: g.background(),
|
|
521
521
|
display: "inline-block"
|
|
522
|
-
})),
|
|
522
|
+
})), se = S(C)({}), ce = S("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), G = S("div")({
|
|
523
523
|
width: "100%",
|
|
524
524
|
position: "relative",
|
|
525
|
-
backgroundColor:
|
|
526
|
-
color:
|
|
527
|
-
}),
|
|
525
|
+
backgroundColor: g.background(),
|
|
526
|
+
color: g.text()
|
|
527
|
+
}), le = S("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), K = S(j)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), ue = S("div")(({ theme: e }) => ({
|
|
528
528
|
zIndex: 10,
|
|
529
529
|
minWidth: "400px",
|
|
530
530
|
marginTop: e.spacing(2)
|
|
531
|
-
})),
|
|
531
|
+
})), de = S("div", { shouldForwardProp: (e) => ![
|
|
532
532
|
"isIncorrect",
|
|
533
533
|
"isCorrect",
|
|
534
534
|
"showCorrectness",
|
|
535
535
|
"correctAnswerShown",
|
|
536
536
|
"printCorrect"
|
|
537
537
|
].includes(e) })(({ theme: e, isIncorrect: t, isCorrect: n, showCorrectness: r, correctAnswerShown: i, printCorrect: a }) => {
|
|
538
|
-
let o = t ?
|
|
538
|
+
let o = t ? g.incorrect() : n ? g.correct() : void 0;
|
|
539
539
|
return {
|
|
540
540
|
maxWidth: "fit-content",
|
|
541
541
|
padding: e.spacing(.25),
|
|
@@ -545,7 +545,7 @@ var G = w(A)(() => ({
|
|
|
545
545
|
padding: e.spacing(1),
|
|
546
546
|
letterSpacing: "0.5px"
|
|
547
547
|
},
|
|
548
|
-
...a && { border: `2px solid ${
|
|
548
|
+
...a && { border: `2px solid ${g.correct()} !important` },
|
|
549
549
|
"& .mq-math-mode": {
|
|
550
550
|
"& .mq-root-block": {
|
|
551
551
|
paddingRight: "0 !important",
|
|
@@ -558,7 +558,7 @@ var G = w(A)(() => ({
|
|
|
558
558
|
"& sup": { top: 0 }
|
|
559
559
|
}
|
|
560
560
|
};
|
|
561
|
-
}),
|
|
561
|
+
}), fe = S("div")({
|
|
562
562
|
position: "relative",
|
|
563
563
|
"& .mq-overarrow-inner": {
|
|
564
564
|
border: "none !important",
|
|
@@ -588,19 +588,19 @@ var G = w(A)(() => ({
|
|
|
588
588
|
paddingTop: "1.5px !important"
|
|
589
589
|
},
|
|
590
590
|
"& .mq-parallelogram": { lineHeight: .85 }
|
|
591
|
-
}),
|
|
591
|
+
}), pe = S("div")(({ theme: e }) => ({
|
|
592
592
|
marginBottom: e.spacing(1),
|
|
593
593
|
pointerEvents: "none"
|
|
594
|
-
})),
|
|
594
|
+
})), me = S("h2")({
|
|
595
595
|
position: "absolute",
|
|
596
596
|
left: "-10000px",
|
|
597
597
|
top: "auto",
|
|
598
598
|
width: "1px",
|
|
599
599
|
height: "1px",
|
|
600
600
|
overflow: "hidden"
|
|
601
|
-
}),
|
|
602
|
-
color:
|
|
601
|
+
}), he = S(i)(({ theme: e }) => ({
|
|
602
|
+
color: g.text(),
|
|
603
603
|
marginBottom: e.spacing(2)
|
|
604
604
|
}));
|
|
605
605
|
//#endregion
|
|
606
|
-
export {
|
|
606
|
+
export { H as Main, H as default };
|