@pie-element/complex-rubric 2.19.5-next.46 → 2.19.5-next.50

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.31.5-next.1",
10
+ "@pie-lib/pie-toolbox": "1.32.0",
11
11
  "lodash": "^4.17.15"
12
12
  },
13
13
  "author": "",
@@ -1,4 +1,4 @@
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.24.3/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.24.4/module/index.js";
2
2
  import RubricConfigure from '@pie-element/rubric/configure/lib';
3
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.24.3/module/index.js";
4
4
  function _mergeNamespaces(n, m) {
@@ -42042,7 +42042,7 @@ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
42042
42042
  var _renderMath = renderMath$1;
42043
42043
  var MathJaxVersion = '3.2.2';
42044
42044
  mathjaxScript.MathJaxVersion = MathJaxVersion;
42045
- var initializeMathJax = function initializeMathJax(renderOpts, callback) {
42045
+ var initializeMathJax = function initializeMathJax(renderOpts) {
42046
42046
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
42047
42047
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
42048
42048
  }
@@ -42066,61 +42066,56 @@ var initializeMathJax = function initializeMathJax(renderOpts, callback) {
42066
42066
  displayMath: [['$$', '$$'], ['\\[', '\\]']]
42067
42067
  };
42068
42068
  window.mathjaxLoadedP = new Promise(function (resolve) {
42069
- resolve();
42070
- });
42071
- window.MathJax = {
42072
- startup: {
42073
- typeset: false,
42074
- ready: function ready() {
42075
- var mathjax = MathJax._.mathjax.mathjax;
42076
- var STATE = MathJax._.core.MathItem.STATE;
42077
- var Menu = MathJax._.ui.menu.Menu.Menu;
42078
- var rerender = Menu.prototype.rerender;
42079
- Menu.prototype.rerender = function () {
42080
- var _this = this;
42081
- var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
42082
- mathjax.handleRetriesFor(function () {
42083
- return rerender.call(_this, start);
42084
- });
42085
- };
42086
- MathJax.startup.defaultReady();
42087
- var globalObj = (0, _renderMath.getGlobal)();
42088
- globalObj.instance = MathJax;
42089
- window.mathjaxIsInitialised = true;
42090
- if (callback) {
42091
- callback();
42069
+ window.MathJax = {
42070
+ startup: {
42071
+ typeset: false,
42072
+ ready: function ready() {
42073
+ var mathjax = MathJax._.mathjax.mathjax;
42074
+ var STATE = MathJax._.core.MathItem.STATE;
42075
+ var Menu = MathJax._.ui.menu.Menu.Menu;
42076
+ var rerender = Menu.prototype.rerender;
42077
+ Menu.prototype.rerender = function () {
42078
+ var _this = this;
42079
+ var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
42080
+ mathjax.handleRetriesFor(function () {
42081
+ return rerender.call(_this, start);
42082
+ });
42083
+ };
42084
+ MathJax.startup.defaultReady();
42085
+ var globalObj = (0, _renderMath.getGlobal)();
42086
+ globalObj.instance = MathJax;
42087
+ resolve();
42092
42088
  }
42093
- }
42094
- },
42095
- loader: {
42096
- load: ['input/mml'],
42097
- preLoad: function preLoad() {}
42098
- },
42099
- tex: texConfig,
42100
- chtml: {
42101
- fontURL: 'https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2',
42102
- displayAlign: 'center'
42103
- },
42104
- customKey: '@pie-lib/math-rendering-accessible@1',
42105
- options: {
42106
- enableEnrichment: true,
42107
- sre: {
42108
- speech: 'deep'
42109
42089
  },
42110
- menuOptions: {
42111
- settings: {
42112
- assistiveMml: true,
42113
- collapsible: false,
42114
- explorer: false
42090
+ loader: {
42091
+ load: ['input/mml']
42092
+ },
42093
+ tex: texConfig,
42094
+ chtml: {
42095
+ fontURL: 'https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2',
42096
+ displayAlign: 'center'
42097
+ },
42098
+ customKey: '@pie-lib/math-rendering-accessible@1',
42099
+ options: {
42100
+ enableEnrichment: true,
42101
+ sre: {
42102
+ speech: 'deep'
42103
+ },
42104
+ menuOptions: {
42105
+ settings: {
42106
+ assistiveMml: true,
42107
+ collapsible: false,
42108
+ explorer: false
42109
+ }
42115
42110
  }
42116
42111
  }
42117
- }
42118
- };
42119
- var script = document.createElement('script');
42120
- script.type = 'text/javascript';
42121
- script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
42122
- script.async = true;
42123
- document.body.appendChild(script);
42112
+ };
42113
+ var script = document.createElement('script');
42114
+ script.type = 'text/javascript';
42115
+ script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
42116
+ script.async = true;
42117
+ document.body.appendChild(script);
42118
+ });
42124
42119
  };
42125
42120
  mathjaxScript.initializeMathJax = initializeMathJax;
42126
42121
  var normalization$1 = {};
@@ -101871,34 +101866,9 @@ getDefaultExportFromCjs(mathRendering);
101871
101866
  fixMathElements(executeOn);
101872
101867
  adjustMathMLStyle(executeOn);
101873
101868
  var mathJaxCustomKey = getMathJaxCustomKey();
101874
- var workingWithMathJax = function workingWithMathJax() {
101875
- var mathJaxInstance = getGlobal().instance;
101876
- if (mathJaxInstance) {
101877
- mathJaxInstance.texReset();
101878
- mathJaxInstance.typesetClear();
101879
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
101880
- try {
101881
- removeExcessMjxContainers(executeOn);
101882
- removePlaceholdersAndRestoreDisplay();
101883
- var updatedDocument = mathJaxInstance.startup.document;
101884
- var list = updatedDocument.math.list;
101885
- for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
101886
- var mathMl = toMMl(item.data.root);
101887
- var parsedMathMl = mathMl.replaceAll('\n', '');
101888
- item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
101889
- }
101890
- } catch (e) {
101891
- console.error('Error post-processing MathJax typesetting:', e.toString());
101892
- }
101893
- mathJaxInstance.startup.document.clear();
101894
- })["catch"](function (error) {
101895
- console.error('Error in typesetting with MathJax:', error);
101896
- });
101897
- }
101898
- };
101899
101869
  if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
