@instructure/quiz-core 17.50.2-rc.1 → 17.50.2-rc.2

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.
@@ -1,3 +1,4 @@
1
+ import { MathquillModal } from '@instructure/quiz-rce';
1
2
  export var printWithCss = function printWithCss(cssClass) {
2
3
  var timeout = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
3
4
  var rootElement = document.querySelector('html');
@@ -28,19 +29,25 @@ var setTimeoutPromise = function setTimeoutPromise(delay) {
28
29
  };
29
30
 
30
31
  var checkIfThereAreAnyUnrenderedLatexEquations = function checkIfThereAreAnyUnrenderedLatexEquations() {
31
- return document.querySelectorAll('.equation_image').length === 0;
32
+ return document.body.textContent.search(MathquillModal.boundaryRegex) === -1;
32
33
  };
33
34
 
34
35
  export var ensureAllMathEquationsAreRendered = function ensureAllMathEquationsAreRendered() {
35
36
  return new Promise(function (resolve) {
36
37
  if (checkIfThereAreAnyUnrenderedLatexEquations()) {
37
38
  return resolve();
38
- }
39
+ } // Failsafe if there is matching regexp on page that is not mathjax equation
40
+
39
41
 
42
+ var failsafeTimeout = setTimeout(function () {
43
+ observer.disconnect();
44
+ resolve();
45
+ }, 10000);
40
46
  var observer = new MutationObserver(function () {
41
47
  if (checkIfThereAreAnyUnrenderedLatexEquations()) {
42
48
  resolve();
43
49
  observer.disconnect();
50
+ clearTimeout(failsafeTimeout);
44
51
  }
45
52
  });
46
53
  observer.observe(document.body, {
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ensureImagesLoaded = exports.ensureAllMathEquationsAreRendered = exports.printWithCss = void 0;
7
7
 
8
+ var _quizRce = require("@instructure/quiz-rce");
9
+
8
10
  var printWithCss = function printWithCss(cssClass) {
9
11
  var timeout = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
10
12
  var rootElement = document.querySelector('html');
@@ -37,19 +39,25 @@ var setTimeoutPromise = function setTimeoutPromise(delay) {
37
39
  };
38
40
 
39
41
  var checkIfThereAreAnyUnrenderedLatexEquations = function checkIfThereAreAnyUnrenderedLatexEquations() {
40
- return document.querySelectorAll('.equation_image').length === 0;
42
+ return document.body.textContent.search(_quizRce.MathquillModal.boundaryRegex) === -1;
41
43
  };
42
44
 
43
45
  var ensureAllMathEquationsAreRendered = function ensureAllMathEquationsAreRendered() {
44
46
  return new Promise(function (resolve) {
45
47
  if (checkIfThereAreAnyUnrenderedLatexEquations()) {
46
48
  return resolve();
47
- }
49
+ } // Failsafe if there is matching regexp on page that is not mathjax equation
50
+
48
51
 
52
+ var failsafeTimeout = setTimeout(function () {
53
+ observer.disconnect();
54
+ resolve();
55
+ }, 10000);
49
56
  var observer = new MutationObserver(function () {
50
57
  if (checkIfThereAreAnyUnrenderedLatexEquations()) {
51
58
  resolve();
52
59
  observer.disconnect();
60
+ clearTimeout(failsafeTimeout);
53
61
  }
54
62
  });
55
63
  observer.observe(document.body, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.50.2-rc.1+61f4ca70c",
3
+ "version": "17.50.2-rc.2+d049180db",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -41,11 +41,11 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@instructure/outcomes-ui": "^2.1.2",
44
- "@instructure/quiz-common": "17.50.2-rc.1+61f4ca70c",
45
- "@instructure/quiz-i18n": "17.50.2-rc.1+61f4ca70c",
46
- "@instructure/quiz-interactions": "17.50.2-rc.1+61f4ca70c",
47
- "@instructure/quiz-number-input": "17.50.2-rc.1+61f4ca70c",
48
- "@instructure/quiz-rce": "17.50.2-rc.1+61f4ca70c",
44
+ "@instructure/quiz-common": "17.50.2-rc.2+d049180db",
45
+ "@instructure/quiz-i18n": "17.50.2-rc.2+d049180db",
46
+ "@instructure/quiz-interactions": "17.50.2-rc.2+d049180db",
47
+ "@instructure/quiz-number-input": "17.50.2-rc.2+d049180db",
48
+ "@instructure/quiz-rce": "17.50.2-rc.2+d049180db",
49
49
  "@instructure/ui-a11y-content": "^7.20.0",
50
50
  "@instructure/ui-alerts": "^7.20.0",
51
51
  "@instructure/ui-avatar": "^7.20.0",
@@ -106,7 +106,7 @@
106
106
  "eventemitter3": "^3.1.0",
107
107
  "humps": "^2.0.0",
108
108
  "immutable": "^3.8.1",
109
- "instructure-validations": "17.50.2-rc.1+61f4ca70c",
109
+ "instructure-validations": "17.50.2-rc.2+d049180db",
110
110
  "ipaddr.js": "^1.5.4",
111
111
  "isomorphic-fetch": "^2.2.0",
112
112
  "isuuid": "^0.1.0",
@@ -156,7 +156,7 @@
156
156
  "intl": "^1.2.4",
157
157
  "jquery": "^2.2.3",
158
158
  "most-subject": "^5.3.0",
159
- "quiz-presets": "17.50.2-rc.1+61f4ca70c",
159
+ "quiz-presets": "17.50.2-rc.2+d049180db",
160
160
  "react": "^16.8.6",
161
161
  "react-addons-test-utils": "^15.6.2",
162
162
  "react-dom": "^16.8.6",
@@ -172,5 +172,5 @@
172
172
  "publishConfig": {
173
173
  "access": "public"
174
174
  },
175
- "gitHead": "61f4ca70cb17108d806d1f4b318fa18f3159b615"
175
+ "gitHead": "d049180db6fd8dcffe1ae4f30fa80bda64ae0dd4"
176
176
  }