@remotion/studio-server 4.0.507 → 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.
Files changed (66) hide show
  1. package/dist/codemods/delete-jsx-node.d.ts +4 -0
  2. package/dist/codemods/delete-jsx-node.js +8 -0
  3. package/dist/codemods/duplicate-jsx-node.d.ts +2 -0
  4. package/dist/codemods/duplicate-jsx-node.js +8 -0
  5. package/dist/codemods/get-node-path-remappings.d.ts +13 -0
  6. package/dist/codemods/get-node-path-remappings.js +87 -0
  7. package/dist/codemods/reorder-sequence.d.ts +2 -1
  8. package/dist/codemods/reorder-sequence.js +8 -0
  9. package/dist/codemods/split-jsx-sequence.d.ts +2 -0
  10. package/dist/codemods/split-jsx-sequence.js +8 -0
  11. package/dist/file-watcher.d.ts +11 -1
  12. package/dist/file-watcher.js +16 -5
  13. package/dist/helpers/coding-agent-registry.d.ts +0 -1
  14. package/dist/helpers/coding-agent-registry.js +1 -5
  15. package/dist/helpers/finder-artwork.d.ts +1 -0
  16. package/dist/helpers/finder-artwork.js +4 -0
  17. package/dist/helpers/resolve-composition-component.d.ts +2 -1
  18. package/dist/helpers/resolve-composition-component.js +60 -68
  19. package/dist/helpers/terminal-artwork.d.ts +6 -0
  20. package/dist/helpers/terminal-artwork.js +14 -0
  21. package/dist/helpers/terminal-registry.d.ts +36 -0
  22. package/dist/helpers/terminal-registry.js +401 -0
  23. package/dist/index.d.ts +6 -1
  24. package/dist/preview-server/api-routes.js +2 -0
  25. package/dist/preview-server/live-events.d.ts +1 -0
  26. package/dist/preview-server/live-events.js +3 -1
  27. package/dist/preview-server/routes/add-effect-keyframe.js +7 -1
  28. package/dist/preview-server/routes/add-effect.js +7 -1
  29. package/dist/preview-server/routes/add-keyframes.js +10 -2
  30. package/dist/preview-server/routes/add-sequence-keyframe.js +7 -1
  31. package/dist/preview-server/routes/app-icon.d.ts +6 -0
  32. package/dist/preview-server/routes/app-icon.js +66 -0
  33. package/dist/preview-server/routes/apply-codemod.js +15 -2
  34. package/dist/preview-server/routes/apply-visual-control-change.js +7 -1
  35. package/dist/preview-server/routes/batch-update-keyframe-settings.js +10 -2
  36. package/dist/preview-server/routes/can-update-sequence-props.d.ts +1 -0
  37. package/dist/preview-server/routes/can-update-sequence-props.js +5 -4
  38. package/dist/preview-server/routes/default-coding-agent.js +4 -2
  39. package/dist/preview-server/routes/delete-effect.js +7 -1
  40. package/dist/preview-server/routes/delete-jsx-node.js +16 -2
  41. package/dist/preview-server/routes/delete-keyframes.js +10 -2
  42. package/dist/preview-server/routes/duplicate-effect.js +7 -1
  43. package/dist/preview-server/routes/duplicate-jsx-node.js +17 -5
  44. package/dist/preview-server/routes/insert-element.js +23 -3
  45. package/dist/preview-server/routes/insert-jsx-element.js +17 -2
  46. package/dist/preview-server/routes/move-keyframes.js +10 -2
  47. package/dist/preview-server/routes/open-in-terminal.d.ts +3 -0
  48. package/dist/preview-server/routes/open-in-terminal.js +17 -0
  49. package/dist/preview-server/routes/paste-effects.js +7 -1
  50. package/dist/preview-server/routes/reorder-effect.js +7 -1
  51. package/dist/preview-server/routes/reorder-sequence.js +17 -2
  52. package/dist/preview-server/routes/save-effect-props.js +7 -1
  53. package/dist/preview-server/routes/save-multiple-effect-props.js +10 -2
  54. package/dist/preview-server/routes/save-sequence-props.js +10 -2
  55. package/dist/preview-server/routes/split-jsx-sequence.js +17 -6
  56. package/dist/preview-server/routes/update-config.js +6 -1
  57. package/dist/preview-server/routes/update-default-props.js +7 -1
  58. package/dist/preview-server/routes/update-effect-keyframe-settings.js +7 -1
  59. package/dist/preview-server/routes/update-sequence-keyframe-settings.js +7 -1
  60. package/dist/preview-server/sequence-node-path-mutation.d.ts +7 -0
  61. package/dist/preview-server/sequence-node-path-mutation.js +21 -0
  62. package/dist/preview-server/sequence-props-watchers.js +15 -6
  63. package/dist/preview-server/undo-stack.d.ts +7 -13
  64. package/dist/preview-server/undo-stack.js +58 -5
  65. package/dist/routes.js +8 -0
  66. package/package.json +8 -8
