@remotion/cli 4.0.0-alpha.185 → 4.0.0-alpha.217
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/ansi/ansi-split.d.ts +1 -0
- package/dist/ansi/ansi-split.js +16 -3
- package/dist/benchmark.js +3 -0
- package/dist/color-math.d.ts +2 -1
- package/dist/color-math.js +2 -3
- package/dist/composition-prompts.d.ts +3 -4
- package/dist/composition-prompts.js +0 -1
- package/dist/compositions.js +3 -0
- package/dist/config/browser.d.ts +1 -3
- package/dist/config/browser.js +2 -12
- package/dist/config/index.d.ts +11 -2
- package/dist/config/index.js +6 -1
- package/dist/config/scale.d.ts +2 -1
- package/dist/config/user-agent.d.ts +4 -0
- package/dist/config/user-agent.js +12 -0
- package/dist/download-progress.js +7 -2
- package/dist/editor/components/EditorContexts.js +2 -1
- package/dist/editor/components/Menu/MenuSubItem.d.ts +0 -1
- package/dist/editor/components/Menu/MenuSubItem.js +1 -2
- package/dist/editor/components/ModalContainer.d.ts +2 -0
- package/dist/editor/components/ModalContainer.js +12 -3
- package/dist/editor/components/Modals.js +1 -1
- package/dist/editor/components/NewComposition/InputDragger.d.ts +1 -0
- package/dist/editor/components/NewComposition/InputDragger.js +2 -2
- package/dist/editor/components/NewComposition/NewCompDuration.js +1 -1
- package/dist/editor/components/NewComposition/NewComposition.js +8 -5
- package/dist/editor/components/NewComposition/RemInput.d.ts +2 -1
- package/dist/editor/components/NewComposition/RemInput.js +3 -2
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +0 -1
- package/dist/editor/components/NewComposition/RemInputTypeColor.js +3 -3
- package/dist/editor/components/NewComposition/ValidationMessage.js +2 -2
- package/dist/editor/components/Notifications/ServerDisconnected.d.ts +0 -4
- package/dist/editor/components/Notifications/ServerDisconnected.js +1 -2
- package/dist/editor/components/PlaybackRateSelector.d.ts +0 -2
- package/dist/editor/components/PlaybackRateSelector.js +5 -6
- package/dist/editor/components/Preview.d.ts +0 -1
- package/dist/editor/components/Preview.js +4 -4
- package/dist/editor/components/PreviewToolbar.js +1 -1
- package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/editor/components/QuickSwitcher/algolia-search.d.ts +0 -27
- package/dist/editor/components/QuickSwitcher/algolia-search.js +2 -3
- package/dist/editor/components/RenderButton.js +9 -2
- package/dist/editor/components/RenderModal/CrfSetting.js +1 -1
- package/dist/editor/components/RenderModal/EnvInput.js +1 -1
- package/dist/editor/components/RenderModal/FrameRangeSetting.js +1 -1
- package/dist/editor/components/RenderModal/NumberOfLoopsSetting.js +1 -1
- package/dist/editor/components/RenderModal/NumberSetting.js +1 -1
- package/dist/editor/components/RenderModal/RenderModal.d.ts +1 -0
- package/dist/editor/components/RenderModal/RenderModal.js +20 -11
- package/dist/editor/components/RenderModal/RenderModalAudio.js +1 -1
- package/dist/editor/components/RenderModal/RenderModalBasic.js +1 -1
- package/dist/editor/components/RenderModal/RenderModalData.js +116 -13
- package/dist/editor/components/RenderModal/RenderModalInput.js +1 -1
- package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.d.ts +1 -2
- package/dist/editor/components/RenderModal/RenderModalPicture.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +9 -42
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +11 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +55 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +10 -5
- package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +17 -9
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +7 -3
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +7 -3
- package/dist/editor/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +10 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +6 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +10 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +11 -4
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +6 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +30 -18
- package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +12 -8
- package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.d.ts +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.js +62 -57
- package/dist/editor/components/RenderModal/WarningIndicatorButton.d.ts +6 -0
- package/dist/editor/components/RenderModal/WarningIndicatorButton.js +49 -0
- package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +11 -0
- package/dist/editor/components/RenderModal/get-render-modal-warnings.js +26 -0
- package/dist/editor/components/RenderModal/layout.js +0 -1
- package/dist/editor/components/RenderModal/out-name-checker.d.ts +0 -1
- package/dist/editor/components/RenderModal/out-name-checker.js +3 -3
- package/dist/editor/components/RenderQueue/actions.d.ts +0 -2
- package/dist/editor/components/RenderQueue/actions.js +10 -11
- package/dist/editor/components/RenderQueue/index.js +25 -1
- package/dist/editor/components/RenderToolbarIcon.js +25 -10
- package/dist/editor/components/SegmentedControl.d.ts +0 -5
- package/dist/editor/components/SegmentedControl.js +2 -3
- package/dist/editor/components/SizeSelector.d.ts +0 -1
- package/dist/editor/components/SizeSelector.js +3 -3
- package/dist/editor/components/Splitter/SplitterElement.js +1 -0
- package/dist/editor/components/Splitter/SplitterHandle.d.ts +0 -1
- package/dist/editor/components/Splitter/SplitterHandle.js +6 -6
- package/dist/editor/components/Tabs/index.d.ts +0 -1
- package/dist/editor/components/Tabs/index.js +3 -3
- package/dist/editor/components/Tabs/vertical.d.ts +0 -5
- package/dist/editor/components/Tabs/vertical.js +3 -17
- package/dist/editor/components/TimeValue.js +3 -4
- package/dist/editor/components/Timeline/TimelineListItem.js +9 -1
- package/dist/editor/components/Timeline/imperative-state.d.ts +0 -4
- package/dist/editor/components/Timeline/imperative-state.js +13 -13
- package/dist/editor/components/Timeline/timeline-scroll-logic.d.ts +0 -1
- package/dist/editor/components/Timeline/timeline-scroll-logic.js +5 -6
- package/dist/editor/components/ZoomPersistor.d.ts +0 -1
- package/dist/editor/components/ZoomPersistor.js +2 -3
- package/dist/editor/components/get-zod-if-possible.d.ts +10 -0
- package/dist/editor/components/get-zod-if-possible.js +79 -0
- package/dist/editor/helpers/calculate-timeline.d.ts +0 -4
- package/dist/editor/helpers/colors.d.ts +0 -1
- package/dist/editor/helpers/colors.js +3 -3
- package/dist/editor/helpers/create-folder-tree.d.ts +0 -1
- package/dist/editor/helpers/create-folder-tree.js +3 -4
- package/dist/editor/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
- package/dist/editor/icons/caret.d.ts +4 -2
- package/dist/editor/icons/caret.js +17 -3
- package/dist/editor/state/keybindings.d.ts +2 -1
- package/dist/editor/state/modals.d.ts +1 -0
- package/dist/editor/state/preview-size.d.ts +0 -1
- package/dist/editor/state/preview-size.js +3 -4
- package/dist/editor/state/sidebar.d.ts +1 -1
- package/dist/editor/state/timeline-ref.d.ts +2 -1
- package/dist/editor/state/z-index.d.ts +0 -5
- package/dist/editor/state/z-index.js +8 -5
- package/dist/get-cli-options.js +1 -0
- package/dist/get-config-file-name.d.ts +0 -2
- package/dist/get-config-file-name.js +7 -7
- package/dist/index.d.ts +52 -1
- package/dist/list-of-remotion-packages.js +1 -0
- package/dist/parse-command-line.d.ts +3 -1
- package/dist/parse-command-line.js +3 -0
- package/dist/preview-server/api-types.d.ts +0 -4
- package/dist/preview-server/dev-middleware/middleware.d.ts +0 -1
- package/dist/preview-server/dev-middleware/middleware.js +1 -2
- package/dist/preview-server/error-overlay/remotion-overlay/Button.d.ts +8 -5
- package/dist/preview-server/error-overlay/remotion-overlay/Button.js +5 -4
- package/dist/preview-server/hot-middleware/client.js +2 -2
- package/dist/preview-server/public-folder.d.ts +0 -5
- package/dist/preview-server/public-folder.js +3 -4
- package/dist/preview-server/render-queue/job.d.ts +1 -1
- package/dist/preview-server/render-queue/make-retry-payload.js +2 -0
- package/dist/preview-server/render-queue/queue.d.ts +1 -13
- package/dist/preview-server/render-queue/queue.js +13 -9
- package/dist/progress-bar.d.ts +1 -12
- package/dist/progress-bar.js +4 -15
- package/dist/render-flows/render.js +3 -0
- package/dist/render-flows/still.js +6 -0
- package/dist/select-composition.d.ts +2 -1
- package/dist/setup-cache.d.ts +2 -14
- package/dist/setup-cache.js +6 -5
- package/package.json +10 -8
- package/dist/editor/components/CollapsedSidebarExpander.d.ts +0 -5
- package/dist/editor/components/CollapsedSidebarExpander.js +0 -40
- package/dist/editor/components/SidebarContent.d.ts +0 -5
- package/dist/editor/components/SidebarContent.js +0 -53
- package/dist/editor/icons/save.d.ts +0 -2
- package/dist/editor/icons/save.js +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canUpdateDefaultProps = exports.updateDefaultProps = exports.cancelRenderJob = exports.removeRenderJob = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addStillRenderJob =
|
|
3
|
+
exports.canUpdateDefaultProps = exports.updateDefaultProps = exports.cancelRenderJob = exports.removeRenderJob = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addStillRenderJob = void 0;
|
|
4
4
|
const date_serialization_1 = require("../RenderModal/SchemaEditor/date-serialization");
|
|
5
5
|
const callApi = (endpoint, body) => {
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
@@ -25,9 +25,8 @@ const callApi = (endpoint, body) => {
|
|
|
25
25
|
});
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
exports.callApi = callApi;
|
|
29
28
|
const addStillRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, frame, scale, verbose, chromiumOptions, delayRenderTimeout, envVariables, inputProps, }) => {
|
|
30
|
-
return
|
|
29
|
+
return callApi('/api/render', {
|
|
31
30
|
compositionId,
|
|
32
31
|
type: 'still',
|
|
33
32
|
outName,
|
|
@@ -44,7 +43,7 @@ const addStillRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, f
|
|
|
44
43
|
};
|
|
45
44
|
exports.addStillRenderJob = addStillRenderJob;
|
|
46
45
|
const addVideoRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, scale, verbose, codec, concurrency, crf, startFrame, endFrame, muted, enforceAudioTrack, proResProfile, pixelFormat, audioBitrate, videoBitrate, everyNthFrame, numberOfGifLoops, delayRenderTimeout, audioCodec, disallowParallelEncoding, chromiumOptions, envVariables, inputProps, }) => {
|
|
47
|
-
return
|
|
46
|
+
return callApi('/api/render', {
|
|
48
47
|
compositionId,
|
|
49
48
|
type: 'video',
|
|
50
49
|
outName,
|
|
@@ -75,11 +74,11 @@ const addVideoRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, s
|
|
|
75
74
|
};
|
|
76
75
|
exports.addVideoRenderJob = addVideoRenderJob;
|
|
77
76
|
const unsubscribeFromFileExistenceWatcher = ({ file, clientId, }) => {
|
|
78
|
-
return
|
|
77
|
+
return callApi('/api/unsubscribe-from-file-existence', { file, clientId });
|
|
79
78
|
};
|
|
80
79
|
exports.unsubscribeFromFileExistenceWatcher = unsubscribeFromFileExistenceWatcher;
|
|
81
80
|
const subscribeToFileExistenceWatcher = async ({ file, clientId, }) => {
|
|
82
|
-
const { exists } = await
|
|
81
|
+
const { exists } = await callApi('/api/subscribe-to-file-existence', {
|
|
83
82
|
file,
|
|
84
83
|
clientId,
|
|
85
84
|
});
|
|
@@ -90,30 +89,30 @@ const openInFileExplorer = ({ directory }) => {
|
|
|
90
89
|
const body = {
|
|
91
90
|
directory,
|
|
92
91
|
};
|
|
93
|
-
return
|
|
92
|
+
return callApi('/api/open-in-file-explorer', body);
|
|
94
93
|
};
|
|
95
94
|
exports.openInFileExplorer = openInFileExplorer;
|
|
96
95
|
const removeRenderJob = (job) => {
|
|
97
|
-
return
|
|
96
|
+
return callApi('/api/remove-render', {
|
|
98
97
|
jobId: job.id,
|
|
99
98
|
});
|
|
100
99
|
};
|
|
101
100
|
exports.removeRenderJob = removeRenderJob;
|
|
102
101
|
const cancelRenderJob = (job) => {
|
|
103
|
-
return
|
|
102
|
+
return callApi('/api/cancel', {
|
|
104
103
|
jobId: job.id,
|
|
105
104
|
});
|
|
106
105
|
};
|
|
107
106
|
exports.cancelRenderJob = cancelRenderJob;
|
|
108
107
|
const updateDefaultProps = (compositionId, defaultProps) => {
|
|
109
|
-
return
|
|
108
|
+
return callApi('/api/update-default-props', {
|
|
110
109
|
compositionId,
|
|
111
110
|
defaultProps: (0, date_serialization_1.serializeJSONWithDate)(defaultProps, undefined),
|
|
112
111
|
});
|
|
113
112
|
};
|
|
114
113
|
exports.updateDefaultProps = updateDefaultProps;
|
|
115
114
|
const canUpdateDefaultProps = (compositionId) => {
|
|
116
|
-
return
|
|
115
|
+
return callApi('/api/can-update-default-props', {
|
|
117
116
|
compositionId,
|
|
118
117
|
});
|
|
119
118
|
};
|
|
@@ -3,15 +3,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenderQueue = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
6
7
|
const colors_1 = require("../../helpers/colors");
|
|
8
|
+
const layout_1 = require("../layout");
|
|
7
9
|
const context_1 = require("./context");
|
|
8
10
|
const RenderQueueItem_1 = require("./RenderQueueItem");
|
|
9
11
|
const separatorStyle = {
|
|
10
12
|
borderBottom: `1px solid ${colors_1.BORDER_COLOR}`,
|
|
11
13
|
};
|
|
12
|
-
|
|
14
|
+
const errorExplanation = {
|
|
15
|
+
fontSize: 14,
|
|
16
|
+
color: colors_1.LIGHT_TEXT,
|
|
17
|
+
fontFamily: 'sans-serif',
|
|
18
|
+
lineHeight: 1.5,
|
|
19
|
+
};
|
|
20
|
+
const explainer = {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flex: 1,
|
|
23
|
+
flexDirection: 'column',
|
|
24
|
+
padding: '0 12px',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
textAlign: 'center',
|
|
28
|
+
};
|
|
13
29
|
const RenderQueue = () => {
|
|
30
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type;
|
|
14
31
|
const { jobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
32
|
+
const jobCount = jobs.length;
|
|
33
|
+
if (connectionStatus === 'disconnected') {
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "The preview server has disconnected." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
|
|
35
|
+
}
|
|
36
|
+
if (jobCount === 0) {
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "No renders in the queue." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
|
|
38
|
+
}
|
|
15
39
|
return ((0, jsx_runtime_1.jsx)("div", { children: jobs.map((j, index) => {
|
|
16
40
|
return ((0, jsx_runtime_1.jsx)("div", { style: index === jobs.length - 1 ? undefined : separatorStyle, children: (0, jsx_runtime_1.jsx)(RenderQueueItem_1.RenderQueueItem, { job: j }) }, j.id));
|
|
17
41
|
}) }));
|
|
@@ -2,33 +2,45 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RenderButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const client_1 = require("@remotion/renderer/client");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const remotion_1 = require("remotion");
|
|
7
8
|
const get_default_out_name_1 = require("../../get-default-out-name");
|
|
9
|
+
const Button_1 = require("../../preview-server/error-overlay/remotion-overlay/Button");
|
|
8
10
|
const get_default_video_contexts_1 = require("../../preview-server/render-queue/get-default-video-contexts");
|
|
9
11
|
const client_id_1 = require("../helpers/client-id");
|
|
10
12
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
11
13
|
const render_1 = require("../icons/render");
|
|
12
14
|
const modals_1 = require("../state/modals");
|
|
13
|
-
const
|
|
15
|
+
const layout_1 = require("./layout");
|
|
16
|
+
const button = {
|
|
17
|
+
paddingLeft: 7,
|
|
18
|
+
paddingRight: 7,
|
|
19
|
+
paddingTop: 7,
|
|
20
|
+
paddingBottom: 7,
|
|
21
|
+
};
|
|
22
|
+
const label = {
|
|
23
|
+
fontSize: 14,
|
|
24
|
+
};
|
|
14
25
|
const RenderButton = () => {
|
|
15
26
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
16
27
|
const { type } = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx);
|
|
28
|
+
const shortcut = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? '' : '(R)';
|
|
29
|
+
const tooltip = type === 'connected'
|
|
30
|
+
? 'Export the current composition ' + shortcut
|
|
31
|
+
: 'Connect to the preview server to render';
|
|
17
32
|
const iconStyle = (0, react_1.useMemo)(() => {
|
|
18
33
|
return {
|
|
19
34
|
style: {
|
|
20
|
-
height:
|
|
35
|
+
height: 16,
|
|
21
36
|
},
|
|
22
37
|
};
|
|
23
38
|
}, []);
|
|
24
|
-
const shortcut = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? '' : '(R)';
|
|
25
|
-
const tooltip = type === 'connected'
|
|
26
|
-
? 'Export the current composition ' + shortcut
|
|
27
|
-
: 'Connect to the preview server to render';
|
|
28
39
|
const video = remotion_1.Internals.useVideo();
|
|
29
40
|
const frame = (0, remotion_1.useCurrentFrame)();
|
|
41
|
+
const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
30
42
|
const onClick = (0, react_1.useCallback)(() => {
|
|
31
|
-
var _a, _b;
|
|
43
|
+
var _a, _b, _c;
|
|
32
44
|
if (!video) {
|
|
33
45
|
return null;
|
|
34
46
|
}
|
|
@@ -49,7 +61,9 @@ const RenderButton = () => {
|
|
|
49
61
|
initialVideoImageFormat: defaults.videoImageFormat,
|
|
50
62
|
initialOutName: (0, get_default_out_name_1.getDefaultOutLocation)({
|
|
51
63
|
compositionName: video.id,
|
|
52
|
-
defaultExtension: isVideo
|
|
64
|
+
defaultExtension: isVideo
|
|
65
|
+
? client_1.BrowserSafeApis.getFileExtensionFromCodec(initialVideoCodec, defaults.audioCodec)
|
|
66
|
+
: defaults.stillImageFormat,
|
|
53
67
|
type: 'asset',
|
|
54
68
|
}),
|
|
55
69
|
initialJpegQuality: defaults.jpegQuality,
|
|
@@ -76,11 +90,12 @@ const RenderButton = () => {
|
|
|
76
90
|
initialOpenGlRenderer: defaults.openGlRenderer,
|
|
77
91
|
initialHeadless: defaults.headless,
|
|
78
92
|
initialIgnoreCertificateErrors: defaults.ignoreCertificateErrors,
|
|
93
|
+
defaultProps: (_c = props[video.id]) !== null && _c !== void 0 ? _c : video.defaultProps,
|
|
79
94
|
});
|
|
80
|
-
}, [video, frame,
|
|
95
|
+
}, [video, setSelectedModal, frame, props]);
|
|
81
96
|
if (!video) {
|
|
82
97
|
return null;
|
|
83
98
|
}
|
|
84
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
99
|
+
return ((0, jsx_runtime_1.jsx)(Button_1.Button, { id: "render-modal-button", title: tooltip, onClick: onClick, buttonContainerStyle: button, children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)(render_1.RenderIcon, { svgProps: iconStyle }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("span", { style: label, children: "Render" })] }) }));
|
|
85
100
|
};
|
|
86
101
|
exports.RenderButton = RenderButton;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { PropsWithChildren } from 'react';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
export declare type SegmentedControlItem = {
|
|
4
3
|
label: React.ReactNode;
|
|
@@ -10,7 +9,3 @@ export declare const SegmentedControl: React.FC<{
|
|
|
10
9
|
items: SegmentedControlItem[];
|
|
11
10
|
needsWrapping: boolean;
|
|
12
11
|
}>;
|
|
13
|
-
export declare const Item: React.FC<PropsWithChildren<{
|
|
14
|
-
selected: boolean;
|
|
15
|
-
onClick: () => void;
|
|
16
|
-
}>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SegmentedControl = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
@@ -38,7 +38,7 @@ const SegmentedControl = ({ items, needsWrapping }) => {
|
|
|
38
38
|
};
|
|
39
39
|
}, [needsWrapping]);
|
|
40
40
|
return ((0, jsx_runtime_1.jsx)("div", { style: controlStyle, children: items.map((i) => {
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(Item, { onClick: i.onClick, selected: i.selected, children: i.label }, i.key));
|
|
42
42
|
}) }));
|
|
43
43
|
};
|
|
44
44
|
exports.SegmentedControl = SegmentedControl;
|
|
@@ -60,4 +60,3 @@ const Item = ({ selected, onClick, children }) => {
|
|
|
60
60
|
}, [hovered, selected]);
|
|
61
61
|
return ((0, jsx_runtime_1.jsx)("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: itemStyle, tabIndex: tabIndex, onClick: onClick, children: children }));
|
|
62
62
|
};
|
|
63
|
-
exports.Item = Item;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PreviewSize } from '@remotion/player';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const commonPreviewSizes: PreviewSize[];
|
|
4
3
|
export declare const getPreviewSizeLabel: (previewSize: PreviewSize) => string;
|
|
5
4
|
export declare const getUniqueSizes: (size: PreviewSize) => PreviewSize[];
|
|
6
5
|
export declare const SizeSelector: React.FC;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SizeSelector = exports.getUniqueSizes = exports.getPreviewSizeLabel =
|
|
3
|
+
exports.SizeSelector = exports.getUniqueSizes = exports.getPreviewSizeLabel = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const Checkmark_1 = require("../icons/Checkmark");
|
|
7
7
|
const preview_size_1 = require("../state/preview-size");
|
|
8
8
|
const ControlButton_1 = require("./ControlButton");
|
|
9
9
|
const ComboBox_1 = require("./NewComposition/ComboBox");
|
|
10
|
-
|
|
10
|
+
const commonPreviewSizes = [
|
|
11
11
|
{
|
|
12
12
|
size: 'auto',
|
|
13
13
|
translation: {
|
|
@@ -47,7 +47,7 @@ exports.getPreviewSizeLabel = getPreviewSizeLabel;
|
|
|
47
47
|
const accessibilityLabel = 'Preview Size';
|
|
48
48
|
const comboStyle = { width: 80 };
|
|
49
49
|
const getUniqueSizes = (size) => {
|
|
50
|
-
const customPreviewSizes = [size, ...
|
|
50
|
+
const customPreviewSizes = [size, ...commonPreviewSizes];
|
|
51
51
|
const uniqueSizes = [];
|
|
52
52
|
customPreviewSizes.forEach((p) => {
|
|
53
53
|
if (!uniqueSizes.find((s) => s.size === p.size)) {
|
|
@@ -14,6 +14,7 @@ const SplitterElement = ({ children, type }) => {
|
|
|
14
14
|
display: 'flex',
|
|
15
15
|
position: 'relative',
|
|
16
16
|
overflow: 'hidden',
|
|
17
|
+
flexDirection: 'column',
|
|
17
18
|
};
|
|
18
19
|
}, [context.flexValue, type]);
|
|
19
20
|
return (0, jsx_runtime_1.jsx)("div", { style: style, children: children });
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SplitterHandle =
|
|
3
|
+
exports.SplitterHandle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const player_1 = require("@remotion/player");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const SplitterContext_1 = require("./SplitterContext");
|
|
8
|
-
|
|
8
|
+
const SPLITTER_HANDLE_SIZE = 3;
|
|
9
9
|
const containerRow = {
|
|
10
|
-
height:
|
|
10
|
+
height: SPLITTER_HANDLE_SIZE,
|
|
11
11
|
cursor: 'row-resize',
|
|
12
12
|
};
|
|
13
13
|
const containerColumn = {
|
|
14
|
-
width:
|
|
14
|
+
width: SPLITTER_HANDLE_SIZE,
|
|
15
15
|
cursor: 'col-resize',
|
|
16
16
|
};
|
|
17
17
|
const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
@@ -43,10 +43,10 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
43
43
|
const change = (() => {
|
|
44
44
|
if (context.orientation === 'vertical') {
|
|
45
45
|
return ((e.clientX - context.isDragging.current.x) /
|
|
46
|
-
(width -
|
|
46
|
+
(width - SPLITTER_HANDLE_SIZE));
|
|
47
47
|
}
|
|
48
48
|
return ((e.clientY - context.isDragging.current.y) /
|
|
49
|
-
(height -
|
|
49
|
+
(height - SPLITTER_HANDLE_SIZE));
|
|
50
50
|
})();
|
|
51
51
|
const newFlex = context.flexValue + change;
|
|
52
52
|
if (clamp) {
|
|
@@ -3,7 +3,6 @@ export declare const Tabs: React.FC<{
|
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
5
|
}>;
|
|
6
|
-
export declare const selectorButton: React.CSSProperties;
|
|
7
6
|
export declare const Tab: React.FC<{
|
|
8
7
|
children: React.ReactNode;
|
|
9
8
|
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Tab = exports.
|
|
3
|
+
exports.Tab = exports.Tabs = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../../helpers/colors");
|
|
@@ -19,7 +19,7 @@ const Tabs = ({ children, style }) => {
|
|
|
19
19
|
return (0, jsx_runtime_1.jsx)("div", { style: definiteStyle, children: children });
|
|
20
20
|
};
|
|
21
21
|
exports.Tabs = Tabs;
|
|
22
|
-
|
|
22
|
+
const selectorButton = {
|
|
23
23
|
border: 'none',
|
|
24
24
|
flex: 1,
|
|
25
25
|
padding: 8,
|
|
@@ -41,7 +41,7 @@ const Tab = ({ children, onClick, style, selected }) => {
|
|
|
41
41
|
}, []);
|
|
42
42
|
const definiteStyle = (0, react_1.useMemo)(() => {
|
|
43
43
|
return {
|
|
44
|
-
...
|
|
44
|
+
...selectorButton,
|
|
45
45
|
backgroundColor: selected
|
|
46
46
|
? 'transparent'
|
|
47
47
|
: hovered
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const VerticalTabs: React.FC<{
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
style?: React.CSSProperties;
|
|
5
|
-
}>;
|
|
6
|
-
export declare const selectorButton: React.CSSProperties;
|
|
7
2
|
export declare const VerticalTab: React.FC<{
|
|
8
3
|
children: React.ReactNode;
|
|
9
4
|
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VerticalTab =
|
|
3
|
+
exports.VerticalTab = void 0;
|
|
4
4
|
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 z_index_1 = require("../../state/z-index");
|
|
8
|
-
const
|
|
9
|
-
display: 'flex',
|
|
10
|
-
flexDirection: 'row',
|
|
11
|
-
};
|
|
12
|
-
const VerticalTabs = ({ children, style }) => {
|
|
13
|
-
const definiteStyle = (0, react_1.useMemo)(() => {
|
|
14
|
-
return {
|
|
15
|
-
...tabsContainer,
|
|
16
|
-
...style,
|
|
17
|
-
};
|
|
18
|
-
}, [style]);
|
|
19
|
-
return (0, jsx_runtime_1.jsx)("div", { style: definiteStyle, children: children });
|
|
20
|
-
};
|
|
21
|
-
exports.VerticalTabs = VerticalTabs;
|
|
22
|
-
exports.selectorButton = {
|
|
8
|
+
const selectorButton = {
|
|
23
9
|
border: 'none',
|
|
24
10
|
flex: 1,
|
|
25
11
|
padding: 8,
|
|
@@ -41,7 +27,7 @@ const VerticalTab = ({ children, onClick, style, selected }) => {
|
|
|
41
27
|
}, []);
|
|
42
28
|
const definiteStyle = (0, react_1.useMemo)(() => {
|
|
43
29
|
return {
|
|
44
|
-
...
|
|
30
|
+
...selectorButton,
|
|
45
31
|
backgroundColor: selected
|
|
46
32
|
? colors_1.SELECTED_BACKGROUND
|
|
47
33
|
: hovered
|
|
@@ -18,14 +18,13 @@ const text = {
|
|
|
18
18
|
const time = {
|
|
19
19
|
display: 'inline-block',
|
|
20
20
|
fontSize: 18,
|
|
21
|
+
lineHeight: 1,
|
|
21
22
|
};
|
|
22
23
|
const frameStyle = {
|
|
23
24
|
color: '#ccc',
|
|
24
25
|
fontSize: 10,
|
|
25
26
|
fontWeight: 500,
|
|
26
|
-
|
|
27
|
-
const spacer = {
|
|
28
|
-
width: layout_1.SPACING_UNIT,
|
|
27
|
+
lineHeight: 1,
|
|
29
28
|
};
|
|
30
29
|
const TimeValue = () => {
|
|
31
30
|
const frame = (0, remotion_1.useCurrentFrame)();
|
|
@@ -37,6 +36,6 @@ const TimeValue = () => {
|
|
|
37
36
|
if (isStill) {
|
|
38
37
|
return null;
|
|
39
38
|
}
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: text, children: [(0, jsx_runtime_1.jsx)("div", { style: time, children: (0, render_frame_1.renderFrame)(frame, config.fps) }),
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: text, children: [(0, jsx_runtime_1.jsx)("div", { style: time, children: (0, render_frame_1.renderFrame)(frame, config.fps) }), " ", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsxs)("div", { style: frameStyle, children: [frame, " ", (0, jsx_runtime_1.jsxs)("span", { style: frameStyle, children: ["(", config.fps, " fps)"] })] })] }));
|
|
41
40
|
};
|
|
42
41
|
exports.TimeValue = TimeValue;
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const colors_1 = require("../../helpers/colors");
|
|
7
7
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
8
8
|
const z_index_1 = require("../../state/z-index");
|
|
9
|
+
const layout_1 = require("../layout");
|
|
9
10
|
const TimelineCollapseToggle_1 = require("./TimelineCollapseToggle");
|
|
10
11
|
const TimelineSequenceFrame_1 = require("./TimelineSequenceFrame");
|
|
11
12
|
const HOOK_WIDTH = 7;
|
|
@@ -17,6 +18,9 @@ const TIMELINE_COLLAPSER_MARGIN_RIGHT = 10;
|
|
|
17
18
|
exports.TOTAL_TIMELINE_LAYER_LEFT_PADDING = TIMELINE_COLLAPSER_WIDTH + TIMELINE_COLLAPSER_MARGIN_RIGHT + timeline_layout_1.TIMELINE_PADDING;
|
|
18
19
|
const textStyle = {
|
|
19
20
|
fontSize: 13,
|
|
21
|
+
whiteSpace: 'nowrap',
|
|
22
|
+
textOverflow: 'ellipsis',
|
|
23
|
+
overflow: 'hidden',
|
|
20
24
|
};
|
|
21
25
|
const outer = {
|
|
22
26
|
height: timeline_layout_1.TIMELINE_LAYER_HEIGHT + timeline_layout_1.TIMELINE_BORDER * 2,
|
|
@@ -44,14 +48,17 @@ const hook = {
|
|
|
44
48
|
};
|
|
45
49
|
const space = {
|
|
46
50
|
width: SPACING,
|
|
51
|
+
flexShrink: 0,
|
|
47
52
|
};
|
|
48
53
|
const smallSpace = {
|
|
49
54
|
width: SPACING * 0.5,
|
|
55
|
+
flexShrink: 0,
|
|
50
56
|
};
|
|
51
57
|
const collapser = {
|
|
52
58
|
width: TIMELINE_COLLAPSER_WIDTH,
|
|
53
59
|
userSelect: 'none',
|
|
54
60
|
marginRight: TIMELINE_COLLAPSER_MARGIN_RIGHT,
|
|
61
|
+
flexShrink: 0,
|
|
55
62
|
};
|
|
56
63
|
const collapserButton = {
|
|
57
64
|
...collapser,
|
|
@@ -72,6 +79,7 @@ const TimelineListItem = ({ nestedDepth, sequence, collapsed, beforeDepth, dispa
|
|
|
72
79
|
const padder = (0, react_1.useMemo)(() => {
|
|
73
80
|
return {
|
|
74
81
|
width: leftOffset * nestedDepth,
|
|
82
|
+
flexShrink: 0,
|
|
75
83
|
};
|
|
76
84
|
}, [leftOffset, nestedDepth]);
|
|
77
85
|
const toggleCollapse = (0, react_1.useCallback)(() => {
|
|
@@ -91,6 +99,6 @@ const TimelineListItem = ({ nestedDepth, sequence, collapsed, beforeDepth, dispa
|
|
|
91
99
|
const text = sequence.displayName.length > 80
|
|
92
100
|
? sequence.displayName.slice(0, 80) + '...'
|
|
93
101
|
: sequence.displayName;
|
|
94
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsx)("div", { style: padder }), canCollapse ? ((0, jsx_runtime_1.jsx)("button", { tabIndex: tabIndex, type: "button", style: collapserButton, onClick: toggleCollapse, children: (0, jsx_runtime_1.jsx)(TimelineCollapseToggle_1.TimelineCollapseToggle, { color: colors_1.LIGHT_COLOR, collapsed: collapsed }) })) : ((0, jsx_runtime_1.jsx)("div", { style: collapser })), sequence.parent && nestedDepth > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: smallSpace }), (0, jsx_runtime_1.jsx)("div", { style: hookContainer, children: (0, jsx_runtime_1.jsx)("div", { style: hookStyle }) }), (0, jsx_runtime_1.jsx)("div", { style: space })] })) : null, (0, jsx_runtime_1.jsxs)("div", { style: textStyle, children: [text || 'Untitled', (0, jsx_runtime_1.jsx)(TimelineSequenceFrame_1.TimelineSequenceFrame, { duration: sequence.duration, from: sequence.from })] })] }));
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsx)("div", { style: padder }), canCollapse ? ((0, jsx_runtime_1.jsx)("button", { tabIndex: tabIndex, type: "button", style: collapserButton, onClick: toggleCollapse, children: (0, jsx_runtime_1.jsx)(TimelineCollapseToggle_1.TimelineCollapseToggle, { color: colors_1.LIGHT_COLOR, collapsed: collapsed }) })) : ((0, jsx_runtime_1.jsx)("div", { style: collapser })), sequence.parent && nestedDepth > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: smallSpace }), (0, jsx_runtime_1.jsx)("div", { style: hookContainer, children: (0, jsx_runtime_1.jsx)("div", { style: hookStyle }) }), (0, jsx_runtime_1.jsx)("div", { style: space })] })) : null, (0, jsx_runtime_1.jsxs)("div", { title: text || 'Untitled', style: textStyle, children: [text || 'Untitled', (0, jsx_runtime_1.jsx)(TimelineSequenceFrame_1.TimelineSequenceFrame, { duration: sequence.duration, from: sequence.from })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 })] }));
|
|
95
103
|
};
|
|
96
104
|
exports.TimelineListItem = TimelineListItem;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export declare let currentFrame: number;
|
|
2
|
-
export declare let currentZoom: number;
|
|
3
|
-
export declare let currentDuration: number;
|
|
4
|
-
export declare let currentFps: number;
|
|
5
1
|
export declare const getCurrentZoom: () => number;
|
|
6
2
|
export declare const setCurrentZoom: (z: number) => void;
|
|
7
3
|
export declare const getCurrentFrame: () => number;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setCurrentFps = exports.getCurrentFps = exports.setCurrentDuration = exports.getCurrentDuration = exports.setCurrentFrame = exports.getCurrentFrame = exports.setCurrentZoom = exports.getCurrentZoom =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
exports.setCurrentFps = exports.getCurrentFps = exports.setCurrentDuration = exports.getCurrentDuration = exports.setCurrentFrame = exports.getCurrentFrame = exports.setCurrentZoom = exports.getCurrentZoom = void 0;
|
|
4
|
+
let currentFrame = 0;
|
|
5
|
+
let currentZoom = 1;
|
|
6
|
+
let currentDuration = 1;
|
|
7
|
+
let currentFps = 1;
|
|
8
8
|
const getCurrentZoom = () => {
|
|
9
|
-
return
|
|
9
|
+
return currentZoom;
|
|
10
10
|
};
|
|
11
11
|
exports.getCurrentZoom = getCurrentZoom;
|
|
12
12
|
const setCurrentZoom = (z) => {
|
|
13
|
-
|
|
13
|
+
currentZoom = z;
|
|
14
14
|
};
|
|
15
15
|
exports.setCurrentZoom = setCurrentZoom;
|
|
16
16
|
const getCurrentFrame = () => {
|
|
17
|
-
return
|
|
17
|
+
return currentFrame;
|
|
18
18
|
};
|
|
19
19
|
exports.getCurrentFrame = getCurrentFrame;
|
|
20
20
|
const setCurrentFrame = (f) => {
|
|
21
|
-
|
|
21
|
+
currentFrame = f;
|
|
22
22
|
};
|
|
23
23
|
exports.setCurrentFrame = setCurrentFrame;
|
|
24
24
|
const getCurrentDuration = () => {
|
|
25
|
-
return
|
|
25
|
+
return currentDuration;
|
|
26
26
|
};
|
|
27
27
|
exports.getCurrentDuration = getCurrentDuration;
|
|
28
28
|
const setCurrentDuration = (d) => {
|
|
29
|
-
|
|
29
|
+
currentDuration = d;
|
|
30
30
|
};
|
|
31
31
|
exports.setCurrentDuration = setCurrentDuration;
|
|
32
32
|
const getCurrentFps = () => {
|
|
33
|
-
return
|
|
33
|
+
return currentFps;
|
|
34
34
|
};
|
|
35
35
|
exports.getCurrentFps = getCurrentFps;
|
|
36
36
|
const setCurrentFps = (d) => {
|
|
37
|
-
|
|
37
|
+
currentFps = d;
|
|
38
38
|
};
|
|
39
39
|
exports.setCurrentFps = setCurrentFps;
|
|
@@ -24,7 +24,6 @@ export declare const getScrollPositionForCursorOnRightEdge: ({ nextFrame, durati
|
|
|
24
24
|
nextFrame: number;
|
|
25
25
|
durationInFrames: number;
|
|
26
26
|
}) => number;
|
|
27
|
-
export declare const getFrameIncrement: (durationInFrames: number) => number;
|
|
28
27
|
export declare const getFrameIncrementFromWidth: (durationInFrames: number, width: number) => number;
|
|
29
28
|
export declare const getFrameWhileScrollingRight: ({ durationInFrames, width, }: {
|
|
30
29
|
durationInFrames: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zoomAndPreserveCursor = exports.getFrameFromX = exports.getFrameWhileScrollingRight = exports.getFrameIncrementFromWidth = exports.
|
|
3
|
+
exports.zoomAndPreserveCursor = exports.getFrameFromX = exports.getFrameWhileScrollingRight = exports.getFrameIncrementFromWidth = exports.getScrollPositionForCursorOnRightEdge = exports.getScrollPositionForCursorOnLeftEdge = exports.scrollToTimelineXOffset = exports.ensureFrameIsInViewport = exports.isCursorInViewport = exports.getFrameWhileScrollingLeft = exports.canScrollTimelineIntoDirection = void 0;
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
5
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
6
6
|
const timeline_refs_1 = require("./timeline-refs");
|
|
@@ -23,7 +23,7 @@ const calculateFrameWhileScrollingRight = ({ durationInFrames, width, scrollLeft
|
|
|
23
23
|
extrapolate: 'clamp',
|
|
24
24
|
}) +
|
|
25
25
|
Math.ceil((((_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) - timeline_layout_1.TIMELINE_PADDING) /
|
|
26
|
-
|
|
26
|
+
getFrameIncrement(durationInFrames)));
|
|
27
27
|
};
|
|
28
28
|
const getFrameWhileScrollingLeft = ({ durationInFrames, width, }) => {
|
|
29
29
|
var _a, _b;
|
|
@@ -145,14 +145,14 @@ const scrollToTimelineXOffset = (scrollPos) => {
|
|
|
145
145
|
};
|
|
146
146
|
exports.scrollToTimelineXOffset = scrollToTimelineXOffset;
|
|
147
147
|
const getScrollPositionForCursorOnLeftEdge = ({ nextFrame, durationInFrames, }) => {
|
|
148
|
-
const frameIncrement =
|
|
148
|
+
const frameIncrement = getFrameIncrement(durationInFrames);
|
|
149
149
|
const scrollPos = frameIncrement * nextFrame;
|
|
150
150
|
return scrollPos;
|
|
151
151
|
};
|
|
152
152
|
exports.getScrollPositionForCursorOnLeftEdge = getScrollPositionForCursorOnLeftEdge;
|
|
153
153
|
const getScrollPositionForCursorOnRightEdge = ({ nextFrame, durationInFrames, }) => {
|
|
154
154
|
var _a, _b;
|
|
155
|
-
const frameIncrement =
|
|
155
|
+
const frameIncrement = getFrameIncrement(durationInFrames);
|
|
156
156
|
const framesRemaining = durationInFrames - 1 - nextFrame;
|
|
157
157
|
const fromRight = framesRemaining * frameIncrement + timeline_layout_1.TIMELINE_PADDING;
|
|
158
158
|
const scrollPos = ((_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.scrollWidth) -
|
|
@@ -168,7 +168,6 @@ const getFrameIncrement = (durationInFrames) => {
|
|
|
168
168
|
const width = (_b = (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.scrollWidth) !== null && _b !== void 0 ? _b : 0;
|
|
169
169
|
return (0, exports.getFrameIncrementFromWidth)(durationInFrames, width);
|
|
170
170
|
};
|
|
171
|
-
exports.getFrameIncrement = getFrameIncrement;
|
|
172
171
|
const getFrameIncrementFromWidth = (durationInFrames, width) => {
|
|
173
172
|
return (width - timeline_layout_1.TIMELINE_PADDING * 2) / (durationInFrames - 1);
|
|
174
173
|
};
|
|
@@ -209,7 +208,7 @@ const zoomAndPreserveCursor = ({ oldZoom, newZoom, currentFrame, currentDuration
|
|
|
209
208
|
if (!current) {
|
|
210
209
|
return;
|
|
211
210
|
}
|
|
212
|
-
const frameIncrement =
|
|
211
|
+
const frameIncrement = getFrameIncrement(currentDurationInFrames);
|
|
213
212
|
const prevCursorPosition = frameIncrement * currentFrame + timeline_layout_1.TIMELINE_PADDING;
|
|
214
213
|
const newCursorPosition = ratio * (prevCursorPosition - timeline_layout_1.TIMELINE_PADDING) + timeline_layout_1.TIMELINE_PADDING;
|
|
215
214
|
current.scrollLeft += newCursorPosition - prevCursorPosition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZoomPersistor = exports.getZoomForComposition =
|
|
3
|
+
exports.ZoomPersistor = exports.getZoomForComposition = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const timeline_zoom_1 = require("../state/timeline-zoom");
|
|
@@ -15,7 +15,6 @@ const persistCurrentZoom = (zoom) => {
|
|
|
15
15
|
}
|
|
16
16
|
localStorage.setItem(makeKey(currentComposition), String(zoom));
|
|
17
17
|
};
|
|
18
|
-
exports.persistCurrentZoom = persistCurrentZoom;
|
|
19
18
|
const getZoomForComposition = (composition) => {
|
|
20
19
|
const zoom = localStorage.getItem(makeKey(composition));
|
|
21
20
|
return zoom ? Number(zoom) : 0;
|
|
@@ -30,7 +29,7 @@ const ZoomPersistor = () => {
|
|
|
30
29
|
if (!isActive) {
|
|
31
30
|
return;
|
|
32
31
|
}
|
|
33
|
-
|
|
32
|
+
persistCurrentZoom(zoom);
|
|
34
33
|
}, [zoom, isActive, playing]);
|
|
35
34
|
return null;
|
|
36
35
|
};
|