@pie-element/complex-rubric 2.19.3-next.8 → 2.19.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.
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.23.2/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.24.2/module/index.js";
2
2
  import RubricConfigure from '@pie-element/rubric/configure/lib';
3
3
  import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@4.24.3/module/index.js";
4
4
  function _mergeNamespaces(n, m) {
@@ -42038,49 +42038,34 @@ var mathjaxScript = {};
42038
42038
  Object.defineProperty(mathjaxScript, "__esModule", {
42039
42039
  value: true
42040
42040
  });
42041
- mathjaxScript.mathRenderingKEY = mathjaxScript.mathRenderingAccessibleKEY = mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
42041
+ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
42042
42042
  var _renderMath = renderMath$1;
42043
42043
  var MathJaxVersion = '3.2.2';
42044
42044
  mathjaxScript.MathJaxVersion = MathJaxVersion;
42045
- var mathRenderingKEY = '@pie-lib/math-rendering@2';
42046
- mathjaxScript.mathRenderingKEY = mathRenderingKEY;
42047
- var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
42048
- mathjaxScript.mathRenderingAccessibleKEY = mathRenderingAccessibleKEY;
42049
- var getMathJaxCustomKey = function getMathJaxCustomKey() {
42050
- var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
42051
- 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);
42052
- };
42053
- var mathJaxCustomKey = getMathJaxCustomKey();
42054
- var defaultOpts = function defaultOpts() {
42055
- return (0, _renderMath.getGlobal)().opts || ({});
42056
- };
42057
- var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFullPage) {
42058
- window.MathJaxInitialised = true;
42059
- renderOpts = renderOpts || defaultOpts();
42060
- if ((!window.MathJax || window.MathJax.version !== MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
42061
- var _renderOpts, _renderOpts2;
42062
- if ((_renderOpts = renderOpts) !== null && _renderOpts !== void 0 && _renderOpts.useSingleDollar) {
42063
- console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
42064
- }
42065
- var texConfig = (_renderOpts2 = renderOpts) !== null && _renderOpts2 !== void 0 && _renderOpts2.useSingleDollar ? {
42066
- macros: {
42067
- parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
42068
- overarc: '\\overparen',
42069
- napprox: '\\not\\approx',
42070
- longdiv: '\\enclose{longdiv}'
42071
- },
42072
- inlineMath: [['$', '$'], ['\\(', '\\)']],
42073
- processEscapes: true,
42074
- displayMath: [['$$', '$$'], ['\\[', '\\]']]
42075
- } : {
42076
- macros: {
42077
- parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
42078
- overarc: '\\overparen',
42079
- napprox: '\\not\\approx',
42080
- longdiv: '\\enclose{longdiv}'
42081
- },
42082
- displayMath: [['$$', '$$'], ['\\[', '\\]']]
42083
- };
42045
+ var initializeMathJax = function initializeMathJax(renderOpts) {
42046
+ if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
42047
+ console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
42048
+ }
42049
+ var texConfig = renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar ? {
42050
+ macros: {
42051
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
42052
+ overarc: '\\overparen',
42053
+ napprox: '\\not\\approx',
42054
+ longdiv: '\\enclose{longdiv}'
42055
+ },
42056
+ inlineMath: [['$', '$'], ['\\(', '\\)']],
42057
+ processEscapes: true,
42058
+ displayMath: [['$$', '$$'], ['\\[', '\\]']]
42059
+ } : {
42060
+ macros: {
42061
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
42062
+ overarc: '\\overparen',
42063
+ napprox: '\\not\\approx',
42064
+ longdiv: '\\enclose{longdiv}'
42065
+ },
42066
+ displayMath: [['$$', '$$'], ['\\[', '\\]']]
42067
+ };
42068
+ window.mathjaxLoadedP = new Promise(function (resolve) {
42084
42069
  window.MathJax = {
42085
42070
  startup: {
42086
42071
  typeset: false,
@@ -42099,10 +42084,7 @@ var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFul
42099
42084
  MathJax.startup.defaultReady();
42100
42085
  var globalObj = (0, _renderMath.getGlobal)();
42101
42086
  globalObj.instance = MathJax;
42102
- if (processMathJaxFullPage) {
42103
- processMathJaxFullPage();
42104
- }
42105
- window.MathJaxLoaded = true;
42087
+ resolve();
42106
42088
  }
42107
42089
  },
42108
42090
  loader: {
@@ -42133,7 +42115,7 @@ var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFul
42133
42115
  script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
42134
42116
  script.async = true;
42135
42117
  document.body.appendChild(script);
42136
- }
42118
+ });
42137
42119
  };
42138
42120
  mathjaxScript.initializeMathJax = initializeMathJax;
42139
42121
  var normalization$1 = {};
@@ -101736,7 +101718,7 @@ getDefaultExportFromCjs(mathRendering);
101736
101718
  Object.defineProperty(exports, "__esModule", {
101737
101719
  value: true
101738
101720
  });
101739
- exports.initializeMathJaxScript = exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
101721
+ exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
101740
101722
  var _typeof2 = _interopRequireDefault(_typeof$s.exports);
101741
101723
  var _mathjaxScript = mathjaxScript;
101742
101724
  var _normalization = normalization$1;
@@ -101787,17 +101769,22 @@ getDefaultExportFromCjs(mathRendering);
101787
101769
  };
101788
101770
  var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
101789
101771
  var NEWLINE_LATEX = '\\newline ';
101772
+ var mathRenderingKEY = '@pie-lib/math-rendering@2';
101773
+ var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
101790
101774
  var getGlobal = function getGlobal() {
101791
101775
  if (typeof window !== 'undefined') {
101792
- if (!window[_mathjaxScript.mathRenderingAccessibleKEY]) {
101793
- window[_mathjaxScript.mathRenderingAccessibleKEY] = {};
101776
+ if (!window[mathRenderingAccessibleKEY]) {
101777
+ window[mathRenderingAccessibleKEY] = {};
101794
101778
  }
101795
- return window[_mathjaxScript.mathRenderingAccessibleKEY];
101779
+ return window[mathRenderingAccessibleKEY];
101796
101780
  } else {
101797
101781
  return {};
101798
101782
  }
101799
101783
  };
101800
101784
  exports.getGlobal = getGlobal;
101785
+ var defaultOpts = function defaultOpts() {
101786
+ return getGlobal().opts || ({});
101787
+ };
101801
101788
  var fixMathElement = function fixMathElement(element) {
101802
101789
  if (element.dataset.mathHandled) {
101803
101790
  return;
@@ -101862,84 +101849,80 @@ getDefaultExportFromCjs(mathRendering);
101862
101849
  }
101863
101850
  });
101864
101851
  };
