@remotion/studio 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 (120) hide show
  1. package/dist/components/AssetSelectorItem.js +7 -4
  2. package/dist/components/Canvas.js +2 -0
  3. package/dist/components/CompositionOrStillIcon.d.ts +7 -0
  4. package/dist/components/CompositionOrStillIcon.js +11 -0
  5. package/dist/components/CompositionSelector.js +13 -1
  6. package/dist/components/CompositionSelectorItem.js +33 -5
  7. package/dist/components/CurrentAsset.d.ts +6 -0
  8. package/dist/components/CurrentAsset.js +14 -8
  9. package/dist/components/CurrentComposition.js +4 -1
  10. package/dist/components/EditorContent.js +1 -1
  11. package/dist/components/GlobalKeybindings.d.ts +1 -3
  12. package/dist/components/GlobalKeybindings.js +2 -9
  13. package/dist/components/InlineEditableTitle.d.ts +1 -0
  14. package/dist/components/InlineEditableTitle.js +12 -7
  15. package/dist/components/InspectorInfoHeader.d.ts +1 -0
  16. package/dist/components/InspectorInfoHeader.js +7 -4
  17. package/dist/components/InspectorLocationCopy.d.ts +7 -0
  18. package/dist/components/InspectorLocationCopy.js +65 -0
  19. package/dist/components/InspectorPanel/SequenceCompositionsSection.d.ts +5 -0
  20. package/dist/components/InspectorPanel/SequenceCompositionsSection.js +37 -0
  21. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +6 -4
  22. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -1
  23. package/dist/components/InspectorPanel/common.js +1 -1
  24. package/dist/components/InspectorPanel/get-compositions-matching-single-child.d.ts +6 -0
  25. package/dist/components/InspectorPanel/get-compositions-matching-single-child.js +11 -0
  26. package/dist/components/InspectorSequenceSection.js +57 -3
  27. package/dist/components/KeyboardShortcutsExplainer.js +4 -0
  28. package/dist/components/NewComposition/NewComposition.js +11 -4
  29. package/dist/components/NewComposition/get-new-composition-defaults.d.ts +4 -0
  30. package/dist/components/NewComposition/get-new-composition-defaults.js +13 -0
  31. package/dist/components/OptionsPanel.js +4 -8
  32. package/dist/components/OutlineToggle.d.ts +3 -1
  33. package/dist/components/OutlineToggle.js +2 -2
  34. package/dist/components/PreviewToolbar.js +1 -1
  35. package/dist/components/RenderButton.js +9 -33
  36. package/dist/components/RenderModal/WebRenderModal.js +3 -8
  37. package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +0 -2
  38. package/dist/components/RenderModal/WebRenderModalAdvanced.js +2 -9
  39. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +0 -2
  40. package/dist/components/RenderQueue/client-side-render-types.d.ts +0 -1
  41. package/dist/components/RenderQueue/index.js +0 -9
  42. package/dist/components/SelectedOutlineElement.js +40 -38
  43. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  44. package/dist/components/SelectedOutlineOverlay.js +2 -13
  45. package/dist/components/SnappingToggle.d.ts +3 -1
  46. package/dist/components/SnappingToggle.js +2 -2
  47. package/dist/components/Timeline/TimelineAssetField.d.ts +14 -0
  48. package/dist/components/Timeline/TimelineAssetField.js +125 -0
  49. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +20 -1
  50. package/dist/components/Timeline/TimelineClipboardKeybindings.js +301 -155
  51. package/dist/components/Timeline/TimelineEffectPropItem.js +7 -11
  52. package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
  53. package/dist/components/Timeline/TimelineFieldLabel.d.ts +1 -0
  54. package/dist/components/Timeline/TimelineFieldLabel.js +7 -3
  55. package/dist/components/Timeline/TimelineFieldRowContent.d.ts +8 -0
  56. package/dist/components/Timeline/TimelineFieldRowContent.js +16 -0
  57. package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
  58. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +5 -1
  59. package/dist/components/Timeline/TimelineRowChrome.js +8 -4
  60. package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +7 -0
  61. package/dist/components/Timeline/TimelineRowLayoutContext.js +13 -0
  62. package/dist/components/Timeline/TimelineSelection.js +1 -0
  63. package/dist/components/Timeline/TimelineSequence.js +2 -4
  64. package/dist/components/Timeline/TimelineSequenceItem.js +1 -0
  65. package/dist/components/Timeline/TimelineSequencePropItem.js +8 -10
  66. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -0
  67. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +18 -6
  68. package/dist/components/Timeline/TimelineTextContentField.js +12 -5
  69. package/dist/components/Timeline/TimelineVideoInfo.d.ts +3 -1
  70. package/dist/components/Timeline/TimelineVideoInfo.js +11 -4
  71. package/dist/components/Timeline/delete-selected-timeline-item.js +4 -5
  72. package/dist/components/Timeline/effects-clipboard.d.ts +14 -0
  73. package/dist/components/Timeline/effects-clipboard.js +68 -0
  74. package/dist/components/Timeline/get-sequence-context-menu-items.js +40 -3
  75. package/dist/components/Timeline/get-timeline-media-start-frame.d.ts +6 -0
  76. package/dist/components/Timeline/get-timeline-media-start-frame.js +15 -0
  77. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -2
  78. package/dist/components/Timeline/sequence-props-subscription-store.js +8 -2
  79. package/dist/components/Timeline/timeline-asset-link.d.ts +6 -0
  80. package/dist/components/Timeline/timeline-asset-link.js +27 -1
  81. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  82. package/dist/components/Timeline/timeline-field-row-layout.d.ts +2 -1
  83. package/dist/components/Timeline/timeline-field-row-layout.js +10 -3
  84. package/dist/components/Timeline/timeline-row-layout.d.ts +4 -3
  85. package/dist/components/Timeline/timeline-row-layout.js +7 -6
  86. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
  87. package/dist/components/Timeline/use-sequence-props-subscription.js +10 -1
  88. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
  89. package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
  90. package/dist/components/Timeline/use-timeline-height.js +1 -0
  91. package/dist/components/import-assets.d.ts +14 -2
  92. package/dist/components/import-assets.js +28 -7
  93. package/dist/components/root-composition-menu-items.d.ts +8 -0
  94. package/dist/components/root-composition-menu-items.js +45 -0
  95. package/dist/components/selected-outline-measurement.d.ts +4 -0
  96. package/dist/components/selected-outline-measurement.js +3 -1
  97. package/dist/components/selected-outline-types.d.ts +1 -6
  98. package/dist/esm/{chunk-16nwrbrm.js → chunk-ewx0568t.js} +7962 -7216
  99. package/dist/esm/index.mjs +0 -1
  100. package/dist/esm/internals.mjs +7962 -7216
  101. package/dist/esm/previewEntry.mjs +7332 -6586
  102. package/dist/esm/renderEntry.mjs +1 -1
  103. package/dist/helpers/format-file-location.d.ts +5 -0
  104. package/dist/helpers/format-file-location.js +9 -1
  105. package/dist/helpers/get-file-manager-name.d.ts +1 -0
  106. package/dist/helpers/get-file-manager-name.js +13 -0
  107. package/dist/helpers/retry-payload.js +0 -1
  108. package/dist/helpers/studio-runtime-config.d.ts +0 -1
  109. package/dist/helpers/studio-runtime-config.js +1 -6
  110. package/dist/helpers/timeline-layout.d.ts +2 -1
  111. package/dist/helpers/timeline-layout.js +5 -1
  112. package/dist/helpers/url-state.d.ts +1 -0
  113. package/dist/helpers/url-state.js +8 -6
  114. package/dist/helpers/use-menu-structure.js +19 -20
  115. package/dist/state/modals.d.ts +0 -1
  116. package/package.json +11 -11
  117. package/dist/components/RenderModal/WebRendererExperimentalBadge.d.ts +0 -1
  118. package/dist/components/RenderModal/WebRendererExperimentalBadge.js +0 -35
  119. package/dist/helpers/show-browser-rendering.d.ts +0 -1
  120. package/dist/helpers/show-browser-rendering.js +0 -5
