π₯ Make videos programmatically with React
Docs: Document Studio interactivity (#8284)
Jonny Burgered4200f51d8d
diff --git a/packages/docs/docs/studio/code-edits.mdx b/packages/docs/docs/studio/code-edits.mdxdeleted file mode 100644index 0c540ab3d4..0000000000--- a/packages/docs/docs/studio/code-edits.mdx+++ /dev/null@@ -1,65 +0,0 @@-----image: /generated/articles-docs-studio-code-edits.png-title: Code Edits-crumb: "Remotion Studio"------# Code Edits<AvailableFrom v="4.0.461" />--The Studio does support some ways to edit your codebase visually.--## Duplicating, renaming and deleting compositions--You can right-click a composition in the left sidebar and select `Duplicate...`, `Rename...` or `Delete...`.--<img src="/composition-actions.png" alt="Duplicate, rename, delete and copy ID actions in the composition right-click menu" />--These actions edit the file that registers the [`<Composition>`](/docs/composition) or [`<Still>`](/docs/still) tag.--When deleting a composition, the component that was rendered by the composition remains in your codebase.--## Changing props of `<Sequence>`'s--Some props of [`<Sequence>`](/docs/sequence)'s can be changed visually through the Studio.-Some other components which inherit from `<Sequence>`, such as [`<Video>`](/docs/media/video), [`<Audio>`](/docs/media/audio), [`<Img>`](/docs/img) and [`<HtmlInCanvas>`](/docs/remotion/html-in-canvas) also allow this.--<img src="/code-edits.png" alt="Code Edits" />--When a value is changed, the value is written back to the codebase immediately.--All `<Sequence>`'s which are in the same location are updated.-If in the code, sequences are programmatically duplicated (such as by calling `.map()`) on an array, all instances receive the same update.--Edits can be undone by pressing <kbd>β/Ctrl</kbd> + <kbd>Z</kbd> in the Studio.-Redo can also be performed by pressing <kbd>β/Ctrl</kbd> + <kbd>Y</kbd> in the Studio.--Prop updates bypass Fast Refresh for reduced latency and are synced to other instances of the Studio once the drag sliders are released.--If the code is being edited in the meanwhile, the undo stack is being cleared.--### Future plans--It is not yet possible:--- to enable these controls for your own components-- to edit [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes) of a `<Sequence>` and [`trimBefore`](/docs/media/video#trimbefore) and [`trimAfter`](/docs/media/video#trimafter) of a [`<Video>`](/docs/media/video)--We plan to add this functionality in the future.--## Duplicating and deleting sequences--You can right-click on a sequence in the timeline and select `Duplicate` or `Delete` to duplicate or delete the sequence.--<img src="/renaming-sequences.png" />--If multiple sequences are in the same location, all will be duplicated or deleted. In this case, a dialog will be shown asking you to confirm.--## Deleting effects--You can right-click on an effect in the expanded timeline and select `Delete` to remove it from the `effects` prop.--<img src="/deleting-effects.png" alt="Deleting effects" />--Deleting effects can be undone by pressing <kbd>β/Ctrl</kbd> + <kbd>Z</kbd> in the Studio.--This is possible if the effects are written as an inline array. Effects from computed arrays cannot be deleted visually.diff --git a/packages/docs/docs/studio/interactivity.mdx b/packages/docs/docs/studio/interactivity.mdxnew file mode 100644index 0000000000..ddb6d0e615--- /dev/null+++ b/packages/docs/docs/studio/interactivity.mdx@@ -0,0 +1,60 @@+---+image: /generated/articles-docs-studio-interactivity.png+title: Interactivity+crumb: "Remotion Studio"+---++# Interactivity<AvailableFrom v="4.0.475" />++Studio interactivity means visual edits that are written back to your codebase.++Edits can be undone with <kbd>β/Ctrl</kbd> + <kbd>Z</kbd> and redone with <kbd>β/Ctrl</kbd> + <kbd>Y</kbd>.++## Selecting edit targets++- Select sequences, sequence props, effects, effect props, keyframes and easing segments.+- Hold <kbd>Shift</kbd> to select ranges.+- Hold <kbd>β/Ctrl</kbd> to toggle items.+- Drag on the timeline to marquee-select sequences, keyframes and easing segments.+- Press <kbd>β/Ctrl</kbd> + <kbd>A</kbd> to select all sequence rows.+- Use outlines, the selection palette and row highlights to see which items will be affected by the next edit.++## Canvas edits++- Selectable sequences show outlines directly in the preview when they can be edited from the canvas.+- Drag selected outlines to move sequences by updating `style.translate`.+- Move multiple selected sequences together.+- Hold <kbd>Shift</kbd> while dragging outlines to lock movement to one axis.+- Drag outline edges to scale selected sequences when `style.scale` is editable.+- Drag outline corners to rotate selected sequences when `style.rotate` is editable.+- Drag the transform-origin handle to move the transform origin. Studio compensates `style.translate` so the visual position stays stable.+- Edit keyframed `style.translate`, `style.rotate` or `style.transformOrigin` values from the canvas. Drags create or update keyframes at the current frame.++## Effects in the preview++- Drop effects onto outlined sequences when the sequence supports effects.+- Drag UV-coordinate handles for selected effects and effect props.+- Use connected handle lines to see which handles belong together.+- Copy selected effects with <kbd>β/Ctrl</kbd> + <kbd>C</kbd> and paste them with <kbd>β/Ctrl</kbd> + <kbd>V</kbd>.+- Copy and paste individual effect prop values, including keyframed effect params where supported.++## Keyframes++- Select keyframes in the timeline.+- Drag selected keyframes horizontally to change their frame.+- Move multiple selected keyframes together.+- Move keyframes for sequence props and effect props.+- Press <kbd>Delete</kbd> or <kbd>Backspace</kbd> to delete selected keyframes where supported.++## Easing segments++- Select easing segments between keyframes.+- Open the easing context menu to set `Linear`, choose a preset or open the custom easing editor.+- Apply easing edits to all selected easing segments.+- Press <kbd>Delete</kbd> or <kbd>Backspace</kbd> to reset selected easing segments to linear when only easing segments are selected.++## Deleting, resetting and duplicating++- Press <kbd>Delete</kbd> or <kbd>Backspace</kbd> to delete selected keyframes, sequences, effects or all effects where supported.+- Reset selected sequence or effect props to their defaults with <kbd>Delete</kbd> or <kbd>Backspace</kbd> when deletion does not apply.+- Press <kbd>β/Ctrl</kbd> + <kbd>D</kbd> to duplicate selected sequences.diff --git a/packages/docs/docs/studio/shortcuts.mdx b/packages/docs/docs/studio/shortcuts.mdxindex a6946e67b0..0473a3cabd 100644--- a/packages/docs/docs/studio/shortcuts.mdx+++ b/packages/docs/docs/studio/shortcuts.mdx@@ -268,6 +268,69 @@ Pause and return to where playback started</tr></table>+### Interactivity++<table>+ <tr>+ <td>+ <kbd>Shift</kbd>+ </td>+ <td>Select a range of timeline items</td>+ </tr>+ <tr>+ <td>+ <kbd>β/Ctrl</kbd>+ </td>+ <td>Toggle timeline items in the selection</td>+ </tr>+ <tr>+ <td>+ <kbd>β/Ctrl</kbd>+ <div style={{width: 2, display: 'inline-block'}} />+ <kbd>A</kbd>+ </td>+ <td>Select all sequence rows</td>+ </tr>+ <tr>+ <td>+ <kbd>Shift</kbd>+ </td>+ <td>Axis-lock canvas outline dragging</td>+ </tr>+ <tr>+ <td>+ <kbd>β/Ctrl</kbd>+ <div style={{width: 2, display: 'inline-block'}} />+ <kbd>D</kbd>+ </td>+ <td>Duplicate selected sequences</td>+ </tr>+ <tr>+ <td>+ <kbd>β/Ctrl</kbd>+ <div style={{width: 2, display: 'inline-block'}} />+ <kbd>C</kbd>+ </td>+ <td>Copy selected effects or effect prop values</td>+ </tr>+ <tr>+ <td>+ <kbd>β/Ctrl</kbd>+ <div style={{width: 2, display: 'inline-block'}} />+ <kbd>V</kbd>+ </td>+ <td>Paste effects or effect prop values</td>+ </tr>+ <tr>+ <td>+ <kbd>Delete</kbd>+ <div style={{width: 2, display: 'inline-block'}} />+ <kbd>Backspace</kbd>+ </td>+ <td>Delete selected keyframes, sequences or effects where supported; otherwise reset selected props or easing segments</td>+ </tr>+</table>+### Navigation<table>diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.tsindex b60d816175..afd05bbc6e 100644--- a/packages/docs/sidebars.ts+++ b/packages/docs/sidebars.ts@@ -1281,7 +1281,7 @@ const sidebars: SidebarsConfig = {'studio/studio','studio/shortcuts','studio/quick-switcher',- 'studio/code-edits',+ 'studio/interactivity','studio/deploy-static','studio/deploy-server',],diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.tsindex 62f2af25e4..ddd0e4bd29 100644--- a/packages/docs/src/data/articles.ts+++ b/packages/docs/src/data/articles.ts@@ -6384,15 +6384,6 @@ export const articles = [noAi: false,slug: 'studio/api',},- {- id: 'studio/code-edits',- title: 'Code Edits',- relativePath: 'docs/studio/code-edits.mdx',- compId: 'articles-docs-studio-code-edits',- crumb: 'Remotion Studio',- noAi: false,- slug: 'studio/code-edits',- },{id: 'studio/delete-static-file',title: 'deleteStaticFile()',@@ -6447,6 +6438,15 @@ export const articles = [noAi: false,slug: 'studio/go-to-composition',},+ {+ id: 'studio/interactivity',+ title: 'Interactivity',+ relativePath: 'docs/studio/interactivity.mdx',+ compId: 'articles-docs-studio-interactivity',+ crumb: 'Remotion Studio',+ noAi: false,+ slug: 'studio/interactivity',+ },{id: 'studio/pause',title: 'pause()',diff --git a/packages/docs/static/code-edits.png b/packages/docs/static/code-edits.pngdeleted file mode 100644index ce8a5098f4..0000000000Binary files a/packages/docs/static/code-edits.png and /dev/null differdiff --git a/packages/docs/static/composition-actions.png b/packages/docs/static/composition-actions.pngdeleted file mode 100644index a75c118e5a..0000000000Binary files a/packages/docs/static/composition-actions.png and /dev/null differdiff --git a/packages/docs/static/deleting-effects.png b/packages/docs/static/deleting-effects.pngdeleted file mode 100644index ba0553978a..0000000000Binary files a/packages/docs/static/deleting-effects.png and /dev/null differdiff --git a/packages/docs/static/generated/articles-docs-studio-code-edits.png b/packages/docs/static/generated/articles-docs-studio-code-edits.pngdeleted file mode 100644index d083658a0d..0000000000Binary files a/packages/docs/static/generated/articles-docs-studio-code-edits.png and /dev/null differdiff --git a/packages/docs/static/generated/articles-docs-studio-interactivity.png b/packages/docs/static/generated/articles-docs-studio-interactivity.pngnew file mode 100644index 0000000000..7a67b08acbBinary files /dev/null and b/packages/docs/static/generated/articles-docs-studio-interactivity.png differdiff --git a/packages/docs/static/renaming-sequences.png b/packages/docs/static/renaming-sequences.pngdeleted file mode 100644index 4e341c704b..0000000000Binary files a/packages/docs/static/renaming-sequences.png and /dev/null differdiff --git a/packages/docs/vercel.ts b/packages/docs/vercel.tsindex bfb0500f52..8c40226dc9 100644--- a/packages/docs/vercel.ts+++ b/packages/docs/vercel.ts@@ -314,6 +314,9 @@ export const config: VercelConfig = {),routes.redirect('/docs/video', '/docs/html5-video', {permanent: false}),routes.redirect('/docs/audio', '/docs/html5-audio', {permanent: false}),+ routes.redirect('/docs/studio/code-edits', '/docs/studio/interactivity', {+ permanent: true,+ }),routes.redirect('/terms', 'https://remotion.pro/terms', {permanent: false,}),diff --git a/packages/studio/src/components/KeyboardShortcutsExplainer.tsx b/packages/studio/src/components/KeyboardShortcutsExplainer.tsxindex c389fc2fb7..b14824c718 100644--- a/packages/studio/src/components/KeyboardShortcutsExplainer.tsx+++ b/packages/studio/src/components/KeyboardShortcutsExplainer.tsx@@ -306,6 +306,60 @@ export const KeyboardShortcutsExplainer: React.FC = () => {</div><div style={right}>Redo</div></Row>+ <br />+ <div style={title}>Interactivity</div>+ <Row align="center">+ <div style={left}>+ <kbd style={key}>Shift</kbd>+ </div>+ <div style={right}>Select range / axis lock drag</div>+ </Row>+ <Row align="center">+ <div style={left}>+ <kbd style={key}>{cmdOrCtrlCharacter}</kbd>+ </div>+ <div style={right}>Toggle selection</div>+ </Row>+ <Row align="center">+ <div style={left}>+ <kbd style={key}>{cmdOrCtrlCharacter}</kbd>+ <Spacing x={0.3} />+ <kbd style={key}>A</kbd>+ </div>+ <div style={right}>Select sequence rows</div>+ </Row>+ <Row align="center">+ <div style={left}>+ <kbd style={key}>{cmdOrCtrlCharacter}</kbd>+ <Spacing x={0.3} />+ <kbd style={key}>D</kbd>+ </div>+ <div style={right}>Duplicate sequences</div>+ </Row>+ <Row align="center">+ <div style={left}>+ <kbd style={key}>{cmdOrCtrlCharacter}</kbd>+ <Spacing x={0.3} />+ <kbd style={key}>C</kbd>+ </div>+ <div style={right}>Copy effects / values</div>+ </Row>+ <Row align="center">+ <div style={left}>+ <kbd style={key}>{cmdOrCtrlCharacter}</kbd>+ <Spacing x={0.3} />+ <kbd style={key}>V</kbd>+ </div>+ <div style={right}>Paste effects / values</div>+ </Row>+ <Row align="center">+ <div style={left}>+ <kbd style={key}>Del</kbd>+ <Spacing x={0.3} />+ <kbd style={key}>β«</kbd>+ </div>+ <div style={right}>Delete / reset selection</div>+ </Row>{process.env.ASK_AI_ENABLED && (<><br />