@pie-element/complex-rubric 2.19.7-next.0 → 2.19.7-next.2
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/controller/package.json +1 -1
- package/module/configure.js +183 -197
- package/module/element.js +183 -197
- package/module/manifest.json +2 -2
- package/module/print.js +183 -197
- package/package.json +4 -4
package/module/print.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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@
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@
|
|
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@2.0.0/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.0/module/index.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
5
5
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -65379,90 +65379,6 @@ responseIndicators.NothingSubmitted = NothingSubmitted;
|
|
|
65379
65379
|
var collapsible = {};
|
|
65380
65380
|
var mathRenderingAccessible = {};
|
|
65381
65381
|
var renderMath$1 = {};
|
|
65382
|
-
var mathjaxScript = {};
|
|
65383
|
-
Object.defineProperty(mathjaxScript, "__esModule", {
|
|
65384
|
-
value: true
|
|
65385
|
-
});
|
|
65386
|
-
mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
|
|
65387
|
-
var _renderMath = renderMath$1;
|
|
65388
|
-
var MathJaxVersion = '3.2.2';
|
|
65389
|
-
mathjaxScript.MathJaxVersion = MathJaxVersion;
|
|
65390
|
-
var initializeMathJax = function initializeMathJax(renderOpts) {
|
|
65391
|
-
if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
|
|
65392
|
-
console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
|
|
65393
|
-
}
|
|
65394
|
-
var texConfig = renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar ? {
|
|
65395
|
-
macros: {
|
|
65396
|
-
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
65397
|
-
overarc: '\\overparen',
|
|
65398
|
-
napprox: '\\not\\approx',
|
|
65399
|
-
longdiv: '\\enclose{longdiv}'
|
|
65400
|
-
},
|
|
65401
|
-
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
|
65402
|
-
processEscapes: true,
|
|
65403
|
-
displayMath: [['$$', '$$'], ['\\[', '\\]']]
|
|
65404
|
-
} : {
|
|
65405
|
-
macros: {
|
|
65406
|
-
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
65407
|
-
overarc: '\\overparen',
|
|
65408
|
-
napprox: '\\not\\approx',
|
|
65409
|
-
longdiv: '\\enclose{longdiv}'
|
|
65410
|
-
},
|
|
65411
|
-
displayMath: [['$$', '$$'], ['\\[', '\\]']]
|
|
65412
|
-
};
|
|
65413
|
-
window.mathjaxLoadedP = new Promise(function (resolve) {
|
|
65414
|
-
window.MathJax = {
|
|
65415
|
-
startup: {
|
|
65416
|
-
typeset: false,
|
|
65417
|
-
ready: function ready() {
|
|
65418
|
-
var mathjax = MathJax._.mathjax.mathjax;
|
|
65419
|
-
var STATE = MathJax._.core.MathItem.STATE;
|
|
65420
|
-
var Menu = MathJax._.ui.menu.Menu.Menu;
|
|
65421
|
-
var rerender = Menu.prototype.rerender;
|
|
65422
|
-
Menu.prototype.rerender = function () {
|
|
65423
|
-
var _this = this;
|
|
65424
|
-
var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
|
|
65425
|
-
mathjax.handleRetriesFor(function () {
|
|
65426
|
-
return rerender.call(_this, start);
|
|
65427
|
-
});
|
|
65428
|
-
};
|
|
65429
|
-
MathJax.startup.defaultReady();
|
|
65430
|
-
var globalObj = (0, _renderMath.getGlobal)();
|
|
65431
|
-
globalObj.instance = MathJax;
|
|
65432
|
-
resolve();
|
|
65433
|
-
}
|
|
65434
|
-
},
|
|
65435
|
-
loader: {
|
|
65436
|
-
load: ['input/mml']
|
|
65437
|
-
},
|
|
65438
|
-
tex: texConfig,
|
|
65439
|
-
chtml: {
|
|
65440
|
-
fontURL: 'https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2',
|
|
65441
|
-
displayAlign: 'center'
|
|
65442
|
-
},
|
|
65443
|
-
customKey: '@pie-lib/math-rendering-accessible@1',
|
|
65444
|
-
options: {
|
|
65445
|
-
enableEnrichment: true,
|
|
65446
|
-
sre: {
|
|
65447
|
-
speech: 'deep'
|
|
65448
|
-
},
|
|
65449
|
-
menuOptions: {
|
|
65450
|
-
settings: {
|
|
65451
|
-
assistiveMml: true,
|
|
65452
|
-
collapsible: false,
|
|
65453
|
-
explorer: false
|
|
65454
|
-
}
|
|
65455
|
-
}
|
|
65456
|
-
}
|
|
65457
|
-
};
|
|
65458
|
-
var script = document.createElement('script');
|
|
65459
|
-
script.type = 'text/javascript';
|
|
65460
|
-
script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
|
|
65461
|
-
script.async = true;
|
|
65462
|
-
document.body.appendChild(script);
|
|
65463
|
-
});
|
|
65464
|
-
};
|
|
65465
|
-
mathjaxScript.initializeMathJax = initializeMathJax;
|
|
65466
65382
|
var normalization$1 = {};
|
|
65467
65383
|
var _interopRequireDefault$2p = interopRequireDefault.exports;
|
|
65468
65384
|
Object.defineProperty(normalization$1, "__esModule", {
|
|
@@ -124998,9 +124914,8 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
124998
124914
|
Object.defineProperty(exports, "__esModule", {
|
|
124999
124915
|
value: true
|
|
125000
124916
|
});
|
|
125001
|
-
exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
|
|
124917
|
+
exports.initializeMathJax = exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = exports.MathJaxVersion = void 0;
|
|
125002
124918
|
var _typeof2 = _interopRequireDefault(_typeof$s.exports);
|
|
125003
|
-
var _mathjaxScript = mathjaxScript;
|
|
125004
124919
|
var _normalization = normalization$1;
|
|
125005
124920
|
var mr = _interopRequireWildcard(mathRendering);
|
|
125006
124921
|
var _SerializedMmlVisitor = SerializedMmlVisitor;
|
|
@@ -125048,11 +124963,13 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
125048
124963
|
return visitor.visitTree(node);
|
|
125049
124964
|
};
|
|
125050
124965
|
var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
|
|
125051
|
-
var NEWLINE_LATEX =
|
|
125052
|
-
var mathRenderingKEY =
|
|
125053
|
-
var mathRenderingAccessibleKEY =
|
|
124966
|
+
var NEWLINE_LATEX = "\\newline ";
|
|
124967
|
+
var mathRenderingKEY = "@pie-lib/math-rendering@2";
|
|
124968
|
+
var mathRenderingAccessibleKEY = "@pie-lib/math-rendering-accessible@1";
|
|
124969
|
+
var MathJaxVersion = "3.2.2";
|
|
124970
|
+
exports.MathJaxVersion = MathJaxVersion;
|
|
125054
124971
|
var getGlobal = function getGlobal() {
|
|
125055
|
-
if (typeof window !==
|
|
124972
|
+
if (typeof window !== "undefined") {
|
|
125056
124973
|
if (!window[mathRenderingAccessibleKEY]) {
|
|
125057
124974
|
window[mathRenderingAccessibleKEY] = {};
|
|
125058
124975
|
}
|
|
@@ -125062,16 +124979,13 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
125062
124979
|
}
|
|
125063
124980
|
};
|
|
125064
124981
|
exports.getGlobal = getGlobal;
|
|
125065
|
-
var defaultOpts = function defaultOpts() {
|
|
125066
|
-
return getGlobal().opts || ({});
|
|
125067
|
-
};
|
|
125068
124982
|
var fixMathElement = function fixMathElement(element) {
|
|
125069
124983
|
if (element.dataset.mathHandled) {
|
|
125070
124984
|
return;
|
|
125071
124985
|
}
|
|
125072
|
-
var property =
|
|
124986
|
+
var property = "innerText";
|
|
125073
124987
|
if (element.textContent) {
|
|
125074
|
-
property =
|
|
124988
|
+
property = "textContent";
|
|
125075
124989
|
}
|
|
125076
124990
|
if (element[property]) {
|
|
125077
124991
|
element[property] = (0, _normalization.wrapMath)((0, _normalization.unWrapMath)(element[property]).unwrapped);
|
|
@@ -125082,7 +124996,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
125082
124996
|
exports.fixMathElement = fixMathElement;
|
|
125083
124997
|
var fixMathElements = function fixMathElements() {
|
|
125084
124998
|
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
125085
|
-
var mathElements = el.querySelectorAll(
|
|
124999
|
+
var mathElements = el.querySelectorAll("[data-latex]");
|
|
125086
125000
|
mathElements.forEach(function (item) {
|
|
125087
125001
|
return fixMathElement(item);
|
|
125088
125002
|
});
|
|
@@ -125090,25 +125004,25 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
125090
125004
|
exports.fixMathElements = fixMathElements;
|
|
125091
125005
|
var adjustMathMLStyle = function adjustMathMLStyle() {
|
|
125092
125006
|
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
125093
|
-
var nodes = el.querySelectorAll(
|
|
125007
|
+
var nodes = el.querySelectorAll("math");
|
|
125094
125008
|
nodes.forEach(function (node) {
|
|
125095
|
-
return node.setAttribute(
|
|
125009
|
+
return node.setAttribute("displaystyle", "true");
|
|
125096
125010
|
});
|
|
125097
125011
|
};
|
|
125098
125012
|
var createPlaceholder = function createPlaceholder(element) {
|
|
125099
125013
|
var _element$previousSibl;
|
|
125100
|
-
if (!element.previousSibling || !((_element$previousSibl = element.previousSibling.classList) !== null && _element$previousSibl !== void 0 && _element$previousSibl.contains(
|
|
125014
|
+
if (!element.previousSibling || !((_element$previousSibl = element.previousSibling.classList) !== null && _element$previousSibl !== void 0 && _element$previousSibl.contains("math-placeholder"))) {
|
|
125101
125015
|
var _element$parentNode;
|
|
125102
|
-
element.dataset.originalDisplay = element.style.display ||
|
|
125103
|
-
element.style.display =
|
|
125104
|
-
var placeholder = document.createElement(
|
|
125105
|
-
placeholder.style.cssText =
|
|
125106
|
-
placeholder.classList.add(
|
|
125016
|
+
element.dataset.originalDisplay = element.style.display || "";
|
|
125017
|
+
element.style.display = "none";
|
|
125018
|
+
var placeholder = document.createElement("span");
|
|
125019
|
+
placeholder.style.cssText = "height: 10px; width: 50px; display: inline-block; vertical-align: middle; justify-content: center; background: #fafafa; border-radius: 4px;";
|
|
125020
|
+
placeholder.classList.add("math-placeholder");
|
|
125107
125021
|
(_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 ? void 0 : _element$parentNode.insertBefore(placeholder, element);
|
|
125108
125022
|
}
|
|
125109
125023
|
};
|
|
125110
125024
|
var removePlaceholdersAndRestoreDisplay = function removePlaceholdersAndRestoreDisplay() {
|
|
125111
|
-
document.querySelectorAll(
|
|
125025
|
+
document.querySelectorAll(".math-placeholder").forEach(function (placeholder) {
|
|
125112
125026
|
var _targetElement$datase;
|
|
125113
125027
|
var targetElement = placeholder.nextElementSibling;
|
|
125114
125028
|
if (targetElement && ((_targetElement$datase = targetElement.dataset) === null || _targetElement$datase === void 0 ? void 0 : _targetElement$datase.originalDisplay) !== undefined) {
|
|
@@ -125119,9 +125033,9 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
125119
125033
|
});
|
|
125120
125034
|
};
|
|
125121
125035
|
var removeExcessMjxContainers = function removeExcessMjxContainers(content) {
|
|
125122
|
-
var elements = content.querySelectorAll(
|
|
125036
|
+
var elements = content.querySelectorAll("[data-latex][data-math-handled=\"true\"]");
|
|
125123
125037
|
elements.forEach(function (element) {
|
|
125124
|
-
var mjxContainers = element.querySelectorAll(
|
|
125038
|
+
var mjxContainers = element.querySelectorAll("mjx-container");
|
|
125125
125039
|
if (mjxContainers.length > 1) {
|
|
125126
125040
|
for (var i = 1; i < mjxContainers.length; i++) {
|
|
125127
125041
|
mjxContainers[i].parentNode.removeChild(mjxContainers[i]);
|
|
@@ -125129,28 +125043,124 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
125129
125043
|
}
|
|
125130
125044
|
});
|
|
125131
125045
|
};
|
|
125132
|
-
var
|
|
125133
|
-
|
|
125134
|
-
|
|
125046
|
+
var renderContentWithMathJax = function renderContentWithMathJax(executeOn) {
|
|
125047
|
+
executeOn = executeOn || document.body;
|
|
125048
|
+
fixMathElements(executeOn);
|
|
125049
|
+
adjustMathMLStyle(executeOn);
|
|
125050
|
+
var mathJaxInstance = getGlobal().instance;
|
|
125051
|
+
if (mathJaxInstance) {
|
|
125052
|
+
mathJaxInstance.texReset();
|
|
125053
|
+
mathJaxInstance.typesetClear();
|
|
125054
|
+
mathJaxInstance.typesetPromise([executeOn]).then(function () {
|
|
125055
|
+
try {
|
|
125056
|
+
removeExcessMjxContainers(executeOn);
|
|
125057
|
+
var updatedDocument = mathJaxInstance.startup.document;
|
|
125058
|
+
var list = updatedDocument.math.list;
|
|
125059
|
+
for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
|
|
125060
|
+
var mathMl = toMMl(item.data.root);
|
|
125061
|
+
var parsedMathMl = mathMl.replaceAll("\n", "");
|
|
125062
|
+
item.data.typesetRoot.setAttribute("data-mathml", parsedMathMl);
|
|
125063
|
+
}
|
|
125064
|
+
} catch (e) {
|
|
125065
|
+
console.error("Error post-processing MathJax typesetting:", e.toString());
|
|
125066
|
+
}
|
|
125067
|
+
mathJaxInstance.startup.document.clear();
|
|
125068
|
+
})["catch"](function (error) {
|
|
125069
|
+
console.error("Error in typesetting with MathJax:", error);
|
|
125070
|
+
});
|
|
125071
|
+
}
|
|
125072
|
+
};
|
|
125073
|
+
var initializeMathJax = function initializeMathJax(callback) {
|
|
125074
|
+
var texConfig = {
|
|
125075
|
+
macros: {
|
|
125076
|
+
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
125077
|
+
overarc: "\\overparen",
|
|
125078
|
+
napprox: "\\not\\approx",
|
|
125079
|
+
longdiv: "\\enclose{longdiv}"
|
|
125080
|
+
},
|
|
125081
|
+
displayMath: [["$$", "$$"], ["\\[", "\\]"]]
|
|
125082
|
+
};
|
|
125083
|
+
window.mathjaxLoadedP = new Promise(function (resolve) {
|
|
125084
|
+
window.MathJax = {
|
|
125085
|
+
startup: {
|
|
125086
|
+
typeset: false,
|
|
125087
|
+
ready: function ready() {
|
|
125088
|
+
var mathjax = MathJax._.mathjax.mathjax;
|
|
125089
|
+
var STATE = MathJax._.core.MathItem.STATE;
|
|
125090
|
+
var Menu = MathJax._.ui.menu.Menu.Menu;
|
|
125091
|
+
var rerender = Menu.prototype.rerender;
|
|
125092
|
+
Menu.prototype.rerender = function () {
|
|
125093
|
+
var _this = this;
|
|
125094
|
+
var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
|
|
125095
|
+
mathjax.handleRetriesFor(function () {
|
|
125096
|
+
return rerender.call(_this, start);
|
|
125097
|
+
});
|
|
125098
|
+
};
|
|
125099
|
+
MathJax.startup.defaultReady();
|
|
125100
|
+
var globalObj = getGlobal();
|
|
125101
|
+
globalObj.instance = MathJax;
|
|
125102
|
+
window.mathjaxLoadedComplete = true;
|
|
125103
|
+
console.log("MathJax has initialised!", new Date().toString());
|
|
125104
|
+
if (callback) {
|
|
125105
|
+
callback();
|
|
125106
|
+
}
|
|
125107
|
+
resolve();
|
|
125108
|
+
}
|
|
125109
|
+
},
|
|
125110
|
+
loader: {
|
|
125111
|
+
load: ["input/mml"],
|
|
125112
|
+
preLoad: function preLoad() {}
|
|
125113
|
+
},
|
|
125114
|
+
tex: texConfig,
|
|
125115
|
+
chtml: {
|
|
125116
|
+
fontURL: "https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2",
|
|
125117
|
+
displayAlign: "center"
|
|
125118
|
+
},
|
|
125119
|
+
customKey: "@pie-lib/math-rendering-accessible@1",
|
|
125120
|
+
options: {
|
|
125121
|
+
enableEnrichment: true,
|
|
125122
|
+
sre: {
|
|
125123
|
+
speech: "deep"
|
|
125124
|
+
},
|
|
125125
|
+
menuOptions: {
|
|
125126
|
+
settings: {
|
|
125127
|
+
assistiveMml: true,
|
|
125128
|
+
collapsible: false,
|
|
125129
|
+
explorer: false
|
|
125130
|
+
}
|
|
125131
|
+
}
|
|
125132
|
+
}
|
|
125133
|
+
};
|
|
125134
|
+
var script = document.createElement("script");
|
|
125135
|
+
script.type = "text/javascript";
|
|
125136
|
+
script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
|
|
125137
|
+
script.async = true;
|
|
125138
|
+
document.body.appendChild(script);
|
|
125139
|
+
});
|
|
125135
125140
|
};
|
|
125141
|
+
exports.initializeMathJax = initializeMathJax;
|
|
125136
125142
|
var renderMath = function renderMath(el, renderOpts) {
|
|
125137
|
-
var
|
|
125143
|
+
var usedForMmlOutput = typeof el === "string";
|
|
125138
125144
|
var executeOn = document.body;
|
|
125139
|
-
if (
|
|
125140
|
-
|
|
125141
|
-
div.innerHTML = el;
|
|
125142
|
-
executeOn = div;
|
|
125145
|
+
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
125146
|
+
return mr.renderMath(el, renderOpts);
|
|
125143
125147
|
}
|
|
125144
|
-
|
|
125145
|
-
|
|
125146
|
-
|
|
125147
|
-
|
|
125148
|
-
|
|
125149
|
-
|
|
125150
|
-
|
|
125151
|
-
(
|
|
125148
|
+
if (!usedForMmlOutput) {
|
|
125149
|
+
if (window.mathjaxLoadedComplete) {
|
|
125150
|
+
renderContentWithMathJax(el);
|
|
125151
|
+
} else if (window.mathjaxLoadedP) {
|
|
125152
|
+
window.mathjaxLoadedP.then(function () {
|
|
125153
|
+
window.mathjaxLoadedComplete = true;
|
|
125154
|
+
renderContentWithMathJax(el);
|
|
125155
|
+
})["catch"](function (error) {
|
|
125156
|
+
return console.error("Error in initializing MathJax:", error);
|
|
125157
|
+
});
|
|
125152
125158
|
}
|
|
125153
|
-
|
|
125159
|
+
} else {
|
|
125160
|
+
if (window.MathJax && window.mathjaxLoadedP) {
|
|
125161
|
+
var div = document.createElement("div");
|
|
125162
|
+
div.innerHTML = el;
|
|
125163
|
+
executeOn = div;
|
|
125154
125164
|
try {
|
|
125155
125165
|
MathJax.texReset();
|
|
125156
125166
|
MathJax.typesetClear();
|
|
@@ -125159,75 +125169,38 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
125159
125169
|
var list = updatedDocument.math.list;
|
|
125160
125170
|
var item = list.next;
|
|
125161
125171
|
var mathMl = toMMl(item.data.root);
|
|
125162
|
-
var parsedMathMl = mathMl.replaceAll(
|
|
125172
|
+
var parsedMathMl = mathMl.replaceAll("\n", "");
|
|
125163
125173
|
return parsedMathMl;
|
|
125164
125174
|
} catch (error) {
|
|
125165
|
-
console.error(
|
|
125175
|
+
console.error("Error rendering math:", error.message);
|
|
125166
125176
|
}
|
|
125177
|
+
return el;
|
|
125167
125178
|
}
|
|
125168
|
-
|
|
125169
|
-
window.mathjaxLoadedP.then(function () {
|
|
125170
|
-
var mathJaxInstance = getGlobal().instance;
|
|
125171
|
-
if (mathJaxInstance) {
|
|
125172
|
-
mathJaxInstance.texReset();
|
|
125173
|
-
mathJaxInstance.typesetClear();
|
|
125174
|
-
mathJaxInstance.typesetPromise([executeOn]).then(function () {
|
|
125175
|
-
try {
|
|
125176
|
-
removeExcessMjxContainers(executeOn);
|
|
125177
|
-
removePlaceholdersAndRestoreDisplay();
|
|
125178
|
-
var _updatedDocument = mathJaxInstance.startup.document;
|
|
125179
|
-
var _list = _updatedDocument.math.list;
|
|
125180
|
-
for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
|
|
125181
|
-
var _mathMl = toMMl(_item.data.root);
|
|
125182
|
-
var _parsedMathMl = _mathMl.replaceAll('\n', '');
|
|
125183
|
-
_item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
|
|
125184
|
-
}
|
|
125185
|
-
} catch (e) {
|
|
125186
|
-
console.error('Error post-processing MathJax typesetting:', e.toString());
|
|
125187
|
-
}
|
|
125188
|
-
mathJaxInstance.startup.document.clear();
|
|
125189
|
-
})["catch"](function (error) {
|
|
125190
|
-
console.error('Error in typesetting with MathJax:', error);
|
|
125191
|
-
});
|
|
125192
|
-
}
|
|
125193
|
-
})["catch"](function (error) {
|
|
125194
|
-
console.error('Error in initializing MathJax:', error);
|
|
125195
|
-
});
|
|
125196
|
-
}
|
|
125197
|
-
};
|
|
125198
|
-
if (skipWaitForMathRenderingLib) {
|
|
125199
|
-
return renderMathAccessible();
|
|
125200
|
-
} else {
|
|
125201
|
-
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
125202
|
-
removePlaceholdersAndRestoreDisplay();
|
|
125203
|
-
return mr.renderMath(executeOn, renderOpts);
|
|
125204
|
-
}
|
|
125205
|
-
if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
|
|
125206
|
-
return renderMathAccessible();
|
|
125207
|
-
}
|
|
125208
|
-
var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
|
|
125209
|
-
var mathElements = executeOn.querySelectorAll('[data-latex]');
|
|
125210
|
-
mathElements.forEach(createPlaceholder);
|
|
125211
|
-
var checkIntervalId;
|
|
125212
|
-
var maxWaitTime = 500;
|
|
125213
|
-
var startTime = Date.now();
|
|
125214
|
-
var checkForLib = function checkForLib() {
|
|
125215
|
-
var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
|
|
125216
|
-
var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
|
|
125217
|
-
if (mathRenderingHasLoaded || hasExceededMaxWait) {
|
|
125218
|
-
clearInterval(checkIntervalId);
|
|
125219
|
-
if (mathRenderingHasLoaded) {
|
|
125220
|
-
removePlaceholdersAndRestoreDisplay();
|
|
125221
|
-
return mr.renderMath(executeOn, renderOpts);
|
|
125222
|
-
}
|
|
125223
|
-
renderMathAccessibleCallback();
|
|
125224
|
-
}
|
|
125225
|
-
};
|
|
125226
|
-
checkIntervalId = setInterval(checkForLib, 100);
|
|
125227
|
-
};
|
|
125228
|
-
waitForMathRenderingLib(renderMathAccessible);
|
|
125179
|
+
return el;
|
|
125229
125180
|
}
|
|
125230
125181
|
};
|
|
125182
|
+
(function () {
|
|
125183
|
+
if (window.checkIntervalId) {
|
|
125184
|
+
return;
|
|
125185
|
+
}
|
|
125186
|
+
window.checkIntervalId = undefined;
|
|
125187
|
+
var maxWaitTime = 5000;
|
|
125188
|
+
var startTime = Date.now();
|
|
125189
|
+
var checkForLib = function checkForLib() {
|
|
125190
|
+
var mathElements = document.body.querySelectorAll("[data-latex]");
|
|
125191
|
+
mathElements.forEach(createPlaceholder);
|
|
125192
|
+
var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
|
|
125193
|
+
var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
|
|
125194
|
+
if (mathRenderingHasLoaded || hasExceededMaxWait) {
|
|
125195
|
+
clearInterval(window.checkIntervalId);
|
|
125196
|
+
removePlaceholdersAndRestoreDisplay();
|
|
125197
|
+
}
|
|
125198
|
+
if (hasExceededMaxWait) {
|
|
125199
|
+
initializeMathJax(renderContentWithMathJax);
|
|
125200
|
+
}
|
|
125201
|
+
};
|
|
125202
|
+
window.checkIntervalId = setInterval(checkForLib, 50);
|
|
125203
|
+
})();
|
|
125231
125204
|
var _default = renderMath;
|
|
125232
125205
|
exports["default"] = _default;
|
|
125233
125206
|
})(renderMath$1);
|
|
@@ -127812,9 +127785,11 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
127812
127785
|
return mmlFromLatex.replace(regex, '');
|
|
127813
127786
|
};
|
|
127814
127787
|
var handled = arrowHandlingCase(decoded);
|
|
127815
|
-
var
|
|
127788
|
+
var latexToConvert = ("<span data-latex=\"\" data-raw=\"").concat(handled, "\">").concat((0, _mathRenderingAccessible.wrapMath)(handled, wrapper), "</span>");
|
|
127789
|
+
var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(latexToConvert, {
|
|
127816
127790
|
skipWaitForMathRenderingLib: true
|
|
127817
127791
|
});
|
|
127792
|
+
var conversionDidNotWork = (0, _isEqual["default"])(latexToConvert, mathMlFromLatex);
|
|
127818
127793
|
mathMlFromLatex = removeEmptyMos(mathMlFromLatex);
|
|
127819
127794
|
var latexFromMathMl = mathMlFromLatex ? (0, _mathRenderingAccessible.mmlToLatex)(mathMlFromLatex) : '';
|
|
127820
127795
|
var strippedL = latex.replace(/\s/g, '');
|
|
@@ -127825,10 +127800,14 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
127825
127800
|
initialLatex: latex,
|
|
127826
127801
|
newLatex: latexFromMathMl,
|
|
127827
127802
|
correctedLatex: correctedLatex,
|
|
127828
|
-
mathML: mathMlFromLatex
|
|
127803
|
+
mathML: mathMlFromLatex,
|
|
127804
|
+
conversionDidNotWork: conversionDidNotWork
|
|
127829
127805
|
});
|
|
127830
127806
|
}
|
|
127831
|
-
return
|
|
127807
|
+
return {
|
|
127808
|
+
mathMlFromLatex: mathMlFromLatex,
|
|
127809
|
+
conversionDidNotWork: conversionDidNotWork
|
|
127810
|
+
};
|
|
127832
127811
|
};
|
|
127833
127812
|
var convertMathMlToLatex = function convertMathMlToLatex(mathMl) {
|
|
127834
127813
|
var htmlWithRemovedSpaces = mathMl.replaceAll(' ', ' ');
|
|
@@ -127895,14 +127874,21 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
127895
127874
|
var decoded = htmlDecode(arrowHandlingCase(latex));
|
|
127896
127875
|
log('[serialize] latex: ', latex);
|
|
127897
127876
|
if (MathPlugin.mathMlOptions.mmlOutput) {
|
|
127877
|
+
var _convertLatexToMathMl = convertLatexToMathMl({
|
|
127878
|
+
latex: latex,
|
|
127879
|
+
decoded: decoded,
|
|
127880
|
+
wrapper: wrapper
|
|
127881
|
+
}), mathMlFromLatex = _convertLatexToMathMl.mathMlFromLatex, conversionDidNotWork = _convertLatexToMathMl.conversionDidNotWork;
|
|
127882
|
+
if (conversionDidNotWork) {
|
|
127883
|
+
return _react["default"].createElement("span", {
|
|
127884
|
+
"data-latex": "",
|
|
127885
|
+
"data-raw": decoded
|
|
127886
|
+
}, (0, _mathRenderingAccessible.wrapMath)(decoded, wrapper));
|
|
127887
|
+
}
|
|
127898
127888
|
return _react["default"].createElement("span", {
|
|
127899
127889
|
"data-type": "mathml",
|
|
127900
127890
|
dangerouslySetInnerHTML: {
|
|
127901
|
-
__html:
|
|
127902
|
-
latex: latex,
|
|
127903
|
-
decoded: decoded,
|
|
127904
|
-
wrapper: wrapper
|
|
127905
|
-
})
|
|
127891
|
+
__html: mathMlFromLatex
|
|
127906
127892
|
}
|
|
127907
127893
|
});
|
|
127908
127894
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/complex-rubric",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "2.19.7-next.
|
|
4
|
+
"version": "2.19.7-next.2+a5588cfdc",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@material-ui/core": "^3.9.2",
|
|
10
|
-
"@pie-element/multi-trait-rubric": "^3.19.7-next.
|
|
11
|
-
"@pie-element/rubric": "^3.19.7-next.
|
|
10
|
+
"@pie-element/multi-trait-rubric": "^3.19.7-next.2+a5588cfdc",
|
|
11
|
+
"@pie-element/rubric": "^3.19.7-next.2+a5588cfdc",
|
|
12
12
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
13
13
|
"classnames": "^2.2.5",
|
|
14
14
|
"debug": "^4.1.1",
|
|
15
15
|
"lodash": "^4.17.11",
|
|
16
16
|
"prop-types": "^15.7.2"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "a5588cfdccb40e970e93736dea60de4b01f1a85d",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"postpublish": "../../scripts/postpublish"
|
|
21
21
|
},
|