@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.61
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fixes
8
+
3
9
  ## 0.3.60
4
10
 
5
11
  ### Patch Changes
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: "100vh",
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: "100vh",
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/react",
3
- "version": "0.3.60",
3
+ "version": "0.3.61",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {