Skip to content

Commit

Permalink
Fix iframe resizing (#180)
Browse files Browse the repository at this point in the history
* Upgrade iframe packages

* Upgrade iframe packages
  • Loading branch information
jonerickson authored Sep 18, 2024
1 parent 5768813 commit 07bcc4a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 70 deletions.
79 changes: 15 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"next-themes": "^0.3.0",
"react": "^18.3.1",
"react-data-table-component": "^7.6.2",
"react-dom": "^18.2.0",
"react-dom": "^18.3.1",
"react-hook-form": "^7.51.3",
"react-router-dom": "^6.22.0",
"react-syntax-highlighter": "^15.5.0",
Expand All @@ -30,6 +30,7 @@
"devDependencies": {
"@headlessui/react": "^1.7.13",
"@heroicons/react": "^2.1.1",
"@iframe-resizer/child": "^5.3.1",
"@next/bundle-analyzer": "^14.1.0",
"@parcel/compressor-brotli": "^2.12.0",
"@parcel/compressor-gzip": "^2.12.0",
Expand All @@ -50,7 +51,6 @@
"eslint-plugin-react-hooks": "^4.6.0",
"flowbite": "^2.3.0",
"flowbite-react": "^0.7",
"iframe-resizer": "5.2.6",
"iron-session": "^8.0.1",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
Expand Down
5 changes: 2 additions & 3 deletions src/app/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ class Widget {
setupIframeResizer = () => {
if (document.getElementById(IFRAME_ID)) {
const iframeResizerScript = document.createElement('script');
iframeResizerScript.src =
'https://cdn.jsdelivr.net/npm/iframe-resizer@4.3.6/js/iframeResizer.min.js';
iframeResizerScript.src = 'https://cdn.jsdelivr.net/npm/@iframe-resizer/parent';
iframeResizerScript.type = 'text/javascript';
iframeResizerScript.onload = () => {
window.iFrameResize({ log: false }, `#${IFRAME_ID}`);
window.iframeResize({ log: false, license: 'GPLv3' }, `#${IFRAME_ID}`);
};

document.body.appendChild(iframeResizerScript);
Expand Down
2 changes: 1 addition & 1 deletion src/providers/iframe.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import 'iframe-resizer/js/iframeResizer.contentWindow.min';
import '@iframe-resizer/child';

export function IframeResizerProvider() {
return <></>;
Expand Down

0 comments on commit 07bcc4a

Please sign in to comment.