101900
101870
  renderOpts = renderOpts || defaultOpts();
101901
- (0, _mathjaxScript.initializeMathJax)(renderOpts, workingWithMathJax);
101871
+ (0, _mathjaxScript.initializeMathJax)(renderOpts);
101902
101872
  }
101903
101873
  if (isString && window.MathJax && window.mathjaxLoadedP) {
101904
101874
  try {
@@ -101916,7 +101886,33 @@ getDefaultExportFromCjs(mathRendering);
101916
101886
  }
101917
101887
  }
101918
101888
  if (window.mathjaxLoadedP) {
101919
- workingWithMathJax();
101889
+ window.mathjaxLoadedP.then(function () {
101890
+ var mathJaxInstance = getGlobal().instance;
101891
+ if (mathJaxInstance) {
101892
+ mathJaxInstance.texReset();
101893
+ mathJaxInstance.typesetClear();
101894
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
101895
+ try {
101896
+ removeExcessMjxContainers(executeOn);
101897
+ removePlaceholdersAndRestoreDisplay();
101898
+ var _updatedDocument = mathJaxInstance.startup.document;
101899
+ var _list = _updatedDocument.math.list;
101900
+ for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
101901
+ var _mathMl = toMMl(_item.data.root);
101902
+ var _parsedMathMl = _mathMl.replaceAll('\n', '');
101903
+ _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
101904
+ }
101905
+ } catch (e) {
101906
+ console.error('Error post-processing MathJax typesetting:', e.toString());
101907
+ }
101908
+ mathJaxInstance.startup.document.clear();
101909
+ })["catch"](function (error) {
101910
+ console.error('Error in typesetting with MathJax:', error);
101911
+ });
101912
+ }
101913
+ })["catch"](function (error) {
101914
+ console.error('Error in initializing MathJax:', error);
101915
+ });
101920
101916
  }
101921
101917
  };
