@pie-element/complex-rubric 2.17.1-next.13 → 2.17.1-next.14

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.
@@ -7,7 +7,7 @@
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "dependencies": {
10
- "@pie-lib/pie-toolbox": "1.28.0",
10
+ "@pie-lib/pie-toolbox": "1.29.0",
11
11
  "lodash": "^4.17.15"
12
12
  },
13
13
  "author": "",
@@ -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.0/module/index.js";
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/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.12.0/module/index.js";
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.23.1/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,8 +42038,10 @@ var mathjaxScript = {};
42038
42038
  Object.defineProperty(mathjaxScript, "__esModule", {
42039
42039
  value: true
42040
42040
  });
42041
- mathjaxScript.initializeMathJax = void 0;
42041
+ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
42042
42042
  var _renderMath = renderMath$1;
42043
+ var MathJaxVersion = '3.2.2';
42044
+ mathjaxScript.MathJaxVersion = MathJaxVersion;
42043
42045
  var initializeMathJax = function initializeMathJax(renderOpts) {
42044
42046
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
42045
42047
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
@@ -42110,7 +42112,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
42110
42112
  };
42111
42113
  var script = document.createElement('script');
42112
42114
  script.type = 'text/javascript';
42113
- script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
42115
+ script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
42114
42116
  script.async = true;
42115
42117
  document.body.appendChild(script);
42116
42118
  });
@@ -101864,7 +101866,7 @@ getDefaultExportFromCjs(mathRendering);
101864
101866
  fixMathElements(executeOn);
101865
101867
  adjustMathMLStyle(executeOn);
101866
101868
  var mathJaxCustomKey = getMathJaxCustomKey();
101867
- if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
101869
+ if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
101868
101870
  renderOpts = renderOpts || defaultOpts();
101869
101871
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
101870
101872
  }
@@ -137700,17 +137702,8 @@ const {isEqual: require$$12$d} = _dll_lodash;
137700
137702
  var getTagName = function getTagName(el) {
137701
137703
  return (el && el.tagName || '').toLowerCase();
137702
137704
  };
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 ? '&lt;' : '').concat(part);
137711
- }, '');
137712
- }
137713
- return input;
137705
+ var arrowHandlingCase = function arrowHandlingCase(input) {
137706
+ return input.replace(/<([a-zA-Z]*)/g, '&lt;$1');
137714
137707
  };
137715
137708
  function replaceLeftRight(latexInput) {
137716
137709
  return latexInput.replace(/\\left\.\s*|\\right\.\s*/g, '');
@@ -137721,7 +137714,8 @@ const {isEqual: require$$12$d} = _dll_lodash;
137721
137714
  var regex = /<mo(?: [^>]*)?>&#x2061;<\/mo>/g;
137722
137715
  return mmlFromLatex.replace(regex, '');
137723
137716
  };
137724
- var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(decoded, "\">").concat((0, _mathRenderingAccessible.wrapMath)(decoded, wrapper), "</span>"), {
137717
+ var handled = arrowHandlingCase(decoded);
137718
+ var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(handled, "\">").concat((0, _mathRenderingAccessible.wrapMath)(handled, wrapper), "</span>"), {
137725
137719
  skipWaitForMathRenderingLib: true
137726
137720
  });
137727
137721
  mathMlFromLatex = removeEmptyMos(mathMlFromLatex);
@@ -137801,7 +137795,7 @@ const {isEqual: require$$12$d} = _dll_lodash;
137801
137795
  if (object.type === 'math') {
137802
137796
  var latex = object.data.get('latex');
137803
137797
  var wrapper = object.data.get('wrapper');
137804
- var decoded = htmlDecode(lessThanHandling(latex));
137798
+ var decoded = htmlDecode(arrowHandlingCase(latex));
137805
137799
  log('[serialize] latex: ', latex);
137806
137800
  if (MathPlugin.mathMlOptions.mmlOutput) {
137807
137801
  return _react["default"].createElement("span", {
@@ -138935,6 +138929,9 @@ const require$$12$b = _dll_debug;
138935
138929
  var matchVimeoUrl = function matchVimeoUrl(url) {
138936
138930
  return url && (/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/).test(url);
138937
138931
  };
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
+ };
138938
138935
  var matchSoundCloudUrl = function matchSoundCloudUrl(url) {
138939
138936
  if (!url) {
138940
138937
  return false;
@@ -139016,46 +139013,62 @@ const require$$12$b = _dll_debug;
139016
139013
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleStateChange", function (newState) {
139017
139014
  return _this.setState(newState, _this.formatUrl);
139018
139015
  });
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
+ });
139019
139063
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "urlChange", function (e) {
139020
139064
  var _ref = e.target || ({}), value = _ref.value;
139021
139065
  var type = _this.props.type;
139022
139066
  if (type && type === 'audio') {
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
- }
139067
+ _this.checkAudio();
139068
+ return;
139033
139069
  } else if (type && type === 'video') {
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
- }
139070
+ _this.checkVideo(value);
139071
+ return;
139059
139072
  }
