@remotion/studio 4.0.134 → 4.0.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssetSelectorItem.js +3 -9
- package/dist/components/CompositionSelectorItem.js +58 -16
- package/dist/components/CopyButton.js +1 -1
- package/dist/components/CurrentCompositionSideEffects.js +2 -2
- package/dist/components/Editor.js +1 -1
- package/dist/components/GlobalKeybindings.js +2 -4
- package/dist/components/KeyboardShortcutsExplainer.js +1 -1
- package/dist/components/Modals.js +4 -2
- package/dist/components/NewComposition/CodemodFooter.d.ts +13 -0
- package/dist/components/NewComposition/CodemodFooter.js +124 -0
- package/dist/components/NewComposition/DeleteComposition.d.ts +4 -0
- package/dist/components/NewComposition/DeleteComposition.js +34 -0
- package/dist/components/NewComposition/DiffPreview.d.ts +14 -0
- package/dist/components/NewComposition/DiffPreview.js +19 -0
- package/dist/components/{PlayerEmitterContext.d.ts → NewComposition/DismissableModal.d.ts} +1 -1
- package/dist/components/NewComposition/DismissableModal.js +15 -0
- package/dist/components/NewComposition/DuplicateComposition.d.ts +4 -0
- package/dist/components/NewComposition/DuplicateComposition.js +177 -0
- package/dist/components/NewComposition/NewCompDuration.d.ts +2 -3
- package/dist/components/NewComposition/NewCompDuration.js +7 -7
- package/dist/components/NewComposition/RenameComposition.d.ts +4 -0
- package/dist/components/NewComposition/RenameComposition.js +52 -0
- package/dist/components/Notifications/Notification.d.ts +1 -1
- package/dist/components/Notifications/Notification.js +3 -0
- package/dist/components/Notifications/NotificationCenter.d.ts +3 -10
- package/dist/components/Notifications/NotificationCenter.js +24 -8
- package/dist/components/OpenEditorButton.js +2 -2
- package/dist/components/QuickSwitcher/QuickSwitcher.js +2 -9
- package/dist/components/RenderModal/DataEditor.js +5 -5
- package/dist/components/RenderModal/RenderModal.js +21 -62
- package/dist/components/RenderModal/RenderStatusModal.js +2 -2
- package/dist/components/RenderModal/ResolveCompositionBeforeModal.d.ts +15 -0
- package/dist/components/RenderModal/ResolveCompositionBeforeModal.js +83 -0
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -8
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +1 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +1 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -8
- package/dist/components/RenderQueue/actions.d.ts +7 -1
- package/dist/components/RenderQueue/actions.js +13 -1
- package/dist/components/Timeline/TimelineStack/index.js +1 -1
- package/dist/components/UpdateModal/UpdateModal.js +3 -8
- package/dist/components/utils.js +4 -25
- package/dist/helpers/client-id.js +1 -1
- package/dist/helpers/pick-color.js +3 -15
- package/dist/helpers/use-menu-structure.js +4 -49
- package/dist/helpers/validate-new-comp-data.d.ts +2 -2
- package/dist/helpers/validate-new-comp-data.js +3 -3
- package/dist/hot-middleware-client/process-update.js +1 -7
- package/dist/state/modals.d.ts +8 -3
- package/package.json +7 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/components/PlayerEmitterContext.js +0 -11
- package/dist/components/RenderModal/RenderModalInput.d.ts +0 -12
- package/dist/components/RenderModal/RenderModalInput.js +0 -13
|
@@ -201,7 +201,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder }) => {
|
|
|
201
201
|
'/' +
|
|
202
202
|
item.name,
|
|
203
203
|
}).catch((err) => {
|
|
204
|
-
(0, NotificationCenter_1.
|
|
204
|
+
(0, NotificationCenter_1.showNotification)(`Could not open file: ${err.message}`, 2000);
|
|
205
205
|
});
|
|
206
206
|
}, [item.name, parentFolder]);
|
|
207
207
|
const copyToClipboard = (0, react_1.useCallback)((e) => {
|
|
@@ -209,16 +209,10 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder }) => {
|
|
|
209
209
|
const content = `staticFile("${[parentFolder, item.name].join('/')}")`;
|
|
210
210
|
(0, copy_text_1.copyText)(content)
|
|
211
211
|
.then(() => {
|
|
212
|
-
|
|
213
|
-
(_a = NotificationCenter_1.notificationCenter.current) === null || _a === void 0 ? void 0 : _a.addNotification({
|
|
214
|
-
content: `Copied '${content}' to clipboard`,
|
|
215
|
-
created: Date.now(),
|
|
216
|
-
duration: 1000,
|
|
217
|
-
id: String(Math.random()),
|
|
218
|
-
});
|
|
212
|
+
(0, NotificationCenter_1.showNotification)(`Copied '${content}' to clipboard`, 1000);
|
|
219
213
|
})
|
|
220
214
|
.catch((err) => {
|
|
221
|
-
(0, NotificationCenter_1.
|
|
215
|
+
(0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
|
|
222
216
|
});
|
|
223
217
|
}, [item.name, parentFolder]);
|
|
224
218
|
return ((0, jsx_runtime_1.jsx)(layout_1.Row, { align: "center", children: (0, jsx_runtime_1.jsxs)("div", { style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, tabIndex: tabIndex, title: item.name, children: [(0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: iconStyle, color: colors_1.LIGHT_TEXT }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: label, children: item.name }), hovered ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { title: "Copy staticFile() name", renderAction: renderCopyAction, onClick: copyToClipboard }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { title: "Open in Explorer", renderAction: renderFileExplorerAction, onClick: revealInExplorer })] })) : null] }) }));
|
|
@@ -8,6 +8,7 @@ const is_composition_still_1 = require("../helpers/is-composition-still");
|
|
|
8
8
|
const folder_1 = require("../icons/folder");
|
|
9
9
|
const still_1 = require("../icons/still");
|
|
10
10
|
const video_1 = require("../icons/video");
|
|
11
|
+
const modals_1 = require("../state/modals");
|
|
11
12
|
const ContextMenu_1 = require("./ContextMenu");
|
|
12
13
|
const layout_1 = require("./layout");
|
|
13
14
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
@@ -85,11 +86,64 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
85
86
|
onClick(evt);
|
|
86
87
|
}
|
|
87
88
|
}, [onClick]);
|
|
89
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
88
90
|
const contextMenu = (0, react_1.useMemo)(() => {
|
|
89
91
|
if (item.type === 'composition') {
|
|
90
92
|
return [
|
|
91
93
|
{
|
|
92
|
-
id: '
|
|
94
|
+
id: 'duplicate',
|
|
95
|
+
keyHint: null,
|
|
96
|
+
label: `Duplicate...`,
|
|
97
|
+
leftItem: null,
|
|
98
|
+
onClick: () => {
|
|
99
|
+
setSelectedModal({
|
|
100
|
+
type: 'duplicate-comp',
|
|
101
|
+
compositionId: item.composition.id,
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
quickSwitcherLabel: null,
|
|
105
|
+
subMenu: null,
|
|
106
|
+
type: 'item',
|
|
107
|
+
value: 'duplicate',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'rename',
|
|
111
|
+
keyHint: null,
|
|
112
|
+
label: `Rename...`,
|
|
113
|
+
leftItem: null,
|
|
114
|
+
onClick: () => {
|
|
115
|
+
setSelectedModal({
|
|
116
|
+
type: 'rename-comp',
|
|
117
|
+
compositionId: item.composition.id,
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
quickSwitcherLabel: null,
|
|
121
|
+
subMenu: null,
|
|
122
|
+
type: 'item',
|
|
123
|
+
value: 'rename',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 'delete',
|
|
127
|
+
keyHint: null,
|
|
128
|
+
label: `Delete...`,
|
|
129
|
+
leftItem: null,
|
|
130
|
+
onClick: () => {
|
|
131
|
+
setSelectedModal({
|
|
132
|
+
type: 'delete-comp',
|
|
133
|
+
compositionId: item.composition.id,
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
quickSwitcherLabel: null,
|
|
137
|
+
subMenu: null,
|
|
138
|
+
type: 'item',
|
|
139
|
+
value: 'delete',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: 'divider',
|
|
143
|
+
id: 'copy-id-divider',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: 'copy-id',
|
|
93
147
|
keyHint: null,
|
|
94
148
|
label: `Copy ID`,
|
|
95
149
|
leftItem: null,
|
|
@@ -97,22 +151,10 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
97
151
|
navigator.clipboard
|
|
98
152
|
.writeText(item.composition.id)
|
|
99
153
|
.catch((err) => {
|
|
100
|
-
|
|
101
|
-
(_a = NotificationCenter_1.notificationCenter.current) === null || _a === void 0 ? void 0 : _a.addNotification({
|
|
102
|
-
content: `Could not copy to clipboard: ${err.message}`,
|
|
103
|
-
created: Date.now(),
|
|
104
|
-
duration: 1000,
|
|
105
|
-
id: String(Math.random()),
|
|
106
|
-
});
|
|
154
|
+
(0, NotificationCenter_1.showNotification)(`Could not copy to clipboard: ${err.message}`, 1000);
|
|
107
155
|
})
|
|
108
156
|
.then(() => {
|
|
109
|
-
|
|
110
|
-
(_a = NotificationCenter_1.notificationCenter.current) === null || _a === void 0 ? void 0 : _a.addNotification({
|
|
111
|
-
content: 'Copied to clipboard',
|
|
112
|
-
created: Date.now(),
|
|
113
|
-
duration: 1000,
|
|
114
|
-
id: String(Math.random()),
|
|
115
|
-
});
|
|
157
|
+
(0, NotificationCenter_1.showNotification)('Copied to clipboard', 1000);
|
|
116
158
|
});
|
|
117
159
|
},
|
|
118
160
|
quickSwitcherLabel: null,
|
|
@@ -123,7 +165,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
123
165
|
];
|
|
124
166
|
}
|
|
125
167
|
return [];
|
|
126
|
-
}, [item]);
|
|
168
|
+
}, [item, setSelectedModal]);
|
|
127
169
|
if (item.type === 'folder') {
|
|
128
170
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, type: "button", title: item.folderName, children: [item.expanded ? ((0, jsx_runtime_1.jsx)(folder_1.ExpandedFolderIcon, { style: iconStyle, color: hovered || selected ? 'white' : colors_1.LIGHT_TEXT })) : ((0, jsx_runtime_1.jsx)(folder_1.CollapsedFolderIcon, { color: hovered || selected ? 'white' : colors_1.LIGHT_TEXT, style: iconStyle })), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: label, children: item.folderName })] }), item.expanded
|
|
129
171
|
? item.items.map((childItem) => {
|
|
@@ -28,7 +28,7 @@ const CopyButton = ({ textToCopy, label, labelWhenCopied }) => {
|
|
|
28
28
|
setCopied(Date.now());
|
|
29
29
|
})
|
|
30
30
|
.catch((err) => {
|
|
31
|
-
(0, NotificationCenter_1.
|
|
31
|
+
(0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
|
|
32
32
|
});
|
|
33
33
|
}, [textToCopy]);
|
|
34
34
|
(0, react_1.useEffect)(() => {
|
|
@@ -42,10 +42,10 @@ const CurrentCompositionKeybindings = ({ readOnlyStudio }) => {
|
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
if (readOnlyStudio) {
|
|
45
|
-
return (0, NotificationCenter_1.
|
|
45
|
+
return (0, NotificationCenter_1.showNotification)('Studio is read-only', 2000);
|
|
46
46
|
}
|
|
47
47
|
if (type !== 'connected') {
|
|
48
|
-
(0, NotificationCenter_1.
|
|
48
|
+
(0, NotificationCenter_1.showNotification)('Studio server is offline', 2000);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
const renderButton = document.getElementById('render-modal-button');
|
|
@@ -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)(
|
|
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, {})] }) }));
|
|
88
88
|
};
|
|
89
89
|
exports.Editor = Editor;
|
|
@@ -5,6 +5,7 @@ const react_1 = require("react");
|
|
|
5
5
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
6
6
|
const checkerboard_1 = require("../state/checkerboard");
|
|
7
7
|
const modals_1 = require("../state/modals");
|
|
8
|
+
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
8
9
|
const GlobalKeybindings = () => {
|
|
9
10
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
10
11
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -14,10 +15,7 @@ const GlobalKeybindings = () => {
|
|
|
14
15
|
event: 'keypress',
|
|
15
16
|
key: 'n',
|
|
16
17
|
callback: () => {
|
|
17
|
-
|
|
18
|
-
type: 'new-comp',
|
|
19
|
-
compType: 'composition',
|
|
20
|
-
});
|
|
18
|
+
(0, NotificationCenter_1.showNotification)(`To make a new composition, right-click an existing one and select "Duplicate"`, 5000);
|
|
21
19
|
},
|
|
22
20
|
commandCtrlKey: false,
|
|
23
21
|
preventDefault: true,
|
|
@@ -52,6 +52,6 @@ const li = {
|
|
|
52
52
|
fontSize: 14,
|
|
53
53
|
};
|
|
54
54
|
const KeyboardShortcutsExplainer = () => {
|
|
55
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? ((0, jsx_runtime_1.jsxs)("div", { style: keyboardShortcutsDisabled, children: ["Keyboard shortcuts disabled either due to:", (0, jsx_runtime_1.jsxs)("ul", { style: ul, children: [(0, jsx_runtime_1.jsx)("li", { style: li, children: "a) --disable-keyboard-shortcuts being passed" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: "b) Config.setKeyboardShortcutsEnabled(false) being set or" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: " c) a Remotion version mismatch." })] })] })) : null, (0, jsx_runtime_1.jsxs)(layout_1.Row, { style: container, children: [(0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second back" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Previous frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Space" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Next frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second forward" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "A" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to beginning" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "E" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to end" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reverse playback" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "L" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Speed up" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "G" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Go to frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Enter" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause & return to playback start" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Sidebar" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "B" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle left sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle right sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "G" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle both sidebars" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "View" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "F" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Enter fullscreen" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Esc" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Exit fullscreen" })] })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 8 }), (0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Navigation" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "N" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "New composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "R" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Render composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "T" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle checkerboard background" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "?" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Show keyboard shortcuts" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Quick Switcher" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback range" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "I" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set In Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "O" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set Out Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "X" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Clear In/Out Points" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Zoom" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "+" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom in" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "-" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom out" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "0" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reset zoom" })] }), ' ', (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Props Editor" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "S" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Save" })] })] })] })] }));
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? ((0, jsx_runtime_1.jsxs)("div", { style: keyboardShortcutsDisabled, children: ["Keyboard shortcuts disabled either due to:", (0, jsx_runtime_1.jsxs)("ul", { style: ul, children: [(0, jsx_runtime_1.jsx)("li", { style: li, children: "a) --disable-keyboard-shortcuts being passed" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: "b) Config.setKeyboardShortcutsEnabled(false) being set or" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: " c) a Remotion version mismatch." })] })] })) : null, (0, jsx_runtime_1.jsxs)(layout_1.Row, { style: container, children: [(0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second back" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Previous frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Space" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Next frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second forward" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "A" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to beginning" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "E" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to end" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reverse playback" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "L" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Speed up" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "G" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Go to frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Enter" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause & return to playback start" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Sidebar" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "B" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle left sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle right sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "G" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle both sidebars" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "View" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "F" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Enter fullscreen" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Esc" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Exit fullscreen" })] })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 8 }), (0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Navigation" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "R" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Render composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "T" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle checkerboard background" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "?" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Show keyboard shortcuts" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Quick Switcher" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback range" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "I" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set In Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "O" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set Out Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "X" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Clear In/Out Points" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Zoom" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "+" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom in" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "-" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom out" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "0" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reset zoom" })] }), ' ', (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Props Editor" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "S" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Save" })] })] })] })] }));
|
|
56
56
|
};
|
|
57
57
|
exports.KeyboardShortcutsExplainer = KeyboardShortcutsExplainer;
|
|
@@ -8,7 +8,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const client_id_1 = require("../helpers/client-id");
|
|
10
10
|
const modals_1 = require("../state/modals");
|
|
11
|
-
const
|
|
11
|
+
const DeleteComposition_1 = require("./NewComposition/DeleteComposition");
|
|
12
|
+
const DuplicateComposition_1 = require("./NewComposition/DuplicateComposition");
|
|
13
|
+
const RenameComposition_1 = require("./NewComposition/RenameComposition");
|
|
12
14
|
const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher"));
|
|
13
15
|
const RenderModal_1 = require("./RenderModal/RenderModal");
|
|
14
16
|
const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
@@ -17,7 +19,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
17
19
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
18
20
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
19
21
|
'connected';
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === '
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'duplicate-comp' && ((0, jsx_runtime_1.jsx)(DuplicateComposition_1.DuplicateComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && ((0, jsx_runtime_1.jsx)(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && ((0, jsx_runtime_1.jsx)(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModalWithLoader, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec })), modalContextType &&
|
|
21
23
|
canRender &&
|
|
22
24
|
modalContextType.type === 'render-progress' && ((0, jsx_runtime_1.jsx)(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'quick-switcher' && ((0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode }))] }));
|
|
23
25
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RecastCodemod } from '@remotion/studio-shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const CodemodFooter: React.FC<{
|
|
4
|
+
valid: boolean;
|
|
5
|
+
codemod: RecastCodemod;
|
|
6
|
+
loadingNotification: React.ReactNode;
|
|
7
|
+
succeessNotifcation: React.ReactNode;
|
|
8
|
+
errorNotification: string;
|
|
9
|
+
genericSubmitLabel: string;
|
|
10
|
+
submitLabel: (options: {
|
|
11
|
+
relativeRootPath: string;
|
|
12
|
+
}) => string;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodemodFooter = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const ShortcutHint_1 = require("../../error-overlay/remotion-overlay/ShortcutHint");
|
|
7
|
+
const colors_1 = require("../../helpers/colors");
|
|
8
|
+
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
9
|
+
const modals_1 = require("../../state/modals");
|
|
10
|
+
const Button_1 = require("../Button");
|
|
11
|
+
const layout_1 = require("../layout");
|
|
12
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
13
|
+
const actions_1 = require("../RenderQueue/actions");
|
|
14
|
+
const DiffPreview_1 = require("./DiffPreview");
|
|
15
|
+
const buttonStyle = {
|
|
16
|
+
backgroundColor: colors_1.BLUE,
|
|
17
|
+
color: 'white',
|
|
18
|
+
};
|
|
19
|
+
const CodemodFooter = ({ codemod, valid, loadingNotification, succeessNotifcation, errorNotification, genericSubmitLabel, submitLabel, }) => {
|
|
20
|
+
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
21
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
22
|
+
const [codemodStatus, setCanApplyCodemod] = (0, react_1.useState)({
|
|
23
|
+
type: 'loading',
|
|
24
|
+
});
|
|
25
|
+
const [projectInfo, setProjectInfo] = (0, react_1.useState)(null);
|
|
26
|
+
(0, react_1.useEffect)(() => {
|
|
27
|
+
const controller = new AbortController();
|
|
28
|
+
(0, actions_1.getProjectInfo)(controller.signal)
|
|
29
|
+
.then((info) => {
|
|
30
|
+
setProjectInfo(info.projectInfo);
|
|
31
|
+
})
|
|
32
|
+
.catch((err) => {
|
|
33
|
+
(0, NotificationCenter_1.showNotification)(`Could not get project info: ${err.message}. Unable to duplicate composition`, 3000);
|
|
34
|
+
});
|
|
35
|
+
return () => {
|
|
36
|
+
controller.abort();
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
const trigger = (0, react_1.useCallback)(() => {
|
|
40
|
+
setSubmitting(true);
|
|
41
|
+
setSelectedModal(null);
|
|
42
|
+
const notification = (0, NotificationCenter_1.showNotification)(loadingNotification, null);
|
|
43
|
+
(0, actions_1.applyCodemod)({
|
|
44
|
+
codemod,
|
|
45
|
+
dryRun: false,
|
|
46
|
+
signal: new AbortController().signal,
|
|
47
|
+
})
|
|
48
|
+
.then(() => {
|
|
49
|
+
notification.replaceContent(succeessNotifcation, 2000);
|
|
50
|
+
})
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
notification.replaceContent(`${errorNotification}: ${err.message}`, 2000);
|
|
53
|
+
});
|
|
54
|
+
}, [
|
|
55
|
+
codemod,
|
|
56
|
+
errorNotification,
|
|
57
|
+
loadingNotification,
|
|
58
|
+
setSelectedModal,
|
|
59
|
+
succeessNotifcation,
|
|
60
|
+
]);
|
|
61
|
+
const getCanApplyCodemod = (0, react_1.useCallback)(async (signal) => {
|
|
62
|
+
const res = await (0, actions_1.applyCodemod)({
|
|
63
|
+
codemod,
|
|
64
|
+
dryRun: true,
|
|
65
|
+
signal,
|
|
66
|
+
});
|
|
67
|
+
if (res.success) {
|
|
68
|
+
setCanApplyCodemod({ type: 'success', diff: res.diff });
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
setCanApplyCodemod({
|
|
72
|
+
type: 'fail',
|
|
73
|
+
error: res.reason,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}, [codemod]);
|
|
77
|
+
(0, react_1.useEffect)(() => {
|
|
78
|
+
const abortController = new AbortController();
|
|
79
|
+
let aborted = false;
|
|
80
|
+
getCanApplyCodemod(abortController.signal)
|
|
81
|
+
.then(() => undefined)
|
|
82
|
+
.catch((err) => {
|
|
83
|
+
if (aborted) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
(0, NotificationCenter_1.showNotification)(`Cannot duplicate composition: ${err.message}`, 3000);
|
|
87
|
+
});
|
|
88
|
+
return () => {
|
|
89
|
+
aborted = true;
|
|
90
|
+
abortController.abort();
|
|
91
|
+
};
|
|
92
|
+
}, [codemodStatus, getCanApplyCodemod, setSelectedModal]);
|
|
93
|
+
const disabled = !valid ||
|
|
94
|
+
submitting ||
|
|
95
|
+
projectInfo === null ||
|
|
96
|
+
codemodStatus.type !== 'success';
|
|
97
|
+
const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
|
|
98
|
+
(0, react_1.useEffect)(() => {
|
|
99
|
+
if (disabled) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const enter = registerKeybinding({
|
|
103
|
+
callback() {
|
|
104
|
+
trigger();
|
|
105
|
+
},
|
|
106
|
+
commandCtrlKey: true,
|
|
107
|
+
key: 'Enter',
|
|
108
|
+
event: 'keydown',
|
|
109
|
+
preventDefault: true,
|
|
110
|
+
triggerIfInputFieldFocused: true,
|
|
111
|
+
keepRegisteredWhenNotHighestContext: false,
|
|
112
|
+
});
|
|
113
|
+
return () => {
|
|
114
|
+
enter.unregister();
|
|
115
|
+
};
|
|
116
|
+
}, [disabled, registerKeybinding, trigger, valid]);
|
|
117
|
+
return ((0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)(DiffPreview_1.CodemodDiffPreview, { status: codemodStatus }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, x: 2 }), (0, jsx_runtime_1.jsxs)(Button_1.Button, { onClick: trigger, disabled: disabled, style: {
|
|
118
|
+
...buttonStyle,
|
|
119
|
+
backgroundColor: disabled ? colors_1.BLUE_DISABLED : colors_1.BLUE,
|
|
120
|
+
}, children: [projectInfo && projectInfo.relativeRootFile
|
|
121
|
+
? submitLabel({ relativeRootPath: projectInfo.relativeRootFile })
|
|
122
|
+
: genericSubmitLabel, (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }));
|
|
123
|
+
};
|
|
124
|
+
exports.CodemodFooter = CodemodFooter;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteComposition = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const styles_1 = require("../Menu/styles");
|
|
7
|
+
const ModalHeader_1 = require("../ModalHeader");
|
|
8
|
+
const ResolveCompositionBeforeModal_1 = require("../RenderModal/ResolveCompositionBeforeModal");
|
|
9
|
+
const CodemodFooter_1 = require("./CodemodFooter");
|
|
10
|
+
const DismissableModal_1 = require("./DismissableModal");
|
|
11
|
+
const content = {
|
|
12
|
+
padding: 16,
|
|
13
|
+
fontSize: 14,
|
|
14
|
+
flex: 1,
|
|
15
|
+
minWidth: 500,
|
|
16
|
+
};
|
|
17
|
+
const DeleteCompositionLoaded = ({ compositionId }) => {
|
|
18
|
+
const context = (0, react_1.useContext)(ResolveCompositionBeforeModal_1.ResolvedCompositionContext);
|
|
19
|
+
if (!context) {
|
|
20
|
+
throw new Error('Resolved composition context');
|
|
21
|
+
}
|
|
22
|
+
const { unresolved } = context;
|
|
23
|
+
const codemod = (0, react_1.useMemo)(() => {
|
|
24
|
+
return {
|
|
25
|
+
type: 'delete-composition',
|
|
26
|
+
idToDelete: compositionId,
|
|
27
|
+
};
|
|
28
|
+
}, [compositionId]);
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: 'Delete composition' }), (0, jsx_runtime_1.jsxs)("form", { children: [(0, jsx_runtime_1.jsxs)("div", { style: content, children: ["Do you want to delete the", ' ', (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: unresolved.durationInFrames === 1 ? `<Still>` : '<Composition>' }), ' ', "with ID ", '"', unresolved.id, '"', "?", (0, jsx_runtime_1.jsx)("br", {}), "The associated ", (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "component" }), " will remain in your code."] }), (0, jsx_runtime_1.jsx)("div", { style: { ...content, borderTop: '1px solid black' }, children: (0, jsx_runtime_1.jsx)(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete composition`, loadingNotification: 'Deleting', succeessNotifcation: `Deleted ${unresolved.id}`, genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, valid: true }) })] })] }));
|
|
30
|
+
};
|
|
31
|
+
const DeleteComposition = ({ compositionId }) => {
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(DismissableModal_1.DismissableModal, { children: (0, jsx_runtime_1.jsx)(ResolveCompositionBeforeModal_1.ResolveCompositionBeforeModal, { compositionId: compositionId, children: (0, jsx_runtime_1.jsx)(DeleteCompositionLoaded, { compositionId: compositionId }) }) }));
|
|
33
|
+
};
|
|
34
|
+
exports.DeleteComposition = DeleteComposition;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SimpleDiff } from '@remotion/studio-shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type CodemodStatus = {
|
|
4
|
+
type: 'loading';
|
|
5
|
+
} | {
|
|
6
|
+
type: 'success';
|
|
7
|
+
diff: SimpleDiff;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'fail';
|
|
10
|
+
error: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const CodemodDiffPreview: React.FC<{
|
|
13
|
+
status: CodemodStatus;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodemodDiffPreview = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../../helpers/colors");
|
|
6
|
+
const CodemodDiffPreview = ({ status }) => {
|
|
7
|
+
if (status.type === 'loading') {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (status.type === 'fail') {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("span", { style: { color: colors_1.FAIL_COLOR, fontSize: 13, lineHeight: 1.2 }, children: status.error }));
|
|
12
|
+
}
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { lineHeight: 1.2 }, children: [(0, jsx_runtime_1.jsx)("span", { style: { color: colors_1.LIGHT_TEXT, fontSize: 13, lineHeight: 1.2 }, children: "This will edit your Root file." }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)("span", { style: { color: colors_1.BLUE, fontSize: 13, lineHeight: 1.2 }, children: [status.diff.additions, " addition", status.diff.additions === 1 ? '' : 's', ","] }), ' ', (0, jsx_runtime_1.jsxs)("span", { style: {
|
|
14
|
+
color: colors_1.SELECTED_GUIDE,
|
|
15
|
+
fontSize: 13,
|
|
16
|
+
lineHeight: 1.2,
|
|
17
|
+
}, children: [status.diff.deletions, " deletion", status.diff.deletions === 1 ? '' : 's'] })] }));
|
|
18
|
+
};
|
|
19
|
+
exports.CodemodDiffPreview = CodemodDiffPreview;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DismissableModal = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const modals_1 = require("../../state/modals");
|
|
7
|
+
const ModalContainer_1 = require("../ModalContainer");
|
|
8
|
+
const DismissableModal = ({ children }) => {
|
|
9
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
10
|
+
const onQuit = (0, react_1.useCallback)(() => {
|
|
11
|
+
setSelectedModal(null);
|
|
12
|
+
}, [setSelectedModal]);
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: children }));
|
|
14
|
+
};
|
|
15
|
+
exports.DismissableModal = DismissableModal;
|