🎥 Make videos programmatically with React
`@remotion/studio`: Add Settings modal (#10125)
Jonny Burger8da4e99aef8c
diff --git a/packages/example/e2e/studio-protocol.test.mts b/packages/example/e2e/studio-protocol.test.mtsindex 24b469418a..1b41e24f69 100644--- a/packages/example/e2e/studio-protocol.test.mts+++ b/packages/example/e2e/studio-protocol.test.mts@@ -258,7 +258,9 @@ export const MyComponent = () => {await studioPage.bringToFront();const licenseDialog = studioPage.getByRole('dialog');- await expect(licenseDialog.getByText('Configure License')).toBeVisible();+ await expect(+ licenseDialog.getByText('Settings', {exact: true}),+ ).toBeVisible();await expect(licenseDialog.getByRole('textbox', {name: 'Public license key'}),).toHaveValue(`rm_pub_${'a'.repeat(48)}`);diff --git a/packages/studio/src/components/ConfigureDefaultEditorModal.tsx b/packages/studio/src/components/ConfigureDefaultEditorModal.tsxindex f3475b3778..a7a0f46373 100644--- a/packages/studio/src/components/ConfigureDefaultEditorModal.tsx+++ b/packages/studio/src/components/ConfigureDefaultEditorModal.tsx@@ -2,31 +2,28 @@ import type {EditorPickerId,GetDefaultEditorInfoResponse,} from '@remotion/studio-shared';-import React, {- useCallback,- useContext,- useEffect,- useMemo,- useState,-} from 'react';-import {LIGHT_TEXT} from '../helpers/colors';+import React, {useCallback, useEffect, useMemo, useState} from 'react';+import {LIGHT_TEXT, WHITE} from '../helpers/colors';import {Checkmark} from '../icons/Checkmark';import {CustomEditorIcon} from '../icons/custom-editor';-import {ModalsContext} from '../state/modals';import {callApi} from './call-api';-import {Row, Spacing} from './layout';+import {Spacing} from './layout';import {ModalButton} from './ModalButton';-import {ModalContainer} from './ModalContainer';-import {ModalFooterContainer} from './ModalFooter';-import {ModalHeader} from './ModalHeader';import type {ComboboxValue} from './NewComposition/ComboBox';import {Combobox} from './NewComposition/ComboBox';import {ValidationMessage} from './NewComposition/ValidationMessage';+import {SettingsModalFooter} from './SettingsModalFooter';++const container: React.CSSProperties = {+ display: 'flex',+ flex: 1,+ flexDirection: 'column',+ minWidth: 0,+};const content: React.CSSProperties = {+ flex: 1,padding: 16,- width: 440,- maxWidth: 'calc(100vw - 40px)',};const description: React.CSSProperties = {@@ -37,6 +34,14 @@ const description: React.CSSProperties = {margin: 0,};+const title: React.CSSProperties = {+ color: WHITE,+ fontFamily: 'sans-serif',+ fontSize: 14,+ lineHeight: 1.5,+ margin: 0,+};+const comboBoxStyle: React.CSSProperties = {boxSizing: 'border-box',width: '100%',@@ -67,8 +72,9 @@ const customEditorName: React.CSSProperties = {const NO_PREFERENCE_ID = 'no-preference';-export const ConfigureDefaultEditorModal: React.FC = () => {- const {setSelectedModal} = useContext(ModalsContext);+export const DefaultEditorSettings: React.FC<{+ readonly onSaved: () => void;+}> = ({onSaved}) => {const [editorInfo, setEditorInfo] =useState<GetDefaultEditorInfoResponse | null>(null);const [selectedEditor, setSelectedEditor] = useState<EditorPickerId | null>(@@ -121,10 +127,6 @@ export const ConfigureDefaultEditorModal: React.FC = () => {return [noPreference, ...installedEditors];}, [editorInfo?.installedEditors, selectedEditor]);- const dismiss = useCallback(() => {- setSelectedModal(null);- }, [setSelectedModal]);-useEffect(() => {const controller = new AbortController();callApi('/api/default-editor-info', {}, controller.signal)@@ -167,23 +169,22 @@ export const ConfigureDefaultEditorModal: React.FC = () => {return;}- dismiss();+ onSaved();} catch (err) {setError((err as Error).message);setIsSubmitting(false);}- }, [dismiss, editorInfo, selectedEditor]);-- if (editorInfo === null && error === null) {- return null;- }+ }, [editorInfo, onSaved, selectedEditor]);return (- <ModalContainer onEscape={dismiss} onOutsideClick={dismiss}>- <ModalHeader title="Configure default editor" onClose={dismiss} />+ <div style={container}><div style={content}>+ <p style={title}>Default editor</p><p style={description}>This setting gets saved to your config file.</p>- <Spacing y={2} block />+ <Spacing y={1} block />+ {editorInfo === null && error === null ? (+ <p style={description}>Loading installed editors...</p>+ ) : null}{editorInfo?.installedEditors.length === 0 ? (<p style={description}>No supported editors were found on this computer.@@ -208,16 +209,14 @@ export const ConfigureDefaultEditorModal: React.FC = () => {</>) : null}</div>- <ModalFooterContainer>- <Row justify="flex-end">- <ModalButton- onClick={submit}- disabled={isSubmitting || editorInfo === null}- >- {isSubmitting ? 'Saving...' : 'Save and reload'}- </ModalButton>- </Row>- </ModalFooterContainer>- </ModalContainer>+ <SettingsModalFooter>+ <ModalButton+ onClick={submit}+ disabled={isSubmitting || editorInfo === null}+ >+ {isSubmitting ? 'Saving...' : 'Save and reload'}+ </ModalButton>+ </SettingsModalFooter>+ </div>);};diff --git a/packages/studio/src/components/ConfigureLicenseModal.tsx b/packages/studio/src/components/ConfigureLicenseModal.tsxindex 6957285cbb..00e933fae2 100644--- a/packages/studio/src/components/ConfigureLicenseModal.tsx+++ b/packages/studio/src/components/ConfigureLicenseModal.tsx@@ -1,15 +1,8 @@-import React, {- useCallback,- useContext,- useEffect,- useMemo,- useState,-} from 'react';+import React, {useCallback, useEffect, useMemo, useState} from 'react';import {LIGHT_TEXT, WHITE} from '../helpers/colors';-import {ModalsContext} from '../state/modals';import {callApi} from './call-api';import {Checkbox} from './Checkbox';-import {Row, Spacing} from './layout';+import {Spacing} from './layout';import {fetchLicenseKeyDetails,hasActiveCompanyLicense,@@ -18,18 +11,22 @@ import {validateLicenseKey,} from './LicenseKeyValidation';import {ModalButton} from './ModalButton';-import {ModalContainer} from './ModalContainer';-import {ModalFooterContainer} from './ModalFooter';-import {ModalHeader} from './ModalHeader';import {RemotionInput} from './NewComposition/RemInput';import {ValidationMessage} from './NewComposition/ValidationMessage';+import {SettingsModalFooter} from './SettingsModalFooter';type LicenseType = 'free' | 'company' | null;+const container: React.CSSProperties = {+ display: 'flex',+ flex: 1,+ flexDirection: 'column',+ minWidth: 0,+};+const content: React.CSSProperties = {+ flex: 1,padding: 16,- width: 540,- maxWidth: 'calc(100vw - 40px)',};const description: React.CSSProperties = {@@ -38,7 +35,6 @@ const description: React.CSSProperties = {fontSize: 14,lineHeight: 1.5,margin: 0,- marginTop: 10,};const descriptionLink: React.CSSProperties = {@@ -76,10 +72,10 @@ const inputLabel: React.CSSProperties = {marginTop: 10,};-export const ConfigureLicenseModal: React.FC<{+export const LicenseSettings: React.FC<{readonly initialPublicLicenseKey: string | null;-}> = ({initialPublicLicenseKey}) => {- const {setSelectedModal} = useContext(ModalsContext);+ readonly onSaved: () => void;+}> = ({initialPublicLicenseKey, onSaved}) => {const initialLicenseType: LicenseType =initialPublicLicenseKey === 'free-license'? 'free'@@ -100,19 +96,23 @@ export const ConfigureLicenseModal: React.FC<{const [licenseKeyDetails, setLicenseKeyDetails] =useState<LicenseKeyDetails | null>(null);- const dismiss = useCallback(() => {- setSelectedModal(null);- }, [setSelectedModal]);+ const toggleLicenseType = useCallback(+ (newLicenseType: Exclude<LicenseType, null>) => {+ setLicenseType((currentLicenseType) =>+ currentLicenseType === newLicenseType ? null : newLicenseType,+ );+ setError(null);+ },+ [],+ );- const chooseFreeLicense = useCallback(() => {- setLicenseType('free');- setError(null);- }, []);+ const toggleFreeLicense = useCallback(() => {+ toggleLicenseType('free');+ }, [toggleLicenseType]);- const chooseCompanyLicense = useCallback(() => {- setLicenseType('company');- setError(null);- }, []);+ const toggleCompanyLicense = useCallback(() => {+ toggleLicenseType('company');+ }, [toggleLicenseType]);const publicLicenseKey = useMemo(() => {if (licenseType === 'free') {@@ -205,40 +205,55 @@ export const ConfigureLicenseModal: React.FC<{return;}- dismiss();+ onSaved();} catch (err) {setError((err as Error).message);setIsSubmitting(false);}- }, [companyLicenseKeyIsValid, dismiss, licenseType, publicLicenseKey]);+ }, [companyLicenseKeyIsValid, licenseType, onSaved, publicLicenseKey]);return (- <ModalContainer onEscape={dismiss} onOutsideClick={dismiss}>- <ModalHeader title="Configure License" onClose={dismiss} />+ <div style={container}><div style={content}><p style={description}>- Remotion is free if you are an individual or company with a headcount- of 3 or less. See{' '}- <a style={descriptionLink} href="https://remotion.dev/license">- LICENSE.md+ Remotion is free to use if you are an individual or company with a+ headcount of 3 or less.+ <br />+ If used in an organization with 4 people or more, a{' '}+ <a style={descriptionLink} href="https://remotion.pro/license">+ Company License</a>- .+ {' needs to be obtained.'}</p><Spacing y={2} />- <div style={checkboxRow} onClick={chooseFreeLicense}>+ <div+ style={checkboxRow}+ onClick={(event) => {+ if (!(event.target instanceof HTMLInputElement)) {+ toggleFreeLicense();+ }+ }}+ ><Checkboxchecked={licenseType === 'free'}- onChange={chooseFreeLicense}+ onChange={toggleFreeLicense}name="free-license"rounded/><Spacing x={1} /><div style={checkboxLabel}>I am eligible for the Free License</div></div>- <div style={checkboxRow} onClick={chooseCompanyLicense}>+ <div+ style={checkboxRow}+ onClick={(event) => {+ if (!(event.target instanceof HTMLInputElement)) {+ toggleCompanyLicense();+ }+ }}+ ><Checkboxchecked={licenseType === 'company'}- onChange={chooseCompanyLicense}+ onChange={toggleCompanyLicense}name="company-license"rounded/>@@ -318,21 +333,19 @@ export const ConfigureLicenseModal: React.FC<{</>) : null}</div>- <ModalFooterContainer>- <Row justify="flex-end">- <ModalButton- onClick={submit}- disabled={- isSubmitting ||- publicLicenseKey.length === 0 ||- (licenseType === 'company' && !companyLicenseKeyIsValid)- }- autoFocus={licenseType !== 'company'}- >- {isSubmitting ? 'Submitting...' : 'Submit and reload'}- </ModalButton>- </Row>- </ModalFooterContainer>- </ModalContainer>+ <SettingsModalFooter>+ <ModalButton+ onClick={submit}+ disabled={+ isSubmitting ||+ publicLicenseKey.length === 0 ||+ (licenseType === 'company' && !companyLicenseKeyIsValid)+ }+ autoFocus={licenseType !== 'company'}+ >+ {isSubmitting ? 'Submitting...' : 'Submit and reload'}+ </ModalButton>+ </SettingsModalFooter>+ </div>);};diff --git a/packages/studio/src/components/InlineDropdown.tsx b/packages/studio/src/components/InlineDropdown.tsxindex 74e17bbc00..390399adf4 100644--- a/packages/studio/src/components/InlineDropdown.tsx+++ b/packages/studio/src/components/InlineDropdown.tsx@@ -30,14 +30,21 @@ type OpenState =values: ComboboxValue[] | null;};+const container: React.CSSProperties = {+ display: 'flex',+ height: 24,+};+export const InlineDropdown = ({values,getItems,+ onOpenChange,unhoveredColor,...props}: Omit<InlineActionProps, 'onClick'> & {readonly values?: ComboboxValue[];readonly getItems?: () => ComboboxValue[];+ readonly onOpenChange?: (open: boolean) => void;}) => {const ref = useRef<HTMLDivElement>(null);const [opened, setOpened] = useState<OpenState>({type: 'not-open'});@@ -66,8 +73,9 @@ export const InlineDropdown = ({top: e.clientY,values: invocationValues,});+ onOpenChange?.(true);},- [getItems],+ [getItems, onOpenChange],);const spaceToBottom = useMemo(() => {@@ -128,11 +136,12 @@ export const InlineDropdown = ({const onHide = useCallback(() => {setOpened({type: 'not-open'});- }, []);+ onOpenChange?.(false);+ }, [onOpenChange]);return (<>- <div ref={ref}>+ <div ref={ref} style={container}><InlineActiononClick={onClick}unhoveredColor={opened.type === 'open' ? WHITE : unhoveredColor}diff --git a/packages/studio/src/components/InspectorOpenInEditor.tsx b/packages/studio/src/components/InspectorOpenInEditor.tsxindex 1fe4848d24..5c7bdd5dde 100644--- a/packages/studio/src/components/InspectorOpenInEditor.tsx+++ b/packages/studio/src/components/InspectorOpenInEditor.tsx@@ -25,18 +25,22 @@ import {const splitButton: React.CSSProperties = {alignItems: 'center',+ borderRadius: 3,display: 'inline-flex',flexDirection: 'row',flexShrink: 0,+ gap: 1,height: 24,+ overflow: 'hidden',};const mainButtonBase: React.CSSProperties = {alignItems: 'center',background: TRANSPARENT,border: 'none',- borderRadius: 3,+ borderRadius: '3px 0 0 3px',color: LIGHT_TEXT,+ columnGap: 4,display: 'inline-flex',fontFamily: 'sans-serif',fontSize: 11,@@ -58,11 +62,13 @@ const editorMenuIconSize = 18;export const InspectorOpenInEditor: React.FC<{readonly location: OriginalPosition | null;-}> = ({location}) => {+ readonly label?: React.ReactNode;+}> = ({label, location}) => {const {previewServerState} = useContext(StudioServerConnectionCtx);const {setSelectedModal} = useContext(ModalsContext);const {tabIndex} = useZIndex();const [hovered, setHovered] = useState(false);+ const [dropdownOpened, setDropdownOpened] = useState(false);const editorPickerAvailable = canUseEditorPicker(previewServerState.type === 'connected',);@@ -94,18 +100,31 @@ export const InspectorOpenInEditor: React.FC<{},[openWithEditor],);+ const mainHovered = hovered && !dropdownOpened;const mainButtonStyle = useMemo((): React.CSSProperties => {return {...mainButtonBase,background: getBackgroundFromHoverState({- hovered,+ hovered: mainHovered,selected: false,}),- color: hovered ? WHITE : LIGHT_TEXT,+ color: mainHovered ? WHITE : LIGHT_TEXT,opacity: canOpenDefault ? 1 : 0.5,pointerEvents: canOpenDefault ? 'auto' : 'none',};- }, [canOpenDefault, hovered]);+ }, [canOpenDefault, mainHovered]);+ const dropdownForegroundColor =+ hovered || dropdownOpened ? WHITE : LIGHT_TEXT;+ const dropdownStyle = useMemo((): React.CSSProperties => {+ return {+ background: getBackgroundFromHoverState({+ hovered,+ selected: dropdownOpened,+ }),+ borderRadius: '0 3px 3px 0',+ color: dropdownForegroundColor,+ };+ }, [dropdownForegroundColor, dropdownOpened, hovered]);const renderDropdownAction: RenderInlineAction = useCallback((color) => {return <CaretDown color={color} small />;}, []);@@ -137,7 +156,12 @@ export const InspectorOpenInEditor: React.FC<{label: <span style={menuLabel}>Set default editor...</span>,leftItem: null,onClick: () => {- setSelectedModal({type: 'configure-default-editor'});+ setSelectedModal({+ type: 'settings',+ initialTab: 'apps',+ initialPublicLicenseKey:+ window.remotion_renderDefaults?.publicLicenseKey ?? null,+ });},quickSwitcherLabel: null,subMenu: null,@@ -159,23 +183,29 @@ export const InspectorOpenInEditor: React.FC<{}return (- <div style={splitButton}>+ <div+ style={splitButton}+ onPointerEnter={() => setHovered(true)}+ onPointerLeave={() => setHovered(false)}+ ><buttonaria-label={`Open in ${editorName}`}disabled={!canOpenDefault}onClick={onOpenDefault}- onPointerEnter={() => setHovered(true)}- onPointerLeave={() => setHovered(false)}style={mainButtonStyle}tabIndex={tabIndex}title={`Open in ${editorName}`}type="button">+ {label}<EditorIcon editorId={preferredEditorId} size={editorButtonIconSize} /></button><InlineDropdown+ onOpenChange={setDropdownOpened}renderAction={renderDropdownAction}+ style={dropdownStyle}title="Open in another editor"+ unhoveredColor={dropdownForegroundColor}values={menuItems}variant="compact"/>diff --git a/packages/studio/src/components/ModalFooter.tsx b/packages/studio/src/components/ModalFooter.tsxindex efcd448505..bf6be97b18 100644--- a/packages/studio/src/components/ModalFooter.tsx+++ b/packages/studio/src/components/ModalFooter.tsx@@ -12,9 +12,16 @@ const content: React.CSSProperties = {export const ModalFooterContainer: React.FC<{readonly children: React.ReactNode;readonly style?: React.CSSProperties;-}> = ({children, style}) => {+ readonly noBorder?: boolean;+}> = ({children, noBorder, style}) => {return (- <div style={{...content, ...style, borderTop: BORDER_BLACK}}>+ <div+ style={{+ ...content,+ ...style,+ borderTop: noBorder ? undefined : BORDER_BLACK,+ }}+ >{children}</div>);diff --git a/packages/studio/src/components/Modals.tsx b/packages/studio/src/components/Modals.tsxindex f7f7945fae..43e6fb8858 100644--- a/packages/studio/src/components/Modals.tsx+++ b/packages/studio/src/components/Modals.tsx@@ -5,8 +5,6 @@ import {getStudioAskAIEnabled} from '../helpers/studio-runtime-config';import {ModalsContext} from '../state/modals';import {useZIndex} from '../state/z-index';import {AskAiModal} from './AskAiModal';-import {ConfigureDefaultEditorModal} from './ConfigureDefaultEditorModal';-import {ConfigureLicenseModal} from './ConfigureLicenseModal';import {ConfirmationDialog} from './ConfirmationDialog';import {EffectPickerModal} from './EffectPickerModal';import {InstallPackageModal} from './InstallPackage';@@ -24,6 +22,7 @@ import QuickSwitcher from './QuickSwitcher/QuickSwitcher';import {RenderStatusModal} from './RenderModal/RenderStatusModal';import {RenderModalWithLoader} from './RenderModal/ServerRenderModal';import {WebRenderModalWithLoader} from './RenderModal/WebRenderModal';+import {SettingsModal} from './SettingsModal';import {SvgImportDialog} from './SvgImportDialog';import {UpdateModal} from './UpdateModal/UpdateModal';@@ -45,7 +44,8 @@ export const Modals: React.FC<{}setSelectedModal({- type: 'configure-license',+ type: 'settings',+ initialTab: 'license',initialPublicLicenseKey: event.licenseKey,});});@@ -98,16 +98,13 @@ export const Modals: React.FC<{{modalContextType && modalContextType.type === 'input-props-override' && (<OverrideInputPropsModal />)}- {modalContextType && modalContextType.type === 'configure-license' && (- <ConfigureLicenseModal- key={modalContextType.initialPublicLicenseKey}+ {modalContextType && modalContextType.type === 'settings' && (+ <SettingsModal+ key={`${modalContextType.initialTab}-${modalContextType.initialPublicLicenseKey}`}+ initialTab={modalContextType.initialTab}initialPublicLicenseKey={modalContextType.initialPublicLicenseKey}/>)}- {modalContextType &&- modalContextType.type === 'configure-default-editor' && (- <ConfigureDefaultEditorModal />- )}{modalContextType && modalContextType.type === 'web-render' && (<WebRenderModalWithLoader {...modalContextType} />)}diff --git a/packages/studio/src/components/RenderModal/WebRenderModal.tsx b/packages/studio/src/components/RenderModal/WebRenderModal.tsxindex 3c06870af4..cf7e4c8a2c 100644--- a/packages/studio/src/components/RenderModal/WebRenderModal.tsx+++ b/packages/studio/src/components/RenderModal/WebRenderModal.tsx@@ -707,7 +707,8 @@ const WebRenderModal: React.FC<WebRenderModalProps> = ({selected={false}onClick={() =>setSelectedModal({- type: 'configure-license',+ type: 'settings',+ initialTab: 'license',initialPublicLicenseKey: publicLicenseKey,})}diff --git a/packages/studio/src/components/SettingsModal.tsx b/packages/studio/src/components/SettingsModal.tsxnew file mode 100644index 0000000000..86f68b8110--- /dev/null+++ b/packages/studio/src/components/SettingsModal.tsx@@ -0,0 +1,113 @@+import React, {useCallback, useContext, useState} from 'react';+import {AppsIcon} from '../icons/apps';+import {CertificateIcon} from '../icons/certificate';+import {ModalsContext} from '../state/modals';+import {DefaultEditorSettings} from './ConfigureDefaultEditorModal';+import {LicenseSettings} from './ConfigureLicenseModal';+import {VERTICAL_SCROLLBAR_CLASSNAME} from './Menu/is-menu-item';+import {ModalHeader} from './ModalHeader';+import {DismissableModal} from './NewComposition/DismissableModal';+import {+ horizontalLayout,+ horizontalTab,+ icon,+ iconContainer,+ leftSidebar,+ optionsPanel,+ outerModalStyle,+} from './RenderModal/render-modals';+import {VerticalTab} from './Tabs/vertical';++type SettingsTab = 'apps' | 'license';++const hiddenPanel: React.CSSProperties = {+ display: 'none',+};++const appsIcon: React.CSSProperties = {+ ...icon,+ height: 20,+ width: 20,+};++const appsIconContainer: React.CSSProperties = {+ ...iconContainer,+ height: 20,+ width: 20,+};++export const SettingsModal: React.FC<{+ readonly initialTab: SettingsTab;+ readonly initialPublicLicenseKey: string | null;+}> = ({initialPublicLicenseKey, initialTab}) => {+ const {setSelectedModal} = useContext(ModalsContext);+ const [tab, setTab] = useState<SettingsTab>(initialTab);+ const [openedTabs, setOpenedTabs] = useState<SettingsTab[]>([initialTab]);++ const dismiss = useCallback(() => {+ setSelectedModal(null);+ }, [setSelectedModal]);+ const selectTab = useCallback((newTab: SettingsTab) => {+ setTab(newTab);+ setOpenedTabs((currentOpenedTabs) => {+ if (currentOpenedTabs.includes(newTab)) {+ return currentOpenedTabs;+ }++ return [...currentOpenedTabs, newTab];+ });+ }, []);++ return (+ <DismissableModal panelStyle={outerModalStyle}>+ <ModalHeader title="Settings" onClose={dismiss} />+ <div style={horizontalLayout}>+ <div style={leftSidebar}>+ <VerticalTab+ style={horizontalTab}+ selected={tab === 'apps'}+ onClick={() => selectTab('apps')}+ renderIcon={(color) => (+ <div style={appsIconContainer}>+ <AppsIcon color={color} style={appsIcon} />+ </div>+ )}+ >+ Apps+ </VerticalTab>+ <VerticalTab+ style={horizontalTab}+ selected={tab === 'license'}+ onClick={() => selectTab('license')}+ renderIcon={(color) => (+ <div style={iconContainer}>+ <CertificateIcon color={color} style={icon} />+ </div>+ )}+ >+ License+ </VerticalTab>+ </div>+ {openedTabs.includes('apps') ? (+ <div+ style={tab === 'apps' ? optionsPanel : hiddenPanel}+ className={VERTICAL_SCROLLBAR_CLASSNAME}+ >+ <DefaultEditorSettings onSaved={dismiss} />+ </div>+ ) : null}+ {openedTabs.includes('license') ? (+ <div+ style={tab === 'license' ? optionsPanel : hiddenPanel}+ className={VERTICAL_SCROLLBAR_CLASSNAME}+ >+ <LicenseSettings+ initialPublicLicenseKey={initialPublicLicenseKey}+ onSaved={dismiss}+ />+ </div>+ ) : null}+ </div>+ </DismissableModal>+ );+};diff --git a/packages/studio/src/components/SettingsModalFooter.tsx b/packages/studio/src/components/SettingsModalFooter.tsxnew file mode 100644index 0000000000..d8d2028835--- /dev/null+++ b/packages/studio/src/components/SettingsModalFooter.tsx@@ -0,0 +1,59 @@+import React, {useMemo} from 'react';+import {BLUE, LIGHT_TEXT} from '../helpers/colors';+import {InspectorOpenInEditor} from './InspectorOpenInEditor';+import {ModalFooterContainer} from './ModalFooter';++const footer: React.CSSProperties = {+ flex: 'none',+};++const footerRow: React.CSSProperties = {+ alignItems: 'center',+ display: 'flex',+ justifyContent: 'space-between',+};++const configFileHint: React.CSSProperties = {+ alignItems: 'center',+ color: LIGHT_TEXT,+ display: 'flex',+ fontFamily: 'sans-serif',+ fontSize: 13,+ lineHeight: '20px',+ whiteSpace: 'nowrap',+};++const configFileName: React.CSSProperties = {+ color: BLUE,+ fontFamily: 'inherit',+ fontSize: 13,+ fontWeight: 'bold',+ lineHeight: '20px',+};++export const SettingsModalFooter: React.FC<{+ readonly children: React.ReactNode;+}> = ({children}) => {+ const configFileLocation = useMemo(() => {+ return {+ source: 'remotion.config.ts',+ line: 1,+ column: 1,+ };+ }, []);++ return (+ <ModalFooterContainer style={footer} noBorder>+ <div style={footerRow}>+ <div style={configFileHint}>+ Changes save to+ <InspectorOpenInEditor+ location={configFileLocation}+ label={<strong style={configFileName}>remotion.config.ts</strong>}+ />+ </div>+ {children}+ </div>+ </ModalFooterContainer>+ );+};diff --git a/packages/studio/src/helpers/use-menu-structure.tsx b/packages/studio/src/helpers/use-menu-structure.tsxindex bd0f7c34b4..7633864b2f 100644--- a/packages/studio/src/helpers/use-menu-structure.tsx+++ b/packages/studio/src/helpers/use-menu-structure.tsx@@ -439,32 +439,15 @@ export const useMenuStructure = (subMenu: null,quickSwitcherLabel: 'Help: Changelog',},- canConfigureDefaultEditor- ? {- id: 'default-editor',- value: 'default-editor',- label: 'Configure default editor...',- onClick: () => {- closeMenu();- setSelectedModal({- type: 'configure-default-editor',- });- },- type: 'item' as const,- keyHint: null,- leftItem: null,- subMenu: null,- quickSwitcherLabel: 'Configure default editor...',- }- : null,{- id: 'license',- value: 'license',- label: 'Configure License...',+ id: 'settings',+ value: 'settings',+ label: 'Settings...',onClick: () => {closeMenu();setSelectedModal({- type: 'configure-license',+ type: 'settings',+ initialTab: canConfigureDefaultEditor ? 'apps' : 'license',initialPublicLicenseKey:window.remotion_renderDefaults?.publicLicenseKey ?? null,});@@ -473,7 +456,7 @@ export const useMenuStructure = (keyHint: null,leftItem: null,subMenu: null,- quickSwitcherLabel: 'Configure License...',+ quickSwitcherLabel: 'Settings...',disabled: readOnlyStudio || type !== 'connected',},{diff --git a/packages/studio/src/icons/apps.tsx b/packages/studio/src/icons/apps.tsxnew file mode 100644index 0000000000..d33424d0dc--- /dev/null+++ b/packages/studio/src/icons/apps.tsx@@ -0,0 +1,11 @@+import type {SVGProps} from 'react';+import {CURRENT_COLOR_LOWERCASE} from '../helpers/colors';++export const AppsIcon = ({color, ...props}: SVGProps<SVGSVGElement>) => (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" {...props}>+ <path+ fill={color ?? CURRENT_COLOR_LOWERCASE}+ d="M144 128C135.2 128 128 135.2 128 144L128 240C128 248.8 135.2 256 144 256L240 256C248.8 256 256 248.8 256 240L256 144C256 135.2 248.8 128 240 128L144 128zM96 144C96 117.5 117.5 96 144 96L240 96C266.5 96 288 117.5 288 144L288 240C288 266.5 266.5 288 240 288L144 288C117.5 288 96 266.5 96 240L96 144zM144 384C135.2 384 128 391.2 128 400L128 496C128 504.8 135.2 512 144 512L240 512C248.8 512 256 504.8 256 496L256 400C256 391.2 248.8 384 240 384L144 384zM96 400C96 373.5 117.5 352 144 352L240 352C266.5 352 288 373.5 288 400L288 496C288 522.5 266.5 544 240 544L144 544C117.5 544 96 522.5 96 496L96 400zM496 128L400 128C391.2 128 384 135.2 384 144L384 240C384 248.8 391.2 256 400 256L496 256C504.8 256 512 248.8 512 240L512 144C512 135.2 504.8 128 496 128zM400 96L496 96C522.5 96 544 117.5 544 144L544 240C544 266.5 522.5 288 496 288L400 288C373.5 288 352 266.5 352 240L352 144C352 117.5 373.5 96 400 96zM400 384C391.2 384 384 391.2 384 400L384 496C384 504.8 391.2 512 400 512L496 512C504.8 512 512 504.8 512 496L512 400C512 391.2 504.8 384 496 384L400 384zM352 400C352 373.5 373.5 352 400 352L496 352C522.5 352 544 373.5 544 400L544 496C544 522.5 522.5 544 496 544L400 544C373.5 544 352 522.5 352 496L352 400z"+ />+ </svg>+);diff --git a/packages/studio/src/state/modals.ts b/packages/studio/src/state/modals.tsindex 82ec1a574a..6458b404ab 100644--- a/packages/studio/src/state/modals.ts+++ b/packages/studio/src/state/modals.ts@@ -180,12 +180,10 @@ export type ModalState =type: 'input-props-override';}| {- type: 'configure-license';+ type: 'settings';+ initialTab: 'apps' | 'license';initialPublicLicenseKey: string | null;}- | {- type: 'configure-default-editor';- }| RenderModalState| WebRenderModalState| {