@remotion/studio 4.0.477 → 4.0.479
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssetSelector.js +8 -14
- package/dist/components/Button.d.ts +1 -0
- package/dist/components/Button.js +8 -5
- package/dist/components/CanvasIfSizeIsAvailable.js +2 -6
- package/dist/components/CompactExplanation.d.ts +12 -0
- package/dist/components/CompactExplanation.js +52 -0
- package/dist/components/CompositionSelector.js +2 -4
- package/dist/components/CurrentAsset.d.ts +3 -1
- package/dist/components/CurrentAsset.js +42 -34
- package/dist/components/CurrentComposition.d.ts +1 -1
- package/dist/components/CurrentComposition.js +38 -31
- package/dist/components/DefaultPropsEditor.d.ts +12 -2
- package/dist/components/DefaultPropsEditor.js +2 -2
- package/dist/components/EditorGuides/Guide.js +37 -9
- package/dist/components/EditorRuler/Ruler.js +4 -14
- package/dist/components/EditorRuler/index.js +9 -4
- package/dist/components/EffectPickerModal.d.ts +5 -0
- package/dist/components/EffectPickerModal.js +179 -0
- package/dist/components/InlineAction.js +1 -0
- package/dist/components/InspectorInfoHeader.d.ts +11 -0
- package/dist/components/InspectorInfoHeader.js +55 -0
- package/dist/components/InspectorPanel/DefaultInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/DefaultInspector.js +93 -0
- package/dist/components/InspectorPanel/EasingInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/EasingInspector.js +41 -0
- package/dist/components/InspectorPanel/GuideInspector.d.ts +7 -0
- package/dist/components/InspectorPanel/GuideInspector.js +55 -0
- package/dist/components/InspectorPanel/KeyframeInspector.d.ts +7 -0
- package/dist/components/InspectorPanel/KeyframeInspector.js +109 -0
- package/dist/components/InspectorPanel/SelectedInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/SelectedInspector.js +26 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +5 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +116 -0
- package/dist/components/InspectorPanel/common.d.ts +15 -0
- package/dist/components/InspectorPanel/common.js +18 -0
- package/dist/components/InspectorPanel/inspector-selection.d.ts +10 -0
- package/dist/components/InspectorPanel/inspector-selection.js +34 -0
- package/dist/components/InspectorPanel/styles.d.ts +27 -0
- package/dist/components/InspectorPanel/styles.js +178 -0
- package/dist/components/InspectorPanel/use-track-for-selection.d.ts +2 -0
- package/dist/components/InspectorPanel/use-track-for-selection.js +22 -0
- package/dist/components/InspectorPanel.d.ts +8 -0
- package/dist/components/InspectorPanel.js +26 -0
- package/dist/components/InspectorPanelLayout.d.ts +1 -0
- package/dist/components/InspectorPanelLayout.js +4 -0
- package/dist/components/InspectorSequenceSection.d.ts +16 -0
- package/dist/components/InspectorSequenceSection.js +147 -0
- package/dist/components/InspectorSourceLocation.d.ts +7 -0
- package/dist/components/InspectorSourceLocation.js +71 -0
- package/dist/components/MenuToolbar.d.ts +1 -0
- package/dist/components/MenuToolbar.js +4 -1
- package/dist/components/Modals.js +3 -3
- package/dist/components/NewComposition/InputDragger.js +1 -1
- package/dist/components/NewComposition/RemInput.d.ts +1 -0
- package/dist/components/NewComposition/RemInput.js +8 -2
- package/dist/components/NewComposition/RemTextarea.d.ts +1 -0
- package/dist/components/NewComposition/RemTextarea.js +8 -2
- package/dist/components/NewComposition/ValidationMessage.d.ts +3 -0
- package/dist/components/NewComposition/ValidationMessage.js +16 -5
- package/dist/components/OptionsPanel.d.ts +1 -1
- package/dist/components/OptionsPanel.js +8 -17
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +2 -7
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +3 -10
- package/dist/components/QuickSwitcher/shared.d.ts +4 -0
- package/dist/components/QuickSwitcher/shared.js +24 -0
- package/dist/components/RenderModal/DataEditor.d.ts +29 -2
- package/dist/components/RenderModal/DataEditor.js +107 -56
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -0
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +25 -7
- package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +2 -1
- package/dist/components/RenderModal/SchemaEditor/Fieldset.js +10 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +4 -0
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +27 -4
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +12 -4
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +23 -9
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
- package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +8 -1
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -6
- package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +9 -11
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
- package/dist/components/RenderModal/WarningIndicatorButton.d.ts +1 -0
- package/dist/components/RenderModal/WarningIndicatorButton.js +17 -4
- package/dist/components/RenderModal/get-render-modal-warnings.d.ts +2 -1
- package/dist/components/RenderModal/get-render-modal-warnings.js +6 -3
- package/dist/components/RendersTab.js +1 -1
- package/dist/components/SegmentedControl.d.ts +3 -0
- package/dist/components/SegmentedControl.js +11 -5
- package/dist/components/SelectedOutlineElement.js +135 -31
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +45 -29
- package/dist/components/SelectedOutlineUvControls.d.ts +9 -0
- package/dist/components/SelectedOutlineUvControls.js +64 -10
- package/dist/components/Tabs/index.js +4 -4
- package/dist/components/Timeline/EasingEditorModal.d.ts +5 -4
- package/dist/components/Timeline/EasingEditorModal.js +597 -124
- package/dist/components/Timeline/KeyframeSettingsModal.d.ts +2 -2
- package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -2
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +15 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +85 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +10 -3
- package/dist/components/Timeline/TimelineEffectItem.d.ts +2 -2
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +24 -20
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +5 -19
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +8 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +24 -3
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -47
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +1 -1
- package/dist/components/Timeline/TimelineKeyframedValue.js +8 -10
- package/dist/components/Timeline/TimelineNumberField.js +5 -11
- package/dist/components/Timeline/TimelineRotationField.js +5 -6
- package/dist/components/Timeline/TimelineScaleField.js +4 -8
- package/dist/components/Timeline/TimelineSelection.d.ts +6 -0
- package/dist/components/Timeline/TimelineSelection.js +109 -14
- package/dist/components/Timeline/TimelineSequence.js +22 -14
- package/dist/components/Timeline/TimelineSequenceItem.js +12 -67
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +56 -52
- package/dist/components/Timeline/TimelineTransformOriginField.js +4 -5
- package/dist/components/Timeline/TimelineTranslateField.js +4 -5
- package/dist/components/Timeline/TimelineUvCoordinateField.js +4 -4
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +93 -8
- package/dist/components/Timeline/call-add-keyframe.d.ts +4 -4
- package/dist/components/Timeline/call-delete-keyframe.d.ts +4 -4
- package/dist/components/Timeline/call-move-keyframe.d.ts +2 -2
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +3 -3
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -1
- package/dist/components/Timeline/delete-selected-timeline-item.js +27 -1
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +7 -0
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +32 -3
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +2 -2
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +3 -3
- package/dist/components/Timeline/reset-selected-timeline-props.js +19 -5
- package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
- package/dist/components/Timeline/save-sequence-prop.d.ts +2 -2
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -3
- package/dist/components/Timeline/timeline-field-display-utils.d.ts +5 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +244 -0
- package/dist/components/Timeline/timeline-video-filmstrip-times.d.ts +17 -0
- package/dist/components/Timeline/timeline-video-filmstrip-times.js +22 -0
- package/dist/components/Timeline/update-selected-easing.d.ts +47 -4
- package/dist/components/Timeline/update-selected-easing.js +40 -9
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +13 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +73 -0
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -3
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +11 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +33 -0
- package/dist/components/VisualControls/VisualControlsContent.d.ts +1 -1
- package/dist/components/VisualControls/VisualControlsContent.js +4 -5
- package/dist/components/effect-drag-and-drop.d.ts +10 -0
- package/dist/components/effect-drag-and-drop.js +17 -8
- package/dist/components/effect-picker-search.d.ts +5 -0
- package/dist/components/effect-picker-search.js +77 -0
- package/dist/components/import-assets.d.ts +11 -2
- package/dist/components/import-assets.js +61 -6
- package/dist/components/selected-outline-drag.d.ts +44 -2
- package/dist/components/selected-outline-drag.js +74 -1
- package/dist/components/selected-outline-types.d.ts +7 -7
- package/dist/components/selected-outline-uv.d.ts +4 -3
- package/dist/components/selected-outline-uv.js +6 -2
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -0
- package/dist/esm/{chunk-t8fjnw2d.js → chunk-fge2mq5p.js} +17004 -13432
- package/dist/esm/internals.mjs +17004 -13432
- package/dist/esm/previewEntry.mjs +26617 -23041
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/editor-guide-selection.js +1 -1
- package/dist/helpers/get-preview-file-type.js +1 -1
- package/dist/helpers/render-codec-label.d.ts +2 -0
- package/dist/helpers/render-codec-label.js +49 -0
- package/dist/helpers/ruler-canvas-size.d.ts +5 -0
- package/dist/helpers/ruler-canvas-size.js +17 -0
- package/dist/helpers/timeline-layout.d.ts +4 -4
- package/dist/helpers/use-media-metadata.d.ts +8 -2
- package/dist/helpers/use-media-metadata.js +17 -4
- package/dist/state/modals.d.ts +9 -4
- package/package.json +12 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CanUpdateSequencePropStatusKeyframed, SequencePropsSubscriptionKey,
|
|
2
|
+
import type { CanUpdateSequencePropStatusKeyframed, SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
|
|
3
3
|
export type KeyframeSettingsModalState = {
|
|
4
4
|
type: 'keyframe-settings';
|
|
5
5
|
fileName: string;
|
|
@@ -7,7 +7,7 @@ export type KeyframeSettingsModalState = {
|
|
|
7
7
|
fieldKey: string;
|
|
8
8
|
fieldLabel: string;
|
|
9
9
|
status: CanUpdateSequencePropStatusKeyframed;
|
|
10
|
-
schema:
|
|
10
|
+
schema: InteractivitySchema;
|
|
11
11
|
effectIndex: number | null;
|
|
12
12
|
};
|
|
13
13
|
export declare const KeyframeSettingsModal: React.FC<{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
|
-
import type { EffectDefinition, JsxComponentIdentity,
|
|
2
|
+
import type { EffectDefinition, JsxComponentIdentity, InteractivitySchema } from 'remotion';
|
|
3
3
|
export declare const SubscribeToNodePaths: FC<{
|
|
4
4
|
readonly overrideId: string;
|
|
5
5
|
readonly componentIdentity: JsxComponentIdentity | null;
|
|
6
|
-
readonly schema:
|
|
6
|
+
readonly schema: InteractivitySchema;
|
|
7
7
|
readonly getStack: () => string | null;
|
|
8
8
|
readonly effects: readonly EffectDefinition<unknown>[];
|
|
9
9
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type EffectClipboardSnapshot, type EffectPropClipboardData } from '@remotion/studio-shared';
|
|
1
|
+
import { type EasingClipboardData, type EffectClipboardSnapshot, type EffectPropClipboardData } from '@remotion/studio-shared';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
import { type OverrideIdToNodePaths, type PropStatuses, type SequencePropsSubscriptionKey, type
|
|
3
|
+
import { type OverrideIdToNodePaths, type PropStatuses, type SequencePropsSubscriptionKey, type InteractivitySchema, type TSequence } from 'remotion';
|
|
4
4
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
5
5
|
import { type TimelineSelection } from './TimelineSelection';
|
|
6
6
|
export type PasteEffectsTarget = {
|
|
@@ -20,7 +20,7 @@ export type PasteEffectPropTarget = {
|
|
|
20
20
|
readonly effectIndex: number;
|
|
21
21
|
readonly fieldKey: string;
|
|
22
22
|
readonly defaultValue: string | null;
|
|
23
|
-
readonly schema:
|
|
23
|
+
readonly schema: InteractivitySchema;
|
|
24
24
|
} | {
|
|
25
25
|
readonly type: 'none' | 'multiple' | 'unsupported' | 'effect-type-mismatch' | 'prop-mismatch' | 'uncopyable';
|
|
26
26
|
};
|
|
@@ -33,6 +33,18 @@ export declare const getEffectPropClipboardDataFromSelection: ({ selection, prop
|
|
|
33
33
|
selection: TimelineSelection;
|
|
34
34
|
propStatuses: PropStatuses;
|
|
35
35
|
}) => EffectPropClipboardData | null;
|
|
36
|
+
export declare const getEasingClipboardDataFromSelection: ({ selection, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
37
|
+
selection: {
|
|
38
|
+
readonly type: "easing";
|
|
39
|
+
readonly nodePathInfo: SequenceNodePathInfo;
|
|
40
|
+
readonly fromFrame: number;
|
|
41
|
+
readonly toFrame: number;
|
|
42
|
+
readonly segmentIndex: number;
|
|
43
|
+
};
|
|
44
|
+
sequences: TSequence[];
|
|
45
|
+
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
46
|
+
propStatuses: PropStatuses;
|
|
47
|
+
}) => EasingClipboardData | null;
|
|
36
48
|
export declare const getPasteEffectPropTarget: ({ selectedItems, payload, propStatuses, sequences, overrideIdsToNodePaths, }: {
|
|
37
49
|
readonly selectedItems: readonly TimelineSelection[];
|
|
38
50
|
readonly payload: EffectPropClipboardData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimelineClipboardKeybindings = exports.getPasteEffectPropTarget = exports.getEffectPropClipboardDataFromSelection = exports.getSnapshotsFromSelection = exports.getPasteEffectsTarget = void 0;
|
|
3
|
+
exports.TimelineClipboardKeybindings = exports.getPasteEffectPropTarget = exports.getEasingClipboardDataFromSelection = exports.getEffectPropClipboardDataFromSelection = exports.getSnapshotsFromSelection = exports.getPasteEffectsTarget = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
@@ -11,6 +11,7 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
|
11
11
|
const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info");
|
|
12
12
|
const save_effect_prop_1 = require("./save-effect-prop");
|
|
13
13
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
14
|
+
const update_selected_easing_1 = require("./update-selected-easing");
|
|
14
15
|
const makeClipboardText = (payload) => JSON.stringify(payload);
|
|
15
16
|
const makeTargetKey = (nodePath) => {
|
|
16
17
|
return JSON.stringify({
|
|
@@ -176,6 +177,24 @@ const getEffectPropClipboardDataFromSelection = ({ selection, propStatuses, }) =
|
|
|
176
177
|
};
|
|
177
178
|
};
|
|
178
179
|
exports.getEffectPropClipboardDataFromSelection = getEffectPropClipboardDataFromSelection;
|
|
180
|
+
const getEasingClipboardDataFromSelection = ({ selection, sequences, overrideIdsToNodePaths, propStatuses, }) => {
|
|
181
|
+
const easing = (0, update_selected_easing_1.getTimelineEasingValueForSelection)({
|
|
182
|
+
selection,
|
|
183
|
+
sequences,
|
|
184
|
+
overrideIdsToNodePaths,
|
|
185
|
+
propStatuses,
|
|
186
|
+
});
|
|
187
|
+
if (easing === null) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
type: 'easing',
|
|
192
|
+
version: 1,
|
|
193
|
+
remotionClipboard: 'easing',
|
|
194
|
+
easing,
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
exports.getEasingClipboardDataFromSelection = getEasingClipboardDataFromSelection;
|
|
179
198
|
const getPasteEffectPropTarget = ({ selectedItems, payload, propStatuses, sequences, overrideIdsToNodePaths, }) => {
|
|
180
199
|
var _a;
|
|
181
200
|
if (selectedItems.length === 0) {
|
|
@@ -269,9 +288,38 @@ const TimelineClipboardKeybindings = () => {
|
|
|
269
288
|
var _a;
|
|
270
289
|
const { selectedItems } = currentSelection.current;
|
|
271
290
|
const propStatuses = propStatusesRef.current;
|
|
291
|
+
const sequences = sequencesRef.current;
|
|
272
292
|
if (selectedItems.length === 0) {
|
|
273
293
|
return;
|
|
274
294
|
}
|
|
295
|
+
const easingSelections = (0, update_selected_easing_1.getEasingSelections)(selectedItems);
|
|
296
|
+
if (easingSelections.length > 0) {
|
|
297
|
+
e.preventDefault();
|
|
298
|
+
if (easingSelections.length !== 1 ||
|
|
299
|
+
easingSelections.length !== selectedItems.length) {
|
|
300
|
+
(0, NotificationCenter_1.showNotification)('Select one easing to copy', 3000);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const payload = (0, exports.getEasingClipboardDataFromSelection)({
|
|
304
|
+
selection: easingSelections[0],
|
|
305
|
+
sequences,
|
|
306
|
+
overrideIdsToNodePaths: overrideIdToNodePathMappings,
|
|
307
|
+
propStatuses,
|
|
308
|
+
});
|
|
309
|
+
if (payload === null) {
|
|
310
|
+
(0, NotificationCenter_1.showNotification)('Cannot copy easing because it cannot be read', 3000);
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
navigator.clipboard
|
|
314
|
+
.writeText(makeClipboardText(payload))
|
|
315
|
+
.then(() => {
|
|
316
|
+
(0, NotificationCenter_1.showNotification)('Copied easing to clipboard', 1000);
|
|
317
|
+
})
|
|
318
|
+
.catch((err) => {
|
|
319
|
+
(0, NotificationCenter_1.showNotification)(`Could not copy easing: ${err.message}`, 2000);
|
|
320
|
+
});
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
275
323
|
if (selectedItems.some((selection) => selection.type === 'sequence-effect-prop')) {
|
|
276
324
|
e.preventDefault();
|
|
277
325
|
if (selectedItems.length !== 1 ||
|
|
@@ -354,6 +402,42 @@ const TimelineClipboardKeybindings = () => {
|
|
|
354
402
|
.then((text) => {
|
|
355
403
|
const propStatuses = propStatusesRef.current;
|
|
356
404
|
const sequences = sequencesRef.current;
|
|
405
|
+
const easingResult = (0, studio_shared_1.parseEasingClipboardDataResult)(text);
|
|
406
|
+
if (easingResult.status !== 'invalid') {
|
|
407
|
+
e.preventDefault();
|
|
408
|
+
if (easingResult.status === 'unsupported-version') {
|
|
409
|
+
(0, NotificationCenter_1.showNotification)('Cannot paste easing copied from a different Remotion Studio version', 4000);
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
const easingSelections = (0, update_selected_easing_1.getEasingSelections)(selectedItems);
|
|
413
|
+
if (easingSelections.length === 0 ||
|
|
414
|
+
easingSelections.length !== selectedItems.length) {
|
|
415
|
+
(0, NotificationCenter_1.showNotification)('Select an easing to paste onto', 3000);
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const updatePromise = (0, update_selected_easing_1.updateSelectedTimelineEasings)({
|
|
419
|
+
selections: easingSelections,
|
|
420
|
+
sequences,
|
|
421
|
+
overrideIdsToNodePaths: overrideIdToNodePathMappings,
|
|
422
|
+
propStatuses,
|
|
423
|
+
setPropStatuses,
|
|
424
|
+
clientId,
|
|
425
|
+
easing: easingResult.data.easing,
|
|
426
|
+
});
|
|
427
|
+
if (updatePromise === null) {
|
|
428
|
+
(0, NotificationCenter_1.showNotification)('Cannot paste onto an easing that cannot be updated', 3000);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
return updatePromise
|
|
432
|
+
.then(() => {
|
|
433
|
+
(0, NotificationCenter_1.showNotification)(easingSelections.length === 1
|
|
434
|
+
? 'Pasted easing'
|
|
435
|
+
: 'Pasted easing to selected segments', 2000);
|
|
436
|
+
})
|
|
437
|
+
.catch((err) => {
|
|
438
|
+
(0, NotificationCenter_1.showNotification)(`Could not paste easing: ${err.message}`, 3000);
|
|
439
|
+
});
|
|
440
|
+
}
|
|
357
441
|
const effectPropResult = (0, studio_shared_1.parseEffectPropClipboardDataResult)(text);
|
|
358
442
|
if (effectPropResult.status !== 'invalid') {
|
|
359
443
|
e.preventDefault();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimelineDeleteKeybindings = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const remotion_1 = require("remotion");
|
|
6
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
@@ -29,7 +30,7 @@ const TimelineDeleteKeybindings = () => {
|
|
|
29
30
|
}
|
|
30
31
|
const { clientId } = previewServerState;
|
|
31
32
|
const handleDelete = () => {
|
|
32
|
-
const { selectedItems, clearSelection } = currentSelection.current;
|
|
33
|
+
const { selectedItems, clearSelection, selectItems } = currentSelection.current;
|
|
33
34
|
const sequences = sequencesRef.current;
|
|
34
35
|
const propStatuses = propStatusesRef.current;
|
|
35
36
|
if (selectedItems.length === 0) {
|
|
@@ -57,7 +58,13 @@ const TimelineDeleteKeybindings = () => {
|
|
|
57
58
|
deletePromise
|
|
58
59
|
.then((deleted) => {
|
|
59
60
|
if (deleted) {
|
|
60
|
-
|
|
61
|
+
const nextSelection = (0, delete_selected_timeline_item_1.getTimelineSelectionAfterDeletingItems)(selectedItems);
|
|
62
|
+
if (nextSelection.length === 0) {
|
|
63
|
+
clearSelection();
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
selectItems(nextSelection);
|
|
67
|
+
}
|
|
61
68
|
}
|
|
62
69
|
})
|
|
63
70
|
.catch(() => undefined);
|
|
@@ -72,7 +79,7 @@ const TimelineDeleteKeybindings = () => {
|
|
|
72
79
|
propStatuses,
|
|
73
80
|
setPropStatuses,
|
|
74
81
|
clientId,
|
|
75
|
-
easing:
|
|
82
|
+
easing: studio_shared_1.LINEAR_KEYFRAME_EASING,
|
|
76
83
|
});
|
|
77
84
|
if (resetEasingPromise !== null) {
|
|
78
85
|
resetEasingPromise.catch(() => undefined);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SequencePropsSubscriptionKey,
|
|
2
|
+
import type { SequencePropsSubscriptionKey, InteractivitySchema } 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 { GetIsExpanded } from '../ExpandedTracksProvider';
|
|
@@ -7,7 +7,7 @@ export declare const TimelineEffectItem: React.FC<{
|
|
|
7
7
|
readonly label: string;
|
|
8
8
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
9
9
|
readonly effectIndex: number;
|
|
10
|
-
readonly effectSchema:
|
|
10
|
+
readonly effectSchema: InteractivitySchema;
|
|
11
11
|
readonly documentationLink: string | null;
|
|
12
12
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
13
13
|
readonly validatedLocation: CodePosition;
|
|
@@ -3,6 +3,13 @@ import type { 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';
|
|
6
|
+
import { type TimelineKeyframeControlsMode } from './TimelineKeyframeControls';
|
|
7
|
+
export declare const TimelineEffectPropValue: React.FC<{
|
|
8
|
+
readonly field: EffectSchemaFieldInfo;
|
|
9
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
10
|
+
readonly validatedLocation: CodePosition;
|
|
11
|
+
readonly sourceFrame: number;
|
|
12
|
+
}>;
|
|
6
13
|
export declare const TimelineEffectPropItem: React.FC<{
|
|
7
14
|
readonly field: EffectSchemaFieldInfo;
|
|
8
15
|
readonly validatedLocation: CodePosition;
|
|
@@ -10,4 +17,5 @@ export declare const TimelineEffectPropItem: React.FC<{
|
|
|
10
17
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
11
18
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
12
19
|
readonly keyframeDisplayOffset: number;
|
|
20
|
+
readonly keyframeControlsMode?: TimelineKeyframeControlsMode;
|
|
13
21
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimelineEffectPropItem = void 0;
|
|
3
|
+
exports.TimelineEffectPropItem = exports.TimelineEffectPropValue = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -40,7 +40,7 @@ const isResettableStatus = ({ status, defaultValue, }) => {
|
|
|
40
40
|
const effectiveCodeValue = (_a = status.codeValue) !== null && _a !== void 0 ? _a : defaultValue;
|
|
41
41
|
return JSON.stringify(effectiveCodeValue) !== JSON.stringify(defaultValue);
|
|
42
42
|
};
|
|
43
|
-
const
|
|
43
|
+
const TimelineEffectPropValue = ({ field, nodePath, validatedLocation, sourceFrame }) => {
|
|
44
44
|
var _a;
|
|
45
45
|
var _b;
|
|
46
46
|
const { setEffectDragOverrides, clearEffectDragOverrides, setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -58,13 +58,11 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
|
|
|
58
58
|
const propStatus = effectStatus.type === 'can-update-effect'
|
|
59
59
|
? ((_b = (_a = effectStatus.props) === null || _a === void 0 ? void 0 : _a[field.key]) !== null && _b !== void 0 ? _b : null)
|
|
60
60
|
: null;
|
|
61
|
-
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
62
|
-
const jsxFrame = timelinePosition - keyframeDisplayOffset;
|
|
63
61
|
const onDragValueChange = (0, react_1.useCallback)((value) => {
|
|
64
62
|
const nextDragOverrideValue = propStatus !== null && isKeyframedStatus(propStatus)
|
|
65
63
|
? remotion_1.Internals.makeKeyframedDragOverride({
|
|
66
64
|
status: propStatus,
|
|
67
|
-
frame:
|
|
65
|
+
frame: sourceFrame,
|
|
68
66
|
value,
|
|
69
67
|
})
|
|
70
68
|
: remotion_1.Internals.makeStaticDragOverride(value);
|
|
@@ -72,10 +70,10 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
|
|
|
72
70
|
}, [
|
|
73
71
|
field.effectIndex,
|
|
74
72
|
field.key,
|
|
75
|
-
jsxFrame,
|
|
76
73
|
nodePath,
|
|
77
74
|
propStatus,
|
|
78
75
|
setEffectDragOverrides,
|
|
76
|
+
sourceFrame,
|
|
79
77
|
]);
|
|
80
78
|
const onDragEnd = (0, react_1.useCallback)(() => {
|
|
81
79
|
clearEffectDragOverrides(nodePath, field.effectIndex);
|
|
@@ -142,7 +140,7 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
|
|
|
142
140
|
setPropStatuses,
|
|
143
141
|
validatedLocation,
|
|
144
142
|
]);
|
|
145
|
-
const onSaveKeyframed = (0, react_1.useCallback)((value,
|
|
143
|
+
const onSaveKeyframed = (0, react_1.useCallback)((value, frame) => {
|
|
146
144
|
if (!validatedLocation) {
|
|
147
145
|
return Promise.reject(new Error('Cannot save'));
|
|
148
146
|
}
|
|
@@ -154,7 +152,7 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
|
|
|
154
152
|
nodePath,
|
|
155
153
|
effectIndex: field.effectIndex,
|
|
156
154
|
fieldKey: field.key,
|
|
157
|
-
sourceFrame,
|
|
155
|
+
sourceFrame: frame,
|
|
158
156
|
value,
|
|
159
157
|
schema: field.effectSchema,
|
|
160
158
|
setPropStatuses,
|
|
@@ -197,7 +195,7 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
|
|
|
197
195
|
return null;
|
|
198
196
|
}
|
|
199
197
|
if (isKeyframedStatus(propStatus)) {
|
|
200
|
-
return (jsx_runtime_1.jsx(TimelineKeyframedValue_1.TimelineKeyframedValue, { field: field, propStatus: propStatus,
|
|
198
|
+
return (jsx_runtime_1.jsx(TimelineKeyframedValue_1.TimelineKeyframedValue, { field: field, propStatus: propStatus, sourceFrame: sourceFrame, dragOverrideValue: dragOverrideValue, onSave: onSaveKeyframed, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, scaleLockNodePath: nodePath }));
|
|
201
199
|
}
|
|
202
200
|
if (propStatus.status === 'computed') {
|
|
203
201
|
return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: (0, get_timeline_keyframes_1.getComputedStatusLabel)(propStatus) });
|
|
@@ -206,12 +204,13 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
|
|
|
206
204
|
propStatus,
|
|
207
205
|
dragOverrideValue,
|
|
208
206
|
defaultValue: field.fieldSchema.default,
|
|
209
|
-
frame:
|
|
207
|
+
frame: sourceFrame,
|
|
210
208
|
shouldResortToDefaultValueIfUndefined: true,
|
|
211
209
|
});
|
|
212
210
|
return (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: propStatus, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, effectiveValue: effectiveValue, scaleLockNodePath: null }));
|
|
213
211
|
};
|
|
214
|
-
|
|
212
|
+
exports.TimelineEffectPropValue = TimelineEffectPropValue;
|
|
213
|
+
const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath, nodePathInfo, keyframeDisplayOffset, keyframeControlsMode = 'timeline', }) => {
|
|
215
214
|
var _a;
|
|
216
215
|
var _b, _c;
|
|
217
216
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
@@ -220,6 +219,8 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
|
|
|
220
219
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
221
220
|
const { getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
222
221
|
const selection = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
222
|
+
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
223
|
+
const sourceFrame = timelinePosition - keyframeDisplayOffset;
|
|
223
224
|
const style = (0, react_1.useMemo)(() => {
|
|
224
225
|
return {
|
|
225
226
|
...fieldRowBase,
|
|
@@ -238,15 +239,18 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
|
|
|
238
239
|
const overrides = getEffectDragOverrides(nodePath, field.effectIndex);
|
|
239
240
|
return overrides[field.key];
|
|
240
241
|
}, [getEffectDragOverrides, nodePath, field.effectIndex, field.key]);
|
|
242
|
+
const keyframable = (0, studio_shared_1.isSchemaFieldKeyframable)({
|
|
243
|
+
schema: field.effectSchema,
|
|
244
|
+
key: field.key,
|
|
245
|
+
});
|
|
241
246
|
const keyframeControls = propStatus !== null &&
|
|
242
|
-
(
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}),
|
|
249
|
-
}) ? (jsx_runtime_1.jsx(TimelineKeyframeControls_1.TimelineKeyframeControls, { fieldKey: field.key, propStatus: propStatus, nodePath: nodePath, fileName: validatedLocation.source, keyframeDisplayOffset: keyframeDisplayOffset, defaultValue: field.fieldSchema.default, dragOverrideValue: dragOverrideValue, schema: field.effectSchema, effectIndex: field.effectIndex, nodePathInfo: nodePathInfo })) : null;
|
|
247
|
+
(keyframeControlsMode === 'inspector'
|
|
248
|
+
? keyframable
|
|
249
|
+
: (0, TimelineKeyframeControls_1.shouldShowTimelineKeyframeControls)({
|
|
250
|
+
propStatus,
|
|
251
|
+
selected: selection.selected,
|
|
252
|
+
keyframable,
|
|
253
|
+
})) ? (jsx_runtime_1.jsx(TimelineKeyframeControls_1.TimelineKeyframeControls, { fieldKey: field.key, propStatus: propStatus, nodePath: nodePath, fileName: validatedLocation.source, keyframeDisplayOffset: keyframeDisplayOffset, defaultValue: field.fieldSchema.default, dragOverrideValue: dragOverrideValue, schema: field.effectSchema, effectIndex: field.effectIndex, nodePathInfo: nodePathInfo, mode: keyframeControlsMode })) : null;
|
|
250
254
|
const canResetToDefault = (0, react_1.useMemo)(() => {
|
|
251
255
|
if (!propStatus || propStatus.status === 'computed') {
|
|
252
256
|
return false;
|
|
@@ -356,7 +360,7 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
|
|
|
356
360
|
propStatus,
|
|
357
361
|
]);
|
|
358
362
|
const row = (jsx_runtime_1.jsxs(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), keyframeControls: keyframeControls, arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: style, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: [
|
|
359
|
-
jsx_runtime_1.jsx(TimelineFieldLabel_1.TimelineFieldLabel, { rowDepth: rowDepth, selected: selection.selected, label: (_c = field.description) !== null && _c !== void 0 ? _c : field.key }), jsx_runtime_1.jsx("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: jsx_runtime_1.jsx(
|
|
363
|
+
jsx_runtime_1.jsx(TimelineFieldLabel_1.TimelineFieldLabel, { rowDepth: rowDepth, selected: selection.selected, label: (_c = field.description) !== null && _c !== void 0 ? _c : field.key }), jsx_runtime_1.jsx("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: jsx_runtime_1.jsx(exports.TimelineEffectPropValue, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, sourceFrame: sourceFrame }) })
|
|
360
364
|
] }));
|
|
361
365
|
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: selection.selectable ? selection.onSelect : null, children: row }));
|
|
362
366
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SequencePropsSubscriptionKey,
|
|
2
|
+
import type { SequencePropsSubscriptionKey, InteractivitySchema } 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 { TimelineTreeNode } from '../../helpers/timeline-layout';
|
|
6
6
|
import type { GetIsExpanded } from '../ExpandedTracksProvider';
|
|
7
|
+
import type { TimelineKeyframeControlsMode } from './TimelineKeyframeControls';
|
|
7
8
|
export declare const TimelineExpandedRow: React.FC<{
|
|
8
9
|
readonly node: TimelineTreeNode;
|
|
9
10
|
readonly depth: number;
|
|
10
11
|
readonly nestedDepth: number;
|
|
12
|
+
readonly rowDepthBase?: number;
|
|
11
13
|
readonly getIsExpanded: GetIsExpanded;
|
|
12
14
|
readonly toggleTrack: (nodePathInfo: SequenceNodePathInfo) => void;
|
|
13
15
|
readonly validatedLocation: CodePosition;
|
|
14
16
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
15
|
-
readonly schema:
|
|
17
|
+
readonly schema: InteractivitySchema;
|
|
16
18
|
readonly keyframeDisplayOffset: number;
|
|
19
|
+
readonly keyframeControlsMode?: TimelineKeyframeControlsMode;
|
|
17
20
|
}>;
|
|
@@ -20,8 +20,8 @@ const rowLabel = {
|
|
|
20
20
|
color: 'rgba(255, 255, 255, 0.8)',
|
|
21
21
|
userSelect: 'none',
|
|
22
22
|
};
|
|
23
|
-
const TimelineExpandedRow = ({ node, depth, nestedDepth, getIsExpanded, toggleTrack, validatedLocation, nodePath, schema, keyframeDisplayOffset, }) => {
|
|
24
|
-
const rowDepth = (0, timeline_row_layout_1.getExpandedRowDepth)({ nestedDepth, treeDepth:
|
|
23
|
+
const TimelineExpandedRow = ({ node, depth, nestedDepth, rowDepthBase, getIsExpanded, toggleTrack, validatedLocation, nodePath, schema, keyframeDisplayOffset, keyframeControlsMode, }) => {
|
|
24
|
+
const rowDepth = (rowDepthBase !== null && rowDepthBase !== void 0 ? rowDepthBase : (0, timeline_row_layout_1.getExpandedRowDepth)({ nestedDepth, treeDepth: 0 })) + depth;
|
|
25
25
|
const selection = (0, TimelineSelection_1.useTimelineRowSelection)(node.nodePathInfo);
|
|
26
26
|
const labelStyle = react_1.default.useMemo(() => ({
|
|
27
27
|
...rowLabel,
|
|
@@ -48,10 +48,10 @@ const TimelineExpandedRow = ({ node, depth, nestedDepth, getIsExpanded, toggleTr
|
|
|
48
48
|
}
|
|
49
49
|
if (node.field) {
|
|
50
50
|
if (node.field.kind === 'effect-field') {
|
|
51
|
-
return (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropItem, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath, nodePathInfo: node.nodePathInfo, keyframeDisplayOffset: keyframeDisplayOffset }));
|
|
51
|
+
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
52
|
}
|
|
53
53
|
if (node.field.kind === 'sequence-field') {
|
|
54
|
-
return (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequencePropItem, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath, nodePathInfo: node.nodePathInfo, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset }));
|
|
54
|
+
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
55
|
}
|
|
56
56
|
throw new Error('Unexpected field kind: ' + JSON.stringify(node.field));
|
|
57
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { TSequence } 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
|
export declare const TimelineExpandedSection: React.FC<{
|
|
@@ -36,11 +36,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.TimelineExpandedSection = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
|
-
const remotion_1 = require("remotion");
|
|
40
39
|
const colors_1 = require("../../helpers/colors");
|
|
41
40
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
42
|
-
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
43
41
|
const TimelineExpandedRow_1 = require("./TimelineExpandedRow");
|
|
42
|
+
const use_timeline_expanded_tree_1 = require("./use-timeline-expanded-tree");
|
|
44
43
|
const expandedSectionBase = {
|
|
45
44
|
color: 'white',
|
|
46
45
|
fontFamily: 'Arial, Helvetica, sans-serif',
|
|
@@ -54,30 +53,17 @@ const separator = {
|
|
|
54
53
|
borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
|
|
55
54
|
};
|
|
56
55
|
const TimelineExpandedSection = ({ sequence, validatedLocation, nodePathInfo, nestedDepth, keyframeDisplayOffset, }) => {
|
|
57
|
-
const { getIsExpanded } = (0,
|
|
58
|
-
const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
|
|
59
|
-
const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
60
|
-
const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
61
|
-
const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({
|
|
56
|
+
const { getIsExpanded, propStatuses, toggleTrack, tree } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
62
57
|
sequence,
|
|
63
58
|
nodePathInfo,
|
|
64
|
-
|
|
65
|
-
getEffectDragOverrides,
|
|
66
|
-
propStatuses: visualModePropStatuses,
|
|
67
|
-
}), [
|
|
68
|
-
sequence,
|
|
69
|
-
nodePathInfo,
|
|
70
|
-
getDragOverrides,
|
|
71
|
-
getEffectDragOverrides,
|
|
72
|
-
visualModePropStatuses,
|
|
73
|
-
]);
|
|
59
|
+
});
|
|
74
60
|
const flat = (0, react_1.useMemo)(() => (0, timeline_layout_1.flattenVisibleTreeNodes)({ nodes: tree, getIsExpanded }), [tree, getIsExpanded]);
|
|
75
61
|
const expandedHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getExpandedTrackHeight)({
|
|
76
62
|
sequence,
|
|
77
63
|
nodePathInfo,
|
|
78
64
|
getIsExpanded,
|
|
79
|
-
propStatuses
|
|
80
|
-
}), [sequence, nodePathInfo, getIsExpanded,
|
|
65
|
+
propStatuses,
|
|
66
|
+
}), [sequence, nodePathInfo, getIsExpanded, propStatuses]);
|
|
81
67
|
const style = (0, react_1.useMemo)(() => {
|
|
82
68
|
return {
|
|
83
69
|
...expandedSectionBase,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CanUpdateSequencePropStatus, DragOverrideValue, SequencePropsSubscriptionKey,
|
|
2
|
+
import type { CanUpdateSequencePropStatus, DragOverrideValue, SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
4
|
import { type TimelineSelection } from './TimelineSelection';
|
|
5
5
|
export declare const getSelectedKeyframeControlNodePathInfos: ({ clickedNodePathInfo, selectedItems, }: {
|
|
@@ -11,6 +11,11 @@ export declare const shouldShowTimelineKeyframeControls: ({ propStatus, selected
|
|
|
11
11
|
selected: boolean;
|
|
12
12
|
keyframable: boolean;
|
|
13
13
|
}) => boolean;
|
|
14
|
+
export type TimelineKeyframeControlsMode = 'timeline' | 'inspector';
|
|
15
|
+
export declare const shouldShowTimelineKeyframeNavigation: ({ propStatus, selected, }: {
|
|
16
|
+
readonly propStatus: CanUpdateSequencePropStatus;
|
|
17
|
+
readonly selected: boolean;
|
|
18
|
+
}) => boolean;
|
|
14
19
|
export declare const TimelineKeyframeControls: React.FC<{
|
|
15
20
|
readonly fieldKey: string;
|
|
16
21
|
readonly propStatus: CanUpdateSequencePropStatus;
|
|
@@ -19,7 +24,8 @@ export declare const TimelineKeyframeControls: React.FC<{
|
|
|
19
24
|
readonly keyframeDisplayOffset: number;
|
|
20
25
|
readonly defaultValue: unknown;
|
|
21
26
|
readonly dragOverrideValue: DragOverrideValue | undefined;
|
|
22
|
-
readonly schema:
|
|
27
|
+
readonly schema: InteractivitySchema;
|
|
23
28
|
readonly effectIndex: number | null;
|
|
24
29
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
30
|
+
readonly mode?: TimelineKeyframeControlsMode;
|
|
25
31
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimelineKeyframeControls = exports.shouldShowTimelineKeyframeControls = exports.getSelectedKeyframeControlNodePathInfos = void 0;
|
|
3
|
+
exports.TimelineKeyframeControls = exports.shouldShowTimelineKeyframeNavigation = exports.shouldShowTimelineKeyframeControls = exports.getSelectedKeyframeControlNodePathInfos = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -255,6 +255,13 @@ const shouldShowTimelineKeyframeControls = ({ propStatus, selected, keyframable,
|
|
|
255
255
|
return isKeyframedStatus(propStatus);
|
|
256
256
|
};
|
|
257
257
|
exports.shouldShowTimelineKeyframeControls = shouldShowTimelineKeyframeControls;
|
|
258
|
+
const shouldShowTimelineKeyframeNavigation = ({ propStatus, selected, }) => {
|
|
259
|
+
if (selected) {
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
return isKeyframedStatus(propStatus);
|
|
263
|
+
};
|
|
264
|
+
exports.shouldShowTimelineKeyframeNavigation = shouldShowTimelineKeyframeNavigation;
|
|
258
265
|
const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, keyframeDisplayOffset, defaultValue, dragOverrideValue, schema, effectIndex, nodePathInfo, }) => {
|
|
259
266
|
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
260
267
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
@@ -278,6 +285,18 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
|
|
|
278
285
|
}, [jsxFrame, propStatus]);
|
|
279
286
|
const previousDisplayFrame = (0, react_1.useMemo)(() => (0, get_keyframe_navigation_1.getPreviousKeyframeDisplayFrame)(keyframes, timelinePosition, videoConfig.durationInFrames), [keyframes, timelinePosition, videoConfig.durationInFrames]);
|
|
280
287
|
const nextDisplayFrame = (0, react_1.useMemo)(() => (0, get_keyframe_navigation_1.getNextKeyframeDisplayFrame)(keyframes, timelinePosition, videoConfig.durationInFrames), [keyframes, timelinePosition, videoConfig.durationInFrames]);
|
|
288
|
+
const propertySelected = (0, react_1.useMemo)(() => {
|
|
289
|
+
const propertySelection = (0, TimelineSelection_1.getTimelineSelectionFromNodePathInfo)(nodePathInfo);
|
|
290
|
+
if (propertySelection === null) {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
const propertySelectionKey = (0, TimelineSelection_1.getTimelineSelectionKey)(propertySelection);
|
|
294
|
+
return selectedItems.some((selection) => (0, TimelineSelection_1.getTimelineSelectionKey)(selection) === propertySelectionKey);
|
|
295
|
+
}, [nodePathInfo, selectedItems]);
|
|
296
|
+
const showNavigationButtons = (0, exports.shouldShowTimelineKeyframeNavigation)({
|
|
297
|
+
propStatus,
|
|
298
|
+
selected: propertySelected,
|
|
299
|
+
});
|
|
281
300
|
const keyframable = (0, studio_shared_1.isSchemaFieldKeyframable)({
|
|
282
301
|
schema,
|
|
283
302
|
key: fieldKey,
|
|
@@ -404,12 +423,14 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
|
|
|
404
423
|
...navButtonStyle,
|
|
405
424
|
cursor: previousDisabled ? 'default' : 'pointer',
|
|
406
425
|
opacity: previousDisabled ? 0.35 : 1,
|
|
407
|
-
|
|
426
|
+
visibility: showNavigationButtons ? 'visible' : 'hidden',
|
|
427
|
+
}), [previousDisabled, showNavigationButtons]);
|
|
408
428
|
const nextStyle = (0, react_1.useMemo)(() => ({
|
|
409
429
|
...navButtonStyle,
|
|
410
430
|
cursor: nextDisabled ? 'default' : 'pointer',
|
|
411
431
|
opacity: nextDisabled ? 0.35 : 1,
|
|
412
|
-
|
|
432
|
+
visibility: showNavigationButtons ? 'visible' : 'hidden',
|
|
433
|
+
}), [nextDisabled, showNavigationButtons]);
|
|
413
434
|
const diamondStyle = (0, react_1.useMemo)(() => ({
|
|
414
435
|
...diamondButtonStyle,
|
|
415
436
|
cursor: canToggleKeyframe && clientId ? 'pointer' : 'default',
|