@remotion/studio 4.0.498 → 4.0.500
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssetSelector.js +8 -6
- package/dist/components/AssetSelectorItem.d.ts +24 -0
- package/dist/components/AssetSelectorItem.js +144 -83
- package/dist/components/Canvas.js +162 -7
- package/dist/components/CompositionSelector.js +15 -42
- package/dist/components/CompositionSelectorItem.js +21 -13
- package/dist/components/ControlButton.js +1 -0
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/EditorRuler/Ruler.js +5 -3
- package/dist/components/ExplorerPanel.js +2 -1
- package/dist/components/ExplorerPanelRef.d.ts +2 -0
- package/dist/components/ForceSpecificCursor.js +13 -1
- package/dist/components/GlobalKeybindings.js +7 -1
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +2 -2
- package/dist/components/InlineDropdown.d.ts +1 -1
- package/dist/components/InlineDropdown.js +3 -2
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +8 -7
- package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +7 -7
- package/dist/components/InspectorPanel/common.d.ts +17 -4
- package/dist/components/InspectorPanel/common.js +60 -6
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
- package/dist/components/InspectorSequenceSection.js +43 -19
- package/dist/components/KeyboardShortcutsExplainer.js +4 -2
- package/dist/components/Menu/MenuItem.js +2 -1
- package/dist/components/MenuCompositionName.js +30 -7
- package/dist/components/MenuToolbar.d.ts +0 -1
- package/dist/components/MenuToolbar.js +8 -7
- package/dist/components/MobilePanel.d.ts +2 -1
- package/dist/components/MobilePanel.js +29 -25
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +34 -0
- package/dist/components/NewComposition/InputDragger.js +262 -23
- package/dist/components/OutlineToggle.d.ts +1 -3
- package/dist/components/OutlineToggle.js +2 -2
- package/dist/components/PreviewToolbar.js +10 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +44 -0
- package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
- package/dist/components/QuickSwitcher/NoResults.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +76 -12
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
- package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
- package/dist/components/QuickSwitcher/asset-search.js +42 -0
- package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
- package/dist/components/SelectedOutlineCropControls.js +299 -0
- package/dist/components/SelectedOutlineElement.js +83 -43
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.js +130 -8
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
- package/dist/components/SidebarCollapserControls.d.ts +3 -1
- package/dist/components/SidebarCollapserControls.js +34 -29
- package/dist/components/SnappingToggle.d.ts +1 -3
- package/dist/components/SnappingToggle.js +2 -2
- package/dist/components/Splitter/SplitterContainer.d.ts +2 -0
- package/dist/components/Splitter/SplitterContainer.js +5 -1
- package/dist/components/Splitter/SplitterContext.d.ts +2 -0
- package/dist/components/Splitter/SplitterContext.js +2 -0
- package/dist/components/Splitter/SplitterElement.js +6 -1
- package/dist/components/Splitter/SplitterHandle.js +27 -2
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
- package/dist/components/Timeline/TimelineAssetField.js +52 -100
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
- package/dist/components/Timeline/TimelineColorField.js +20 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.js +25 -1
- package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
- package/dist/components/Timeline/TimelineLayerEye.js +4 -1
- package/dist/components/Timeline/TimelineList.d.ts +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +7 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +5 -5
- package/dist/components/Timeline/TimelineSelection.js +8 -6
- package/dist/components/Timeline/TimelineSequence.js +7 -6
- package/dist/components/Timeline/TimelineSequenceItem.js +57 -10
- package/dist/components/Timeline/TimelineSequenceName.js +1 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +27 -75
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +5 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +29 -12
- package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
- package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
- package/dist/components/Timeline/reset-selected-timeline-props.js +18 -10
- package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
- package/dist/components/Timeline/save-effect-prop.js +52 -1
- package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +17 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +6 -4
- package/dist/components/TopPanel.js +3 -2
- package/dist/components/UndoRedoButtons.js +27 -5
- package/dist/components/composition-drop-preview.d.ts +33 -0
- package/dist/components/composition-drop-preview.js +68 -0
- package/dist/components/drop-handler-data.d.ts +1 -1
- package/dist/components/drop-handler-data.js +27 -60
- package/dist/components/effect-drag-and-drop.d.ts +1 -1
- package/dist/components/effect-drag-and-drop.js +7 -55
- package/dist/components/element-drag-and-drop.d.ts +1 -1
- package/dist/components/element-drag-and-drop.js +5 -17
- package/dist/components/handle-drop.js +0 -1
- package/dist/components/import-assets.d.ts +7 -8
- package/dist/components/import-assets.js +2 -9
- package/dist/components/menu-toolbar-height.d.ts +1 -0
- package/dist/components/menu-toolbar-height.js +4 -0
- package/dist/components/selected-outline-drag.d.ts +41 -4
- package/dist/components/selected-outline-drag.js +179 -2
- package/dist/components/selected-outline-geometry.d.ts +1 -0
- package/dist/components/selected-outline-measurement.d.ts +11 -0
- package/dist/components/selected-outline-measurement.js +64 -3
- package/dist/components/selected-outline-types.d.ts +44 -1
- package/dist/components/selected-outline-types.js +21 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
- package/dist/esm/{chunk-7a6q9hk2.js → chunk-dr1y1vm3.js} +11851 -9494
- package/dist/esm/internals.mjs +11851 -9494
- package/dist/esm/previewEntry.mjs +55150 -52795
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.d.ts +2 -2
- package/dist/helpers/calculate-timeline.js +8 -28
- package/dist/helpers/get-effective-translation.d.ts +13 -1
- package/dist/helpers/get-effective-translation.js +12 -6
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
- package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
- package/dist/helpers/interactivity-enabled.d.ts +1 -0
- package/dist/helpers/interactivity-enabled.js +7 -2
- package/dist/helpers/is-mac.d.ts +1 -0
- package/dist/helpers/is-mac.js +4 -0
- package/dist/helpers/open-in-editor.d.ts +5 -1
- package/dist/helpers/open-in-editor.js +15 -1
- package/dist/helpers/ruler-canvas-size.d.ts +7 -0
- package/dist/helpers/ruler-canvas-size.js +14 -1
- package/dist/helpers/sort-by-nonce-history.js +97 -19
- package/dist/helpers/use-image-metadata.d.ts +1 -0
- package/dist/helpers/use-image-metadata.js +8 -5
- package/dist/helpers/use-keybinding.js +2 -3
- package/dist/helpers/use-media-metadata.d.ts +1 -0
- package/dist/helpers/use-media-metadata.js +8 -5
- package/dist/helpers/use-menu-structure.js +10 -1
- package/dist/icons/caret.d.ts +1 -0
- package/dist/icons/caret.js +2 -2
- package/dist/icons/pen.d.ts +5 -0
- package/dist/icons/pen.js +8 -0
- package/dist/state/modals.d.ts +5 -0
- package/package.json +13 -12
- package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
- package/dist/helpers/get-timeline-sequence-hash.js +0 -33
|
@@ -55,6 +55,7 @@ const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
|
55
55
|
const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
|
|
56
56
|
const layout_1 = require("../layout");
|
|
57
57
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
58
|
+
const selected_outline_types_1 = require("../selected-outline-types");
|
|
58
59
|
const use_select_asset_1 = require("../use-select-asset");
|
|
59
60
|
const disable_sequence_interactivity_1 = require("./disable-sequence-interactivity");
|
|
60
61
|
const duplicate_selected_timeline_item_1 = require("./duplicate-selected-timeline-item");
|
|
@@ -186,7 +187,7 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
186
187
|
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
187
188
|
const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
|
|
188
189
|
const { onSelect, selectable, selected, selectionItem } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
189
|
-
const { selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
190
|
+
const { selectItem, selectedItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
190
191
|
const containsSelection = (0, TimelineSelection_1.useTimelineRowContainsSelection)(nodePathInfo);
|
|
191
192
|
const [effectDropHovered, setEffectDropHovered] = (0, react_1.useState)(false);
|
|
192
193
|
const [isRenaming, setIsRenaming] = (0, react_1.useState)(false);
|
|
@@ -651,6 +652,29 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
651
652
|
const canAddEffect = (nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.supportsEffects) === true &&
|
|
652
653
|
previewInteractive &&
|
|
653
654
|
Boolean(validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source);
|
|
655
|
+
const canCrop = (0, react_1.useMemo)(() => {
|
|
656
|
+
if (!previewInteractive ||
|
|
657
|
+
!sequence.controls ||
|
|
658
|
+
!nodePathInfo ||
|
|
659
|
+
!propStatusesForOverride ||
|
|
660
|
+
!(validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source)) {
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
663
|
+
const activeSchema = remotion_1.Internals.flattenActiveSchema(sequence.controls.schema, (key) => {
|
|
664
|
+
var _a;
|
|
665
|
+
return (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.currentRuntimeValueDotNotation[key];
|
|
666
|
+
});
|
|
667
|
+
return (0, selected_outline_types_1.canEditSelectedOutlineCrop)({
|
|
668
|
+
schema: activeSchema,
|
|
669
|
+
propStatuses: propStatusesForOverride,
|
|
670
|
+
});
|
|
671
|
+
}, [
|
|
672
|
+
nodePathInfo,
|
|
673
|
+
previewInteractive,
|
|
674
|
+
propStatusesForOverride,
|
|
675
|
+
sequence.controls,
|
|
676
|
+
validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source,
|
|
677
|
+
]);
|
|
654
678
|
const onAddEffect = (0, react_1.useCallback)(() => {
|
|
655
679
|
if (!canAddEffect ||
|
|
656
680
|
previewServerState.type !== 'connected' ||
|
|
@@ -671,10 +695,20 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
671
695
|
setSelectedModal,
|
|
672
696
|
validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source,
|
|
673
697
|
]);
|
|
674
|
-
const
|
|
675
|
-
if (!
|
|
676
|
-
return
|
|
698
|
+
const onCrop = (0, react_1.useCallback)(() => {
|
|
699
|
+
if (!canCrop || !nodePathInfo) {
|
|
700
|
+
return;
|
|
677
701
|
}
|
|
702
|
+
selectItem({
|
|
703
|
+
type: 'sequence-prop',
|
|
704
|
+
nodePathInfo: {
|
|
705
|
+
...nodePathInfo,
|
|
706
|
+
auxiliaryKeys: ['controls', selected_outline_types_1.cropFieldKeys.left],
|
|
707
|
+
},
|
|
708
|
+
key: selected_outline_types_1.cropFieldKeys.left,
|
|
709
|
+
}, undefined, undefined, { reveal: true });
|
|
710
|
+
}, [canCrop, nodePathInfo, selectItem]);
|
|
711
|
+
const contextMenuValues = (0, react_1.useMemo)(() => {
|
|
678
712
|
return (0, get_sequence_context_menu_items_1.getSequenceContextMenuItems)({
|
|
679
713
|
assetLinkInfo,
|
|
680
714
|
canOpenInEditor,
|
|
@@ -706,12 +740,24 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
706
740
|
subMenu: null,
|
|
707
741
|
value: 'add-effect',
|
|
708
742
|
},
|
|
709
|
-
{
|
|
710
|
-
type: 'divider',
|
|
711
|
-
id: 'add-effect-divider',
|
|
712
|
-
},
|
|
713
743
|
]
|
|
714
744
|
: []),
|
|
745
|
+
{
|
|
746
|
+
type: 'item',
|
|
747
|
+
id: 'crop',
|
|
748
|
+
keyHint: null,
|
|
749
|
+
label: 'Crop',
|
|
750
|
+
leftItem: null,
|
|
751
|
+
disabled: !canCrop,
|
|
752
|
+
onClick: onCrop,
|
|
753
|
+
quickSwitcherLabel: null,
|
|
754
|
+
subMenu: null,
|
|
755
|
+
value: 'crop',
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
type: 'divider',
|
|
759
|
+
id: 'crop-divider',
|
|
760
|
+
},
|
|
715
761
|
{
|
|
716
762
|
type: 'item',
|
|
717
763
|
id: 'rename-sequence',
|
|
@@ -733,6 +779,7 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
733
779
|
}, [
|
|
734
780
|
assetLinkInfo,
|
|
735
781
|
canAddEffect,
|
|
782
|
+
canCrop,
|
|
736
783
|
canOpenInEditor,
|
|
737
784
|
canRenameThisSequence,
|
|
738
785
|
deleteDisabled,
|
|
@@ -742,13 +789,13 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
742
789
|
freezeFrameMenuItem,
|
|
743
790
|
nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.supportsEffects,
|
|
744
791
|
onAddEffect,
|
|
792
|
+
onCrop,
|
|
745
793
|
onDeleteSequenceFromSource,
|
|
746
794
|
onDisableSequenceInteractivity,
|
|
747
795
|
onDuplicateSequenceFromSource,
|
|
748
796
|
onRenameSequence,
|
|
749
797
|
openInEditor,
|
|
750
798
|
originalLocation,
|
|
751
|
-
previewConnected,
|
|
752
799
|
selectAsset,
|
|
753
800
|
sequence,
|
|
754
801
|
]);
|
|
@@ -818,7 +865,7 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
818
865
|
jsx_runtime_1.jsx(TimelineMediaInfo_1.TimelineMediaInfo, { src: mediaSrc })
|
|
819
866
|
] })) : null] }) }));
|
|
820
867
|
const draggableTrackRow = canHandleSequenceDrag ? (jsx_runtime_1.jsxs("div", { draggable: canReorderSequence, onDragStart: onSequenceDragStart, onDragEnd: onSequenceDragEnd, onDragOver: onSequenceDragOver, onDragLeave: onSequenceDragLeave, onDrop: onSequenceDrop, style: sequenceReorderWrapper, children: [sequenceReorderLineStyle ? (jsx_runtime_1.jsx("div", { style: sequenceReorderLineStyle })) : null, sequenceDropRejection ? (jsx_runtime_1.jsx("div", { style: sequenceReorderRejectionStyle, children: sequenceDropRejection })) : null, trackRow] })) : (trackRow);
|
|
821
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [previewConnected ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: selectable ? onSelect : null, children: draggableTrackRow })) : (draggableTrackRow), previewConnected &&
|
|
868
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [previewConnected || window.remotion_isReadOnlyStudio ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: selectable ? onSelect : null, children: draggableTrackRow })) : (draggableTrackRow), previewConnected &&
|
|
822
869
|
(0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
|
|
823
870
|
isExpanded &&
|
|
824
871
|
hasExpandableContent &&
|
|
@@ -24,6 +24,7 @@ const TimelineSequenceName = ({ displayName, fallbackDisplayName, selected, cont
|
|
|
24
24
|
alignSelf: 'stretch',
|
|
25
25
|
...(0, TimelineSelection_1.getTimelineSelectedLabelStyle)(selected, false),
|
|
26
26
|
display: 'inline-flex',
|
|
27
|
+
flexShrink: 0,
|
|
27
28
|
fontFamily: 'inherit',
|
|
28
29
|
fontSize: 12,
|
|
29
30
|
lineHeight: 'normal',
|
|
@@ -6,9 +6,10 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const client_id_1 = require("../../helpers/client-id");
|
|
9
|
+
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
9
10
|
const ContextMenu_1 = require("../ContextMenu");
|
|
11
|
+
const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
|
|
10
12
|
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
11
|
-
const get_animation_item_selection_for_frame_1 = require("./get-animation-item-selection-for-frame");
|
|
12
13
|
const save_sequence_prop_1 = require("./save-sequence-prop");
|
|
13
14
|
const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
|
|
14
15
|
const TimelineFieldRowContent_1 = require("./TimelineFieldRowContent");
|
|
@@ -18,8 +19,17 @@ const TimelineLayerEye_1 = require("./TimelineLayerEye");
|
|
|
18
19
|
const TimelineRowChrome_1 = require("./TimelineRowChrome");
|
|
19
20
|
const TimelineSchemaField_1 = require("./TimelineSchemaField");
|
|
20
21
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
21
|
-
const update_selected_easing_1 = require("./update-selected-easing");
|
|
22
22
|
const fieldRowBase = {};
|
|
23
|
+
const inlineSourceFieldRow = {
|
|
24
|
+
alignItems: 'stretch',
|
|
25
|
+
display: 'flex',
|
|
26
|
+
minWidth: 0,
|
|
27
|
+
width: '100%',
|
|
28
|
+
};
|
|
29
|
+
const computedSourceFieldRow = {
|
|
30
|
+
boxSizing: 'border-box',
|
|
31
|
+
paddingInline: InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING,
|
|
32
|
+
};
|
|
23
33
|
const isKeyframedStatus = (status) => {
|
|
24
34
|
return status.status === 'keyframed';
|
|
25
35
|
};
|
|
@@ -167,9 +177,6 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
167
177
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
168
178
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
169
179
|
const selection = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
170
|
-
const { selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
171
|
-
const setFrame = remotion_1.Internals.useTimelineSetFrame();
|
|
172
|
-
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
173
180
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
174
181
|
const sourceFrame = timelinePosition - keyframeDisplayOffset;
|
|
175
182
|
const propStatusesForOverride = remotion_1.Internals.getPropStatusesCtx(visualModePropStatuses, nodePath);
|
|
@@ -267,84 +274,29 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
267
274
|
},
|
|
268
275
|
];
|
|
269
276
|
}, [canShowReset, onReset]);
|
|
270
|
-
const seekToDisplayFrame = (0, react_1.useCallback)((frame) => {
|
|
271
|
-
setFrame((current) => {
|
|
272
|
-
const next = { ...current, [videoConfig.id]: frame };
|
|
273
|
-
remotion_1.Internals.persistCurrentFrame(next);
|
|
274
|
-
return next;
|
|
275
|
-
});
|
|
276
|
-
}, [setFrame, videoConfig.id]);
|
|
277
277
|
const onPropertyDoubleClick = (0, react_1.useCallback)((event) => {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const keyframeSelection = {
|
|
282
|
-
type: 'keyframe',
|
|
283
|
-
nodePathInfo,
|
|
284
|
-
frame: sourceFrame + keyframeDisplayOffset,
|
|
285
|
-
};
|
|
286
|
-
if (propStatus.status === 'static') {
|
|
287
|
-
if (!keyframable || previewServerState.type !== 'connected') {
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
const value = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
291
|
-
propStatus,
|
|
292
|
-
dragOverrideValue,
|
|
293
|
-
frame: sourceFrame,
|
|
294
|
-
defaultValue: field.fieldSchema.default,
|
|
295
|
-
shouldResortToDefaultValueIfUndefined: true,
|
|
296
|
-
});
|
|
297
|
-
event.stopPropagation();
|
|
298
|
-
(0, call_add_keyframe_1.callAddSequenceKeyframe)({
|
|
299
|
-
fileName: validatedLocation.source,
|
|
300
|
-
nodePath,
|
|
301
|
-
fieldKey: field.key,
|
|
302
|
-
sourceFrame,
|
|
303
|
-
value,
|
|
304
|
-
schema,
|
|
305
|
-
setPropStatuses,
|
|
306
|
-
clientId: previewServerState.clientId,
|
|
307
|
-
}).catch(() => undefined);
|
|
308
|
-
selectItems([keyframeSelection], { reveal: true });
|
|
309
|
-
seekToDisplayFrame(keyframeSelection.frame);
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
const targetSelection = (0, get_animation_item_selection_for_frame_1.getAnimationItemSelectionForSourceFrame)({
|
|
313
|
-
includeEasings: (0, update_selected_easing_1.canEditEasingForInterpolationFunction)(propStatus.interpolationFunction),
|
|
314
|
-
keyframeDisplayOffset,
|
|
315
|
-
keyframes: propStatus.keyframes,
|
|
316
|
-
nodePathInfo,
|
|
317
|
-
sourceFrame,
|
|
318
|
-
});
|
|
319
|
-
if (targetSelection === null) {
|
|
278
|
+
var _a;
|
|
279
|
+
if (!window.remotion_editorName ||
|
|
280
|
+
previewServerState.type !== 'connected') {
|
|
320
281
|
return;
|
|
321
282
|
}
|
|
322
283
|
event.stopPropagation();
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
}, [
|
|
328
|
-
dragOverrideValue,
|
|
329
|
-
field.fieldSchema.default,
|
|
330
|
-
field.key,
|
|
331
|
-
keyframeDisplayOffset,
|
|
332
|
-
keyframable,
|
|
333
|
-
nodePath,
|
|
334
|
-
nodePathInfo,
|
|
335
|
-
previewServerState,
|
|
336
|
-
propStatus,
|
|
337
|
-
schema,
|
|
338
|
-
seekToDisplayFrame,
|
|
339
|
-
selectItems,
|
|
340
|
-
setPropStatuses,
|
|
341
|
-
sourceFrame,
|
|
342
|
-
validatedLocation.source,
|
|
343
|
-
]);
|
|
284
|
+
(0, open_in_editor_1.openOriginalPositionInEditorAtProperty)({
|
|
285
|
+
originalPosition: validatedLocation,
|
|
286
|
+
property: (_a = field.key.split('.').at(-1)) !== null && _a !== void 0 ? _a : field.key,
|
|
287
|
+
}).catch(() => undefined);
|
|
288
|
+
}, [field.key, previewServerState.type, validatedLocation]);
|
|
344
289
|
if (propStatus === null) {
|
|
345
290
|
return null;
|
|
346
291
|
}
|
|
347
292
|
const fieldValue = isKeyframedStatus(propStatus) ? (jsx_runtime_1.jsx(exports.TimelineSequenceKeyframedValue, { field: field, fileName: validatedLocation.source, nodePath: nodePath, schema: schema, propStatus: propStatus, sourceFrame: sourceFrame })) : propStatus.status === 'static' ? (jsx_runtime_1.jsx(Value, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, schema: schema, propStatus: propStatus })) : (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineNonEditableStatus, { propStatus: propStatus }));
|
|
293
|
+
if (field.typeName === 'asset' && field.key === 'src') {
|
|
294
|
+
return (jsx_runtime_1.jsx("div", { style: {
|
|
295
|
+
...inlineSourceFieldRow,
|
|
296
|
+
...(propStatus.status === 'computed' ? computedSourceFieldRow : null),
|
|
297
|
+
...style,
|
|
298
|
+
}, children: fieldValue }));
|
|
299
|
+
}
|
|
348
300
|
const row = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), keyframeControls: keyframeControls, arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: style, selected: selection.selected, selectable: selection.selectable, selectionItem: selection.selectionItem, onSelect: selection.onSelect, onDoubleClick: onPropertyDoubleClick, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx(TimelineFieldRowContent_1.TimelineFieldRowContent, { field: field, rowDepth: rowDepth, selected: selection.selected, children: fieldValue }) }));
|
|
349
301
|
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: selection.selectable ? selection.onSelect : null, children: row }));
|
|
350
302
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CanUpdateSequencePropStatusKeyframed, OverrideIdToNodePaths, PropStatuses, SequencePropsSubscriptionKey, TSequence, InteractivitySchema } from 'remotion';
|
|
2
|
+
import type { CanUpdateSequencePropStatus, CanUpdateSequencePropStatusKeyframed, OverrideIdToNodePaths, PropStatuses, SequencePropsSubscriptionKey, TSequence, InteractivitySchema } from 'remotion';
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
4
|
import type { MoveEffectKeyframeChange, MoveSequenceKeyframeChange } from './call-move-keyframe';
|
|
5
5
|
import { type SaveSequencePropChange } from './save-sequence-prop';
|
|
@@ -42,6 +42,10 @@ type TimelineSequenceEffectKeyframeDragTarget = TimelineSequenceKeyframeDragTarg
|
|
|
42
42
|
export declare const isTransitionSeriesSequence: (sequence: TSequence) => boolean;
|
|
43
43
|
export declare const isCascadingSequence: (sequence: TSequence) => boolean;
|
|
44
44
|
export declare const isTimelineSequenceDurationDraggable: (sequence: TSequence) => boolean;
|
|
45
|
+
export declare const canResizeTimelineSequenceDuration: ({ sequence, status, }: {
|
|
46
|
+
readonly sequence: TSequence;
|
|
47
|
+
readonly status: CanUpdateSequencePropStatus | undefined;
|
|
48
|
+
}) => boolean;
|
|
45
49
|
export declare const isTimelineSequenceLeftEdgeDraggable: (sequence: TSequence) => boolean;
|
|
46
50
|
export declare const getTimelineSequenceDurationDragValue: ({ initialDuration, deltaFrames, minimumDuration, }: {
|
|
47
51
|
readonly initialDuration: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimelineSequenceRightEdgeDragHandle = exports.useTimelineSequenceFromDrag = exports.TimelineSequenceLeftEdgeDragHandle = exports.getTimelineSequenceFromDragTargets = exports.getTimelineSequenceLeftEdgeDragTargets = exports.getTimelineSequenceDurationDragTargets = exports.getTimelineSequenceFromDragKeyframeMoves = exports.getTimelineSequenceFromDragChanges = exports.getTimelineSequenceFromDragDelta = exports.getTimelineSequenceFromDragValue = exports.getTimelineSequenceDurationDragChanges = exports.getTimelineSequenceLeftEdgeDragChanges = exports.getTimelineSequenceLeftEdgeDragValues = exports.getTimelineSequenceLeftEdgeDragDelta = exports.getTimelineSequenceDurationDragValue = exports.isTimelineSequenceLeftEdgeDraggable = exports.isTimelineSequenceDurationDraggable = exports.isCascadingSequence = exports.isTransitionSeriesSequence = exports.timelineSequenceFromDragSnapThresholdPx = void 0;
|
|
3
|
+
exports.TimelineSequenceRightEdgeDragHandle = exports.useTimelineSequenceFromDrag = exports.TimelineSequenceLeftEdgeDragHandle = exports.getTimelineSequenceFromDragTargets = exports.getTimelineSequenceLeftEdgeDragTargets = exports.getTimelineSequenceDurationDragTargets = exports.getTimelineSequenceFromDragKeyframeMoves = exports.getTimelineSequenceFromDragChanges = exports.getTimelineSequenceFromDragDelta = exports.getTimelineSequenceFromDragValue = exports.getTimelineSequenceDurationDragChanges = exports.getTimelineSequenceLeftEdgeDragChanges = exports.getTimelineSequenceLeftEdgeDragValues = exports.getTimelineSequenceLeftEdgeDragDelta = exports.getTimelineSequenceDurationDragValue = exports.isTimelineSequenceLeftEdgeDraggable = exports.canResizeTimelineSequenceDuration = exports.isTimelineSequenceDurationDraggable = exports.isCascadingSequence = exports.isTransitionSeriesSequence = exports.timelineSequenceFromDragSnapThresholdPx = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -107,7 +107,6 @@ const getMinimumSequenceDuration = ({ sequence, sequences, }) => {
|
|
|
107
107
|
return 1;
|
|
108
108
|
}
|
|
109
109
|
const siblings = (0, sort_by_nonce_history_1.sortItemsByNonceHistory)(sequences.filter((candidate) => candidate.parent === sequence.parent &&
|
|
110
|
-
candidate.rootId === sequence.rootId &&
|
|
111
110
|
((0, exports.isTransitionSeriesSequence)(candidate) ||
|
|
112
111
|
isTransitionSeriesTransition(candidate))));
|
|
113
112
|
const sequenceIndex = siblings.findIndex((candidate) => candidate.id === sequence.id);
|
|
@@ -129,6 +128,16 @@ const isTimelineSequenceDurationDraggable = (sequence) => {
|
|
|
129
128
|
Boolean(sequence.controls));
|
|
130
129
|
};
|
|
131
130
|
exports.isTimelineSequenceDurationDraggable = isTimelineSequenceDurationDraggable;
|
|
131
|
+
const canResizeTimelineSequenceDuration = ({ sequence, status, }) => {
|
|
132
|
+
if ((status === null || status === void 0 ? void 0 : status.status) !== 'static') {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
if (sequence.type === 'audio' || sequence.type === 'video') {
|
|
136
|
+
return status.codeValue !== undefined;
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
};
|
|
140
|
+
exports.canResizeTimelineSequenceDuration = canResizeTimelineSequenceDuration;
|
|
132
141
|
const isTimelineSequenceLeftEdgeDraggable = (sequence) => {
|
|
133
142
|
return ((!sequence.isInsideSeries || (0, exports.isCascadingSequence)(sequence)) &&
|
|
134
143
|
Boolean(sequence.controls) &&
|
|
@@ -338,6 +347,7 @@ const findSequenceTrack = ({ tracks, nodePathInfo, }) => {
|
|
|
338
347
|
});
|
|
339
348
|
};
|
|
340
349
|
const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }) => {
|
|
350
|
+
var _a;
|
|
341
351
|
const draggedSelectionKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(draggedNodePathInfo);
|
|
342
352
|
const selectedSequenceItems = selectedItems.filter((item) => item.type === 'sequence');
|
|
343
353
|
const draggedItemIsSelected = selectedSequenceItems.some((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo) ===
|
|
@@ -363,7 +373,11 @@ const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedI
|
|
|
363
373
|
return null;
|
|
364
374
|
}
|
|
365
375
|
const nodePath = track.nodePathInfo.sequenceSubscriptionKey;
|
|
366
|
-
|
|
376
|
+
const durationStatus = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a.durationInFrames;
|
|
377
|
+
if (!(0, exports.canResizeTimelineSequenceDuration)({
|
|
378
|
+
sequence: originalSequence,
|
|
379
|
+
status: durationStatus,
|
|
380
|
+
})) {
|
|
367
381
|
return null;
|
|
368
382
|
}
|
|
369
383
|
const { controls } = originalSequence;
|
|
@@ -543,14 +557,14 @@ const TimelineSequenceLeftEdgeDragHandle = ({ nodePathInfo, windowWidth, timelin
|
|
|
543
557
|
};
|
|
544
558
|
const finishDrag = (0, react_1.useCallback)((commit) => {
|
|
545
559
|
const dragState = dragStateRef.current;
|
|
560
|
+
if (!dragState) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
546
563
|
dragStateRef.current = null;
|
|
547
564
|
document.body.style.userSelect = '';
|
|
548
565
|
document.body.style.webkitUserSelect = '';
|
|
549
566
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
550
567
|
setDragging(false);
|
|
551
|
-
if (!dragState) {
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
568
|
const { setPropStatuses: latestSetPropStatuses, clearDragOverrides: latestClear, previewServerState: latestServerState, } = latestRef.current;
|
|
555
569
|
const changes = (0, exports.getTimelineSequenceLeftEdgeDragChanges)({
|
|
556
570
|
targets: dragState.targets,
|
|
@@ -685,6 +699,7 @@ const TimelineSequenceLeftEdgeDragHandle = ({ nodePathInfo, windowWidth, timelin
|
|
|
685
699
|
window.removeEventListener('pointerup', onUp);
|
|
686
700
|
window.removeEventListener('pointercancel', onCancel);
|
|
687
701
|
window.removeEventListener('blur', onWindowBlur);
|
|
702
|
+
finishDrag(false);
|
|
688
703
|
};
|
|
689
704
|
}, [dragging, finishDrag]);
|
|
690
705
|
const style = {
|
|
@@ -729,13 +744,13 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
729
744
|
};
|
|
730
745
|
const finishDrag = (0, react_1.useCallback)((commit) => {
|
|
731
746
|
const dragState = dragStateRef.current;
|
|
747
|
+
if (!dragState) {
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
732
750
|
dragStateRef.current = null;
|
|
733
751
|
document.body.style.userSelect = '';
|
|
734
752
|
document.body.style.webkitUserSelect = '';
|
|
735
753
|
setDragging(false);
|
|
736
|
-
if (!dragState) {
|
|
737
|
-
return;
|
|
738
|
-
}
|
|
739
754
|
const { setPropStatuses: latestSetPropStatuses, clearDragOverrides: latestClear, clearEffectDragOverrides: latestClearEffect, previewServerState: latestServerState, } = latestRef.current;
|
|
740
755
|
const changes = (0, exports.getTimelineSequenceFromDragChanges)({
|
|
741
756
|
targets: dragState.targets,
|
|
@@ -897,6 +912,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
897
912
|
window.removeEventListener('pointerup', onUp);
|
|
898
913
|
window.removeEventListener('pointercancel', onCancel);
|
|
899
914
|
window.removeEventListener('blur', onWindowBlur);
|
|
915
|
+
finishDrag(false);
|
|
900
916
|
};
|
|
901
917
|
}, [dragging, finishDrag]);
|
|
902
918
|
return {
|
|
@@ -933,14 +949,14 @@ const TimelineSequenceRightEdgeDragHandle = ({ nodePathInfo, windowWidth, timeli
|
|
|
933
949
|
};
|
|
934
950
|
const finishDrag = (0, react_1.useCallback)((commit) => {
|
|
935
951
|
const dragState = dragStateRef.current;
|
|
952
|
+
if (!dragState) {
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
936
955
|
dragStateRef.current = null;
|
|
937
956
|
document.body.style.userSelect = '';
|
|
938
957
|
document.body.style.webkitUserSelect = '';
|
|
939
958
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
940
959
|
setDragging(false);
|
|
941
|
-
if (!dragState) {
|
|
942
|
-
return;
|
|
943
|
-
}
|
|
944
960
|
const { setPropStatuses: latestSetPropStatuses, clearDragOverrides: latestClear, previewServerState: latestServerState, } = latestRef.current;
|
|
945
961
|
const changes = (0, exports.getTimelineSequenceDurationDragChanges)({
|
|
946
962
|
targets: dragState.targets,
|
|
@@ -1069,6 +1085,7 @@ const TimelineSequenceRightEdgeDragHandle = ({ nodePathInfo, windowWidth, timeli
|
|
|
1069
1085
|
window.removeEventListener('pointerup', onUp);
|
|
1070
1086
|
window.removeEventListener('pointercancel', onCancel);
|
|
1071
1087
|
window.removeEventListener('blur', onWindowBlur);
|
|
1088
|
+
finishDrag(false);
|
|
1072
1089
|
};
|
|
1073
1090
|
}, [dragging, finishDrag]);
|
|
1074
1091
|
const style = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
3
|
export declare const TimelineTrack: React.NamedExoticComponent<{
|
|
4
|
-
readonly track:
|
|
4
|
+
readonly track: TimelineTrackData;
|
|
5
5
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
3
|
export declare const TimelineTracks: React.NamedExoticComponent<{
|
|
4
|
-
readonly timeline:
|
|
4
|
+
readonly timeline: TimelineTrackData[];
|
|
5
5
|
readonly hasBeenCut: boolean;
|
|
6
6
|
}>;
|
|
@@ -4,4 +4,4 @@ export declare const findTrackForNodePathInfo: ({ sequences, overrideIdsToNodePa
|
|
|
4
4
|
sequences: TSequence[];
|
|
5
5
|
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
6
6
|
nodePathInfo: SequenceNodePathInfo;
|
|
7
|
-
}) => import("../../helpers/get-timeline-sequence-sort-key").
|
|
7
|
+
}) => import("../../helpers/get-timeline-sequence-sort-key").TimelineTrackData | undefined;
|
|
@@ -145,18 +145,20 @@ const getSequenceContextMenuItems = ({ assetLinkInfo, canOpenInEditor, deleteDis
|
|
|
145
145
|
}
|
|
146
146
|
: null,
|
|
147
147
|
...sourceActions,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
148
|
+
includeSourceEditItems
|
|
149
|
+
? {
|
|
150
|
+
type: 'item',
|
|
151
|
+
id: 'disable-interactivity',
|
|
152
|
+
keyHint: null,
|
|
153
|
+
label: 'Disable interactivity',
|
|
154
|
+
leftItem: null,
|
|
155
|
+
disabled: disableInteractivityDisabled,
|
|
156
|
+
onClick: onDisableSequenceInteractivity,
|
|
157
|
+
quickSwitcherLabel: null,
|
|
158
|
+
subMenu: null,
|
|
159
|
+
value: 'disable-interactivity',
|
|
160
|
+
}
|
|
161
|
+
: null,
|
|
160
162
|
includeSourceEditItems
|
|
161
163
|
? {
|
|
162
164
|
type: 'item',
|
|
@@ -175,18 +175,26 @@ const resetSelectedTimelineProps = ({ selections, sequences, overrideIdsToNodePa
|
|
|
175
175
|
: 'Reapply sequence prop',
|
|
176
176
|
}));
|
|
177
177
|
}
|
|
178
|
-
|
|
179
|
-
resetPromises.push((0, save_effect_prop_1.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
178
|
+
if (effectPropTargets.length > 0) {
|
|
179
|
+
resetPromises.push((0, save_effect_prop_1.saveMultipleEffectProps)({
|
|
180
|
+
changes: effectPropTargets.map((target) => ({
|
|
181
|
+
type: 'value',
|
|
182
|
+
fileName: target.fileName,
|
|
183
|
+
nodePath: target.nodePath,
|
|
184
|
+
effectIndex: target.effectIndex,
|
|
185
|
+
fieldKey: target.fieldKey,
|
|
186
|
+
value: target.value,
|
|
187
|
+
defaultValue: target.defaultValue,
|
|
188
|
+
schema: target.schema,
|
|
189
|
+
})),
|
|
188
190
|
setPropStatuses,
|
|
189
191
|
clientId,
|
|
192
|
+
undoLabel: effectPropTargets.length > 1
|
|
193
|
+
? 'Reset selected effect props'
|
|
194
|
+
: 'Reset effect prop',
|
|
195
|
+
redoLabel: effectPropTargets.length > 1
|
|
196
|
+
? 'Reapply selected effect props'
|
|
197
|
+
: 'Reapply effect prop',
|
|
190
198
|
}));
|
|
191
199
|
}
|
|
192
200
|
return Promise.all(resetPromises).then(() => undefined);
|
|
@@ -20,5 +20,15 @@ type SaveEffectPropEffectParam = SaveEffectPropBase & {
|
|
|
20
20
|
effectParam: EffectClipboardParam;
|
|
21
21
|
};
|
|
22
22
|
type SaveEffectPropInput = SaveEffectPropValue | SaveEffectPropEffectParam;
|
|
23
|
+
type WithoutSaveContext<T> = T extends unknown ? Omit<T, 'setPropStatuses' | 'clientId'> : never;
|
|
24
|
+
type SaveMultipleEffectPropChange = WithoutSaveContext<SaveEffectPropInput>;
|
|
25
|
+
type SaveMultipleEffectPropsOptions = {
|
|
26
|
+
changes: SaveMultipleEffectPropChange[];
|
|
27
|
+
setPropStatuses: SetPropStatuses;
|
|
28
|
+
clientId: string;
|
|
29
|
+
undoLabel: string;
|
|
30
|
+
redoLabel: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const saveMultipleEffectProps: ({ changes, setPropStatuses, clientId, undoLabel, redoLabel, }: SaveMultipleEffectPropsOptions) => Promise<void>;
|
|
23
33
|
export declare const saveEffectProp: (input: SaveEffectPropInput) => Promise<void>;
|
|
24
34
|
export {};
|
|
@@ -1,10 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.saveEffectProp = void 0;
|
|
3
|
+
exports.saveEffectProp = exports.saveMultipleEffectProps = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const call_api_1 = require("../call-api");
|
|
6
6
|
const apply_effect_response_to_prop_statuses_1 = require("./apply-effect-response-to-prop-statuses");
|
|
7
7
|
const save_prop_queue_1 = require("./save-prop-queue");
|
|
8
|
+
const saveMultipleEffectProps = ({ changes, setPropStatuses, clientId, undoLabel, redoLabel, }) => {
|
|
9
|
+
if (changes.length === 0) {
|
|
10
|
+
return Promise.resolve();
|
|
11
|
+
}
|
|
12
|
+
for (const change of changes) {
|
|
13
|
+
if (change.type === 'effect-param') {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
setPropStatuses(change.nodePath, (prev) => (0, studio_shared_1.optimisticUpdateForEffectPropStatuses)({
|
|
17
|
+
previous: prev,
|
|
18
|
+
effectIndex: change.effectIndex,
|
|
19
|
+
fieldKey: change.fieldKey,
|
|
20
|
+
value: change.value,
|
|
21
|
+
schema: change.schema,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
return (0, call_api_1.callApi)('/api/save-multiple-effect-props', {
|
|
25
|
+
edits: changes.map((change) => change.type === 'effect-param'
|
|
26
|
+
? {
|
|
27
|
+
type: 'effect-param',
|
|
28
|
+
fileName: change.fileName,
|
|
29
|
+
sequenceNodePath: change.nodePath,
|
|
30
|
+
effectIndex: change.effectIndex,
|
|
31
|
+
key: change.fieldKey,
|
|
32
|
+
effectParam: change.effectParam,
|
|
33
|
+
defaultValue: change.defaultValue,
|
|
34
|
+
schema: change.schema,
|
|
35
|
+
}
|
|
36
|
+
: {
|
|
37
|
+
type: 'value',
|
|
38
|
+
fileName: change.fileName,
|
|
39
|
+
sequenceNodePath: change.nodePath,
|
|
40
|
+
effectIndex: change.effectIndex,
|
|
41
|
+
key: change.fieldKey,
|
|
42
|
+
value: JSON.stringify(change.value),
|
|
43
|
+
defaultValue: change.defaultValue,
|
|
44
|
+
schema: change.schema,
|
|
45
|
+
}),
|
|
46
|
+
clientId,
|
|
47
|
+
undoLabel,
|
|
48
|
+
redoLabel,
|
|
49
|
+
}).then((response) => {
|
|
50
|
+
for (const result of response.results) {
|
|
51
|
+
setPropStatuses(result.sequenceNodePath, (prev) => (0, apply_effect_response_to_prop_statuses_1.applyEffectResponseToPropStatuses)({
|
|
52
|
+
previous: prev,
|
|
53
|
+
response: result.status,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
exports.saveMultipleEffectProps = saveMultipleEffectProps;
|
|
8
59
|
const saveEffectProp = (input) => {
|
|
9
60
|
const { fileName, nodePath, effectIndex, fieldKey, defaultValue, schema, setPropStatuses, clientId, } = input;
|
|
10
61
|
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const shouldShowTrackInTimeline: (track:
|
|
1
|
+
import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
|
|
2
|
+
export declare const shouldShowTrackInTimeline: (track: TimelineTrackData, durationInFrames: number) => boolean;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.openTimelineAssetLink = exports.getTimelineAssetLinkInfo = exports.getTimelineAssetSrcFromSchema = exports.splitRemoteSourceForMiddleEllipsis = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
6
|
const url_state_1 = require("../../helpers/url-state");
|
|
6
7
|
const splitRemoteSourceForMiddleEllipsis = (src) => {
|
|
7
8
|
const protocolEnd = src.indexOf('://');
|
|
@@ -29,6 +30,21 @@ const getTimelineAssetSrcFromSchema = (controls) => {
|
|
|
29
30
|
};
|
|
30
31
|
exports.getTimelineAssetSrcFromSchema = getTimelineAssetSrcFromSchema;
|
|
31
32
|
const getTimelineAssetLinkInfo = (src) => {
|
|
33
|
+
if (src.startsWith(no_react_1.NoReactInternals.FILE_TOKEN)) {
|
|
34
|
+
const encodedAssetPath = src.slice(no_react_1.NoReactInternals.FILE_TOKEN.length);
|
|
35
|
+
let assetPath = encodedAssetPath;
|
|
36
|
+
try {
|
|
37
|
+
assetPath = encodedAssetPath.split('/').map(decodeURIComponent).join('/');
|
|
38
|
+
}
|
|
39
|
+
catch (_a) {
|
|
40
|
+
// Keep the encoded path if it contains an invalid escape sequence.
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
kind: 'local',
|
|
44
|
+
assetPath,
|
|
45
|
+
title: assetPath,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
32
48
|
const staticBase = typeof window === 'undefined' ? null : window.remotion_staticBase;
|
|
33
49
|
if (staticBase && src.startsWith(staticBase + '/')) {
|
|
34
50
|
const assetPath = src.slice(staticBase.length + 1);
|
|
@@ -45,7 +61,7 @@ const getTimelineAssetLinkInfo = (src) => {
|
|
|
45
61
|
const url = new URL(src.startsWith('//') ? 'https:' + src : src);
|
|
46
62
|
return { kind: 'remote', href: src, title: url.hostname };
|
|
47
63
|
}
|
|
48
|
-
catch (
|
|
64
|
+
catch (_b) {
|
|
49
65
|
return { kind: 'remote', href: src, title: src };
|
|
50
66
|
}
|
|
51
67
|
}
|