mirror of
https://github.com/mathuo/dockview
synced 2025-02-02 06:25:44 +00:00
chore: fix docs build
This commit is contained in:
parent
9c091f5126
commit
f6e816fa10
@ -3,7 +3,7 @@
|
|||||||
"version": "1.13.0",
|
"version": "1.13.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run create-templates && docusaurus build",
|
"build": "npm run build-templates && docusaurus build",
|
||||||
"clear": "docusaurus clear",
|
"clear": "docusaurus clear",
|
||||||
"start": "concurrently \"docusaurus start\" \"npm run start-esm-server\"",
|
"start": "concurrently \"docusaurus start\" \"npm run start-esm-server\"",
|
||||||
"start-esm-server": "node web-server/index.mjs",
|
"start-esm-server": "node web-server/index.mjs",
|
||||||
|
@ -5,15 +5,11 @@ import BrowserOnly from '@docusaurus/BrowserOnly';
|
|||||||
const BASE_SANDBOX_URL =
|
const BASE_SANDBOX_URL =
|
||||||
'https://codesandbox.io/s/github/mathuo/dockview/tree/master/packages/docs';
|
'https://codesandbox.io/s/github/mathuo/dockview/tree/master/packages/docs';
|
||||||
|
|
||||||
export const _CodeRunner = (props: {
|
export const _CodeRunner = (props: { id: string; height: number }) => {
|
||||||
id: string;
|
const [framework] = useActiveFramework();
|
||||||
framework: string;
|
|
||||||
height: number;
|
|
||||||
}) => {
|
|
||||||
useActiveFramework();
|
|
||||||
|
|
||||||
const sandboxUrl = `${BASE_SANDBOX_URL}/templates/${props.id}/${props.framework}`;
|
const sandboxUrl = `${BASE_SANDBOX_URL}/templates/${props.id}/${framework}`;
|
||||||
const path = `/templates/${props.id}/${props.framework}/index.html`;
|
const path = `/templates/${props.id}/${framework}/index.html`;
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<iframe
|
<iframe
|
||||||
@ -35,15 +31,7 @@ export const _CodeRunner = (props: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const CodeRunner = (props: { id: string; height: number }) => {
|
export const CodeRunner = (props: { id: string; height: number }) => {
|
||||||
const [framework] = useActiveFramework();
|
return <BrowserOnly>{() => <_CodeRunner {...props} />}</BrowserOnly>;
|
||||||
|
|
||||||
return (
|
|
||||||
<BrowserOnly>
|
|
||||||
{() => (
|
|
||||||
<_CodeRunner {...props} framework={framework.toLowerCase()} />
|
|
||||||
)}
|
|
||||||
</BrowserOnly>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const CodeSandbox = (props: { url: string }) => {
|
const CodeSandbox = (props: { url: string }) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user