@remotion/studio 4.0.463 → 4.0.465
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.
- package/dist/components/CanvasOrLoading.js +1 -1
- package/dist/components/ColorPicker/AlphaSlider.d.ts +9 -0
- package/dist/components/ColorPicker/AlphaSlider.js +88 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +18 -0
- package/dist/components/ColorPicker/ColorPicker.js +176 -0
- package/dist/components/ColorPicker/ColorPickerPopup.d.ts +8 -0
- package/dist/components/ColorPicker/ColorPickerPopup.js +276 -0
- package/dist/components/ColorPicker/HueSlider.d.ts +6 -0
- package/dist/components/ColorPicker/HueSlider.js +68 -0
- package/dist/components/ColorPicker/SaturationValueArea.d.ts +14 -0
- package/dist/components/ColorPicker/SaturationValueArea.js +93 -0
- package/dist/components/ColorPicker/checker.d.ts +4 -0
- package/dist/components/ColorPicker/checker.js +9 -0
- package/dist/components/ExpandedTracksProvider.d.ts +2 -0
- package/dist/components/ExpandedTracksProvider.js +18 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
- package/dist/components/NewComposition/CodemodFooter.js +35 -23
- package/dist/components/NewComposition/DeleteComposition.js +3 -1
- package/dist/components/NewComposition/DiffPreview.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +3 -1
- package/dist/components/NewComposition/RenameComposition.js +4 -2
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +8 -47
- package/dist/components/RenderQueue/actions.d.ts +2 -1
- package/dist/components/RenderQueue/actions.js +2 -1
- package/dist/components/Timeline/Padder.js +2 -2
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +1 -1
- package/dist/components/Timeline/SubscribeToNodePaths.js +9 -4
- package/dist/components/Timeline/Timeline.js +4 -7
- package/dist/components/Timeline/TimelineColorField.js +18 -156
- package/dist/components/Timeline/TimelineEffectFieldRow.d.ts +1 -2
- package/dist/components/Timeline/TimelineEffectFieldRow.js +22 -31
- package/dist/components/Timeline/TimelineEffectGroupRow.d.ts +1 -2
- package/dist/components/Timeline/TimelineEffectGroupRow.js +67 -12
- package/dist/components/Timeline/TimelineExpandedRow.js +15 -30
- package/dist/components/Timeline/TimelineFieldRow.d.ts +1 -2
- package/dist/components/Timeline/TimelineFieldRow.js +19 -16
- package/dist/components/Timeline/TimelineImageInfo.js +5 -17
- package/dist/components/Timeline/TimelineListItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineListItem.js +12 -14
- package/dist/components/Timeline/TimelineRowChrome.d.ts +8 -0
- package/dist/components/Timeline/TimelineRowChrome.js +21 -0
- package/dist/components/Timeline/TimelineTimeIndicators.js +4 -11
- package/dist/components/Timeline/TimelineTracks.js +0 -4
- package/dist/components/Timeline/TimelineVideoInfo.js +25 -8
- package/dist/components/Timeline/get-timeline-video-info-widths.d.ts +9 -0
- package/dist/components/Timeline/get-timeline-video-info-widths.js +11 -0
- package/dist/components/Timeline/save-effect-prop.d.ts +2 -1
- package/dist/components/Timeline/save-effect-prop.js +2 -13
- package/dist/components/Timeline/save-prop-queue.d.ts +1 -2
- package/dist/components/Timeline/save-prop-queue.js +3 -12
- package/dist/components/Timeline/save-sequence-prop.d.ts +2 -1
- package/dist/components/Timeline/save-sequence-prop.js +2 -11
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -0
- package/dist/components/Timeline/should-show-track-in-timeline.js +23 -0
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +2 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +14 -0
- package/dist/components/Timeline/timeline-indent.d.ts +1 -0
- package/dist/components/Timeline/timeline-indent.js +4 -0
- package/dist/components/Timeline/timeline-row-layout.d.ts +11 -0
- package/dist/components/Timeline/timeline-row-layout.js +27 -0
- package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +2 -0
- package/dist/components/Timeline/use-resolved-stack-react-to-change.js +59 -0
- package/dist/components/Timeline/use-resolved-stack.d.ts +1 -0
- package/dist/components/Timeline/use-resolved-stack.js +10 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +27 -1
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +5 -3
- package/dist/esm/chunk-6jf1natv.js +25 -0
- package/dist/esm/{chunk-b0m62frw.js → chunk-pqk2qd0d.js} +4971 -4013
- package/dist/esm/index.mjs +16 -0
- package/dist/esm/internals.mjs +4984 -4011
- package/dist/esm/previewEntry.mjs +4995 -4023
- package/dist/esm/renderEntry.mjs +4 -3
- package/dist/helpers/client-id.d.ts +2 -9
- package/dist/helpers/client-id.js +15 -40
- package/dist/helpers/color-conversion.d.ts +36 -0
- package/dist/helpers/color-conversion.js +121 -0
- package/dist/helpers/inject-css.js +4 -7
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.d.ts +3 -0
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +26 -0
- package/dist/helpers/preview-server-events.d.ts +15 -0
- package/dist/helpers/preview-server-events.js +81 -0
- package/dist/helpers/resolved-stack-to-symbolicated.d.ts +3 -0
- package/dist/helpers/resolved-stack-to-symbolicated.js +16 -0
- package/dist/helpers/timeline-layout.d.ts +0 -1
- package/dist/helpers/timeline-layout.js +29 -25
- package/dist/hot-middleware-client/client.js +10 -16
- package/package.json +10 -10
- package/dist/components/NewComposition/RemInputTypeColor.d.ts +0 -8
- package/dist/components/NewComposition/RemInputTypeColor.js +0 -53
- package/dist/components/Timeline/is-collapsed.d.ts +0 -2
- package/dist/components/Timeline/is-collapsed.js +0 -10
- package/dist/esm/chunk-5gtx3pza.js +0 -9
- package/dist/helpers/color-math.d.ts +0 -1
- package/dist/helpers/color-math.js +0 -13
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimelineImageInfo = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const timeline_utils_1 = require("@remotion/timeline-utils");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
7
8
|
const HEIGHT = (0, timeline_layout_1.getTimelineLayerHeight)('image') - 2;
|
|
@@ -33,23 +34,10 @@ const TimelineImageInfo = ({ src, visualizationWidth }) => {
|
|
|
33
34
|
const img = new Image();
|
|
34
35
|
img.crossOrigin = 'anonymous';
|
|
35
36
|
img.onload = () => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
offscreen.width = scaledWidth;
|
|
41
|
-
offscreen.height = scaledHeight;
|
|
42
|
-
const offCtx = offscreen.getContext('2d');
|
|
43
|
-
if (!offCtx) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
offCtx.drawImage(img, 0, 0, scaledWidth, scaledHeight);
|
|
47
|
-
const pattern = ctx.createPattern(offscreen, 'repeat-x');
|
|
48
|
-
if (!pattern) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
ctx.fillStyle = pattern;
|
|
52
|
-
ctx.fillRect(0, 0, visualizationWidth * window.devicePixelRatio, HEIGHT * window.devicePixelRatio);
|
|
37
|
+
(0, timeline_utils_1.drawRepeatingImageThumbnail)({
|
|
38
|
+
canvas,
|
|
39
|
+
image: img,
|
|
40
|
+
});
|
|
53
41
|
};
|
|
54
42
|
img.src = src;
|
|
55
43
|
return () => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TSequence } from 'remotion';
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
|
-
export declare const INDENT = 10;
|
|
5
4
|
export declare const TimelineListItem: React.FC<{
|
|
6
5
|
readonly sequence: TSequence;
|
|
7
6
|
readonly nestedDepth: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimelineListItem =
|
|
3
|
+
exports.TimelineListItem = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
@@ -11,17 +11,16 @@ const call_api_1 = require("../call-api");
|
|
|
11
11
|
const ContextMenu_1 = require("../ContextMenu");
|
|
12
12
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
13
13
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
14
|
-
const Padder_1 = require("./Padder");
|
|
15
14
|
const save_sequence_prop_1 = require("./save-sequence-prop");
|
|
16
15
|
const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
|
|
17
16
|
const TimelineExpandedSection_1 = require("./TimelineExpandedSection");
|
|
18
17
|
const TimelineLayerEye_1 = require("./TimelineLayerEye");
|
|
18
|
+
const TimelineRowChrome_1 = require("./TimelineRowChrome");
|
|
19
19
|
const TimelineStack_1 = require("./TimelineStack");
|
|
20
|
-
const
|
|
21
|
-
exports.INDENT = 10;
|
|
20
|
+
const use_resolved_stack_react_to_change_1 = require("./use-resolved-stack-react-to-change");
|
|
22
21
|
const TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) => {
|
|
23
22
|
var _a;
|
|
24
|
-
var _b
|
|
23
|
+
var _b;
|
|
25
24
|
const nodePath = (_b = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.sequenceSubscriptionKey) !== null && _b !== void 0 ? _b : null;
|
|
26
25
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
27
26
|
const previewConnected = previewServerState.type === 'connected';
|
|
@@ -29,7 +28,7 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) =>
|
|
|
29
28
|
const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
|
|
30
29
|
const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
|
|
31
30
|
const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
32
|
-
const originalLocation = (0,
|
|
31
|
+
const originalLocation = (0, use_resolved_stack_react_to_change_1.useResolveStackAndReactToChange)(sequence.getStack);
|
|
33
32
|
const validatedLocation = (0, react_1.useMemo)(() => {
|
|
34
33
|
var _a;
|
|
35
34
|
if (!originalLocation ||
|
|
@@ -179,7 +178,8 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) =>
|
|
|
179
178
|
!validatedLocation ||
|
|
180
179
|
!codeValuesForOverride ||
|
|
181
180
|
!codeHiddenStatus ||
|
|
182
|
-
!codeHiddenStatus.canUpdate
|
|
181
|
+
!codeHiddenStatus.canUpdate ||
|
|
182
|
+
previewServerState.type !== 'connected') {
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
const newValue = type !== 'enable';
|
|
@@ -196,11 +196,13 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) =>
|
|
|
196
196
|
defaultValue,
|
|
197
197
|
schema,
|
|
198
198
|
setCodeValues,
|
|
199
|
+
clientId: previewServerState.clientId,
|
|
199
200
|
});
|
|
200
201
|
}, [
|
|
201
202
|
codeHiddenStatus,
|
|
202
203
|
codeValuesForOverride,
|
|
203
204
|
nodePath,
|
|
205
|
+
previewServerState,
|
|
204
206
|
sequence.controls,
|
|
205
207
|
setCodeValues,
|
|
206
208
|
validatedLocation,
|
|
@@ -217,23 +219,19 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact, nodePathInfo }) =>
|
|
|
217
219
|
height: timeline_layout_1.TIMELINE_LAYER_HEIGHT_AUDIO,
|
|
218
220
|
color: 'white',
|
|
219
221
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
220
|
-
display: 'flex',
|
|
221
|
-
flexDirection: 'row',
|
|
222
|
-
alignItems: 'center',
|
|
223
222
|
wordBreak: 'break-all',
|
|
224
223
|
textAlign: 'left',
|
|
225
|
-
paddingLeft: 5,
|
|
226
224
|
};
|
|
227
225
|
}, []);
|
|
228
226
|
const hasExpandableContent = Boolean(sequence.controls) || sequence.effects.length > 0;
|
|
229
|
-
const canToggleVisibility =
|
|
227
|
+
const canToggleVisibility = previewConnected &&
|
|
228
|
+
Boolean(sequence.controls) &&
|
|
230
229
|
nodePath !== null &&
|
|
231
230
|
validatedLocation !== null &&
|
|
232
231
|
codeHiddenStatus !== undefined &&
|
|
233
232
|
codeHiddenStatus !== null &&
|
|
234
233
|
codeHiddenStatus.canUpdate;
|
|
235
|
-
const trackRow = (jsx_runtime_1.jsx("div", { style: outer, children: jsx_runtime_1.
|
|
236
|
-
] }) }));
|
|
234
|
+
const trackRow = (jsx_runtime_1.jsx("div", { style: outer, children: jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: hasExpandableContent ? (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: onToggleExpand, label: "track properties", disabled: !previewConnected || nodePathInfo === null })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {})), style: inner, children: jsx_runtime_1.jsx(TimelineStack_1.TimelineStack, { sequence: sequence, isCompact: isCompact, originalLocation: originalLocation }) }) }));
|
|
237
235
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [previewConnected ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, children: trackRow })) : (trackRow), previewConnected &&
|
|
238
236
|
isExpanded &&
|
|
239
237
|
hasExpandableContent &&
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimelineRowChrome = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Padder_1 = require("./Padder");
|
|
7
|
+
const timeline_row_layout_1 = require("./timeline-row-layout");
|
|
8
|
+
const rowBase = {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
};
|
|
12
|
+
const TimelineRowChrome = ({ depth, eye, arrow, children, style }) => {
|
|
13
|
+
const rowStyle = (0, react_1.useMemo)(() => ({
|
|
14
|
+
...rowBase,
|
|
15
|
+
paddingLeft: timeline_row_layout_1.TIMELINE_ROW_BASE_PADDING,
|
|
16
|
+
...style,
|
|
17
|
+
}), [style]);
|
|
18
|
+
const indentWidth = (0, timeline_row_layout_1.getTimelineRowIndentWidth)(depth);
|
|
19
|
+
return (jsx_runtime_1.jsxs("div", { style: rowStyle, children: [eye, indentWidth > 0 ? jsx_runtime_1.jsx(Padder_1.Padder, { depth: depth }) : null, arrow, children] }));
|
|
20
|
+
};
|
|
21
|
+
exports.TimelineRowChrome = TimelineRowChrome;
|
|
@@ -7,14 +7,13 @@ const remotion_1 = require("remotion");
|
|
|
7
7
|
const colors_1 = require("../../helpers/colors");
|
|
8
8
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
9
9
|
const render_frame_1 = require("../../state/render-frame");
|
|
10
|
-
const SplitterHandle_1 = require("../Splitter/SplitterHandle");
|
|
11
10
|
const TimeValue_1 = require("../TimeValue");
|
|
12
11
|
const timeline_refs_1 = require("./timeline-refs");
|
|
13
12
|
const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
|
|
14
13
|
const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
|
|
15
14
|
exports.TIMELINE_TIME_INDICATOR_HEIGHT = 39;
|
|
16
15
|
const container = {
|
|
17
|
-
height: exports.TIMELINE_TIME_INDICATOR_HEIGHT
|
|
16
|
+
height: exports.TIMELINE_TIME_INDICATOR_HEIGHT,
|
|
18
17
|
boxShadow: `0 0 4px ${colors_1.TIMELINE_BACKGROUND}`,
|
|
19
18
|
position: 'absolute',
|
|
20
19
|
backgroundColor: colors_1.TIMELINE_BACKGROUND,
|
|
@@ -94,10 +93,8 @@ const TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) =>
|
|
|
94
93
|
const style = (0, react_1.useMemo)(() => {
|
|
95
94
|
return {
|
|
96
95
|
...container,
|
|
97
|
-
width: windowWidth
|
|
96
|
+
width: windowWidth,
|
|
98
97
|
overflow: 'hidden',
|
|
99
|
-
// Since
|
|
100
|
-
marginLeft: SplitterHandle_1.SPLITTER_HANDLE_SIZE / 2,
|
|
101
98
|
pointerEvents: 'none',
|
|
102
99
|
};
|
|
103
100
|
}, [windowWidth]);
|
|
@@ -119,9 +116,7 @@ const TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) =>
|
|
|
119
116
|
frame: index * fps,
|
|
120
117
|
style: {
|
|
121
118
|
...secondTick,
|
|
122
|
-
left: frameInterval * index * fps +
|
|
123
|
-
timeline_layout_1.TIMELINE_PADDING -
|
|
124
|
-
SplitterHandle_1.SPLITTER_HANDLE_SIZE / 2,
|
|
119
|
+
left: frameInterval * index * fps + timeline_layout_1.TIMELINE_PADDING,
|
|
125
120
|
},
|
|
126
121
|
showTime: index > 0,
|
|
127
122
|
};
|
|
@@ -134,9 +129,7 @@ const TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) =>
|
|
|
134
129
|
frame: index,
|
|
135
130
|
style: {
|
|
136
131
|
...tick,
|
|
137
|
-
left: frameInterval * index +
|
|
138
|
-
timeline_layout_1.TIMELINE_PADDING -
|
|
139
|
-
SplitterHandle_1.SPLITTER_HANDLE_SIZE / 2,
|
|
132
|
+
left: frameInterval * index + timeline_layout_1.TIMELINE_PADDING,
|
|
140
133
|
height: index % fps === 0
|
|
141
134
|
? 10
|
|
142
135
|
: (index / frameMarkerEveryNth) % 2 === 0
|
|
@@ -40,7 +40,6 @@ const remotion_1 = require("remotion");
|
|
|
40
40
|
const client_id_1 = require("../../helpers/client-id");
|
|
41
41
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
42
42
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
43
|
-
const is_collapsed_1 = require("./is-collapsed");
|
|
44
43
|
const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
|
|
45
44
|
const TimelineSequence_1 = require("./TimelineSequence");
|
|
46
45
|
const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
|
|
@@ -74,9 +73,6 @@ const TimelineTracksInner = ({ timeline, hasBeenCut }) => {
|
|
|
74
73
|
return (jsx_runtime_1.jsxs("div", { style: timelineStyle, children: [
|
|
75
74
|
jsx_runtime_1.jsxs("div", { style: content, children: [
|
|
76
75
|
jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimePadding, {}), timeline.map((track) => {
|
|
77
|
-
if ((0, is_collapsed_1.isTrackHidden)(track)) {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
76
|
const isExpanded = track.nodePathInfo !== null && getIsExpanded(track.nodePathInfo);
|
|
81
77
|
return (jsx_runtime_1.jsxs("div", { children: [
|
|
82
78
|
jsx_runtime_1.jsx("div", { style: {
|
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
9
9
|
const AudioWaveform_1 = require("../AudioWaveform");
|
|
10
|
+
const get_timeline_video_info_widths_1 = require("./get-timeline-video-info-widths");
|
|
10
11
|
const FILMSTRIP_HEIGHT = timeline_layout_1.TIMELINE_LAYER_HEIGHT_IMAGE - 2;
|
|
11
12
|
const outerStyle = {
|
|
12
13
|
width: '100%',
|
|
@@ -16,7 +17,6 @@ const outerStyle = {
|
|
|
16
17
|
};
|
|
17
18
|
const filmstripContainerStyle = {
|
|
18
19
|
height: FILMSTRIP_HEIGHT,
|
|
19
|
-
width: '100%',
|
|
20
20
|
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
21
21
|
display: 'flex',
|
|
22
22
|
borderTopLeftRadius: 2,
|
|
@@ -28,6 +28,14 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
28
28
|
const ref = (0, react_1.useRef)(null);
|
|
29
29
|
const [error, setError] = (0, react_1.useState)(null);
|
|
30
30
|
const aspectRatio = (0, react_1.useRef)((0, timeline_utils_1.getAspectRatioFromCache)(src));
|
|
31
|
+
const { mediaVisualizationWidth, mediaNaturalWidth } = (0, react_1.useMemo)(() => {
|
|
32
|
+
return (0, get_timeline_video_info_widths_1.getTimelineVideoInfoWidths)({
|
|
33
|
+
visualizationWidth,
|
|
34
|
+
naturalWidth,
|
|
35
|
+
premountWidth,
|
|
36
|
+
postmountWidth,
|
|
37
|
+
});
|
|
38
|
+
}, [naturalWidth, postmountWidth, premountWidth, visualizationWidth]);
|
|
31
39
|
// for rendering frames
|
|
32
40
|
(0, react_1.useEffect)(() => {
|
|
33
41
|
if (error) {
|
|
@@ -39,7 +47,7 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
39
47
|
}
|
|
40
48
|
const controller = new AbortController();
|
|
41
49
|
const canvas = document.createElement('canvas');
|
|
42
|
-
canvas.width =
|
|
50
|
+
canvas.width = mediaVisualizationWidth;
|
|
43
51
|
canvas.height = FILMSTRIP_HEIGHT;
|
|
44
52
|
const ctx = canvas.getContext('2d');
|
|
45
53
|
if (!ctx) {
|
|
@@ -47,7 +55,7 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
47
55
|
}
|
|
48
56
|
current.appendChild(canvas);
|
|
49
57
|
const loopWidth = (0, timeline_utils_1.getLoopDisplayWidth)({
|
|
50
|
-
visualizationWidth:
|
|
58
|
+
visualizationWidth: mediaNaturalWidth,
|
|
51
59
|
loopDisplay,
|
|
52
60
|
});
|
|
53
61
|
const shouldRepeatVideo = (0, timeline_utils_1.shouldTileLoopDisplay)(loopDisplay);
|
|
@@ -85,7 +93,9 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
85
93
|
// Trim is applied first, then playbackRate. Each composition frame
|
|
86
94
|
// advances the source video by `playbackRate` source frames.
|
|
87
95
|
const toSeconds = fromSeconds + (visibleDurationInFrames * playbackRate) / fps;
|
|
88
|
-
const targetWidth = shouldRepeatVideo
|
|
96
|
+
const targetWidth = shouldRepeatVideo
|
|
97
|
+
? targetCanvas.width
|
|
98
|
+
: mediaNaturalWidth;
|
|
89
99
|
if (aspectRatio.current !== null) {
|
|
90
100
|
(0, timeline_utils_1.ensureSlots)({
|
|
91
101
|
filledSlots,
|
|
@@ -207,13 +217,20 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
207
217
|
error,
|
|
208
218
|
fps,
|
|
209
219
|
loopDisplay,
|
|
210
|
-
|
|
220
|
+
mediaNaturalWidth,
|
|
221
|
+
mediaVisualizationWidth,
|
|
211
222
|
playbackRate,
|
|
212
223
|
src,
|
|
213
224
|
trimBefore,
|
|
214
|
-
visualizationWidth,
|
|
215
225
|
]);
|
|
216
|
-
const audioWidth =
|
|
226
|
+
const audioWidth = mediaVisualizationWidth;
|
|
227
|
+
const filmstripStyle = (0, react_1.useMemo)(() => {
|
|
228
|
+
return {
|
|
229
|
+
...filmstripContainerStyle,
|
|
230
|
+
width: mediaVisualizationWidth,
|
|
231
|
+
marginLeft: premountWidth,
|
|
232
|
+
};
|
|
233
|
+
}, [mediaVisualizationWidth, premountWidth]);
|
|
217
234
|
const audioStyle = (0, react_1.useMemo)(() => {
|
|
218
235
|
return {
|
|
219
236
|
height: timeline_layout_1.TIMELINE_LAYER_HEIGHT_AUDIO,
|
|
@@ -223,7 +240,7 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
223
240
|
};
|
|
224
241
|
}, [audioWidth, premountWidth]);
|
|
225
242
|
return (jsx_runtime_1.jsxs("div", { style: outerStyle, children: [
|
|
226
|
-
jsx_runtime_1.jsx("div", { ref: ref, style:
|
|
243
|
+
jsx_runtime_1.jsx("div", { ref: ref, style: filmstripStyle }), jsx_runtime_1.jsx("div", { style: audioStyle, children: jsx_runtime_1.jsx(AudioWaveform_1.AudioWaveform, { src: src, visualizationWidth: audioWidth, startFrom: trimBefore, durationInFrames: durationInFrames, volume: volume, doesVolumeChange: doesVolumeChange, playbackRate: playbackRate, loopDisplay: loopDisplay }) })
|
|
227
244
|
] }));
|
|
228
245
|
};
|
|
229
246
|
exports.TimelineVideoInfo = TimelineVideoInfo;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const getTimelineVideoInfoWidths: ({ visualizationWidth, naturalWidth, premountWidth, postmountWidth, }: {
|
|
2
|
+
visualizationWidth: number;
|
|
3
|
+
naturalWidth: number;
|
|
4
|
+
premountWidth: number;
|
|
5
|
+
postmountWidth: number;
|
|
6
|
+
}) => {
|
|
7
|
+
mediaVisualizationWidth: number;
|
|
8
|
+
mediaNaturalWidth: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTimelineVideoInfoWidths = void 0;
|
|
4
|
+
const getTimelineVideoInfoWidths = ({ visualizationWidth, naturalWidth, premountWidth, postmountWidth, }) => {
|
|
5
|
+
const mountWidth = premountWidth + postmountWidth;
|
|
6
|
+
return {
|
|
7
|
+
mediaVisualizationWidth: Math.max(0, visualizationWidth - mountWidth),
|
|
8
|
+
mediaNaturalWidth: Math.max(0, naturalWidth - mountWidth),
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
exports.getTimelineVideoInfoWidths = getTimelineVideoInfoWidths;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
2
2
|
import type { SetCodeValues } from './save-sequence-prop';
|
|
3
|
-
export declare const saveEffectProp: ({ fileName, nodePath, effectIndex, fieldKey, value, defaultValue, schema, setCodeValues, }: {
|
|
3
|
+
export declare const saveEffectProp: ({ fileName, nodePath, effectIndex, fieldKey, value, defaultValue, schema, setCodeValues, clientId, }: {
|
|
4
4
|
fileName: string;
|
|
5
5
|
nodePath: SequencePropsSubscriptionKey;
|
|
6
6
|
effectIndex: number;
|
|
@@ -9,4 +9,5 @@ export declare const saveEffectProp: ({ fileName, nodePath, effectIndex, fieldKe
|
|
|
9
9
|
defaultValue: string | null;
|
|
10
10
|
schema: SequenceSchema;
|
|
11
11
|
setCodeValues: SetCodeValues;
|
|
12
|
+
clientId: string;
|
|
12
13
|
}) => Promise<void>;
|
|
@@ -4,7 +4,7 @@ exports.saveEffectProp = void 0;
|
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const call_api_1 = require("../call-api");
|
|
6
6
|
const save_prop_queue_1 = require("./save-prop-queue");
|
|
7
|
-
const saveEffectProp = ({ fileName, nodePath, effectIndex, fieldKey, value, defaultValue, schema, setCodeValues, }) => {
|
|
7
|
+
const saveEffectProp = ({ fileName, nodePath, effectIndex, fieldKey, value, defaultValue, schema, setCodeValues, clientId, }) => {
|
|
8
8
|
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
9
9
|
nodePath,
|
|
10
10
|
setCodeValues,
|
|
@@ -23,19 +23,8 @@ const saveEffectProp = ({ fileName, nodePath, effectIndex, fieldKey, value, defa
|
|
|
23
23
|
value: JSON.stringify(value),
|
|
24
24
|
defaultValue,
|
|
25
25
|
schema,
|
|
26
|
+
clientId,
|
|
26
27
|
}),
|
|
27
|
-
mergeServerResponse: (prev, data) => {
|
|
28
|
-
if (!prev.canUpdate) {
|
|
29
|
-
return prev;
|
|
30
|
-
}
|
|
31
|
-
const idx = prev.effects.findIndex((e) => e.effectIndex === effectIndex);
|
|
32
|
-
if (idx === -1) {
|
|
33
|
-
return { ...prev, effects: [...prev.effects, data] };
|
|
34
|
-
}
|
|
35
|
-
const nextEffects = [...prev.effects];
|
|
36
|
-
nextEffects[idx] = data;
|
|
37
|
-
return { ...prev, effects: nextEffects };
|
|
38
|
-
},
|
|
39
28
|
errorLabel: 'Could not save effect prop',
|
|
40
29
|
});
|
|
41
30
|
};
|
|
@@ -5,8 +5,7 @@ export type EnqueueSaveOptions<TResponse> = {
|
|
|
5
5
|
setCodeValues: SetCodeValues;
|
|
6
6
|
applyOptimistic: (prev: CanUpdateSequencePropsResponse) => CanUpdateSequencePropsResponse;
|
|
7
7
|
apiCall: () => Promise<TResponse>;
|
|
8
|
-
mergeServerResponse: (prev: CanUpdateSequencePropsResponse, response: TResponse) => CanUpdateSequencePropsResponse;
|
|
9
8
|
errorLabel: string;
|
|
10
9
|
};
|
|
11
|
-
export declare const enqueueSavePropChange: <TResponse>({ nodePath, setCodeValues, applyOptimistic, apiCall,
|
|
10
|
+
export declare const enqueueSavePropChange: <TResponse>({ nodePath, setCodeValues, applyOptimistic, apiCall, errorLabel, }: EnqueueSaveOptions<TResponse>) => Promise<void>;
|
|
12
11
|
export {};
|
|
@@ -8,7 +8,7 @@ const getQueue = (nodePath) => {
|
|
|
8
8
|
const key = remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath);
|
|
9
9
|
let q = queues.get(key);
|
|
10
10
|
if (!q) {
|
|
11
|
-
q = { chain: Promise.resolve(), cancelled: false
|
|
11
|
+
q = { chain: Promise.resolve(), cancelled: false };
|
|
12
12
|
queues.set(key, q);
|
|
13
13
|
}
|
|
14
14
|
return q;
|
|
@@ -19,15 +19,12 @@ const dropQueue = (nodePath, q) => {
|
|
|
19
19
|
queues.delete(key);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
const enqueueSavePropChange = ({ nodePath, setCodeValues, applyOptimistic, apiCall,
|
|
22
|
+
const enqueueSavePropChange = ({ nodePath, setCodeValues, applyOptimistic, apiCall, errorLabel, }) => {
|
|
23
23
|
const q = getQueue(nodePath);
|
|
24
24
|
if (q.cancelled) {
|
|
25
25
|
return Promise.resolve();
|
|
26
26
|
}
|
|
27
27
|
setCodeValues(nodePath, (prev) => {
|
|
28
|
-
if (q.committed === null) {
|
|
29
|
-
q.committed = prev;
|
|
30
|
-
}
|
|
31
28
|
return applyOptimistic(prev);
|
|
32
29
|
});
|
|
33
30
|
const myQueue = q;
|
|
@@ -36,12 +33,10 @@ const enqueueSavePropChange = ({ nodePath, setCodeValues, applyOptimistic, apiCa
|
|
|
36
33
|
return;
|
|
37
34
|
}
|
|
38
35
|
try {
|
|
39
|
-
|
|
36
|
+
await apiCall();
|
|
40
37
|
if (myQueue.cancelled) {
|
|
41
38
|
return;
|
|
42
39
|
}
|
|
43
|
-
setCodeValues(nodePath, (prev) => mergeServerResponse(prev, response));
|
|
44
|
-
myQueue.committed = mergeServerResponse(myQueue.committed, response);
|
|
45
40
|
// If nothing more is queued, reset baseline so the next round starts fresh.
|
|
46
41
|
if (myQueue.chain === next) {
|
|
47
42
|
dropQueue(nodePath, myQueue);
|
|
@@ -49,10 +44,6 @@ const enqueueSavePropChange = ({ nodePath, setCodeValues, applyOptimistic, apiCa
|
|
|
49
44
|
}
|
|
50
45
|
catch (err) {
|
|
51
46
|
myQueue.cancelled = true;
|
|
52
|
-
const { committed } = myQueue;
|
|
53
|
-
if (committed !== null) {
|
|
54
|
-
setCodeValues(nodePath, () => committed);
|
|
55
|
-
}
|
|
56
47
|
dropQueue(nodePath, myQueue);
|
|
57
48
|
(0, NotificationCenter_1.showNotification)(`${errorLabel}: ${err instanceof Error ? err.message : String(err)}`, 4000);
|
|
58
49
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CanUpdateSequencePropsResponse, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
2
2
|
export type SetCodeValues = (nodePath: SequencePropsSubscriptionKey, values: (prev: CanUpdateSequencePropsResponse) => CanUpdateSequencePropsResponse) => void;
|
|
3
|
-
export declare const saveSequenceProp: ({ fileName, nodePath, fieldKey, value, defaultValue, schema, setCodeValues, }: {
|
|
3
|
+
export declare const saveSequenceProp: ({ fileName, nodePath, fieldKey, value, defaultValue, schema, setCodeValues, clientId, }: {
|
|
4
4
|
fileName: string;
|
|
5
5
|
nodePath: SequencePropsSubscriptionKey;
|
|
6
6
|
fieldKey: string;
|
|
@@ -8,4 +8,5 @@ export declare const saveSequenceProp: ({ fileName, nodePath, fieldKey, value, d
|
|
|
8
8
|
defaultValue: string | null;
|
|
9
9
|
schema: SequenceSchema;
|
|
10
10
|
setCodeValues: SetCodeValues;
|
|
11
|
+
clientId: string;
|
|
11
12
|
}) => Promise<void>;
|
|
@@ -4,7 +4,7 @@ exports.saveSequenceProp = void 0;
|
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const call_api_1 = require("../call-api");
|
|
6
6
|
const save_prop_queue_1 = require("./save-prop-queue");
|
|
7
|
-
const saveSequenceProp = ({ fileName, nodePath, fieldKey, value, defaultValue, schema, setCodeValues, }) => {
|
|
7
|
+
const saveSequenceProp = ({ fileName, nodePath, fieldKey, value, defaultValue, schema, setCodeValues, clientId, }) => {
|
|
8
8
|
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
9
9
|
nodePath,
|
|
10
10
|
setCodeValues,
|
|
@@ -21,17 +21,8 @@ const saveSequenceProp = ({ fileName, nodePath, fieldKey, value, defaultValue, s
|
|
|
21
21
|
value: JSON.stringify(value),
|
|
22
22
|
defaultValue,
|
|
23
23
|
schema,
|
|
24
|
+
clientId,
|
|
24
25
|
}),
|
|
25
|
-
mergeServerResponse: (prev, data) => {
|
|
26
|
-
if (!data.canUpdate) {
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
canUpdate: true,
|
|
31
|
-
props: data.props,
|
|
32
|
-
effects: prev.canUpdate ? prev.effects : [],
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
26
|
errorLabel: 'Could not save sequence prop',
|
|
36
27
|
});
|
|
37
28
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shouldShowTrackInTimeline = void 0;
|
|
4
|
+
// A track is shown in the timeline list when:
|
|
5
|
+
// - The sequence opted-in via `showInTimeline` (the default).
|
|
6
|
+
// Children of a sequence with `showInTimeline: false` keep being listed
|
|
7
|
+
// on their own; their depth is independently flattened by
|
|
8
|
+
// `getTimelineNestedLevel` so the parent does not contribute an indent.
|
|
9
|
+
// - The sequence has a positive duration.
|
|
10
|
+
// - The sequence starts before the composition ends.
|
|
11
|
+
const shouldShowTrackInTimeline = (track, durationInFrames) => {
|
|
12
|
+
if (!track.sequence.showInTimeline) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (track.sequence.duration <= 0) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
if (track.sequence.from > durationInFrames) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
};
|
|
23
|
+
exports.shouldShowTrackInTimeline = shouldShowTrackInTimeline;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTimelineFieldLabelRowStyle = void 0;
|
|
4
|
+
const timeline_row_layout_1 = require("./timeline-row-layout");
|
|
5
|
+
const getTimelineFieldLabelRowStyle = (depth) => {
|
|
6
|
+
return {
|
|
7
|
+
flex: `0 0 ${(0, timeline_row_layout_1.getTimelineFieldLabelFlexBasis)(depth)}`,
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexDirection: 'row',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
gap: 6,
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
exports.getTimelineFieldLabelRowStyle = getTimelineFieldLabelRowStyle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TIMELINE_INDENT = 10;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const TIMELINE_ROW_BASE_PADDING = 5;
|
|
2
|
+
export declare const TIMELINE_EYE_COLUMN_WIDTH = 22;
|
|
3
|
+
export declare const TIMELINE_ARROW_COLUMN_WIDTH = 16;
|
|
4
|
+
export declare const TIMELINE_FIELD_LABEL_EXTRA_WIDTH = 15;
|
|
5
|
+
export declare const getTimelineRowIndentWidth: (depth: number) => number;
|
|
6
|
+
export declare const getTimelineRowLeftChromeWidth: (depth: number) => number;
|
|
7
|
+
export declare const getTimelineFieldLabelFlexBasis: (depth: number) => string;
|
|
8
|
+
export declare const getExpandedRowDepth: ({ nestedDepth, treeDepth, }: {
|
|
9
|
+
nestedDepth: number;
|
|
10
|
+
treeDepth: number;
|
|
11
|
+
}) => number;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExpandedRowDepth = exports.getTimelineFieldLabelFlexBasis = exports.getTimelineRowLeftChromeWidth = exports.getTimelineRowIndentWidth = exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH = exports.TIMELINE_ARROW_COLUMN_WIDTH = exports.TIMELINE_EYE_COLUMN_WIDTH = exports.TIMELINE_ROW_BASE_PADDING = void 0;
|
|
4
|
+
const timeline_indent_1 = require("./timeline-indent");
|
|
5
|
+
exports.TIMELINE_ROW_BASE_PADDING = 5;
|
|
6
|
+
exports.TIMELINE_EYE_COLUMN_WIDTH = 22;
|
|
7
|
+
exports.TIMELINE_ARROW_COLUMN_WIDTH = 16;
|
|
8
|
+
exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH = 15;
|
|
9
|
+
const getTimelineRowIndentWidth = (depth) => {
|
|
10
|
+
return depth * timeline_indent_1.TIMELINE_INDENT;
|
|
11
|
+
};
|
|
12
|
+
exports.getTimelineRowIndentWidth = getTimelineRowIndentWidth;
|
|
13
|
+
const getTimelineRowLeftChromeWidth = (depth) => {
|
|
14
|
+
return (exports.TIMELINE_ROW_BASE_PADDING +
|
|
15
|
+
exports.TIMELINE_EYE_COLUMN_WIDTH +
|
|
16
|
+
(0, exports.getTimelineRowIndentWidth)(depth) +
|
|
17
|
+
exports.TIMELINE_ARROW_COLUMN_WIDTH);
|
|
18
|
+
};
|
|
19
|
+
exports.getTimelineRowLeftChromeWidth = getTimelineRowLeftChromeWidth;
|
|
20
|
+
const getTimelineFieldLabelFlexBasis = (depth) => {
|
|
21
|
+
return `calc(50% - ${(0, exports.getTimelineRowLeftChromeWidth)(depth) - exports.TIMELINE_FIELD_LABEL_EXTRA_WIDTH}px)`;
|
|
22
|
+
};
|
|
23
|
+
exports.getTimelineFieldLabelFlexBasis = getTimelineFieldLabelFlexBasis;
|
|
24
|
+
const getExpandedRowDepth = ({ nestedDepth, treeDepth, }) => {
|
|
25
|
+
return nestedDepth + 1 + treeDepth;
|
|
26
|
+
};
|
|
27
|
+
exports.getExpandedRowDepth = getExpandedRowDepth;
|