@@ -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;
@@ -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;
@@ -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: (file: string, content: string, originatorClientId: string | undefined) => void;
38
+ writeFileAndNotifyFileWatchers: (options: WriteFileAndNotifyFileWatchersOptions) => void;
29
39
  };
30
40
  export declare const createFileWatcherRegistry: () => FileWatcherRegistry;
31
41
  export declare const setFileWatcherRegistry: (registry: FileWatcherRegistry) => () => void;
@@ -101,7 +101,12 @@ const createFileWatcherRegistry = () => {
101
101
  return;
102
102
  }
103
103
  shared.lastKnownContent = content;
104
- event = { type: 'changed', content, originatorClientId: undefined };
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({ type: 'changed', content, originatorClientId });
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 = (file, content, originatorClientId) => {
180
+ const writeFileAndNotifyFileWatchers = (options) => {
170
181
  if (!currentRegistry) {
171
182
  return;
172
183
  }
173
- (0, exports.getFileWatcherRegistry)().writeFileAndNotifyFileWatchers(file, content, originatorClientId);
184
+ (0, exports.getFileWatcherRegistry)().writeFileAndNotifyFileWatchers(options);
174
185
  };
175
186
  exports.writeFileAndNotifyFileWatchers = writeFileAndNotifyFileWatchers;
@@ -4,7 +4,6 @@ export type InstalledCodingAgent = {
4
4
  name: string;
5
5
  nameWithType: string;
6
6
  applicationPath: string;
7
- iconDataUrl: string | null;
8
7
  platform: SupportedCodingAgentPlatform;
9
8
  launchMode: 'direct' | 'terminal';
10
9
  terminal: InstalledTerminal | null;
@@ -184,7 +184,6 @@ const findMacApplications = async (bundleIdentifier) => {
184
184
  return [];
185
185
  }
186
186
  };
187
- const getBundledCodingAgentIconDataUrl = (id) => `data:image/png;base64,${(0, node_fs_1.readFileSync)(node_path_1.default.join(__dirname, '..', '..', 'web', 'coding-agent-icons', `${id}.png`)).toString('base64')}`;
188
187
  const defaultDiscoveryContext = {
189
188
  platform: process.platform,
190
189
  env: process.env,
@@ -294,10 +293,7 @@ const discoverAvailableCodingAgents = async (context) => {
294
293
  }
295
294
  }
296
295
  }
297
- return installedCodingAgents.map((codingAgent) => ({
298
- ...codingAgent,
299
- iconDataUrl: getBundledCodingAgentIconDataUrl(codingAgent.id),
300
- }));
296
+ return installedCodingAgents;
301
297
  };
302
298
  exports.discoverAvailableCodingAgents = discoverAvailableCodingAgents;
303
299
  let availableCodingAgents = null;
