@pie-element/complex-rubric 2.10.1-next.6 → 2.10.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.10.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.10.0...@pie-element/complex-rubric@2.10.1) (2024-04-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-3683, PD-3644 ([73734c5](https://github.com/pie-framework/pie-elements/commit/73734c50a1e4fcda6be4f67c725816d75aea222f))
12
+
13
+
14
+
15
+
16
+
6
17
  # [2.10.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.9.1...@pie-element/complex-rubric@2.10.0) (2024-04-22)
7
18
 
8
19
 
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.2.16](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.2.15...@pie-element/complex-rubric-configure@2.2.16) (2024-04-29)
7
+
8
+ **Note:** Version bump only for package @pie-element/complex-rubric-configure
9
+
10
+
11
+
12
+
13
+
6
14
  ## [2.2.15](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.2.14...@pie-element/complex-rubric-configure@2.2.15) (2024-04-22)
7
15
 
8
16
  **Note:** Version bump only for package @pie-element/complex-rubric-configure
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@pie-element/complex-rubric-configure",
3
3
  "private": true,
4
- "version": "2.2.15",
4
+ "version": "2.2.16",
5
5
  "description": "Complex Rubric authoring view",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "author": "Pie Framework Authors",
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
11
- "@pie-element/multi-trait-rubric": "^3.10.0",
12
- "@pie-element/rubric": "^3.10.0",
11
+ "@pie-element/multi-trait-rubric": "^3.10.1",
12
+ "@pie-element/rubric": "^3.10.1",
13
13
  "@pie-framework/pie-configure-events": "^1.3.0",
14
14
  "@pie-lib/config-ui": "^11.9.25-next.0",
15
15
  "@pie-lib/editable-html": "^11.1.2-next.0",
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.9.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-controller@2.9.0...@pie-element/complex-rubric-controller@2.9.1) (2024-04-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-3683, PD-3644 ([73734c5](https://github.com/pie-framework/pie-elements/commit/73734c50a1e4fcda6be4f67c725816d75aea222f))
12
+
13
+
14
+
15
+
16
+
6
17
  # [2.9.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-controller@2.8.1...@pie-element/complex-rubric-controller@2.9.0) (2024-04-22)
7
18
 
8
19
 
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/complex-rubric-controller",
3
3
  "private": true,
4
- "version": "2.9.0",
4
+ "version": "2.9.1",
5
5
  "description": "",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "dependencies": {
10
- "@pie-lib/pie-toolbox": "1.16.0",
10
+ "@pie-lib/pie-toolbox": "1.16.4",
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.9.1/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.9.3/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.0.0/module/index.js";
4
4
  function _mergeNamespaces(n, m) {
@@ -104157,13 +104157,14 @@ getDefaultExportFromCjs(mathRendering);
104157
104157
  };
104158
104158
  var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
104159
104159
  var NEWLINE_LATEX = '\\newline ';
104160
+ var mathRenderingKEY = '@pie-lib/math-rendering@2';
104161
+ var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
104160
104162
  var getGlobal = function getGlobal() {
104161
- var key = '@pie-lib/math-rendering-accessible@1';
104162
104163
  if (typeof window !== 'undefined') {
104163
- if (!window[key]) {
104164
- window[key] = {};
104164
+ if (!window[mathRenderingAccessibleKEY]) {
104165
+ window[mathRenderingAccessibleKEY] = {};
104165
104166
  }
104166
- return window[key];
104167
+ return window[mathRenderingAccessibleKEY];
104167
104168
  } else {
104168
104169
  return {};
104169
104170
  }
@@ -104225,22 +104226,6 @@ getDefaultExportFromCjs(mathRendering);
104225
104226
  placeholder.remove();
104226
104227
  });
104227
104228
  };
104228
- var waitForMathRenderingLib = function waitForMathRenderingLib(callback) {
104229
- if (window.hasOwnProperty('@pie-lib/math-rendering@2')) {
104230
- callback();
104231
- return;
104232
- }
104233
- var checkIntervalId;
104234
- var maxWaitTime = 500;
104235
- var startTime = Date.now();
104236
- var checkForLib = function checkForLib() {
104237
- if (window.hasOwnProperty('@pie-lib/math-rendering@2') || Date.now() - startTime > maxWaitTime) {
104238
- clearInterval(checkIntervalId);
104239
- callback();
104240
- }
104241
- };
104242
- checkIntervalId = setInterval(checkForLib, 100);
104243
- };
104244
104229
  var removeExcessMjxContainers = function removeExcessMjxContainers(content) {
104245
104230
  var elements = content.querySelectorAll('[data-latex][data-math-handled="true"]');
104246
104231
  elements.forEach(function (element) {
@@ -104252,9 +104237,11 @@ getDefaultExportFromCjs(mathRendering);
104252
104237
  }
104253
104238
  });
104254
104239
  };
104240
+ var getMathJaxCustomKey = function getMathJaxCustomKey() {
104241
+ var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
104242
+ return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
104243
+ };
104255
104244
  var renderMath = function renderMath(el, renderOpts) {
104256
- renderOpts = renderOpts || defaultOpts();
104257
- var _renderOpts = renderOpts, skipWaitForMathRenderingLib = _renderOpts.skipWaitForMathRenderingLib;
104258
104245
  var isString = typeof el === 'string';
104259
104246
  var executeOn = document.body;
104260
104247
  if (isString) {
@@ -104262,16 +104249,13 @@ getDefaultExportFromCjs(mathRendering);
104262
104249
  div.innerHTML = el;
104263
104250
  executeOn = div;
104264
104251
  }
104265
- var unprocessedMathElements = executeOn.querySelectorAll('[data-latex]:not([data-math-handled="true"])');
104266
- unprocessedMathElements.forEach(createPlaceholder);
104267
- var mathRenderingCallback = function mathRenderingCallback() {
104252
+ var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
104253
+ var renderMathAccessible = function renderMathAccessible() {
104268
104254
  fixMathElements(executeOn);
104269
104255
  adjustMathMLStyle(executeOn);
104270
- if (window.hasOwnProperty('@pie-lib/math-rendering@2')) {
104271
- removePlaceholdersAndRestoreDisplay();
104272
- return mr.renderMath(el);
104273
- }
104274
- if (!window.MathJax && !window.mathjaxLoadedP || window.MathJax && !window.hasOwnProperty('@pie-lib/math-rendering-accessible@1')) {
104256
+ var mathJaxCustomKey = getMathJaxCustomKey();
104257
+ if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
104258
+ renderOpts = renderOpts || defaultOpts();
104275
104259
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
104276
104260
  }
104277
104261
  if (isString && window.MathJax && window.mathjaxLoadedP) {
@@ -104320,9 +104304,36 @@ getDefaultExportFromCjs(mathRendering);
104320
104304
  }
104321
104305
  };
104322
104306
  if (skipWaitForMathRenderingLib) {
104323
- return mathRenderingCallback();
104307
+ return renderMathAccessible();
104324
104308
  } else {
104325
- waitForMathRenderingLib(mathRenderingCallback);
104309
+ if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
104310
+ removePlaceholdersAndRestoreDisplay();
104311
+ return mr.renderMath();
104312
+ }
104313
+ if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
104314
+ return renderMathAccessible();
104315
+ }
104316
+ var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
104317
+ var mathElements = executeOn.querySelectorAll('[data-latex]');
104318
+ mathElements.forEach(createPlaceholder);
104319
+ var checkIntervalId;
104320
+ var maxWaitTime = 500;
104321
+ var startTime = Date.now();
104322
+ var checkForLib = function checkForLib() {
104323
+ var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
104324
+ var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
104325
+ if (mathRenderingHasLoaded || hasExceededMaxWait) {
104326
+ clearInterval(checkIntervalId);
104327
+ if (mathRenderingHasLoaded) {
104328
+ removePlaceholdersAndRestoreDisplay();
104329
+ return mr.renderMath();
104330
+ }
104331
+ renderMathAccessibleCallback();
104332
+ }
104333
+ };
104334
+ checkIntervalId = setInterval(checkForLib, 100);
104335
+ };
104336
+ waitForMathRenderingLib(renderMathAccessible);
104326
104337
  }
104327
104338
  };
104328
104339
  var _default = renderMath;
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.9.1/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.9.3/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.0.0/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -126493,13 +126493,14 @@ getDefaultExportFromCjs(mathRendering);
126493
126493
  };
