🎥 Make videos programmatically with React
show CWD in top right corner
Jonny Burger45f044feaa91
diff --git a/packages/bundler/src/static-preview.ts b/packages/bundler/src/static-preview.tsindex be8062ab8d..fcbc67bdec 100644--- a/packages/bundler/src/static-preview.ts+++ b/packages/bundler/src/static-preview.ts@@ -18,7 +18,10 @@ export const indexHtml = (staticHash: string, editorName: string | null) =>? `<script>window.remotion_editorName = "${editorName}";</script>`: '<script>window.remotion_editorName = null;</script>'}- <script>window.remotion_projectName = "${path.basename(process.cwd())}";</script>+ <script>window.remotion_projectName = "${path.basename(+ process.cwd()+ )}";</script>+ <script>window.remotion_cwd = "${process.cwd()}";</script><div id="container"></div><div id="menuportal-0"></div>diff --git a/packages/cli/src/editor/components/CurrentComposition.tsx b/packages/cli/src/editor/components/CurrentComposition.tsxindex 68390bd9ca..0c333d7a55 100644--- a/packages/cli/src/editor/components/CurrentComposition.tsx+++ b/packages/cli/src/editor/components/CurrentComposition.tsx@@ -42,9 +42,12 @@ export const CurrentComposition = () => {const video = Internals.useVideo();useEffect(() => {- window.document.title = `${video?.id || 'Composition'} - ${- window.remotion_projectName- } - Remotion Preview`;+ if (!video) {+ document.title = 'Remotion Preview';+ return;+ }++ document.title = `${video.id} / ${window.remotion_projectName} - Remotion Preview`;}, [video]);if (!video) {diff --git a/packages/cli/src/editor/components/MenuToolbar.tsx b/packages/cli/src/editor/components/MenuToolbar.tsxindex 514b376897..af5d9b6679 100644--- a/packages/cli/src/editor/components/MenuToolbar.tsx+++ b/packages/cli/src/editor/components/MenuToolbar.tsx@@ -20,6 +20,16 @@ const row: React.CSSProperties = {fontSize: 13,paddingLeft: 6,+ paddingRight: 10,+};++const flex: React.CSSProperties = {+ flex: 1,+};++const cwd: React.CSSProperties = {+ fontSize: 13,+ opacity: 0.8,};type Structure = Menu[];@@ -473,6 +483,10 @@ export const MenuToolbar: React.FC = () => {);})}<UpdateCheck />+ <div style={flex}></div>+ <div style={cwd} title={window.remotion_cwd}>+ {window.remotion_projectName}+ </div></Row>);};diff --git a/packages/core/src/index.ts b/packages/core/src/index.tsindex 1c4b403a39..1e7df3d88c 100644--- a/packages/core/src/index.ts+++ b/packages/core/src/index.ts@@ -9,6 +9,7 @@ declare global {remotion_staticBase: string;remotion_editorName: string | null;remotion_projectName: string;+ remotion_cwd: string;remotion_setFrame: (frame: number) => void;remotion_initialFrame: number;remotion_puppeteerTimeout: number;