101865
- var processMathJaxFullPage = function processMathJaxFullPage(executeOn) {
101866
- executeOn = executeOn || document.body;
101867
- var mathJaxInstance = getGlobal().instance;
101868
- if (mathJaxInstance) {
101869
- mathJaxInstance.texReset();
101870
- mathJaxInstance.typesetClear();
101871
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
101872
- try {
101873
- removeExcessMjxContainers(executeOn);
101874
- removePlaceholdersAndRestoreDisplay();
101875
- var updatedDocument = mathJaxInstance.startup.document;
101876
- var list = updatedDocument.math.list;
101877
- for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
101878
- var mathMl = toMMl(item.data.root);
101879
- var parsedMathMl = mathMl.replaceAll('\n', '');
101880
- item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
101881
- }
101882
- } catch (e) {
101883
- console.error('Error post-processing MathJax typesetting:', e.toString());
101884
- }
101885
- mathJaxInstance.startup.document.clear();
101886
- })["catch"](function (error) {
101887
- console.error('Error in typesetting with MathJax:', error);
101888
- });
101889
- }
101890
- };
101891
- var initializeMathJaxScript = function initializeMathJaxScript(renderOpts) {
101892
- if (!window.MathJaxInitialised) {
101893
- (0, _mathjaxScript.initializeMathJax)(renderOpts, processMathJaxFullPage);
101894
- }
101852
+ var getMathJaxCustomKey = function getMathJaxCustomKey() {
101853
+ var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
101854
+ 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);
101895
101855
  };
