@remotion/studio-server 4.0.532 → 4.0.534
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/detect-outdated-remotion-skills.d.ts +4 -0
- package/dist/detect-outdated-remotion-skills.js +3 -2
- package/dist/helpers/coding-agent-registry.d.ts +1 -0
- package/dist/helpers/coding-agent-registry.js +30 -6
- package/dist/helpers/editor-registry.d.ts +1 -0
- package/dist/helpers/editor-registry.js +24 -1
- package/dist/helpers/open-in-editor.d.ts +1 -1
- package/dist/helpers/open-in-editor.js +65 -83
- package/dist/helpers/running-processes.d.ts +12 -0
- package/dist/helpers/running-processes.js +88 -0
- package/dist/helpers/video-config-numeric-expression.js +29 -20
- package/dist/helpers/video-config-values.d.ts +6 -3
- package/dist/helpers/video-config-values.js +42 -26
- package/dist/preview-server/api-routes.js +4 -0
- package/dist/preview-server/file-existence-watchers.js +11 -6
- package/dist/preview-server/routes/add-sequence-keyframe.js +0 -1
- package/dist/preview-server/routes/can-update-effect-props.d.ts +4 -6
- package/dist/preview-server/routes/can-update-effect-props.js +5 -28
- package/dist/preview-server/routes/can-update-sequence-props.d.ts +6 -8
- package/dist/preview-server/routes/can-update-sequence-props.js +11 -12
- package/dist/preview-server/routes/default-coding-agent.js +2 -0
- package/dist/preview-server/routes/default-editor.js +5 -1
- package/dist/preview-server/routes/delete-keyframes.d.ts +2 -2
- package/dist/preview-server/routes/delete-keyframes.js +0 -1
- package/dist/preview-server/routes/find-in-file.js +7 -2
- package/dist/preview-server/routes/insert-element.js +17 -7
- package/dist/preview-server/routes/install-remotion-skill.d.ts +2 -1
- package/dist/preview-server/routes/install-remotion-skill.js +87 -56
- package/dist/preview-server/routes/open-in-editor.js +1 -1
- package/dist/preview-server/routes/remotion-skills-info.d.ts +2 -1
- package/dist/preview-server/routes/remotion-skills-info.js +57 -3
- package/dist/preview-server/routes/reorder-sequence.js +6 -3
- package/dist/preview-server/routes/save-sequence-props.js +0 -1
- package/dist/preview-server/routes/shared-memory-capture-support.d.ts +3 -0
- package/dist/preview-server/routes/shared-memory-capture-support.js +13 -0
- package/dist/preview-server/routes/split-sequences.js +2 -1
- package/dist/preview-server/routes/subscribe-to-sequence-props.js +1 -2
- package/dist/preview-server/routes/unsubscribe-from-sequence-props.js +0 -1
- package/dist/preview-server/routes/update-sequence-keyframe-settings.js +0 -1
- package/dist/preview-server/routes/wrap-node.js +13 -4
- package/dist/preview-server/sequence-props-watchers.d.ts +3 -5
- package/dist/preview-server/sequence-props-watchers.js +9 -17
- package/dist/preview-server/update-available.js +17 -0
- package/dist/routes.js +3 -1
- package/dist/start-studio.js +7 -3
- package/package.json +8 -8
|
@@ -33,24 +33,14 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.getVideoConfigIdentifierValues = void 0;
|
|
36
|
+
exports.getVideoConfigIdentifierValues = exports.getVideoConfigIdentifiers = void 0;
|
|
37
37
|
const recast = __importStar(require("recast"));
|
|
38
|
-
const
|
|
38
|
+
const getVideoConfigIdentifiers = ({ ast, }) => {
|
|
39
39
|
const candidates = new Map();
|
|
40
|
-
const otherDeclarations = new Set();
|
|
41
|
-
const addCandidate = (identifier, value) => {
|
|
42
|
-
if (candidates.has(identifier) || otherDeclarations.has(identifier)) {
|
|
43
|
-
candidates.delete(identifier);
|
|
44
|
-
otherDeclarations.add(identifier);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
candidates.set(identifier, value);
|
|
48
|
-
};
|
|
49
40
|
recast.types.visit(ast, {
|
|
50
41
|
visitVariableDeclarator(path) {
|
|
51
42
|
const { id, init } = path.node;
|
|
52
|
-
const isVideoConfigDeclaration =
|
|
53
|
-
id.type === 'ObjectPattern' &&
|
|
43
|
+
const isVideoConfigDeclaration = id.type === 'ObjectPattern' &&
|
|
54
44
|
(init === null || init === void 0 ? void 0 : init.type) === 'CallExpression' &&
|
|
55
45
|
init.callee.type === 'Identifier' &&
|
|
56
46
|
init.callee.name === 'useVideoConfig' &&
|
|
@@ -67,13 +57,16 @@ const getVideoConfigIdentifierValues = ({ ast, videoConfigValues, }) => {
|
|
|
67
57
|
: property.key.type === 'StringLiteral'
|
|
68
58
|
? property.key.value
|
|
69
59
|
: null;
|
|
70
|
-
if (configKey
|
|
60
|
+
if (configKey !== 'durationInFrames' &&
|
|
61
|
+
configKey !== 'fps' &&
|
|
62
|
+
configKey !== 'width' &&
|
|
63
|
+
configKey !== 'height') {
|
|
71
64
|
continue;
|
|
72
65
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
66
|
+
candidates.set(property.value, {
|
|
67
|
+
type: 'video-config',
|
|
68
|
+
field: configKey,
|
|
69
|
+
});
|
|
77
70
|
}
|
|
78
71
|
}
|
|
79
72
|
else if (id.type === 'Identifier') {
|
|
@@ -85,19 +78,42 @@ const getVideoConfigIdentifierValues = ({ ast, videoConfigValues, }) => {
|
|
|
85
78
|
? init.value
|
|
86
79
|
: null;
|
|
87
80
|
if (numericConstant !== null) {
|
|
88
|
-
|
|
81
|
+
candidates.set(id, {
|
|
82
|
+
type: 'constant',
|
|
83
|
+
value: numericConstant,
|
|
84
|
+
});
|
|
89
85
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
}
|
|
87
|
+
this.traverse(path);
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
// Resolve each reference to its declaration. Components may independently
|
|
91
|
+
// declare the same name, while parameters and other shadowing stay computed.
|
|
92
|
+
const bindings = new Map();
|
|
93
|
+
recast.types.visit(ast, {
|
|
94
|
+
visitIdentifier(path) {
|
|
95
|
+
var _a;
|
|
96
|
+
var _b;
|
|
97
|
+
const declarations = (_b = (_a = path.scope.lookup(path.node.name)) === null || _a === void 0 ? void 0 : _a.getBindings()[path.node.name]) !== null && _b !== void 0 ? _b : [];
|
|
98
|
+
if (declarations.length === 1) {
|
|
99
|
+
const binding = candidates.get(declarations[0].node);
|
|
100
|
+
if (binding !== undefined) {
|
|
101
|
+
bindings.set(path.node, binding);
|
|
93
102
|
}
|
|
94
103
|
}
|
|
95
104
|
this.traverse(path);
|
|
96
105
|
},
|
|
97
106
|
});
|
|
98
|
-
|
|
99
|
-
candidates.delete(identifier);
|
|
100
|
-
}
|
|
101
|
-
return Object.fromEntries(candidates);
|
|
107
|
+
return bindings;
|
|
102
108
|
};
|
|
109
|
+
exports.getVideoConfigIdentifiers = getVideoConfigIdentifiers;
|
|
110
|
+
// Editing uses the current instance's configuration supplied with the mutation.
|
|
111
|
+
const getVideoConfigIdentifierValues = ({ ast, videoConfigValues, }) => new Map([...(0, exports.getVideoConfigIdentifiers)({ ast })].flatMap(([identifier, binding]) => {
|
|
112
|
+
if (binding.type === 'constant')
|
|
113
|
+
return [[identifier, binding]];
|
|
114
|
+
const value = videoConfigValues === null || videoConfigValues === void 0 ? void 0 : videoConfigValues[binding.field];
|
|
115
|
+
return value === undefined || !Number.isFinite(value)
|
|
116
|
+
? []
|
|
117
|
+
: [[identifier, { type: 'constant', value }]];
|
|
118
|
+
}));
|
|
103
119
|
exports.getVideoConfigIdentifierValues = getVideoConfigIdentifierValues;
|
|
@@ -58,6 +58,7 @@ const restart_studio_1 = require("./routes/restart-studio");
|
|
|
58
58
|
const save_effect_props_1 = require("./routes/save-effect-props");
|
|
59
59
|
const save_multiple_effect_props_1 = require("./routes/save-multiple-effect-props");
|
|
60
60
|
const save_sequence_props_1 = require("./routes/save-sequence-props");
|
|
61
|
+
const shared_memory_capture_support_1 = require("./routes/shared-memory-capture-support");
|
|
61
62
|
const shutdown_studio_1 = require("./routes/shutdown-studio");
|
|
62
63
|
const split_sequences_1 = require("./routes/split-sequences");
|
|
63
64
|
const split_video_from_audio_1 = require("./routes/split-video-from-audio");
|
|
@@ -79,6 +80,7 @@ const update_sequence_keyframe_settings_1 = require("./routes/update-sequence-ke
|
|
|
79
80
|
const upgrade_remotion_1 = require("./routes/upgrade-remotion");
|
|
80
81
|
const wrap_node_1 = require("./routes/wrap-node");
|
|
81
82
|
exports.allApiRoutes = {
|
|
83
|
+
'/api/shared-memory-capture-support': shared_memory_capture_support_1.sharedMemoryCaptureSupportHandler,
|
|
82
84
|
'/api/invalidate-bundle': invalidate_bundle_1.invalidateBundleHandler,
|
|
83
85
|
'/api/composition-component-info': composition_component_info_1.compositionComponentInfoHandler,
|
|
84
86
|
'/api/copy-render-output-to-asset': copy_render_output_to_asset_1.copyRenderOutputToAssetHandler,
|
|
@@ -142,6 +144,8 @@ exports.allApiRoutes = {
|
|
|
142
144
|
'/api/remotion-skills-info': remotion_skills_info_1.remotionSkillsInfoHandler,
|
|
143
145
|
'/api/install-remotion-skill': install_remotion_skill_1.installRemotionSkillHandler,
|
|
144
146
|
'/api/remove-remotion-skill': install_remotion_skill_1.removeRemotionSkillHandler,
|
|
147
|
+
'/api/upgrade-remotion-skill': install_remotion_skill_1.upgradeRemotionSkillHandler,
|
|
148
|
+
'/api/open-remotion-skill': remotion_skills_info_1.openRemotionSkillHandler,
|
|
145
149
|
'/api/project-info': project_info_1.projectInfoHandler,
|
|
146
150
|
'/api/delete-static-file': delete_static_file_1.deleteStaticFileHandler,
|
|
147
151
|
'/api/rename-static-file': rename_static_file_1.renameStaticFileHandler,
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.unsubscribeClientFileExistenceWatchers = exports.unsubscribeFromFileExistenceWatchers = exports.subscribeToFileExistenceWatchers = void 0;
|
|
7
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
8
4
|
const file_watcher_1 = require("../file-watcher");
|
|
5
|
+
const resolve_file_inside_project_1 = require("../helpers/resolve-file-inside-project");
|
|
9
6
|
const live_events_1 = require("./live-events");
|
|
10
7
|
const fileExistenceWatchers = {};
|
|
11
8
|
const subscribeToFileExistenceWatchers = ({ file: relativeFile, remotionRoot, clientId, }) => {
|
|
12
|
-
const file =
|
|
9
|
+
const { absolutePath: file } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
10
|
+
remotionRoot,
|
|
11
|
+
fileName: relativeFile,
|
|
12
|
+
action: 'watch',
|
|
13
|
+
});
|
|
13
14
|
const { unwatch, exists } = (0, file_watcher_1.installFileWatcher)({
|
|
14
15
|
file,
|
|
15
16
|
existenceOnly: true,
|
|
@@ -43,7 +44,11 @@ const subscribeToFileExistenceWatchers = ({ file: relativeFile, remotionRoot, cl
|
|
|
43
44
|
exports.subscribeToFileExistenceWatchers = subscribeToFileExistenceWatchers;
|
|
44
45
|
const unsubscribeFromFileExistenceWatchers = ({ file, remotionRoot, clientId, }) => {
|
|
45
46
|
var _a, _b;
|
|
46
|
-
const actualPath =
|
|
47
|
+
const { absolutePath: actualPath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
48
|
+
remotionRoot,
|
|
49
|
+
fileName: file,
|
|
50
|
+
action: 'unwatch',
|
|
51
|
+
});
|
|
47
52
|
if (!fileExistenceWatchers[clientId]) {
|
|
48
53
|
return;
|
|
49
54
|
}
|
|
@@ -83,7 +83,6 @@ const addSequenceKeyframeHandler = ({ input: { fileName, nodePath, key, frame, v
|
|
|
83
83
|
nodePath: updatedNodePath,
|
|
84
84
|
componentIdentity: null,
|
|
85
85
|
effects: [],
|
|
86
|
-
videoConfigValues: nodePath.videoConfigValues,
|
|
87
86
|
});
|
|
88
87
|
const updatedSubscriptionKey = { ...nodePath, nodePath: updatedNodePath };
|
|
89
88
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { File, JSXOpeningElement } from '@babel/types';
|
|
2
|
-
import type { CanUpdateEffectPropsResponse, SequenceNodePath, InteractivitySchema
|
|
2
|
+
import type { CanUpdateEffectPropsResponse, SequenceNodePath, InteractivitySchema } from 'remotion';
|
|
3
3
|
import { type VideoConfigIdentifierValues } from '../../helpers/video-config-values';
|
|
4
4
|
export declare const computeEffectPropStatus: ({ ast, jsx, effectIndex, keys, videoConfigValues, }: {
|
|
5
5
|
ast: File;
|
|
@@ -8,18 +8,16 @@ export declare const computeEffectPropStatus: ({ ast, jsx, effectIndex, keys, vi
|
|
|
8
8
|
keys: string[];
|
|
9
9
|
videoConfigValues: VideoConfigIdentifierValues;
|
|
10
10
|
}) => CanUpdateEffectPropsResponse;
|
|
11
|
-
export declare const computeEffectPropsStatusesFromContent: ({ fileContents, sequenceNodePath, effects, keysFor,
|
|
11
|
+
export declare const computeEffectPropsStatusesFromContent: ({ fileContents, sequenceNodePath, effects, keysFor, }: {
|
|
12
12
|
fileContents: string;
|
|
13
13
|
sequenceNodePath: SequenceNodePath;
|
|
14
14
|
effects: InteractivitySchema[];
|
|
15
15
|
keysFor: (effect: InteractivitySchema) => string[];
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
export declare const computeEffectPropsStatusesFromFile: ({ fileName, sequenceNodePath, effects, keysFor, remotionRoot, videoConfigValues, }: {
|
|
16
|
+
}) => CanUpdateEffectPropsResponse<import("remotion").SourceNumericValue>[];
|
|
17
|
+
export declare const computeEffectPropsStatusesFromFile: ({ fileName, sequenceNodePath, effects, keysFor, remotionRoot, }: {
|
|
19
18
|
fileName: string;
|
|
20
19
|
sequenceNodePath: SequenceNodePath;
|
|
21
20
|
effects: InteractivitySchema[];
|
|
22
21
|
keysFor: (effect: InteractivitySchema) => string[];
|
|
23
22
|
remotionRoot: string;
|
|
24
|
-
videoConfigValues: VideoConfigValues | null;
|
|
25
23
|
}) => CanUpdateEffectPropsResponse[];
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.computeEffectPropsStatusesFromFile = exports.computeEffectPropsStatusesFromContent = exports.computeEffectPropStatus = void 0;
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
|
-
const
|
|
5
|
+
const codemods_1 = require("@remotion/codemods");
|
|
6
|
+
const no_react_1 = require("remotion/no-react");
|
|
6
7
|
const update_effect_props_1 = require("../../codemods/update-effect-props/update-effect-props");
|
|
7
8
|
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
8
9
|
const video_config_numeric_expression_1 = require("../../helpers/video-config-numeric-expression");
|
|
9
|
-
const video_config_values_1 = require("../../helpers/video-config-values");
|
|
10
10
|
const can_update_sequence_props_1 = require("./can-update-sequence-props");
|
|
11
11
|
const staticStatus = (codeValue) => ({
|
|
12
12
|
status: 'static',
|
|
@@ -112,7 +112,7 @@ const getPropsFromObjectExpression = ({ ast, objExpr, keys, videoConfigValues, }
|
|
|
112
112
|
? {
|
|
113
113
|
status: 'static',
|
|
114
114
|
keyframeDisplayOffsetAdjustment: null,
|
|
115
|
-
codeValue: numericExpression
|
|
115
|
+
codeValue: no_react_1.NoReactInternals.evaluateSourceNumericValue(numericExpression, null),
|
|
116
116
|
...(numericExpression.type === 'literal'
|
|
117
117
|
? {}
|
|
118
118
|
: { numericExpression }),
|
|
@@ -195,30 +195,8 @@ const computeEffectPropStatus = ({ ast, jsx, effectIndex, keys, videoConfigValue
|
|
|
195
195
|
};
|
|
196
196
|
};
|
|
197
197
|
exports.computeEffectPropStatus = computeEffectPropStatus;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const videoConfigIdentifierValues = (0, video_config_values_1.getVideoConfigIdentifierValues)({
|
|
201
|
-
ast,
|
|
202
|
-
videoConfigValues,
|
|
203
|
-
});
|
|
204
|
-
const jsx = (0, can_update_sequence_props_1.findJsxElementAtNodePath)(ast, sequenceNodePath);
|
|
205
|
-
if (!jsx) {
|
|
206
|
-
return effects.map((_effect, effectIndex) => ({
|
|
207
|
-
canUpdate: false,
|
|
208
|
-
effectIndex,
|
|
209
|
-
reason: 'not-found',
|
|
210
|
-
}));
|
|
211
|
-
}
|
|
212
|
-
return effects.map((effect, effectIndex) => (0, exports.computeEffectPropStatus)({
|
|
213
|
-
ast,
|
|
214
|
-
jsx,
|
|
215
|
-
effectIndex,
|
|
216
|
-
keys: keysFor(effect),
|
|
217
|
-
videoConfigValues: videoConfigIdentifierValues,
|
|
218
|
-
}));
|
|
219
|
-
};
|
|
220
|
-
exports.computeEffectPropsStatusesFromContent = computeEffectPropsStatusesFromContent;
|
|
221
|
-
const computeEffectPropsStatusesFromFile = ({ fileName, sequenceNodePath, effects, keysFor, remotionRoot, videoConfigValues, }) => {
|
|
198
|
+
({ computeEffectPropsStatusesFromContent: exports.computeEffectPropsStatusesFromContent } = codemods_1.CodemodsInternals);
|
|
199
|
+
const computeEffectPropsStatusesFromFile = ({ fileName, sequenceNodePath, effects, keysFor, remotionRoot, }) => {
|
|
222
200
|
const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
223
201
|
remotionRoot,
|
|
224
202
|
fileName,
|
|
@@ -230,7 +208,6 @@ const computeEffectPropsStatusesFromFile = ({ fileName, sequenceNodePath, effect
|
|
|
230
208
|
sequenceNodePath,
|
|
231
209
|
effects,
|
|
232
210
|
keysFor,
|
|
233
|
-
videoConfigValues,
|
|
234
211
|
});
|
|
235
212
|
};
|
|
236
213
|
exports.computeEffectPropsStatusesFromFile = computeEffectPropsStatusesFromFile;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Expression, File, JSXElement, JSXOpeningElement } from '@babel/types';
|
|
2
2
|
import type { SubscribeToSequencePropsResponse } from '@remotion/studio-shared';
|
|
3
|
-
import type { CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, SequenceNodePath
|
|
3
|
+
import type { CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, SequenceNodePath } from 'remotion';
|
|
4
4
|
import { type VideoConfigIdentifierValues } from '../../helpers/video-config-values';
|
|
5
|
+
type CanUpdatePropStatus = CanUpdateSequencePropStatus;
|
|
5
6
|
type StaticValueOptions = {
|
|
6
7
|
allowSpecialValues: boolean;
|
|
7
8
|
};
|
|
8
9
|
export declare const isStaticValue: (node: Expression, options?: StaticValueOptions) => boolean;
|
|
9
10
|
export declare const extractStaticValue: (node: Expression, options?: StaticValueOptions) => unknown;
|
|
10
|
-
export declare const getComputedStatus: (node: Expression, ast: File, videoConfigValues: VideoConfigIdentifierValues) =>
|
|
11
|
+
export declare const getComputedStatus: (node: Expression, ast: File, videoConfigValues: VideoConfigIdentifierValues) => CanUpdatePropStatus;
|
|
11
12
|
export declare const getNodePathForRecastPath: (recastPath: any, ast: File) => SequenceNodePath;
|
|
12
13
|
export declare const findJsxElementPathAtNodePath: (ast: File, nodePath: SequenceNodePath) => import("ast-types/lib/node-path").NodePath<N, V> | null;
|
|
13
14
|
export declare const findJsxElementAtNodePath: (ast: File, nodePath: SequenceNodePath) => JSXOpeningElement | null;
|
|
@@ -40,16 +41,15 @@ export declare const resolveSequencePropsNodePathsFromFilename: ({ fileName, tar
|
|
|
40
41
|
}[];
|
|
41
42
|
remotionRoot: string;
|
|
42
43
|
}) => (SequenceNodePath | null)[];
|
|
43
|
-
export declare const computeSequencePropsStatusFromContent: ({ fileContents, nodePath, componentIdentity, keys, assetKeys, effects,
|
|
44
|
+
export declare const computeSequencePropsStatusFromContent: ({ fileContents, nodePath, componentIdentity, keys, assetKeys, effects, }: {
|
|
44
45
|
fileContents: string;
|
|
45
46
|
nodePath: SequenceNodePath;
|
|
46
47
|
componentIdentity: string | null;
|
|
47
48
|
keys: string[];
|
|
48
49
|
assetKeys?: string[] | undefined;
|
|
49
50
|
effects: string[][];
|
|
50
|
-
videoConfigValues: VideoConfigValues | null;
|
|
51
51
|
}) => CanUpdateSequencePropsResponseTrue;
|
|
52
|
-
export declare const computeSequencePropsStatus: ({ fileName, nodePath, componentIdentity, keys, assetKeys, effects, remotionRoot,
|
|
52
|
+
export declare const computeSequencePropsStatus: ({ fileName, nodePath, componentIdentity, keys, assetKeys, effects, remotionRoot, }: {
|
|
53
53
|
fileName: string;
|
|
54
54
|
nodePath: SequenceNodePath;
|
|
55
55
|
componentIdentity: string | null;
|
|
@@ -57,9 +57,8 @@ export declare const computeSequencePropsStatus: ({ fileName, nodePath, componen
|
|
|
57
57
|
assetKeys?: string[] | undefined;
|
|
58
58
|
effects: string[][];
|
|
59
59
|
remotionRoot: string;
|
|
60
|
-
videoConfigValues: VideoConfigValues | null;
|
|
61
60
|
}) => CanUpdateSequencePropsResponseTrue;
|
|
62
|
-
export declare const computeSequencePropsStatusFromFilenameByLocation: ({ fileName, line, column, componentIdentity, keys, assetKeys, effects, remotionRoot, logLevel,
|
|
61
|
+
export declare const computeSequencePropsStatusFromFilenameByLocation: ({ fileName, line, column, componentIdentity, keys, assetKeys, effects, remotionRoot, logLevel, }: {
|
|
63
62
|
fileName: string;
|
|
64
63
|
line: number;
|
|
65
64
|
column: number;
|
|
@@ -69,6 +68,5 @@ export declare const computeSequencePropsStatusFromFilenameByLocation: ({ fileNa
|
|
|
69
68
|
effects: string[][];
|
|
70
69
|
remotionRoot: string;
|
|
71
70
|
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
72
|
-
videoConfigValues: VideoConfigValues;
|
|
73
71
|
}) => SubscribeToSequencePropsResponse;
|
|
74
72
|
export {};
|
|
@@ -439,7 +439,7 @@ const getInterpolationKeyframes = (node, ast, videoConfigValues) => {
|
|
|
439
439
|
return undefined;
|
|
440
440
|
}
|
|
441
441
|
keyframes.push({
|
|
442
|
-
frame: frameExpression
|
|
442
|
+
frame: no_react_1.NoReactInternals.evaluateSourceNumericValue(frameExpression, null),
|
|
443
443
|
value: (0, exports.extractStaticValue)(outputElement),
|
|
444
444
|
...(frameExpression.type === 'literal' ? {} : { frameExpression }),
|
|
445
445
|
});
|
|
@@ -521,8 +521,7 @@ const findNodePath = (ast, target) => {
|
|
|
521
521
|
return found;
|
|
522
522
|
};
|
|
523
523
|
const getJsxNumericAttribute = ({ openingElement, name, defaultValue, videoConfigValues, }) => {
|
|
524
|
-
var _a
|
|
525
|
-
var _c;
|
|
524
|
+
var _a;
|
|
526
525
|
if (openingElement.attributes.some((attribute) => attribute.type === 'JSXSpreadAttribute')) {
|
|
527
526
|
return null;
|
|
528
527
|
}
|
|
@@ -537,10 +536,13 @@ const getJsxNumericAttribute = ({ openingElement, name, defaultValue, videoConfi
|
|
|
537
536
|
attribute.value.expression.type === 'JSXEmptyExpression') {
|
|
538
537
|
return null;
|
|
539
538
|
}
|
|
540
|
-
|
|
539
|
+
const numericExpression = (0, video_config_numeric_expression_1.parseVideoConfigNumericExpression)({
|
|
541
540
|
node: attribute.value.expression,
|
|
542
541
|
videoConfigValues,
|
|
543
|
-
})
|
|
542
|
+
});
|
|
543
|
+
return numericExpression === null
|
|
544
|
+
? null
|
|
545
|
+
: no_react_1.NoReactInternals.evaluateSourceNumericValue(numericExpression, null);
|
|
544
546
|
}
|
|
545
547
|
return defaultValue;
|
|
546
548
|
};
|
|
@@ -975,7 +977,7 @@ const resolveSequencePropsNodePathsFromFilename = ({ fileName, targets, remotion
|
|
|
975
977
|
});
|
|
976
978
|
};
|
|
977
979
|
exports.resolveSequencePropsNodePathsFromFilename = resolveSequencePropsNodePathsFromFilename;
|
|
978
|
-
const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, componentIdentity, keys, assetKeys = [], effects,
|
|
980
|
+
const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, componentIdentity, keys, assetKeys = [], effects, }) => {
|
|
979
981
|
try {
|
|
980
982
|
return (0, codemods_1.getNodeProps)({
|
|
981
983
|
project: { rootDir: '/', files: { 'source.tsx': fileContents } },
|
|
@@ -984,7 +986,6 @@ const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, compone
|
|
|
984
986
|
keys,
|
|
985
987
|
assetKeys,
|
|
986
988
|
effectKeys: effects,
|
|
987
|
-
videoConfig: videoConfigValues !== null && videoConfigValues !== void 0 ? videoConfigValues : undefined,
|
|
988
989
|
});
|
|
989
990
|
}
|
|
990
991
|
catch (error) {
|
|
@@ -998,7 +999,7 @@ const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, compone
|
|
|
998
999
|
}
|
|
999
1000
|
};
|
|
1000
1001
|
exports.computeSequencePropsStatusFromContent = computeSequencePropsStatusFromContent;
|
|
1001
|
-
const computeSequencePropsStatus = ({ fileName, nodePath, componentIdentity, keys, assetKeys = [], effects, remotionRoot,
|
|
1002
|
+
const computeSequencePropsStatus = ({ fileName, nodePath, componentIdentity, keys, assetKeys = [], effects, remotionRoot, }) => {
|
|
1002
1003
|
const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
1003
1004
|
remotionRoot,
|
|
1004
1005
|
fileName,
|
|
@@ -1012,11 +1013,10 @@ const computeSequencePropsStatus = ({ fileName, nodePath, componentIdentity, key
|
|
|
1012
1013
|
keys,
|
|
1013
1014
|
assetKeys,
|
|
1014
1015
|
effects,
|
|
1015
|
-
videoConfigValues,
|
|
1016
1016
|
});
|
|
1017
1017
|
};
|
|
1018
1018
|
exports.computeSequencePropsStatus = computeSequencePropsStatus;
|
|
1019
|
-
const computeSequencePropsStatusFromFilenameByLocation = ({ fileName, line, column, componentIdentity, keys, assetKeys = [], effects, remotionRoot, logLevel,
|
|
1019
|
+
const computeSequencePropsStatusFromFilenameByLocation = ({ fileName, line, column, componentIdentity, keys, assetKeys = [], effects, remotionRoot, logLevel, }) => {
|
|
1020
1020
|
try {
|
|
1021
1021
|
const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
1022
1022
|
remotionRoot,
|
|
@@ -1046,14 +1046,13 @@ const computeSequencePropsStatusFromFilenameByLocation = ({ fileName, line, colu
|
|
|
1046
1046
|
assetKeys,
|
|
1047
1047
|
effects,
|
|
1048
1048
|
remotionRoot,
|
|
1049
|
-
videoConfigValues,
|
|
1050
1049
|
}),
|
|
1051
1050
|
nodePath: {
|
|
1052
1051
|
absolutePath,
|
|
1053
1052
|
nodePath: resolvedNodePath,
|
|
1054
1053
|
sequenceKeys: keys,
|
|
1055
1054
|
effectKeys: effects,
|
|
1056
|
-
videoConfigValues,
|
|
1055
|
+
videoConfigValues: null,
|
|
1057
1056
|
},
|
|
1058
1057
|
success: true,
|
|
1059
1058
|
};
|
|
@@ -6,10 +6,12 @@ const git_client_registry_1 = require("../../helpers/git-client-registry");
|
|
|
6
6
|
const terminal_registry_1 = require("../../helpers/terminal-registry");
|
|
7
7
|
const getDefaultCodingAgentInfoHandler = async ({ getDefaultCodingAgent }) => {
|
|
8
8
|
const installedCodingAgents = await (0, coding_agent_registry_1.getAvailableCodingAgents)();
|
|
9
|
+
const runningCodingAgents = await (0, coding_agent_registry_1.getRunningCodingAgents)(installedCodingAgents);
|
|
9
10
|
const installedTerminals = await (0, terminal_registry_1.getAvailableTerminals)();
|
|
10
11
|
const installedGitClients = await (0, git_client_registry_1.getAvailableGitClients)();
|
|
11
12
|
return {
|
|
12
13
|
defaultCodingAgent: getDefaultCodingAgent(),
|
|
14
|
+
runningCodingAgents,
|
|
13
15
|
installedCodingAgents: installedCodingAgents.map(({ id, name, nameWithType }) => ({
|
|
14
16
|
id,
|
|
15
17
|
name,
|
|
@@ -5,6 +5,7 @@ const custom_editor_1 = require("../../helpers/custom-editor");
|
|
|
5
5
|
const editor_registry_1 = require("../../helpers/editor-registry");
|
|
6
6
|
const getDefaultEditorInfoHandler = async ({ getDefaultEditor }) => {
|
|
7
7
|
const installedEditors = await (0, editor_registry_1.getAvailableEditors)();
|
|
8
|
+
const runningEditors = await (0, editor_registry_1.getRunningEditors)(installedEditors);
|
|
8
9
|
const configuredEditor = getDefaultEditor();
|
|
9
10
|
const customEditor = configuredEditor &&
|
|
10
11
|
typeof configuredEditor === 'object' &&
|
|
@@ -12,7 +13,10 @@ const getDefaultEditorInfoHandler = async ({ getDefaultEditor }) => {
|
|
|
12
13
|
? configuredEditor
|
|
13
14
|
: null;
|
|
14
15
|
return {
|
|
15
|
-
defaultEditor: typeof configuredEditor === 'object'
|
|
16
|
+
defaultEditor: configuredEditor && typeof configuredEditor === 'object'
|
|
17
|
+
? 'custom'
|
|
18
|
+
: configuredEditor,
|
|
19
|
+
runningEditors,
|
|
16
20
|
installedEditors: [
|
|
17
21
|
...installedEditors.map(({ id, name, nameWithType }) => ({
|
|
18
22
|
id,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeleteEffectKeyframe, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteSequenceKeyframe, SaveSequencePropsResult } from '@remotion/studio-shared';
|
|
1
|
+
import type { DeleteEffectKeyframe, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteSequenceKeyframe, SaveEffectPropsResponse, SaveSequencePropsResult } from '@remotion/studio-shared';
|
|
2
2
|
import type { ApiHandler } from '../api-types';
|
|
3
3
|
export declare const deleteKeyframes: ({ sequenceKeyframes, effectKeyframes, clientId, remotionRoot, logLevel, }: {
|
|
4
4
|
sequenceKeyframes: DeleteSequenceKeyframe[];
|
|
@@ -8,6 +8,6 @@ export declare const deleteKeyframes: ({ sequenceKeyframes, effectKeyframes, cli
|
|
|
8
8
|
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
9
9
|
}) => Promise<{
|
|
10
10
|
sequenceResults: SaveSequencePropsResult[];
|
|
11
|
-
effectResults:
|
|
11
|
+
effectResults: SaveEffectPropsResponse[];
|
|
12
12
|
}>;
|
|
13
13
|
export declare const deleteKeyframesHandler: ApiHandler<DeleteKeyframesRequest, DeleteKeyframesResponse>;
|
|
@@ -239,7 +239,6 @@ const deleteKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, r
|
|
|
239
239
|
nodePath: keyframe.nodePath.nodePath,
|
|
240
240
|
componentIdentity: null,
|
|
241
241
|
effects: [],
|
|
242
|
-
videoConfigValues: keyframe.nodePath.videoConfigValues,
|
|
243
242
|
});
|
|
244
243
|
return {
|
|
245
244
|
fileName: keyframe.fileName,
|
|
@@ -5,12 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.findInFileHandler = exports.findSearchPosition = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
9
8
|
const codemods_1 = require("@remotion/codemods");
|
|
9
|
+
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
10
10
|
({ findSearchPosition: exports.findSearchPosition } = codemods_1.CodemodsInternals);
|
|
11
11
|
const findInFileHandler = async ({ input, remotionRoot }) => {
|
|
12
12
|
const { fileName, lineNumber, columnNumber, search } = input;
|
|
13
|
-
const
|
|
13
|
+
const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
14
|
+
remotionRoot,
|
|
15
|
+
fileName,
|
|
16
|
+
action: 'read',
|
|
17
|
+
});
|
|
18
|
+
const contents = await node_fs_1.default.promises.readFile(absolutePath, 'utf-8');
|
|
14
19
|
return (0, exports.findSearchPosition)({
|
|
15
20
|
contents,
|
|
16
21
|
lineNumber,
|
|
@@ -54,7 +54,7 @@ const insertElementHandler = async ({ input: { compositionFile, compositionId, e
|
|
|
54
54
|
}
|
|
55
55
|
return (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
|
|
56
56
|
var _a, _b, _c, _d, _e, _f;
|
|
57
|
-
var _g, _h, _j
|
|
57
|
+
var _g, _h, _j;
|
|
58
58
|
const createdAssets = [];
|
|
59
59
|
const changedSources = [];
|
|
60
60
|
let undoEntryPushed = false;
|
|
@@ -187,6 +187,13 @@ const insertElementHandler = async ({ input: { compositionFile, compositionId, e
|
|
|
187
187
|
throw new Error('Element source file conflicts with the new composition file');
|
|
188
188
|
}
|
|
189
189
|
const shouldWriteElementFile = !plan.elementFileExists || elementSourcesDiffer;
|
|
190
|
+
const initialProps = { ...element.initialProps };
|
|
191
|
+
if (componentOwnsSequence && element.dimensions !== null) {
|
|
192
|
+
initialProps.style = {
|
|
193
|
+
...element.dimensions,
|
|
194
|
+
...(typeof initialProps.style === 'object' ? initialProps.style : {}),
|
|
195
|
+
};
|
|
196
|
+
}
|
|
190
197
|
const insertionInput = {
|
|
191
198
|
remotionRoot,
|
|
192
199
|
compositionFile,
|
|
@@ -197,7 +204,10 @@ const insertElementHandler = async ({ input: { compositionFile, compositionId, e
|
|
|
197
204
|
importName: plan.componentName,
|
|
198
205
|
importPath: plan.importPath,
|
|
199
206
|
props: [
|
|
200
|
-
...Object.entries(
|
|
207
|
+
...Object.entries(initialProps).map(([name, value]) => ({
|
|
208
|
+
name,
|
|
209
|
+
value,
|
|
210
|
+
})),
|
|
201
211
|
...(componentOwnsSequence && element.durationInFrames !== null
|
|
202
212
|
? [
|
|
203
213
|
{
|
|
@@ -289,7 +299,7 @@ const insertElementHandler = async ({ input: { compositionFile, compositionId, e
|
|
|
289
299
|
try {
|
|
290
300
|
(0, node_fs_1.unlinkSync)(asset.absolutePath);
|
|
291
301
|
}
|
|
292
|
-
catch (
|
|
302
|
+
catch (_k) {
|
|
293
303
|
// Keep the original write error.
|
|
294
304
|
}
|
|
295
305
|
throw error;
|
|
@@ -328,7 +338,7 @@ const insertElementHandler = async ({ input: { compositionFile, compositionId, e
|
|
|
328
338
|
filePath: compositionCreation.registrationFilePath,
|
|
329
339
|
oldContents: compositionCreation.registrationFileOldContents,
|
|
330
340
|
newContents: compositionCreation.registrationFileNewContents,
|
|
331
|
-
logLine: (
|
|
341
|
+
logLine: (_h = (_e = newComposition === null || newComposition === void 0 ? void 0 : newComposition.symbolicatedStack) === null || _e === void 0 ? void 0 : _e.originalLineNumber) !== null && _h !== void 0 ? _h : 1,
|
|
332
342
|
nodePathRemappings: null,
|
|
333
343
|
},
|
|
334
344
|
]),
|
|
@@ -397,7 +407,7 @@ const insertElementHandler = async ({ input: { compositionFile, compositionId, e
|
|
|
397
407
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright((0, format_log_file_location_1.formatLogFileLocation)({
|
|
398
408
|
remotionRoot,
|
|
399
409
|
absolutePath: compositionCreation.registrationFilePath,
|
|
400
|
-
line: (
|
|
410
|
+
line: (_j = (_f = newComposition.symbolicatedStack) === null || _f === void 0 ? void 0 : _f.originalLineNumber) !== null && _j !== void 0 ? _j : 1,
|
|
401
411
|
}))} Created composition "${compositionId}"`);
|
|
402
412
|
}
|
|
403
413
|
const compositionLocationLabel = (0, format_log_file_location_1.formatLogFileLocation)({
|
|
@@ -441,7 +451,7 @@ const insertElementHandler = async ({ input: { compositionFile, compositionId, e
|
|
|
441
451
|
});
|
|
442
452
|
}
|
|
443
453
|
}
|
|
444
|
-
catch (
|
|
454
|
+
catch (_l) {
|
|
445
455
|
// Preserve subsequent user changes and the original installation error.
|
|
446
456
|
}
|
|
447
457
|
}
|
|
@@ -451,7 +461,7 @@ const insertElementHandler = async ({ input: { compositionFile, compositionId, e
|
|
|
451
461
|
(0, node_fs_1.unlinkSync)(asset.absolutePath);
|
|
452
462
|
}
|
|
453
463
|
}
|
|
454
|
-
catch (
|
|
464
|
+
catch (_m) {
|
|
455
465
|
// Preserve subsequent user changes and the original installation error.
|
|
456
466
|
}
|
|
457
467
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { GetRemotionSkillsInfoResponse, InstallRemotionSkillRequest, RemoveRemotionSkillRequest } from '@remotion/studio-shared';
|
|
1
|
+
import type { GetRemotionSkillsInfoResponse, InstallRemotionSkillRequest, RemoveRemotionSkillRequest, UpgradeRemotionSkillRequest } from '@remotion/studio-shared';
|
|
2
2
|
import type { ApiHandler } from '../api-types';
|
|
3
3
|
export declare const installRemotionSkillHandler: ApiHandler<InstallRemotionSkillRequest, GetRemotionSkillsInfoResponse>;
|
|
4
4
|
export declare const removeRemotionSkillHandler: ApiHandler<RemoveRemotionSkillRequest, GetRemotionSkillsInfoResponse>;
|
|
5
|
+
export declare const upgradeRemotionSkillHandler: ApiHandler<UpgradeRemotionSkillRequest, GetRemotionSkillsInfoResponse>;
|