@doenet/doenetml-iframe 0.7.15 → 0.7.16-dev.20260428024558.bb726cf

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.
Files changed (3) hide show
  1. package/index.js +37 -17
  2. package/index.js.map +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -16436,6 +16436,16 @@ function normalize_display_negative_fractions_sub$1(e3, { inside_unary_minus: t2
16436
16436
  function normalize_display_negative_fractions$1(e3) {
16437
16437
  return normalize_display_negative_fractions_sub$1(e3, { inside_unary_minus: false });
16438
16438
  }
16439
+ function expandScientificNotation$1(e3) {
16440
+ let t2 = e3.indexOf("e");
16441
+ if (-1 === t2) return e3;
16442
+ let r2 = e3.substring(0, t2), n3 = Number(e3.substring(t2 + 1)), i2 = "";
16443
+ "-" !== r2[0] && "+" !== r2[0] || (i2 = "-" === r2[0] ? "-" : "", r2 = r2.substring(1));
16444
+ let a2 = r2.indexOf(".");
16445
+ -1 === a2 && (a2 = r2.length);
16446
+ let o2 = r2.replace(".", ""), s2 = a2 + n3;
16447
+ return s2 <= 0 ? i2 + "0." + "0".repeat(-s2) + o2 : s2 >= o2.length ? i2 + o2 + "0".repeat(s2 - o2.length) : i2 + o2.substring(0, s2) + "." + o2.substring(s2);
16448
+ }
16439
16449
  const unicode_operators$1 = { "+": function(e3) {
16440
16450
  return e3.join(" ");
16441
16451
  }, "-": function(e3) {
@@ -16674,8 +16684,8 @@ const unicode_operators$1 = { "+": function(e3) {
16674
16684
  return e3[0] + " " + e3[1];
16675
16685
  } }, output_unicodeDefault$1 = true;
16676
16686
  let astToText$2$1 = class astToText$22 {
16677
- constructor({ output_unicode: e3 = output_unicodeDefault$1, padToDigits: t2 = null, padToDecimals: r2 = null, showBlanks: n3 = true, explicitMultiplicationSymbols: i2 = false } = {}) {
16678
- this.output_unicode = e3, this.operators = unicode_operators$1, e3 || (this.operators = nonunicode_operators$1), this.padToDigits = t2, this.padToDecimals = r2, this.showBlanks = n3, this.explicitMultiplicationSymbols = i2;
16687
+ constructor({ output_unicode: e3 = output_unicodeDefault$1, padToDigits: t2 = null, padToDecimals: r2 = null, avoidScientificNotation: n3 = false, showBlanks: i2 = true, explicitMultiplicationSymbols: a2 = false } = {}) {
16688
+ this.output_unicode = e3, this.operators = unicode_operators$1, e3 || (this.operators = nonunicode_operators$1), this.padToDigits = t2, this.padToDecimals = r2, this.avoidScientificNotation = n3, this.showBlanks = i2, this.explicitMultiplicationSymbols = a2;
16679
16689
  }
16680
16690
  convert(e3) {
16681
16691
  return this.statement(normalize_display_negative_fractions$1(e3));
@@ -16746,7 +16756,7 @@ let astToText$2$1 = class astToText$22 {
16746
16756
  }
16747
16757
  simple_factor_or_function_or_parens(e3) {
16748
16758
  let t2 = this.factor(e3);
16749
- return !!(t2.length <= 1 || "string" == typeof e3 && e3.match(/^\w+$/) || Array.isArray(e3) && "apply" === e3[0] || t2.match(/^\(.*\)$/) || t2.match(/^⟨.*⟩$/)) || "number" == typeof e3 && (e3 >= 0 && !e3.toString().includes("e"));
16759
+ return !!(t2.length <= 1 || "string" == typeof e3 && e3.match(/^\w+$/) || Array.isArray(e3) && "apply" === e3[0] || t2.match(/^\(.*\)$/) || t2.match(/^⟨.*⟩$/)) || "number" == typeof e3 && !(!(e3 >= 0) || !this.avoidScientificNotation && e3.toString().includes("e"));
16750
16760
  }
16751
16761
  factor(e3) {
16752
16762
  if ("string" == typeof e3) return this.symbolConvert(e3);
@@ -16756,7 +16766,7 @@ let astToText$2$1 = class astToText$22 {
16756
16766
  if (Number.isNaN(e3)) return "NaN";
16757
16767
  {
16758
16768
  let t3 = e3.toString(), r3 = t3.indexOf("e");
16759
- if (-1 === r3) return null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals$1(t3, this.padToDigits, this.padToDecimals)), t3;
16769
+ if (-1 === r3 || this.avoidScientificNotation) return -1 !== r3 && this.avoidScientificNotation && (t3 = expandScientificNotation$1(t3)), null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals$1(t3, this.padToDigits, this.padToDecimals)), t3;
16760
16770
  let n3 = t3.substring(0, r3), i2 = t3.substring(r3 + 1);
16761
16771
  if (null !== this.padToDigits || null !== this.padToDecimals) {
16762
16772
  let r4 = Number(i2);
@@ -20848,8 +20858,8 @@ const operators$1$1 = { "+": function(e3) {
20848
20858
  return "\\circ" === e3[1] ? e3[0] + "^{\\circ}" : e3[0] + " " + e3[1];
20849
20859
  } }, allowedLatexSymbolsDefault$1$1 = ["alpha", "beta", "gamma", "Gamma", "delta", "Delta", "epsilon", "zeta", "eta", "theta", "Theta", "iota", "kappa", "lambda", "Lambda", "mu", "nu", "xi", "Xi", "pi", "Pi", "rho", "sigma", "Sigma", "tau", "Tau", "upsilon", "Upsilon", "phi", "Phi", "chi", "psi", "Psi", "omega", "Omega", "partial", "abs", "exp", "log", "ln", "log10", "sign", "sqrt", "erf", "cos", "cosh", "cot", "coth", "csc", "csch", "sec", "sech", "sin", "sinh", "tan", "tanh", "arcsin", "arccos", "arctan", "arccsc", "arcsec", "arccot", "arg", "Re", "Im", "det", "angle", "perp", "circ", "%", "$", "int", "varnothing"], convertLatexSymbolsDefault$1 = { acos: "arccos", acosh: "arccosh", acot: "arccot", acoth: "arccoth", acsc: "arccsc", acsch: "arccsch", asec: "arcsec", asech: "arcsech", asin: "arcsin", asinh: "arcsinh", atan: "arctan", atanh: "arctanh", deg: "circ", emptyset: "varnothing" }, matrixEnvironmentDefault$1 = "bmatrix";
20850
20860
  let astToLatex$1$1 = class astToLatex$12 {
20851
- constructor({ allowedLatexSymbols: e3 = allowedLatexSymbolsDefault$1$1, convertLatexSymbols: t2 = convertLatexSymbolsDefault$1, matrixEnvironment: r2 = matrixEnvironmentDefault$1, padToDigits: n3 = null, padToDecimals: i2 = null, showBlanks: a2 = true } = {}) {
20852
- this.allowedLatexSymbols = e3, this.convertLatexSymbols = t2, this.matrixEnvironment = r2, this.padToDigits = n3, this.padToDecimals = i2, this.showBlanks = a2;
20861
+ constructor({ allowedLatexSymbols: e3 = allowedLatexSymbolsDefault$1$1, convertLatexSymbols: t2 = convertLatexSymbolsDefault$1, matrixEnvironment: r2 = matrixEnvironmentDefault$1, padToDigits: n3 = null, padToDecimals: i2 = null, avoidScientificNotation: a2 = false, showBlanks: o2 = true } = {}) {
20862
+ this.allowedLatexSymbols = e3, this.convertLatexSymbols = t2, this.matrixEnvironment = r2, this.padToDigits = n3, this.padToDecimals = i2, this.avoidScientificNotation = a2, this.showBlanks = o2;
20853
20863
  }
20854
20864
  convert(e3) {
20855
20865
  return this.statement(normalize_display_negative_fractions$1(e3));
@@ -20907,7 +20917,7 @@ let astToLatex$1$1 = class astToLatex$12 {
20907
20917
  }
20908
20918
  simple_factor_or_function_or_parens(e3) {
20909
20919
  var t2 = this.factor(e3);
20910
- return !!(t2.length <= 1 || "string" == typeof e3 && e3.match(/^\w+$/) || Array.isArray(e3) && "apply" === e3[0] && !["sqrt", "cbrt", "nthroot"].includes(e3[1]) || t2.match(/^\\left\(.*\\right\)$/) || t2.match(/^\\left\\langle.*\\right\\rangle$/)) || "number" == typeof e3 && (e3 >= 0 && !e3.toString().includes("e"));
20920
+ return !!(t2.length <= 1 || "string" == typeof e3 && e3.match(/^\w+$/) || Array.isArray(e3) && "apply" === e3[0] && !["sqrt", "cbrt", "nthroot"].includes(e3[1]) || t2.match(/^\\left\(.*\\right\)$/) || t2.match(/^\\left\\langle.*\\right\\rangle$/)) || "number" == typeof e3 && !(!(e3 >= 0) || !this.avoidScientificNotation && e3.toString().includes("e"));
20911
20921
  }
20912
20922
  stringConvert(e3) {
20913
20923
  return e3.length > 1 ? (this.convertLatexSymbols[e3] && (e3 = this.convertLatexSymbols[e3]), this.allowedLatexSymbols.includes(e3) ? "\\" + e3 : "\\operatorname{" + e3 + "}") : this.allowedLatexSymbols.includes(e3) ? "\\" + e3 : "_" !== e3 || this.showBlanks ? e3 : "";
@@ -20920,7 +20930,7 @@ let astToLatex$1$1 = class astToLatex$12 {
20920
20930
  if (Number.isNaN(e3)) return "NaN";
20921
20931
  {
20922
20932
  let t3 = e3.toString(), r3 = t3.indexOf("e");
20923
- if (-1 === r3) return null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals$1(t3, this.padToDigits, this.padToDecimals)), t3;
20933
+ if (-1 === r3 || this.avoidScientificNotation) return -1 !== r3 && this.avoidScientificNotation && (t3 = expandScientificNotation$1(t3)), null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals$1(t3, this.padToDigits, this.padToDecimals)), t3;
20924
20934
  let n3 = t3.substring(0, r3), i2 = t3.substring(r3 + 1);
20925
20935
  if ("+" === i2[0] && (i2 = i2.slice(1)), null !== this.padToDigits || null !== this.padToDecimals) {
20926
20936
  let r4 = Number(i2);
@@ -64750,6 +64760,16 @@ function normalize_display_negative_fractions_sub(e3, { inside_unary_minus: t2 =
64750
64760
  function normalize_display_negative_fractions(e3) {
64751
64761
  return normalize_display_negative_fractions_sub(e3, { inside_unary_minus: false });
64752
64762
  }
64763
+ function expandScientificNotation(e3) {
64764
+ let t2 = e3.indexOf("e");
64765
+ if (-1 === t2) return e3;
64766
+ let r2 = e3.substring(0, t2), n3 = Number(e3.substring(t2 + 1)), i2 = "";
64767
+ "-" !== r2[0] && "+" !== r2[0] || (i2 = "-" === r2[0] ? "-" : "", r2 = r2.substring(1));
64768
+ let a2 = r2.indexOf(".");
64769
+ -1 === a2 && (a2 = r2.length);
64770
+ let o2 = r2.replace(".", ""), s2 = a2 + n3;
64771
+ return s2 <= 0 ? i2 + "0." + "0".repeat(-s2) + o2 : s2 >= o2.length ? i2 + o2 + "0".repeat(s2 - o2.length) : i2 + o2.substring(0, s2) + "." + o2.substring(s2);
64772
+ }
64753
64773
  const unicode_operators = { "+": function(e3) {
64754
64774
  return e3.join(" ");
64755
64775
  }, "-": function(e3) {
@@ -64988,8 +65008,8 @@ const unicode_operators = { "+": function(e3) {
64988
65008
  return e3[0] + " " + e3[1];
64989
65009
  } }, output_unicodeDefault = true;
64990
65010
  let astToText$2 = class {
64991
- constructor({ output_unicode: e3 = output_unicodeDefault, padToDigits: t2 = null, padToDecimals: r2 = null, showBlanks: n3 = true, explicitMultiplicationSymbols: i2 = false } = {}) {
64992
- this.output_unicode = e3, this.operators = unicode_operators, e3 || (this.operators = nonunicode_operators), this.padToDigits = t2, this.padToDecimals = r2, this.showBlanks = n3, this.explicitMultiplicationSymbols = i2;
65011
+ constructor({ output_unicode: e3 = output_unicodeDefault, padToDigits: t2 = null, padToDecimals: r2 = null, avoidScientificNotation: n3 = false, showBlanks: i2 = true, explicitMultiplicationSymbols: a2 = false } = {}) {
65012
+ this.output_unicode = e3, this.operators = unicode_operators, e3 || (this.operators = nonunicode_operators), this.padToDigits = t2, this.padToDecimals = r2, this.avoidScientificNotation = n3, this.showBlanks = i2, this.explicitMultiplicationSymbols = a2;
64993
65013
  }
64994
65014
  convert(e3) {
64995
65015
  return this.statement(normalize_display_negative_fractions(e3));
@@ -65060,7 +65080,7 @@ let astToText$2 = class {
65060
65080
  }
65061
65081
  simple_factor_or_function_or_parens(e3) {
65062
65082
  let t2 = this.factor(e3);
65063
- return !!(t2.length <= 1 || "string" == typeof e3 && e3.match(/^\w+$/) || Array.isArray(e3) && "apply" === e3[0] || t2.match(/^\(.*\)$/) || t2.match(/^⟨.*⟩$/)) || "number" == typeof e3 && (e3 >= 0 && !e3.toString().includes("e"));
65083
+ return !!(t2.length <= 1 || "string" == typeof e3 && e3.match(/^\w+$/) || Array.isArray(e3) && "apply" === e3[0] || t2.match(/^\(.*\)$/) || t2.match(/^⟨.*⟩$/)) || "number" == typeof e3 && !(!(e3 >= 0) || !this.avoidScientificNotation && e3.toString().includes("e"));
65064
65084
  }
65065
65085
  factor(e3) {
65066
65086
  if ("string" == typeof e3) return this.symbolConvert(e3);
@@ -65070,7 +65090,7 @@ let astToText$2 = class {
65070
65090
  if (Number.isNaN(e3)) return "NaN";
65071
65091
  {
65072
65092
  let t3 = e3.toString(), r3 = t3.indexOf("e");
65073
- if (-1 === r3) return null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals(t3, this.padToDigits, this.padToDecimals)), t3;
65093
+ if (-1 === r3 || this.avoidScientificNotation) return -1 !== r3 && this.avoidScientificNotation && (t3 = expandScientificNotation(t3)), null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals(t3, this.padToDigits, this.padToDecimals)), t3;
65074
65094
  let n3 = t3.substring(0, r3), i2 = t3.substring(r3 + 1);
65075
65095
  if (null !== this.padToDigits || null !== this.padToDecimals) {
65076
65096
  let r4 = Number(i2);
@@ -69162,8 +69182,8 @@ const operators$1 = { "+": function(e3) {
69162
69182
  return "\\circ" === e3[1] ? e3[0] + "^{\\circ}" : e3[0] + " " + e3[1];
69163
69183
  } }, allowedLatexSymbolsDefault$1 = ["alpha", "beta", "gamma", "Gamma", "delta", "Delta", "epsilon", "zeta", "eta", "theta", "Theta", "iota", "kappa", "lambda", "Lambda", "mu", "nu", "xi", "Xi", "pi", "Pi", "rho", "sigma", "Sigma", "tau", "Tau", "upsilon", "Upsilon", "phi", "Phi", "chi", "psi", "Psi", "omega", "Omega", "partial", "abs", "exp", "log", "ln", "log10", "sign", "sqrt", "erf", "cos", "cosh", "cot", "coth", "csc", "csch", "sec", "sech", "sin", "sinh", "tan", "tanh", "arcsin", "arccos", "arctan", "arccsc", "arcsec", "arccot", "arg", "Re", "Im", "det", "angle", "perp", "circ", "%", "$", "int", "varnothing"], convertLatexSymbolsDefault = { acos: "arccos", acosh: "arccosh", acot: "arccot", acoth: "arccoth", acsc: "arccsc", acsch: "arccsch", asec: "arcsec", asech: "arcsech", asin: "arcsin", asinh: "arcsinh", atan: "arctan", atanh: "arctanh", deg: "circ", emptyset: "varnothing" }, matrixEnvironmentDefault = "bmatrix";
69164
69184
  let astToLatex$1 = class {
69165
- constructor({ allowedLatexSymbols: e3 = allowedLatexSymbolsDefault$1, convertLatexSymbols: t2 = convertLatexSymbolsDefault, matrixEnvironment: r2 = matrixEnvironmentDefault, padToDigits: n3 = null, padToDecimals: i2 = null, showBlanks: a2 = true } = {}) {
69166
- this.allowedLatexSymbols = e3, this.convertLatexSymbols = t2, this.matrixEnvironment = r2, this.padToDigits = n3, this.padToDecimals = i2, this.showBlanks = a2;
69185
+ constructor({ allowedLatexSymbols: e3 = allowedLatexSymbolsDefault$1, convertLatexSymbols: t2 = convertLatexSymbolsDefault, matrixEnvironment: r2 = matrixEnvironmentDefault, padToDigits: n3 = null, padToDecimals: i2 = null, avoidScientificNotation: a2 = false, showBlanks: o2 = true } = {}) {
69186
+ this.allowedLatexSymbols = e3, this.convertLatexSymbols = t2, this.matrixEnvironment = r2, this.padToDigits = n3, this.padToDecimals = i2, this.avoidScientificNotation = a2, this.showBlanks = o2;
69167
69187
  }
69168
69188
  convert(e3) {
69169
69189
  return this.statement(normalize_display_negative_fractions(e3));
@@ -69221,7 +69241,7 @@ let astToLatex$1 = class {
69221
69241
  }
69222
69242
  simple_factor_or_function_or_parens(e3) {
69223
69243
  var t2 = this.factor(e3);
69224
- return !!(t2.length <= 1 || "string" == typeof e3 && e3.match(/^\w+$/) || Array.isArray(e3) && "apply" === e3[0] && !["sqrt", "cbrt", "nthroot"].includes(e3[1]) || t2.match(/^\\left\(.*\\right\)$/) || t2.match(/^\\left\\langle.*\\right\\rangle$/)) || "number" == typeof e3 && (e3 >= 0 && !e3.toString().includes("e"));
69244
+ return !!(t2.length <= 1 || "string" == typeof e3 && e3.match(/^\w+$/) || Array.isArray(e3) && "apply" === e3[0] && !["sqrt", "cbrt", "nthroot"].includes(e3[1]) || t2.match(/^\\left\(.*\\right\)$/) || t2.match(/^\\left\\langle.*\\right\\rangle$/)) || "number" == typeof e3 && !(!(e3 >= 0) || !this.avoidScientificNotation && e3.toString().includes("e"));
69225
69245
  }
69226
69246
  stringConvert(e3) {
69227
69247
  return e3.length > 1 ? (this.convertLatexSymbols[e3] && (e3 = this.convertLatexSymbols[e3]), this.allowedLatexSymbols.includes(e3) ? "\\" + e3 : "\\operatorname{" + e3 + "}") : this.allowedLatexSymbols.includes(e3) ? "\\" + e3 : "_" !== e3 || this.showBlanks ? e3 : "";
@@ -69234,7 +69254,7 @@ let astToLatex$1 = class {
69234
69254
  if (Number.isNaN(e3)) return "NaN";
69235
69255
  {
69236
69256
  let t3 = e3.toString(), r3 = t3.indexOf("e");
69237
- if (-1 === r3) return null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals(t3, this.padToDigits, this.padToDecimals)), t3;
69257
+ if (-1 === r3 || this.avoidScientificNotation) return -1 !== r3 && this.avoidScientificNotation && (t3 = expandScientificNotation(t3)), null === this.padToDigits && null === this.padToDecimals || (t3 = padNumberStringToDigitsAndDecimals(t3, this.padToDigits, this.padToDecimals)), t3;
69238
69258
  let n3 = t3.substring(0, r3), i2 = t3.substring(r3 + 1);
69239
69259
  if ("+" === i2[0] && (i2 = i2.slice(1)), null !== this.padToDigits || null !== this.padToDecimals) {
69240
69260
  let r4 = Number(i2);
@@ -73655,7 +73675,7 @@ function ExternalVirtualKeyboard() {
73655
73675
  }
73656
73676
  );
73657
73677
  }
73658
- const version = "0.7.15";
73678
+ const version = "0.7.16-dev.20260428024558.bb726cf";
73659
73679
  const latestDoenetmlVersion = version;
73660
73680
  function DoenetViewer({
73661
73681
  doenetML,