101896
- exports.initializeMathJaxScript = initializeMathJaxScript;
101897
101856
  var renderMath = function renderMath(el, renderOpts) {
101898
101857
  var isString = typeof el === 'string';
101899
- var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
101900
101858
  var executeOn = document.body;
101901
101859
  if (isString) {
101902
101860
  var div = document.createElement('div');
101903
101861
  div.innerHTML = el;
101904
101862
  executeOn = div;
101905
101863
  }
101864
+ var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
101906
101865
  var renderMathAccessible = function renderMathAccessible() {
101907
101866
  fixMathElements(executeOn);
101908
101867
  adjustMathMLStyle(executeOn);
101909
- if (!window.MathJaxInitialised) {
101910
- (0, _mathjaxScript.initializeMathJax)(renderOpts, function () {
101911
- return processMathJaxFullPage(executeOn);
101912
- });
101913
- return;
101868
+ var mathJaxCustomKey = getMathJaxCustomKey();
101869
+ if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
101870
+ renderOpts = renderOpts || defaultOpts();
101871
+ (0, _mathjaxScript.initializeMathJax)(renderOpts);
101914
101872
  }
101915
- if (window.MathJaxLoaded) {
101916
- if (isString) {
101917
- try {
101918
- MathJax.texReset();
101919
- MathJax.typesetClear();
101920
- window.MathJax.typeset([executeOn]);
101921
- var updatedDocument = window.MathJax.startup.document;
101922
- var list = updatedDocument.math.list;
101923
- var item = list.next;
101924
- var mathMl = toMMl(item.data.root);
101925
- var parsedMathMl = mathMl.replaceAll('\n', '');
101926
- return parsedMathMl;
101927
- } catch (error) {
101928
- console.error('Error rendering math:', error.message);
101929
- return '';
101930
- }
101873
+ if (isString && window.MathJax && window.mathjaxLoadedP) {
101874
+ try {
101875
+ MathJax.texReset();
101876
+ MathJax.typesetClear();
101877
+ window.MathJax.typeset([executeOn]);
101878
+ var updatedDocument = window.MathJax.startup.document;
101879
+ var list = updatedDocument.math.list;
101880
+ var item = list.next;
101881
+ var mathMl = toMMl(item.data.root);
101882
+ var parsedMathMl = mathMl.replaceAll('\n', '');
101883
+ return parsedMathMl;
101884
+ } catch (error) {
101885
+ console.error('Error rendering math:', error.message);
101931
101886
  }
101932
- processMathJaxFullPage(executeOn);
101887
+ }
101888
+ if (window.mathjaxLoadedP) {
101889
+ window.mathjaxLoadedP.then(function () {
101890
+ var mathJaxInstance = getGlobal().instance;
101891
+ if (mathJaxInstance) {
101892
+ mathJaxInstance.texReset();
101893
+ mathJaxInstance.typesetClear();
101894
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
101895
+ try {
101896
+ removeExcessMjxContainers(executeOn);
101897
+ removePlaceholdersAndRestoreDisplay();
101898
+ var _updatedDocument = mathJaxInstance.startup.document;
101899
+ var _list = _updatedDocument.math.list;
101900
+ for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
101901
+ var _mathMl = toMMl(_item.data.root);
101902
+ var _parsedMathMl = _mathMl.replaceAll('\n', '');
101903
+ _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
101904
+ }
101905
+ } catch (e) {
101906
+ console.error('Error post-processing MathJax typesetting:', e.toString());
101907
+ }
101908
+ mathJaxInstance.startup.document.clear();
101909
+ })["catch"](function (error) {
101910
+ console.error('Error in typesetting with MathJax:', error);
101911
+ });
101912
+ }
101913
+ })["catch"](function (error) {
101914
+ console.error('Error in initializing MathJax:', error);
101915
+ });
101933
101916
  }
101934
101917
  };
