@betterstore/react 0.3.60 → 0.3.61
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 +6 -0
- package/dist/index.cjs.js +13 -2
- package/dist/index.mjs +13 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -540,6 +540,17 @@ const IframeWrapper = ({ children, iframeRef, wrapperRef, }) => {
|
|
|
540
540
|
iframeDoc.head.appendChild(style);
|
|
541
541
|
styleRef.current = style;
|
|
542
542
|
setIframeBody(iframeDoc.body);
|
|
543
|
+
// Set up ResizeObserver to adjust iframe height
|
|
544
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
545
|
+
for (const entry of entries) {
|
|
546
|
+
const height = entry.contentRect.height;
|
|
547
|
+
iframe.style.height = `${height}px`;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
resizeObserver.observe(iframeDoc.body);
|
|
551
|
+
return () => {
|
|
552
|
+
resizeObserver.disconnect();
|
|
553
|
+
};
|
|
543
554
|
};
|
|
544
555
|
// For first load
|
|
545
556
|
if (iframeDoc.readyState === "complete")
|
|
@@ -564,12 +575,12 @@ const IframeWrapper = ({ children, iframeRef, wrapperRef, }) => {
|
|
|
564
575
|
overflowX: "hidden",
|
|
565
576
|
marginInline: "auto",
|
|
566
577
|
scrollbarWidth: "none",
|
|
578
|
+
overflowY: "auto",
|
|
567
579
|
}, ref: wrapperRef },
|
|
568
580
|
React.createElement("iframe", { ref: iframeRef, style: {
|
|
569
581
|
width: "100%",
|
|
570
|
-
height: "100%",
|
|
571
582
|
border: "none",
|
|
572
|
-
minHeight: "
|
|
583
|
+
minHeight: "100%",
|
|
573
584
|
}, sandbox: "allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-top-navigation" }),
|
|
574
585
|
iframeBody && ReactDOM.createPortal(children, iframeBody)));
|
|
575
586
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -517,6 +517,17 @@ const IframeWrapper = ({ children, iframeRef, wrapperRef, }) => {
|
|
|
517
517
|
iframeDoc.head.appendChild(style);
|
|
518
518
|
styleRef.current = style;
|
|
519
519
|
setIframeBody(iframeDoc.body);
|
|
520
|
+
// Set up ResizeObserver to adjust iframe height
|
|
521
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
522
|
+
for (const entry of entries) {
|
|
523
|
+
const height = entry.contentRect.height;
|
|
524
|
+
iframe.style.height = `${height}px`;
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
resizeObserver.observe(iframeDoc.body);
|
|
528
|
+
return () => {
|
|
529
|
+
resizeObserver.disconnect();
|
|
530
|
+
};
|
|
520
531
|
};
|
|
521
532
|
// For first load
|
|
522
533
|
if (iframeDoc.readyState === "complete")
|
|
@@ -541,12 +552,12 @@ const IframeWrapper = ({ children, iframeRef, wrapperRef, }) => {
|
|
|
541
552
|
overflowX: "hidden",
|
|
542
553
|
marginInline: "auto",
|
|
543
554
|
scrollbarWidth: "none",
|
|
555
|
+
overflowY: "auto",
|
|
544
556
|
}, ref: wrapperRef },
|
|
545
557
|
React__default.createElement("iframe", { ref: iframeRef, style: {
|
|
546
558
|
width: "100%",
|
|
547
|
-
height: "100%",
|
|
548
559
|
border: "none",
|
|
549
|
-
minHeight: "
|
|
560
|
+
minHeight: "100%",
|
|
550
561
|
}, sandbox: "allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-top-navigation" }),
|
|
551
562
|
iframeBody && ReactDOM.createPortal(children, iframeBody)));
|
|
552
563
|
};
|