@remotion/studio 4.0.508 → 4.0.510
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/Studio.d.ts +5 -0
- package/dist/Studio.js +2 -2
- package/dist/components/Canvas.js +41 -8
- package/dist/components/ColorPicker/AlphaSlider.js +2 -2
- package/dist/components/ColorPicker/HueSlider.js +2 -2
- package/dist/components/ColorPicker/SaturationValueArea.js +2 -2
- package/dist/components/CompositionSelectorItem.js +1 -1
- package/dist/components/EditorGuides/Guide.js +2 -2
- package/dist/components/EditorRuler/index.js +2 -2
- package/dist/components/ExplorerPanel.js +19 -1
- package/dist/components/InspectorOpenInEditor.js +19 -5
- package/dist/components/InspectorPanel/CompositionMetadata.js +23 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +3 -3
- package/dist/components/Menu/MenuItem.js +2 -2
- package/dist/components/ModalContainer.js +1 -1
- package/dist/components/Modals.js +2 -9
- package/dist/components/NewComposition/InputDragger.js +2 -2
- package/dist/components/NewComposition/NewComposition.d.ts +2 -0
- package/dist/components/NewComposition/NewComposition.js +38 -6
- package/dist/components/NewComposition/get-new-composition-defaults.d.ts +1 -1
- package/dist/components/NewComposition/get-new-composition-defaults.js +9 -1
- package/dist/components/QuickSwitcher/asset-search.js +1 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +6 -4
- package/dist/components/SelectedOutlineCropControls.js +3 -3
- package/dist/components/SelectedOutlineElement.js +6 -2
- package/dist/components/SelectedOutlinePolygon.js +4 -3
- package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +5 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.js +4 -4
- package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +1 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.js +4 -4
- package/dist/components/SelectedOutlineTransformOriginHandle.js +2 -2
- package/dist/components/SelectedOutlineUvControls.js +8 -8
- package/dist/components/Splitter/SplitterHandle.js +2 -2
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Timeline/EasingEditorModal.d.ts +8 -0
- package/dist/components/Timeline/EasingEditorModal.js +10 -11
- package/dist/components/Timeline/SubscribeToNodePaths.js +1 -1
- package/dist/components/Timeline/Timeline.js +55 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +99 -35
- package/dist/components/Timeline/TimelineColorField.js +1 -6
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineEffectItem.js +1 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -1
- package/dist/components/Timeline/TimelineEnumField.js +1 -4
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
- package/dist/components/Timeline/TimelineFieldRowContent.d.ts +2 -1
- package/dist/components/Timeline/TimelineFieldRowContent.js +18 -3
- package/dist/components/Timeline/TimelineFontFamilyField.js +1 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +3 -2
- package/dist/components/Timeline/TimelineLayerEye.js +2 -2
- package/dist/components/Timeline/TimelineNumberField.js +4 -2
- package/dist/components/Timeline/TimelineRotationField.js +3 -3
- package/dist/components/Timeline/TimelineRowChrome.d.ts +5 -0
- package/dist/components/Timeline/TimelineRowChrome.js +14 -9
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +1 -0
- package/dist/components/Timeline/TimelineRowLayoutContext.js +4 -1
- package/dist/components/Timeline/TimelineScaleField.js +4 -0
- package/dist/components/Timeline/TimelineSelection.js +2 -2
- package/dist/components/Timeline/TimelineSequenceItem.js +2 -25
- package/dist/components/Timeline/TimelineSequencePropItem.js +8 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +69 -20
- package/dist/components/Timeline/TimelineTextContentField.js +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -0
- package/dist/components/Timeline/keyframe-clipboard.d.ts +5 -1
- package/dist/components/Timeline/keyframe-clipboard.js +3 -2
- package/dist/components/Timeline/save-sequence-prop.js +16 -7
- package/dist/components/Timeline/sequence-prop-clipboard.d.ts +31 -0
- package/dist/components/Timeline/sequence-prop-clipboard.js +142 -0
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +0 -1
- package/dist/components/Timeline/split-selected-timeline-item.js +5 -13
- package/dist/components/Timeline/timeline-field-row-layout.js +2 -2
- package/dist/components/Timeline/timeline-field-utils.d.ts +1 -0
- package/dist/components/Timeline/timeline-field-utils.js +6 -1
- package/dist/components/Timeline/update-selected-easing.js +8 -0
- package/dist/components/Timeline/use-open-sequence-in-apps.js +3 -1
- package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +1 -1
- package/dist/components/Timeline/use-resolved-stack-react-to-change.js +24 -3
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +4 -4
- package/dist/components/UndoRedoButtons.js +5 -3
- package/dist/components/folder-menu-items.js +1 -0
- package/dist/components/get-open-in-menu-items.d.ts +4 -1
- package/dist/components/get-open-in-menu-items.js +99 -50
- package/dist/components/import-assets.js +7 -0
- package/dist/components/root-composition-menu-items.js +1 -0
- package/dist/components/selected-outline-control-layout.d.ts +14 -0
- package/dist/components/selected-outline-control-layout.js +94 -0
- package/dist/components/use-default-editor-info.js +28 -3
- package/dist/esm/{chunk-zpn4m49r.js → chunk-axbagh08.js} +6098 -5285
- package/dist/esm/{chunk-fgedsvhb.js → chunk-r46yxrjr.js} +1 -2
- package/dist/esm/internals.mjs +6097 -5284
- package/dist/esm/previewEntry.mjs +5989 -5176
- package/dist/esm/renderEntry.mjs +4 -2
- package/dist/helpers/get-canvas-capture-import.d.ts +7 -0
- package/dist/helpers/get-canvas-capture-import.js +43 -0
- package/dist/helpers/get-git-menu-item.d.ts +1 -1
- package/dist/helpers/get-git-menu-item.js +33 -3
- package/dist/helpers/inserted-element-selection.d.ts +12 -0
- package/dist/helpers/inserted-element-selection.js +29 -0
- package/dist/helpers/open-in-editor.d.ts +1 -0
- package/dist/helpers/open-in-editor.js +5 -1
- package/dist/helpers/pointer-session.d.ts +6 -2
- package/dist/helpers/pointer-session.js +29 -12
- package/dist/helpers/use-create-composition.d.ts +15 -2
- package/dist/helpers/use-create-composition.js +11 -17
- package/dist/helpers/use-menu-structure.js +1 -0
- package/dist/icons/git-client.d.ts +6 -0
- package/dist/icons/git-client.js +8 -0
- package/dist/icons/github.d.ts +4 -0
- package/dist/icons/github.js +11 -0
- package/dist/renderEntry.js +2 -2
- package/dist/state/modals.d.ts +9 -1
- package/dist/state/z-index.d.ts +0 -1
- package/dist/state/z-index.js +27 -33
- package/package.json +12 -12
package/dist/Studio.d.ts
CHANGED
package/dist/Studio.js
CHANGED
|
@@ -16,8 +16,8 @@ const getServerDisconnectedDomElement = () => {
|
|
|
16
16
|
return document.getElementById('server-disconnected-overlay');
|
|
17
17
|
};
|
|
18
18
|
const StudioInner = ({ rootComponent, readOnly }) => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
return (jsx_runtime_1.jsx(remotion_1.Internals.CompositionManagerProvider, { onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], initialCanvasContent: null, children: jsx_runtime_1.jsx(remotion_1.Internals.RemotionRootContexts, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: (_a = window.remotion_logLevel) !== null && _a !== void 0 ? _a : 'info', numberOfAudioTags: window.remotion_numberOfAudioTags, audioLatencyHint: (_b = window.remotion_audioLatencyHint) !== null && _b !== void 0 ? _b : 'playback', previewSampleRate: window.remotion_previewSampleRate, children: jsx_runtime_1.jsx(use_static_files_1.StaticFilesProvider, { children: jsx_runtime_1.jsx(ResolveCompositionConfigInStudio_1.ResolveCompositionConfigInStudio, { children: jsx_runtime_1.jsxs(EditorContexts_1.EditorContexts, { children: [
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
return (jsx_runtime_1.jsx(remotion_1.Internals.CompositionManagerProvider, { onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], initialCanvasContent: null, children: jsx_runtime_1.jsx(remotion_1.Internals.RemotionRootContexts, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: (_a = window.remotion_logLevel) !== null && _a !== void 0 ? _a : 'info', numberOfAudioTags: window.remotion_numberOfAudioTags, audioLatencyHint: (_b = window.remotion_audioLatencyHint) !== null && _b !== void 0 ? _b : 'playback', previewSampleRate: window.remotion_previewSampleRate, _experimentalKeepAudioContextAlive: (_c = window.remotion_experimentalKeepAudioContextAlive) !== null && _c !== void 0 ? _c : false, children: jsx_runtime_1.jsx(use_static_files_1.StaticFilesProvider, { children: jsx_runtime_1.jsx(ResolveCompositionConfigInStudio_1.ResolveCompositionConfigInStudio, { children: jsx_runtime_1.jsxs(EditorContexts_1.EditorContexts, { children: [
|
|
21
21
|
jsx_runtime_1.jsx(Editor_1.Editor, { readOnlyStudio: readOnly, Root: rootComponent }), readOnly
|
|
22
22
|
? null
|
|
23
23
|
: (0, react_dom_1.createPortal)(jsx_runtime_1.jsx(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement())] }) }) }) }) }));
|
|
@@ -15,6 +15,7 @@ const clipboard_images_1 = require("../helpers/clipboard-images");
|
|
|
15
15
|
const clipboard_svg_1 = require("../helpers/clipboard-svg");
|
|
16
16
|
const colors_1 = require("../helpers/colors");
|
|
17
17
|
const get_asset_metadata_1 = require("../helpers/get-asset-metadata");
|
|
18
|
+
const get_canvas_capture_import_1 = require("../helpers/get-canvas-capture-import");
|
|
18
19
|
const get_effective_translation_1 = require("../helpers/get-effective-translation");
|
|
19
20
|
const install_required_package_1 = require("../helpers/install-required-package");
|
|
20
21
|
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
@@ -25,6 +26,7 @@ const canvas_ref_1 = require("../state/canvas-ref");
|
|
|
25
26
|
const editor_guides_1 = require("../state/editor-guides");
|
|
26
27
|
const editor_snapping_1 = require("../state/editor-snapping");
|
|
27
28
|
const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
|
|
29
|
+
const modals_1 = require("../state/modals");
|
|
28
30
|
const call_api_1 = require("./call-api");
|
|
29
31
|
const composition_drop_preview_1 = require("./composition-drop-preview");
|
|
30
32
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
@@ -125,6 +127,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
125
127
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
126
128
|
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
127
129
|
const chooseSvgImportMode = (0, SvgImportDialog_1.useSvgImportDialog)();
|
|
130
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
128
131
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
129
132
|
const areRulersVisible = (0, use_is_ruler_visible_1.useIsRulerVisible)();
|
|
130
133
|
const { editorShowGuides } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
|
|
@@ -703,13 +706,15 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
703
706
|
setCompositionDropPreview(null);
|
|
704
707
|
return;
|
|
705
708
|
}
|
|
706
|
-
|
|
709
|
+
const mayBeCanvasCapture = (0, drop_handler_data_1.isFileDragEvent)(event) && !window.remotion_isReadOnlyStudio;
|
|
710
|
+
if (!canDropAssets && !cannotAddSequence && !mayBeCanvasCapture) {
|
|
707
711
|
setCompositionDropPreview(null);
|
|
708
712
|
return;
|
|
709
713
|
}
|
|
710
714
|
event.preventDefault();
|
|
711
715
|
if (event.dataTransfer) {
|
|
712
|
-
event.dataTransfer.dropEffect =
|
|
716
|
+
event.dataTransfer.dropEffect =
|
|
717
|
+
canDropAssets || mayBeCanvasCapture ? 'copy' : 'none';
|
|
713
718
|
}
|
|
714
719
|
if (!canDropAssets ||
|
|
715
720
|
contentDimensions === null ||
|
|
@@ -718,7 +723,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
718
723
|
return;
|
|
719
724
|
}
|
|
720
725
|
const metadata = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : []);
|
|
721
|
-
if ((metadata === null || metadata === void 0 ? void 0 : metadata.type) !== 'composition' ||
|
|
726
|
+
if (((metadata === null || metadata === void 0 ? void 0 : metadata.type) !== 'composition' && (metadata === null || metadata === void 0 ? void 0 : metadata.type) !== 'element') ||
|
|
722
727
|
metadata.width === undefined ||
|
|
723
728
|
metadata.height === undefined) {
|
|
724
729
|
setCompositionDropPreview(null);
|
|
@@ -729,7 +734,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
729
734
|
clientX: event.clientX,
|
|
730
735
|
clientY: event.clientY,
|
|
731
736
|
contentDimensions,
|
|
732
|
-
unbounded:
|
|
737
|
+
unbounded: metadata.type === 'composition',
|
|
733
738
|
previewSize,
|
|
734
739
|
size,
|
|
735
740
|
});
|
|
@@ -741,7 +746,10 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
741
746
|
width: metadata.width,
|
|
742
747
|
height: metadata.height,
|
|
743
748
|
};
|
|
744
|
-
if (
|
|
749
|
+
if (metadata.type === 'composition' &&
|
|
750
|
+
editorSnapping &&
|
|
751
|
+
!event.metaKey &&
|
|
752
|
+
!event.ctrlKey) {
|
|
745
753
|
dropPosition = (0, composition_drop_preview_1.snapCompositionDropPosition)({
|
|
746
754
|
compositionDimensions,
|
|
747
755
|
destinationDimensions: contentDimensions,
|
|
@@ -797,12 +805,36 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
797
805
|
setCompositionDropPreview(null);
|
|
798
806
|
}, []);
|
|
799
807
|
const onDrop = (0, react_1.useCallback)(async (event) => {
|
|
800
|
-
var _a;
|
|
801
|
-
var
|
|
808
|
+
var _a, _b;
|
|
809
|
+
var _c, _d;
|
|
802
810
|
setCompositionDropPreview(null);
|
|
803
811
|
if (!(0, drop_handler_data_1.isSupportedDropEvent)(event) || !isDragEventInsideCanvas(event)) {
|
|
804
812
|
return;
|
|
805
813
|
}
|
|
814
|
+
if ((0, drop_handler_data_1.isFileDragEvent)(event) && !window.remotion_isReadOnlyStudio) {
|
|
815
|
+
event.preventDefault();
|
|
816
|
+
event.stopPropagation();
|
|
817
|
+
const files = Array.from((_c = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _c !== void 0 ? _c : []);
|
|
818
|
+
if (files.length === 1) {
|
|
819
|
+
setIsAddingAsset(true);
|
|
820
|
+
try {
|
|
821
|
+
const canvasCapture = await (0, get_canvas_capture_import_1.getCanvasCaptureImport)(files[0]);
|
|
822
|
+
if (canvasCapture !== null) {
|
|
823
|
+
setSelectedModal({
|
|
824
|
+
type: 'new-comp',
|
|
825
|
+
canvasCapture,
|
|
826
|
+
folderName: null,
|
|
827
|
+
parentName: null,
|
|
828
|
+
stack: null,
|
|
829
|
+
});
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
finally {
|
|
834
|
+
setIsAddingAsset(false);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
806
838
|
if (cannotAddSequence) {
|
|
807
839
|
event.preventDefault();
|
|
808
840
|
event.stopPropagation();
|
|
@@ -824,7 +856,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
824
856
|
event.stopPropagation();
|
|
825
857
|
setIsAddingAsset(true);
|
|
826
858
|
try {
|
|
827
|
-
const metadata = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata((
|
|
859
|
+
const metadata = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata((_d = (_b = event.dataTransfer) === null || _b === void 0 ? void 0 : _b.types) !== null && _d !== void 0 ? _d : []);
|
|
828
860
|
const isComposition = (metadata === null || metadata === void 0 ? void 0 : metadata.type) === 'composition';
|
|
829
861
|
let dropPosition = getDropPosition({
|
|
830
862
|
addFitPadding,
|
|
@@ -887,6 +919,7 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
887
919
|
editorSnapping,
|
|
888
920
|
previewSize,
|
|
889
921
|
size,
|
|
922
|
+
setSelectedModal,
|
|
890
923
|
]);
|
|
891
924
|
const onPaste = (0, react_1.useCallback)(async (event) => {
|
|
892
925
|
const { activeElement } = document;
|
|
@@ -59,9 +59,9 @@ const AlphaSlider = ({ hue, saturation, value, alpha, onChange, onChangeComplete
|
|
|
59
59
|
e.preventDefault();
|
|
60
60
|
updateFromEvent(e.clientX, false);
|
|
61
61
|
let lastClientX = e.clientX;
|
|
62
|
-
(0, pointer_session_1.
|
|
62
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
63
63
|
event: e.nativeEvent,
|
|
64
|
-
|
|
64
|
+
captureTarget: e.currentTarget,
|
|
65
65
|
onMove: (ev) => {
|
|
66
66
|
lastClientX = ev.clientX;
|
|
67
67
|
updateFromEvent(ev.clientX, false);
|
|
@@ -41,9 +41,9 @@ const HueSlider = ({ hue, onChange, onChangeComplete }) => {
|
|
|
41
41
|
e.preventDefault();
|
|
42
42
|
updateFromEvent(e.clientX, false);
|
|
43
43
|
let lastClientX = e.clientX;
|
|
44
|
-
(0, pointer_session_1.
|
|
44
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
45
45
|
event: e.nativeEvent,
|
|
46
|
-
|
|
46
|
+
captureTarget: e.currentTarget,
|
|
47
47
|
onMove: (ev) => {
|
|
48
48
|
lastClientX = ev.clientX;
|
|
49
49
|
updateFromEvent(ev.clientX, false);
|
|
@@ -55,9 +55,9 @@ const SaturationValueArea = ({ hue, saturation, value, onChange, onChangeComplet
|
|
|
55
55
|
e.preventDefault();
|
|
56
56
|
updateFromEvent(e.clientX, e.clientY, false);
|
|
57
57
|
let lastPosition = { clientX: e.clientX, clientY: e.clientY };
|
|
58
|
-
(0, pointer_session_1.
|
|
58
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
59
59
|
event: e.nativeEvent,
|
|
60
|
-
|
|
60
|
+
captureTarget: e.currentTarget,
|
|
61
61
|
onMove: (ev) => {
|
|
62
62
|
lastPosition = { clientX: ev.clientX, clientY: ev.clientY };
|
|
63
63
|
updateFromEvent(ev.clientX, ev.clientY, false);
|
|
@@ -112,7 +112,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
|
|
|
112
112
|
}
|
|
113
113
|
}, [item, selectComposition, toggleFolder]);
|
|
114
114
|
const onKeyDown = (0, react_1.useCallback)((evt) => {
|
|
115
|
-
if (evt.key === 'Enter'
|
|
115
|
+
if (evt.key === 'Enter') {
|
|
116
116
|
onClick(evt);
|
|
117
117
|
}
|
|
118
118
|
}, [onClick]);
|
|
@@ -115,9 +115,9 @@ const GuideComp = ({ guide, canvasDimensions, scale }) => {
|
|
|
115
115
|
};
|
|
116
116
|
shouldCreateGuideRef.current = false;
|
|
117
117
|
setDraggingGuideId(() => guide.id);
|
|
118
|
-
(0, pointer_session_1.
|
|
118
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
119
119
|
event: e.nativeEvent,
|
|
120
|
-
|
|
120
|
+
captureTarget: e.currentTarget,
|
|
121
121
|
onMove: (moveEvent) => {
|
|
122
122
|
var _a;
|
|
123
123
|
updateHasMovedGuide(moveEvent.clientX, moveEvent.clientY);
|
|
@@ -168,9 +168,9 @@ const EditorRulers = ({ contentDimensions, canvasSize, assetMetadata, containerR
|
|
|
168
168
|
};
|
|
169
169
|
}, [draggingGuideId, moveGuidePointerRef, onMouseMove]);
|
|
170
170
|
const onPointerSessionStart = (0, react_1.useCallback)((event, guideId) => {
|
|
171
|
-
(0, pointer_session_1.
|
|
171
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
172
172
|
event: event.nativeEvent,
|
|
173
|
-
|
|
173
|
+
captureTarget: event.currentTarget,
|
|
174
174
|
onMove: (moveEvent) => onMouseMove(moveEvent, guideId),
|
|
175
175
|
onEnd: () => finishGuideInteraction(guideId),
|
|
176
176
|
});
|
|
@@ -4,6 +4,7 @@ exports.ExplorerPanel = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
|
+
const use_asset_drag_events_1 = require("../helpers/use-asset-drag-events");
|
|
7
8
|
const AssetSelector_1 = require("./AssetSelector");
|
|
8
9
|
const CompositionSelector_1 = require("./CompositionSelector");
|
|
9
10
|
const CompSelectorRef_1 = require("./CompSelectorRef");
|
|
@@ -33,6 +34,7 @@ const persistSelectedOptionsSidebarPanel = (panel) => {
|
|
|
33
34
|
};
|
|
34
35
|
const ExplorerPanel = ({ readOnlyStudio }) => {
|
|
35
36
|
const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
|
|
37
|
+
const assetTabFocusTimer = (0, react_1.useRef)(null);
|
|
36
38
|
const onCompositionsSelected = (0, react_1.useCallback)(() => {
|
|
37
39
|
setPanel('compositions');
|
|
38
40
|
persistSelectedOptionsSidebarPanel('compositions');
|
|
@@ -41,6 +43,22 @@ const ExplorerPanel = ({ readOnlyStudio }) => {
|
|
|
41
43
|
setPanel('assets');
|
|
42
44
|
persistSelectedOptionsSidebarPanel('assets');
|
|
43
45
|
}, []);
|
|
46
|
+
const onAssetDragEnter = (0, react_1.useCallback)((event) => {
|
|
47
|
+
if ((0, use_asset_drag_events_1.isAssetUploadDragEvent)(event) &&
|
|
48
|
+
assetTabFocusTimer.current === null) {
|
|
49
|
+
assetTabFocusTimer.current = window.setTimeout(() => {
|
|
50
|
+
onAssetsSelected();
|
|
51
|
+
assetTabFocusTimer.current = null;
|
|
52
|
+
}, 500);
|
|
53
|
+
}
|
|
54
|
+
}, [onAssetsSelected]);
|
|
55
|
+
const onAssetDragLeave = (0, react_1.useCallback)((event) => {
|
|
56
|
+
if ((0, use_asset_drag_events_1.isAssetUploadDragEvent)(event) &&
|
|
57
|
+
assetTabFocusTimer.current !== null) {
|
|
58
|
+
window.clearTimeout(assetTabFocusTimer.current);
|
|
59
|
+
assetTabFocusTimer.current = null;
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
44
62
|
(0, react_1.useImperativeHandle)(ExplorerPanelRef_1.explorerSidebarTabs, () => {
|
|
45
63
|
return {
|
|
46
64
|
getSelectedPanel: () => panel,
|
|
@@ -60,7 +78,7 @@ const ExplorerPanel = ({ readOnlyStudio }) => {
|
|
|
60
78
|
}, []);
|
|
61
79
|
return (jsx_runtime_1.jsx(CompSelectorRef_1.CompSelectorRef, { children: jsx_runtime_1.jsxs("div", { style: container, className: "css-reset", onPointerDown: onPointerDown, children: [
|
|
62
80
|
jsx_runtime_1.jsx("div", { style: tabsContainer, children: jsx_runtime_1.jsxs(Tabs_1.Tabs, { children: [
|
|
63
|
-
jsx_runtime_1.jsx(Tabs_1.Tab, { selected: panel === 'compositions', onClick: onCompositionsSelected, children: "Compositions" }), jsx_runtime_1.jsx(Tabs_1.Tab, { selected: panel === 'assets', onClick: onAssetsSelected, children: "Assets" })
|
|
81
|
+
jsx_runtime_1.jsx(Tabs_1.Tab, { selected: panel === 'compositions', onClick: onCompositionsSelected, children: "Compositions" }), jsx_runtime_1.jsx(Tabs_1.Tab, { selected: panel === 'assets', onClick: onAssetsSelected, onDragEnter: onAssetDragEnter, onDragLeave: onAssetDragLeave, children: "Assets" })
|
|
64
82
|
] }) }), panel === 'compositions' ? (jsx_runtime_1.jsx(CompositionSelector_1.CompositionSelector, {})) : (jsx_runtime_1.jsx(AssetSelector_1.AssetSelector, { readOnlyStudio: readOnlyStudio }))] }) }));
|
|
65
83
|
};
|
|
66
84
|
exports.ExplorerPanel = ExplorerPanel;
|
|
@@ -42,7 +42,7 @@ const mainButtonBase = {
|
|
|
42
42
|
};
|
|
43
43
|
const editorButtonIconSize = 18;
|
|
44
44
|
const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locationType }) => {
|
|
45
|
-
var _a;
|
|
45
|
+
var _a, _b;
|
|
46
46
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
47
47
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
48
48
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
@@ -64,6 +64,7 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
|
|
|
64
64
|
}
|
|
65
65
|
}, [location]);
|
|
66
66
|
const preferredEditorId = (0, use_default_editor_info_1.getPreferredEditorId)(editorInfo);
|
|
67
|
+
const preferredEditor = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.id === preferredEditorId);
|
|
67
68
|
const openWithCodingAgent = (0, react_1.useCallback)(async (codingAgentId, codingAgentName) => {
|
|
68
69
|
try {
|
|
69
70
|
const response = await (0, open_in_editor_1.openInCodingAgent)(codingAgentId, codingAgentId === 'copilot' ? null : contextForAgents);
|
|
@@ -75,12 +76,13 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
|
|
|
75
76
|
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
76
77
|
}
|
|
77
78
|
}, [contextForAgents]);
|
|
78
|
-
const editorName = (_a = window.remotion_editorName) !== null && _a !== void 0 ? _a : 'default editor';
|
|
79
|
-
const canOpenDefault = location !== null &&
|
|
79
|
+
const editorName = (_b = (_a = window.remotion_editorName) !== null && _a !== void 0 ? _a : preferredEditor === null || preferredEditor === void 0 ? void 0 : preferredEditor.nameWithType) !== null && _b !== void 0 ? _b : 'default editor';
|
|
80
|
+
const canOpenDefault = location !== null &&
|
|
81
|
+
(window.remotion_editorName !== null || preferredEditorId !== null);
|
|
80
82
|
const onOpenDefault = (0, react_1.useCallback)((event) => {
|
|
81
83
|
event.stopPropagation();
|
|
82
|
-
openWithEditor(null).catch(() => undefined);
|
|
83
|
-
}, [openWithEditor]);
|
|
84
|
+
openWithEditor(window.remotion_editorName === null ? preferredEditorId : null).catch(() => undefined);
|
|
85
|
+
}, [openWithEditor, preferredEditorId]);
|
|
84
86
|
const onDropdownOpenChange = (0, react_1.useCallback)((open) => {
|
|
85
87
|
setDropdownOpened(open);
|
|
86
88
|
if (!open) {
|
|
@@ -124,6 +126,7 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
|
|
|
124
126
|
excludeEditorId: preferredEditorId,
|
|
125
127
|
fileManagerDisabled: !(location === null || location === void 0 ? void 0 : location.source),
|
|
126
128
|
folder: locationType === 'folder',
|
|
129
|
+
location,
|
|
127
130
|
onConfigureApps: () => {
|
|
128
131
|
var _a;
|
|
129
132
|
var _b;
|
|
@@ -147,6 +150,17 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
|
|
|
147
150
|
(0, NotificationCenter_1.showNotification)(`Could not open file: ${err.message}`, 2000);
|
|
148
151
|
});
|
|
149
152
|
},
|
|
153
|
+
onOpenInGitClient: (gitClientId) => {
|
|
154
|
+
(0, open_in_editor_1.openInGitClient)(gitClientId)
|
|
155
|
+
.then((response) => {
|
|
156
|
+
if (!response.success) {
|
|
157
|
+
(0, NotificationCenter_1.showNotification)('Could not open Git client', 2000);
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
.catch((err) => {
|
|
161
|
+
(0, NotificationCenter_1.showNotification)(`Could not open Git client: ${err.message}`, 2000);
|
|
162
|
+
});
|
|
163
|
+
},
|
|
150
164
|
onOpenInTerminal: (terminalId) => {
|
|
151
165
|
if (!(location === null || location === void 0 ? void 0 : location.source) || locationType !== 'folder') {
|
|
152
166
|
return;
|
|
@@ -39,6 +39,28 @@ const computedValueStyle = {
|
|
|
39
39
|
fontStyle: 'italic',
|
|
40
40
|
lineHeight: '20px',
|
|
41
41
|
};
|
|
42
|
+
const metadataDraggerStyles = {
|
|
43
|
+
durationInFrames: {
|
|
44
|
+
padding: '2px 0 2px 6px',
|
|
45
|
+
textAlign: 'right',
|
|
46
|
+
width: 92,
|
|
47
|
+
},
|
|
48
|
+
fps: {
|
|
49
|
+
padding: '2px 0 2px 6px',
|
|
50
|
+
textAlign: 'right',
|
|
51
|
+
width: 72,
|
|
52
|
+
},
|
|
53
|
+
height: {
|
|
54
|
+
padding: '2px 0 2px 6px',
|
|
55
|
+
textAlign: 'right',
|
|
56
|
+
width: 52,
|
|
57
|
+
},
|
|
58
|
+
width: {
|
|
59
|
+
padding: '2px 0 2px 6px',
|
|
60
|
+
textAlign: 'right',
|
|
61
|
+
width: 52,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
42
64
|
const dimensionsControls = {
|
|
43
65
|
alignItems: 'center',
|
|
44
66
|
color: 'inherit',
|
|
@@ -124,7 +146,7 @@ const CompositionMetadataValue = ({ computed, disabled, field, onSave, pendingVa
|
|
|
124
146
|
}
|
|
125
147
|
return String(roundedValue);
|
|
126
148
|
}, [field]);
|
|
127
|
-
return computed ? (jsx_runtime_1.jsx("span", { style: computedContainerStyle, children: jsx_runtime_1.jsx("span", { style: computedValueStyle, children: formatValue(value) }) })) : disabled ? (formatValue(value)) : (jsx_runtime_1.jsx(InputDragger_1.InputDragger, { "aria-label": fieldLabels[field], type: "number", value: (_a = dragValue !== null && dragValue !== void 0 ? dragValue : pendingValue === null || pendingValue === void 0 ? void 0 : pendingValue.value) !== null && _a !== void 0 ? _a : value, disabled: pendingValue !== null, status: "ok", onValueChange: setDragValue, onValueChangeEnd: save, onTextChange: () => undefined, min: isFps ? 0.01 : 1, step: isFps ? 0.01 : 1, dragDecimalPlaces: isFps ? 2 : 0, formatter: formatValue, rightAlign: true,
|
|
149
|
+
return computed ? (jsx_runtime_1.jsx("span", { style: computedContainerStyle, children: jsx_runtime_1.jsx("span", { style: computedValueStyle, children: formatValue(value) }) })) : disabled ? (formatValue(value)) : (jsx_runtime_1.jsx(InputDragger_1.InputDragger, { "aria-label": fieldLabels[field], buttonStyle: metadataDraggerStyles[field], type: "number", value: (_a = dragValue !== null && dragValue !== void 0 ? dragValue : pendingValue === null || pendingValue === void 0 ? void 0 : pendingValue.value) !== null && _a !== void 0 ? _a : value, disabled: pendingValue !== null, status: "ok", onValueChange: setDragValue, onValueChangeEnd: save, onTextChange: () => undefined, min: isFps ? 0.01 : 1, step: isFps ? 0.01 : 1, dragDecimalPlaces: isFps ? 2 : 0, formatter: formatValue, rightAlign: true, style: metadataDraggerStyles[field] }));
|
|
128
150
|
};
|
|
129
151
|
const CompositionMetadata = ({ compositionId, disabled, stack }) => {
|
|
130
152
|
var _a, _b, _c, _d;
|
|
@@ -105,6 +105,7 @@ const SequenceExpandedInspector = ({ track, readOnlyStudio }) => {
|
|
|
105
105
|
const sourceLocation = (0, SequenceInspectorHeader_1.useSequenceInspectorSourceLocation)(track.sequence);
|
|
106
106
|
const connectedCompositions = (0, ConnectedCompositionsSection_1.useConnectedCompositions)({ track });
|
|
107
107
|
const { validatedLocation } = sourceLocation;
|
|
108
|
+
const stackKey = track.sequence.getStack();
|
|
108
109
|
const sequenceSelection = (0, react_1.useMemo)(() => {
|
|
109
110
|
if (!track.nodePathInfo) {
|
|
110
111
|
return null;
|
|
@@ -141,7 +142,7 @@ const SequenceExpandedInspector = ({ track, readOnlyStudio }) => {
|
|
|
141
142
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
142
143
|
}
|
|
143
144
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
|
|
144
|
-
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
145
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }, stackKey !== null && stackKey !== void 0 ? stackKey : track.sequence.id), jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
145
146
|
jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })
|
|
146
147
|
] })) : null, validatedLocation ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [
|
|
147
148
|
jsx_runtime_1.jsx(SplitSequenceAction, { selection: sequenceSelection, track: track }), jsx_runtime_1.jsx(SequenceSourceActions, { selection: sequenceSelection, track: track, validatedSource: validatedLocation.source })
|
|
@@ -153,7 +154,6 @@ const SequenceSelectionInspector = ({ selection, readOnlyStudio }) => {
|
|
|
153
154
|
if (!track) {
|
|
154
155
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
155
156
|
}
|
|
156
|
-
|
|
157
|
-
return (jsx_runtime_1.jsx(SequenceExpandedInspector, { track: track, readOnlyStudio: readOnlyStudio }, stackKey !== null && stackKey !== void 0 ? stackKey : track.sequence.id));
|
|
157
|
+
return (jsx_runtime_1.jsx(SequenceExpandedInspector, { track: track, readOnlyStudio: readOnlyStudio }));
|
|
158
158
|
};
|
|
159
159
|
exports.SequenceSelectionInspector = SequenceSelectionInspector;
|
|
@@ -73,9 +73,9 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
onItemSelected(id);
|
|
76
|
-
(0, pointer_session_1.
|
|
76
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
77
77
|
event: e.nativeEvent,
|
|
78
|
-
|
|
78
|
+
captureTarget: e.currentTarget,
|
|
79
79
|
onEnd: (reason, evt) => {
|
|
80
80
|
if ((reason === 'pointerup' || reason === 'buttons-released') &&
|
|
81
81
|
evt) {
|
|
@@ -34,6 +34,6 @@ const ModalContainer = ({ children, onEscape, onOutsideClick, noZIndex, panelSty
|
|
|
34
34
|
// Prevent deselection of currently selected items
|
|
35
35
|
e.stopPropagation();
|
|
36
36
|
}, []);
|
|
37
|
-
return (jsx_runtime_1.jsx("div", { className: "css-reset", style: backgroundOverlay, role: "dialog", "aria-modal": "true", onPointerDown: onPointerDown, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { disabled: noZIndex, onOutsideClick: onOutsideClick, onEscape: onEscape,
|
|
37
|
+
return (jsx_runtime_1.jsx("div", { className: "css-reset", style: backgroundOverlay, role: "dialog", "aria-modal": "true", onPointerDown: onPointerDown, children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { disabled: noZIndex, onOutsideClick: onOutsideClick, onEscape: onEscape, children: jsx_runtime_1.jsx("div", { style: { ...panel, ...panelStyle }, children: children }) }) }));
|
|
38
38
|
};
|
|
39
39
|
exports.ModalContainer = ModalContainer;
|
|
@@ -6,16 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Modals = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
-
const react_dom_1 = __importDefault(require("react-dom"));
|
|
10
9
|
const client_id_1 = require("../helpers/client-id");
|
|
11
10
|
const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
|
|
12
11
|
const modals_1 = require("../state/modals");
|
|
13
|
-
const z_index_1 = require("../state/z-index");
|
|
14
12
|
const AskAiModal_1 = require("./AskAiModal");
|
|
15
13
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
16
14
|
const EffectPickerModal_1 = require("./EffectPickerModal");
|
|
17
15
|
const InstallPackage_1 = require("./InstallPackage");
|
|
18
|
-
const portals_1 = require("./Menu/portals");
|
|
19
16
|
const DeleteComposition_1 = require("./NewComposition/DeleteComposition");
|
|
20
17
|
const DeleteFolder_1 = require("./NewComposition/DeleteFolder");
|
|
21
18
|
const DuplicateComposition_1 = require("./NewComposition/DuplicateComposition");
|
|
@@ -36,7 +33,6 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
36
33
|
var _a;
|
|
37
34
|
const modalContextType = (0, react_1.useContext)(modals_1.SelectedModalContext);
|
|
38
35
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
39
|
-
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
40
36
|
const { previewServerState, subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
41
37
|
const canRender = previewServerState.type === 'connected';
|
|
42
38
|
(0, react_1.useEffect)(() => {
|
|
@@ -51,11 +47,8 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
51
47
|
});
|
|
52
48
|
});
|
|
53
49
|
}, [setSelectedModal, subscribeToEvent]);
|
|
54
|
-
return
|
|
50
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack, canvasCapture: modalContextType.canvasCapture })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'settings' && (jsx_runtime_1.jsx(SettingsModal_1.SettingsModal, { initialTab: modalContextType.initialTab, initialPublicLicenseKey: modalContextType.initialPublicLicenseKey }, `${modalContextType.initialTab}-${modalContextType.initialPublicLicenseKey}`)), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
55
51
|
modalContextType.type === 'server-render' &&
|
|
56
|
-
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] })
|
|
57
|
-
// Modals must be above overlays opened from the editor, such as the
|
|
58
|
-
// floating sidebars used in the mobile layout.
|
|
59
|
-
(0, portals_1.getPortal)(currentZIndex + 1));
|
|
52
|
+
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
60
53
|
};
|
|
61
54
|
exports.Modals = Modals;
|
|
@@ -449,9 +449,9 @@ const InputDraggerForwardRefFn = ({ onValueChange, onValueChangeEnd, min: _min,
|
|
|
449
449
|
lastDragValue = nextValue;
|
|
450
450
|
onValueChange(nextValue);
|
|
451
451
|
};
|
|
452
|
-
(0, pointer_session_1.
|
|
452
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
453
453
|
event: e.nativeEvent,
|
|
454
|
-
target,
|
|
454
|
+
captureTarget: target,
|
|
455
455
|
onMove: moveListener,
|
|
456
456
|
onEnd: (reason) => {
|
|
457
457
|
pointerDownRef.current = false;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { CanvasCaptureImport } from '../../state/modals';
|
|
2
3
|
export declare const NewComposition: React.FC<{
|
|
3
4
|
readonly folderName: string | null;
|
|
4
5
|
readonly parentName: string | null;
|
|
5
6
|
readonly stack: string | null;
|
|
7
|
+
readonly canvasCapture: CanvasCaptureImport | null;
|
|
6
8
|
}>;
|
|
@@ -4,6 +4,9 @@ exports.NewComposition = 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 get_static_files_1 = require("../../api/get-static-files");
|
|
8
|
+
const write_static_file_1 = require("../../api/write-static-file");
|
|
9
|
+
const install_required_package_1 = require("../../helpers/install-required-package");
|
|
7
10
|
const use_create_composition_1 = require("../../helpers/use-create-composition");
|
|
8
11
|
const layout_1 = require("../layout");
|
|
9
12
|
const ModalFooter_1 = require("../ModalFooter");
|
|
@@ -27,14 +30,15 @@ const content = {
|
|
|
27
30
|
const folderPathStyle = {
|
|
28
31
|
fontSize: 14,
|
|
29
32
|
};
|
|
30
|
-
const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
33
|
+
const NewCompositionLoaded = ({ canvasCapture, folderName, parentName, stack }) => {
|
|
34
|
+
var _a;
|
|
31
35
|
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
32
36
|
const resolvedComposition = remotion_1.Internals.useResolvedVideoConfig(null);
|
|
33
37
|
const initialComposition = (resolvedComposition === null || resolvedComposition === void 0 ? void 0 : resolvedComposition.type) === 'success' ||
|
|
34
38
|
(resolvedComposition === null || resolvedComposition === void 0 ? void 0 : resolvedComposition.type) === 'success-and-refreshing'
|
|
35
39
|
? resolvedComposition.result
|
|
36
40
|
: null;
|
|
37
|
-
const initialDimensions = (0, get_new_composition_defaults_1.getNewCompositionDefaults)(initialComposition);
|
|
41
|
+
const initialDimensions = (0, get_new_composition_defaults_1.getNewCompositionDefaults)(initialComposition, (_a = canvasCapture === null || canvasCapture === void 0 ? void 0 : canvasCapture.durationInSeconds) !== null && _a !== void 0 ? _a : null);
|
|
38
42
|
const [newId, setName] = (0, react_1.useState)(() => (0, use_create_composition_1.getUniqueCompositionName)(compositions));
|
|
39
43
|
const inputRef = (0, react_1.useRef)(null);
|
|
40
44
|
(0, react_1.useEffect)(() => {
|
|
@@ -98,13 +102,41 @@ const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
|
98
102
|
parentName,
|
|
99
103
|
selectedFrameRate,
|
|
100
104
|
size,
|
|
105
|
+
canvasCapture: canvasCapture === null
|
|
106
|
+
? null
|
|
107
|
+
: {
|
|
108
|
+
data: canvasCapture.data,
|
|
109
|
+
videoFileName: canvasCapture.file.name,
|
|
110
|
+
videoHeight: canvasCapture.height,
|
|
111
|
+
videoWidth: canvasCapture.width,
|
|
112
|
+
},
|
|
101
113
|
});
|
|
114
|
+
const createCanvasCaptureComposition = (0, react_1.useCallback)(async ({ signal, symbolicatedStack, }) => {
|
|
115
|
+
if (canvasCapture !== null) {
|
|
116
|
+
const existingFile = (0, get_static_files_1.getStaticFiles)().find((file) => file.name === canvasCapture.file.name);
|
|
117
|
+
if (existingFile !== undefined &&
|
|
118
|
+
existingFile.sizeInBytes !== canvasCapture.file.size) {
|
|
119
|
+
throw new Error(`File with name ${canvasCapture.file.name} already exists and is different`);
|
|
120
|
+
}
|
|
121
|
+
await (0, install_required_package_1.installRequiredPackages)([
|
|
122
|
+
{ name: '@remotion/media', version: null },
|
|
123
|
+
{ name: '@remotion/mac-cursors', version: null },
|
|
124
|
+
]);
|
|
125
|
+
if (existingFile === undefined) {
|
|
126
|
+
await (0, write_static_file_1.writeStaticFile)({
|
|
127
|
+
contents: await canvasCapture.file.arrayBuffer(),
|
|
128
|
+
filePath: canvasCapture.file.name,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return createComposition({ signal, symbolicatedStack });
|
|
133
|
+
}, [canvasCapture, createComposition]);
|
|
102
134
|
const onSubmit = (0, react_1.useCallback)((e) => {
|
|
103
135
|
e.preventDefault();
|
|
104
136
|
}, []);
|
|
105
137
|
const folderPath = [parentName, folderName].filter(Boolean).join('/');
|
|
106
138
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
107
|
-
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title:
|
|
139
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: canvasCapture === null ? 'New composition' : 'Import Canvas Capture' }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
108
140
|
jsx_runtime_1.jsxs("div", { style: content, children: [folderPath ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
109
141
|
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 }) })
|
|
110
142
|
] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
@@ -125,14 +157,14 @@ const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
|
|
|
125
157
|
] }), jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
126
158
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "FPS" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })
|
|
127
159
|
] })
|
|
128
|
-
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: null, errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) =>
|
|
160
|
+
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: null, errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => createCanvasCaptureComposition({
|
|
129
161
|
signal,
|
|
130
162
|
symbolicatedStack,
|
|
131
163
|
}), fallbackToRootFile: true }) })
|
|
132
164
|
] })
|
|
133
165
|
] }));
|
|
134
166
|
};
|
|
135
|
-
const NewComposition = ({ folderName, parentName, stack }) => {
|
|
136
|
-
return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { children: jsx_runtime_1.jsx(NewCompositionLoaded, { folderName: folderName, parentName: parentName, stack: stack }) }));
|
|
167
|
+
const NewComposition = ({ canvasCapture, folderName, parentName, stack }) => {
|
|
168
|
+
return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { children: jsx_runtime_1.jsx(NewCompositionLoaded, { canvasCapture: canvasCapture, folderName: folderName, parentName: parentName, stack: stack }) }));
|
|
137
169
|
};
|
|
138
170
|
exports.NewComposition = NewComposition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { VideoConfig } from 'remotion';
|
|
2
2
|
type CompositionDimensions = Pick<VideoConfig, 'width' | 'height' | 'fps' | 'durationInFrames'>;
|
|
3
|
-
export declare const getNewCompositionDefaults: (composition: CompositionDimensions | null) => CompositionDimensions;
|
|
3
|
+
export declare const getNewCompositionDefaults: (composition: CompositionDimensions | null, canvasCaptureDurationInSeconds: number | null) => CompositionDimensions;
|
|
4
4
|
export {};
|