@remotion/studio 4.0.513 → 4.0.515
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/api/install-package.js +14 -1
- package/dist/components/AskAiModal.js +1 -1
- package/dist/components/AssetSelector.js +2 -0
- package/dist/components/AssetSelectorItem.d.ts +2 -1
- package/dist/components/AssetSelectorItem.js +19 -16
- package/dist/components/AudioWaveform.d.ts +3 -0
- package/dist/components/AudioWaveform.js +65 -199
- package/dist/components/Canvas.js +40 -5
- package/dist/components/CanvasOrLoading.js +5 -0
- package/dist/components/CompositionSelector.js +2 -0
- 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 +3 -1
- package/dist/components/InspectorPanel/CompositionInspector.js +37 -5
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +1 -1
- package/dist/components/InspectorPanel/EasingInspector.js +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +2 -2
- 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/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/InstallPackage.d.ts +1 -1
- package/dist/components/InstallPackage.js +38 -6
- package/dist/components/LicenseKeyValidation.js +2 -2
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/Modals.js +11 -3
- 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/GuiRenderStatus.js +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +3 -3
- package/dist/components/RenderModal/WebRenderModal.js +10 -4
- 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/RenderQueueItem.js +3 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +3 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -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/SelectedOutlineCanvasRotation.d.ts +1 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +11 -4
- package/dist/components/SelectedOutlineElement.js +3 -3
- package/dist/components/SelectedOutlinePolygon.d.ts +2 -0
- package/dist/components/SelectedOutlinePolygon.js +54 -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/TimelineAssetField.d.ts +2 -2
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +6 -2
- package/dist/components/Timeline/TimelineDragHandler.js +62 -76
- package/dist/components/Timeline/TimelineEffectItem.js +23 -6
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +4 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +22 -13
- package/dist/components/Timeline/TimelineExpandArrowButton.js +10 -7
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +4 -1
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
- package/dist/components/Timeline/TimelineExpandedSection.js +8 -5
- 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 +6 -1
- 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 +1 -2
- package/dist/components/Timeline/TimelineRowChrome.js +50 -7
- 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 +13 -5
- package/dist/components/Timeline/TimelineSelection.js +95 -106
- package/dist/components/Timeline/TimelineSequence.js +59 -25
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +21 -12
- package/dist/components/Timeline/TimelineSequenceName.js +1 -1
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +2 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +3 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +33 -10
- package/dist/components/Timeline/TimelineSlider.js +42 -33
- package/dist/components/Timeline/TimelineTimeIndicators.js +90 -98
- package/dist/components/Timeline/TimelineTrack.js +4 -1
- 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 +155 -63
- 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.js +11 -1
- package/dist/components/Timeline/call-update-keyframe-settings.js +31 -3
- package/dist/components/Timeline/delete-selected-timeline-item.js +8 -3
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +4 -2
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +1 -2
- package/dist/components/Timeline/get-timeline-keyframes.js +1 -8
- 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/save-effect-prop.js +3 -3
- 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-timeline-height.d.ts +3 -5
- package/dist/components/Timeline/use-timeline-height.js +16 -18
- package/dist/components/UpdateCheck.d.ts +2 -10
- package/dist/components/UpdateCheck.js +8 -2
- package/dist/components/VisualControls/VisualControlHandle.js +8 -0
- package/dist/components/delete-jsx-node-api.d.ts +2 -0
- package/dist/components/delete-jsx-node-api.js +12 -0
- package/dist/components/effect-drag-and-drop.js +6 -3
- package/dist/components/effect-operations-api.d.ts +8 -0
- package/dist/components/effect-operations-api.js +52 -0
- package/dist/components/element-install-api.d.ts +3 -0
- package/dist/components/element-install-api.js +19 -0
- 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/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/error-overlay/remotion-overlay/Overlay.js +1 -1
- package/dist/error-overlay/remotion-overlay/log-studio-error.js +4 -0
- package/dist/esm/{chunk-r46yxrjr.js → chunk-s6k99gh2.js} +1 -1
- package/dist/esm/{chunk-tv7r0jy3.js → chunk-v5a8vpv4.js} +11479 -7851
- package/dist/esm/index.mjs +7 -5
- package/dist/esm/internals.mjs +11479 -7851
- package/dist/esm/previewEntry.mjs +11311 -7683
- package/dist/esm/renderEntry.mjs +3 -4
- package/dist/helpers/browser-studio-operations.d.ts +5 -0
- package/dist/helpers/browser-studio-operations.js +27 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/colors.js +1 -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 +7 -5
- 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-max-media-duration.js +5 -3
- package/dist/helpers/use-media-metadata.js +37 -20
- package/dist/helpers/use-menu-structure.js +67 -84
- package/dist/helpers/use-runtime-values.d.ts +2 -1
- package/dist/helpers/use-runtime-values.js +7 -3
- package/dist/icons/cloud-download.d.ts +4 -0
- package/dist/icons/cloud-download.js +8 -0
- 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 +8 -2
- package/dist/state/timeline-zoom.d.ts +1 -2
- package/dist/state/timeline-zoom.js +9 -5
- package/package.json +14 -13
|
@@ -4,11 +4,12 @@ exports.TimelineEffectItem = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
7
8
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
9
|
const colors_1 = require("../../helpers/colors");
|
|
9
10
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
10
|
-
const call_api_1 = require("../call-api");
|
|
11
11
|
const ContextMenu_1 = require("../ContextMenu");
|
|
12
|
+
const effect_operations_api_1 = require("../effect-operations-api");
|
|
12
13
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
13
14
|
const save_effect_prop_1 = require("./save-effect-prop");
|
|
14
15
|
const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
|
|
@@ -26,6 +27,14 @@ const rowStyle = {
|
|
|
26
27
|
height: timeline_layout_1.TREE_GROUP_ROW_HEIGHT,
|
|
27
28
|
cursor: 'default',
|
|
28
29
|
};
|
|
30
|
+
const labelContainerStyle = {
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
alignSelf: 'stretch',
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flex: 1,
|
|
35
|
+
minWidth: 0,
|
|
36
|
+
paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
|
|
37
|
+
};
|
|
29
38
|
const reorderWrapper = {
|
|
30
39
|
position: 'relative',
|
|
31
40
|
};
|
|
@@ -69,6 +78,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
69
78
|
var _b;
|
|
70
79
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
71
80
|
const previewConnected = previewServerState.type === 'connected';
|
|
81
|
+
const canMutateEffects = (0, browser_studio_operations_1.canUseEffectOperations)();
|
|
72
82
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
73
83
|
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
74
84
|
const selection = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
@@ -88,11 +98,13 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
88
98
|
}
|
|
89
99
|
return false;
|
|
90
100
|
}, [disabledStatus]);
|
|
91
|
-
const canToggle = previewConnected && (disabledStatus === null || disabledStatus === void 0 ? void 0 : disabledStatus.status) === 'static';
|
|
101
|
+
const canToggle = previewConnected && canMutateEffects && (disabledStatus === null || disabledStatus === void 0 ? void 0 : disabledStatus.status) === 'static';
|
|
92
102
|
const deleteDisabled = !previewConnected ||
|
|
103
|
+
!canMutateEffects ||
|
|
93
104
|
effectStatus.type !== 'can-update-effect' ||
|
|
94
105
|
!validatedLocation.source;
|
|
95
106
|
const canReorder = previewConnected &&
|
|
107
|
+
canMutateEffects &&
|
|
96
108
|
effectStatus.type === 'can-update-effect' &&
|
|
97
109
|
Boolean(validatedLocation.source);
|
|
98
110
|
const nodePathKey = (0, react_1.useMemo)(() => remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath), [nodePath]);
|
|
@@ -101,7 +113,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
101
113
|
return;
|
|
102
114
|
}
|
|
103
115
|
try {
|
|
104
|
-
const result = await (0,
|
|
116
|
+
const result = await (0, effect_operations_api_1.deleteEffects)([
|
|
105
117
|
{
|
|
106
118
|
type: 'single-effect',
|
|
107
119
|
fileName: validatedLocation.source,
|
|
@@ -209,8 +221,11 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
209
221
|
alignItems: 'center',
|
|
210
222
|
color: (0, TimelineSelection_1.getTimelineColor)(selection.selected, true),
|
|
211
223
|
display: 'inline-flex',
|
|
212
|
-
|
|
224
|
+
flexShrink: 1,
|
|
213
225
|
minWidth: 0,
|
|
226
|
+
overflow: 'hidden',
|
|
227
|
+
textOverflow: 'ellipsis',
|
|
228
|
+
whiteSpace: 'nowrap',
|
|
214
229
|
boxShadow: containsSelection && !selection.selected
|
|
215
230
|
? `inset 0 0 0 2px ${TimelineSelection_1.TIMELINE_SELECTED_LABEL_BACKGROUND}`
|
|
216
231
|
: undefined,
|
|
@@ -288,7 +303,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
288
303
|
setDropIndicator(null);
|
|
289
304
|
currentEffectDrag = null;
|
|
290
305
|
try {
|
|
291
|
-
const result = await (0,
|
|
306
|
+
const result = await (0, effect_operations_api_1.reorderEffect)({
|
|
292
307
|
fileName: validatedLocation.source,
|
|
293
308
|
sequenceNodePath: nodePath,
|
|
294
309
|
fromIndex: dropTarget.dragData.effectIndex,
|
|
@@ -321,7 +336,9 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
|
|
|
321
336
|
...(dropIndicator === 'before' ? { top: -1 } : { bottom: -1 }),
|
|
322
337
|
};
|
|
323
338
|
}, [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.
|
|
339
|
+
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.TimelineExpandArrowSpacer, {}), style: rowStyle, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: containsSelection, isFieldRow: false, outerHeight: null, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [
|
|
340
|
+
jsx_runtime_1.jsx("span", { title: label, style: labelStyle, children: label }), jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(nodePathInfo), label: `${label} section`, disabled: false })
|
|
341
|
+
] }) }));
|
|
325
342
|
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
343
|
return previewConnected ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: draggableRow })) : (draggableRow);
|
|
327
344
|
};
|
|
@@ -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
|
}>;
|
|
@@ -5,10 +5,12 @@ 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 open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
10
|
-
const
|
|
11
|
+
const use_runtime_values_1 = require("../../helpers/use-runtime-values");
|
|
11
12
|
const ContextMenu_1 = require("../ContextMenu");
|
|
13
|
+
const effect_operations_api_1 = require("../effect-operations-api");
|
|
12
14
|
const use_default_editor_info_1 = require("../use-default-editor-info");
|
|
13
15
|
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
14
16
|
const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
|
|
@@ -40,7 +42,11 @@ const isResettableStatus = ({ status, defaultValue, }) => {
|
|
|
40
42
|
const effectiveCodeValue = (_a = status.codeValue) !== null && _a !== void 0 ? _a : defaultValue;
|
|
41
43
|
return JSON.stringify(effectiveCodeValue) !== JSON.stringify(defaultValue);
|
|
42
44
|
};
|
|
43
|
-
const
|
|
45
|
+
const TimelineComputedEffectPropValue = ({ field, propStatus, runtimeValueStore, validatedLocation }) => {
|
|
46
|
+
const runtimeValue = (0, use_runtime_values_1.useRuntimeStoreValue)(runtimeValueStore, field.key);
|
|
47
|
+
return (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineNonEditableStatus, { propStatus: propStatus, field: field, runtimeValue: runtimeValue, validatedLocation: validatedLocation }));
|
|
48
|
+
};
|
|
49
|
+
const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFrame, runtimeValueStore }) => {
|
|
44
50
|
var _a;
|
|
45
51
|
var _b;
|
|
46
52
|
const { setEffectDragOverrides, clearEffectDragOverrides, setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -123,7 +129,7 @@ const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFra
|
|
|
123
129
|
value,
|
|
124
130
|
schema: field.effectSchema,
|
|
125
131
|
}),
|
|
126
|
-
apiCall: () => (0,
|
|
132
|
+
apiCall: () => (0, effect_operations_api_1.saveEffectProps)({
|
|
127
133
|
type: 'value',
|
|
128
134
|
fileName: validatedLocation.source,
|
|
129
135
|
sequenceNodePath: nodePath,
|
|
@@ -177,24 +183,27 @@ const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFra
|
|
|
177
183
|
if (field.fieldSchema.type === 'scale') {
|
|
178
184
|
throw new Error(`Effects do not support scale fields: ${field.key}`);
|
|
179
185
|
}
|
|
186
|
+
if (!(0, browser_studio_operations_1.canUseEffectOperations)()) {
|
|
187
|
+
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "read only", formattedValue: false });
|
|
188
|
+
}
|
|
180
189
|
if (effectStatus.type === 'cannot-update-effect') {
|
|
181
190
|
if (effectStatus.reason === 'computed') {
|
|
182
|
-
return (jsx_runtime_1.jsx(
|
|
191
|
+
return (jsx_runtime_1.jsx(TimelineComputedEffectPropValue, { propStatus: { status: 'computed' }, field: field, runtimeValueStore: runtimeValueStore, validatedLocation: validatedLocation }));
|
|
183
192
|
}
|
|
184
193
|
if (effectStatus.reason === 'not-call-expression') {
|
|
185
|
-
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not inline" });
|
|
194
|
+
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not inline", formattedValue: false });
|
|
186
195
|
}
|
|
187
196
|
if (effectStatus.reason === 'not-found') {
|
|
188
|
-
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not found in code" });
|
|
197
|
+
return (jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not found in code", formattedValue: false }));
|
|
189
198
|
}
|
|
190
199
|
throw new Error(`Unsupported effect status: ${effectStatus.reason}`);
|
|
191
200
|
}
|
|
192
201
|
if (effectStatus.type === 'cannot-update-sequence') {
|
|
193
202
|
if (effectStatus.reason === 'not-found') {
|
|
194
|
-
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not found in code" });
|
|
203
|
+
return (jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "not found in code", formattedValue: false }));
|
|
195
204
|
}
|
|
196
205
|
if (effectStatus.reason === 'error') {
|
|
197
|
-
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "error" });
|
|
206
|
+
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: "error", formattedValue: false });
|
|
198
207
|
}
|
|
199
208
|
throw new Error(`Unsupported effect status: ${effectStatus.reason}`);
|
|
200
209
|
}
|
|
@@ -205,7 +214,7 @@ const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFra
|
|
|
205
214
|
return (jsx_runtime_1.jsx(TimelineKeyframedValue_1.TimelineKeyframedValue, { field: field, propStatus: propStatus, sourceFrame: sourceFrame, dragOverrideValue: dragOverrideValue, onSave: onSaveKeyframed, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, scaleLockNodePath: nodePath }));
|
|
206
215
|
}
|
|
207
216
|
if (propStatus.status === 'computed') {
|
|
208
|
-
return (jsx_runtime_1.jsx(
|
|
217
|
+
return (jsx_runtime_1.jsx(TimelineComputedEffectPropValue, { propStatus: propStatus, field: field, runtimeValueStore: runtimeValueStore, validatedLocation: validatedLocation }));
|
|
209
218
|
}
|
|
210
219
|
const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
211
220
|
propStatus,
|
|
@@ -217,11 +226,11 @@ const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFra
|
|
|
217
226
|
return (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: propStatus, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, effectiveValue: effectiveValue, scaleLockNodePath: null }));
|
|
218
227
|
};
|
|
219
228
|
exports.TimelineEffectPropValue = TimelineEffectPropValue;
|
|
220
|
-
const TimelineEffectPropValueAtCurrentFrame = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) => {
|
|
229
|
+
const TimelineEffectPropValueAtCurrentFrame = ({ field, nodePath, validatedLocation, keyframeDisplayOffset, runtimeValueStore, }) => {
|
|
221
230
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
222
|
-
return (jsx_runtime_1.jsx(exports.TimelineEffectPropValue, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, sourceFrame: timelinePosition - keyframeDisplayOffset }));
|
|
231
|
+
return (jsx_runtime_1.jsx(exports.TimelineEffectPropValue, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, sourceFrame: timelinePosition - keyframeDisplayOffset, runtimeValueStore: runtimeValueStore }));
|
|
223
232
|
};
|
|
224
|
-
const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath, nodePathInfo, keyframeDisplayOffset, keyframeControlsMode
|
|
233
|
+
const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath, nodePathInfo, keyframeDisplayOffset, keyframeControlsMode, runtimeValueStore, }) => {
|
|
225
234
|
var _a;
|
|
226
235
|
var _b;
|
|
227
236
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
@@ -339,7 +348,7 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
|
|
|
339
348
|
property: field.key,
|
|
340
349
|
}).catch(() => undefined);
|
|
341
350
|
}, [canOpenInEditor, defaultEditorId, field.key, validatedLocation]);
|
|
342
|
-
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,
|
|
351
|
+
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 }) }) }));
|
|
343
352
|
return jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, children: row });
|
|
344
353
|
};
|
|
345
354
|
exports.TimelineEffectPropItem = TimelineEffectPropItem;
|
|
@@ -37,11 +37,11 @@ exports.TimelineExpandArrowSpacer = exports.TimelineExpandArrowButton = void 0;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const colors_1 = require("../../helpers/colors");
|
|
40
|
+
const hoverable_1 = require("../../helpers/hoverable");
|
|
41
|
+
const caret_1 = require("../../icons/caret");
|
|
40
42
|
const arrowButton = {
|
|
41
43
|
background: 'none',
|
|
42
44
|
border: 'none',
|
|
43
|
-
color: colors_1.WHITE,
|
|
44
|
-
cursor: 'pointer',
|
|
45
45
|
padding: 0,
|
|
46
46
|
display: 'flex',
|
|
47
47
|
alignItems: 'center',
|
|
@@ -57,9 +57,7 @@ const arrowButton = {
|
|
|
57
57
|
};
|
|
58
58
|
const arrowSpacer = {
|
|
59
59
|
...arrowButton,
|
|
60
|
-
cursor: 'default',
|
|
61
60
|
};
|
|
62
|
-
const svgStyle = { display: 'block' };
|
|
63
61
|
const TimelineExpandArrowButton = ({ isExpanded, onClick, label, disabled = false }) => {
|
|
64
62
|
const handleClick = react_1.default.useCallback((e) => {
|
|
65
63
|
e.stopPropagation();
|
|
@@ -71,12 +69,17 @@ const TimelineExpandArrowButton = ({ isExpanded, onClick, label, disabled = fals
|
|
|
71
69
|
const style = (0, react_1.useMemo)(() => {
|
|
72
70
|
return {
|
|
73
71
|
...arrowButton,
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
73
|
+
idleBackground: colors_1.TRANSPARENT,
|
|
74
|
+
hoverBackground: colors_1.TRANSPARENT,
|
|
75
|
+
idleColor: colors_1.LIGHT_GRAY,
|
|
76
|
+
hoverColor: disabled ? colors_1.LIGHT_GRAY : colors_1.WHITE,
|
|
77
|
+
}),
|
|
78
|
+
transform: isExpanded ? 'rotate(0deg)' : 'rotate(-90deg)',
|
|
76
79
|
opacity: disabled ? 0.5 : 1,
|
|
77
80
|
};
|
|
78
81
|
}, [isExpanded, disabled]);
|
|
79
|
-
return (jsx_runtime_1.jsx("button", { type: "button", style: style, onClick: handleClick, onDoubleClick: stopPropagation, onPointerDown: stopPropagation, disabled: disabled, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} ${label}`, children: jsx_runtime_1.jsx(
|
|
82
|
+
return (jsx_runtime_1.jsx("button", { type: "button", className: `${hoverable_1.HOVERABLE_CLASS_NAME} __remotion-timeline-expand-arrow-button`, style: style, onClick: handleClick, onDoubleClick: stopPropagation, onPointerDown: stopPropagation, disabled: disabled, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} ${label}`, children: jsx_runtime_1.jsx(caret_1.CaretDown, {}) }));
|
|
80
83
|
};
|
|
81
84
|
exports.TimelineExpandArrowButton = TimelineExpandArrowButton;
|
|
82
85
|
const TimelineExpandArrowSpacer = () => {
|
|
@@ -59,7 +59,10 @@ const rowSeparator = {
|
|
|
59
59
|
};
|
|
60
60
|
const TimelineExpandedKeyframeRowUnmemoized = ({ height, keyframes, canEditEasing, nodePathInfo, showSeparator }) => {
|
|
61
61
|
const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
|
|
62
|
-
const rowHighlightBackground = (0, TimelineSelection_1.useTimelineRowHighlightBackground)(nodePathInfo
|
|
62
|
+
const rowHighlightBackground = (0, TimelineSelection_1.useTimelineRowHighlightBackground)(nodePathInfo, {
|
|
63
|
+
hovered: false,
|
|
64
|
+
selectedBackground: TimelineSelection_1.TIMELINE_EXPANDED_SELECTED_BACKGROUND,
|
|
65
|
+
});
|
|
63
66
|
const easingSegments = canEditEasing
|
|
64
67
|
? (0, get_timeline_easing_segments_1.getTimelineEasingSegments)(keyframes)
|
|
65
68
|
: [];
|
|
@@ -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);
|
|
@@ -39,8 +39,11 @@ const react_1 = __importStar(require("react"));
|
|
|
39
39
|
const colors_1 = require("../../helpers/colors");
|
|
40
40
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
41
41
|
const TimelineExpandedRow_1 = require("./TimelineExpandedRow");
|
|
42
|
+
const TimelineRowChrome_1 = require("./TimelineRowChrome");
|
|
43
|
+
const TimelineSelection_1 = require("./TimelineSelection");
|
|
42
44
|
const use_timeline_expanded_tree_1 = require("./use-timeline-expanded-tree");
|
|
43
45
|
const expandedSectionBase = {
|
|
46
|
+
backgroundColor: TimelineSelection_1.TIMELINE_BACKGROUND,
|
|
44
47
|
color: colors_1.WHITE,
|
|
45
48
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
46
49
|
fontSize: 12,
|
|
@@ -68,16 +71,16 @@ const TimelineExpandedSection = ({ sequence, validatedLocation, nodePathInfo, ne
|
|
|
68
71
|
const style = (0, react_1.useMemo)(() => {
|
|
69
72
|
return {
|
|
70
73
|
...expandedSectionBase,
|
|
71
|
-
height: expandedHeight,
|
|
74
|
+
height: expandedHeight + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
72
75
|
};
|
|
73
76
|
}, [expandedHeight]);
|
|
74
77
|
const { schema } = sequence.controls;
|
|
75
78
|
if (flat.length === 0) {
|
|
76
79
|
return null;
|
|
77
80
|
}
|
|
78
|
-
return (jsx_runtime_1.jsx("div", { style: style, children: flat.map(({ node, depth }, i) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
return (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowSelectedBackgroundContext.Provider, { value: TimelineSelection_1.TIMELINE_EXPANDED_SELECTED_BACKGROUND, children: jsx_runtime_1.jsx("div", { style: style, children: flat.map(({ node, depth }, i) => {
|
|
82
|
+
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" })
|
|
83
|
+
] }, JSON.stringify(node.nodePathInfo)));
|
|
84
|
+
}) }) }));
|
|
82
85
|
};
|
|
83
86
|
exports.TimelineExpandedSection = TimelineExpandedSection;
|
|
@@ -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");
|
|
@@ -292,6 +293,9 @@ const shouldShowTimelineKeyframeControls = ({ propStatus, selected, keyframable,
|
|
|
292
293
|
};
|
|
293
294
|
exports.shouldShowTimelineKeyframeControls = shouldShowTimelineKeyframeControls;
|
|
294
295
|
const shouldShowTimelineKeyframeNavigation = ({ propStatus, selected, }) => {
|
|
296
|
+
if (propStatus.status === 'computed') {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
295
299
|
if (selected) {
|
|
296
300
|
return true;
|
|
297
301
|
}
|
|
@@ -342,7 +346,8 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
|
|
|
342
346
|
key: fieldKey,
|
|
343
347
|
});
|
|
344
348
|
const canAddKeyframe = keyframable;
|
|
345
|
-
const canToggleKeyframe =
|
|
349
|
+
const canToggleKeyframe = (0, browser_studio_operations_1.canUseKeyframeOperations)() &&
|
|
350
|
+
propStatus.status !== 'computed' &&
|
|
346
351
|
(hasKeyframeAtCurrentFrame || canAddKeyframe);
|
|
347
352
|
const selectedNodePathInfos = (0, react_1.useMemo)(() => (0, exports.getSelectedKeyframeControlNodePathInfos)({
|
|
348
353
|
clickedNodePathInfo: nodePathInfo,
|
|
@@ -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;
|
|
@@ -9,11 +9,11 @@ const timeline_zoom_1 = require("../../state/timeline-zoom");
|
|
|
9
9
|
const timeline_refs_1 = require("./timeline-refs");
|
|
10
10
|
const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
|
|
11
11
|
/**
|
|
12
|
-
* Maps wheel deltaY to zoom
|
|
13
|
-
* pinch steps change `TimelineZoomCtx` zoom by at least one
|
|
14
|
-
*
|
|
12
|
+
* Maps wheel deltaY to a multiplicative zoom change. Must be large enough that
|
|
13
|
+
* typical ctrl+wheel pinch steps change `TimelineZoomCtx` zoom by at least one
|
|
14
|
+
* 0.1 step after rounding in `clampTimelineZoom` (0.005 was too small at 1x).
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const ZOOM_WHEEL_SENSITIVITY = 0.06;
|
|
17
17
|
const TimelinePinchZoom = () => {
|
|
18
18
|
const isVideoComposition = (0, is_current_selected_still_1.useIsVideoComposition)();
|
|
19
19
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
@@ -60,7 +60,7 @@ const TimelinePinchZoom = () => {
|
|
|
60
60
|
else if (deltaMode === WheelEvent.DOM_DELTA_PAGE) {
|
|
61
61
|
scaledDeltaY *= scrollEl.clientHeight;
|
|
62
62
|
}
|
|
63
|
-
setZoom(canvasContent.compositionId, (z) => z -
|
|
63
|
+
setZoom(canvasContent.compositionId, (z) => z * Math.exp(-scaledDeltaY * ZOOM_WHEEL_SENSITIVITY), { anchorFrame: null, anchorContentX });
|
|
64
64
|
}, [
|
|
65
65
|
editorZoomGestures,
|
|
66
66
|
isVideoComposition,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TimelineSelectionInteraction } from './TimelineSelection';
|
|
3
|
-
|
|
3
|
+
export declare const TimelineRowSelectedBackgroundContext: React.Context<string>;
|
|
4
4
|
export declare const TimelineRowKeyframeControlsColumn: React.FC<{
|
|
5
5
|
readonly children: React.ReactNode;
|
|
6
6
|
readonly depth: number;
|
|
@@ -14,7 +14,6 @@ export declare const TimelineRowChrome: React.FC<{
|
|
|
14
14
|
readonly style: React.CSSProperties;
|
|
15
15
|
readonly selected: boolean;
|
|
16
16
|
readonly selectable: boolean;
|
|
17
|
-
readonly selectionItem: TimelineSelection | null;
|
|
18
17
|
readonly onSelect: (interaction?: TimelineSelectionInteraction) => void;
|
|
19
18
|
readonly showSelectedBackground: boolean;
|
|
20
19
|
readonly containsSelection: boolean;
|