101922
101918
  if (skipWaitForMathRenderingLib) {
@@ -149381,7 +149377,27 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
149381
149377
  if (opts.responseArea && opts.responseArea.type === 'math-templated') {
149382
149378
  tablePlugins.push(respAreaPlugin);
149383
149379
  }
149384
- var builtPlugins = (0, _compact["default"])([EnterHandlingPlugin(), addIf('table', (0, _table["default"])(opts.table, (0, _compact["default"])(tablePlugins))), addIf('bold', MarkHotkey({
149380
+ var builtCustomPlugins = [];
149381
+ customPlugins.forEach(function (customPlugin) {
149382
+ var _ref2 = customPlugin || ({}), event = _ref2.event, icon = _ref2.icon, iconType = _ref2.iconType, iconAlt = _ref2.iconAlt;
149383
+ function isValidEventName(eventName) {
149384
+ if (typeof eventName !== 'string' || eventName.length === 0) {
149385
+ return false;
149386
+ }
149387
+ var regex = /^[a-zA-Z0-9_]+$/;
149388
+ return regex.test(eventName);
149389
+ }
149390
+ if (!isValidEventName(event)) {
149391
+ console.error(("The event name: ").concat(event, " is not a valid event name!"));
149392
+ return;
149393
+ }
149394
+ if (!icon && !iconType && !iconAlt) {
149395
+ console.error('Your custom button requires icon, iconType and iconAlt');
149396
+ return;
149397
+ }
149398
+ builtCustomPlugins.push((0, _customPlugin["default"])('custom-plugin', customPlugin));
149399
+ });
149400
+ return (0, _compact["default"])([addIf('table', (0, _table["default"])(opts.table, (0, _compact["default"])(tablePlugins))), addIf('bold', MarkHotkey({
149385
149401
  key: 'b',
149386
149402
  type: 'bold',
149387
149403
  icon: _react$1e["default"].createElement(_FormatBold["default"], null),
@@ -149431,27 +149447,7 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
149431
149447
  icon: _react$1e["default"].createElement(_FormatListNumbered["default"], null)
149432
149448
  })), addIf('redo', UndoRedo('redo')), addIf('undo', UndoRedo('undo')), (0, _toolbar["default"])(opts.toolbar), (0, _slateSoftBreak["default"])({
149433
149449
  shift: true
149434
- }), addIf('responseArea', respAreaPlugin), addIf('html', (0, _html$1["default"])(opts.html))]));
149435
- customPlugins.forEach(function (customPlugin) {
149436
- var _ref2 = customPlugin || ({}), event = _ref2.event, icon = _ref2.icon, iconType = _ref2.iconType, iconAlt = _ref2.iconAlt;
149437
- function isValidEventName(eventName) {
149438
- if (typeof eventName !== 'string' || eventName.length === 0) {
149439
- return false;
149440
- }
149441
- var regex = /^[a-zA-Z0-9_]+$/;
149442
- return regex.test(eventName);
149443
- }
149444
- if (!isValidEventName(event)) {
149445
- console.error(("The event name: ").concat(event, " is not a valid event name!"));
149446
- return;
149447
- }
149448
- if (!icon && !iconType && !iconAlt) {
149449
- console.error('Your custom button requires icon, iconType and iconAlt');
149450
- return;
149451
- }
149452
- builtPlugins.push((0, _customPlugin["default"])('custom-plugin', customPlugin));
149453
- });
149454
- return builtPlugins;
149450
+ })], builtCustomPlugins, [addIf('responseArea', respAreaPlugin), addIf('html', (0, _html$1["default"])(opts.html)), EnterHandlingPlugin()]));
149455
149451
  };
149456
149452
  plugins.buildPlugins = buildPlugins;
149457
149453
  var require$$25 = getAugmentedNamespace(slatePlainSerializer_es);
package/module/element.js CHANGED
@@ -1,4 +1,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.24.3/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.24.4/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.24.3/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -65368,7 +65368,7 @@ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
65368
65368
  var _renderMath = renderMath$1;
65369
65369
  var MathJaxVersion = '3.2.2';
65370
65370
  mathjaxScript.MathJaxVersion = MathJaxVersion;
65371
- var initializeMathJax = function initializeMathJax(renderOpts, callback) {
65371
+ var initializeMathJax = function initializeMathJax(renderOpts) {
65372
65372
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
65373
65373
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
65374
65374
  }
@@ -65392,61 +65392,56 @@ var initializeMathJax = function initializeMathJax(renderOpts, callback) {
65392
65392
  displayMath: [['$$', '$$'], ['\\[', '\\]']]
65393
65393
  };
65394
65394
  window.mathjaxLoadedP = new Promise(function (resolve) {
65395
- resolve();
65396
- });
65397
- window.MathJax = {
65398
- startup: {
65399
- typeset: false,
65400
- ready: function ready() {
65401
- var mathjax = MathJax._.mathjax.mathjax;
65402
- var STATE = MathJax._.core.MathItem.STATE;
65403
- var Menu = MathJax._.ui.menu.Menu.Menu;
65404
- var rerender = Menu.prototype.rerender;
65405
- Menu.prototype.rerender = function () {
65406
- var _this = this;
65407
- var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
65408
- mathjax.handleRetriesFor(function () {
65409
- return rerender.call(_this, start);
65410
- });
65411
- };
65412
- MathJax.startup.defaultReady();
65413
- var globalObj = (0, _renderMath.getGlobal)();
65414
- globalObj.instance = MathJax;
65415
- window.mathjaxIsInitialised = true;
65416
- if (callback) {
65417
- callback();
65395
+ window.MathJax = {
65396
+ startup: {
65397
+ typeset: false,
65398
+ ready: function ready() {
65399
+ var mathjax = MathJax._.mathjax.mathjax;
65400
+ var STATE = MathJax._.core.MathItem.STATE;
65401
+ var Menu = MathJax._.ui.menu.Menu.Menu;
65402
+ var rerender = Menu.prototype.rerender;
65403
+ Menu.prototype.rerender = function () {
65404
+ var _this = this;
65405
+ var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
65406
+ mathjax.handleRetriesFor(function () {
65407
+ return rerender.call(_this, start);
65408
+ });
65409
+ };
65410
+ MathJax.startup.defaultReady();
65411
+ var globalObj = (0, _renderMath.getGlobal)();
65412
+ globalObj.instance = MathJax;
65413
+ resolve();
65418
65414
  }
65419
- }
65420
- },
65421
- loader: {
65422
- load: ['input/mml'],
65423
- preLoad: function preLoad() {}
65424
- },
65425
- tex: texConfig,
65426
- chtml: {
65427
- fontURL: 'https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2',
65428
- displayAlign: 'center'
65429
- },
65430
- customKey: '@pie-lib/math-rendering-accessible@1',
65431
- options: {
65432
- enableEnrichment: true,
65433
- sre: {
65434
- speech: 'deep'
65435
65415
  },
65436
- menuOptions: {
65437
- settings: {
65438
- assistiveMml: true,
65439
- collapsible: false,
65440
- explorer: false
65416
+ loader: {
65417
+ load: ['input/mml']
65418
+ },
65419
+ tex: texConfig,
65420
+ chtml: {
65421
+ fontURL: 'https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2',
65422
+ displayAlign: 'center'
65423
+ },
65424
+ customKey: '@pie-lib/math-rendering-accessible@1',
65425
+ options: {
65426
+ enableEnrichment: true,
65427
+ sre: {
65428
+ speech: 'deep'
65429
+ },
65430
+ menuOptions: {
65431
+ settings: {
65432
+ assistiveMml: true,
65433
+ collapsible: false,
65434
+ explorer: false
65435
+ }
65441
65436
  }
65442
65437
  }
65443
- }
65444
- };
65445
- var script = document.createElement('script');
65446
- script.type = 'text/javascript';
65447
- script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
65448
- script.async = true;
65449
- document.body.appendChild(script);
65438
+ };
65439
+ var script = document.createElement('script');
65440
+ script.type = 'text/javascript';
65441
+ script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
65442
+ script.async = true;
65443
+ document.body.appendChild(script);
65444
+ });
65450
65445
  };
65451
65446
  mathjaxScript.initializeMathJax = initializeMathJax;
65452
65447
  var normalization$1 = {};
@@ -125132,34 +125127,9 @@ getDefaultExportFromCjs(mathRendering);
125132
125127
  fixMathElements(executeOn);
125133
125128
  adjustMathMLStyle(executeOn);
125134
125129
  var mathJaxCustomKey = getMathJaxCustomKey();
125135
- var workingWithMathJax = function workingWithMathJax() {
125136
- var mathJaxInstance = getGlobal().instance;
125137
- if (mathJaxInstance) {
125138
- mathJaxInstance.texReset();
125139
- mathJaxInstance.typesetClear();
125140
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
125141
- try {
125142
- removeExcessMjxContainers(executeOn);
125143
- removePlaceholdersAndRestoreDisplay();
125144
- var updatedDocument = mathJaxInstance.startup.document;
125145
- var list = updatedDocument.math.list;
125146
- for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
125147
- var mathMl = toMMl(item.data.root);
125148
- var parsedMathMl = mathMl.replaceAll('\n', '');
125149
- item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
125150
- }
125151
- } catch (e) {
125152
- console.error('Error post-processing MathJax typesetting:', e.toString());
125153
- }
125154
- mathJaxInstance.startup.document.clear();
125155
- })["catch"](function (error) {
125156
- console.error('Error in typesetting with MathJax:', error);
125157
- });
125158
- }
125159
- };
125160
125130
  if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
125161
125131
  renderOpts = renderOpts || defaultOpts();
125162
- (0, _mathjaxScript.initializeMathJax)(renderOpts, workingWithMathJax);
125132
+ (0, _mathjaxScript.initializeMathJax)(renderOpts);
125163
125133
  }
