@remotion/studio 4.0.484 → 4.0.486
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/ResolveCompositionConfigInStudio.js +42 -0
- package/dist/components/AssetSelector.js +1 -1
- package/dist/components/AssetSelectorItem.js +9 -9
- package/dist/components/AudioWaveform.js +3 -3
- package/dist/components/Button.js +2 -2
- package/dist/components/Canvas.js +28 -0
- package/dist/components/CanvasOrLoading.js +1 -1
- package/dist/components/CheckboardToggle.js +1 -1
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ColorPicker/AlphaSlider.js +4 -3
- package/dist/components/ColorPicker/ColorPicker.js +4 -4
- package/dist/components/ColorPicker/ColorPickerPopup.js +10 -10
- package/dist/components/ColorPicker/HueSlider.js +4 -3
- package/dist/components/ColorPicker/SaturationValueArea.js +5 -4
- package/dist/components/ColorPicker/checker.d.ts +1 -1
- package/dist/components/ColorPicker/checker.js +3 -3
- package/dist/components/CompactExplanation.js +3 -3
- package/dist/components/CompositionSelector.js +141 -5
- package/dist/components/CompositionSelectorItem.d.ts +1 -0
- package/dist/components/CompositionSelectorItem.js +103 -11
- package/dist/components/ContextMenu.js +75 -1
- package/dist/components/CopyButton.js +3 -2
- package/dist/components/CurrentAsset.d.ts +3 -1
- package/dist/components/CurrentAsset.js +15 -2
- package/dist/components/CurrentComposition.js +3 -2
- package/dist/components/EffectPickerModal.js +1 -1
- package/dist/components/FilePreview.js +2 -1
- package/dist/components/FpsCounter.js +3 -2
- package/dist/components/FullscreenToggle.js +2 -1
- package/dist/components/GlobalKeybindings.js +0 -12
- package/dist/components/InlineAction.js +2 -2
- package/dist/components/InlineCompositionName.d.ts +7 -0
- package/dist/components/InlineCompositionName.js +58 -0
- package/dist/components/InlineEditableTitle.d.ts +8 -0
- package/dist/components/InlineEditableTitle.js +134 -0
- package/dist/components/InspectorInfoHeader.js +2 -2
- package/dist/components/InspectorPanel/DefaultInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/DefaultInspector.js +2 -2
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +1 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +17 -30
- package/dist/components/InspectorPanel/common.js +2 -2
- package/dist/components/InspectorPanel/styles.js +5 -5
- package/dist/components/InspectorPanel.d.ts +1 -0
- package/dist/components/InspectorPanel.js +2 -2
- package/dist/components/InspectorSequenceSection.js +35 -2
- package/dist/components/InstallablePackage.js +1 -1
- package/dist/components/KeyboardShortcutsExplainer.js +5 -5
- package/dist/components/LoopToggle.js +1 -1
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuSubItem.js +1 -1
- package/dist/components/Menu/styles.js +3 -3
- package/dist/components/MenuToolbar.js +2 -2
- package/dist/components/ModalButton.js +1 -1
- package/dist/components/ModalContainer.js +3 -3
- package/dist/components/ModalFooter.js +2 -1
- package/dist/components/ModalHeader.js +3 -2
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CancelButton.js +4 -3
- package/dist/components/NewComposition/CodemodFooter.d.ts +7 -1
- package/dist/components/NewComposition/CodemodFooter.js +17 -12
- package/dist/components/NewComposition/ComboBox.js +3 -3
- package/dist/components/NewComposition/DeleteComposition.js +7 -1
- package/dist/components/NewComposition/DeleteFolder.js +7 -1
- package/dist/components/NewComposition/DuplicateComposition.js +17 -10
- package/dist/components/NewComposition/InputAndValidationContainer.d.ts +3 -0
- package/dist/components/NewComposition/InputAndValidationContainer.js +15 -0
- package/dist/components/NewComposition/InputDragger.js +11 -3
- package/dist/components/NewComposition/MenuContent.js +1 -1
- package/dist/components/NewComposition/NewCompDuration.js +7 -6
- package/dist/components/NewComposition/NewComposition.d.ts +5 -1
- package/dist/components/NewComposition/NewComposition.js +31 -85
- package/dist/components/NewComposition/NewFolder.d.ts +5 -0
- package/dist/components/NewComposition/NewFolder.js +86 -0
- package/dist/components/NewComposition/RemInput.js +3 -3
- package/dist/components/NewComposition/RemTextarea.js +1 -1
- package/dist/components/NewComposition/RenameComposition.js +13 -14
- package/dist/components/NewComposition/RenameFolder.js +9 -2
- package/dist/components/NewComposition/RenameStaticFile.js +22 -60
- package/dist/components/NewComposition/ValidationMessage.js +10 -2
- package/dist/components/NewComposition/use-rename-static-file.d.ts +18 -0
- package/dist/components/NewComposition/use-rename-static-file.js +90 -0
- package/dist/components/NoRegisterRoot.js +3 -2
- package/dist/components/Notifications/ColorDot.js +3 -2
- package/dist/components/Notifications/Notification.js +4 -4
- package/dist/components/Notifications/NotificationCenter.js +2 -1
- package/dist/components/Notifications/ServerDisconnected.js +5 -4
- package/dist/components/OptionsPanel.d.ts +0 -3
- package/dist/components/OptionsPanel.js +8 -4
- package/dist/components/OutlineToggle.js +1 -1
- package/dist/components/PlayPause.js +4 -3
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/QuickSwitcher/AlgoliaCredit.js +2 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +2 -2
- package/dist/components/RefreshCompositionOverlay.js +2 -1
- package/dist/components/RenderButton.js +9 -9
- package/dist/components/RenderModal/CliCopyButton.js +1 -1
- package/dist/components/RenderModal/ClientRenderProgress.js +1 -1
- package/dist/components/RenderModal/DataEditor.js +1 -1
- package/dist/components/RenderModal/GuiRenderStatus.js +1 -1
- package/dist/components/RenderModal/InfoBubble.js +2 -2
- package/dist/components/RenderModal/InfoTooltip.js +3 -3
- package/dist/components/RenderModal/InlineEyeIcon.js +2 -1
- package/dist/components/RenderModal/InlineRemoveButton.js +2 -1
- package/dist/components/RenderModal/MultiRangeSlider.js +1 -1
- package/dist/components/RenderModal/OptionExplainer.js +2 -2
- package/dist/components/RenderModal/RenderModalHr.js +2 -1
- package/dist/components/RenderModal/RenderStatusModal.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaResetButton.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaVerticalGuide.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +2 -1
- package/dist/components/RenderModal/ServerRenderModal.js +5 -4
- package/dist/components/RenderModal/WarningIndicatorButton.js +4 -6
- package/dist/components/RenderModal/WebRenderModal.js +2 -1
- package/dist/components/RenderModal/WebRenderModalAudio.js +4 -3
- package/dist/components/RenderModal/WebRenderModalLicense.js +2 -2
- package/dist/components/RenderModal/WebRenderModalPicture.js +2 -1
- package/dist/components/RenderModal/render-modals.js +3 -3
- package/dist/components/RenderPreview.js +1 -1
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/components/RenderQueue/index.js +1 -1
- package/dist/components/RendersTab.js +2 -2
- package/dist/components/SegmentedControl.js +3 -3
- package/dist/components/SelectedOutlineElement.d.ts +5 -0
- package/dist/components/SelectedOutlineElement.js +52 -10
- package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
- package/dist/components/SelectedOutlineOverlay.js +16 -4
- package/dist/components/SelectedOutlineUvControls.js +5 -5
- package/dist/components/SidebarCollapserControls.js +5 -4
- package/dist/components/Splitter/SplitterElement.js +2 -1
- package/dist/components/StaticFilePreview.js +1 -1
- package/dist/components/Tabs/index.js +3 -3
- package/dist/components/Tabs/vertical.js +3 -3
- package/dist/components/TextViewer.js +2 -1
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/EasingEditorModal.js +8 -8
- package/dist/components/Timeline/KeyframeSettingsModal.js +1 -1
- package/dist/components/Timeline/LoopedIndicator.js +2 -2
- package/dist/components/Timeline/MaxTimelineTracks.js +3 -2
- package/dist/components/Timeline/TimelineArrayField.js +6 -5
- package/dist/components/Timeline/TimelineColorField.js +2 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +34 -1
- package/dist/components/Timeline/TimelineEffectItem.js +3 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +2 -2
- package/dist/components/Timeline/TimelineExpandArrowButton.js +3 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +2 -1
- package/dist/components/Timeline/TimelineFieldLabel.js +2 -1
- package/dist/components/Timeline/TimelineFontFamilyField.d.ts +11 -0
- package/dist/components/Timeline/TimelineFontFamilyField.js +545 -0
- package/dist/components/Timeline/TimelineImageInfo.js +2 -1
- package/dist/components/Timeline/TimelineInOutPointer.js +2 -1
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +4 -5
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -1
- package/dist/components/Timeline/TimelineKeyframeControls.js +3 -2
- package/dist/components/Timeline/TimelineKeyframeDiamondIcon.js +1 -1
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +1 -1
- package/dist/components/Timeline/TimelineLayerEye.js +3 -3
- package/dist/components/Timeline/TimelineMediaInfo.js +2 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +8 -0
- package/dist/components/Timeline/TimelineRotationField.js +4 -3
- package/dist/components/Timeline/TimelineScaleField.js +1 -1
- package/dist/components/Timeline/TimelineSchemaField.d.ts +2 -0
- package/dist/components/Timeline/TimelineSchemaField.js +47 -7
- package/dist/components/Timeline/TimelineScrollable.js +3 -2
- package/dist/components/Timeline/TimelineSelection.js +7 -6
- package/dist/components/Timeline/TimelineSequence.js +17 -20
- package/dist/components/Timeline/TimelineSequenceFrame.js +3 -2
- package/dist/components/Timeline/TimelineSequenceItem.js +27 -108
- package/dist/components/Timeline/TimelineSequenceName.js +3 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +8 -4
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +20 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +128 -11
- package/dist/components/Timeline/TimelineSlider.js +2 -1
- package/dist/components/Timeline/TimelineSliderHandle.js +2 -1
- package/dist/components/Timeline/TimelineTextContentField.d.ts +12 -0
- package/dist/components/Timeline/TimelineTextContentField.js +100 -0
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +2 -1
- package/dist/components/Timeline/TimelineWidthProvider.js +18 -3
- package/dist/components/Timeline/TimelineZoomControls.js +4 -3
- package/dist/components/Timeline/call-move-keyframe.d.ts +5 -0
- package/dist/components/Timeline/call-move-keyframe.js +14 -3
- package/dist/components/Timeline/focus-inspector-field.d.ts +16 -0
- package/dist/components/Timeline/focus-inspector-field.js +49 -0
- package/dist/components/Timeline/google-fonts-list.d.ts +6 -0
- package/dist/components/Timeline/google-fonts-list.js +1512 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +8 -1
- package/dist/components/Timeline/save-sequence-prop.js +63 -19
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +38 -0
- package/dist/components/Timeline/split-selected-timeline-item.js +156 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +2 -0
- package/dist/components/Timeline/timeline-rotation-field-utils.d.ts +5 -0
- package/dist/components/Timeline/timeline-rotation-field-utils.js +16 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +5 -2
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
- package/dist/components/Timeline/use-rename-sequence.d.ts +30 -0
- package/dist/components/Timeline/use-rename-sequence.js +115 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
- package/dist/components/Timeline/use-timeline-height.js +1 -0
- package/dist/components/TimelineInOutToggle.js +1 -1
- package/dist/components/UpdateCheck.js +2 -2
- package/dist/components/UpdateModal/OpenIssueButton.js +1 -1
- package/dist/components/VisualControls/ClickableFileName.js +2 -2
- package/dist/components/composition-menu-items.js +3 -0
- package/dist/components/effect-drag-and-drop.js +1 -0
- package/dist/components/folder-menu-items.js +20 -0
- package/dist/components/import-assets.d.ts +7 -1
- package/dist/components/import-assets.js +55 -1
- package/dist/components/options-sidebar-tabs.d.ts +4 -0
- package/dist/components/options-sidebar-tabs.js +5 -0
- package/dist/components/selected-outline-measurement.js +2 -1
- package/dist/components/selected-outline-types.d.ts +6 -1
- package/dist/error-overlay/remotion-overlay/CalculateMetadataErrorExplainer.js +2 -2
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +7 -5
- package/dist/error-overlay/remotion-overlay/CompositionIdListItem.js +2 -2
- package/dist/error-overlay/remotion-overlay/DismissButton.js +3 -2
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +3 -2
- package/dist/error-overlay/remotion-overlay/ErrorMessage.js +4 -4
- package/dist/error-overlay/remotion-overlay/HelpLink.js +1 -1
- package/dist/error-overlay/remotion-overlay/MediaPlaybackErrorExplainer.js +4 -4
- package/dist/error-overlay/remotion-overlay/Overlay.js +3 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +4 -3
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +2 -1
- package/dist/error-overlay/remotion-overlay/carets.js +3 -2
- package/dist/esm/{chunk-9erwh79m.js → chunk-975rp13y.js} +11165 -7032
- package/dist/esm/chunk-jefhcs5z.js +164 -0
- package/dist/esm/internals.mjs +11166 -6999
- package/dist/esm/previewEntry.mjs +10697 -6526
- package/dist/esm/renderEntry.mjs +8 -5
- package/dist/helpers/checkerboard-background.js +4 -12
- package/dist/helpers/colors.d.ts +99 -7
- package/dist/helpers/colors.js +118 -10
- package/dist/helpers/inject-css.js +85 -83
- package/dist/helpers/render-codec-label.d.ts +1 -1
- package/dist/helpers/timeline-layout.d.ts +7 -4
- package/dist/helpers/timeline-layout.js +3 -1
- package/dist/helpers/use-create-composition.d.ts +35 -0
- package/dist/helpers/use-create-composition.js +111 -0
- package/dist/helpers/use-menu-structure.js +31 -3
- package/dist/helpers/use-rename-composition.d.ts +16 -0
- package/dist/helpers/use-rename-composition.js +49 -0
- package/dist/helpers/validate-folder-rename.js +2 -10
- package/dist/helpers/validate-new-folder-name.d.ts +5 -0
- package/dist/helpers/validate-new-folder-name.js +16 -0
- package/dist/hot-middleware-client/client.js +3 -2
- package/dist/icons/Checkmark.js +2 -1
- package/dist/icons/audio.js +2 -1
- package/dist/icons/caret.js +2 -2
- package/dist/icons/certificate.js +2 -1
- package/dist/icons/data.js +2 -1
- package/dist/icons/eyedropper.js +2 -1
- package/dist/icons/file.js +2 -1
- package/dist/icons/frame.js +2 -1
- package/dist/icons/gear.js +2 -1
- package/dist/icons/gif.js +2 -1
- package/dist/icons/jump-to-start.js +2 -1
- package/dist/icons/keys.js +4 -3
- package/dist/icons/media-volume.js +1 -1
- package/dist/icons/minus.js +2 -1
- package/dist/icons/pause.js +2 -1
- package/dist/icons/play.js +2 -1
- package/dist/icons/redo.js +2 -1
- package/dist/icons/step-back.js +2 -1
- package/dist/icons/step-forward.js +2 -1
- package/dist/icons/undo.js +2 -1
- package/dist/previewEntry.js +2 -1
- package/dist/renderEntry.js +4 -3
- package/dist/state/modals.d.ts +7 -0
- package/dist/state/timeline-zoom.js +17 -14
- package/dist/state/z-index.d.ts +1 -0
- package/dist/state/z-index.js +11 -2
- package/package.json +12 -12
- package/dist/esm/chunk-6jf1natv.js +0 -25
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type SaveSequencePropSourceEdit } from '@remotion/studio-shared';
|
|
1
2
|
import type { CanUpdateSequencePropsResponse, SequencePropsSubscriptionKey, InteractivitySchema } from 'remotion';
|
|
3
|
+
import { type MoveEffectKeyframeChange, type MoveSequenceKeyframeChange } from './call-move-keyframe';
|
|
2
4
|
export type SetPropStatuses = (nodePath: SequencePropsSubscriptionKey, values: (prev: CanUpdateSequencePropsResponse) => CanUpdateSequencePropsResponse) => void;
|
|
3
5
|
export type SaveSequencePropChange = {
|
|
4
6
|
fileName: string;
|
|
@@ -7,13 +9,18 @@ export type SaveSequencePropChange = {
|
|
|
7
9
|
value: unknown;
|
|
8
10
|
defaultValue: string | null;
|
|
9
11
|
schema: InteractivitySchema;
|
|
12
|
+
sourceEdit?: SaveSequencePropSourceEdit;
|
|
10
13
|
};
|
|
11
14
|
type SaveSequencePropsOptions = {
|
|
12
15
|
changes: SaveSequencePropChange[];
|
|
16
|
+
movedKeyframes?: {
|
|
17
|
+
sequenceKeyframes: MoveSequenceKeyframeChange[];
|
|
18
|
+
effectKeyframes: MoveEffectKeyframeChange[];
|
|
19
|
+
};
|
|
13
20
|
setPropStatuses: SetPropStatuses;
|
|
14
21
|
clientId: string;
|
|
15
22
|
undoLabel: string;
|
|
16
23
|
redoLabel: string;
|
|
17
24
|
};
|
|
18
|
-
export declare const saveSequenceProps: ({ changes, setPropStatuses, clientId, undoLabel, redoLabel, }: SaveSequencePropsOptions) => Promise<void>;
|
|
25
|
+
export declare const saveSequenceProps: ({ changes, movedKeyframes, setPropStatuses, clientId, undoLabel, redoLabel, }: SaveSequencePropsOptions) => Promise<void>;
|
|
19
26
|
export {};
|
|
@@ -3,12 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.saveSequenceProps = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const call_api_1 = require("../call-api");
|
|
6
|
+
const call_move_keyframe_1 = require("./call-move-keyframe");
|
|
6
7
|
const save_prop_queue_1 = require("./save-prop-queue");
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
8
|
+
const serializeSequencePropValue = (value) => {
|
|
9
|
+
if (value === undefined) {
|
|
10
|
+
return { type: 'undefined' };
|
|
11
|
+
}
|
|
12
|
+
return { type: 'json', serialized: JSON.stringify(value) };
|
|
13
|
+
};
|
|
14
|
+
const saveSequenceProps = ({ changes, movedKeyframes, setPropStatuses, clientId, undoLabel, redoLabel, }) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const sequenceKeyframes = (_a = movedKeyframes === null || movedKeyframes === void 0 ? void 0 : movedKeyframes.sequenceKeyframes) !== null && _a !== void 0 ? _a : [];
|
|
17
|
+
const effectKeyframes = (_b = movedKeyframes === null || movedKeyframes === void 0 ? void 0 : movedKeyframes.effectKeyframes) !== null && _b !== void 0 ? _b : [];
|
|
18
|
+
if (changes.length === 0 &&
|
|
19
|
+
sequenceKeyframes.length === 0 &&
|
|
20
|
+
effectKeyframes.length === 0) {
|
|
9
21
|
return Promise.resolve();
|
|
10
22
|
}
|
|
11
|
-
if (changes.length === 1
|
|
23
|
+
if (changes.length === 1 &&
|
|
24
|
+
sequenceKeyframes.length === 0 &&
|
|
25
|
+
effectKeyframes.length === 0) {
|
|
12
26
|
const change = changes[0];
|
|
13
27
|
if (change === undefined) {
|
|
14
28
|
throw new Error('Expected a sequence prop change');
|
|
@@ -23,24 +37,33 @@ const saveSequenceProps = ({ changes, setPropStatuses, clientId, undoLabel, redo
|
|
|
23
37
|
defaultValue: change.defaultValue,
|
|
24
38
|
schema: change.schema,
|
|
25
39
|
}),
|
|
26
|
-
apiCall: () =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
apiCall: () => {
|
|
41
|
+
var _a;
|
|
42
|
+
return (0, call_api_1.callApi)('/api/save-sequence-props', {
|
|
43
|
+
edits: [
|
|
44
|
+
{
|
|
45
|
+
fileName: change.fileName,
|
|
46
|
+
nodePath: change.nodePath,
|
|
47
|
+
key: change.fieldKey,
|
|
48
|
+
value: serializeSequencePropValue(change.value),
|
|
49
|
+
defaultValue: change.defaultValue,
|
|
50
|
+
schema: change.schema,
|
|
51
|
+
sourceEdit: (_a = change.sourceEdit) !== null && _a !== void 0 ? _a : null,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
clientId,
|
|
55
|
+
undoLabel,
|
|
56
|
+
redoLabel,
|
|
57
|
+
});
|
|
58
|
+
},
|
|
41
59
|
errorLabel: 'Could not save sequence prop',
|
|
42
60
|
});
|
|
43
61
|
}
|
|
62
|
+
(0, call_move_keyframe_1.applyOptimisticKeyframeMoves)({
|
|
63
|
+
sequenceKeyframes,
|
|
64
|
+
effectKeyframes,
|
|
65
|
+
setPropStatuses,
|
|
66
|
+
});
|
|
44
67
|
for (const change of changes) {
|
|
45
68
|
setPropStatuses(change.nodePath, (prev) => (0, studio_shared_1.optimisticUpdateForPropStatuses)({
|
|
46
69
|
previous: prev,
|
|
@@ -52,15 +75,36 @@ const saveSequenceProps = ({ changes, setPropStatuses, clientId, undoLabel, redo
|
|
|
52
75
|
}
|
|
53
76
|
return (0, call_api_1.callApi)('/api/save-sequence-props', {
|
|
54
77
|
edits: changes.map((change) => {
|
|
78
|
+
var _a;
|
|
55
79
|
return {
|
|
56
80
|
fileName: change.fileName,
|
|
57
81
|
nodePath: change.nodePath,
|
|
58
82
|
key: change.fieldKey,
|
|
59
|
-
value:
|
|
83
|
+
value: serializeSequencePropValue(change.value),
|
|
60
84
|
defaultValue: change.defaultValue,
|
|
61
85
|
schema: change.schema,
|
|
86
|
+
sourceEdit: (_a = change.sourceEdit) !== null && _a !== void 0 ? _a : null,
|
|
62
87
|
};
|
|
63
88
|
}),
|
|
89
|
+
movedKeyframes: {
|
|
90
|
+
sequenceKeyframes: sequenceKeyframes.map((keyframe) => ({
|
|
91
|
+
fileName: keyframe.fileName,
|
|
92
|
+
nodePath: keyframe.nodePath,
|
|
93
|
+
key: keyframe.fieldKey,
|
|
94
|
+
fromFrame: keyframe.fromFrame,
|
|
95
|
+
toFrame: keyframe.toFrame,
|
|
96
|
+
schema: keyframe.schema,
|
|
97
|
+
})),
|
|
98
|
+
effectKeyframes: effectKeyframes.map((keyframe) => ({
|
|
99
|
+
fileName: keyframe.fileName,
|
|
100
|
+
sequenceNodePath: keyframe.nodePath,
|
|
101
|
+
effectIndex: keyframe.effectIndex,
|
|
102
|
+
key: keyframe.fieldKey,
|
|
103
|
+
fromFrame: keyframe.fromFrame,
|
|
104
|
+
toFrame: keyframe.toFrame,
|
|
105
|
+
schema: keyframe.schema,
|
|
106
|
+
})),
|
|
107
|
+
},
|
|
64
108
|
clientId,
|
|
65
109
|
undoLabel,
|
|
66
110
|
redoLabel,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CanUpdateSequencePropStatus, OverrideIdToNodePaths, PropStatuses, TSequence } from 'remotion';
|
|
2
|
+
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
|
+
import type { TimelineSelection } from './TimelineSelection';
|
|
4
|
+
export type SplitTimelineSequenceEligibility = {
|
|
5
|
+
canSplit: true;
|
|
6
|
+
nodePathInfo: SequenceNodePathInfo;
|
|
7
|
+
} | {
|
|
8
|
+
canSplit: false;
|
|
9
|
+
reason: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const getTimelineSequenceSplitUnsupportedReason: (componentName: string | null | undefined) => string | null;
|
|
12
|
+
export declare const getTimelineSequenceSplitEligibility: ({ selection, sequence, splitFrame, propStatuses, }: {
|
|
13
|
+
selection: TimelineSelection;
|
|
14
|
+
sequence: TSequence | null;
|
|
15
|
+
splitFrame: number;
|
|
16
|
+
propStatuses?: Partial<Record<"durationInFrames" | "from" | "trimBefore", CanUpdateSequencePropStatus>> | undefined;
|
|
17
|
+
}) => SplitTimelineSequenceEligibility;
|
|
18
|
+
export declare const splitTimelineSequenceFromSource: ({ nodePathInfo, splitFrame, }: {
|
|
19
|
+
nodePathInfo: SequenceNodePathInfo;
|
|
20
|
+
splitFrame: number;
|
|
21
|
+
}) => Promise<boolean>;
|
|
22
|
+
export declare const shouldHandleTimelineDuplicateShortcut: ({ shiftKey, }: {
|
|
23
|
+
readonly shiftKey: boolean;
|
|
24
|
+
}) => boolean;
|
|
25
|
+
export declare const shouldHandleTimelineSplitShortcut: ({ shiftKey, }: {
|
|
26
|
+
readonly shiftKey: boolean;
|
|
27
|
+
}) => boolean;
|
|
28
|
+
export declare const splitSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, propStatuses, splitFrame, splitSequence, }: {
|
|
29
|
+
selections: readonly TimelineSelection[];
|
|
30
|
+
sequences: TSequence[];
|
|
31
|
+
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
32
|
+
propStatuses: PropStatuses | undefined;
|
|
33
|
+
splitFrame: number;
|
|
34
|
+
splitSequence?: ((options: {
|
|
35
|
+
nodePathInfo: SequenceNodePathInfo;
|
|
36
|
+
splitFrame: number;
|
|
37
|
+
}) => Promise<boolean>) | undefined;
|
|
38
|
+
}) => Promise<boolean> | null;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitSelectedTimelineItems = exports.shouldHandleTimelineSplitShortcut = exports.shouldHandleTimelineDuplicateShortcut = exports.splitTimelineSequenceFromSource = exports.getTimelineSequenceSplitEligibility = exports.getTimelineSequenceSplitUnsupportedReason = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const call_api_1 = require("../call-api");
|
|
6
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
7
|
+
const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info");
|
|
8
|
+
const getTimelineSequenceSplitUnsupportedReason = (componentName) => {
|
|
9
|
+
if (componentName === '<TransitionSeries.Sequence>' ||
|
|
10
|
+
componentName === '<TransitionSeries.Overlay>') {
|
|
11
|
+
return `${componentName} cannot be split from source`;
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
};
|
|
15
|
+
exports.getTimelineSequenceSplitUnsupportedReason = getTimelineSequenceSplitUnsupportedReason;
|
|
16
|
+
const staticNumberish = (status) => {
|
|
17
|
+
if (!status) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return (status.status === 'static' &&
|
|
21
|
+
(typeof status.codeValue === 'number' || status.codeValue === undefined));
|
|
22
|
+
};
|
|
23
|
+
const getTimelineSequenceSplitEligibility = ({ selection, sequence, splitFrame, propStatuses, }) => {
|
|
24
|
+
var _a;
|
|
25
|
+
if (selection.type !== 'sequence') {
|
|
26
|
+
return {
|
|
27
|
+
canSplit: false,
|
|
28
|
+
reason: 'Select one sequence to split',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (!sequence) {
|
|
32
|
+
return {
|
|
33
|
+
canSplit: false,
|
|
34
|
+
reason: 'Could not find selected sequence',
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (!Number.isInteger(splitFrame)) {
|
|
38
|
+
return {
|
|
39
|
+
canSplit: false,
|
|
40
|
+
reason: 'Split frame must be an integer',
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (sequence.isInsideSeries) {
|
|
44
|
+
return {
|
|
45
|
+
canSplit: false,
|
|
46
|
+
reason: 'Series.Sequence clips cannot be split from source',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const unsupportedReason = (0, exports.getTimelineSequenceSplitUnsupportedReason)((_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.componentName);
|
|
50
|
+
if (unsupportedReason) {
|
|
51
|
+
return {
|
|
52
|
+
canSplit: false,
|
|
53
|
+
reason: unsupportedReason,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const { nodePathInfo } = selection;
|
|
57
|
+
if (!nodePathInfo.sequenceSubscriptionKey.nodePath) {
|
|
58
|
+
return {
|
|
59
|
+
canSplit: false,
|
|
60
|
+
reason: 'Sequence has no editable source node',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (nodePathInfo.numberOfSequencesWithThisNodePath > 1) {
|
|
64
|
+
return {
|
|
65
|
+
canSplit: false,
|
|
66
|
+
reason: 'Programmatically duplicated sequences cannot be split',
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (!staticNumberish(propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses.from) ||
|
|
70
|
+
!staticNumberish(propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses.durationInFrames) ||
|
|
71
|
+
!staticNumberish(propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses.trimBefore)) {
|
|
72
|
+
return {
|
|
73
|
+
canSplit: false,
|
|
74
|
+
reason: 'Sequence timing props must be static numbers',
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const start = sequence.from;
|
|
78
|
+
const end = sequence.duration === Infinity
|
|
79
|
+
? Infinity
|
|
80
|
+
: sequence.from + sequence.duration;
|
|
81
|
+
if (splitFrame <= start) {
|
|
82
|
+
return {
|
|
83
|
+
canSplit: false,
|
|
84
|
+
reason: 'Cannot split at the sequence start',
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (splitFrame >= end) {
|
|
88
|
+
return {
|
|
89
|
+
canSplit: false,
|
|
90
|
+
reason: 'Cannot split at the sequence end',
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
canSplit: true,
|
|
95
|
+
nodePathInfo,
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
exports.getTimelineSequenceSplitEligibility = getTimelineSequenceSplitEligibility;
|
|
99
|
+
const splitTimelineSequenceFromSource = ({ nodePathInfo, splitFrame, }) => {
|
|
100
|
+
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
101
|
+
return (0, call_api_1.callApi)('/api/split-jsx-sequence', {
|
|
102
|
+
fileName: nodePath.absolutePath,
|
|
103
|
+
nodePath: nodePath.nodePath,
|
|
104
|
+
splitFrame,
|
|
105
|
+
})
|
|
106
|
+
.then((result) => {
|
|
107
|
+
if (result.success) {
|
|
108
|
+
(0, NotificationCenter_1.showNotification)('Split sequence', 2000);
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
112
|
+
return false;
|
|
113
|
+
})
|
|
114
|
+
.catch((err) => {
|
|
115
|
+
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
116
|
+
return false;
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
exports.splitTimelineSequenceFromSource = splitTimelineSequenceFromSource;
|
|
120
|
+
const shouldHandleTimelineDuplicateShortcut = ({ shiftKey, }) => !shiftKey;
|
|
121
|
+
exports.shouldHandleTimelineDuplicateShortcut = shouldHandleTimelineDuplicateShortcut;
|
|
122
|
+
const shouldHandleTimelineSplitShortcut = ({ shiftKey, }) => shiftKey;
|
|
123
|
+
exports.shouldHandleTimelineSplitShortcut = shouldHandleTimelineSplitShortcut;
|
|
124
|
+
const splitSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodePaths, propStatuses, splitFrame, splitSequence = exports.splitTimelineSequenceFromSource, }) => {
|
|
125
|
+
var _a;
|
|
126
|
+
if (selections.length !== 1) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
const [selection] = selections;
|
|
130
|
+
if (selection.type !== 'sequence') {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const track = (0, find_track_for_node_path_info_1.findTrackForNodePathInfo)({
|
|
134
|
+
sequences,
|
|
135
|
+
overrideIdsToNodePaths,
|
|
136
|
+
nodePathInfo: selection.nodePathInfo,
|
|
137
|
+
});
|
|
138
|
+
const sequencePropStatuses = propStatuses
|
|
139
|
+
? remotion_1.Internals.getPropStatusesCtx(propStatuses, selection.nodePathInfo.sequenceSubscriptionKey)
|
|
140
|
+
: undefined;
|
|
141
|
+
const eligibility = (0, exports.getTimelineSequenceSplitEligibility)({
|
|
142
|
+
selection,
|
|
143
|
+
sequence: (_a = track === null || track === void 0 ? void 0 : track.sequence) !== null && _a !== void 0 ? _a : null,
|
|
144
|
+
splitFrame,
|
|
145
|
+
propStatuses: sequencePropStatuses,
|
|
146
|
+
});
|
|
147
|
+
if (!eligibility.canSplit) {
|
|
148
|
+
(0, NotificationCenter_1.showNotification)(eligibility.reason, 4000);
|
|
149
|
+
return Promise.resolve(false);
|
|
150
|
+
}
|
|
151
|
+
return splitSequence({
|
|
152
|
+
nodePathInfo: eligibility.nodePathInfo,
|
|
153
|
+
splitFrame,
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
exports.splitSelectedTimelineItems = splitSelectedTimelineItems;
|
|
@@ -234,6 +234,8 @@ const formatTimelineFieldValueForDisplay = ({ fieldSchema, value, }) => {
|
|
|
234
234
|
})) !== null && _d !== void 0 ? _d : formatUnknownTimelineValueForDisplay(value));
|
|
235
235
|
case 'uv-coordinate':
|
|
236
236
|
return ((_e = formatUvCoordinateTimelineFieldValueForDisplay({ fieldSchema, value })) !== null && _e !== void 0 ? _e : formatUnknownTimelineValueForDisplay(value));
|
|
237
|
+
case 'text-content':
|
|
238
|
+
return String(value);
|
|
237
239
|
case 'array':
|
|
238
240
|
case 'boolean':
|
|
239
241
|
case 'color':
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatTimelineRotationFieldValue = void 0;
|
|
4
|
+
const timeline_field_display_utils_1 = require("./timeline-field-display-utils");
|
|
5
|
+
const timeline_rotation_utils_1 = require("./timeline-rotation-utils");
|
|
6
|
+
const formatTimelineRotationFieldValue = ({ decimalPlaces, fieldSchema, value, }) => {
|
|
7
|
+
return (0, timeline_field_display_utils_1.formatTimelineFieldValueForDisplay)({
|
|
8
|
+
fieldSchema,
|
|
9
|
+
value: fieldSchema.type === 'rotation-css' &&
|
|
10
|
+
typeof value === 'number' &&
|
|
11
|
+
Number.isFinite(value)
|
|
12
|
+
? (0, timeline_rotation_utils_1.serializeCssRotation)(value, decimalPlaces)
|
|
13
|
+
: value,
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
exports.formatTimelineRotationFieldValue = formatTimelineRotationFieldValue;
|
|
@@ -172,9 +172,12 @@ const getFrameIncrement = (durationInFrames) => {
|
|
|
172
172
|
return (0, exports.getFrameIncrementFromWidth)(durationInFrames, width);
|
|
173
173
|
};
|
|
174
174
|
const getFrameIncrementFromWidth = (durationInFrames, width) => {
|
|
175
|
-
return (width
|
|
175
|
+
return getUsableTimelineWidth(width) / durationInFrames;
|
|
176
176
|
};
|
|
177
177
|
exports.getFrameIncrementFromWidth = getFrameIncrementFromWidth;
|
|
178
|
+
const getUsableTimelineWidth = (width) => {
|
|
179
|
+
return Math.max(1, width - timeline_layout_1.TIMELINE_PADDING * 2);
|
|
180
|
+
};
|
|
178
181
|
const getFrameWhileScrollingRight = ({ durationInFrames, width, }) => {
|
|
179
182
|
var _a, _b;
|
|
180
183
|
const nextFrame = calculateFrameWhileScrollingRight({
|
|
@@ -193,7 +196,7 @@ const getFrameWhileScrollingRight = ({ durationInFrames, width, }) => {
|
|
|
193
196
|
exports.getFrameWhileScrollingRight = getFrameWhileScrollingRight;
|
|
194
197
|
const getFrameFromX = ({ clientX, durationInFrames, width, extrapolate, }) => {
|
|
195
198
|
const pos = clientX - timeline_layout_1.TIMELINE_PADDING;
|
|
196
|
-
const frame = Math.min(durationInFrames - 1, Math.round((0, remotion_1.interpolate)(pos, [0, width
|
|
199
|
+
const frame = Math.min(durationInFrames - 1, Math.round((0, remotion_1.interpolate)(pos, [0, getUsableTimelineWidth(width)], [0, durationInFrames], {
|
|
197
200
|
extrapolateLeft: extrapolate,
|
|
198
201
|
extrapolateRight: extrapolate,
|
|
199
202
|
})));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { TSequence } from 'remotion';
|
|
2
|
+
import type { CodePosition } from '../../error-overlay/react-overlay/utils/get-source-map';
|
|
3
|
+
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
|
+
type SequenceNameSaveAction = {
|
|
5
|
+
type: 'noop';
|
|
6
|
+
} | {
|
|
7
|
+
type: 'save';
|
|
8
|
+
defaultValue: string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare const getSequenceNameSaveAction: ({ editedName, currentDisplayName, fallbackDisplayName, hasStaticNameProp, }: {
|
|
11
|
+
editedName: string;
|
|
12
|
+
currentDisplayName: string;
|
|
13
|
+
fallbackDisplayName: string;
|
|
14
|
+
hasStaticNameProp: boolean;
|
|
15
|
+
}) => SequenceNameSaveAction;
|
|
16
|
+
export declare const useRenameSequence: ({ clientId, nodePathInfo, sequence, validatedLocation, }: {
|
|
17
|
+
readonly clientId: string | null;
|
|
18
|
+
readonly nodePathInfo: SequenceNodePathInfo | null;
|
|
19
|
+
readonly sequence: TSequence;
|
|
20
|
+
readonly validatedLocation: CodePosition | null;
|
|
21
|
+
}) => {
|
|
22
|
+
canRename: boolean;
|
|
23
|
+
codeNameStatus: import("remotion").CanUpdateSequencePropStatus | undefined;
|
|
24
|
+
displayName: string;
|
|
25
|
+
fallbackDisplayName: string;
|
|
26
|
+
hasStaticNameProp: boolean;
|
|
27
|
+
propStatusesForOverride: Record<string, import("remotion").CanUpdateSequencePropStatus> | undefined;
|
|
28
|
+
saveName: (name: string) => Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRenameSequence = exports.getSequenceNameSaveAction = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const save_sequence_prop_1 = require("./save-sequence-prop");
|
|
7
|
+
const getSequenceNameSaveAction = ({ editedName, currentDisplayName, fallbackDisplayName, hasStaticNameProp, }) => {
|
|
8
|
+
if (!hasStaticNameProp &&
|
|
9
|
+
(editedName === '' || editedName === fallbackDisplayName)) {
|
|
10
|
+
return { type: 'noop' };
|
|
11
|
+
}
|
|
12
|
+
if (hasStaticNameProp && editedName === currentDisplayName) {
|
|
13
|
+
return { type: 'noop' };
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
type: 'save',
|
|
17
|
+
defaultValue: editedName === '' ? JSON.stringify('') : null,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
exports.getSequenceNameSaveAction = getSequenceNameSaveAction;
|
|
21
|
+
const useRenameSequence = ({ clientId, nodePathInfo, sequence, validatedLocation, }) => {
|
|
22
|
+
var _a;
|
|
23
|
+
var _b, _c;
|
|
24
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
25
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
26
|
+
const nodePath = (_b = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.sequenceSubscriptionKey) !== null && _b !== void 0 ? _b : null;
|
|
27
|
+
const propStatusesForOverride = (0, react_1.useMemo)(() => {
|
|
28
|
+
return nodePath
|
|
29
|
+
? remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)
|
|
30
|
+
: undefined;
|
|
31
|
+
}, [propStatuses, nodePath]);
|
|
32
|
+
const codeNameStatus = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.name;
|
|
33
|
+
const fallbackDisplayName = (_c = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.componentName) !== null && _c !== void 0 ? _c : '<Sequence>';
|
|
34
|
+
const staticNamePropValue = (codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status) === 'static' &&
|
|
35
|
+
typeof codeNameStatus.codeValue === 'string'
|
|
36
|
+
? codeNameStatus.codeValue
|
|
37
|
+
: null;
|
|
38
|
+
const hasStaticNameProp = staticNamePropValue !== null;
|
|
39
|
+
const displayName = (0, react_1.useMemo)(() => {
|
|
40
|
+
if (staticNamePropValue !== null) {
|
|
41
|
+
return staticNamePropValue;
|
|
42
|
+
}
|
|
43
|
+
if ((codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status) === 'static') {
|
|
44
|
+
return fallbackDisplayName;
|
|
45
|
+
}
|
|
46
|
+
return sequence.displayName;
|
|
47
|
+
}, [
|
|
48
|
+
codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status,
|
|
49
|
+
fallbackDisplayName,
|
|
50
|
+
sequence.displayName,
|
|
51
|
+
staticNamePropValue,
|
|
52
|
+
]);
|
|
53
|
+
const canRename = clientId !== null &&
|
|
54
|
+
!window.remotion_isReadOnlyStudio &&
|
|
55
|
+
Boolean(sequence.controls) &&
|
|
56
|
+
nodePath !== null &&
|
|
57
|
+
validatedLocation !== null &&
|
|
58
|
+
codeNameStatus !== undefined &&
|
|
59
|
+
codeNameStatus !== null &&
|
|
60
|
+
codeNameStatus.status === 'static';
|
|
61
|
+
const saveName = (0, react_1.useCallback)(async (name) => {
|
|
62
|
+
if (!canRename ||
|
|
63
|
+
clientId === null ||
|
|
64
|
+
!sequence.controls ||
|
|
65
|
+
!nodePath ||
|
|
66
|
+
!validatedLocation) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const action = (0, exports.getSequenceNameSaveAction)({
|
|
70
|
+
editedName: name,
|
|
71
|
+
currentDisplayName: displayName,
|
|
72
|
+
fallbackDisplayName,
|
|
73
|
+
hasStaticNameProp,
|
|
74
|
+
});
|
|
75
|
+
if (action.type === 'noop') {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
await (0, save_sequence_prop_1.saveSequenceProps)({
|
|
79
|
+
changes: [
|
|
80
|
+
{
|
|
81
|
+
fileName: validatedLocation.source,
|
|
82
|
+
nodePath,
|
|
83
|
+
fieldKey: 'name',
|
|
84
|
+
value: name,
|
|
85
|
+
defaultValue: action.defaultValue,
|
|
86
|
+
schema: sequence.controls.schema,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
setPropStatuses,
|
|
90
|
+
clientId,
|
|
91
|
+
undoLabel: 'Rename sequence',
|
|
92
|
+
redoLabel: 'Rename sequence again',
|
|
93
|
+
});
|
|
94
|
+
}, [
|
|
95
|
+
canRename,
|
|
96
|
+
clientId,
|
|
97
|
+
displayName,
|
|
98
|
+
fallbackDisplayName,
|
|
99
|
+
hasStaticNameProp,
|
|
100
|
+
nodePath,
|
|
101
|
+
sequence.controls,
|
|
102
|
+
setPropStatuses,
|
|
103
|
+
validatedLocation,
|
|
104
|
+
]);
|
|
105
|
+
return {
|
|
106
|
+
canRename,
|
|
107
|
+
codeNameStatus,
|
|
108
|
+
displayName,
|
|
109
|
+
fallbackDisplayName,
|
|
110
|
+
hasStaticNameProp,
|
|
111
|
+
propStatusesForOverride,
|
|
112
|
+
saveName,
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
exports.useRenameSequence = useRenameSequence;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type TSequence } from 'remotion';
|
|
2
2
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
|
-
export declare const useTimelineExpandedTree: ({ sequence, nodePathInfo, }: {
|
|
3
|
+
export declare const useTimelineExpandedTree: ({ sequence, nodePathInfo, includeTextContent, }: {
|
|
4
4
|
readonly sequence: TSequence;
|
|
5
5
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
6
|
+
readonly includeTextContent: boolean;
|
|
6
7
|
}) => {
|
|
7
8
|
filteredTree: import("../../helpers/timeline-layout").TimelineTreeNode[];
|
|
8
9
|
getIsExpanded: import("../ExpandedTracksProvider").GetIsExpanded;
|
|
@@ -8,7 +8,7 @@ const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
|
8
8
|
const get_node_keyframes_1 = require("./get-node-keyframes");
|
|
9
9
|
const timeline_expanded_filter_1 = require("./timeline-expanded-filter");
|
|
10
10
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
11
|
-
const useTimelineExpandedTree = ({ sequence, nodePathInfo, }) => {
|
|
11
|
+
const useTimelineExpandedTree = ({ sequence, nodePathInfo, includeTextContent, }) => {
|
|
12
12
|
const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
|
|
13
13
|
const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
|
|
14
14
|
const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
@@ -20,12 +20,14 @@ const useTimelineExpandedTree = ({ sequence, nodePathInfo, }) => {
|
|
|
20
20
|
getDragOverrides,
|
|
21
21
|
getEffectDragOverrides,
|
|
22
22
|
propStatuses: visualModePropStatuses,
|
|
23
|
+
includeTextContent,
|
|
23
24
|
}), [
|
|
24
25
|
sequence,
|
|
25
26
|
nodePathInfo,
|
|
26
27
|
getDragOverrides,
|
|
27
28
|
getEffectDragOverrides,
|
|
28
29
|
visualModePropStatuses,
|
|
30
|
+
includeTextContent,
|
|
29
31
|
]);
|
|
30
32
|
const selectedRowKeys = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.getSelectedTimelineExpandedRowKeys)(selectedItems), [selectedItems]);
|
|
31
33
|
const filteredTree = (0, react_1.useMemo)(() => (0, timeline_expanded_filter_1.filterTimelineExpandedTree)({
|
|
@@ -239,7 +239,7 @@ const TimelineInOutPointToggle = () => {
|
|
|
239
239
|
};
|
|
240
240
|
}, [confId, onInMark, onInOutClear, onOutMark]);
|
|
241
241
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
242
|
-
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('In', 'I'), "aria-label": getTooltipText('In', 'I'), onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ?
|
|
242
|
+
jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('In', 'I'), "aria-label": getTooltipText('In', 'I'), onClick: onInMark, onContextMenu: clearInMark, disabled: !videoConfig || isFirstFrame, children: jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ? colors_1.WHITE : colors_1.BLUE, style: style }) }), jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: getTooltipText('Out', 'O'), "aria-label": getTooltipText('Out', 'O'), onClick: onOutMark, onContextMenu: clearOutMark, disabled: !videoConfig || isLastFrame, children: jsx_runtime_1.jsx(timelineInOutPointer_1.TimelineOutPointer, { color: outFrame === null ? colors_1.WHITE : colors_1.BLUE, style: style }) })
|
|
243
243
|
] }));
|
|
244
244
|
};
|
|
245
245
|
exports.TimelineInOutPointToggle = TimelineInOutPointToggle;
|
|
@@ -13,7 +13,7 @@ const buttonStyle = {
|
|
|
13
13
|
color: colors_1.BLUE,
|
|
14
14
|
border: 'none',
|
|
15
15
|
fontWeight: 'bold',
|
|
16
|
-
backgroundColor:
|
|
16
|
+
backgroundColor: colors_1.TRANSPARENT,
|
|
17
17
|
cursor: 'pointer',
|
|
18
18
|
fontSize: 14,
|
|
19
19
|
display: 'inline-flex',
|
|
@@ -90,6 +90,6 @@ const UpdateCheck = () => {
|
|
|
90
90
|
return (jsx_runtime_1.jsx("button", { tabIndex: tabIndex, style: dynButtonStyle, onClick: openModal, type: "button", title: hasKnownBugs ? 'Bugfixes available' : 'Update available', children: hasKnownBugs ? ('Bugfixes available') : (jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", style: {
|
|
91
91
|
height: 16,
|
|
92
92
|
width: 16,
|
|
93
|
-
}, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill:
|
|
93
|
+
}, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.CURRENT_COLOR_LOWERCASE, d: "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM135.1 217.4c-4.5 4.2-7.1 10.1-7.1 16.3c0 12.3 10 22.3 22.3 22.3H208v96c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V256h57.7c12.3 0 22.3-10 22.3-22.3c0-6.2-2.6-12.1-7.1-16.3L269.8 117.5c-3.8-3.5-8.7-5.5-13.8-5.5s-10.1 2-13.8 5.5L135.1 217.4z" }) })) }));
|
|
94
94
|
};
|
|
95
95
|
exports.UpdateCheck = UpdateCheck;
|
|
@@ -23,7 +23,7 @@ const OpenIssueButton = ({ link }) => {
|
|
|
23
23
|
window.open(link, '_blank');
|
|
24
24
|
}, [link]);
|
|
25
25
|
const svgFillColor = (0, react_1.useMemo)(() => {
|
|
26
|
-
return hovered ?
|
|
26
|
+
return hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT;
|
|
27
27
|
}, [hovered]);
|
|
28
28
|
const openInEditorSvg = (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: svgStyle, children: jsx_runtime_1.jsx("path", { fill: svgFillColor, d: "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z" }) }));
|
|
29
29
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
@@ -24,8 +24,8 @@ const ClickableFileName = ({ originalFileName, }) => {
|
|
|
24
24
|
return {
|
|
25
25
|
fontSize: 12,
|
|
26
26
|
cursor: originalFileName.type === 'loaded' ? 'pointer' : undefined,
|
|
27
|
-
borderBottom: hoverEffect ?
|
|
28
|
-
color: hoverEffect ?
|
|
27
|
+
borderBottom: hoverEffect ? colors_1.BORDER_WHITE : 'none',
|
|
28
|
+
color: hoverEffect ? colors_1.WHITE_HEX : colors_1.LIGHT_COLOR,
|
|
29
29
|
};
|
|
30
30
|
}, [originalFileName, hoverEffect]);
|
|
31
31
|
const onClick = (0, react_1.useCallback)(async () => {
|