@pie-element/explicit-constructed-response 6.22.3-next.4 → 6.22.3-next.8

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.
@@ -8,7 +8,7 @@
8
8
  "@material-ui/core": "^3.9.2",
9
9
  "@material-ui/icons": "^3.0.1",
10
10
  "@pie-framework/pie-configure-events": "^1.3.0",
11
- "@pie-lib/pie-toolbox": "1.30.2",
11
+ "@pie-lib/pie-toolbox": "1.31.0",
12
12
  "classnames": "^2.2.6",
13
13
  "debug": "^3.1.0",
14
14
  "lodash": "^4.17.15",
@@ -8,7 +8,7 @@
8
8
  "author": "",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "@pie-lib/pie-toolbox": "1.30.2",
11
+ "@pie-lib/pie-toolbox": "1.31.0",
12
12
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15",
14
14
  "type-of": "^2.0.1"
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.23.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.23.2/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@4.24.3/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
package/module/element.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.23.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.23.2/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.24.3/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
@@ -19152,34 +19152,49 @@ var mathjaxScript = {};
19152
19152
  Object.defineProperty(mathjaxScript, "__esModule", {
19153
19153
  value: true
19154
19154
  });
19155
- mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
19155
+ mathjaxScript.mathRenderingKEY = mathjaxScript.mathRenderingAccessibleKEY = mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
19156
19156
  var _renderMath = renderMath$2;
19157
19157
  var MathJaxVersion = '3.2.2';
19158
19158
  mathjaxScript.MathJaxVersion = MathJaxVersion;
19159
- var initializeMathJax = function initializeMathJax(renderOpts) {
19160
- if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
19161
- console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
19162
- }
19163
- var texConfig = renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar ? {
19164
- macros: {
19165
- parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
19166
- overarc: '\\overparen',
19167
- napprox: '\\not\\approx',
19168
- longdiv: '\\enclose{longdiv}'
19169
- },
19170
- inlineMath: [['$', '$'], ['\\(', '\\)']],
19171
- processEscapes: true,
19172
- displayMath: [['$$', '$$'], ['\\[', '\\]']]
19173
- } : {
19174
- macros: {
19175
- parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
19176
- overarc: '\\overparen',
19177
- napprox: '\\not\\approx',
19178
- longdiv: '\\enclose{longdiv}'
19179
- },
19180
- displayMath: [['$$', '$$'], ['\\[', '\\]']]
19181
- };
19182
- window.mathjaxLoadedP = new Promise(function (resolve) {
19159
+ var mathRenderingKEY = '@pie-lib/math-rendering@2';
19160
+ mathjaxScript.mathRenderingKEY = mathRenderingKEY;
19161
+ var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
19162
+ mathjaxScript.mathRenderingAccessibleKEY = mathRenderingAccessibleKEY;
19163
+ var getMathJaxCustomKey = function getMathJaxCustomKey() {
19164
+ var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
19165
+ return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
19166
+ };
19167
+ var mathJaxCustomKey = getMathJaxCustomKey();
19168
+ var defaultOpts = function defaultOpts() {
19169
+ return (0, _renderMath.getGlobal)().opts || ({});
19170
+ };
19171
+ var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFullPage) {
19172
+ window.MathJaxInitialised = true;
19173
+ renderOpts = renderOpts || defaultOpts();
19174
+ if ((!window.MathJax || window.MathJax.version !== MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
19175
+ var _renderOpts, _renderOpts2;
19176
+ if ((_renderOpts = renderOpts) !== null && _renderOpts !== void 0 && _renderOpts.useSingleDollar) {
19177
+ console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
19178
+ }
19179
+ var texConfig = (_renderOpts2 = renderOpts) !== null && _renderOpts2 !== void 0 && _renderOpts2.useSingleDollar ? {
19180
+ macros: {
19181
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
19182
+ overarc: '\\overparen',
19183
+ napprox: '\\not\\approx',
19184
+ longdiv: '\\enclose{longdiv}'
19185
+ },
19186
+ inlineMath: [['$', '$'], ['\\(', '\\)']],
19187
+ processEscapes: true,
19188
+ displayMath: [['$$', '$$'], ['\\[', '\\]']]
19189
+ } : {
19190
+ macros: {
19191
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
19192
+ overarc: '\\overparen',
19193
+ napprox: '\\not\\approx',
19194
+ longdiv: '\\enclose{longdiv}'
19195
+ },
19196
+ displayMath: [['$$', '$$'], ['\\[', '\\]']]
19197
+ };
19183
19198
  window.MathJax = {
19184
19199
  startup: {
19185
19200
  typeset: false,
@@ -19198,7 +19213,10 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
19198
19213
  MathJax.startup.defaultReady();
19199
19214
  var globalObj = (0, _renderMath.getGlobal)();
19200
19215
  globalObj.instance = MathJax;
19201
- resolve();
19216
+ if (processMathJaxFullPage) {
19217
+ processMathJaxFullPage();
19218
+ }
19219
+ window.MathJaxLoaded = true;
19202
19220
  }
19203
19221
  },
19204
19222
  loader: {
@@ -19229,7 +19247,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
19229
19247
  script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
19230
19248
  script.async = true;
19231
19249
  document.body.appendChild(script);
19232
- });
19250
+ }
19233
19251
  };
19234
19252
  mathjaxScript.initializeMathJax = initializeMathJax;
19235
19253
  var normalization$1 = {};
@@ -78907,7 +78925,7 @@ getDefaultExportFromCjs(mathRendering);
78907
78925
  Object.defineProperty(exports, "__esModule", {
78908
78926
  value: true
78909
78927
  });
78910
- exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
78928
+ exports.initializeMathJaxScript = exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
78911
78929
  var _typeof2 = _interopRequireDefault(_typeof$d.exports);
78912
78930
  var _mathjaxScript = mathjaxScript;
78913
78931
  var _normalization = normalization$1;
@@ -78958,22 +78976,17 @@ getDefaultExportFromCjs(mathRendering);
78958
78976
  };