125164
125134
  if (isString && window.MathJax && window.mathjaxLoadedP) {
125165
125135
  try {
@@ -125177,7 +125147,33 @@ getDefaultExportFromCjs(mathRendering);
125177
125147
  }
125178
125148
  }
125179
125149
  if (window.mathjaxLoadedP) {
125180
- workingWithMathJax();
125150
+ window.mathjaxLoadedP.then(function () {
125151
+ var mathJaxInstance = getGlobal().instance;
125152
+ if (mathJaxInstance) {
125153
+ mathJaxInstance.texReset();
125154
+ mathJaxInstance.typesetClear();
125155
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
125156
+ try {
125157
+ removeExcessMjxContainers(executeOn);
125158
+ removePlaceholdersAndRestoreDisplay();
125159
+ var _updatedDocument = mathJaxInstance.startup.document;
125160
+ var _list = _updatedDocument.math.list;
125161
+ for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
125162
+ var _mathMl = toMMl(_item.data.root);
125163
+ var _parsedMathMl = _mathMl.replaceAll('\n', '');
125164
+ _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
125165
+ }
125166
+ } catch (e) {
125167
+ console.error('Error post-processing MathJax typesetting:', e.toString());
125168
+ }
125169
+ mathJaxInstance.startup.document.clear();
125170
+ })["catch"](function (error) {
125171
+ console.error('Error in typesetting with MathJax:', error);
125172
+ });
125173
+ }
125174
+ })["catch"](function (error) {
125175
+ console.error('Error in initializing MathJax:', error);
125176
+ });
125181
125177
  }
125182
125178
  };
125183
125179
  if (skipWaitForMathRenderingLib) {
@@ -147641,7 +147637,27 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
147641
147637
  if (opts.responseArea && opts.responseArea.type === 'math-templated') {
147642
147638
  tablePlugins.push(respAreaPlugin);
147643
147639
  }
147644
- var builtPlugins = (0, _compact["default"])([EnterHandlingPlugin(), addIf('table', (0, _table["default"])(opts.table, (0, _compact["default"])(tablePlugins))), addIf('bold', MarkHotkey({
147640
+ var builtCustomPlugins = [];
147641
+ customPlugins.forEach(function (customPlugin) {
147642
+ var _ref2 = customPlugin || ({}), event = _ref2.event, icon = _ref2.icon, iconType = _ref2.iconType, iconAlt = _ref2.iconAlt;
147643
+ function isValidEventName(eventName) {
147644
+ if (typeof eventName !== 'string' || eventName.length === 0) {
147645
+ return false;
147646
+ }
147647
+ var regex = /^[a-zA-Z0-9_]+$/;
147648
+ return regex.test(eventName);
147649
+ }
147650
+ if (!isValidEventName(event)) {
147651
+ console.error(("The event name: ").concat(event, " is not a valid event name!"));
147652
+ return;
147653
+ }
147654
+ if (!icon && !iconType && !iconAlt) {
147655
+ console.error('Your custom button requires icon, iconType and iconAlt');
147656
+ return;
147657
+ }
147658
+ builtCustomPlugins.push((0, _customPlugin["default"])('custom-plugin', customPlugin));
147659
+ });
147660
+ return (0, _compact["default"])([addIf('table', (0, _table["default"])(opts.table, (0, _compact["default"])(tablePlugins))), addIf('bold', MarkHotkey({
147645
147661
  key: 'b',
147646
147662
  type: 'bold',
147647
147663
  icon: _react$1c["default"].createElement(_FormatBold["default"], null),
@@ -147691,27 +147707,7 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
147691
147707
  icon: _react$1c["default"].createElement(_FormatListNumbered["default"], null)
147692
147708
  })), addIf('redo', UndoRedo('redo')), addIf('undo', UndoRedo('undo')), (0, _toolbar["default"])(opts.toolbar), (0, _slateSoftBreak["default"])({
147693
147709
  shift: true
147694
- }), addIf('responseArea', respAreaPlugin), addIf('html', (0, _html$1["default"])(opts.html))]));
147695
- customPlugins.forEach(function (customPlugin) {
147696
- var _ref2 = customPlugin || ({}), event = _ref2.event, icon = _ref2.icon, iconType = _ref2.iconType, iconAlt = _ref2.iconAlt;
147697
- function isValidEventName(eventName) {
147698
- if (typeof eventName !== 'string' || eventName.length === 0) {
147699
- return false;
147700
- }
147701
- var regex = /^[a-zA-Z0-9_]+$/;
147702
- return regex.test(eventName);
147703
- }
147704
- if (!isValidEventName(event)) {
147705
- console.error(("The event name: ").concat(event, " is not a valid event name!"));
147706
- return;
147707
- }
147708
- if (!icon && !iconType && !iconAlt) {
147709
- console.error('Your custom button requires icon, iconType and iconAlt');
147710
- return;
147711
- }
147712
- builtPlugins.push((0, _customPlugin["default"])('custom-plugin', customPlugin));
147713
- });
147714
- return builtPlugins;
147710
+ })], builtCustomPlugins, [addIf('responseArea', respAreaPlugin), addIf('html', (0, _html$1["default"])(opts.html)), EnterHandlingPlugin()]));
147715
147711
  };