@@ -0,0 +1 @@
1
+ export declare const finderArtworkDataUrl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAIFElEQVRYCe1XXWxcRxU+M3P33l177Wx+ajtbk9SJIyuhUghCQgKnJYAAKaJVoA/QB0BCPJSfPFBVRAiQJURfeOEFeCgvCFSpqQhR1KqhbQhClIcqwpX60qTrFKdJwK7/7fX67v3j++buXd+7rcszqGc1OzNnzpzzzTlnfq7IB/Q/5gH1X/FOXXX2ffr+ezzlDUSJckS3VaKUkjZmakFblIvmMvo/G27K12qSbCRJIuJKkviJ67pJHMcRaH1mZmb+1KlT4fvZ3BFQ/eraPql43xbjPAzN96H0iVIatYI1O4+4On0xSSxPjzbleJ8kgRUAUgW82uKPtVabWpvZJI4uzc3N/Wp8fHz+vYC9J6Chy3PHnd17nlYV55gEsBlhKhctLDliFxrasZJPlFvy24O+xHAZeRYsGsSssQ6ttTglR8qeK63W1vWVleVH6/X6P3LabFP3MoYvNIacau0Z5TjHkvVIki14OACikAUIwni7RGwnEmPsdLUtDkBHcSwI0XaBTBRHmB6K7/uytrYhCONEtTrwzLVr1/b32n8XINO397u67E4kTQCJAIDeQa06ddonLy2wJUMSymR/LD7w0Wl0ZozCVALL1uTZgn5zc1MGBqrjo6MHzqJboCKgb0yVlXHPJFuQgaEURLHu5QXAfcILpO4m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ule", { value: true });
3
+ exports.finderArtworkDataUrl = void 0;
4
+ exports.finderArtworkDataUrl = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAIFElEQVRYCe1XXWxcRxU+M3P33l177Wx+ajtbk9SJIyuhUghCQgKnJYAAKaJVoA/QB0BCPJSfPFBVRAiQJURfeOEFeCgvCFSpqQhR1KqhbQhClIcqwpX60qTrFKdJwK7/7fX67v3j++buXd+7rcszqGc1OzNnzpzzzTlnfq7IB/Q/5gH1X/FOXXX2ffr+ezzlDUSJckS3VaKUkjZmakFblIvmMvo/G27K12qSbCRJIuJKkviJ67pJHMcRaH1mZmb+1KlT4fvZ3BFQ/eraPql43xbjPAzN96H0iVIatYI1O4+4On0xSSxPjzbleJ8kgRUAUgW82uKPtVabWpvZJI4uzc3N/Wp8fHz+vYC9J6Chy3PHnd17nlYV55gEsBlhKhctLDliFxrasZJPlFvy24O+xHAZeRYsGsSssQ6ttTglR8qeK63W1vWVleVH6/X6P3LabFP3MoYvNIacau0Z5TjHkvVIki14OACikAUIwni7RGwnEmPsdLUtDkBHcSwI0XaBTBRHmB6K7/uytrYhCONEtTrwzLVr1/b32n8XINO397u67E4kTQCJAIDeQa06ddonLy2wJUMSymR/LD7w0Wl0ZozCVALL1uTZgn5zc1MGBqrjo6MHzqJboCKgb0yVlXHPJFuQgaEURLHu5QXAfcILpO4m1oFdMEDENv/gsA4o8lL+lh9IyXUfnpqa6ssjcvKd2sTHRyQxH0JSiOISmQO5vEk55JI4BkMIyclqlPIsAjvYnQXf4gdQmMzVUwfrIAyYZ6OTk5Mj6N5EsVQA5Fb6B+GZsp3GmV21bEOxMfBctmuxUnAHkPEn+iMJsnBZScpjNgCWHKeTTykiLgLLhfcxQUk5KZV2WeHOXyFksVIlSOs0eSFB2ywR1thqSTB7Y5sHPhYpB5xIRj2EC/qtU2GXNZ3F8majIZuYS4oxkIYs9VgSJwaAC04pAHISTychAHUTGBqZ2ILz8MY1qT31GE69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7eE97Fjf/+ErHntGhLwvmsKwcnZJdR25LfWVazMp1iRenJUYi05eJLsnK4G752PGPype/+nUZ2V+HoxNpt7c9k5nmNYL7zl9YXMLzYZsKgOZfuzB/79jpO0r34aHGUJDSc4MBNEgcbuclVZfF2gHRu8HDOWSsU0U2Ay2PnGzKF47jVbCFRxvyZifSBs+uVnj34kvPzeVlikl9/dJ63Fx4QeEjj4lqk5U1UeT6Gl8ZOoBX2vjswdu4jdMw9JHU7UjeuIOLGB7h04MO3qmUSp4sLS9ffvnZZ1d3BoSR5usXfx2tz89qXcHNDo0Ewi2O2t6TlgevoZ+Npw9/nDcQf3NOSwtvchK9mpVuHwwPG2RxceH2lZcu/5L8POFqLJL/zytL7vBHXjf9ow9od1eNn6npMgHAtpFTPNi6bY6nBV/W0sQXy4OHA6n1p1uc2u0Njy1v8FrlUbC2unrrb3+9+q0fPXH2VY7n6V2AONh648JbSRS8bPrryOlSDXu0DFCae9U+znmz2m8b1HysZ23UmwA0tmdLJkZwkvNMQ1bj4zEKw7C11Wq+/fbs7PnfPfWb7z/50x/+PQ8ka3MLvR8Z2TO+f/DQl+qqes+gMS4+Tvmg3pl8hPLEqC+fOwasCDU+6pMw8sOldxbW//yn5+80Go1/YTYT4QP6//DAfwC3xW1pQd6lDwAAAABJRU5ErkJggg==';
@@ -1,4 +1,4 @@
1
- import { type InsertableCompositionElement, type InsertableCompositionElementPosition } from '@remotion/studio-shared';
1
+ import { type InsertableCompositionElement, type InsertableCompositionElementPosition, type SequenceNodePathRemapping } from '@remotion/studio-shared';
2
2
  export type ResolvedCompositionComponent = {
3
3
  source: string;
4
4
  line: number;
@@ -43,4 +43,5 @@ export declare const insertJsxElementIntoComposition: ({ remotionRoot, compositi
43
43
  output: string;
44
44
  formatted: boolean;
45
45
  logLine: number;
46
+ nodePathRemappings: SequenceNodePathRemapping[];
46
47
  }>;
@@ -39,11 +39,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.insertJsxElementIntoComposition = exports.resolveCompositionComponent = exports.resolveCompositionComponentWithFile = void 0;
40
40
  const node_fs_1 = __importDefault(require("node:fs"));
41
41
  const node_path_1 = __importDefault(require("node:path"));
42
- const studio_codemods_1 = require("@remotion/studio-codemods");
43
42
  const studio_shared_1 = require("@remotion/studio-shared");
44
43
  const recast = __importStar(require("recast"));
45
44
  const no_react_1 = require("remotion/no-react");
46
45
  const format_file_content_1 = require("../codemods/format-file-content");
46
+ const get_node_path_remappings_1 = require("../codemods/get-node-path-remappings");
47
47
  const parse_ast_1 = require("../codemods/parse-ast");
48
48
  const strip_parenthesized_extra_1 = require("../codemods/strip-parenthesized-extra");
49
49
  const update_nested_prop_1 = require("../codemods/update-nested-prop");
@@ -1130,14 +1130,14 @@ const addElementToComponentRoot = ({ ast, exportName, element, }) => {
1130
1130
  CANVAS_ROOT_ELEMENTS.includes(rootNode.openingElement.name.name)) {
1131
1131
  throw new Error(`Cannot insert a JSX element into a composition whose root element is <${rootNode.openingElement.name.name}>`);
1132
1132
  }
1133
- if (rootNode.type === 'JSXElement' && rootNode.openingElement.selfClosing) {
1134
- const fragment = recast.types.builders.jsxFragment(recast.types.builders.jsxOpeningFragment(), recast.types.builders.jsxClosingFragment(), [
1135
- createSequenceWithChild({
1133
+ if (rootNode.type === 'JSXElement') {
1134
+ const existingRoot = rootNode.openingElement.selfClosing
1135
+ ? createSequenceWithChild({
1136
1136
  child: (0, strip_parenthesized_extra_1.stripParenthesizedExtra)(rootNode),
1137
1137
  sequenceLocalName: ensureSequenceImport(ast),
1138
- }),
1139
- element,
1140
- ]);
1138
+ })
1139
+ : (0, strip_parenthesized_extra_1.stripParenthesizedExtra)(rootNode);
1140
+ const fragment = recast.types.builders.jsxFragment(recast.types.builders.jsxOpeningFragment(), recast.types.builders.jsxClosingFragment(), [existingRoot, element]);
1141
1141
  let replaced = false;
1142
1142
  recast.types.visit(ast, {
1143
1143
  visitJSXElement(astPath) {
@@ -1440,75 +1440,66 @@ const insertJsxElementIntoComposition = async ({ remotionRoot, compositionFile,
1440
1440
  remotionRoot,
1441
1441
  fileName: location.fileName,
1442
1442
  });
1443
- let finalFile;
1444
- let logLine;
1445
- if (element.type === 'solid' && from === null && wrapInSequence === null) {
1446
- const inserted = (0, studio_codemods_1.insertSolidIntoSource)({
1447
- exportName: location.exportName,
1448
- height: element.height,
1443
+ const ast = (0, parse_ast_1.parseAst)(input);
1444
+ const capturedNodePaths = (0, get_node_path_remappings_1.captureJsxNodePaths)(ast);
1445
+ if (element.type === 'composition' &&
1446
+ element.compositionId === compositionId) {
1447
+ throw new Error('Cannot insert a composition into itself');
1448
+ }
1449
+ const sequenceWrapper = element.type === 'composition'
1450
+ ? {
1451
+ dimensions: { width: element.width, height: element.height },
1452
+ durationInFrames: element.durationInFrames,
1453
+ name: element.compositionId,
1449
1454
  position: element.position,
1450
- source: input,
1451
- width: element.width,
1452
- });
1453
- finalFile = inserted.output;
1454
- logLine = inserted.line;
1455
- }
1456
- else {
1457
- const ast = (0, parse_ast_1.parseAst)(input);
1458
- if (element.type === 'composition' &&
1459
- element.compositionId === compositionId) {
1460
- throw new Error('Cannot insert a composition into itself');
1455
+ from,
1461
1456
  }
1462
- const sequenceWrapper = element.type === 'composition'
1463
- ? {
1464
- dimensions: { width: element.width, height: element.height },
1465
- durationInFrames: element.durationInFrames,
1466
- name: element.compositionId,
1457
+ : from === null ||
1458
+ element.type === 'asset' ||
1459
+ element.type === 'svg' ||
1460
+ element.type === 'component'
1461
+ ? wrapInSequence
1462
+ : {
1463
+ dimensions: null,
1464
+ durationInFrames: null,
1465
+ name: null,
1467
1466
  position: element.position,
1468
1467
  from,
1469
- }
1470
- : from === null ||
1471
- element.type === 'asset' ||
1472
- element.type === 'svg' ||
1473
- element.type === 'component'
1474
- ? wrapInSequence
1475
- : {
1476
- dimensions: null,
1477
- durationInFrames: null,
1478
- name: null,
1479
- position: element.position,
1480
- from,
1481
- };
1482
- const elementToInsert = await createInsertableJsxElement({
1483
- addPositionStyleToComponent: sequenceWrapper === null,
1484
- ast,
1485
- destinationFileName: location.fileName,
1486
- element,
1487
- from,
1488
- remotionRoot,
1489
- });
1490
- const finalElementToInsert = sequenceWrapper
1491
- ? createSequenceWrappedElement({
1492
- child: elementToInsert,
1493
- dimensions: sequenceWrapper.dimensions,
1494
- durationInFrames: (_a = sequenceWrapper.durationInFrames) !== null && _a !== void 0 ? _a : null,
1495
- from: sequenceWrapper.from,
1496
- name: sequenceWrapper.name,
1497
- position: sequenceWrapper.position,
1498
- sequenceLocalName: ensureSequenceImport(ast),
1499
- })
1500
- : elementToInsert;
1501
- logLine = addElementToComponentRoot({
1502
- ast,
1503
- exportName: location.exportName,
1504
- element: finalElementToInsert,
1505
- });
1506
- finalFile = (0, parse_ast_1.serializeAst)(ast);
1507
- }
1468
+ };
1469
+ const elementToInsert = await createInsertableJsxElement({
1470
+ addPositionStyleToComponent: sequenceWrapper === null,
1471
+ ast,
1472
+ destinationFileName: location.fileName,
1473
+ element,
1474
+ from,
1475
+ remotionRoot,
1476
+ });
1477
+ const finalElementToInsert = sequenceWrapper
1478
+ ? createSequenceWrappedElement({
1479
+ child: elementToInsert,
1480
+ dimensions: sequenceWrapper.dimensions,
1481
+ durationInFrames: (_a = sequenceWrapper.durationInFrames) !== null && _a !== void 0 ? _a : null,
1482
+ from: sequenceWrapper.from,
1483
+ name: sequenceWrapper.name,
1484
+ position: sequenceWrapper.position,
1485
+ sequenceLocalName: ensureSequenceImport(ast),
1486
+ })
1487
+ : elementToInsert;
1488
+ const logLine = addElementToComponentRoot({
1489
+ ast,
1490
+ exportName: location.exportName,
1491
+ element: finalElementToInsert,
1492
+ });
1493
+ const finalFile = (0, parse_ast_1.serializeAst)(ast);
1508
1494
  const { output, formatted } = await (0, format_file_content_1.formatFileContent)({
1509
1495
  input: finalFile,
1510
1496
  prettierConfigOverride,
1511
1497
  });
1498
+ const nodePathRemappings = (0, get_node_path_remappings_1.getNodePathRemappings)({
1499
+ ast,
1500
+ captured: capturedNodePaths,
1501
+ output,
1502
+ });
1512
1503
  return {
1513
1504
  fileName: location.fileName,
1514
1505
  source: location.source,
@@ -1516,6 +1507,7 @@ const insertJsxElementIntoComposition = async ({ remotionRoot, compositionFile,
1516
1507
  output,
1517
1508
  formatted,
1518
1509
  logLine,
1510
+ nodePathRemappings,
1519
1511
  };
1520
1512
  };
1521
1513
  exports.insertJsxElementIntoComposition = insertJsxElementIntoComposition;