@@ -4,10 +4,11 @@ exports.acquireSequencePropsSubscription = void 0;
4
4
  const studio_shared_1 = require("@remotion/studio-shared");
5
5
  const remotion_1 = require("remotion");
6
6
  const call_api_1 = require("../call-api");
7
- const makeKey = ({ fileName, line, column, componentIdentity, sequenceKeys, effectKeys, }) => `${fileName}\0${line}\0${column}\0${componentIdentity !== null && componentIdentity !== void 0 ? componentIdentity : ''}\0${sequenceKeys.join('\0')}\0${effectKeys.map((keys) => keys.join('\0')).join('\0\0')}`;
7
+ const makeKey = ({ fileName, line, column, componentIdentity, sequenceKeys, assetKeys, effectKeys, videoConfigValues, }) => `${fileName}\0${line}\0${column}\0${componentIdentity !== null && componentIdentity !== void 0 ? componentIdentity : ''}\0${sequenceKeys.join('\0')}\0${assetKeys.join('\0')}\0${effectKeys.map((keys) => keys.join('\0')).join('\0\0')}\0${JSON.stringify(videoConfigValues)}`;
8
8
  const entries = new Map();
9
- const acquireSequencePropsSubscription = ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, }) => {
9
+ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, videoConfigValues, }) => {
10
10
  const sequenceKeys = (0, studio_shared_1.getAllSchemaKeys)(schema);
11
+ const assetKeys = (0, studio_shared_1.getAssetSchemaKeys)(schema);
11
12
  const effectKeys = effects.map((effect) => (0, studio_shared_1.getAllSchemaKeys)(effect));
12
13
  const key = makeKey({
13
14
  fileName,
@@ -15,7 +16,9 @@ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, comp
15
16
  column,
16
17
  componentIdentity,
17
18
  sequenceKeys,
19
+ assetKeys,
18
20
  effectKeys,
21
+ videoConfigValues,
19
22
  });
20
23
  let entry = entries.get(key);
21
24
  if (!entry) {
@@ -26,8 +29,10 @@ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, comp
26
29
  nodePath,
27
30
  componentIdentity,
28
31
  keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
32
+ assetKeys,
29
33
  effects: effectKeys,
30
34
  clientId,
35
+ videoConfigValues,
31
36
  });