126494
126494
  var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
126495
126495
  var NEWLINE_LATEX = '\\newline ';
126496
+ var mathRenderingKEY = '@pie-lib/math-rendering@2';
126497
+ var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
126496
126498
  var getGlobal = function getGlobal() {
126497
- var key = '@pie-lib/math-rendering-accessible@1';
126498
126499
  if (typeof window !== 'undefined') {
126499
- if (!window[key]) {
126500
- window[key] = {};
126500
+ if (!window[mathRenderingAccessibleKEY]) {
126501
+ window[mathRenderingAccessibleKEY] = {};
126501
126502
  }
126502
- return window[key];
126503
+ return window[mathRenderingAccessibleKEY];
126503
126504
  } else {
126504
126505
  return {};
126505
126506
  }
@@ -126561,22 +126562,6 @@ getDefaultExportFromCjs(mathRendering);
126561
126562
  placeholder.remove();
126562
126563
  });
126563
126564
  };
126564
- var waitForMathRenderingLib = function waitForMathRenderingLib(callback) {
126565
- if (window.hasOwnProperty('@pie-lib/math-rendering@2')) {
126566
- callback();
126567
- return;
126568
- }
126569
- var checkIntervalId;
126570
- var maxWaitTime = 500;
126571
- var startTime = Date.now();
126572
- var checkForLib = function checkForLib() {
126573
- if (window.hasOwnProperty('@pie-lib/math-rendering@2') || Date.now() - startTime > maxWaitTime) {
126574
- clearInterval(checkIntervalId);
126575
- callback();
126576
- }
126577
- };
126578
- checkIntervalId = setInterval(checkForLib, 100);
126579
- };
126580
126565
  var removeExcessMjxContainers = function removeExcessMjxContainers(content) {
126581
126566
  var elements = content.querySelectorAll('[data-latex][data-math-handled="true"]');
126582
126567
  elements.forEach(function (element) {
@@ -126588,9 +126573,11 @@ getDefaultExportFromCjs(mathRendering);
126588
126573
  }
126589
126574
  });
