@remotion/studio-server 4.0.490 → 4.0.492

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 (44) hide show
  1. package/dist/better-opn/index.d.ts +4 -0
  2. package/dist/better-opn/index.js +152 -31
  3. package/dist/codemods/paste-effects.d.ts +2 -1
  4. package/dist/codemods/paste-effects.js +33 -6
  5. package/dist/codemods/split-jsx-sequence.js +5 -0
  6. package/dist/codemods/update-keyframes/update-keyframes.d.ts +9 -5
  7. package/dist/codemods/update-keyframes/update-keyframes.js +88 -42
  8. package/dist/codemods/update-nested-prop.d.ts +3 -2
  9. package/dist/codemods/update-nested-prop.js +17 -4
  10. package/dist/codemods/update-sequence-props/update-sequence-props.d.ts +6 -3
  11. package/dist/codemods/update-sequence-props/update-sequence-props.js +51 -10
  12. package/dist/helpers/video-config-numeric-expression.d.ts +12 -0
  13. package/dist/helpers/video-config-numeric-expression.js +152 -0
  14. package/dist/helpers/video-config-values.d.ts +7 -0
  15. package/dist/helpers/video-config-values.js +84 -0
  16. package/dist/index.d.ts +1 -2
  17. package/dist/preview-server/element-install-state.d.ts +1 -0
  18. package/dist/preview-server/routes/add-effect-keyframe.js +6 -0
  19. package/dist/preview-server/routes/add-keyframes.js +2 -0
  20. package/dist/preview-server/routes/add-sequence-keyframe.js +2 -0
  21. package/dist/preview-server/routes/apply-codemod.d.ts +1 -0
  22. package/dist/preview-server/routes/apply-codemod.js +62 -13
  23. package/dist/preview-server/routes/can-update-effect-props.d.ts +8 -4
  24. package/dist/preview-server/routes/can-update-effect-props.js +26 -5
  25. package/dist/preview-server/routes/can-update-sequence-props.d.ts +12 -5
  26. package/dist/preview-server/routes/can-update-sequence-props.js +82 -33
  27. package/dist/preview-server/routes/delete-keyframes.js +8 -0
  28. package/dist/preview-server/routes/move-keyframes.js +2 -0
  29. package/dist/preview-server/routes/paste-effects.js +2 -1
  30. package/dist/preview-server/routes/save-effect-props.js +5 -0
  31. package/dist/preview-server/routes/save-sequence-props.js +5 -0
  32. package/dist/preview-server/routes/subscribe-to-sequence-props.js +3 -1
  33. package/dist/preview-server/routes/unsubscribe-from-sequence-props.js +3 -1
  34. package/dist/preview-server/routes/update-effect-keyframe-settings.js +6 -0
  35. package/dist/preview-server/routes/update-element-install-target.js +15 -1
  36. package/dist/preview-server/routes/update-sequence-keyframe-settings.js +2 -0
  37. package/dist/preview-server/sequence-props-watchers.d.ts +7 -3
  38. package/dist/preview-server/sequence-props-watchers.js +20 -6
  39. package/dist/preview-server/start-server.d.ts +0 -1
  40. package/dist/preview-server/start-server.js +0 -1
  41. package/dist/routes.js +3 -0
  42. package/dist/start-studio.d.ts +1 -2
  43. package/dist/start-studio.js +1 -2
  44. package/package.json +6 -6
@@ -1,12 +1,13 @@
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 type { CanUpdateSequencePropsResponseTrue, CanUpdateSequencePropStatus, SequenceNodePath, VideoConfigValues } from 'remotion';
4
+ import { type VideoConfigIdentifierValues } from '../../helpers/video-config-values';
4
5
  type StaticValueOptions = {
5
6
  allowSpecialValues: boolean;
6
7
  };
7
8
  export declare const isStaticValue: (node: Expression, options?: StaticValueOptions) => boolean;
8
9
  export declare const extractStaticValue: (node: Expression, options?: StaticValueOptions) => unknown;
9
- export declare const getComputedStatus: (node: Expression, ast: File) => CanUpdateSequencePropStatus;
10
+ export declare const getComputedStatus: (node: Expression, ast: File, videoConfigValues: VideoConfigIdentifierValues) => CanUpdateSequencePropStatus;
10
11
  export declare const findJsxElementPathAtNodePath: (ast: File, nodePath: SequenceNodePath) => import("ast-types/lib/node-path").NodePath<N, V> | null;
11
12
  export declare const findJsxElementAtNodePath: (ast: File, nodePath: SequenceNodePath) => JSXOpeningElement | null;
12
13
  export declare const findJsxElementNodeAtNodePath: (ast: File, nodePath: SequenceNodePath) => JSXElement | null;
