@pie-element/complex-rubric 3.0.1-next.3 → 3.0.1-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "dependencies": {
10
- "@pie-lib/pie-toolbox": "2.0.6",
10
+ "@pie-lib/pie-toolbox": "2.0.8",
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@2.0.4/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@2.0.6/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@5.0.3/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@5.0.5/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) {
@@ -49087,6 +49087,29 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
49087
49087
  return node.setAttribute("displaystyle", "true");
49088
49088
  });
49089
49089
  };
49090
+ var createPlaceholder = function createPlaceholder(element) {
49091
+ var _element$previousSibl;
49092
+ if (!element.previousSibling || !((_element$previousSibl = element.previousSibling.classList) !== null && _element$previousSibl !== void 0 && _element$previousSibl.contains("math-placeholder"))) {
49093
+ var _element$parentNode;
49094
+ element.dataset.originalDisplay = element.style.display || "";
49095
+ element.style.display = "none";
49096
+ var placeholder = document.createElement("span");
49097
+ placeholder.style.cssText = "height: 10px; width: 50px; display: inline-block; vertical-align: middle; justify-content: center; background: #fafafa; border-radius: 4px;";
49098
+ placeholder.classList.add("math-placeholder");
49099
+ (_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 ? void 0 : _element$parentNode.insertBefore(placeholder, element);
49100
+ }
49101
+ };
49102
+ var removePlaceholdersAndRestoreDisplay = function removePlaceholdersAndRestoreDisplay() {
49103
+ document.querySelectorAll(".math-placeholder").forEach(function (placeholder) {
49104
+ var _targetElement$datase;
49105
+ var targetElement = placeholder.nextElementSibling;
49106
+ if (targetElement && ((_targetElement$datase = targetElement.dataset) === null || _targetElement$datase === void 0 ? void 0 : _targetElement$datase.originalDisplay) !== undefined) {
49107
+ targetElement.style.display = targetElement.dataset.originalDisplay;
49108
+ delete targetElement.dataset.originalDisplay;
49109
+ }
49110
+ placeholder.remove();
49111
+ });
49112
+ };
49090
49113
  var removeExcessMjxContainers = function removeExcessMjxContainers(content) {
49091
49114
  var elements = content.querySelectorAll("[data-latex][data-math-handled=\"true\"]");
49092
49115
  elements.forEach(function (element) {
@@ -49100,6 +49123,7 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
49100
49123
  };
49101
49124
  var renderContentWithMathJax = function renderContentWithMathJax(executeOn) {
49102
49125
  executeOn = executeOn || document.body;
49126
+ if (!(executeOn instanceof HTMLElement)) return;
49103
49127
  fixMathElements(executeOn);
49104
49128
  adjustMathMLStyle(executeOn);
49105
49129
  var mathJaxInstance = getGlobal().instance;
@@ -49108,6 +49132,7 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
49108
49132
  mathJaxInstance.typesetClear();
49109
49133
  mathJaxInstance.typesetPromise([executeOn]).then(function () {
49110
49134
  try {
49135
+ removePlaceholdersAndRestoreDisplay();
49111
49136
  removeExcessMjxContainers(executeOn);
49112
49137
  var updatedDocument = mathJaxInstance.startup.document;
49113
49138
  var list = updatedDocument.math.list;
@@ -49194,6 +49219,13 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
49194
49219
  script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
49195
49220
  script.async = true;
49196
49221
  document.head.appendChild(script);
49222
+ setTimeout(function () {
49223
+ if (!window.mathjaxLoadedComplete) {
49224
+ var _document, _document$body;
49225
+ var mathElements = (_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : _document$body.querySelectorAll("[data-latex]");
49226
+ (mathElements || []).forEach(createPlaceholder);
49227
+ }
49228
+ });
49197
49229
  });
49198
49230
  };
49199
49231
  exports.initializeMathJax = initializeMathJax;
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@2.0.4/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.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@2.0.6/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.5/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) {
@@ -72367,6 +72367,29 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
72367
72367
  return node.setAttribute("displaystyle", "true");
72368
72368
  });
72369
72369
  };
72370
+ var createPlaceholder = function createPlaceholder(element) {
72371
+ var _element$previousSibl;
72372
+ if (!element.previousSibling || !((_element$previousSibl = element.previousSibling.classList) !== null && _element$previousSibl !== void 0 && _element$previousSibl.contains("math-placeholder"))) {
72373
+ var _element$parentNode;
72374
+ element.dataset.originalDisplay = element.style.display || "";
72375
+ element.style.display = "none";
72376
+ var placeholder = document.createElement("span");
72377
+ placeholder.style.cssText = "height: 10px; width: 50px; display: inline-block; vertical-align: middle; justify-content: center; background: #fafafa; border-radius: 4px;";
72378
+ placeholder.classList.add("math-placeholder");
72379
+ (_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 ? void 0 : _element$parentNode.insertBefore(placeholder, element);
72380
+ }
72381
+ };
72382
+ var removePlaceholdersAndRestoreDisplay = function removePlaceholdersAndRestoreDisplay() {
72383
+ document.querySelectorAll(".math-placeholder").forEach(function (placeholder) {
72384
+ var _targetElement$datase;
72385
+ var targetElement = placeholder.nextElementSibling;
72386
+ if (targetElement && ((_targetElement$datase = targetElement.dataset) === null || _targetElement$datase === void 0 ? void 0 : _targetElement$datase.originalDisplay) !== undefined) {
72387
+ targetElement.style.display = targetElement.dataset.originalDisplay;
72388
+ delete targetElement.dataset.originalDisplay;
72389
+ }
72390
+ placeholder.remove();
72391
+ });
72392
+ };
72370
72393
  var removeExcessMjxContainers = function removeExcessMjxContainers(content) {
72371
72394
  var elements = content.querySelectorAll("[data-latex][data-math-handled=\"true\"]");
72372
72395
  elements.forEach(function (element) {
@@ -72380,6 +72403,7 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
72380
72403
  };
72381
72404
  var renderContentWithMathJax = function renderContentWithMathJax(executeOn) {
72382
72405
  executeOn = executeOn || document.body;
72406
+ if (!(executeOn instanceof HTMLElement)) return;
72383
72407
  fixMathElements(executeOn);
72384
72408
  adjustMathMLStyle(executeOn);
72385
72409
  var mathJaxInstance = getGlobal().instance;
@@ -72388,6 +72412,7 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
72388
72412
  mathJaxInstance.typesetClear();
72389
72413
  mathJaxInstance.typesetPromise([executeOn]).then(function () {
72390
72414
  try {
72415
+ removePlaceholdersAndRestoreDisplay();
72391
72416
  removeExcessMjxContainers(executeOn);
72392
72417
  var updatedDocument = mathJaxInstance.startup.document;
72393
72418
  var list = updatedDocument.math.list;
@@ -72474,6 +72499,13 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
72474
72499
  script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
72475
72500
  script.async = true;
72476
72501
  document.head.appendChild(script);
72502
+ setTimeout(function () {
72503
+ if (!window.mathjaxLoadedComplete) {
72504
+ var _document, _document$body;
72505
+ var mathElements = (_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : _document$body.querySelectorAll("[data-latex]");
72506
+ (mathElements || []).forEach(createPlaceholder);
72507
+ }
72508
+ });
72477
72509
  });
72478
72510
  };
72479
72511
  exports.initializeMathJax = initializeMathJax;
@@ -4,11 +4,11 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "2.0.4"
7
+ "version": "2.0.6"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
11
- "version": "5.0.3"
11
+ "version": "5.0.5"
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@2.0.4/module/index.js";
2
- import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.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@2.0.6/module/index.js";
2
+ import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.5/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) {
@@ -72367,6 +72367,29 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
72367
72367
  return node.setAttribute("displaystyle", "true");
72368
72368
  });
72369
72369
  };
72370
+ var createPlaceholder = function createPlaceholder(element) {
72371
+ var _element$previousSibl;
72372
+ if (!element.previousSibling || !((_element$previousSibl = element.previousSibling.classList) !== null && _element$previousSibl !== void 0 && _element$previousSibl.contains("math-placeholder"))) {
72373
+ var _element$parentNode;
72374
+ element.dataset.originalDisplay = element.style.display || "";
72375
+ element.style.display = "none";
72376
+ var placeholder = document.createElement("span");
72377
+ placeholder.style.cssText = "height: 10px; width: 50px; display: inline-block; vertical-align: middle; justify-content: center; background: #fafafa; border-radius: 4px;";
72378
+ placeholder.classList.add("math-placeholder");
72379
+ (_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 ? void 0 : _element$parentNode.insertBefore(placeholder, element);
72380
+ }
72381
+ };
72382
+ var removePlaceholdersAndRestoreDisplay = function removePlaceholdersAndRestoreDisplay() {
72383
+ document.querySelectorAll(".math-placeholder").forEach(function (placeholder) {
72384
+ var _targetElement$datase;
72385
+ var targetElement = placeholder.nextElementSibling;
72386
+ if (targetElement && ((_targetElement$datase = targetElement.dataset) === null || _targetElement$datase === void 0 ? void 0 : _targetElement$datase.originalDisplay) !== undefined) {
72387
+ targetElement.style.display = targetElement.dataset.originalDisplay;
72388
+ delete targetElement.dataset.originalDisplay;
72389
+ }
72390
+ placeholder.remove();
72391
+ });
72392
+ };
72370
72393
  var removeExcessMjxContainers = function removeExcessMjxContainers(content) {
72371
72394
  var elements = content.querySelectorAll("[data-latex][data-math-handled=\"true\"]");
72372
72395
  elements.forEach(function (element) {
@@ -72380,6 +72403,7 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
72380
72403
  };
72381
72404
  var renderContentWithMathJax = function renderContentWithMathJax(executeOn) {
72382
72405
  executeOn = executeOn || document.body;
72406
+ if (!(executeOn instanceof HTMLElement)) return;
72383
72407
  fixMathElements(executeOn);
72384
72408
  adjustMathMLStyle(executeOn);
72385
72409
  var mathJaxInstance = getGlobal().instance;
@@ -72388,6 +72412,7 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
72388
72412
  mathJaxInstance.typesetClear();
72389
72413
  mathJaxInstance.typesetPromise([executeOn]).then(function () {
72390
72414
  try {
72415
+ removePlaceholdersAndRestoreDisplay();
72391
72416
  removeExcessMjxContainers(executeOn);
72392
72417
  var updatedDocument = mathJaxInstance.startup.document;
72393
72418
  var list = updatedDocument.math.list;
@@ -72474,6 +72499,13 @@ getDefaultExportFromCjs(SerializedMmlVisitor);
72474
72499
  script.src = ("https://cdn.jsdelivr.net/npm/mathjax@").concat(MathJaxVersion, "/es5/tex-chtml-full.js");
72475
72500
  script.async = true;
72476
72501
  document.head.appendChild(script);
72502
+ setTimeout(function () {
72503
+ if (!window.mathjaxLoadedComplete) {
72504
+ var _document, _document$body;
72505
+ var mathElements = (_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : _document$body.querySelectorAll("[data-latex]");
72506
+ (mathElements || []).forEach(createPlaceholder);
72507
+ }
72508
+ });
72477
72509
  });
72478
72510
  };
72479
72511
  exports.initializeMathJax = initializeMathJax;
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": "3.0.1-next.3+321147b40",
4
+ "version": "3.0.1-next.5+c363be48f",
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": "^4.0.1-next.3+321147b40",
11
- "@pie-element/rubric": "^4.0.1-next.3+321147b40",
10
+ "@pie-element/multi-trait-rubric": "^4.0.1-next.5+c363be48f",
11
+ "@pie-element/rubric": "^4.0.1-next.5+c363be48f",
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": "321147b4072f2a6200d155f7f09c712960fe078c",
18
+ "gitHead": "c363be48f9428024d4acc1eed05cd598840ffe3a",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },