@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.
package/module/element.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _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_react_dom, _dll_classnames, _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 {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.24.3/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -65364,49 +65364,34 @@ var mathjaxScript = {};
65364
65364
  Object.defineProperty(mathjaxScript, "__esModule", {
65365
65365
  value: true
65366
65366
  });
65367
- mathjaxScript.mathRenderingKEY = mathjaxScript.mathRenderingAccessibleKEY = mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
65367
+ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
65368
65368
  var _renderMath = renderMath$1;
65369
65369
  var MathJaxVersion = '3.2.2';
65370
65370
  mathjaxScript.MathJaxVersion = MathJaxVersion;
65371
- var mathRenderingKEY = '@pie-lib/math-rendering@2';
65372
- mathjaxScript.mathRenderingKEY = mathRenderingKEY;
65373
- var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
65374
- mathjaxScript.mathRenderingAccessibleKEY = mathRenderingAccessibleKEY;
65375
- var getMathJaxCustomKey = function getMathJaxCustomKey() {
65376
- var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
65377
- 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);
65378
- };
65379
- var mathJaxCustomKey = getMathJaxCustomKey();
65380
- var defaultOpts = function defaultOpts() {
65381
- return (0, _renderMath.getGlobal)().opts || ({});
65382
- };
65383
- var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFullPage) {
65384
- window.MathJaxInitialised = true;
65385
- renderOpts = renderOpts || defaultOpts();
65386
- if ((!window.MathJax || window.MathJax.version !== MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
65387
- var _renderOpts, _renderOpts2;
65388
- if ((_renderOpts = renderOpts) !== null && _renderOpts !== void 0 && _renderOpts.useSingleDollar) {
65389
- console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
65390
- }
65391
- var texConfig = (_renderOpts2 = renderOpts) !== null && _renderOpts2 !== void 0 && _renderOpts2.useSingleDollar ? {
65392
- macros: {
65393
- parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
65394
- overarc: '\\overparen',
65395
- napprox: '\\not\\approx',
65396
- longdiv: '\\enclose{longdiv}'
65397
- },
65398
- inlineMath: [['$', '$'], ['\\(', '\\)']],
65399
- processEscapes: true,
65400
- displayMath: [['$$', '$$'], ['\\[', '\\]']]
65401
- } : {
65402
- macros: {
65403
- parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
65404
- overarc: '\\overparen',
65405
- napprox: '\\not\\approx',
65406
- longdiv: '\\enclose{longdiv}'
65407
- },
65408
- displayMath: [['$$', '$$'], ['\\[', '\\]']]
65409
- };
65371
+ var initializeMathJax = function initializeMathJax(renderOpts) {
65372
+ if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
65373
+ console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
65374
+ }
65375
+ var texConfig = renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar ? {
65376
+ macros: {
65377
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
65378
+ overarc: '\\overparen',
65379
+ napprox: '\\not\\approx',
65380
+ longdiv: '\\enclose{longdiv}'
65381
+ },
65382
+ inlineMath: [['$', '$'], ['\\(', '\\)']],
65383
+ processEscapes: true,
65384
+ displayMath: [['$$', '$$'], ['\\[', '\\]']]
65385
+ } : {
65386
+ macros: {
65387
+ parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
65388
+ overarc: '\\overparen',
65389
+ napprox: '\\not\\approx',
65390
+ longdiv: '\\enclose{longdiv}'
65391
+ },
65392
+ displayMath: [['$$', '$$'], ['\\[', '\\]']]
65393
+ };
65394
+ window.mathjaxLoadedP = new Promise(function (resolve) {
65410
65395
  window.MathJax = {
65411
65396
  startup: {
65412
65397
  typeset: false,
@@ -65425,10 +65410,7 @@ var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFul
65425
65410
  MathJax.startup.defaultReady();
65426
65411
  var globalObj = (0, _renderMath.getGlobal)();
65427
65412
  globalObj.instance = MathJax;
65428
- if (processMathJaxFullPage) {
65429
- processMathJaxFullPage();
65430
- }
65431
- window.MathJaxLoaded = true;
65413
+ resolve();
65432
65414
  }
65433
65415
  },
65434
65416
  loader: {
@@ -65459,7 +65441,7 @@ var initializeMathJax = function initializeMathJax(renderOpts, processMathJaxFul
65459
65441
  script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
65460
65442
  script.async = true;
65461
65443
  document.body.appendChild(script);
65462
- }
65444
+ });
65463
65445
  };
65464
65446
  mathjaxScript.initializeMathJax = initializeMathJax;
65465
65447
  var normalization$1 = {};
@@ -124997,7 +124979,7 @@ getDefaultExportFromCjs(mathRendering);
124997
124979
  Object.defineProperty(exports, "__esModule", {
124998
124980
  value: true
124999
124981
  });
125000
- exports.initializeMathJaxScript = exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
124982
+ exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
125001
124983
  var _typeof2 = _interopRequireDefault(_typeof$s.exports);
125002
124984
  var _mathjaxScript = mathjaxScript;
125003
124985
  var _normalization = normalization$1;
@@ -125048,17 +125030,22 @@ getDefaultExportFromCjs(mathRendering);
125048
125030
  };
125049
125031
  var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
125050
125032
  var NEWLINE_LATEX = '\\newline ';
125033
+ var mathRenderingKEY = '@pie-lib/math-rendering@2';
125034
+ var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
125051
125035
  var getGlobal = function getGlobal() {
125052
125036
  if (typeof window !== 'undefined') {
125053
- if (!window[_mathjaxScript.mathRenderingAccessibleKEY]) {
125054
- window[_mathjaxScript.mathRenderingAccessibleKEY] = {};
125037
+ if (!window[mathRenderingAccessibleKEY]) {
125038
+ window[mathRenderingAccessibleKEY] = {};
125055
125039
  }
125056
- return window[_mathjaxScript.mathRenderingAccessibleKEY];
125040
+ return window[mathRenderingAccessibleKEY];
125057
125041
  } else {
125058
125042
  return {};
125059
125043
  }
125060
125044
  };
125061
125045
  exports.getGlobal = getGlobal;
125046
+ var defaultOpts = function defaultOpts() {
125047
+ return getGlobal().opts || ({});
125048
+ };
125062
125049
  var fixMathElement = function fixMathElement(element) {
125063
125050
  if (element.dataset.mathHandled) {
125064
125051
  return;
@@ -125123,84 +125110,80 @@ getDefaultExportFromCjs(mathRendering);
125123
125110
  }
125124
125111
  });
125125
125112
  };
125126
- var processMathJaxFullPage = function processMathJaxFullPage(executeOn) {
125127
- executeOn = executeOn || document.body;
125128
- var mathJaxInstance = getGlobal().instance;
125129
- if (mathJaxInstance) {
125130
- mathJaxInstance.texReset();
125131
- mathJaxInstance.typesetClear();
125132
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
125133
- try {
125134
- removeExcessMjxContainers(executeOn);
125135
- removePlaceholdersAndRestoreDisplay();
125136
- var updatedDocument = mathJaxInstance.startup.document;
125137
- var list = updatedDocument.math.list;
125138
- for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
125139
- var mathMl = toMMl(item.data.root);
125140
- var parsedMathMl = mathMl.replaceAll('\n', '');
125141
- item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
125142
- }
125143
- } catch (e) {
125144
- console.error('Error post-processing MathJax typesetting:', e.toString());
125145
- }
125146
- mathJaxInstance.startup.document.clear();
125147
- })["catch"](function (error) {
125148
- console.error('Error in typesetting with MathJax:', error);
125149
- });
125150
- }
125151
- };
125152
- var initializeMathJaxScript = function initializeMathJaxScript(renderOpts) {
125153
- if (!window.MathJaxInitialised) {
125154
- (0, _mathjaxScript.initializeMathJax)(renderOpts, processMathJaxFullPage);
125155
- }
125113
+ var getMathJaxCustomKey = function getMathJaxCustomKey() {
125114
+ var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
125115
+ 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);
125156
125116
  };
