@remotion/studio 4.0.459 → 4.0.461
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/Studio.d.ts +0 -1
- package/dist/Studio.js +4 -4
- package/dist/components/AudioWaveform.js +21 -13
- package/dist/components/Checkbox.d.ts +7 -0
- package/dist/components/Checkbox.js +38 -24
- package/dist/components/Editor.js +10 -9
- package/dist/components/ExpandedTracksProvider.d.ts +9 -4
- package/dist/components/ExpandedTracksProvider.js +45 -15
- package/dist/components/MenuBuildIndicator.js +1 -2
- package/dist/components/MenuCompositionName.js +1 -0
- package/dist/components/NewComposition/ComboBox.d.ts +1 -0
- package/dist/components/NewComposition/ComboBox.js +14 -5
- package/dist/components/RenderButton.js +1 -1
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +3 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +26 -0
- package/dist/components/Timeline/SequencePropsObserver.d.ts +1 -0
- package/dist/components/Timeline/SequencePropsObserver.js +24 -0
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +7 -0
- package/dist/components/Timeline/SubscribeToNodePaths.js +15 -0
- package/dist/components/Timeline/Timeline.js +30 -49
- package/dist/components/Timeline/TimelineBooleanField.d.ts +4 -4
- package/dist/components/Timeline/TimelineBooleanField.js +5 -5
- package/dist/components/Timeline/TimelineDragHandler.js +37 -3
- package/dist/components/Timeline/TimelineEnumField.d.ts +5 -5
- package/dist/components/Timeline/TimelineEnumField.js +23 -15
- package/dist/components/Timeline/TimelineExpandArrowButton.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandArrowButton.js +5 -3
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +6 -6
- package/dist/components/Timeline/TimelineExpandedRow.js +4 -5
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +2 -2
- package/dist/components/Timeline/TimelineExpandedSection.js +20 -9
- package/dist/components/Timeline/TimelineFieldRow.d.ts +2 -3
- package/dist/components/Timeline/TimelineFieldRow.js +66 -30
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +7 -0
- package/dist/components/Timeline/TimelineHeightContainer.js +51 -0
- package/dist/components/Timeline/TimelineList.js +1 -1
- package/dist/components/Timeline/TimelineListItem.d.ts +2 -0
- package/dist/components/Timeline/TimelineListItem.js +33 -18
- package/dist/components/Timeline/TimelineNumberField.d.ts +5 -5
- package/dist/components/Timeline/TimelineNumberField.js +12 -10
- package/dist/components/Timeline/TimelineRotationField.d.ts +5 -5
- package/dist/components/Timeline/TimelineRotationField.js +10 -10
- package/dist/components/Timeline/TimelineSchemaField.d.ts +4 -6
- package/dist/components/Timeline/TimelineSchemaField.js +11 -11
- package/dist/components/Timeline/TimelineSequence.js +2 -2
- package/dist/components/Timeline/TimelineSlider.js +2 -2
- package/dist/components/Timeline/TimelineStack/get-stack.js +17 -31
- package/dist/components/Timeline/TimelineStack/index.js +0 -10
- package/dist/components/Timeline/TimelineTimeIndicators.js +2 -2
- package/dist/components/Timeline/TimelineTracks.d.ts +1 -1
- package/dist/components/Timeline/TimelineTracks.js +53 -12
- package/dist/components/Timeline/TimelineTranslateField.d.ts +5 -5
- package/dist/components/Timeline/TimelineTranslateField.js +19 -37
- package/dist/components/Timeline/TimelineVideoInfo.js +25 -140
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +10 -13
- package/dist/components/Timeline/sequence-props-subscription-store.js +56 -123
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +6 -6
- package/dist/components/Timeline/use-sequence-props-subscription.js +25 -55
- package/dist/components/Timeline/use-timeline-height.d.ts +5 -0
- package/dist/components/Timeline/use-timeline-height.js +39 -0
- package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts +3 -3
- package/dist/error-overlay/react-overlay/utils/get-source-map.js +5 -5
- package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +0 -6
- package/dist/error-overlay/react-overlay/utils/unmapper.js +8 -1
- package/dist/esm/{chunk-0njpenna.js → chunk-yzh34sp0.js} +3026 -3446
- package/dist/esm/internals.mjs +3026 -3446
- package/dist/esm/previewEntry.mjs +3028 -3449
- package/dist/esm/renderEntry.mjs +2 -5
- package/dist/helpers/calculate-timeline.d.ts +3 -2
- package/dist/helpers/calculate-timeline.js +43 -2
- package/dist/helpers/get-timeline-sequence-layout.js +3 -3
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +7 -1
- package/dist/helpers/timeline-layout.d.ts +19 -9
- package/dist/helpers/timeline-layout.js +50 -20
- package/dist/icons/Checkmark.d.ts +4 -1
- package/dist/icons/Checkmark.js +1 -5
- package/dist/icons/caret.d.ts +3 -1
- package/dist/icons/caret.js +5 -2
- package/dist/internals.d.ts +0 -1
- package/dist/previewEntry.js +1 -1
- package/dist/renderEntry.js +3 -3
- package/package.json +13 -21
- package/dist/audio-waveform-worker.d.ts +0 -1
- package/dist/audio-waveform-worker.js +0 -102
- package/dist/components/audio-waveform-worker-types.d.ts +0 -28
- package/dist/components/audio-waveform-worker-types.js +0 -2
- package/dist/components/draw-peaks.d.ts +0 -1
- package/dist/components/draw-peaks.js +0 -68
- package/dist/components/load-waveform-peaks.d.ts +0 -13
- package/dist/components/load-waveform-peaks.js +0 -76
- package/dist/components/looped-media-timeline.d.ts +0 -6
- package/dist/components/looped-media-timeline.js +0 -14
- package/dist/components/parse-color.d.ts +0 -1
- package/dist/components/parse-color.js +0 -17
- package/dist/components/slice-waveform-peaks.d.ts +0 -7
- package/dist/components/slice-waveform-peaks.js +0 -15
- package/dist/components/waveform-peak-processor.d.ts +0 -23
- package/dist/components/waveform-peak-processor.js +0 -77
- package/dist/esm/audio-waveform-worker.mjs +0 -354
- package/dist/helpers/extract-frames.d.ts +0 -18
- package/dist/helpers/extract-frames.js +0 -87
- package/dist/helpers/frame-database.d.ts +0 -16
- package/dist/helpers/frame-database.js +0 -65
- package/dist/helpers/resize-video-frame.d.ts +0 -4
- package/dist/helpers/resize-video-frame.js +0 -39
- package/dist/make-audio-waveform-worker.d.ts +0 -1
- package/dist/make-audio-waveform-worker.js +0 -10
package/dist/Studio.d.ts
CHANGED
package/dist/Studio.js
CHANGED
|
@@ -15,17 +15,17 @@ const ResolveCompositionConfigInStudio_1 = require("./ResolveCompositionConfigIn
|
|
|
15
15
|
const getServerDisconnectedDomElement = () => {
|
|
16
16
|
return document.getElementById('server-disconnected-overlay');
|
|
17
17
|
};
|
|
18
|
-
const StudioInner = ({ rootComponent, readOnly
|
|
18
|
+
const StudioInner = ({ rootComponent, readOnly }) => {
|
|
19
19
|
var _a, _b;
|
|
20
|
-
return (jsx_runtime_1.jsx(remotion_1.Internals.CompositionManagerProvider, { onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], initialCanvasContent: null, children: jsx_runtime_1.jsx(remotion_1.Internals.RemotionRootContexts, {
|
|
20
|
+
return (jsx_runtime_1.jsx(remotion_1.Internals.CompositionManagerProvider, { onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], initialCanvasContent: null, children: jsx_runtime_1.jsx(remotion_1.Internals.RemotionRootContexts, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: (_a = window.remotion_logLevel) !== null && _a !== void 0 ? _a : 'info', numberOfAudioTags: window.remotion_numberOfAudioTags, audioLatencyHint: (_b = window.remotion_audioLatencyHint) !== null && _b !== void 0 ? _b : 'playback', children: jsx_runtime_1.jsx(use_static_files_1.StaticFilesProvider, { children: jsx_runtime_1.jsx(ResolveCompositionConfigInStudio_1.ResolveCompositionConfigInStudio, { children: jsx_runtime_1.jsxs(EditorContexts_1.EditorContexts, { readOnlyStudio: readOnly, children: [
|
|
21
21
|
jsx_runtime_1.jsx(Editor_1.Editor, { readOnlyStudio: readOnly, Root: rootComponent }), readOnly
|
|
22
22
|
? null
|
|
23
23
|
: (0, react_dom_1.createPortal)(jsx_runtime_1.jsx(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement())] }) }) }) }) }));
|
|
24
24
|
};
|
|
25
|
-
const Studio = ({ rootComponent, readOnly
|
|
25
|
+
const Studio = ({ rootComponent, readOnly }) => {
|
|
26
26
|
(0, react_1.useLayoutEffect)(() => {
|
|
27
27
|
(0, inject_css_1.injectCSS)();
|
|
28
28
|
}, []);
|
|
29
|
-
return (jsx_runtime_1.jsx(FastRefreshProvider_1.FastRefreshProvider, { children: jsx_runtime_1.jsx(StudioInner, { rootComponent: rootComponent, readOnly: readOnly
|
|
29
|
+
return (jsx_runtime_1.jsx(FastRefreshProvider_1.FastRefreshProvider, { children: jsx_runtime_1.jsx(StudioInner, { rootComponent: rootComponent, readOnly: readOnly }) }));
|
|
30
30
|
};
|
|
31
31
|
exports.Studio = Studio;
|
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AudioWaveform = 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 remotion_1 = require("remotion");
|
|
7
8
|
const colors_1 = require("../helpers/colors");
|
|
8
9
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
9
|
-
const make_audio_waveform_worker_1 = require("../make-audio-waveform-worker");
|
|
10
|
-
const draw_peaks_1 = require("./draw-peaks");
|
|
11
|
-
const load_waveform_peaks_1 = require("./load-waveform-peaks");
|
|
12
|
-
const looped_media_timeline_1 = require("./looped-media-timeline");
|
|
13
|
-
const slice_waveform_peaks_1 = require("./slice-waveform-peaks");
|
|
14
10
|
const EMPTY_PEAKS = new Float32Array(0);
|
|
15
11
|
// Recreate the canvas after Fast Refresh because an already transferred canvas
|
|
16
12
|
// cannot be handed to OffscreenCanvas again.
|
|
@@ -56,7 +52,13 @@ const drawLoopedWaveform = ({ canvas, peaks, volume, visualizationWidth, loopWid
|
|
|
56
52
|
const targetCanvas = document.createElement('canvas');
|
|
57
53
|
targetCanvas.width = Math.max(1, Math.ceil(loopWidth));
|
|
58
54
|
targetCanvas.height = h;
|
|
59
|
-
(0,
|
|
55
|
+
(0, timeline_utils_1.drawBars)({
|
|
56
|
+
canvas: targetCanvas,
|
|
57
|
+
peaks,
|
|
58
|
+
color: 'rgba(255, 255, 255, 0.6)',
|
|
59
|
+
volume,
|
|
60
|
+
width: targetCanvas.width,
|
|
61
|
+
});
|
|
60
62
|
canvas.width = w;
|
|
61
63
|
canvas.height = h;
|
|
62
64
|
const ctx = canvas.getContext('2d');
|
|
@@ -94,7 +96,7 @@ const AudioWaveform = ({ src, startFrom, durationInFrames, visualizationWidth, v
|
|
|
94
96
|
const controller = new AbortController();
|
|
95
97
|
setPeaks(null);
|
|
96
98
|
setError(null);
|
|
97
|
-
(0,
|
|
99
|
+
(0, timeline_utils_1.loadWaveformPeaks)(src, controller.signal)
|
|
98
100
|
.then((p) => {
|
|
99
101
|
if (!controller.signal.aborted) {
|
|
100
102
|
setPeaks(p);
|
|
@@ -115,7 +117,7 @@ const AudioWaveform = ({ src, startFrom, durationInFrames, visualizationWidth, v
|
|
|
115
117
|
if (!canvasElement || hasTransferredCanvas.current) {
|
|
116
118
|
return;
|
|
117
119
|
}
|
|
118
|
-
const worker = (0,
|
|
120
|
+
const worker = (0, timeline_utils_1.makeAudioWaveformWorker)();
|
|
119
121
|
waveformWorker.current = worker;
|
|
120
122
|
worker.addEventListener('message', (event) => {
|
|
121
123
|
if (event.data.type === 'error') {
|
|
@@ -151,8 +153,8 @@ const AudioWaveform = ({ src, startFrom, durationInFrames, visualizationWidth, v
|
|
|
151
153
|
if (canUseWorkerPath || !peaks) {
|
|
152
154
|
return null;
|
|
153
155
|
}
|
|
154
|
-
return (0,
|
|
155
|
-
durationInFrames: (0,
|
|
156
|
+
return (0, timeline_utils_1.sliceWaveformPeaks)({
|
|
157
|
+
durationInFrames: (0, timeline_utils_1.shouldTileLoopDisplay)(loopDisplay)
|
|
156
158
|
? loopDisplay.durationInFrames
|
|
157
159
|
: durationInFrames,
|
|
158
160
|
fps: vidConf.fps,
|
|
@@ -203,20 +205,26 @@ const AudioWaveform = ({ src, startFrom, durationInFrames, visualizationWidth, v
|
|
|
203
205
|
}
|
|
204
206
|
canvasElement.width = w;
|
|
205
207
|
canvasElement.height = h;
|
|
206
|
-
if ((0,
|
|
208
|
+
if ((0, timeline_utils_1.shouldTileLoopDisplay)(loopDisplay)) {
|
|
207
209
|
drawLoopedWaveform({
|
|
208
210
|
canvas: canvasElement,
|
|
209
211
|
peaks: portionPeaks !== null && portionPeaks !== void 0 ? portionPeaks : EMPTY_PEAKS,
|
|
210
212
|
volume: vol,
|
|
211
213
|
visualizationWidth,
|
|
212
|
-
loopWidth: (0,
|
|
214
|
+
loopWidth: (0, timeline_utils_1.getLoopDisplayWidth)({
|
|
213
215
|
visualizationWidth,
|
|
214
216
|
loopDisplay,
|
|
215
217
|
}),
|
|
216
218
|
});
|
|
217
219
|
}
|
|
218
220
|
else {
|
|
219
|
-
(0,
|
|
221
|
+
(0, timeline_utils_1.drawBars)({
|
|
222
|
+
canvas: canvasElement,
|
|
223
|
+
peaks: portionPeaks !== null && portionPeaks !== void 0 ? portionPeaks : EMPTY_PEAKS,
|
|
224
|
+
color: 'rgba(255, 255, 255, 0.6)',
|
|
225
|
+
volume: vol,
|
|
226
|
+
width: w,
|
|
227
|
+
});
|
|
220
228
|
}
|
|
221
229
|
}, [
|
|
222
230
|
canUseWorkerPath,
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
declare const SIZES: {
|
|
3
|
+
readonly default: 20;
|
|
4
|
+
readonly small: 18;
|
|
5
|
+
};
|
|
6
|
+
export type CheckboxVariant = keyof typeof SIZES;
|
|
2
7
|
export declare const Checkbox: React.FC<{
|
|
3
8
|
readonly checked: boolean;
|
|
4
9
|
readonly onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
5
10
|
readonly name: string;
|
|
6
11
|
readonly rounded?: boolean;
|
|
7
12
|
readonly disabled?: boolean;
|
|
13
|
+
readonly variant?: CheckboxVariant;
|
|
8
14
|
}>;
|
|
15
|
+
export {};
|
|
@@ -5,32 +5,46 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const Checkmark_1 = require("../icons/Checkmark");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
width: size,
|
|
12
|
-
position: 'relative',
|
|
8
|
+
const SIZES = {
|
|
9
|
+
default: 20,
|
|
10
|
+
small: 18,
|
|
13
11
|
};
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
backgroundColor: colors_1.LIGHT_TEXT,
|
|
18
|
-
borderRadius: '50%',
|
|
12
|
+
const BULLET_SIZES = {
|
|
13
|
+
default: 10,
|
|
14
|
+
small: 9,
|
|
19
15
|
};
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
alignItems: 'center',
|
|
24
|
-
position: 'absolute',
|
|
25
|
-
height: size,
|
|
26
|
-
width: size,
|
|
27
|
-
top: 0,
|
|
28
|
-
left: 0,
|
|
29
|
-
pointerEvents: 'none',
|
|
30
|
-
color: 'white',
|
|
16
|
+
const CHECKMARK_SIZES = {
|
|
17
|
+
default: 14,
|
|
18
|
+
small: 13,
|
|
31
19
|
};
|
|
32
|
-
const Checkbox = ({ checked, onChange, disabled, name, rounded }) => {
|
|
20
|
+
const Checkbox = ({ checked, onChange, disabled, name, rounded, variant = 'default' }) => {
|
|
33
21
|
const ref = (0, react_1.useRef)(null);
|
|
22
|
+
const size = SIZES[variant];
|
|
23
|
+
const bulletSize = BULLET_SIZES[variant];
|
|
24
|
+
const checkmarkSize = CHECKMARK_SIZES[variant];
|
|
25
|
+
const background = (0, react_1.useMemo)(() => ({
|
|
26
|
+
height: size,
|
|
27
|
+
width: size,
|
|
28
|
+
position: 'relative',
|
|
29
|
+
}), [size]);
|
|
30
|
+
const bullet = (0, react_1.useMemo)(() => ({
|
|
31
|
+
width: bulletSize,
|
|
32
|
+
height: bulletSize,
|
|
33
|
+
backgroundColor: colors_1.LIGHT_TEXT,
|
|
34
|
+
borderRadius: '50%',
|
|
35
|
+
}), [bulletSize]);
|
|
36
|
+
const box = (0, react_1.useMemo)(() => ({
|
|
37
|
+
display: 'flex',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
height: size,
|
|
42
|
+
width: size,
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
pointerEvents: 'none',
|
|
46
|
+
color: 'white',
|
|
47
|
+
}), [size]);
|
|
34
48
|
const input = (0, react_1.useMemo)(() => {
|
|
35
49
|
return {
|
|
36
50
|
appearance: 'none',
|
|
@@ -43,14 +57,14 @@ const Checkbox = ({ checked, onChange, disabled, name, rounded }) => {
|
|
|
43
57
|
position: 'absolute',
|
|
44
58
|
margin: 0,
|
|
45
59
|
};
|
|
46
|
-
}, [disabled]);
|
|
60
|
+
}, [disabled, size]);
|
|
47
61
|
(0, react_1.useEffect)(() => {
|
|
48
62
|
if (ref.current) {
|
|
49
63
|
ref.current.style.setProperty('border-radius', rounded ? '50%' : '0%', 'important');
|
|
50
64
|
}
|
|
51
65
|
}, [rounded]);
|
|
52
66
|
return (jsx_runtime_1.jsxs("div", { style: background, children: [
|
|
53
|
-
jsx_runtime_1.jsx("input", { ref: ref, style: input, type: 'checkbox', checked: checked, onChange: onChange, disabled: disabled, name: name }), jsx_runtime_1.jsx("div", { style: box, children: checked ? rounded ? jsx_runtime_1.jsx("div", { style: bullet }) : jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null })
|
|
67
|
+
jsx_runtime_1.jsx("input", { ref: ref, style: input, type: 'checkbox', checked: checked, onChange: onChange, disabled: disabled, name: name }), jsx_runtime_1.jsx("div", { style: box, children: checked ? (rounded ? (jsx_runtime_1.jsx("div", { style: bullet })) : (jsx_runtime_1.jsx(Checkmark_1.Checkmark, { size: checkmarkSize }))) : null })
|
|
54
68
|
] }));
|
|
55
69
|
};
|
|
56
70
|
exports.Checkbox = Checkbox;
|
|
@@ -49,6 +49,7 @@ const GlobalKeybindings_1 = require("./GlobalKeybindings");
|
|
|
49
49
|
const Modals_1 = require("./Modals");
|
|
50
50
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
51
51
|
const RenderErrorContext_1 = require("./RenderErrorContext");
|
|
52
|
+
const SequencePropsSubscriptionProvider_1 = require("./SequencePropsSubscriptionProvider");
|
|
52
53
|
const TopPanel_1 = require("./TopPanel");
|
|
53
54
|
const background = {
|
|
54
55
|
backgroundColor: colors_1.BACKGROUND,
|
|
@@ -90,14 +91,14 @@ const Editor = ({ Root, readOnlyStudio }) => {
|
|
|
90
91
|
}, []);
|
|
91
92
|
const compositionRenderErrorContextValue = (0, react_1.useMemo)(() => ({ setError: setRenderError, clearError }), [clearError]);
|
|
92
93
|
const renderErrorContextValue = (0, react_1.useMemo)(() => ({ error: renderError }), [renderError]);
|
|
93
|
-
return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: jsx_runtime_1.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(timeline_zoom_1.TimelineZoomContext, { children: jsx_runtime_1.jsxs(SequencePropsSubscriptionProvider_1.SequencePropsSubscriptionProvider, { children: [
|
|
95
|
+
jsx_runtime_1.jsxs(remotion_1.Internals.CurrentScaleContext.Provider, { value: value, children: [
|
|
96
|
+
jsx_runtime_1.jsx(ForceSpecificCursor_1.ForceSpecificCursor, {}), jsx_runtime_1.jsxs("div", { style: background, children: [
|
|
97
|
+
jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsxs(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [
|
|
98
|
+
jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: canvas_ref_1.drawRef, bufferStateDelayInMilliseconds: exports.BUFFER_STATE_DELAY_IN_MILLISECONDS, onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }), jsx_runtime_1.jsx(GlobalKeybindings_1.GlobalKeybindings, {})
|
|
99
|
+
] })
|
|
100
|
+
] })
|
|
101
|
+
] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
|
|
102
|
+
] }) }) }));
|
|
102
103
|
};
|
|
103
104
|
exports.Editor = Editor;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { SequenceNodePathInfo } from '../helpers/get-timeline-sequence-sort-key';
|
|
3
|
+
export type GetIsExpanded = (nodePathInfo: SequenceNodePathInfo) => boolean;
|
|
4
|
+
type ExpandedTracksGetterContextValue = {
|
|
5
|
+
readonly getIsExpanded: GetIsExpanded;
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
+
type ExpandedTracksSetterContextValue = {
|
|
8
|
+
readonly toggleTrack: (nodePathInfo: SequenceNodePathInfo) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const ExpandedTracksGetterContext: React.Context<ExpandedTracksGetterContextValue>;
|
|
11
|
+
export declare const ExpandedTracksSetterContext: React.Context<ExpandedTracksSetterContextValue>;
|
|
7
12
|
export declare const ExpandedTracksProvider: React.FC<{
|
|
8
13
|
readonly children: React.ReactNode;
|
|
9
14
|
}>;
|
|
@@ -1,26 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExpandedTracksProvider = exports.
|
|
3
|
+
exports.ExpandedTracksProvider = exports.ExpandedTracksSetterContext = exports.ExpandedTracksGetterContext = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const nodePathInfoToKey = (info) => JSON.stringify([info.nodePath, info.index]);
|
|
7
|
+
const LOCAL_STORAGE_KEY = 'remotion.editor.expandedTracks';
|
|
8
|
+
const loadExpandedTracks = () => {
|
|
9
|
+
if (typeof window === 'undefined') {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
const item = window.localStorage.getItem(LOCAL_STORAGE_KEY);
|
|
13
|
+
if (item === null) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
const parsed = JSON.parse(item);
|
|
18
|
+
if (parsed && typeof parsed === 'object') {
|
|
19
|
+
return parsed;
|
|
20
|
+
}
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
catch (_a) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.ExpandedTracksGetterContext = (0, react_1.createContext)({
|
|
28
|
+
getIsExpanded: () => {
|
|
29
|
+
throw new Error('ExpandedTracksGetterContext not initialized');
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
exports.ExpandedTracksSetterContext = (0, react_1.createContext)({
|
|
8
33
|
toggleTrack: () => {
|
|
9
|
-
throw new Error('
|
|
34
|
+
throw new Error('ExpandedTracksSetterContext not initialized');
|
|
10
35
|
},
|
|
11
36
|
});
|
|
12
37
|
const ExpandedTracksProvider = ({ children }) => {
|
|
13
|
-
const [expandedTracks, setExpandedTracks] = (0, react_1.useState)(
|
|
14
|
-
const toggleTrack = (0, react_1.useCallback)((
|
|
15
|
-
setExpandedTracks((prev) =>
|
|
16
|
-
|
|
17
|
-
[
|
|
18
|
-
|
|
38
|
+
const [expandedTracks, setExpandedTracks] = (0, react_1.useState)(loadExpandedTracks);
|
|
39
|
+
const toggleTrack = (0, react_1.useCallback)((nodePathInfo) => {
|
|
40
|
+
setExpandedTracks((prev) => {
|
|
41
|
+
const key = nodePathInfoToKey(nodePathInfo);
|
|
42
|
+
const next = { ...prev, [key]: !prev[key] };
|
|
43
|
+
window.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(next));
|
|
44
|
+
return next;
|
|
45
|
+
});
|
|
19
46
|
}, []);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
47
|
+
const getterValue = (0, react_1.useMemo)(() => ({
|
|
48
|
+
getIsExpanded: (nodePathInfo) => {
|
|
49
|
+
var _a;
|
|
50
|
+
return (_a = expandedTracks[nodePathInfoToKey(nodePathInfo)]) !== null && _a !== void 0 ? _a : false;
|
|
51
|
+
},
|
|
52
|
+
}), [expandedTracks]);
|
|
53
|
+
const setterValue = (0, react_1.useMemo)(() => ({ toggleTrack }), [toggleTrack]);
|
|
54
|
+
return (jsx_runtime_1.jsx(exports.ExpandedTracksSetterContext.Provider, { value: setterValue, children: jsx_runtime_1.jsx(exports.ExpandedTracksGetterContext.Provider, { value: getterValue, children: children }) }));
|
|
25
55
|
};
|
|
26
56
|
exports.ExpandedTracksProvider = ExpandedTracksProvider;
|
|
@@ -22,7 +22,6 @@ const spinnerSize = 14;
|
|
|
22
22
|
const spinner = {
|
|
23
23
|
position: 'relative',
|
|
24
24
|
width: spinnerSize,
|
|
25
|
-
marginTop: 4,
|
|
26
25
|
};
|
|
27
26
|
const noSpinner = {
|
|
28
27
|
position: 'relative',
|
|
@@ -95,7 +94,7 @@ const MenuBuildIndicator = () => {
|
|
|
95
94
|
window.remotion_finishedBuilding = undefined;
|
|
96
95
|
};
|
|
97
96
|
}, []);
|
|
98
|
-
return (jsx_runtime_1.jsxs("div", { style: cwd, title: window.remotion_cwd, children: [isClickable ? jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }) : null, isBuilding ? (jsx_runtime_1.jsx("div", { style: spinner, children: jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize }) })) : (jsx_runtime_1.jsx("div", { style: noSpinner })),
|
|
97
|
+
return (jsx_runtime_1.jsxs("div", { style: cwd, title: window.remotion_cwd, children: [isClickable ? jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }) : null, isBuilding ? (jsx_runtime_1.jsx("div", { style: spinner, children: jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: spinnerSize }) })) : (jsx_runtime_1.jsx("div", { style: noSpinner })), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), isClickable ? (jsx_runtime_1.jsx("a", { style: projectNameHovered ? projectNameLinkHovered : projectNameLink, title: projectNameTitle, onClick: handleProjectNameClick, onPointerEnter: () => setProjectNameHovered(true), onPointerLeave: () => setProjectNameHovered(false), children: window.remotion_projectName })) : (window.remotion_projectName), jsx_runtime_1.jsx(MenuCompositionName_1.MenuCompositionName, {})
|
|
99
98
|
] }));
|
|
100
99
|
};
|
|
101
100
|
exports.MenuBuildIndicator = MenuBuildIndicator;
|
|
@@ -26,6 +26,10 @@ const container = {
|
|
|
26
26
|
borderStyle: 'solid',
|
|
27
27
|
maxWidth: '100%',
|
|
28
28
|
};
|
|
29
|
+
const smallContainer = {
|
|
30
|
+
...container,
|
|
31
|
+
padding: '3px 4px',
|
|
32
|
+
};
|
|
29
33
|
const label = {
|
|
30
34
|
flex: 1,
|
|
31
35
|
overflow: 'hidden',
|
|
@@ -33,7 +37,12 @@ const label = {
|
|
|
33
37
|
fontSize: 14,
|
|
34
38
|
textAlign: 'left',
|
|
35
39
|
};
|
|
36
|
-
const
|
|
40
|
+
const smallLabel = {
|
|
41
|
+
...label,
|
|
42
|
+
fontSize: 11,
|
|
43
|
+
lineHeight: 1,
|
|
44
|
+
};
|
|
45
|
+
const Combobox = ({ values, selectedId, style: customStyle, title, small = false }) => {
|
|
37
46
|
const [hovered, setIsHovered] = (0, react_1.useState)(false);
|
|
38
47
|
const [opened, setOpened] = (0, react_1.useState)(false);
|
|
39
48
|
const ref = (0, react_1.useRef)(null);
|
|
@@ -147,7 +156,7 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
|
147
156
|
const selected = values.find((v) => v.id === selectedId);
|
|
148
157
|
const style = (0, react_1.useMemo)(() => {
|
|
149
158
|
return {
|
|
150
|
-
...container,
|
|
159
|
+
...(small ? smallContainer : container),
|
|
151
160
|
...(customStyle !== null && customStyle !== void 0 ? customStyle : {}),
|
|
152
161
|
userSelect: 'none',
|
|
153
162
|
WebkitUserSelect: 'none',
|
|
@@ -161,11 +170,11 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
|
|
|
161
170
|
? colors_1.INPUT_BORDER_COLOR_HOVERED
|
|
162
171
|
: colors_1.INPUT_BORDER_COLOR_UNHOVERED,
|
|
163
172
|
};
|
|
164
|
-
}, [customStyle, hovered, opened]);
|
|
173
|
+
}, [customStyle, hovered, opened, small]);
|
|
165
174
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
166
|
-
jsx_runtime_1.jsxs("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: label, children: selected === null || selected === void 0 ? void 0 : selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }),
|
|
175
|
+
jsx_runtime_1.jsxs("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected ? (jsx_runtime_1.jsx("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: small ? smallLabel : label, children: selected === null || selected === void 0 ? void 0 : selected.label })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: small ? 0.5 : 1 }),
|
|
167
176
|
" ",
|
|
168
|
-
jsx_runtime_1.jsx(caret_1.CaretDown, {})
|
|
177
|
+
jsx_runtime_1.jsx(caret_1.CaretDown, { small: small })
|
|
169
178
|
] }), portalStyle
|
|
170
179
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((v) => selected && v.id === selected.id), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
171
180
|
: null] }));
|
|
@@ -166,7 +166,7 @@ const RenderButton = ({ readOnlyStudio, }) => {
|
|
|
166
166
|
};
|
|
167
167
|
}, []);
|
|
168
168
|
const video = remotion_1.Internals.useVideo();
|
|
169
|
-
const getCurrentFrame = player_1.PlayerInternals.
|
|
169
|
+
const { getCurrentFrame } = player_1.PlayerInternals.usePlayer();
|
|
170
170
|
const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
171
171
|
const openServerRenderModal = (0, react_1.useCallback)((copyCommandOnly) => {
|
|
172
172
|
var _a;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SequencePropsSubscriptionProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const SequencePropsSubscriptionProvider = ({ children }) => {
|
|
8
|
+
const [overrideToNodePathMap, setOverrideIdToNodePathMap] = (0, react_1.useState)({});
|
|
9
|
+
const setOverrideIdToNodePath = (0, react_1.useCallback)((overrideId, state) => {
|
|
10
|
+
setOverrideIdToNodePathMap((prev) => {
|
|
11
|
+
const existing = prev[overrideId];
|
|
12
|
+
if (existing && existing === state) {
|
|
13
|
+
return prev;
|
|
14
|
+
}
|
|
15
|
+
return { ...prev, [overrideId]: state };
|
|
16
|
+
});
|
|
17
|
+
}, []);
|
|
18
|
+
const getters = (0, react_1.useMemo)(() => {
|
|
19
|
+
return { overrideIdToNodePathMappings: overrideToNodePathMap };
|
|
20
|
+
}, [overrideToNodePathMap]);
|
|
21
|
+
const setters = (0, react_1.useMemo)(() => {
|
|
22
|
+
return { setOverrideIdToNodePath };
|
|
23
|
+
}, [setOverrideIdToNodePath]);
|
|
24
|
+
return (jsx_runtime_1.jsx(remotion_1.Internals.OverrideIdsToNodePathsGettersContext.Provider, { value: getters, children: jsx_runtime_1.jsx(remotion_1.Internals.OverrideIdsToNodePathsSettersContext.Provider, { value: setters, children: children }) }));
|
|
25
|
+
};
|
|
26
|
+
exports.SequencePropsSubscriptionProvider = SequencePropsSubscriptionProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SequencePropsObserver: () => null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SequencePropsObserver = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
7
|
+
const SequencePropsObserver = () => {
|
|
8
|
+
const { subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
9
|
+
const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
11
|
+
const handleEvent = (event) => {
|
|
12
|
+
if (event.type !== 'sequence-props-updated') {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
setCodeValues(event.nodePath, () => event.result);
|
|
16
|
+
};
|
|
17
|
+
const unsubscribe = subscribeToEvent('sequence-props-updated', handleEvent);
|
|
18
|
+
return () => {
|
|
19
|
+
unsubscribe();
|
|
20
|
+
};
|
|
21
|
+
}, [setCodeValues, subscribeToEvent]);
|
|
22
|
+
return null;
|
|
23
|
+
};
|
|
24
|
+
exports.SequencePropsObserver = SequencePropsObserver;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscribeToNodePaths = void 0;
|
|
4
|
+
const use_resolved_stack_1 = require("./use-resolved-stack");
|
|
5
|
+
const use_sequence_props_subscription_1 = require("./use-sequence-props-subscription");
|
|
6
|
+
const SubscribeToNodePaths = ({ overrideId, schema, stack }) => {
|
|
7
|
+
const originalLocation = (0, use_resolved_stack_1.useResolvedStack)(stack);
|
|
8
|
+
(0, use_sequence_props_subscription_1.useSequencePropsSubscription)({
|
|
9
|
+
overrideId,
|
|
10
|
+
schema,
|
|
11
|
+
originalLocation,
|
|
12
|
+
});
|
|
13
|
+
return null;
|
|
14
|
+
};
|
|
15
|
+
exports.SubscribeToNodePaths = SubscribeToNodePaths;
|