126590
126575
  };
126576
+ var getMathJaxCustomKey = function getMathJaxCustomKey() {
126577
+ var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
126578
+ return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
126579
+ };
126591
126580
  var renderMath = function renderMath(el, renderOpts) {
126592
- renderOpts = renderOpts || defaultOpts();
126593
- var _renderOpts = renderOpts, skipWaitForMathRenderingLib = _renderOpts.skipWaitForMathRenderingLib;
126594
126581
  var isString = typeof el === 'string';
126595
126582
  var executeOn = document.body;
126596
126583
  if (isString) {
@@ -126598,16 +126585,13 @@ getDefaultExportFromCjs(mathRendering);
126598
126585
  div.innerHTML = el;
126599
126586
  executeOn = div;
126600
126587
  }
126601
- var unprocessedMathElements = executeOn.querySelectorAll('[data-latex]:not([data-math-handled="true"])');
126602
- unprocessedMathElements.forEach(createPlaceholder);
126603
- var mathRenderingCallback = function mathRenderingCallback() {
126588
+ var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
126589
+ var renderMathAccessible = function renderMathAccessible() {
126604
126590
  fixMathElements(executeOn);
126605
126591
  adjustMathMLStyle(executeOn);
126606
- if (window.hasOwnProperty('@pie-lib/math-rendering@2')) {
126607
- removePlaceholdersAndRestoreDisplay();
126608
- return mr.renderMath(el);
126609
- }
126610
- if (!window.MathJax && !window.mathjaxLoadedP || window.MathJax && !window.hasOwnProperty('@pie-lib/math-rendering-accessible@1')) {
126592
+ var mathJaxCustomKey = getMathJaxCustomKey();
126593
+ if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
126594
+ renderOpts = renderOpts || defaultOpts();
126611
126595
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
126612
126596
  }
126613
126597
  if (isString && window.MathJax && window.mathjaxLoadedP) {
@@ -126656,9 +126640,36 @@ getDefaultExportFromCjs(mathRendering);
126656
126640
  }
126657
126641
  };
126658
126642
  if (skipWaitForMathRenderingLib) {
126659
- return mathRenderingCallback();
126643
+ return renderMathAccessible();
126660
126644
  } else {
126661
- waitForMathRenderingLib(mathRenderingCallback);
126645
+ if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
126646
+ removePlaceholdersAndRestoreDisplay();
126647
+ return mr.renderMath();
126648
+ }
126649
+ if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
126650
+ return renderMathAccessible();
126651
+ }
126652
+ var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
126653
+ var mathElements = executeOn.querySelectorAll('[data-latex]');
126654
+ mathElements.forEach(createPlaceholder);
126655
+ var checkIntervalId;
126656
+ var maxWaitTime = 500;
126657
+ var startTime = Date.now();
126658
+ var checkForLib = function checkForLib() {
126659
+ var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
126660
+ var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
126661
+ if (mathRenderingHasLoaded || hasExceededMaxWait) {
126662
+ clearInterval(checkIntervalId);
126663
+ if (mathRenderingHasLoaded) {
126664
+ removePlaceholdersAndRestoreDisplay();
126665
+ return mr.renderMath();
126666
+ }
126667
+ renderMathAccessibleCallback();
126668
+ }
126669
+ };
126670
+ checkIntervalId = setInterval(checkForLib, 100);
126671
+ };
126672
+ waitForMathRenderingLib(renderMathAccessible);
126662
126673
  }