125157
- exports.initializeMathJaxScript = initializeMathJaxScript;
125158
125117
  var renderMath = function renderMath(el, renderOpts) {
125159
125118
  var isString = typeof el === 'string';
125160
- var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
125161
125119
  var executeOn = document.body;
125162
125120
  if (isString) {
125163
125121
  var div = document.createElement('div');
125164
125122
  div.innerHTML = el;
125165
125123
  executeOn = div;
125166
125124
  }
125125
+ var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
125167
125126
  var renderMathAccessible = function renderMathAccessible() {
125168
125127
  fixMathElements(executeOn);
125169
125128
  adjustMathMLStyle(executeOn);
125170
- if (!window.MathJaxInitialised) {
125171
- (0, _mathjaxScript.initializeMathJax)(renderOpts, function () {
125172
- return processMathJaxFullPage(executeOn);
125173
- });
125174
- return;
125129
+ var mathJaxCustomKey = getMathJaxCustomKey();
125130
+ if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
125131
+ renderOpts = renderOpts || defaultOpts();
125132
+ (0, _mathjaxScript.initializeMathJax)(renderOpts);
125175
125133
  }
125176
- if (window.MathJaxLoaded) {
125177
- if (isString) {
125178
- try {
125179
- MathJax.texReset();
125180
- MathJax.typesetClear();
125181
- window.MathJax.typeset([executeOn]);
125182
- var updatedDocument = window.MathJax.startup.document;
125183
- var list = updatedDocument.math.list;
125184
- var item = list.next;
125185
- var mathMl = toMMl(item.data.root);
125186
- var parsedMathMl = mathMl.replaceAll('\n', '');
125187
- return parsedMathMl;
125188
- } catch (error) {
125189
- console.error('Error rendering math:', error.message);
125190
- return '';
125191
- }
125134
+ if (isString && window.MathJax && window.mathjaxLoadedP) {
125135
+ try {
125136
+ MathJax.texReset();
125137
+ MathJax.typesetClear();
125138
+ window.MathJax.typeset([executeOn]);
125139
+ var updatedDocument = window.MathJax.startup.document;
125140
+ var list = updatedDocument.math.list;
125141
+ var item = list.next;
125142
+ var mathMl = toMMl(item.data.root);
125143
+ var parsedMathMl = mathMl.replaceAll('\n', '');
125144
+ return parsedMathMl;
125145
+ } catch (error) {
125146
+ console.error('Error rendering math:', error.message);
125192
125147
  }
125193
- processMathJaxFullPage(executeOn);
125148
+ }
125149
+ if (window.mathjaxLoadedP) {
125150
+ window.mathjaxLoadedP.then(function () {
125151
+ var mathJaxInstance = getGlobal().instance;
125152
+ if (mathJaxInstance) {
125153
+ mathJaxInstance.texReset();
125154
+ mathJaxInstance.typesetClear();
125155
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
125156
+ try {
125157
+ removeExcessMjxContainers(executeOn);
125158
+ removePlaceholdersAndRestoreDisplay();
125159
+ var _updatedDocument = mathJaxInstance.startup.document;
125160
+ var _list = _updatedDocument.math.list;
125161
+ for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
125162
+ var _mathMl = toMMl(_item.data.root);
125163
+ var _parsedMathMl = _mathMl.replaceAll('\n', '');
125164
+ _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
125165
+ }
125166
+ } catch (e) {
125167
+ console.error('Error post-processing MathJax typesetting:', e.toString());
125168
+ }
125169
+ mathJaxInstance.startup.document.clear();
125170
+ })["catch"](function (error) {
125171
+ console.error('Error in typesetting with MathJax:', error);
125172
+ });
125173
+ }
125174
+ })["catch"](function (error) {
125175
+ console.error('Error in initializing MathJax:', error);
125176
+ });
125194
125177
  }
125195
125178
  };
