@iframe-resizer/react 5.2.6 → 5.3.0-beta.1

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.1 2024-09-01 - 14:00:49.991Z_
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.1 (cjs) - 2024-09-01
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,17 +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.`);
62
+ if (!iframeRef.current)
63
+ // eslint-disable-next-line no-console
64
+ console.warn(`[iframe-resizer/react][${iframeRef?.current?.id}] Close event ignored, to remove the iframe update your React component.`);
64
65
  return !iframeRef.current; // Allow React to close this
65
66
  };
66
67
 
@@ -84,9 +85,9 @@ function IframeResizer(props) {
84
85
  iframeRef.current.iframeResizer.sendMessage(message, targetOrigin);
85
86
  }
86
87
  }));
87
- return /*#__PURE__*/React.createElement("iframe", _extends({
88
- title: title
89
- }, filteredProps, {
88
+
89
+ // eslint-disable-next-line jsx-a11y/iframe-has-title
90
+ return /*#__PURE__*/React.createElement("iframe", _extends({}, filteredProps, {
90
91
  ref: iframeRef
91
92
  }));
92
93
  }
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.1 (esm) - 2024-09-01
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,17 +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.`);
60
+ if (!iframeRef.current)
61
+ // eslint-disable-next-line no-console
62
+ console.warn(`[iframe-resizer/react][${iframeRef?.current?.id}] Close event ignored, to remove the iframe update your React component.`);
62
63
  return !iframeRef.current; // Allow React to close this
63
64
  };
64
65
 
@@ -82,9 +83,9 @@ function IframeResizer(props) {
82
83
  iframeRef.current.iframeResizer.sendMessage(message, targetOrigin);
83
84
  }
84
85
  }));
85
- return /*#__PURE__*/React.createElement("iframe", _extends({
86
- title: title
87
- }, filteredProps, {
86
+
87
+ // eslint-disable-next-line jsx-a11y/iframe-has-title
88
+ return /*#__PURE__*/React.createElement("iframe", _extends({}, filteredProps, {
88
89
  ref: iframeRef
89
90
  }));
90
91
  }
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.1",
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.1"
49
48
  }
50
49
  }