@pie-element/math-templated 3.1.2-next.5 → 3.1.2-next.54
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/configure/package.json +1 -1
- package/controller/package.json +1 -1
- package/module/configure.js +144 -4
- package/module/element.js +144 -4
- package/module/manifest.json +2 -2
- package/module/print.js +144 -4
- package/package.json +3 -3
package/configure/package.json
CHANGED
package/controller/package.json
CHANGED
package/module/configure.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.11/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_math_toolbar, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@5.0.7/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) {
|
|
5
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -49977,6 +49977,52 @@ MmlVisitor$1.MmlVisitor = MmlVisitor;
|
|
|
49977
49977
|
exports.SerializedMmlVisitor = SerializedMmlVisitor;
|
|
49978
49978
|
})(SerializedMmlVisitor);
|
|
49979
49979
|
getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
49980
|
+
var TexError$1 = {};
|
|
49981
|
+
Object.defineProperty(TexError$1, "__esModule", {
|
|
49982
|
+
value: true
|
|
49983
|
+
});
|
|
49984
|
+
var TexError = (function () {
|
|
49985
|
+
function TexError(id, message) {
|
|
49986
|
+
var rest = [];
|
|
49987
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
49988
|
+
rest[_i - 2] = arguments[_i];
|
|
49989
|
+
}
|
|
49990
|
+
this.id = id;
|
|
49991
|
+
this.message = TexError.processString(message, rest);
|
|
49992
|
+
}
|
|
49993
|
+
TexError.processString = function (str, args) {
|
|
49994
|
+
var parts = str.split(TexError.pattern);
|
|
49995
|
+
for (var i = 1, m = parts.length; i < m; i += 2) {
|
|
49996
|
+
var c = parts[i].charAt(0);
|
|
49997
|
+
if (c >= '0' && c <= '9') {
|
|
49998
|
+
parts[i] = args[parseInt(parts[i], 10) - 1];
|
|
49999
|
+
if (typeof parts[i] === 'number') {
|
|
50000
|
+
parts[i] = parts[i].toString();
|
|
50001
|
+
}
|
|
50002
|
+
} else if (c === '{') {
|
|
50003
|
+
c = parts[i].substr(1);
|
|
50004
|
+
if (c >= '0' && c <= '9') {
|
|
50005
|
+
parts[i] = args[parseInt(parts[i].substr(1, parts[i].length - 2), 10) - 1];
|
|
50006
|
+
if (typeof parts[i] === 'number') {
|
|
50007
|
+
parts[i] = parts[i].toString();
|
|
50008
|
+
}
|
|
50009
|
+
} else {
|
|
50010
|
+
var match = parts[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/);
|
|
50011
|
+
if (match) {
|
|
50012
|
+
parts[i] = '%' + parts[i];
|
|
50013
|
+
}
|
|
50014
|
+
}
|
|
50015
|
+
}
|
|
50016
|
+
if (parts[i] == null) {
|
|
50017
|
+
parts[i] = '???';
|
|
50018
|
+
}
|
|
50019
|
+
}
|
|
50020
|
+
return parts.join('');
|
|
50021
|
+
};
|
|
50022
|
+
TexError.pattern = /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g;
|
|
50023
|
+
return TexError;
|
|
50024
|
+
})();
|
|
50025
|
+
TexError$1.default = TexError;
|
|
49980
50026
|
(function (exports) {
|
|
49981
50027
|
var _interopRequireDefault = interopRequireDefault.exports;
|
|
49982
50028
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -49986,6 +50032,7 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
49986
50032
|
var _typeof2 = _interopRequireDefault(_typeof$3.exports);
|
|
49987
50033
|
var _normalization = normalization;
|
|
49988
50034
|
var _SerializedMmlVisitor = SerializedMmlVisitor;
|
|
50035
|
+
var _TexError = _interopRequireDefault(TexError$1);
|
|
49989
50036
|
var visitor = new _SerializedMmlVisitor.SerializedMmlVisitor();
|
|
49990
50037
|
var toMMl = function toMMl(node) {
|
|
49991
50038
|
return visitor.visitTree(node);
|
|
@@ -50071,6 +50118,15 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
50071
50118
|
}
|
|
50072
50119
|
});
|
|
50073
50120
|
};
|
|
50121
|
+
var renderContentsWithMathJax = function renderContentsWithMathJax(el) {
|
|
50122
|
+
if (el instanceof Array) {
|
|
50123
|
+
el.forEach(function (elNode) {
|
|
50124
|
+
return renderContentWithMathJax(elNode);
|
|
50125
|
+
});
|
|
50126
|
+
} else {
|
|
50127
|
+
renderContentWithMathJax(el);
|
|
50128
|
+
}
|
|
50129
|
+
};
|
|
50074
50130
|
var renderContentWithMathJax = function renderContentWithMathJax(executeOn) {
|
|
50075
50131
|
executeOn = executeOn || document.body;
|
|
50076
50132
|
if (!(executeOn instanceof HTMLElement)) return;
|
|
@@ -50100,10 +50156,77 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
50100
50156
|
});
|
|
50101
50157
|
}
|
|
50102
50158
|
};
|
|
50159
|
+
var convertMathJax2ToMathJax3 = function convertMathJax2ToMathJax3() {
|
|
50160
|
+
var CommandMap = MathJax._.input.tex.SymbolMap.CommandMap;
|
|
50161
|
+
var requireMap = MathJax.config.startup.requireMap;
|
|
50162
|
+
var RequireLoad = MathJax._.input.tex.require.RequireConfiguration.RequireLoad;
|
|
50163
|
+
var RequireMethods = {
|
|
50164
|
+
Require: function Require(parser, name) {
|
|
50165
|
+
var required = parser.GetArgument(name);
|
|
50166
|
+
if (required.match(/[^_a-zA-Z0-9]/) || required === "") {
|
|
50167
|
+
throw new _TexError["default"]("BadPackageName", "Argument for %1 is not a valid package name", name);
|
|
50168
|
+
}
|
|
50169
|
+
if (requireMap.hasOwnProperty(required)) {
|
|
50170
|
+
required = requireMap[required];
|
|
50171
|
+
}
|
|
50172
|
+
RequireLoad(parser, required);
|
|
50173
|
+
}
|
|
50174
|
+
};
|
|
50175
|
+
new CommandMap("require", {
|
|
50176
|
+
require: "Require"
|
|
50177
|
+
}, RequireMethods);
|
|
50178
|
+
MathJax.Callback = function (args) {
|
|
50179
|
+
if (Array.isArray(args)) {
|
|
50180
|
+
if (args.length === 1 && typeof args[0] === "function") {
|
|
50181
|
+
return args[0];
|
|
50182
|
+
} else if (typeof args[0] === "string" && args[1] instanceof Object && typeof args[1][args[0]] === "function") {
|
|
50183
|
+
return Function.bind.apply(args[1][args[0]], args.slice(1));
|
|
50184
|
+
} else if (typeof args[0] === "function") {
|
|
50185
|
+
return Function.bind.apply(args[0], [window].concat(args.slice(1)));
|
|
50186
|
+
} else if (typeof args[1] === "function") {
|
|
50187
|
+
return Function.bind.apply(args[1], [args[0]].concat(args.slice(2)));
|
|
50188
|
+
}
|
|
50189
|
+
} else if (typeof args === "function") {
|
|
50190
|
+
return args;
|
|
50191
|
+
}
|
|
50192
|
+
throw Error("Can't make callback from given data");
|
|
50193
|
+
};
|
|
50194
|
+
MathJax.Hub = {
|
|
50195
|
+
Queue: function Queue() {
|
|
50196
|
+
for (var i = 0, m = arguments.length; i < m; i++) {
|
|
50197
|
+
var fn = MathJax.Callback(arguments[i]);
|
|
50198
|
+
MathJax.startup.promise = MathJax.startup.promise.then(fn);
|
|
50199
|
+
}
|
|
50200
|
+
return MathJax.startup.promise;
|
|
50201
|
+
},
|
|
50202
|
+
Typeset: function Typeset(elements, callback) {
|
|
50203
|
+
var promise = MathJax.typesetPromise(elements);
|
|
50204
|
+
if (callback) {
|
|
50205
|
+
promise = promise.then(callback);
|
|
50206
|
+
}
|
|
50207
|
+
return promise;
|
|
50208
|
+
},
|
|
50209
|
+
Register: {
|
|
50210
|
+
MessageHook: function MessageHook() {
|
|
50211
|
+
console.log("MessageHooks are not supported in version 3");
|
|
50212
|
+
},
|
|
50213
|
+
StartupHook: function StartupHook() {
|
|
50214
|
+
console.log("StartupHooks are not supported in version 3");
|
|
50215
|
+
},
|
|
50216
|
+
LoadHook: function LoadHook() {
|
|
50217
|
+
console.log("LoadHooks are not supported in version 3");
|
|
50218
|
+
}
|
|
50219
|
+
},
|
|
50220
|
+
Config: function Config() {
|
|
50221
|
+
console.log("MathJax configurations should be converted for version 3");
|
|
50222
|
+
}
|
|
50223
|
+
};
|
|
50224
|
+
};
|
|
50103
50225
|
var initializeMathJax = function initializeMathJax(callback) {
|
|
50104
50226
|
if (window.mathjaxLoadedP) {
|
|
50105
50227
|
return;
|
|
50106
50228
|
}
|
|
50229
|
+
var PreviousMathJaxIsUsed = window.MathJax && window.MathJax.version && window.MathJax.version !== MathJaxVersion && window.MathJax.version[0] === '2';
|
|
50107
50230
|
var texConfig = {
|
|
50108
50231
|
macros: {
|
|
50109
50232
|
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
@@ -50113,11 +50236,28 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
50113
50236
|
},
|
|
50114
50237
|
displayMath: [["$$", "$$"], ["\\[", "\\]"]]
|
|
50115
50238
|
};
|
|
50239
|
+
if (PreviousMathJaxIsUsed) {
|
|
50240
|
+
texConfig.autoload = {
|
|
50241
|
+
color: [],
|
|
50242
|
+
colorv2: ["color"]
|
|
50243
|
+
};
|
|
50244
|
+
}
|
|
50116
50245
|
window.mathjaxLoadedP = new Promise(function (resolve) {
|
|
50117
50246
|
window.MathJax = {
|
|
50118
50247
|
startup: {
|
|
50248
|
+
requireMap: PreviousMathJaxIsUsed ? {
|
|
50249
|
+
AMSmath: "ams",
|
|
50250
|
+
AMSsymbols: "ams",
|
|
50251
|
+
AMScd: "amscd",
|
|
50252
|
+
HTML: "html",
|
|
50253
|
+
noErrors: "noerrors",
|
|
50254
|
+
noUndefined: "noundefined"
|
|
50255
|
+
} : {},
|
|
50119
50256
|
typeset: false,
|
|
50120
50257
|
ready: function ready() {
|
|
50258
|
+
if (PreviousMathJaxIsUsed) {
|
|
50259
|
+
convertMathJax2ToMathJax3();
|
|
50260
|
+
}
|
|
50121
50261
|
var mathjax = MathJax._.mathjax.mathjax;
|
|
50122
50262
|
var STATE = MathJax._.core.MathItem.STATE;
|
|
50123
50263
|
var Menu = MathJax._.ui.menu.Menu.Menu;
|
|
@@ -50184,11 +50324,11 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
50184
50324
|
var executeOn = document.body;
|
|
50185
50325
|
if (!usedForMmlOutput) {
|
|
50186
50326
|
if (window.mathjaxLoadedComplete) {
|
|
50187
|
-
|
|
50327
|
+
renderContentsWithMathJax(el);
|
|
50188
50328
|
} else if (window.mathjaxLoadedP) {
|
|
50189
50329
|
window.mathjaxLoadedP.then(function () {
|
|
50190
50330
|
window.mathjaxLoadedComplete = true;
|
|
50191
|
-
|
|
50331
|
+
renderContentsWithMathJax(el);
|
|
50192
50332
|
})["catch"](function (error) {
|
|
50193
50333
|
return console.error("Error in initializing MathJax:", error);
|
|
50194
50334
|
});
|
package/module/element.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.11/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.0.7/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) {
|
|
5
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -28867,6 +28867,52 @@ MmlVisitor$1.MmlVisitor = MmlVisitor;
|
|
|
28867
28867
|
exports.SerializedMmlVisitor = SerializedMmlVisitor;
|
|
28868
28868
|
})(SerializedMmlVisitor);
|
|
28869
28869
|
getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
28870
|
+
var TexError$1 = {};
|
|
28871
|
+
Object.defineProperty(TexError$1, "__esModule", {
|
|
28872
|
+
value: true
|
|
28873
|
+
});
|
|
28874
|
+
var TexError = (function () {
|
|
28875
|
+
function TexError(id, message) {
|
|
28876
|
+
var rest = [];
|
|
28877
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
28878
|
+
rest[_i - 2] = arguments[_i];
|
|
28879
|
+
}
|
|
28880
|
+
this.id = id;
|
|
28881
|
+
this.message = TexError.processString(message, rest);
|
|
28882
|
+
}
|
|
28883
|
+
TexError.processString = function (str, args) {
|
|
28884
|
+
var parts = str.split(TexError.pattern);
|
|
28885
|
+
for (var i = 1, m = parts.length; i < m; i += 2) {
|
|
28886
|
+
var c = parts[i].charAt(0);
|
|
28887
|
+
if (c >= '0' && c <= '9') {
|
|
28888
|
+
parts[i] = args[parseInt(parts[i], 10) - 1];
|
|
28889
|
+
if (typeof parts[i] === 'number') {
|
|
28890
|
+
parts[i] = parts[i].toString();
|
|
28891
|
+
}
|
|
28892
|
+
} else if (c === '{') {
|
|
28893
|
+
c = parts[i].substr(1);
|
|
28894
|
+
if (c >= '0' && c <= '9') {
|
|
28895
|
+
parts[i] = args[parseInt(parts[i].substr(1, parts[i].length - 2), 10) - 1];
|
|
28896
|
+
if (typeof parts[i] === 'number') {
|
|
28897
|
+
parts[i] = parts[i].toString();
|
|
28898
|
+
}
|
|
28899
|
+
} else {
|
|
28900
|
+
var match = parts[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/);
|
|
28901
|
+
if (match) {
|
|
28902
|
+
parts[i] = '%' + parts[i];
|
|
28903
|
+
}
|
|
28904
|
+
}
|
|
28905
|
+
}
|
|
28906
|
+
if (parts[i] == null) {
|
|
28907
|
+
parts[i] = '???';
|
|
28908
|
+
}
|
|
28909
|
+
}
|
|
28910
|
+
return parts.join('');
|
|
28911
|
+
};
|
|
28912
|
+
TexError.pattern = /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g;
|
|
28913
|
+
return TexError;
|
|
28914
|
+
})();
|
|
28915
|
+
TexError$1.default = TexError;
|
|
28870
28916
|
(function (exports) {
|
|
28871
28917
|
var _interopRequireDefault = interopRequireDefault.exports;
|
|
28872
28918
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -28876,6 +28922,7 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
28876
28922
|
var _typeof2 = _interopRequireDefault(_typeof$b.exports);
|
|
28877
28923
|
var _normalization = normalization;
|
|
28878
28924
|
var _SerializedMmlVisitor = SerializedMmlVisitor;
|
|
28925
|
+
var _TexError = _interopRequireDefault(TexError$1);
|
|
28879
28926
|
var visitor = new _SerializedMmlVisitor.SerializedMmlVisitor();
|
|
28880
28927
|
var toMMl = function toMMl(node) {
|
|
28881
28928
|
return visitor.visitTree(node);
|
|
@@ -28961,6 +29008,15 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
28961
29008
|
}
|
|
28962
29009
|
});
|
|
28963
29010
|
};
|
|
29011
|
+
var renderContentsWithMathJax = function renderContentsWithMathJax(el) {
|
|
29012
|
+
if (el instanceof Array) {
|
|
29013
|
+
el.forEach(function (elNode) {
|
|
29014
|
+
return renderContentWithMathJax(elNode);
|
|
29015
|
+
});
|
|
29016
|
+
} else {
|
|
29017
|
+
renderContentWithMathJax(el);
|
|
29018
|
+
}
|
|
29019
|
+
};
|
|
28964
29020
|
var renderContentWithMathJax = function renderContentWithMathJax(executeOn) {
|
|
28965
29021
|
executeOn = executeOn || document.body;
|
|
28966
29022
|
if (!(executeOn instanceof HTMLElement)) return;
|
|
@@ -28990,10 +29046,77 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
28990
29046
|
});
|
|
28991
29047
|
}
|
|
28992
29048
|
};
|
|
29049
|
+
var convertMathJax2ToMathJax3 = function convertMathJax2ToMathJax3() {
|
|
29050
|
+
var CommandMap = MathJax._.input.tex.SymbolMap.CommandMap;
|
|
29051
|
+
var requireMap = MathJax.config.startup.requireMap;
|
|
29052
|
+
var RequireLoad = MathJax._.input.tex.require.RequireConfiguration.RequireLoad;
|
|
29053
|
+
var RequireMethods = {
|
|
29054
|
+
Require: function Require(parser, name) {
|
|
29055
|
+
var required = parser.GetArgument(name);
|
|
29056
|
+
if (required.match(/[^_a-zA-Z0-9]/) || required === "") {
|
|
29057
|
+
throw new _TexError["default"]("BadPackageName", "Argument for %1 is not a valid package name", name);
|
|
29058
|
+
}
|
|
29059
|
+
if (requireMap.hasOwnProperty(required)) {
|
|
29060
|
+
required = requireMap[required];
|
|
29061
|
+
}
|
|
29062
|
+
RequireLoad(parser, required);
|
|
29063
|
+
}
|
|
29064
|
+
};
|
|
29065
|
+
new CommandMap("require", {
|
|
29066
|
+
require: "Require"
|
|
29067
|
+
}, RequireMethods);
|
|
29068
|
+
MathJax.Callback = function (args) {
|
|
29069
|
+
if (Array.isArray(args)) {
|
|
29070
|
+
if (args.length === 1 && typeof args[0] === "function") {
|
|
29071
|
+
return args[0];
|
|
29072
|
+
} else if (typeof args[0] === "string" && args[1] instanceof Object && typeof args[1][args[0]] === "function") {
|
|
29073
|
+
return Function.bind.apply(args[1][args[0]], args.slice(1));
|
|
29074
|
+
} else if (typeof args[0] === "function") {
|
|
29075
|
+
return Function.bind.apply(args[0], [window].concat(args.slice(1)));
|
|
29076
|
+
} else if (typeof args[1] === "function") {
|
|
29077
|
+
return Function.bind.apply(args[1], [args[0]].concat(args.slice(2)));
|
|
29078
|
+
}
|
|
29079
|
+
} else if (typeof args === "function") {
|
|
29080
|
+
return args;
|
|
29081
|
+
}
|
|
29082
|
+
throw Error("Can't make callback from given data");
|
|
29083
|
+
};
|
|
29084
|
+
MathJax.Hub = {
|
|
29085
|
+
Queue: function Queue() {
|
|
29086
|
+
for (var i = 0, m = arguments.length; i < m; i++) {
|
|
29087
|
+
var fn = MathJax.Callback(arguments[i]);
|
|
29088
|
+
MathJax.startup.promise = MathJax.startup.promise.then(fn);
|
|
29089
|
+
}
|
|
29090
|
+
return MathJax.startup.promise;
|
|
29091
|
+
},
|
|
29092
|
+
Typeset: function Typeset(elements, callback) {
|
|
29093
|
+
var promise = MathJax.typesetPromise(elements);
|
|
29094
|
+
if (callback) {
|
|
29095
|
+
promise = promise.then(callback);
|
|
29096
|
+
}
|
|
29097
|
+
return promise;
|
|
29098
|
+
},
|
|
29099
|
+
Register: {
|
|
29100
|
+
MessageHook: function MessageHook() {
|
|
29101
|
+
console.log("MessageHooks are not supported in version 3");
|
|
29102
|
+
},
|
|
29103
|
+
StartupHook: function StartupHook() {
|
|
29104
|
+
console.log("StartupHooks are not supported in version 3");
|
|
29105
|
+
},
|
|
29106
|
+
LoadHook: function LoadHook() {
|
|
29107
|
+
console.log("LoadHooks are not supported in version 3");
|
|
29108
|
+
}
|
|
29109
|
+
},
|
|
29110
|
+
Config: function Config() {
|
|
29111
|
+
console.log("MathJax configurations should be converted for version 3");
|
|
29112
|
+
}
|
|
29113
|
+
};
|
|
29114
|
+
};
|
|
28993
29115
|
var initializeMathJax = function initializeMathJax(callback) {
|
|
28994
29116
|
if (window.mathjaxLoadedP) {
|
|
28995
29117
|
return;
|
|
28996
29118
|
}
|
|
29119
|
+
var PreviousMathJaxIsUsed = window.MathJax && window.MathJax.version && window.MathJax.version !== MathJaxVersion && window.MathJax.version[0] === '2';
|
|
28997
29120
|
var texConfig = {
|
|
28998
29121
|
macros: {
|
|
28999
29122
|
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
@@ -29003,11 +29126,28 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
29003
29126
|
},
|
|
29004
29127
|
displayMath: [["$$", "$$"], ["\\[", "\\]"]]
|
|
29005
29128
|
};
|
|
29129
|
+
if (PreviousMathJaxIsUsed) {
|
|
29130
|
+
texConfig.autoload = {
|
|
29131
|
+
color: [],
|
|
29132
|
+
colorv2: ["color"]
|
|
29133
|
+
};
|
|
29134
|
+
}
|
|
29006
29135
|
window.mathjaxLoadedP = new Promise(function (resolve) {
|
|
29007
29136
|
window.MathJax = {
|
|
29008
29137
|
startup: {
|
|
29138
|
+
requireMap: PreviousMathJaxIsUsed ? {
|
|
29139
|
+
AMSmath: "ams",
|
|
29140
|
+
AMSsymbols: "ams",
|
|
29141
|
+
AMScd: "amscd",
|
|
29142
|
+
HTML: "html",
|
|
29143
|
+
noErrors: "noerrors",
|
|
29144
|
+
noUndefined: "noundefined"
|
|
29145
|
+
} : {},
|
|
29009
29146
|
typeset: false,
|
|
29010
29147
|
ready: function ready() {
|
|
29148
|
+
if (PreviousMathJaxIsUsed) {
|
|
29149
|
+
convertMathJax2ToMathJax3();
|
|
29150
|
+
}
|
|
29011
29151
|
var mathjax = MathJax._.mathjax.mathjax;
|
|
29012
29152
|
var STATE = MathJax._.core.MathItem.STATE;
|
|
29013
29153
|
var Menu = MathJax._.ui.menu.Menu.Menu;
|
|
@@ -29074,11 +29214,11 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
29074
29214
|
var executeOn = document.body;
|
|
29075
29215
|
if (!usedForMmlOutput) {
|
|
29076
29216
|
if (window.mathjaxLoadedComplete) {
|
|
29077
|
-
|
|
29217
|
+
renderContentsWithMathJax(el);
|
|
29078
29218
|
} else if (window.mathjaxLoadedP) {
|
|
29079
29219
|
window.mathjaxLoadedP.then(function () {
|
|
29080
29220
|
window.mathjaxLoadedComplete = true;
|
|
29081
|
-
|
|
29221
|
+
renderContentsWithMathJax(el);
|
|
29082
29222
|
})["catch"](function (error) {
|
|
29083
29223
|
return console.error("Error in initializing MathJax:", error);
|
|
29084
29224
|
});
|
package/module/manifest.json
CHANGED
package/module/print.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.11/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_math_input, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_correct_answer_toggle} from "../../../@pie-lib/pie-toolbox-module@5.0.7/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) {
|
|
5
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -28830,6 +28830,52 @@ MmlVisitor$1.MmlVisitor = MmlVisitor;
|
|
|
28830
28830
|
exports.SerializedMmlVisitor = SerializedMmlVisitor;
|
|
28831
28831
|
})(SerializedMmlVisitor);
|
|
28832
28832
|
getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
28833
|
+
var TexError$1 = {};
|
|
28834
|
+
Object.defineProperty(TexError$1, "__esModule", {
|
|
28835
|
+
value: true
|
|
28836
|
+
});
|
|
28837
|
+
var TexError = (function () {
|
|
28838
|
+
function TexError(id, message) {
|
|
28839
|
+
var rest = [];
|
|
28840
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
28841
|
+
rest[_i - 2] = arguments[_i];
|
|
28842
|
+
}
|
|
28843
|
+
this.id = id;
|
|
28844
|
+
this.message = TexError.processString(message, rest);
|
|
28845
|
+
}
|
|
28846
|
+
TexError.processString = function (str, args) {
|
|
28847
|
+
var parts = str.split(TexError.pattern);
|
|
28848
|
+
for (var i = 1, m = parts.length; i < m; i += 2) {
|
|
28849
|
+
var c = parts[i].charAt(0);
|
|
28850
|
+
if (c >= '0' && c <= '9') {
|
|
28851
|
+
parts[i] = args[parseInt(parts[i], 10) - 1];
|
|
28852
|
+
if (typeof parts[i] === 'number') {
|
|
28853
|
+
parts[i] = parts[i].toString();
|
|
28854
|
+
}
|
|
28855
|
+
} else if (c === '{') {
|
|
28856
|
+
c = parts[i].substr(1);
|
|
28857
|
+
if (c >= '0' && c <= '9') {
|
|
28858
|
+
parts[i] = args[parseInt(parts[i].substr(1, parts[i].length - 2), 10) - 1];
|
|
28859
|
+
if (typeof parts[i] === 'number') {
|
|
28860
|
+
parts[i] = parts[i].toString();
|
|
28861
|
+
}
|
|
28862
|
+
} else {
|
|
28863
|
+
var match = parts[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/);
|
|
28864
|
+
if (match) {
|
|
28865
|
+
parts[i] = '%' + parts[i];
|
|
28866
|
+
}
|
|
28867
|
+
}
|
|
28868
|
+
}
|
|
28869
|
+
if (parts[i] == null) {
|
|
28870
|
+
parts[i] = '???';
|
|
28871
|
+
}
|
|
28872
|
+
}
|
|
28873
|
+
return parts.join('');
|
|
28874
|
+
};
|
|
28875
|
+
TexError.pattern = /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g;
|
|
28876
|
+
return TexError;
|
|
28877
|
+
})();
|
|
28878
|
+
TexError$1.default = TexError;
|
|
28833
28879
|
(function (exports) {
|
|
28834
28880
|
var _interopRequireDefault = interopRequireDefault.exports;
|
|
28835
28881
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -28839,6 +28885,7 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
28839
28885
|
var _typeof2 = _interopRequireDefault(_typeof$b.exports);
|
|
28840
28886
|
var _normalization = normalization;
|
|
28841
28887
|
var _SerializedMmlVisitor = SerializedMmlVisitor;
|
|
28888
|
+
var _TexError = _interopRequireDefault(TexError$1);
|
|
28842
28889
|
var visitor = new _SerializedMmlVisitor.SerializedMmlVisitor();
|
|
28843
28890
|
var toMMl = function toMMl(node) {
|
|
28844
28891
|
return visitor.visitTree(node);
|
|
@@ -28924,6 +28971,15 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
28924
28971
|
}
|
|
28925
28972
|
});
|
|
28926
28973
|
};
|
|
28974
|
+
var renderContentsWithMathJax = function renderContentsWithMathJax(el) {
|
|
28975
|
+
if (el instanceof Array) {
|
|
28976
|
+
el.forEach(function (elNode) {
|
|
28977
|
+
return renderContentWithMathJax(elNode);
|
|
28978
|
+
});
|
|
28979
|
+
} else {
|
|
28980
|
+
renderContentWithMathJax(el);
|
|
28981
|
+
}
|
|
28982
|
+
};
|
|
28927
28983
|
var renderContentWithMathJax = function renderContentWithMathJax(executeOn) {
|
|
28928
28984
|
executeOn = executeOn || document.body;
|
|
28929
28985
|
if (!(executeOn instanceof HTMLElement)) return;
|
|
@@ -28953,10 +29009,77 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
28953
29009
|
});
|
|
28954
29010
|
}
|
|
28955
29011
|
};
|
|
29012
|
+
var convertMathJax2ToMathJax3 = function convertMathJax2ToMathJax3() {
|
|
29013
|
+
var CommandMap = MathJax._.input.tex.SymbolMap.CommandMap;
|
|
29014
|
+
var requireMap = MathJax.config.startup.requireMap;
|
|
29015
|
+
var RequireLoad = MathJax._.input.tex.require.RequireConfiguration.RequireLoad;
|
|
29016
|
+
var RequireMethods = {
|
|
29017
|
+
Require: function Require(parser, name) {
|
|
29018
|
+
var required = parser.GetArgument(name);
|
|
29019
|
+
if (required.match(/[^_a-zA-Z0-9]/) || required === "") {
|
|
29020
|
+
throw new _TexError["default"]("BadPackageName", "Argument for %1 is not a valid package name", name);
|
|
29021
|
+
}
|
|
29022
|
+
if (requireMap.hasOwnProperty(required)) {
|
|
29023
|
+
required = requireMap[required];
|
|
29024
|
+
}
|
|
29025
|
+
RequireLoad(parser, required);
|
|
29026
|
+
}
|
|
29027
|
+
};
|
|
29028
|
+
new CommandMap("require", {
|
|
29029
|
+
require: "Require"
|
|
29030
|
+
}, RequireMethods);
|
|
29031
|
+
MathJax.Callback = function (args) {
|
|
29032
|
+
if (Array.isArray(args)) {
|
|
29033
|
+
if (args.length === 1 && typeof args[0] === "function") {
|
|
29034
|
+
return args[0];
|
|
29035
|
+
} else if (typeof args[0] === "string" && args[1] instanceof Object && typeof args[1][args[0]] === "function") {
|
|
29036
|
+
return Function.bind.apply(args[1][args[0]], args.slice(1));
|
|
29037
|
+
} else if (typeof args[0] === "function") {
|
|
29038
|
+
return Function.bind.apply(args[0], [window].concat(args.slice(1)));
|
|
29039
|
+
} else if (typeof args[1] === "function") {
|
|
29040
|
+
return Function.bind.apply(args[1], [args[0]].concat(args.slice(2)));
|
|
29041
|
+
}
|
|
29042
|
+
} else if (typeof args === "function") {
|
|
29043
|
+
return args;
|
|
29044
|
+
}
|
|
29045
|
+
throw Error("Can't make callback from given data");
|
|
29046
|
+
};
|
|
29047
|
+
MathJax.Hub = {
|
|
29048
|
+
Queue: function Queue() {
|
|
29049
|
+
for (var i = 0, m = arguments.length; i < m; i++) {
|
|
29050
|
+
var fn = MathJax.Callback(arguments[i]);
|
|
29051
|
+
MathJax.startup.promise = MathJax.startup.promise.then(fn);
|
|
29052
|
+
}
|
|
29053
|
+
return MathJax.startup.promise;
|
|
29054
|
+
},
|
|
29055
|
+
Typeset: function Typeset(elements, callback) {
|
|
29056
|
+
var promise = MathJax.typesetPromise(elements);
|
|
29057
|
+
if (callback) {
|
|
29058
|
+
promise = promise.then(callback);
|
|
29059
|
+
}
|
|
29060
|
+
return promise;
|
|
29061
|
+
},
|
|
29062
|
+
Register: {
|
|
29063
|
+
MessageHook: function MessageHook() {
|
|
29064
|
+
console.log("MessageHooks are not supported in version 3");
|
|
29065
|
+
},
|
|
29066
|
+
StartupHook: function StartupHook() {
|
|
29067
|
+
console.log("StartupHooks are not supported in version 3");
|
|
29068
|
+
},
|
|
29069
|
+
LoadHook: function LoadHook() {
|
|
29070
|
+
console.log("LoadHooks are not supported in version 3");
|
|
29071
|
+
}
|
|
29072
|
+
},
|
|
29073
|
+
Config: function Config() {
|
|
29074
|
+
console.log("MathJax configurations should be converted for version 3");
|
|
29075
|
+
}
|
|
29076
|
+
};
|
|
29077
|
+
};
|
|
28956
29078
|
var initializeMathJax = function initializeMathJax(callback) {
|
|
28957
29079
|
if (window.mathjaxLoadedP) {
|
|
28958
29080
|
return;
|
|
28959
29081
|
}
|
|
29082
|
+
var PreviousMathJaxIsUsed = window.MathJax && window.MathJax.version && window.MathJax.version !== MathJaxVersion && window.MathJax.version[0] === '2';
|
|
28960
29083
|
var texConfig = {
|
|
28961
29084
|
macros: {
|
|
28962
29085
|
parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
|
|
@@ -28966,11 +29089,28 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
28966
29089
|
},
|
|
28967
29090
|
displayMath: [["$$", "$$"], ["\\[", "\\]"]]
|
|
28968
29091
|
};
|
|
29092
|
+
if (PreviousMathJaxIsUsed) {
|
|
29093
|
+
texConfig.autoload = {
|
|
29094
|
+
color: [],
|
|
29095
|
+
colorv2: ["color"]
|
|
29096
|
+
};
|
|
29097
|
+
}
|
|
28969
29098
|
window.mathjaxLoadedP = new Promise(function (resolve) {
|
|
28970
29099
|
window.MathJax = {
|
|
28971
29100
|
startup: {
|
|
29101
|
+
requireMap: PreviousMathJaxIsUsed ? {
|
|
29102
|
+
AMSmath: "ams",
|
|
29103
|
+
AMSsymbols: "ams",
|
|
29104
|
+
AMScd: "amscd",
|
|
29105
|
+
HTML: "html",
|
|
29106
|
+
noErrors: "noerrors",
|
|
29107
|
+
noUndefined: "noundefined"
|
|
29108
|
+
} : {},
|
|
28972
29109
|
typeset: false,
|
|
28973
29110
|
ready: function ready() {
|
|
29111
|
+
if (PreviousMathJaxIsUsed) {
|
|
29112
|
+
convertMathJax2ToMathJax3();
|
|
29113
|
+
}
|
|
28974
29114
|
var mathjax = MathJax._.mathjax.mathjax;
|
|
28975
29115
|
var STATE = MathJax._.core.MathItem.STATE;
|
|
28976
29116
|
var Menu = MathJax._.ui.menu.Menu.Menu;
|
|
@@ -29037,11 +29177,11 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
|
|
|
29037
29177
|
var executeOn = document.body;
|
|
29038
29178
|
if (!usedForMmlOutput) {
|
|
29039
29179
|
if (window.mathjaxLoadedComplete) {
|
|
29040
|
-
|
|
29180
|
+
renderContentsWithMathJax(el);
|
|
29041
29181
|
} else if (window.mathjaxLoadedP) {
|
|
29042
29182
|
window.mathjaxLoadedP.then(function () {
|
|
29043
29183
|
window.mathjaxLoadedComplete = true;
|
|
29044
|
-
|
|
29184
|
+
renderContentsWithMathJax(el);
|
|
29045
29185
|
})["catch"](function (error) {
|
|
29046
29186
|
return console.error("Error in initializing MathJax:", error);
|
|
29047
29187
|
});
|
package/package.json
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "3.1.2-next.
|
|
7
|
+
"version": "3.1.2-next.54+4bc542ce4",
|
|
8
8
|
"description": "",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@material-ui/core": "^3.9.2",
|
|
11
11
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
12
|
-
"@pie-lib/pie-toolbox": "2.0.
|
|
12
|
+
"@pie-lib/pie-toolbox": "2.0.13",
|
|
13
13
|
"prop-types": "^15.6.1",
|
|
14
14
|
"react": "^16.8.1",
|
|
15
15
|
"react-dom": "^16.8.1"
|
|
16
16
|
},
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "ISC",
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "4bc542ce49d923b9f281d7a15ba28e442acf2d6c",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postpublish": "../../scripts/postpublish"
|
|
22
22
|
},
|