@remotion/studio 4.0.149 → 4.0.151
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 +4 -2
- package/bundle.ts +15 -4
- package/dist/components/Canvas.d.ts +3 -2
- package/dist/components/Canvas.js +2 -2
- package/dist/components/CanvasOrLoading.d.ts +1 -1
- package/dist/components/CanvasOrLoading.js +7 -29
- package/dist/components/Editor.js +3 -3
- package/dist/components/FullscreenToggle.js +1 -1
- package/dist/components/ModalContainer.d.ts +3 -3
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -1
- package/dist/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/components/Preview.d.ts +5 -4
- package/dist/components/Preview.js +5 -3
- package/dist/components/PreviewToolbar.d.ts +2 -2
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/RefreshCompositionOverlay.d.ts +3 -0
- package/dist/components/RefreshCompositionOverlay.js +19 -0
- package/dist/components/RenderModal/ResolveCompositionBeforeModal.js +2 -2
- package/dist/components/RunningCalculateMetadata.d.ts +3 -0
- package/dist/components/RunningCalculateMetadata.js +26 -0
- package/dist/components/Spinner.d.ts +2 -2
- package/dist/components/Spinner.js +1 -1
- package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
- package/dist/esm/internals.mjs +4083 -3932
- package/dist/helpers/checkerboard-background.d.ts +1 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/get-timeline-sequence-layout.js +5 -5
- package/dist/helpers/use-menu-structure.js +1 -1
- package/dist/state/canvas-ref.d.ts +1 -0
- package/dist/state/canvas-ref.js +2 -1
- package/package.json +8 -8
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
> @remotion/studio@4.0.
|
|
3
|
-
> bun bundle.ts
|
|
2
|
+
> @remotion/studio@4.0.150 build /Users/jonathanburger/remotion/packages/studio
|
|
3
|
+
> bun --env-file=../.env.bundle bundle.ts
|
|
4
4
|
|
|
5
|
+
warn: Remotion currently uses a fork of Bun to bundle.
|
|
6
|
+
You dont currently run the fork, this could lead to duplicate key warnings in React.
|
package/bundle.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import {build} from 'bun';
|
|
1
|
+
import {build, revision} from 'bun';
|
|
2
|
+
|
|
3
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4
|
+
throw new Error('This script must be run using NODE_ENV=production');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
if (!revision.startsWith('07ce')) {
|
|
8
|
+
// eslint-disable-next-line no-console
|
|
9
|
+
console.warn('warn: Remotion currently uses a fork of Bun to bundle.');
|
|
10
|
+
// eslint-disable-next-line no-console
|
|
11
|
+
console.log(
|
|
12
|
+
'You dont currently run the fork, this could lead to duplicate key warnings in React.',
|
|
13
|
+
);
|
|
14
|
+
}
|
|
2
15
|
|
|
3
16
|
const mainModule = await build({
|
|
4
17
|
entrypoints: ['src/index.ts'],
|
|
@@ -7,9 +20,7 @@ const mainModule = await build({
|
|
|
7
20
|
});
|
|
8
21
|
|
|
9
22
|
const [file] = mainModule.outputs;
|
|
10
|
-
const text =
|
|
11
|
-
.replace(/jsxDEV/g, 'jsx')
|
|
12
|
-
.replace(/react\/jsx-dev-runtime/g, 'react/jsx-runtime');
|
|
23
|
+
const text = await file.text();
|
|
13
24
|
|
|
14
25
|
await Bun.write('dist/esm/index.mjs', text);
|
|
15
26
|
|
|
@@ -2,6 +2,7 @@ import type { Size } from '@remotion/player';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { CanvasContent } from 'remotion';
|
|
4
4
|
export declare const Canvas: React.FC<{
|
|
5
|
-
canvasContent: CanvasContent;
|
|
6
|
-
size: Size;
|
|
5
|
+
readonly canvasContent: CanvasContent;
|
|
6
|
+
readonly size: Size;
|
|
7
|
+
readonly isRefreshing: boolean;
|
|
7
8
|
}>;
|
|
@@ -34,7 +34,7 @@ const resetZoom = {
|
|
|
34
34
|
right: layout_1.SPACING_UNIT * 2,
|
|
35
35
|
};
|
|
36
36
|
const ZOOM_PX_FACTOR = 0.003;
|
|
37
|
-
const Canvas = ({ canvasContent, size }) => {
|
|
37
|
+
const Canvas = ({ canvasContent, size, isRefreshing }) => {
|
|
38
38
|
const { setSize, size: previewSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
39
39
|
const { editorZoomGestures } = (0, react_1.useContext)(editor_zoom_gestures_1.EditorZoomGesturesContext);
|
|
40
40
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
@@ -249,6 +249,6 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
249
249
|
(0, react_1.useEffect)(() => {
|
|
250
250
|
fetchMetadata();
|
|
251
251
|
}, [fetchMetadata]);
|
|
252
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { ref: canvas_ref_1.canvasRef, style: container, children: [size ? ((0, jsx_runtime_1.jsx)(Preview_1.VideoPreview, { canvasContent: canvasContent, contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution })) : null, isFit ? null : ((0, jsx_runtime_1.jsx)("div", { style: resetZoom, className: "css-reset", children: (0, jsx_runtime_1.jsx)(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) })), editorShowGuides && canvasContent.type === 'composition' && ((0, jsx_runtime_1.jsx)(EditorGuides_1.default, { canvasSize: size, contentDimensions: contentDimensions, assetMetadata: assetResolution }))] }), areRulersVisible && ((0, jsx_runtime_1.jsx)(EditorRuler_1.EditorRulers, { contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, containerRef: canvas_ref_1.canvasRef }))] }));
|
|
252
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { ref: canvas_ref_1.canvasRef, style: container, children: [size ? ((0, jsx_runtime_1.jsx)(Preview_1.VideoPreview, { canvasContent: canvasContent, contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, isRefreshing: isRefreshing })) : null, isFit ? null : ((0, jsx_runtime_1.jsx)("div", { style: resetZoom, className: "css-reset", children: (0, jsx_runtime_1.jsx)(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) })), editorShowGuides && canvasContent.type === 'composition' && ((0, jsx_runtime_1.jsx)(EditorGuides_1.default, { canvasSize: size, contentDimensions: contentDimensions, assetMetadata: assetResolution }))] }), areRulersVisible && ((0, jsx_runtime_1.jsx)(EditorRuler_1.EditorRulers, { contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, containerRef: canvas_ref_1.canvasRef }))] }));
|
|
253
253
|
};
|
|
254
254
|
exports.Canvas = Canvas;
|
|
@@ -9,12 +9,11 @@ const colors_1 = require("../helpers/colors");
|
|
|
9
9
|
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
10
10
|
const Canvas_1 = require("./Canvas");
|
|
11
11
|
const FramePersistor_1 = require("./FramePersistor");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const RefreshCompositionOverlay_1 = require("./RefreshCompositionOverlay");
|
|
13
|
+
const RunningCalculateMetadata_1 = require("./RunningCalculateMetadata");
|
|
14
14
|
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
15
15
|
const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
|
|
16
16
|
const ZoomPersistor_1 = require("./ZoomPersistor");
|
|
17
|
-
const layout_1 = require("./layout");
|
|
18
17
|
const container = {
|
|
19
18
|
color: 'white',
|
|
20
19
|
flex: 1,
|
|
@@ -26,19 +25,11 @@ const container = {
|
|
|
26
25
|
};
|
|
27
26
|
const CanvasOrLoading = ({ size }) => {
|
|
28
27
|
const resolved = remotion_1.Internals.useResolvedVideoConfig(null);
|
|
29
|
-
const [takesALongTime, setTakesALongTime] = (0, react_1.useState)(false);
|
|
30
28
|
const { setZoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
|
|
31
29
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
32
30
|
(0, react_1.useEffect)(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, 500);
|
|
36
|
-
return () => {
|
|
37
|
-
clearTimeout(timeout);
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
40
|
-
(0, react_1.useEffect)(() => {
|
|
41
|
-
if ((resolved === null || resolved === void 0 ? void 0 : resolved.type) !== 'success') {
|
|
31
|
+
if ((resolved === null || resolved === void 0 ? void 0 : resolved.type) !== 'success' &&
|
|
32
|
+
(resolved === null || resolved === void 0 ? void 0 : resolved.type) !== 'success-and-refreshing') {
|
|
42
33
|
return;
|
|
43
34
|
}
|
|
44
35
|
const c = resolved.result;
|
|
@@ -50,18 +41,11 @@ const CanvasOrLoading = ({ size }) => {
|
|
|
50
41
|
});
|
|
51
42
|
});
|
|
52
43
|
}, [resolved, setZoom]);
|
|
53
|
-
const style = (0, react_1.useMemo)(() => {
|
|
54
|
-
return {
|
|
55
|
-
...loaderLabel,
|
|
56
|
-
opacity: takesALongTime ? 1 : 0,
|
|
57
|
-
transition: 'opacity 0.3s',
|
|
58
|
-
};
|
|
59
|
-
}, [takesALongTime]);
|
|
60
44
|
if (!canvasContent) {
|
|
61
45
|
const compname = window.location.pathname.replace('/', '');
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: container, className: "css-reset", children: (0, jsx_runtime_1.jsxs)("div", { style:
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: container, className: "css-reset", children: (0, jsx_runtime_1.jsxs)("div", { style: RunningCalculateMetadata_1.loaderLabel, children: ["Composition with ID ", compname, " not found."] }) }));
|
|
63
47
|
}
|
|
64
|
-
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), (0, jsx_runtime_1.jsx)(Canvas_1.Canvas, { size: size, canvasContent: canvasContent })] }));
|
|
48
|
+
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ZoomPersistor_1.ZoomPersistor, {}), (0, jsx_runtime_1.jsx)(Canvas_1.Canvas, { isRefreshing: (resolved === null || resolved === void 0 ? void 0 : resolved.type) === 'success-and-refreshing', size: size, canvasContent: canvasContent }), (resolved === null || resolved === void 0 ? void 0 : resolved.type) === 'success-and-refreshing' ? ((0, jsx_runtime_1.jsx)(RefreshCompositionOverlay_1.RefreshCompositionOverlay, {})) : null] }));
|
|
65
49
|
if (canvasContent.type === 'asset' || canvasContent.type === 'output') {
|
|
66
50
|
return content;
|
|
67
51
|
}
|
|
@@ -69,7 +53,7 @@ const CanvasOrLoading = ({ size }) => {
|
|
|
69
53
|
return null;
|
|
70
54
|
}
|
|
71
55
|
if (resolved.type === 'loading') {
|
|
72
|
-
return ((0, jsx_runtime_1.
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: container, className: "css-reset", children: (0, jsx_runtime_1.jsx)(RunningCalculateMetadata_1.RunningCalculateMetadata, {}) }));
|
|
73
57
|
}
|
|
74
58
|
if (resolved.type === 'error') {
|
|
75
59
|
return (0, jsx_runtime_1.jsx)(ErrorLoading, { error: resolved.error });
|
|
@@ -77,12 +61,6 @@ const CanvasOrLoading = ({ size }) => {
|
|
|
77
61
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FramePersistor_1.FramePersistor, {}), " ", content] }));
|
|
78
62
|
};
|
|
79
63
|
exports.CanvasOrLoading = CanvasOrLoading;
|
|
80
|
-
const loaderLabel = {
|
|
81
|
-
fontSize: 14,
|
|
82
|
-
color: colors_1.LIGHT_TEXT,
|
|
83
|
-
fontFamily: 'sans-serif',
|
|
84
|
-
lineHeight: 1.5,
|
|
85
|
-
};
|
|
86
64
|
const loaderContainer = {
|
|
87
65
|
marginLeft: 'auto',
|
|
88
66
|
marginRight: 'auto',
|
|
@@ -30,6 +30,7 @@ const react_1 = __importStar(require("react"));
|
|
|
30
30
|
const remotion_1 = require("remotion");
|
|
31
31
|
const colors_1 = require("../helpers/colors");
|
|
32
32
|
const noop_1 = require("../helpers/noop");
|
|
33
|
+
const canvas_ref_1 = require("../state/canvas-ref");
|
|
33
34
|
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
34
35
|
const z_index_1 = require("../state/z-index");
|
|
35
36
|
const EditorContent_1 = require("./EditorContent");
|
|
@@ -49,8 +50,7 @@ exports.BUFFER_STATE_DELAY_IN_MILLISECONDS = typeof process.env.BUFFER_STATE_DEL
|
|
|
49
50
|
? DEFAULT_BUFFER_STATE_DELAY_IN_MILLISECONDS
|
|
50
51
|
: Number(process.env.BUFFER_STATE_DELAY_IN_MILLISECONDS);
|
|
51
52
|
const Editor = ({ Root, readOnlyStudio }) => {
|
|
52
|
-
const
|
|
53
|
-
const size = player_1.PlayerInternals.useElementSize(drawRef, {
|
|
53
|
+
const size = player_1.PlayerInternals.useElementSize(canvas_ref_1.drawRef, {
|
|
54
54
|
triggerOnWindowResize: false,
|
|
55
55
|
shouldApplyCssTransforms: true,
|
|
56
56
|
});
|
|
@@ -84,6 +84,6 @@ const Editor = ({ Root, readOnlyStudio }) => {
|
|
|
84
84
|
const MemoRoot = (0, react_1.useMemo)(() => {
|
|
85
85
|
return react_1.default.memo(Root);
|
|
86
86
|
}, [Root]);
|
|
87
|
-
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)(MemoRoot, {}) : 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)(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {})] }) }));
|
|
87
|
+
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)(MemoRoot, {}) : null, (0, jsx_runtime_1.jsxs)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: [(0, jsx_runtime_1.jsx)(EditorContent_1.EditorContent, { drawRef: canvas_ref_1.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)(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), (0, jsx_runtime_1.jsx)(NotificationCenter_1.NotificationCenter, {})] }) }));
|
|
88
88
|
};
|
|
89
89
|
exports.Editor = Editor;
|
|
@@ -19,7 +19,7 @@ const FullScreenToggle = () => {
|
|
|
19
19
|
const { setSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
20
20
|
const onClick = (0, react_1.useCallback)(() => {
|
|
21
21
|
var _a;
|
|
22
|
-
(_a = canvas_ref_1.
|
|
22
|
+
(_a = canvas_ref_1.drawRef.current) === null || _a === void 0 ? void 0 : _a.requestFullscreen();
|
|
23
23
|
if (document.fullscreenElement)
|
|
24
24
|
setSize(() => ({
|
|
25
25
|
size: 'auto',
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare const getMaxModalWidth: (width: number) => string;
|
|
3
3
|
export declare const getMaxModalHeight: (height: number) => string;
|
|
4
4
|
export declare const ModalContainer: React.FC<{
|
|
5
|
-
onEscape: () => void;
|
|
6
|
-
onOutsideClick: () => void;
|
|
7
|
-
children: React.ReactNode;
|
|
5
|
+
readonly onEscape: () => void;
|
|
6
|
+
readonly onOutsideClick: () => void;
|
|
7
|
+
readonly children: React.ReactNode;
|
|
8
8
|
}>;
|
|
@@ -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
|
+
}) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232" | "#f1c40f";
|
|
16
16
|
export declare const RemotionInput: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
17
17
|
export {};
|
|
@@ -6,8 +6,9 @@ import type { Dimensions } from '../helpers/is-current-selected-still';
|
|
|
6
6
|
export type AssetFileType = 'audio' | 'video' | 'image' | 'json' | 'txt' | 'other';
|
|
7
7
|
export declare const getPreviewFileType: (fileName: string | null) => AssetFileType;
|
|
8
8
|
export declare const VideoPreview: React.FC<{
|
|
9
|
-
canvasSize: Size;
|
|
10
|
-
contentDimensions: Dimensions | 'none' | null;
|
|
11
|
-
canvasContent: CanvasContent;
|
|
12
|
-
assetMetadata: AssetMetadata | null;
|
|
9
|
+
readonly canvasSize: Size;
|
|
10
|
+
readonly contentDimensions: Dimensions | 'none' | null;
|
|
11
|
+
readonly canvasContent: CanvasContent;
|
|
12
|
+
readonly assetMetadata: AssetMetadata | null;
|
|
13
|
+
readonly isRefreshing: boolean;
|
|
13
14
|
}>;
|
|
@@ -68,17 +68,17 @@ const containerStyle = (options) => {
|
|
|
68
68
|
backgroundPosition: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(checkerboardSize) /* Must be half of one side of the square */,
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
-
const VideoPreview = ({ canvasSize, contentDimensions, canvasContent, assetMetadata }) => {
|
|
71
|
+
const VideoPreview = ({ canvasSize, contentDimensions, canvasContent, assetMetadata, isRefreshing, }) => {
|
|
72
72
|
if (assetMetadata && assetMetadata.type === 'not-found') {
|
|
73
73
|
return ((0, jsx_runtime_1.jsx)("div", { style: centeredContainer, children: (0, jsx_runtime_1.jsx)("div", { style: label, children: "File does not exist" }) }));
|
|
74
74
|
}
|
|
75
75
|
if (contentDimensions === null) {
|
|
76
76
|
return ((0, jsx_runtime_1.jsx)("div", { style: centeredContainer, children: (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { duration: 0.5, size: 24 }) }));
|
|
77
77
|
}
|
|
78
|
-
return ((0, jsx_runtime_1.jsx)(CompWhenItHasDimensions, { contentDimensions: contentDimensions, canvasSize: canvasSize, canvasContent: canvasContent, assetMetadata: assetMetadata }));
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(CompWhenItHasDimensions, { contentDimensions: contentDimensions, canvasSize: canvasSize, canvasContent: canvasContent, assetMetadata: assetMetadata, isRefreshing: isRefreshing }));
|
|
79
79
|
};
|
|
80
80
|
exports.VideoPreview = VideoPreview;
|
|
81
|
-
const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent, assetMetadata }) => {
|
|
81
|
+
const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent, assetMetadata, isRefreshing, }) => {
|
|
82
82
|
const { size: previewSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
83
83
|
const { centerX, centerY, yCorrection, xCorrection, scale } = (0, react_1.useMemo)(() => {
|
|
84
84
|
if (contentDimensions === 'none') {
|
|
@@ -114,6 +114,7 @@ const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent,
|
|
|
114
114
|
(0, exports.getPreviewFileType)(canvasContent.asset) === 'audio'
|
|
115
115
|
? 'center'
|
|
116
116
|
: 'normal',
|
|
117
|
+
opacity: isRefreshing ? 0.5 : 1,
|
|
117
118
|
};
|
|
118
119
|
}, [
|
|
119
120
|
contentDimensions,
|
|
@@ -123,6 +124,7 @@ const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent,
|
|
|
123
124
|
previewSize.translation.y,
|
|
124
125
|
centerY,
|
|
125
126
|
canvasContent,
|
|
127
|
+
isRefreshing,
|
|
126
128
|
]);
|
|
127
129
|
return ((0, jsx_runtime_1.jsx)("div", { style: outer, children: canvasContent.type === 'asset' ? ((0, jsx_runtime_1.jsx)(StaticFilePreview_1.StaticFilePreview, { assetMetadata: assetMetadata, currentAsset: canvasContent.asset })) : canvasContent.type === 'output' ? ((0, jsx_runtime_1.jsx)(RenderPreview_1.RenderPreview, { path: canvasContent.path, assetMetadata: assetMetadata })) : ((0, jsx_runtime_1.jsx)(PortalContainer, { contentDimensions: contentDimensions, scale: scale, xCorrection: xCorrection, yCorrection: yCorrection })) }));
|
|
128
130
|
};
|
|
@@ -50,6 +50,6 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
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, { 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 })
|
|
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 })] })) : null, (0, jsx_runtime_1.jsx)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), 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;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RefreshCompositionOverlay = exports.container = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const RunningCalculateMetadata_1 = require("./RunningCalculateMetadata");
|
|
7
|
+
exports.container = {
|
|
8
|
+
justifyContent: 'flex-end',
|
|
9
|
+
alignItems: 'flex-start',
|
|
10
|
+
padding: 20,
|
|
11
|
+
pointerEvents: 'none',
|
|
12
|
+
};
|
|
13
|
+
const shadow = {
|
|
14
|
+
boxShadow: '0 0 4px black',
|
|
15
|
+
};
|
|
16
|
+
const RefreshCompositionOverlay = () => {
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: exports.container, children: (0, jsx_runtime_1.jsx)("div", { style: shadow, children: (0, jsx_runtime_1.jsx)(RunningCalculateMetadata_1.RunningCalculateMetadata, {}) }) }));
|
|
18
|
+
};
|
|
19
|
+
exports.RefreshCompositionOverlay = RefreshCompositionOverlay;
|
|
@@ -29,7 +29,7 @@ const react_1 = __importStar(require("react"));
|
|
|
29
29
|
const remotion_1 = require("remotion");
|
|
30
30
|
const colors_1 = require("../../helpers/colors");
|
|
31
31
|
const styles_1 = require("../Menu/styles");
|
|
32
|
-
const
|
|
32
|
+
const RunningCalculateMetadata_1 = require("../RunningCalculateMetadata");
|
|
33
33
|
const layout_1 = require("../layout");
|
|
34
34
|
const loaderContainer = {
|
|
35
35
|
paddingTop: 40,
|
|
@@ -72,7 +72,7 @@ const ResolveCompositionBeforeModal = ({ compositionId, children }) => {
|
|
|
72
72
|
};
|
|
73
73
|
}, [resolved, unresolved]);
|
|
74
74
|
if (!resolved || resolved.type === 'loading') {
|
|
75
|
-
return (
|
|
75
|
+
return (0, jsx_runtime_1.jsx)(RunningCalculateMetadata_1.RunningCalculateMetadata, {});
|
|
76
76
|
}
|
|
77
77
|
if (resolved.type === 'error') {
|
|
78
78
|
return ((0, jsx_runtime_1.jsxs)("div", { style: loaderContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2 }), (0, jsx_runtime_1.jsxs)("div", { style: loaderLabel, children: ["Running ", (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "calculateMetadata()" }), ' ', "yielded an error:"] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)("div", { style: loaderLabel, children: resolved.error.message || 'Unknown error' })] }));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RunningCalculateMetadata = exports.loaderLabel = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
const styles_1 = require("./Menu/styles");
|
|
7
|
+
const Spinner_1 = require("./Spinner");
|
|
8
|
+
const layout_1 = require("./layout");
|
|
9
|
+
exports.loaderLabel = {
|
|
10
|
+
fontSize: 14,
|
|
11
|
+
color: colors_1.LIGHT_TEXT,
|
|
12
|
+
fontFamily: 'sans-serif',
|
|
13
|
+
lineHeight: 1.5,
|
|
14
|
+
};
|
|
15
|
+
const container = {
|
|
16
|
+
backgroundColor: colors_1.BACKGROUND,
|
|
17
|
+
display: 'inline-flex',
|
|
18
|
+
justifyContent: 'center',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
flexDirection: 'row',
|
|
21
|
+
padding: 20,
|
|
22
|
+
};
|
|
23
|
+
const RunningCalculateMetadata = () => {
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { size: 24, duration: 1 }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsxs)("div", { style: exports.loaderLabel, children: ["Running ", (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "calculateMetadata()" }), "..."] })] }));
|
|
25
|
+
};
|
|
26
|
+
exports.RunningCalculateMetadata = RunningCalculateMetadata;
|
|
@@ -5,7 +5,7 @@ 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 viewBox = 100;
|
|
8
|
-
const lines =
|
|
8
|
+
const lines = 8;
|
|
9
9
|
const className = '__remotion_spinner_line';
|
|
10
10
|
const remotionSpinnerAnimation = '__remotion_spinner_animation';
|
|
11
11
|
// Generated from https://github.com/remotion-dev/template-next/commit/9282c93f7c51ada31a42e18a94680fa09a14eee3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TrackWithHash } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
3
|
export declare const TimelineTracks: React.FC<{
|
|
4
|
-
timeline: TrackWithHash[];
|
|
5
|
-
hasBeenCut: boolean;
|
|
4
|
+
readonly timeline: TrackWithHash[];
|
|
5
|
+
readonly hasBeenCut: boolean;
|
|
6
6
|
}>;
|