147716
147712
  plugins.buildPlugins = buildPlugins;
147717
147713
  var require$$25 = getAugmentedNamespace(slatePlainSerializer_es);
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "1.24.3"
7
+ "version": "1.24.4"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
package/module/print.js CHANGED
@@ -1,4 +1,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.24.3/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.24.4/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.24.3/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -65368,7 +65368,7 @@ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
65368
65368
  var _renderMath = renderMath$1;
65369
65369
  var MathJaxVersion = '3.2.2';
65370
65370
  mathjaxScript.MathJaxVersion = MathJaxVersion;
65371
- var initializeMathJax = function initializeMathJax(renderOpts, callback) {
65371
+ var initializeMathJax = function initializeMathJax(renderOpts) {
65372
65372
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
65373
65373
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
65374
65374
  }
@@ -65392,61 +65392,56 @@ var initializeMathJax = function initializeMathJax(renderOpts, callback) {
65392
65392
  displayMath: [['$$', '$$'], ['\\[', '\\]']]
65393
65393
  };
65394
65394
  window.mathjaxLoadedP = new Promise(function (resolve) {
65395
- resolve();
65396
- });
65397
- window.MathJax = {
65398
- startup: {
65399
- typeset: false,
65400
- ready: function ready() {
65401
- var mathjax = MathJax._.mathjax.mathjax;
65402
- var STATE = MathJax._.core.MathItem.STATE;
65403
- var Menu = MathJax._.ui.menu.Menu.Menu;
65404
- var rerender = Menu.prototype.rerender;
65405
- Menu.prototype.rerender = function () {
65406
- var _this = this;
65407
- var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
65408
- mathjax.handleRetriesFor(function () {
65409
- return rerender.call(_this, start);
65410
- });
65411
- };
65412
- MathJax.startup.defaultReady();
65413
- var globalObj = (0, _renderMath.getGlobal)();
65414
- globalObj.instance = MathJax;
65415
- window.mathjaxIsInitialised = true;
65416
- if (callback) {
65417
- callback();
65395
+ window.MathJax = {
65396
+ startup: {
65397
+ typeset: false,
65398
+ ready: function ready() {
65399
+ var mathjax = MathJax._.mathjax.mathjax;
65400
+ var STATE = MathJax._.core.MathItem.STATE;
65401
+ var Menu = MathJax._.ui.menu.Menu.Menu;
65402
+ var rerender = Menu.prototype.rerender;
65403
+ Menu.prototype.rerender = function () {
65404
+ var _this = this;
65405
+ var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : STATE.TYPESET;
65406
+ mathjax.handleRetriesFor(function () {
65407
+ return rerender.call(_this, start);
65408
+ });
65409
+ };
65410
+ MathJax.startup.defaultReady();
65411
+ var globalObj = (0, _renderMath.getGlobal)();
65412
+ globalObj.instance = MathJax;
65413
+ resolve();
65418
65414
  }
65419
- }
65420
- },
65421
- loader: {
65422
- load: ['input/mml'],
65423
- preLoad: function preLoad() {}
65424
- },
65425
- tex: texConfig,
65426
- chtml: {
65427
- fontURL: 'https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2',
65428
- displayAlign: 'center'
65429
- },
65430
- customKey: '@pie-lib/math-rendering-accessible@1',
65431
- options: {
65432
- enableEnrichment: true,
65433
- sre: {
65434
- speech: 'deep'
65435
65415
  },
65436
- menuOptions: {
65437
- settings: {
65438
- assistiveMml: true,
65439
- collapsible: false,
65440
- explorer: false
65416
+ loader: {
65417
+ load: ['input/mml']
65418
+ },
65419
+ tex: texConfig,
65420
+ chtml: {
65421
+ fontURL: 'https://unpkg.com/mathjax-full@3.2.2/ts/output/chtml/fonts/tex-woff-v2',
65422
+ displayAlign: 'center'
65423
+ },
65424
+ customKey: '@pie-lib/math-rendering-accessible@1',
65425
+ options: {
65426
+ enableEnrichment: true,
65427
+ sre: {
65428
+ speech: 'deep'
65429
+ },
65430
+ menuOptions: {
65431
+ settings: {
65432
+ assistiveMml: true,
65433
+ collapsible: false,
65434
+ explorer: false
65435
+ }
65441
65436
  }
65442
65437
  }
65443
- }
65444
- };
65445
- var script = document.createElement('script');
65446
- script.type = 'text/javascript';
65447
- script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
65448
- script.async = true;
65449
- document.body.appendChild(script);
65438
+ };
65439
+ var script = document.createElement('script');
65440
+ script.type = 'text/javascript';
65441
+ script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
65442
+ script.async = true;
65443
+ document.body.appendChild(script);
65444
+ });
65450
65445
  };
65451
65446
  mathjaxScript.initializeMathJax = initializeMathJax;
65452
65447
  var normalization$1 = {};
@@ -125132,34 +125127,9 @@ getDefaultExportFromCjs(mathRendering);
125132
125127
  fixMathElements(executeOn);
125133
125128
  adjustMathMLStyle(executeOn);
125134
125129
  var mathJaxCustomKey = getMathJaxCustomKey();
125135
- var workingWithMathJax = function workingWithMathJax() {
125136
- var mathJaxInstance = getGlobal().instance;
125137
- if (mathJaxInstance) {
125138
- mathJaxInstance.texReset();
125139
- mathJaxInstance.typesetClear();
125140
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
125141
- try {
125142
- removeExcessMjxContainers(executeOn);
125143
- removePlaceholdersAndRestoreDisplay();
125144
- var updatedDocument = mathJaxInstance.startup.document;
125145
- var list = updatedDocument.math.list;
125146
- for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
125147
- var mathMl = toMMl(item.data.root);
125148
- var parsedMathMl = mathMl.replaceAll('\n', '');
125149
- item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
125150
- }
125151
- } catch (e) {
125152
- console.error('Error post-processing MathJax typesetting:', e.toString());
125153
- }
125154
- mathJaxInstance.startup.document.clear();
125155
- })["catch"](function (error) {
125156
- console.error('Error in typesetting with MathJax:', error);
125157
- });
125158
- }
125159
- };
125160
125130
  if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
