@remotion/studio 4.0.139 → 4.0.140

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.139 build /Users/jonathanburger/remotion/packages/studio
3
3
  > tsc -d
4
4
 
@@ -12,6 +12,6 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
12
12
  status: 'error' | 'warning' | 'ok';
13
13
  isFocused: boolean;
14
14
  isHovered: boolean;
15
- }) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232" | "#f1c40f";
15
+ }) => "#ff3232" | "hsla(0, 0%, 100%, 0.15)" | "#f1c40f" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)";
16
16
  export declare const RemotionInput: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
17
17
  export {};
@@ -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: '-',
@@ -1,4 +1,4 @@
1
1
  export declare const getCheckerboardBackgroundSize: (size: number) => string;
2
2
  export declare const getCheckerboardBackgroundPos: (size: number) => string;
3
- export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "black" | "white";
3
+ export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "white" | "black";
4
4
  export declare const checkerboardBackgroundImage: (checkerboard: boolean) => "\n linear-gradient(\n 45deg,\n rgba(0, 0, 0, 0.1) 25%,\n transparent 25%\n ),\n linear-gradient(135deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%),\n linear-gradient(135deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%)\n " | undefined;
@@ -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
+ }) => "transparent" | "hsla(0, 0%, 100%, 0.25)" | "hsla(0, 0%, 100%, 0.15)" | "rgba(255, 255, 255, 0.06)";
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/studio",
3
- "version": "4.0.139",
3
+ "version": "4.0.140",
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/player": "4.0.140",
22
+ "@remotion/renderer": "4.0.140",
23
+ "remotion": "4.0.140",
24
+ "@remotion/media-utils": "4.0.140",
25
+ "@remotion/studio-shared": "4.0.140"
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.140"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"