@remotion/studio-server 4.0.537 → 4.0.538

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 (88) hide show
  1. package/dist/ansi-diff.js +3 -19
  2. package/dist/better-opn/index.d.ts +4 -2
  3. package/dist/codemods/effect-param-expression.d.ts +2 -2
  4. package/dist/codemods/get-node-path-remappings.d.ts +1 -12
  5. package/dist/codemods/get-node-path-remappings.js +1 -51
  6. package/dist/codemods/paste-effects.d.ts +2 -15
  7. package/dist/codemods/update-effect-props/update-effect-props.d.ts +2 -2
  8. package/dist/codemods/update-keyframes/update-keyframes.d.ts +3 -3
  9. package/dist/codemods/update-nested-prop.d.ts +1 -1
  10. package/dist/detect-outdated-remotion-skills.d.ts +3 -3
  11. package/dist/figma/figma-to-svg.d.ts +1 -1
  12. package/dist/file-watcher.d.ts +1 -1
  13. package/dist/helpers/coding-agent-registry.d.ts +3 -3
  14. package/dist/helpers/css-shorthand-properties.d.ts +8 -7
  15. package/dist/helpers/custom-editor.d.ts +2 -2
  16. package/dist/helpers/editor-registry.d.ts +2 -2
  17. package/dist/helpers/get-ast-node-path.d.ts +2 -1
  18. package/dist/helpers/import-agnostic-node-path.js +22 -13
  19. package/dist/helpers/open-in-app.d.ts +3 -3
  20. package/dist/helpers/open-in-editor.d.ts +2 -2
  21. package/dist/helpers/package-manager-spawn-options.d.ts +1 -1
  22. package/dist/helpers/read-source-file.d.ts +4 -0
  23. package/dist/helpers/read-source-file.js +14 -0
  24. package/dist/helpers/recently-used-apps.d.ts +2 -2
  25. package/dist/helpers/resolve-composition-component.d.ts +2 -2
  26. package/dist/helpers/resolve-editor.d.ts +3 -3
  27. package/dist/helpers/terminal-artwork.d.ts +4 -4
  28. package/dist/helpers/video-config-values.d.ts +4 -0
  29. package/dist/helpers/video-config-values.js +11 -3
  30. package/dist/index.d.ts +39 -100
  31. package/dist/index.js +1 -1
  32. package/dist/maybe-open-browser.d.ts +2 -1
  33. package/dist/preview-server/api-types.d.ts +1 -1
  34. package/dist/preview-server/dev-middleware/index.d.ts +2 -1
  35. package/dist/preview-server/dev-middleware/middleware.d.ts +1 -1
  36. package/dist/preview-server/dev-middleware/middleware.js +14 -17
  37. package/dist/preview-server/element-install-state.d.ts +1 -1
  38. package/dist/preview-server/get-package-manager.d.ts +3 -2
  39. package/dist/preview-server/handler.d.ts +4 -4
  40. package/dist/preview-server/hmr-timing.d.ts +2 -1
  41. package/dist/preview-server/hot-middleware/index.d.ts +2 -1
  42. package/dist/preview-server/jsx-component-identity.d.ts +4 -3
  43. package/dist/preview-server/live-events.d.ts +3 -2
  44. package/dist/preview-server/public-folder.js +11 -2
  45. package/dist/preview-server/routes/add-keyframes.d.ts +2 -1
  46. package/dist/preview-server/routes/app-icon.d.ts +1 -1
  47. package/dist/preview-server/routes/apply-visual-control-change.js +1 -4
  48. package/dist/preview-server/routes/batch-update-keyframe-settings.d.ts +2 -1
  49. package/dist/preview-server/routes/can-update-default-props.d.ts +2 -1
  50. package/dist/preview-server/routes/can-update-effect-props.d.ts +2 -6
  51. package/dist/preview-server/routes/can-update-sequence-props.d.ts +17 -13
  52. package/dist/preview-server/routes/can-update-sequence-props.js +21 -25
  53. package/dist/preview-server/routes/delete-keyframes.d.ts +4 -6
  54. package/dist/preview-server/routes/delete-keyframes.js +4 -66
  55. package/dist/preview-server/routes/element-install-plan.d.ts +3 -3
  56. package/dist/preview-server/routes/find-in-file.d.ts +2 -9
  57. package/dist/preview-server/routes/insert-element.js +1 -4
  58. package/dist/preview-server/routes/install-dependency.d.ts +2 -14
  59. package/dist/preview-server/routes/log-updates/log-effect-update.d.ts +2 -1
  60. package/dist/preview-server/routes/log-updates/log-update.d.ts +3 -2
  61. package/dist/preview-server/routes/move-keyframes.d.ts +2 -1
  62. package/dist/preview-server/routes/open-in-editor.d.ts +2 -2
  63. package/dist/preview-server/routes/remotion-skills-info.d.ts +1 -1
  64. package/dist/preview-server/routes/save-multiple-effect-props.js +25 -8
  65. package/dist/preview-server/routes/save-sequence-props.d.ts +2 -2
  66. package/dist/preview-server/routes/source-file-write-queue.d.ts +3 -2
  67. package/dist/preview-server/routes/subscribe-to-sequence-props.js +55 -34
  68. package/dist/preview-server/sequence-node-path-mutation.d.ts +2 -6
  69. package/dist/preview-server/sequence-props-watchers.d.ts +7 -5
  70. package/dist/preview-server/sequence-props-watchers.js +7 -2
  71. package/dist/preview-server/serve-static.d.ts +1 -1
  72. package/dist/preview-server/serve-static.js +18 -1
  73. package/dist/preview-server/start-server.d.ts +3 -3
  74. package/dist/preview-server/studio-protocol/handle-discovery.d.ts +1 -1
  75. package/dist/preview-server/studio-protocol/handle-element-library.d.ts +1 -1
  76. package/dist/preview-server/studio-protocol/handle-install.d.ts +1 -1
  77. package/dist/preview-server/studio-protocol/handle-license-key.d.ts +1 -1
  78. package/dist/preview-server/studio-protocol/origin-policy.d.ts +2 -2
  79. package/dist/preview-server/studio-protocol/protocol-response.d.ts +1 -1
  80. package/dist/preview-server/undo-stack.d.ts +3 -3
  81. package/dist/preview-server/undo-stack.js +9 -0
  82. package/dist/preview-server/update-available.d.ts +3 -2
  83. package/dist/remotion-skill-names.d.ts +1 -1
  84. package/dist/routes.d.ts +4 -4
  85. package/dist/server-ready.d.ts +2 -1
  86. package/dist/start-studio.d.ts +3 -3
  87. package/dist/studio-shortcuts.d.ts +3 -3
  88. package/package.json +10 -10