126663
126674
  };
126664
126675
  var _default = renderMath;
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "1.9.1"
7
+ "version": "1.9.3"
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.9.1/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.9.3/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.0.0/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -126493,13 +126493,14 @@ getDefaultExportFromCjs(mathRendering);
126493
126493
  };
126494
126494
  var NEWLINE_BLOCK_REGEX = /\\embed\{newLine\}\[\]/g;
126495
126495
  var NEWLINE_LATEX = '\\newline ';
126496
+ var mathRenderingKEY = '@pie-lib/math-rendering@2';
126497
+ var mathRenderingAccessibleKEY = '@pie-lib/math-rendering-accessible@1';
126496
126498
  var getGlobal = function getGlobal() {
126497
- var key = '@pie-lib/math-rendering-accessible@1';
126498
126499
  if (typeof window !== 'undefined') {
126499
- if (!window[key]) {
126500
- window[key] = {};
126500
+ if (!window[mathRenderingAccessibleKEY]) {
126501
+ window[mathRenderingAccessibleKEY] = {};
126501
126502
  }
126502
- return window[key];
126503
+ return window[mathRenderingAccessibleKEY];
126503
126504
  } else {
126504
126505
  return {};
126505
126506
  }
@@ -126561,22 +126562,6 @@ getDefaultExportFromCjs(mathRendering);
126561
126562
  placeholder.remove();
126562
126563
  });
126563
126564
  };
126564
- var waitForMathRenderingLib = function waitForMathRenderingLib(callback) {
126565
- if (window.hasOwnProperty('@pie-lib/math-rendering@2')) {
126566
- callback();
126567
- return;
126568
- }
126569
- var checkIntervalId;
126570
- var maxWaitTime = 500;
126571
- var startTime = Date.now();
126572
- var checkForLib = function checkForLib() {
126573
- if (window.hasOwnProperty('@pie-lib/math-rendering@2') || Date.now() - startTime > maxWaitTime) {
126574
- clearInterval(checkIntervalId);
126575
- callback();
126576
- }
126577
- };
126578
- checkIntervalId = setInterval(checkForLib, 100);
126579
- };
126580
126565
  var removeExcessMjxContainers = function removeExcessMjxContainers(content) {
126581
126566
  var elements = content.querySelectorAll('[data-latex][data-math-handled="true"]');
126582
126567
  elements.forEach(function (element) {
@@ -126588,9 +126573,11 @@ getDefaultExportFromCjs(mathRendering);
126588
126573
  }
126589
126574
  });
126590
126575
  };
126576
+ var getMathJaxCustomKey = function getMathJaxCustomKey() {
126577
+ var _window, _window$MathJax, _window2, _window2$MathJax, _window2$MathJax$conf;
126578
+ return ((_window = window) === null || _window === void 0 ? void 0 : (_window$MathJax = _window.MathJax) === null || _window$MathJax === void 0 ? void 0 : _window$MathJax.customKey) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$conf = _window2$MathJax.config) === null || _window2$MathJax$conf === void 0 ? void 0 : _window2$MathJax$conf.customKey);
126579
+ };
126591
126580
  var renderMath = function renderMath(el, renderOpts) {
126592
- renderOpts = renderOpts || defaultOpts();
126593
- var _renderOpts = renderOpts, skipWaitForMathRenderingLib = _renderOpts.skipWaitForMathRenderingLib;
126594
126581
  var isString = typeof el === 'string';
126595
126582
  var executeOn = document.body;
126596
126583
  if (isString) {
@@ -126598,16 +126585,13 @@ getDefaultExportFromCjs(mathRendering);
126598
126585
  div.innerHTML = el;
126599
126586
  executeOn = div;
126600
126587
  }
126601
- var unprocessedMathElements = executeOn.querySelectorAll('[data-latex]:not([data-math-handled="true"])');
126602
- unprocessedMathElements.forEach(createPlaceholder);
126603
- var mathRenderingCallback = function mathRenderingCallback() {
126588
+ var _ref = renderOpts || ({}), skipWaitForMathRenderingLib = _ref.skipWaitForMathRenderingLib;
126589
+ var renderMathAccessible = function renderMathAccessible() {
126604
126590
  fixMathElements(executeOn);
126605
126591
  adjustMathMLStyle(executeOn);
126606
- if (window.hasOwnProperty('@pie-lib/math-rendering@2')) {
126607
- removePlaceholdersAndRestoreDisplay();
126608
- return mr.renderMath(el);
126609
- }
126610
- if (!window.MathJax && !window.mathjaxLoadedP || window.MathJax && !window.hasOwnProperty('@pie-lib/math-rendering-accessible@1')) {
126592
+ var mathJaxCustomKey = getMathJaxCustomKey();
126593
+ if (!window.MathJax && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
126594
+ renderOpts = renderOpts || defaultOpts();
126611
126595
  (0, _mathjaxScript.initializeMathJax)(renderOpts);
126612
126596
  }
126613
126597
  if (isString && window.MathJax && window.mathjaxLoadedP) {
@@ -126656,9 +126640,36 @@ getDefaultExportFromCjs(mathRendering);
126656
126640
  }
126657
126641
  };
126658
126642
  if (skipWaitForMathRenderingLib) {
126659
- return mathRenderingCallback();
126643
+ return renderMathAccessible();
126660
126644
  } else {
126661
- waitForMathRenderingLib(mathRenderingCallback);
126645
+ if (window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance) {
126646
+ removePlaceholdersAndRestoreDisplay();
126647
+ return mr.renderMath();
126648
+ }
126649
+ if (window.hasOwnProperty(mathRenderingAccessibleKEY) && window[mathRenderingAccessibleKEY].instance) {
126650
+ return renderMathAccessible();
126651
+ }
126652
+ var waitForMathRenderingLib = function waitForMathRenderingLib(renderMathAccessibleCallback) {
126653
+ var mathElements = executeOn.querySelectorAll('[data-latex]');
126654
+ mathElements.forEach(createPlaceholder);
126655
+ var checkIntervalId;
126656
+ var maxWaitTime = 500;
126657
+ var startTime = Date.now();
126658
+ var checkForLib = function checkForLib() {
126659
+ var mathRenderingHasLoaded = window.hasOwnProperty(mathRenderingKEY) && window[mathRenderingKEY].instance;
126660
+ var hasExceededMaxWait = Date.now() - startTime > maxWaitTime;
126661
+ if (mathRenderingHasLoaded || hasExceededMaxWait) {
126662
+ clearInterval(checkIntervalId);
126663
+ if (mathRenderingHasLoaded) {
126664
+ removePlaceholdersAndRestoreDisplay();
126665
+ return mr.renderMath();
126666
+ }
126667
+ renderMathAccessibleCallback();
126668
+ }
126669
+ };
126670
+ checkIntervalId = setInterval(checkForLib, 100);
126671
+ };
126672
+ waitForMathRenderingLib(renderMathAccessible);
126662
126673
  }
126663
126674
  };
126664
126675
  var _default = renderMath;
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.10.1-next.6+712de008e",
4
+ "version": "2.10.1",
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.10.1-next.6+712de008e",
11
- "@pie-element/rubric": "^3.10.1-next.6+712de008e",
10
+ "@pie-element/multi-trait-rubric": "^3.10.1",
11
+ "@pie-element/rubric": "^3.10.1",
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": "712de008e29dbe1c40f559a76f87cea8b5d1dd07",
18
+ "gitHead": "528b92201b3f7f917007273d8584d7efccce6364",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },