@remotion/studio 4.0.478 → 4.0.481
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/AssetSelector.js +8 -14
- package/dist/components/AudioWaveform.js +19 -11
- package/dist/components/Button.d.ts +2 -0
- package/dist/components/Button.js +9 -6
- package/dist/components/CompactExplanation.d.ts +12 -0
- package/dist/components/CompactExplanation.js +52 -0
- package/dist/components/CompositionSelector.js +2 -4
- package/dist/components/CurrentAsset.d.ts +3 -1
- package/dist/components/CurrentAsset.js +42 -34
- package/dist/components/CurrentComposition.d.ts +1 -1
- package/dist/components/CurrentComposition.js +38 -31
- package/dist/components/CurrentCompositionSideEffects.d.ts +0 -3
- package/dist/components/CurrentCompositionSideEffects.js +1 -37
- package/dist/components/DefaultPropsEditor.d.ts +12 -2
- package/dist/components/DefaultPropsEditor.js +2 -2
- package/dist/components/Editor.js +2 -5
- package/dist/components/EditorContent.js +2 -1
- package/dist/components/EffectPickerModal.d.ts +5 -0
- package/dist/components/EffectPickerModal.js +179 -0
- package/dist/components/ExpandedTracksProvider.d.ts +1 -0
- package/dist/components/ExpandedTracksProvider.js +81 -7
- package/dist/components/GlobalKeybindings.d.ts +3 -1
- package/dist/components/GlobalKeybindings.js +104 -10
- package/dist/components/InspectorInfoHeader.d.ts +11 -0
- package/dist/components/InspectorInfoHeader.js +55 -0
- package/dist/components/InspectorPanel/DefaultInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/DefaultInspector.js +93 -0
- package/dist/components/InspectorPanel/EasingInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/EasingInspector.js +41 -0
- package/dist/components/InspectorPanel/GuideInspector.d.ts +7 -0
- package/dist/components/InspectorPanel/GuideInspector.js +55 -0
- package/dist/components/InspectorPanel/KeyframeInspector.d.ts +7 -0
- package/dist/components/InspectorPanel/KeyframeInspector.js +109 -0
- package/dist/components/InspectorPanel/SelectedInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/SelectedInspector.js +26 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +117 -0
- package/dist/components/InspectorPanel/common.d.ts +15 -0
- package/dist/components/InspectorPanel/common.js +18 -0
- package/dist/components/InspectorPanel/inspector-selection.d.ts +10 -0
- package/dist/components/InspectorPanel/inspector-selection.js +35 -0
- package/dist/components/InspectorPanel/styles.d.ts +28 -0
- package/dist/components/InspectorPanel/styles.js +196 -0
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +2 -0
- package/dist/components/InspectorPanel/use-track-for-selection.js +22 -0
- package/dist/components/InspectorPanel.d.ts +8 -0
- package/dist/components/InspectorPanel.js +26 -0
- package/dist/components/InspectorPanelLayout.d.ts +1 -0
- package/dist/components/InspectorPanelLayout.js +4 -0
- package/dist/components/InspectorSequenceSection.d.ts +19 -0
- package/dist/components/InspectorSequenceSection.js +157 -0
- package/dist/components/InspectorSourceLocation.d.ts +7 -0
- package/dist/components/InspectorSourceLocation.js +71 -0
- package/dist/components/KeyboardShortcutsExplainer.js +10 -2
- package/dist/components/Modals.js +3 -3
- package/dist/components/NewComposition/InputDragger.js +1 -1
- package/dist/components/NewComposition/RemInput.d.ts +1 -0
- package/dist/components/NewComposition/RemInput.js +8 -2
- package/dist/components/NewComposition/RemTextarea.d.ts +1 -0
- package/dist/components/NewComposition/RemTextarea.js +8 -2
- package/dist/components/NewComposition/ValidationMessage.d.ts +3 -0
- package/dist/components/NewComposition/ValidationMessage.js +16 -5
- package/dist/components/OptionsPanel.d.ts +1 -1
- package/dist/components/OptionsPanel.js +8 -17
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +2 -7
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +3 -10
- package/dist/components/QuickSwitcher/shared.d.ts +4 -0
- package/dist/components/QuickSwitcher/shared.js +24 -0
- package/dist/components/RenderModal/DataEditor.d.ts +29 -2
- package/dist/components/RenderModal/DataEditor.js +107 -56
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -0
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +25 -7
- package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +2 -1
- package/dist/components/RenderModal/SchemaEditor/Fieldset.js +10 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +4 -0
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +27 -4
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +12 -4
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +23 -9
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
- package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +8 -1
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -6
- package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +9 -11
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
- package/dist/components/RenderModal/WarningIndicatorButton.d.ts +1 -0
- package/dist/components/RenderModal/WarningIndicatorButton.js +17 -4
- package/dist/components/RenderModal/get-render-modal-warnings.d.ts +2 -1
- package/dist/components/RenderModal/get-render-modal-warnings.js +6 -3
- package/dist/components/RendersTab.js +1 -1
- package/dist/components/ResetZoomButton.d.ts +2 -1
- package/dist/components/ResetZoomButton.js +5 -1
- package/dist/components/SegmentedControl.d.ts +3 -0
- package/dist/components/SegmentedControl.js +11 -5
- package/dist/components/SelectedOutlineElement.js +96 -24
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +44 -30
- package/dist/components/SelectedOutlineUvControls.d.ts +9 -0
- package/dist/components/SelectedOutlineUvControls.js +64 -10
- package/dist/components/Tabs/index.js +4 -4
- package/dist/components/Timeline/EasingEditorModal.d.ts +5 -4
- package/dist/components/Timeline/EasingEditorModal.js +597 -124
- package/dist/components/Timeline/KeyframeSettingsModal.d.ts +2 -2
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -2
- package/dist/components/Timeline/Timeline.js +9 -9
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +15 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +85 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +10 -3
- package/dist/components/Timeline/TimelineEffectItem.d.ts +2 -2
- package/dist/components/Timeline/TimelineEffectItem.js +1 -1
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +25 -21
- package/dist/components/Timeline/TimelineExpandArrowButton.js +42 -2
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +6 -6
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +10 -25
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +8 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +24 -3
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -47
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +1 -1
- package/dist/components/Timeline/TimelineKeyframedValue.js +8 -10
- package/dist/components/Timeline/TimelineNumberField.js +5 -11
- package/dist/components/Timeline/TimelineRotationField.js +5 -6
- package/dist/components/Timeline/TimelineRowChrome.d.ts +2 -0
- package/dist/components/Timeline/TimelineRowChrome.js +5 -3
- package/dist/components/Timeline/TimelineScaleField.js +4 -8
- package/dist/components/Timeline/TimelineSelection.d.ts +28 -2
- package/dist/components/Timeline/TimelineSelection.js +342 -61
- package/dist/components/Timeline/TimelineSequence.js +19 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +68 -64
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +57 -53
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +6 -4
- package/dist/components/Timeline/TimelineTransformOriginField.js +4 -5
- package/dist/components/Timeline/TimelineTranslateField.js +4 -5
- package/dist/components/Timeline/TimelineUvCoordinateField.js +4 -4
- package/dist/components/Timeline/call-add-keyframe.d.ts +4 -4
- package/dist/components/Timeline/call-delete-keyframe.d.ts +4 -4
- package/dist/components/Timeline/call-move-keyframe.d.ts +2 -2
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +3 -3
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -1
- package/dist/components/Timeline/delete-selected-timeline-item.js +27 -1
- package/dist/components/Timeline/find-track-for-node-path-info.js +2 -2
- package/dist/components/Timeline/get-node-keyframes.d.ts +7 -0
- package/dist/components/Timeline/get-node-keyframes.js +26 -1
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +2 -2
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +3 -3
- package/dist/components/Timeline/reset-selected-timeline-props.js +34 -7
- package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
- package/dist/components/Timeline/save-sequence-prop.d.ts +2 -2
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -3
- package/dist/components/Timeline/timeline-expanded-filter.d.ts +12 -0
- package/dist/components/Timeline/timeline-expanded-filter.js +38 -0
- package/dist/components/Timeline/timeline-field-display-utils.d.ts +5 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +244 -0
- package/dist/components/Timeline/update-selected-easing.d.ts +47 -4
- package/dist/components/Timeline/update-selected-easing.js +40 -9
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +50 -18
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +13 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +73 -0
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -3
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +12 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +60 -0
- package/dist/components/Timeline/use-timeline-height.js +51 -7
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +12 -6
- package/dist/components/TopPanel.js +1 -1
- package/dist/components/VisualControls/VisualControlsContent.d.ts +1 -1
- package/dist/components/VisualControls/VisualControlsContent.js +4 -5
- package/dist/components/effect-drag-and-drop.d.ts +10 -0
- package/dist/components/effect-drag-and-drop.js +17 -8
- package/dist/components/effect-picker-search.d.ts +5 -0
- package/dist/components/effect-picker-search.js +77 -0
- package/dist/components/selected-outline-drag.d.ts +21 -2
- package/dist/components/selected-outline-drag.js +31 -6
- package/dist/components/selected-outline-measurement.js +48 -14
- package/dist/components/selected-outline-types.d.ts +7 -7
- package/dist/components/selected-outline-uv.d.ts +4 -3
- package/dist/components/selected-outline-uv.js +6 -2
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +8 -1
- package/dist/esm/{chunk-hrw9799x.js → chunk-4rq5gt8c.js} +30557 -26640
- package/dist/esm/internals.mjs +30557 -26640
- package/dist/esm/previewEntry.mjs +18584 -14665
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
- package/dist/helpers/render-codec-label.d.ts +2 -0
- package/dist/helpers/render-codec-label.js +49 -0
- package/dist/helpers/timeline-layout.d.ts +4 -4
- package/dist/helpers/use-media-metadata.d.ts +8 -2
- package/dist/helpers/use-media-metadata.js +17 -4
- package/dist/state/modals.d.ts +9 -4
- package/package.json +12 -12
|
@@ -36,7 +36,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.AssetSelector = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = require("react");
|
|
39
|
-
const remotion_1 = require("remotion");
|
|
40
39
|
const write_static_file_1 = require("../api/write-static-file");
|
|
41
40
|
const client_id_1 = require("../helpers/client-id");
|
|
42
41
|
const colors_1 = require("../helpers/colors");
|
|
@@ -47,7 +46,6 @@ const use_asset_drag_events_1 = __importStar(require("../helpers/use-asset-drag-
|
|
|
47
46
|
const folders_1 = require("../state/folders");
|
|
48
47
|
const z_index_1 = require("../state/z-index");
|
|
49
48
|
const AssetSelectorItem_1 = require("./AssetSelectorItem");
|
|
50
|
-
const CurrentAsset_1 = require("./CurrentAsset");
|
|
51
49
|
const styles_1 = require("./Menu/styles");
|
|
52
50
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
53
51
|
const use_static_files_1 = require("./use-static-files");
|
|
@@ -77,21 +75,17 @@ const baseList = {
|
|
|
77
75
|
};
|
|
78
76
|
const AssetSelector = ({ readOnlyStudio }) => {
|
|
79
77
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
80
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
81
78
|
const { assetFoldersExpanded, setAssetFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
|
|
82
79
|
const [dropLocation, setDropLocation] = (0, react_1.useState)(null);
|
|
83
80
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
84
81
|
.previewServerState.type;
|
|
85
82
|
const shouldAllowUpload = connectionStatus === 'connected' && !readOnlyStudio;
|
|
86
|
-
const showCurrentAsset = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset';
|
|
87
83
|
const list = (0, react_1.useMemo)(() => {
|
|
88
84
|
return {
|
|
89
85
|
...baseList,
|
|
90
|
-
height:
|
|
91
|
-
? `calc(100% - ${CurrentAsset_1.CURRENT_ASSET_HEIGHT}px)`
|
|
92
|
-
: '100%',
|
|
86
|
+
height: '100%',
|
|
93
87
|
};
|
|
94
|
-
}, [
|
|
88
|
+
}, []);
|
|
95
89
|
const staticFiles = (0, use_static_files_1.useStaticFiles)();
|
|
96
90
|
const publicFolderExists = window.remotion_publicFolderExists;
|
|
97
91
|
const assetTree = (0, react_1.useMemo)(() => {
|
|
@@ -164,11 +158,11 @@ const AssetSelector = ({ readOnlyStudio }) => {
|
|
|
164
158
|
setDropLocation(null);
|
|
165
159
|
}
|
|
166
160
|
}, [dropLocation, staticFiles]);
|
|
167
|
-
return (jsx_runtime_1.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
161
|
+
return (jsx_runtime_1.jsx("div", { style: container, onDragOver: shouldAllowUpload ? onDragOver : undefined, onDrop: shouldAllowUpload ? onDrop : undefined, children: staticFiles.length === 0 ? (publicFolderExists ? (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, place a file in the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
|
|
162
|
+
" folder of your project or drag and drop a file here."] }) })) : (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, create a folder called", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
|
|
163
|
+
" in the root of your project and place a file in it."] }) }))) : (jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: {
|
|
164
|
+
...list,
|
|
165
|
+
backgroundColor: isDropDiv ? colors_1.CLEAR_HOVER : colors_1.BACKGROUND,
|
|
166
|
+
}, onDragEnter: onDragEnter, onDragLeave: onDragLeave, children: jsx_runtime_1.jsx(AssetSelectorItem_1.AssetFolderTree, { item: assetTree, level: 0, parentFolder: null, name: null, tabIndex: tabIndex, toggleFolder: toggleFolder, dropLocation: dropLocation, setDropLocation: setDropLocation, readOnlyStudio: readOnlyStudio }) })) }));
|
|
173
167
|
};
|
|
174
168
|
exports.AssetSelector = AssetSelector;
|
|
@@ -52,6 +52,12 @@ const waveformCanvasStyle = {
|
|
|
52
52
|
const volumeCanvasStyle = {
|
|
53
53
|
position: 'absolute',
|
|
54
54
|
};
|
|
55
|
+
const parseVolume = (volume) => {
|
|
56
|
+
if (typeof volume === 'number') {
|
|
57
|
+
return volume;
|
|
58
|
+
}
|
|
59
|
+
return volume.split(',').map((v) => Number(v));
|
|
60
|
+
};
|
|
55
61
|
const drawLoopedWaveform = ({ canvas, peaks, volume, visualizationWidth, loopWidth, }) => {
|
|
56
62
|
const h = canvas.height;
|
|
57
63
|
const w = Math.ceil(visualizationWidth);
|
|
@@ -95,6 +101,7 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
95
101
|
const hasTransferredCanvas = (0, react_1.useRef)(false);
|
|
96
102
|
const latestRequestId = (0, react_1.useRef)(0);
|
|
97
103
|
const shouldRenderVolumeOverlay = doesVolumeChange && typeof volume === 'string';
|
|
104
|
+
const parsedVolume = (0, react_1.useMemo)(() => parseVolume(volume), [volume]);
|
|
98
105
|
(0, react_1.useEffect)(() => {
|
|
99
106
|
if (canUseWorkerPath) {
|
|
100
107
|
return;
|
|
@@ -198,7 +205,6 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
198
205
|
}
|
|
199
206
|
const h = height;
|
|
200
207
|
const w = Math.ceil(visualizationWidth);
|
|
201
|
-
const vol = typeof volume === 'number' ? volume : 1;
|
|
202
208
|
if (canUseWorkerPath) {
|
|
203
209
|
const worker = waveformWorker.current;
|
|
204
210
|
if (!worker || !hasTransferredCanvas.current) {
|
|
@@ -212,7 +218,7 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
212
218
|
src,
|
|
213
219
|
width: w,
|
|
214
220
|
height: h,
|
|
215
|
-
volume:
|
|
221
|
+
volume: parsedVolume,
|
|
216
222
|
startFrom,
|
|
217
223
|
durationInFrames,
|
|
218
224
|
fps: vidConf.fps,
|
|
@@ -228,7 +234,7 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
228
234
|
drawLoopedWaveform({
|
|
229
235
|
canvas: canvasElement,
|
|
230
236
|
peaks: portionPeaks !== null && portionPeaks !== void 0 ? portionPeaks : EMPTY_PEAKS,
|
|
231
|
-
volume:
|
|
237
|
+
volume: parsedVolume,
|
|
232
238
|
visualizationWidth,
|
|
233
239
|
loopWidth: (0, timeline_utils_1.getLoopDisplayWidth)({
|
|
234
240
|
visualizationWidth,
|
|
@@ -241,7 +247,7 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
241
247
|
canvas: canvasElement,
|
|
242
248
|
peaks: portionPeaks !== null && portionPeaks !== void 0 ? portionPeaks : EMPTY_PEAKS,
|
|
243
249
|
color: 'rgba(255, 255, 255, 0.6)',
|
|
244
|
-
volume:
|
|
250
|
+
volume: parsedVolume,
|
|
245
251
|
width: w,
|
|
246
252
|
});
|
|
247
253
|
}
|
|
@@ -251,12 +257,12 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
251
257
|
height,
|
|
252
258
|
loopDisplay,
|
|
253
259
|
playbackRate,
|
|
260
|
+
parsedVolume,
|
|
254
261
|
portionPeaks,
|
|
255
262
|
src,
|
|
256
263
|
startFrom,
|
|
257
264
|
vidConf.fps,
|
|
258
265
|
visualizationWidth,
|
|
259
|
-
volume,
|
|
260
266
|
waveformCanvasKey,
|
|
261
267
|
]);
|
|
262
268
|
(0, react_1.useEffect)(() => {
|
|
@@ -275,11 +281,15 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
275
281
|
volumeCanvasElement.width = Math.ceil(visualizationWidth);
|
|
276
282
|
volumeCanvasElement.height = h;
|
|
277
283
|
context.clearRect(0, 0, visualizationWidth, h);
|
|
278
|
-
|
|
284
|
+
if (!Array.isArray(parsedVolume)) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
279
287
|
context.beginPath();
|
|
280
288
|
context.moveTo(0, h);
|
|
281
|
-
|
|
282
|
-
const x =
|
|
289
|
+
parsedVolume.forEach((v, index) => {
|
|
290
|
+
const x = parsedVolume.length <= 1
|
|
291
|
+
? 0
|
|
292
|
+
: (index / (parsedVolume.length - 1)) * visualizationWidth;
|
|
283
293
|
const y = (1 - v) * (h - timeline_layout_1.TIMELINE_BORDER * 2) + 1;
|
|
284
294
|
if (index === 0) {
|
|
285
295
|
context.moveTo(x, y);
|
|
@@ -290,10 +300,8 @@ const AudioWaveform = ({ src, height, startFrom, durationInFrames, visualization
|
|
|
290
300
|
});
|
|
291
301
|
context.strokeStyle = colors_1.LIGHT_TRANSPARENT;
|
|
292
302
|
context.stroke();
|
|
293
|
-
}, [height, shouldRenderVolumeOverlay, visualizationWidth
|
|
303
|
+
}, [height, parsedVolume, shouldRenderVolumeOverlay, visualizationWidth]);
|
|
294
304
|
if (error) {
|
|
295
|
-
// eslint-disable-next-line no-console
|
|
296
|
-
console.error(error);
|
|
297
305
|
return (jsx_runtime_1.jsx("div", { style: getContainerStyle(height), children: jsx_runtime_1.jsx("div", { style: errorMessage, children: "No waveform available. The audio could not be decoded or may not support CORS." }) }));
|
|
298
306
|
}
|
|
299
307
|
if (!canUseWorkerPath && !peaks) {
|
|
@@ -3,10 +3,12 @@ export type ButtonProps = {
|
|
|
3
3
|
readonly onClick: () => void;
|
|
4
4
|
readonly disabled?: boolean;
|
|
5
5
|
readonly children: React.ReactNode;
|
|
6
|
+
readonly size?: 'default' | 'compact' | 'condensed';
|
|
6
7
|
readonly style?: React.CSSProperties;
|
|
7
8
|
readonly buttonContainerStyle?: React.CSSProperties;
|
|
8
9
|
readonly autoFocus?: boolean;
|
|
9
10
|
readonly title?: string;
|
|
10
11
|
readonly id?: string;
|
|
12
|
+
readonly onPointerDown?: React.PointerEventHandler<HTMLButtonElement>;
|
|
11
13
|
};
|
|
12
14
|
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -14,22 +14,25 @@ const button = {
|
|
|
14
14
|
color: 'white',
|
|
15
15
|
flexDirection: 'row',
|
|
16
16
|
};
|
|
17
|
-
const ButtonRefForwardFunction = ({ children, onClick, title, disabled, style, id, autoFocus, buttonContainerStyle, }, ref) => {
|
|
17
|
+
const ButtonRefForwardFunction = ({ children, onClick, title, disabled, size = 'default', style, id, autoFocus, buttonContainerStyle, onPointerDown, }, ref) => {
|
|
18
18
|
const combined = (0, react_1.useMemo)(() => {
|
|
19
19
|
return {
|
|
20
20
|
...button,
|
|
21
|
+
...(size === 'compact' ? { fontSize: 12 } : null),
|
|
22
|
+
...(size === 'condensed' ? { fontSize: 11 } : null),
|
|
21
23
|
...(style !== null && style !== void 0 ? style : {}),
|
|
22
24
|
};
|
|
23
|
-
}, [style]);
|
|
25
|
+
}, [size, style]);
|
|
24
26
|
const buttonContainer = (0, react_1.useMemo)(() => {
|
|
25
27
|
return {
|
|
26
|
-
padding: 10,
|
|
28
|
+
padding: size === 'condensed' ? '2px 7px' : size === 'compact' ? '5px 8px' : 10,
|
|
27
29
|
cursor: disabled ? 'inherit' : 'pointer',
|
|
28
|
-
fontSize: 14,
|
|
30
|
+
fontSize: size === 'condensed' ? 11 : size === 'compact' ? 12 : 14,
|
|
31
|
+
lineHeight: size === 'condensed' ? '14px' : size === 'compact' ? '14px' : undefined,
|
|
29
32
|
opacity: disabled ? 0.7 : 1,
|
|
30
33
|
...(buttonContainerStyle !== null && buttonContainerStyle !== void 0 ? buttonContainerStyle : {}),
|
|
31
34
|
};
|
|
32
|
-
}, [buttonContainerStyle, disabled]);
|
|
33
|
-
return (jsx_runtime_1.jsx("button", { ref: ref, id: id, style: combined, type: "button", disabled: disabled, onClick: onClick, autoFocus: autoFocus, title: title, children: jsx_runtime_1.jsx("div", { className: "css-reset", style: buttonContainer, children: children }) }));
|
|
35
|
+
}, [buttonContainerStyle, disabled, size]);
|
|
36
|
+
return (jsx_runtime_1.jsx("button", { ref: ref, id: id, style: combined, type: "button", disabled: disabled, onClick: onClick, onPointerDown: onPointerDown, autoFocus: autoFocus, title: title, children: jsx_runtime_1.jsx("div", { className: "css-reset", style: buttonContainer, children: children }) }));
|
|
34
37
|
};
|
|
35
38
|
exports.Button = (0, react_1.forwardRef)(ButtonRefForwardFunction);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export declare const CompactExplanation: ({ children, learnMoreAriaLabel, learnMoreHref, learnMoreTitle, }: {
|
|
3
|
+
readonly children: ReactNode;
|
|
4
|
+
readonly learnMoreAriaLabel?: string | undefined;
|
|
5
|
+
readonly learnMoreHref?: string | undefined;
|
|
6
|
+
readonly learnMoreTitle?: string | undefined;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const CompactNotSetUp: ({ learnMoreAriaLabel, learnMoreHref, learnMoreTitle, }: {
|
|
9
|
+
readonly learnMoreAriaLabel: string;
|
|
10
|
+
readonly learnMoreHref: string;
|
|
11
|
+
readonly learnMoreTitle?: string | undefined;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompactNotSetUp = exports.CompactExplanation = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const compactExplanation = {
|
|
8
|
+
color: colors_1.LIGHT_TEXT,
|
|
9
|
+
fontFamily: 'sans-serif',
|
|
10
|
+
fontSize: 12,
|
|
11
|
+
lineHeight: 1.4,
|
|
12
|
+
padding: '0 12px 8px',
|
|
13
|
+
};
|
|
14
|
+
const compactHelpLink = {
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
color: 'inherit',
|
|
17
|
+
cursor: 'default',
|
|
18
|
+
display: 'inline-flex',
|
|
19
|
+
height: 13,
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
marginLeft: 8,
|
|
22
|
+
opacity: 1,
|
|
23
|
+
textDecoration: 'none',
|
|
24
|
+
verticalAlign: 'text-bottom',
|
|
25
|
+
width: 13,
|
|
26
|
+
};
|
|
27
|
+
const compactHelpLinkHovered = {
|
|
28
|
+
...compactHelpLink,
|
|
29
|
+
color: 'white',
|
|
30
|
+
};
|
|
31
|
+
const compactHelpIcon = {
|
|
32
|
+
color: 'inherit',
|
|
33
|
+
display: 'block',
|
|
34
|
+
fill: 'currentColor',
|
|
35
|
+
height: 13,
|
|
36
|
+
width: 13,
|
|
37
|
+
};
|
|
38
|
+
const compactHelpIconPath = {
|
|
39
|
+
color: 'inherit',
|
|
40
|
+
};
|
|
41
|
+
const CompactHelpLink = ({ href, ariaLabel, title, }) => {
|
|
42
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
43
|
+
return (jsx_runtime_1.jsx("a", { href: href, target: "_blank", rel: "noopener noreferrer", style: hovered ? compactHelpLinkHovered : compactHelpLink, "aria-label": ariaLabel, title: title, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: compactHelpIcon, "aria-hidden": "true", children: jsx_runtime_1.jsx("path", { style: compactHelpIconPath, fill: "currentColor", d: "M464 256a208 208 0 1 0 -416 0 208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm256-80c-17.7 0-32 14.3-32 32l-48 0c0-44.2 35.8-80 80-80s80 35.8 80 80c0 35.1-20.5 57.5-38.2 70-6.3 4.4-12.5 7.8-17.8 10.4l0 21.9-48 0 0-56.7c1.4-.4 2.7-.7 4.1-1.1 12.2-3.2 23.3-6.1 34.1-13.7 10.4-7.3 17.8-16.9 17.8-30.8 0-17.7-14.3-32-32-32zM232 344l48 0 0 48-48 0 0-48z" }) }) }));
|
|
44
|
+
};
|
|
45
|
+
const CompactExplanation = ({ children, learnMoreAriaLabel, learnMoreHref, learnMoreTitle = 'Learn more', }) => {
|
|
46
|
+
return (jsx_runtime_1.jsxs("div", { style: compactExplanation, children: [children, learnMoreHref ? (jsx_runtime_1.jsx(CompactHelpLink, { href: learnMoreHref, ariaLabel: learnMoreAriaLabel !== null && learnMoreAriaLabel !== void 0 ? learnMoreAriaLabel : learnMoreTitle, title: learnMoreTitle })) : null] }));
|
|
47
|
+
};
|
|
48
|
+
exports.CompactExplanation = CompactExplanation;
|
|
49
|
+
const CompactNotSetUp = ({ learnMoreAriaLabel, learnMoreHref, learnMoreTitle, }) => {
|
|
50
|
+
return (jsx_runtime_1.jsx(exports.CompactExplanation, { learnMoreAriaLabel: learnMoreAriaLabel, learnMoreHref: learnMoreHref, learnMoreTitle: learnMoreTitle !== null && learnMoreTitle !== void 0 ? learnMoreTitle : 'Learn more', children: "Not set up" }));
|
|
51
|
+
};
|
|
52
|
+
exports.CompactNotSetUp = CompactNotSetUp;
|
|
@@ -13,7 +13,6 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
|
13
13
|
const modals_1 = require("../state/modals");
|
|
14
14
|
const z_index_1 = require("../state/z-index");
|
|
15
15
|
const CompositionSelectorItem_1 = require("./CompositionSelectorItem");
|
|
16
|
-
const CurrentComposition_1 = require("./CurrentComposition");
|
|
17
16
|
const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
|
|
18
17
|
const useCompositionNavigation = () => {
|
|
19
18
|
const { compositions, canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
@@ -59,7 +58,6 @@ const container = {
|
|
|
59
58
|
overflow: 'hidden',
|
|
60
59
|
backgroundColor: colors_1.BACKGROUND,
|
|
61
60
|
};
|
|
62
|
-
const QUICK_SWITCHER_TRIGGER_HEIGHT = 38;
|
|
63
61
|
const quickSwitcherArea = {
|
|
64
62
|
padding: '4px 12px',
|
|
65
63
|
borderBottom: `1px solid ${colors_1.BORDER_COLOR}`,
|
|
@@ -99,7 +97,7 @@ const CompositionSelector = () => {
|
|
|
99
97
|
}, [sortedCompositions, sortedFolders, foldersExpanded]);
|
|
100
98
|
const list = (0, react_1.useMemo)(() => {
|
|
101
99
|
return {
|
|
102
|
-
|
|
100
|
+
flex: 1,
|
|
103
101
|
overflowY: 'auto',
|
|
104
102
|
};
|
|
105
103
|
}, []);
|
|
@@ -115,7 +113,7 @@ const CompositionSelector = () => {
|
|
|
115
113
|
});
|
|
116
114
|
}, [setSelectedModal]);
|
|
117
115
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
118
|
-
jsx_runtime_1.jsx(
|
|
116
|
+
jsx_runtime_1.jsx("div", { style: quickSwitcherArea, children: jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, children: ["Search...", (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : (jsx_runtime_1.jsxs("span", { style: shortcutLabel, children: [ShortcutHint_1.cmdOrCtrlCharacter, "+K"] }))] }) }), jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: list, children: items.map((c) => {
|
|
119
117
|
return (jsx_runtime_1.jsx(CompositionSelectorItem_1.CompositionSelectorItem, { level: 0, currentComposition: canvasContent && canvasContent.type === 'composition'
|
|
120
118
|
? canvasContent.compositionId
|
|
121
119
|
: null, selectComposition: selectComposition, toggleFolder: toggleFolder, tabIndex: tabIndex, item: c }, c.key + c.type));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import type { MediaMetadata } from '../helpers/use-media-metadata';
|
|
3
|
+
export declare const CURRENT_ASSET_HEIGHT = 84;
|
|
3
4
|
export declare const getCurrentAssetMetadataSource: (assetName: string | null) => string | null;
|
|
5
|
+
export declare const getCurrentAssetMediaDetailLines: (mediaMetadata: MediaMetadata) => string[];
|
|
4
6
|
export declare const CurrentAsset: React.FC;
|
|
@@ -1,44 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CurrentAsset = exports.getCurrentAssetMetadataSource = exports.CURRENT_ASSET_HEIGHT = void 0;
|
|
3
|
+
exports.CurrentAsset = exports.getCurrentAssetMediaDetailLines = exports.getCurrentAssetMetadataSource = exports.CURRENT_ASSET_HEIGHT = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
-
const colors_1 = require("../helpers/colors");
|
|
9
8
|
const format_media_duration_1 = require("../helpers/format-media-duration");
|
|
10
9
|
const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
|
|
10
|
+
const render_codec_label_1 = require("../helpers/render-codec-label");
|
|
11
11
|
const use_media_metadata_1 = require("../helpers/use-media-metadata");
|
|
12
|
+
const InspectorInfoHeader_1 = require("./InspectorInfoHeader");
|
|
12
13
|
const use_static_files_1 = require("./use-static-files");
|
|
13
|
-
exports.CURRENT_ASSET_HEIGHT =
|
|
14
|
-
const container = {
|
|
15
|
-
height: exports.CURRENT_ASSET_HEIGHT,
|
|
16
|
-
display: 'block',
|
|
17
|
-
borderBottom: `1px solid ${colors_1.BORDER_COLOR}`,
|
|
18
|
-
padding: 12,
|
|
19
|
-
color: 'white',
|
|
20
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
21
|
-
};
|
|
22
|
-
const title = {
|
|
23
|
-
fontWeight: 'bold',
|
|
24
|
-
fontSize: 12,
|
|
25
|
-
whiteSpace: 'nowrap',
|
|
26
|
-
lineHeight: '18px',
|
|
27
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
28
|
-
};
|
|
29
|
-
const subtitle = {
|
|
30
|
-
fontSize: 12,
|
|
31
|
-
opacity: 0.8,
|
|
32
|
-
whiteSpace: 'nowrap',
|
|
33
|
-
lineHeight: '18px',
|
|
34
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
35
|
-
};
|
|
36
|
-
const row = {
|
|
37
|
-
display: 'flex',
|
|
38
|
-
flexDirection: 'row',
|
|
39
|
-
lineHeight: '18px',
|
|
40
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
41
|
-
};
|
|
14
|
+
exports.CURRENT_ASSET_HEIGHT = InspectorInfoHeader_1.INSPECTOR_INFO_HEADER_MIN_HEIGHT;
|
|
42
15
|
const getCurrentAssetMetadataSource = (assetName) => {
|
|
43
16
|
if (!assetName) {
|
|
44
17
|
return null;
|
|
@@ -49,6 +22,36 @@ const getCurrentAssetMetadataSource = (assetName) => {
|
|
|
49
22
|
: null;
|
|
50
23
|
};
|
|
51
24
|
exports.getCurrentAssetMetadataSource = getCurrentAssetMetadataSource;
|
|
25
|
+
const formatFps = (fps) => `${fps.toFixed(2)} FPS`;
|
|
26
|
+
const getCurrentAssetMediaDetailLines = (mediaMetadata) => {
|
|
27
|
+
const detailLines = [];
|
|
28
|
+
if (mediaMetadata.hasVideoTrack === true) {
|
|
29
|
+
const videoParts = [
|
|
30
|
+
(0, render_codec_label_1.renderHumanReadableVideoCodec)(mediaMetadata.videoCodec),
|
|
31
|
+
];
|
|
32
|
+
if (mediaMetadata.fps !== null) {
|
|
33
|
+
videoParts.push(formatFps(mediaMetadata.fps));
|
|
34
|
+
}
|
|
35
|
+
if (mediaMetadata.isHdr !== null) {
|
|
36
|
+
videoParts.push(`HDR: ${mediaMetadata.isHdr ? 'Yes' : 'No'}`);
|
|
37
|
+
}
|
|
38
|
+
detailLines.push(`Video: ${videoParts.join(' · ')}`);
|
|
39
|
+
}
|
|
40
|
+
if (mediaMetadata.hasAudioTrack === true) {
|
|
41
|
+
const audioParts = [
|
|
42
|
+
(0, render_codec_label_1.renderHumanReadableAudioCodec)(mediaMetadata.audioCodec),
|
|
43
|
+
];
|
|
44
|
+
if (mediaMetadata.sampleRate !== null) {
|
|
45
|
+
audioParts.push(`${mediaMetadata.sampleRate} Hz`);
|
|
46
|
+
}
|
|
47
|
+
detailLines.push(`Audio: ${audioParts.join(' · ')}`);
|
|
48
|
+
}
|
|
49
|
+
else if (mediaMetadata.hasAudioTrack === false) {
|
|
50
|
+
detailLines.push('Audio: No audio');
|
|
51
|
+
}
|
|
52
|
+
return detailLines;
|
|
53
|
+
};
|
|
54
|
+
exports.getCurrentAssetMediaDetailLines = getCurrentAssetMediaDetailLines;
|
|
52
55
|
const CurrentAsset = () => {
|
|
53
56
|
var _a;
|
|
54
57
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
@@ -65,7 +68,7 @@ const CurrentAsset = () => {
|
|
|
65
68
|
const src = (0, exports.getCurrentAssetMetadataSource)(assetName);
|
|
66
69
|
const mediaMetadata = (0, use_media_metadata_1.useMediaMetadata)(src);
|
|
67
70
|
if (!assetName) {
|
|
68
|
-
return jsx_runtime_1.jsx(
|
|
71
|
+
return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, {});
|
|
69
72
|
}
|
|
70
73
|
const fileName = (_a = assetName.split('/').pop()) !== null && _a !== void 0 ? _a : assetName;
|
|
71
74
|
const subtitleParts = [];
|
|
@@ -80,7 +83,12 @@ const CurrentAsset = () => {
|
|
|
80
83
|
subtitleParts.push(`${mediaMetadata.width}x${mediaMetadata.height}`);
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
const mediaDetailLines = mediaMetadata
|
|
87
|
+
? (0, exports.getCurrentAssetMediaDetailLines)(mediaMetadata)
|
|
88
|
+
: [];
|
|
89
|
+
return (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoHeader, { children: [
|
|
90
|
+
jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoTitle, { children: fileName }), subtitleParts.length > 0 ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: subtitleParts.join(' · ') })) : null, mediaMetadata ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: (0, format_media_duration_1.formatMediaDuration)(mediaMetadata.duration) })) : null, mediaDetailLines.map((line) => {
|
|
91
|
+
return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: line }, line);
|
|
92
|
+
})] }));
|
|
85
93
|
};
|
|
86
94
|
exports.CurrentAsset = CurrentAsset;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CURRENT_COMPOSITION_HEIGHT =
|
|
1
|
+
export declare const CURRENT_COMPOSITION_HEIGHT = 84;
|
|
2
2
|
export declare const CurrentComposition: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,41 +2,48 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CurrentComposition = exports.CURRENT_COMPOSITION_HEIGHT = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const remotion_1 = require("remotion");
|
|
6
|
-
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const is_composition_still_1 = require("../helpers/is-composition-still");
|
|
8
|
+
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
8
9
|
const render_frame_1 = require("../state/render-frame");
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
color: 'white',
|
|
15
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
16
|
-
};
|
|
17
|
-
const title = {
|
|
18
|
-
fontWeight: 'bold',
|
|
19
|
-
fontSize: 12,
|
|
20
|
-
whiteSpace: 'nowrap',
|
|
21
|
-
lineHeight: '18px',
|
|
22
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
23
|
-
};
|
|
24
|
-
const subtitle = {
|
|
25
|
-
fontSize: 12,
|
|
26
|
-
opacity: 0.8,
|
|
27
|
-
whiteSpace: 'nowrap',
|
|
28
|
-
lineHeight: '18px',
|
|
29
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
30
|
-
};
|
|
31
|
-
const row = {
|
|
32
|
-
display: 'flex',
|
|
33
|
-
flexDirection: 'row',
|
|
34
|
-
lineHeight: '18px',
|
|
35
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
36
|
-
};
|
|
10
|
+
const InspectorInfoHeader_1 = require("./InspectorInfoHeader");
|
|
11
|
+
const InspectorSourceLocation_1 = require("./InspectorSourceLocation");
|
|
12
|
+
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
13
|
+
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
14
|
+
exports.CURRENT_COMPOSITION_HEIGHT = InspectorInfoHeader_1.INSPECTOR_INFO_HEADER_MIN_HEIGHT;
|
|
37
15
|
const CurrentComposition = () => {
|
|
16
|
+
var _a;
|
|
38
17
|
const video = remotion_1.Internals.useVideo();
|
|
39
|
-
|
|
40
|
-
|
|
18
|
+
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
19
|
+
const currentComposition = (0, react_1.useMemo)(() => {
|
|
20
|
+
var _a;
|
|
21
|
+
if (!video) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return ((_a = compositions.find((composition) => composition.id === video.id)) !== null && _a !== void 0 ? _a : null);
|
|
25
|
+
}, [compositions, video]);
|
|
26
|
+
const resolvedCompositionLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _a !== void 0 ? _a : null);
|
|
27
|
+
const validatedLocation = (0, react_1.useMemo)(() => {
|
|
28
|
+
if (!(resolvedCompositionLocation === null || resolvedCompositionLocation === void 0 ? void 0 : resolvedCompositionLocation.source) ||
|
|
29
|
+
resolvedCompositionLocation.line === null) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
column: resolvedCompositionLocation.column,
|
|
34
|
+
line: resolvedCompositionLocation.line,
|
|
35
|
+
source: resolvedCompositionLocation.source,
|
|
36
|
+
};
|
|
37
|
+
}, [resolvedCompositionLocation]);
|
|
38
|
+
const openFileLocation = (0, react_1.useCallback)(() => {
|
|
39
|
+
if (!validatedLocation) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
(0, open_in_editor_1.openOriginalPositionInEditor)(validatedLocation).catch((err) => {
|
|
43
|
+
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
44
|
+
});
|
|
45
|
+
}, [validatedLocation]);
|
|
46
|
+
return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { children: video ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
47
|
+
jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoTitle, { children: video.id }), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: validatedLocation !== null, onOpen: openFileLocation }), jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: [video.width, "x", video.height, (0, is_composition_still_1.isCompositionStill)(video) ? null : `, ${video.fps} FPS`] }), (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: "Still" })) : (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: ["Duration ", (0, render_frame_1.renderFrame)(video.durationInFrames, video.fps)] }))] })) : null }));
|
|
41
48
|
};
|
|
42
49
|
exports.CurrentComposition = CurrentComposition;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TitleUpdater = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
-
const client_id_1 = require("../helpers/client-id");
|
|
7
6
|
const document_title_1 = require("../helpers/document-title");
|
|
8
|
-
const show_browser_rendering_1 = require("../helpers/show-browser-rendering");
|
|
9
|
-
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
|
-
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
11
7
|
const context_1 = require("./RenderQueue/context");
|
|
12
8
|
const TitleUpdater = () => {
|
|
13
9
|
const renderQueue = (0, react_1.useContext)(context_1.RenderQueueContext);
|
|
@@ -38,35 +34,3 @@ const TitleUpdater = () => {
|
|
|
38
34
|
return null;
|
|
39
35
|
};
|
|
40
36
|
exports.TitleUpdater = TitleUpdater;
|
|
41
|
-
const CurrentCompositionKeybindings = ({ readOnlyStudio }) => {
|
|
42
|
-
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
43
|
-
const video = remotion_1.Internals.useVideo();
|
|
44
|
-
const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState;
|
|
45
|
-
const openRenderModal = (0, react_1.useCallback)(() => {
|
|
46
|
-
if (!video) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (type !== 'connected' && !show_browser_rendering_1.SHOW_BROWSER_RENDERING && !readOnlyStudio) {
|
|
50
|
-
(0, NotificationCenter_1.showNotification)('Studio server is offline', 2000);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const renderButton = document.getElementById('render-modal-button');
|
|
54
|
-
renderButton.click();
|
|
55
|
-
}, [readOnlyStudio, type, video]);
|
|
56
|
-
(0, react_1.useEffect)(() => {
|
|
57
|
-
const binding = keybindings.registerKeybinding({
|
|
58
|
-
event: 'keydown',
|
|
59
|
-
key: 'r',
|
|
60
|
-
commandCtrlKey: false,
|
|
61
|
-
callback: openRenderModal,
|
|
62
|
-
preventDefault: true,
|
|
63
|
-
triggerIfInputFieldFocused: false,
|
|
64
|
-
keepRegisteredWhenNotHighestContext: false,
|
|
65
|
-
});
|
|
66
|
-
return () => {
|
|
67
|
-
binding.unregister();
|
|
68
|
-
};
|
|
69
|
-
}, [keybindings, openRenderModal]);
|
|
70
|
-
return null;
|
|
71
|
-
};
|
|
72
|
-
exports.CurrentCompositionKeybindings = CurrentCompositionKeybindings;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import type { PropsEditType } from './RenderModal/DataEditor';
|
|
1
|
+
import type { DataEditorLayout, DataEditorMode, PropsEditType, RenderModalWarning } from './RenderModal/DataEditor';
|
|
2
|
+
import type { SchemaErrorMode } from './RenderModal/SchemaEditor/SchemaErrorMessages';
|
|
2
3
|
import type { UpdaterFunction } from './RenderModal/SchemaEditor/ZodSwitch';
|
|
3
|
-
export declare const DefaultPropsEditor: ({ unresolvedComposition, defaultProps, setDefaultProps, propsEditType, }: {
|
|
4
|
+
export declare const DefaultPropsEditor: ({ unresolvedComposition, defaultProps, setDefaultProps, propsEditType, schemaErrorMode, layout, mode, onModeChange, hideModeControls, warnings, showWarning, setShowWarning, hideWarningButton, }: {
|
|
4
5
|
readonly unresolvedComposition: import("remotion").AnyComposition;
|
|
5
6
|
readonly defaultProps: Record<string, unknown>;
|
|
6
7
|
readonly setDefaultProps: UpdaterFunction<Record<string, unknown>>;
|
|
7
8
|
readonly propsEditType: PropsEditType;
|
|
9
|
+
readonly schemaErrorMode?: SchemaErrorMode | undefined;
|
|
10
|
+
readonly layout?: DataEditorLayout | undefined;
|
|
11
|
+
readonly mode?: DataEditorMode | undefined;
|
|
12
|
+
readonly onModeChange?: ((mode: DataEditorMode) => void) | undefined;
|
|
13
|
+
readonly hideModeControls?: boolean | undefined;
|
|
14
|
+
readonly warnings?: RenderModalWarning[] | undefined;
|
|
15
|
+
readonly showWarning?: boolean | undefined;
|
|
16
|
+
readonly setShowWarning?: import("react").Dispatch<import("react").SetStateAction<boolean>> | undefined;
|
|
17
|
+
readonly hideWarningButton?: boolean | undefined;
|
|
8
18
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,11 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const ObserveDefaultPropsContext_1 = require("./ObserveDefaultPropsContext");
|
|
7
7
|
const DataEditor_1 = require("./RenderModal/DataEditor");
|
|
8
|
-
const DefaultPropsEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, propsEditType, }) => {
|
|
8
|
+
const DefaultPropsEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, propsEditType, schemaErrorMode, layout, mode, onModeChange, hideModeControls, warnings, showWarning, setShowWarning, hideWarningButton, }) => {
|
|
9
9
|
const canSaveDefaultProps = (0, react_1.useContext)(ObserveDefaultPropsContext_1.ObserveDefaultPropsContext);
|
|
10
10
|
if (canSaveDefaultProps === null) {
|
|
11
11
|
throw new Error('ObserveDefaultPropsContext is not set');
|
|
12
12
|
}
|
|
13
|
-
return (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { unresolvedComposition: unresolvedComposition, defaultProps: defaultProps, setDefaultProps: setDefaultProps, propsEditType: propsEditType, canSaveDefaultProps: canSaveDefaultProps.canSaveDefaultProps }));
|
|
13
|
+
return (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { unresolvedComposition: unresolvedComposition, defaultProps: defaultProps, setDefaultProps: setDefaultProps, propsEditType: propsEditType, canSaveDefaultProps: canSaveDefaultProps.canSaveDefaultProps, schemaErrorMode: schemaErrorMode, layout: layout, mode: mode, onModeChange: onModeChange, hideModeControls: hideModeControls, warnings: warnings, showWarning: showWarning, setShowWarning: setShowWarning, hideWarningButton: hideWarningButton }));
|
|
14
14
|
};
|
|
15
15
|
exports.DefaultPropsEditor = DefaultPropsEditor;
|
|
@@ -47,7 +47,6 @@ const z_index_1 = require("../state/z-index");
|
|
|
47
47
|
const canvas_capture_enabled_1 = require("./canvas-capture-enabled");
|
|
48
48
|
const EditorContent_1 = require("./EditorContent");
|
|
49
49
|
const ForceSpecificCursor_1 = require("./ForceSpecificCursor");
|
|
50
|
-
const GlobalKeybindings_1 = require("./GlobalKeybindings");
|
|
51
50
|
const Modals_1 = require("./Modals");
|
|
52
51
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
53
52
|
const RenderErrorContext_1 = require("./RenderErrorContext");
|
|
@@ -104,12 +103,10 @@ const Editor = ({ Root, readOnlyStudio }) => {
|
|
|
104
103
|
const editor = (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(timeline_zoom_1.TimelineZoomContext, { children: jsx_runtime_1.jsxs(SequencePropsSubscriptionProvider_1.SequencePropsSubscriptionProvider, { children: [
|
|
105
104
|
jsx_runtime_1.jsxs(remotion_1.Internals.CurrentScaleContext.Provider, { value: value, children: [
|
|
106
105
|
jsx_runtime_1.jsx(ForceSpecificCursor_1.ForceSpecificCursor, {}), jsx_runtime_1.jsx(scale_lock_1.ScaleLockProvider, { children: jsx_runtime_1.jsxs("div", { style: background, children: [
|
|
107
|
-
jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.
|
|
108
|
-
jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds: exports.BUFFER_STATE_DELAY_IN_MILLISECONDS, onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }), jsx_runtime_1.jsx(GlobalKeybindings_1.GlobalKeybindings, {})
|
|
109
|
-
] })
|
|
106
|
+
jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsx(remotion_1.Internals.CanUseRemotionHooksProvider, { children: jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds: exports.BUFFER_STATE_DELAY_IN_MILLISECONDS, onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }) })
|
|
110
107
|
] }) })
|
|
111
108
|
] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
|
|
112
109
|
] }) }) }));
|
|
113
|
-
return canvas_capture_enabled_1.CANVAS_CAPTURE_ENABLED ? (jsx_runtime_1.jsx(StudioCanvasCapture_1.StudioCanvasCapture, { density:
|
|
110
|
+
return canvas_capture_enabled_1.CANVAS_CAPTURE_ENABLED ? (jsx_runtime_1.jsx(StudioCanvasCapture_1.StudioCanvasCapture, { density: 3, children: editor })) : (editor);
|
|
114
111
|
};
|
|
115
112
|
exports.Editor = Editor;
|