@remotion/studio-server 4.0.508 → 4.0.510

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/canvas-capture/generate-canvas-capture-composition.d.ts +14 -0
  2. package/dist/canvas-capture/generate-canvas-capture-composition.js +174 -0
  3. package/dist/codemods/delete-jsx-node.js +1 -1
  4. package/dist/codemods/duplicate-composition.js +8 -6
  5. package/dist/codemods/duplicate-jsx-node.js +1 -1
  6. package/dist/codemods/get-node-path-remappings.d.ts +4 -1
  7. package/dist/codemods/get-node-path-remappings.js +2 -1
  8. package/dist/codemods/recast-mods.js +13 -0
  9. package/dist/codemods/reorder-sequence.js +1 -1
  10. package/dist/codemods/split-jsx-sequence.d.ts +3 -4
  11. package/dist/codemods/split-jsx-sequence.js +6 -60
  12. package/dist/codemods/update-keyframes/update-keyframes.js +17 -10
  13. package/dist/helpers/git-client-registry.d.ts +30 -0
  14. package/dist/helpers/git-client-registry.js +130 -0
  15. package/dist/helpers/github-desktop-artwork.d.ts +1 -0
  16. package/dist/helpers/github-desktop-artwork.js +6 -0
  17. package/dist/helpers/resolve-composition-component.d.ts +2 -0
  18. package/dist/helpers/resolve-composition-component.js +4 -2
  19. package/dist/index.d.ts +2 -1
  20. package/dist/preview-server/api-routes.js +2 -0
  21. package/dist/preview-server/routes/app-icon.js +12 -7
  22. package/dist/preview-server/routes/apply-codemod.js +19 -3
  23. package/dist/preview-server/routes/default-coding-agent.js +3 -0
  24. package/dist/preview-server/routes/insert-jsx-element.js +7 -1
  25. package/dist/preview-server/routes/open-in-git-client.d.ts +3 -0
  26. package/dist/preview-server/routes/open-in-git-client.js +13 -0
  27. package/dist/preview-server/routes/save-sequence-props.js +19 -3
  28. package/dist/preview-server/routes/split-jsx-sequence.js +7 -2
  29. package/dist/preview-server/start-server.d.ts +1 -0
  30. package/dist/preview-server/start-server.js +1 -0
  31. package/dist/routes.d.ts +2 -1
  32. package/dist/routes.js +4 -2
  33. package/dist/start-studio.d.ts +2 -1
  34. package/dist/start-studio.js +2 -1
  35. package/package.json +8 -8
@@ -27,6 +27,15 @@ const stringifySequencePropEditValue = (value) => {
27
27
  }
28
28
  return JSON.stringify(value);
29
29
  };
