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

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.
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "1.23.2"
7
+ "version": "1.24.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.2/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.24.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,49 +19115,34 @@ var mathjaxScript = {};
19115
19115
  Object.defineProperty(mathjaxScript, "__esModule", {
19116
19116
  value: true
19117
19117
  });
19118
- mathjaxScript.mathRenderingKEY = mathjaxScript.mathRenderingAccessibleKEY = mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
19118
+ 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 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
- };
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) {
19161
19146
  window.MathJax = {
19162
19147
  startup: {
19163
19148
  typeset: false,
@@ -19176,10 +19161,7 @@ var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFul
19176
19161
  MathJax.startup.defaultReady();
19177
19162
  var globalObj = (0, _renderMath.getGlobal)();
19178
19163
  globalObj.instance = MathJax;
19179
- if (processMathJaxFullPage) {
19180
- processMathJaxFullPage();
19181
- }
19182
- window.MathJaxLoaded = true;
19164
+ resolve();
19183
19165
  }
19184
19166
  },
19185
19167
  loader: {
@@ -19210,7 +19192,7 @@ var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFul
19210
19192
  script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
19211
19193
  script.async = true;
19212
19194
  document.body.appendChild(script);
19213
- }
19195
+ });
19214
19196
  };
19215
19197
  mathjaxScript.initializeMathJax = initializeMathJax;
19216
19198
  var normalization$1 = {};
@@ -78888,7 +78870,7 @@ getDefaultExportFromCjs(mathRendering);
78888
78870
  Object.defineProperty(exports, "__esModule", {
78889
78871
  value: true
78890
78872
  });
78891
- exports.initializeMathJaxScript = exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
78873
+ exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
78892
78874
  var _typeof2 = _interopRequireDefault(_typeof$d.exports);
78893
78875
  var _mathjaxScript = mathjaxScript;
78894
78876
  var _normalization = normalization$1;
@@ -78939,17 +78921,22 @@ getDefaultExportFromCjs(mathRendering);
78939
78921
  };
78940
78922
  var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
78941
78923
  var NEWLINE_LATEX = '\\newline ';
78924
+ var mathRenderingKEY = '@pie-lib/math-rendering@2';
78925
+ var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
78942
78926
  var getGlobal = function getGlobal() {
78943
78927
  if (typeof window !== 'undefined') {
78944
- if (!window[_mathjaxScript.mathRenderingAccessibleKEY]) {
78945
- window[_mathjaxScript.mathRenderingAccessibleKEY] = {};
78928
+ if (!window[mathRenderingAccessibleKEY]) {
78929
+ window[mathRenderingAccessibleKEY] = {};
78946
78930
  }
78947
- return window[_mathjaxScript.mathRenderingAccessibleKEY];
78931
+ return window[mathRenderingAccessibleKEY];
78948
78932
  } else {
78949
78933
  return {};
78950
78934
  }
78951
78935
  };
78952
78936
  exports.getGlobal = getGlobal;
78937
+ var defaultOpts = function defaultOpts() {
78938
+ return getGlobal().opts || ({});
78939
+ };
78953
78940
  var fixMathElement = function fixMathElement(element) {
78954
78941
  if (element.dataset.mathHandled) {
78955
78942
  return;
@@ -79014,84 +79001,80 @@ getDefaultExportFromCjs(mathRendering);
79014
79001
  }
79015
79002
  });
79016
79003
  };
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
- }
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);
79047
79007
  };
79048
- exports.initializeMathJaxScript = initializeMathJaxScript;
79049
79008
  var renderMath = function renderMath(el, renderOpts) {
79050
79009
  var isString = typeof el === 'string';
79051
- var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
79052
79010
  var executeOn = document.body;
79053
79011
  if (isString) {
79054
79012
  var div = document.createElement('div');
79055
79013
  div.innerHTML = el;
79056
79014
  executeOn = div;
79057
79015
  }
79016
+ var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
79058
79017
  var renderMathAccessible = function renderMathAccessible() {
79059
79018
  fixMathElements(executeOn);
79060
79019
  adjustMathMLStyle(executeOn);
79061
- if (!window.MathJaxInitialised) {
79062
- (0, _mathjaxScript.initializeMathJax)(renderOpts, function () {
79063
- return processMathJaxFullPage(executeOn);
79064
- });
79065
- return;
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);
79066
79024
  }
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 '';
79082
- }
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);
79083
79038
  }
79084
- processMathJaxFullPage(executeOn);
79039
+ }
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
+ });
79064
+ }
79065
+ })["catch"](function (error) {
79066
+ console.error('Error in initializing MathJax:', error);
79067
+ });
79085
79068
  }
79086
79069
  };
79087
79070
  if (skipWaitForMathRenderingLib) {
79088
79071
  return renderMathAccessible();
79089
79072
  } else {
79090
- if (window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance) {
79073
+ if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
79091
79074
  removePlaceholdersAndRestoreDisplay();
79092
79075
  return mr.renderMath(executeOn, renderOpts);
79093
79076
  }
79094
- if (window.hasOwnProperty(_mathjaxScript.mathRenderingAccessibleKEY) && window[_mathjaxScript.mathRenderingAccessibleKEY].instance) {
79077
+ if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
79095
79078
  return renderMathAccessible();
79096
79079
  }
79097
79080
  var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
@@ -79101,7 +79084,7 @@ getDefaultExportFromCjs(mathRendering);
79101
79084
  var maxWaitTime = 500;
79102
79085
  var startTime = Date.now();
79103
79086
  var checkForLib = function checkForLib() {
79104
- var mathRenderingHasLoaded = window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance;
79087
+ var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
79105
79088
  var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
79106
79089
  if (mathRenderingHasLoaded || hasExceededMaxWait) {
79107
79090
  clearInterval(checkIntervalId);
@@ -79136,16 +79119,9 @@ var mmlToLatex = {};
79136
79119
  getDefaultExportFromCjs(mmlToLatex);
79137
79120
  (function (exports) {
79138
79121
  var _interopRequireDefault = interopRequireDefault.exports;
79139
- var _typeof = _typeof$d.exports;
79140
79122
  Object.defineProperty(exports, "__esModule", {
79141
79123
  value: true
79142
79124
  });
79143
- Object.defineProperty(exports, "initializeMathJaxScript", {
79144
- enumerable: true,
79145
- get: function get() {
79146
- return _renderMath.initializeMathJaxScript;
79147
- }
79148
- });
79149
79125
  Object.defineProperty(exports, "mmlToLatex", {
79150
79126
  enumerable: true,
79151
79127
  get: function get() {
@@ -79170,48 +79146,9 @@ getDefaultExportFromCjs(mmlToLatex);
79170
79146
  return _normalization.wrapMath;
79171
79147
  }
79172
79148
  });
79173
- var _renderMath = _interopRequireWildcard(renderMath$2);
79149
+ var _renderMath = _interopRequireDefault(renderMath$2);
79174
79150
  var _mmlToLatex = _interopRequireDefault(mmlToLatex);
79175
79151
  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
- }
79215
79152
  })(mathRenderingAccessible);
79216
79153
  getDefaultExportFromCjs(mathRenderingAccessible);
79217
79154
  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.8+1dd6cd9ce",
7
+ "version": "6.22.3",
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.31.0",
15
+ "@pie-lib/pie-toolbox": "1.31.3",
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": "1dd6cd9ce2b68e511748963f567e94c1af5cb32c",
24
+ "gitHead": "8c0b9d9d91490c958440ece9a2c018acecbf7c5c",
25
25
  "main": "lib/index.js",
26
26
  "module": "src/index.js",
27
27
  "exports": {