🎥 Make videos programmatically with React
`@remotion/studio`: Clarify remotion.dev/new playground limitations
Igor Samokhovetsa535afc40142
diff --git a/packages/browser-studio/src/dev/index.tsx b/packages/browser-studio/src/dev/index.tsxindex 253ceb55cc..d0424c4774 100644--- a/packages/browser-studio/src/dev/index.tsx+++ b/packages/browser-studio/src/dev/index.tsx@@ -14,6 +14,7 @@ createRoot(root).render(initialElement={null}project={createBlankTemplateProject()}readOnly={false}+ showExperimentalNoticeremotionPackageSource={{baseUrl: new URL('/__remotion_browser_studio_workspace__/',diff --git a/packages/studio/src/components/BrowserStudioExperimentalNotice.tsx b/packages/studio/src/components/BrowserStudioExperimentingNotice.tsxsimilarity index 58%rename from packages/studio/src/components/BrowserStudioExperimentalNotice.tsxrename to packages/studio/src/components/BrowserStudioExperimentingNotice.tsxindex b900bce329..1a5a08352d 100644--- a/packages/studio/src/components/BrowserStudioExperimentalNotice.tsx+++ b/packages/studio/src/components/BrowserStudioExperimentingNotice.tsx@@ -1,6 +1,6 @@import React, {useCallback, useContext, useState} from 'react';import {ShortcutHint} from '../error-overlay/remotion-overlay/ShortcutHint';-import {LIGHT_TEXT, TRANSPARENT, WHITE} from '../helpers/colors';+import {LIGHT_TEXT, TRANSPARENT, WARNING_COLOR, WHITE} from '../helpers/colors';import {FOCUS_VISIBLE_ONLY_CLASS_NAME,HOVERABLE_CLASS_NAME,@@ -12,6 +12,7 @@ import {ModalButton} from './ModalButton';import {getMaxModalWidth, ModalContainer} from './ModalContainer';import {ModalFooterContainer} from './ModalFooter';import {ModalHeader} from './ModalHeader';+import {WarningTriangle} from './NewComposition/ValidationMessage';export const experimentalNoticeStorageKey ='remotion-browser-studio-experimental-notice-acknowledged';@@ -53,7 +54,7 @@ const buttonTextStyle: React.CSSProperties = {lineHeight: 1.5,};-export const BrowserStudioExperimentalNotice: React.FC = () => {+export const BrowserStudioExperimentingNotice: React.FC = () => {const {setSelectedModal} = useContext(SetSelectedModalContext);const [keyboardNavigation, setKeyboardNavigation] = useState(false);@@ -83,32 +84,100 @@ export const BrowserStudioExperimentalNotice: React.FC = () => {}`}</style><ModalContainer- ariaLabel="Browser Studio is experimental"+ ariaLabel="Before you start"onEscape={onClose}onOutsideClick={onClose}panelStyle={panelStyle}>- <ModalHeader title="Browser Studio is experimental" onClose={onClose} />+ <ModalHeader title="Before you start" onClose={onClose} /><div style={{padding: 16, minHeight: 0, overflowY: 'auto'}}><p style={{...bodyTextStyle, margin: '0 0 12px'}}>- This is a playground for trying Remotion’s editing features.- Projects aren’t saved between visits, and AI interaction isn’t- available here as it is in the{' '}- <a- className={`${HOVERABLE_CLASS_NAME} ${FOCUS_VISIBLE_ONLY_CLASS_NAME}`}- href="https://www.remotion.dev/docs/studio"- rel="noopener noreferrer"- style={linkStyle}- target="_blank"- >- regular Remotion Studio- </a>- .+ remotion.dev/new is a playground for experimenting with Remotion’s+ editing features.+ </p>+ <p+ style={{+ ...bodyTextStyle,+ margin: '0 0 12px',+ display: 'flex',+ alignItems: 'center',+ gap: 8,+ }}+ >+ <WarningTriangle+ aria-hidden+ style={{+ width: 14,+ height: 14,+ flexShrink: 0,+ fill: WARNING_COLOR,+ }}+ />+ <strong style={{...bodyTextStyle, fontWeight: 'bold'}}>+ Projects aren’t saved between visits.+ </strong>+ </p>+ <p+ style={{+ ...bodyTextStyle,+ margin: '0 0 12px',+ display: 'flex',+ alignItems: 'flex-start',+ gap: 8,+ }}+ >+ <WarningTriangle+ aria-hidden+ style={{+ width: 14,+ height: 14,+ marginTop: 3.5,+ flexShrink: 0,+ fill: WARNING_COLOR,+ }}+ />+ <span style={bodyTextStyle}>+ AI interaction requires the{' '}+ <a+ className={`${HOVERABLE_CLASS_NAME} ${FOCUS_VISIBLE_ONLY_CLASS_NAME}`}+ href="https://www.remotion.dev/docs/studio"+ rel="noopener noreferrer"+ style={linkStyle}+ target="_blank"+ >+ local Remotion Studio+ </a>+ .+ </span>+ </p>+ <p+ style={{+ ...bodyTextStyle,+ margin: '0 0 12px',+ display: 'flex',+ alignItems: 'center',+ gap: 8,+ }}+ >+ <WarningTriangle+ aria-hidden+ style={{+ width: 14,+ height: 14,+ flexShrink: 0,+ fill: WARNING_COLOR,+ }}+ />+ <span style={bodyTextStyle}>+ Only browser rendering is available here.+ </span></p><p style={{...bodyTextStyle, margin: 0}}>To keep working on your project, use{' '}- <strong style={bodyTextStyle}>Download project</strong> and continue- locally.+ <strong style={{...bodyTextStyle, fontWeight: 'bold'}}>+ Download project+ </strong>{' '}+ and continue locally.</p></div><ModalFooterContainer style={{minWidth: 0, flex: 'none'}}>diff --git a/packages/studio/src/components/Modals.tsx b/packages/studio/src/components/Modals.tsxindex 249e64e3ec..8ed80f3b20 100644--- a/packages/studio/src/components/Modals.tsx+++ b/packages/studio/src/components/Modals.tsx@@ -9,7 +9,7 @@ import {getStudioAskAIEnabled} from '../helpers/studio-runtime-config';import {SelectedModalContext, SetSelectedModalContext} from '../state/modals';import {AskAiModal} from './AskAiModal';import {AssetSelectorModal} from './AssetSelectorModal';-import {BrowserStudioExperimentalNotice} from './BrowserStudioExperimentalNotice';+import {BrowserStudioExperimentingNotice} from './BrowserStudioExperimentingNotice';import {callApi} from './call-api';import {ConfirmationDialog, useConfirmationDialog} from './ConfirmationDialog';import {EffectPickerModal} from './EffectPickerModal';@@ -252,7 +252,7 @@ export const Modals: React.FC<{return (<>{modalContextType?.type === 'browser-studio-experimental-notice' ? (- <BrowserStudioExperimentalNotice />+ <BrowserStudioExperimentingNotice />) : null}{modalContextType && modalContextType.type === 'new-comp' && (<NewCompositiondiff --git a/packages/studio/src/components/ModalsProvider.tsx b/packages/studio/src/components/ModalsProvider.tsxindex eb389de35d..d9b4dc6155 100644--- a/packages/studio/src/components/ModalsProvider.tsx+++ b/packages/studio/src/components/ModalsProvider.tsx@@ -2,7 +2,7 @@ import React, {useMemo, useState} from 'react';import {getBrowserStudioOperations} from '../helpers/browser-studio-operations';import type {ModalState, SetSelectedModalContextType} from '../state/modals';import {SelectedModalContext, SetSelectedModalContext} from '../state/modals';-import {experimentalNoticeStorageKey} from './BrowserStudioExperimentalNotice';+import {experimentalNoticeStorageKey} from './BrowserStudioExperimentingNotice';export const ModalsProvider: React.FC<{readonly children: React.ReactNode;