@remotion/studio 4.0.512 → 4.0.514
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Studio.js +2 -1
- package/dist/components/AskAiModal.js +1 -1
- package/dist/components/AssetSelector.js +2 -0
- package/dist/components/AssetSelectorItem.js +1 -2
- package/dist/components/AudioWaveform.d.ts +3 -0
- package/dist/components/AudioWaveform.js +55 -67
- package/dist/components/Canvas.js +40 -5
- package/dist/components/CanvasOrLoading.js +5 -0
- package/dist/components/CompositionSelector.js +2 -0
- package/dist/components/CompositionSelectorItem.js +14 -1
- package/dist/components/ConfigureDefaultEditorModal.js +17 -11
- package/dist/components/Editor.js +16 -1
- package/dist/components/ElementInstallConfirmation.d.ts +1 -0
- package/dist/components/ElementInstallConfirmation.js +4 -2
- package/dist/components/FixComputedValueModal.d.ts +9 -0
- package/dist/components/FixComputedValueModal.js +217 -0
- package/dist/components/InitialCompositionLoader.js +19 -0
- package/dist/components/InlineDropdown.js +4 -4
- package/dist/components/InspectorInfoHeader.js +3 -3
- package/dist/components/InspectorOpenInEditor.js +26 -24
- package/dist/components/InspectorPanel/AlignmentControls.js +13 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +11 -1
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +12 -8
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +13 -2
- package/dist/components/InspectorPanel/EasingInspector.js +12 -3
- package/dist/components/InspectorPanel/KeyframeInspector.js +21 -7
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +1 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +35 -6
- package/dist/components/InspectorPanel/common.d.ts +5 -5
- package/dist/components/InspectorPanel/common.js +8 -8
- package/dist/components/InspectorPanel/easing-inspector-selection.js +7 -2
- package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +1 -0
- package/dist/components/InspectorPanel/styles.d.ts +1 -1
- package/dist/components/InspectorPanel/styles.js +4 -2
- package/dist/components/InspectorSourceLocation.d.ts +1 -1
- package/dist/components/InspectorSourceLocation.js +2 -2
- package/dist/components/LicenseKeyValidation.js +2 -2
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
- package/dist/components/NewComposition/CodemodFooter.js +10 -8
- package/dist/components/NewComposition/DeleteComposition.js +1 -1
- package/dist/components/NewComposition/DeleteFolder.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +7 -2
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/NewFolder.js +1 -1
- package/dist/components/NewComposition/RenameComposition.js +1 -1
- package/dist/components/NewComposition/RenameFolder.js +1 -1
- package/dist/components/NewComposition/duplicate-composition-api.d.ts +16 -0
- package/dist/components/NewComposition/duplicate-composition-api.js +16 -0
- package/dist/components/NoRegisterRoot.js +1 -1
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +4 -3
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
- package/dist/components/QuickSwitcher/fuzzy-search.js +1 -1
- package/dist/components/RefreshCompositionOverlay.js +1 -1
- package/dist/components/RenderButton.js +6 -3
- package/dist/components/RenderModal/WebRenderModal.js +6 -2
- package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +2 -0
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +9 -2
- package/dist/components/RenderModal/render-modals.js +5 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +5 -1
- package/dist/components/RenderQueue/actions.js +12 -2
- package/dist/components/RenderQueue/client-side-render-types.d.ts +1 -0
- package/dist/components/RenderingSettings.d.ts +2 -0
- package/dist/components/RenderingSettings.js +355 -0
- package/dist/components/SelectedOutlineElement.js +15 -13
- package/dist/components/SelectedOutlineOverlay.js +30 -8
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +53 -9
- package/dist/components/SettingsContext.d.ts +4 -1
- package/dist/components/SettingsContext.js +9 -2
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +10 -1
- package/dist/components/SettingsModalFooter.js +1 -1
- package/dist/components/StudioSettings.d.ts +2 -0
- package/dist/components/StudioSettings.js +185 -0
- package/dist/components/Timeline/LoopedIndicator.js +1 -1
- package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +3 -0
- package/dist/components/Timeline/LoopedTimelineIndicators.js +22 -14
- package/dist/components/Timeline/Timeline.js +11 -9
- package/dist/components/Timeline/TimelineArrayField.js +1 -0
- package/dist/components/Timeline/TimelineAssetField.d.ts +2 -2
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineDragHandler.js +62 -76
- package/dist/components/Timeline/TimelineEffectItem.js +1 -1
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +4 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +25 -14
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -1
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +0 -4
- package/dist/components/Timeline/TimelineHeightContainer.js +4 -4
- package/dist/components/Timeline/TimelineImageInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineImageInfo.js +3 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +31 -8
- package/dist/components/Timeline/TimelineKeyframedValue.js +1 -0
- package/dist/components/Timeline/TimelineList.d.ts +1 -5
- package/dist/components/Timeline/TimelineList.js +14 -9
- package/dist/components/Timeline/TimelinePinchZoom.js +5 -5
- package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -2
- package/dist/components/Timeline/TimelineRowChrome.js +12 -5
- package/dist/components/Timeline/TimelineSchemaField.d.ts +7 -3
- package/dist/components/Timeline/TimelineSchemaField.js +71 -13
- package/dist/components/Timeline/TimelineScrollable.js +3 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +5 -2
- package/dist/components/Timeline/TimelineSelection.js +90 -103
- package/dist/components/Timeline/TimelineSequence.js +59 -25
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +15 -9
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +2 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +14 -7
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +128 -27
- package/dist/components/Timeline/TimelineSlider.js +42 -33
- package/dist/components/Timeline/TimelineTimeIndicators.js +90 -98
- package/dist/components/Timeline/TimelineTracks.d.ts +0 -2
- package/dist/components/Timeline/TimelineTracks.js +11 -4
- package/dist/components/Timeline/TimelineTransformOriginField.js +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +4 -4
- package/dist/components/Timeline/TimelineVideoInfo.js +151 -61
- package/dist/components/Timeline/TimelineViewport.d.ts +12 -0
- package/dist/components/Timeline/TimelineViewport.js +62 -0
- package/dist/components/Timeline/TimelineVirtualization.d.ts +22 -0
- package/dist/components/Timeline/TimelineVirtualization.js +144 -0
- package/dist/components/Timeline/TimelineZoomControls.js +16 -8
- package/dist/components/Timeline/call-add-keyframe.js +31 -3
- package/dist/components/Timeline/call-delete-keyframe.js +13 -3
- package/dist/components/Timeline/call-move-keyframe.d.ts +2 -1
- package/dist/components/Timeline/call-move-keyframe.js +81 -18
- package/dist/components/Timeline/call-update-keyframe-settings.js +31 -3
- package/dist/components/Timeline/delete-selected-keyframe.d.ts +0 -8
- package/dist/components/Timeline/delete-selected-keyframe.js +23 -44
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +0 -8
- package/dist/components/Timeline/delete-selected-timeline-item.js +18 -44
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +8 -3
- package/dist/components/Timeline/get-sequence-context-menu-items.js +10 -8
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +5 -2
- package/dist/components/Timeline/get-timeline-keyframes.js +16 -10
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +30 -0
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +61 -0
- package/dist/components/Timeline/keyframe-clipboard.js +9 -2
- package/dist/components/Timeline/split-selected-timeline-item.js +2 -2
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +24 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +127 -4
- package/dist/components/Timeline/use-open-sequence-in-apps.js +8 -8
- package/dist/components/Timeline/use-timeline-height.d.ts +3 -5
- package/dist/components/Timeline/use-timeline-height.js +16 -18
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +14 -4
- package/dist/components/UpdateCheck.d.ts +2 -10
- package/dist/components/UpdateCheck.js +8 -2
- package/dist/components/VisualControls/ClickableFileName.js +13 -6
- package/dist/components/VisualControls/VisualControlHandle.js +8 -0
- package/dist/components/composition-menu-items.d.ts +6 -1
- package/dist/components/composition-menu-items.js +9 -6
- package/dist/components/delete-jsx-node-api.d.ts +2 -0
- package/dist/components/delete-jsx-node-api.js +12 -0
- package/dist/components/element-install-api.d.ts +3 -0
- package/dist/components/element-install-api.js +19 -0
- package/dist/components/folder-menu-items.d.ts +4 -1
- package/dist/components/folder-menu-items.js +4 -5
- package/dist/components/get-open-in-menu-items.d.ts +1 -1
- package/dist/components/get-open-in-menu-items.js +15 -13
- package/dist/components/import-assets.js +20 -9
- package/dist/components/reorder-sequence-api.d.ts +2 -0
- package/dist/components/reorder-sequence-api.js +12 -0
- package/dist/components/sequence-props-api.js +44 -3
- package/dist/components/split-jsx-sequence-api.d.ts +2 -0
- package/dist/components/split-jsx-sequence-api.js +12 -0
- package/dist/components/split-video-from-audio-api.d.ts +2 -0
- package/dist/components/split-video-from-audio-api.js +12 -0
- package/dist/components/use-default-editor-info.d.ts +8 -0
- package/dist/components/use-default-editor-info.js +25 -9
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +10 -3
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +3 -1
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +6 -6
- package/dist/error-overlay/remotion-overlay/Overlay.js +14 -12
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +2 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +7 -4
- package/dist/esm/{chunk-s8gwjng0.js → chunk-xn2q7eem.js} +11983 -8035
- package/dist/esm/index.mjs +7 -5
- package/dist/esm/internals.mjs +11983 -8035
- package/dist/esm/previewEntry.mjs +13059 -9107
- package/dist/esm/renderEntry.mjs +2 -3
- package/dist/helpers/browser-studio-operations.d.ts +2 -0
- package/dist/helpers/browser-studio-operations.js +10 -1
- package/dist/helpers/get-timeline-max-zoom.d.ts +26 -0
- package/dist/helpers/get-timeline-max-zoom.js +45 -0
- package/dist/helpers/inject-css.js +2 -2
- package/dist/helpers/open-in-editor.d.ts +6 -4
- package/dist/helpers/open-in-editor.js +4 -4
- package/dist/helpers/render-codec-label.d.ts +1 -1
- package/dist/helpers/retry-payload.js +1 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -1
- package/dist/helpers/studio-runtime-config.js +2 -3
- package/dist/helpers/timeline-layout.d.ts +3 -1
- package/dist/helpers/timeline-layout.js +6 -1
- package/dist/helpers/url-state.js +3 -2
- package/dist/helpers/use-menu-structure.js +12 -11
- package/dist/helpers/use-runtime-values.d.ts +2 -1
- package/dist/helpers/use-runtime-values.js +7 -3
- package/dist/icons/remotion-triangle.d.ts +2 -0
- package/dist/icons/remotion-triangle.js +7 -0
- package/dist/renderEntry.js +1 -1
- package/dist/state/composition-list.d.ts +13 -0
- package/dist/state/composition-list.js +21 -0
- package/dist/state/modals.d.ts +7 -1
- package/dist/state/timeline-zoom.d.ts +1 -2
- package/dist/state/timeline-zoom.js +9 -5
- package/package.json +14 -13
|
@@ -40,10 +40,10 @@ const react_1 = __importStar(require("react"));
|
|
|
40
40
|
const remotion_1 = require("remotion");
|
|
41
41
|
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
42
42
|
const pointer_session_1 = require("../../helpers/pointer-session");
|
|
43
|
-
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
44
43
|
const timeline_zoom_1 = require("../../state/timeline-zoom");
|
|
45
44
|
const z_index_1 = require("../../state/z-index");
|
|
46
45
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
46
|
+
const imperative_state_1 = require("./imperative-state");
|
|
47
47
|
const timeline_refs_1 = require("./timeline-refs");
|
|
48
48
|
const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
|
|
49
49
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
@@ -109,13 +109,7 @@ const TimelineDragHandlerInner = () => {
|
|
|
109
109
|
dragging: false,
|
|
110
110
|
});
|
|
111
111
|
const { isPlaying, play, pause, seek } = player_1.PlayerInternals.usePlayerMethods();
|
|
112
|
-
const
|
|
113
|
-
const stopInterval = () => {
|
|
114
|
-
if (scroller.current) {
|
|
115
|
-
clearInterval(scroller.current);
|
|
116
|
-
scroller.current = null;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
112
|
+
const autoScroller = (0, react_1.useRef)(null);
|
|
119
113
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
120
114
|
var _a, _b;
|
|
121
115
|
if (e.button !== 0) {
|
|
@@ -124,7 +118,6 @@ const TimelineDragHandlerInner = () => {
|
|
|
124
118
|
if (!isHighestContext) {
|
|
125
119
|
return;
|
|
126
120
|
}
|
|
127
|
-
stopInterval();
|
|
128
121
|
if (!videoConfig) {
|
|
129
122
|
return;
|
|
130
123
|
}
|
|
@@ -148,87 +141,66 @@ const TimelineDragHandlerInner = () => {
|
|
|
148
141
|
(_b = (_a = e.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, e.pointerId);
|
|
149
142
|
pause();
|
|
150
143
|
}, [isHighestContext, videoConfig, left, width, seek, isPlaying, pause]);
|
|
144
|
+
const onEdgeScrollTick = (0, react_1.useCallback)((directions) => {
|
|
145
|
+
var _a;
|
|
146
|
+
if (!videoConfig || directions.x === null) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const nextFrame = directions.x === 'left'
|
|
150
|
+
? (0, timeline_scroll_logic_1.getFrameWhileScrollingLeft)({
|
|
151
|
+
durationInFrames: videoConfig.durationInFrames,
|
|
152
|
+
width,
|
|
153
|
+
})
|
|
154
|
+
: (0, timeline_scroll_logic_1.getFrameWhileScrollingRight)({
|
|
155
|
+
durationInFrames: videoConfig.durationInFrames,
|
|
156
|
+
width,
|
|
157
|
+
});
|
|
158
|
+
const scrollPos = directions.x === 'left'
|
|
159
|
+
? (0, timeline_scroll_logic_1.getScrollPositionForCursorOnLeftEdge)({
|
|
160
|
+
nextFrame,
|
|
161
|
+
durationInFrames: videoConfig.durationInFrames,
|
|
162
|
+
})
|
|
163
|
+
: (0, timeline_scroll_logic_1.getScrollPositionForCursorOnRightEdge)({
|
|
164
|
+
nextFrame,
|
|
165
|
+
durationInFrames: videoConfig.durationInFrames,
|
|
166
|
+
});
|
|
167
|
+
// Update the imperative frame and apply the scroll before drawing, so
|
|
168
|
+
// every redraw (including the scroll event listener in TimelineSlider)
|
|
169
|
+
// sees a consistent (frame, scrollLeft) pair. Otherwise the playhead
|
|
170
|
+
// flickers between stale combinations while React commits the seek.
|
|
171
|
+
(0, imperative_state_1.setCurrentFrame)(nextFrame);
|
|
172
|
+
(0, timeline_scroll_logic_1.scrollToTimelineXOffset)(scrollPos);
|
|
173
|
+
(_a = TimelineSlider_1.redrawTimelineSliderFast.current) === null || _a === void 0 ? void 0 : _a.draw(nextFrame);
|
|
174
|
+
seek(nextFrame);
|
|
175
|
+
}, [videoConfig, width, seek]);
|
|
151
176
|
const onPointerMoveScrubbing = (0, react_1.useCallback)((e) => {
|
|
152
177
|
var _a;
|
|
178
|
+
var _b;
|
|
153
179
|
if (!videoConfig) {
|
|
154
180
|
return;
|
|
155
181
|
}
|
|
156
182
|
if (!dragging.dragging) {
|
|
157
183
|
return;
|
|
158
184
|
}
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
185
|
+
const directions = (_b = (_a = autoScroller.current) === null || _a === void 0 ? void 0 : _a.update(e)) !== null && _b !== void 0 ? _b : {
|
|
186
|
+
x: null,
|
|
187
|
+
y: null,
|
|
188
|
+
};
|
|
189
|
+
// While edge auto-scrolling is active, the tick owns seeking
|
|
190
|
+
if (directions.x !== null) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
164
193
|
const frame = (0, timeline_scroll_logic_1.getFrameFromX)({
|
|
165
194
|
clientX: getClientXWithScroll(e.clientX) - left,
|
|
166
195
|
durationInFrames: videoConfig.durationInFrames,
|
|
167
196
|
width,
|
|
168
197
|
extrapolate: 'clamp',
|
|
169
198
|
});
|
|
170
|
-
|
|
171
|
-
if (scroller.current) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
const scrollEvery = () => {
|
|
175
|
-
var _a;
|
|
176
|
-
if (!(0, timeline_scroll_logic_1.canScrollTimelineIntoDirection)().canScrollLeft) {
|
|
177
|
-
stopInterval();
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
const nextFrame = (0, timeline_scroll_logic_1.getFrameWhileScrollingLeft)({
|
|
181
|
-
durationInFrames: videoConfig.durationInFrames,
|
|
182
|
-
width,
|
|
183
|
-
});
|
|
184
|
-
const scrollPos = (0, timeline_scroll_logic_1.getScrollPositionForCursorOnLeftEdge)({
|
|
185
|
-
nextFrame,
|
|
186
|
-
durationInFrames: videoConfig.durationInFrames,
|
|
187
|
-
});
|
|
188
|
-
(_a = TimelineSlider_1.redrawTimelineSliderFast.current) === null || _a === void 0 ? void 0 : _a.draw(nextFrame);
|
|
189
|
-
seek(nextFrame);
|
|
190
|
-
(0, timeline_scroll_logic_1.scrollToTimelineXOffset)(scrollPos);
|
|
191
|
-
};
|
|
192
|
-
scrollEvery();
|
|
193
|
-
scroller.current = setInterval(() => {
|
|
194
|
-
scrollEvery();
|
|
195
|
-
}, 100);
|
|
196
|
-
}
|
|
197
|
-
else if (isRightOfArea &&
|
|
198
|
-
(0, timeline_scroll_logic_1.canScrollTimelineIntoDirection)().canScrollRight) {
|
|
199
|
-
if (scroller.current) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
const scrollEvery = () => {
|
|
203
|
-
var _a;
|
|
204
|
-
if (!(0, timeline_scroll_logic_1.canScrollTimelineIntoDirection)().canScrollRight) {
|
|
205
|
-
stopInterval();
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
const nextFrame = (0, timeline_scroll_logic_1.getFrameWhileScrollingRight)({
|
|
209
|
-
durationInFrames: videoConfig.durationInFrames,
|
|
210
|
-
width,
|
|
211
|
-
});
|
|
212
|
-
const scrollPos = (0, timeline_scroll_logic_1.getScrollPositionForCursorOnRightEdge)({
|
|
213
|
-
nextFrame,
|
|
214
|
-
durationInFrames: videoConfig.durationInFrames,
|
|
215
|
-
});
|
|
216
|
-
(_a = TimelineSlider_1.redrawTimelineSliderFast.current) === null || _a === void 0 ? void 0 : _a.draw(nextFrame);
|
|
217
|
-
seek(nextFrame);
|
|
218
|
-
(0, timeline_scroll_logic_1.scrollToTimelineXOffset)(scrollPos);
|
|
219
|
-
};
|
|
220
|
-
scrollEvery();
|
|
221
|
-
scroller.current = setInterval(() => {
|
|
222
|
-
scrollEvery();
|
|
223
|
-
}, 100);
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
stopInterval();
|
|
227
|
-
seek(frame);
|
|
228
|
-
}
|
|
199
|
+
seek(frame);
|
|
229
200
|
}, [videoConfig, dragging.dragging, left, width, seek]);
|
|
230
201
|
const onPointerUpScrubbing = (0, react_1.useCallback)((e) => {
|
|
231
|
-
|
|
202
|
+
var _a;
|
|
203
|
+
(_a = autoScroller.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
232
204
|
document.body.style.userSelect = '';
|
|
233
205
|
document.body.style.webkitUserSelect = '';
|
|
234
206
|
if (!videoConfig) {
|
|
@@ -259,7 +231,8 @@ const TimelineDragHandlerInner = () => {
|
|
|
259
231
|
}
|
|
260
232
|
}, [dragging, left, play, videoConfig, setFrame, width]);
|
|
261
233
|
const onPointerCancelScrubbing = (0, react_1.useCallback)(() => {
|
|
262
|
-
|
|
234
|
+
var _a;
|
|
235
|
+
(_a = autoScroller.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
263
236
|
document.body.style.userSelect = '';
|
|
264
237
|
document.body.style.webkitUserSelect = '';
|
|
265
238
|
if (!dragging.dragging) {
|
|
@@ -274,7 +247,12 @@ const TimelineDragHandlerInner = () => {
|
|
|
274
247
|
if (!dragging.dragging) {
|
|
275
248
|
return;
|
|
276
249
|
}
|
|
277
|
-
|
|
250
|
+
const scroller = (0, timeline_scroll_logic_1.startTimelineEdgeAutoScroll)({
|
|
251
|
+
includeVertical: false,
|
|
252
|
+
onTick: onEdgeScrollTick,
|
|
253
|
+
});
|
|
254
|
+
autoScroller.current = scroller;
|
|
255
|
+
const endSession = (0, pointer_session_1.startCapturedPointerSession)({
|
|
278
256
|
event: dragging,
|
|
279
257
|
captureTarget: dragging.target,
|
|
280
258
|
onMove: onPointerMoveScrubbing,
|
|
@@ -288,8 +266,16 @@ const TimelineDragHandlerInner = () => {
|
|
|
288
266
|
}
|
|
289
267
|
},
|
|
290
268
|
});
|
|
269
|
+
return () => {
|
|
270
|
+
scroller.stop();
|
|
271
|
+
if (autoScroller.current === scroller) {
|
|
272
|
+
autoScroller.current = null;
|
|
273
|
+
}
|
|
274
|
+
endSession();
|
|
275
|
+
};
|
|
291
276
|
}, [
|
|
292
277
|
dragging,
|
|
278
|
+
onEdgeScrollTick,
|
|
293
279
|
onPointerCancelScrubbing,
|
|
294
280
|
onPointerMoveScrubbing,
|
|
295
281
|
onPointerUpScrubbing,
|
|
@@ -321,7 +321,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
321
321
|
...(dropIndicator === 'before' ? { top: -1 } : { bottom: -1 }),
|
|
322
322
|
};
|
|
323
323
|
}, [dropIndicator]);
|
|
324
|
-
const row = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: canToggle ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: "effect", hidden: isDisabled, onInvoked: onToggle })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(nodePathInfo), label: `${label} section`, disabled: false }), style: rowStyle, selected: selection.selected, selectable: selection.selectable,
|
|
324
|
+
const row = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: canToggle ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: "effect", hidden: isDisabled, onInvoked: onToggle })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(nodePathInfo), label: `${label} section`, disabled: false }), style: rowStyle, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: containsSelection, isFieldRow: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { title: label, style: labelStyle, children: label }) }));
|
|
325
325
|
const draggableRow = canReorder ? (jsx_runtime_1.jsxs("div", { draggable: true, onDragStart: onDragStart, onDragEnd: onDragEnd, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop, style: reorderWrapper, children: [reorderLineStyle ? jsx_runtime_1.jsx("div", { style: reorderLineStyle }) : null, row] })) : (row);
|
|
326
326
|
return previewConnected ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: draggableRow })) : (draggableRow);
|
|
327
327
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SequencePropsSubscriptionKey } from 'remotion';
|
|
2
|
+
import type { RuntimeValueStore, 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 { EffectSchemaFieldInfo } from '../../helpers/timeline-layout';
|
|
@@ -9,6 +9,7 @@ export declare const TimelineEffectPropValue: React.FC<{
|
|
|
9
9
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
10
10
|
readonly validatedLocation: CodePosition;
|
|
11
11
|
readonly sourceFrame: number;
|
|
12
|
+
readonly runtimeValueStore: RuntimeValueStore | null;
|
|
12
13
|
}>;
|
|
13
14
|
export declare const TimelineEffectPropItem: React.FC<{
|
|
14
15
|
readonly field: EffectSchemaFieldInfo;
|
|
@@ -17,5 +18,6 @@ export declare const TimelineEffectPropItem: React.FC<{
|
|
|
17
18
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
18
19
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
19
20
|
readonly keyframeDisplayOffset: number;
|
|
20
|
-
readonly keyframeControlsMode
|
|
21
|
+
readonly keyframeControlsMode: TimelineKeyframeControlsMode;
|
|
22
|
+
readonly runtimeValueStore: RuntimeValueStore | null;
|
|
21
23
|
}>;
|
|
@@ -7,8 +7,10 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const client_id_1 = require("../../helpers/client-id");
|
|
9
9
|
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
10
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
10
11
|
const call_api_1 = require("../call-api");
|
|
11
12
|
const ContextMenu_1 = require("../ContextMenu");
|
|
13
|
+
const use_default_editor_info_1 = require("../use-default-editor-info");
|
|
12
14
|
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
13
15
|
const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
|
|
14
16
|
const save_effect_prop_1 = require("./save-effect-prop");
|
|
@@ -39,7 +41,11 @@ const isResettableStatus = ({ status, defaultValue, }) => {
|
|
|
39
41
|
const effectiveCodeValue = (_a = status.codeValue) !== null && _a !== void 0 ? _a : defaultValue;
|
|
40
42
|
return JSON.stringify(effectiveCodeValue) !== JSON.stringify(defaultValue);
|
|
41
43
|
};
|
|
42
|
-
const
|
|
44
|
+
const TimelineComputedEffectPropValue = ({ field, propStatus, runtimeValueStore, validatedLocation }) => {
|
|
45
|
+
const runtimeValue = (0, use_runtime_values_1.useRuntimeStoreValue)(runtimeValueStore, field.key);
|
|
46
|
+
return (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineNonEditableStatus, { propStatus: propStatus, field: field, runtimeValue: runtimeValue, validatedLocation: validatedLocation }));
|
|
47
|
+
};
|
|
48
|
+
const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFrame, runtimeValueStore }) => {
|
|
43
49
|
var _a;
|
|
44
50
|
var _b;
|
|
45
51
|
const { setEffectDragOverrides, clearEffectDragOverrides, setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -178,22 +184,22 @@ const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFra
|
|
|
178
184
|
}
|
|
179
185
|
if (effectStatus.type === 'cannot-update-effect') {
|
|
180
186
|
if (effectStatus.reason === 'computed') {
|
|
181
|
-
return (jsx_runtime_1.jsx(
|
|
187
|
+
return (jsx_runtime_1.jsx(TimelineComputedEffectPropValue, { propStatus: { status: 'computed' }, field: field, runtimeValueStore: runtimeValueStore, validatedLocation: validatedLocation }));
|
|
182
188
|
}
|
|
183
189
|
if (effectStatus.reason === 'not-call-expression') {
|
|
184
|
-
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not inline" });
|
|
190
|
+
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not inline", formattedValue: false });
|
|
185
191
|
}
|
|
186
192
|
if (effectStatus.reason === 'not-found') {
|
|
187
|
-
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not found in code" });
|
|
193
|
+
return (jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not found in code", formattedValue: false }));
|
|
188
194
|
}
|
|
189
195
|
throw new Error(`Unsupported effect status: ${effectStatus.reason}`);
|
|
190
196
|
}
|
|
191
197
|
if (effectStatus.type === 'cannot-update-sequence') {
|
|
192
198
|
if (effectStatus.reason === 'not-found') {
|
|
193
|
-
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not found in code" });
|
|
199
|
+
return (jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not found in code", formattedValue: false }));
|
|
194
200
|
}
|
|
195
201
|
if (effectStatus.reason === 'error') {
|
|
196
|
-
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "error" });
|
|
202
|
+
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "error", formattedValue: false });
|
|
197
203
|
}
|
|
198
204
|
throw new Error(`Unsupported effect status: ${effectStatus.reason}`);
|
|
199
205
|
}
|
|
@@ -204,7 +210,7 @@ const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFra
|
|
|
204
210
|
return (jsx_runtime_1.jsx(TimelineKeyframedValue_1.TimelineKeyframedValue, { field: field, propStatus: propStatus, sourceFrame: sourceFrame, dragOverrideValue: dragOverrideValue, onSave: onSaveKeyframed, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, scaleLockNodePath: nodePath }));
|
|
205
211
|
}
|
|
206
212
|
if (propStatus.status === 'computed') {
|
|
207
|
-
return (jsx_runtime_1.jsx(
|
|
213
|
+
return (jsx_runtime_1.jsx(TimelineComputedEffectPropValue, { propStatus: propStatus, field: field, runtimeValueStore: runtimeValueStore, validatedLocation: validatedLocation }));
|
|
208
214
|
}
|
|
209
215
|
const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
210
216
|
propStatus,
|
|
@@ -216,14 +222,15 @@ const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFra
|
|
|
216
222
|
return (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: propStatus, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, effectiveValue: effectiveValue, scaleLockNodePath: null }));
|
|
217
223
|
};
|
|
218
224
|
exports.TimelineEffectPropValue = TimelineEffectPropValue;
|
|
219
|
-
const TimelineEffectPropValueAtCurrentFrame = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) => {
|
|
225
|
+
const TimelineEffectPropValueAtCurrentFrame = ({ field, nodePath, validatedLocation, keyframeDisplayOffset, runtimeValueStore, }) => {
|
|
220
226
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
221
|
-
return (jsx_runtime_1.jsx(exports.TimelineEffectPropValue, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, sourceFrame: timelinePosition - keyframeDisplayOffset }));
|
|
227
|
+
return (jsx_runtime_1.jsx(exports.TimelineEffectPropValue, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, sourceFrame: timelinePosition - keyframeDisplayOffset, runtimeValueStore: runtimeValueStore }));
|
|
222
228
|
};
|
|
223
|
-
const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath, nodePathInfo, keyframeDisplayOffset, keyframeControlsMode
|
|
229
|
+
const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath, nodePathInfo, keyframeDisplayOffset, keyframeControlsMode, runtimeValueStore, }) => {
|
|
224
230
|
var _a;
|
|
225
231
|
var _b;
|
|
226
232
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
233
|
+
const { canOpenInEditor, defaultEditorId } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
|
|
227
234
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
228
235
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
229
236
|
const { getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
@@ -241,6 +248,10 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
|
|
|
241
248
|
const propStatus = effectStatus.type === 'can-update-effect'
|
|
242
249
|
? ((_b = (_a = effectStatus.props) === null || _a === void 0 ? void 0 : _a[field.key]) !== null && _b !== void 0 ? _b : null)
|
|
243
250
|
: null;
|
|
251
|
+
const resolvedKeyframeDisplayOffset = (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
252
|
+
propStatus,
|
|
253
|
+
keyframeDisplayOffset,
|
|
254
|
+
});
|
|
244
255
|
const dragOverrideValue = (0, react_1.useMemo)(() => {
|
|
245
256
|
const overrides = getEffectDragOverrides(nodePath, field.effectIndex);
|
|
246
257
|
return overrides[field.key];
|
|
@@ -323,17 +334,17 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
|
|
|
323
334
|
];
|
|
324
335
|
}, [canShowReset, onReset, selection]);
|
|
325
336
|
const onPropertyDoubleClick = (0, react_1.useCallback)((event) => {
|
|
326
|
-
if (!
|
|
327
|
-
previewServerState.type !== 'connected') {
|
|
337
|
+
if (!canOpenInEditor || !defaultEditorId) {
|
|
328
338
|
return;
|
|
329
339
|
}
|
|
330
340
|
event.stopPropagation();
|
|
331
341
|
(0, open_in_editor_1.openOriginalPositionInEditorAtProperty)({
|
|
342
|
+
editorId: defaultEditorId,
|
|
332
343
|
originalPosition: validatedLocation,
|
|
333
344
|
property: field.key,
|
|
334
345
|
}).catch(() => undefined);
|
|
335
|
-
}, [field.key,
|
|
336
|
-
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,
|
|
346
|
+
}, [canOpenInEditor, defaultEditorId, field.key, validatedLocation]);
|
|
347
|
+
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, onSelect: selection.onSelect, onDoubleClick: onPropertyDoubleClick, showSelectedBackground: true, containsSelection: false, isFieldRow: true, outerHeight: null, children: jsx_runtime_1.jsx(TimelineFieldRowContent_1.TimelineFieldRowContent, { field: field, rowDepth: rowDepth, selected: selection.selected, keyframeControls: keyframeControls, children: jsx_runtime_1.jsx(TimelineEffectPropValueAtCurrentFrame, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, keyframeDisplayOffset: resolvedKeyframeDisplayOffset, runtimeValueStore: runtimeValueStore }) }) }));
|
|
337
348
|
return jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: row });
|
|
338
349
|
};
|
|
339
350
|
exports.TimelineEffectPropItem = TimelineEffectPropItem;
|
|
@@ -16,7 +16,7 @@ type TimelineExpandedRowProps = {
|
|
|
16
16
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
17
17
|
readonly schema: InteractivitySchema;
|
|
18
18
|
readonly keyframeDisplayOffset: number;
|
|
19
|
-
readonly keyframeControlsMode
|
|
19
|
+
readonly keyframeControlsMode: TimelineKeyframeControlsMode;
|
|
20
20
|
};
|
|
21
21
|
export declare const TimelineExpandedRow: React.NamedExoticComponent<TimelineExpandedRowProps>;
|
|
22
22
|
export {};
|
|
@@ -45,19 +45,19 @@ const TimelineExpandedRowInner = ({ node, depth, nestedDepth, rowDepthBase, getI
|
|
|
45
45
|
const isExpanded = getIsExpanded(node.nodePathInfo);
|
|
46
46
|
return (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(node.nodePathInfo), label: `${node.label} section`, disabled: false }), style: {
|
|
47
47
|
height: timeline_layout_1.TREE_GROUP_ROW_HEIGHT,
|
|
48
|
-
}, selected: selection.selected, selectable: selection.selectable,
|
|
48
|
+
}, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, isFieldRow: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { style: labelStyle, children: node.label }) }));
|
|
49
49
|
}
|
|
50
50
|
if (node.field) {
|
|
51
51
|
if (node.field.kind === 'effect-field') {
|
|
52
|
-
return (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropItem, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath, nodePathInfo: node.nodePathInfo, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: keyframeControlsMode }));
|
|
52
|
+
return (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropItem, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath, nodePathInfo: node.nodePathInfo, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: keyframeControlsMode, runtimeValueStore: node.runtimeValueStore }));
|
|
53
53
|
}
|
|
54
54
|
if (node.field.kind === 'sequence-field') {
|
|
55
|
-
return (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequencePropItem, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath, nodePathInfo: node.nodePathInfo, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: keyframeControlsMode }));
|
|
55
|
+
return (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequencePropItem, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath, nodePathInfo: node.nodePathInfo, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: keyframeControlsMode, runtimeValue: node.runtimeValue }));
|
|
56
56
|
}
|
|
57
57
|
throw new Error('Unexpected field kind: ' + JSON.stringify(node.field));
|
|
58
58
|
}
|
|
59
59
|
return (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: {
|
|
60
60
|
height: (0, timeline_layout_1.getTreeRowHeight)(node),
|
|
61
|
-
}, selected: selection.selected, selectable: selection.selectable,
|
|
61
|
+
}, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, isFieldRow: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { style: labelStyle, children: node.label }) }));
|
|
62
62
|
};
|
|
63
63
|
exports.TimelineExpandedRow = react_1.default.memo(TimelineExpandedRowInner);
|
|
@@ -76,7 +76,7 @@ const TimelineExpandedSection = ({ sequence, validatedLocation, nodePathInfo, ne
|
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
78
|
return (jsx_runtime_1.jsx("div", { style: style, children: flat.map(({ node, depth }, i) => {
|
|
79
|
-
return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i > 0 ? jsx_runtime_1.jsx("div", { style: separator }) : null, jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: nestedDepth, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset })
|
|
79
|
+
return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i > 0 ? jsx_runtime_1.jsx("div", { style: separator }) : null, jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: nestedDepth, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "timeline" })
|
|
80
80
|
] }, JSON.stringify(node.nodePathInfo)));
|
|
81
81
|
}) }));
|
|
82
82
|
};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
2
|
export declare const TimelineHeightContainer: React.NamedExoticComponent<{
|
|
4
|
-
readonly shown: TimelineTrackData[];
|
|
5
|
-
readonly hasBeenCut: boolean;
|
|
6
|
-
readonly isStill: boolean;
|
|
7
3
|
readonly children: React.ReactNode;
|
|
8
4
|
}>;
|
|
@@ -37,7 +37,7 @@ exports.TimelineHeightContainer = void 0;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
40
|
-
const
|
|
40
|
+
const TimelineVirtualization_1 = require("./TimelineVirtualization");
|
|
41
41
|
const baseStyle = {
|
|
42
42
|
display: 'flex',
|
|
43
43
|
flex: 1,
|
|
@@ -45,9 +45,9 @@ const baseStyle = {
|
|
|
45
45
|
overflowX: 'hidden',
|
|
46
46
|
backgroundColor: TimelineSelection_1.TIMELINE_BACKGROUND,
|
|
47
47
|
};
|
|
48
|
-
const TimelineHeightContainerInner = ({
|
|
49
|
-
const
|
|
50
|
-
const style = (0, react_1.useMemo)(() => ({ ...baseStyle, height }), [
|
|
48
|
+
const TimelineHeightContainerInner = ({ children }) => {
|
|
49
|
+
const { totalSize } = (0, TimelineVirtualization_1.useTimelineVirtualization)();
|
|
50
|
+
const style = (0, react_1.useMemo)(() => ({ ...baseStyle, height: totalSize }), [totalSize]);
|
|
51
51
|
return jsx_runtime_1.jsx("div", { style: style, children: children });
|
|
52
52
|
};
|
|
53
53
|
exports.TimelineHeightContainer = react_1.default.memo(TimelineHeightContainerInner);
|
|
@@ -15,7 +15,7 @@ const containerStyle = {
|
|
|
15
15
|
borderTopLeftRadius: 2,
|
|
16
16
|
borderBottomLeftRadius: 2,
|
|
17
17
|
};
|
|
18
|
-
const TimelineImageInfo = ({ src, visualizationWidth }) => {
|
|
18
|
+
const TimelineImageInfo = ({ src, visualizationWidth, offsetInPixels }) => {
|
|
19
19
|
const ref = (0, react_1.useRef)(null);
|
|
20
20
|
(0, react_1.useEffect)(() => {
|
|
21
21
|
const { current } = ref;
|
|
@@ -38,13 +38,14 @@ const TimelineImageInfo = ({ src, visualizationWidth }) => {
|
|
|
38
38
|
(0, timeline_utils_1.drawRepeatingImageThumbnail)({
|
|
39
39
|
canvas,
|
|
40
40
|
image: img,
|
|
41
|
+
offsetInPixels: offsetInPixels * window.devicePixelRatio,
|
|
41
42
|
});
|
|
42
43
|
};
|
|
43
44
|
img.src = src;
|
|
44
45
|
return () => {
|
|
45
46
|
current.removeChild(canvas);
|
|
46
47
|
};
|
|
47
|
-
}, [src, visualizationWidth]);
|
|
48
|
+
}, [offsetInPixels, src, visualizationWidth]);
|
|
48
49
|
return jsx_runtime_1.jsx("div", { ref: ref, style: containerStyle });
|
|
49
50
|
};
|
|
50
51
|
exports.TimelineImageInfo = TimelineImageInfo;
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
8
9
|
const client_id_1 = require("../../helpers/client-id");
|
|
9
10
|
const colors_1 = require("../../helpers/colors");
|
|
10
11
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
@@ -150,8 +151,15 @@ const resolveKeyframeControlTarget = ({ nodePathInfo, tracks, propStatuses, getD
|
|
|
150
151
|
propStatus: sequenceSelectedPropStatus,
|
|
151
152
|
nodePath,
|
|
152
153
|
fileName: nodePath.absolutePath,
|
|
153
|
-
keyframeDisplayOffset:
|
|
154
|
-
|
|
154
|
+
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
155
|
+
propStatus: sequenceSelectedPropStatus,
|
|
156
|
+
keyframeDisplayOffset: track.keyframeDisplayOffset,
|
|
157
|
+
}),
|
|
158
|
+
sourceFrame: timelinePosition -
|
|
159
|
+
(0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
160
|
+
propStatus: sequenceSelectedPropStatus,
|
|
161
|
+
keyframeDisplayOffset: track.keyframeDisplayOffset,
|
|
162
|
+
}),
|
|
155
163
|
defaultValue: fieldNode.field.fieldSchema.default,
|
|
156
164
|
dragOverrideValue: ((_c = getDragOverrides(nodePath)) !== null && _c !== void 0 ? _c : {})[fieldNode.field.key],
|
|
157
165
|
schema: track.sequence.controls.schema,
|
|
@@ -175,8 +183,15 @@ const resolveKeyframeControlTarget = ({ nodePathInfo, tracks, propStatuses, getD
|
|
|
175
183
|
propStatus: effectSelectedPropStatus,
|
|
176
184
|
nodePath,
|
|
177
185
|
fileName: nodePath.absolutePath,
|
|
178
|
-
keyframeDisplayOffset:
|
|
179
|
-
|
|
186
|
+
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
187
|
+
propStatus: effectSelectedPropStatus,
|
|
188
|
+
keyframeDisplayOffset: track.keyframeDisplayOffset,
|
|
189
|
+
}),
|
|
190
|
+
sourceFrame: timelinePosition -
|
|
191
|
+
(0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
192
|
+
propStatus: effectSelectedPropStatus,
|
|
193
|
+
keyframeDisplayOffset: track.keyframeDisplayOffset,
|
|
194
|
+
}),
|
|
180
195
|
defaultValue: fieldNode.field.fieldSchema.default,
|
|
181
196
|
dragOverrideValue: getEffectDragOverrides(nodePath, fieldNode.field.effectIndex)[fieldNode.field.key],
|
|
182
197
|
schema: fieldNode.field.effectSchema,
|
|
@@ -278,6 +293,9 @@ const shouldShowTimelineKeyframeControls = ({ propStatus, selected, keyframable,
|
|
|
278
293
|
};
|
|
279
294
|
exports.shouldShowTimelineKeyframeControls = shouldShowTimelineKeyframeControls;
|
|
280
295
|
const shouldShowTimelineKeyframeNavigation = ({ propStatus, selected, }) => {
|
|
296
|
+
if (propStatus.status === 'computed') {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
281
299
|
if (selected) {
|
|
282
300
|
return true;
|
|
283
301
|
}
|
|
@@ -297,7 +315,11 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
|
|
|
297
315
|
const clientId = previewServerState.type === 'connected'
|
|
298
316
|
? previewServerState.clientId
|
|
299
317
|
: null;
|
|
300
|
-
const
|
|
318
|
+
const resolvedKeyframeDisplayOffset = (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
319
|
+
propStatus,
|
|
320
|
+
keyframeDisplayOffset,
|
|
321
|
+
});
|
|
322
|
+
const jsxFrame = timelinePosition - resolvedKeyframeDisplayOffset;
|
|
301
323
|
const keyframes = (0, react_1.useMemo)(() => (0, get_timeline_keyframes_1.getTimelineKeyframes)(propStatus, keyframeDisplayOffset), [propStatus, keyframeDisplayOffset]);
|
|
302
324
|
const hasKeyframeAtCurrentFrame = (0, react_1.useMemo)(() => {
|
|
303
325
|
if (!isKeyframedStatus(propStatus)) {
|
|
@@ -324,7 +346,8 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
|
|
|
324
346
|
key: fieldKey,
|
|
325
347
|
});
|
|
326
348
|
const canAddKeyframe = keyframable;
|
|
327
|
-
const canToggleKeyframe =
|
|
349
|
+
const canToggleKeyframe = (0, browser_studio_operations_1.canUseKeyframeOperations)() &&
|
|
350
|
+
propStatus.status !== 'computed' &&
|
|
328
351
|
(hasKeyframeAtCurrentFrame || canAddKeyframe);
|
|
329
352
|
const selectedNodePathInfos = (0, react_1.useMemo)(() => (0, exports.getSelectedKeyframeControlNodePathInfos)({
|
|
330
353
|
clickedNodePathInfo: nodePathInfo,
|
|
@@ -336,7 +359,7 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
|
|
|
336
359
|
propStatus,
|
|
337
360
|
nodePath,
|
|
338
361
|
fileName,
|
|
339
|
-
keyframeDisplayOffset,
|
|
362
|
+
keyframeDisplayOffset: resolvedKeyframeDisplayOffset,
|
|
340
363
|
sourceFrame: jsxFrame,
|
|
341
364
|
defaultValue,
|
|
342
365
|
dragOverrideValue,
|
|
@@ -349,7 +372,7 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
|
|
|
349
372
|
fieldKey,
|
|
350
373
|
fileName,
|
|
351
374
|
jsxFrame,
|
|
352
|
-
|
|
375
|
+
resolvedKeyframeDisplayOffset,
|
|
353
376
|
nodePath,
|
|
354
377
|
nodePathInfo,
|
|
355
378
|
propStatus,
|
|
@@ -22,6 +22,7 @@ const TimelineKeyframedValue = ({ field, propStatus, sourceFrame, dragOverrideVa
|
|
|
22
22
|
}, [propStatus, sourceFrame]);
|
|
23
23
|
const fakeStatus = (0, react_1.useMemo)(() => ({
|
|
24
24
|
status: 'static',
|
|
25
|
+
keyframeDisplayOffsetAdjustment: null,
|
|
25
26
|
codeValue: computedValue,
|
|
26
27
|
}), [computedValue]);
|
|
27
28
|
const effectiveValue = (0, react_1.useMemo)(() => {
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare const TimelineList: React.FC<{
|
|
4
|
-
readonly timeline: TimelineTrackData[];
|
|
5
|
-
readonly showTimePadding: boolean;
|
|
6
|
-
}>;
|
|
2
|
+
export declare const TimelineList: React.FC;
|
|
@@ -2,22 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimelineList = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
5
|
const colors_1 = require("../../helpers/colors");
|
|
7
|
-
const nest_timeline_tracks_1 = require("./nest-timeline-tracks");
|
|
8
6
|
const TimelineSequenceItem_1 = require("./TimelineSequenceItem");
|
|
9
|
-
const
|
|
7
|
+
const TimelineVirtualization_1 = require("./TimelineVirtualization");
|
|
10
8
|
const container = {
|
|
11
9
|
flex: 1,
|
|
12
10
|
background: colors_1.BACKGROUND,
|
|
11
|
+
position: 'relative',
|
|
13
12
|
};
|
|
14
|
-
const TimelineListTrack = ({
|
|
13
|
+
const TimelineListTrack = ({ row }) => {
|
|
15
14
|
var _a;
|
|
16
|
-
const {
|
|
17
|
-
return (jsx_runtime_1.jsx(
|
|
15
|
+
const { afterDropLineOffset, siblingIndex, track } = row;
|
|
16
|
+
return (jsx_runtime_1.jsx(TimelineSequenceItem_1.TimelineSequenceItem, { afterDropLineOffset: afterDropLineOffset, siblingIndex: siblingIndex, connectedCompositions: (_a = track.connectedCompositions) !== null && _a !== void 0 ? _a : [], nestedDepth: track.depth, sequence: track.sequence, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, sequenceFrameOffset: track.sequenceFrameOffset }));
|
|
18
17
|
};
|
|
19
|
-
const TimelineList = (
|
|
20
|
-
const
|
|
21
|
-
return (jsx_runtime_1.
|
|
18
|
+
const TimelineList = () => {
|
|
19
|
+
const { rows, tracksEnd, virtualItems } = (0, TimelineVirtualization_1.useTimelineVirtualization)();
|
|
20
|
+
return (jsx_runtime_1.jsx("div", { style: { ...container, height: tracksEnd }, children: virtualItems.map((virtualItem) => (jsx_runtime_1.jsx("div", { style: {
|
|
21
|
+
height: virtualItem.size,
|
|
22
|
+
left: 0,
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
top: virtualItem.start,
|
|
25
|
+
width: '100%',
|
|
26
|
+
}, children: jsx_runtime_1.jsx(TimelineListTrack, { row: rows[virtualItem.index] }) }, virtualItem.key))) }));
|
|
22
27
|
};
|
|
23
28
|
exports.TimelineList = TimelineList;
|