78959
78977
  var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
78960
78978
  var NEWLINE_LATEX = '\\newline ';
78961
- var mathRenderingKEY = '@pie-lib/math-rendering@2';
78962
- var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
78963
78979
  var getGlobal = function getGlobal() {
78964
78980
  if (typeof window !== 'undefined') {
78965
- if (!window[mathRenderingAccessibleKEY]) {
78966
- window[mathRenderingAccessibleKEY] = {};
78981
+ if (!window[_mathjaxScript.mathRenderingAccessibleKEY]) {
78982
+ window[_mathjaxScript.mathRenderingAccessibleKEY] = {};
78967
78983
  }
78968
- return window[mathRenderingAccessibleKEY];
78984
+ return window[_mathjaxScript.mathRenderingAccessibleKEY];
78969
78985
  } else {
78970
78986
  return {};
78971
78987
  }
78972
78988
  };
78973
78989
  exports.getGlobal = getGlobal;
78974
- var defaultOpts = function defaultOpts() {
78975
- return getGlobal().opts || ({});
78976
- };
78977
78990
  var fixMathElement = function fixMathElement(element) {
78978
78991
  if (element.dataset.mathHandled) {
78979
78992
  return;
@@ -79038,80 +79051,84 @@ getDefaultExportFromCjs(mathRendering);
79038
79051
  }
79039
79052
  });
79040
79053
  };
79041
- var getMathJaxCustomKey = function getMathJaxCustomKey() {
79042
- var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
79043
- return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
79054
+ var processMathJaxFullPage = function processMathJaxFullPage(executeOn) {
79055
+ executeOn = executeOn || document.body;
79056
+ var mathJaxInstance = getGlobal().instance;
79057
+ if (mathJaxInstance) {
79058
+ mathJaxInstance.texReset();
79059
+ mathJaxInstance.typesetClear();
79060
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
79061
+ try {
79062
+ removeExcessMjxContainers(executeOn);
79063
+ removePlaceholdersAndRestoreDisplay();
79064
+ var updatedDocument = mathJaxInstance.startup.document;
79065
+ var list = updatedDocument.math.list;
79066
+ for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
79067
+ var mathMl = toMMl(item.data.root);
79068
+ var parsedMathMl = mathMl.replaceAll('\n', '');
79069
+ item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
79070
+ }
79071
+ } catch (e) {
79072
+ console.error('Error post-processing MathJax typesetting:', e.toString());
79073
+ }
79074
+ mathJaxInstance.startup.document.clear();
79075
+ })["catch"](function (error) {
79076
+ console.error('Error in typesetting with MathJax:', error);
79077
+ });
79078
+ }
79079
+ };
79080
+ var initializeMathJaxScript = function initializeMathJaxScript(renderOpts) {
79081
+ if (!window.MathJaxInitialised) {
79082
+ (0, _mathjaxScript.initializeMathJax)(renderOpts, processMathJaxFullPage);
79083
+ }
79044
79084
  };
79085
+ exports.initializeMathJaxScript = initializeMathJaxScript;
79045
79086
  var renderMath = function renderMath(el, renderOpts) {
79046
79087
  var isString = typeof el === 'string';
79088
+ var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
79047
79089
  var executeOn = document.body;
79048
79090
  if (isString) {
79049
79091
  var div = document.createElement('div');
79050
79092
  div.innerHTML = el;
79051
79093
  executeOn = div;
79052
79094
  }
79053
- var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
79054
79095
  var renderMathAccessible = function renderMathAccessible() {
79055
79096
  fixMathElements(executeOn);
79056
79097
  adjustMathMLStyle(executeOn);
79057
- var mathJaxCustomKey = getMathJaxCustomKey();
79058
- if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
79059
- renderOpts = renderOpts || defaultOpts();
79060
- (0, _mathjaxScript.initializeMathJax)(renderOpts);
79061
- }
79062
- if (isString && window.MathJax && window.mathjaxLoadedP) {
79063
- try {
79064
- MathJax.texReset();
79065
- MathJax.typesetClear();
79066
- window.MathJax.typeset([executeOn]);
79067
- var updatedDocument = window.MathJax.startup.document;
79068
- var list = updatedDocument.math.list;
79069
- var item = list.next;
79070
- var mathMl = toMMl(item.data.root);
79071
- var parsedMathMl = mathMl.replaceAll('\n', '');
79072
- return parsedMathMl;
79073
- } catch (error) {
79074
- console.error('Error rendering math:', error.message);
79075
- }
79098
+ if (!window.MathJaxInitialised) {
79099
+ (0, _mathjaxScript.initializeMathJax)(renderOpts, function () {
79100
+ return processMathJaxFullPage(executeOn);
79101
+ });
79102
+ return;
79076
79103
  }
79077
- if (window.mathjaxLoadedP) {
79078
- window.mathjaxLoadedP.then(function () {
79079
- var mathJaxInstance = getGlobal().instance;
79080
- if (mathJaxInstance) {
79081
- mathJaxInstance.texReset();
79082
- mathJaxInstance.typesetClear();
79083
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
79084
- try {
79085
- removeExcessMjxContainers(executeOn);
79086
- removePlaceholdersAndRestoreDisplay();
79087
- var _updatedDocument = mathJaxInstance.startup.document;
79088
- var _list = _updatedDocument.math.list;
79089
- for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
79090
- var _mathMl = toMMl(_item.data.root);
79091
- var _parsedMathMl = _mathMl.replaceAll('\n', '');
79092
- _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
79093
- }
79094
- } catch (e) {
79095
- console.error('Error post-processing MathJax typesetting:', e.toString());
79096
- }
79097
- mathJaxInstance.startup.document.clear();
79098
- })["catch"](function (error) {
79099
- console.error('Error in typesetting with MathJax:', error);
79100
- });
79104
+ if (window.MathJaxLoaded) {
79105
+ if (isString) {
79106
+ try {
79107
+ MathJax.texReset();
79108
+ MathJax.typesetClear();
79109
+ window.MathJax.typeset([executeOn]);
79110
+ var updatedDocument = window.MathJax.startup.document;
79111
+ var list = updatedDocument.math.list;
79112
+ var item = list.next;
79113
+ var mathMl = toMMl(item.data.root);
79114
+ var parsedMathMl = mathMl.replaceAll('\n', '');
79115
+ return parsedMathMl;
79116
+ } catch (error) {
79117
+ console.error('Error rendering math:', error.message);
79118
+ return '';
79101
79119
  }
79102
- })["catch"](function (error) {
79103
- console.error('Error in initializing MathJax:', error);
79104
- });
79120
+ }
79121
+ processMathJaxFullPage(executeOn);
79105
79122
  }
79106
79123
  };
