@remotion/studio-server 4.0.506 → 4.0.508
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.
- package/dist/codemods/delete-jsx-node.d.ts +4 -0
- package/dist/codemods/delete-jsx-node.js +8 -0
- package/dist/codemods/duplicate-jsx-node.d.ts +2 -0
- package/dist/codemods/duplicate-jsx-node.js +8 -0
- package/dist/codemods/effect-param-expression.js +2 -0
- package/dist/codemods/get-node-path-remappings.d.ts +13 -0
- package/dist/codemods/get-node-path-remappings.js +87 -0
- package/dist/codemods/reorder-sequence.d.ts +2 -1
- package/dist/codemods/reorder-sequence.js +8 -0
- package/dist/codemods/split-jsx-sequence.d.ts +2 -0
- package/dist/codemods/split-jsx-sequence.js +8 -0
- package/dist/codemods/update-keyframes/update-keyframes.js +2 -0
- package/dist/file-watcher.d.ts +11 -1
- package/dist/file-watcher.js +16 -5
- package/dist/helpers/coding-agent-registry.d.ts +34 -0
- package/dist/helpers/coding-agent-registry.js +442 -21
- package/dist/helpers/editor-registry.d.ts +1 -0
- package/dist/helpers/editor-registry.js +31 -3
- package/dist/helpers/finder-artwork.d.ts +1 -0
- package/dist/helpers/finder-artwork.js +4 -0
- package/dist/helpers/open-in-editor.js +5 -5
- package/dist/helpers/parse-keyframe-easing-expression.js +3 -0
- package/dist/helpers/resolve-composition-component.d.ts +2 -1
- package/dist/helpers/resolve-composition-component.js +60 -68
- package/dist/helpers/resolve-editor.d.ts +2 -0
- package/dist/helpers/resolve-editor.js +4 -1
- package/dist/helpers/terminal-artwork.d.ts +6 -0
- package/dist/helpers/terminal-artwork.js +14 -0
- package/dist/helpers/terminal-registry.d.ts +36 -0
- package/dist/helpers/terminal-registry.js +401 -0
- package/dist/index.d.ts +7 -2
- package/dist/preview-server/api-routes.js +7 -4
- package/dist/preview-server/handler.d.ts +1 -1
- package/dist/preview-server/live-events.d.ts +1 -0
- package/dist/preview-server/live-events.js +3 -1
- package/dist/preview-server/routes/add-effect-keyframe.js +7 -1
- package/dist/preview-server/routes/add-effect.js +7 -1
- package/dist/preview-server/routes/add-keyframes.js +10 -2
- package/dist/preview-server/routes/add-render.js +2 -0
- package/dist/preview-server/routes/add-sequence-keyframe.js +7 -1
- package/dist/preview-server/routes/app-icon.d.ts +6 -0
- package/dist/preview-server/routes/app-icon.js +66 -0
- package/dist/preview-server/routes/apply-codemod.js +15 -2
- package/dist/preview-server/routes/apply-visual-control-change.js +7 -1
- package/dist/preview-server/routes/batch-update-keyframe-settings.js +10 -2
- package/dist/preview-server/routes/can-update-sequence-props.d.ts +1 -0
- package/dist/preview-server/routes/can-update-sequence-props.js +33 -9
- package/dist/preview-server/routes/copy-render-output-to-asset.d.ts +3 -0
- package/dist/preview-server/routes/copy-render-output-to-asset.js +58 -0
- package/dist/preview-server/routes/default-coding-agent.d.ts +2 -6
- package/dist/preview-server/routes/default-coding-agent.js +19 -88
- package/dist/preview-server/routes/default-editor.d.ts +1 -6
- package/dist/preview-server/routes/default-editor.js +13 -113
- package/dist/preview-server/routes/delete-effect.js +7 -1
- package/dist/preview-server/routes/delete-jsx-node.js +16 -2
- package/dist/preview-server/routes/delete-keyframes.js +10 -2
- package/dist/preview-server/routes/duplicate-effect.js +7 -1
- package/dist/preview-server/routes/duplicate-jsx-node.js +17 -5
- package/dist/preview-server/routes/insert-element.js +23 -3
- package/dist/preview-server/routes/insert-jsx-element.js +17 -2
- package/dist/preview-server/routes/move-keyframes.js +10 -2
- package/dist/preview-server/routes/open-in-editor.js +1 -1
- package/dist/preview-server/routes/open-in-terminal.d.ts +3 -0
- package/dist/preview-server/routes/open-in-terminal.js +17 -0
- package/dist/preview-server/routes/paste-effects.js +7 -1
- package/dist/preview-server/routes/reorder-effect.js +7 -1
- package/dist/preview-server/routes/reorder-sequence.js +17 -2
- package/dist/preview-server/routes/save-effect-props.js +7 -1
- package/dist/preview-server/routes/save-multiple-effect-props.js +10 -2
- package/dist/preview-server/routes/save-sequence-props.js +10 -2
- package/dist/preview-server/routes/split-jsx-sequence.js +17 -6
- package/dist/preview-server/routes/update-config.d.ts +7 -0
- package/dist/preview-server/routes/update-config.js +193 -0
- package/dist/preview-server/routes/update-default-props.js +7 -1
- package/dist/preview-server/routes/update-effect-keyframe-settings.js +7 -1
- package/dist/preview-server/routes/update-sequence-keyframe-settings.js +7 -1
- package/dist/preview-server/sequence-node-path-mutation.d.ts +7 -0
- package/dist/preview-server/sequence-node-path-mutation.js +21 -0
- package/dist/preview-server/sequence-props-watchers.js +15 -6
- package/dist/preview-server/start-server.d.ts +1 -1
- package/dist/preview-server/studio-protocol/handle-discovery.js +3 -4
- package/dist/preview-server/studio-protocol/handle-install.js +1 -1
- package/dist/preview-server/studio-protocol/handle-license-key.js +2 -2
- package/dist/preview-server/studio-protocol/origin-policy.d.ts +2 -5
- package/dist/preview-server/studio-protocol/origin-policy.js +6 -30
- package/dist/preview-server/undo-stack.d.ts +7 -13
- package/dist/preview-server/undo-stack.js +58 -5
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +8 -1
- package/dist/start-studio.d.ts +1 -1
- package/package.json +8 -8
- package/web/coding-agent-icons/claude-code.png +0 -0
- package/web/coding-agent-icons/codex.png +0 -0
- package/web/coding-agent-icons/copilot.png +0 -0
- package/web/coding-agent-icons/cursor.png +0 -0
- package/dist/preview-server/routes/delete-effect-keyframe.d.ts +0 -3
- package/dist/preview-server/routes/delete-effect-keyframe.js +0 -89
- package/dist/preview-server/routes/delete-sequence-keyframe.d.ts +0 -3
- package/dist/preview-server/routes/delete-sequence-keyframe.js +0 -82
- package/dist/preview-server/routes/save-props-mutex.d.ts +0 -1
- package/dist/preview-server/routes/save-props-mutex.js +0 -11
|
@@ -17,6 +17,7 @@ const read_visual_control_values_1 = require("../codemods/read-visual-control-va
|
|
|
17
17
|
const file_watcher_1 = require("../file-watcher");
|
|
18
18
|
const format_log_file_location_1 = require("./format-log-file-location");
|
|
19
19
|
const live_events_1 = require("./live-events");
|
|
20
|
+
const sequence_node_path_mutation_1 = require("./sequence-node-path-mutation");
|
|
20
21
|
const watch_ignore_next_change_1 = require("./watch-ignore-next-change");
|
|
21
22
|
const MAX_ENTRIES = 100;
|
|
22
23
|
const undoStack = [];
|
|
@@ -56,7 +57,7 @@ const makeUndoEntry = ({ snapshots, description, entryType, suppressHmrOnFileRes
|
|
|
56
57
|
suppressHmrOnFileRestore,
|
|
57
58
|
};
|
|
58
59
|
};
|
|
59
|
-
function pushToUndoStack({ filePath, oldContents, newContents, logLevel, remotionRoot, logLine, description, entryType, suppressHmrOnFileRestore, }) {
|
|
60
|
+
function pushToUndoStack({ filePath, oldContents, newContents, logLevel, remotionRoot, logLine, description, entryType, suppressHmrOnFileRestore, nodePathRemappings, }) {
|
|
60
61
|
pushTransactionToUndoStack({
|
|
61
62
|
snapshots: [
|
|
62
63
|
{
|
|
@@ -64,6 +65,7 @@ function pushToUndoStack({ filePath, oldContents, newContents, logLevel, remotio
|
|
|
64
65
|
oldContents,
|
|
65
66
|
newContents,
|
|
66
67
|
logLine,
|
|
68
|
+
nodePathRemappings,
|
|
67
69
|
},
|
|
68
70
|
],
|
|
69
71
|
logLevel,
|
|
@@ -108,6 +110,7 @@ function pushToRedoStack({ filePath, oldContents, newContents, logLine, descript
|
|
|
108
110
|
oldContents,
|
|
109
111
|
newContents,
|
|
110
112
|
logLine,
|
|
113
|
+
nodePathRemappings: null,
|
|
111
114
|
},
|
|
112
115
|
],
|
|
113
116
|
description,
|
|
@@ -247,6 +250,29 @@ function popUndo() {
|
|
|
247
250
|
if (redoStack.length > MAX_ENTRIES) {
|
|
248
251
|
redoStack.shift();
|
|
249
252
|
}
|
|
253
|
+
const files = entry.snapshots.flatMap((snapshot) => {
|
|
254
|
+
if (snapshot.nodePathRemappings === null) {
|
|
255
|
+
return [];
|
|
256
|
+
}
|
|
257
|
+
return [
|
|
258
|
+
{
|
|
259
|
+
absolutePath: snapshot.filePath,
|
|
260
|
+
remappings: snapshot.nodePathRemappings.flatMap((remapping) => {
|
|
261
|
+
if (remapping.newNodePath === null) {
|
|
262
|
+
return [];
|
|
263
|
+
}
|
|
264
|
+
return [
|
|
265
|
+
{
|
|
266
|
+
oldNodePath: remapping.newNodePath,
|
|
267
|
+
newNodePath: remapping.oldNodePath,
|
|
268
|
+
},
|
|
269
|
+
];
|
|
270
|
+
}),
|
|
271
|
+
restoredNodePaths: snapshot.nodePathRemappings.flatMap((remapping) => remapping.newNodePath === null ? [remapping.oldNodePath] : []),
|
|
272
|
+
},
|
|
273
|
+
];
|
|
274
|
+
});
|
|
275
|
+
const nodePathMutation = files.length === 0 ? null : (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)(files);
|
|
250
276
|
for (const snapshot of entry.snapshots) {
|
|
251
277
|
suppressUndoStackInvalidation(snapshot.filePath);
|
|
252
278
|
if (entry.suppressHmrOnFileRestore) {
|
|
@@ -256,7 +282,14 @@ function popUndo() {
|
|
|
256
282
|
(0, node_fs_1.rmSync)(snapshot.filePath, { force: true });
|
|
257
283
|
}
|
|
258
284
|
else {
|
|
259
|
-
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(
|
|
285
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)({
|
|
286
|
+
file: snapshot.filePath,
|
|
287
|
+
content: snapshot.oldContents,
|
|
288
|
+
originatorClientId: undefined,
|
|
289
|
+
metadata: snapshot.nodePathRemappings === null
|
|
290
|
+
? null
|
|
291
|
+
: { skipSequencePropsUpdate: true },
|
|
292
|
+
});
|
|
260
293
|
}
|
|
261
294
|
}
|
|
262
295
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel: storedLogLevel }, renderer_1.RenderInternals.chalk.gray(`Undo: restored ${entry.filePath} (undo: ${undoStack.length}, redo: ${redoStack.length})`));
|
|
@@ -272,7 +305,7 @@ function popUndo() {
|
|
|
272
305
|
ensureWatching(filePath);
|
|
273
306
|
}
|
|
274
307
|
broadcastState();
|
|
275
|
-
return { success: true };
|
|
308
|
+
return { success: true, nodePathMutation };
|
|
276
309
|
}
|
|
277
310
|
function popRedo() {
|
|
278
311
|
const entry = redoStack.pop();
|
|
@@ -298,12 +331,32 @@ function popRedo() {
|
|
|
298
331
|
if (undoStack.length > MAX_ENTRIES) {
|
|
299
332
|
undoStack.shift();
|
|
300
333
|
}
|
|
334
|
+
const files = snapshotsWithNewContents.flatMap((snapshot) => {
|
|
335
|
+
if (snapshot.nodePathRemappings === null) {
|
|
336
|
+
return [];
|
|
337
|
+
}
|
|
338
|
+
return [
|
|
339
|
+
{
|
|
340
|
+
absolutePath: snapshot.filePath,
|
|
341
|
+
remappings: snapshot.nodePathRemappings,
|
|
342
|
+
restoredNodePaths: [],
|
|
343
|
+
},
|
|
344
|
+
];
|
|
345
|
+
});
|
|
346
|
+
const nodePathMutation = files.length === 0 ? null : (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)(files);
|
|
301
347
|
for (const snapshot of snapshotsWithNewContents) {
|
|
302
348
|
suppressUndoStackInvalidation(snapshot.filePath);
|
|
303
349
|
if (entry.suppressHmrOnFileRestore) {
|
|
304
350
|
(0, watch_ignore_next_change_1.suppressBundlerUpdateForFile)(snapshot.filePath);
|
|
305
351
|
}
|
|
306
|
-
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(
|
|
352
|
+
(0, file_watcher_1.writeFileAndNotifyFileWatchers)({
|
|
353
|
+
file: snapshot.filePath,
|
|
354
|
+
content: snapshot.newContents,
|
|
355
|
+
originatorClientId: undefined,
|
|
356
|
+
metadata: snapshot.nodePathRemappings === null
|
|
357
|
+
? null
|
|
358
|
+
: { skipSequencePropsUpdate: true },
|
|
359
|
+
});
|
|
307
360
|
}
|
|
308
361
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel: storedLogLevel }, renderer_1.RenderInternals.chalk.gray(`Redo: restored ${entry.filePath} (undo: ${undoStack.length}, redo: ${redoStack.length})`));
|
|
309
362
|
logFileAction(entry.description.redoMessage, entry.filePath, entry.logLine);
|
|
@@ -318,7 +371,7 @@ function popRedo() {
|
|
|
318
371
|
ensureWatching(filePath);
|
|
319
372
|
}
|
|
320
373
|
broadcastState();
|
|
321
|
-
return { success: true };
|
|
374
|
+
return { success: true, nodePathMutation };
|
|
322
375
|
}
|
|
323
376
|
/*
|
|
324
377
|
* Keep stack accessors typed as readonly arrays so callers can only inspect
|
package/dist/routes.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const handleRoutes: ({ staticHash, staticHashPrefix, outputHash,
|
|
|
27
27
|
getPreviewSampleRate: () => number | null;
|
|
28
28
|
enableCrossSiteIsolation: boolean;
|
|
29
29
|
getStudioRuntimeConfig: () => StudioRuntimeConfig;
|
|
30
|
-
getDefaultCodingAgent: () => "claude-code" | "codex" | "
|
|
30
|
+
getDefaultCodingAgent: () => "claude-code" | "codex" | "copilot" | "cursor" | null;
|
|
31
31
|
getDefaultEditor: () => DefaultEditor | null;
|
|
32
32
|
configFile: string | null;
|
|
33
33
|
}) => Promise<void>;
|
package/dist/routes.js
CHANGED
|
@@ -51,6 +51,7 @@ const get_package_manager_1 = require("./preview-server/get-package-manager");
|
|
|
51
51
|
const get_static_file_fallback_hint_1 = require("./preview-server/get-static-file-fallback-hint");
|
|
52
52
|
const handler_1 = require("./preview-server/handler");
|
|
53
53
|
const public_folder_1 = require("./preview-server/public-folder");
|
|
54
|
+
const app_icon_1 = require("./preview-server/routes/app-icon");
|
|
54
55
|
const open_in_editor_1 = require("./preview-server/routes/open-in-editor");
|
|
55
56
|
const serve_static_1 = require("./preview-server/serve-static");
|
|
56
57
|
const handle_discovery_1 = require("./preview-server/studio-protocol/handle-discovery");
|
|
@@ -279,12 +280,18 @@ const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPref
|
|
|
279
280
|
remotionRoot,
|
|
280
281
|
});
|
|
281
282
|
}
|
|
283
|
+
if (url.pathname.startsWith('/api/app-icon/')) {
|
|
284
|
+
return (0, app_icon_1.handleAppIcon)({
|
|
285
|
+
pathname: url.pathname,
|
|
286
|
+
request,
|
|
287
|
+
response,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
282
290
|
if (url.pathname === '/api/studio-protocol' ||
|
|
283
291
|
url.pathname === '/api/studio-protocol/install' ||
|
|
284
292
|
url.pathname === '/api/studio-protocol/license-key') {
|
|
285
293
|
if (request.method === 'OPTIONS') {
|
|
286
294
|
return (0, origin_policy_1.handleStudioProtocolOptions)({
|
|
287
|
-
licenseKey: url.pathname === '/api/studio-protocol/license-key',
|
|
288
295
|
request,
|
|
289
296
|
response,
|
|
290
297
|
});
|
package/dist/start-studio.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare const startStudio: ({ browserArgs, browserFlag, shouldOpenBrowser
|
|
|
36
36
|
forceNew: boolean;
|
|
37
37
|
rspack: boolean;
|
|
38
38
|
getStudioRuntimeConfig: () => StudioRuntimeConfig;
|
|
39
|
-
getDefaultCodingAgent: () => "claude-code" | "codex" | "
|
|
39
|
+
getDefaultCodingAgent: () => "claude-code" | "codex" | "copilot" | "cursor" | null;
|
|
40
40
|
getDefaultEditor: () => DefaultEditor | null;
|
|
41
41
|
configFile: string | null;
|
|
42
42
|
}) => Promise<StartStudioResult>;
|
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.
|
|
6
|
+
"version": "4.0.508",
|
|
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.
|
|
26
|
+
"@remotion/studio-protocol": "4.0.508",
|
|
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.
|
|
35
|
+
"remotion": "4.0.508",
|
|
36
36
|
"recast": "0.23.11",
|
|
37
|
-
"@remotion/bundler": "4.0.
|
|
38
|
-
"@remotion/renderer": "4.0.
|
|
39
|
-
"@remotion/studio-codemods": "4.0.
|
|
40
|
-
"@remotion/studio-shared": "4.0.
|
|
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",
|
|
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.
|
|
48
|
+
"@remotion/eslint-config-internal": "4.0.508",
|
|
49
49
|
"eslint": "9.19.0",
|
|
50
50
|
"@types/node": "20.12.14",
|
|
51
51
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DeleteEffectKeyframeRequest, DeleteEffectKeyframeResponse } from '@remotion/studio-shared';
|
|
2
|
-
import type { ApiHandler } from '../api-types';
|
|
3
|
-
export declare const deleteEffectKeyframeHandler: ApiHandler<DeleteEffectKeyframeRequest, DeleteEffectKeyframeResponse>;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteEffectKeyframeHandler = void 0;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const renderer_1 = require("@remotion/renderer");
|
|
6
|
-
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
|
-
const parse_ast_1 = require("../../codemods/parse-ast");
|
|
8
|
-
const update_keyframes_1 = require("../../codemods/update-keyframes/update-keyframes");
|
|
9
|
-
const file_watcher_1 = require("../../file-watcher");
|
|
10
|
-
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
11
|
-
const undo_stack_1 = require("../undo-stack");
|
|
12
|
-
const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
|
|
13
|
-
const can_update_effect_props_1 = require("./can-update-effect-props");
|
|
14
|
-
const can_update_sequence_props_1 = require("./can-update-sequence-props");
|
|
15
|
-
const log_effect_update_1 = require("./log-updates/log-effect-update");
|
|
16
|
-
const save_props_mutex_1 = require("./save-props-mutex");
|
|
17
|
-
const deleteEffectKeyframeHandler = ({ input: { fileName, sequenceNodePath, effectIndex, key, frame, schema, clientId, }, remotionRoot, logLevel, }) => (0, save_props_mutex_1.withSavePropsLock)(async () => {
|
|
18
|
-
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[delete-effect-keyframe] Received request for fileName="${fileName}" effectIndex=${effectIndex} key="${key}" frame=${frame}`);
|
|
19
|
-
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
20
|
-
remotionRoot,
|
|
21
|
-
fileName,
|
|
22
|
-
action: 'modify',
|
|
23
|
-
});
|
|
24
|
-
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
25
|
-
const { output, oldValueStrings, newValueStrings, formatted, logLine, effectCallee, } = await (0, update_keyframes_1.updateEffectKeyframes)({
|
|
26
|
-
input: fileContents,
|
|
27
|
-
sequenceNodePath: sequenceNodePath.nodePath,
|
|
28
|
-
effectIndex,
|
|
29
|
-
updates: [
|
|
30
|
-
{
|
|
31
|
-
key,
|
|
32
|
-
operation: {
|
|
33
|
-
type: 'remove',
|
|
34
|
-
frame,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
});
|
|
39
|
-
const oldValueString = oldValueStrings[0];
|
|
40
|
-
const newValueString = newValueStrings[0];
|
|
41
|
-
const undoPropChange = `${key} keyframe restored at frame ${frame}`;
|
|
42
|
-
const redoPropChange = `${key} keyframe deleted at frame ${frame}`;
|
|
43
|
-
(0, undo_stack_1.pushToUndoStack)({
|
|
44
|
-
filePath: absolutePath,
|
|
45
|
-
oldContents: fileContents,
|
|
46
|
-
newContents: null,
|
|
47
|
-
logLevel,
|
|
48
|
-
remotionRoot,
|
|
49
|
-
logLine,
|
|
50
|
-
description: {
|
|
51
|
-
undoMessage: `↩️ ${undoPropChange}`,
|
|
52
|
-
redoMessage: `↪️ ${redoPropChange}`,
|
|
53
|
-
},
|
|
54
|
-
entryType: 'effect-props',
|
|
55
|
-
suppressHmrOnFileRestore: true,
|
|
56
|
-
});
|
|
57
|
-
(0, undo_stack_1.suppressUndoStackInvalidation)(absolutePath);
|
|
58
|
-
(0, watch_ignore_next_change_1.suppressBundlerUpdateForFile)(absolutePath);
|
|
59
|
-
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(absolutePath, output, clientId);
|
|
60
|
-
(0, log_effect_update_1.logEffectUpdate)({
|
|
61
|
-
fileRelativeToRoot,
|
|
62
|
-
line: logLine,
|
|
63
|
-
effectName: effectCallee,
|
|
64
|
-
propKey: key,
|
|
65
|
-
oldValueString,
|
|
66
|
-
newValueString,
|
|
67
|
-
defaultValueString: null,
|
|
68
|
-
formatted,
|
|
69
|
-
logLevel,
|
|
70
|
-
removedProps: [],
|
|
71
|
-
addedProps: [],
|
|
72
|
-
});
|
|
73
|
-
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
74
|
-
const ast = (0, parse_ast_1.parseAst)((0, node_fs_1.readFileSync)(absolutePath, 'utf-8'));
|
|
75
|
-
const jsx = (0, can_update_sequence_props_1.findJsxElementAtNodePath)(ast, sequenceNodePath.nodePath);
|
|
76
|
-
if (!jsx) {
|
|
77
|
-
return {
|
|
78
|
-
canUpdate: false,
|
|
79
|
-
effectIndex,
|
|
80
|
-
reason: 'not-found',
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
return (0, can_update_effect_props_1.computeEffectPropStatus)({
|
|
84
|
-
jsx,
|
|
85
|
-
effectIndex,
|
|
86
|
-
keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
exports.deleteEffectKeyframeHandler = deleteEffectKeyframeHandler;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DeleteSequenceKeyframeRequest, DeleteSequenceKeyframeResponse } from '@remotion/studio-shared';
|
|
2
|
-
import type { ApiHandler } from '../api-types';
|
|
3
|
-
export declare const deleteSequenceKeyframeHandler: ApiHandler<DeleteSequenceKeyframeRequest, DeleteSequenceKeyframeResponse>;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteSequenceKeyframeHandler = void 0;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const renderer_1 = require("@remotion/renderer");
|
|
6
|
-
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
|
-
const update_keyframes_1 = require("../../codemods/update-keyframes/update-keyframes");
|
|
8
|
-
const file_watcher_1 = require("../../file-watcher");
|
|
9
|
-
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
10
|
-
const undo_stack_1 = require("../undo-stack");
|
|
11
|
-
const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
|
|
12
|
-
const can_update_sequence_props_1 = require("./can-update-sequence-props");
|
|
13
|
-
const log_update_1 = require("./log-updates/log-update");
|
|
14
|
-
const save_props_mutex_1 = require("./save-props-mutex");
|
|
15
|
-
const deleteSequenceKeyframeHandler = ({ input: { fileName, nodePath, key, frame, schema, clientId }, remotionRoot, logLevel, }) => (0, save_props_mutex_1.withSavePropsLock)(async () => {
|
|
16
|
-
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[delete-sequence-keyframe] Received request for fileName="${fileName}" key="${key}" frame=${frame}`);
|
|
17
|
-
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
18
|
-
remotionRoot,
|
|
19
|
-
fileName,
|
|
20
|
-
action: 'modify',
|
|
21
|
-
});
|
|
22
|
-
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
23
|
-
const { output, oldValueStrings, newValueStrings, formatted, logLine } = await (0, update_keyframes_1.updateSequenceKeyframes)({
|
|
24
|
-
input: fileContents,
|
|
25
|
-
nodePath: nodePath.nodePath,
|
|
26
|
-
updates: [
|
|
27
|
-
{
|
|
28
|
-
key,
|
|
29
|
-
operation: {
|
|
30
|
-
type: 'remove',
|
|
31
|
-
frame,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
});
|
|
36
|
-
const oldValueString = oldValueStrings[0];
|
|
37
|
-
const newValueString = newValueStrings[0];
|
|
38
|
-
const undoPropChange = `${key} keyframe restored at frame ${frame}`;
|
|
39
|
-
const redoPropChange = `${key} keyframe deleted at frame ${frame}`;
|
|
40
|
-
(0, undo_stack_1.pushToUndoStack)({
|
|
41
|
-
filePath: absolutePath,
|
|
42
|
-
oldContents: fileContents,
|
|
43
|
-
newContents: null,
|
|
44
|
-
logLevel,
|
|
45
|
-
remotionRoot,
|
|
46
|
-
logLine,
|
|
47
|
-
description: {
|
|
48
|
-
undoMessage: `↩️ ${undoPropChange}`,
|
|
49
|
-
redoMessage: `↪️ ${redoPropChange}`,
|
|
50
|
-
},
|
|
51
|
-
entryType: 'sequence-props',
|
|
52
|
-
suppressHmrOnFileRestore: true,
|
|
53
|
-
});
|
|
54
|
-
(0, undo_stack_1.suppressUndoStackInvalidation)(absolutePath);
|
|
55
|
-
(0, watch_ignore_next_change_1.suppressBundlerUpdateForFile)(absolutePath);
|
|
56
|
-
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(absolutePath, output, clientId);
|
|
57
|
-
(0, log_update_1.logUpdate)({
|
|
58
|
-
fileRelativeToRoot,
|
|
59
|
-
line: logLine,
|
|
60
|
-
key,
|
|
61
|
-
oldValueString,
|
|
62
|
-
newValueString,
|
|
63
|
-
defaultValueString: null,
|
|
64
|
-
formatted,
|
|
65
|
-
logLevel,
|
|
66
|
-
removedProps: [],
|
|
67
|
-
addedProps: [],
|
|
68
|
-
});
|
|
69
|
-
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
70
|
-
const status = (0, can_update_sequence_props_1.computeSequencePropsStatusFromContent)({
|
|
71
|
-
fileContents: output,
|
|
72
|
-
keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
|
|
73
|
-
nodePath: nodePath.nodePath,
|
|
74
|
-
effects: [],
|
|
75
|
-
});
|
|
76
|
-
return {
|
|
77
|
-
canUpdate: true,
|
|
78
|
-
props: status.props,
|
|
79
|
-
results: [{ fileName, nodePath, props: status.props }],
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
exports.deleteSequenceKeyframeHandler = deleteSequenceKeyframeHandler;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const withSavePropsLock: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withSavePropsLock = void 0;
|
|
4
|
-
let chain = Promise.resolve();
|
|
5
|
-
const withSavePropsLock = (fn) => {
|
|
6
|
-
const run = () => fn();
|
|
7
|
-
const next = chain.then(run, run);
|
|
8
|
-
chain = next.then(() => undefined, () => undefined);
|
|
9
|
-
return next;
|
|
10
|
-
};
|
|
11
|
-
exports.withSavePropsLock = withSavePropsLock;
|