@remotion/studio 4.0.490 → 4.0.492
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 +7 -4
- package/dist/components/Canvas.js +2 -0
- package/dist/components/CompositionOrStillIcon.d.ts +7 -0
- package/dist/components/CompositionOrStillIcon.js +11 -0
- package/dist/components/CompositionSelector.js +13 -1
- package/dist/components/CompositionSelectorItem.js +33 -5
- package/dist/components/CurrentAsset.d.ts +6 -0
- package/dist/components/CurrentAsset.js +14 -8
- package/dist/components/CurrentComposition.js +4 -1
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/GlobalKeybindings.d.ts +1 -3
- package/dist/components/GlobalKeybindings.js +2 -9
- package/dist/components/InlineEditableTitle.d.ts +1 -0
- package/dist/components/InlineEditableTitle.js +12 -7
- package/dist/components/InspectorInfoHeader.d.ts +1 -0
- package/dist/components/InspectorInfoHeader.js +7 -4
- package/dist/components/InspectorLocationCopy.d.ts +7 -0
- package/dist/components/InspectorLocationCopy.js +65 -0
- package/dist/components/InspectorPanel/SequenceCompositionsSection.d.ts +5 -0
- package/dist/components/InspectorPanel/SequenceCompositionsSection.js +37 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +6 -4
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -1
- package/dist/components/InspectorPanel/common.js +1 -1
- package/dist/components/InspectorPanel/get-compositions-matching-single-child.d.ts +6 -0
- package/dist/components/InspectorPanel/get-compositions-matching-single-child.js +11 -0
- package/dist/components/InspectorSequenceSection.js +57 -3
- package/dist/components/KeyboardShortcutsExplainer.js +4 -0
- package/dist/components/NewComposition/NewComposition.js +11 -4
- package/dist/components/NewComposition/get-new-composition-defaults.d.ts +4 -0
- package/dist/components/NewComposition/get-new-composition-defaults.js +13 -0
- package/dist/components/OptionsPanel.js +4 -8
- package/dist/components/OutlineToggle.d.ts +3 -1
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/RenderButton.js +9 -33
- package/dist/components/RenderModal/WebRenderModal.js +3 -8
- package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +0 -2
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +2 -9
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +0 -2
- package/dist/components/RenderQueue/client-side-render-types.d.ts +0 -1
- package/dist/components/RenderQueue/index.js +0 -9
- package/dist/components/SelectedOutlineElement.js +40 -38
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +2 -13
- package/dist/components/SnappingToggle.d.ts +3 -1
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Timeline/TimelineAssetField.d.ts +14 -0
- package/dist/components/Timeline/TimelineAssetField.js +125 -0
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +20 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +301 -155
- package/dist/components/Timeline/TimelineEffectPropItem.js +7 -11
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
- package/dist/components/Timeline/TimelineFieldLabel.d.ts +1 -0
- package/dist/components/Timeline/TimelineFieldLabel.js +7 -3
- package/dist/components/Timeline/TimelineFieldRowContent.d.ts +8 -0
- package/dist/components/Timeline/TimelineFieldRowContent.js +16 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +5 -1
- package/dist/components/Timeline/TimelineRowChrome.js +8 -4
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +7 -0
- package/dist/components/Timeline/TimelineRowLayoutContext.js +13 -0
- package/dist/components/Timeline/TimelineSelection.js +1 -0
- package/dist/components/Timeline/TimelineSequence.js +2 -4
- package/dist/components/Timeline/TimelineSequenceItem.js +1 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +8 -10
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +18 -6
- package/dist/components/Timeline/TimelineTextContentField.js +12 -5
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +3 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +11 -4
- package/dist/components/Timeline/delete-selected-timeline-item.js +4 -5
- package/dist/components/Timeline/effects-clipboard.d.ts +14 -0
- package/dist/components/Timeline/effects-clipboard.js +68 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +40 -3
- package/dist/components/Timeline/get-timeline-media-start-frame.d.ts +6 -0
- package/dist/components/Timeline/get-timeline-media-start-frame.js +15 -0
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -2
- package/dist/components/Timeline/sequence-props-subscription-store.js +8 -2
- package/dist/components/Timeline/timeline-asset-link.d.ts +6 -0
- package/dist/components/Timeline/timeline-asset-link.js +27 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +2 -1
- package/dist/components/Timeline/timeline-field-row-layout.js +10 -3
- package/dist/components/Timeline/timeline-row-layout.d.ts +4 -3
- package/dist/components/Timeline/timeline-row-layout.js +7 -6
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
- package/dist/components/Timeline/use-sequence-props-subscription.js +10 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
- package/dist/components/Timeline/use-timeline-height.js +1 -0
- package/dist/components/import-assets.d.ts +14 -2
- package/dist/components/import-assets.js +28 -7
- package/dist/components/root-composition-menu-items.d.ts +8 -0
- package/dist/components/root-composition-menu-items.js +45 -0
- package/dist/components/selected-outline-measurement.d.ts +4 -0
- package/dist/components/selected-outline-measurement.js +3 -1
- package/dist/components/selected-outline-types.d.ts +1 -6
- package/dist/esm/{chunk-16nwrbrm.js → chunk-ewx0568t.js} +7962 -7216
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/internals.mjs +7962 -7216
- package/dist/esm/previewEntry.mjs +7332 -6586
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/format-file-location.d.ts +5 -0
- package/dist/helpers/format-file-location.js +9 -1
- package/dist/helpers/get-file-manager-name.d.ts +1 -0
- package/dist/helpers/get-file-manager-name.js +13 -0
- package/dist/helpers/retry-payload.js +0 -1
- package/dist/helpers/studio-runtime-config.d.ts +0 -1
- package/dist/helpers/studio-runtime-config.js +1 -6
- package/dist/helpers/timeline-layout.d.ts +2 -1
- package/dist/helpers/timeline-layout.js +5 -1
- package/dist/helpers/url-state.d.ts +1 -0
- package/dist/helpers/url-state.js +8 -6
- package/dist/helpers/use-menu-structure.js +19 -20
- package/dist/state/modals.d.ts +0 -1
- package/package.json +11 -11
- package/dist/components/RenderModal/WebRendererExperimentalBadge.d.ts +0 -1
- package/dist/components/RenderModal/WebRendererExperimentalBadge.js +0 -35
- package/dist/helpers/show-browser-rendering.d.ts +0 -1
- package/dist/helpers/show-browser-rendering.js +0 -5
|
@@ -9,6 +9,7 @@ const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
|
9
9
|
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
10
10
|
const AlignmentControls_1 = require("./AlignmentControls");
|
|
11
11
|
const common_1 = require("./common");
|
|
12
|
+
const SequenceCompositionsSection_1 = require("./SequenceCompositionsSection");
|
|
12
13
|
const SequenceInspectorHeader_1 = require("./SequenceInspectorHeader");
|
|
13
14
|
const styles_1 = require("./styles");
|
|
14
15
|
const use_track_for_selection_1 = require("./use-track-for-selection");
|
|
@@ -52,7 +53,7 @@ const SequenceExpandedInspector = ({ track }) => {
|
|
|
52
53
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
53
54
|
}
|
|
54
55
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
|
|
55
|
-
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })), renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) })] }));
|
|
56
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(SequenceCompositionsSection_1.SequenceCompositionsSection, { track: track }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })), renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) })] }));
|
|
56
57
|
};
|
|
57
58
|
const SequenceSelectionInspector = ({ selection }) => {
|
|
58
59
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getCompositionsMatchingSingleChild: <Composition extends {
|
|
2
|
+
readonly componentFromProps?: unknown;
|
|
3
|
+
}>({ compositions, singleChildComponent, }: {
|
|
4
|
+
readonly compositions: readonly Composition[];
|
|
5
|
+
readonly singleChildComponent: unknown;
|
|
6
|
+
}) => Composition[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCompositionsMatchingSingleChild = void 0;
|
|
4
|
+
const getCompositionsMatchingSingleChild = ({ compositions, singleChildComponent, }) => {
|
|
5
|
+
if (singleChildComponent === null ||
|
|
6
|
+
typeof singleChildComponent === 'undefined') {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
return compositions.filter((composition) => composition.componentFromProps === singleChildComponent);
|
|
10
|
+
};
|
|
11
|
+
exports.getCompositionsMatchingSingleChild = getCompositionsMatchingSingleChild;
|
|
@@ -41,11 +41,16 @@ const colors_1 = require("../helpers/colors");
|
|
|
41
41
|
const timeline_layout_1 = require("../helpers/timeline-layout");
|
|
42
42
|
const plus_1 = require("../icons/plus");
|
|
43
43
|
const modals_1 = require("../state/modals");
|
|
44
|
+
const CurrentAsset_1 = require("./CurrentAsset");
|
|
44
45
|
const InlineAction_1 = require("./InlineAction");
|
|
45
46
|
const styles_1 = require("./InspectorPanel/styles");
|
|
47
|
+
const InspectorPanelLayout_1 = require("./InspectorPanelLayout");
|
|
48
|
+
const timeline_asset_link_1 = require("./Timeline/timeline-asset-link");
|
|
46
49
|
const TimelineExpandedRow_1 = require("./Timeline/TimelineExpandedRow");
|
|
50
|
+
const TimelineRowLayoutContext_1 = require("./Timeline/TimelineRowLayoutContext");
|
|
47
51
|
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
48
52
|
const use_timeline_expanded_tree_1 = require("./Timeline/use-timeline-expanded-tree");
|
|
53
|
+
const use_select_asset_1 = require("./use-select-asset");
|
|
49
54
|
const container = {
|
|
50
55
|
color: colors_1.WHITE,
|
|
51
56
|
display: 'flex',
|
|
@@ -72,6 +77,38 @@ const plusIcon = {
|
|
|
72
77
|
width: 15,
|
|
73
78
|
height: 15,
|
|
74
79
|
};
|
|
80
|
+
const remoteSourceLabel = {
|
|
81
|
+
color: colors_1.LIGHT_TEXT,
|
|
82
|
+
display: 'flex',
|
|
83
|
+
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
84
|
+
fontSize: 12,
|
|
85
|
+
lineHeight: '18px',
|
|
86
|
+
minWidth: 0,
|
|
87
|
+
overflow: 'hidden',
|
|
88
|
+
padding: `6px ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px`,
|
|
89
|
+
whiteSpace: 'nowrap',
|
|
90
|
+
};
|
|
91
|
+
const remoteSourceLeading = {
|
|
92
|
+
color: colors_1.LIGHT_TEXT,
|
|
93
|
+
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
94
|
+
fontSize: 12,
|
|
95
|
+
lineHeight: '18px',
|
|
96
|
+
minWidth: 0,
|
|
97
|
+
overflow: 'hidden',
|
|
98
|
+
textOverflow: 'ellipsis',
|
|
99
|
+
whiteSpace: 'nowrap',
|
|
100
|
+
};
|
|
101
|
+
const remoteSourceTrailing = {
|
|
102
|
+
color: colors_1.LIGHT_TEXT,
|
|
103
|
+
flexShrink: 0,
|
|
104
|
+
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
105
|
+
fontSize: 12,
|
|
106
|
+
lineHeight: '18px',
|
|
107
|
+
maxWidth: '55%',
|
|
108
|
+
overflow: 'hidden',
|
|
109
|
+
textOverflow: 'ellipsis',
|
|
110
|
+
whiteSpace: 'nowrap',
|
|
111
|
+
};
|
|
75
112
|
const isEffectsRoot = (node) => {
|
|
76
113
|
if (node.kind !== 'group' || node.effectInfo !== null) {
|
|
77
114
|
return false;
|
|
@@ -138,10 +175,22 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
138
175
|
sequence,
|
|
139
176
|
nodePathInfo,
|
|
140
177
|
includeTextContent: true,
|
|
178
|
+
includeSourceControls: true,
|
|
141
179
|
});
|
|
142
180
|
const [collapsedKeys, setCollapsedKeys] = (0, react_1.useState)(loadInspectorCollapsedKeys);
|
|
143
181
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
144
182
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
183
|
+
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
184
|
+
const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls);
|
|
185
|
+
const assetLinkInfo = (0, react_1.useMemo)(() => (mediaSrc ? (0, timeline_asset_link_1.getTimelineAssetLinkInfo)(mediaSrc) : null), [mediaSrc]);
|
|
186
|
+
const localAsset = (assetLinkInfo === null || assetLinkInfo === void 0 ? void 0 : assetLinkInfo.kind) === 'local' ? assetLinkInfo : null;
|
|
187
|
+
const remoteAsset = (assetLinkInfo === null || assetLinkInfo === void 0 ? void 0 : assetLinkInfo.kind) === 'remote' ? assetLinkInfo : null;
|
|
188
|
+
const remoteSourceParts = (0, react_1.useMemo)(() => remoteAsset ? (0, timeline_asset_link_1.splitRemoteSourceForMiddleEllipsis)(remoteAsset.href) : null, [remoteAsset]);
|
|
189
|
+
const jumpToAsset = (0, react_1.useCallback)(() => {
|
|
190
|
+
if (localAsset) {
|
|
191
|
+
(0, timeline_asset_link_1.openTimelineAssetLink)(localAsset, selectAsset);
|
|
192
|
+
}
|
|
193
|
+
}, [localAsset, selectAsset]);
|
|
145
194
|
const getIsExpanded = (0, react_1.useCallback)((candidate) => {
|
|
146
195
|
return !collapsedKeys.has(getInspectorExpansionKey(candidate));
|
|
147
196
|
}, [collapsedKeys]);
|
|
@@ -183,7 +232,10 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
183
232
|
}),
|
|
184
233
|
};
|
|
185
234
|
}, [getIsExpanded, tree]);
|
|
186
|
-
const controlSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(controlRows)
|
|
235
|
+
const controlSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(controlRows.filter(({ node }) => {
|
|
236
|
+
var _a;
|
|
237
|
+
return node.kind !== 'field' || ((_a = node.field) === null || _a === void 0 ? void 0 : _a.key) !== 'src';
|
|
238
|
+
})), [controlRows]);
|
|
187
239
|
const effectSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(effectRows), [effectRows]);
|
|
188
240
|
const controlGroups = (0, react_1.useMemo)(() => getInspectorControlGroups(controlRows), [controlRows]);
|
|
189
241
|
const { schema } = sequence.controls;
|
|
@@ -214,7 +266,7 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
214
266
|
jsx_runtime_1.jsx("div", { style: effectsHeaderTitle, children: "Effects" }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: !canAddEffect, onClick: onAddEffect, title: canAddEffect ? 'Add effect' : undefined, renderAction: (color) => jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: plusIcon }) })] }));
|
|
215
267
|
};
|
|
216
268
|
const renderRow = ({ node, depth }) => {
|
|
217
|
-
return (jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: 0, rowDepthBase: 0, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "inspector" }, JSON.stringify(node.nodePathInfo)));
|
|
269
|
+
return (jsx_runtime_1.jsx(TimelineRowLayoutContext_1.TimelineRowLayoutContext.Provider, { value: TimelineRowLayoutContext_1.INSPECTOR_TIMELINE_ROW_LAYOUT, children: jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: 0, rowDepthBase: 0, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "inspector" }) }, JSON.stringify(node.nodePathInfo)));
|
|
218
270
|
};
|
|
219
271
|
if (controlRows.length === 0 && !showEffectsSection) {
|
|
220
272
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
@@ -222,6 +274,8 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
222
274
|
] }));
|
|
223
275
|
}
|
|
224
276
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
225
|
-
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider }), controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group, i) => (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i === 0 ? null : jsx_runtime_1.jsx("div", { style: controlsEffectsDivider }), renderSectionHeader(group.label), group.id === '
|
|
277
|
+
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider }), controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group, i) => (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i === 0 ? null : jsx_runtime_1.jsx("div", { style: controlsEffectsDivider }), renderSectionHeader(group.label), group.id === 'source' && localAsset ? (jsx_runtime_1.jsx(CurrentAsset_1.AssetInfo, { assetName: localAsset.assetPath, contentSized: true, onAssetClick: jumpToAsset, readOnlyStudio: true })) : null, group.id === 'source' && remoteAsset && remoteSourceParts ? (jsx_runtime_1.jsxs("div", { style: remoteSourceLabel, title: remoteAsset.href, children: [
|
|
278
|
+
jsx_runtime_1.jsx("span", { style: remoteSourceLeading, children: remoteSourceParts.leading }), jsx_runtime_1.jsx("span", { style: remoteSourceTrailing, children: remoteSourceParts.trailing })
|
|
279
|
+
] })) : null, group.id === 'transforms' ? renderTransformControls() : null, group.id === 'source' ? null : group.rows.map(renderRow)] }, group.id))) })) : null, showEffectsSection ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showControlsEffectsDivider ? (jsx_runtime_1.jsx("div", { style: controlsEffectsDivider })) : null, renderEffectsHeader(), effectRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) })) : null] })) : null] }));
|
|
226
280
|
};
|
|
227
281
|
exports.InspectorSequenceSection = InspectorSequenceSection;
|
|
@@ -167,6 +167,10 @@ const KeyboardShortcutsExplainer = () => {
|
|
|
167
167
|
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
168
168
|
jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "C" })
|
|
169
169
|
] }), jsx_runtime_1.jsx("div", { style: right, children: "Copy effects / values" })
|
|
170
|
+
] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
171
|
+
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
172
|
+
jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "X" })
|
|
173
|
+
] }), jsx_runtime_1.jsx("div", { style: right, children: "Cut effects" })
|
|
170
174
|
] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
171
175
|
jsx_runtime_1.jsxs("div", { style: left, children: [
|
|
172
176
|
jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "V" })
|
|
@@ -11,6 +11,7 @@ const ModalHeader_1 = require("../ModalHeader");
|
|
|
11
11
|
const layout_2 = require("../RenderModal/layout");
|
|
12
12
|
const CodemodFooter_1 = require("./CodemodFooter");
|
|
13
13
|
const DismissableModal_1 = require("./DismissableModal");
|
|
14
|
+
const get_new_composition_defaults_1 = require("./get-new-composition-defaults");
|
|
14
15
|
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
15
16
|
const InputDragger_1 = require("./InputDragger");
|
|
16
17
|
const NewCompDuration_1 = require("./NewCompDuration");
|
|
@@ -28,13 +29,19 @@ const folderPathStyle = {
|
|
|
28
29
|
};
|
|
29
30
|
const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
30
31
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
32
|
+
const resolvedComposition = remotion_1.Internals.useResolvedVideoConfig(null);
|
|
33
|
+
const initialComposition = (resolvedComposition === null || resolvedComposition === void 0 ? void 0 : resolvedComposition.type) === 'success' ||
|
|
34
|
+
(resolvedComposition === null || resolvedComposition === void 0 ? void 0 : resolvedComposition.type) === 'success-and-refreshing'
|
|
35
|
+
? resolvedComposition.result
|
|
36
|
+
: null;
|
|
37
|
+
const initialDimensions = (0, get_new_composition_defaults_1.getNewCompositionDefaults)(initialComposition);
|
|
31
38
|
const [newId, setName] = (0, react_1.useState)(() => (0, use_create_composition_1.getUniqueCompositionName)(compositions));
|
|
32
|
-
const [selectedFrameRate, setFrameRate] = (0, react_1.useState)(
|
|
39
|
+
const [selectedFrameRate, setFrameRate] = (0, react_1.useState)(initialDimensions.fps);
|
|
33
40
|
const [size, setSize] = (0, react_1.useState)(() => ({
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
41
|
+
width: initialDimensions.width,
|
|
42
|
+
height: initialDimensions.height,
|
|
36
43
|
}));
|
|
37
|
-
const [durationInFrames, setDurationInFrames] = (0, react_1.useState)(
|
|
44
|
+
const [durationInFrames, setDurationInFrames] = (0, react_1.useState)(initialDimensions.durationInFrames);
|
|
38
45
|
const onWidthChanged = (0, react_1.useCallback)((newValue) => {
|
|
39
46
|
setSize((s) => {
|
|
40
47
|
return {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { VideoConfig } from 'remotion';
|
|
2
|
+
type CompositionDimensions = Pick<VideoConfig, 'width' | 'height' | 'fps' | 'durationInFrames'>;
|
|
3
|
+
export declare const getNewCompositionDefaults: (composition: CompositionDimensions | null) => CompositionDimensions;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNewCompositionDefaults = void 0;
|
|
4
|
+
const defaultCompositionDimensions = {
|
|
5
|
+
width: 1920,
|
|
6
|
+
height: 1080,
|
|
7
|
+
fps: 30,
|
|
8
|
+
durationInFrames: 150,
|
|
9
|
+
};
|
|
10
|
+
const getNewCompositionDefaults = (composition) => {
|
|
11
|
+
return composition !== null && composition !== void 0 ? composition : defaultCompositionDimensions;
|
|
12
|
+
};
|
|
13
|
+
exports.getNewCompositionDefaults = getNewCompositionDefaults;
|
|
@@ -6,7 +6,6 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const colors_1 = require("../helpers/colors");
|
|
8
8
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
9
|
-
const show_browser_rendering_1 = require("../helpers/show-browser-rendering");
|
|
10
9
|
const get_zod_if_possible_1 = require("./get-zod-if-possible");
|
|
11
10
|
const InspectorPanel_1 = require("./InspectorPanel");
|
|
12
11
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
@@ -19,10 +18,7 @@ const actions_1 = require("./RenderQueue/actions");
|
|
|
19
18
|
const RendersTab_1 = require("./RendersTab");
|
|
20
19
|
const Tabs_1 = require("./Tabs");
|
|
21
20
|
const localStorageKey = 'remotion.sidebarPanel';
|
|
22
|
-
const getSelectedPanel = (
|
|
23
|
-
if (!renderingAvailable) {
|
|
24
|
-
return 'inspector';
|
|
25
|
-
}
|
|
21
|
+
const getSelectedPanel = () => {
|
|
26
22
|
const panel = localStorage.getItem(localStorageKey);
|
|
27
23
|
if (panel === 'renders') {
|
|
28
24
|
return 'renders';
|
|
@@ -38,7 +34,6 @@ const persistSelectedOptionsSidebarPanel = (panel) => {
|
|
|
38
34
|
exports.persistSelectedOptionsSidebarPanel = persistSelectedOptionsSidebarPanel;
|
|
39
35
|
const OptionsPanel = ({ readOnlyStudio }) => {
|
|
40
36
|
const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
41
|
-
const renderingAvailable = !readOnlyStudio || show_browser_rendering_1.SHOW_BROWSER_RENDERING;
|
|
42
37
|
const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
|
|
43
38
|
const container = (0, react_1.useMemo)(() => ({
|
|
44
39
|
height: '100%',
|
|
@@ -48,7 +43,7 @@ const OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
48
43
|
flexDirection: 'column',
|
|
49
44
|
flex: 1,
|
|
50
45
|
}), [isMobileLayout]);
|
|
51
|
-
const [panel, setPanel] = (0, react_1.useState)(
|
|
46
|
+
const [panel, setPanel] = (0, react_1.useState)(getSelectedPanel);
|
|
52
47
|
const onInspectorSelected = (0, react_1.useCallback)(() => {
|
|
53
48
|
setPanel('inspector');
|
|
54
49
|
(0, exports.persistSelectedOptionsSidebarPanel)('inspector');
|
|
@@ -181,6 +176,7 @@ const OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
181
176
|
}, []);
|
|
182
177
|
return (jsx_runtime_1.jsxs("div", { style: container, className: "css-reset", onPointerDown: onPointerDown, children: [
|
|
183
178
|
jsx_runtime_1.jsx("div", { style: tabsContainer, children: jsx_runtime_1.jsxs(Tabs_1.Tabs, { children: [
|
|
184
|
-
jsx_runtime_1.jsxs(Tabs_1.Tab, { selected: panel === 'inspector', onClick: onInspectorSelected, style: { justifyContent: 'space-between' }, children: ["Inspector", hasLocalModifications ? (jsx_runtime_1.jsx(SchemaResetButton_1.SchemaResetButton, { onClick: resetToOriginal })) : null] }),
|
|
179
|
+
jsx_runtime_1.jsxs(Tabs_1.Tab, { selected: panel === 'inspector', onClick: onInspectorSelected, style: { justifyContent: 'space-between' }, children: ["Inspector", hasLocalModifications ? (jsx_runtime_1.jsx(SchemaResetButton_1.SchemaResetButton, { onClick: resetToOriginal })) : null] }), jsx_runtime_1.jsx(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })
|
|
180
|
+
] }) }), panel === 'inspector' ? (jsx_runtime_1.jsx(InspectorPanel_1.InspectorPanel, { composition: composition, currentDefaultProps: currentDefaultProps, readOnlyStudio: readOnlyStudio, setDefaultProps: setDefaultProps })) : (jsx_runtime_1.jsx(RenderQueue_1.RenderQueue, {}))] }));
|
|
185
181
|
};
|
|
186
182
|
exports.OptionsPanel = OptionsPanel;
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
8
8
|
const ControlButton_1 = require("./ControlButton");
|
|
9
|
-
const OutlineToggle = () => {
|
|
9
|
+
const OutlineToggle = ({ disabled }) => {
|
|
10
10
|
const { editorShowOutlines, setEditorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
11
11
|
const onClick = (0, react_1.useCallback)(() => {
|
|
12
12
|
setEditorShowOutlines((current) => !current);
|
|
@@ -15,6 +15,6 @@ const OutlineToggle = () => {
|
|
|
15
15
|
const accessibilityLabel = editorShowOutlines
|
|
16
16
|
? 'Hide outlines'
|
|
17
17
|
: 'Show outlines';
|
|
18
|
-
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: jsx_runtime_1.jsx("svg", { style: { width: 18, height: 18 }, viewBox: "0 0 512 512", fill: color, "aria-hidden": "true", focusable: "false", children: jsx_runtime_1.jsx("path", { d: "M32 119.4C12.9 108.4 0 87.7 0 64 0 28.7 28.7 0 64 0 87.7 0 108.4 12.9 119.4 32l273.1 0c11.1-19.1 31.7-32 55.4-32 35.3 0 64 28.7 64 64 0 23.7-12.9 44.4-32 55.4l0 273.1c19.1 11.1 32 31.7 32 55.4 0 35.3-28.7 64-64 64-23.7 0-44.4-12.9-55.4-32l-273.1 0c-11.1 19.1-31.7 32-55.4 32-35.3 0-64-28.7-64-64 0-23.7 12.9-44.4 32-55.4l0-273.1zm64 0l0 273.1c9.7 5.6 17.8 13.7 23.4 23.4l273.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-273.1c-9.7-5.6-17.8-13.7-23.4-23.4L119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4z" }) }) }));
|
|
18
|
+
return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, disabled: disabled, onClick: onClick, children: jsx_runtime_1.jsx("svg", { style: { width: 18, height: 18 }, viewBox: "0 0 512 512", fill: color, "aria-hidden": "true", focusable: "false", children: jsx_runtime_1.jsx("path", { d: "M32 119.4C12.9 108.4 0 87.7 0 64 0 28.7 28.7 0 64 0 87.7 0 108.4 12.9 119.4 32l273.1 0c11.1-19.1 31.7-32 55.4-32 35.3 0 64 28.7 64 64 0 23.7-12.9 44.4-32 55.4l0 273.1c19.1 11.1 32 31.7 32 55.4 0 35.3-28.7 64-64 64-23.7 0-44.4-12.9-55.4-32l-273.1 0c-11.1 19.1-31.7 32-55.4 32-35.3 0-64-28.7-64-64 0-23.7 12.9-44.4 32-55.4l0-273.1zm64 0l0 273.1c9.7 5.6 17.8 13.7 23.4 23.4l273.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-273.1c-9.7-5.6-17.8-13.7-23.4-23.4L119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4z" }) }) }));
|
|
19
19
|
};
|
|
20
20
|
exports.OutlineToggle = OutlineToggle;
|
|
@@ -166,7 +166,7 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
166
166
|
] }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), isVideoComposition ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
167
167
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlayPause_1.PlayPause, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, loop: loop, playbackRate: playbackRate, muted: playerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(MuteToggle_1.MuteToggle, { muted: playerMuted, setMuted: setPlayerMuted }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(TimelineInOutToggle_1.TimelineInOutPointToggle, {}) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 })
|
|
168
168
|
] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
169
|
-
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, {}) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SnappingToggle_1.SnappingToggle, {}) })
|
|
169
|
+
jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(CheckboardToggle_1.CheckboardToggle, {}) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(OutlineToggle_1.OutlineToggle, { disabled: readOnlyStudio }) }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SnappingToggle_1.SnappingToggle, { disabled: readOnlyStudio }) })
|
|
170
170
|
] })) : null, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), canvasContent && isFullscreenSupported ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(FullscreenToggle_1.FullScreenToggle, {}) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), isMobileLayout && (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
171
171
|
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(SizeSelector_1.SizeSelector, {}) }), isStill || isVideoComposition ? (jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }) })) : null] })), jsx_runtime_1.jsxs("div", { style: sideContainer, children: [
|
|
172
172
|
jsx_runtime_1.jsx(layout_1.Flex, {}), !isMobileLayout && jsx_runtime_1.jsx(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 2 }), jsx_runtime_1.jsx(PreviewToolbarControl, { children: jsx_runtime_1.jsx(RenderButton_1.RenderButton, { readOnlyStudio: readOnlyStudio }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1.5 })
|
|
@@ -11,7 +11,6 @@ const react_dom_1 = __importDefault(require("react-dom"));
|
|
|
11
11
|
const remotion_1 = require("remotion");
|
|
12
12
|
const client_id_1 = require("../helpers/client-id");
|
|
13
13
|
const colors_1 = require("../helpers/colors");
|
|
14
|
-
const show_browser_rendering_1 = require("../helpers/show-browser-rendering");
|
|
15
14
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
16
15
|
const caret_1 = require("../icons/caret");
|
|
17
16
|
const render_1 = require("../icons/render");
|
|
@@ -72,9 +71,6 @@ const label = {
|
|
|
72
71
|
};
|
|
73
72
|
const RENDER_TYPE_STORAGE_KEY = 'remotion.renderType';
|
|
74
73
|
const getInitialRenderType = (readOnlyStudio) => {
|
|
75
|
-
if (!show_browser_rendering_1.SHOW_BROWSER_RENDERING) {
|
|
76
|
-
return readOnlyStudio ? 'render-command' : 'server-render';
|
|
77
|
-
}
|
|
78
74
|
if (readOnlyStudio) {
|
|
79
75
|
return 'client-render';
|
|
80
76
|
}
|
|
@@ -139,30 +135,21 @@ const RenderButton = ({ readOnlyStudio, }) => {
|
|
|
139
135
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
140
136
|
.previewServerState.type;
|
|
141
137
|
const canServerRender = connectionStatus === 'connected';
|
|
142
|
-
const canRender = canServerRender || show_browser_rendering_1.SHOW_BROWSER_RENDERING || readOnlyStudio;
|
|
143
138
|
const renderType = (0, react_1.useMemo)(() => {
|
|
144
139
|
if (readOnlyStudio) {
|
|
145
|
-
if (!show_browser_rendering_1.SHOW_BROWSER_RENDERING) {
|
|
146
|
-
return 'render-command';
|
|
147
|
-
}
|
|
148
140
|
return preferredRenderType === 'render-command'
|
|
149
141
|
? 'render-command'
|
|
150
142
|
: 'client-render';
|
|
151
143
|
}
|
|
152
|
-
if (connectionStatus === 'disconnected'
|
|
144
|
+
if (connectionStatus === 'disconnected') {
|
|
153
145
|
return 'client-render';
|
|
154
146
|
}
|
|
155
|
-
if (!show_browser_rendering_1.SHOW_BROWSER_RENDERING) {
|
|
156
|
-
return 'server-render';
|
|
157
|
-
}
|
|
158
147
|
return preferredRenderType;
|
|
159
148
|
}, [connectionStatus, preferredRenderType, readOnlyStudio]);
|
|
160
149
|
const shortcut = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? '' : '(R)';
|
|
161
150
|
const tooltip = renderType === 'render-command'
|
|
162
151
|
? 'Copy a CLI command to render this composition ' + shortcut
|
|
163
|
-
:
|
|
164
|
-
? 'Export the current composition ' + shortcut
|
|
165
|
-
: 'Connect to the Studio server to render';
|
|
152
|
+
: 'Export the current composition ' + shortcut;
|
|
166
153
|
const iconStyle = (0, react_1.useMemo)(() => {
|
|
167
154
|
return {
|
|
168
155
|
style: {
|
|
@@ -270,7 +257,6 @@ const RenderButton = ({ readOnlyStudio, }) => {
|
|
|
270
257
|
initialTransparent: null,
|
|
271
258
|
initialMuted: null,
|
|
272
259
|
initialMediaCacheSizeInBytes: defaults.mediaCacheSizeInBytes,
|
|
273
|
-
initialAllowHtmlInCanvas: defaults.allowHtmlInCanvas,
|
|
274
260
|
initialPageResponsiveness: 'medium',
|
|
275
261
|
});
|
|
276
262
|
}, [video, setSelectedModal, getCurrentFrame, props, inFrame, outFrame]);
|
|
@@ -279,7 +265,7 @@ const RenderButton = ({ readOnlyStudio, }) => {
|
|
|
279
265
|
openServerRenderModal(true);
|
|
280
266
|
return;
|
|
281
267
|
}
|
|
282
|
-
if (
|
|
268
|
+
if (renderType === 'server-render') {
|
|
283
269
|
openServerRenderModal(false);
|
|
284
270
|
}
|
|
285
271
|
else {
|
|
@@ -399,34 +385,24 @@ const RenderButton = ({ readOnlyStudio, }) => {
|
|
|
399
385
|
return {
|
|
400
386
|
...splitButtonContainer,
|
|
401
387
|
borderColor: colors_1.BLACK_ALPHA_60,
|
|
402
|
-
opacity:
|
|
403
|
-
cursor:
|
|
388
|
+
opacity: 1,
|
|
389
|
+
cursor: 'pointer',
|
|
404
390
|
};
|
|
405
|
-
}, [
|
|
391
|
+
}, []);
|
|
406
392
|
const renderLabel = renderType === 'server-render'
|
|
407
393
|
? 'Render'
|
|
408
394
|
: renderType === 'render-command'
|
|
409
395
|
? 'Render via CLI'
|
|
410
396
|
: 'Render on web';
|
|
411
|
-
const shouldShowDropdown = (0, react_1.useMemo)(() => {
|
|
412
|
-
if (readOnlyStudio) {
|
|
413
|
-
return show_browser_rendering_1.SHOW_BROWSER_RENDERING;
|
|
414
|
-
}
|
|
415
|
-
if (!show_browser_rendering_1.SHOW_BROWSER_RENDERING) {
|
|
416
|
-
return false;
|
|
417
|
-
}
|
|
418
|
-
return true;
|
|
419
|
-
}, [readOnlyStudio]);
|
|
420
397
|
if (!video) {
|
|
421
398
|
return null;
|
|
422
399
|
}
|
|
423
400
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
424
401
|
jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-server", disabled: !canServerRender, onClick: () => openServerRenderModal(false), type: "button" }), ' ', jsx_runtime_1.jsx("button", { style: { display: 'none' }, id: "render-modal-button-client", onClick: openClientRenderModal, type: "button" }), jsx_runtime_1.jsxs("div", { ref: containerRef, style: containerStyle, title: tooltip, children: [
|
|
425
|
-
jsx_runtime_1.jsx("button", { type: "button", style: mainButtonStyle, onClick: onClick, id: "render-modal-button",
|
|
402
|
+
jsx_runtime_1.jsx("button", { type: "button", style: mainButtonStyle, onClick: onClick, id: "render-modal-button", children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", style: mainButtonContent, children: [
|
|
426
403
|
jsx_runtime_1.jsx(render_1.ThinRenderIcon, { fill: colors_1.CURRENT_COLOR_LOWERCASE, svgProps: iconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("span", { style: label, children: renderLabel })
|
|
427
|
-
] }) }),
|
|
428
|
-
|
|
429
|
-
] })) : null] }), portalStyle
|
|
404
|
+
] }) }), jsx_runtime_1.jsx("div", { style: dividerStyle }), jsx_runtime_1.jsx("button", { ref: dropdownRef, type: "button", style: dropdownTriggerStyle, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, onPointerDown: onPointerDown, onClick: onClickDropdown, children: jsx_runtime_1.jsx(caret_1.CaretDown, {}) })
|
|
405
|
+
] }), portalStyle
|
|
430
406
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHideDropdown, onEscape: onHideDropdown, children: jsx_runtime_1.jsx("div", { style: portalStyle, onPointerDown: onMenuPointerDown, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: () => { }, onPreviousMenu: () => { }, values: dropdownValues, onHide: onHideDropdown, leaveLeftSpace: false, preselectIndex: dropdownValues.findIndex((v) => v.id === renderType), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
431
407
|
: null] }));
|
|
432
408
|
};
|
|
@@ -29,7 +29,6 @@ const render_modals_1 = require("./render-modals");
|
|
|
29
29
|
const ResolveCompositionBeforeModal_1 = require("./ResolveCompositionBeforeModal");
|
|
30
30
|
const use_encodable_audio_codecs_1 = require("./use-encodable-audio-codecs");
|
|
31
31
|
const use_encodable_video_codecs_1 = require("./use-encodable-video-codecs");
|
|
32
|
-
const WebRendererExperimentalBadge_1 = require("./WebRendererExperimentalBadge");
|
|
33
32
|
const WebRenderModalAdvanced_1 = require("./WebRenderModalAdvanced");
|
|
34
33
|
const WebRenderModalAudio_1 = require("./WebRenderModalAudio");
|
|
35
34
|
const WebRenderModalBasic_1 = require("./WebRenderModalBasic");
|
|
@@ -81,7 +80,7 @@ const validateOutnameForStill = ({ outName, stillImageFormat, }) => {
|
|
|
81
80
|
// TODO: Shortcut: Shift + R
|
|
82
81
|
// TODO: Apply defaultCodec
|
|
83
82
|
// TODO: Apply defaultOutName
|
|
84
|
-
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel, initialLicenseKey, initialStillImageFormat, initialDefaultOutName, initialScale, initialDelayRenderTimeout, initialMediaCacheSizeInBytes, initialContainer, initialVideoCodec, initialAudioCodec, initialAudioBitrate, initialVideoBitrate, initialHardwareAcceleration, initialKeyframeIntervalInSeconds, initialTransparent, initialMuted,
|
|
83
|
+
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel, initialLicenseKey, initialStillImageFormat, initialDefaultOutName, initialScale, initialDelayRenderTimeout, initialMediaCacheSizeInBytes, initialContainer, initialVideoCodec, initialAudioCodec, initialAudioBitrate, initialVideoBitrate, initialHardwareAcceleration, initialKeyframeIntervalInSeconds, initialTransparent, initialMuted, initialPageResponsiveness, }) => {
|
|
85
84
|
var _a;
|
|
86
85
|
const context = (0, react_1.useContext)(ResolveCompositionBeforeModal_1.ResolvedCompositionContext);
|
|
87
86
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -125,7 +124,6 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
125
124
|
const [muted, setMuted] = (0, react_1.useState)(initialMuted !== null && initialMuted !== void 0 ? initialMuted : false);
|
|
126
125
|
const [scale, setScale] = (0, react_1.useState)(initialScale !== null && initialScale !== void 0 ? initialScale : 1);
|
|
127
126
|
const [licenseKey, setLicenseKey] = (0, react_1.useState)(initialLicenseKey);
|
|
128
|
-
const [allowHtmlInCanvas, setAllowHtmlInCanvas] = (0, react_1.useState)(initialAllowHtmlInCanvas !== null && initialAllowHtmlInCanvas !== void 0 ? initialAllowHtmlInCanvas : false);
|
|
129
127
|
const [pageResponsiveness, setPageResponsiveness] = (0, react_1.useState)(initialPageResponsiveness !== null && initialPageResponsiveness !== void 0 ? initialPageResponsiveness : 'medium');
|
|
130
128
|
const encodableAudioCodecs = (0, use_encodable_audio_codecs_1.useEncodableAudioCodecs)(container);
|
|
131
129
|
const encodableVideoCodecs = (0, use_encodable_video_codecs_1.useEncodableVideoCodecs)(container);
|
|
@@ -339,7 +337,6 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
339
337
|
logLevel,
|
|
340
338
|
licenseKey,
|
|
341
339
|
scale,
|
|
342
|
-
allowHtmlInCanvas,
|
|
343
340
|
}, compositionRef);
|
|
344
341
|
}
|
|
345
342
|
else {
|
|
@@ -366,7 +363,6 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
366
363
|
logLevel,
|
|
367
364
|
licenseKey,
|
|
368
365
|
scale,
|
|
369
|
-
allowHtmlInCanvas,
|
|
370
366
|
pageResponsiveness,
|
|
371
367
|
}, compositionRef);
|
|
372
368
|
}
|
|
@@ -408,14 +404,13 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
408
404
|
addClientStillJob,
|
|
409
405
|
addClientVideoJob,
|
|
410
406
|
scale,
|
|
411
|
-
allowHtmlInCanvas,
|
|
412
407
|
pageResponsiveness,
|
|
413
408
|
]);
|
|
414
409
|
return (jsx_runtime_1.jsxs("div", { style: render_modals_1.outerModalStyle, children: [
|
|
415
410
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Render ${resolvedComposition.id}` }), jsx_runtime_1.jsxs("div", { style: render_modals_1.container, children: [
|
|
416
411
|
jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), jsx_runtime_1.jsx("div", { style: render_modals_1.flexer }), jsx_runtime_1.jsxs(Button_1.Button, { autoFocus: true, onClick: onAddToQueue, style: render_modals_1.buttonStyle, disabled: !outnameValidation.valid, children: ["Render ", renderMode, jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })
|
|
417
412
|
] })
|
|
418
|
-
] }), jsx_runtime_1.
|
|
413
|
+
] }), jsx_runtime_1.jsxs("div", { style: render_modals_1.horizontalLayout, children: [
|
|
419
414
|
jsx_runtime_1.jsxs("div", { style: render_modals_1.leftSidebar, children: [
|
|
420
415
|
jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [
|
|
421
416
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(file_1.FileIcon, { style: render_modals_1.icon }) }),
|
|
@@ -434,7 +429,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
434
429
|
canUpdate: false,
|
|
435
430
|
reason: 'render dialogue',
|
|
436
431
|
determined: false,
|
|
437
|
-
} })) : tab === 'picture' ? (jsx_runtime_1.jsx(WebRenderModalPicture_1.WebRenderModalPicture, { renderMode: renderMode, videoBitrate: videoBitrate, setVideoBitrate: setVideoBitrate, keyframeIntervalInSeconds: keyframeIntervalInSeconds, setKeyframeIntervalInSeconds: setKeyframeIntervalInSeconds, transparent: transparent, setTransparent: setTransparent, scale: scale, setScale: setScale, compositionWidth: resolvedComposition.width, compositionHeight: resolvedComposition.height })) : tab === 'audio' ? (jsx_runtime_1.jsx(WebRenderModalAudio_1.WebRenderModalAudio, { renderMode: renderMode, muted: muted, setMuted: setMuted, audioCodec: audioCodec, setAudioCodec: setAudioCodec, audioBitrate: audioBitrate, setAudioBitrate: setAudioBitrate, container: container, encodableCodecs: encodableAudioCodecs, effectiveAudioCodec: effectiveAudioCodec })) : tab === 'advanced' ? (jsx_runtime_1.jsx(WebRenderModalAdvanced_1.WebRenderModalAdvanced, { renderMode: renderMode, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, mediaCacheSizeInBytes: mediaCacheSizeInBytes, setMediaCacheSizeInBytes: setMediaCacheSizeInBytes, hardwareAcceleration: hardwareAcceleration, setHardwareAcceleration: setHardwareAcceleration,
|
|
432
|
+
} })) : tab === 'picture' ? (jsx_runtime_1.jsx(WebRenderModalPicture_1.WebRenderModalPicture, { renderMode: renderMode, videoBitrate: videoBitrate, setVideoBitrate: setVideoBitrate, keyframeIntervalInSeconds: keyframeIntervalInSeconds, setKeyframeIntervalInSeconds: setKeyframeIntervalInSeconds, transparent: transparent, setTransparent: setTransparent, scale: scale, setScale: setScale, compositionWidth: resolvedComposition.width, compositionHeight: resolvedComposition.height })) : tab === 'audio' ? (jsx_runtime_1.jsx(WebRenderModalAudio_1.WebRenderModalAudio, { renderMode: renderMode, muted: muted, setMuted: setMuted, audioCodec: audioCodec, setAudioCodec: setAudioCodec, audioBitrate: audioBitrate, setAudioBitrate: setAudioBitrate, container: container, encodableCodecs: encodableAudioCodecs, effectiveAudioCodec: effectiveAudioCodec })) : tab === 'advanced' ? (jsx_runtime_1.jsx(WebRenderModalAdvanced_1.WebRenderModalAdvanced, { renderMode: renderMode, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, mediaCacheSizeInBytes: mediaCacheSizeInBytes, setMediaCacheSizeInBytes: setMediaCacheSizeInBytes, hardwareAcceleration: hardwareAcceleration, setHardwareAcceleration: setHardwareAcceleration, pageResponsiveness: pageResponsiveness, setPageResponsiveness: setPageResponsiveness })) : (jsx_runtime_1.jsx(WebRenderModalLicense_1.WebRenderModalLicense, { licenseKey: licenseKey, setLicenseKey: setLicenseKey, initialPublicLicenseKey: initialLicenseKey })) })
|
|
438
433
|
] })
|
|
439
434
|
] }));
|
|
440
435
|
};
|
|
@@ -9,8 +9,6 @@ type WebRenderModalAdvancedProps = {
|
|
|
9
9
|
readonly setMediaCacheSizeInBytes: React.Dispatch<React.SetStateAction<number | null>>;
|
|
10
10
|
readonly hardwareAcceleration: 'no-preference' | 'prefer-hardware' | 'prefer-software';
|
|
11
11
|
readonly setHardwareAcceleration: (value: 'no-preference' | 'prefer-hardware' | 'prefer-software') => void;
|
|
12
|
-
readonly allowHtmlInCanvas: boolean;
|
|
13
|
-
readonly setAllowHtmlInCanvas: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
12
|
readonly pageResponsiveness: WebRendererPageResponsiveness;
|
|
15
13
|
readonly setPageResponsiveness: React.Dispatch<React.SetStateAction<WebRendererPageResponsiveness>>;
|
|
16
14
|
};
|
|
@@ -30,7 +30,7 @@ const PageResponsivenessDescription = () => {
|
|
|
30
30
|
" to give the browser more chances to update."] })
|
|
31
31
|
] }));
|
|
32
32
|
};
|
|
33
|
-
const WebRenderModalAdvanced = ({ renderMode, delayRenderTimeout, setDelayRenderTimeout, mediaCacheSizeInBytes, setMediaCacheSizeInBytes, hardwareAcceleration, setHardwareAcceleration,
|
|
33
|
+
const WebRenderModalAdvanced = ({ renderMode, delayRenderTimeout, setDelayRenderTimeout, mediaCacheSizeInBytes, setMediaCacheSizeInBytes, hardwareAcceleration, setHardwareAcceleration, pageResponsiveness, setPageResponsiveness, }) => {
|
|
34
34
|
const toggleCustomMediaCacheSizeInBytes = (0, react_1.useCallback)(() => {
|
|
35
35
|
setMediaCacheSizeInBytes((previous) => {
|
|
36
36
|
if (previous === null) {
|
|
@@ -39,9 +39,6 @@ const WebRenderModalAdvanced = ({ renderMode, delayRenderTimeout, setDelayRender
|
|
|
39
39
|
return null;
|
|
40
40
|
});
|
|
41
41
|
}, [setMediaCacheSizeInBytes]);
|
|
42
|
-
const toggleAllowHtmlInCanvas = (0, react_1.useCallback)(() => {
|
|
43
|
-
setAllowHtmlInCanvas((prev) => !prev);
|
|
44
|
-
}, [setAllowHtmlInCanvas]);
|
|
45
42
|
const changeMediaCacheSizeInBytes = (0, react_1.useCallback)((cb) => {
|
|
46
43
|
setMediaCacheSizeInBytes((prev) => {
|
|
47
44
|
if (prev === null) {
|
|
@@ -163,11 +160,7 @@ const WebRenderModalAdvanced = ({ renderMode, delayRenderTimeout, setDelayRender
|
|
|
163
160
|
] }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: mediaCacheSizeInBytes !== null, onChange: toggleCustomMediaCacheSizeInBytes, name: "media-cache-size" }) })
|
|
164
161
|
] }), mediaCacheSizeInBytes === null ? null : (jsx_runtime_1.jsx(NumberSetting_1.NumberSetting, { name: "@remotion/media cache size", formatter: (w) => `${w} bytes`, min: 0, max: 10000000000, step: 10 * 1024 * 1024, value: mediaCacheSizeInBytes, onValueChanged: changeMediaCacheSizeInBytes })), renderMode === 'video' ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
165
162
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Hardware Acceleration" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: hardwareAccelerationOptions, selectedId: hardwareAcceleration, title: "Hardware Acceleration" }) })
|
|
166
|
-
] })) : null, jsx_runtime_1.jsxs(
|
|
167
|
-
jsx_runtime_1.jsxs("div", { style: layout_2.label, children: ["Allow HTML-in-canvas ",
|
|
168
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(OptionExplainerBubble_1.WebRendererOptionExplainerBubble, { apiName: "allowHtmlInCanvas", id: "allowHtmlInCanvasOption" })
|
|
169
|
-
] }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: allowHtmlInCanvas, onChange: toggleAllowHtmlInCanvas, name: "allow-html-in-canvas" }) })
|
|
170
|
-
] }), renderMode === 'still' ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
163
|
+
] })) : null, renderMode === 'still' ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
171
164
|
jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
172
165
|
jsx_runtime_1.jsxs("div", { style: layout_2.label, children: ["Page Responsiveness ",
|
|
173
166
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(OptionExplainerBubble_1.WebRendererCustomOptionExplainerBubble, { apiName: "pageResponsiveness", description: jsx_runtime_1.jsx(PageResponsivenessDescription, {}), docLink: "https://www.remotion.dev/docs/client-side-rendering/page-responsiveness", name: "Page responsiveness" })
|
|
@@ -44,7 +44,6 @@ const ClientRenderQueueProcessor = () => {
|
|
|
44
44
|
licenseKey: (_b = job.licenseKey) !== null && _b !== void 0 ? _b : undefined,
|
|
45
45
|
scale: job.scale,
|
|
46
46
|
signal,
|
|
47
|
-
allowHtmlInCanvas: job.allowHtmlInCanvas,
|
|
48
47
|
})).blob({ format: job.imageFormat });
|
|
49
48
|
return {
|
|
50
49
|
getBlob: () => Promise.resolve(blob),
|
|
@@ -97,7 +96,6 @@ const ClientRenderQueueProcessor = () => {
|
|
|
97
96
|
},
|
|
98
97
|
outputTarget: 'web-fs',
|
|
99
98
|
licenseKey: (_c = job.licenseKey) !== null && _c !== void 0 ? _c : undefined,
|
|
100
|
-
allowHtmlInCanvas: job.allowHtmlInCanvas,
|
|
101
99
|
pageResponsiveness: job.pageResponsiveness,
|
|
102
100
|
});
|
|
103
101
|
return {
|
|
@@ -37,9 +37,7 @@ exports.RenderQueue = void 0;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
40
|
-
const client_id_1 = require("../../helpers/client-id");
|
|
41
40
|
const colors_1 = require("../../helpers/colors");
|
|
42
|
-
const show_browser_rendering_1 = require("../../helpers/show-browser-rendering");
|
|
43
41
|
const layout_1 = require("../layout");
|
|
44
42
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
45
43
|
const context_1 = require("./context");
|
|
@@ -69,8 +67,6 @@ const renderQueue = {
|
|
|
69
67
|
overflowY: 'auto',
|
|
70
68
|
};
|
|
71
69
|
const RenderQueue = () => {
|
|
72
|
-
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
73
|
-
.previewServerState.type;
|
|
74
70
|
const { jobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
75
71
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
76
72
|
const previousJobCount = react_1.default.useRef(jobs.length);
|
|
@@ -103,11 +99,6 @@ const RenderQueue = () => {
|
|
|
103
99
|
}
|
|
104
100
|
return -1;
|
|
105
101
|
}, [canvasContent, jobs]);
|
|
106
|
-
if (connectionStatus === 'disconnected' && !show_browser_rendering_1.SHOW_BROWSER_RENDERING) {
|
|
107
|
-
return (jsx_runtime_1.jsxs("div", { style: explainer, children: [
|
|
108
|
-
jsx_runtime_1.jsx(layout_1.Spacing, { y: 5 }), jsx_runtime_1.jsx("div", { style: errorExplanation, children: "The studio server has disconnected." }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2, block: true })
|
|
109
|
-
] }));
|
|
110
|
-
}
|
|
111
102
|
if (jobCount === 0) {
|
|
112
103
|
return (jsx_runtime_1.jsxs("div", { style: explainer, children: [
|
|
113
104
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 5 }), jsx_runtime_1.jsx("div", { style: errorExplanation, children: "No renders in the queue." }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2, block: true })
|