101935
101918
  if (skipWaitForMathRenderingLib) {
101936
101919
  return renderMathAccessible();
101937
101920
  } else {
101938
- if (window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance) {
101921
+ if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
101939
101922
  removePlaceholdersAndRestoreDisplay();
101940
101923
  return mr.renderMath(executeOn, renderOpts);
101941
101924
  }
101942
- if (window.hasOwnProperty(_mathjaxScript.mathRenderingAccessibleKEY) && window[_mathjaxScript.mathRenderingAccessibleKEY].instance) {
101925
+ if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
101943
101926
  return renderMathAccessible();
101944
101927
  }
101945
101928
  var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
@@ -101949,7 +101932,7 @@ getDefaultExportFromCjs(mathRendering);
101949
101932
  var maxWaitTime = 500;
101950
101933
  var startTime = Date.now();
101951
101934
  var checkForLib = function checkForLib() {
101952
- var mathRenderingHasLoaded = window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance;
101935
+ var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
101953
101936
  var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
101954
101937
  if (mathRenderingHasLoaded || hasExceededMaxWait) {
101955
101938
  clearInterval(checkIntervalId);
@@ -101984,16 +101967,9 @@ var mmlToLatex = {};
101984
101967
  getDefaultExportFromCjs(mmlToLatex);
101985
101968
  (function (exports) {
101986
101969
  var _interopRequireDefault = interopRequireDefault.exports;
101987
- var _typeof = _typeof$s.exports;
101988
101970
  Object.defineProperty(exports, "__esModule", {
101989
101971
  value: true
101990
101972
  });
101991
- Object.defineProperty(exports, "initializeMathJaxScript", {
101992
- enumerable: true,
101993
- get: function get() {
101994
- return _renderMath.initializeMathJaxScript;
101995
- }
101996
- });
101997
101973
  Object.defineProperty(exports, "mmlToLatex", {
101998
101974
  enumerable: true,
101999
101975
  get: function get() {
@@ -102018,48 +101994,9 @@ getDefaultExportFromCjs(mmlToLatex);
102018
101994
  return _normalization.wrapMath;
102019
101995
  }
102020
101996
  });
102021
- var _renderMath = _interopRequireWildcard(renderMath$1);
101997
+ var _renderMath = _interopRequireDefault(renderMath$1);
102022
101998
  var _mmlToLatex = _interopRequireDefault(mmlToLatex);
102023
101999
  var _normalization = normalization$1;
102024
- function _getRequireWildcardCache(nodeInterop) {
102025
- if (typeof WeakMap !== "function") return null;
102026
- var cacheBabelInterop = new WeakMap();
102027
- var cacheNodeInterop = new WeakMap();
102028
- return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
102029
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
102030
- })(nodeInterop);
102031
- }
102032
- function _interopRequireWildcard(obj, nodeInterop) {
102033
- if (!nodeInterop && obj && obj.__esModule) {
102034
- return obj;
102035
- }
102036
- if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
102037
- return {
102038
- "default": obj
102039
- };
102040
- }
102041
- var cache = _getRequireWildcardCache(nodeInterop);
102042
- if (cache && cache.has(obj)) {
102043
- return cache.get(obj);
102044
- }
102045
- var newObj = {};
102046
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
102047
- for (var key in obj) {
102048
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
102049
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
102050
- if (desc && (desc.get || desc.set)) {
102051
- Object.defineProperty(newObj, key, desc);
102052
- } else {
102053
- newObj[key] = obj[key];
102054
- }
102055
- }
102056
- }
102057
- newObj["default"] = obj;
102058
- if (cache) {
102059
- cache.set(obj, newObj);
102060
- }
102061
- return newObj;
102062
- }
102063
102000
  })(mathRenderingAccessible);
102064
102001
  getDefaultExportFromCjs(mathRenderingAccessible);
102065
102002
  const require$$8$y = _dll_react;
@@ -141077,6 +141014,7 @@ const require$$7$7 = _dll_debug;
141077
141014
  attributes: _propTypes["default"].object,
141078
141015
  children: _propTypes["default"].func
141079
141016
  };
141017
+ core.name = type;
141080
141018
  return core;
141081
141019
  };
141082
141020
  exports["default"] = _default;
@@ -143787,6 +143725,7 @@ const require$$8$e = _dll_prop_types;
143787
143725
  };
143788
143726
  };
143789
143727
  core.renderNode = Node;
143728
+ core.name = 'table';
143790
143729
  return core;
143791
143730
  };
143792
143731
  exports["default"] = _default;