125196
125179
  if (skipWaitForMathRenderingLib) {
125197
125180
  return renderMathAccessible();
125198
125181
  } else {
125199
- if (window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance) {
125182
+ if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
125200
125183
  removePlaceholdersAndRestoreDisplay();
125201
125184
  return mr.renderMath(executeOn, renderOpts);
125202
125185
  }
125203
- if (window.hasOwnProperty(_mathjaxScript.mathRenderingAccessibleKEY) && window[_mathjaxScript.mathRenderingAccessibleKEY].instance) {
125186
+ if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
125204
125187
  return renderMathAccessible();
125205
125188
  }
125206
125189
  var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
@@ -125210,7 +125193,7 @@ getDefaultExportFromCjs(mathRendering);
125210
125193
  var maxWaitTime = 500;
125211
125194
  var startTime = Date.now();
125212
125195
  var checkForLib = function checkForLib() {
125213
- var mathRenderingHasLoaded = window.hasOwnProperty(_mathjaxScript.mathRenderingKEY) && window[_mathjaxScript.mathRenderingKEY].instance;
125196
+ var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
125214
125197
  var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
125215
125198
  if (mathRenderingHasLoaded || hasExceededMaxWait) {
125216
125199
  clearInterval(checkIntervalId);
@@ -125245,16 +125228,9 @@ var mmlToLatex = {};
125245
125228
  getDefaultExportFromCjs(mmlToLatex);
125246
125229
  (function (exports) {
125247
125230
  var _interopRequireDefault = interopRequireDefault.exports;
125248
- var _typeof = _typeof$s.exports;
125249
125231
  Object.defineProperty(exports, "__esModule", {
125250
125232
  value: true
125251
125233
  });
125252
- Object.defineProperty(exports, "initializeMathJaxScript", {
125253
- enumerable: true,
125254
- get: function get() {
125255
- return _renderMath.initializeMathJaxScript;
125256
- }
125257
- });
125258
125234
  Object.defineProperty(exports, "mmlToLatex", {
125259
125235
  enumerable: true,
125260
125236
  get: function get() {
@@ -125279,48 +125255,9 @@ getDefaultExportFromCjs(mmlToLatex);
125279
125255
  return _normalization.wrapMath;
125280
125256
  }
125281
125257
  });
125282
- var _renderMath = _interopRequireWildcard(renderMath$1);
125258
+ var _renderMath = _interopRequireDefault(renderMath$1);
125283
125259
  var _mmlToLatex = _interopRequireDefault(mmlToLatex);
125284
125260
  var _normalization = normalization$1;
125285
- function _getRequireWildcardCache(nodeInterop) {
125286
- if (typeof WeakMap !== "function") return null;
125287
- var cacheBabelInterop = new WeakMap();
125288
- var cacheNodeInterop = new WeakMap();
125289
- return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
125290
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
125291
- })(nodeInterop);
125292
- }
125293
- function _interopRequireWildcard(obj, nodeInterop) {
125294
- if (!nodeInterop && obj && obj.__esModule) {
125295
- return obj;
125296
- }
125297
- if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
125298
- return {
125299
- "default": obj
125300
- };
125301
- }
125302
- var cache = _getRequireWildcardCache(nodeInterop);
125303
- if (cache && cache.has(obj)) {
125304
- return cache.get(obj);
125305
- }
125306
- var newObj = {};
125307
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
125308
- for (var key in obj) {
125309
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
125310
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
125311
- if (desc && (desc.get || desc.set)) {
125312
- Object.defineProperty(newObj, key, desc);
125313
- } else {
125314
- newObj[key] = obj[key];
125315
- }
125316
- }
125317
- }
125318
- newObj["default"] = obj;
125319
- if (cache) {
125320
- cache.set(obj, newObj);
125321
- }
125322
- return newObj;
125323
- }
125324
125261
  })(mathRenderingAccessible);
125325
125262
  getDefaultExportFromCjs(mathRenderingAccessible);
125326
125263
  const require$$8$l = _dll_react;
@@ -131256,6 +131193,7 @@ const require$$7$8 = _dll_debug;
131256
131193
  attributes: _propTypes["default"].object,
131257
131194
  children: _propTypes["default"].func
131258
131195
  };
131196
+ core.name = type;
131259
131197
  return core;
131260
131198
  };
131261
131199
  exports["default"] = _default;
@@ -133966,6 +133904,7 @@ const require$$8$f = _dll_prop_types;
133966
133904
  };
133967
133905
  };
133968
133906
  core.renderNode = Node;
133907
+ core.name = 'table';
133969
133908
  return core;
133970
133909
  };
133971
133910
  exports["default"] = _default;
@@ -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",