@remotion/studio 4.0.139 → 4.0.141

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @remotion/studio@4.0.138 build /Users/jonathanburger/remotion/packages/studio
2
+ > @remotion/studio@4.0.140 build /Users/jonathanburger/remotion/packages/studio
3
3
  > tsc -d
4
4
 
@@ -99,6 +99,9 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
99
99
  setSelectedModal({
100
100
  type: 'duplicate-comp',
101
101
  compositionId: item.composition.id,
102
+ compositionType: item.composition.durationInFrames === 1
103
+ ? 'still'
104
+ : 'composition',
102
105
  });
103
106
  },
104
107
  quickSwitcherLabel: null,
@@ -19,7 +19,7 @@ const Modals = ({ readOnlyStudio }) => {
19
19
  const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
20
20
  const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
21
21
  'connected';
22
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && ((0, jsx_runtime_1.jsx)(DuplicateComposition_1.DuplicateComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && ((0, jsx_runtime_1.jsx)(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && ((0, jsx_runtime_1.jsx)(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModalWithLoader, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender })), modalContextType &&
22
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && ((0, jsx_runtime_1.jsx)(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && ((0, jsx_runtime_1.jsx)(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && ((0, jsx_runtime_1.jsx)(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModalWithLoader, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender })), modalContextType &&
23
23
  canRender &&
24
24
  modalContextType.type === 'render-progress' && ((0, jsx_runtime_1.jsx)(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'quick-switcher' && ((0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode }))] }));
25
25
  };
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ export type CompType = 'composition' | 'still';
2
3
  export declare const DuplicateComposition: React.FC<{
3
4
  readonly compositionId: string;
5
+ readonly compositionType: CompType;
4
6
  }>;
@@ -26,13 +26,13 @@ const content = {
26
26
  const comboBoxStyle = {
27
27
  width: 190,
28
28
  };
29
- const DuplicateCompositionLoaded = () => {
29
+ const DuplicateCompositionLoaded = ({ initialType }) => {
30
30
  const context = (0, react_1.useContext)(ResolveCompositionBeforeModal_1.ResolvedCompositionContext);
31
31
  if (!context) {
32
32
  throw new Error('Resolved composition context');
33
33
  }
34
34
  const { resolved, unresolved } = context;
35
- const initialCompType = resolved.result.durationInFrames === 1 ? 'still' : 'composition';
35
+ const [initialCompType] = (0, react_1.useState)(initialType);
36
36
  const hadDimensionsDefined = unresolved.width && unresolved.height;
37
37
  const hadFpsDefined = unresolved.fps !== undefined;
38
38
  const hadDurationDefined = unresolved.durationInFrames !== undefined;
@@ -174,7 +174,7 @@ const DuplicateCompositionLoaded = () => {
174
174
  // not the other way around
175
175
  (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Type" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Type of composition", style: comboBoxStyle, values: typeValues, selectedId: type }) })] })) : null, (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "ID" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })] })) : null] }) })] }), hadDimensionsDefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Width" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })] })) : null] })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Height" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_2.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })] })) : null] })] })] })) : null, type === 'composition' && hadDurationDefined ? ((0, jsx_runtime_1.jsx)(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames })) : null, type === 'composition' && hadFpsDefined ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "FPS" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: { ...content, borderTop: '1px solid black' }, children: (0, jsx_runtime_1.jsx)(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Duplicating...', errorNotification: 'Could not duplicate composition', succeessNotifcation: `Duplicated ${unresolved.id}`, genericSubmitLabel: 'Duplicate', submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, valid: valid }) })] })] }));
176
176
  };