79107
79124
  if (skipWaitForMathRenderingLib) {
79108
79125
  return renderMathAccessible();
79109
79126
  } else {
79110
- if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
79127
+ if (window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance) {
79111
79128
  removePlaceholdersAndRestoreDisplay();
79112
79129
  return mr.renderMath(executeOn, renderOpts);
79113
79130
  }
79114
- if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
79131
+ if (window.hasOwnProperty(_mathjaxScript.mathRenderingAccessibleKEY) && window[_mathjaxScript.mathRenderingAccessibleKEY].instance) {
79115
79132
  return renderMathAccessible();
79116
79133
  }
79117
79134
  var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
@@ -79121,7 +79138,7 @@ getDefaultExportFromCjs(mathRendering);
79121
79138
  var maxWaitTime = 500;
79122
79139
  var startTime = Date.now();
79123
79140
  var checkForLib = function checkForLib() {
79124
- var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
79141
+ var mathRenderingHasLoaded = window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance;
79125
79142
  var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
79126
79143
  if (mathRenderingHasLoaded || hasExceededMaxWait) {
79127
79144
  clearInterval(checkIntervalId);
@@ -79156,9 +79173,16 @@ var mmlToLatex = {};
79156
79173
  getDefaultExportFromCjs(mmlToLatex);
79157
79174
  (function (exports) {
79158
79175
  var _interopRequireDefault = interopRequireDefault.exports;
79176
+ var _typeof = _typeof$d.exports;
79159
79177
  Object.defineProperty(exports, "__esModule", {
79160
79178
  value: true
79161
79179
  });
79180
+ Object.defineProperty(exports, "initializeMathJaxScript", {
79181
+ enumerable: true,
79182
+ get: function get() {
79183
+ return _renderMath.initializeMathJaxScript;
79184
+ }
79185
+ });
79162
79186
  Object.defineProperty(exports, "mmlToLatex", {
79163
79187
  enumerable: true,
79164
79188
  get: function get() {
@@ -79183,9 +79207,48 @@ getDefaultExportFromCjs(mmlToLatex);
79183
79207
  return _normalization.wrapMath;
79184
79208
  }
79185
79209
  });
79186
- var _renderMath = _interopRequireDefault(renderMath$2);
79210
+ var _renderMath = _interopRequireWildcard(renderMath$2);
79187
79211
  var _mmlToLatex = _interopRequireDefault(mmlToLatex);
79188
79212
  var _normalization = normalization$1;
79213
+ function _getRequireWildcardCache(nodeInterop) {
79214
+ if (typeof WeakMap !== "function") return null;
79215
+ var cacheBabelInterop = new WeakMap();
79216
+ var cacheNodeInterop = new WeakMap();
79217
+ return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
79218
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
79219
+ })(nodeInterop);
79220
+ }
79221
+ function _interopRequireWildcard(obj, nodeInterop) {
79222
+ if (!nodeInterop && obj && obj.__esModule) {
79223
+ return obj;
79224
+ }
79225
+ if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
79226
+ return {
79227
+ "default": obj
79228
+ };
79229
+ }
79230
+ var cache = _getRequireWildcardCache(nodeInterop);
79231
+ if (cache && cache.has(obj)) {
79232
+ return cache.get(obj);
79233
+ }
79234
+ var newObj = {};
79235
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
79236
+ for (var key in obj) {
79237
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
79238
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
79239
+ if (desc && (desc.get || desc.set)) {
79240
+ Object.defineProperty(newObj, key, desc);
79241
+ } else {
79242
+ newObj[key] = obj[key];
79243
+ }
79244
+ }
79245
+ }
79246
+ newObj["default"] = obj;
79247
+ if (cache) {
79248
+ cache.set(obj, newObj);
79249
+ }
79250
+ return newObj;
79251
+ }
79189
79252
  })(mathRenderingAccessible);
79190
79253
  getDefaultExportFromCjs(mathRenderingAccessible);