@@ -1,5 +1,6 @@
1
+ import { CodemodsInternals } from '@remotion/codemods';
1
2
  import type { CanUpdateDefaultPropsResponse, SymbolicatedStackFrame } from '@remotion/studio-shared';
2
- export declare const computeCanUpdateDefaultPropsFromContent: (content: string, compositionId: string) => CanUpdateDefaultPropsResponse;
3
+ export declare const { computeCanUpdateDefaultPropsFromContent, }: typeof CodemodsInternals;
3
4
  export declare const checkIfTypeScriptFile: (file: string) => void;
4
5
  export declare const getDefaultPropsFile: ({ symbolicatedStack, remotionRoot, entryPoint, }: {
5
6
  symbolicatedStack: SymbolicatedStackFrame | null;
@@ -1,4 +1,5 @@
1
1
  import type { File, JSXOpeningElement } from '@babel/types';
2
+ import { CodemodsInternals } from '@remotion/codemods';
2
3
  import type { CanUpdateEffectPropsResponse, SequenceNodePath, InteractivitySchema } from 'remotion';
3
4
  import { type VideoConfigIdentifierValues } from '../../helpers/video-config-values';
4
5
  export declare const computeEffectPropStatus: ({ ast, jsx, effectIndex, keys, videoConfigValues, }: {
@@ -8,12 +9,7 @@ export declare const computeEffectPropStatus: ({ ast, jsx, effectIndex, keys, vi
8
9
  keys: string[];
9
10
  videoConfigValues: VideoConfigIdentifierValues;
10
11
  }) => CanUpdateEffectPropsResponse;
11
- export declare const computeEffectPropsStatusesFromContent: ({ fileContents, sequenceNodePath, effects, keysFor, }: {
12
- fileContents: string;
13
- sequenceNodePath: SequenceNodePath;
14
- effects: InteractivitySchema[];
15
- keysFor: (effect: InteractivitySchema) => string[];
16
- }) => CanUpdateEffectPropsResponse<import("remotion").SourceNumericValue>[];
12
+ export declare const { computeEffectPropsStatusesFromContent }: typeof CodemodsInternals;
17
13
  export declare const computeEffectPropsStatusesFromFile: ({ fileName, sequenceNodePath, effects, keysFor, remotionRoot, }: {
18
14
  fileName: string;
19
15
  sequenceNodePath: SequenceNodePath;
@@ -1,6 +1,7 @@
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 } from 'remotion';
3
+ import * as recast from 'recast';
4
+ import type { CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, JsxComponentIdentity, LogLevel, SequenceNodePath } from 'remotion';
4
5
  import { type VideoConfigIdentifierValues } from '../../helpers/video-config-values';
5
6
  type CanUpdatePropStatus = CanUpdateSequencePropStatus;
6
7
  type StaticValueOptions = {
@@ -10,7 +11,7 @@ export declare const isStaticValue: (node: Expression, options?: StaticValueOpti
10
11
  export declare const extractStaticValue: (node: Expression, options?: StaticValueOptions) => unknown;
11
12
  export declare const getComputedStatus: (node: Expression, ast: File, videoConfigValues: VideoConfigIdentifierValues) => CanUpdatePropStatus;
12
13
  export declare const getNodePathForRecastPath: (recastPath: any, ast: File) => SequenceNodePath;
13
- export declare const findJsxElementPathAtNodePath: (ast: File, nodePath: SequenceNodePath) => import("ast-types/lib/node-path").NodePath<N, V> | null;
14
+ export declare const findJsxElementPathAtNodePath: (ast: File, nodePath: SequenceNodePath) => recast.types.NodePath<any, any> | null;
14
15
  export declare const findJsxElementAtNodePath: (ast: File, nodePath: SequenceNodePath) => JSXOpeningElement | null;
15
16
  export declare const findJsxElementNodeAtNodePath: (ast: File, nodePath: SequenceNodePath) => JSXElement | null;
16
17
  export type StaticJsxTextContent = {
@@ -24,7 +25,7 @@ export declare const getStaticJsxChildrenAttribute: (jsxElement: JSXOpeningEleme
24
25
  export declare const hasJsxChildrenAttribute: (jsxElement: JSXOpeningElement) => boolean;
25
26
  export declare const getStaticJsxTextContent: (jsxElement: JSXElement) => StaticJsxTextContent | null;
26
27
  export declare const findNodePathForJsxElement: (ast: File, target: JSXOpeningElement) => SequenceNodePath | null;
27
- export declare const lineColumnToNodePath: (ast: File, targetLine: number, targetColumn?: number | undefined, fileContents?: string | undefined) => SequenceNodePath | null;
28
+ export declare const lineColumnToNodePath: (ast: File, targetLine: number, targetColumn?: number, fileContents?: string) => SequenceNodePath | null;
28
29
  export declare const lineColumnsToNodePaths: ({ ast, targets, fileContents, }: {
29
30
  ast: File;
30
31
  targets: {
@@ -33,40 +34,43 @@ export declare const lineColumnsToNodePaths: ({ ast, targets, fileContents, }: {
33
34
  }[];
34
35
  fileContents: string;
35
36
  }) => (SequenceNodePath | null)[];
36
- export declare const resolveSequencePropsNodePathsFromFilename: ({ fileName, targets, remotionRoot, }: {
37
+ export declare const resolveSequencePropsNodePathsFromFilename: ({ fileName, targets, remotionRoot, fileContentsCache, }: {
37
38
  fileName: string;
38
39
  targets: {
39
40
  line: number;
40
41
  column: number;
41
42
  }[];
42
43
  remotionRoot: string;
44
+ fileContentsCache: Map<string, string> | null;
43
45
  }) => (SequenceNodePath | null)[];
44
46
  export declare const computeSequencePropsStatusFromContent: ({ fileContents, nodePath, componentIdentity, keys, assetKeys, effects, }: {
45
47
  fileContents: string;
46
48
  nodePath: SequenceNodePath;
47
- componentIdentity: string | null;
49
+ componentIdentity: JsxComponentIdentity | null;
48
50
  keys: string[];
49
- assetKeys?: string[] | undefined;
51
+ assetKeys?: string[];
50
52
  effects: string[][];
51
53
  }) => CanUpdateSequencePropsResponseTrue;
52
- export declare const computeSequencePropsStatus: ({ fileName, nodePath, componentIdentity, keys, assetKeys, effects, remotionRoot, }: {
54
+ export declare const computeSequencePropsStatus: ({ fileName, nodePath, componentIdentity, keys, assetKeys, effects, remotionRoot, fileContentsCache, }: {
53
55
  fileName: string;
54
56
  nodePath: SequenceNodePath;
55
- componentIdentity: string | null;
57
+ componentIdentity: JsxComponentIdentity | null;
56
58
  keys: string[];
57
- assetKeys?: string[] | undefined;
59
+ assetKeys?: string[];
58
60
  effects: string[][];
59
61
  remotionRoot: string;
62
+ fileContentsCache: Map<string, string> | null;
60
63
  }) => CanUpdateSequencePropsResponseTrue;
61
- export declare const computeSequencePropsStatusFromFilenameByLocation: ({ fileName, line, column, componentIdentity, keys, assetKeys, effects, remotionRoot, logLevel, }: {
64
+ export declare const computeSequencePropsStatusFromFilenameByLocation: ({ fileName, line, column, componentIdentity, keys, assetKeys, effects, remotionRoot, logLevel, fileContentsCache, }: {
62
65
  fileName: string;
63
66
  line: number;
64
67
  column: number;
65
- componentIdentity: string | null;
68
+ componentIdentity: JsxComponentIdentity | null;
66
69
  keys: string[];
67
- assetKeys?: string[] | undefined;
70
+ assetKeys?: string[];
68
71
  effects: string[][];
69
72
  remotionRoot: string;
70
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
73
+ logLevel: LogLevel;
74
+ fileContentsCache: Map<string, string> | null;
71
75
  }) => SubscribeToSequencePropsResponse;
72
76
  export {};
@@ -34,7 +34,6 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.computeSequencePropsStatusFromFilenameByLocation = exports.computeSequencePropsStatus = exports.computeSequencePropsStatusFromContent = exports.resolveSequencePropsNodePathsFromFilename = exports.lineColumnsToNodePaths = exports.lineColumnToNodePath = exports.findNodePathForJsxElement = exports.getStaticJsxTextContent = exports.hasJsxChildrenAttribute = exports.getStaticJsxChildrenAttribute = exports.findJsxElementNodeAtNodePath = exports.findJsxElementAtNodePath = exports.findJsxElementPathAtNodePath = exports.getNodePathForRecastPath = exports.getComputedStatus = exports.extractStaticValue = exports.isStaticValue = void 0;
37
- const node_fs_1 = require("node:fs");
38
37
  const codemods_1 = require("@remotion/codemods");
39
38
  const renderer_1 = require("@remotion/renderer");
40
39
  const studio_shared_1 = require("@remotion/studio-shared");
@@ -43,6 +42,7 @@ const no_react_1 = require("remotion/no-react");
43
42
  const get_ast_node_path_1 = require("../../helpers/get-ast-node-path");
44
43
  const import_agnostic_node_path_1 = require("../../helpers/import-agnostic-node-path");
45
44
  const parse_keyframe_easing_expression_1 = require("../../helpers/parse-keyframe-easing-expression");
45
+ const read_source_file_1 = require("../../helpers/read-source-file");
46
46
  const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
47
47
  const video_config_numeric_expression_1 = require("../../helpers/video-config-numeric-expression");
48
48
  const jsx_component_identity_1 = require("../jsx-component-identity");
@@ -513,7 +513,7 @@ const findNodePath = (ast, target) => {
513
513
  visitNode(p) {
514
514
  if (p.node === target) {
515
515
  found = p;
516
- return false;
516
+ return this.abort();
517
517
  }
518
518
  return this.traverse(p);
519
519
  },
@@ -604,11 +604,13 @@ const getFrameDisplayOffsetAdjustmentBetweenPaths = ({ startPath, endPath, video
604
604
  ? { adjustment, playbackRateAdjustment, hasEnclosingElement }
605
605
  : null;
606
606
  };
607
- const resolveCurrentFrameExpression = ({ node, ast, seenDeclarations, }) => {
607
+ const resolveCurrentFrameExpression = ({ node, nodePath, ast, seenDeclarations, }) => {
608
608
  var _a;
609
+ var _b, _c, _d;
609
610
  if (node.type === 'TSAsExpression') {
610
611
  return resolveCurrentFrameExpression({
611
612
  node: node.expression,
613
+ nodePath: (_b = nodePath === null || nodePath === void 0 ? void 0 : nodePath.get('expression')) !== null && _b !== void 0 ? _b : null,
612
614
  ast,
613
615
  seenDeclarations,
614
616
  });
@@ -619,6 +621,7 @@ const resolveCurrentFrameExpression = ({ node, ast, seenDeclarations, }) => {
619
621
  if (rightValue !== null && Number.isFinite(rightValue)) {
620
622
  const resolvedLeft = resolveCurrentFrameExpression({
621
623
  node: node.left,
624
+ nodePath: (_c = nodePath === null || nodePath === void 0 ? void 0 : nodePath.get('left')) !== null && _c !== void 0 ? _c : null,
622
625
  ast,
623
626
  seenDeclarations,
624
627
  });
@@ -635,6 +638,7 @@ const resolveCurrentFrameExpression = ({ node, ast, seenDeclarations, }) => {
635
638
  if (leftValue !== null && Number.isFinite(leftValue)) {
636
639
  const resolvedRight = resolveCurrentFrameExpression({
637
640
  node: node.right,
641
+ nodePath: (_d = nodePath === null || nodePath === void 0 ? void 0 : nodePath.get('right')) !== null && _d !== void 0 ? _d : null,
638
642
  ast,
639
643
  seenDeclarations,
640
644
  });
@@ -651,7 +655,6 @@ const resolveCurrentFrameExpression = ({ node, ast, seenDeclarations, }) => {
651
655
  if (node.type !== 'Identifier') {
652
656
  return null;
653
657
  }
654
- const nodePath = findNodePath(ast, node);
655
658
  const bindingScope = (_a = nodePath === null || nodePath === void 0 ? void 0 : nodePath.scope) === null || _a === void 0 ? void 0 : _a.lookup(node.name);
656
659
  if (!nodePath || !bindingScope) {
657
660
  return null;
@@ -659,6 +662,7 @@ const resolveCurrentFrameExpression = ({ node, ast, seenDeclarations, }) => {
659
662
  let matchingDeclarations = 0;
660
663
  let matchingDeclaration = null;
661
664
  let initializer = null;
665
+ let initializerPath = null;
662
666
  let isConstDeclaration = false;
663
667
  recast.types.visit(bindingScope.path, {
664
668
  visitVariableDeclarator(p) {
@@ -674,6 +678,7 @@ const resolveCurrentFrameExpression = ({ node, ast, seenDeclarations, }) => {
674
678
  if (init) {
675
679
  matchingDeclaration = p.node;
676
680
  initializer = init;
681
+ initializerPath = p.get('init');
677
682
  isConstDeclaration =
678
683
  declaration.type === 'VariableDeclaration' &&
679
684
  declaration.kind === 'const';
@@ -697,6 +702,7 @@ const resolveCurrentFrameExpression = ({ node, ast, seenDeclarations, }) => {
697
702
  nextSeenDeclarations.add(matchingDeclaration);
698
703
  return resolveCurrentFrameExpression({
699
704
  node: initializer,
705
+ nodePath: initializerPath,
700
706
  ast,
701
707
  seenDeclarations: nextSeenDeclarations,
702
708
  });
@@ -712,6 +718,7 @@ const getCurrentFrameDisplayOffsetAdjustment = ({ node, ast, videoConfigValues,
712
718
  const nodePath = findNodePath(ast, node);
713
719
  const resolved = resolveCurrentFrameExpression({
714
720
  node,
721
+ nodePath,
715
722
  ast,
716
723
  seenDeclarations: new Set(),
717
724
  });
@@ -951,29 +958,16 @@ const lineColumnsToNodePaths = ({ ast, targets, fileContents, }) => {
951
958
  return targets.map((_, index) => exactMatchCounts[index] === 1 ? exactMatches[index] : lineMatches[index]);
952
959
  };
953
960
  exports.lineColumnsToNodePaths = lineColumnsToNodePaths;
954
- const resolveSequencePropsNodePathsFromFilename = ({ fileName, targets, remotionRoot, }) => {
961
+ const resolveSequencePropsNodePathsFromFilename = ({ fileName, targets, remotionRoot, fileContentsCache, }) => {
955
962
  const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
956
963
  remotionRoot,
957
964
  fileName,
958
965
  action: 'read',
959
966
  });
960
- const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
961
- const nodes = (0, codemods_1.getNodes)({
962
- project: { rootDir: remotionRoot, files: { [absolutePath]: fileContents } },
963
- filePath: absolutePath,
964
- });
965
- return targets.map(({ line, column }) => {
966
- var _a;
967
- var _b;
968
- const lineMatches = nodes.filter((node) => {
969
- var _a;
970
- return ((_a = node.location) === null || _a === void 0 ? void 0 : _a.line) === line;
971
- });
972
- const exactMatches = lineMatches.filter((node) => {
973
- var _a;
974
- return ((_a = node.location) === null || _a === void 0 ? void 0 : _a.column) === column;
975
- });
976
- return ((_b = (_a = (exactMatches.length === 1 ? exactMatches[0] : lineMatches.at(-1))) === null || _a === void 0 ? void 0 : _a.nodePath) !== null && _b !== void 0 ? _b : null);
967
+ const fileContents = (0, read_source_file_1.readSourceFile)({ absolutePath, fileContentsCache });
968
+ return codemods_1.CodemodsInternals.resolveNodePathsFromLocations({
969
+ fileContents,
970
+ targets,
977
971
  });
978
972
  };
979
973
  exports.resolveSequencePropsNodePathsFromFilename = resolveSequencePropsNodePathsFromFilename;
@@ -999,13 +993,13 @@ const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, compone
999
993
  }
1000
994
  };
1001
995
  exports.computeSequencePropsStatusFromContent = computeSequencePropsStatusFromContent;
1002
- const computeSequencePropsStatus = ({ fileName, nodePath, componentIdentity, keys, assetKeys = [], effects, remotionRoot, }) => {
996
+ const computeSequencePropsStatus = ({ fileName, nodePath, componentIdentity, keys, assetKeys = [], effects, remotionRoot, fileContentsCache, }) => {
1003
997
  const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
1004
998
  remotionRoot,
1005
999
  fileName,
1006
1000
  action: 'read',
1007
1001
  });
1008
- const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
1002
+ const fileContents = (0, read_source_file_1.readSourceFile)({ absolutePath, fileContentsCache });
1009
1003
  return (0, exports.computeSequencePropsStatusFromContent)({
1010
1004
  fileContents,
1011
1005
  nodePath,
@@ -1016,7 +1010,7 @@ const computeSequencePropsStatus = ({ fileName, nodePath, componentIdentity, key
1016
1010
  });
1017
1011
  };
1018
1012
  exports.computeSequencePropsStatus = computeSequencePropsStatus;
1019
- const computeSequencePropsStatusFromFilenameByLocation = ({ fileName, line, column, componentIdentity, keys, assetKeys = [], effects, remotionRoot, logLevel, }) => {
1013
+ const computeSequencePropsStatusFromFilenameByLocation = ({ fileName, line, column, componentIdentity, keys, assetKeys = [], effects, remotionRoot, logLevel, fileContentsCache, }) => {
1020
1014
  try {
1021
1015
  const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
1022
1016
  remotionRoot,
@@ -1027,6 +1021,7 @@ const computeSequencePropsStatusFromFilenameByLocation = ({ fileName, line, colu
1027
1021
  fileName,
1028
1022
  targets: [{ line, column }],
1029
1023
  remotionRoot,
1024
+ fileContentsCache,
1030
1025
  });
1031
1026
  if (!resolvedNodePath) {
1032
1027
  return {
@@ -1046,6 +1041,7 @@ const computeSequencePropsStatusFromFilenameByLocation = ({ fileName, line, colu
1046
1041
  assetKeys,
1047
1042
  effects,
1048
1043
  remotionRoot,
1044
+ fileContentsCache,
1049
1045
  }),
1050
1046
  nodePath: {
1051
1047
  absolutePath,
@@ -1,13 +1,11 @@
1
- import type { DeleteEffectKeyframe, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteSequenceKeyframe, SaveEffectPropsResponse, SaveSequencePropsResult } from '@remotion/studio-shared';
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ import type { DeleteEffectKeyframe, DeleteKeyframesRequest, DeleteKeyframesResponse, DeleteSequenceKeyframe } from '@remotion/studio-shared';
2
3
  import type { ApiHandler } from '../api-types';
3
4
  export declare const deleteKeyframes: ({ sequenceKeyframes, effectKeyframes, clientId, remotionRoot, logLevel, }: {
4
5
  sequenceKeyframes: DeleteSequenceKeyframe[];
5
6
  effectKeyframes: DeleteEffectKeyframe[];
6
7
  clientId: string;
7
8
  remotionRoot: string;
8
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
9
- }) => Promise<{
10
- sequenceResults: SaveSequencePropsResult[];
11
- effectResults: SaveEffectPropsResponse[];
12
- }>;
9
+ logLevel: LogLevel;
10
+ }) => Promise<void>;
13
11
  export declare const deleteKeyframesHandler: ApiHandler<DeleteKeyframesRequest, DeleteKeyframesResponse>;
@@ -3,16 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deleteKeyframesHandler = exports.deleteKeyframes = void 0;
4
4
  const node_fs_1 = require("node:fs");
5
5
  const renderer_1 = require("@remotion/renderer");
6
- const studio_shared_1 = require("@remotion/studio-shared");
7
- const parse_ast_1 = require("../../codemods/parse-ast");
8
6
  const update_keyframes_1 = require("../../codemods/update-keyframes/update-keyframes");
9
7
  const file_watcher_1 = require("../../file-watcher");
10
8
  const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
11
- const video_config_values_1 = require("../../helpers/video-config-values");
12
9
  const undo_stack_1 = require("../undo-stack");
13
10
  const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
14
- const can_update_effect_props_1 = require("./can-update-effect-props");
15
- const can_update_sequence_props_1 = require("./can-update-sequence-props");
16
11
  const log_effect_update_1 = require("./log-updates/log-effect-update");
17
12
  const log_update_1 = require("./log-updates/log-update");
18
13
  const source_file_write_queue_1 = require("./source-file-write-queue");
@@ -46,42 +41,33 @@ const deleteKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, r
46
41
  throw new Error('No keyframes were specified for deletion');
47
42
  }
48
43
  const fileGroups = new Map();
49
- const resolvedSequenceKeyframes = [];
50
- const resolvedEffectKeyframes = [];
51
- for (const [index, keyframe] of sequenceKeyframes.entries()) {
44
+ for (const keyframe of sequenceKeyframes) {
52
45
  const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
53
46
  remotionRoot,
54
47
  fileName: keyframe.fileName,
55
48
  action: 'modify',
56
49
  });
57
50
  const group = (_a = fileGroups.get(absolutePath)) !== null && _a !== void 0 ? _a : {
58
- fileRelativeToRoot,
59
51
  sequenceKeyframes: [],
60
52
  effectKeyframes: [],
61
53
  };
62
- const resolved = { ...keyframe, index, absolutePath, fileRelativeToRoot };
63
- group.sequenceKeyframes.push(resolved);
64
- resolvedSequenceKeyframes.push(resolved);
54
+ group.sequenceKeyframes.push({ ...keyframe, fileRelativeToRoot });
65
55
  fileGroups.set(absolutePath, group);
66
56
  }
67
- for (const [index, keyframe] of effectKeyframes.entries()) {
57
+ for (const keyframe of effectKeyframes) {
68
58
  const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
69
59
  remotionRoot,
70
60
  fileName: keyframe.fileName,
71
61
  action: 'modify',
72
62
  });
73
63
  const group = (_b = fileGroups.get(absolutePath)) !== null && _b !== void 0 ? _b : {
74
- fileRelativeToRoot,
75
64
  sequenceKeyframes: [],
76
65
  effectKeyframes: [],
77
66
  };
78
- const resolved = { ...keyframe, index, absolutePath, fileRelativeToRoot };
79
- group.effectKeyframes.push(resolved);
80
- resolvedEffectKeyframes.push(resolved);
67
+ group.effectKeyframes.push({ ...keyframe, fileRelativeToRoot });
81
68
  fileGroups.set(absolutePath, group);
82
69
  }
83
70
  const snapshots = [];
84
- const outputByPath = new Map();
85
71
  const sequenceLogs = [];
86
72
  const effectLogs = [];
87
73
  for (const [absolutePath, group] of fileGroups) {
@@ -166,7 +152,6 @@ const deleteKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, r
166
152
  newContents: output,
167
153
  logLine: Number.isFinite(firstLogLine) ? firstLogLine : 1,
168
154
  });
169
- outputByPath.set(absolutePath, output);
170
155
  }
171
156
  const [firstKeyframe] = sequenceKeyframes.length > 0 ? sequenceKeyframes : effectKeyframes;
172
157
  if (!firstKeyframe) {
@@ -228,53 +213,6 @@ const deleteKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, r
228
213
  });
229
214
  }
230
215
  (0, undo_stack_1.printUndoHint)(logLevel);
231
- const sequenceResults = resolvedSequenceKeyframes.map((keyframe) => {
232
- const output = outputByPath.get(keyframe.absolutePath);
233
- if (!output) {
234
- throw new Error('Could not compute sequence keyframe deletion status');
235
- }
236
- const status = (0, can_update_sequence_props_1.computeSequencePropsStatusFromContent)({
237
- fileContents: output,
238
- keys: (0, studio_shared_1.getAllSchemaKeys)(keyframe.schema),
239
- nodePath: keyframe.nodePath.nodePath,
240
- componentIdentity: null,
241
- effects: [],
242
- });
243
- return {
244
- fileName: keyframe.fileName,
245
- nodePath: keyframe.nodePath,
246
- props: status.props,
247
- };
248
- });
249
- const astByPath = new Map();
250
- const effectResults = resolvedEffectKeyframes.map((keyframe) => {
251
- var _a;
252
- const output = outputByPath.get(keyframe.absolutePath);
253
- if (!output) {
254
- throw new Error('Could not compute effect keyframe deletion status');
255
- }
256
- const ast = (_a = astByPath.get(keyframe.absolutePath)) !== null && _a !== void 0 ? _a : (0, parse_ast_1.parseAst)(output);
257
- astByPath.set(keyframe.absolutePath, ast);
258
- const jsx = (0, can_update_sequence_props_1.findJsxElementAtNodePath)(ast, keyframe.sequenceNodePath.nodePath);
259
- if (!jsx) {
260
- return {
261
- canUpdate: false,
262
- effectIndex: keyframe.effectIndex,
263
- reason: 'not-found',
264
- };
265
- }
266
- return (0, can_update_effect_props_1.computeEffectPropStatus)({
267
- ast,
268
- jsx,
269
- effectIndex: keyframe.effectIndex,
270
- keys: (0, studio_shared_1.getAllSchemaKeys)(keyframe.schema),
271
- videoConfigValues: (0, video_config_values_1.getVideoConfigIdentifierValues)({
272
- ast,
273
- videoConfigValues: keyframe.sequenceNodePath.videoConfigValues,
274
- }),
275
- });
276
- });
277
- return { sequenceResults, effectResults };
278
216
  };
279
217
  exports.deleteKeyframes = deleteKeyframes;
280
218
  const deleteKeyframesHandler = ({ input: { sequenceKeyframes, effectKeyframes, clientId }, remotionRoot, logLevel, }) => (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
@@ -1,7 +1,7 @@
1
- import type { ElementInstallExpectedFileState, PrepareElementInstallRequest } from '@remotion/studio-shared';
1
+ import type { ElementInstallExpectedFileState, InsertElementRequest, PrepareElementInstallRequest } from '@remotion/studio-shared';
2
2
  export declare const getElementSourceHash: (source: string) => string;
3
- export declare const validateElementInstallPosition: (position: import("@remotion/studio-shared").InsertableCompositionElementPosition | null) => void;
4
- export declare const validateElementForInstallation: (element: import("@remotion/studio-shared").InstallableElement) => void;
3
+ export declare const validateElementInstallPosition: (position: InsertElementRequest['position']) => void;
4
+ export declare const validateElementForInstallation: (element: InsertElementRequest['element']) => void;
5
5
  export declare const makeRelativeElementImportPath: ({ fromFile, toFile, }: {
6
6
  fromFile: string;
7
7
  toFile: string;
@@ -1,12 +1,5 @@
1
+ import { CodemodsInternals } from '@remotion/codemods';
1
2
  import type { FindInFileRequest, FindInFileResponse } from '@remotion/studio-shared';
2
3
  import type { ApiHandler } from '../api-types';
3
- export declare const findSearchPosition: ({ contents, lineNumber, columnNumber, search, }: {
4
- contents: string;
5
- lineNumber: number;
6
- columnNumber: number;
7
- search: string;
8
- }) => {
9
- lineNumber: number;
10
- columnNumber: number;
11
- };
4
+ export declare const { findSearchPosition }: typeof CodemodsInternals;
12
5
  export declare const findInFileHandler: ApiHandler<FindInFileRequest, FindInFileResponse>;
@@ -79,10 +79,7 @@ const insertElementHandler = async ({ input: { compositionFile, compositionId, c
79
79
  const componentOwnsSequence = installationMode === 'component-owned-sequence';
80
80
  if (componentOwnsSequence &&
81
81
  element.initialProps !== null &&
82
- ['from', 'durationInFrames', 'name'].some((prop) => {
83
- var _a;
84
- return Object.hasOwn((_a = element.initialProps) !== null && _a !== void 0 ? _a : {}, prop);
85
- })) {
82
+ ['from', 'durationInFrames', 'name'].some((prop) => { var _a; return Object.hasOwn((_a = element.initialProps) !== null && _a !== void 0 ? _a : {}, prop); })) {
86
83
  throw new Error('Component-owned Element initial props must not override from, durationInFrames, or name');
87
84
  }
88
85
  if (componentOwnsSequence &&
@@ -1,18 +1,6 @@
1
1
  import { type InstallPackageRequest, type InstallPackageResponse, type PackageInstallSpec } from '@remotion/studio-shared';
2
+ import type { ApiHandler } from '../api-types';
2
3
  export declare const getPackageInstallSpec: (dependency: PackageInstallSpec) => string;
3
- export declare const handleInstallPackage: ({ logLevel, remotionRoot, input: { dependencies }, invalidateBundle, }: {
4
- input: InstallPackageRequest;
5
- entryPoint: string;
6
- remotionRoot: string;
7
- request: import("http").IncomingMessage;
8
- response: import("http").ServerResponse<import("http").IncomingMessage>;
9
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
10
- methods: import("../api-types").QueueMethods;
11
- publicDir: string;
12
- binariesDirectory: string | null;
13
- configFile: string | null;
14
- getDefaultCodingAgent: () => "claude-code" | "codex" | "copilot" | "cursor" | null;
15
- getDefaultEditor: () => import("@remotion/renderer").DefaultEditor | null;
16
- } & {
4
+ export declare const handleInstallPackage: ({ logLevel, remotionRoot, input: { dependencies }, invalidateBundle, }: Parameters<ApiHandler<InstallPackageRequest, InstallPackageResponse>>[0] & {
17
5
  readonly invalidateBundle: () => Promise<void>;
18
6
  }) => Promise<InstallPackageResponse>;
@@ -1,3 +1,4 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  import type { PropDelta } from './formatting';
2
3
  export declare const logEffectUpdate: ({ fileRelativeToRoot, line, effectName, propKey, oldValueString, newValueString, defaultValueString, formatted, logLevel, removedProps, addedProps, }: {
3
4
  fileRelativeToRoot: string;
@@ -8,7 +9,7 @@ export declare const logEffectUpdate: ({ fileRelativeToRoot, line, effectName, p
8
9
  newValueString: string;
9
10
  defaultValueString: string | null;
10
11
  formatted: boolean;
11
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
12
+ logLevel: LogLevel;
12
13
  removedProps: PropDelta[];
13
14
  addedProps: PropDelta[];
14
15
  }) => void;
@@ -1,5 +1,6 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  import type { PropDelta } from './formatting';
2
- export declare const warnAboutPrettierOnce: (logLevel: "error" | "info" | "trace" | "verbose" | "warn") => void;
3
+ export declare const warnAboutPrettierOnce: (logLevel: LogLevel) => void;
3
4
  export declare const normalizeQuotes: (str: string) => string;
4
5
  export declare const logUpdate: ({ fileRelativeToRoot, line, key, oldValueString, newValueString, defaultValueString, formatted, logLevel, removedProps, addedProps, }: {
5
6
  fileRelativeToRoot: string;
@@ -9,7 +10,7 @@ export declare const logUpdate: ({ fileRelativeToRoot, line, key, oldValueString
9
10
  newValueString: string;
10
11
  defaultValueString: string | null;
11
12
  formatted: boolean;
12
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
13
+ logLevel: LogLevel;
13
14
  removedProps: PropDelta[];
14
15
  addedProps: PropDelta[];
15
16
  }) => void;
@@ -1,7 +1,8 @@
1
+ import type { LogLevel } from '@remotion/renderer';
1
2
  import type { MoveKeyframesRequest, MoveKeyframesResponse } from '@remotion/studio-shared';
2
3
  import type { ApiHandler } from '../api-types';
3
4
  export declare const moveKeyframes: ({ sequenceKeyframes, effectKeyframes, clientId, remotionRoot, logLevel, }: MoveKeyframesRequest & {
4
5
  remotionRoot: string;
5
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
6
+ logLevel: LogLevel;
6
7
  }) => Promise<void>;
7
8
  export declare const moveKeyframesHandler: ApiHandler<MoveKeyframesRequest, MoveKeyframesResponse>;
@@ -1,8 +1,8 @@
1
- import type { DefaultEditor } from '@remotion/renderer';
1
+ import type { DefaultEditor, LogLevel } from '@remotion/renderer';
2
2
  import type { OpenInEditorRequest, OpenInEditorResponse } from '@remotion/studio-shared';
3
3
  import type { ApiHandler } from '../api-types';
4
4
  export declare const getEditorName: ({ getDefaultEditor, logLevel, }: {
5
5
  getDefaultEditor: () => DefaultEditor | null;
6
- logLevel: "error" | "info" | "trace" | "verbose" | "warn";
6
+ logLevel: LogLevel;
7
7
  }) => Promise<string | null>;
8
8
  export declare const openInEditorHandler: ApiHandler<OpenInEditorRequest, OpenInEditorResponse>;
@@ -2,7 +2,7 @@ import type { GetRemotionSkillsInfoRequest, GetRemotionSkillsInfoResponse, OpenR
2
2
  import type { ApiHandler } from '../api-types';
3
3
  export declare const getRemotionSkillsInfo: ({ remotionRoot, homeDirectory, }: {
4
4
  remotionRoot: string;
5
- homeDirectory?: string | undefined;
5
+ homeDirectory?: string;
6
6
  }) => GetRemotionSkillsInfoResponse;
7
7
  export declare const remotionSkillsInfoHandler: ApiHandler<GetRemotionSkillsInfoRequest, GetRemotionSkillsInfoResponse>;
8
8
  export declare const openRemotionSkillHandler: ApiHandler<OpenRemotionSkillRequest, void>;
@@ -141,6 +141,9 @@ const saveMultipleEffectPropsHandler = ({ input: { edits, clientId, undoLabel, r
141
141
  edit,
142
142
  ])).values(),
143
143
  ];
144
+ const statusAsts = new Map();
145
+ // Share binding analysis, but resolve each target's video configuration below.
146
+ const statusIdentifiers = new Map();
144
147
  const results = statusTargets.map((edit) => {
145
148
  const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
146
149
  remotionRoot,
@@ -151,24 +154,38 @@ const saveMultipleEffectPropsHandler = ({ input: { edits, clientId, undoLabel, r
151
154
  if (!output) {
152
155
  throw new Error('Could not compute effect prop edit status');
153
156
  }
154
- const ast = (0, parse_ast_1.parseAst)(output);
157
+ let ast = statusAsts.get(absolutePath);
158
+ if (!ast) {
159
+ ast = (0, parse_ast_1.parseAst)(output);
160
+ statusAsts.set(absolutePath, ast);
161
+ }
155
162
  const jsx = (0, can_update_sequence_props_1.findJsxElementAtNodePath)(ast, edit.sequenceNodePath.nodePath);
156
- const status = jsx
157
- ? (0, can_update_effect_props_1.computeEffectPropStatus)({
163
+ let status;
164
+ if (jsx) {
165
+ const keys = (0, studio_shared_1.getAllSchemaKeys)(edit.schema);
166
+ let identifiers = statusIdentifiers.get(absolutePath);
167
+ if (!identifiers) {
168
+ identifiers = (0, video_config_values_1.getVideoConfigIdentifiers)({ ast });
169
+ statusIdentifiers.set(absolutePath, identifiers);
170
+ }
171
+ status = (0, can_update_effect_props_1.computeEffectPropStatus)({
158
172
  ast,
159
173
  jsx,
160
174
  effectIndex: edit.effectIndex,
161
- keys: (0, studio_shared_1.getAllSchemaKeys)(edit.schema),
162
- videoConfigValues: (0, video_config_values_1.getVideoConfigIdentifierValues)({
163
- ast,
175
+ keys,
176
+ videoConfigValues: (0, video_config_values_1.resolveVideoConfigIdentifierValues)({
177
+ identifiers,
164
178
  videoConfigValues: edit.sequenceNodePath.videoConfigValues,
165
179
  }),
166
- })
167
- : {
180
+ });
181
+ }
182
+ else {
183
+ status = {
168
184
  canUpdate: false,
169
185
  effectIndex: edit.effectIndex,
170
186
  reason: 'not-found',
171
187
  };
188
+ }
172
189
  return {
173
190
  fileName: edit.fileName,
174
191
  sequenceNodePath: edit.sequenceNodePath,
@@ -13,10 +13,10 @@ type ResolvedSequencePropEdit = {
13
13
  schema: SaveSequencePropEdit['schema'];
14
14
  sourceEdit: SaveSequencePropEdit['sourceEdit'];
15
15
  };
16
- export declare const convertSequencePropEditToCodemodChange: (edit: Pick<ResolvedSequencePropEdit, "defaultValue" | "key" | "nodePath" | "schema" | "sourceEdit" | "value">) => SequencePropsNodeUpdate;
16
+ export declare const convertSequencePropEditToCodemodChange: (edit: Pick<ResolvedSequencePropEdit, 'nodePath' | 'key' | 'value' | 'defaultValue' | 'schema' | 'sourceEdit'>) => SequencePropsNodeUpdate;
17
17
  export declare const shouldSuppressHmrForSequencePropEdits: (edits: readonly {
18
18
  key: string;
19
- sourceEdit?: import("@remotion/studio-shared").SaveSequencePropSourceEdit | null | undefined;
19
+ sourceEdit?: SaveSequencePropEdit['sourceEdit'];
20
20
  }[]) => boolean;
21
21
  export declare const saveSequencePropsHandler: ApiHandler<SaveSequencePropsRequest, SaveSequencePropsResponse>;
22
22
  export {};
@@ -1,2 +1,3 @@
1
- export declare const getCodemodTimingPrefix: (logLevel: "error" | "info" | "trace" | "verbose" | "warn") => string;
2
- export declare const withSourceFileWriteQueue: <T>(fn: () => T | Promise<T>) => Promise<T>;
1
+ import type { LogLevel } from '@remotion/renderer';
2
+ export declare const getCodemodTimingPrefix: (logLevel: LogLevel) => string;
3
+ export declare const withSourceFileWriteQueue: <T>(fn: () => Promise<T> | T) => Promise<T>;