@pie-element/complex-rubric 2.17.1-next.18 → 2.17.1-next.5
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 +54 -67
- package/module/element.js +54 -67
- package/module/manifest.json +2 -2
- package/module/print.js +54 -67
- 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.21.
|
|
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.21.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@4.
|
|
3
|
+
import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@4.12.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) {
|
|
@@ -42038,10 +42038,8 @@ var mathjaxScript = {};
|
|
|
42038
42038
|
Object.defineProperty(mathjaxScript, "__esModule", {
|
|
42039
42039
|
value: true
|
|
42040
42040
|
});
|
|
42041
|
-
mathjaxScript.initializeMathJax =
|
|
42041
|
+
mathjaxScript.initializeMathJax = void 0;
|
|
42042
42042
|
var _renderMath = renderMath$1;
|
|
42043
|
-
var MathJaxVersion = '3.2.2';
|
|
42044
|
-
mathjaxScript.MathJaxVersion = MathJaxVersion;
|
|
42045
42043
|
var initializeMathJax = function initializeMathJax(renderOpts) {
|
|
42046
42044
|
if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
|
|
42047
42045
|
console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
|
|
@@ -42112,7 +42110,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
|
|
|
42112
42110
|
};
|
|
42113
42111
|
var script = document.createElement('script');
|
|
42114
42112
|
script.type = 'text/javascript';
|
|
42115
|
-
script.src =
|
|
42113
|
+
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
|
|
42116
42114
|
script.async = true;
|
|
42117
42115
|
document.body.appendChild(script);
|
|
42118
42116
|
});
|
|
@@ -101866,7 +101864,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
101866
101864
|
fixMathElements(executeOn);
|
|
101867
101865
|
adjustMathMLStyle(executeOn);
|
|
101868
101866
|
var mathJaxCustomKey = getMathJaxCustomKey();
|
|
101869
|
-
if (
|
|
101867
|
+
if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
|
|
101870
101868
|
renderOpts = renderOpts || defaultOpts();
|
|
101871
101869
|
(0, _mathjaxScript.initializeMathJax)(renderOpts);
|
|
101872
101870
|
}
|
|
@@ -137702,8 +137700,17 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
137702
137700
|
var getTagName = function getTagName(el) {
|
|
137703
137701
|
return (el && el.tagName || '').toLowerCase();
|
|
137704
137702
|
};
|
|
137705
|
-
var
|
|
137706
|
-
|
|
137703
|
+
var lessThanHandling = function lessThanHandling(input) {
|
|
137704
|
+
var arrowSplit = input.split('<');
|
|
137705
|
+
if (input.length > 2) {
|
|
137706
|
+
return arrowSplit.reduce(function (st, part) {
|
|
137707
|
+
if (part.match(/<[a-zA-Z/][\s\S]*>/gi)) {
|
|
137708
|
+
return ("").concat(st).concat(st ? '<' : '').concat(part);
|
|
137709
|
+
}
|
|
137710
|
+
return ("").concat(st).concat(st ? '<' : '').concat(part);
|
|
137711
|
+
}, '');
|
|
137712
|
+
}
|
|
137713
|
+
return input;
|
|
137707
137714
|
};
|
|
137708
137715
|
function replaceLeftRight(latexInput) {
|
|
137709
137716
|
return latexInput.replace(/\\left\.\s*|\\right\.\s*/g, '');
|
|
@@ -137714,8 +137721,7 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
137714
137721
|
var regex = /<mo(?: [^>]*)?>⁡<\/mo>/g;
|
|
137715
137722
|
return mmlFromLatex.replace(regex, '');
|
|
137716
137723
|
};
|
|
137717
|
-
var
|
|
137718
|
-
var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(handled, "\">").concat((0, _mathRenderingAccessible.wrapMath)(handled, wrapper), "</span>"), {
|
|
137724
|
+
var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(decoded, "\">").concat((0, _mathRenderingAccessible.wrapMath)(decoded, wrapper), "</span>"), {
|
|
137719
137725
|
skipWaitForMathRenderingLib: true
|
|
137720
137726
|
});
|
|
137721
137727
|
mathMlFromLatex = removeEmptyMos(mathMlFromLatex);
|
|
@@ -137795,7 +137801,7 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
137795
137801
|
if (object.type === 'math') {
|
|
137796
137802
|
var latex = object.data.get('latex');
|
|
137797
137803
|
var wrapper = object.data.get('wrapper');
|
|
137798
|
-
var decoded = htmlDecode(
|
|
137804
|
+
var decoded = htmlDecode(lessThanHandling(latex));
|
|
137799
137805
|
log('[serialize] latex: ', latex);
|
|
137800
137806
|
if (MathPlugin.mathMlOptions.mmlOutput) {
|
|
137801
137807
|
return _react["default"].createElement("span", {
|
|
@@ -138929,9 +138935,6 @@ const require$$12$b = _dll_debug;
|
|
|
138929
138935
|
var matchVimeoUrl = function matchVimeoUrl(url) {
|
|
138930
138936
|
return url && (/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/).test(url);
|
|
138931
138937
|
};
|
|
138932
|
-
var matchDriveUrl = function matchDriveUrl(url) {
|
|
138933
|
-
return url && (/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/).test(url);
|
|
138934
|
-
};
|
|
138935
138938
|
var matchSoundCloudUrl = function matchSoundCloudUrl(url) {
|
|
138936
138939
|
if (!url) {
|
|
138937
138940
|
return false;
|
|
@@ -139013,62 +139016,46 @@ const require$$12$b = _dll_debug;
|
|
|
139013
139016
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleStateChange", function (newState) {
|
|
139014
139017
|
return _this.setState(newState, _this.formatUrl);
|
|
139015
139018
|
});
|
|
139016
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "checkAudio", function (value) {
|
|
139017
|
-
if (matchSoundCloudUrl(value)) {
|
|
139018
|
-
makeApiRequest(value).then(function (urlToUse) {
|
|
139019
|
-
_this.handleStateChange({
|
|
139020
|
-
urlToUse: urlToUse,
|
|
139021
|
-
invalid: !urlToUse,
|
|
139022
|
-
url: value
|
|
139023
|
-
});
|
|
139024
|
-
})["catch"](log);
|
|
139025
|
-
}
|
|
139026
|
-
});
|
|
139027
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "checkVideo", function (value) {
|
|
139028
|
-
if (matchYoutubeUrl(value)) {
|
|
139029
|
-
var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
|
|
139030
|
-
var match = value.match(regExp);
|
|
139031
|
-
var id = match[2];
|
|
139032
|
-
var urlToUse = ("https://youtube.com/embed/").concat(id);
|
|
139033
|
-
log('is youtube');
|
|
139034
|
-
_this.handleStateChange({
|
|
139035
|
-
urlToUse: urlToUse,
|
|
139036
|
-
url: value,
|
|
139037
|
-
invalid: false
|
|
139038
|
-
});
|
|
139039
|
-
}
|
|
139040
|
-
if (matchVimeoUrl(value)) {
|
|
139041
|
-
var _id = value.replace(/.*vimeo.com\/(.*)/g, '$1');
|
|
139042
|
-
var _urlToUse2 = ("https://player.vimeo.com/video/").concat(_id);
|
|
139043
|
-
log('is vimeo');
|
|
139044
|
-
_this.handleStateChange({
|
|
139045
|
-
urlToUse: _urlToUse2,
|
|
139046
|
-
url: value,
|
|
139047
|
-
ends: null,
|
|
139048
|
-
invalid: false
|
|
139049
|
-
});
|
|
139050
|
-
}
|
|
139051
|
-
if (matchDriveUrl(value)) {
|
|
139052
|
-
var _id2 = value.replace(/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)\/.*/, '$1');
|
|
139053
|
-
var _urlToUse3 = ("https://drive.google.com/file/d/").concat(_id2, "/preview");
|
|
139054
|
-
log('is google drive');
|
|
139055
|
-
_this.handleStateChange({
|
|
139056
|
-
urlToUse: _urlToUse3,
|
|
139057
|
-
url: value,
|
|
139058
|
-
ends: null,
|
|
139059
|
-
invalid: false
|
|
139060
|
-
});
|
|
139061
|
-
}
|
|
139062
|
-
});
|
|
139063
139019
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "urlChange", function (e) {
|
|
139064
139020
|
var _ref = e.target || ({}), value = _ref.value;
|
|
139065
139021
|
var type = _this.props.type;
|
|
139066
139022
|
if (type && type === 'audio') {
|
|
139067
|
-
|
|
139068
|
-
|
|
139023
|
+
if (matchSoundCloudUrl(value)) {
|
|
139024
|
+
makeApiRequest(value).then(function (urlToUse) {
|
|
139025
|
+
_this.handleStateChange({
|
|
139026
|
+
urlToUse: urlToUse,
|
|
139027
|
+
invalid: !urlToUse,
|
|
139028
|
+
url: value
|
|
139029
|
+
});
|
|
139030
|
+
})["catch"](log);
|
|
139031
|
+
return;
|
|
139032
|
+
}
|
|
139069
139033
|
} else if (type && type === 'video') {
|
|
139070
|
-
|
|
139071
|
-
|
|
139034
|
+
if (matchYoutubeUrl(value)) {
|
|
139035
|
+
var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
|
|
139036
|
+
var match = value.match(regExp);
|
|
139037
|
+
var id = match[2];
|
|
139038
|
+
var urlToUse = ("https://youtube.com/embed/").concat(id);
|
|
139039
|
+
log('is youtube');
|
|
139040
|
+
_this.handleStateChange({
|
|
139041
|
+
urlToUse: urlToUse,
|
|
139042
|
+
url: value,
|
|
139043
|
+
invalid: false
|
|
139044
|
+
});
|
|
139045
|
+
return;
|
|
139046
|
+
}
|
|
139047
|
+
if (matchVimeoUrl(value)) {
|
|
139048
|
+
var _id = value.replace(/.*vimeo.com\/(.*)/g, '$1');
|
|
139049
|
+
var _urlToUse2 = ("https://player.vimeo.com/video/").concat(_id);
|
|
139050
|
+
log('is vimeo');
|
|
139051
|
+
_this.handleStateChange({
|
|
139052
|
+
urlToUse: _urlToUse2,
|
|
139053
|
+
url: value,
|
|
139054
|
+
ends: null,
|
|
139055
|
+
invalid: false
|
|
139056
|
+
});
|
|
139057
|
+
return;
|
|
139058
|
+
}
|
|
139072
139059
|
}
|
|
139073
139060
|
_this.handleStateChange({
|
|
139074
139061
|
urlToUse: null,
|
|
@@ -149325,7 +149312,7 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
149325
149312
|
var languageCharactersPlugins = ((opts === null || opts === void 0 ? void 0 : opts.languageCharacters) || []).map(function (config) {
|
|
149326
149313
|
return (0, _characters["default"])(config);
|
|
149327
149314
|
});
|
|
149328
|
-
var tablePlugins = [imagePlugin, mathPlugin
|
|
149315
|
+
var tablePlugins = [imagePlugin, mathPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins));
|
|
149329
149316
|
if (opts.responseArea && opts.responseArea.type === 'math-templated') {
|
|
149330
149317
|
tablePlugins.push(respAreaPlugin);
|
|
149331
149318
|
}
|
package/module/element.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@1.21.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@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.21.0/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.12.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) {
|
|
@@ -65364,10 +65364,8 @@ var mathjaxScript = {};
|
|
|
65364
65364
|
Object.defineProperty(mathjaxScript, "__esModule", {
|
|
65365
65365
|
value: true
|
|
65366
65366
|
});
|
|
65367
|
-
mathjaxScript.initializeMathJax =
|
|
65367
|
+
mathjaxScript.initializeMathJax = void 0;
|
|
65368
65368
|
var _renderMath = renderMath$1;
|
|
65369
|
-
var MathJaxVersion = '3.2.2';
|
|
65370
|
-
mathjaxScript.MathJaxVersion = MathJaxVersion;
|
|
65371
65369
|
var initializeMathJax = function initializeMathJax(renderOpts) {
|
|
65372
65370
|
if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
|
|
65373
65371
|
console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
|
|
@@ -65438,7 +65436,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
|
|
|
65438
65436
|
};
|
|
65439
65437
|
var script = document.createElement('script');
|
|
65440
65438
|
script.type = 'text/javascript';
|
|
65441
|
-
script.src =
|
|
65439
|
+
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
|
|
65442
65440
|
script.async = true;
|
|
65443
65441
|
document.body.appendChild(script);
|
|
65444
65442
|
});
|
|
@@ -125127,7 +125125,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
125127
125125
|
fixMathElements(executeOn);
|
|
125128
125126
|
adjustMathMLStyle(executeOn);
|
|
125129
125127
|
var mathJaxCustomKey = getMathJaxCustomKey();
|
|
125130
|
-
if (
|
|
125128
|
+
if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
|
|
125131
125129
|
renderOpts = renderOpts || defaultOpts();
|
|
125132
125130
|
(0, _mathjaxScript.initializeMathJax)(renderOpts);
|
|
125133
125131
|
}
|
|
@@ -127770,8 +127768,17 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
127770
127768
|
var getTagName = function getTagName(el) {
|
|
127771
127769
|
return (el && el.tagName || '').toLowerCase();
|
|
127772
127770
|
};
|
|
127773
|
-
var
|
|
127774
|
-
|
|
127771
|
+
var lessThanHandling = function lessThanHandling(input) {
|
|
127772
|
+
var arrowSplit = input.split('<');
|
|
127773
|
+
if (input.length > 2) {
|
|
127774
|
+
return arrowSplit.reduce(function (st, part) {
|
|
127775
|
+
if (part.match(/<[a-zA-Z/][\s\S]*>/gi)) {
|
|
127776
|
+
return ("").concat(st).concat(st ? '<' : '').concat(part);
|
|
127777
|
+
}
|
|
127778
|
+
return ("").concat(st).concat(st ? '<' : '').concat(part);
|
|
127779
|
+
}, '');
|
|
127780
|
+
}
|
|
127781
|
+
return input;
|
|
127775
127782
|
};
|
|
127776
127783
|
function replaceLeftRight(latexInput) {
|
|
127777
127784
|
return latexInput.replace(/\\left\.\s*|\\right\.\s*/g, '');
|
|
@@ -127782,8 +127789,7 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
127782
127789
|
var regex = /<mo(?: [^>]*)?>⁡<\/mo>/g;
|
|
127783
127790
|
return mmlFromLatex.replace(regex, '');
|
|
127784
127791
|
};
|
|
127785
|
-
var
|
|
127786
|
-
var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(handled, "\">").concat((0, _mathRenderingAccessible.wrapMath)(handled, wrapper), "</span>"), {
|
|
127792
|
+
var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(decoded, "\">").concat((0, _mathRenderingAccessible.wrapMath)(decoded, wrapper), "</span>"), {
|
|
127787
127793
|
skipWaitForMathRenderingLib: true
|
|
127788
127794
|
});
|
|
127789
127795
|
mathMlFromLatex = removeEmptyMos(mathMlFromLatex);
|
|
@@ -127863,7 +127869,7 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
127863
127869
|
if (object.type === 'math') {
|
|
127864
127870
|
var latex = object.data.get('latex');
|
|
127865
127871
|
var wrapper = object.data.get('wrapper');
|
|
127866
|
-
var decoded = htmlDecode(
|
|
127872
|
+
var decoded = htmlDecode(lessThanHandling(latex));
|
|
127867
127873
|
log('[serialize] latex: ', latex);
|
|
127868
127874
|
if (MathPlugin.mathMlOptions.mmlOutput) {
|
|
127869
127875
|
return _react["default"].createElement("span", {
|
|
@@ -129108,9 +129114,6 @@ const require$$12$b = _dll_debug;
|
|
|
129108
129114
|
var matchVimeoUrl = function matchVimeoUrl(url) {
|
|
129109
129115
|
return url && (/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/).test(url);
|
|
129110
129116
|
};
|
|
129111
|
-
var matchDriveUrl = function matchDriveUrl(url) {
|
|
129112
|
-
return url && (/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/).test(url);
|
|
129113
|
-
};
|
|
129114
129117
|
var matchSoundCloudUrl = function matchSoundCloudUrl(url) {
|
|
129115
129118
|
if (!url) {
|
|
129116
129119
|
return false;
|
|
@@ -129192,62 +129195,46 @@ const require$$12$b = _dll_debug;
|
|
|
129192
129195
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleStateChange", function (newState) {
|
|
129193
129196
|
return _this.setState(newState, _this.formatUrl);
|
|
129194
129197
|
});
|
|
129195
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "checkAudio", function (value) {
|
|
129196
|
-
if (matchSoundCloudUrl(value)) {
|
|
129197
|
-
makeApiRequest(value).then(function (urlToUse) {
|
|
129198
|
-
_this.handleStateChange({
|
|
129199
|
-
urlToUse: urlToUse,
|
|
129200
|
-
invalid: !urlToUse,
|
|
129201
|
-
url: value
|
|
129202
|
-
});
|
|
129203
|
-
})["catch"](log);
|
|
129204
|
-
}
|
|
129205
|
-
});
|
|
129206
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "checkVideo", function (value) {
|
|
129207
|
-
if (matchYoutubeUrl(value)) {
|
|
129208
|
-
var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
|
|
129209
|
-
var match = value.match(regExp);
|
|
129210
|
-
var id = match[2];
|
|
129211
|
-
var urlToUse = ("https://youtube.com/embed/").concat(id);
|
|
129212
|
-
log('is youtube');
|
|
129213
|
-
_this.handleStateChange({
|
|
129214
|
-
urlToUse: urlToUse,
|
|
129215
|
-
url: value,
|
|
129216
|
-
invalid: false
|
|
129217
|
-
});
|
|
129218
|
-
}
|
|
129219
|
-
if (matchVimeoUrl(value)) {
|
|
129220
|
-
var _id = value.replace(/.*vimeo.com\/(.*)/g, '$1');
|
|
129221
|
-
var _urlToUse2 = ("https://player.vimeo.com/video/").concat(_id);
|
|
129222
|
-
log('is vimeo');
|
|
129223
|
-
_this.handleStateChange({
|
|
129224
|
-
urlToUse: _urlToUse2,
|
|
129225
|
-
url: value,
|
|
129226
|
-
ends: null,
|
|
129227
|
-
invalid: false
|
|
129228
|
-
});
|
|
129229
|
-
}
|
|
129230
|
-
if (matchDriveUrl(value)) {
|
|
129231
|
-
var _id2 = value.replace(/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)\/.*/, '$1');
|
|
129232
|
-
var _urlToUse3 = ("https://drive.google.com/file/d/").concat(_id2, "/preview");
|
|
129233
|
-
log('is google drive');
|
|
129234
|
-
_this.handleStateChange({
|
|
129235
|
-
urlToUse: _urlToUse3,
|
|
129236
|
-
url: value,
|
|
129237
|
-
ends: null,
|
|
129238
|
-
invalid: false
|
|
129239
|
-
});
|
|
129240
|
-
}
|
|
129241
|
-
});
|
|
129242
129198
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "urlChange", function (e) {
|
|
129243
129199
|
var _ref = e.target || ({}), value = _ref.value;
|
|
129244
129200
|
var type = _this.props.type;
|
|
129245
129201
|
if (type && type === 'audio') {
|
|
129246
|
-
|
|
129247
|
-
|
|
129202
|
+
if (matchSoundCloudUrl(value)) {
|
|
129203
|
+
makeApiRequest(value).then(function (urlToUse) {
|
|
129204
|
+
_this.handleStateChange({
|
|
129205
|
+
urlToUse: urlToUse,
|
|
129206
|
+
invalid: !urlToUse,
|
|
129207
|
+
url: value
|
|
129208
|
+
});
|
|
129209
|
+
})["catch"](log);
|
|
129210
|
+
return;
|
|
129211
|
+
}
|
|
129248
129212
|
} else if (type && type === 'video') {
|
|
129249
|
-
|
|
129250
|
-
|
|
129213
|
+
if (matchYoutubeUrl(value)) {
|
|
129214
|
+
var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
|
|
129215
|
+
var match = value.match(regExp);
|
|
129216
|
+
var id = match[2];
|
|
129217
|
+
var urlToUse = ("https://youtube.com/embed/").concat(id);
|
|
129218
|
+
log('is youtube');
|
|
129219
|
+
_this.handleStateChange({
|
|
129220
|
+
urlToUse: urlToUse,
|
|
129221
|
+
url: value,
|
|
129222
|
+
invalid: false
|
|
129223
|
+
});
|
|
129224
|
+
return;
|
|
129225
|
+
}
|
|
129226
|
+
if (matchVimeoUrl(value)) {
|
|
129227
|
+
var _id = value.replace(/.*vimeo.com\/(.*)/g, '$1');
|
|
129228
|
+
var _urlToUse2 = ("https://player.vimeo.com/video/").concat(_id);
|
|
129229
|
+
log('is vimeo');
|
|
129230
|
+
_this.handleStateChange({
|
|
129231
|
+
urlToUse: _urlToUse2,
|
|
129232
|
+
url: value,
|
|
129233
|
+
ends: null,
|
|
129234
|
+
invalid: false
|
|
129235
|
+
});
|
|
129236
|
+
return;
|
|
129237
|
+
}
|
|
129251
129238
|
}
|
|
129252
129239
|
_this.handleStateChange({
|
|
129253
129240
|
urlToUse: null,
|
|
@@ -147585,7 +147572,7 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
147585
147572
|
var languageCharactersPlugins = ((opts === null || opts === void 0 ? void 0 : opts.languageCharacters) || []).map(function (config) {
|
|
147586
147573
|
return (0, _characters["default"])(config);
|
|
147587
147574
|
});
|
|
147588
|
-
var tablePlugins = [imagePlugin, mathPlugin
|
|
147575
|
+
var tablePlugins = [imagePlugin, mathPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins));
|
|
147589
147576
|
if (opts.responseArea && opts.responseArea.type === 'math-templated') {
|
|
147590
147577
|
tablePlugins.push(respAreaPlugin);
|
|
147591
147578
|
}
|
package/module/manifest.json
CHANGED
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@1.21.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@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.21.0/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.12.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) {
|
|
@@ -65364,10 +65364,8 @@ var mathjaxScript = {};
|
|
|
65364
65364
|
Object.defineProperty(mathjaxScript, "__esModule", {
|
|
65365
65365
|
value: true
|
|
65366
65366
|
});
|
|
65367
|
-
mathjaxScript.initializeMathJax =
|
|
65367
|
+
mathjaxScript.initializeMathJax = void 0;
|
|
65368
65368
|
var _renderMath = renderMath$1;
|
|
65369
|
-
var MathJaxVersion = '3.2.2';
|
|
65370
|
-
mathjaxScript.MathJaxVersion = MathJaxVersion;
|
|
65371
65369
|
var initializeMathJax = function initializeMathJax(renderOpts) {
|
|
65372
65370
|
if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
|
|
65373
65371
|
console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
|
|
@@ -65438,7 +65436,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
|
|
|
65438
65436
|
};
|
|
65439
65437
|
var script = document.createElement('script');
|
|
65440
65438
|
script.type = 'text/javascript';
|
|
65441
|
-
script.src =
|
|
65439
|
+
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
|
|
65442
65440
|
script.async = true;
|
|
65443
65441
|
document.body.appendChild(script);
|
|
65444
65442
|
});
|
|
@@ -125127,7 +125125,7 @@ getDefaultExportFromCjs(mathRendering);
|
|
|
125127
125125
|
fixMathElements(executeOn);
|
|
125128
125126
|
adjustMathMLStyle(executeOn);
|
|
125129
125127
|
var mathJaxCustomKey = getMathJaxCustomKey();
|
|
125130
|
-
if (
|
|
125128
|
+
if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
|
|
125131
125129
|
renderOpts = renderOpts || defaultOpts();
|
|
125132
125130
|
(0, _mathjaxScript.initializeMathJax)(renderOpts);
|
|
125133
125131
|
}
|
|
@@ -127770,8 +127768,17 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
127770
127768
|
var getTagName = function getTagName(el) {
|
|
127771
127769
|
return (el && el.tagName || '').toLowerCase();
|
|
127772
127770
|
};
|
|
127773
|
-
var
|
|
127774
|
-
|
|
127771
|
+
var lessThanHandling = function lessThanHandling(input) {
|
|
127772
|
+
var arrowSplit = input.split('<');
|
|
127773
|
+
if (input.length > 2) {
|
|
127774
|
+
return arrowSplit.reduce(function (st, part) {
|
|
127775
|
+
if (part.match(/<[a-zA-Z/][\s\S]*>/gi)) {
|
|
127776
|
+
return ("").concat(st).concat(st ? '<' : '').concat(part);
|
|
127777
|
+
}
|
|
127778
|
+
return ("").concat(st).concat(st ? '<' : '').concat(part);
|
|
127779
|
+
}, '');
|
|
127780
|
+
}
|
|
127781
|
+
return input;
|
|
127775
127782
|
};
|
|
127776
127783
|
function replaceLeftRight(latexInput) {
|
|
127777
127784
|
return latexInput.replace(/\\left\.\s*|\\right\.\s*/g, '');
|
|
@@ -127782,8 +127789,7 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
127782
127789
|
var regex = /<mo(?: [^>]*)?>⁡<\/mo>/g;
|
|
127783
127790
|
return mmlFromLatex.replace(regex, '');
|
|
127784
127791
|
};
|
|
127785
|
-
var
|
|
127786
|
-
var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(handled, "\">").concat((0, _mathRenderingAccessible.wrapMath)(handled, wrapper), "</span>"), {
|
|
127792
|
+
var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(decoded, "\">").concat((0, _mathRenderingAccessible.wrapMath)(decoded, wrapper), "</span>"), {
|
|
127787
127793
|
skipWaitForMathRenderingLib: true
|
|
127788
127794
|
});
|
|
127789
127795
|
mathMlFromLatex = removeEmptyMos(mathMlFromLatex);
|
|
@@ -127863,7 +127869,7 @@ const {isEqual: require$$12$d} = _dll_lodash;
|
|
|
127863
127869
|
if (object.type === 'math') {
|
|
127864
127870
|
var latex = object.data.get('latex');
|
|
127865
127871
|
var wrapper = object.data.get('wrapper');
|
|
127866
|
-
var decoded = htmlDecode(
|
|
127872
|
+
var decoded = htmlDecode(lessThanHandling(latex));
|
|
127867
127873
|
log('[serialize] latex: ', latex);
|
|
127868
127874
|
if (MathPlugin.mathMlOptions.mmlOutput) {
|
|
127869
127875
|
return _react["default"].createElement("span", {
|
|
@@ -129108,9 +129114,6 @@ const require$$12$b = _dll_debug;
|
|
|
129108
129114
|
var matchVimeoUrl = function matchVimeoUrl(url) {
|
|
129109
129115
|
return url && (/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/).test(url);
|
|
129110
129116
|
};
|
|
129111
|
-
var matchDriveUrl = function matchDriveUrl(url) {
|
|
129112
|
-
return url && (/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/).test(url);
|
|
129113
|
-
};
|
|
129114
129117
|
var matchSoundCloudUrl = function matchSoundCloudUrl(url) {
|
|
129115
129118
|
if (!url) {
|
|
129116
129119
|
return false;
|
|
@@ -129192,62 +129195,46 @@ const require$$12$b = _dll_debug;
|
|
|
129192
129195
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleStateChange", function (newState) {
|
|
129193
129196
|
return _this.setState(newState, _this.formatUrl);
|
|
129194
129197
|
});
|
|
129195
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "checkAudio", function (value) {
|
|
129196
|
-
if (matchSoundCloudUrl(value)) {
|
|
129197
|
-
makeApiRequest(value).then(function (urlToUse) {
|
|
129198
|
-
_this.handleStateChange({
|
|
129199
|
-
urlToUse: urlToUse,
|
|
129200
|
-
invalid: !urlToUse,
|
|
129201
|
-
url: value
|
|
129202
|
-
});
|
|
129203
|
-
})["catch"](log);
|
|
129204
|
-
}
|
|
129205
|
-
});
|
|
129206
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "checkVideo", function (value) {
|
|
129207
|
-
if (matchYoutubeUrl(value)) {
|
|
129208
|
-
var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
|
|
129209
|
-
var match = value.match(regExp);
|
|
129210
|
-
var id = match[2];
|
|
129211
|
-
var urlToUse = ("https://youtube.com/embed/").concat(id);
|
|
129212
|
-
log('is youtube');
|
|
129213
|
-
_this.handleStateChange({
|
|
129214
|
-
urlToUse: urlToUse,
|
|
129215
|
-
url: value,
|
|
129216
|
-
invalid: false
|
|
129217
|
-
});
|
|
129218
|
-
}
|
|
129219
|
-
if (matchVimeoUrl(value)) {
|
|
129220
|
-
var _id = value.replace(/.*vimeo.com\/(.*)/g, '$1');
|
|
129221
|
-
var _urlToUse2 = ("https://player.vimeo.com/video/").concat(_id);
|
|
129222
|
-
log('is vimeo');
|
|
129223
|
-
_this.handleStateChange({
|
|
129224
|
-
urlToUse: _urlToUse2,
|
|
129225
|
-
url: value,
|
|
129226
|
-
ends: null,
|
|
129227
|
-
invalid: false
|
|
129228
|
-
});
|
|
129229
|
-
}
|
|
129230
|
-
if (matchDriveUrl(value)) {
|
|
129231
|
-
var _id2 = value.replace(/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)\/.*/, '$1');
|
|
129232
|
-
var _urlToUse3 = ("https://drive.google.com/file/d/").concat(_id2, "/preview");
|
|
129233
|
-
log('is google drive');
|
|
129234
|
-
_this.handleStateChange({
|
|
129235
|
-
urlToUse: _urlToUse3,
|
|
129236
|
-
url: value,
|
|
129237
|
-
ends: null,
|
|
129238
|
-
invalid: false
|
|
129239
|
-
});
|
|
129240
|
-
}
|
|
129241
|
-
});
|
|
129242
129198
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "urlChange", function (e) {
|
|
129243
129199
|
var _ref = e.target || ({}), value = _ref.value;
|
|
129244
129200
|
var type = _this.props.type;
|
|
129245
129201
|
if (type && type === 'audio') {
|
|
129246
|
-
|
|
129247
|
-
|
|
129202
|
+
if (matchSoundCloudUrl(value)) {
|
|
129203
|
+
makeApiRequest(value).then(function (urlToUse) {
|
|
129204
|
+
_this.handleStateChange({
|
|
129205
|
+
urlToUse: urlToUse,
|
|
129206
|
+
invalid: !urlToUse,
|
|
129207
|
+
url: value
|
|
129208
|
+
});
|
|
129209
|
+
})["catch"](log);
|
|
129210
|
+
return;
|
|
129211
|
+
}
|
|
129248
129212
|
} else if (type && type === 'video') {
|
|
129249
|
-
|
|
129250
|
-
|
|
129213
|
+
if (matchYoutubeUrl(value)) {
|
|
129214
|
+
var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
|
|
129215
|
+
var match = value.match(regExp);
|
|
129216
|
+
var id = match[2];
|
|
129217
|
+
var urlToUse = ("https://youtube.com/embed/").concat(id);
|
|
129218
|
+
log('is youtube');
|
|
129219
|
+
_this.handleStateChange({
|
|
129220
|
+
urlToUse: urlToUse,
|
|
129221
|
+
url: value,
|
|
129222
|
+
invalid: false
|
|
129223
|
+
});
|
|
129224
|
+
return;
|
|
129225
|
+
}
|
|
129226
|
+
if (matchVimeoUrl(value)) {
|
|
129227
|
+
var _id = value.replace(/.*vimeo.com\/(.*)/g, '$1');
|
|
129228
|
+
var _urlToUse2 = ("https://player.vimeo.com/video/").concat(_id);
|
|
129229
|
+
log('is vimeo');
|
|
129230
|
+
_this.handleStateChange({
|
|
129231
|
+
urlToUse: _urlToUse2,
|
|
129232
|
+
url: value,
|
|
129233
|
+
ends: null,
|
|
129234
|
+
invalid: false
|
|
129235
|
+
});
|
|
129236
|
+
return;
|
|
129237
|
+
}
|
|
129251
129238
|
}
|
|
129252
129239
|
_this.handleStateChange({
|
|
129253
129240
|
urlToUse: null,
|
|
@@ -147585,7 +147572,7 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
|
|
|
147585
147572
|
var languageCharactersPlugins = ((opts === null || opts === void 0 ? void 0 : opts.languageCharacters) || []).map(function (config) {
|
|
147586
147573
|
return (0, _characters["default"])(config);
|
|
147587
147574
|
});
|
|
147588
|
-
var tablePlugins = [imagePlugin, mathPlugin
|
|
147575
|
+
var tablePlugins = [imagePlugin, mathPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins));
|
|
147589
147576
|
if (opts.responseArea && opts.responseArea.type === 'math-templated') {
|
|
147590
147577
|
tablePlugins.push(respAreaPlugin);
|
|
147591
147578
|
}
|
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.17.1-next.
|
|
4
|
+
"version": "2.17.1-next.5+6084f693c",
|
|
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.17.1-next.
|
|
11
|
-
"@pie-element/rubric": "^3.17.1-next.
|
|
10
|
+
"@pie-element/multi-trait-rubric": "^3.17.1-next.5+6084f693c",
|
|
11
|
+
"@pie-element/rubric": "^3.17.1-next.5+6084f693c",
|
|
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": "6084f693cf23739eba410d0a16ee53a292e9077d",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"postpublish": "../../scripts/postpublish"
|
|
21
21
|
},
|