79191
79254
  var choices = {};
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "1.23.1"
7
+ "version": "1.23.2"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
package/module/print.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.23.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_react_dom, _dll_classnames, _dll_pie_lib__pie_toolbox_math_rendering_accessible} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.23.2/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_correct_answer_toggle, _dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.24.3/module/index.js";
3
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
4
  function getDefaultExportFromCjs(x) {
@@ -19115,34 +19115,49 @@ var mathjaxScript = {};
19115
19115
  Object.defineProperty(mathjaxScript, "__esModule", {
19116
19116
  value: true
19117
19117
  });
19118
- mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
19118
+ mathjaxScript.mathRenderingKEY = mathjaxScript.mathRenderingAccessibleKEY = mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
19119
19119
  var _renderMath = renderMath$2;
19120
19120
  var MathJaxVersion = '3.2.2';
19121
19121
  mathjaxScript.MathJaxVersion = MathJaxVersion;
19122
- var initializeMathJax = function initializeMathJax(renderOpts) {
19123
- if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
19124
- console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
19125
- }
19126
- var texConfig = renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar ? {
19127
- macros: {
19128
- parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
19129
- overarc: '\\overparen',
19130
- napprox: '\\not\\approx',
19131
- longdiv: '\\enclose{longdiv}'
19132
- },
19133
- inlineMath: [['$', '$'], ['\\(', '\\)']],
19134
- processEscapes: true,
19135
- displayMath: [['$$', '$$'], ['\\[', '\\]']]
19136
- } : {
19137
- macros: {
19138
- parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
19139
- overarc: '\\overparen',
19140
- napprox: '\\not\\approx',
19141
- longdiv: '\\enclose{longdiv}'
19142
- },
19143
- displayMath: [['$$', '$$'], ['\\[', '\\]']]
19144
- };
19145
- window.mathjaxLoadedP = new Promise(function (resolve) {
19122
+ var mathRenderingKEY = '@pie-lib/math-rendering@2';
19123
+ mathjaxScript.mathRenderingKEY = mathRenderingKEY;
19124
+ var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
19125
+ mathjaxScript.mathRenderingAccessibleKEY = mathRenderingAccessibleKEY;
19126
+ var getMathJaxCustomKey = function getMathJaxCustomKey() {
19127
+ var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
19128
+ return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
19129
+ };
19130
+ var mathJaxCustomKey = getMathJaxCustomKey();
19131
+ var defaultOpts = function defaultOpts() {
19132
+ return (0, _renderMath.getGlobal)().opts || ({});
19133
+ };
19134
+ var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFullPage) {
19135
+ window.MathJaxInitialised = true;
19136
+ renderOpts = renderOpts || defaultOpts();
19137
+ if ((!window.MathJax || window.MathJax.version !== MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
19138
+ var _renderOpts, _renderOpts2;
19139
+ if ((_renderOpts = renderOpts) !== null && _renderOpts !== void 0 && _renderOpts.useSingleDollar) {
19140
+ console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
19141
+ }
19142
+ var texConfig = (_renderOpts2 = renderOpts) !== null && _renderOpts2 !== void 0 && _renderOpts2.useSingleDollar ? {
19143
+ macros: {
19144
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
19145
+ overarc: '\\overparen',
19146
+ napprox: '\\not\\approx',
19147
+ longdiv: '\\enclose{longdiv}'
19148
+ },
19149
+ inlineMath: [['$', '$'], ['\\(', '\\)']],
19150
+ processEscapes: true,
19151
+ displayMath: [['$$', '$$'], ['\\[', '\\]']]
19152
+ } : {
19153
+ macros: {
19154
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
19155
+ overarc: '\\overparen',
19156
+ napprox: '\\not\\approx',
19157
+ longdiv: '\\enclose{longdiv}'
19158
+ },
19159
+ displayMath: [['$$', '$$'], ['\\[', '\\]']]
19160
+ };
19146
19161
  window.MathJax = {
19147
19162
  startup: {
19148
19163
  typeset: false,
@@ -19161,7 +19176,10 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
19161
19176
  MathJax.startup.defaultReady();
19162
19177
  var globalObj = (0, _renderMath.getGlobal)();
19163
19178
  globalObj.instance = MathJax;
19164
- resolve();
19179
+ if (processMathJaxFullPage) {
19180
+ processMathJaxFullPage();
19181
+ }
19182
+ window.MathJaxLoaded = true;
19165
19183
  }
19166
19184
  },
19167
19185
  loader: {
@@ -19192,7 +19210,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
19192
19210
  script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
19193
19211
  script.async = true;
19194
19212
  document.body.appendChild(script);
19195
- });
19213
+ }
19196
19214
  };
19197
19215
  mathjaxScript.initializeMathJax = initializeMathJax;
19198
19216
  var normalization$1 = {};
@@ -78870,7 +78888,7 @@ getDefaultExportFromCjs(mathRendering);
78870
78888
  Object.defineProperty(exports, "__esModule", {
78871
78889
  value: true
78872
78890
  });
78873
- exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
78891
+ exports.initializeMathJaxScript = exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
78874
78892
  var _typeof2 = _interopRequireDefault(_typeof$d.exports);
78875
78893
  var _mathjaxScript = mathjaxScript;
78876
78894
  var _normalization = normalization$1;
@@ -78921,22 +78939,17 @@ getDefaultExportFromCjs(mathRendering);
78921
78939
  };
78922
78940
  var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
78923
78941
  var NEWLINE_LATEX = '\\newline ';
78924
- var mathRenderingKEY = '@pie-lib/math-rendering@2';
78925
- var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
78926
78942
  var getGlobal = function getGlobal() {
78927
78943
  if (typeof window !== 'undefined') {
78928
- if (!window[mathRenderingAccessibleKEY]) {
78929
- window[mathRenderingAccessibleKEY] = {};
78944
+ if (!window[_mathjaxScript.mathRenderingAccessibleKEY]) {
78945
+ window[_mathjaxScript.mathRenderingAccessibleKEY] = {};
78930
78946
  }
78931
- return window[mathRenderingAccessibleKEY];
78947
+ return window[_mathjaxScript.mathRenderingAccessibleKEY];
78932
78948
  } else {
78933
78949
  return {};
78934
78950
  }
78935
78951
  };
78936
78952
  exports.getGlobal = getGlobal;
78937
- var defaultOpts = function defaultOpts() {
78938
- return getGlobal().opts || ({});
78939
- };
78940
78953
  var fixMathElement = function fixMathElement(element) {
78941
78954
  if (element.dataset.mathHandled) {
78942
78955
  return;
@@ -79001,80 +79014,84 @@ getDefaultExportFromCjs(mathRendering);
79001
79014
  }
79002
79015
  });
79003
79016
  };