139060
139073
  _this.handleStateChange({
139061
139074
  urlToUse: null,
@@ -149312,7 +149325,7 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
149312
149325
  var languageCharactersPlugins = ((opts === null || opts === void 0 ? void 0 : opts.languageCharacters) || []).map(function (config) {
149313
149326
  return (0, _characters["default"])(config);
149314
149327
  });
149315
- var tablePlugins = [imagePlugin, mathPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins));
149328
+ var tablePlugins = [imagePlugin, mathPlugin, respAreaPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins));
149316
149329
  if (opts.responseArea && opts.responseArea.type === 'math-templated') {
149317
149330
  tablePlugins.push(respAreaPlugin);
149318
149331
  }
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.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";
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.1/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.23.1/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,8 +65364,10 @@ var mathjaxScript = {};
65364
65364
  Object.defineProperty(mathjaxScript, "__esModule", {
65365
65365
  value: true
65366
65366
  });
65367
- mathjaxScript.initializeMathJax = void 0;
65367
+ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
65368
65368
  var _renderMath = renderMath$1;
65369
+ var MathJaxVersion = '3.2.2';
65370
+ mathjaxScript.MathJaxVersion = MathJaxVersion;
65369
65371
  var initializeMathJax = function initializeMathJax(renderOpts) {
65370
65372
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
65371
65373
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
@@ -65436,7 +65438,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
65436
65438
  };
65437
65439
  var script = document.createElement('script');
65438
65440
  script.type = 'text/javascript';
65439
- script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
65441
+ script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
65440
65442
  script.async = true;
65441
65443
  document.body.appendChild(script);
65442
65444
  });
@@ -125125,7 +125127,7 @@ getDefaultExportFromCjs(mathRendering);
125125
125127
  fixMathElements(executeOn);
125126
125128
  adjustMathMLStyle(executeOn);
125127
125129
  var mathJaxCustomKey = getMathJaxCustomKey();
125128
- if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
125130
+ if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
125129
125131
  renderOpts = renderOpts || defaultOpts();
125130
125132
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
125131
125133
  }
@@ -127768,17 +127770,8 @@ const {isEqual: require$$12$d} = _dll_lodash;
127768
127770
  var getTagName = function getTagName(el) {
127769
127771
  return (el && el.tagName || '').toLowerCase();
127770
127772
  };
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 ? '&lt;' : '').concat(part);
127779
- }, '');
127780
- }
127781
- return input;
127773
+ var arrowHandlingCase = function arrowHandlingCase(input) {
127774
+ return input.replace(/<([a-zA-Z]*)/g, '&lt;$1');
127782
127775
  };
127783
127776
  function replaceLeftRight(latexInput) {
127784
127777
  return latexInput.replace(/\\left\.\s*|\\right\.\s*/g, '');
@@ -127789,7 +127782,8 @@ const {isEqual: require$$12$d} = _dll_lodash;
127789
127782
  var regex = /<mo(?: [^>]*)?>&#x2061;<\/mo>/g;
127790
127783
  return mmlFromLatex.replace(regex, '');
127791
127784
  };
127792
- var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(decoded, "\">").concat((0, _mathRenderingAccessible.wrapMath)(decoded, wrapper), "</span>"), {
127785
+ var handled = arrowHandlingCase(decoded);
127786
+ var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(handled, "\">").concat((0, _mathRenderingAccessible.wrapMath)(handled, wrapper), "</span>"), {
127793
127787
  skipWaitForMathRenderingLib: true
127794
127788
  });
127795
127789
  mathMlFromLatex = removeEmptyMos(mathMlFromLatex);
@@ -127869,7 +127863,7 @@ const {isEqual: require$$12$d} = _dll_lodash;
127869
127863
  if (object.type === 'math') {
127870
127864
  var latex = object.data.get('latex');
127871
127865
  var wrapper = object.data.get('wrapper');
127872
- var decoded = htmlDecode(lessThanHandling(latex));
127866
+ var decoded = htmlDecode(arrowHandlingCase(latex));
127873
127867
  log('[serialize] latex: ', latex);
127874
127868
  if (MathPlugin.mathMlOptions.mmlOutput) {
127875
127869
  return _react["default"].createElement("span", {
@@ -129114,6 +129108,9 @@ const require$$12$b = _dll_debug;
129114
129108
  var matchVimeoUrl = function matchVimeoUrl(url) {
129115
129109
  return url && (/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/).test(url);
129116
129110
  };
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
+ };
129117
129114
  var matchSoundCloudUrl = function matchSoundCloudUrl(url) {
129118
129115
  if (!url) {
129119
129116
  return false;
@@ -129195,46 +129192,62 @@ const require$$12$b = _dll_debug;
129195
129192
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleStateChange", function (newState) {
129196
129193
  return _this.setState(newState, _this.formatUrl);
129197
129194
  });
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
+ });
129198
129242
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "urlChange", function (e) {
129199
129243
  var _ref = e.target || ({}), value = _ref.value;
129200
129244
  var type = _this.props.type;
129201
129245
  if (type && type === 'audio') {
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
- }
129246
+ _this.checkAudio();
129247
+ return;
129212
129248
  } else if (type && type === 'video') {
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
- }
129249
+ _this.checkVideo(value);
129250
+ return;
129238
129251
  }
129239
129252
  _this.handleStateChange({
129240
129253
  urlToUse: null,
@@ -147572,7 +147585,7 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
147572
147585
  var languageCharactersPlugins = ((opts === null || opts === void 0 ? void 0 : opts.languageCharacters) || []).map(function (config) {
147573
147586
  return (0, _characters["default"])(config);
147574
147587
  });
147575
- var tablePlugins = [imagePlugin, mathPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins));
147588
+ var tablePlugins = [imagePlugin, mathPlugin, respAreaPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins));
147576
147589
  if (opts.responseArea && opts.responseArea.type === 'math-templated') {
147577
147590
  tablePlugins.push(respAreaPlugin);
147578
147591
  }
@@ -4,11 +4,11 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "1.21.0"
7
+ "version": "1.21.1"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "4.12.0"
11
+ "version": "4.23.1"
12
12
  }
13
13
  ]
14
14
  }
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.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";
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.1/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.23.1/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,8 +65364,10 @@ var mathjaxScript = {};
65364
65364
  Object.defineProperty(mathjaxScript, "__esModule", {
65365
65365
  value: true
65366
65366
  });
65367
- mathjaxScript.initializeMathJax = void 0;
65367
+ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
65368
65368
  var _renderMath = renderMath$1;
65369
+ var MathJaxVersion = '3.2.2';
65370
+ mathjaxScript.MathJaxVersion = MathJaxVersion;
65369
65371
  var initializeMathJax = function initializeMathJax(renderOpts) {
65370
65372
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
65371
65373
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
@@ -65436,7 +65438,7 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
65436
65438
  };
65437
65439
  var script = document.createElement('script');
65438
65440
  script.type = 'text/javascript';
65439
- script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml-full.js';
65441
+ script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
65440
65442
  script.async = true;
65441
65443
  document.body.appendChild(script);
65442
65444
  });
@@ -125125,7 +125127,7 @@ getDefaultExportFromCjs(mathRendering);
125125
125127
  fixMathElements(executeOn);
125126
125128
  adjustMathMLStyle(executeOn);
125127
125129
  var mathJaxCustomKey = getMathJaxCustomKey();
125128
- if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
125130
+ if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
125129
125131
  renderOpts = renderOpts || defaultOpts();
125130
125132
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
125131
125133
  }
@@ -127768,17 +127770,8 @@ const {isEqual: require$$12$d} = _dll_lodash;
127768
127770
  var getTagName = function getTagName(el) {
127769
127771
  return (el && el.tagName || '').toLowerCase();
127770
127772
  };
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 ? '&lt;' : '').concat(part);
127779
- }, '');
127780
- }
127781
- return input;
127773
+ var arrowHandlingCase = function arrowHandlingCase(input) {
127774
+ return input.replace(/<([a-zA-Z]*)/g, '&lt;$1');
127782
127775
  };
127783
127776
  function replaceLeftRight(latexInput) {
127784
127777
  return latexInput.replace(/\\left\.\s*|\\right\.\s*/g, '');
@@ -127789,7 +127782,8 @@ const {isEqual: require$$12$d} = _dll_lodash;
127789
127782
  var regex = /<mo(?: [^>]*)?>&#x2061;<\/mo>/g;
127790
127783
  return mmlFromLatex.replace(regex, '');
127791
127784
  };
127792
- var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(decoded, "\">").concat((0, _mathRenderingAccessible.wrapMath)(decoded, wrapper), "</span>"), {
127785
+ var handled = arrowHandlingCase(decoded);
127786
+ var mathMlFromLatex = (0, _mathRenderingAccessible.renderMath)(("<span data-latex=\"\" data-raw=\"").concat(handled, "\">").concat((0, _mathRenderingAccessible.wrapMath)(handled, wrapper), "</span>"), {
127793
127787
  skipWaitForMathRenderingLib: true
127794
127788
  });
127795
127789
  mathMlFromLatex = removeEmptyMos(mathMlFromLatex);
@@ -127869,7 +127863,7 @@ const {isEqual: require$$12$d} = _dll_lodash;
127869
127863
  if (object.type === 'math') {
127870
127864
  var latex = object.data.get('latex');
127871
127865
  var wrapper = object.data.get('wrapper');
127872
- var decoded = htmlDecode(lessThanHandling(latex));
127866
+ var decoded = htmlDecode(arrowHandlingCase(latex));
127873
127867
  log('[serialize] latex: ', latex);
127874
127868
  if (MathPlugin.mathMlOptions.mmlOutput) {
127875
127869
  return _react["default"].createElement("span", {
@@ -129114,6 +129108,9 @@ const require$$12$b = _dll_debug;
129114
129108
  var matchVimeoUrl = function matchVimeoUrl(url) {
129115
129109
  return url && (/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/).test(url);
129116
129110
  };
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
+ };
129117
129114
  var matchSoundCloudUrl = function matchSoundCloudUrl(url) {
129118
129115
  if (!url) {
129119
129116
  return false;
@@ -129195,46 +129192,62 @@ const require$$12$b = _dll_debug;
129195
129192
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleStateChange", function (newState) {
129196
129193
  return _this.setState(newState, _this.formatUrl);
129197
129194
  });
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
+ });
129198
129242
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "urlChange", function (e) {
129199
129243
  var _ref = e.target || ({}), value = _ref.value;
129200
129244
  var type = _this.props.type;
129201
129245
  if (type && type === 'audio') {
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
- }
129246
+ _this.checkAudio();
129247
+ return;
129212
129248
  } else if (type && type === 'video') {
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
- }
129249
+ _this.checkVideo(value);
129250
+ return;
129238
129251
  }
129239
129252
  _this.handleStateChange({
129240
129253
  urlToUse: null,
@@ -147572,7 +147585,7 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
147572
147585
  var languageCharactersPlugins = ((opts === null || opts === void 0 ? void 0 : opts.languageCharacters) || []).map(function (config) {
147573
147586
  return (0, _characters["default"])(config);
147574
147587
  });
147575
- var tablePlugins = [imagePlugin, mathPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins));
147588
+ var tablePlugins = [imagePlugin, mathPlugin, respAreaPlugin].concat((0, _toConsumableArray2$2["default"])(languageCharactersPlugins));
147576
147589
  if (opts.responseArea && opts.responseArea.type === 'math-templated') {
147577
147590
  tablePlugins.push(respAreaPlugin);
147578
147591
  }
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.13+e2f0ba2c8",
4
+ "version": "2.17.1-next.14+6343d1b00",
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.13+e2f0ba2c8",
11
- "@pie-element/rubric": "^3.17.1-next.13+e2f0ba2c8",
10
+ "@pie-element/multi-trait-rubric": "^3.17.1-next.14+6343d1b00",
11
+ "@pie-element/rubric": "^3.17.1-next.14+6343d1b00",
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": "e2f0ba2c8d984648c56a1b9114b8875a8e0adc9f",
18
+ "gitHead": "6343d1b00c5a4a3d88de70ed13a8aa5c1a43002d",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },