@remotion/studio 4.0.109 → 4.0.111
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/.turbo/turbo-build.log +5 -4
- package/dist/components/Canvas.js +4 -6
- package/dist/components/Editor.d.ts +1 -0
- package/dist/components/Editor.js +21 -2
- package/dist/components/EditorContent.d.ts +4 -0
- package/dist/components/EditorContent.js +2 -2
- package/dist/components/EditorContexts.js +2 -2
- package/dist/components/FullscreenToggle.js +2 -2
- package/dist/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/components/PlayPause.d.ts +1 -0
- package/dist/components/PlayPause.js +42 -11
- package/dist/components/Preview.js +1 -2
- package/dist/components/PreviewToolbar.d.ts +1 -0
- package/dist/components/PreviewToolbar.js +2 -2
- package/dist/components/SizeSelector.d.ts +1 -1
- package/dist/components/SizeSelector.js +1 -2
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/TimelineTracks.js +1 -1
- package/dist/components/Timeline/is-collapsed.d.ts +1 -1
- package/dist/components/Timeline/is-collapsed.js +2 -8
- package/dist/components/TopPanel.d.ts +4 -0
- package/dist/components/TopPanel.js +2 -8
- package/dist/helpers/checkerboard-background.d.ts +1 -1
- package/dist/helpers/get-effective-translation.d.ts +2 -1
- package/dist/helpers/render-modal-sections.d.ts +0 -1
- package/dist/helpers/use-menu-structure.js +1 -2
- package/dist/helpers/use-studio-canvas-dimensions.js +2 -2
- package/dist/state/preview-size.d.ts +0 -7
- package/dist/state/preview-size.js +3 -6
- package/package.json +7 -7
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @remotion/studio@4.0.110 build /Users/jonathanburger/remotion/packages/studio
|
|
4
|
+
> tsc -d
|
|
5
|
+
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Canvas = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const player_1 = require("@remotion/player");
|
|
9
8
|
const react_1 = require("react");
|
|
10
9
|
const remotion_1 = require("remotion");
|
|
11
10
|
const colors_1 = require("../helpers/colors");
|
|
@@ -16,7 +15,6 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
|
16
15
|
const canvas_ref_1 = require("../state/canvas-ref");
|
|
17
16
|
const editor_guides_1 = require("../state/editor-guides");
|
|
18
17
|
const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
|
|
19
|
-
const preview_size_1 = require("../state/preview-size");
|
|
20
18
|
const EditorGuides_1 = __importDefault(require("./EditorGuides"));
|
|
21
19
|
const EditorRuler_1 = require("./EditorRuler");
|
|
22
20
|
const use_is_ruler_visible_1 = require("./EditorRuler/use-is-ruler-visible");
|
|
@@ -37,7 +35,7 @@ const resetZoom = {
|
|
|
37
35
|
};
|
|
38
36
|
const ZOOM_PX_FACTOR = 0.003;
|
|
39
37
|
const Canvas = ({ canvasContent, size }) => {
|
|
40
|
-
const { setSize, size: previewSize } = (0, react_1.useContext)(
|
|
38
|
+
const { setSize, size: previewSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
41
39
|
const { editorZoomGestures } = (0, react_1.useContext)(editor_zoom_gestures_1.EditorZoomGesturesContext);
|
|
42
40
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
43
41
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
@@ -72,7 +70,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
72
70
|
}
|
|
73
71
|
e.preventDefault();
|
|
74
72
|
setSize((prevSize) => {
|
|
75
|
-
const scale =
|
|
73
|
+
const scale = remotion_1.Internals.calculateScale({
|
|
76
74
|
canvasSize: size,
|
|
77
75
|
compositionHeight: contentDimensions.height,
|
|
78
76
|
compositionWidth: contentDimensions.width,
|
|
@@ -168,7 +166,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
168
166
|
return;
|
|
169
167
|
}
|
|
170
168
|
setSize((prevSize) => {
|
|
171
|
-
const scale =
|
|
169
|
+
const scale = remotion_1.Internals.calculateScale({
|
|
172
170
|
canvasSize: size,
|
|
173
171
|
compositionHeight: contentDimensions.height,
|
|
174
172
|
compositionWidth: contentDimensions.width,
|
|
@@ -191,7 +189,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
191
189
|
return;
|
|
192
190
|
}
|
|
193
191
|
setSize((prevSize) => {
|
|
194
|
-
const scale =
|
|
192
|
+
const scale = remotion_1.Internals.calculateScale({
|
|
195
193
|
canvasSize: size,
|
|
196
194
|
compositionHeight: contentDimensions.height,
|
|
197
195
|
compositionWidth: contentDimensions.width,
|
|
@@ -23,8 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Editor = void 0;
|
|
26
|
+
exports.Editor = exports.BUFFER_STATE_DELAY_IN_MILLISECONDS = void 0;
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const player_1 = require("@remotion/player");
|
|
28
29
|
const react_1 = __importStar(require("react"));
|
|
29
30
|
const remotion_1 = require("remotion");
|
|
30
31
|
const colors_1 = require("../helpers/colors");
|
|
@@ -43,7 +44,16 @@ const background = {
|
|
|
43
44
|
flexDirection: 'column',
|
|
44
45
|
position: 'absolute',
|
|
45
46
|
};
|
|
47
|
+
const DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS = 300;
|
|
48
|
+
exports.BUFFER_STATE_DELAY_IN_MILLISECONDS = typeof process.env.BUFFER_STATE_DELAY_IN_MILLISECONDS === 'undefined'
|
|
49
|
+
? DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS
|
|
50
|
+
: Number(process.env.BUFFER_STATE_DELAY_IN_MILLISECONDS);
|
|
46
51
|
const Editor = ({ Root, readOnlyStudio, }) => {
|
|
52
|
+
const drawRef = (0, react_1.useRef)(null);
|
|
53
|
+
const size = player_1.PlayerInternals.useElementSize(drawRef, {
|
|
54
|
+
triggerOnWindowResize: false,
|
|
55
|
+
shouldApplyCssTransforms: true,
|
|
56
|
+
});
|
|
47
57
|
(0, react_1.useEffect)(() => {
|
|
48
58
|
if (readOnlyStudio) {
|
|
49
59
|
return;
|
|
@@ -62,6 +72,15 @@ const Editor = ({ Root, readOnlyStudio, }) => {
|
|
|
62
72
|
const onMounted = (0, react_1.useCallback)(() => {
|
|
63
73
|
setCanvasMounted(true);
|
|
64
74
|
}, []);
|
|
65
|
-
|
|
75
|
+
const value = (0, react_1.useMemo)(() => {
|
|
76
|
+
if (!size) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
type: 'canvas-size',
|
|
81
|
+
canvasSize: size,
|
|
82
|
+
};
|
|
83
|
+
}, [size]);
|
|
84
|
+
return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsxs)(timeline_zoom_1.TimelineZoomContext, { children: [(0, jsx_runtime_1.jsx)(remotion_1.Internals.CurrentScaleContext.Provider, { value: value, children: (0, jsx_runtime_1.jsxs)("div", { style: background, children: [canvasMounted ? (0, jsx_runtime_1.jsx)(Root, {}) : null, (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, { drawRef: drawRef, size: size, onMounted: onMounted, readOnlyStudio: readOnlyStudio, bufferStateDelayInMilliseconds: exports.BUFFER_STATE_DELAY_IN_MILLISECONDS }), (0, jsx_runtime_1.jsx)(GlobalKeybindings_1.GlobalKeybindings, {})] }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {})] }) }), (0, jsx_runtime_1.jsx)(Modals_1.Modals, { readOnlyStudio: readOnlyStudio })] }) }));
|
|
66
85
|
};
|
|
67
86
|
exports.Editor = Editor;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import type { Size } from '@remotion/player';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
export declare const EditorContent: React.FC<{
|
|
3
4
|
readOnlyStudio: boolean;
|
|
4
5
|
onMounted: () => void;
|
|
6
|
+
drawRef: React.RefObject<HTMLDivElement>;
|
|
7
|
+
size: Size | null;
|
|
8
|
+
bufferStateDelayInMilliseconds: number;
|
|
5
9
|
}>;
|
|
@@ -19,11 +19,11 @@ const container = {
|
|
|
19
19
|
flex: 1,
|
|
20
20
|
height: 0,
|
|
21
21
|
};
|
|
22
|
-
const EditorContent = ({ readOnlyStudio, onMounted }) => {
|
|
22
|
+
const EditorContent = ({ readOnlyStudio, onMounted, size, drawRef, bufferStateDelayInMilliseconds, }) => {
|
|
23
23
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
24
24
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
25
25
|
// Preventing multiple renders so the update check doesn't get rendered twice and needs to be aborted
|
|
26
26
|
const onlyTopPanel = canvasContent === null || isStill || canvasContent.type !== 'composition';
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(InitialCompositionLoader_1.InitialCompositionLoader, {}), (0, jsx_runtime_1.jsx)(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), onlyTopPanel ? ((0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, { onMounted: onMounted, readOnlyStudio: readOnlyStudio })) : ((0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, { onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }), (0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(Timeline_1.Timeline, {}) })] }))] }));
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(InitialCompositionLoader_1.InitialCompositionLoader, {}), (0, jsx_runtime_1.jsx)(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), onlyTopPanel ? ((0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, { size: size, drawRef: drawRef, bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, onMounted: onMounted, readOnlyStudio: readOnlyStudio })) : ((0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)(TopPanel_1.TopPanel, { size: size, drawRef: drawRef, bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }), (0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(Timeline_1.Timeline, {}) })] }))] }));
|
|
28
28
|
};
|
|
29
29
|
exports.EditorContent = EditorContent;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EditorContexts = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const player_1 = require("@remotion/player");
|
|
5
6
|
const client_id_1 = require("../helpers/client-id");
|
|
6
7
|
const folders_1 = require("../state/folders");
|
|
7
8
|
const highest_z_index_1 = require("../state/highest-z-index");
|
|
@@ -12,13 +13,12 @@ const CheckerboardProvider_1 = require("./CheckerboardProvider");
|
|
|
12
13
|
const get_zod_if_possible_1 = require("./get-zod-if-possible");
|
|
13
14
|
const MediaVolumeProvider_1 = require("./MediaVolumeProvider");
|
|
14
15
|
const ModalsProvider_1 = require("./ModalsProvider");
|
|
15
|
-
const PlayerEmitterContext_1 = require("./PlayerEmitterContext");
|
|
16
16
|
const context_1 = require("./RenderQueue/context");
|
|
17
17
|
const SetTimelineInOutProvider_1 = require("./SetTimelineInOutProvider");
|
|
18
18
|
const ShowGuidesProvider_1 = require("./ShowGuidesProvider");
|
|
19
19
|
const ShowRulersProvider_1 = require("./ShowRulersProvider");
|
|
20
20
|
const ZoomGesturesProvider_1 = require("./ZoomGesturesProvider");
|
|
21
21
|
const EditorContexts = ({ children, readOnlyStudio }) => {
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(get_zod_if_possible_1.ZodProvider, { children: (0, jsx_runtime_1.jsx)(client_id_1.PreviewServerConnection, { readOnlyStudio: readOnlyStudio, children: (0, jsx_runtime_1.jsx)(context_1.RenderQueueContextProvider, { children: (0, jsx_runtime_1.jsx)(keybindings_1.KeybindingContextProvider, { children: (0, jsx_runtime_1.jsx)(CheckerboardProvider_1.CheckerboardProvider, { children: (0, jsx_runtime_1.jsx)(ZoomGesturesProvider_1.ZoomGesturesProvider, { children: (0, jsx_runtime_1.jsx)(ShowRulersProvider_1.ShowRulersProvider, { children: (0, jsx_runtime_1.jsx)(ShowGuidesProvider_1.ShowGuidesProvider, { children: (0, jsx_runtime_1.jsx)(preview_size_1.PreviewSizeProvider, { children: (0, jsx_runtime_1.jsx)(ModalsProvider_1.ModalsProvider, { children: (0, jsx_runtime_1.jsx)(MediaVolumeProvider_1.MediaVolumeProvider, { children: (0, jsx_runtime_1.jsx)(
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(get_zod_if_possible_1.ZodProvider, { children: (0, jsx_runtime_1.jsx)(client_id_1.PreviewServerConnection, { readOnlyStudio: readOnlyStudio, children: (0, jsx_runtime_1.jsx)(context_1.RenderQueueContextProvider, { children: (0, jsx_runtime_1.jsx)(keybindings_1.KeybindingContextProvider, { children: (0, jsx_runtime_1.jsx)(CheckerboardProvider_1.CheckerboardProvider, { children: (0, jsx_runtime_1.jsx)(ZoomGesturesProvider_1.ZoomGesturesProvider, { children: (0, jsx_runtime_1.jsx)(ShowRulersProvider_1.ShowRulersProvider, { children: (0, jsx_runtime_1.jsx)(ShowGuidesProvider_1.ShowGuidesProvider, { children: (0, jsx_runtime_1.jsx)(preview_size_1.PreviewSizeProvider, { children: (0, jsx_runtime_1.jsx)(ModalsProvider_1.ModalsProvider, { children: (0, jsx_runtime_1.jsx)(MediaVolumeProvider_1.MediaVolumeProvider, { children: (0, jsx_runtime_1.jsx)(player_1.PlayerInternals.PlayerEmitterProvider, { currentPlaybackRate: null, children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarContextProvider, { children: (0, jsx_runtime_1.jsx)(folders_1.FolderContextProvider, { children: (0, jsx_runtime_1.jsx)(highest_z_index_1.HighestZIndexProvider, { children: (0, jsx_runtime_1.jsx)(SetTimelineInOutProvider_1.SetTimelineInOutProvider, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
23
23
|
};
|
|
24
24
|
exports.EditorContexts = EditorContexts;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FullScreenToggle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
6
7
|
const no_react_1 = require("remotion/no-react");
|
|
7
8
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
8
9
|
const canvas_ref_1 = require("../state/canvas-ref");
|
|
9
|
-
const preview_size_1 = require("../state/preview-size");
|
|
10
10
|
const ControlButton_1 = require("./ControlButton");
|
|
11
11
|
const accessibilityLabel = [
|
|
12
12
|
'Enter fullscreen preview',
|
|
@@ -16,7 +16,7 @@ const accessibilityLabel = [
|
|
|
16
16
|
.join(' ');
|
|
17
17
|
const FullScreenToggle = () => {
|
|
18
18
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
19
|
-
const { setSize } = (0, react_1.useContext)(
|
|
19
|
+
const { setSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
20
20
|
const onClick = (0, react_1.useCallback)(() => {
|
|
21
21
|
var _a;
|
|
22
22
|
(_a = canvas_ref_1.canvasRef.current) === null || _a === void 0 ? void 0 : _a.requestFullscreen();
|
|
@@ -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)" | "#
|
|
15
|
+
}) => "#ff3232" | "hsla(0, 0%, 100%, 0.15)" | "#f1c40f" | "rgba(255, 255, 255, 0.05)" | "rgba(0, 0, 0, 0.6)";
|
|
16
16
|
export declare const RemotionInput: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
17
17
|
export {};
|
|
@@ -24,10 +24,16 @@ const forwardBackStyle = {
|
|
|
24
24
|
height: 16,
|
|
25
25
|
color: 'white',
|
|
26
26
|
};
|
|
27
|
-
const
|
|
27
|
+
const iconButton = {
|
|
28
|
+
height: 14,
|
|
29
|
+
width: 14,
|
|
30
|
+
color: 'white',
|
|
31
|
+
};
|
|
32
|
+
const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds }) => {
|
|
28
33
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
29
34
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
30
|
-
const
|
|
35
|
+
const [showBufferIndicator, setShowBufferState] = (0, react_1.useState)(false);
|
|
36
|
+
const { playing, play, pause, pauseAndReturnToPlayStart, frameBack, seek, frameForward, isLastFrame, isFirstFrame, remotionInternal_currentFrameRef, emitter, } = player_1.PlayerInternals.usePlayer();
|
|
31
37
|
player_1.PlayerInternals.usePlayback({
|
|
32
38
|
loop,
|
|
33
39
|
playbackRate,
|
|
@@ -197,14 +203,39 @@ const PlayPause = ({ playbackRate, loop }) => {
|
|
|
197
203
|
onEnter,
|
|
198
204
|
onSpace,
|
|
199
205
|
]);
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
206
|
+
(0, react_1.useEffect)(() => {
|
|
207
|
+
let timeout = null;
|
|
208
|
+
let stopped = false;
|
|
209
|
+
const onBuffer = () => {
|
|
210
|
+
requestAnimationFrame(() => {
|
|
211
|
+
timeout = setTimeout(() => {
|
|
212
|
+
if (!stopped) {
|
|
213
|
+
setShowBufferState(true);
|
|
214
|
+
}
|
|
215
|
+
}, bufferStateDelayInMilliseconds);
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
const onResume = () => {
|
|
219
|
+
requestAnimationFrame(() => {
|
|
220
|
+
setShowBufferState(false);
|
|
221
|
+
stopped = true;
|
|
222
|
+
if (timeout) {
|
|
223
|
+
clearTimeout(timeout);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
emitter.addEventListener('waiting', onBuffer);
|
|
228
|
+
emitter.addEventListener('resume', onResume);
|
|
229
|
+
return () => {
|
|
230
|
+
emitter.removeEventListener('waiting', onBuffer);
|
|
231
|
+
emitter.removeEventListener('resume', onResume);
|
|
232
|
+
setShowBufferState(false);
|
|
233
|
+
if (timeout) {
|
|
234
|
+
clearTimeout(timeout);
|
|
235
|
+
}
|
|
236
|
+
stopped = true;
|
|
237
|
+
};
|
|
238
|
+
}, [emitter]);
|
|
239
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Jump to beginning", title: "Jump to beginning", disabled: !videoConfig || isFirstFrame, onClick: jumpToStart, children: (0, jsx_runtime_1.jsx)(jump_to_start_1.JumpToStart, { style: backStyle }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Step back one frame", title: "Step back one frame", disabled: !videoConfig || isFirstFrame, onClick: oneFrameBack, children: (0, jsx_runtime_1.jsx)(step_back_1.StepBack, { style: forwardBackStyle }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": playing ? 'Pause' : 'Play', title: playing ? 'Pause' : 'Play', onClick: playing ? pause : play, disabled: !videoConfig, children: playing ? (showBufferIndicator ? ((0, jsx_runtime_1.jsx)(player_1.PlayerInternals.BufferingIndicator, { type: "studio" })) : ((0, jsx_runtime_1.jsx)(pause_1.Pause, { style: iconButton }))) : ((0, jsx_runtime_1.jsx)(play_1.Play, { style: iconButton })) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { "aria-label": "Step forward one frame", title: "Step forward one frame", disabled: !videoConfig || isLastFrame, onClick: oneFrameForward, children: (0, jsx_runtime_1.jsx)(step_forward_1.StepForward, { style: forwardBackStyle }) })] }));
|
|
209
240
|
};
|
|
210
241
|
exports.PlayPause = PlayPause;
|
|
@@ -8,7 +8,6 @@ const remotion_1 = require("remotion");
|
|
|
8
8
|
const checkerboard_background_1 = require("../helpers/checkerboard-background");
|
|
9
9
|
const colors_1 = require("../helpers/colors");
|
|
10
10
|
const checkerboard_1 = require("../state/checkerboard");
|
|
11
|
-
const preview_size_1 = require("../state/preview-size");
|
|
12
11
|
const RenderPreview_1 = require("./RenderPreview");
|
|
13
12
|
const Spinner_1 = require("./Spinner");
|
|
14
13
|
const StaticFilePreview_1 = require("./StaticFilePreview");
|
|
@@ -80,7 +79,7 @@ const VideoPreview = ({ canvasSize, contentDimensions, canvasContent, assetMetad
|
|
|
80
79
|
};
|
|
81
80
|
exports.VideoPreview = VideoPreview;
|
|
82
81
|
const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent, assetMetadata }) => {
|
|
83
|
-
const { size: previewSize } = (0, react_1.useContext)(
|
|
82
|
+
const { size: previewSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
84
83
|
const { centerX, centerY, yCorrection, xCorrection, scale } = (0, react_1.useMemo)(() => {
|
|
85
84
|
if (contentDimensions === 'none') {
|
|
86
85
|
return {
|
|
@@ -42,7 +42,7 @@ const sideContainer = {
|
|
|
42
42
|
const padding = {
|
|
43
43
|
width: timeline_layout_1.TIMELINE_PADDING,
|
|
44
44
|
};
|
|
45
|
-
const PreviewToolbar = ({ readOnlyStudio }) => {
|
|
45
|
+
const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
46
46
|
const { playbackRate, setPlaybackRate } = (0, react_1.useContext)(remotion_1.Internals.Timeline.TimelineContext);
|
|
47
47
|
const { mediaMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
|
|
48
48
|
const { setMediaMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
|
|
@@ -50,6 +50,6 @@ const PreviewToolbar = ({ readOnlyStudio }) => {
|
|
|
50
50
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
51
51
|
const [loop, setLoop] = (0, react_1.useState)((0, loop_1.loadLoopOption)());
|
|
52
52
|
const isFullscreenSupported = document.fullscreenEnabled || document.webkitFullscreenEnabled;
|
|
53
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }), (0, jsx_runtime_1.jsx)(TimelineZoomControls_1.TimelineZoomControls, {})] }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), isStill || isVideoComposition ? ((0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate })) : null, isVideoComposition ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(PlayPause_1.PlayPause, { loop: loop, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 })] })) : null, isFullscreenSupported && (0, jsx_runtime_1.jsx)(FullscreenToggle_1.FullScreenToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), readOnlyStudio ? null : (0, jsx_runtime_1.jsx)(RenderButton_1.RenderButton, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 })] }), (0, jsx_runtime_1.jsx)(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), (0, jsx_runtime_1.jsx)(PlaybackRatePersistor_1.PlaybackRatePersistor, {})] }));
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }), (0, jsx_runtime_1.jsx)(TimelineZoomControls_1.TimelineZoomControls, {})] }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), isStill || isVideoComposition ? ((0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate })) : null, isVideoComposition ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 })] })) : null, isFullscreenSupported && (0, jsx_runtime_1.jsx)(FullscreenToggle_1.FullScreenToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), readOnlyStudio ? null : (0, jsx_runtime_1.jsx)(RenderButton_1.RenderButton, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 })] }), (0, jsx_runtime_1.jsx)(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), (0, jsx_runtime_1.jsx)(PlaybackRatePersistor_1.PlaybackRatePersistor, {})] }));
|
|
54
54
|
};
|
|
55
55
|
exports.PreviewToolbar = PreviewToolbar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PreviewSize } from '@remotion/player';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import type { PreviewSize } from 'remotion';
|
|
3
3
|
export declare const getPreviewSizeLabel: (previewSize: PreviewSize) => string;
|
|
4
4
|
export declare const getUniqueSizes: (size: PreviewSize) => PreviewSize[];
|
|
5
5
|
export declare const SizeSelector: React.FC;
|
|
@@ -5,7 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const Checkmark_1 = require("../icons/Checkmark");
|
|
8
|
-
const preview_size_1 = require("../state/preview-size");
|
|
9
8
|
const ControlButton_1 = require("./ControlButton");
|
|
10
9
|
const ComboBox_1 = require("./NewComposition/ComboBox");
|
|
11
10
|
const Preview_1 = require("./Preview");
|
|
@@ -69,7 +68,7 @@ const getUniqueSizes = (size) => {
|
|
|
69
68
|
exports.getUniqueSizes = getUniqueSizes;
|
|
70
69
|
const zoomableFileTypes = ['video', 'image'];
|
|
71
70
|
const SizeSelector = () => {
|
|
72
|
-
const { size, setSize } = (0, react_1.useContext)(
|
|
71
|
+
const { size, setSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
73
72
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
74
73
|
const style = (0, react_1.useMemo)(() => {
|
|
75
74
|
return {
|
|
@@ -47,7 +47,7 @@ const Timeline = () => {
|
|
|
47
47
|
}, [sequences, videoConfig]);
|
|
48
48
|
const durationInFrames = (_a = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _a !== void 0 ? _a : 0;
|
|
49
49
|
const filtered = (0, react_1.useMemo)(() => {
|
|
50
|
-
const withoutHidden = timeline.filter((t) => !(0, is_collapsed_1.isTrackHidden)(t
|
|
50
|
+
const withoutHidden = timeline.filter((t) => !(0, is_collapsed_1.isTrackHidden)(t));
|
|
51
51
|
const withoutAfter = withoutHidden.filter((t) => {
|
|
52
52
|
return t.sequence.from <= durationInFrames && t.sequence.duration > 0;
|
|
53
53
|
});
|
|
@@ -30,7 +30,7 @@ const TimelineTracks = ({ timeline, hasBeenCut }) => {
|
|
|
30
30
|
};
|
|
31
31
|
}, []);
|
|
32
32
|
return ((0, jsx_runtime_1.jsxs)("div", { style: timelineStyle, children: [(0, jsx_runtime_1.jsxs)("div", { style: content, children: [(0, jsx_runtime_1.jsx)(TimelineTimeIndicators_1.TimelineTimePadding, {}), timeline.map((track) => {
|
|
33
|
-
if ((0, is_collapsed_1.isTrackHidden)(track
|
|
33
|
+
if ((0, is_collapsed_1.isTrackHidden)(track)) {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
return ((0, jsx_runtime_1.jsx)("div", { style: inner, children: (0, jsx_runtime_1.jsx)(TimelineSequence_1.TimelineSequence, { s: track.sequence }) }, track.sequence.id));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TrackWithHash } from '../../helpers/get-timeline-sequence-sort-key';
|
|
2
|
-
export declare const isTrackHidden: (track: TrackWithHash
|
|
2
|
+
export declare const isTrackHidden: (track: TrackWithHash) => boolean;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isTrackHidden = void 0;
|
|
4
|
-
const isTrackHidden = (track
|
|
4
|
+
const isTrackHidden = (track) => {
|
|
5
5
|
if (!track.sequence.parent) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
// Due to effects and conditional `showInTimeline`, a parent
|
|
10
|
-
// may not exist in the `allTracks` array.
|
|
11
|
-
if (!parent) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
return (0, exports.isTrackHidden)(parent, allTracks);
|
|
8
|
+
return !track.sequence.showInTimeline;
|
|
15
9
|
};
|
|
16
10
|
exports.isTrackHidden = isTrackHidden;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { Size } from '@remotion/player';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
export declare const useResponsiveSidebarStatus: () => 'collapsed' | 'expanded';
|
|
3
4
|
export declare const TopPanel: React.FC<{
|
|
4
5
|
readOnlyStudio: boolean;
|
|
5
6
|
onMounted: () => void;
|
|
7
|
+
size: Size | null;
|
|
8
|
+
drawRef: React.RefObject<HTMLDivElement>;
|
|
9
|
+
bufferStateDelayInMilliseconds: number;
|
|
6
10
|
}>;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TopPanel = exports.useResponsiveSidebarStatus = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const player_1 = require("@remotion/player");
|
|
6
5
|
const react_1 = require("react");
|
|
7
6
|
const use_breakpoint_1 = require("../helpers/use-breakpoint");
|
|
8
7
|
const editor_rulers_1 = require("../state/editor-rulers");
|
|
@@ -44,10 +43,9 @@ const useResponsiveSidebarStatus = () => {
|
|
|
44
43
|
return actualStateLeft;
|
|
45
44
|
};
|
|
46
45
|
exports.useResponsiveSidebarStatus = useResponsiveSidebarStatus;
|
|
47
|
-
const TopPanel = ({ readOnlyStudio, onMounted }) => {
|
|
46
|
+
const TopPanel = ({ readOnlyStudio, onMounted, size, drawRef, bufferStateDelayInMilliseconds, }) => {
|
|
48
47
|
const { setSidebarCollapsedState, sidebarCollapsedStateRight } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
49
48
|
const rulersAreVisible = (0, use_is_ruler_visible_1.useIsRulerVisible)();
|
|
50
|
-
const ref = (0, react_1.useRef)(null);
|
|
51
49
|
const actualStateLeft = (0, exports.useResponsiveSidebarStatus)();
|
|
52
50
|
const actualStateRight = (0, react_1.useMemo)(() => {
|
|
53
51
|
if (sidebarCollapsedStateRight === 'collapsed') {
|
|
@@ -55,10 +53,6 @@ const TopPanel = ({ readOnlyStudio, onMounted }) => {
|
|
|
55
53
|
}
|
|
56
54
|
return 'expanded';
|
|
57
55
|
}, [sidebarCollapsedStateRight]);
|
|
58
|
-
const size = player_1.PlayerInternals.useElementSize(ref, {
|
|
59
|
-
triggerOnWindowResize: false,
|
|
60
|
-
shouldApplyCssTransforms: true,
|
|
61
|
-
});
|
|
62
56
|
const hasSize = size !== null;
|
|
63
57
|
(0, react_1.useEffect)(() => {
|
|
64
58
|
onMounted();
|
|
@@ -75,6 +69,6 @@ const TopPanel = ({ readOnlyStudio, onMounted }) => {
|
|
|
75
69
|
const onCollapseRight = (0, react_1.useCallback)(() => {
|
|
76
70
|
setSidebarCollapsedState({ left: null, right: 'collapsed' });
|
|
77
71
|
}, [setSidebarCollapsedState]);
|
|
78
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: row, children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)(ExplorerPanel_1.ExplorerPanel, {}) })) : null, actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, id: "canvas-to-right-sidebar", orientation: "vertical", children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)("div", { ref:
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: row, children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)(ExplorerPanel_1.ExplorerPanel, {}) })) : null, actualStateLeft === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, (0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsxs)(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, id: "canvas-to-right-sidebar", orientation: "vertical", children: [(0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: (0, jsx_runtime_1.jsx)("div", { ref: drawRef, style: canvasContainerStyle, children: size ? (0, jsx_runtime_1.jsx)(CanvasOrLoading_1.CanvasOrLoading, { size: size }) : null }) }), actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? ((0, jsx_runtime_1.jsx)(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: (0, jsx_runtime_1.jsx)(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) })) : null] }) })] }) }), (0, jsx_runtime_1.jsx)(PreviewToolbar_1.PreviewToolbar, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.CurrentCompositionKeybindings, { readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(CurrentCompositionSideEffects_1.TitleUpdater, {})] }));
|
|
79
73
|
};
|
|
80
74
|
exports.TopPanel = TopPanel;
|
|
@@ -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) => "
|
|
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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Size
|
|
1
|
+
import type { Size } from '@remotion/player';
|
|
2
|
+
import type { Translation } from 'remotion';
|
|
2
3
|
export declare const getEffectiveTranslation: ({ canvasSize, scale, compositionHeight, compositionWidth, translation, }: {
|
|
3
4
|
canvasSize: Size;
|
|
4
5
|
scale: number;
|
|
@@ -18,7 +18,6 @@ const editor_guides_1 = require("../state/editor-guides");
|
|
|
18
18
|
const editor_rulers_1 = require("../state/editor-rulers");
|
|
19
19
|
const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
|
|
20
20
|
const modals_1 = require("../state/modals");
|
|
21
|
-
const preview_size_1 = require("../state/preview-size");
|
|
22
21
|
const sidebar_1 = require("../state/sidebar");
|
|
23
22
|
const client_id_1 = require("./client-id");
|
|
24
23
|
const get_git_menu_item_1 = require("./get-git-menu-item");
|
|
@@ -156,7 +155,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
156
155
|
const { editorZoomGestures, setEditorZoomGestures } = (0, react_1.useContext)(editor_zoom_gestures_1.EditorZoomGesturesContext);
|
|
157
156
|
const { editorShowRulers, setEditorShowRulers } = (0, react_1.useContext)(editor_rulers_1.EditorShowRulersContext);
|
|
158
157
|
const { editorShowGuides, setEditorShowGuides } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
|
|
159
|
-
const { size, setSize } = (0, react_1.useContext)(
|
|
158
|
+
const { size, setSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
160
159
|
const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState;
|
|
161
160
|
const { setSidebarCollapsedState, sidebarCollapsedStateLeft, sidebarCollapsedStateRight, } = (0, react_1.useContext)(sidebar_1.SidebarContext);
|
|
162
161
|
const sizes = (0, SizeSelector_1.getUniqueSizes)(size);
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useStudioCanvasDimensions = void 0;
|
|
4
4
|
const player_1 = require("@remotion/player");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
7
|
const useStudioCanvasDimensions = ({ canvasSize, contentDimensions, assetMetadata, }) => {
|
|
8
|
-
const { size: previewSize } = (0, react_1.useContext)(
|
|
8
|
+
const { size: previewSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
9
9
|
const { centerX, centerY, scale } = (0, react_1.useMemo)(() => {
|
|
10
10
|
if (contentDimensions === 'none' ||
|
|
11
11
|
contentDimensions === null ||
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import type { PreviewSize } from '@remotion/player';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
type PreviewSizeCtx = {
|
|
4
|
-
size: PreviewSize;
|
|
5
|
-
setSize: (cb: (oldSize: PreviewSize) => PreviewSize) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare const PreviewSizeContext: React.Context<PreviewSizeCtx>;
|
|
8
2
|
export declare const PreviewSizeProvider: React.FC<{
|
|
9
3
|
children: React.ReactNode;
|
|
10
4
|
}>;
|
|
11
|
-
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PreviewSizeProvider =
|
|
3
|
+
exports.PreviewSizeProvider = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
6
7
|
const editor_zoom_gestures_1 = require("./editor-zoom-gestures");
|
|
7
8
|
const key = 'remotion.previewSize';
|
|
8
9
|
const persistPreviewSizeOption = (option) => {
|
|
@@ -21,10 +22,6 @@ const loadPreviewSizeOption = () => {
|
|
|
21
22
|
}
|
|
22
23
|
return JSON.parse(item);
|
|
23
24
|
};
|
|
24
|
-
exports.PreviewSizeContext = (0, react_1.createContext)({
|
|
25
|
-
setSize: () => undefined,
|
|
26
|
-
size: loadPreviewSizeOption(),
|
|
27
|
-
});
|
|
28
25
|
const PreviewSizeProvider = ({ children }) => {
|
|
29
26
|
const [size, setSizeState] = (0, react_1.useState)(() => loadPreviewSizeOption());
|
|
30
27
|
const [translation, setTranslation] = (0, react_1.useState)(() => {
|
|
@@ -57,6 +54,6 @@ const PreviewSizeProvider = ({ children }) => {
|
|
|
57
54
|
setTranslation,
|
|
58
55
|
};
|
|
59
56
|
}, [editorZoomGestures, size, setSize, translation]);
|
|
60
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.PreviewSizeContext.Provider, { value: previewSizeCtx, children: children }));
|
|
61
58
|
};
|
|
62
59
|
exports.PreviewSizeProvider = PreviewSizeProvider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/studio",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.111",
|
|
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.
|
|
22
|
-
"@remotion/
|
|
23
|
-
"@remotion/
|
|
24
|
-
"@remotion/
|
|
25
|
-
"@remotion/
|
|
21
|
+
"remotion": "4.0.111",
|
|
22
|
+
"@remotion/player": "4.0.111",
|
|
23
|
+
"@remotion/media-utils": "4.0.111",
|
|
24
|
+
"@remotion/renderer": "4.0.111",
|
|
25
|
+
"@remotion/studio-shared": "4.0.111"
|
|
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.
|
|
43
|
+
"@remotion/zod-types": "4.0.111"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|