79004
- var getMathJaxCustomKey = function getMathJaxCustomKey() {
79005
- var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
79006
- return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
79017
+ var processMathJaxFullPage = function processMathJaxFullPage(executeOn) {
79018
+ executeOn = executeOn || document.body;
79019
+ var mathJaxInstance = getGlobal().instance;
79020
+ if (mathJaxInstance) {
79021
+ mathJaxInstance.texReset();
79022
+ mathJaxInstance.typesetClear();
79023
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
79024
+ try {
79025
+ removeExcessMjxContainers(executeOn);
79026
+ removePlaceholdersAndRestoreDisplay();
79027
+ var updatedDocument = mathJaxInstance.startup.document;
79028
+ var list = updatedDocument.math.list;
79029
+ for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
79030
+ var mathMl = toMMl(item.data.root);
79031
+ var parsedMathMl = mathMl.replaceAll('\n', '');
79032
+ item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
79033
+ }
79034
+ } catch (e) {
79035
+ console.error('Error post-processing MathJax typesetting:', e.toString());
79036
+ }
79037
+ mathJaxInstance.startup.document.clear();
79038
+ })["catch"](function (error) {
79039
+ console.error('Error in typesetting with MathJax:', error);
79040
+ });
79041
+ }
79042
+ };
79043
+ var initializeMathJaxScript = function initializeMathJaxScript(renderOpts) {
79044
+ if (!window.MathJaxInitialised) {
79045
+ (0, _mathjaxScript.initializeMathJax)(renderOpts, processMathJaxFullPage);
79046
+ }
79007
79047
  };
79048
+ exports.initializeMathJaxScript = initializeMathJaxScript;
79008
79049
  var renderMath = function renderMath(el, renderOpts) {
79009
79050
  var isString = typeof el === 'string';
79051
+ var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
79010
79052
  var executeOn = document.body;
79011
79053
  if (isString) {
79012
79054
  var div = document.createElement('div');
79013
79055
  div.innerHTML = el;
79014
79056
  executeOn = div;
79015
79057
  }
79016
- var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
79017
79058
  var renderMathAccessible = function renderMathAccessible() {
79018
79059
  fixMathElements(executeOn);
79019
79060
  adjustMathMLStyle(executeOn);
79020
- var mathJaxCustomKey = getMathJaxCustomKey();
79021
- if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
79022
- renderOpts = renderOpts || defaultOpts();
79023
- (0, _mathjaxScript.initializeMathJax)(renderOpts);
79024
- }
79025
- if (isString && window.MathJax && window.mathjaxLoadedP) {
79026
- try {
79027
- MathJax.texReset();
79028
- MathJax.typesetClear();
79029
- window.MathJax.typeset([executeOn]);
79030
- var updatedDocument = window.MathJax.startup.document;
79031
- var list = updatedDocument.math.list;
79032
- var item = list.next;
79033
- var mathMl = toMMl(item.data.root);
79034
- var parsedMathMl = mathMl.replaceAll('\n', '');
79035
- return parsedMathMl;
79036
- } catch (error) {
79037
- console.error('Error rendering math:', error.message);
79038
- }
79061
+ if (!window.MathJaxInitialised) {
79062
+ (0, _mathjaxScript.initializeMathJax)(renderOpts, function () {
79063
+ return processMathJaxFullPage(executeOn);
79064
+ });
79065
+ return;
79039
79066
  }
79040
- if (window.mathjaxLoadedP) {
79041
- window.mathjaxLoadedP.then(function () {
79042
- var mathJaxInstance = getGlobal().instance;
79043
- if (mathJaxInstance) {
79044
- mathJaxInstance.texReset();
79045
- mathJaxInstance.typesetClear();
79046
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
79047
- try {
79048
- removeExcessMjxContainers(executeOn);
79049
- removePlaceholdersAndRestoreDisplay();
79050
- var _updatedDocument = mathJaxInstance.startup.document;
79051
- var _list = _updatedDocument.math.list;
79052
- for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
79053
- var _mathMl = toMMl(_item.data.root);
79054
- var _parsedMathMl = _mathMl.replaceAll('\n', '');
79055
- _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
79056
- }
79057
- } catch (e) {
79058
- console.error('Error post-processing MathJax typesetting:', e.toString());
79059
- }
79060
- mathJaxInstance.startup.document.clear();
79061
- })["catch"](function (error) {
79062
- console.error('Error in typesetting with MathJax:', error);
79063
- });
79067
+ if (window.MathJaxLoaded) {
79068
+ if (isString) {
79069
+ try {
79070
+ MathJax.texReset();
79071
+ MathJax.typesetClear();
79072
+ window.MathJax.typeset([executeOn]);
79073
+ var updatedDocument = window.MathJax.startup.document;
79074
+ var list = updatedDocument.math.list;
79075
+ var item = list.next;
79076
+ var mathMl = toMMl(item.data.root);
79077
+ var parsedMathMl = mathMl.replaceAll('\n', '');
79078
+ return parsedMathMl;
79079
+ } catch (error) {
79080
+ console.error('Error rendering math:', error.message);
79081
+ return '';
79064
79082
  }
79065
- })["catch"](function (error) {
79066
- console.error('Error in initializing MathJax:', error);
79067
- });
79083
+ }
79084
+ processMathJaxFullPage(executeOn);
79068
79085
  }
79069
79086
  };
79070
79087
  if (skipWaitForMathRenderingLib) {
79071
79088
  return renderMathAccessible();
79072
79089
  } else {
79073
- if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
79090
+ if (window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance) {
79074
79091
  removePlaceholdersAndRestoreDisplay();
79075
79092
  return mr.renderMath(executeOn, renderOpts);
79076
79093
  }
79077
- if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
79094
+ if (window.hasOwnProperty(_mathjaxScript.mathRenderingAccessibleKEY) && window[_mathjaxScript.mathRenderingAccessibleKEY].instance) {
79078
79095
  return renderMathAccessible();
79079
79096
  }
79080
79097
  var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
@@ -79084,7 +79101,7 @@ getDefaultExportFromCjs(mathRendering);
79084
79101
  var maxWaitTime = 500;
79085
79102
  var startTime = Date.now();
79086
79103
  var checkForLib = function checkForLib() {
79087
- var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
79104
+ var mathRenderingHasLoaded = window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance;
79088
79105
  var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
79089
79106
  if (mathRenderingHasLoaded || hasExceededMaxWait) {
79090
79107
  clearInterval(checkIntervalId);
@@ -79119,9 +79136,16 @@ var mmlToLatex = {};
79119
79136
  getDefaultExportFromCjs(mmlToLatex);
79120
79137
  (function (exports) {
79121
79138
  var _interopRequireDefault = interopRequireDefault.exports;
79139
+ var _typeof = _typeof$d.exports;
79122
79140
  Object.defineProperty(exports, "__esModule", {
79123
79141
  value: true
79124
79142
  });
79143
+ Object.defineProperty(exports, "initializeMathJaxScript", {
79144
+ enumerable: true,
79145
+ get: function get() {
79146
+ return _renderMath.initializeMathJaxScript;
79147
+ }
79148
+ });
79125
79149
  Object.defineProperty(exports, "mmlToLatex", {
79126
79150
  enumerable: true,
79127
79151
  get: function get() {
@@ -79146,9 +79170,48 @@ getDefaultExportFromCjs(mmlToLatex);
79146
79170
  return _normalization.wrapMath;
79147
79171
  }
79148
79172
  });
79149
- var _renderMath = _interopRequireDefault(renderMath$2);
79173
+ var _renderMath = _interopRequireWildcard(renderMath$2);
79150
79174
  var _mmlToLatex = _interopRequireDefault(mmlToLatex);
79151
79175
  var _normalization = normalization$1;
79176
+ function _getRequireWildcardCache(nodeInterop) {
79177
+ if (typeof WeakMap !== "function") return null;
79178
+ var cacheBabelInterop = new WeakMap();
79179
+ var cacheNodeInterop = new WeakMap();
79180
+ return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
79181
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
79182
+ })(nodeInterop);
79183
+ }
79184
+ function _interopRequireWildcard(obj, nodeInterop) {
79185
+ if (!nodeInterop && obj && obj.__esModule) {
79186
+ return obj;
79187
+ }
79188
+ if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
79189
+ return {
79190
+ "default": obj
79191
+ };
79192
+ }
79193
+ var cache = _getRequireWildcardCache(nodeInterop);
79194
+ if (cache && cache.has(obj)) {
79195
+ return cache.get(obj);
79196
+ }
79197
+ var newObj = {};
79198
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
79199
+ for (var key in obj) {
79200
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
79201
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
79202
+ if (desc && (desc.get || desc.set)) {
79203
+ Object.defineProperty(newObj, key, desc);
79204
+ } else {
79205
+ newObj[key] = obj[key];
79206
+ }
79207
+ }
79208
+ }
79209
+ newObj["default"] = obj;
79210
+ if (cache) {
79211
+ cache.set(obj, newObj);
79212
+ }
79213
+ return newObj;
79214
+ }
79152
79215
  })(mathRenderingAccessible);
79153
79216
  getDefaultExportFromCjs(mathRenderingAccessible);
79154
79217
  var choices = {};
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "6.22.3-next.4+9d0f87467",
7
+ "version": "6.22.3-next.8+1dd6cd9ce",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "postpublish": "../../scripts/postpublish"
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@material-ui/core": "^3.9.2",
14
14
  "@pie-framework/pie-player-events": "^0.1.0",
15
- "@pie-lib/pie-toolbox": "1.30.2",
15
+ "@pie-lib/pie-toolbox": "1.31.0",
16
16
  "classnames": "^2.2.5",
17
17
  "lodash": "^4.17.10",
18
18
  "prop-types": "^15.6.1",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "author": "",
23
23
  "license": "ISC",
24
- "gitHead": "9d0f87467cb2a85e309a8ae0340d8092515b4cc9",
24
+ "gitHead": "1dd6cd9ce2b68e511748963f567e94c1af5cb32c",
25
25
  "main": "lib/index.js",
26
26
  "module": "src/index.js",
27
27
  "exports": {