@blocklet/pages-kit-block-studio 0.1.8 → 0.1.20
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.
|
@@ -207,11 +207,8 @@ ${content.trim()}`;
|
|
|
207
207
|
function generateComponent(content, _isDev = true) {
|
|
208
208
|
const htmlContent = content.html;
|
|
209
209
|
// const { name } = content;
|
|
210
|
-
return `import React, { useEffect, useRef } from 'react';
|
|
210
|
+
return `import React, { useEffect, useRef } from '@blocklet/pages-kit/builtin/react';
|
|
211
211
|
|
|
212
|
-
const htmlContent = \`
|
|
213
|
-
${htmlContent}
|
|
214
|
-
\`;
|
|
215
212
|
|
|
216
213
|
export default function HtmlPreview() {
|
|
217
214
|
const iframeRef = useRef(null);
|
|
@@ -239,7 +236,7 @@ export default function HtmlPreview() {
|
|
|
239
236
|
style={{ border: 'none', width: '100%', height: '0px', maxHeight: '100vh' }}
|
|
240
237
|
sandbox="allow-scripts"
|
|
241
238
|
title="HtmlPreview"
|
|
242
|
-
srcDoc={htmlContent}
|
|
239
|
+
srcDoc={${htmlContent}}
|
|
243
240
|
/>
|
|
244
241
|
);
|
|
245
242
|
}`;
|