125161
125131
  renderOpts = renderOpts || defaultOpts();
125162
- (0, _mathjaxScript.initializeMathJax)(renderOpts, workingWithMathJax);
125132
+ (0, _mathjaxScript.initializeMathJax)(renderOpts);
125163
125133
  }
125164
125134
  if (isString && window.MathJax && window.mathjaxLoadedP) {
125165
125135
  try {
@@ -125177,7 +125147,33 @@ getDefaultExportFromCjs(mathRendering);
125177
125147
  }
125178
125148
  }
125179
125149
  if (window.mathjaxLoadedP) {
125180
- workingWithMathJax();
125150
+ window.mathjaxLoadedP.then(function () {
125151
+ var mathJaxInstance = getGlobal().instance;
125152
+ if (mathJaxInstance) {
125153
+ mathJaxInstance.texReset();
125154
+ mathJaxInstance.typesetClear();
125155
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
125156
+ try {
125157
+ removeExcessMjxContainers(executeOn);
125158
+ removePlaceholdersAndRestoreDisplay();
125159
+ var _updatedDocument = mathJaxInstance.startup.document;
125160
+ var _list = _updatedDocument.math.list;
125161
+ for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
125162
+ var _mathMl = toMMl(_item.data.root);
125163
+ var _parsedMathMl = _mathMl.replaceAll('\n', '');
125164
+ _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
125165
+ }
125166
+ } catch (e) {
125167
+ console.error('Error post-processing MathJax typesetting:', e.toString());
125168
+ }
125169
+ mathJaxInstance.startup.document.clear();
125170
+ })["catch"](function (error) {
125171
+ console.error('Error in typesetting with MathJax:', error);
125172
+ });
125173
+ }
125174
+ })["catch"](function (error) {
125175
+ console.error('Error in initializing MathJax:', error);
125176
+ });
125181
125177
  }
125182
125178
  };
