@doenet/doenetml-iframe 0.7.0-alpha11 → 0.7.0-alpha13
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/index.js +10 -10
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5,11 +5,9 @@ import React from "react";
|
|
|
5
5
|
function watchForResize(ref, getHeight, setHeight) {
|
|
6
6
|
var _a, _b, _c, _d;
|
|
7
7
|
const iframe = (_d = (_c = (_b = (_a = ref.current) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document) == null ? void 0 : _c.body) == null ? void 0 : _d.parentElement;
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
};
|
|
8
|
+
if (iframe) {
|
|
9
|
+
setHeight(iframe.scrollHeight + "px");
|
|
11
10
|
}
|
|
12
|
-
setHeight(iframe.scrollHeight + "px");
|
|
13
11
|
const updateHeight = () => {
|
|
14
12
|
var _a2, _b2, _c2, _d2;
|
|
15
13
|
const iframe2 = (_d2 = (_c2 = (_b2 = (_a2 = ref.current) == null ? void 0 : _a2.contentWindow) == null ? void 0 : _b2.document) == null ? void 0 : _c2.body) == null ? void 0 : _d2.parentElement;
|
|
@@ -22,11 +20,13 @@ function watchForResize(ref, getHeight, setHeight) {
|
|
|
22
20
|
}
|
|
23
21
|
};
|
|
24
22
|
const observer = new MutationObserver(updateHeight);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
if (iframe) {
|
|
24
|
+
observer.observe(iframe, {
|
|
25
|
+
attributes: true,
|
|
26
|
+
childList: true,
|
|
27
|
+
subtree: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
30
|
const interval = setInterval(updateHeight, 200);
|
|
31
31
|
return () => {
|
|
32
32
|
observer.disconnect();
|
|
@@ -41196,7 +41196,7 @@ function detectVersionFromDoenetML(doenetML) {
|
|
|
41196
41196
|
}
|
|
41197
41197
|
return {};
|
|
41198
41198
|
}
|
|
41199
|
-
const version = "0.7.0-
|
|
41199
|
+
const version = "0.7.0-alpha13";
|
|
41200
41200
|
const latestDoenetmlVersion = version;
|
|
41201
41201
|
function DoenetViewer({
|
|
41202
41202
|
doenetML,
|