@remotion/studio 4.0.485 → 4.0.487
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/ResolveCompositionConfigInStudio.js +42 -0
- package/dist/components/AssetSelector.js +1 -1
- package/dist/components/AssetSelectorItem.js +9 -9
- package/dist/components/AudioWaveform.js +3 -3
- package/dist/components/Button.js +2 -2
- package/dist/components/Canvas.js +28 -0
- package/dist/components/CanvasOrLoading.js +1 -1
- package/dist/components/CheckboardToggle.js +1 -1
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ColorPicker/AlphaSlider.js +4 -3
- package/dist/components/ColorPicker/ColorPicker.js +4 -4
- package/dist/components/ColorPicker/ColorPickerPopup.js +10 -10
- package/dist/components/ColorPicker/HueSlider.js +4 -3
- package/dist/components/ColorPicker/SaturationValueArea.js +5 -4
- package/dist/components/ColorPicker/checker.d.ts +1 -1
- package/dist/components/ColorPicker/checker.js +3 -3
- package/dist/components/CompactExplanation.js +3 -3
- package/dist/components/CompositionSelector.js +141 -5
- package/dist/components/CompositionSelectorItem.d.ts +1 -0
- package/dist/components/CompositionSelectorItem.js +103 -11
- package/dist/components/ContextMenu.js +2 -1
- package/dist/components/CopyButton.js +3 -2
- package/dist/components/CurrentAsset.d.ts +3 -1
- package/dist/components/CurrentAsset.js +15 -2
- package/dist/components/CurrentComposition.js +43 -2
- package/dist/components/EditorContexts.js +2 -1
- package/dist/components/EffectPickerModal.js +1 -1
- package/dist/components/FilePreview.js +2 -1
- package/dist/components/FpsCounter.js +3 -2
- package/dist/components/FullscreenToggle.js +2 -1
- package/dist/components/GlobalKeybindings.js +19 -12
- package/dist/components/InlineAction.js +2 -2
- package/dist/components/InlineEditableTitle.d.ts +1 -0
- package/dist/components/InlineEditableTitle.js +12 -7
- package/dist/components/InspectorInfoHeader.js +2 -2
- package/dist/components/InspectorPanel/DefaultInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/DefaultInspector.js +2 -2
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
- package/dist/components/InspectorPanel/common.js +2 -2
- package/dist/components/InspectorPanel/styles.js +3 -3
- package/dist/components/InspectorPanel.d.ts +1 -0
- package/dist/components/InspectorPanel.js +2 -2
- package/dist/components/InspectorSequenceSection.js +1 -1
- package/dist/components/InspectorSourceLocation.d.ts +1 -0
- package/dist/components/InspectorSourceLocation.js +18 -3
- package/dist/components/InstallablePackage.js +1 -1
- package/dist/components/KeyboardShortcutsExplainer.js +9 -5
- package/dist/components/LoopToggle.js +1 -1
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuSubItem.js +1 -1
- package/dist/components/Menu/styles.js +3 -3
- package/dist/components/MenuToolbar.js +2 -2
- package/dist/components/ModalButton.js +1 -1
- package/dist/components/ModalContainer.js +3 -3
- package/dist/components/ModalFooter.js +2 -1
- package/dist/components/ModalHeader.js +3 -2
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CancelButton.js +4 -3
- package/dist/components/NewComposition/ComboBox.js +3 -3
- package/dist/components/NewComposition/InputDragger.js +11 -3
- package/dist/components/NewComposition/MenuContent.js +1 -1
- package/dist/components/NewComposition/NewComposition.js +4 -1
- package/dist/components/NewComposition/NewFolder.d.ts +5 -0
- package/dist/components/NewComposition/NewFolder.js +86 -0
- package/dist/components/NewComposition/RemInput.js +3 -3
- package/dist/components/NewComposition/RemTextarea.js +1 -1
- package/dist/components/NewComposition/RenameStaticFile.js +20 -59
- package/dist/components/NewComposition/ValidationMessage.js +1 -1
- package/dist/components/NewComposition/use-rename-static-file.d.ts +18 -0
- package/dist/components/NewComposition/use-rename-static-file.js +90 -0
- package/dist/components/NoRegisterRoot.js +3 -2
- package/dist/components/Notifications/ColorDot.js +3 -2
- package/dist/components/Notifications/Notification.js +4 -4
- package/dist/components/Notifications/NotificationCenter.js +2 -1
- package/dist/components/Notifications/ServerDisconnected.js +5 -4
- package/dist/components/OptionsPanel.js +1 -1
- package/dist/components/OutlineToggle.js +1 -1
- package/dist/components/PlayPause.js +4 -3
- package/dist/components/Preview.js +1 -1
- package/dist/components/PreviewToolbar.js +3 -2
- package/dist/components/QuickSwitcher/AlgoliaCredit.js +2 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +2 -2
- package/dist/components/RefreshCompositionOverlay.js +2 -1
- package/dist/components/RenderButton.js +10 -9
- package/dist/components/RenderModal/CliCopyButton.js +1 -1
- package/dist/components/RenderModal/ClientRenderProgress.js +1 -1
- package/dist/components/RenderModal/DataEditor.js +1 -1
- package/dist/components/RenderModal/GuiRenderStatus.js +1 -1
- package/dist/components/RenderModal/InfoBubble.js +2 -2
- package/dist/components/RenderModal/InfoTooltip.js +3 -3
- package/dist/components/RenderModal/InlineEyeIcon.js +2 -1
- package/dist/components/RenderModal/InlineRemoveButton.js +2 -1
- package/dist/components/RenderModal/MultiRangeSlider.js +1 -1
- package/dist/components/RenderModal/OptionExplainer.d.ts +11 -1
- package/dist/components/RenderModal/OptionExplainer.js +33 -13
- package/dist/components/RenderModal/OptionExplainerBubble.d.ts +15 -1
- package/dist/components/RenderModal/OptionExplainerBubble.js +17 -3
- package/dist/components/RenderModal/RenderModalHr.js +2 -1
- package/dist/components/RenderModal/RenderStatusModal.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/Fieldset.js +6 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +1 -2
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaResetButton.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaVerticalGuide.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +2 -1
- package/dist/components/RenderModal/ServerRenderModal.js +1 -1
- package/dist/components/RenderModal/WarningIndicatorButton.js +4 -6
- package/dist/components/RenderModal/WebRenderModal.js +5 -2
- package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +3 -0
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +92 -5
- package/dist/components/RenderModal/WebRenderModalAudio.js +4 -3
- package/dist/components/RenderModal/WebRenderModalBasic.js +2 -2
- package/dist/components/RenderModal/WebRenderModalLicense.js +2 -2
- package/dist/components/RenderModal/WebRenderModalPicture.js +2 -1
- package/dist/components/RenderModal/render-modals.js +3 -3
- package/dist/components/RenderPreview.js +1 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +1 -0
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/components/RenderQueue/client-side-render-types.d.ts +2 -1
- package/dist/components/RenderQueue/index.js +1 -1
- package/dist/components/RendersTab.js +2 -2
- package/dist/components/SegmentedControl.js +3 -3
- package/dist/components/SelectedOutlineElement.d.ts +9 -0
- package/dist/components/SelectedOutlineElement.js +63 -18
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -0
- package/dist/components/SelectedOutlineOverlay.js +53 -2
- package/dist/components/SelectedOutlineUvControls.js +18 -11
- package/dist/components/SidebarCollapserControls.js +5 -4
- package/dist/components/SnappingProvider.d.ts +4 -0
- package/dist/components/SnappingProvider.js +24 -0
- package/dist/components/SnappingToggle.d.ts +2 -0
- package/dist/components/SnappingToggle.js +26 -0
- package/dist/components/Splitter/SplitterContext.d.ts +1 -1
- package/dist/components/Splitter/SplitterElement.js +2 -1
- package/dist/components/StaticFilePreview.js +1 -1
- package/dist/components/Tabs/index.js +3 -3
- package/dist/components/Tabs/vertical.js +3 -3
- package/dist/components/TextViewer.js +2 -1
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/EasingEditorModal.js +8 -8
- package/dist/components/Timeline/KeyframeSettingsModal.js +1 -1
- package/dist/components/Timeline/LoopedIndicator.js +2 -2
- package/dist/components/Timeline/MaxTimelineTracks.js +3 -2
- package/dist/components/Timeline/TimelineArrayField.js +6 -5
- package/dist/components/Timeline/TimelineColorField.js +2 -1
- package/dist/components/Timeline/TimelineEffectItem.js +3 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +2 -2
- package/dist/components/Timeline/TimelineExpandArrowButton.js +3 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -1
- package/dist/components/Timeline/TimelineFieldLabel.js +2 -1
- package/dist/components/Timeline/TimelineFontFamilyField.d.ts +11 -0
- package/dist/components/Timeline/TimelineFontFamilyField.js +545 -0
- package/dist/components/Timeline/TimelineImageInfo.js +2 -1
- package/dist/components/Timeline/TimelineInOutPointer.js +2 -1
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +2 -4
- package/dist/components/Timeline/TimelineKeyframeControls.js +2 -2
- package/dist/components/Timeline/TimelineKeyframeDiamondIcon.js +1 -1
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +1 -1
- package/dist/components/Timeline/TimelineLayerEye.js +3 -3
- package/dist/components/Timeline/TimelineMediaInfo.js +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineRotationField.js +4 -3
- package/dist/components/Timeline/TimelineScaleField.js +1 -1
- package/dist/components/Timeline/TimelineSchemaField.d.ts +2 -0
- package/dist/components/Timeline/TimelineSchemaField.js +47 -7
- package/dist/components/Timeline/TimelineScrollable.js +3 -2
- package/dist/components/Timeline/TimelineSelection.js +11 -6
- package/dist/components/Timeline/TimelineSequence.js +17 -20
- package/dist/components/Timeline/TimelineSequenceFrame.js +3 -2
- package/dist/components/Timeline/TimelineSequenceItem.js +8 -7
- package/dist/components/Timeline/TimelineSequenceName.js +3 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +2 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +20 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +128 -11
- package/dist/components/Timeline/TimelineSlider.js +2 -1
- package/dist/components/Timeline/TimelineSliderHandle.js +2 -1
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +2 -1
- package/dist/components/Timeline/TimelineZoomControls.js +4 -3
- package/dist/components/Timeline/call-move-keyframe.d.ts +5 -0
- package/dist/components/Timeline/call-move-keyframe.js +14 -3
- package/dist/components/Timeline/google-fonts-list.d.ts +6 -0
- package/dist/components/Timeline/google-fonts-list.js +1512 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +8 -1
- package/dist/components/Timeline/save-sequence-prop.js +63 -19
- package/dist/components/Timeline/timeline-rotation-field-utils.d.ts +5 -0
- package/dist/components/Timeline/timeline-rotation-field-utils.js +16 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +5 -2
- package/dist/components/TimelineInOutToggle.js +1 -1
- package/dist/components/UpdateCheck.js +2 -2
- package/dist/components/UpdateModal/OpenIssueButton.js +1 -1
- package/dist/components/VisualControls/ClickableFileName.js +4 -4
- package/dist/components/VisualControls/VisualControlsContent.js +9 -1
- package/dist/components/effect-drag-and-drop.js +30 -8
- package/dist/components/import-assets.d.ts +8 -2
- package/dist/components/import-assets.js +55 -1
- package/dist/components/options-sidebar-tabs.d.ts +1 -0
- package/dist/components/options-sidebar-tabs.js +6 -1
- package/dist/components/selected-outline-measurement.js +2 -1
- package/dist/components/selected-outline-snap.d.ts +36 -0
- package/dist/components/selected-outline-snap.js +158 -0
- package/dist/error-overlay/remotion-overlay/CalculateMetadataErrorExplainer.js +2 -2
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +7 -5
- package/dist/error-overlay/remotion-overlay/CompositionIdListItem.js +2 -2
- package/dist/error-overlay/remotion-overlay/DismissButton.js +3 -2
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +3 -2
- package/dist/error-overlay/remotion-overlay/ErrorMessage.js +4 -4
- package/dist/error-overlay/remotion-overlay/HelpLink.js +1 -1
- package/dist/error-overlay/remotion-overlay/MediaPlaybackErrorExplainer.js +4 -4
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +4 -3
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +2 -1
- package/dist/error-overlay/remotion-overlay/carets.js +3 -2
- package/dist/esm/chunk-jefhcs5z.js +164 -0
- package/dist/esm/{chunk-103pp4n7.js → chunk-y2t24cx0.js} +10754 -6829
- package/dist/esm/internals.mjs +10755 -6796
- package/dist/esm/previewEntry.mjs +10554 -6591
- package/dist/esm/renderEntry.mjs +8 -5
- package/dist/helpers/checkerboard-background.js +4 -12
- package/dist/helpers/colors.d.ts +99 -7
- package/dist/helpers/colors.js +118 -10
- package/dist/helpers/inject-css.js +85 -83
- package/dist/helpers/retry-payload.js +1 -0
- package/dist/helpers/timeline-layout.d.ts +4 -2
- package/dist/helpers/use-menu-structure.js +74 -5
- package/dist/helpers/validate-folder-rename.js +2 -10
- package/dist/helpers/validate-new-folder-name.d.ts +5 -0
- package/dist/helpers/validate-new-folder-name.js +16 -0
- package/dist/hot-middleware-client/client.js +3 -2
- package/dist/icons/Checkmark.js +2 -1
- package/dist/icons/audio.js +2 -1
- package/dist/icons/caret.js +2 -2
- package/dist/icons/certificate.js +2 -1
- package/dist/icons/data.js +2 -1
- package/dist/icons/eyedropper.js +2 -1
- package/dist/icons/file.js +2 -1
- package/dist/icons/frame.js +2 -1
- package/dist/icons/gear.js +2 -1
- package/dist/icons/gif.js +2 -1
- package/dist/icons/jump-to-start.js +2 -1
- package/dist/icons/keys.js +4 -3
- package/dist/icons/magnet.d.ts +3 -0
- package/dist/icons/magnet.js +8 -0
- package/dist/icons/media-volume.js +1 -1
- package/dist/icons/minus.js +2 -1
- package/dist/icons/pause.js +2 -1
- package/dist/icons/play.js +2 -1
- package/dist/icons/react.d.ts +5 -0
- package/dist/icons/react.js +8 -0
- package/dist/icons/redo.js +2 -1
- package/dist/icons/step-back.js +2 -1
- package/dist/icons/step-forward.js +2 -1
- package/dist/icons/undo.js +2 -1
- package/dist/previewEntry.js +2 -1
- package/dist/renderEntry.js +4 -3
- package/dist/state/editor-guides.d.ts +2 -2
- package/dist/state/editor-snapping.d.ts +8 -0
- package/dist/state/editor-snapping.js +18 -0
- package/dist/state/modals.d.ts +6 -1
- package/package.json +12 -12
- package/dist/esm/chunk-6jf1natv.js +0 -25
|
@@ -84,8 +84,8 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
84
84
|
const style = (0, react_1.useMemo)(() => {
|
|
85
85
|
return {
|
|
86
86
|
...RemInput_1.inputBaseStyle,
|
|
87
|
-
backgroundColor:
|
|
88
|
-
borderColor:
|
|
87
|
+
backgroundColor: colors_1.TRANSPARENT,
|
|
88
|
+
borderColor: colors_1.TRANSPARENT,
|
|
89
89
|
padding: '4px 6px',
|
|
90
90
|
...{ outline: 'none' },
|
|
91
91
|
};
|
|
@@ -113,6 +113,14 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
113
113
|
}
|
|
114
114
|
setInputFallback(true);
|
|
115
115
|
}, []);
|
|
116
|
+
const onKeyDown = (0, react_1.useCallback)((e) => {
|
|
117
|
+
if (e.key !== 'Enter') {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
e.stopPropagation();
|
|
122
|
+
setInputFallback(true);
|
|
123
|
+
}, []);
|
|
116
124
|
const onEscape = (0, react_1.useCallback)(() => {
|
|
117
125
|
setInputFallback(false);
|
|
118
126
|
}, []);
|
|
@@ -225,6 +233,6 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
225
233
|
if (inputFallback) {
|
|
226
234
|
return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: onEscape, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: fallbackRef, autoFocus: true, onKeyPress: onKeyPress, onBlur: onBlur, onChange: onInputChange, min: _min, max: _max, step: deriveStep, defaultValue: value, status: status, pattern: '[0-9]*[.]?[0-9]*', rightAlign: rightAlign, small: small, ...props }) }));
|
|
227
235
|
}
|
|
228
|
-
return (jsx_runtime_1.jsx("button", { ref: ref, type: "button", className: '__remotion_input_dragger', style: style, onClick: onClick, onFocus: onFocus, onPointerDown: onPointerDown, children: jsx_runtime_1.jsx("span", { style: span, children: formatter(value) }) }));
|
|
236
|
+
return (jsx_runtime_1.jsx("button", { ref: ref, type: "button", className: '__remotion_input_dragger', style: style, onClick: onClick, onFocus: onFocus, onKeyDown: onKeyDown, onPointerDown: onPointerDown, children: jsx_runtime_1.jsx("span", { style: span, children: formatter(value) }) }));
|
|
229
237
|
};
|
|
230
238
|
exports.InputDragger = react_1.default.forwardRef(InputDraggerForwardRefFn);
|
|
@@ -15,7 +15,7 @@ const BORDER_SIZE = 1;
|
|
|
15
15
|
const container = {
|
|
16
16
|
paddingTop: styles_1.MENU_VERTICAL_PADDING,
|
|
17
17
|
paddingBottom: styles_1.MENU_VERTICAL_PADDING,
|
|
18
|
-
border: `${BORDER_SIZE}px solid ${colors_1.
|
|
18
|
+
border: `${BORDER_SIZE}px solid ${colors_1.BLACK_ALPHA_60}`,
|
|
19
19
|
marginLeft: 0 - BORDER_SIZE,
|
|
20
20
|
overflowY: 'auto',
|
|
21
21
|
overflowX: 'hidden',
|
|
@@ -23,6 +23,9 @@ const content = {
|
|
|
23
23
|
fontSize: 13,
|
|
24
24
|
minWidth: 500,
|
|
25
25
|
};
|
|
26
|
+
const folderPathStyle = {
|
|
27
|
+
fontSize: 14,
|
|
28
|
+
};
|
|
26
29
|
const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
27
30
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
28
31
|
const [newId, setName] = (0, react_1.useState)(() => (0, use_create_composition_1.getUniqueCompositionName)(compositions));
|
|
@@ -89,7 +92,7 @@ const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
|
89
92
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
90
93
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "New composition" }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
91
94
|
jsx_runtime_1.jsxs("div", { style: content, children: [folderPath ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
92
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Folder" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: folderPath })
|
|
95
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Folder" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx("span", { style: folderPathStyle, children: folderPath }) })
|
|
93
96
|
] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
94
97
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
95
98
|
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NewFolder = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const get_folder_id_1 = require("../../helpers/get-folder-id");
|
|
8
|
+
const validate_new_folder_name_1 = require("../../helpers/validate-new-folder-name");
|
|
9
|
+
const layout_1 = require("../layout");
|
|
10
|
+
const ModalFooter_1 = require("../ModalFooter");
|
|
11
|
+
const ModalHeader_1 = require("../ModalHeader");
|
|
12
|
+
const layout_2 = require("../RenderModal/layout");
|
|
13
|
+
const actions_1 = require("../RenderQueue/actions");
|
|
14
|
+
const CodemodFooter_1 = require("./CodemodFooter");
|
|
15
|
+
const DismissableModal_1 = require("./DismissableModal");
|
|
16
|
+
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
17
|
+
const RemInput_1 = require("./RemInput");
|
|
18
|
+
const ValidationMessage_1 = require("./ValidationMessage");
|
|
19
|
+
const content = {
|
|
20
|
+
padding: 12,
|
|
21
|
+
paddingRight: 12,
|
|
22
|
+
flex: 1,
|
|
23
|
+
fontSize: 13,
|
|
24
|
+
minWidth: 500,
|
|
25
|
+
};
|
|
26
|
+
const getUniqueFolderName = ({ folders, parentName, }) => {
|
|
27
|
+
let counter = 1;
|
|
28
|
+
while (true) {
|
|
29
|
+
const name = counter === 1 ? 'NewFolder' : `NewFolder${counter}`;
|
|
30
|
+
const err = (0, validate_new_folder_name_1.validateNewFolderName)({ folders, newName: name, parentName });
|
|
31
|
+
if (!err) {
|
|
32
|
+
return name;
|
|
33
|
+
}
|
|
34
|
+
counter++;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const NewFolder = ({ parentName, stack }) => {
|
|
38
|
+
const { folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
39
|
+
const [newName, setName] = (0, react_1.useState)(() => getUniqueFolderName({ folders, parentName }));
|
|
40
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
|
+
const input = inputRef.current;
|
|
43
|
+
if (!input)
|
|
44
|
+
return;
|
|
45
|
+
input.select();
|
|
46
|
+
}, []);
|
|
47
|
+
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
48
|
+
setName(e.target.value);
|
|
49
|
+
}, []);
|
|
50
|
+
const folderNameErrMessage = (0, validate_new_folder_name_1.validateNewFolderName)({
|
|
51
|
+
folders,
|
|
52
|
+
newName,
|
|
53
|
+
parentName,
|
|
54
|
+
});
|
|
55
|
+
const valid = folderNameErrMessage === null;
|
|
56
|
+
const codemod = (0, react_1.useMemo)(() => {
|
|
57
|
+
return {
|
|
58
|
+
type: 'new-folder',
|
|
59
|
+
folderName: newName,
|
|
60
|
+
parentName,
|
|
61
|
+
};
|
|
62
|
+
}, [newName, parentName]);
|
|
63
|
+
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
}, []);
|
|
66
|
+
const folderId = (0, get_folder_id_1.getFolderId)({ folderName: newName, parentName });
|
|
67
|
+
return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { children: [
|
|
68
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "New folder" }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
69
|
+
jsx_runtime_1.jsxs("div", { style: content, children: [parentName ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
70
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Parent" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: parentName })
|
|
71
|
+
] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
72
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
73
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
74
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: folderNameErrMessage, type: "error" })
|
|
75
|
+
] })) : null] }) })
|
|
76
|
+
] })
|
|
77
|
+
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Creating folder...', errorNotification: 'Could not create folder', successNotification: `Created folder ${folderId}`, genericSubmitLabel: 'Add to root file', submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, fallbackToRootFile: true, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
|
|
78
|
+
codemod,
|
|
79
|
+
dryRun: false,
|
|
80
|
+
signal,
|
|
81
|
+
symbolicatedStack,
|
|
82
|
+
}) }) })
|
|
83
|
+
] })
|
|
84
|
+
] }));
|
|
85
|
+
};
|
|
86
|
+
exports.NewFolder = NewFolder;
|
|
@@ -15,7 +15,7 @@ const RightAlignInput = ({ children }) => {
|
|
|
15
15
|
exports.RightAlignInput = RightAlignInput;
|
|
16
16
|
exports.inputBaseStyle = {
|
|
17
17
|
padding: `${exports.INPUT_HORIZONTAL_PADDING}px 10px`,
|
|
18
|
-
color:
|
|
18
|
+
color: colors_1.WHITE,
|
|
19
19
|
borderStyle: 'solid',
|
|
20
20
|
borderWidth: 1,
|
|
21
21
|
fontSize: 14,
|
|
@@ -32,8 +32,8 @@ const getInputBorderColor = ({ status, isFocused, isHovered, }) => status === 'w
|
|
|
32
32
|
: isFocused
|
|
33
33
|
? colors_1.SELECTED_BACKGROUND
|
|
34
34
|
: isHovered
|
|
35
|
-
? colors_1.
|
|
36
|
-
: colors_1.
|
|
35
|
+
? colors_1.WHITE_ALPHA_05
|
|
36
|
+
: colors_1.BLACK_ALPHA_60;
|
|
37
37
|
exports.getInputBorderColor = getInputBorderColor;
|
|
38
38
|
const RemInputForwardRef = ({ status, rightAlign, small = false, ...props }, ref) => {
|
|
39
39
|
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
@@ -9,7 +9,7 @@ const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
|
9
9
|
const RemInput_1 = require("../NewComposition/RemInput");
|
|
10
10
|
const inputBaseStyle = {
|
|
11
11
|
padding: `${RemInput_1.INPUT_HORIZONTAL_PADDING}px 10px`,
|
|
12
|
-
color:
|
|
12
|
+
color: colors_1.WHITE,
|
|
13
13
|
borderStyle: 'solid',
|
|
14
14
|
borderWidth: 1,
|
|
15
15
|
fontSize: 14,
|
|
@@ -3,20 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenameStaticFileModal = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
|
-
const rename_static_file_1 = require("../../api/rename-static-file");
|
|
8
|
-
const url_state_1 = require("../../helpers/url-state");
|
|
9
6
|
const modals_1 = require("../../state/modals");
|
|
10
7
|
const Button_1 = require("../Button");
|
|
11
8
|
const layout_1 = require("../layout");
|
|
12
9
|
const ModalFooter_1 = require("../ModalFooter");
|
|
13
10
|
const ModalHeader_1 = require("../ModalHeader");
|
|
14
|
-
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
15
11
|
const layout_2 = require("../RenderModal/layout");
|
|
16
12
|
const use_static_files_1 = require("../use-static-files");
|
|
17
13
|
const DismissableModal_1 = require("./DismissableModal");
|
|
18
14
|
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
19
15
|
const RemInput_1 = require("./RemInput");
|
|
16
|
+
const use_rename_static_file_1 = require("./use-rename-static-file");
|
|
20
17
|
const ValidationMessage_1 = require("./ValidationMessage");
|
|
21
18
|
const content = {
|
|
22
19
|
padding: 12,
|
|
@@ -25,54 +22,32 @@ const content = {
|
|
|
25
22
|
fontSize: 13,
|
|
26
23
|
minWidth: 500,
|
|
27
24
|
};
|
|
28
|
-
const getParent = (relativePath) => {
|
|
29
|
-
const slashIndex = relativePath.lastIndexOf('/');
|
|
30
|
-
return slashIndex === -1 ? '' : relativePath.slice(0, slashIndex);
|
|
31
|
-
};
|
|
32
|
-
const getBaseName = (relativePath) => {
|
|
33
|
-
const slashIndex = relativePath.lastIndexOf('/');
|
|
34
|
-
return slashIndex === -1 ? relativePath : relativePath.slice(slashIndex + 1);
|
|
35
|
-
};
|
|
36
25
|
const RenameStaticFileModal = ({ relativePath }) => {
|
|
37
26
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
38
|
-
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
39
|
-
const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
|
|
40
27
|
const staticFiles = (0, use_static_files_1.useStaticFiles)();
|
|
41
|
-
const [newName, setNewName] = (0, react_1.useState)(() =>
|
|
28
|
+
const [newName, setNewName] = (0, react_1.useState)(() => (0, use_rename_static_file_1.getStaticFileBaseName)(relativePath));
|
|
42
29
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
43
30
|
const inputRef = (0, react_1.useRef)(null);
|
|
31
|
+
const renameFile = (0, use_rename_static_file_1.useRenameStaticFile)({ relativePath, staticFiles });
|
|
44
32
|
(0, react_1.useEffect)(() => {
|
|
45
33
|
const input = inputRef.current;
|
|
46
34
|
if (!input)
|
|
47
35
|
return;
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
input.setSelectionRange(0, stemEnd);
|
|
36
|
+
const [start, end] = (0, use_rename_static_file_1.getStaticFileRenameSelection)(newName);
|
|
37
|
+
input.setSelectionRange(start, end);
|
|
51
38
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
52
39
|
}, []);
|
|
53
|
-
const parent = (0, react_1.useMemo)(() => getParent(relativePath), [relativePath]);
|
|
54
40
|
const newRelativePath = (0, react_1.useMemo)(() => {
|
|
55
|
-
return
|
|
56
|
-
}, [newName,
|
|
41
|
+
return (0, use_rename_static_file_1.getRenamedStaticFilePath)({ newName, relativePath });
|
|
42
|
+
}, [newName, relativePath]);
|
|
57
43
|
const changed = newRelativePath !== relativePath;
|
|
58
44
|
const validationMessage = (0, react_1.useMemo)(() => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return 'Name cannot start or end with whitespace';
|
|
65
|
-
}
|
|
66
|
-
if (newName.includes('/') || newName.includes('\\')) {
|
|
67
|
-
return 'Name cannot include slashes';
|
|
68
|
-
}
|
|
69
|
-
const existingFile = staticFiles.find((file) => {
|
|
70
|
-
return file.name === newRelativePath && file.name !== relativePath;
|
|
45
|
+
return (0, use_rename_static_file_1.validateStaticFileRename)({
|
|
46
|
+
newName,
|
|
47
|
+
newRelativePath,
|
|
48
|
+
relativePath,
|
|
49
|
+
staticFiles,
|
|
71
50
|
});
|
|
72
|
-
if (existingFile) {
|
|
73
|
-
return 'An asset with this name already exists';
|
|
74
|
-
}
|
|
75
|
-
return null;
|
|
76
51
|
}, [newName, newRelativePath, relativePath, staticFiles]);
|
|
77
52
|
const valid = changed && validationMessage === null;
|
|
78
53
|
const onNameChange = (0, react_1.useCallback)((e) => {
|
|
@@ -83,32 +58,18 @@ const RenameStaticFileModal = ({ relativePath }) => {
|
|
|
83
58
|
return;
|
|
84
59
|
}
|
|
85
60
|
setSubmitting(true);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
.then(() => {
|
|
92
|
-
setSelectedModal(null);
|
|
93
|
-
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' &&
|
|
94
|
-
canvasContent.asset === relativePath) {
|
|
95
|
-
setCanvasContent({ type: 'asset', asset: newRelativePath });
|
|
96
|
-
(0, url_state_1.pushUrl)(`/assets/${newRelativePath}`);
|
|
61
|
+
renameFile(newName)
|
|
62
|
+
.then((renamed) => {
|
|
63
|
+
if (!renamed) {
|
|
64
|
+
setSubmitting(false);
|
|
65
|
+
return;
|
|
97
66
|
}
|
|
98
|
-
|
|
67
|
+
setSelectedModal(null);
|
|
99
68
|
})
|
|
100
|
-
.catch((
|
|
69
|
+
.catch(() => {
|
|
101
70
|
setSubmitting(false);
|
|
102
|
-
notification.replaceContent(`Could not rename ${relativePath}: ${err.message}`, 3000);
|
|
103
71
|
});
|
|
104
|
-
}, [
|
|
105
|
-
canvasContent,
|
|
106
|
-
newRelativePath,
|
|
107
|
-
relativePath,
|
|
108
|
-
setCanvasContent,
|
|
109
|
-
setSelectedModal,
|
|
110
|
-
valid,
|
|
111
|
-
]);
|
|
72
|
+
}, [newName, renameFile, setSelectedModal, valid]);
|
|
112
73
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
113
74
|
e.preventDefault();
|
|
114
75
|
onRename();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type StaticFile } from 'remotion';
|
|
2
|
+
export declare const getStaticFileParent: (relativePath: string) => string;
|
|
3
|
+
export declare const getStaticFileBaseName: (relativePath: string) => string;
|
|
4
|
+
export declare const getStaticFileRenameSelection: (fileName: string) => [number, number];
|
|
5
|
+
export declare const getRenamedStaticFilePath: ({ newName, relativePath, }: {
|
|
6
|
+
readonly newName: string;
|
|
7
|
+
readonly relativePath: string;
|
|
8
|
+
}) => string;
|
|
9
|
+
export declare const validateStaticFileRename: ({ newName, newRelativePath, relativePath, staticFiles, }: {
|
|
10
|
+
readonly newName: string;
|
|
11
|
+
readonly newRelativePath: string;
|
|
12
|
+
readonly relativePath: string;
|
|
13
|
+
readonly staticFiles: StaticFile[];
|
|
14
|
+
}) => "An asset with this name already exists" | "Name cannot be empty" | "Name cannot include slashes" | "Name cannot start or end with whitespace" | null;
|
|
15
|
+
export declare const useRenameStaticFile: ({ relativePath, staticFiles, }: {
|
|
16
|
+
readonly relativePath: string;
|
|
17
|
+
readonly staticFiles: StaticFile[];
|
|
18
|
+
}) => (newName: string) => Promise<boolean>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRenameStaticFile = exports.validateStaticFileRename = exports.getRenamedStaticFilePath = exports.getStaticFileRenameSelection = exports.getStaticFileBaseName = exports.getStaticFileParent = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const rename_static_file_1 = require("../../api/rename-static-file");
|
|
7
|
+
const url_state_1 = require("../../helpers/url-state");
|
|
8
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
9
|
+
const getStaticFileParent = (relativePath) => {
|
|
10
|
+
const slashIndex = relativePath.lastIndexOf('/');
|
|
11
|
+
return slashIndex === -1 ? '' : relativePath.slice(0, slashIndex);
|
|
12
|
+
};
|
|
13
|
+
exports.getStaticFileParent = getStaticFileParent;
|
|
14
|
+
const getStaticFileBaseName = (relativePath) => {
|
|
15
|
+
const slashIndex = relativePath.lastIndexOf('/');
|
|
16
|
+
return slashIndex === -1 ? relativePath : relativePath.slice(slashIndex + 1);
|
|
17
|
+
};
|
|
18
|
+
exports.getStaticFileBaseName = getStaticFileBaseName;
|
|
19
|
+
const getStaticFileRenameSelection = (fileName) => {
|
|
20
|
+
const dotIndex = fileName.lastIndexOf('.');
|
|
21
|
+
return [0, dotIndex > 0 ? dotIndex : fileName.length];
|
|
22
|
+
};
|
|
23
|
+
exports.getStaticFileRenameSelection = getStaticFileRenameSelection;
|
|
24
|
+
const getRenamedStaticFilePath = ({ newName, relativePath, }) => {
|
|
25
|
+
const parent = (0, exports.getStaticFileParent)(relativePath);
|
|
26
|
+
return [parent, newName].filter(Boolean).join('/');
|
|
27
|
+
};
|
|
28
|
+
exports.getRenamedStaticFilePath = getRenamedStaticFilePath;
|
|
29
|
+
const validateStaticFileRename = ({ newName, newRelativePath, relativePath, staticFiles, }) => {
|
|
30
|
+
const trimmedName = newName.trim();
|
|
31
|
+
if (trimmedName.length === 0) {
|
|
32
|
+
return 'Name cannot be empty';
|
|
33
|
+
}
|
|
34
|
+
if (trimmedName !== newName) {
|
|
35
|
+
return 'Name cannot start or end with whitespace';
|
|
36
|
+
}
|
|
37
|
+
if (newName.includes('/') || newName.includes('\\')) {
|
|
38
|
+
return 'Name cannot include slashes';
|
|
39
|
+
}
|
|
40
|
+
const existingFile = staticFiles.find((file) => {
|
|
41
|
+
return file.name === newRelativePath && file.name !== relativePath;
|
|
42
|
+
});
|
|
43
|
+
if (existingFile) {
|
|
44
|
+
return 'An asset with this name already exists';
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
48
|
+
exports.validateStaticFileRename = validateStaticFileRename;
|
|
49
|
+
const useRenameStaticFile = ({ relativePath, staticFiles, }) => {
|
|
50
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
51
|
+
const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
|
|
52
|
+
return (0, react_1.useCallback)(async (newName) => {
|
|
53
|
+
const newRelativePath = (0, exports.getRenamedStaticFilePath)({
|
|
54
|
+
newName,
|
|
55
|
+
relativePath,
|
|
56
|
+
});
|
|
57
|
+
if (newRelativePath === relativePath) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
const validationMessage = (0, exports.validateStaticFileRename)({
|
|
61
|
+
newName,
|
|
62
|
+
newRelativePath,
|
|
63
|
+
relativePath,
|
|
64
|
+
staticFiles,
|
|
65
|
+
});
|
|
66
|
+
if (validationMessage) {
|
|
67
|
+
(0, NotificationCenter_1.showNotification)(validationMessage, 2000);
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
const notification = (0, NotificationCenter_1.showNotification)(`Renaming ${relativePath}...`, null);
|
|
71
|
+
try {
|
|
72
|
+
await (0, rename_static_file_1.renameStaticFile)({
|
|
73
|
+
oldRelativePath: relativePath,
|
|
74
|
+
newRelativePath,
|
|
75
|
+
});
|
|
76
|
+
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' &&
|
|
77
|
+
canvasContent.asset === relativePath) {
|
|
78
|
+
setCanvasContent({ type: 'asset', asset: newRelativePath });
|
|
79
|
+
(0, url_state_1.pushUrl)(`/assets/${newRelativePath}`);
|
|
80
|
+
}
|
|
81
|
+
notification.replaceContent(`Renamed to ${newRelativePath}`, 2000);
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
notification.replaceContent(`Could not rename ${relativePath}: ${err.message}`, 3000);
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}, [canvasContent, relativePath, setCanvasContent, staticFiles]);
|
|
89
|
+
};
|
|
90
|
+
exports.useRenameStaticFile = useRenameStaticFile;
|
|
@@ -4,9 +4,10 @@ exports.NoRegisterRoot = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const colors_1 = require("../helpers/colors");
|
|
7
8
|
const label = {
|
|
8
9
|
fontSize: 13,
|
|
9
|
-
color:
|
|
10
|
+
color: colors_1.WHITE,
|
|
10
11
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
11
12
|
};
|
|
12
13
|
const container = {
|
|
@@ -17,7 +18,7 @@ const container = {
|
|
|
17
18
|
lineHeight: 1.5,
|
|
18
19
|
};
|
|
19
20
|
const link = {
|
|
20
|
-
color:
|
|
21
|
+
color: colors_1.WHITE,
|
|
21
22
|
textDecoration: 'none',
|
|
22
23
|
borderBottom: '1px solid',
|
|
23
24
|
};
|
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ColorDot = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../../helpers/colors");
|
|
6
7
|
const container = {
|
|
7
8
|
height: 16,
|
|
8
9
|
width: 16,
|
|
9
|
-
backgroundColor:
|
|
10
|
-
border:
|
|
10
|
+
backgroundColor: colors_1.RED,
|
|
11
|
+
border: colors_1.BORDER_WHITE_ALPHA_20,
|
|
11
12
|
borderRadius: 8,
|
|
12
13
|
};
|
|
13
14
|
const ColorDot = ({ color }) => {
|
|
@@ -5,15 +5,15 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../../helpers/colors");
|
|
7
7
|
const notification = {
|
|
8
|
-
backgroundColor:
|
|
9
|
-
color: colors_1.
|
|
8
|
+
backgroundColor: colors_1.NOTIFICATION_BACKGROUND,
|
|
9
|
+
color: colors_1.WHITE_HEX,
|
|
10
10
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
11
11
|
display: 'inline-flex',
|
|
12
12
|
padding: '6px 14px',
|
|
13
13
|
borderRadius: 6,
|
|
14
14
|
fontSize: 13,
|
|
15
|
-
border:
|
|
16
|
-
boxShadow:
|
|
15
|
+
border: colors_1.NOTIFICATION_BORDER,
|
|
16
|
+
boxShadow: colors_1.NOTIFICATION_SHADOW,
|
|
17
17
|
marginTop: 3,
|
|
18
18
|
marginBottom: 3,
|
|
19
19
|
alignItems: 'center',
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NotificationCenter = exports.showNotification = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../../helpers/colors");
|
|
6
7
|
const Notification_1 = require("./Notification");
|
|
7
8
|
const container = {
|
|
8
9
|
position: 'absolute',
|
|
@@ -13,7 +14,7 @@ const container = {
|
|
|
13
14
|
flexDirection: 'column',
|
|
14
15
|
paddingTop: 40,
|
|
15
16
|
pointerEvents: 'none',
|
|
16
|
-
backgroundColor:
|
|
17
|
+
backgroundColor: colors_1.TRANSPARENT,
|
|
17
18
|
};
|
|
18
19
|
const notificationCenter = (0, react_1.createRef)();
|
|
19
20
|
const showNotification = (content, durationInMs) => {
|
|
@@ -4,6 +4,7 @@ exports.ServerDisconnected = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const client_id_1 = require("../../helpers/client-id");
|
|
7
|
+
const colors_1 = require("../../helpers/colors");
|
|
7
8
|
const container = {
|
|
8
9
|
position: 'fixed',
|
|
9
10
|
justifyContent: 'flex-end',
|
|
@@ -14,18 +15,18 @@ const container = {
|
|
|
14
15
|
flexDirection: 'column',
|
|
15
16
|
padding: 30,
|
|
16
17
|
pointerEvents: 'none',
|
|
17
|
-
backgroundColor:
|
|
18
|
+
backgroundColor: colors_1.TRANSPARENT,
|
|
18
19
|
fontFamily: 'SF Pro, Arial, Helvetica, sans-serif',
|
|
19
20
|
};
|
|
20
21
|
const message = {
|
|
21
|
-
backgroundColor:
|
|
22
|
-
color:
|
|
22
|
+
backgroundColor: colors_1.SERVER_DISCONNECTED_BACKGROUND,
|
|
23
|
+
color: colors_1.WHITE,
|
|
23
24
|
paddingLeft: 20,
|
|
24
25
|
paddingRight: 20,
|
|
25
26
|
paddingTop: 12,
|
|
26
27
|
paddingBottom: 12,
|
|
27
28
|
borderRadius: 4,
|
|
28
|
-
boxShadow:
|
|
29
|
+
boxShadow: colors_1.SERVER_DISCONNECTED_SHADOW,
|
|
29
30
|
lineHeight: 1.5,
|
|
30
31
|
};
|
|
31
32
|
const inlineCode = {
|
|
@@ -181,6 +181,6 @@ const OptionsPanel = ({ readOnlyStudio }) => {
|
|
|
181
181
|
}, []);
|
|
182
182
|
return (jsx_runtime_1.jsxs("div", { style: container, className: "css-reset", onPointerDown: onPointerDown, children: [
|
|
183
183
|
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] }), renderingAvailable ? (jsx_runtime_1.jsx(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })) : null] }) }), panel === 'inspector' ? (jsx_runtime_1.jsx(InspectorPanel_1.InspectorPanel, { composition: composition, currentDefaultProps: currentDefaultProps, setDefaultProps: setDefaultProps })) : !renderingAvailable ? null : (jsx_runtime_1.jsx(RenderQueue_1.RenderQueue, {}))] }));
|
|
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] }), renderingAvailable ? (jsx_runtime_1.jsx(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })) : null] }) }), panel === 'inspector' ? (jsx_runtime_1.jsx(InspectorPanel_1.InspectorPanel, { composition: composition, currentDefaultProps: currentDefaultProps, readOnlyStudio: readOnlyStudio, setDefaultProps: setDefaultProps })) : !renderingAvailable ? null : (jsx_runtime_1.jsx(RenderQueue_1.RenderQueue, {}))] }));
|
|
185
185
|
};
|
|
186
186
|
exports.OptionsPanel = OptionsPanel;
|
|
@@ -11,7 +11,7 @@ const OutlineToggle = () => {
|
|
|
11
11
|
const onClick = (0, react_1.useCallback)(() => {
|
|
12
12
|
setEditorShowOutlines((current) => !current);
|
|
13
13
|
}, [setEditorShowOutlines]);
|
|
14
|
-
const color = editorShowOutlines ? colors_1.BLUE :
|
|
14
|
+
const color = editorShowOutlines ? colors_1.BLUE : colors_1.WHITE;
|
|
15
15
|
const accessibilityLabel = editorShowOutlines
|
|
16
16
|
? 'Hide outlines'
|
|
17
17
|
: 'Show outlines';
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const player_1 = require("@remotion/player");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
+
const colors_1 = require("../helpers/colors");
|
|
8
9
|
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
9
10
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
10
11
|
const jump_to_start_1 = require("../icons/jump-to-start");
|
|
@@ -18,16 +19,16 @@ const imperative_state_1 = require("./Timeline/imperative-state");
|
|
|
18
19
|
const timeline_scroll_logic_1 = require("./Timeline/timeline-scroll-logic");
|
|
19
20
|
const backStyle = {
|
|
20
21
|
height: 18,
|
|
21
|
-
color:
|
|
22
|
+
color: colors_1.WHITE,
|
|
22
23
|
};
|
|
23
24
|
const forwardBackStyle = {
|
|
24
25
|
height: 16,
|
|
25
|
-
color:
|
|
26
|
+
color: colors_1.WHITE,
|
|
26
27
|
};
|
|
27
28
|
const iconButton = {
|
|
28
29
|
height: 14,
|
|
29
30
|
width: 14,
|
|
30
|
-
color:
|
|
31
|
+
color: colors_1.WHITE,
|
|
31
32
|
};
|
|
32
33
|
const PlayPause = ({ playbackRate, loop, bufferStateDelayInMilliseconds, muted }) => {
|
|
33
34
|
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
@@ -122,7 +122,7 @@ const CompWhenItHasDimensions = ({ contentDimensions, canvasSize, canvasContent,
|
|
|
122
122
|
return (jsx_runtime_1.jsx("div", { style: outer, children: jsx_runtime_1.jsx(RenderPreview_1.RenderPreview, { path: canvasContent.displayName, assetMetadata: assetMetadata, getBlob: canvasContent.getBlob }) }));
|
|
123
123
|
}
|
|
124
124
|
return (jsx_runtime_1.jsxs("div", { style: outer, children: [
|
|
125
|
-
jsx_runtime_1.jsx(PortalContainer, { contentDimensions: contentDimensions, scale: scale, xCorrection: xCorrection, yCorrection: yCorrection }), jsx_runtime_1.jsx(SelectedOutlineOverlay_1.SelectedOutlineOverlay, { scale: scale, translationX: previewSize.translation.x, translationY: previewSize.translation.y })
|
|
125
|
+
jsx_runtime_1.jsx(PortalContainer, { contentDimensions: contentDimensions, scale: scale, xCorrection: xCorrection, yCorrection: yCorrection }), jsx_runtime_1.jsx(SelectedOutlineOverlay_1.SelectedOutlineOverlay, { compositionHeight: contentDimensions.height, compositionWidth: contentDimensions.width, scale: scale, translationX: previewSize.translation.x, translationY: previewSize.translation.y })
|
|
126
126
|
] }));
|
|
127
127
|
};
|
|
128
128
|
const PortalContainer = ({ scale, xCorrection, yCorrection, contentDimensions }) => {
|
|
@@ -23,13 +23,14 @@ const PlaybackRateSelector_1 = require("./PlaybackRateSelector");
|
|
|
23
23
|
const PlayPause_1 = require("./PlayPause");
|
|
24
24
|
const RenderButton_1 = require("./RenderButton");
|
|
25
25
|
const SizeSelector_1 = require("./SizeSelector");
|
|
26
|
+
const SnappingToggle_1 = require("./SnappingToggle");
|
|
26
27
|
const TimelineZoomControls_1 = require("./Timeline/TimelineZoomControls");
|
|
27
28
|
const TimelineInOutToggle_1 = require("./TimelineInOutToggle");
|
|
28
29
|
const TOOLBAR_HEIGHT = 50;
|
|
29
30
|
const container = {
|
|
30
31
|
display: 'flex',
|
|
31
32
|
justifyContent: 'center',
|
|
32
|
-
borderTop:
|
|
33
|
+
borderTop: colors_1.BORDER_BLACK_ALPHA_50,
|
|
33
34
|
alignItems: 'center',
|
|
34
35
|
flexDirection: 'row',
|
|
35
36
|
background: colors_1.BACKGROUND,
|
|
@@ -165,7 +166,7 @@ const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
|
|
|
165
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: [
|
|
166
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 })
|
|
167
168
|
] })) : null, (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
168
|
-
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, {}) })
|
|
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
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: [
|
|
170
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: [
|
|
171
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 })
|