@@ -22,28 +23,34 @@ export declare const hasJsxChildrenAttribute: (jsxElement: JSXOpeningElement) =>
22
23
  export declare const getStaticJsxTextContent: (jsxElement: JSXElement) => StaticJsxTextContent | null;
23
24
  export declare const findNodePathForJsxElement: (ast: File, target: JSXOpeningElement) => SequenceNodePath | null;
24
25
  export declare const lineColumnToNodePath: (ast: File, targetLine: number) => SequenceNodePath | null;
25
- export declare const computeSequencePropsStatusFromContent: ({ fileContents, nodePath, componentIdentity, keys, effects, }: {
26
+ export declare const computeSequencePropsStatusFromContent: ({ fileContents, nodePath, componentIdentity, keys, assetKeys, effects, videoConfigValues, }: {
26
27
  fileContents: string;
27
28
  nodePath: SequenceNodePath;
28
29
  componentIdentity: string | null;
29
30
  keys: string[];
31
+ assetKeys?: string[] | undefined;
30
32
  effects: string[][];
33
+ videoConfigValues: VideoConfigValues | null;
31
34
  }) => CanUpdateSequencePropsResponseTrue;
32
- export declare const computeSequencePropsStatus: ({ fileName, nodePath, componentIdentity, keys, effects, remotionRoot, }: {
35
+ export declare const computeSequencePropsStatus: ({ fileName, nodePath, componentIdentity, keys, assetKeys, effects, remotionRoot, videoConfigValues, }: {
33
36
  fileName: string;
34
37
  nodePath: SequenceNodePath;
35
38
  componentIdentity: string | null;
36
39
  keys: string[];
40
+ assetKeys?: string[] | undefined;
37
41
  effects: string[][];
38
42
  remotionRoot: string;
43
+ videoConfigValues: VideoConfigValues | null;
39
44
  }) => CanUpdateSequencePropsResponseTrue;
40
- export declare const computeSequencePropsStatusFromFilenameByLine: ({ fileName, line, componentIdentity, keys, effects, remotionRoot, logLevel, }: {
45
+ export declare const computeSequencePropsStatusFromFilenameByLine: ({ fileName, line, componentIdentity, keys, assetKeys, effects, remotionRoot, logLevel, videoConfigValues, }: {
41
46
  fileName: string;
42
47
  line: number;
43
48
  componentIdentity: string | null;
44
49
  keys: string[];
50
+ assetKeys?: string[] | undefined;
45
51
  effects: string[][];
46
52
  remotionRoot: string;
47
53
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
54
+ videoConfigValues: VideoConfigValues;
48
55
  }) => SubscribeToSequencePropsResponse;
49
56
  export {};
@@ -44,12 +44,17 @@ const get_ast_node_path_1 = require("../../helpers/get-ast-node-path");
44
44
  const import_agnostic_node_path_1 = require("../../helpers/import-agnostic-node-path");
45
45
  const parse_keyframe_easing_expression_1 = require("../../helpers/parse-keyframe-easing-expression");
46
46
  const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
47
+ const video_config_numeric_expression_1 = require("../../helpers/video-config-numeric-expression");
48
+ const video_config_values_1 = require("../../helpers/video-config-values");
47
49
  const jsx_component_identity_1 = require("../jsx-component-identity");
48
50
  const jsx_element_not_found_at_location_error_1 = require("../jsx-element-not-found-at-location-error");
49
51
  const can_update_effect_props_1 = require("./can-update-effect-props");
50
- const staticStatus = (codeValue) => ({
52
+ const staticStatus = (codeValue, numericExpression) => ({
51
53
  status: 'static',
52
54
  codeValue,
55
+ ...(numericExpression === null || numericExpression.type === 'literal'
56
+ ? {}
57
+ : { numericExpression }),
53
58
  });
54
59
  const computedStatus = () => ({
55
60
  status: 'computed',
@@ -341,9 +346,9 @@ const getInterpolationMetadata = (interpolationFunction, callExpression, keyfram
341
346
  output,
342
347
  };
343
348
  };
344
- const getInterpolationKeyframes = (node, ast) => {
349
+ const getInterpolationKeyframes = (node, ast, videoConfigValues) => {
345
350
  if (node.type === 'TSAsExpression') {
346
- return getInterpolationKeyframes(node.expression, ast);
351
+ return getInterpolationKeyframes(node.expression, ast, videoConfigValues);
347
352
  }
348
353
  if (node.type === 'CallExpression' &&
349
354
  node.callee.type === 'Identifier' &&
@@ -352,7 +357,7 @@ const getInterpolationKeyframes = (node, ast) => {
352
357
  node.arguments[0].type !== 'ArgumentPlaceholder' &&
353
358
  node.arguments[0].type !== 'JSXNamespacedName' &&
354
359
  node.arguments[0].type !== 'SpreadElement') {
355
- const interpolation = getInterpolationKeyframes(node.arguments[0], ast);
360
+ const interpolation = getInterpolationKeyframes(node.arguments[0], ast, videoConfigValues);
356
361
  if (!interpolation) {
357
362
  return undefined;
358
363
  }
@@ -398,13 +403,17 @@ const getInterpolationKeyframes = (node, ast) => {
398
403
  outputElement.type === 'SpreadElement') {
399
404
  return undefined;
400
405
  }
401
- const frame = getNumericValue(inputElement);
402
- if (frame === null || !(0, exports.isStaticValue)(outputElement)) {
406
+ const frameExpression = (0, video_config_numeric_expression_1.parseVideoConfigNumericExpression)({
407
+ node: inputElement,
408
+ videoConfigValues,
409
+ });
410
+ if (frameExpression === null || !(0, exports.isStaticValue)(outputElement)) {
403
411
  return undefined;
404
412
  }
405
413
  keyframes.push({
406
- frame,
414
+ frame: frameExpression.value,
407
415
  value: (0, exports.extractStaticValue)(outputElement),
416
+ ...(frameExpression.type === 'literal' ? {} : { frameExpression }),
408
417
  });
409
418
  }
410
419
  if (keyframes.length === 0) {
@@ -455,8 +464,8 @@ const isCurrentFrameIdentifier = (node, ast) => {
455
464
  });
456
465
  return hasUseCurrentFrameDeclaration && !hasOtherDeclaration;
457
466
  };
458
- const getComputedStatus = (node, ast) => {
459
- const interpolation = getInterpolationKeyframes(node, ast);
467
+ const getComputedStatus = (node, ast, videoConfigValues) => {
468
+ const interpolation = getInterpolationKeyframes(node, ast, videoConfigValues);
460
469
  if (!interpolation) {
461
470
  return computedStatus();
462
471
  }
@@ -471,7 +480,7 @@ const getComputedStatus = (node, ast) => {
471
480
  };
472
481
  };
473
482
  exports.getComputedStatus = getComputedStatus;
474
- const getPropsStatus = (jsxElement, ast) => {
483
+ const getPropsStatus = (jsxElement, ast, videoConfigValues, assetKeys) => {
475
484
  const props = {};
476
485
  for (const attr of jsxElement.attributes) {
477
486
  if (attr.type === 'JSXSpreadAttribute') {
@@ -486,24 +495,33 @@ const getPropsStatus = (jsxElement, ast) => {
486
495
  }
487
496
  const { value } = attr;
488
497
  if (!value) {
489
- props[name] = staticStatus(true);
498
+ props[name] = staticStatus(true, null);
490
499
  continue;
491
500
  }
492
501
  if (value.type === 'StringLiteral') {
493
- props[name] = staticStatus(value.value);
502
+ props[name] = staticStatus(value.value, null);
494
503
  continue;
495
504
  }
496
505
  if (value.type === 'JSXExpressionContainer') {
497
506
  const { expression } = value;
507
+ const staticValueOptions = {
508
+ allowSpecialValues: assetKeys.includes(name),
509
+ };
498
510
  if (expression.type === 'JSXEmptyExpression') {
499
511
  props[name] = computedStatus();
500
512
  continue;
501
513
  }
502
- if (!(0, exports.isStaticValue)(expression)) {
503
- props[name] = (0, exports.getComputedStatus)(expression, ast);
514
+ if (!(0, exports.isStaticValue)(expression, staticValueOptions)) {
515
+ const numericExpression = (0, video_config_numeric_expression_1.parseVideoConfigNumericExpression)({
516
+ node: expression,
517
+ videoConfigValues,
518
+ });
519
+ props[name] = numericExpression
520
+ ? staticStatus(numericExpression.value, numericExpression)
521
+ : (0, exports.getComputedStatus)(expression, ast, videoConfigValues);
504
522
  continue;
505
523
  }
506
- props[name] = staticStatus((0, exports.extractStaticValue)(expression));
524
+ props[name] = staticStatus((0, exports.extractStaticValue)(expression, staticValueOptions), null);
507
525
  continue;
508
526
  }
509
527
  props[name] = computedStatus();
@@ -651,13 +669,13 @@ const validateStyleValue = (childKey, value) => {
651
669
  }
652
670
  return true;
653
671
  };
654
- const getNestedPropStatus = (jsxElement, ast, parentKey, childKey) => {
672
+ const getNestedPropStatus = ({ jsxElement, ast, parentKey, childKey, videoConfigValues, allowSpecialValues, }) => {
655
673
  const attr = jsxElement.attributes.find((a) => a.type !== 'JSXSpreadAttribute' &&
656
674
  a.name.type !== 'JSXNamespacedName' &&
657
675
  a.name.name === parentKey);
658
676
  if (!attr || !attr.value) {
659
677
  // Parent attribute doesn't exist, nested prop can be added
660
- return staticStatus(undefined);
678
+ return staticStatus(undefined, null);
661
679
  }
662
680
  if (attr.value.type !== 'JSXExpressionContainer') {
663
681
  return computedStatus();
@@ -674,34 +692,42 @@ const getNestedPropStatus = (jsxElement, ast, parentKey, childKey) => {
674
692
  (p.key.type === 'StringLiteral' && p.key.value === childKey)));
675
693
  if (!prop) {
676
694
  // Property not set in the object, can be added
677
- return staticStatus(undefined);
695
+ return staticStatus(undefined, null);
678
696
  }
679
697
  const propValue = prop.value;
680
- if (!(0, exports.isStaticValue)(propValue)) {
681
- return (0, exports.getComputedStatus)(propValue, ast);
698
+ const staticValueOptions = { allowSpecialValues };
699
+ if (!(0, exports.isStaticValue)(propValue, staticValueOptions)) {
700
+ const numericExpression = (0, video_config_numeric_expression_1.parseVideoConfigNumericExpression)({
701
+ node: propValue,
702
+ videoConfigValues,
703
+ });
704
+ return numericExpression
705
+ ? staticStatus(numericExpression.value, numericExpression)
706
+ : (0, exports.getComputedStatus)(propValue, ast, videoConfigValues);
682
707
  }
683
- const propStatus = (0, exports.extractStaticValue)(propValue);
708
+ const propStatus = (0, exports.extractStaticValue)(propValue, staticValueOptions);
684
709
  if (!validateStyleValue(childKey, propStatus)) {
685
710
  return computedStatus();
686
711
  }
687
- return staticStatus(propStatus);
712
+ return staticStatus(propStatus, null);
688
713
  };
689
- const computeEffectsForJsx = ({ ast, jsxElement, effects, }) => {
714
+ const computeEffectsForJsx = ({ ast, jsxElement, effects, videoConfigValues, }) => {
690
715
  return effects.map((effect, effectIndex) => (0, can_update_effect_props_1.computeEffectPropStatus)({
691
716
  ast,
692
717
  jsx: jsxElement,
693
718
  effectIndex,
694
719
  keys: effect,
720
+ videoConfigValues,
695
721
  }));
696
722
  };
697
- const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys, }) => {
698
- const allProps = getPropsStatus(jsxElement, ast);
723
+ const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys, assetKeys, videoConfigValues, }) => {
724
+ const allProps = getPropsStatus(jsxElement, ast, videoConfigValues, assetKeys);
699
725
  const filteredProps = {};
700
726
  for (const key of keys) {
701
727
  if (key === 'children') {
702
728
  const staticChildrenAttribute = (0, exports.getStaticJsxChildrenAttribute)(jsxElement);
703
729
  if (staticChildrenAttribute) {
704
- filteredProps[key] = staticStatus(staticChildrenAttribute.value);
730
+ filteredProps[key] = staticStatus(staticChildrenAttribute.value, null);
705
731
  continue;
706
732
  }
707
733
  if ((0, exports.hasJsxChildrenAttribute)(jsxElement)) {
@@ -710,26 +736,37 @@ const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys,
710
736
  }
711
737
  const staticTextContent = (0, exports.getStaticJsxTextContent)(jsxElementNode);
712
738
  filteredProps[key] = staticTextContent
713
- ? staticStatus(staticTextContent.value)
739
+ ? staticStatus(staticTextContent.value, null)
714
740
  : computedStatus();
715
741
  continue;
716
742
  }
717
743
  const dotIndex = key.indexOf('.');
718
744
  if (dotIndex !== -1) {
719
- filteredProps[key] = getNestedPropStatus(jsxElement, ast, key.slice(0, dotIndex), key.slice(dotIndex + 1));
745
+ filteredProps[key] = getNestedPropStatus({
746
+ jsxElement,
747
+ ast,
748
+ parentKey: key.slice(0, dotIndex),
749
+ childKey: key.slice(dotIndex + 1),
750
+ videoConfigValues,
751
+ allowSpecialValues: assetKeys.includes(key),
752
+ });
720
753
  }
721
754
  else if (key in allProps) {
722
755
  filteredProps[key] = allProps[key];
723
756
  }
724
757
  else {
725
- filteredProps[key] = staticStatus(undefined);
758
+ filteredProps[key] = staticStatus(undefined, null);
726
759
  }
727
760
  }
728
761
  return filteredProps;
729
762
  };
730
- const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, componentIdentity, keys, effects, }) => {
763
+ const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, componentIdentity, keys, assetKeys = [], effects, videoConfigValues, }) => {
731
764
  var _a;
732
765
  const ast = (0, parse_ast_1.parseAst)(fileContents);
766
+ const videoConfigIdentifierValues = (0, video_config_values_1.getVideoConfigIdentifierValues)({
767
+ ast,
768
+ videoConfigValues,
769
+ });
733
770
  const jsxElementNode = (0, exports.findJsxElementNodeAtNodePath)(ast, nodePath);
734
771
  const jsxElement = (_a = jsxElementNode === null || jsxElementNode === void 0 ? void 0 : jsxElementNode.openingElement) !== null && _a !== void 0 ? _a : null;
735
772
  if (!jsxElement || !jsxElementNode) {
@@ -746,8 +783,15 @@ const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, compone
746
783
  jsxElementNode,
747
784
  ast,
748
785
  keys,
786
+ assetKeys,
787
+ videoConfigValues: videoConfigIdentifierValues,
788
+ });
789
+ const effectsStatuses = computeEffectsForJsx({
790
+ ast,
791
+ jsxElement,
792
+ effects,
793
+ videoConfigValues: videoConfigIdentifierValues,
749
794
  });
750
- const effectsStatuses = computeEffectsForJsx({ ast, jsxElement, effects });
751
795
  return {
752
796
  canUpdate: true,
753
797
  props: filteredProps,
@@ -755,7 +799,7 @@ const computeSequencePropsStatusFromContent = ({ fileContents, nodePath, compone
755
799
  };
756
800
  };
757
801
  exports.computeSequencePropsStatusFromContent = computeSequencePropsStatusFromContent;
758
- const computeSequencePropsStatus = ({ fileName, nodePath, componentIdentity, keys, effects, remotionRoot, }) => {
802
+ const computeSequencePropsStatus = ({ fileName, nodePath, componentIdentity, keys, assetKeys = [], effects, remotionRoot, videoConfigValues, }) => {
759
803
  const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
760
804
  remotionRoot,
761
805
  fileName,
@@ -767,11 +811,13 @@ const computeSequencePropsStatus = ({ fileName, nodePath, componentIdentity, key
767
811
  nodePath,
768
812
  componentIdentity,
769
813
  keys,
814
+ assetKeys,
770
815
  effects,
816
+ videoConfigValues,
771
817
  });
772
818
  };
773
819
  exports.computeSequencePropsStatus = computeSequencePropsStatus;
774
- const computeSequencePropsStatusFromFilenameByLine = ({ fileName, line, componentIdentity, keys, effects, remotionRoot, logLevel, }) => {
820
+ const computeSequencePropsStatusFromFilenameByLine = ({ fileName, line, componentIdentity, keys, assetKeys = [], effects, remotionRoot, logLevel, videoConfigValues, }) => {
775
821
  try {
776
822
  const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
777
823
  remotionRoot,
@@ -796,14 +842,17 @@ const computeSequencePropsStatusFromFilenameByLine = ({ fileName, line, componen
796
842
  nodePath: resolvedNodePath,
797
843
  componentIdentity,
798
844
  keys,
845
+ assetKeys,
799
846
  effects,
800
847
  remotionRoot,
848
+ videoConfigValues,
801
849
  }),
802
850
  nodePath: {
803
851
  absolutePath,
804
852
  nodePath: resolvedNodePath,
805
853
  sequenceKeys: keys,
806
854
  effectKeys: effects,
855
+ videoConfigValues,
807
856
  },
808
857
  success: true,
809
858
  };
@@ -8,6 +8,7 @@ const parse_ast_1 = require("../../codemods/parse-ast");
8
8
  const update_keyframes_1 = require("../../codemods/update-keyframes/update-keyframes");
9
9
  const file_watcher_1 = require("../../file-watcher");
10
10
  const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
11
+ const video_config_values_1 = require("../../helpers/video-config-values");
11
12
  const undo_stack_1 = require("../undo-stack");
12
13
  const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
13
14
  const can_update_effect_props_1 = require("./can-update-effect-props");
@@ -95,6 +96,7 @@ const deleteKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, r
95
96
  const result = await (0, update_keyframes_1.updateSequenceKeyframes)({
96
97
  input: output,
97
98
  nodePath: firstSequenceKeyframe.nodePath.nodePath,
99
+ videoConfigValues: firstSequenceKeyframe.nodePath.videoConfigValues,
98
100
  updates: keyframeGroup.map((keyframe) => ({
99
101
  key: keyframe.key,
100
102
  operation: {
@@ -125,6 +127,7 @@ const deleteKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, r
125
127
  input: output,
126
128
  sequenceNodePath: firstEffectKeyframe.sequenceNodePath.nodePath,
127
129
  effectIndex: firstEffectKeyframe.effectIndex,
130
+ videoConfigValues: firstEffectKeyframe.sequenceNodePath.videoConfigValues,
128
131
  updates: keyframeGroup.map((keyframe) => ({
129
132
  key: keyframe.key,
130
133
  operation: {
@@ -217,6 +220,7 @@ const deleteKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, r
217
220
  nodePath: keyframe.nodePath.nodePath,
218
221
  componentIdentity: null,
219
222
  effects: [],
223
+ videoConfigValues: keyframe.nodePath.videoConfigValues,
220
224
  });
221
225
  return {
222
226
  fileName: keyframe.fileName,
@@ -246,6 +250,10 @@ const deleteKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, r
246
250
  jsx,
247
251
  effectIndex: keyframe.effectIndex,
248
252
  keys: (0, studio_shared_1.getAllSchemaKeys)(keyframe.schema),
253
+ videoConfigValues: (0, video_config_values_1.getVideoConfigIdentifierValues)({
254
+ ast,
255
+ videoConfigValues: keyframe.sequenceNodePath.videoConfigValues,
256
+ }),
249
257
  });
250
258
  });
251
259
  return { sequenceResults, effectResults };
@@ -111,6 +111,7 @@ const moveKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, rem
111
111
  input: output,
112
112
  nodePath: firstSequenceKeyframe.nodePath.nodePath,
113
113
  schema: firstSequenceKeyframe.schema,
114
+ videoConfigValues: firstSequenceKeyframe.nodePath.videoConfigValues,
114
115
  updates,
115
116
  });
116
117
  output = result.output;
@@ -152,6 +153,7 @@ const moveKeyframes = async ({ sequenceKeyframes, effectKeyframes, clientId, rem
152
153
  sequenceNodePath: firstEffectKeyframe.sequenceNodePath.nodePath,
153
154
  effectIndex: firstEffectKeyframe.effectIndex,
154
155
  schema: firstEffectKeyframe.schema,
156
+ videoConfigValues: firstEffectKeyframe.sequenceNodePath.videoConfigValues,
155
157
  updates,
156
158
  });
157
159
  output = result.output;
@@ -17,7 +17,7 @@ const getPastedEffectDescription = (effectLabels) => {
17
17
  }
18
18
  return `${effectLabels.length} effects`;
19
19
  };
20
- const pasteEffectsHandler = ({ input: { targetFileName, targetSequenceNodePath, type, effects, clientId }, remotionRoot, logLevel, }) => {
20
+ const pasteEffectsHandler = ({ input: { targetFileName, targetSequenceNodePath, type, effects, clientId, insertAtIndices, }, remotionRoot, logLevel, }) => {
21
21
  return (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
22
22
  try {
23
23
  if (effects.length === 0 && type !== 'effects-replacing') {
@@ -36,6 +36,7 @@ const pasteEffectsHandler = ({ input: { targetFileName, targetSequenceNodePath,
36
36
  targetSequenceNodePath: targetSequenceNodePath.nodePath,
37
37
  type,
38
38
  effects,
39
+ insertAtIndices,
39
40
  });
40
41
  const effectDescription = getPastedEffectDescription(effectLabels);
41
42
  (0, undo_stack_1.pushToUndoStack)({
@@ -8,6 +8,7 @@ const parse_ast_1 = require("../../codemods/parse-ast");
8
8
  const update_effect_props_1 = require("../../codemods/update-effect-props/update-effect-props");
9
9
  const file_watcher_1 = require("../../file-watcher");
10
10
  const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
11
+ const video_config_values_1 = require("../../helpers/video-config-values");
11
12
  const undo_stack_1 = require("../undo-stack");
12
13
  const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
13
14
  const can_update_effect_props_1 = require("./can-update-effect-props");
@@ -122,6 +123,10 @@ const saveEffectPropsHandler = ({ input, remotionRoot, logLevel }) => (0, source
122
123
  jsx,
123
124
  effectIndex,
124
125
  keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
126
+ videoConfigValues: (0, video_config_values_1.getVideoConfigIdentifierValues)({
127
+ ast,
128
+ videoConfigValues: sequenceNodePath.videoConfigValues,
129
+ }),
125
130
  });
126
131
  });
127
132
  exports.saveEffectPropsHandler = saveEffectPropsHandler;
@@ -50,6 +50,7 @@ const convertSequencePropEditToCodemodChange = (edit) => {
50
50
  },
51
51
  ],
52
52
  schema: edit.schema,
53
+ videoConfigValues: edit.nodePath.videoConfigValues,
53
54
  };
54
55
  };
55
56
  exports.convertSequencePropEditToCodemodChange = convertSequencePropEditToCodemodChange;
@@ -182,6 +183,7 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
182
183
  input: output,
183
184
  nodePath: firstSequenceKeyframe.nodePath.nodePath,
184
185
  schema: firstSequenceKeyframe.schema,
186
+ videoConfigValues: firstSequenceKeyframe.nodePath.videoConfigValues,
185
187
  updates,
186
188
  });
187
189
  output = result.output;
@@ -223,6 +225,7 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
223
225
  sequenceNodePath: firstEffectKeyframe.sequenceNodePath.nodePath,
224
226
  effectIndex: firstEffectKeyframe.effectIndex,
225
227
  schema: firstEffectKeyframe.schema,
228
+ videoConfigValues: firstEffectKeyframe.sequenceNodePath.videoConfigValues,
226
229
  updates,
227
230
  });
228
231
  output = result.output;
@@ -328,9 +331,11 @@ const saveSequencePropsHandler = ({ input: { edits, movedKeyframes = { sequenceK
328
331
  const newStatus = (0, can_update_sequence_props_1.computeSequencePropsStatusFromContent)({
329
332
  fileContents: output,
330
333
  keys: (0, studio_shared_1.getAllSchemaKeys)(edit.schema),
334
+ assetKeys: (0, studio_shared_1.getAssetSchemaKeys)(edit.schema),
331
335
  nodePath: edit.nodePath.nodePath,
332
336
  componentIdentity: null,
333
337
  effects: [],
338
+ videoConfigValues: edit.nodePath.videoConfigValues,
334
339
  });
335
340
  return {
336
341
  fileName: edit.fileName,
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.subscribeToSequenceProps = void 0;
4
4
  const sequence_props_watchers_1 = require("../sequence-props-watchers");
5
- const subscribeToSequenceProps = ({ input: { fileName, line, column, nodePath, componentIdentity, keys, effects, clientId, }, remotionRoot, logLevel, }) => {
5
+ const subscribeToSequenceProps = ({ input: { fileName, line, column, nodePath, componentIdentity, keys, assetKeys = [], effects, clientId, videoConfigValues, }, remotionRoot, logLevel, }) => {
6
6
  const result = (0, sequence_props_watchers_1.subscribeToSequencePropsWatchers)({
7
7
  fileName,
8
8
  line,
@@ -10,9 +10,11 @@ const subscribeToSequenceProps = ({ input: { fileName, line, column, nodePath, c
10
10
  nodePath,
11
11
  componentIdentity,
12
12
  keys,
13
+ assetKeys,
13
14
  effects,
14
15
  remotionRoot,
15
16
  clientId,
17
+ videoConfigValues,
16
18
  logLevel,
17
19
  });
18
20
  return Promise.resolve(result);
@@ -2,14 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.unsubscribeFromSequenceProps = void 0;
4
4
  const sequence_props_watchers_1 = require("../sequence-props-watchers");
5
- const unsubscribeFromSequenceProps = ({ input: { fileName, nodePath, clientId, sequenceKeys, effectKeys }, remotionRoot, }) => {
5
+ const unsubscribeFromSequenceProps = ({ input: { fileName, nodePath, clientId, sequenceKeys, assetKeys = [], effectKeys, }, remotionRoot, }) => {
6
6
  (0, sequence_props_watchers_1.unsubscribeFromSequencePropsWatchers)({
7
7
  fileName,
8
8
  nodePath: nodePath.nodePath,
9
9
  remotionRoot,
10
10
  clientId,
11
11
  sequenceKeys,
12
+ assetKeys,
12
13
  effectKeys,
14
+ videoConfigValues: nodePath.videoConfigValues,
13
15
  });
14
16
  return Promise.resolve(undefined);
15
17
  };
@@ -8,6 +8,7 @@ const parse_ast_1 = require("../../codemods/parse-ast");
8
8
  const update_keyframes_1 = require("../../codemods/update-keyframes/update-keyframes");
9
9
  const file_watcher_1 = require("../../file-watcher");
10
10
  const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
11
+ const video_config_values_1 = require("../../helpers/video-config-values");
11
12
  const undo_stack_1 = require("../undo-stack");
12
13
  const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
13
14
  const can_update_effect_props_1 = require("./can-update-effect-props");
@@ -27,6 +28,7 @@ const updateEffectKeyframeSettingsHandler = ({ input: { fileName, sequenceNodePa
27
28
  sequenceNodePath: sequenceNodePath.nodePath,
28
29
  effectIndex,
29
30
  schema,
31
+ videoConfigValues: sequenceNodePath.videoConfigValues,
30
32
  updates: [
31
33
  {
32
34
  key,
@@ -92,6 +94,10 @@ const updateEffectKeyframeSettingsHandler = ({ input: { fileName, sequenceNodePa
92
94
  jsx,
93
95
  effectIndex,
94
96
  keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
97
+ videoConfigValues: (0, video_config_values_1.getVideoConfigIdentifierValues)({
98
+ ast,
99
+ videoConfigValues: sequenceNodePath.videoConfigValues,
100
+ }),
95
101
  });
96
102
  });
97
103
  exports.updateEffectKeyframeSettingsHandler = updateEffectKeyframeSettingsHandler;
@@ -5,7 +5,7 @@ const element_install_state_1 = require("../element-install-state");
5
5
  const isFiniteTimestamp = (value) => {
6
6
  return value === null || (Number.isFinite(value) && value > 0);
7
7
  };
8
- const updateElementInstallTargetHandler = ({ input }) => {
8
+ const updateElementInstallTargetHandler = ({ input, request }) => {
9
9
  if (typeof input.clientId !== 'string' || input.clientId.length === 0) {
10
10
  throw new Error('Invalid client ID');
11
11
  }
@@ -22,6 +22,20 @@ const updateElementInstallTargetHandler = ({ input }) => {
22
22
  if (input.compositionId !== null && typeof input.compositionId !== 'string') {
23
23
  throw new Error('Invalid composition ID');
24
24
  }
25
+ if (typeof input.studioUrl !== 'string') {
26
+ throw new Error('Invalid Studio URL');
27
+ }
28
+ let studioUrl;
29
+ try {
30
+ studioUrl = new URL(input.studioUrl);
31
+ }
32
+ catch (_a) {
33
+ throw new Error('Invalid Studio URL');
34
+ }
35
+ if (typeof request.headers.origin !== 'string' ||
36
+ studioUrl.origin !== request.headers.origin) {
37
+ throw new Error('Studio URL must match the request origin');
38
+ }
25
39
  (0, element_install_state_1.updateElementInstallTarget)(input);
26
40
  return Promise.resolve({});
27
41
  };
@@ -24,6 +24,7 @@ const updateSequenceKeyframeSettingsHandler = ({ input: { fileName, nodePath, ke
24
24
  input: fileContents,
25
25
  nodePath: nodePath.nodePath,
26
26
  schema,
27
+ videoConfigValues: nodePath.videoConfigValues,
27
28
  updates: [
28
29
  {
29
30
  key,
@@ -80,6 +81,7 @@ const updateSequenceKeyframeSettingsHandler = ({ input: { fileName, nodePath, ke
80
81
  nodePath: updatedNodePath,
81
82
  componentIdentity: null,
82
83
  effects: [],
84
+ videoConfigValues: nodePath.videoConfigValues,
83
85
  });
84
86
  const updatedSubscriptionKey = { ...nodePath, nodePath: updatedNodePath };
85
87
  return {
@@ -1,23 +1,27 @@
1
1
  import { type SubscribeToSequencePropsResponse } from '@remotion/studio-shared';
2
- import type { SequenceNodePath } from 'remotion';
3
- export declare const subscribeToSequencePropsWatchers: ({ fileName, line, column, nodePath: preferredNodePath, componentIdentity, keys, effects, remotionRoot, clientId, logLevel, }: {
2
+ import type { SequenceNodePath, VideoConfigValues } from 'remotion';
3
+ export declare const subscribeToSequencePropsWatchers: ({ fileName, line, column, nodePath: preferredNodePath, componentIdentity, keys, assetKeys, effects, remotionRoot, clientId, logLevel, videoConfigValues, }: {
4
4
  fileName: string;
5
5
  line: number;
6
6
  column: number;
7
7
  nodePath: SequenceNodePath | null;
8
8
  componentIdentity: string | null;
9
9
  keys: string[];
10
+ assetKeys: string[];
10
11
  effects: string[][];
11
12
  remotionRoot: string;
12
13
  clientId: string;
13
14
  logLevel: "error" | "info" | "trace" | "verbose" | "warn";
15
+ videoConfigValues: VideoConfigValues;
14
16
  }) => SubscribeToSequencePropsResponse;
15
- export declare const unsubscribeFromSequencePropsWatchers: ({ fileName, nodePath, remotionRoot, clientId, sequenceKeys, effectKeys, }: {
17
+ export declare const unsubscribeFromSequencePropsWatchers: ({ fileName, nodePath, remotionRoot, clientId, sequenceKeys, assetKeys, effectKeys, videoConfigValues, }: {
16
18
  fileName: string;
17
19
  nodePath: SequenceNodePath;
18
20
  remotionRoot: string;
19
21
  clientId: string;
20
22
  sequenceKeys: string[];
23
+ assetKeys: string[];
21
24
  effectKeys: string[][];
25
+ videoConfigValues: VideoConfigValues | null;
22
26
  }) => void;
23
27
  export declare const unsubscribeClientSequencePropsWatchers: (clientId: string) => void;