32
37
  const created = {
33
38
  refCount: 0,
@@ -86,6 +91,7 @@ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, comp
86
91
  nodePath: result.nodePath,
87
92
  clientId: acquired.clientId,
88
93
  sequenceKeys,
94
+ assetKeys,
89
95
  effectKeys,
90
96
  });
91
97
  })
@@ -1,3 +1,4 @@
1
+ import type { SequenceControls } from 'remotion';
1
2
  type LinkInfo = {
2
3
  kind: 'local';
3
4
  assetPath: string;
@@ -8,6 +9,11 @@ type LinkInfo = {
8
9
  title: string;
9
10
  } | null;
10
11
  export type TimelineAssetLinkInfo = Exclude<LinkInfo, null>;
12
+ export declare const splitRemoteSourceForMiddleEllipsis: (src: string) => {
13
+ leading: string;
14
+ trailing: string;
15
+ };
16
+ export declare const getTimelineAssetSrcFromSchema: (controls: SequenceControls | null) => string | null;
11
17
  export declare const getTimelineAssetLinkInfo: (src: string) => LinkInfo;
12
18
  export declare const openTimelineAssetLink: (linkInfo: TimelineAssetLinkInfo, selectAsset: (asset: string) => void) => void;
13
19
  export {};
@@ -1,7 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.openTimelineAssetLink = exports.getTimelineAssetLinkInfo = void 0;
3
+ exports.openTimelineAssetLink = exports.getTimelineAssetLinkInfo = exports.getTimelineAssetSrcFromSchema = exports.splitRemoteSourceForMiddleEllipsis = void 0;
4
+ const studio_shared_1 = require("@remotion/studio-shared");
4
5
  const url_state_1 = require("../../helpers/url-state");
6
+ const splitRemoteSourceForMiddleEllipsis = (src) => {
7
+ const protocolEnd = src.indexOf('://');
8
+ const minimumSlashIndex = protocolEnd === -1 ? 0 : protocolEnd + 3;
9
+ const lastSlash = src.lastIndexOf('/');
10
+ if (lastSlash >= minimumSlashIndex && lastSlash < src.length - 1) {
11
+ return {
12
+ leading: src.slice(0, lastSlash + 1),
13
+ trailing: src.slice(lastSlash + 1),
14
+ };
15
+ }
16
+ const middle = Math.ceil(src.length / 2);
17
+ return {
18
+ leading: src.slice(0, middle),
19
+ trailing: src.slice(middle),
20
+ };
21
+ };
22
+ exports.splitRemoteSourceForMiddleEllipsis = splitRemoteSourceForMiddleEllipsis;
23
+ const getTimelineAssetSrcFromSchema = (controls) => {
24
+ if (!controls || !(0, studio_shared_1.getAssetSchemaKeys)(controls.schema).includes('src')) {
25
+ return null;
26
+ }
27
+ const { src } = controls.currentRuntimeValueDotNotation;
28
+ return typeof src === 'string' ? src : null;
29
+ };
30
+ exports.getTimelineAssetSrcFromSchema = getTimelineAssetSrcFromSchema;
5
31
  const getTimelineAssetLinkInfo = (src) => {
6
32
  const staticBase = typeof window === 'undefined' ? null : window.remotion_staticBase;
7
33
  if (staticBase && src.startsWith(staticBase + '/')) {
@@ -236,6 +236,7 @@ const formatTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
236
236
  return ((_e = formatUvCoordinateTimelineFieldValueForDisplay({ fieldSchema, value })) !== null && _e !== void 0 ? _e : formatUnknownTimelineValueForDisplay(value));
237
237
  case 'text-content':
238
238
  return String(value);
239
+ case 'asset':
239
240
  case 'array':
240
241
  case 'boolean':
241
242
  case 'color':
@@ -1,3 +1,4 @@
1
1
  import type React from 'react';
2
- export declare const getTimelineFieldLabelRowStyle: (depth: number) => React.CSSProperties;
2
+ export declare const getTimelineFieldLabelRowStyle: (depth: number, basePadding?: number | undefined) => React.CSSProperties;
3
3
  export declare const timelineFieldValueColumnStyle: React.CSSProperties;
4
+ export declare const timelineStackedFieldContentStyle: React.CSSProperties;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.timelineFieldValueColumnStyle = exports.getTimelineFieldLabelRowStyle = void 0;
3
+ exports.timelineStackedFieldContentStyle = exports.timelineFieldValueColumnStyle = exports.getTimelineFieldLabelRowStyle = void 0;
4
4
  const timeline_layout_1 = require("../../helpers/timeline-layout");
5
5
  const timeline_row_layout_1 = require("./timeline-row-layout");
6
- const getTimelineFieldLabelRowStyle = (depth) => {
6
+ const getTimelineFieldLabelRowStyle = (depth, basePadding) => {
7
7
  return {
8
- flex: `0 0 ${(0, timeline_row_layout_1.getTimelineFieldLabelFlexBasis)(depth)}`,
8
+ flex: `0 0 ${(0, timeline_row_layout_1.getTimelineFieldLabelFlexBasis)(depth, basePadding)}`,
9
9
  minWidth: 0,
10
10
  display: 'flex',
11
11
  flexDirection: 'row',
@@ -22,3 +22,10 @@ exports.timelineFieldValueColumnStyle = {
22
22
  minWidth: 0,
23
23
  paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
24
24
  };
25
+ exports.timelineStackedFieldContentStyle = {
26
+ alignSelf: 'stretch',
27
+ display: 'flex',
28
+ flex: 1,
29
+ flexDirection: 'column',
30
+ minWidth: 0,
31
+ };
@@ -1,11 +1,12 @@
1
- export declare const TIMELINE_ROW_BASE_PADDING = 5;
1
+ export declare const TIMELINE_ROW_BASE_PADDING = 10;
2
+ export declare const INSPECTOR_ROW_BASE_PADDING = 5;
2
3
  export declare const TIMELINE_EYE_COLUMN_WIDTH = 22;
3
4
  export declare const TIMELINE_ARROW_COLUMN_WIDTH = 16;
4
5
  export declare const TIMELINE_KEYFRAME_CONTROLS_WIDTH = 38;
5
6
  export declare const TIMELINE_FIELD_LABEL_EXTRA_WIDTH = 15;
6
7
  export declare const getTimelineRowIndentWidth: (depth: number) => number;
7
- export declare const getTimelineRowLeftChromeWidth: (depth: number) => number;
8
- export declare const getTimelineFieldLabelFlexBasis: (depth: number) => string;
8
+ export declare const getTimelineRowLeftChromeWidth: (depth: number, basePadding?: number) => number;
9
+ export declare const getTimelineFieldLabelFlexBasis: (depth: number, basePadding?: number) => string;
9
10
  export declare const getExpandedRowDepth: ({ nestedDepth, treeDepth, }: {
10
11
  nestedDepth: number;
11
12
  treeDepth: number;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getExpandedRowDepth = exports.getTimelineFieldLabelFlexBasis = exports.getTimelineRowLeftChromeWidth = exports.getTimelineRowIndentWidth = exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH = exports.TIMELINE_KEYFRAME_CONTROLS_WIDTH = exports.TIMELINE_ARROW_COLUMN_WIDTH = exports.TIMELINE_EYE_COLUMN_WIDTH = exports.TIMELINE_ROW_BASE_PADDING = void 0;
3
+ exports.getExpandedRowDepth = exports.getTimelineFieldLabelFlexBasis = exports.getTimelineRowLeftChromeWidth = exports.getTimelineRowIndentWidth = exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH = exports.TIMELINE_KEYFRAME_CONTROLS_WIDTH = exports.TIMELINE_ARROW_COLUMN_WIDTH = exports.TIMELINE_EYE_COLUMN_WIDTH = exports.INSPECTOR_ROW_BASE_PADDING = exports.TIMELINE_ROW_BASE_PADDING = void 0;
4
4
  const timeline_indent_1 = require("./timeline-indent");
5
- exports.TIMELINE_ROW_BASE_PADDING = 5;
5
+ exports.TIMELINE_ROW_BASE_PADDING = 10;
6
+ exports.INSPECTOR_ROW_BASE_PADDING = 5;
6
7
  exports.TIMELINE_EYE_COLUMN_WIDTH = 22;
7
8
  exports.TIMELINE_ARROW_COLUMN_WIDTH = 16;
8
9
  exports.TIMELINE_KEYFRAME_CONTROLS_WIDTH = 38;
@@ -11,15 +12,15 @@ const getTimelineRowIndentWidth = (depth) => {
11
12
  return depth * timeline_indent_1.TIMELINE_INDENT;
12
13
  };
13
14
  exports.getTimelineRowIndentWidth = getTimelineRowIndentWidth;
14
- const getTimelineRowLeftChromeWidth = (depth) => {
15
- return (exports.TIMELINE_ROW_BASE_PADDING +
15
+ const getTimelineRowLeftChromeWidth = (depth, basePadding = exports.TIMELINE_ROW_BASE_PADDING) => {
16
+ return (basePadding +
16
17
  exports.TIMELINE_EYE_COLUMN_WIDTH +
17
18
  (0, exports.getTimelineRowIndentWidth)(depth) +
18
19
  exports.TIMELINE_ARROW_COLUMN_WIDTH);
19
20
  };
20
21
  exports.getTimelineRowLeftChromeWidth = getTimelineRowLeftChromeWidth;
21
- const getTimelineFieldLabelFlexBasis = (depth) => {
22
- return `calc(50% - ${(0, exports.getTimelineRowLeftChromeWidth)(depth) - exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH}px)`;
22
+ const getTimelineFieldLabelFlexBasis = (depth, basePadding = exports.TIMELINE_ROW_BASE_PADDING) => {
23
+ return `calc(50% - ${(0, exports.getTimelineRowLeftChromeWidth)(depth, basePadding) - exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH}px)`;
23
24
  };
24
25
  exports.getTimelineFieldLabelFlexBasis = getTimelineFieldLabelFlexBasis;
25
26
  const getExpandedRowDepth = ({ nestedDepth, treeDepth, }) => {
@@ -45,6 +45,7 @@ const useExpandedTrackKeyframeRows = ({ sequence, nodePathInfo, keyframeDisplayO
45
45
  getEffectDragOverrides,
46
46
  propStatuses,
47
47
  includeTextContent: false,
48
+ includeSourceControls: false,
48
49
  }), [
49
50
  propStatuses,
50
51
  getDragOverrides,
@@ -18,6 +18,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
18
18
  const overrideIdToNodePathMappingsRef = (0, react_1.useRef)(overrideIdToNodePathMappings);
19
19
  overrideIdToNodePathMappingsRef.current = overrideIdToNodePathMappings;
20
20
  const clientId = state.type === 'connected' ? state.clientId : undefined;
21
+ const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
21
22
  const effectsSignature = (0, react_1.useMemo)(() => effects.map((effect) => (0, studio_shared_1.getAllSchemaKeys)(effect).join('\0')).join('\0\0'), [effects]);
22
23
  const validatedLocation = (0, react_1.useMemo)(() => {
23
24
  var _a;
@@ -41,7 +42,8 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
41
42
  !locationSource ||
42
43
  !locationLine ||
43
44
  locationColumn === null ||
44
- !schema) {
45
+ !schema ||
46
+ videoConfig === null) {
45
47
  return;
46
48
  }
47
49
  const nodePathAtResubscribe = (_a = overrideIdToNodePathMappingsRef.current[overrideId]) !== null && _a !== void 0 ? _a : null;
@@ -54,6 +56,12 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
54
56
  effects,
55
57
  nodePath: (_b = nodePathAtResubscribe === null || nodePathAtResubscribe === void 0 ? void 0 : nodePathAtResubscribe.nodePath) !== null && _b !== void 0 ? _b : null,
56
58
  clientId,
59
+ videoConfigValues: {
60
+ durationInFrames: videoConfig.durationInFrames,
61
+ fps: videoConfig.fps,
62
+ height: videoConfig.height,
63
+ width: videoConfig.width,
64
+ },
57
65
  applyOnce: (result) => {
58
66
  if (!result.success) {
59
67
  return;
@@ -97,6 +105,7 @@ const useSequencePropsSubscription = ({ originalLocation, overrideId, componentI
97
105
  schema,
98
106
  setPropStatuses,
99
107
  setOverrideIdToNodePath,
108
+ videoConfig,
100
109
  ]);
101
110
  };
102
111
  exports.useSequencePropsSubscription = useSequencePropsSubscription;
@@ -1,9 +1,10 @@
1
1
  import { type TSequence } from 'remotion';
2
2
  import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
3
- export declare const useTimelineExpandedTree: ({ sequence, nodePathInfo, includeTextContent, }: {
3
+ export declare const useTimelineExpandedTree: ({ sequence, nodePathInfo, includeTextContent, includeSourceControls, }: {
4
4
  readonly sequence: TSequence;
5
5
  readonly nodePathInfo: SequenceNodePathInfo;
6
6
  readonly includeTextContent: boolean;
7
+ readonly includeSourceControls: boolean;
7
8
  }) => {
8
9
  filteredTree: import("../../helpers/timeline-layout").TimelineTreeNode[];
9
10
  getIsExpanded: import("../ExpandedTracksProvider").GetIsExpanded;
@@ -8,7 +8,7 @@ const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
8
8
  const get_node_keyframes_1 = require("./get-node-keyframes");
9
9
  const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
10
10
  const TimelineSelection_1 = require("./TimelineSelection");
11
- const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, }) => {
11
+ const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, includeSourceControls, }) => {
12
12
  const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
13
13
  const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
14
14
  const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
@@ -21,6 +21,7 @@ const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, }
21
21
  getEffectDragOverrides,
22
22
  propStatuses: visualModePropStatuses,
23
23
  includeTextContent,
24
+ includeSourceControls,
24
25
  }), [
25
26
  sequence,
26
27
  nodePathInfo,
@@ -28,6 +29,7 @@ const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, }
28
29
  getEffectDragOverrides,
29
30
  visualModePropStatuses,
30
31
  includeTextContent,
32
+ includeSourceControls,
31
33
  ]);
32
34
  const selectedRowKeys = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.getSelectedTimelineExpandedRowKeys)(selectedItems), [selectedItems]);
33
35
  const filteredTree = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
@@ -38,6 +38,7 @@ const useTimelineHeight = ({ shown, hasBeenCut, }) => {
38
38
  getEffectDragOverrides,
39
39
  propStatuses,
40
40
  includeTextContent: false,
41
+ includeSourceControls: false,
41
42
  });
42
43
  const filteredTree = (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
43
44
  nodes: tree,
@@ -29,6 +29,15 @@ export declare const getAssetElementFromPath: (assetPath: string) => {
29
29
  } | null;
30
30
  position: InsertableCompositionElementPosition | null;
31
31
  } | null;
32
+ export declare const getElementPositionForDrop: ({ dimensions, dropPosition, }: {
33
+ dimensions: Dimensions | null;
34
+ dropPosition: InsertElementDropPosition | null;
35
+ }) => InsertableCompositionElementPosition | null;
36
+ export declare const getCompositionPositionForDrop: ({ compositionDimensions, destinationDimensions, dropPosition, }: {
37
+ compositionDimensions: Dimensions;
38
+ destinationDimensions: Dimensions | null;
39
+ dropPosition: InsertElementDropPosition | null;
40
+ }) => InsertableCompositionElementPosition | null;
32
41
  export declare const getComponentDimensions: (component: {
33
42
  componentName: string;
34
43
  dimensions?: import("@remotion/studio-shared").ComponentDimensions | undefined;
@@ -36,7 +45,9 @@ export declare const getComponentDimensions: (component: {
36
45
  importPath: string;
37
46
  props: ComponentProp[];
38
47
  }) => Dimensions | null;
39
- export declare const pickFilesToImport: () => Promise<File[]>;
48
+ export declare const pickFilesToImport: ({ multiple, }?: {
49
+ readonly multiple?: boolean | undefined;
50
+ }) => Promise<File[]>;
40
51
  export declare const importAssets: ({ compositionFile, compositionId, dropPosition, files, }: {
41
52
  compositionFile: string;
42
53
  compositionId: string;
@@ -72,10 +83,11 @@ export declare const insertComponent: ({ component, compositionFile, composition
72
83
  compositionId: string;
73
84
  dropPosition: InsertElementDropPosition | null;
74
85
  }) => Promise<void>;
75
- export declare const insertComposition: ({ composition, compositionFile, compositionId, dropPosition, }: {
86
+ export declare const insertComposition: ({ composition, compositionFile, compositionId, destinationDimensions, dropPosition, }: {
76
87
  composition: CompositionDragData;
77
88
  compositionFile: string;
78
89
  compositionId: string;
90
+ destinationDimensions: Dimensions | null;
79
91
  dropPosition: InsertElementDropPosition | null;
80
92
  }) => Promise<void>;
81
93
  export declare const insertElement: ({ compositionFile, compositionId, dropPosition, element, }: {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.insertElement = exports.insertComposition = exports.insertComponent = exports.insertExistingAssets = exports.insertRemoteAudio = exports.importRemoteAsset = exports.importAssets = exports.pickFilesToImport = exports.getComponentDimensions = exports.getAssetElementFromPath = exports.getAssetElement = void 0;
3
+ exports.insertElement = exports.insertComposition = exports.insertComponent = exports.insertExistingAssets = exports.insertRemoteAudio = exports.importRemoteAsset = exports.importAssets = exports.pickFilesToImport = exports.getComponentDimensions = exports.getCompositionPositionForDrop = exports.getElementPositionForDrop = exports.getAssetElementFromPath = exports.getAssetElement = void 0;
4
4
  const media_utils_1 = require("@remotion/media-utils");
5
5
  const studio_shared_1 = require("@remotion/studio-shared");
6
6
  const remotion_1 = require("remotion");
@@ -174,6 +174,26 @@ const getCenteredPosition = ({ dimensions, dropPosition, }) => {
174
174
  y: dropPosition.centerY - dimensions.height / 2,
175
175
  };
176
176
  };
177
+ const getElementPositionForDrop = ({ dimensions, dropPosition, }) => {
178
+ if (dimensions === null) {
179
+ return null;
180
+ }
181
+ return getCenteredPosition({ dimensions, dropPosition });
182
+ };
183
+ exports.getElementPositionForDrop = getElementPositionForDrop;
184
+ const getCompositionPositionForDrop = ({ compositionDimensions, destinationDimensions, dropPosition, }) => {
185
+ // No translation makes an equal-sized composition fill the destination.
186
+ if (destinationDimensions !== null &&
187
+ compositionDimensions.width === destinationDimensions.width &&
188
+ compositionDimensions.height === destinationDimensions.height) {
189
+ return null;
190
+ }
191
+ return getCenteredPosition({
192
+ dimensions: compositionDimensions,
193
+ dropPosition,
194
+ });
195
+ };
196
+ exports.getCompositionPositionForDrop = getCompositionPositionForDrop;
177
197
  const getComponentPropNumber = (props, name) => {
178
198
  const prop = props.find((p) => p.name === name);
179
199
  return typeof (prop === null || prop === void 0 ? void 0 : prop.value) === 'number' ? prop.value : null;
@@ -306,11 +326,11 @@ const getAssetElementFromStaticAsset = async (assetPath) => {
306
326
  }
307
327
  return (0, exports.getAssetElementFromPath)(assetPath);
308
328
  };
309
- const pickFilesToImport = () => {
329
+ const pickFilesToImport = ({ multiple = true, } = {}) => {
310
330
  return new Promise((resolve) => {
311
331
  const input = document.createElement('input');
312
332
  input.type = 'file';
313
- input.multiple = true;
333
+ input.multiple = multiple;
314
334
  input.style.display = 'none';
315
335
  let didResolve = false;
316
336
  const resolveOnce = (files) => {
@@ -577,7 +597,7 @@ const serializeResolvedPropsForSourceCode = (props) => {
577
597
  staticBase: window.remotion_staticBase,
578
598
  }).serializedString;
579
599
  };
580
- const insertComposition = async ({ composition, compositionFile, compositionId, dropPosition, }) => {
600
+ const insertComposition = async ({ composition, compositionFile, compositionId, destinationDimensions, dropPosition, }) => {
581
601
  if (composition.compositionId === compositionId) {
582
602
  (0, NotificationCenter_1.showNotification)('Cannot add a composition to itself', 3000);
583
603
  return;
@@ -607,8 +627,9 @@ const insertComposition = async ({ composition, compositionFile, compositionId,
607
627
  width: calculated.width,
608
628
  height: calculated.height,
609
629
  serializedResolvedPropsWithCustomSchema: serializeResolvedPropsForSourceCode(calculated.props),
610
- position: getCenteredPosition({
611
- dimensions,
630
+ position: (0, exports.getCompositionPositionForDrop)({
631
+ compositionDimensions: dimensions,
632
+ destinationDimensions,
612
633
  dropPosition,
613
634
  }),
614
635
  },
@@ -630,7 +651,7 @@ const insertElement = async ({ compositionFile, compositionId, dropPosition, ele
630
651
  compositionFile,
631
652
  compositionId,
632
653
  element,
633
- position: getCenteredPosition({
654
+ position: (0, exports.getElementPositionForDrop)({
634
655
  dimensions: element.dimensions,
635
656
  dropPosition,
636
657
  }),
@@ -0,0 +1,8 @@
1
+ import type { SetStateAction } from 'react';
2
+ import type { ModalState } from '../state/modals';
3
+ import type { ComboboxValue } from './NewComposition/ComboBox';
4
+ export declare const getRootCompositionMenuItems: ({ connectionStatus, readOnlyStudio, setSelectedModal, }: {
5
+ connectionStatus: "connected" | "disconnected" | "init";
6
+ readOnlyStudio: boolean;
7
+ setSelectedModal: (value: SetStateAction<ModalState | null>) => void;
8
+ }) => ComboboxValue[];
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRootCompositionMenuItems = void 0;
4
+ const getRootCompositionMenuItems = ({ connectionStatus, readOnlyStudio, setSelectedModal, }) => {
5
+ return [
6
+ {
7
+ id: 'new-root-composition',
8
+ keyHint: null,
9
+ label: 'New composition...',
10
+ leftItem: null,
11
+ onClick: () => {
12
+ setSelectedModal({
13
+ type: 'new-comp',
14
+ folderName: null,
15
+ parentName: null,
16
+ stack: null,
17
+ });
18
+ },
19
+ quickSwitcherLabel: 'New composition...',
20
+ subMenu: null,
21
+ type: 'item',
22
+ value: 'new-root-composition',
23
+ disabled: readOnlyStudio || connectionStatus !== 'connected',
24
+ },
25
+ {
26
+ id: 'new-root-folder',
27
+ keyHint: null,
28
+ label: 'New folder...',
29
+ leftItem: null,
30
+ onClick: () => {
31
+ setSelectedModal({
32
+ type: 'new-folder',
33
+ parentName: null,
34
+ stack: null,
35
+ });
36
+ },
37
+ quickSwitcherLabel: 'New folder...',
38
+ subMenu: null,
39
+ type: 'item',
40
+ value: 'new-root-folder',
41
+ disabled: readOnlyStudio || connectionStatus !== 'connected',
42
+ },
43
+ ];
44
+ };
45
+ exports.getRootCompositionMenuItems = getRootCompositionMenuItems;
@@ -48,6 +48,10 @@ export declare const getOutlineSelectionInteraction: ({ shiftKey, metaKey, ctrlK
48
48
  readonly metaKey: boolean;
49
49
  readonly ctrlKey: boolean;
50
50
  }) => TimelineSelectionInteraction;
51
+ export declare const getOutlineDoubleClickAction: ({ button, canOpenInEditor, }: {
52
+ readonly button: number;
53
+ readonly canOpenInEditor: boolean;
54
+ }) => "open-in-editor" | null;
51
55
  type SelectedEffectFields = {
52
56
  allFields: boolean;
53
57
  fieldKeys: Set<string>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.outlinesAreEqual = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedTransformOriginInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
3
+ exports.outlinesAreEqual = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedTransformOriginInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineDoubleClickAction = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
4
4
  const calculate_timeline_1 = require("../helpers/calculate-timeline");
5
5
  const colors_1 = require("../helpers/colors");
6
6
  const get_box_quads_ponyfill_1 = require("../helpers/get-box-quads-ponyfill");
@@ -220,6 +220,8 @@ const getOutlineSelectionInteraction = ({ shiftKey, metaKey, ctrlKey, }) => ({
220
220
  toggleKey: metaKey || ctrlKey,
221
221
  });
222
222
  exports.getOutlineSelectionInteraction = getOutlineSelectionInteraction;
223
+ const getOutlineDoubleClickAction = ({ button, canOpenInEditor, }) => button === 0 && canOpenInEditor ? 'open-in-editor' : null;
224
+ exports.getOutlineDoubleClickAction = getOutlineDoubleClickAction;
223
225
  const getKeyframeOrEasingField = (item) => {
224
226
  if (item.type !== 'keyframe' && item.type !== 'easing') {
225
227
  return null;
@@ -1,4 +1,4 @@
1
- import type { CanUpdateSequencePropStatus, CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, InteractivitySchema, InteractivitySchemaField, SequencePropsSubscriptionKey, TSequence } from 'remotion';
1
+ import type { CanUpdateSequencePropStatusKeyframed, CanUpdateSequencePropStatusStatic, InteractivitySchema, InteractivitySchemaField, SequencePropsSubscriptionKey, TSequence } from 'remotion';
2
2
  import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
3
3
  import type { ComboboxValue } from './NewComposition/ComboBox';
4
4
  import type { SelectedOutlineUvHandle } from './selected-outline-uv';
@@ -18,7 +18,6 @@ export type SelectedOutlineTarget = {
18
18
  readonly scaleDrag: SelectedOutlineScaleDragTarget | null;
19
19
  readonly rotationDrag: SelectedOutlineRotationDragTarget | null;
20
20
  readonly transformOriginDrag: SelectedOutlineTransformOriginDragTarget | null;
21
- readonly textEdit: SelectedOutlineTextEditTarget | null;
22
21
  readonly uvHandles: readonly SelectedOutlineUvHandle[];
23
22
  };
24
23
  export type SelectedOutlineEffectDropTarget = {
@@ -26,10 +25,6 @@ export type SelectedOutlineEffectDropTarget = {
26
25
  readonly fileName: string;
27
26
  readonly nodePath: SequencePropsSubscriptionKey;
28
27
  };
29
- export type SelectedOutlineTextEditTarget = {
30
- readonly nodePath: SequencePropsSubscriptionKey;
31
- readonly propStatus: CanUpdateSequencePropStatus;
32
- };
33
28
  export type SelectedOutlineDragTarget = {
34
29
  readonly propStatus: CanUpdateSequencePropStatusStatic | CanUpdateSequencePropStatusKeyframed;
35
30
  readonly clientId: string;