@pie-element/complex-rubric 2.19.7-next.1 → 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 +161 -189
- package/module/element.js +161 -189
- package/module/manifest.json +2 -2
- package/module/print.js +161 -189
- package/package.json +4 -4
package/controller/package.json
CHANGED
package/module/configure.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
+
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@2.0.0/module/index.js";
|
|
2
2
|
import RubricConfigure from '@pie-element/rubric/configure/lib';
|
|
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@
|
|
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@5.0.0/module/index.js";
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
5
5
|
m.forEach(function (e) {
|
|
6
6
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -42034,90 +42034,6 @@ Collapse$1.default = _default$2V;
|
|
|
42034
42034
|
var index$1E = getDefaultExportFromCjs(Collapse$2);
|
|
42035
42035
|
var mathRenderingAccessible = {};
|
|
42036
42036
|
var renderMath$1 = {};
|
|
42037
|
-
var mathjaxScript = {};
|
|
42038
|
-
Object.defineProperty(mathjaxScript, "__esModule", {
|
|
42039
|
-
value: true
|
|
42040
|
-
});
|
|
42041
|
-
mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
|
|
42042
|
-
var _renderMath = renderMath$1;
|
|
42043
|
-
var MathJaxVersion = '3.2.2';
|
|
42044
|
-
mathjaxScript.MathJaxVersion = MathJaxVersion;
|
|
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) {
|
|
42069
|
-
window.MathJax = {
|
|
42070
|
-
startup: {
|
|
42071
|
-
typeset: false,
|
|
42072
|
-
ready: function ready() {
|
|
42073
|
-
var mathjax = MathJax._.mathjax.mathjax;
|
|
42074
|
-
var STATE = MathJax._.core.MathItem.STATE;
|
|
42075
|
-
var Menu = MathJax._.ui.menu.Menu.Menu;
|
|
42076
|
-
var rerender = Menu.prototype.rerender;
|
|
42077
|
-
Menu.prototype.rerender = function () {
|
|
42078
|
-
var _this = this;
|
|
42079
|
-
var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
|
|
42080
|
-
mathjax.handleRetriesFor(function () {
|
|
42081
|
-
return rerender.call(_this, start);
|
|
42082
|
-
});
|
|
42083
|
-
};
|
|
42084
|
-
MathJax.startup.defaultReady();
|
|
42085
|
-
var globalObj = (0, _renderMath.getGlobal)();
|
|
42086
|
-
globalObj.instance = MathJax;
|
|
42087
|
-
resolve();
|
|
42088
|
-
}
|
|
42089
|
-
},
|
|
42090
|
-
loader: {
|
|
42091
|
-
load: ['input/mml']
|
|
42092
|
-
},
|
|
42093
|
-
tex: texConfig,
|
|
42094
|
-
chtml: {
|
|
42095
|
-
fontURL: 'https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2',
|
|
42096
|
-
displayAlign: 'center'
|
|
42097
|
-
},
|
|
42098
|
-
customKey: '@pie-lib/math-rendering-accessible@1',
|
|
42099
|
-
options: {
|
|
42100
|
-
enableEnrichment: true,
|
|
42101
|
-
sre: {
|
|
42102
|
-
speech: 'deep'
|
|
42103
|
-
},
|
|
42104
|
-
menuOptions: {
|
|
42105
|
-
settings: {
|
|
42106
|
-
assistiveMml: true,
|
|
42107
|
-
collapsible: false,
|
|
42108
|
-
explorer: false
|
|
42109
|
-
}
|
|
42110
|
-
}
|
|
42111
|
-
}
|
|
42112
|
-
};
|
|
42113
|
-
var script = document.createElement('script');
|
|
42114
|
-
script.type = 'text/javascript';
|
|
42115
|
-
script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
|
|
42116
|
-
script.async = true;
|
|
42117
|
-
document.body.appendChild(script);
|
|
42118
|
-
});
|
|
42119
|
-
};
|
|
42120
|
-
mathjaxScript.initializeMathJax = initializeMathJax;
|
|
42121
42037
|
var normalization$1 = {};
|
|
42122
42038
|
var slicedToArray$3 = {
|
|
42123
42039
|
exports: {}
|
|
@@ -101718,9 +101634,8 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
101718
101634
|
Object.defineProperty(exports, "__esModule", {
|
|
101719
101635
|
value: true
|
|
101720
101636
|
});
|
|
101721
|
-
exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = void 0;
|
|
101637
|
+
exports.initializeMathJax = exports.getGlobal = exports.fixMathElements = exports.fixMathElement = exports["default"] = exports.MathJaxVersion = void 0;
|
|
101722
101638
|
var _typeof2 = _interopRequireDefault(_typeof$s.exports);
|
|
101723
|
-
var _mathjaxScript = mathjaxScript;
|
|
101724
101639
|
var _normalization = normalization$1;
|
|
101725
101640
|
var mr = _interopRequireWildcard(mathRendering);
|
|
101726
101641
|
var _SerializedMmlVisitor = SerializedMmlVisitor;
|
|
@@ -101768,11 +101683,13 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
101768
101683
|
return visitor.visitTree(node);
|
|
101769
101684
|
};
|
|
101770
101685
|
var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
|
|
101771
|
-
var NEWLINE_LATEX =
|
|
101772
|
-
var mathRenderingKEY =
|
|
101773
|
-
var mathRenderingAccessibleKEY =
|
|
101686
|
+
var NEWLINE_LATEX = "\\newline ";
|
|
101687
|
+
var mathRenderingKEY = "@pie-lib/math-rendering@2";
|
|
101688
|
+
var mathRenderingAccessibleKEY = "@pie-lib/math-rendering-accessible@1";
|
|
101689
|
+
var MathJaxVersion = "3.2.2";
|
|
101690
|
+
exports.MathJaxVersion = MathJaxVersion;
|
|
101774
101691
|
var getGlobal = function getGlobal() {
|
|
101775
|
-
if (typeof window !==
|
|
101692
|
+
if (typeof window !== "undefined") {
|
|
101776
101693
|
if (!window[mathRenderingAccessibleKEY]) {
|
|
101777
101694
|
window[mathRenderingAccessibleKEY] = {};
|
|
101778
101695
|
}
|
|
@@ -101782,16 +101699,13 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
101782
101699
|
}
|
|
101783
101700
|
};
|
|
101784
101701
|
exports.getGlobal = getGlobal;
|
|
101785
|
-
var defaultOpts = function defaultOpts() {
|
|
101786
|
-
return getGlobal().opts || ({});
|
|
101787
|
-
};
|
|
101788
101702
|
var fixMathElement = function fixMathElement(element) {
|
|
101789
101703
|
if (element.dataset.mathHandled) {
|
|
101790
101704
|
return;
|
|
101791
101705
|
}
|
|
101792
|
-
var property =
|
|
101706
|
+
var property = "innerText";
|
|
101793
101707
|
if (element.textContent) {
|
|
101794
|
-
property =
|
|
101708
|
+
property = "textContent";
|
|
101795
101709
|
}
|
|
101796
101710
|
if (element[property]) {
|
|
101797
101711
|
element[property] = (0, _normalization.wrapMath)((0, _normalization.unWrapMath)(element[property]).unwrapped);
|
|
@@ -101802,7 +101716,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
101802
101716
|
exports.fixMathElement = fixMathElement;
|
|
101803
101717
|
var fixMathElements = function fixMathElements() {
|
|
101804
101718
|
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
101805
|
-
var mathElements = el.querySelectorAll(
|
|
101719
|
+
var mathElements = el.querySelectorAll("[data-latex]");
|
|
101806
101720
|
mathElements.forEach(function (item) {
|
|
101807
101721
|
return fixMathElement(item);
|
|
101808
101722
|
});
|
|
@@ -101810,25 +101724,25 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
101810
101724
|
exports.fixMathElements = fixMathElements;
|
|
101811
101725
|
var adjustMathMLStyle = function adjustMathMLStyle() {
|
|
101812
101726
|
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
101813
|
-
var nodes = el.querySelectorAll(
|
|
101727
|
+
var nodes = el.querySelectorAll("math");
|
|
101814
101728
|
nodes.forEach(function (node) {
|
|
101815
|
-
return node.setAttribute(
|
|
101729
|
+
return node.setAttribute("displaystyle", "true");
|
|
101816
101730
|
});
|
|
101817
101731
|
};
|
|
101818
101732
|
var createPlaceholder = function createPlaceholder(element) {
|
|
101819
101733
|
var _element$previousSibl;
|
|
101820
|
-
if (!element.previousSibling || !((_element$previousSibl = element.previousSibling.classList) !== null && _element$previousSibl !== void 0 && _element$previousSibl.contains(
|
|
101734
|
+
if (!element.previousSibling || !((_element$previousSibl = element.previousSibling.classList) !== null && _element$previousSibl !== void 0 && _element$previousSibl.contains("math-placeholder"))) {
|
|
101821
101735
|
var _element$parentNode;
|
|
101822
|
-
element.dataset.originalDisplay = element.style.display ||
|
|
101823
|
-
element.style.display =
|
|
101824
|
-
var placeholder = document.createElement(
|
|
101825
|
-
placeholder.style.cssText =
|
|
101826
|
-
placeholder.classList.add(
|
|
101736
|
+
element.dataset.originalDisplay = element.style.display || "";
|
|
101737
|
+
element.style.display = "none";
|
|
101738
|
+
var placeholder = document.createElement("span");
|
|
101739
|
+
placeholder.style.cssText = "height: 10px; width: 50px; display: inline-block; vertical-align: middle; justify-content: center; background: #fafafa; border-radius: 4px;";
|
|
101740
|
+
placeholder.classList.add("math-placeholder");
|
|
101827
101741
|
(_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 ? void 0 : _element$parentNode.insertBefore(placeholder, element);
|
|
101828
101742
|
}
|
|
101829
101743
|
};
|
|
101830
101744
|
var removePlaceholdersAndRestoreDisplay = function removePlaceholdersAndRestoreDisplay() {
|
|
101831
|
-
document.querySelectorAll(
|
|
101745
|
+
document.querySelectorAll(".math-placeholder").forEach(function (placeholder) {
|
|
101832
101746
|
var _targetElement$datase;
|
|
101833
101747
|
var targetElement = placeholder.nextElementSibling;
|
|
101834
101748
|
if (targetElement && ((_targetElement$datase = targetElement.dataset) === null || _targetElement$datase === void 0 ? void 0 : _targetElement$datase.originalDisplay) !== undefined) {
|
|
@@ -101839,9 +101753,9 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
101839
101753
|
});
|
|
101840
101754
|
};
|
|
101841
101755
|
var removeExcessMjxContainers = function removeExcessMjxContainers(content) {
|
|
101842
|
-
var elements = content.querySelectorAll(
|
|
101756
|
+
var elements = content.querySelectorAll("[data-latex][data-math-handled=\"true\"]");
|
|
101843
101757
|
elements.forEach(function (element) {
|
|
101844
|
-
var mjxContainers = element.querySelectorAll(
|
|
101758
|
+
var mjxContainers = element.querySelectorAll("mjx-container");
|
|
101845
101759
|
if (mjxContainers.length > 1) {
|
|
101846
101760
|
for (var i = 1; i < mjxContainers.length; i++) {
|
|
101847
101761
|
mjxContainers[i].parentNode.removeChild(mjxContainers[i]);
|
|
@@ -101849,28 +101763,124 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
101849
101763
|
}
|
|
101850
101764
|
});
|
|
101851
101765
|
};
|
|
101852
|
-
var
|
|
101853
|
-
|
|
101854
|
-
|
|
101766
|
+
var renderContentWithMathJax = function renderContentWithMathJax(executeOn) {
|
|
101767
|
+
executeOn = executeOn || document.body;
|
|
101768
|
+
fixMathElements(executeOn);
|
|
101769
|
+
adjustMathMLStyle(executeOn);
|
|
101770
|
+
var mathJaxInstance = getGlobal().instance;
|
|
101771
|
+
if (mathJaxInstance) {
|
|
101772
|
+
mathJaxInstance.texReset();
|
|
101773
|
+
mathJaxInstance.typesetClear();
|
|
101774
|
+
mathJaxInstance.typesetPromise([executeOn]).then(function () {
|
|
101775
|
+
try {
|
|
101776
|
+
removeExcessMjxContainers(executeOn);
|
|
101777
|
+
var updatedDocument = mathJaxInstance.startup.document;
|
|
101778
|
+
var list = updatedDocument.math.list;
|
|
101779
|
+
for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
|
|
101780
|
+
var mathMl = toMMl(item.data.root);
|
|
101781
|
+
var parsedMathMl = mathMl.replaceAll("\n", "");
|
|
101782
|
+
item.data.typesetRoot.setAttribute("data-mathml", parsedMathMl);
|
|
101783
|
+
}
|
|
101784
|
+
} catch (e) {
|
|
101785
|
+
console.error("Error post-processing MathJax typesetting:", e.toString());
|
|
101786
|
+
}
|
|
101787
|
+
mathJaxInstance.startup.document.clear();
|
|
101788
|
+
})["catch"](function (error) {
|
|
101789
|
+
console.error("Error in typesetting with MathJax:", error);
|
|
101790
|
+
});
|
|
101791
|
+
}
|
|
101792
|
+
};
|
|
101793
|
+
var initializeMathJax = function initializeMathJax(callback) {
|
|
101794
|
+
var texConfig = {
|
|
101795
|
+
macros: {
|
|
101796
|
+
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
101797
|
+
overarc: "\\overparen",
|
|
101798
|
+
napprox: "\\not\\approx",
|
|
101799
|
+
longdiv: "\\enclose{longdiv}"
|
|
101800
|
+
},
|
|
101801
|
+
displayMath: [["$$", "$$"], ["\\[", "\\]"]]
|
|
101802
|
+
};
|
|
101803
|
+
window.mathjaxLoadedP = new Promise(function (resolve) {
|
|
101804
|
+
window.MathJax = {
|
|
101805
|
+
startup: {
|
|
101806
|
+
typeset: false,
|
|
101807
|
+
ready: function ready() {
|
|
101808
|
+
var mathjax = MathJax._.mathjax.mathjax;
|
|
101809
|
+
var STATE = MathJax._.core.MathItem.STATE;
|
|
101810
|
+
var Menu = MathJax._.ui.menu.Menu.Menu;
|
|
101811
|
+
var rerender = Menu.prototype.rerender;
|
|
101812
|
+
Menu.prototype.rerender = function () {
|
|
101813
|
+
var _this = this;
|
|
101814
|
+
var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
|
|
101815
|
+
mathjax.handleRetriesFor(function () {
|
|
101816
|
+
return rerender.call(_this, start);
|
|
101817
|
+
});
|
|
101818
|
+
};
|
|
101819
|
+
MathJax.startup.defaultReady();
|
|
101820
|
+
var globalObj = getGlobal();
|
|
101821
|
+
globalObj.instance = MathJax;
|
|
101822
|
+
window.mathjaxLoadedComplete = true;
|
|
101823
|
+
console.log("MathJax has initialised!", new Date().toString());
|
|
101824
|
+
if (callback) {
|
|
101825
|
+
callback();
|
|
101826
|
+
}
|
|
101827
|
+
resolve();
|
|
101828
|
+
}
|
|
101829
|
+
},
|
|
101830
|
+
loader: {
|
|
101831
|
+
load: ["input/mml"],
|
|
101832
|
+
preLoad: function preLoad() {}
|
|
101833
|
+
},
|
|
101834
|
+
tex: texConfig,
|
|
101835
|
+
chtml: {
|
|
101836
|
+
fontURL: "https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2",
|
|
101837
|
+
displayAlign: "center"
|
|
101838
|
+
},
|
|
101839
|
+
customKey: "@pie-lib/math-rendering-accessible@1",
|
|
101840
|
+
options: {
|
|
101841
|
+
enableEnrichment: true,
|
|
101842
|
+
sre: {
|
|
101843
|
+
speech: "deep"
|
|
101844
|
+
},
|
|
101845
|
+
menuOptions: {
|
|
101846
|
+
settings: {
|
|
101847
|
+
assistiveMml: true,
|
|
101848
|
+
collapsible: false,
|
|
101849
|
+
explorer: false
|
|
101850
|
+
}
|
|
101851
|
+
}
|
|
101852
|
+
}
|
|
101853
|
+
};
|
|
101854
|
+
var script = document.createElement("script");
|
|
101855
|
+
script.type = "text/javascript";
|
|
101856
|
+
script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
|
|
101857
|
+
script.async = true;
|
|
101858
|
+
document.body.appendChild(script);
|
|
101859
|
+
});
|
|
101855
101860
|
};
|
|
101861
|
+
exports.initializeMathJax = initializeMathJax;
|
|
101856
101862
|
var renderMath = function renderMath(el, renderOpts) {
|
|
101857
|
-
var
|
|
101863
|
+
var usedForMmlOutput = typeof el === "string";
|
|
101858
101864
|
var executeOn = document.body;
|
|
101859
|
-
if (
|
|
101860
|
-
|
|
101861
|
-
div.innerHTML = el;
|
|
101862
|
-
executeOn = div;
|
|
101865
|
+
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
101866
|
+
return mr.renderMath(el, renderOpts);
|
|
101863
101867
|
}
|
|
101864
|
-
|
|
101865
|
-
|
|
101866
|
-
|
|
101867
|
-
|
|
101868
|
-
|
|
101869
|
-
|
|
101870
|
-
|
|
101871
|
-
(
|
|
101868
|
+
if (!usedForMmlOutput) {
|
|
101869
|
+
if (window.mathjaxLoadedComplete) {
|
|
101870
|
+
renderContentWithMathJax(el);
|
|
101871
|
+
} else if (window.mathjaxLoadedP) {
|
|
101872
|
+
window.mathjaxLoadedP.then(function () {
|
|
101873
|
+
window.mathjaxLoadedComplete = true;
|
|
101874
|
+
renderContentWithMathJax(el);
|
|
101875
|
+
})["catch"](function (error) {
|
|
101876
|
+
return console.error("Error in initializing MathJax:", error);
|
|
101877
|
+
});
|
|
101872
101878
|
}
|
|
101873
|
-
|
|
101879
|
+
} else {
|
|
101880
|
+
if (window.MathJax && window.mathjaxLoadedP) {
|
|
101881
|
+
var div = document.createElement("div");
|
|
101882
|
+
div.innerHTML = el;
|
|
101883
|
+
executeOn = div;
|
|
101874
101884
|
try {
|
|
101875
101885
|
MathJax.texReset();
|
|
101876
101886
|
MathJax.typesetClear();
|
|
@@ -101879,76 +101889,38 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
101879
101889
|
var list = updatedDocument.math.list;
|
|
101880
101890
|
var item = list.next;
|
|
101881
101891
|
var mathMl = toMMl(item.data.root);
|
|
101882
|
-
var parsedMathMl = mathMl.replaceAll(
|
|
101892
|
+
var parsedMathMl = mathMl.replaceAll("\n", "");
|
|
101883
101893
|
return parsedMathMl;
|
|
101884
101894
|
} catch (error) {
|
|
101885
|
-
console.error(
|
|
101895
|
+
console.error("Error rendering math:", error.message);
|
|
101886
101896
|
}
|
|
101887
101897
|
return el;
|
|
101888
101898
|
}
|
|
101889
|
-
|
|
101890
|
-
window.mathjaxLoadedP.then(function () {
|
|
101891
|
-
var mathJaxInstance = getGlobal().instance;
|
|
101892
|
-
if (mathJaxInstance) {
|
|
101893
|
-
mathJaxInstance.texReset();
|
|
101894
|
-
mathJaxInstance.typesetClear();
|
|
101895
|
-
mathJaxInstance.typesetPromise([executeOn]).then(function () {
|
|
101896
|
-
try {
|
|
101897
|
-
removeExcessMjxContainers(executeOn);
|
|
101898
|
-
removePlaceholdersAndRestoreDisplay();
|
|
101899
|
-
var _updatedDocument = mathJaxInstance.startup.document;
|
|
101900
|
-
var _list = _updatedDocument.math.list;
|
|
101901
|
-
for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
|
|
101902
|
-
var _mathMl = toMMl(_item.data.root);
|
|
101903
|
-
var _parsedMathMl = _mathMl.replaceAll('\n', '');
|
|
101904
|
-
_item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
|
|
101905
|
-
}
|
|
101906
|
-
} catch (e) {
|
|
101907
|
-
console.error('Error post-processing MathJax typesetting:', e.toString());
|
|
101908
|
-
}
|
|
101909
|
-
mathJaxInstance.startup.document.clear();
|
|
101910
|
-
})["catch"](function (error) {
|
|
101911
|
-
console.error('Error in typesetting with MathJax:', error);
|
|
101912
|
-
});
|
|
101913
|
-
}
|
|
101914
|
-
})["catch"](function (error) {
|
|
101915
|
-
console.error('Error in initializing MathJax:', error);
|
|
101916
|
-
});
|
|
101917
|
-
}
|
|
101918
|
-
};
|
|
101919
|
-
if (skipWaitForMathRenderingLib) {
|
|
101920
|
-
return renderMathAccessible();
|
|
101921
|
-
} else {
|
|
101922
|
-
if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
|
|
101923
|
-
removePlaceholdersAndRestoreDisplay();
|
|
101924
|
-
return mr.renderMath(executeOn, renderOpts);
|
|
101925
|
-
}
|
|
101926
|
-
if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
|
|
101927
|
-
return renderMathAccessible();
|
|
101928
|
-
}
|
|
101929
|
-
var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
|
|
101930
|
-
var mathElements = executeOn.querySelectorAll('[data-latex]');
|
|
101931
|
-
mathElements.forEach(createPlaceholder);
|
|
101932
|
-
var checkIntervalId;
|
|
101933
|
-
var maxWaitTime = 500;
|
|
101934
|
-
var startTime = Date.now();
|
|
101935
|
-
var checkForLib = function checkForLib() {
|
|
101936
|
-
var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
|
|
101937
|
-
var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
|
|
101938
|
-
if (mathRenderingHasLoaded || hasExceededMaxWait) {
|
|
101939
|
-
clearInterval(checkIntervalId);
|
|
101940
|
-
if (mathRenderingHasLoaded) {
|
|
101941
|
-
removePlaceholdersAndRestoreDisplay();
|
|
101942
|
-
return mr.renderMath(executeOn, renderOpts);
|
|
101943
|
-
}
|
|
101944
|
-
renderMathAccessibleCallback();
|
|
101945
|
-
}
|
|
101946
|
-
};
|
|
101947
|
-
checkIntervalId = setInterval(checkForLib, 100);
|
|
101948
|
-
};
|
|
101949
|
-
waitForMathRenderingLib(renderMathAccessible);
|
|
101899
|
+
return el;
|
|
101950
101900
|
}
|
|
101951
101901
|
};
|
|
101902
|
+
(function () {
|
|
101903
|
+
if (window.checkIntervalId) {
|
|
101904
|
+
return;
|
|
101905
|
+
}
|
|
101906
|
+
window.checkIntervalId = undefined;
|
|
101907
|
+
var maxWaitTime = 5000;
|
|
101908
|
+
var startTime = Date.now();
|
|
101909
|
+
var checkForLib = function checkForLib() {
|
|
101910
|
+
var mathElements = document.body.querySelectorAll("[data-latex]");
|
|
101911
|
+
mathElements.forEach(createPlaceholder);
|
|
101912
|
+
var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
|
|
101913
|
+
var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
|
|
101914
|
+
if (mathRenderingHasLoaded || hasExceededMaxWait) {
|
|
101915
|
+
clearInterval(window.checkIntervalId);
|
|
101916
|
+
removePlaceholdersAndRestoreDisplay();
|
|
101917
|
+
}
|
|
101918
|
+
if (hasExceededMaxWait) {
|
|
101919
|
+
initializeMathJax(renderContentWithMathJax);
|
|
101920
|
+
}
|
|
101921
|
+
};
|
|
101922
|
+
window.checkIntervalId = setInterval(checkForLib, 50);
|
|
101923
|
+
})();
|
|
101952
101924
|
var _default = renderMath;
|
|
101953
101925
|
exports["default"] = _default;
|
|
101954
101926
|
})(renderMath$1);
|