30
+ const stringifySequencePropSourceEdit = (sourceEdit, fallbackValue) => {
31
+ if ((sourceEdit === null || sourceEdit === void 0 ? void 0 : sourceEdit.type) !== 'clipboard-param') {
32
+ return stringifySequencePropEditValue(fallbackValue);
33
+ }
34
+ if (sourceEdit.param.type === 'static') {
35
+ return stringifySequencePropEditValue(sourceEdit.param.value);
36
+ }
37
+ return `${sourceEdit.param.interpolationFunction}(frame, ${JSON.stringify(sourceEdit.param.keyframes.map((keyframe) => keyframe.frame))}, ${JSON.stringify(sourceEdit.param.keyframes.map((keyframe) => keyframe.value))})`;
38
+ };
30
39
  const groupBy = (items, getKey) => {
31
40
  var _a;
32
41
  const groups = new Map();
@@ -39,7 +48,7 @@ const groupBy = (items, getKey) => {
39
48
  return [...groups.values()];
40
49
  };
41
50
  const convertSequencePropEditToCodemodChange = (edit) => {
42
- var _a;
51
+ var _a, _b;
43
52
  return {
44
53
  nodePath: edit.nodePath.nodePath,
45
54
  updates: [
@@ -48,6 +57,9 @@ const convertSequencePropEditToCodemodChange = (edit) => {
48
57
  value: edit.value,
49
58
  defaultValue: edit.defaultValue,
50
59
  googleFont: ((_a = edit.sourceEdit) === null || _a === void 0 ? void 0 : _a.type) === 'google-font' ? edit.sourceEdit.font : null,
60
+ clipboardParam: ((_b = edit.sourceEdit) === null || _b === void 0 ? void 0 : _b.type) === 'clipboard-param'
61
+ ? edit.sourceEdit.param
62
+ : null,
51
63
  },
52
64
  ],
53
65
  schema: edit.schema,
@@ -98,7 +110,7 @@ const saveSequencePropsHandler = ({ input: { edits, addedKeyframes, movedKeyfram
98
110
  nodePath: edit.nodePath,
99
111
  key: edit.key,
100
112
  value: parsedValue,
101
- valueString: stringifySequencePropEditValue(parsedValue),
113
+ valueString: stringifySequencePropSourceEdit(edit.sourceEdit, parsedValue),
102
114
  defaultValue: parsedDefaultValue,
103
115
  defaultValueString: parsedDefaultValue !== null
104
116
  ? JSON.stringify(parsedDefaultValue)
@@ -179,6 +191,7 @@ const saveSequencePropsHandler = ({ input: { edits, addedKeyframes, movedKeyfram
179
191
  const snapshots = [];
180
192
  const outputByPath = new Map();
181
193
  const resultByIndex = new Map();
194
+ const updatedNodePaths = new Map();
182
195
  const sequenceKeyframeLogs = [];
183
196
  const captionPatchLogs = [];
184
197
  const effectKeyframeLogs = [];
@@ -204,7 +217,9 @@ const saveSequencePropsHandler = ({ input: { edits, addedKeyframes, movedKeyfram
204
217
  logLine: result.logLine,
205
218
  removedProps: result.removedProps,
206
219
  formatted,
220
+ newNodePath: result.newNodePath,
207
221
  });
222
+ updatedNodePaths.set(`${absolutePath}:${JSON.stringify(edit.nodePath.nodePath)}`, result.newNodePath);
208
223
  }
209
224
  }
210
225
  for (const captionPatchRequest of group.captionPatches) {
@@ -456,6 +471,7 @@ const saveSequencePropsHandler = ({ input: { edits, addedKeyframes, movedKeyfram
456
471
  ])).values(),
457
472
  ];
458
473
  const results = statusTargets.map((target) => {
474
+ var _a;
459
475
  const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
460
476
  remotionRoot,
461
477
  fileName: target.fileName,
@@ -469,7 +485,7 @@ const saveSequencePropsHandler = ({ input: { edits, addedKeyframes, movedKeyfram
469
485
  fileContents: output,
470
486
  keys: (0, studio_shared_1.getAllSchemaKeys)(target.schema),
471
487
  assetKeys: (0, studio_shared_1.getAssetSchemaKeys)(target.schema),
472
- nodePath: target.nodePath.nodePath,
488
+ nodePath: (_a = updatedNodePaths.get(`${absolutePath}:${JSON.stringify(target.nodePath.nodePath)}`)) !== null && _a !== void 0 ? _a : target.nodePath.nodePath,
473
489
  componentIdentity: null,
474
490
  effects: [],
475
491
  videoConfigValues: target.nodePath.videoConfigValues,
@@ -11,7 +11,7 @@ const sequence_node_path_mutation_1 = require("../sequence-node-path-mutation");
11
11
  const undo_stack_1 = require("../undo-stack");
12
12
  const log_update_1 = require("./log-updates/log-update");
13
13
  const source_file_write_queue_1 = require("./source-file-write-queue");
14
- const splitJsxSequenceHandler = ({ input: { fileName, nodePath, splitFrame }, remotionRoot, logLevel }) => (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
14
+ const splitJsxSequenceHandler = ({ input: { fileName, nodePath, sequenceKeys, splitFrame }, remotionRoot, logLevel, }) => (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
15
15
  try {
16
16
  renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[split-jsx-sequence] Received request for fileName="${fileName}" at frame ${splitFrame}`);
17
17
  const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
@@ -20,7 +20,12 @@ const splitJsxSequenceHandler = ({ input: { fileName, nodePath, splitFrame }, re
20
20
  action: 'modify',
21
21
  });
22
22
  const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
23
- const { output, formatted, nodeLabel, logLine, nodePathRemappings } = await (0, split_jsx_sequence_1.splitJsxSequence)({ input: fileContents, nodePath, splitFrame });
23
+ const { output, formatted, nodeLabel, logLine, nodePathRemappings } = await (0, split_jsx_sequence_1.splitJsxSequence)({
24
+ input: fileContents,
25
+ nodePath,
26
+ sequenceKeys,
27
+ splitFrame,
28
+ });
24
29
  const nodePathMutation = (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)([
25
30
  {
26
31
  absolutePath,
@@ -37,6 +37,7 @@ export declare const startServer: (options: {
37
37
  binariesDirectory: string | null;
38
38
  forceIPv4: boolean;
39
39
  getAudioLatencyHint: () => AudioContextLatencyCategory | null;
40
+ getExperimentalKeepAudioContextAlive: () => boolean;
40
41
  getPreviewSampleRate: () => number | null;
41
42
  enableCrossSiteIsolation: boolean;
42
43
  forceNew: boolean;
@@ -99,6 +99,7 @@ const startServer = async (options) => {
99
99
  gitSource: options.gitSource,
100
100
  binariesDirectory: options.binariesDirectory,
101
101
  getAudioLatencyHint: options.getAudioLatencyHint,
102
+ getExperimentalKeepAudioContextAlive: options.getExperimentalKeepAudioContextAlive,
102
103
  getPreviewSampleRate: options.getPreviewSampleRate,
103
104
  enableCrossSiteIsolation: options.enableCrossSiteIsolation,
104
105
  getStudioRuntimeConfig: options.getStudioRuntimeConfig,
package/dist/routes.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { DefaultEditor } from '@remotion/renderer';
3
3
  import type { GitSource, RenderDefaults, RenderJob, StudioRuntimeConfig } from '@remotion/studio-shared';
4
4
  import type { QueueMethods } from './preview-server/api-types';
5
5
  import type { LiveEventsServer } from './preview-server/live-events';
6
- export declare const handleRoutes: ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, logLevel, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, queueMethods: methods, gitSource, binariesDirectory, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, getStudioRuntimeConfig, getDefaultCodingAgent, getDefaultEditor, configFile, }: {
6
+ export declare const handleRoutes: ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, logLevel, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, queueMethods: methods, gitSource, binariesDirectory, getAudioLatencyHint, getExperimentalKeepAudioContextAlive, getPreviewSampleRate, enableCrossSiteIsolation, getStudioRuntimeConfig, getDefaultCodingAgent, getDefaultEditor, configFile, }: {
7
7
  staticHash: string;
8
8
  staticHashPrefix: string;
9
9
  outputHash: string;
@@ -24,6 +24,7 @@ export declare const handleRoutes: ({ staticHash, staticHashPrefix, outputHash,
24
24
  gitSource: GitSource | null;
25
25
  binariesDirectory: string | null;
26
26
  getAudioLatencyHint: () => AudioContextLatencyCategory | null;
27
+ getExperimentalKeepAudioContextAlive: () => boolean;
27
28
  getPreviewSampleRate: () => number | null;
28
29
  enableCrossSiteIsolation: boolean;
29
30
  getStudioRuntimeConfig: () => StudioRuntimeConfig;
package/dist/routes.js CHANGED
@@ -84,7 +84,7 @@ const handleRemotionConfig = (response, remotionRoot) => {
84
84
  response.end(JSON.stringify(body));
85
85
  return Promise.resolve();
86
86
  };
87
- const handleFallback = async ({ remotionRoot, hash, response, request, getCurrentInputProps, getEnvVariables, publicDir, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, getAudioLatencyHint, getPreviewSampleRate, gitSource, logLevel, enableCrossSiteIsolation, getStudioRuntimeConfig, getDefaultEditor, }) => {
87
+ const handleFallback = async ({ remotionRoot, hash, response, request, getCurrentInputProps, getEnvVariables, publicDir, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, getAudioLatencyHint, getExperimentalKeepAudioContextAlive, getPreviewSampleRate, gitSource, logLevel, enableCrossSiteIsolation, getStudioRuntimeConfig, getDefaultEditor, }) => {
88
88
  var _a, _b;
89
89
  const acceptsHtml = ((_a = request.headers.accept) !== null && _a !== void 0 ? _a : '').includes('text/html');
90
90
  if (request.method === 'GET' && acceptsHtml) {
@@ -149,6 +149,7 @@ const handleFallback = async ({ remotionRoot, hash, response, request, getCurren
149
149
  logLevel,
150
150
  mode: 'dev',
151
151
  audioLatencyHint: (_b = getAudioLatencyHint()) !== null && _b !== void 0 ? _b : 'playback',
152
+ experimentalKeepAudioContextAlive: getExperimentalKeepAudioContextAlive(),
152
153
  sampleRate: getPreviewSampleRate(),
153
154
  studioRuntimeConfig: getStudioRuntimeConfig(),
154
155
  }));
@@ -253,7 +254,7 @@ const handleBeep = (_, response) => {
253
254
  readStream.pipe(response);
254
255
  return Promise.resolve();
255
256
  };
256
- const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, logLevel, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, queueMethods: methods, gitSource, binariesDirectory, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, getStudioRuntimeConfig, getDefaultCodingAgent, getDefaultEditor, configFile, }) => {
257
+ const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPrefix, request, response, liveEventsServer, getCurrentInputProps, getEnvVariables, remotionRoot, entryPoint, publicDir, logLevel, getRenderQueue, getRenderDefaults, getNumberOfAudioTags, queueMethods: methods, gitSource, binariesDirectory, getAudioLatencyHint, getExperimentalKeepAudioContextAlive, getPreviewSampleRate, enableCrossSiteIsolation, getStudioRuntimeConfig, getDefaultCodingAgent, getDefaultEditor, configFile, }) => {
257
258
  const url = new URL(request.url, 'http://localhost');
258
259
  if (url.pathname === '/api/file-source') {
259
260
  return handleFileSource({
@@ -397,6 +398,7 @@ const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPref
397
398
  gitSource,
398
399
  logLevel,
399
400
  getAudioLatencyHint,
401
+ getExperimentalKeepAudioContextAlive,
400
402
  getPreviewSampleRate,
401
403
  enableCrossSiteIsolation,
402
404
  getStudioRuntimeConfig,
@@ -7,7 +7,7 @@ export type StartStudioResult = {
7
7
  } | {
8
8
  type: 'already-running';
9
9
  };
10
- export declare const startStudio: ({ browserArgs, browserFlag, shouldOpenBrowser, fullEntryPath, logLevel, getCurrentInputProps, getEnvVariables, desiredPort, remotionRoot, relativePublicDir, bundlerOverride, rspackOverride, webpackOverride, poll, getRenderDefaults, getRenderQueue, getNumberOfAudioTags, queueMethods, previewEntry, gitSource, binariesDirectory, forceIPv4, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, forceNew, rspack, getStudioRuntimeConfig, getDefaultCodingAgent, getDefaultEditor, configFile, }: {
10
+ export declare const startStudio: ({ browserArgs, browserFlag, shouldOpenBrowser, fullEntryPath, logLevel, getCurrentInputProps, getEnvVariables, desiredPort, remotionRoot, relativePublicDir, bundlerOverride, rspackOverride, webpackOverride, poll, getRenderDefaults, getRenderQueue, getNumberOfAudioTags, queueMethods, previewEntry, gitSource, binariesDirectory, forceIPv4, getAudioLatencyHint, getExperimentalKeepAudioContextAlive, getPreviewSampleRate, enableCrossSiteIsolation, forceNew, rspack, getStudioRuntimeConfig, getDefaultCodingAgent, getDefaultEditor, configFile, }: {
11
11
  browserArgs: string;
12
12
  browserFlag: string;
13
13
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
@@ -26,6 +26,7 @@ export declare const startStudio: ({ browserArgs, browserFlag, shouldOpenBrowser
26
26
  getRenderQueue: () => RenderJob[];
27
27
  getNumberOfAudioTags: () => number;
28
28
  getAudioLatencyHint: () => AudioContextLatencyCategory | null;
29
+ getExperimentalKeepAudioContextAlive: () => boolean;
29
30
  getPreviewSampleRate: () => number | null;
30
31
  enableCrossSiteIsolation: boolean;
31
32
  queueMethods: QueueMethods;
@@ -19,7 +19,7 @@ const public_folder_1 = require("./preview-server/public-folder");
19
19
  const start_server_1 = require("./preview-server/start-server");
20
20
  const server_ready_1 = require("./server-ready");
21
21
  const watch_root_file_1 = require("./watch-root-file");
22
- const startStudio = async ({ browserArgs, browserFlag, shouldOpenBrowser, fullEntryPath, logLevel, getCurrentInputProps, getEnvVariables, desiredPort, remotionRoot, relativePublicDir, bundlerOverride, rspackOverride, webpackOverride, poll, getRenderDefaults, getRenderQueue, getNumberOfAudioTags, queueMethods, previewEntry, gitSource, binariesDirectory, forceIPv4, getAudioLatencyHint, getPreviewSampleRate, enableCrossSiteIsolation, forceNew, rspack, getStudioRuntimeConfig, getDefaultCodingAgent, getDefaultEditor, configFile, }) => {
22
+ const startStudio = async ({ browserArgs, browserFlag, shouldOpenBrowser, fullEntryPath, logLevel, getCurrentInputProps, getEnvVariables, desiredPort, remotionRoot, relativePublicDir, bundlerOverride, rspackOverride, webpackOverride, poll, getRenderDefaults, getRenderQueue, getNumberOfAudioTags, queueMethods, previewEntry, gitSource, binariesDirectory, forceIPv4, getAudioLatencyHint, getExperimentalKeepAudioContextAlive, getPreviewSampleRate, enableCrossSiteIsolation, forceNew, rspack, getStudioRuntimeConfig, getDefaultCodingAgent, getDefaultEditor, configFile, }) => {
23
23
  try {
24
24
  if (typeof Bun === 'undefined') {
25
25
  process.title = 'node (npx remotion studio)';
@@ -88,6 +88,7 @@ const startStudio = async ({ browserArgs, browserFlag, shouldOpenBrowser, fullEn
88
88
  binariesDirectory,
89
89
  forceIPv4,
90
90
  getAudioLatencyHint,
91
+ getExperimentalKeepAudioContextAlive,
91
92
  getPreviewSampleRate,
92
93
  enableCrossSiteIsolation,
93
94
  forceNew,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio-server"
4
4
  },
5
5
  "name": "@remotion/studio-server",
6
- "version": "4.0.508",
6
+ "version": "4.0.510",
7
7
  "description": "Run a Remotion Studio with a server backend",
8
8
  "main": "dist",
9
9
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "access": "public"
24
24
  },
25
25
  "dependencies": {
26
- "@remotion/studio-protocol": "4.0.508",
26
+ "@remotion/studio-protocol": "4.0.510",
27
27
  "@babel/types": "7.24.0",
28
28
  "@babel/parser": "7.24.1",
29
29
  "@svgr/core": "8.1.0",
@@ -32,12 +32,12 @@
32
32
  "semver": "7.5.3",
33
33
  "zod": "4.4.3",
34
34
  "prettier": "3.8.1",
35
- "remotion": "4.0.508",
35
+ "remotion": "4.0.510",
36
36
  "recast": "0.23.11",
37
- "@remotion/bundler": "4.0.508",
38
- "@remotion/renderer": "4.0.508",
39
- "@remotion/studio-codemods": "4.0.508",
40
- "@remotion/studio-shared": "4.0.508",
37
+ "@remotion/bundler": "4.0.510",
38
+ "@remotion/renderer": "4.0.510",
39
+ "@remotion/studio-codemods": "4.0.510",
40
+ "@remotion/studio-shared": "4.0.510",
41
41
  "memfs": "3.4.3",
42
42
  "open": "8.4.2"
43
43
  },
@@ -45,7 +45,7 @@
45
45
  "ast-types": "0.16.1",
46
46
  "react": "19.2.3",
47
47
  "@types/semver": "7.5.3",
48
- "@remotion/eslint-config-internal": "4.0.508",
48
+ "@remotion/eslint-config-internal": "4.0.510",
49
49
  "eslint": "9.19.0",
50
50
  "@types/node": "20.12.14",
51
51
  "@typescript/native-preview": "7.0.0-dev.20260217.1"