125183
125179
  if (skipWaitForMathRenderingLib) {
@@ -147641,7 +147637,27 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
147641
147637
  if (opts.responseArea && opts.responseArea.type === 'math-templated') {
147642
147638
  tablePlugins.push(respAreaPlugin);
147643
147639
  }
147644
- var builtPlugins = (0, _compact["default"])([EnterHandlingPlugin(), addIf('table', (0, _table["default"])(opts.table, (0, _compact["default"])(tablePlugins))), addIf('bold', MarkHotkey({
147640
+ var builtCustomPlugins = [];
147641
+ customPlugins.forEach(function (customPlugin) {
147642
+ var _ref2 = customPlugin || ({}), event = _ref2.event, icon = _ref2.icon, iconType = _ref2.iconType, iconAlt = _ref2.iconAlt;
147643
+ function isValidEventName(eventName) {
147644
+ if (typeof eventName !== 'string' || eventName.length === 0) {
147645
+ return false;
147646
+ }
147647
+ var regex = /^[a-zA-Z0-9_]+$/;
147648
+ return regex.test(eventName);
147649
+ }
147650
+ if (!isValidEventName(event)) {
147651
+ console.error(("The event name: ").concat(event, " is not a valid event name!"));
147652
+ return;
147653
+ }
147654
+ if (!icon && !iconType && !iconAlt) {
147655
+ console.error('Your custom button requires icon, iconType and iconAlt');
147656
+ return;
147657
+ }
147658
+ builtCustomPlugins.push((0, _customPlugin["default"])('custom-plugin', customPlugin));
147659
+ });
147660
+ return (0, _compact["default"])([addIf('table', (0, _table["default"])(opts.table, (0, _compact["default"])(tablePlugins))), addIf('bold', MarkHotkey({
147645
147661
  key: 'b',
147646
147662
  type: 'bold',
147647
147663
  icon: _react$1c["default"].createElement(_FormatBold["default"], null),
@@ -147691,27 +147707,7 @@ var buildPlugins = function buildPlugins(activePlugins, customPlugins, opts) {
147691
147707
  icon: _react$1c["default"].createElement(_FormatListNumbered["default"], null)
147692
147708
  })), addIf('redo', UndoRedo('redo')), addIf('undo', UndoRedo('undo')), (0, _toolbar["default"])(opts.toolbar), (0, _slateSoftBreak["default"])({
147693
147709
  shift: true
147694
- }), addIf('responseArea', respAreaPlugin), addIf('html', (0, _html$1["default"])(opts.html))]));
147695
- customPlugins.forEach(function (customPlugin) {
147696
- var _ref2 = customPlugin || ({}), event = _ref2.event, icon = _ref2.icon, iconType = _ref2.iconType, iconAlt = _ref2.iconAlt;
147697
- function isValidEventName(eventName) {
147698
- if (typeof eventName !== 'string' || eventName.length === 0) {
147699
- return false;
147700
- }
147701
- var regex = /^[a-zA-Z0-9_]+$/;
147702
- return regex.test(eventName);
147703
- }
147704
- if (!isValidEventName(event)) {
147705
- console.error(("The event name: ").concat(event, " is not a valid event name!"));
147706
- return;
147707
- }
147708
- if (!icon && !iconType && !iconAlt) {
147709
- console.error('Your custom button requires icon, iconType and iconAlt');
147710
- return;
147711
- }
147712
- builtPlugins.push((0, _customPlugin["default"])('custom-plugin', customPlugin));
147713
- });
147714
- return builtPlugins;
147710
+ })], builtCustomPlugins, [addIf('responseArea', respAreaPlugin), addIf('html', (0, _html$1["default"])(opts.html)), EnterHandlingPlugin()]));
147715
147711
  };
147716
147712
  plugins.buildPlugins = buildPlugins;
147717
147713
  var require$$25 = getAugmentedNamespace(slatePlainSerializer_es);
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@pie-element/complex-rubric",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "2.19.5-next.46+d62f2b452",
4
+ "version": "2.19.5-next.50+37c00cde6",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "dependencies": {
9
9
  "@material-ui/core": "^3.9.2",
10
- "@pie-element/multi-trait-rubric": "^3.19.5-next.46+d62f2b452",
11
- "@pie-element/rubric": "^3.19.5-next.46+d62f2b452",
10
+ "@pie-element/multi-trait-rubric": "^3.19.5-next.50+37c00cde6",
11
+ "@pie-element/rubric": "^3.19.5-next.50+37c00cde6",
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": "d62f2b4526eeda1f90d3660d97bf278ac1ae72da",
18
+ "gitHead": "37c00cde6d7e4a9991075f045e11602a2ace772f",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },