@pie-element/math-inline 12.1.1-next.0 → 12.1.1-next.12

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.
@@ -1,11 +1,11 @@
1
1
  import { a as e, t, y as n } from "./dist-BJ5Sm1Fi.js";
2
- import { C as r, L as i, M as a, Ot as o, R as s, S as c, T as l, _ as u, dt as d, f, ft as p, h as ee, m, mt as h, n as g, p as _, u as te, ut as v, v as y, w as b } from "./dist-DguK2kIS.js";
2
+ import { C as r, L as i, M as a, Ot as o, S as s, T as c, _ as l, dt as u, f as d, ft as f, h as ee, m as p, mt as m, n as h, p as g, u as te, ut as _, v, w as y, z as b } from "./dist-OamHPwLm.js";
3
3
  import { t as x } from "./dist-D9ARZhQk.js";
4
4
  import S, { useRef as C } from "react";
5
5
  import { jsx as w, jsxs as T } from "react/jsx-runtime";
6
6
  import ne from "react-dom";
7
7
  //#region ../../lib-react/correct-answer-toggle/dist/expander.js
8
- var E = /* @__PURE__ */ n(o(), 1), D = "height ease-in 300ms, opacity ease-in 300ms", O = h("div")(() => ({
8
+ var E = /* @__PURE__ */ n(o(), 1), D = "height ease-in 300ms, opacity ease-in 300ms", O = m("div")(() => ({
9
9
  position: "relative",
10
10
  height: 0,
11
11
  overflow: "hidden",
@@ -41,7 +41,7 @@ var E = /* @__PURE__ */ n(o(), 1), D = "height ease-in 300ms, opacity ease-in 30
41
41
  }
42
42
  })), k = (e) => {
43
43
  let { show: t, children: n, className: r } = e, i = C(null);
44
- return /* @__PURE__ */ w(p, {
44
+ return /* @__PURE__ */ w(f, {
45
45
  nodeRef: i,
46
46
  in: t,
47
47
  appear: !0,
@@ -138,7 +138,7 @@ j.propTypes = {
138
138
  fgFill: E.default.string.isRequired,
139
139
  borderFill: E.default.string.isRequired
140
140
  };
141
- var M = h("div")(({ size: e }) => ({
141
+ var M = m("div")(({ size: e }) => ({
142
142
  width: e || "25px",
143
143
  height: e || "25px"
144
144
  })), N = ({ open: e, size: t }) => /* @__PURE__ */ w(M, {
@@ -164,29 +164,29 @@ function P(e) {
164
164
  function F(e, t) {
165
165
  return !e || P(e) ? e : P(e.default) ? e.default : t && P(e[t]) ? e[t] : t && P(e[t]?.default) ? e[t].default : e;
166
166
  }
167
- var I = F(b, "Readable") || F(z.Readable, "Readable"), L = y, R = L.default, z = R && typeof R == "object" ? R : L, { translator: B } = x, V = {
167
+ var I = F(y, "Readable") || F(z.Readable, "Readable"), L = v, R = L.default, z = R && typeof R == "object" ? R : L, { translator: B } = x, V = {
168
168
  WebkitTouchCallout: "none",
169
169
  WebkitUserSelect: "none",
170
170
  KhtmlUserSelect: "none",
171
171
  MozUserSelect: "none",
172
172
  msUserSelect: "none",
173
173
  userSelect: "none"
174
- }, re = h("div")(() => ({
174
+ }, re = m("div")(() => ({
175
175
  width: "100%",
176
176
  cursor: "pointer"
177
- })), H = h("div")(() => ({
177
+ })), H = m("div")(() => ({
178
178
  margin: "0 auto",
179
179
  textAlign: "center",
180
180
  display: "flex"
181
- })), U = h("div")(() => ({
181
+ })), U = m("div")(() => ({
182
182
  width: "fit-content",
183
183
  minWidth: "140px",
184
184
  alignSelf: "center",
185
185
  verticalAlign: "middle",
186
- color: `var(--correct-answer-toggle-label-color, ${d.text()})`,
186
+ color: `var(--correct-answer-toggle-label-color, ${u.text()})`,
187
187
  fontWeight: "normal",
188
188
  ...V
189
- })), W = h("div")(() => ({
189
+ })), W = m("div")(() => ({
190
190
  position: "absolute",
191
191
  width: "25px",
192
192
  "&.enter": { opacity: "0" },
@@ -199,7 +199,7 @@ var I = F(b, "Readable") || F(z.Readable, "Readable"), L = y, R = L.default, z =
199
199
  opacity: "0",
200
200
  transition: "opacity 0.3s ease-in"
201
201
  }
202
- })), G = h("div")(() => ({
202
+ })), G = m("div")(() => ({
203
203
  width: "25px",
204
204
  marginRight: "5px",
205
205
  display: "flex",
@@ -249,7 +249,7 @@ var I = F(b, "Readable") || F(z.Readable, "Readable"), L = y, R = L.default, z =
249
249
  children: /* @__PURE__ */ T(H, {
250
250
  onClick: this.onClick.bind(this),
251
251
  onTouchEnd: this.onTouch.bind(this),
252
- children: [/* @__PURE__ */ T(G, { children: [/* @__PURE__ */ w(p, {
252
+ children: [/* @__PURE__ */ T(G, { children: [/* @__PURE__ */ w(f, {
253
253
  nodeRef: this.openIconRef,
254
254
  timeout: 400,
255
255
  in: t,
@@ -264,7 +264,7 @@ var I = F(b, "Readable") || F(z.Readable, "Readable"), L = y, R = L.default, z =
264
264
  ref: this.openIconRef,
265
265
  children: /* @__PURE__ */ w(N, { open: t }, "correct-open")
266
266
  })
267
- }), /* @__PURE__ */ w(p, {
267
+ }), /* @__PURE__ */ w(f, {
268
268
  nodeRef: this.closedIconRef,
269
269
  timeout: 5e3,
270
270
  in: !t,
@@ -293,14 +293,14 @@ var I = F(b, "Readable") || F(z.Readable, "Readable"), L = y, R = L.default, z =
293
293
  }, ae = {
294
294
  advanced: "Advanced Multi",
295
295
  simple: "Simple"
296
- }, oe = h("div")(({ theme: e }) => ({
296
+ }, oe = m("div")(({ theme: e }) => ({
297
297
  marginTop: e.spacing(2),
298
298
  marginBottom: e.spacing(2),
299
299
  padding: e.spacing(1)
300
- })), se = h("div", { shouldForwardProp: (e) => !["isCorrect", "isIncorrect"].includes(e) })(({ theme: e, isCorrect: t, isIncorrect: n }) => ({
301
- color: d.text(),
302
- background: d.background(),
303
- border: t ? `2px solid ${d.correct()} !important` : n ? `2px solid ${d.incorrect()} !important` : `1px solid ${d.primaryLight()}`,
300
+ })), se = m("div", { shouldForwardProp: (e) => !["isCorrect", "isIncorrect"].includes(e) })(({ theme: e, isCorrect: t, isIncorrect: n }) => ({
301
+ color: u.text(),
302
+ background: u.background(),
303
+ border: t ? `2px solid ${u.correct()} !important` : n ? `2px solid ${u.incorrect()} !important` : `1px solid ${u.primaryLight()}`,
304
304
  width: "fit-content",
305
305
  fontSize: "1rem",
306
306
  padding: t || n ? e.spacing(1) : e.spacing(.5),
@@ -322,7 +322,7 @@ if (typeof document < "u") {
322
322
  padding: 8px;
323
323
  }
324
324
  .response-editor.mq-math-mode {
325
- border: 1px solid ${d.primaryLight()};
325
+ border: 1px solid ${u.primaryLight()};
326
326
  }
327
327
  `, document.head.appendChild(t);
328
328
  }
@@ -359,10 +359,10 @@ var ce = class extends S.Component {
359
359
  children: t || s ? /* @__PURE__ */ w(se, {
360
360
  isIncorrect: !r && !l && !t,
361
361
  isCorrect: !r && (l || t),
362
- children: /* @__PURE__ */ w(m.Static, { latex: t ? u && u.length && u[0].answer : n.response || "" })
362
+ children: /* @__PURE__ */ w(p.Static, { latex: t ? u && u.length && u[0].answer : n.response || "" })
363
363
  }) : /* @__PURE__ */ w("div", {
364
364
  id: this.mathToolBarId,
365
- children: /* @__PURE__ */ w(g, {
365
+ children: /* @__PURE__ */ w(h, {
366
366
  classNames: { editor: "response-editor" },
367
367
  latex: n.response,
368
368
  keypadMode: d,
@@ -385,7 +385,7 @@ function K(e) {
385
385
  function q(e, t) {
386
386
  return !e || K(e) ? e : K(e.default) ? e.default : t && K(e[t]) ? e[t] : t && K(e[t]?.default) ? e[t].default : e;
387
387
  }
388
- var le = q(a, "UiLayout") || q(X.UiLayout, "UiLayout"), J = q(l, "PreviewPrompt") || q(X.PreviewPrompt, "PreviewPrompt"), ue = q(b, "Readable") || q(X.Readable, "Readable"), de = q(i, "Collapsible") || q(X.Collapsible, "Collapsible"), fe = q(v, "Feedback") || q(X.Feedback, "Feedback"), pe = y, Y = pe.default, X = Y && typeof Y == "object" ? Y : pe, { translator: Z } = x, me = !1, he = /\\newline/g, Q = /{{response}}/gm, ge = 6, _e = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
388
+ var le = q(a, "UiLayout") || q(X.UiLayout, "UiLayout"), J = q(c, "PreviewPrompt") || q(X.PreviewPrompt, "PreviewPrompt"), ue = q(y, "Readable") || q(X.Readable, "Readable"), de = q(i, "Collapsible") || q(X.Collapsible, "Collapsible"), fe = q(_, "Feedback") || q(X.Feedback, "Feedback"), pe = v, Y = pe.default, X = Y && typeof Y == "object" ? Y : pe, { translator: Z } = x, me = !1, he = /\\newline/g, Q = /{{response}}/gm, ge = 6, _e = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
389
389
  function ve(e = []) {
390
390
  return e.map((e) => ({
391
391
  name: e,
@@ -451,7 +451,7 @@ var Ce = class extends S.Component {
451
451
  };
452
452
  }
453
453
  UNSAFE_componentWillMount() {
454
- typeof window < "u" && (me ||= (_("answerBlock", (e) => {
454
+ typeof window < "u" && (me ||= (g("answerBlock", (e) => {
455
455
  let t = we();
456
456
  return {
457
457
  htmlString: `<div class="${t.blockContainer}">
@@ -471,9 +471,9 @@ var Ce = class extends S.Component {
471
471
  let n = this.root.querySelector(`#${t}`), i = this.root.querySelector(`#${t}Index`);
472
472
  if (n) {
473
473
  let a = r[t];
474
- f(n, a && a.value || ""), e.view && (n.parentElement.parentElement.classList.remove("correct"), n.parentElement.parentElement.classList.remove("incorrect")), i.textContent = "R";
474
+ d(n, a && a.value || ""), e.view && (n.parentElement.parentElement.classList.remove("correct"), n.parentElement.parentElement.classList.remove("incorrect")), i.textContent = "R";
475
475
  }
476
- }), s(this.root);
476
+ }), b(this.root);
477
477
  };
478
478
  countResponseOccurrences(e) {
479
479
  let t = e?.match(/\{\{response\}\}/g);
@@ -503,7 +503,7 @@ var Ce = class extends S.Component {
503
503
  return !r || !i;
504
504
  }
505
505
  componentDidMount() {
506
- this.handleAnswerBlockDomUpdate(), this.updateAria(), setTimeout(() => s(this.root), 100);
506
+ this.handleAnswerBlockDomUpdate(), this.updateAria(), setTimeout(() => b(this.root), 100);
507
507
  }
508
508
  componentDidUpdate(e, t) {
509
509
  this.handleAnswerBlockDomUpdate(), e.model?.config?.responseType !== this.props.model?.config?.responseType && this.updateAria();
@@ -581,7 +581,7 @@ var Ce = class extends S.Component {
581
581
  this.setState({ showCorrect: e }, this.handleAnswerBlockDomUpdate);
582
582
  };
583
583
  subFieldChanged = (e, t) => {
584
- if (u(), e) {
584
+ if (l(), e) {
585
585
  let n = window.scrollX, r = window.scrollY;
586
586
  this.setState((n) => ({ session: {
587
587
  ...n.session,
@@ -628,9 +628,9 @@ var Ce = class extends S.Component {
628
628
  }, 1);
629
629
  }
630
630
  render() {
631
- let { model: t } = this.props, { activeAnswerBlock: n, showCorrect: i, session: a, tooltipContainerRef: o } = this.state, { config: s, correctness: l, disabled: u, extraCSSRules: f, view: p, teacherInstructions: h, rationale: g, feedback: _, animationsDisabled: v, printMode: y, alwaysShowCorrect: b, language: x } = t || {};
632
- if (!s) return null;
633
- let { showNote: S, note: C, prompt: E, responses: D, responseType: O, equationEditor: k, customKeys: A, id: j, env: { mode: M, role: N } = {} } = s || {}, P = (i || M === "view" && N === "instructor") && S && C, F = e(D), I = !F && l && l.correctness !== "correct", L = u && l, R = ve(A), z = l && l.correct, B = xe(t, this.state) || "", V = u && !l, re = y && !b, H = g && (r(g) || c(g)), U = h && (r(h) || c(h)), W = /* @__PURE__ */ w(Ne, { children: /* @__PURE__ */ w(m.Static, {
631
+ let { model: t } = this.props, { activeAnswerBlock: n, showCorrect: i, session: a, tooltipContainerRef: o } = this.state, { config: c, correctness: l, disabled: d, extraCSSRules: f, view: m, teacherInstructions: h, rationale: g, feedback: _, animationsDisabled: v, printMode: y, alwaysShowCorrect: b, language: x } = t || {};
632
+ if (!c) return null;
633
+ let { showNote: S, note: C, prompt: E, responses: D, responseType: O, equationEditor: k, customKeys: A, id: j, env: { mode: M, role: N } = {} } = c || {}, P = (i || M === "view" && N === "instructor") && S && C, F = e(D), I = !F && l && l.correctness !== "correct", L = d && l, R = ve(A), z = l && l.correct, B = xe(t, this.state) || "", V = d && !l, re = y && !b, H = g && (r(g) || s(g)), U = h && (r(h) || s(h)), W = /* @__PURE__ */ w(Ne, { children: /* @__PURE__ */ w(p.Static, {
634
634
  className: "static-math",
635
635
  ref: (e) => {
636
636
  e && (this.mqStatic = e);
@@ -667,7 +667,7 @@ var Ce = class extends S.Component {
667
667
  ref: o,
668
668
  isIncorrect: !F && !z && !i,
669
669
  isCorrect: !F && (z || i),
670
- showCorrectness: !F && u && l && !p,
670
+ showCorrectness: !F && d && l && !m,
671
671
  correctAnswerShown: i,
672
672
  printCorrect: y && b,
673
673
  children: /* @__PURE__ */ w(te, {
@@ -720,7 +720,7 @@ var Ce = class extends S.Component {
720
720
  boxShadow: "none"
721
721
  } }
722
722
  },
723
- title: Object.keys(a.answers).map((e) => e === n && !(i || u) && /* @__PURE__ */ w(Ae, {
723
+ title: Object.keys(a.answers).map((e) => e === n && !(i || d) && /* @__PURE__ */ w(Ae, {
724
724
  "data-keypad": !0,
725
725
  style: { width: be(R, k) },
726
726
  children: /* @__PURE__ */ w(ee, {
@@ -729,7 +729,7 @@ var Ce = class extends S.Component {
729
729
  onClick: this.onClick
730
730
  })
731
731
  }, e) || null),
732
- children: /* @__PURE__ */ w("div", { children: /* @__PURE__ */ w(m.Static, {
732
+ children: /* @__PURE__ */ w("div", { children: /* @__PURE__ */ w(p.Static, {
733
733
  className: "static-math",
734
734
  ref: (e) => {
735
735
  e && (this.mqStatic = e);
@@ -766,10 +766,10 @@ var Ce = class extends S.Component {
766
766
  placement: "bottom-start",
767
767
  slotProps: {
768
768
  tooltip: { sx: (e) => ({
769
- background: `${d.primaryLight()} !important`,
770
- color: d.text(),
769
+ background: `${u.primaryLight()} !important`,
770
+ color: u.text(),
771
771
  padding: e.spacing(2),
772
- border: `1px solid ${d.secondary()}`,
772
+ border: `1px solid ${u.secondary()}`,
773
773
  fontSize: "16px",
774
774
  "& :not(.MathJax) > table tr": { "&:nth-child(2n)": { backgroundColor: "unset !important" } }
775
775
  }) },
@@ -855,8 +855,8 @@ if (typeof document < "u") {
855
855
  flex-basis: auto;
856
856
  }
857
857
  .block-math {
858
- color: ${d.text()};
859
- background-color: ${d.background()};
858
+ color: ${u.text()};
859
+ background-color: ${u.background()};
860
860
  padding: 4px !important;
861
861
  display: flex;
862
862
  align-items: center;
@@ -875,32 +875,32 @@ if (typeof document < "u") {
875
875
  overflow: hidden;
876
876
  }
877
877
  .static-math > .mq-root-block > .mq-editable-field {
878
- border-color: ${d.text()};
878
+ border-color: ${u.text()};
879
879
  }
880
880
  `, document.head.appendChild(t);
881
881
  }
882
882
  }
883
- var Te = h(le)(() => ({
884
- color: d.text(),
885
- backgroundColor: d.background(),
883
+ var Te = m(le)(() => ({
884
+ color: u.text(),
885
+ backgroundColor: u.background(),
886
886
  display: "inline-block"
887
- })), Ee = h(te)({}), De = h("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Oe = h("div")({
887
+ })), Ee = m(te)({}), De = m("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Oe = m("div")({
888
888
  width: "100%",
889
889
  position: "relative",
890
- backgroundColor: d.background(),
891
- color: d.text()
892
- }), ke = h("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), $ = h(de)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Ae = h("div")(({ theme: e }) => ({
890
+ backgroundColor: u.background(),
891
+ color: u.text()
892
+ }), ke = m("div")(({ theme: e }) => ({ paddingBottom: e.spacing(2) })), $ = m(de)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Ae = m("div")(({ theme: e }) => ({
893
893
  zIndex: 10,
894
894
  minWidth: "400px",
895
895
  marginTop: e.spacing(2)
896
- })), je = h("div", { shouldForwardProp: (e) => ![
896
+ })), je = m("div", { shouldForwardProp: (e) => ![
897
897
  "isIncorrect",
898
898
  "isCorrect",
899
899
  "showCorrectness",
900
900
  "correctAnswerShown",
901
901
  "printCorrect"
902
902
  ].includes(e) })(({ theme: e, isIncorrect: t, isCorrect: n, showCorrectness: r, correctAnswerShown: i, printCorrect: a }) => {
903
- let o = t ? d.incorrect() : n ? d.correct() : void 0;
903
+ let o = t ? u.incorrect() : n ? u.correct() : void 0;
904
904
  return {
905
905
  maxWidth: "fit-content",
906
906
  padding: e.spacing(.25),
@@ -910,7 +910,7 @@ var Te = h(le)(() => ({
910
910
  padding: e.spacing(1),
911
911
  letterSpacing: "0.5px"
912
912
  },
913
- ...a && { border: `2px solid ${d.correct()} !important` },
913
+ ...a && { border: `2px solid ${u.correct()} !important` },
914
914
  "& .mq-math-mode": {
915
915
  "& .mq-root-block": {
916
916
  paddingRight: "0 !important",
@@ -923,7 +923,7 @@ var Te = h(le)(() => ({
923
923
  "& sup": { top: 0 }
924
924
  }
925
925
  };
926
- }), Me = h("div")({
926
+ }), Me = m("div")({
927
927
  position: "relative",
928
928
  "& .mq-overarrow-inner": {
929
929
  border: "none !important",
@@ -953,21 +953,21 @@ var Te = h(le)(() => ({
953
953
  paddingTop: "1.5px !important"
954
954
  },
955
955
  "& .mq-parallelogram": { lineHeight: .85 }
956
- }), Ne = h("div")(({ theme: e }) => ({
956
+ }), Ne = m("div")(({ theme: e }) => ({
957
957
  marginBottom: e.spacing(1),
958
958
  pointerEvents: "none"
959
- })), Pe = h("h2")({
959
+ })), Pe = m("h2")({
960
960
  position: "absolute",
961
961
  left: "-10000px",
962
962
  top: "auto",
963
963
  width: "1px",
964
964
  height: "1px",
965
965
  overflow: "hidden"
966
- }), Fe = h(ie)(({ theme: e }) => ({
967
- color: d.text(),
966
+ }), Fe = m(ie)(({ theme: e }) => ({
967
+ color: u.text(),
968
968
  marginBottom: e.spacing(2)
969
969
  }));
970
970
  //#endregion
971
971
  export { Ce as t };
972
972
 
973
- //# sourceMappingURL=main-CohR01RN.js.map
973
+ //# sourceMappingURL=main-BDByYWlm.js.map