@pie-element/math-templated 7.1.1-next.45 → 7.1.1-next.46

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 { C as e, g as t, n, o as r, t as i } from "./browser-_ggI30Zt.js";
2
- import { G as a, J as o, K as s, Nt as c, W as l, _ as u, b as d, c as f, it as p, k as m, l as h, n as g, o as _, q as v, s as y, t as b, ut as x, y as S } from "./horizontal-keypad-BvWjUfrQ.js";
2
+ import { A as a, G as o, J as s, K as c, Pt as l, Y as u, _ as d, at as f, c as p, dt as m, l as h, n as g, o as _, q as v, s as y, t as b, x, y as S } from "./horizontal-keypad-DTHAIckS.js";
3
3
  import { t as C } from "./dist-DCmVXYeO.js";
4
4
  import w, { useRef as T } from "react";
5
5
  import { jsx as E, jsxs as D } from "react/jsx-runtime";
6
6
  import ee from "react-dom";
7
7
  //#region ../../lib-react/icons/dist/correct-response-icon.js
8
- var O = /* @__PURE__ */ e(c(), 1), te = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ D("svg", {
8
+ var O = /* @__PURE__ */ e(l(), 1), te = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ D("svg", {
9
9
  preserveAspectRatio: "xMinYMin meet",
10
10
  version: "1.1",
11
11
  viewBox: "-283 359 34 35",
@@ -76,7 +76,7 @@ ne.propTypes = {
76
76
  fgFill: O.default.string.isRequired,
77
77
  borderFill: O.default.string.isRequired
78
78
  };
79
- var re = x("div")(({ size: e }) => ({
79
+ var re = m("div")(({ size: e }) => ({
80
80
  width: e || "25px",
81
81
  height: e || "25px"
82
82
  })), k = ({ open: e, size: t }) => /* @__PURE__ */ E(re, {
@@ -469,10 +469,10 @@ var ge = he(), _e = (0, ie.default)("@pie-lib:mask-markup:serialization"), ve =
469
469
  nodes: t
470
470
  }
471
471
  };
472
- }, Ne = x("div")(({ theme: e }) => ({
472
+ }, Ne = m("div")(({ theme: e }) => ({
473
473
  paddingTop: e.spacing(.5),
474
474
  paddingBottom: e.spacing(.5)
475
- })), V = x("span")(() => ({
475
+ })), V = m("span")(() => ({
476
476
  display: "inline-block",
477
477
  width: ".75em"
478
478
  })), Pe = ["tbody", "tr"], Fe = (e, t) => {
@@ -516,7 +516,7 @@ var ge = he(), _e = (0, ie.default)("@pie-lib:mask-markup:serialization"), ve =
516
516
  }
517
517
  }
518
518
  }), o;
519
- }, Le = x("div")(() => ({
519
+ }, Le = m("div")(() => ({
520
520
  display: "initial",
521
521
  "&:not(.MathJax) table": { borderCollapse: "collapse" },
522
522
  "&:not(.MathJax) table td, &:not(.MathJax) table th": {
@@ -537,7 +537,7 @@ var ge = he(), _e = (0, ie.default)("@pie-lib:mask-markup:serialization"), ve =
537
537
  };
538
538
  componentDidMount() {
539
539
  let e = this.props.containerRef || this.internalContainerRef;
540
- e.current && typeof d == "function" && d(e.current);
540
+ e.current && typeof x == "function" && x(e.current);
541
541
  }
542
542
  handleChange = (e, t) => {
543
543
  let n = {
@@ -591,7 +591,7 @@ var ge = he(), _e = (0, ie.default)("@pie-lib:mask-markup:serialization"), ve =
591
591
  })("input", (e) => (t, n, r) => {
592
592
  let i = t.data && t.data.dataset || {};
593
593
  if (i.component === "input") return e.customMarkMarkupComponent(i.id);
594
- }), U = "height ease-in 300ms, opacity ease-in 300ms", Ve = x("div")(() => ({
594
+ }), U = "height ease-in 300ms, opacity ease-in 300ms", Ve = m("div")(() => ({
595
595
  position: "relative",
596
596
  height: 0,
597
597
  overflow: "hidden",
@@ -627,7 +627,7 @@ var ge = he(), _e = (0, ie.default)("@pie-lib:mask-markup:serialization"), ve =
627
627
  }
628
628
  })), He = (e) => {
629
629
  let { show: t, children: n, className: r } = e, i = T(null);
630
- return /* @__PURE__ */ E(p, {
630
+ return /* @__PURE__ */ E(f, {
631
631
  nodeRef: i,
632
632
  in: t,
633
633
  appear: !0,
@@ -659,29 +659,29 @@ function W(e) {
659
659
  function Ue(e, t) {
660
660
  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;
661
661
  }
662
- var We = Ue(f, "Readable") || Ue(Ke.Readable, "Readable"), Ge = g, G = Ge.default, Ke = G && typeof G == "object" ? G : Ge, { translator: K } = C, qe = {
662
+ var We = Ue(p, "Readable") || Ue(Ke.Readable, "Readable"), Ge = g, G = Ge.default, Ke = G && typeof G == "object" ? G : Ge, { translator: K } = C, qe = {
663
663
  WebkitTouchCallout: "none",
664
664
  WebkitUserSelect: "none",
665
665
  KhtmlUserSelect: "none",
666
666
  MozUserSelect: "none",
667
667
  msUserSelect: "none",
668
668
  userSelect: "none"
669
- }, Je = x("div")(() => ({
669
+ }, Je = m("div")(() => ({
670
670
  width: "100%",
671
671
  cursor: "pointer"
672
- })), Ye = x("div")(() => ({
672
+ })), Ye = m("div")(() => ({
673
673
  margin: "0 auto",
674
674
  textAlign: "center",
675
675
  display: "flex"
676
- })), Xe = x("div")(() => ({
676
+ })), Xe = m("div")(() => ({
677
677
  width: "fit-content",
678
678
  minWidth: "140px",
679
679
  alignSelf: "center",
680
680
  verticalAlign: "middle",
681
- color: `var(--correct-answer-toggle-label-color, ${m.text()})`,
681
+ color: `var(--correct-answer-toggle-label-color, ${a.text()})`,
682
682
  fontWeight: "normal",
683
683
  ...qe
684
- })), Ze = x("div")(() => ({
684
+ })), Ze = m("div")(() => ({
685
685
  position: "absolute",
686
686
  width: "25px",
687
687
  "&.enter": { opacity: "0" },
@@ -694,7 +694,7 @@ var We = Ue(f, "Readable") || Ue(Ke.Readable, "Readable"), Ge = g, G = Ge.defaul
694
694
  opacity: "0",
695
695
  transition: "opacity 0.3s ease-in"
696
696
  }
697
- })), Qe = x("div")(() => ({
697
+ })), Qe = m("div")(() => ({
698
698
  width: "25px",
699
699
  marginRight: "5px",
700
700
  display: "flex",
@@ -744,7 +744,7 @@ var We = Ue(f, "Readable") || Ue(Ke.Readable, "Readable"), Ge = g, G = Ge.defaul
744
744
  children: /* @__PURE__ */ D(Ye, {
745
745
  onClick: this.onClick.bind(this),
746
746
  onTouchEnd: this.onTouch.bind(this),
747
- children: [/* @__PURE__ */ D(Qe, { children: [/* @__PURE__ */ E(p, {
747
+ children: [/* @__PURE__ */ D(Qe, { children: [/* @__PURE__ */ E(f, {
748
748
  nodeRef: this.openIconRef,
749
749
  timeout: 400,
750
750
  in: t,
@@ -759,7 +759,7 @@ var We = Ue(f, "Readable") || Ue(Ke.Readable, "Readable"), Ge = g, G = Ge.defaul
759
759
  ref: this.openIconRef,
760
760
  children: /* @__PURE__ */ E(k, { open: t }, "correct-open")
761
761
  })
762
- }), /* @__PURE__ */ E(p, {
762
+ }), /* @__PURE__ */ E(f, {
763
763
  nodeRef: this.closedIconRef,
764
764
  timeout: 5e3,
765
765
  in: !t,
@@ -794,16 +794,16 @@ function q(e) {
794
794
  function J(e, t) {
795
795
  return !e || q(e) ? e : q(e.default) ? e.default : t && q(e[t]) ? e[t] : t && q(e[t]?.default) ? e[t].default : e;
796
796
  }
797
- var et = J(u, "UiLayout") || J(Z.UiLayout, "UiLayout"), Y = J(h, "PreviewPrompt") || J(Z.PreviewPrompt, "PreviewPrompt"), tt = J(f, "Readable") || J(Z.Readable, "Readable"), nt = J(S, "Collapsible") || J(Z.Collapsible, "Collapsible"), rt = g, X = rt.default, Z = X && typeof X == "object" ? X : rt, it = x(et)({
798
- color: m.text(),
799
- backgroundColor: m.background(),
797
+ var et = J(d, "UiLayout") || J(Z.UiLayout, "UiLayout"), Y = J(h, "PreviewPrompt") || J(Z.PreviewPrompt, "PreviewPrompt"), tt = J(p, "Readable") || J(Z.Readable, "Readable"), nt = J(S, "Collapsible") || J(Z.Collapsible, "Collapsible"), rt = g, X = rt.default, Z = X && typeof X == "object" ? X : rt, it = m(et)({
798
+ color: a.text(),
799
+ backgroundColor: a.background(),
800
800
  display: "inline-block"
801
- }), Q = x("div")({
801
+ }), Q = m("div")({
802
802
  width: "100%",
803
803
  position: "relative",
804
- backgroundColor: m.background(),
805
- color: m.text()
806
- }), at = x("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), ot = x("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), st = x("div")({
804
+ backgroundColor: a.background(),
805
+ color: a.text()
806
+ }), at = m("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), ot = m("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), st = m("div")({
807
807
  position: "relative",
808
808
  "& > div > div": {
809
809
  display: "flex",
@@ -838,10 +838,10 @@ var et = J(u, "UiLayout") || J(Z.UiLayout, "UiLayout"), Y = J(h, "PreviewPrompt"
838
838
  paddingTop: "1.5px !important"
839
839
  },
840
840
  "& .mq-parallelogram": { lineHeight: .85 }
841
- }), ct = x("div")(({ theme: e, $incorrect: t, $correct: n, $showCorrectness: r, $correctAnswerShown: i }) => ({
841
+ }), ct = m("div")(({ theme: e, $incorrect: t, $correct: n, $showCorrectness: r, $correctAnswerShown: i }) => ({
842
842
  maxWidth: "fit-content",
843
- ...t && { borderColor: `${m.incorrect()} !important` },
844
- ...n && { borderColor: `${m.correct()} !important` },
843
+ ...t && { borderColor: `${a.incorrect()} !important` },
844
+ ...n && { borderColor: `${a.correct()} !important` },
845
845
  ...r && { border: "2px solid" },
846
846
  ...i && {
847
847
  padding: e.spacing(1),
@@ -854,22 +854,22 @@ var et = J(u, "UiLayout") || J(Z.UiLayout, "UiLayout"), Y = J(h, "PreviewPrompt"
854
854
  } },
855
855
  "& sup": { top: 0 }
856
856
  }
857
- })), lt = x(l.Static)({ "& > .mq-root-block": { "& > .mq-editable-field": { borderColor: m.text() } } }), ut = x("div")(({ theme: e }) => ({
857
+ })), lt = m(o.Static)({ "& > .mq-root-block": { "& > .mq-editable-field": { borderColor: a.text() } } }), ut = m("div")(({ theme: e }) => ({
858
858
  zIndex: 10,
859
859
  minWidth: "400px",
860
860
  marginTop: e.spacing(2)
861
- })), dt = x("div")(({ theme: e }) => ({
861
+ })), dt = m("div")(({ theme: e }) => ({
862
862
  marginBottom: e.spacing(1),
863
863
  pointerEvents: "none"
864
- })), ft = x("h2")({
864
+ })), ft = m("h2")({
865
865
  position: "absolute",
866
866
  left: "-10000px",
867
867
  top: "auto",
868
868
  width: "1px",
869
869
  height: "1px",
870
870
  overflow: "hidden"
871
- }), pt = x("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), mt = x($e)(({ theme: e }) => ({
872
- color: m.text(),
871
+ }), pt = m("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), mt = m($e)(({ theme: e }) => ({
872
+ color: a.text(),
873
873
  marginBottom: e.spacing(2)
874
874
  }));
875
875
  if (typeof document < "u") {
@@ -894,8 +894,8 @@ if (typeof document < "u") {
894
894
  border-right: 2px solid #bdbdbd !important;
895
895
  }
896
896
  .block-math {
897
- color: ${m.text()};
898
- background-color: ${m.background()};
897
+ color: ${a.text()};
898
+ background-color: ${a.background()};
899
899
  padding: 4px !important;
900
900
  display: flex;
901
901
  align-items: center;
@@ -906,10 +906,10 @@ if (typeof document < "u") {
906
906
  display: none;
907
907
  }
908
908
  .correct {
909
- border-color: ${m.correct()} !important;
909
+ border-color: ${a.correct()} !important;
910
910
  }
911
911
  .incorrect {
912
- border-color: ${m.incorrect()} !important;
912
+ border-color: ${a.incorrect()} !important;
913
913
  }
914
914
  `, document.head.appendChild(t);
915
915
  }
@@ -987,7 +987,7 @@ var Ct = {
987
987
  };
988
988
  }
989
989
  UNSAFE_componentWillMount() {
990
- typeof window < "u" && (ht ||= (s("answerBlock", (e) => ({
990
+ typeof window < "u" && (ht ||= (v("answerBlock", (e) => ({
991
991
  htmlString: `<div class="block-container">
992
992
  <div class="block-response" id="${e}Index">R</div>
993
993
  <div class="block-math">
@@ -1003,10 +1003,10 @@ var Ct = {
1003
1003
  this.root && e.disabled && !n && Object.keys(r).forEach((t) => {
1004
1004
  let n = this.root.querySelector(`#${t}`), i = this.root.querySelector(`#${t}Index`);
1005
1005
  if (n) {
1006
- let o = r[t];
1007
- a(n, o && o.value || ""), e.view && (n.parentElement.parentElement.classList.remove("correct"), n.parentElement.parentElement.classList.remove("incorrect")), i.textContent = "R";
1006
+ let a = r[t];
1007
+ c(n, a && a.value || ""), e.view && (n.parentElement.parentElement.classList.remove("correct"), n.parentElement.parentElement.classList.remove("incorrect")), i.textContent = "R";
1008
1008
  }
1009
- }), d(this.root);
1009
+ }), x(this.root);
1010
1010
  };
1011
1011
  UNSAFE_componentWillReceiveProps(t) {
1012
1012
  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";
@@ -1033,7 +1033,7 @@ var Ct = {
1033
1033
  return !r || !i;
1034
1034
  }
1035
1035
  componentDidMount() {
1036
- this.handleAnswerBlockDomUpdate(), setTimeout(() => d(this.root), 100);
1036
+ this.handleAnswerBlockDomUpdate(), setTimeout(() => x(this.root), 100);
1037
1037
  }
1038
1038
  componentDidUpdate() {
1039
1039
  this.handleAnswerBlockDomUpdate();
@@ -1096,7 +1096,7 @@ var Ct = {
1096
1096
  this.setState({ showCorrect: e }, this.handleAnswerBlockDomUpdate);
1097
1097
  };
1098
1098
  subFieldChanged = (e, t) => {
1099
- v(), e && this.setState((n) => ({ session: {
1099
+ s(), e && this.setState((n) => ({ session: {
1100
1100
  ...n.session,
1101
1101
  answers: {
1102
1102
  ...n.session.answers,
@@ -1158,13 +1158,13 @@ var Ct = {
1158
1158
  }) });
1159
1159
  };
1160
1160
  renderPlayerContent = () => {
1161
- 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: m } = {}, printMode: h, alwaysShowCorrect: g } = e || {}, _ = r(u), v = yt(f), y = St(e, this.state) || "", x = h && !g;
1161
+ let { model: e } = this.props, { activeAnswerBlock: t, showCorrect: n, session: i, tooltipContainerRef: a } = this.state, { correctness: o, disabled: s, view: c, responses: l, equationEditor: d, customKeys: f, feedback: p, env: { mode: m } = {}, printMode: h, alwaysShowCorrect: g } = e || {}, _ = r(l), v = yt(f), y = St(e, this.state) || "", x = h && !g;
1162
1162
  return /* @__PURE__ */ E(st, { children: /* @__PURE__ */ E(Be, {
1163
- disabled: c,
1163
+ disabled: s,
1164
1164
  markup: e.markup,
1165
1165
  value: {},
1166
1166
  customMarkMarkupComponent: (e) => {
1167
- let r = m === "evaluate" && p && p[e], u = /* @__PURE__ */ E(lt, {
1167
+ let r = m === "evaluate" && p && p[e], l = /* @__PURE__ */ E(lt, {
1168
1168
  ref: (e) => {
1169
1169
  this.mqStatic = e || this.mqStatic;
1170
1170
  },
@@ -1179,9 +1179,9 @@ var Ct = {
1179
1179
  ref: a,
1180
1180
  $incorrect: !_ && !r && !n,
1181
1181
  $correct: !_ && (r || n),
1182
- $showCorrectness: !_ && c && s && !l,
1182
+ $showCorrectness: !_ && s && o && !c,
1183
1183
  $correctAnswerShown: n,
1184
- children: /* @__PURE__ */ E(o, {
1184
+ children: /* @__PURE__ */ E(u, {
1185
1185
  ref: (e) => this.setTooltipRef(e),
1186
1186
  enterTouchDelay: 0,
1187
1187
  interactive: !0,
@@ -1218,7 +1218,7 @@ var Ct = {
1218
1218
  boxShadow: "none"
1219
1219
  } }
1220
1220
  },
1221
- title: Object.keys(i.answers).map((e) => e === t && !(n || c) && /* @__PURE__ */ E(ut, {
1221
+ title: Object.keys(i.answers).map((e) => e === t && !(n || s) && /* @__PURE__ */ E(ut, {
1222
1222
  "data-keypad": !0,
1223
1223
  style: { width: bt(v, d) },
1224
1224
  children: /* @__PURE__ */ E(b, {
@@ -1227,7 +1227,7 @@ var Ct = {
1227
1227
  onClick: this.onClick
1228
1228
  })
1229
1229
  }, e) || null),
1230
- children: E(x ? dt : "div", { children: u })
1230
+ children: E(x ? dt : "div", { children: l })
1231
1231
  })
1232
1232
  });
1233
1233
  }
@@ -1267,4 +1267,4 @@ var Ct = {
1267
1267
  //#endregion
1268
1268
  export { wt as t };
1269
1269
 
1270
- //# sourceMappingURL=main-AMGQsaTu.js.map
1270
+ //# sourceMappingURL=main-Bj8Kkc7H.js.map