@remotion/studio 4.0.505 → 4.0.506
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/api/install-package.d.ts +2 -3
- package/dist/api/install-package.js +1 -3
- package/dist/api/visual-control.d.ts +3 -0
- package/dist/api/visual-control.js +3 -0
- package/dist/components/AssetSelectorItem.js +1 -1
- package/dist/components/Canvas.js +2 -0
- package/dist/components/CompositionSelector.js +1 -1
- package/dist/components/CompositionSelectorItem.js +1 -1
- package/dist/components/ConfigureDefaultEditorModal.d.ts +3 -1
- package/dist/components/ConfigureDefaultEditorModal.js +90 -32
- package/dist/components/ConfigureLicenseModal.d.ts +2 -1
- package/dist/components/ConfigureLicenseModal.js +40 -32
- package/dist/components/ConfirmationDialog.js +2 -2
- package/dist/components/Editor.js +2 -0
- package/dist/components/EffectPickerModal.js +1 -1
- package/dist/components/GlobalKeybindings.js +3 -2
- package/dist/components/InlineCaptionInspector.d.ts +2 -2
- package/dist/components/InlineDropdown.d.ts +2 -1
- package/dist/components/InlineDropdown.js +10 -4
- package/dist/components/InspectorOpenInEditor.d.ts +1 -0
- package/dist/components/InspectorOpenInEditor.js +33 -9
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +15 -1
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +1 -1
- package/dist/components/InspectorPanel/EasingInspector.js +7 -4
- package/dist/components/InspectorPanel/KeyframeInspector.js +5 -1
- package/dist/components/InspectorPanel/common.d.ts +1 -0
- package/dist/components/InspectorPanel/common.js +2 -2
- package/dist/components/InspectorPanel/use-composition-actions.js +4 -1
- package/dist/components/InspectorSequenceSection.js +4 -4
- package/dist/components/InstallPackage.js +1 -1
- package/dist/components/MenuBuildIndicator.js +1 -0
- package/dist/components/MenuToolbar.js +1 -1
- package/dist/components/ModalFooter.d.ts +1 -0
- package/dist/components/ModalFooter.js +6 -2
- package/dist/components/ModalHeader.js +1 -1
- package/dist/components/Modals.js +18 -7
- package/dist/components/ModalsProvider.js +5 -6
- package/dist/components/NewComposition/CodemodFooter.js +1 -1
- package/dist/components/NewComposition/DismissableModal.js +1 -1
- package/dist/components/NewComposition/RenameStaticFile.js +1 -1
- package/dist/components/OverrideInputProps.js +1 -1
- package/dist/components/PlayPause.js +2 -1
- package/dist/components/PlaybackKeyboardShortcutsManager.js +7 -5
- package/dist/components/PreviewToolbarOverflowButton.js +4 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/components/RenderButton.d.ts +3 -3
- package/dist/components/RenderButton.js +42 -7
- package/dist/components/RenderModal/RenderStatusModal.js +1 -1
- package/dist/components/RenderModal/ServerRenderModal.js +1 -1
- package/dist/components/RenderModal/WebRenderModal.js +3 -2
- package/dist/components/RenderQueue/RenderQueueError.js +1 -1
- package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
- package/dist/components/RenderQueue/RenderQueueProgressMessage.js +1 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
- package/dist/components/SelectedOutlineElement.js +1 -1
- package/dist/components/SelectedOutlineOverlay.js +62 -19
- package/dist/components/SettingsModal.d.ts +7 -0
- package/dist/components/SettingsModal.js +50 -0
- package/dist/components/SettingsModalFooter.d.ts +4 -0
- package/dist/components/SettingsModalFooter.js +46 -0
- package/dist/components/SidebarRenderButton.js +1 -1
- package/dist/components/SvgImportDialog.js +2 -2
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/Timeline.js +1 -0
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineDragHandler.js +3 -3
- package/dist/components/Timeline/TimelineEffectPropItem.js +5 -3
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +4 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
- package/dist/components/Timeline/TimelineFontFamilyField.js +3 -1
- package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
- package/dist/components/Timeline/TimelineSelection.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +28 -34
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +1 -1
- package/dist/components/Timeline/reset-selected-timeline-props.js +1 -1
- package/dist/components/Timeline/should-subscribe-to-sequence-props.d.ts +1 -1
- package/dist/components/Timeline/timeline-asset-link.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +2 -2
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +4 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +5 -0
- package/dist/components/Timeline/use-timeline-height.js +20 -0
- package/dist/components/TimelineInOutToggle.js +5 -1
- package/dist/components/TopPanel.js +16 -0
- package/dist/components/UpdateCheck.js +1 -1
- package/dist/components/effect-drag-and-drop.js +1 -1
- package/dist/components/handle-drop.d.ts +2 -1
- package/dist/components/handle-drop.js +12 -2
- package/dist/components/import-assets.d.ts +18 -6
- package/dist/components/import-assets.js +76 -32
- package/dist/esm/{chunk-7pgk8h5m.js → chunk-b49ec3nz.js} +8334 -7701
- package/dist/esm/internals.mjs +8334 -7701
- package/dist/esm/previewEntry.mjs +8343 -7710
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/client-id.d.ts +3 -1
- package/dist/helpers/client-id.js +21 -4
- package/dist/helpers/install-required-package.d.ts +3 -3
- package/dist/helpers/install-required-package.js +1 -6
- package/dist/helpers/studio-fit-padding.d.ts +1 -1
- package/dist/helpers/studio-fit-padding.js +1 -1
- package/dist/helpers/timeline-layout.d.ts +2 -1
- package/dist/helpers/timeline-layout.js +5 -2
- package/dist/helpers/use-menu-structure.js +23 -33
- package/dist/helpers/use-runtime-values.d.ts +11 -0
- package/dist/helpers/use-runtime-values.js +76 -0
- package/dist/icons/apps.d.ts +2 -0
- package/dist/icons/apps.js +7 -0
- package/dist/icons/browse-elements.d.ts +4 -0
- package/dist/icons/browse-elements.js +10 -0
- package/dist/state/modals.d.ts +5 -6
- package/dist/state/modals.js +5 -3
- package/package.json +12 -12
|
@@ -15,17 +15,21 @@ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
|
15
15
|
const use_default_editor_info_1 = require("./use-default-editor-info");
|
|
16
16
|
const splitButton = {
|
|
17
17
|
alignItems: 'center',
|
|
18
|
+
borderRadius: 3,
|
|
18
19
|
display: 'inline-flex',
|
|
19
20
|
flexDirection: 'row',
|
|
20
21
|
flexShrink: 0,
|
|
22
|
+
gap: 1,
|
|
21
23
|
height: 24,
|
|
24
|
+
overflow: 'hidden',
|
|
22
25
|
};
|
|
23
26
|
const mainButtonBase = {
|
|
24
27
|
alignItems: 'center',
|
|
25
28
|
background: colors_1.TRANSPARENT,
|
|
26
29
|
border: 'none',
|
|
27
|
-
borderRadius:
|
|
30
|
+
borderRadius: '3px 0 0 3px',
|
|
28
31
|
color: colors_1.LIGHT_TEXT,
|
|
32
|
+
columnGap: 4,
|
|
29
33
|
display: 'inline-flex',
|
|
30
34
|
fontFamily: 'sans-serif',
|
|
31
35
|
fontSize: 11,
|
|
@@ -42,12 +46,13 @@ const menuLabel = {
|
|
|
42
46
|
};
|
|
43
47
|
const editorButtonIconSize = 18;
|
|
44
48
|
const editorMenuIconSize = 18;
|
|
45
|
-
const InspectorOpenInEditor = ({ location }) => {
|
|
49
|
+
const InspectorOpenInEditor = ({ label, location }) => {
|
|
46
50
|
var _a;
|
|
47
51
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
48
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
52
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
49
53
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
50
54
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
55
|
+
const [dropdownOpened, setDropdownOpened] = (0, react_1.useState)(false);
|
|
51
56
|
const editorPickerAvailable = (0, use_default_editor_info_1.canUseEditorPicker)(previewServerState.type === 'connected');
|
|
52
57
|
const editorInfo = (0, use_default_editor_info_1.useDefaultEditorInfo)(editorPickerAvailable);
|
|
53
58
|
const openWithEditor = (0, react_1.useCallback)(async (editorId) => {
|
|
@@ -68,18 +73,30 @@ const InspectorOpenInEditor = ({ location }) => {
|
|
|
68
73
|
event.stopPropagation();
|
|
69
74
|
openWithEditor(null).catch(() => undefined);
|
|
70
75
|
}, [openWithEditor]);
|
|
76
|
+
const mainHovered = hovered && !dropdownOpened;
|
|
71
77
|
const mainButtonStyle = (0, react_1.useMemo)(() => {
|
|
72
78
|
return {
|
|
73
79
|
...mainButtonBase,
|
|
74
80
|
background: (0, colors_1.getBackgroundFromHoverState)({
|
|
75
|
-
hovered,
|
|
81
|
+
hovered: mainHovered,
|
|
76
82
|
selected: false,
|
|
77
83
|
}),
|
|
78
|
-
color:
|
|
84
|
+
color: mainHovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
|
|
79
85
|
opacity: canOpenDefault ? 1 : 0.5,
|
|
80
86
|
pointerEvents: canOpenDefault ? 'auto' : 'none',
|
|
81
87
|
};
|
|
82
|
-
}, [canOpenDefault,
|
|
88
|
+
}, [canOpenDefault, mainHovered]);
|
|
89
|
+
const dropdownForegroundColor = hovered || dropdownOpened ? colors_1.WHITE : colors_1.LIGHT_TEXT;
|
|
90
|
+
const dropdownStyle = (0, react_1.useMemo)(() => {
|
|
91
|
+
return {
|
|
92
|
+
background: (0, colors_1.getBackgroundFromHoverState)({
|
|
93
|
+
hovered,
|
|
94
|
+
selected: dropdownOpened,
|
|
95
|
+
}),
|
|
96
|
+
borderRadius: '0 3px 3px 0',
|
|
97
|
+
color: dropdownForegroundColor,
|
|
98
|
+
};
|
|
99
|
+
}, [dropdownForegroundColor, dropdownOpened, hovered]);
|
|
83
100
|
const renderDropdownAction = (0, react_1.useCallback)((color) => {
|
|
84
101
|
return jsx_runtime_1.jsx(caret_1.CaretDown, { color: color, small: true });
|
|
85
102
|
}, []);
|
|
@@ -110,7 +127,13 @@ const InspectorOpenInEditor = ({ location }) => {
|
|
|
110
127
|
label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Set default editor..." }),
|
|
111
128
|
leftItem: null,
|
|
112
129
|
onClick: () => {
|
|
113
|
-
|
|
130
|
+
var _a;
|
|
131
|
+
var _b;
|
|
132
|
+
setSelectedModal({
|
|
133
|
+
type: 'settings',
|
|
134
|
+
initialTab: 'apps',
|
|
135
|
+
initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
|
|
136
|
+
});
|
|
114
137
|
},
|
|
115
138
|
quickSwitcherLabel: null,
|
|
116
139
|
subMenu: null,
|
|
@@ -128,8 +151,9 @@ const InspectorOpenInEditor = ({ location }) => {
|
|
|
128
151
|
if (!editorPickerAvailable) {
|
|
129
152
|
return null;
|
|
130
153
|
}
|
|
131
|
-
return (jsx_runtime_1.jsxs("div", { style: splitButton, children: [
|
|
132
|
-
jsx_runtime_1.
|
|
154
|
+
return (jsx_runtime_1.jsxs("div", { style: splitButton, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [
|
|
155
|
+
jsx_runtime_1.jsxs("button", { "aria-label": `Open in ${editorName}`, disabled: !canOpenDefault, onClick: onOpenDefault, style: mainButtonStyle, tabIndex: tabIndex, title: `Open in ${editorName}`, type: "button", children: [label, jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: preferredEditorId, size: editorButtonIconSize })
|
|
156
|
+
] }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { onOpenChange: setDropdownOpened, renderAction: renderDropdownAction, style: dropdownStyle, title: "Open in another editor", unhoveredColor: dropdownForegroundColor, values: menuItems, variant: "compact" })
|
|
133
157
|
] }));
|
|
134
158
|
};
|
|
135
159
|
exports.InspectorOpenInEditor = InspectorOpenInEditor;
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
8
|
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
9
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
9
10
|
const align_bottom_1 = require("../../icons/align-bottom");
|
|
10
11
|
const align_center_horizontal_1 = require("../../icons/align-center-horizontal");
|
|
11
12
|
const align_center_vertical_1 = require("../../icons/align-center-vertical");
|
|
@@ -48,6 +49,7 @@ const AlignmentButton = ({ onClick, title, Icon, disabled }) => {
|
|
|
48
49
|
};
|
|
49
50
|
const AlignmentControls = ({ track }) => {
|
|
50
51
|
var _a;
|
|
52
|
+
const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)(track.sequence.controls);
|
|
51
53
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
52
54
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
53
55
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
@@ -79,7 +81,7 @@ const AlignmentControls = ({ track }) => {
|
|
|
79
81
|
const dragOverrides = (_b = getDragOverrides(nodePath)) !== null && _b !== void 0 ? _b : {};
|
|
80
82
|
const activeSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
|
|
81
83
|
schema: track.sequence.controls.schema,
|
|
82
|
-
currentRuntimeValueDotNotation:
|
|
84
|
+
currentRuntimeValueDotNotation: runtimeValues,
|
|
83
85
|
dragOverrides,
|
|
84
86
|
propStatus: nodePropStatuses,
|
|
85
87
|
frame: sourceFrame,
|
|
@@ -176,6 +178,7 @@ const AlignmentControls = ({ track }) => {
|
|
|
176
178
|
currentCompositionMetadata,
|
|
177
179
|
timelinePosition,
|
|
178
180
|
propStatuses,
|
|
181
|
+
runtimeValues,
|
|
179
182
|
getDragOverrides,
|
|
180
183
|
setPropStatuses,
|
|
181
184
|
]);
|
|
@@ -192,7 +195,7 @@ const AlignmentControls = ({ track }) => {
|
|
|
192
195
|
const renderDragOverrides = (_a = getDragOverrides(renderNodePath)) !== null && _a !== void 0 ? _a : {};
|
|
193
196
|
const renderActiveSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
|
|
194
197
|
schema: track.sequence.controls.schema,
|
|
195
|
-
currentRuntimeValueDotNotation:
|
|
198
|
+
currentRuntimeValueDotNotation: runtimeValues,
|
|
196
199
|
dragOverrides: renderDragOverrides,
|
|
197
200
|
propStatus: renderNodePropStatuses,
|
|
198
201
|
frame: renderSourceFrame,
|
|
@@ -4,6 +4,7 @@ exports.CompositionInspector = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
7
|
+
const browse_elements_1 = require("../../icons/browse-elements");
|
|
7
8
|
const frame_1 = require("../../icons/frame");
|
|
8
9
|
const solid_1 = require("../../icons/solid");
|
|
9
10
|
const video_1 = require("../../icons/video");
|
|
@@ -26,13 +27,26 @@ const actionIconStyle = {
|
|
|
26
27
|
height: 18,
|
|
27
28
|
width: 18,
|
|
28
29
|
};
|
|
30
|
+
const browseElementsIconStyle = {
|
|
31
|
+
height: 22,
|
|
32
|
+
width: 22,
|
|
33
|
+
};
|
|
34
|
+
const browseElementsIconContainerStyle = {
|
|
35
|
+
height: 22,
|
|
36
|
+
marginLeft: -2,
|
|
37
|
+
marginRight: -2,
|
|
38
|
+
width: 22,
|
|
39
|
+
};
|
|
29
40
|
const CompositionActions = ({ readOnlyStudio }) => {
|
|
30
41
|
const { canInsertAsset, canInsertComposition, canInsertSolid, canShowInsertAsset, canShowInsertComposition, canShowInsertSolid, insertAsset, insertComposition, insertSolid, } = (0, use_composition_actions_1.useCompositionActions)();
|
|
42
|
+
const openElementsLibrary = (0, react_1.useCallback)(() => {
|
|
43
|
+
window.open('https://www.remotion.dev/elements', '_blank', 'noopener,noreferrer');
|
|
44
|
+
}, []);
|
|
31
45
|
if ((readOnlyStudio && !canShowInsertSolid) ||
|
|
32
46
|
(!canShowInsertAsset && !canShowInsertComposition && !canShowInsertSolid)) {
|
|
33
47
|
return null;
|
|
34
48
|
}
|
|
35
|
-
return (jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null] }));
|
|
49
|
+
return (jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, iconContainerStyle: browseElementsIconContainerStyle, onClick: openElementsLibrary, renderIcon: (color) => (jsx_runtime_1.jsx(browse_elements_1.BrowseElementsIcon, { color: color, style: browseElementsIconStyle })), title: "Open the Remotion Elements library in a new tab. Install an Element there to send it to this composition.", children: "Browse Elements..." })) : null] }));
|
|
36
50
|
};
|
|
37
51
|
const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
|
|
38
52
|
var _a;
|
|
@@ -40,7 +40,7 @@ const ConnectedCompositionsSection = ({ connectedCompositions }) => {
|
|
|
40
40
|
exports.ConnectedCompositionsSection = ConnectedCompositionsSection;
|
|
41
41
|
const ConnectedCompositionRow = ({ composition }) => {
|
|
42
42
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
43
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
43
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
44
44
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
45
45
|
.previewServerState.type;
|
|
46
46
|
const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(composition.stack);
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
8
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
9
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
9
10
|
const plus_1 = require("../../icons/plus");
|
|
10
11
|
const render_frame_1 = require("../../state/render-frame");
|
|
11
12
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
@@ -26,8 +27,9 @@ const addKeyframeIcon = {
|
|
|
26
27
|
width: 18,
|
|
27
28
|
};
|
|
28
29
|
const EasingInspector = ({ selection }) => {
|
|
29
|
-
var _a, _b;
|
|
30
|
+
var _a, _b, _c;
|
|
30
31
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
32
|
+
const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)((_a = track === null || track === void 0 ? void 0 : track.sequence.controls) !== null && _a !== void 0 ? _a : null);
|
|
31
33
|
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
32
34
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
33
35
|
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
@@ -44,7 +46,7 @@ const EasingInspector = ({ selection }) => {
|
|
|
44
46
|
overrideIdsToNodePaths: overrideIdToNodePathMappings,
|
|
45
47
|
propStatuses,
|
|
46
48
|
}), [overrideIdToNodePathMappings, propStatuses, selection, sequences]);
|
|
47
|
-
const initialEasing = (
|
|
49
|
+
const initialEasing = (_b = easingUpdate === null || easingUpdate === void 0 ? void 0 : easingUpdate.currentEasing) !== null && _b !== void 0 ? _b : null;
|
|
48
50
|
const easingDetails = (0, react_1.useMemo)(() => {
|
|
49
51
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
50
52
|
if (easingUpdate === null || track === null) {
|
|
@@ -61,7 +63,7 @@ const EasingInspector = ({ selection }) => {
|
|
|
61
63
|
}
|
|
62
64
|
const sequenceFields = (0, timeline_layout_1.getFieldsToShow)({
|
|
63
65
|
schema: track.sequence.controls.schema,
|
|
64
|
-
currentRuntimeValueDotNotation:
|
|
66
|
+
currentRuntimeValueDotNotation: runtimeValues,
|
|
65
67
|
getDragOverrides,
|
|
66
68
|
propStatuses,
|
|
67
69
|
nodePath: easingUpdate.nodePath,
|
|
@@ -100,9 +102,10 @@ const EasingInspector = ({ selection }) => {
|
|
|
100
102
|
getDragOverrides,
|
|
101
103
|
getEffectDragOverrides,
|
|
102
104
|
propStatuses,
|
|
105
|
+
runtimeValues,
|
|
103
106
|
track,
|
|
104
107
|
]);
|
|
105
|
-
const fieldLabel = (
|
|
108
|
+
const fieldLabel = (_c = easingDetails === null || easingDetails === void 0 ? void 0 : easingDetails.fieldLabel) !== null && _c !== void 0 ? _c : null;
|
|
106
109
|
const currentEasingSelection = (0, react_1.useMemo)(() => {
|
|
107
110
|
if (easingUpdate === null || track === null) {
|
|
108
111
|
return null;
|
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const client_id_1 = require("../../helpers/client-id");
|
|
9
9
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
10
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
10
11
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
11
12
|
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
12
13
|
const call_delete_keyframe_1 = require("../Timeline/call-delete-keyframe");
|
|
@@ -53,7 +54,9 @@ const TrashIcon = ({ color }) => {
|
|
|
53
54
|
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 448 512", style: removeKeyframeIcon, children: jsx_runtime_1.jsx("path", { fill: color, d: "M160.5 27.4c2-6.8 8.3-11.4 15.3-11.4l96.4 0c7.1 0 13.3 4.6 15.3 11.4l11 36.6-149 0 11-36.6zM116.1 64L16 64C7.2 64 0 71.2 0 80S7.2 96 16 96l416 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-100.1 0-13.7-45.8C312.1-2.1 293.4-16 272.2-16l-96.4 0c-21.2 0-39.9 13.9-46 34.2L116.1 64zM28.7 144L51.6 452.7c2.5 33.4 30.3 59.3 63.8 59.3l217.1 0c33.5 0 61.3-25.9 63.8-59.3l22.9-308.7-32.1 0-22.7 306.4c-1.2 16.7-15.2 29.6-31.9 29.6l-217.1 0c-16.8 0-30.7-12.9-31.9-29.6L60.8 144 28.7 144z" }) }));
|
|
54
55
|
};
|
|
55
56
|
const KeyframeInspector = ({ selection }) => {
|
|
57
|
+
var _a;
|
|
56
58
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
59
|
+
const runtimeValues = (0, use_runtime_values_1.useRuntimeValues)((_a = track === null || track === void 0 ? void 0 : track.sequence.controls) !== null && _a !== void 0 ? _a : null);
|
|
57
60
|
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
58
61
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
59
62
|
const { clearDragOverrides, clearEffectDragOverrides, setDragOverrides, setEffectDragOverrides, setPropStatuses, } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -81,7 +84,7 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
81
84
|
if (keyframeField.type === 'sequence') {
|
|
82
85
|
const sequenceFields = (0, timeline_layout_1.getFieldsToShow)({
|
|
83
86
|
schema: track.sequence.controls.schema,
|
|
84
|
-
currentRuntimeValueDotNotation:
|
|
87
|
+
currentRuntimeValueDotNotation: runtimeValues,
|
|
85
88
|
getDragOverrides,
|
|
86
89
|
propStatuses,
|
|
87
90
|
nodePath,
|
|
@@ -148,6 +151,7 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
148
151
|
getDragOverrides,
|
|
149
152
|
getEffectDragOverrides,
|
|
150
153
|
propStatuses,
|
|
154
|
+
runtimeValues,
|
|
151
155
|
selection,
|
|
152
156
|
track,
|
|
153
157
|
]);
|
|
@@ -33,6 +33,7 @@ export type InspectorInlineActionSegment = {
|
|
|
33
33
|
export type InspectorInlineActionProps = {
|
|
34
34
|
readonly children: React.ReactNode;
|
|
35
35
|
readonly disabled: boolean;
|
|
36
|
+
readonly iconContainerStyle?: React.CSSProperties;
|
|
36
37
|
readonly onClick: React.MouseEventHandler<HTMLButtonElement> | null;
|
|
37
38
|
readonly renderIcon?: (color: string) => React.ReactNode;
|
|
38
39
|
readonly size?: 'default' | 'compact';
|
|
@@ -115,7 +115,7 @@ const segmentedTrailingAction = {
|
|
|
115
115
|
padding: 0,
|
|
116
116
|
width: 28,
|
|
117
117
|
};
|
|
118
|
-
const InspectorInlineAction = ({ children, disabled, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
|
|
118
|
+
const InspectorInlineAction = ({ children, disabled, iconContainerStyle, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
|
|
119
119
|
const isSegmented = variant.type === 'segmented';
|
|
120
120
|
// A non-clickable single action (onClick === null) never shows a hover
|
|
121
121
|
// effect. In the segmented variant, the main segment highlights whenever
|
|
@@ -135,7 +135,7 @@ const InspectorInlineAction = ({ children, disabled, onClick, renderIcon, size =
|
|
|
135
135
|
...(isSegmented ? segmentedMainAction : null),
|
|
136
136
|
...style,
|
|
137
137
|
}), [disabled, showsHover, isSegmented, size, style]);
|
|
138
|
-
const mainContent = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderIcon ? (jsx_runtime_1.jsx("span", { style: inlineLabelIcon, children: renderIcon(colors_1.CURRENT_COLOR) })) : null, jsx_runtime_1.jsx("span", { style: inlineLabelText, children: children })
|
|
138
|
+
const mainContent = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderIcon ? (jsx_runtime_1.jsx("span", { style: { ...inlineLabelIcon, ...iconContainerStyle }, children: renderIcon(colors_1.CURRENT_COLOR) })) : null, jsx_runtime_1.jsx("span", { style: inlineLabelText, children: children })
|
|
139
139
|
] }));
|
|
140
140
|
const mainAction = onClick ? (jsx_runtime_1.jsx("button", { className: `__remotion-inspector-inline-action ${hoverable_1.HOVERABLE_CLASS_NAME}`, type: "button", disabled: disabled, style: buttonStyle, title: title, onClick: onClick, children: mainContent })) : (jsx_runtime_1.jsx("div", { className: hoverable_1.HOVERABLE_CLASS_NAME, style: buttonStyle, title: title, children: mainContent }));
|
|
141
141
|
if (variant.type === 'segmented') {
|
|
@@ -21,7 +21,7 @@ const useCompositionActions = () => {
|
|
|
21
21
|
const [isAddingSolid, setIsAddingSolid] = (0, react_1.useState)(false);
|
|
22
22
|
const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
|
|
23
23
|
const [isAddingComposition, setIsAddingComposition] = (0, react_1.useState)(false);
|
|
24
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
24
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
25
25
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
26
26
|
const previewConnected = previewServerState.type === 'connected';
|
|
27
27
|
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
@@ -121,6 +121,7 @@ const useCompositionActions = () => {
|
|
|
121
121
|
destinationDimensions: null,
|
|
122
122
|
dropPosition: null,
|
|
123
123
|
from: null,
|
|
124
|
+
preferCompositionStart: null,
|
|
124
125
|
svgImportMode: 'image',
|
|
125
126
|
});
|
|
126
127
|
}
|
|
@@ -145,6 +146,7 @@ const useCompositionActions = () => {
|
|
|
145
146
|
destinationDimensions: null,
|
|
146
147
|
dropPosition: null,
|
|
147
148
|
from: null,
|
|
149
|
+
preferCompositionStart: null,
|
|
148
150
|
});
|
|
149
151
|
}
|
|
150
152
|
finally {
|
|
@@ -198,6 +200,7 @@ const useCompositionActions = () => {
|
|
|
198
200
|
compositionId: currentCompositionId,
|
|
199
201
|
dropPosition: null,
|
|
200
202
|
from: null,
|
|
203
|
+
preferCompositionStart: null,
|
|
201
204
|
});
|
|
202
205
|
}
|
|
203
206
|
catch (error) {
|
|
@@ -230,7 +230,7 @@ const hasSequenceControls = (sequence) => {
|
|
|
230
230
|
exports.hasSequenceControls = hasSequenceControls;
|
|
231
231
|
const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderTransformControls, }) => {
|
|
232
232
|
var _a;
|
|
233
|
-
const { tree, propStatuses } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
233
|
+
const { tree, propStatuses, runtimeValues } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
234
234
|
sequence,
|
|
235
235
|
nodePathInfo,
|
|
236
236
|
includeTextContent: true,
|
|
@@ -242,9 +242,9 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
242
242
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
243
243
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
244
244
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
245
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
245
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
246
246
|
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
247
|
-
const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls);
|
|
247
|
+
const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls, runtimeValues);
|
|
248
248
|
const assetSelectionInitialQuery = (0, asset_search_1.getAssetSearchQueryForComponent)(sequence.controls.componentIdentity);
|
|
249
249
|
const getSourceAction = (0, react_1.useCallback)((src) => {
|
|
250
250
|
var _a;
|
|
@@ -412,7 +412,7 @@ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation,
|
|
|
412
412
|
});
|
|
413
413
|
const borderRadiusConversion = (0, border_radius_representation_1.getBorderRadiusConversion)(sequencePropStatuses, getDragOverrides(nodePathInfo.sequenceSubscriptionKey));
|
|
414
414
|
const inlineCaptionValue = ((_a = schema.captions) === null || _a === void 0 ? void 0 : _a.type) === 'remotion-captions'
|
|
415
|
-
?
|
|
415
|
+
? runtimeValues.captions
|
|
416
416
|
: null;
|
|
417
417
|
const inlineCaptions = Array.isArray(inlineCaptionValue)
|
|
418
418
|
? inlineCaptionValue
|
|
@@ -73,7 +73,7 @@ const InstallPackageModal = ({ packageManager }) => {
|
|
|
73
73
|
}
|
|
74
74
|
setState({ type: 'installing' });
|
|
75
75
|
try {
|
|
76
|
-
await (0, install_package_1.installPackages)(selectedPackages);
|
|
76
|
+
await (0, install_package_1.installPackages)(selectedPackages.map((name) => ({ name, version: null })));
|
|
77
77
|
setState({ type: 'done' });
|
|
78
78
|
}
|
|
79
79
|
catch (err) {
|
|
@@ -39,7 +39,7 @@ const flex = {
|
|
|
39
39
|
const MenuToolbar = ({ readOnlyStudio }) => {
|
|
40
40
|
const [selected, setSelected] = (0, react_1.useState)(null);
|
|
41
41
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
42
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
42
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
43
43
|
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
44
44
|
const canUndoAndRedo = !readOnlyStudio ||
|
|
45
45
|
(previewServerState.type === 'connected' &&
|
|
@@ -10,7 +10,11 @@ const content = {
|
|
|
10
10
|
fontSize: 13,
|
|
11
11
|
minWidth: 500,
|
|
12
12
|
};
|
|
13
|
-
const ModalFooterContainer = ({ children, style }) => {
|
|
14
|
-
return (jsx_runtime_1.jsx("div", { style: {
|
|
13
|
+
const ModalFooterContainer = ({ children, noBorder, style }) => {
|
|
14
|
+
return (jsx_runtime_1.jsx("div", { style: {
|
|
15
|
+
...content,
|
|
16
|
+
...style,
|
|
17
|
+
borderTop: noBorder ? undefined : colors_1.BORDER_BLACK,
|
|
18
|
+
}, children: children }));
|
|
15
19
|
};
|
|
16
20
|
exports.ModalFooterContainer = ModalFooterContainer;
|
|
@@ -24,7 +24,7 @@ const icon = {
|
|
|
24
24
|
width: 20,
|
|
25
25
|
};
|
|
26
26
|
const ModalHeader = ({ title, onClose }) => {
|
|
27
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
27
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
28
28
|
const onPress = (0, react_1.useCallback)(() => {
|
|
29
29
|
setSelectedModal(null);
|
|
30
30
|
}, [setSelectedModal]);
|
|
@@ -12,8 +12,6 @@ const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
|
|
|
12
12
|
const modals_1 = require("../state/modals");
|
|
13
13
|
const z_index_1 = require("../state/z-index");
|
|
14
14
|
const AskAiModal_1 = require("./AskAiModal");
|
|
15
|
-
const ConfigureDefaultEditorModal_1 = require("./ConfigureDefaultEditorModal");
|
|
16
|
-
const ConfigureLicenseModal_1 = require("./ConfigureLicenseModal");
|
|
17
15
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
18
16
|
const EffectPickerModal_1 = require("./EffectPickerModal");
|
|
19
17
|
const InstallPackage_1 = require("./InstallPackage");
|
|
@@ -31,16 +29,29 @@ const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher")
|
|
|
31
29
|
const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
32
30
|
const ServerRenderModal_1 = require("./RenderModal/ServerRenderModal");
|
|
33
31
|
const WebRenderModal_1 = require("./RenderModal/WebRenderModal");
|
|
32
|
+
const SettingsModal_1 = require("./SettingsModal");
|
|
34
33
|
const SvgImportDialog_1 = require("./SvgImportDialog");
|
|
35
34
|
const UpdateModal_1 = require("./UpdateModal/UpdateModal");
|
|
36
35
|
const Modals = ({ readOnlyStudio }) => {
|
|
37
36
|
var _a;
|
|
38
|
-
const
|
|
37
|
+
const modalContextType = (0, react_1.useContext)(modals_1.SelectedModalContext);
|
|
38
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
39
39
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const { previewServerState, subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
41
|
+
const canRender = previewServerState.type === 'connected';
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
43
|
+
return subscribeToEvent('license-key-install-request', (event) => {
|
|
44
|
+
if (event.type !== 'license-key-install-request') {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
setSelectedModal({
|
|
48
|
+
type: 'settings',
|
|
49
|
+
initialTab: 'license',
|
|
50
|
+
initialPublicLicenseKey: event.licenseKey,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}, [setSelectedModal, subscribeToEvent]);
|
|
54
|
+
return react_dom_1.default.createPortal(jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'settings' && (jsx_runtime_1.jsx(SettingsModal_1.SettingsModal, { initialTab: modalContextType.initialTab, initialPublicLicenseKey: modalContextType.initialPublicLicenseKey }, `${modalContextType.initialTab}-${modalContextType.initialPublicLicenseKey}`)), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
44
55
|
modalContextType.type === 'server-render' &&
|
|
45
56
|
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, 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, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }),
|
|
46
57
|
// Modals must be above overlays opened from the editor, such as the
|
|
@@ -5,13 +5,12 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const modals_1 = require("../state/modals");
|
|
7
7
|
const ModalsProvider = ({ children }) => {
|
|
8
|
-
const [
|
|
9
|
-
const
|
|
8
|
+
const [selectedModal, setSelectedModal] = (0, react_1.useState)(null);
|
|
9
|
+
const setSelectedModalContext = (0, react_1.useMemo)(() => {
|
|
10
10
|
return {
|
|
11
|
-
|
|
12
|
-
setSelectedModal: setModalContextType,
|
|
11
|
+
setSelectedModal,
|
|
13
12
|
};
|
|
14
|
-
}, [
|
|
15
|
-
return (jsx_runtime_1.jsx(modals_1.
|
|
13
|
+
}, []);
|
|
14
|
+
return (jsx_runtime_1.jsx(modals_1.SetSelectedModalContext.Provider, { value: setSelectedModalContext, children: jsx_runtime_1.jsx(modals_1.SelectedModalContext.Provider, { value: selectedModal, children: children }) }));
|
|
16
15
|
};
|
|
17
16
|
exports.ModalsProvider = ModalsProvider;
|
|
@@ -24,7 +24,7 @@ const CodemodFooterPresentation = ({ codemodStatus, disabled, genericSubmitLabel
|
|
|
24
24
|
const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNotification, errorNotification, genericSubmitLabel, submitLabel, onSuccess, fallbackToRootFile = false, applyCodemod, }) => {
|
|
25
25
|
var _a;
|
|
26
26
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
27
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
27
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
28
28
|
const [codemodStatus, setCanApplyCodemod] = (0, react_1.useState)({
|
|
29
29
|
type: 'loading',
|
|
30
30
|
});
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const modals_1 = require("../../state/modals");
|
|
7
7
|
const ModalContainer_1 = require("../ModalContainer");
|
|
8
8
|
const DismissableModal = ({ children, panelStyle }) => {
|
|
9
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
9
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
10
10
|
const onQuit = (0, react_1.useCallback)(() => {
|
|
11
11
|
setSelectedModal(null);
|
|
12
12
|
}, [setSelectedModal]);
|
|
@@ -23,7 +23,7 @@ const content = {
|
|
|
23
23
|
minWidth: 500,
|
|
24
24
|
};
|
|
25
25
|
const RenameStaticFileModal = ({ relativePath }) => {
|
|
26
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
26
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
27
27
|
const staticFiles = (0, use_static_files_1.useStaticFiles)();
|
|
28
28
|
const [newName, setNewName] = (0, react_1.useState)(() => (0, use_rename_static_file_1.getStaticFileBaseName)(relativePath));
|
|
29
29
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
@@ -51,7 +51,7 @@ const Inner = () => {
|
|
|
51
51
|
}
|
|
52
52
|
return null;
|
|
53
53
|
});
|
|
54
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
54
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
55
55
|
const valid = (0, react_1.useMemo)(() => {
|
|
56
56
|
if (!value)
|
|
57
57
|
return true;
|
|
@@ -30,7 +30,8 @@ const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted,
|
|
|
30
30
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
31
31
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
32
32
|
const [showBufferIndicator, setShowBufferState] = (0, react_1.useState)(false);
|
|
33
|
-
const {
|
|
33
|
+
const { play, pause, pauseAndReturnToPlayStart, frameBack, seek, frameForward, emitter, getCurrentFrame, } = player_1.PlayerInternals.usePlayerMethods();
|
|
34
|
+
const [playing] = remotion_1.Internals.Timeline.usePlayingState();
|
|
34
35
|
player_1.PlayerInternals.usePlayback({
|
|
35
36
|
loop,
|
|
36
37
|
playbackRate,
|
|
@@ -6,10 +6,11 @@ const react_1 = require("react");
|
|
|
6
6
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
7
7
|
const PlaybackKeyboardShortcutsManager = ({ setPlaybackRate }) => {
|
|
8
8
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
9
|
-
const { play, pause,
|
|
9
|
+
const { play, pause, isPlaying } = player_1.PlayerInternals.usePlayerMethods();
|
|
10
10
|
const onJKey = (0, react_1.useCallback)(() => {
|
|
11
|
+
const wasPlaying = isPlaying();
|
|
11
12
|
setPlaybackRate((prevPlaybackRate) => {
|
|
12
|
-
if (!
|
|
13
|
+
if (!wasPlaying) {
|
|
13
14
|
return -1;
|
|
14
15
|
}
|
|
15
16
|
if (prevPlaybackRate > -1) {
|
|
@@ -21,14 +22,15 @@ const PlaybackKeyboardShortcutsManager = ({ setPlaybackRate }) => {
|
|
|
21
22
|
return -4;
|
|
22
23
|
});
|
|
23
24
|
play();
|
|
24
|
-
}, [
|
|
25
|
+
}, [isPlaying, play, setPlaybackRate]);
|
|
25
26
|
const onKKey = (0, react_1.useCallback)(() => {
|
|
26
27
|
setPlaybackRate(1);
|
|
27
28
|
pause();
|
|
28
29
|
}, [pause, setPlaybackRate]);
|
|
29
30
|
const onLKey = (0, react_1.useCallback)(() => {
|
|
31
|
+
const wasPlaying = isPlaying();
|
|
30
32
|
setPlaybackRate((prevPlaybackRate) => {
|
|
31
|
-
if (!
|
|
33
|
+
if (!wasPlaying) {
|
|
32
34
|
return 1;
|
|
33
35
|
}
|
|
34
36
|
if (prevPlaybackRate < 1) {
|
|
@@ -40,7 +42,7 @@ const PlaybackKeyboardShortcutsManager = ({ setPlaybackRate }) => {
|
|
|
40
42
|
return 4;
|
|
41
43
|
});
|
|
42
44
|
play();
|
|
43
|
-
}, [
|
|
45
|
+
}, [isPlaying, play, setPlaybackRate]);
|
|
44
46
|
(0, react_1.useEffect)(() => {
|
|
45
47
|
const jKey = keybindings.registerKeybinding({
|
|
46
48
|
event: 'keydown',
|