177
- const DuplicateComposition = ({ compositionId }) => {
178
- return ((0, jsx_runtime_1.jsx)(DismissableModal_1.DismissableModal, { children: (0, jsx_runtime_1.jsx)(ResolveCompositionBeforeModal_1.ResolveCompositionBeforeModal, { compositionId: compositionId, children: (0, jsx_runtime_1.jsx)(DuplicateCompositionLoaded, {}) }) }));
177
+ const DuplicateComposition = ({ compositionId, compositionType }) => {
178
+ return ((0, jsx_runtime_1.jsx)(DismissableModal_1.DismissableModal, { children: (0, jsx_runtime_1.jsx)(ResolveCompositionBeforeModal_1.ResolveCompositionBeforeModal, { compositionId: compositionId, children: (0, jsx_runtime_1.jsx)(DuplicateCompositionLoaded, { initialType: compositionType }) }) }));
179
179
  };
180
180
  exports.DuplicateComposition = DuplicateComposition;
@@ -10,6 +10,7 @@ const containerRow = {
10
10
  flexDirection: 'row',
11
11
  flex: 1,
12
12
  height: '100%',
13
+ width: '100%',
13
14
  };
14
15
  exports.containerColumn = {
15
16
  display: 'flex',
@@ -23,6 +23,7 @@ const TimelineSequence = ({ s }) => {
23
23
  };
24
24
  exports.TimelineSequence = TimelineSequence;
25
25
  const Inner = ({ s, windowWidth }) => {
26
+ var _a;
26
27
  // If a duration is 1, it is essentially a still and it should have width 0
27
28
  // Some compositions may not be longer than their media duration,
28
29
  // if that is the case, it needs to be asynchronously determined
@@ -33,9 +34,13 @@ const Inner = ({ s, windowWidth }) => {
33
34
  }
34
35
  const frame = (0, remotion_1.useCurrentFrame)();
35
36
  const relativeFrame = frame - s.from;
37
+ const relativeFrameWithPremount = relativeFrame + ((_a = s.premountDisplay) !== null && _a !== void 0 ? _a : 0);
36
38
  const roundedFrame = Math.round(relativeFrame * 100) / 100;
37
39
  const isInRange = relativeFrame >= 0 && relativeFrame < s.duration;
38
- const { marginLeft, width } = (0, react_1.useMemo)(() => {
40
+ const isPremounting = relativeFrameWithPremount >= 0 &&
41
+ relativeFrameWithPremount < s.duration &&
42
+ !isInRange;
43
+ const { marginLeft, width, premountWidth } = (0, react_1.useMemo)(() => {
39
44
  return (0, get_timeline_sequence_layout_1.getTimelineSequenceLayout)({
40
45
  durationInFrames: s.loopDisplay
41
46
  ? s.loopDisplay.durationInFrames * s.loopDisplay.numberOfTimes
@@ -45,6 +50,7 @@ const Inner = ({ s, windowWidth }) => {
45
50
  maxMediaDuration,
46
51
  video,
47
52
  windowWidth,
53
+ premountDisplay: s.premountDisplay,
48
54
  });
49
55
  }, [maxMediaDuration, s, video, windowWidth]);
50
56
  const style = (0, react_1.useMemo)(() => {
@@ -65,13 +71,24 @@ const Inner = ({ s, windowWidth }) => {
65
71
  opacity: isInRange ? 1 : 0.5,
66
72
  };
67
73
  }, [isInRange, marginLeft, s.type, width]);
68
- return ((0, jsx_runtime_1.jsxs)("div", { style: style, title: s.displayName, children: [s.type === 'audio' ? ((0, jsx_runtime_1.jsx)(AudioWaveform_1.AudioWaveform, { src: s.src, doesVolumeChange: s.doesVolumeChange, visualizationWidth: width, startFrom: s.startMediaFrom, durationInFrames: s.duration, volume: s.volume, setMaxMediaDuration: setMaxMediaDuration, playbackRate: s.playbackRate })) : null, s.type === 'video' ? (0, jsx_runtime_1.jsx)(TimelineVideoInfo_1.TimelineVideoInfo, { src: s.src }) : null, s.loopDisplay === undefined ? null : ((0, jsx_runtime_1.jsx)(LoopedTimelineIndicators_1.LoopedTimelineIndicator, { loops: s.loopDisplay.numberOfTimes })), s.type !== 'audio' &&
74
+ return ((0, jsx_runtime_1.jsxs)("div", { style: style, title: s.displayName, children: [premountWidth ? ((0, jsx_runtime_1.jsx)("div", { style: {
75
+ width: premountWidth,
76
+ height: '100%',
77
+ background: `repeating-linear-gradient(
78
+ -45deg,
79
+ transparent,
80
+ transparent 2px,
81
+ rgba(255, 255, 255, ${isPremounting ? 0.5 : 0.2}) 2px,
82
+ rgba(255, 255, 255, ${isPremounting ? 0.5 : 0.2}) 4px
83
+ )`,
84
+ position: 'absolute',
85
+ } })) : null, s.type === 'audio' ? ((0, jsx_runtime_1.jsx)(AudioWaveform_1.AudioWaveform, { src: s.src, doesVolumeChange: s.doesVolumeChange, visualizationWidth: width, startFrom: s.startMediaFrom, durationInFrames: s.duration, volume: s.volume, setMaxMediaDuration: setMaxMediaDuration, playbackRate: s.playbackRate })) : null, s.type === 'video' ? (0, jsx_runtime_1.jsx)(TimelineVideoInfo_1.TimelineVideoInfo, { src: s.src }) : null, s.loopDisplay === undefined ? null : ((0, jsx_runtime_1.jsx)(LoopedTimelineIndicators_1.LoopedTimelineIndicator, { loops: s.loopDisplay.numberOfTimes })), s.type !== 'audio' &&
69
86
  s.type !== 'video' &&
70
87
  s.loopDisplay === undefined &&
71
- isInRange ? ((0, jsx_runtime_1.jsx)("div", { style: {
72
- paddingLeft: 5,
88
+ (isInRange || isPremounting) ? ((0, jsx_runtime_1.jsx)("div", { style: {
89
+ paddingLeft: 5 + (premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0),
73
90
  height: '100%',
74
91
  display: 'flex',
75
92
  alignItems: 'center',
76
- }, children: (0, jsx_runtime_1.jsx)(TimelineSequenceFrame_1.TimelineSequenceFrame, { roundedFrame: roundedFrame }) })) : null] }, s.id));
93
+ }, children: (0, jsx_runtime_1.jsx)(TimelineSequenceFrame_1.TimelineSequenceFrame, { premounted: isPremounting, roundedFrame: roundedFrame }) })) : null] }, s.id));
77
94
  };
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  export declare const TimelineSequenceFrame: React.FC<{
3
3
  roundedFrame: number;
4
+ premounted: boolean;
4
5
  }>;
@@ -8,7 +8,7 @@ const relativeFrameStyle = {
8
8
  color: 'white',
9
9
  opacity: 0.5,
10
10
  };
11
- const TimelineSequenceFrame = ({ roundedFrame }) => {
12
- return (0, jsx_runtime_1.jsx)("div", { style: relativeFrameStyle, children: roundedFrame });
11
+ const TimelineSequenceFrame = ({ roundedFrame, premounted }) => {
12
+ return ((0, jsx_runtime_1.jsx)("div", { style: relativeFrameStyle, children: premounted ? '0 (Premounted)' : roundedFrame }));
13
13
  };
14
14
  exports.TimelineSequenceFrame = TimelineSequenceFrame;
@@ -22,6 +22,7 @@ const calculateTimeline = ({ sequences, sequenceDuration, }) => {
22
22
  nonce: 0,
23
23
  loopDisplay: undefined,
24
24
  stack: null,
25
+ premountDisplay: null,
25
26
  },
26
27
  depth: 0,
27
28
  hash: '-',
@@ -23,4 +23,4 @@ export declare const TIMELINE_TRACK_SEPARATOR = "rgba(0, 0, 0, 0.3)";
23
23
  export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
24
24
  selected: boolean;
25
25
  hovered: boolean;
26
- }) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)";
26
+ }) => "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)" | "transparent";
@@ -1,13 +1,15 @@
1
1
  import type { VideoConfig } from 'remotion';
2
2
  export declare const SEQUENCE_BORDER_WIDTH = 1;
3
- export declare const getTimelineSequenceLayout: ({ durationInFrames, startFrom, maxMediaDuration, startFromMedia, video, windowWidth, }: {
3
+ export declare const getTimelineSequenceLayout: ({ durationInFrames, startFrom, maxMediaDuration, startFromMedia, video, windowWidth, premountDisplay, }: {
4
4
  durationInFrames: number;
5
5
  startFrom: number;
6
6
  startFromMedia: number;
7
7
  maxMediaDuration: number | null;
8
8
  video: VideoConfig;
9
9
  windowWidth: number;
10
+ premountDisplay: number | null;
10
11
  }) => {
11
12
  marginLeft: number;
12
13
  width: number;
14
+ premountWidth: number | null;
13
15
  };
@@ -10,7 +10,7 @@ const getWidthOfTrack = ({ durationInFrames, lastFrame, windowWidth, spatialDura
10
10
  : (spatialDuration / lastFrame) * fullWidth;
11
11
  return base - exports.SEQUENCE_BORDER_WIDTH + nonNegativeMarginLeft;
12
12
  };
13
- const getTimelineSequenceLayout = ({ durationInFrames, startFrom, maxMediaDuration, startFromMedia, video, windowWidth, }) => {
13
+ const getTimelineSequenceLayout = ({ durationInFrames, startFrom, maxMediaDuration, startFromMedia, video, windowWidth, premountDisplay, }) => {
14
14
  var _a;
15
15
  const maxMediaSequenceDuration = (maxMediaDuration !== null && maxMediaDuration !== void 0 ? maxMediaDuration : Infinity) - startFromMedia;
16
16
  const lastFrame = ((_a = video.durationInFrames) !== null && _a !== void 0 ? _a : 1) - 1;
@@ -31,15 +31,26 @@ const getTimelineSequenceLayout = ({ durationInFrames, startFrom, maxMediaDurati
31
31
  : (startFromWithOffset / lastFrame) *
32
32
  (windowWidth - timeline_layout_1.TIMELINE_PADDING * 2);
33
33
  const nonNegativeMarginLeft = Math.min(marginLeft, 0);
34
- return {
35
- marginLeft: Math.round(Math.max(marginLeft, 0)),
36
- width: Math.floor(getWidthOfTrack({
37
- durationInFrames,
34
+ const width = Math.floor(getWidthOfTrack({
35
+ durationInFrames,
36
+ lastFrame,
37
+ nonNegativeMarginLeft,
38
+ spatialDuration,
39
+ windowWidth,
40
+ }));
41
+ const premountWidth = premountDisplay
42
+ ? Math.floor(getWidthOfTrack({
43
+ durationInFrames: premountDisplay,
38
44
  lastFrame,
39
45
  nonNegativeMarginLeft,
40
- spatialDuration,
46
+ spatialDuration: premountDisplay,
41
47
  windowWidth,
42
- })),
48
+ }))
49
+ : null;
50
+ return {
51
+ marginLeft: Math.round(Math.max(marginLeft, 0)) - (premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0),
52
+ width: width + (premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0),
53
+ premountWidth,
43
54
  };
44
55
  };
45
56
  exports.getTimelineSequenceLayout = getTimelineSequenceLayout;
@@ -1,5 +1,6 @@
1
1
  import type { AudioCodec, Codec, ColorSpace, LogLevel, OpenGlRenderer, PixelFormat, ProResProfile, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
2
2
  import type React from 'react';
3
+ import type { CompType } from '../components/NewComposition/DuplicateComposition';
3
4
  import type { QuickSwitcherMode } from '../components/QuickSwitcher/NoResults';
4
5
  import type { RenderType } from '../components/RenderModal/RenderModalAdvanced';
5
6
  import type { Bug, UpdateInfo } from '../components/UpdateCheck';
@@ -49,6 +50,7 @@ export type RenderModalState = {
49
50
  export type ModalState = {
50
51
  type: 'duplicate-comp';
51
52
  compositionId: string;
53
+ compositionType: CompType;
52
54
  } | {
53
55
  type: 'delete-comp';
54
56
  compositionId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/studio",
3
- "version": "4.0.139",
3
+ "version": "4.0.141",
4
4
  "description": "Remotion Editor",
5
5
  "main": "dist",
6
6
  "sideEffects": false,
@@ -18,11 +18,11 @@
18
18
  "memfs": "3.4.3",
19
19
  "source-map": "0.7.3",
20
20
  "open": "^8.4.2",
21
- "remotion": "4.0.139",
22
- "@remotion/media-utils": "4.0.139",
23
- "@remotion/renderer": "4.0.139",
24
- "@remotion/player": "4.0.139",
25
- "@remotion/studio-shared": "4.0.139"
21
+ "remotion": "4.0.141",
22
+ "@remotion/player": "4.0.141",
23
+ "@remotion/studio-shared": "4.0.141",
24
+ "@remotion/media-utils": "4.0.141",
25
+ "@remotion/renderer": "4.0.141"
26
26
  },
27
27
  "devDependencies": {
28
28
  "react": "18.2.0",
@@ -40,7 +40,7 @@
40
40
  "prettier-plugin-organize-imports": "3.2.4",
41
41
  "vitest": "0.31.1",
42
42
  "zod": "^3.22.3",
43
- "@remotion/zod-types": "4.0.139"
43
+ "@remotion/zod-types": "4.0.141"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"