@iframe-resizer/react 5.2.6 → 5.3.0-beta.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.
package/README.md CHANGED
@@ -22,4 +22,4 @@ yarn add @iframe-resizer/react
22
22
 
23
23
  ---
24
24
 
25
- _iframe-resizer version 5.2.6 2024-08-22 - 18:01:31.031Z_
25
+ _iframe-resizer version 5.3.0-beta.2 2024-09-03 - 18:55:18.269Z_
package/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/react 5.2.6 (cjs) - 2024-08-22
4
+ * @module iframe-resizer/react 5.3.0-beta.2 (cjs) - 2024-09-03
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -22,7 +22,6 @@
22
22
  const _extends = require('@babel/runtime/helpers/extends');
23
23
  const connectResizer = require('@iframe-resizer/core');
24
24
  const React = require('react');
25
- const warning = require('warning');
26
25
 
27
26
  const filterIframeAttribs = props => {
28
27
  const {
@@ -50,18 +49,19 @@ const filterIframeAttribs = props => {
50
49
  return iframeProps;
51
50
  };
52
51
 
52
+ // TODO: Add support for React.forwardRef() in next major version (Breaking change)
53
53
  function IframeResizer(props) {
54
54
  // eslint-disable-next-line react/prop-types
55
55
  const {
56
- title,
57
56
  forwardRef,
58
57
  ...rest
59
58
  } = props;
60
59
  const filteredProps = filterIframeAttribs(rest);
61
60
  const iframeRef = React.useRef(null);
62
61
  const onClose = () => {
63
- warning(!iframeRef.current, `[iframe-resizer/react][${iframeRef?.current?.id}] Close event ignored, to remove the iframe update your React component.`);
64
- return !iframeRef.current; // Allow React to close this
62
+ // eslint-disable-next-line no-console
63
+ console.warn(`[iframe-resizer/react][${iframeRef?.current?.id}] Close event ignored, to remove the iframe update your React component.`);
64
+ return false;
65
65
  };
66
66
 
67
67
  // This hook is only run once, as once iframe-resizer is bound, it will
@@ -84,9 +84,9 @@ function IframeResizer(props) {
84
84
  iframeRef.current.iframeResizer.sendMessage(message, targetOrigin);
85
85
  }
86
86
  }));
87
- return /*#__PURE__*/React.createElement("iframe", _extends({
88
- title: title
89
- }, filteredProps, {
87
+
88
+ // eslint-disable-next-line jsx-a11y/iframe-has-title
89
+ return /*#__PURE__*/React.createElement("iframe", _extends({}, filteredProps, {
90
90
  ref: iframeRef
91
91
  }));
92
92
  }
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * @preserve
3
3
  *
4
- * @module iframe-resizer/react 5.2.6 (esm) - 2024-08-22
4
+ * @module iframe-resizer/react 5.3.0-beta.2 (esm) - 2024-09-03
5
5
  *
6
6
  * @license GPL-3.0 for non-commercial use only.
7
7
  * For commercial use, you must purchase a license from
@@ -20,7 +20,6 @@
20
20
  import _extends from '@babel/runtime/helpers/extends';
21
21
  import connectResizer from '@iframe-resizer/core';
22
22
  import React, { useRef, useEffect, useImperativeHandle } from 'react';
23
- import warning from 'warning';
24
23
 
25
24
  const filterIframeAttribs = props => {
26
25
  const {
@@ -48,18 +47,19 @@ const filterIframeAttribs = props => {
48
47
  return iframeProps;
49
48
  };
50
49
 
50
+ // TODO: Add support for React.forwardRef() in next major version (Breaking change)
51
51
  function IframeResizer(props) {
52
52
  // eslint-disable-next-line react/prop-types
53
53
  const {
54
- title,
55
54
  forwardRef,
56
55
  ...rest
57
56
  } = props;
58
57
  const filteredProps = filterIframeAttribs(rest);
59
58
  const iframeRef = useRef(null);
60
59
  const onClose = () => {
61
- warning(!iframeRef.current, `[iframe-resizer/react][${iframeRef?.current?.id}] Close event ignored, to remove the iframe update your React component.`);
62
- return !iframeRef.current; // Allow React to close this
60
+ // eslint-disable-next-line no-console
61
+ console.warn(`[iframe-resizer/react][${iframeRef?.current?.id}] Close event ignored, to remove the iframe update your React component.`);
62
+ return false;
63
63
  };
64
64
 
65
65
  // This hook is only run once, as once iframe-resizer is bound, it will
@@ -82,9 +82,9 @@ function IframeResizer(props) {
82
82
  iframeRef.current.iframeResizer.sendMessage(message, targetOrigin);
83
83
  }
84
84
  }));
85
- return /*#__PURE__*/React.createElement("iframe", _extends({
86
- title: title
87
- }, filteredProps, {
85
+
86
+ // eslint-disable-next-line jsx-a11y/iframe-has-title
87
+ return /*#__PURE__*/React.createElement("iframe", _extends({}, filteredProps, {
88
88
  ref: iframeRef
89
89
  }));
90
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/react",
3
- "version": "5.2.6",
3
+ "version": "5.3.0-beta.2",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -43,8 +43,7 @@
43
43
  "react"
44
44
  ],
45
45
  "dependencies": {
46
- "@babel/runtime": "^7.25.4",
47
- "@iframe-resizer/core": "5.2.6",
48
- "warning": "^4.0.3"
46
+ "@babel/runtime": "^7.25.6",
47
+ "@iframe-resizer/core": "5.3.0-beta.2"
49
48
  }
50
49
  }