@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
|
@@ -13,6 +13,10 @@ export declare const deleteJsxNodes: ({ input, nodePaths, prettierConfigOverride
|
|
|
13
13
|
formatted: boolean;
|
|
14
14
|
nodeLabels: string[];
|
|
15
15
|
logLines: number[];
|
|
16
|
+
nodePathRemappings: {
|
|
17
|
+
oldNodePath: SequenceNodePath;
|
|
18
|
+
newNodePath: SequenceNodePath | null;
|
|
19
|
+
}[];
|
|
16
20
|
}>;
|
|
17
21
|
export declare const deleteJsxNode: ({ input, nodePath, prettierConfigOverride, }: {
|
|
18
22
|
input: string;
|
|
@@ -37,6 +37,7 @@ exports.deleteJsxNode = exports.deleteJsxNodes = exports.deleteJsxElementAtPath
|
|
|
37
37
|
const recast = __importStar(require("recast"));
|
|
38
38
|
const get_ast_node_path_1 = require("../helpers/get-ast-node-path");
|
|
39
39
|
const format_file_content_1 = require("./format-file-content");
|
|
40
|
+
const get_node_path_remappings_1 = require("./get-node-path-remappings");
|
|
40
41
|
const parse_ast_1 = require("./parse-ast");
|
|
41
42
|
const { builders: b, namedTypes } = recast.types;
|
|
42
43
|
/** Recast `builders.nullLiteral()` is typed against ast-types; normalize to Babel `Expression`. */
|
|
@@ -292,6 +293,7 @@ const deleteJsxNodes = async ({ input, nodePaths, prettierConfigOverride, }) =>
|
|
|
292
293
|
throw new Error('No JSX nodes were specified for deletion');
|
|
293
294
|
}
|
|
294
295
|
const ast = (0, parse_ast_1.parseAst)(input);
|
|
296
|
+
const capturedNodePaths = (0, get_node_path_remappings_1.captureJsxNodePaths)(ast);
|
|
295
297
|
const pathsToDelete = nodePaths.map((nodePath) => {
|
|
296
298
|
var _a, _b;
|
|
297
299
|
var _c, _d;
|
|
@@ -314,11 +316,17 @@ const deleteJsxNodes = async ({ input, nodePaths, prettierConfigOverride, }) =>
|
|
|
314
316
|
input: finalFile,
|
|
315
317
|
prettierConfigOverride,
|
|
316
318
|
});
|
|
319
|
+
const nodePathRemappings = (0, get_node_path_remappings_1.getNodePathRemappings)({
|
|
320
|
+
ast,
|
|
321
|
+
captured: capturedNodePaths,
|
|
322
|
+
output,
|
|
323
|
+
});
|
|
317
324
|
return {
|
|
318
325
|
output,
|
|
319
326
|
formatted,
|
|
320
327
|
nodeLabels: pathsToDelete.map(({ nodeLabel }) => nodeLabel),
|
|
321
328
|
logLines: pathsToDelete.map(({ logLine }) => logLine),
|
|
329
|
+
nodePathRemappings,
|
|
322
330
|
};
|
|
323
331
|
};
|
|
324
332
|
exports.deleteJsxNodes = deleteJsxNodes;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SequenceNodePathRemapping } from '@remotion/studio-shared';
|
|
1
2
|
import type { SequenceNodePath } from 'remotion';
|
|
2
3
|
export declare const duplicateJsxElementAtPath: (jsxPath: import("ast-types/lib/node-path").NodePath<N, V>) => void;
|
|
3
4
|
export declare const duplicateJsxNode: ({ input, nodePath, prettierConfigOverride, }: {
|
|
@@ -9,4 +10,5 @@ export declare const duplicateJsxNode: ({ input, nodePath, prettierConfigOverrid
|
|
|
9
10
|
formatted: boolean;
|
|
10
11
|
nodeLabel: string;
|
|
11
12
|
logLine: number;
|
|
13
|
+
nodePathRemappings: SequenceNodePathRemapping[];
|
|
12
14
|
}>;
|
|
@@ -38,6 +38,7 @@ const types_1 = require("@babel/types");
|
|
|
38
38
|
const recast = __importStar(require("recast"));
|
|
39
39
|
const delete_jsx_node_1 = require("./delete-jsx-node");
|
|
40
40
|
const format_file_content_1 = require("./format-file-content");
|
|
41
|
+
const get_node_path_remappings_1 = require("./get-node-path-remappings");
|
|
41
42
|
const parse_ast_1 = require("./parse-ast");
|
|
42
43
|
const { namedTypes } = recast.types;
|
|
43
44
|
const makeFragment = (first, second) => ({
|
|
@@ -288,6 +289,7 @@ const duplicateJsxNode = async ({ input, nodePath, prettierConfigOverride, }) =>
|
|
|
288
289
|
var _a, _b;
|
|
289
290
|
var _c, _d;
|
|
290
291
|
const ast = (0, parse_ast_1.parseAst)(input);
|
|
292
|
+
const capturedNodePaths = (0, get_node_path_remappings_1.captureJsxNodePaths)(ast);
|
|
291
293
|
const jsxPath = (0, delete_jsx_node_1.findJsxElementPathForDeletion)(ast, nodePath);
|
|
292
294
|
if (!jsxPath) {
|
|
293
295
|
throw new Error('Could not find a JSX element at the specified location to duplicate');
|
|
@@ -301,11 +303,17 @@ const duplicateJsxNode = async ({ input, nodePath, prettierConfigOverride, }) =>
|
|
|
301
303
|
input: finalFile,
|
|
302
304
|
prettierConfigOverride,
|
|
303
305
|
});
|
|
306
|
+
const nodePathRemappings = (0, get_node_path_remappings_1.getNodePathRemappings)({
|
|
307
|
+
ast,
|
|
308
|
+
captured: capturedNodePaths,
|
|
309
|
+
output,
|
|
310
|
+
});
|
|
304
311
|
return {
|
|
305
312
|
output,
|
|
306
313
|
formatted,
|
|
307
314
|
nodeLabel,
|
|
308
315
|
logLine,
|
|
316
|
+
nodePathRemappings,
|
|
309
317
|
};
|
|
310
318
|
};
|
|
311
319
|
exports.duplicateJsxNode = duplicateJsxNode;
|
|
@@ -76,6 +76,8 @@ const makeEasingExpression = ({ easing, easingLocalName, }) => {
|
|
|
76
76
|
switch (easing.type) {
|
|
77
77
|
case 'linear':
|
|
78
78
|
return b.memberExpression(b.identifier(easingLocalName), b.identifier('linear'));
|
|
79
|
+
case 'step1':
|
|
80
|
+
return b.memberExpression(b.identifier(easingLocalName), b.identifier('step1'));
|
|
79
81
|
case 'spring':
|
|
80
82
|
return b.callExpression(b.memberExpression(b.identifier(easingLocalName), b.identifier('spring')), [
|
|
81
83
|
b.objectExpression([
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { File, JSXOpeningElement } from '@babel/types';
|
|
2
|
+
import type { SequenceNodePathRemapping } from '@remotion/studio-shared';
|
|
3
|
+
import type { SequenceNodePath } from 'remotion';
|
|
4
|
+
export type CapturedJsxNodePath = {
|
|
5
|
+
node: JSXOpeningElement;
|
|
6
|
+
nodePath: SequenceNodePath;
|
|
7
|
+
};
|
|
8
|
+
export declare const captureJsxNodePaths: (ast: File) => CapturedJsxNodePath[];
|
|
9
|
+
export declare const getNodePathRemappings: ({ ast, captured, output, }: {
|
|
10
|
+
ast: File;
|
|
11
|
+
captured: CapturedJsxNodePath[];
|
|
12
|
+
output: string;
|
|
13
|
+
}) => SequenceNodePathRemapping[];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getNodePathRemappings = exports.captureJsxNodePaths = void 0;
|
|
37
|
+
const recast = __importStar(require("recast"));
|
|
38
|
+
const can_update_sequence_props_1 = require("../preview-server/routes/can-update-sequence-props");
|
|
39
|
+
const parse_ast_1 = require("./parse-ast");
|
|
40
|
+
const captureJsxNodePaths = (ast) => {
|
|
41
|
+
const captured = [];
|
|
42
|
+
recast.visit(ast, {
|
|
43
|
+
visitJSXOpeningElement(path) {
|
|
44
|
+
captured.push({
|
|
45
|
+
node: path.node,
|
|
46
|
+
nodePath: (0, can_update_sequence_props_1.getNodePathForRecastPath)(path, ast),
|
|
47
|
+
});
|
|
48
|
+
return this.traverse(path);
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
return captured;
|
|
52
|
+
};
|
|
53
|
+
exports.captureJsxNodePaths = captureJsxNodePaths;
|
|
54
|
+
const getNodePathRemappings = ({ ast, captured, output, }) => {
|
|
55
|
+
const nodesAfterMutation = [];
|
|
56
|
+
recast.visit(ast, {
|
|
57
|
+
visitJSXOpeningElement(path) {
|
|
58
|
+
nodesAfterMutation.push(path.node);
|
|
59
|
+
return this.traverse(path);
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
const finalAst = (0, parse_ast_1.parseAst)(output);
|
|
63
|
+
const finalNodePaths = [];
|
|
64
|
+
recast.visit(finalAst, {
|
|
65
|
+
visitJSXOpeningElement(path) {
|
|
66
|
+
finalNodePaths.push((0, can_update_sequence_props_1.getNodePathForRecastPath)(path, finalAst));
|
|
67
|
+
return this.traverse(path);
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
if (nodesAfterMutation.length !== finalNodePaths.length) {
|
|
71
|
+
throw new Error('Could not map JSX node paths after modifying JSX nodes');
|
|
72
|
+
}
|
|
73
|
+
const finalNodePathByNode = new Map();
|
|
74
|
+
for (let i = 0; i < nodesAfterMutation.length; i++) {
|
|
75
|
+
finalNodePathByNode.set(nodesAfterMutation[i], finalNodePaths[i]);
|
|
76
|
+
}
|
|
77
|
+
return captured.flatMap(({ node, nodePath }) => {
|
|
78
|
+
var _a;
|
|
79
|
+
const newNodePath = (_a = finalNodePathByNode.get(node)) !== null && _a !== void 0 ? _a : null;
|
|
80
|
+
if (newNodePath !== null &&
|
|
81
|
+
JSON.stringify(nodePath) === JSON.stringify(newNodePath)) {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
return [{ oldNodePath: nodePath, newNodePath }];
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
exports.getNodePathRemappings = getNodePathRemappings;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReorderSequencePosition } from '@remotion/studio-shared';
|
|
1
|
+
import type { ReorderSequencePosition, SequenceNodePathRemapping } from '@remotion/studio-shared';
|
|
2
2
|
import type { SequenceNodePath } from 'remotion';
|
|
3
3
|
export declare const reorderSequence: ({ input, sourceNodePath, targetNodePath, position, prettierConfigOverride, }: {
|
|
4
4
|
input: string;
|
|
@@ -11,4 +11,5 @@ export declare const reorderSequence: ({ input, sourceNodePath, targetNodePath,
|
|
|
11
11
|
formatted: boolean;
|
|
12
12
|
sequenceLabel: string;
|
|
13
13
|
logLine: number;
|
|
14
|
+
nodePathRemappings: SequenceNodePathRemapping[];
|
|
14
15
|
}>;
|
|
@@ -37,6 +37,7 @@ exports.reorderSequence = void 0;
|
|
|
37
37
|
const recast = __importStar(require("recast"));
|
|
38
38
|
const delete_jsx_node_1 = require("./delete-jsx-node");
|
|
39
39
|
const format_file_content_1 = require("./format-file-content");
|
|
40
|
+
const get_node_path_remappings_1 = require("./get-node-path-remappings");
|
|
40
41
|
const parse_ast_1 = require("./parse-ast");
|
|
41
42
|
const { namedTypes } = recast.types;
|
|
42
43
|
const getJsxChildrenParent = (path) => {
|
|
@@ -57,6 +58,7 @@ const reorderSequence = async ({ input, sourceNodePath, targetNodePath, position
|
|
|
57
58
|
var _a, _b;
|
|
58
59
|
var _c, _d;
|
|
59
60
|
const ast = (0, parse_ast_1.parseAst)(input);
|
|
61
|
+
const capturedNodePaths = (0, get_node_path_remappings_1.captureJsxNodePaths)(ast);
|
|
60
62
|
const sourcePath = (0, delete_jsx_node_1.findJsxElementPathForDeletion)(ast, sourceNodePath);
|
|
61
63
|
if (!sourcePath) {
|
|
62
64
|
throw new Error('Could not find a JSX element at the source location to reorder sequence');
|
|
@@ -99,11 +101,17 @@ const reorderSequence = async ({ input, sourceNodePath, targetNodePath, position
|
|
|
99
101
|
input: finalFile,
|
|
100
102
|
prettierConfigOverride,
|
|
101
103
|
});
|
|
104
|
+
const nodePathRemappings = (0, get_node_path_remappings_1.getNodePathRemappings)({
|
|
105
|
+
ast,
|
|
106
|
+
captured: capturedNodePaths,
|
|
107
|
+
output,
|
|
108
|
+
});
|
|
102
109
|
return {
|
|
103
110
|
output,
|
|
104
111
|
formatted,
|
|
105
112
|
sequenceLabel,
|
|
106
113
|
logLine,
|
|
114
|
+
nodePathRemappings,
|
|
107
115
|
};
|
|
108
116
|
};
|
|
109
117
|
exports.reorderSequence = reorderSequence;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SequenceNodePathRemapping } from '@remotion/studio-shared';
|
|
1
2
|
import type { SequenceNodePath } from 'remotion';
|
|
2
3
|
export declare const getSplitUnsupportedSequenceTagReason: (tagName: string) => string | null;
|
|
3
4
|
export declare const getIsSplittableSequenceTag: (tagName: string) => boolean;
|
|
@@ -11,4 +12,5 @@ export declare const splitJsxSequence: ({ input, nodePath, splitFrame, prettierC
|
|
|
11
12
|
formatted: boolean;
|
|
12
13
|
nodeLabel: string;
|
|
13
14
|
logLine: number;
|
|
15
|
+
nodePathRemappings: SequenceNodePathRemapping[];
|
|
14
16
|
}>;
|
|
@@ -38,6 +38,7 @@ const types_1 = require("@babel/types");
|
|
|
38
38
|
const recast = __importStar(require("recast"));
|
|
39
39
|
const delete_jsx_node_1 = require("./delete-jsx-node");
|
|
40
40
|
const format_file_content_1 = require("./format-file-content");
|
|
41
|
+
const get_node_path_remappings_1 = require("./get-node-path-remappings");
|
|
41
42
|
const parse_ast_1 = require("./parse-ast");
|
|
42
43
|
const { builders: b, namedTypes } = recast.types;
|
|
43
44
|
const jsxId = (name) => ({ type: 'JSXIdentifier', name });
|
|
@@ -275,6 +276,7 @@ const splitJsxSequence = async ({ input, nodePath, splitFrame, prettierConfigOve
|
|
|
275
276
|
throw new Error('Split frame must be an integer');
|
|
276
277
|
}
|
|
277
278
|
const ast = (0, parse_ast_1.parseAst)(input);
|
|
279
|
+
const capturedNodePaths = (0, get_node_path_remappings_1.captureJsxNodePaths)(ast);
|
|
278
280
|
const jsxPath = (0, delete_jsx_node_1.findJsxElementPathForDeletion)(ast, nodePath);
|
|
279
281
|
if (!jsxPath) {
|
|
280
282
|
throw new Error('Could not find a JSX sequence at the specified location to split');
|
|
@@ -340,11 +342,17 @@ const splitJsxSequence = async ({ input, nodePath, splitFrame, prettierConfigOve
|
|
|
340
342
|
input: finalFile,
|
|
341
343
|
prettierConfigOverride,
|
|
342
344
|
});
|
|
345
|
+
const nodePathRemappings = (0, get_node_path_remappings_1.getNodePathRemappings)({
|
|
346
|
+
ast,
|
|
347
|
+
captured: capturedNodePaths,
|
|
348
|
+
output,
|
|
349
|
+
});
|
|
343
350
|
return {
|
|
344
351
|
output,
|
|
345
352
|
formatted,
|
|
346
353
|
nodeLabel: (0, delete_jsx_node_1.getJsxElementTagLabel)(jsxElement),
|
|
347
354
|
logLine: (_d = (_c = (_a = jsxElement.openingElement.loc) === null || _a === void 0 ? void 0 : _a.start.line) !== null && _c !== void 0 ? _c : (_b = jsxElement.loc) === null || _b === void 0 ? void 0 : _b.start.line) !== null && _d !== void 0 ? _d : 1,
|
|
355
|
+
nodePathRemappings,
|
|
348
356
|
};
|
|
349
357
|
};
|
|
350
358
|
exports.splitJsxSequence = splitJsxSequence;
|
|
@@ -285,6 +285,8 @@ const createEasingExpression = (easing) => {
|
|
|
285
285
|
switch (easing.type) {
|
|
286
286
|
case 'linear':
|
|
287
287
|
return b.memberExpression(b.identifier('Easing'), b.identifier('linear'));
|
|
288
|
+
case 'step1':
|
|
289
|
+
return b.memberExpression(b.identifier('Easing'), b.identifier('step1'));
|
|
288
290
|
case 'spring':
|
|
289
291
|
return b.callExpression(b.memberExpression(b.identifier('Easing'), b.identifier('spring')), [
|
|
290
292
|
b.objectExpression([
|
package/dist/file-watcher.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export type FileChangeMetadata = {
|
|
2
|
+
skipSequencePropsUpdate: boolean;
|
|
3
|
+
};
|
|
4
|
+
type WriteFileAndNotifyFileWatchersOptions = {
|
|
5
|
+
file: string;
|
|
6
|
+
content: string;
|
|
7
|
+
originatorClientId: string | undefined;
|
|
8
|
+
metadata: FileChangeMetadata | null;
|
|
9
|
+
};
|
|
1
10
|
export type FileChangeEvent = {
|
|
2
11
|
type: 'created';
|
|
3
12
|
content: string;
|
|
@@ -8,6 +17,7 @@ export type FileChangeEvent = {
|
|
|
8
17
|
type: 'changed';
|
|
9
18
|
content: string;
|
|
10
19
|
originatorClientId: string | undefined;
|
|
20
|
+
skipSequencePropsUpdate: boolean;
|
|
11
21
|
};
|
|
12
22
|
type OnChange = (event: FileChangeEvent) => void;
|
|
13
23
|
export type FileWatcherRegistry = {
|
|
@@ -25,7 +35,7 @@ export type FileWatcherRegistry = {
|
|
|
25
35
|
exists: boolean;
|
|
26
36
|
unwatch: () => void;
|
|
27
37
|
};
|
|
28
|
-
writeFileAndNotifyFileWatchers: (
|
|
38
|
+
writeFileAndNotifyFileWatchers: (options: WriteFileAndNotifyFileWatchersOptions) => void;
|
|
29
39
|
};
|
|
30
40
|
export declare const createFileWatcherRegistry: () => FileWatcherRegistry;
|
|
31
41
|
export declare const setFileWatcherRegistry: (registry: FileWatcherRegistry) => () => void;
|
package/dist/file-watcher.js
CHANGED
|
@@ -101,7 +101,12 @@ const createFileWatcherRegistry = () => {
|
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
shared.lastKnownContent = content;
|
|
104
|
-
event = {
|
|
104
|
+
event = {
|
|
105
|
+
type: 'changed',
|
|
106
|
+
content,
|
|
107
|
+
originatorClientId: undefined,
|
|
108
|
+
skipSequencePropsUpdate: false,
|
|
109
|
+
};
|
|
105
110
|
}
|
|
106
111
|
if (!event) {
|
|
107
112
|
return;
|
|
@@ -123,7 +128,8 @@ const createFileWatcherRegistry = () => {
|
|
|
123
128
|
},
|
|
124
129
|
};
|
|
125
130
|
};
|
|
126
|
-
const _writeFileAndNotifyFileWatchers = (file, content, originatorClientId) => {
|
|
131
|
+
const _writeFileAndNotifyFileWatchers = ({ file, content, originatorClientId, metadata, }) => {
|
|
132
|
+
var _a;
|
|
127
133
|
(0, node_fs_1.writeFileSync)(file, content);
|
|
128
134
|
const shared = sharedWatchers.get(getRegistryKey(file, false));
|
|
129
135
|
if (!shared) {
|
|
@@ -132,7 +138,12 @@ const createFileWatcherRegistry = () => {
|
|
|
132
138
|
shared.lastKnownContent = content;
|
|
133
139
|
shared.existedBefore = true;
|
|
134
140
|
for (const subscriber of shared.subscribers) {
|
|
135
|
-
subscriber({
|
|
141
|
+
subscriber({
|
|
142
|
+
type: 'changed',
|
|
143
|
+
content,
|
|
144
|
+
originatorClientId,
|
|
145
|
+
skipSequencePropsUpdate: (_a = metadata === null || metadata === void 0 ? void 0 : metadata.skipSequencePropsUpdate) !== null && _a !== void 0 ? _a : false,
|
|
146
|
+
});
|
|
136
147
|
}
|
|
137
148
|
};
|
|
138
149
|
return {
|
|
@@ -166,10 +177,10 @@ const installFileWatcher = (options) => {
|
|
|
166
177
|
return (0, exports.getFileWatcherRegistry)().installFileWatcher(options);
|
|
167
178
|
};
|
|
168
179
|
exports.installFileWatcher = installFileWatcher;
|
|
169
|
-
const writeFileAndNotifyFileWatchers = (
|
|
180
|
+
const writeFileAndNotifyFileWatchers = (options) => {
|
|
170
181
|
if (!currentRegistry) {
|
|
171
182
|
return;
|
|
172
183
|
}
|
|
173
|
-
(0, exports.getFileWatcherRegistry)().writeFileAndNotifyFileWatchers(
|
|
184
|
+
(0, exports.getFileWatcherRegistry)().writeFileAndNotifyFileWatchers(options);
|
|
174
185
|
};
|
|
175
186
|
exports.writeFileAndNotifyFileWatchers = writeFileAndNotifyFileWatchers;
|
|
@@ -2,13 +2,47 @@ import type { DefaultCodingAgent } from '@remotion/renderer';
|
|
|
2
2
|
export type InstalledCodingAgent = {
|
|
3
3
|
id: DefaultCodingAgent;
|
|
4
4
|
name: string;
|
|
5
|
+
nameWithType: string;
|
|
5
6
|
applicationPath: string;
|
|
7
|
+
platform: SupportedCodingAgentPlatform;
|
|
8
|
+
launchMode: 'direct' | 'terminal';
|
|
9
|
+
terminal: InstalledTerminal | null;
|
|
10
|
+
};
|
|
11
|
+
type SupportedCodingAgentPlatform = 'darwin' | 'linux' | 'win32';
|
|
12
|
+
type LinuxTerminalId = 'x-terminal-emulator' | 'gnome-terminal' | 'konsole' | 'kitty' | 'alacritty' | 'wezterm' | 'xterm';
|
|
13
|
+
type InstalledTerminal = {
|
|
14
|
+
id: LinuxTerminalId | 'cmd';
|
|
15
|
+
path: string;
|
|
6
16
|
};
|
|
7
17
|
export type CodingAgentDiscoveryContext = {
|
|
8
18
|
platform: NodeJS.Platform;
|
|
19
|
+
env: NodeJS.ProcessEnv;
|
|
9
20
|
homeDirectory: string;
|
|
10
21
|
pathExists: (filePath: string) => boolean;
|
|
11
22
|
findMacApplications: (bundleIdentifier: string) => Promise<readonly string[]>;
|
|
12
23
|
};
|
|
13
24
|
export declare const discoverAvailableCodingAgents: (context: CodingAgentDiscoveryContext) => Promise<readonly InstalledCodingAgent[]>;
|
|
14
25
|
export declare const getAvailableCodingAgents: () => Promise<readonly InstalledCodingAgent[]>;
|
|
26
|
+
export declare const getCodingAgentLaunchCommand: ({ codingAgent, projectPath, }: {
|
|
27
|
+
codingAgent: InstalledCodingAgent;
|
|
28
|
+
projectPath: string;
|
|
29
|
+
}) => {
|
|
30
|
+
command: string;
|
|
31
|
+
args: string[];
|
|
32
|
+
cwd: string | null;
|
|
33
|
+
};
|
|
34
|
+
type CodingAgentLaunchCommand = ReturnType<typeof getCodingAgentLaunchCommand> & {
|
|
35
|
+
waitForExit: boolean;
|
|
36
|
+
};
|
|
37
|
+
export declare const getCodingAgentLaunchCommands: ({ codingAgent, projectPath, prompt, }: {
|
|
38
|
+
codingAgent: InstalledCodingAgent;
|
|
39
|
+
projectPath: string;
|
|
40
|
+
prompt: string | null;
|
|
41
|
+
}) => readonly CodingAgentLaunchCommand[];
|
|
42
|
+
export declare const launchCodingAgent: ({ codingAgent, projectPath, logLevel, prompt, }: {
|
|
43
|
+
codingAgent: InstalledCodingAgent;
|
|
44
|
+
projectPath: string;
|
|
45
|
+
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
46
|
+
prompt: string | null;
|
|
47
|
+
}) => Promise<boolean>;
|
|
48
|
+
export {};
|