@remotion/studio 4.0.482 → 4.0.484
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/Canvas.js +19 -0
- package/dist/components/ColorPicker/ColorPicker.js +65 -3
- package/dist/components/ColorPicker/ColorPickerPopup.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPickerPopup.js +3 -2
- package/dist/components/InspectorPanel/EasingInspector.js +184 -10
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.d.ts +14 -0
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +146 -0
- package/dist/components/InspectorPanel/KeyframeInspector.d.ts +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +228 -5
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +17 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +93 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -58
- package/dist/components/InspectorPanel/common.d.ts +12 -0
- package/dist/components/InspectorPanel/common.js +78 -1
- package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +14 -0
- package/dist/components/InspectorPanel/easing-inspector-selection.js +18 -0
- package/dist/components/InspectorPanel/keyframe-easing-navigator-items.d.ts +24 -0
- package/dist/components/InspectorPanel/keyframe-easing-navigator-items.js +40 -0
- package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +8 -0
- package/dist/components/InspectorPanel/keyframe-inspector-frame.js +14 -0
- package/dist/components/InspectorPanel/styles.d.ts +1 -0
- package/dist/components/InspectorPanel/styles.js +9 -1
- package/dist/components/InspectorSequenceSection.js +47 -10
- package/dist/components/Preview.js +1 -1
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -0
- package/dist/components/SelectedOutlineOverlay.js +33 -12
- package/dist/components/SelectedOutlineUvControls.js +461 -2
- package/dist/components/Timeline/EasingEditorModal.js +48 -5
- package/dist/components/Timeline/Timeline.js +2 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +11 -1
- package/dist/components/Timeline/TimelineEffectItem.js +8 -5
- package/dist/components/Timeline/TimelineEffectPropItem.js +82 -1
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +2 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +37 -7
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +4 -0
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +12 -6
- package/dist/components/Timeline/TimelineKeyframedValue.js +1 -0
- package/dist/components/Timeline/TimelineRowChrome.js +6 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +7 -1
- package/dist/components/Timeline/TimelineSelection.js +19 -3
- package/dist/components/Timeline/TimelineSequence.js +20 -8
- package/dist/components/Timeline/TimelineSequenceItem.js +64 -28
- package/dist/components/Timeline/TimelineSequenceName.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceName.js +7 -6
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +1 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +80 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +40 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +308 -1
- package/dist/components/Timeline/TimelineSlider.js +17 -3
- package/dist/components/Timeline/TimelineTrack.js +2 -4
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +8 -2
- package/dist/components/Timeline/delete-selected-timeline-item.js +80 -1
- package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +18 -0
- package/dist/components/Timeline/get-animation-item-selection-for-frame.js +49 -0
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +15 -0
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +26 -0
- package/dist/components/Timeline/save-sequence-prop.js +2 -0
- package/dist/components/Timeline/should-subscribe-to-sequence-props.d.ts +4 -0
- package/dist/components/Timeline/should-subscribe-to-sequence-props.js +10 -0
- package/dist/components/Timeline/update-selected-easing.d.ts +1 -0
- package/dist/components/Timeline/update-selected-easing.js +4 -3
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +2 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +19 -13
- package/dist/components/element-drag-and-drop.d.ts +3 -0
- package/dist/components/element-drag-and-drop.js +30 -0
- package/dist/components/import-assets.d.ts +11 -0
- package/dist/components/import-assets.js +23 -1
- package/dist/components/selected-outline-uv.d.ts +71 -1
- package/dist/components/selected-outline-uv.js +332 -10
- package/dist/esm/{chunk-nkqfa5bw.js → chunk-9erwh79m.js} +11896 -9019
- package/dist/esm/internals.mjs +11896 -9019
- package/dist/esm/previewEntry.mjs +11923 -9046
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/timeline-layout.d.ts +3 -3
- package/dist/helpers/timeline-layout.js +3 -1
- package/dist/helpers/use-menu-structure.js +0 -14
- package/package.json +11 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTimelineRowContainsSelection = exports.useTimelineGuideSelection = exports.useTimelineEasingSelection = exports.useTimelineKeyframeSelection = exports.useTimelineRowSelection = exports.useTimelineFocusableItem = exports.useTimelineMarqueeSelectableItem = exports.useTimelineMarqueeSelection = exports.useCurrentTimelineSelectionStateAsRef = exports.TIMELINE_SCRUBBER_ATTR = exports.TIMELINE_MARQUEE_ITEM_ATTR = exports.useTimelineSelection = exports.TimelineSelectionProvider = exports.TimelineSelectableItemsProvider = exports.TimelineSelectAllKeybindings = exports.getTimelineSequenceSelectionKey = exports.getSelectableTimelineItems = exports.getSelectableTimelineSequenceSelections = exports.getTimelineSelectionKey = exports.getTimelineSelectionFromNodePathInfo = exports.TimelineSelectionOrderProvider = exports.getTimelineMarqueeSelection = exports.timelineMarqueeRectsIntersect = exports.getClampedTimelineMarqueePoint = exports.getNormalizedTimelineMarqueeRect = exports.getAvailableTimelineSelectionState = exports.getTimelineSelectionAfterInteraction = exports.EMPTY_TIMELINE_SELECTION_STATE = exports.shouldSelectTimelineRowOnPointerDown = exports.isTimelineSelectionModifierEvent = exports.TIMELINE_TICKS_BACKGROUND = exports.TIMELINE_BACKGROUND = exports.getTimelineSelectedTrackHighlightStyle = exports.getTimelineColor = exports.getTimelineSelectedLabelStyle = exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = exports.TIMELINE_SELECTED_LABEL_TEXT = exports.TIMELINE_SELECTED_LABEL_BACKGROUND = exports.TIMELINE_SELECTED_BACKGROUND = void 0;
|
|
3
|
+
exports.useTimelineRowHighlightBackground = exports.useTimelineRowContainsSelection = exports.useTimelineGuideSelection = exports.useTimelineEasingSelection = exports.useTimelineKeyframeSelection = exports.useTimelineRowSelection = exports.useTimelineFocusableItem = exports.useTimelineMarqueeSelectableItem = exports.useTimelineMarqueeSelection = exports.useCurrentTimelineSelectionStateAsRef = exports.TIMELINE_SCRUBBER_ATTR = exports.TIMELINE_MARQUEE_ITEM_ATTR = exports.useTimelineSelection = exports.TimelineSelectionProvider = exports.TimelineSelectableItemsProvider = exports.TimelineSelectAllKeybindings = exports.getTimelineSequenceSelectionKey = exports.getSelectableTimelineItems = exports.getSelectableTimelineSequenceSelections = exports.getTimelineSelectionKey = exports.getTimelineSelectionFromNodePathInfo = exports.TimelineSelectionOrderProvider = exports.getTimelineMarqueeSelection = exports.timelineMarqueeRectsIntersect = exports.getClampedTimelineMarqueePoint = exports.getNormalizedTimelineMarqueeRect = exports.getAvailableTimelineSelectionState = exports.getTimelineSelectionAfterInteraction = exports.EMPTY_TIMELINE_SELECTION_STATE = exports.shouldSelectTimelineRowOnPointerDown = exports.isTimelineSelectionModifierEvent = exports.TIMELINE_TICKS_BACKGROUND = exports.TIMELINE_BACKGROUND = exports.getTimelineRowHighlightBackground = exports.getTimelineSelectedTrackHighlightStyle = exports.getTimelineColor = exports.getTimelineSelectedLabelStyle = exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = exports.TIMELINE_SELECTED_LABEL_TEXT = exports.TIMELINE_SELECTED_LABEL_BACKGROUND = exports.TIMELINE_SELECTED_BACKGROUND = 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");
|
|
@@ -42,8 +42,8 @@ const getTimelineColor = (selected, subcategory) => {
|
|
|
42
42
|
: 'rgba(255, 255, 255, 0.8)';
|
|
43
43
|
};
|
|
44
44
|
exports.getTimelineColor = getTimelineColor;
|
|
45
|
-
const getTimelineSelectedTrackHighlightStyle = (timelineWidth) => ({
|
|
46
|
-
backgroundColor
|
|
45
|
+
const getTimelineSelectedTrackHighlightStyle = (timelineWidth, backgroundColor = exports.TIMELINE_SELECTED_BACKGROUND) => ({
|
|
46
|
+
backgroundColor,
|
|
47
47
|
bottom: 0,
|
|
48
48
|
left: -timeline_layout_1.TIMELINE_PADDING,
|
|
49
49
|
pointerEvents: 'none',
|
|
@@ -52,6 +52,12 @@ const getTimelineSelectedTrackHighlightStyle = (timelineWidth) => ({
|
|
|
52
52
|
width: timelineWidth,
|
|
53
53
|
});
|
|
54
54
|
exports.getTimelineSelectedTrackHighlightStyle = getTimelineSelectedTrackHighlightStyle;
|
|
55
|
+
const getTimelineRowHighlightBackground = ({ showSelectedBackground, selected, containsSelection, }) => {
|
|
56
|
+
return showSelectedBackground && (selected || containsSelection)
|
|
57
|
+
? exports.TIMELINE_SELECTED_BACKGROUND
|
|
58
|
+
: undefined;
|
|
59
|
+
};
|
|
60
|
+
exports.getTimelineRowHighlightBackground = getTimelineRowHighlightBackground;
|
|
55
61
|
exports.TIMELINE_BACKGROUND = '#0F1113';
|
|
56
62
|
exports.TIMELINE_TICKS_BACKGROUND = colors_1.BACKGROUND;
|
|
57
63
|
const isTimelineSelectionModifierEvent = ({ shiftKey, metaKey, ctrlKey, }) => {
|
|
@@ -1043,3 +1049,13 @@ const useTimelineRowContainsSelection = (nodePathInfo) => {
|
|
|
1043
1049
|
return containsSelection(nodePathInfo);
|
|
1044
1050
|
};
|
|
1045
1051
|
exports.useTimelineRowContainsSelection = useTimelineRowContainsSelection;
|
|
1052
|
+
const useTimelineRowHighlightBackground = (nodePathInfo) => {
|
|
1053
|
+
const { selected } = (0, exports.useTimelineRowSelection)(nodePathInfo);
|
|
1054
|
+
const containsSelection = (0, exports.useTimelineRowContainsSelection)(nodePathInfo);
|
|
1055
|
+
return (0, exports.getTimelineRowHighlightBackground)({
|
|
1056
|
+
showSelectedBackground: true,
|
|
1057
|
+
selected,
|
|
1058
|
+
containsSelection,
|
|
1059
|
+
});
|
|
1060
|
+
};
|
|
1061
|
+
exports.useTimelineRowHighlightBackground = useTimelineRowHighlightBackground;
|
|
@@ -154,10 +154,10 @@ const TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffs
|
|
|
154
154
|
// If a duration is 1, it is essentially a still and it should have width 0
|
|
155
155
|
// Some compositions may not be longer than their media duration,
|
|
156
156
|
// if that is the case, it needs to be asynchronously determined
|
|
157
|
-
var _a, _b;
|
|
158
|
-
var
|
|
157
|
+
var _a, _b, _c;
|
|
158
|
+
var _d, _e, _f, _g, _h, _j;
|
|
159
159
|
const video = remotion_1.Internals.useVideo();
|
|
160
|
-
const maxMediaDuration = (0, use_max_media_duration_1.useMaxMediaDuration)(s, (
|
|
160
|
+
const maxMediaDuration = (0, use_max_media_duration_1.useMaxMediaDuration)(s, (_d = video === null || video === void 0 ? void 0 : video.fps) !== null && _d !== void 0 ? _d : 30);
|
|
161
161
|
const effectiveMaxMediaDuration = s.loopDisplay ? null : maxMediaDuration;
|
|
162
162
|
const originalLocation = (0, use_resolved_stack_react_to_change_1.useResolveStackAndReactToChange)(s.getStack);
|
|
163
163
|
const validatedLocation = (0, react_1.useMemo)(() => {
|
|
@@ -174,7 +174,7 @@ const TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffs
|
|
|
174
174
|
};
|
|
175
175
|
}, [originalLocation]);
|
|
176
176
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
177
|
-
const nodePath = (
|
|
177
|
+
const nodePath = (_e = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.sequenceSubscriptionKey) !== null && _e !== void 0 ? _e : null;
|
|
178
178
|
const propStatusesForOverride = (0, react_1.useMemo)(() => {
|
|
179
179
|
return nodePath
|
|
180
180
|
? remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)
|
|
@@ -182,6 +182,7 @@ const TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffs
|
|
|
182
182
|
}, [propStatuses, nodePath]);
|
|
183
183
|
const durationCanUpdate = Boolean(((_a = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.durationInFrames) === null || _a === void 0 ? void 0 : _a.status) === 'static');
|
|
184
184
|
const fromCanUpdate = Boolean(((_b = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.from) === null || _b === void 0 ? void 0 : _b.status) === 'static');
|
|
185
|
+
const trimBeforeCanUpdate = Boolean(((_c = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.trimBefore) === null || _c === void 0 ? void 0 : _c.status) === 'static');
|
|
185
186
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
186
187
|
const previewConnected = previewServerState.type === 'connected';
|
|
187
188
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -291,7 +292,7 @@ const TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffs
|
|
|
291
292
|
sequenceFrameOffset,
|
|
292
293
|
setPropStatuses,
|
|
293
294
|
timelinePosition,
|
|
294
|
-
validatedSource: (
|
|
295
|
+
validatedSource: (_f = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) !== null && _f !== void 0 ? _f : null,
|
|
295
296
|
});
|
|
296
297
|
const contextMenuValues = (0, react_1.useMemo)(() => {
|
|
297
298
|
if (!previewConnected) {
|
|
@@ -312,7 +313,7 @@ const TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffs
|
|
|
312
313
|
originalLocation,
|
|
313
314
|
selectAsset,
|
|
314
315
|
sequence: s,
|
|
315
|
-
sourceActions: [freezeFrameMenuItem],
|
|
316
|
+
sourceActions: freezeFrameMenuItem ? [freezeFrameMenuItem] : [],
|
|
316
317
|
});
|
|
317
318
|
}, [
|
|
318
319
|
assetLinkInfo,
|
|
@@ -340,7 +341,7 @@ const TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffs
|
|
|
340
341
|
const { onPointerDown: onMoveDragPointerDown } = (0, TimelineSequenceRightEdgeDragHandle_1.useTimelineSequenceFromDrag)({
|
|
341
342
|
nodePathInfo,
|
|
342
343
|
windowWidth,
|
|
343
|
-
timelineDurationInFrames: (
|
|
344
|
+
timelineDurationInFrames: (_g = video === null || video === void 0 ? void 0 : video.durationInFrames) !== null && _g !== void 0 ? _g : 1,
|
|
344
345
|
});
|
|
345
346
|
if (!video) {
|
|
346
347
|
throw new TypeError('Expected video config');
|
|
@@ -391,10 +392,21 @@ const TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffs
|
|
|
391
392
|
nodePath !== null &&
|
|
392
393
|
validatedLocation !== null &&
|
|
393
394
|
durationCanUpdate;
|
|
395
|
+
const showLeftEdgeDragHandle = (s.type === 'sequence' ||
|
|
396
|
+
s.type === 'image' ||
|
|
397
|
+
s.type === 'audio' ||
|
|
398
|
+
s.type === 'video') &&
|
|
399
|
+
!s.isInsideSeries &&
|
|
400
|
+
nodePath !== null &&
|
|
401
|
+
validatedLocation !== null &&
|
|
402
|
+
Boolean(s.controls) &&
|
|
403
|
+
fromCanUpdate &&
|
|
404
|
+
durationCanUpdate &&
|
|
405
|
+
trimBeforeCanUpdate;
|
|
394
406
|
if (maxMediaDuration === null && !s.loopDisplay) {
|
|
395
407
|
return null;
|
|
396
408
|
}
|
|
397
|
-
const sequence = (jsx_runtime_1.jsxs(TimelineSequenceCurrentFrame, { s: s, displayDurationInFrames: displayDurationInFrames, premountWidth: premountWidth, postmountWidth: postmountWidth, style: style, nodePathInfo: nodePathInfo, sequenceFrameOffset: sequenceFrameOffset, fromCanUpdate: fromCanUpdate, frozenFrame: frozenFrame, onMoveDragPointerDown: onMoveDragPointerDown, children: [s.type === 'audio' ? (jsx_runtime_1.jsx(AudioWaveform_1.AudioWaveform, { src: s.src, height: timeline_layout_1.TIMELINE_LAYER_HEIGHT_AUDIO, doesVolumeChange: s.doesVolumeChange, visualizationWidth: width, startFrom: s.startMediaFrom, durationInFrames: s.duration, volume: s.volume, playbackRate: s.playbackRate, loopDisplay: s.loopDisplay })) : null, s.type === 'video' ? (jsx_runtime_1.jsx(TimelineVideoInfo_1.TimelineVideoInfo, { src: s.src, visualizationWidth: width, naturalWidth: naturalWidth, trimBefore: s.startMediaFrom, durationInFrames: s.duration, playbackRate: s.playbackRate, volume: s.volume, doesVolumeChange: s.doesVolumeChange, premountWidth: premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0, postmountWidth: postmountWidth !== null && postmountWidth !== void 0 ? postmountWidth : 0, loopDisplay: s.loopDisplay, frozenMediaFrame: s.frozenMediaFrame })) : null, s.type === 'image' ? (jsx_runtime_1.jsx(TimelineImageInfo_1.TimelineImageInfo, { src: s.src, visualizationWidth: width })) : null, s.loopDisplay === undefined ? null : (jsx_runtime_1.jsx(LoopedTimelineIndicators_1.LoopedTimelineIndicator, { loops: s.loopDisplay.numberOfTimes })), showRightEdgeDragHandle && nodePathInfo && validatedLocation ? (jsx_runtime_1.jsx(TimelineSequenceRightEdgeDragHandle_1.TimelineSequenceRightEdgeDragHandle, { nodePathInfo: nodePathInfo, windowWidth: windowWidth, timelineDurationInFrames: (
|
|
409
|
+
const sequence = (jsx_runtime_1.jsxs(TimelineSequenceCurrentFrame, { s: s, displayDurationInFrames: displayDurationInFrames, premountWidth: premountWidth, postmountWidth: postmountWidth, style: style, nodePathInfo: nodePathInfo, sequenceFrameOffset: sequenceFrameOffset, fromCanUpdate: fromCanUpdate, frozenFrame: frozenFrame, onMoveDragPointerDown: onMoveDragPointerDown, children: [s.type === 'audio' ? (jsx_runtime_1.jsx(AudioWaveform_1.AudioWaveform, { src: s.src, height: timeline_layout_1.TIMELINE_LAYER_HEIGHT_AUDIO, doesVolumeChange: s.doesVolumeChange, visualizationWidth: width, startFrom: s.startMediaFrom, durationInFrames: s.duration, volume: s.volume, playbackRate: s.playbackRate, loopDisplay: s.loopDisplay })) : null, s.type === 'video' ? (jsx_runtime_1.jsx(TimelineVideoInfo_1.TimelineVideoInfo, { src: s.src, visualizationWidth: width, naturalWidth: naturalWidth, trimBefore: s.startMediaFrom, durationInFrames: s.duration, playbackRate: s.playbackRate, volume: s.volume, doesVolumeChange: s.doesVolumeChange, premountWidth: premountWidth !== null && premountWidth !== void 0 ? premountWidth : 0, postmountWidth: postmountWidth !== null && postmountWidth !== void 0 ? postmountWidth : 0, loopDisplay: s.loopDisplay, frozenMediaFrame: s.frozenMediaFrame })) : null, s.type === 'image' ? (jsx_runtime_1.jsx(TimelineImageInfo_1.TimelineImageInfo, { src: s.src, visualizationWidth: width })) : null, s.loopDisplay === undefined ? null : (jsx_runtime_1.jsx(LoopedTimelineIndicators_1.LoopedTimelineIndicator, { loops: s.loopDisplay.numberOfTimes })), showLeftEdgeDragHandle && nodePathInfo && validatedLocation ? (jsx_runtime_1.jsx(TimelineSequenceRightEdgeDragHandle_1.TimelineSequenceLeftEdgeDragHandle, { nodePathInfo: nodePathInfo, windowWidth: windowWidth, timelineDurationInFrames: (_h = video.durationInFrames) !== null && _h !== void 0 ? _h : 1 })) : null, showRightEdgeDragHandle && nodePathInfo && validatedLocation ? (jsx_runtime_1.jsx(TimelineSequenceRightEdgeDragHandle_1.TimelineSequenceRightEdgeDragHandle, { nodePathInfo: nodePathInfo, windowWidth: windowWidth, timelineDurationInFrames: (_j = video.durationInFrames) !== null && _j !== void 0 ? _j : 1 })) : null] }));
|
|
398
410
|
return previewConnected ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: onContextMenuOpen, children: sequence })) : (sequence);
|
|
399
411
|
};
|
|
400
412
|
exports.TimelineSequence = react_1.default.memo(TimelineSequenceFn);
|
|
@@ -78,6 +78,19 @@ const effectDropHighlight = {
|
|
|
78
78
|
outlineOffset: -1,
|
|
79
79
|
};
|
|
80
80
|
const SEQUENCE_REORDER_MIME_TYPE = 'application/remotion-sequence-reorder';
|
|
81
|
+
const getSequenceNameSaveAction = ({ editedName, currentDisplayName, fallbackDisplayName, hasStaticNameProp, }) => {
|
|
82
|
+
if (!hasStaticNameProp &&
|
|
83
|
+
(editedName === '' || editedName === fallbackDisplayName)) {
|
|
84
|
+
return { type: 'noop' };
|
|
85
|
+
}
|
|
86
|
+
if (hasStaticNameProp && editedName === currentDisplayName) {
|
|
87
|
+
return { type: 'noop' };
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
type: 'save',
|
|
91
|
+
defaultValue: editedName === '' ? JSON.stringify('') : null,
|
|
92
|
+
};
|
|
93
|
+
};
|
|
81
94
|
let currentSequenceDrag = null;
|
|
82
95
|
const TimelineSequenceExpandArrow = ({ disabled, isExpanded, nodePathInfo, onToggleExpand, sequence }) => {
|
|
83
96
|
const { filteredTree } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
@@ -150,9 +163,9 @@ const getDestinationIndex = ({ fromIndex, insertionIndex, }) => {
|
|
|
150
163
|
return insertionIndex > fromIndex ? insertionIndex - 1 : insertionIndex;
|
|
151
164
|
};
|
|
152
165
|
const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDisplayOffset, sequenceFrameOffset, trackIndex, }) => {
|
|
153
|
-
var _a, _b, _c;
|
|
154
|
-
var
|
|
155
|
-
const nodePath = (
|
|
166
|
+
var _a, _b, _c, _d;
|
|
167
|
+
var _e, _f, _g, _h;
|
|
168
|
+
const nodePath = (_e = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.sequenceSubscriptionKey) !== null && _e !== void 0 ? _e : null;
|
|
156
169
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
157
170
|
const previewConnected = previewServerState.type === 'connected';
|
|
158
171
|
const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
|
|
@@ -190,7 +203,7 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
190
203
|
}, [originalLocation]);
|
|
191
204
|
const canDeleteFromSource = Boolean(nodePath && (validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source));
|
|
192
205
|
const nodePathKey = (0, react_1.useMemo)(() => nodePath ? remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath) : null, [nodePath]);
|
|
193
|
-
const parentId = (
|
|
206
|
+
const parentId = (_f = sequence.parent) !== null && _f !== void 0 ? _f : null;
|
|
194
207
|
const canReorderSequence = previewConnected &&
|
|
195
208
|
Boolean(nodePath && nodePathKey && (validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source)) &&
|
|
196
209
|
(nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.numberOfSequencesWithThisNodePath) === 1;
|
|
@@ -437,17 +450,6 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
437
450
|
}
|
|
438
451
|
toggleTrack(nodePathInfo);
|
|
439
452
|
}, [nodePathInfo, toggleTrack]);
|
|
440
|
-
const onShowInEditorDoubleClick = (0, react_1.useCallback)((e) => {
|
|
441
|
-
if (!canOpenInEditor) {
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
if ((0, TimelineSelection_1.isTimelineSelectionModifierEvent)(e)) {
|
|
445
|
-
e.stopPropagation();
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
e.stopPropagation();
|
|
449
|
-
openInEditor();
|
|
450
|
-
}, [canOpenInEditor, openInEditor]);
|
|
451
453
|
const propStatusesForOverride = (0, react_1.useMemo)(() => {
|
|
452
454
|
return nodePath
|
|
453
455
|
? remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)
|
|
@@ -464,14 +466,26 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
464
466
|
const effective = (propStatus !== null && propStatus !== void 0 ? propStatus : runtimeValue);
|
|
465
467
|
return effective !== null && effective !== void 0 ? effective : false;
|
|
466
468
|
}, [codeHiddenStatus, (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.currentRuntimeValueDotNotation]);
|
|
469
|
+
const fallbackDisplayName = (_g = (_b = sequence.controls) === null || _b === void 0 ? void 0 : _b.componentName) !== null && _g !== void 0 ? _g : '<Sequence>';
|
|
470
|
+
const staticNamePropValue = (codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status) === 'static' &&
|
|
471
|
+
typeof codeNameStatus.codeValue === 'string'
|
|
472
|
+
? codeNameStatus.codeValue
|
|
473
|
+
: null;
|
|
474
|
+
const hasStaticNameProp = staticNamePropValue !== null;
|
|
467
475
|
const displayName = (0, react_1.useMemo)(() => {
|
|
468
|
-
if (
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
476
|
+
if (staticNamePropValue !== null) {
|
|
477
|
+
return staticNamePropValue;
|
|
478
|
+
}
|
|
479
|
+
if ((codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status) === 'static') {
|
|
480
|
+
return fallbackDisplayName;
|
|
472
481
|
}
|
|
473
482
|
return sequence.displayName;
|
|
474
|
-
}, [
|
|
483
|
+
}, [
|
|
484
|
+
codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status,
|
|
485
|
+
fallbackDisplayName,
|
|
486
|
+
sequence.displayName,
|
|
487
|
+
staticNamePropValue,
|
|
488
|
+
]);
|
|
475
489
|
const onToggleVisibility = (0, react_1.useCallback)((type) => {
|
|
476
490
|
if (!sequence.controls ||
|
|
477
491
|
!nodePath ||
|
|
@@ -548,10 +562,22 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
548
562
|
codeNameStatus !== undefined &&
|
|
549
563
|
codeNameStatus !== null &&
|
|
550
564
|
codeNameStatus.status === 'static';
|
|
565
|
+
const onSequenceDoubleClick = (0, react_1.useCallback)((e) => {
|
|
566
|
+
if ((0, TimelineSelection_1.isTimelineSelectionModifierEvent)(e)) {
|
|
567
|
+
e.stopPropagation();
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
e.stopPropagation();
|
|
571
|
+
if (canRenameThisSequence) {
|
|
572
|
+
setIsRenaming(true);
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
openInEditor();
|
|
576
|
+
}, [canRenameThisSequence, openInEditor]);
|
|
551
577
|
const canRenameSelectedSequence = canRenameThisSequence &&
|
|
552
578
|
selected &&
|
|
553
579
|
selectedItems.length === 1 &&
|
|
554
|
-
((
|
|
580
|
+
((_c = selectedItems[0]) === null || _c === void 0 ? void 0 : _c.type) === 'sequence';
|
|
555
581
|
const onCancelRenaming = (0, react_1.useCallback)(() => {
|
|
556
582
|
setIsRenaming(false);
|
|
557
583
|
}, []);
|
|
@@ -564,7 +590,13 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
564
590
|
setIsRenaming(false);
|
|
565
591
|
return;
|
|
566
592
|
}
|
|
567
|
-
|
|
593
|
+
const action = getSequenceNameSaveAction({
|
|
594
|
+
editedName: name,
|
|
595
|
+
currentDisplayName: displayName,
|
|
596
|
+
fallbackDisplayName,
|
|
597
|
+
hasStaticNameProp,
|
|
598
|
+
});
|
|
599
|
+
if (action.type === 'noop') {
|
|
568
600
|
setIsRenaming(false);
|
|
569
601
|
return;
|
|
570
602
|
}
|
|
@@ -575,7 +607,7 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
575
607
|
nodePath,
|
|
576
608
|
fieldKey: 'name',
|
|
577
609
|
value: name,
|
|
578
|
-
defaultValue:
|
|
610
|
+
defaultValue: action.defaultValue,
|
|
579
611
|
schema: sequence.controls.schema,
|
|
580
612
|
},
|
|
581
613
|
],
|
|
@@ -589,6 +621,8 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
589
621
|
}, [
|
|
590
622
|
canRenameThisSequence,
|
|
591
623
|
displayName,
|
|
624
|
+
fallbackDisplayName,
|
|
625
|
+
hasStaticNameProp,
|
|
592
626
|
nodePath,
|
|
593
627
|
previewServerState,
|
|
594
628
|
sequence.controls,
|
|
@@ -639,7 +673,7 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
639
673
|
sequenceFrameOffset,
|
|
640
674
|
setPropStatuses,
|
|
641
675
|
timelinePosition,
|
|
642
|
-
validatedSource: (
|
|
676
|
+
validatedSource: (_h = validatedLocation === null || validatedLocation === void 0 ? void 0 : validatedLocation.source) !== null && _h !== void 0 ? _h : null,
|
|
643
677
|
});
|
|
644
678
|
const canAddEffect = (nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.supportsEffects) === true &&
|
|
645
679
|
previewServerState.type === 'connected' &&
|
|
@@ -718,7 +752,7 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
718
752
|
subMenu: null,
|
|
719
753
|
value: 'rename-sequence',
|
|
720
754
|
},
|
|
721
|
-
freezeFrameMenuItem,
|
|
755
|
+
...(freezeFrameMenuItem ? [freezeFrameMenuItem] : []),
|
|
722
756
|
],
|
|
723
757
|
});
|
|
724
758
|
}, [
|
|
@@ -746,7 +780,7 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
746
780
|
const canDropEffect = previewServerState.type === 'connected' &&
|
|
747
781
|
nodePath !== null &&
|
|
748
782
|
validatedLocation !== null &&
|
|
749
|
-
((
|
|
783
|
+
((_d = sequence.controls) === null || _d === void 0 ? void 0 : _d.supportsEffects) === true;
|
|
750
784
|
const sequenceReorderLineStyle = (0, react_1.useMemo)(() => {
|
|
751
785
|
if (!sequenceDropIndicator) {
|
|
752
786
|
return null;
|
|
@@ -801,8 +835,10 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
801
835
|
clientId: previewServerState.clientId,
|
|
802
836
|
});
|
|
803
837
|
}, [canDropEffect, nodePath, previewServerState, validatedLocation]);
|
|
804
|
-
const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewConnected, isExpanded: isExpanded, nodePathInfo: nodePathInfo, onToggleExpand: onToggleExpand, sequence: sequence })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {})), style: rowStyle, selected: selected, selectable: selectable, selectionItem: selectionItem, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick:
|
|
805
|
-
|
|
838
|
+
const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewConnected, isExpanded: isExpanded, nodePathInfo: nodePathInfo, onToggleExpand: onToggleExpand, sequence: sequence })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {})), style: rowStyle, selected: selected, selectable: selectable, selectionItem: selectionItem, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick: canRenameThisSequence || canOpenInEditor
|
|
839
|
+
? onSequenceDoubleClick
|
|
840
|
+
: undefined, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [
|
|
841
|
+
jsx_runtime_1.jsx(TimelineSequenceName_1.TimelineSequenceName, { displayName: displayName, fallbackDisplayName: fallbackDisplayName, selected: selected, containsSelection: containsSelection, editing: isRenaming, onCancelEditing: onCancelRenaming, onSaveName: onSaveName }), mediaSrc ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
806
842
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }),
|
|
807
843
|
" ",
|
|
808
844
|
jsx_runtime_1.jsx(TimelineMediaInfo_1.TimelineMediaInfo, { src: mediaSrc })
|
|
@@ -13,7 +13,7 @@ const getTruncatedDisplayName = (displayName) => {
|
|
|
13
13
|
}
|
|
14
14
|
return displayName;
|
|
15
15
|
};
|
|
16
|
-
const TimelineSequenceName = ({ displayName, selected, containsSelection, editing, onCancelEditing, onSaveName, }) => {
|
|
16
|
+
const TimelineSequenceName = ({ displayName, fallbackDisplayName, selected, containsSelection, editing, onCancelEditing, onSaveName, }) => {
|
|
17
17
|
const inputRef = (0, react_1.useRef)(null);
|
|
18
18
|
const [draftName, setDraftName] = (0, react_1.useState)(displayName);
|
|
19
19
|
const cancelNextBlurRef = (0, react_1.useRef)(false);
|
|
@@ -53,10 +53,11 @@ const TimelineSequenceName = ({ displayName, selected, containsSelection, editin
|
|
|
53
53
|
WebkitUserSelect: 'text',
|
|
54
54
|
};
|
|
55
55
|
}, [style]);
|
|
56
|
-
const
|
|
56
|
+
const editableDisplayName = displayName || fallbackDisplayName;
|
|
57
|
+
const text = getTruncatedDisplayName(editableDisplayName);
|
|
57
58
|
(0, react_1.useEffect)(() => {
|
|
58
59
|
if (!editing) {
|
|
59
|
-
setDraftName(
|
|
60
|
+
setDraftName(editableDisplayName);
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
63
|
const input = inputRef.current;
|
|
@@ -64,10 +65,10 @@ const TimelineSequenceName = ({ displayName, selected, containsSelection, editin
|
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
67
|
input.focus();
|
|
67
|
-
const basenameIndex =
|
|
68
|
-
const selectionEnd = basenameIndex > 0 ? basenameIndex :
|
|
68
|
+
const basenameIndex = editableDisplayName.lastIndexOf('.');
|
|
69
|
+
const selectionEnd = basenameIndex > 0 ? basenameIndex : editableDisplayName.length;
|
|
69
70
|
input.setSelectionRange(0, selectionEnd);
|
|
70
|
-
}, [
|
|
71
|
+
}, [editableDisplayName, editing]);
|
|
71
72
|
const save = (0, react_1.useCallback)(() => {
|
|
72
73
|
onSaveName(draftName).catch(() => undefined);
|
|
73
74
|
}, [draftName, onSaveName]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CanUpdateSequencePropStatusKeyframed,
|
|
2
|
+
import type { CanUpdateSequencePropStatusKeyframed, InteractivitySchema, SequencePropsSubscriptionKey } from 'remotion';
|
|
3
3
|
import type { CodePosition } from '../../error-overlay/react-overlay/utils/get-source-map';
|
|
4
4
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
5
5
|
import type { SchemaFieldInfo } from '../../helpers/timeline-layout';
|
|
@@ -9,6 +9,7 @@ const client_id_1 = require("../../helpers/client-id");
|
|
|
9
9
|
const modals_1 = require("../../state/modals");
|
|
10
10
|
const ContextMenu_1 = require("../ContextMenu");
|
|
11
11
|
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
12
|
+
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 timeline_field_row_layout_1 = require("./timeline-field-row-layout");
|
|
14
15
|
const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
|
|
@@ -19,6 +20,7 @@ const TimelineLayerEye_1 = require("./TimelineLayerEye");
|
|
|
19
20
|
const TimelineRowChrome_1 = require("./TimelineRowChrome");
|
|
20
21
|
const TimelineSchemaField_1 = require("./TimelineSchemaField");
|
|
21
22
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
23
|
+
const update_selected_easing_1 = require("./update-selected-easing");
|
|
22
24
|
const fieldRowBase = {};
|
|
23
25
|
const isKeyframedStatus = (status) => {
|
|
24
26
|
return status.status === 'keyframed';
|
|
@@ -162,6 +164,9 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
162
164
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
163
165
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
164
166
|
const selection = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
167
|
+
const { selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
168
|
+
const setFrame = remotion_1.Internals.useTimelineSetFrame();
|
|
169
|
+
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
165
170
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
166
171
|
const sourceFrame = timelinePosition - keyframeDisplayOffset;
|
|
167
172
|
const propStatusesForOverride = remotion_1.Internals.getPropStatusesCtx(visualModePropStatuses, nodePath);
|
|
@@ -303,10 +308,84 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
303
308
|
onReset,
|
|
304
309
|
previewServerState,
|
|
305
310
|
]);
|
|
311
|
+
const seekToDisplayFrame = (0, react_1.useCallback)((frame) => {
|
|
312
|
+
setFrame((current) => {
|
|
313
|
+
const next = { ...current, [videoConfig.id]: frame };
|
|
314
|
+
remotion_1.Internals.persistCurrentFrame(next);
|
|
315
|
+
return next;
|
|
316
|
+
});
|
|
317
|
+
}, [setFrame, videoConfig.id]);
|
|
318
|
+
const onPropertyDoubleClick = (0, react_1.useCallback)((event) => {
|
|
319
|
+
if (propStatus === null || propStatus.status === 'computed') {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const keyframeSelection = {
|
|
323
|
+
type: 'keyframe',
|
|
324
|
+
nodePathInfo,
|
|
325
|
+
frame: sourceFrame + keyframeDisplayOffset,
|
|
326
|
+
};
|
|
327
|
+
if (propStatus.status === 'static') {
|
|
328
|
+
if (!keyframable || previewServerState.type !== 'connected') {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const value = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
332
|
+
propStatus,
|
|
333
|
+
dragOverrideValue,
|
|
334
|
+
frame: sourceFrame,
|
|
335
|
+
defaultValue: field.fieldSchema.default,
|
|
336
|
+
shouldResortToDefaultValueIfUndefined: true,
|
|
337
|
+
});
|
|
338
|
+
event.stopPropagation();
|
|
339
|
+
(0, call_add_keyframe_1.callAddSequenceKeyframe)({
|
|
340
|
+
fileName: validatedLocation.source,
|
|
341
|
+
nodePath,
|
|
342
|
+
fieldKey: field.key,
|
|
343
|
+
sourceFrame,
|
|
344
|
+
value,
|
|
345
|
+
schema,
|
|
346
|
+
setPropStatuses,
|
|
347
|
+
clientId: previewServerState.clientId,
|
|
348
|
+
}).catch(() => undefined);
|
|
349
|
+
selectItems([keyframeSelection], { reveal: true });
|
|
350
|
+
seekToDisplayFrame(keyframeSelection.frame);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
const targetSelection = (0, get_animation_item_selection_for_frame_1.getAnimationItemSelectionForSourceFrame)({
|
|
354
|
+
includeEasings: (0, update_selected_easing_1.canEditEasingForInterpolationFunction)(propStatus.interpolationFunction),
|
|
355
|
+
keyframeDisplayOffset,
|
|
356
|
+
keyframes: propStatus.keyframes,
|
|
357
|
+
nodePathInfo,
|
|
358
|
+
sourceFrame,
|
|
359
|
+
});
|
|
360
|
+
if (targetSelection === null) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
event.stopPropagation();
|
|
364
|
+
selectItems([targetSelection], { reveal: true });
|
|
365
|
+
if (targetSelection.type === 'keyframe') {
|
|
366
|
+
seekToDisplayFrame(targetSelection.frame);
|
|
367
|
+
}
|
|
368
|
+
}, [
|
|
369
|
+
dragOverrideValue,
|
|
370
|
+
field.fieldSchema.default,
|
|
371
|
+
field.key,
|
|
372
|
+
keyframeDisplayOffset,
|
|
373
|
+
keyframable,
|
|
374
|
+
nodePath,
|
|
375
|
+
nodePathInfo,
|
|
376
|
+
previewServerState,
|
|
377
|
+
propStatus,
|
|
378
|
+
schema,
|
|
379
|
+
seekToDisplayFrame,
|
|
380
|
+
selectItems,
|
|
381
|
+
setPropStatuses,
|
|
382
|
+
sourceFrame,
|
|
383
|
+
validatedLocation.source,
|
|
384
|
+
]);
|
|
306
385
|
if (propStatus === null) {
|
|
307
386
|
return null;
|
|
308
387
|
}
|
|
309
|
-
const row = (jsx_runtime_1.jsxs(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, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: [
|
|
388
|
+
const row = (jsx_runtime_1.jsxs(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: [
|
|
310
389
|
jsx_runtime_1.jsx(TimelineFieldLabel_1.TimelineFieldLabel, { rowDepth: rowDepth, selected: selection.selected, label: (_b = field.description) !== null && _b !== void 0 ? _b : field.key }), isKeyframedStatus(propStatus) ? (jsx_runtime_1.jsx("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: 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("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: jsx_runtime_1.jsx(Value, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, schema: schema, propStatus: propStatus }) })) : (jsx_runtime_1.jsx("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineNonEditableStatus, { propStatus: propStatus }) }))] }));
|
|
311
390
|
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: selection.selectable ? selection.onSelect : null, children: row }));
|
|
312
391
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { OverrideIdToNodePaths, PropStatuses, SequencePropsSubscriptionKey, TSequence } from 'remotion';
|
|
2
|
+
import type { OverrideIdToNodePaths, PropStatuses, SequencePropsSubscriptionKey, TSequence, InteractivitySchema } from 'remotion';
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
4
|
import { type SaveSequencePropChange } from './save-sequence-prop';
|
|
5
5
|
import { type TimelineSelection } from './TimelineSelection';
|
|
@@ -8,6 +8,14 @@ export type TimelineSequenceDurationDragTarget = {
|
|
|
8
8
|
readonly initialDuration: number;
|
|
9
9
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
10
10
|
};
|
|
11
|
+
export type TimelineSequenceLeftEdgeDragTarget = {
|
|
12
|
+
readonly fileName: string;
|
|
13
|
+
readonly initialDuration: number;
|
|
14
|
+
readonly initialFrom: number;
|
|
15
|
+
readonly initialTrimBefore: number;
|
|
16
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
17
|
+
readonly schema: InteractivitySchema;
|
|
18
|
+
};
|
|
11
19
|
export type TimelineSequenceFromDragTarget = {
|
|
12
20
|
readonly fileName: string;
|
|
13
21
|
readonly initialFrom: number;
|
|
@@ -17,6 +25,25 @@ export declare const getTimelineSequenceDurationDragValue: ({ initialDuration, d
|
|
|
17
25
|
readonly initialDuration: number;
|
|
18
26
|
readonly deltaFrames: number;
|
|
19
27
|
}) => number;
|
|
28
|
+
export declare const getTimelineSequenceLeftEdgeDragDelta: ({ initialDuration, initialTrimBefore, deltaFrames, }: {
|
|
29
|
+
readonly initialDuration: number;
|
|
30
|
+
readonly initialTrimBefore: number;
|
|
31
|
+
readonly deltaFrames: number;
|
|
32
|
+
}) => number;
|
|
33
|
+
export declare const getTimelineSequenceLeftEdgeDragValues: ({ initialDuration, initialFrom, initialTrimBefore, deltaFrames, }: {
|
|
34
|
+
readonly initialDuration: number;
|
|
35
|
+
readonly initialFrom: number;
|
|
36
|
+
readonly initialTrimBefore: number;
|
|
37
|
+
readonly deltaFrames: number;
|
|
38
|
+
}) => {
|
|
39
|
+
durationInFrames: number;
|
|
40
|
+
from: number;
|
|
41
|
+
trimBefore: number;
|
|
42
|
+
};
|
|
43
|
+
export declare const getTimelineSequenceLeftEdgeDragChanges: ({ targets, deltaFrames, }: {
|
|
44
|
+
readonly targets: readonly TimelineSequenceLeftEdgeDragTarget[];
|
|
45
|
+
readonly deltaFrames: number;
|
|
46
|
+
}) => SaveSequencePropChange[];
|
|
20
47
|
export declare const getTimelineSequenceDurationDragChanges: ({ targets, deltaFrames, }: {
|
|
21
48
|
readonly targets: readonly TimelineSequenceDurationDragTarget[];
|
|
22
49
|
readonly deltaFrames: number;
|
|
@@ -36,6 +63,13 @@ export declare const getTimelineSequenceDurationDragTargets: ({ draggedNodePathI
|
|
|
36
63
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
37
64
|
readonly propStatuses: PropStatuses;
|
|
38
65
|
}) => TimelineSequenceDurationDragTarget[] | null;
|
|
66
|
+
export declare const getTimelineSequenceLeftEdgeDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
67
|
+
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
68
|
+
readonly selectedItems: readonly TimelineSelection[];
|
|
69
|
+
readonly sequences: TSequence[];
|
|
70
|
+
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
71
|
+
readonly propStatuses: PropStatuses;
|
|
72
|
+
}) => TimelineSequenceLeftEdgeDragTarget[] | null;
|
|
39
73
|
export declare const getTimelineSequenceFromDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
40
74
|
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
41
75
|
readonly selectedItems: readonly TimelineSelection[];
|
|
@@ -43,6 +77,11 @@ export declare const getTimelineSequenceFromDragTargets: ({ draggedNodePathInfo,
|
|
|
43
77
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
44
78
|
readonly propStatuses: PropStatuses;
|
|
45
79
|
}) => TimelineSequenceFromDragTarget[] | null;
|
|
80
|
+
export declare const TimelineSequenceLeftEdgeDragHandle: React.FC<{
|
|
81
|
+
readonly nodePathInfo: SequenceNodePathInfo;
|
|
82
|
+
readonly windowWidth: number;
|
|
83
|
+
readonly timelineDurationInFrames: number;
|
|
84
|
+
}>;
|
|
46
85
|
export declare const useTimelineSequenceFromDrag: ({ nodePathInfo, windowWidth, timelineDurationInFrames, }: {
|
|
47
86
|
readonly nodePathInfo: SequenceNodePathInfo | null;
|
|
48
87
|
readonly windowWidth: number;
|