@pie-element/math-templated 7.1.1-next.0 → 7.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,5 +1,5 @@
1
1
  import { C as e, g as t, n, o as r, t as i } from "./browser-DJA4OL8j.js";
2
- import { At as a, C as o, J as s, M as c, S as l, a as u, b as d, d as f, f as p, ft as m, i as h, it as g, l as _, n as v, q as y, r as b, t as x, u as S } from "./dist-CGHr_3dl.js";
2
+ import { At as a, J as o, M as s, S as c, a as l, b as u, d, f, ft as p, i as m, it as h, l as g, n as _, q as v, r as y, t as b, u as x, w as S } from "./dist-Csid0rBE.js";
3
3
  import { t as C } from "./dist-D9ARZhQk.js";
4
4
  import w, { useRef as T } from "react";
5
5
  import { jsx as E, jsxs as D } from "react/jsx-runtime";
@@ -76,7 +76,7 @@ k.propTypes = {
76
76
  fgFill: O.default.string.isRequired,
77
77
  borderFill: O.default.string.isRequired
78
78
  };
79
- var ne = m("div")(({ size: e }) => ({
79
+ var ne = p("div")(({ size: e }) => ({
80
80
  width: e || "25px",
81
81
  height: e || "25px"
82
82
  })), A = ({ open: e, size: t }) => /* @__PURE__ */ E(ne, {
@@ -469,10 +469,10 @@ var he = me(), ge = (0, re.default)("@pie-lib:mask-markup:serialization"), _e =
469
469
  nodes: t
470
470
  }
471
471
  };
472
- }, Me = m("div")(({ theme: e }) => ({
472
+ }, Me = p("div")(({ theme: e }) => ({
473
473
  paddingTop: e.spacing(.5),
474
474
  paddingBottom: e.spacing(.5)
475
- })), H = m("span")(() => ({
475
+ })), H = p("span")(() => ({
476
476
  display: "inline-block",
477
477
  width: ".75em"
478
478
  })), Ne = ["tbody", "tr"], Pe = (e, t) => {
@@ -520,7 +520,7 @@ var he = me(), ge = (0, re.default)("@pie-lib:mask-markup:serialization"), _e =
520
520
  }
521
521
  }
522
522
  }), o;
523
- }, Ie = m("div")(() => ({
523
+ }, Ie = p("div")(() => ({
524
524
  display: "initial",
525
525
  "&:not(.MathJax) table": { borderCollapse: "collapse" },
526
526
  "&:not(.MathJax) table td, &:not(.MathJax) table th": {
@@ -541,7 +541,7 @@ var he = me(), ge = (0, re.default)("@pie-lib:mask-markup:serialization"), _e =
541
541
  };
542
542
  componentDidMount() {
543
543
  let e = this.props.containerRef || this.internalContainerRef;
544
- e.current && typeof o == "function" && o(e.current);
544
+ e.current && typeof S == "function" && S(e.current);
545
545
  }
546
546
  handleChange = (e, t) => {
547
547
  let n = {
@@ -595,7 +595,7 @@ var he = me(), ge = (0, re.default)("@pie-lib:mask-markup:serialization"), _e =
595
595
  })("input", (e) => (t, n, r) => {
596
596
  let i = t.data && t.data.dataset || {};
597
597
  if (i.component === "input") return e.customMarkMarkupComponent(i.id);
598
- }), W = "height ease-in 300ms, opacity ease-in 300ms", Be = m("div")(() => ({
598
+ }), W = "height ease-in 300ms, opacity ease-in 300ms", Be = p("div")(() => ({
599
599
  position: "relative",
600
600
  height: 0,
601
601
  overflow: "hidden",
@@ -631,7 +631,7 @@ var he = me(), ge = (0, re.default)("@pie-lib:mask-markup:serialization"), _e =
631
631
  }
632
632
  })), Ve = (e) => {
633
633
  let { show: t, children: n, className: r } = e, i = T(null);
634
- return /* @__PURE__ */ E(g, {
634
+ return /* @__PURE__ */ E(h, {
635
635
  nodeRef: i,
636
636
  in: t,
637
637
  appear: !0,
@@ -663,29 +663,29 @@ function G(e) {
663
663
  function He(e, t) {
664
664
  return !e || G(e) ? e : G(e.default) ? e.default : t && G(e[t]) ? e[t] : t && G(e[t]?.default) ? e[t].default : e;
665
665
  }
666
- var Ue = He(f, "Readable") || He(Ge.Readable, "Readable"), We = u, K = We.default, Ge = K && typeof K == "object" ? K : We, { translator: q } = C, Ke = {
666
+ var Ue = He(d, "Readable") || He(Ge.Readable, "Readable"), We = l, K = We.default, Ge = K && typeof K == "object" ? K : We, { translator: q } = C, Ke = {
667
667
  WebkitTouchCallout: "none",
668
668
  WebkitUserSelect: "none",
669
669
  KhtmlUserSelect: "none",
670
670
  MozUserSelect: "none",
671
671
  msUserSelect: "none",
672
672
  userSelect: "none"
673
- }, qe = m("div")(() => ({
673
+ }, qe = p("div")(() => ({
674
674
  width: "100%",
675
675
  cursor: "pointer"
676
- })), Je = m("div")(() => ({
676
+ })), Je = p("div")(() => ({
677
677
  margin: "0 auto",
678
678
  textAlign: "center",
679
679
  display: "flex"
680
- })), Ye = m("div")(() => ({
680
+ })), Ye = p("div")(() => ({
681
681
  width: "fit-content",
682
682
  minWidth: "140px",
683
683
  alignSelf: "center",
684
684
  verticalAlign: "middle",
685
- color: `var(--correct-answer-toggle-label-color, ${c.text()})`,
685
+ color: `var(--correct-answer-toggle-label-color, ${s.text()})`,
686
686
  fontWeight: "normal",
687
687
  ...Ke
688
- })), Xe = m("div")(() => ({
688
+ })), Xe = p("div")(() => ({
689
689
  position: "absolute",
690
690
  width: "25px",
691
691
  "&.enter": { opacity: "0" },
@@ -698,7 +698,7 @@ var Ue = He(f, "Readable") || He(Ge.Readable, "Readable"), We = u, K = We.defaul
698
698
  opacity: "0",
699
699
  transition: "opacity 0.3s ease-in"
700
700
  }
701
- })), Ze = m("div")(() => ({
701
+ })), Ze = p("div")(() => ({
702
702
  width: "25px",
703
703
  marginRight: "5px",
704
704
  display: "flex",
@@ -748,7 +748,7 @@ var Ue = He(f, "Readable") || He(Ge.Readable, "Readable"), We = u, K = We.defaul
748
748
  children: /* @__PURE__ */ D(Je, {
749
749
  onClick: this.onClick.bind(this),
750
750
  onTouchEnd: this.onTouch.bind(this),
751
- children: [/* @__PURE__ */ D(Ze, { children: [/* @__PURE__ */ E(g, {
751
+ children: [/* @__PURE__ */ D(Ze, { children: [/* @__PURE__ */ E(h, {
752
752
  nodeRef: this.openIconRef,
753
753
  timeout: 400,
754
754
  in: t,
@@ -763,7 +763,7 @@ var Ue = He(f, "Readable") || He(Ge.Readable, "Readable"), We = u, K = We.defaul
763
763
  ref: this.openIconRef,
764
764
  children: /* @__PURE__ */ E(A, { open: t }, "correct-open")
765
765
  })
766
- }), /* @__PURE__ */ E(g, {
766
+ }), /* @__PURE__ */ E(h, {
767
767
  nodeRef: this.closedIconRef,
768
768
  timeout: 5e3,
769
769
  in: !t,
@@ -798,16 +798,16 @@ function J(e) {
798
798
  function Y(e, t) {
799
799
  return !e || J(e) ? e : J(e.default) ? e.default : t && J(e[t]) ? e[t] : t && J(e[t]?.default) ? e[t].default : e;
800
800
  }
801
- var $e = Y(d, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(p, "PreviewPrompt") || Y(Q.PreviewPrompt, "PreviewPrompt"), et = Y(f, "Readable") || Y(Q.Readable, "Readable"), tt = Y(l, "Collapsible") || Y(Q.Collapsible, "Collapsible"), nt = u, Z = nt.default, Q = Z && typeof Z == "object" ? Z : nt, rt = m($e)({
802
- color: c.text(),
803
- backgroundColor: c.background(),
801
+ var $e = Y(u, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(f, "PreviewPrompt") || Y(Q.PreviewPrompt, "PreviewPrompt"), et = Y(d, "Readable") || Y(Q.Readable, "Readable"), tt = Y(c, "Collapsible") || Y(Q.Collapsible, "Collapsible"), nt = l, Z = nt.default, Q = Z && typeof Z == "object" ? Z : nt, rt = p($e)({
802
+ color: s.text(),
803
+ backgroundColor: s.background(),
804
804
  display: "inline-block"
805
- }), it = m("div")({
805
+ }), it = p("div")({
806
806
  width: "100%",
807
807
  position: "relative",
808
- backgroundColor: c.background(),
809
- color: c.text()
810
- }), at = m("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), ot = m("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), st = m("div")({
808
+ backgroundColor: s.background(),
809
+ color: s.text()
810
+ }), at = p("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), ot = p("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), st = p("div")({
811
811
  position: "relative",
812
812
  "& > div > div": {
813
813
  display: "flex",
@@ -842,10 +842,10 @@ var $e = Y(d, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(p, "PreviewPrompt"
842
842
  paddingTop: "1.5px !important"
843
843
  },
844
844
  "& .mq-parallelogram": { lineHeight: .85 }
845
- }), ct = m("div")(({ theme: e, $incorrect: t, $correct: n, $showCorrectness: r, $correctAnswerShown: i }) => ({
845
+ }), ct = p("div")(({ theme: e, $incorrect: t, $correct: n, $showCorrectness: r, $correctAnswerShown: i }) => ({
846
846
  maxWidth: "fit-content",
847
- ...t && { borderColor: `${c.incorrect()} !important` },
848
- ...n && { borderColor: `${c.correct()} !important` },
847
+ ...t && { borderColor: `${s.incorrect()} !important` },
848
+ ...n && { borderColor: `${s.correct()} !important` },
849
849
  ...r && { border: "2px solid" },
850
850
  ...i && {
851
851
  padding: e.spacing(1),
@@ -858,22 +858,22 @@ var $e = Y(d, "UiLayout") || Y(Q.UiLayout, "UiLayout"), X = Y(p, "PreviewPrompt"
858
858
  } },
859
859
  "& sup": { top: 0 }
860
860
  }
861
- })), lt = m(b.Static)({ "& > .mq-root-block": { "& > .mq-editable-field": { borderColor: c.text() } } }), ut = m("div")(({ theme: e }) => ({
861
+ })), lt = p(y.Static)({ "& > .mq-root-block": { "& > .mq-editable-field": { borderColor: s.text() } } }), ut = p("div")(({ theme: e }) => ({
862
862
  zIndex: 10,
863
863
  minWidth: "400px",
864
864
  marginTop: e.spacing(2)
865
- })), dt = m("div")(({ theme: e }) => ({
865
+ })), dt = p("div")(({ theme: e }) => ({
866
866
  marginBottom: e.spacing(1),
867
867
  pointerEvents: "none"
868
- })), ft = m("h2")({
868
+ })), ft = p("h2")({
869
869
  position: "absolute",
870
870
  left: "-10000px",
871
871
  top: "auto",
872
872
  width: "1px",
873
873
  height: "1px",
874
874
  overflow: "hidden"
875
- }), pt = m("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), mt = m(Qe)(({ theme: e }) => ({
876
- color: c.text(),
875
+ }), pt = p("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), mt = p(Qe)(({ theme: e }) => ({
876
+ color: s.text(),
877
877
  marginBottom: e.spacing(2)
878
878
  }));
879
879
  if (typeof document < "u") {
@@ -898,8 +898,8 @@ if (typeof document < "u") {
898
898
  border-right: 2px solid #bdbdbd !important;
899
899
  }
900
900
  .block-math {
901
- color: ${c.text()};
902
- background-color: ${c.background()};
901
+ color: ${s.text()};
902
+ background-color: ${s.background()};
903
903
  padding: 4px !important;
904
904
  display: flex;
905
905
  align-items: center;
@@ -910,10 +910,10 @@ if (typeof document < "u") {
910
910
  display: none;
911
911
  }
912
912
  .correct {
913
- border-color: ${c.correct()} !important;
913
+ border-color: ${s.correct()} !important;
914
914
  }
915
915
  .incorrect {
916
- border-color: ${c.incorrect()} !important;
916
+ border-color: ${s.incorrect()} !important;
917
917
  }
918
918
  `, document.head.appendChild(t);
919
919
  }
@@ -991,7 +991,7 @@ var Ct = {
991
991
  };
992
992
  }
993
993
  UNSAFE_componentWillMount() {
994
- typeof window < "u" && (ht ||= (v("answerBlock", (e) => ({
994
+ typeof window < "u" && (ht ||= (_("answerBlock", (e) => ({
995
995
  htmlString: `<div class="block-container">
996
996
  <div class="block-response" id="${e}Index">R</div>
997
997
  <div class="block-math">
@@ -1008,9 +1008,9 @@ var Ct = {
1008
1008
  let n = this.root.querySelector(`#${t}`), i = this.root.querySelector(`#${t}Index`);
1009
1009
  if (n) {
1010
1010
  let a = r[t];
1011
- x(n, a && a.value || ""), e.view && (n.parentElement.parentElement.classList.remove("correct"), n.parentElement.parentElement.classList.remove("incorrect")), i.textContent = "R";
1011
+ b(n, a && a.value || ""), e.view && (n.parentElement.parentElement.classList.remove("correct"), n.parentElement.parentElement.classList.remove("incorrect")), i.textContent = "R";
1012
1012
  }
1013
- }), o(this.root);
1013
+ }), S(this.root);
1014
1014
  };
1015
1015
  UNSAFE_componentWillReceiveProps(t) {
1016
1016
  let { model: r } = this.props, { model: i = {} } = t || {}, { markup: a = "", env: o = {} } = r || {}, { markup: s = "", env: c = {}, alwaysShowCorrect: l = !1 } = i, u = (e) => e && e.mode === "evaluate";
@@ -1037,7 +1037,7 @@ var Ct = {
1037
1037
  return !r || !i;
1038
1038
  }
1039
1039
  componentDidMount() {
1040
- this.handleAnswerBlockDomUpdate(), setTimeout(() => o(this.root), 100);
1040
+ this.handleAnswerBlockDomUpdate(), setTimeout(() => S(this.root), 100);
1041
1041
  }
1042
1042
  componentDidUpdate() {
1043
1043
  this.handleAnswerBlockDomUpdate();
@@ -1100,7 +1100,7 @@ var Ct = {
1100
1100
  this.setState({ showCorrect: e }, this.handleAnswerBlockDomUpdate);
1101
1101
  };
1102
1102
  subFieldChanged = (e, t) => {
1103
- y(), e && this.setState((n) => ({ session: {
1103
+ v(), e && this.setState((n) => ({ session: {
1104
1104
  ...n.session,
1105
1105
  answers: {
1106
1106
  ...n.session.answers,
@@ -1139,7 +1139,7 @@ var Ct = {
1139
1139
  }, 1);
1140
1140
  }
1141
1141
  renderTeacherInstructions = () => {
1142
- let { model: e } = this.props, { teacherInstructions: t, animationsDisabled: n } = e || {}, r = t && (S(t) || _(t)), i = /* @__PURE__ */ E(X, {
1142
+ let { model: e } = this.props, { teacherInstructions: t, animationsDisabled: n } = e || {}, r = t && (x(t) || g(t)), i = /* @__PURE__ */ E(X, {
1143
1143
  defaultClassName: "teacher-instructions",
1144
1144
  prompt: t
1145
1145
  });
@@ -1153,7 +1153,7 @@ var Ct = {
1153
1153
  };
1154
1154
  renderRationale = () => {
1155
1155
  let { model: e } = this.props, { rationale: t, animationsDisabled: n } = e || {}, r = /* @__PURE__ */ E(X, { prompt: t });
1156
- return t && (S(t) || _(t)) && /* @__PURE__ */ E(ot, { children: n ? r : /* @__PURE__ */ E(tt, {
1156
+ return t && (x(t) || g(t)) && /* @__PURE__ */ E(ot, { children: n ? r : /* @__PURE__ */ E(tt, {
1157
1157
  labels: {
1158
1158
  hidden: "Show Rationale",
1159
1159
  visible: "Hide Rationale"
@@ -1162,13 +1162,13 @@ var Ct = {
1162
1162
  }) });
1163
1163
  };
1164
1164
  renderPlayerContent = () => {
1165
- let { model: e } = this.props, { activeAnswerBlock: t, showCorrect: n, session: i, tooltipContainerRef: a } = this.state, { correctness: o, disabled: c, view: l, responses: u, equationEditor: d, customKeys: f, feedback: p, env: { mode: m } = {}, printMode: g, alwaysShowCorrect: _ } = e || {}, v = r(u), y = yt(f), b = St(e, this.state) || "", x = g && !_;
1165
+ let { model: e } = this.props, { activeAnswerBlock: t, showCorrect: n, session: i, tooltipContainerRef: a } = this.state, { correctness: s, disabled: c, view: l, responses: u, equationEditor: d, customKeys: f, feedback: p, env: { mode: h } = {}, printMode: g, alwaysShowCorrect: _ } = e || {}, v = r(u), y = yt(f), b = St(e, this.state) || "", x = g && !_;
1166
1166
  return /* @__PURE__ */ E(st, { children: /* @__PURE__ */ E(ze, {
1167
1167
  disabled: c,
1168
1168
  markup: e.markup,
1169
1169
  value: {},
1170
1170
  customMarkMarkupComponent: (e) => {
1171
- let r = m === "evaluate" && p && p[e], u = /* @__PURE__ */ E(lt, {
1171
+ let r = h === "evaluate" && p && p[e], u = /* @__PURE__ */ E(lt, {
1172
1172
  ref: (e) => {
1173
1173
  this.mqStatic = e || this.mqStatic;
1174
1174
  },
@@ -1183,9 +1183,9 @@ var Ct = {
1183
1183
  ref: a,
1184
1184
  $incorrect: !v && !r && !n,
1185
1185
  $correct: !v && (r || n),
1186
- $showCorrectness: !v && c && o && !l,
1186
+ $showCorrectness: !v && c && s && !l,
1187
1187
  $correctAnswerShown: n,
1188
- children: /* @__PURE__ */ E(s, {
1188
+ children: /* @__PURE__ */ E(o, {
1189
1189
  ref: (e) => this.setTooltipRef(e),
1190
1190
  enterTouchDelay: 0,
1191
1191
  interactive: !0,
@@ -1225,7 +1225,7 @@ var Ct = {
1225
1225
  title: Object.keys(i.answers).map((e) => e === t && !(n || c) && /* @__PURE__ */ E(ut, {
1226
1226
  "data-keypad": !0,
1227
1227
  style: { width: bt(y, d) },
1228
- children: /* @__PURE__ */ E(h, {
1228
+ children: /* @__PURE__ */ E(m, {
1229
1229
  additionalKeys: y,
1230
1230
  mode: d || gt,
1231
1231
  onClick: this.onClick
@@ -1271,4 +1271,4 @@ var Ct = {
1271
1271
  //#endregion
1272
1272
  export { wt as t };
1273
1273
 
1274
- //# sourceMappingURL=main-DjRQVdyL.js.map
1274
+ //# sourceMappingURL=main-I_wWeaur.js.map