Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
51 lines
1.1 KiB
Plaintext
51 lines
1.1 KiB
Plaintext
'use client';
|
|
|
|
import { c as _c } from "react/compiler-runtime";
|
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
import React from 'react';
|
|
import { useLivePreviewContext } from '../../../providers/LivePreview/context.js';
|
|
import './index.scss';
|
|
const baseClass = 'live-preview-iframe';
|
|
export const IFrame = () => {
|
|
const $ = _c(8);
|
|
const {
|
|
iframeRef,
|
|
setLoadedURL,
|
|
url,
|
|
zoom
|
|
} = useLivePreviewContext();
|
|
let t0;
|
|
if ($[0] !== setLoadedURL || $[1] !== url) {
|
|
t0 = () => {
|
|
setLoadedURL(url);
|
|
};
|
|
$[0] = setLoadedURL;
|
|
$[1] = url;
|
|
$[2] = t0;
|
|
} else {
|
|
t0 = $[2];
|
|
}
|
|
const t1 = typeof zoom === "number" ? `scale(${zoom}) ` : undefined;
|
|
let t2;
|
|
if ($[3] !== iframeRef || $[4] !== t0 || $[5] !== t1 || $[6] !== url) {
|
|
t2 = _jsx("iframe", {
|
|
className: baseClass,
|
|
onLoad: t0,
|
|
ref: iframeRef,
|
|
src: url,
|
|
style: {
|
|
transform: t1
|
|
},
|
|
title: url
|
|
}, url);
|
|
$[3] = iframeRef;
|
|
$[4] = t0;
|
|
$[5] = t1;
|
|
$[6] = url;
|
|
$[7] = t2;
|
|
} else {
|
|
t2 = $[7];
|
|
}
|
|
return t2;
|
|
};
|
|
//# sourceMappingURL=index.js.map |