@remotion/studio 4.0.471 → 4.0.473
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/api/rename-static-file.d.ts +6 -0
- package/dist/api/rename-static-file.js +18 -0
- package/dist/components/AssetSelector.js +55 -5
- package/dist/components/AssetSelectorItem.js +153 -27
- package/dist/components/Canvas.js +147 -0
- package/dist/components/CompositionSelectorItem.d.ts +1 -0
- package/dist/components/CompositionSelectorItem.js +12 -4
- package/dist/components/ConfirmationDialog-types.d.ts +8 -0
- package/dist/components/ConfirmationDialog-types.js +2 -0
- package/dist/components/ConfirmationDialog.d.ts +7 -0
- package/dist/components/ConfirmationDialog.js +103 -0
- package/dist/components/ContextMenu.d.ts +9 -1
- package/dist/components/ContextMenu.js +99 -47
- package/dist/components/CurrentAsset.d.ts +1 -0
- package/dist/components/CurrentAsset.js +13 -2
- package/dist/components/Editor.js +14 -6
- package/dist/components/EditorContent.js +15 -2
- package/dist/components/EditorContexts.js +2 -1
- package/dist/components/EditorRuler/Ruler.js +2 -0
- package/dist/components/ExplorerPanel.d.ts +0 -4
- package/dist/components/ExplorerPanel.js +8 -4
- package/dist/components/ExplorerPanelRef.d.ts +4 -0
- package/dist/components/ExplorerPanelRef.js +5 -0
- package/dist/components/FilePreview.d.ts +1 -1
- package/dist/components/InitialCompositionLoader.d.ts +0 -1
- package/dist/components/InitialCompositionLoader.js +5 -27
- package/dist/components/Menu/MenuItem.js +7 -1
- package/dist/components/Menu/SubMenu.js +5 -1
- package/dist/components/Menu/portals.js +17 -8
- package/dist/components/MenuToolbar.js +5 -1
- package/dist/components/ModalContainer.js +6 -1
- package/dist/components/Modals.js +8 -2
- package/dist/components/NewComposition/CodemodFooter.js +2 -2
- package/dist/components/NewComposition/ComboBox.js +8 -2
- package/dist/components/NewComposition/DeleteFolder.d.ts +6 -0
- package/dist/components/NewComposition/DeleteFolder.js +39 -0
- package/dist/components/NewComposition/DeleteStaticFile.d.ts +4 -0
- package/dist/components/NewComposition/DeleteStaticFile.js +44 -0
- package/dist/components/NewComposition/RenameFolder.d.ts +6 -0
- package/dist/components/NewComposition/RenameFolder.js +60 -0
- package/dist/components/NewComposition/RenameStaticFile.d.ts +4 -0
- package/dist/components/NewComposition/RenameStaticFile.js +118 -0
- package/dist/components/OptionsPanel.js +5 -1
- package/dist/components/OutlineToggle.d.ts +2 -0
- package/dist/components/OutlineToggle.js +20 -0
- package/dist/components/Preview.d.ts +0 -2
- package/dist/components/Preview.js +23 -33
- package/dist/components/PreviewToolbar.js +19 -6
- package/dist/components/RenderButton.js +8 -2
- package/dist/components/RenderPreview.js +2 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +105 -4
- package/dist/components/SelectedOutlineOverlay.js +578 -59
- package/dist/components/ShowOutlinesProvider.d.ts +4 -0
- package/dist/components/ShowOutlinesProvider.js +24 -0
- package/dist/components/SizeSelector.js +3 -3
- package/dist/components/Splitter/SplitterContainer.js +9 -0
- package/dist/components/Splitter/SplitterHandle.js +65 -70
- package/dist/components/StaticFilePreview.js +2 -2
- package/dist/components/Timeline/KeyframeSettingsModal.d.ts +15 -0
- package/dist/components/Timeline/KeyframeSettingsModal.js +150 -0
- package/dist/components/Timeline/Timeline.js +50 -15
- package/dist/components/Timeline/TimelineArrayField.d.ts +9 -0
- package/dist/components/Timeline/TimelineArrayField.js +210 -0
- package/dist/components/Timeline/TimelineBooleanField.d.ts +2 -2
- package/dist/components/Timeline/TimelineBooleanField.js +2 -2
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +43 -0
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +479 -0
- package/dist/components/Timeline/TimelineColorField.d.ts +2 -2
- package/dist/components/Timeline/TimelineColorField.js +2 -8
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +12 -2
- package/dist/components/Timeline/TimelineEffectItem.js +3 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +146 -26
- package/dist/components/Timeline/TimelineEnumField.d.ts +2 -2
- package/dist/components/Timeline/TimelineEnumField.js +3 -3
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +4 -3
- package/dist/components/Timeline/TimelineKeyframeControls.js +41 -37
- package/dist/components/Timeline/TimelineKeyframeDiamond.js +24 -21
- package/dist/components/Timeline/TimelineKeyframeDiamondIcon.d.ts +6 -0
- package/dist/components/Timeline/TimelineKeyframeDiamondIcon.js +14 -0
- package/dist/components/Timeline/TimelineKeyframeDragState.d.ts +17 -0
- package/dist/components/Timeline/TimelineKeyframeDragState.js +39 -0
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +7 -2
- package/dist/components/Timeline/TimelineKeyframedValue.js +22 -8
- package/dist/components/Timeline/TimelineLayerEye.d.ts +1 -0
- package/dist/components/Timeline/TimelineLayerEye.js +8 -3
- package/dist/components/Timeline/TimelineList.js +2 -2
- package/dist/components/Timeline/TimelineMediaInfo.d.ts +0 -13
- package/dist/components/Timeline/TimelineMediaInfo.js +8 -73
- package/dist/components/Timeline/TimelineNumberField.d.ts +2 -2
- package/dist/components/Timeline/TimelineNumberField.js +7 -11
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +17 -0
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +53 -0
- package/dist/components/Timeline/TimelineRotationField.d.ts +2 -2
- package/dist/components/Timeline/TimelineRotationField.js +41 -24
- package/dist/components/Timeline/TimelineRowChrome.js +8 -7
- package/dist/components/Timeline/TimelineScaleField.d.ts +20 -0
- package/dist/components/Timeline/TimelineScaleField.js +314 -0
- package/dist/components/Timeline/TimelineSchemaField.d.ts +3 -2
- package/dist/components/Timeline/TimelineSchemaField.js +8 -42
- package/dist/components/Timeline/TimelineSelection.js +3 -2
- package/dist/components/Timeline/TimelineSequence.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequence.js +51 -10
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +282 -28
- package/dist/components/Timeline/TimelineSequencePropItem.js +161 -35
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +58 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +525 -0
- package/dist/components/Timeline/TimelineTrack.js +1 -1
- package/dist/components/Timeline/TimelineTranslateField.d.ts +2 -2
- package/dist/components/Timeline/TimelineTranslateField.js +21 -25
- package/dist/components/Timeline/TimelineUvCoordinateField.d.ts +2 -2
- package/dist/components/Timeline/TimelineUvCoordinateField.js +20 -26
- package/dist/components/Timeline/apply-effect-response-to-code-values.d.ts +5 -0
- package/dist/components/Timeline/apply-effect-response-to-code-values.js +19 -0
- package/dist/components/Timeline/call-add-keyframe.js +4 -0
- package/dist/components/Timeline/call-move-keyframe.d.ts +19 -0
- package/dist/components/Timeline/call-move-keyframe.js +71 -0
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +22 -0
- package/dist/components/Timeline/call-update-keyframe-settings.js +52 -0
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +7 -4
- package/dist/components/Timeline/delete-selected-timeline-item.js +33 -21
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +4 -2
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +39 -34
- package/dist/components/Timeline/get-bounded-keyframe-drag-delta.d.ts +8 -0
- package/dist/components/Timeline/get-bounded-keyframe-drag-delta.js +12 -0
- package/dist/components/Timeline/get-keyframe-navigation.d.ts +2 -2
- package/dist/components/Timeline/get-keyframe-navigation.js +14 -6
- package/dist/components/Timeline/get-node-keyframes.d.ts +5 -2
- package/dist/components/Timeline/get-node-keyframes.js +38 -5
- package/dist/components/Timeline/get-timeline-keyframes.js +4 -4
- package/dist/components/Timeline/reset-selected-timeline-props.js +22 -8
- package/dist/components/Timeline/save-effect-prop.d.ts +14 -3
- package/dist/components/Timeline/save-effect-prop.js +36 -18
- package/dist/components/Timeline/save-prop-queue.d.ts +2 -1
- package/dist/components/Timeline/save-prop-queue.js +5 -2
- package/dist/components/Timeline/save-sequence-prop.d.ts +2 -7
- package/dist/components/Timeline/save-sequence-prop.js +33 -30
- package/dist/components/Timeline/should-clear-selection-on-pointer-down.d.ts +3 -0
- package/dist/components/Timeline/should-clear-selection-on-pointer-down.js +7 -0
- package/dist/components/Timeline/timeline-asset-link.d.ts +13 -0
- package/dist/components/Timeline/timeline-asset-link.js +37 -0
- package/dist/components/Timeline/timeline-field-utils.d.ts +1 -0
- package/dist/components/Timeline/timeline-field-utils.js +5 -1
- package/dist/components/Timeline/timeline-translate-utils.js +9 -2
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +7 -0
- package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +10 -0
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +378 -0
- package/dist/components/TopPanel.d.ts +1 -1
- package/dist/components/folder-menu-items.d.ts +12 -0
- package/dist/components/folder-menu-items.js +147 -0
- package/dist/components/import-assets.d.ts +22 -0
- package/dist/components/import-assets.js +294 -0
- package/dist/components/load-canvas-content-from-url.d.ts +1 -0
- package/dist/components/load-canvas-content-from-url.js +9 -3
- package/dist/components/use-select-asset.d.ts +1 -0
- package/dist/components/use-select-asset.js +30 -0
- package/dist/error-overlay/error-origin.d.ts +3 -0
- package/dist/error-overlay/error-origin.js +42 -0
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +6 -2
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +38 -0
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +1 -1
- package/dist/error-overlay/remotion-overlay/log-studio-error.d.ts +3 -0
- package/dist/error-overlay/remotion-overlay/log-studio-error.js +27 -0
- package/dist/esm/{chunk-z0z9d4r0.js → chunk-q0jkt0zq.js} +23062 -17350
- package/dist/esm/internals.mjs +23062 -17350
- package/dist/esm/previewEntry.mjs +22351 -16615
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/calculate-timeline.js +7 -3
- package/dist/helpers/create-folder-tree.js +1 -0
- package/dist/helpers/get-asset-metadata.js +2 -2
- package/dist/helpers/get-folder-id.d.ts +4 -0
- package/dist/helpers/get-folder-id.js +7 -0
- package/dist/helpers/get-preview-file-type.d.ts +2 -0
- package/dist/helpers/get-preview-file-type.js +33 -0
- package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -0
- package/dist/helpers/install-required-package.d.ts +1 -0
- package/dist/helpers/install-required-package.js +39 -0
- package/dist/helpers/remote-asset-drag.d.ts +4 -0
- package/dist/helpers/remote-asset-drag.js +73 -0
- package/dist/helpers/timeline-layout.js +5 -1
- package/dist/helpers/use-asset-drag-events.d.ts +5 -2
- package/dist/helpers/use-asset-drag-events.js +13 -2
- package/dist/helpers/validate-folder-rename.d.ts +6 -0
- package/dist/helpers/validate-folder-rename.js +19 -0
- package/dist/hot-middleware-client/client.js +6 -0
- package/dist/state/editor-outlines.d.ts +8 -0
- package/dist/state/editor-outlines.js +18 -0
- package/dist/state/modals.d.ts +29 -2
- package/dist/state/scale-lock.d.ts +18 -0
- package/dist/state/scale-lock.js +59 -0
- package/package.json +10 -10
|
@@ -57,8 +57,7 @@ const TimelineUvCoordinateField = ({ field, propStatus, effectiveValue, onSave,
|
|
|
57
57
|
const onXChangeEnd = (0, react_1.useCallback)((newVal) => {
|
|
58
58
|
const currentY = dragY !== null && dragY !== void 0 ? dragY : codeY;
|
|
59
59
|
const newTuple = [newVal, currentY];
|
|
60
|
-
if (propStatus.
|
|
61
|
-
!tuplesEqual(propStatus.codeValue, newTuple)) {
|
|
60
|
+
if (!tuplesEqual(propStatus.codeValue, newTuple)) {
|
|
62
61
|
onSave(newTuple).finally(() => {
|
|
63
62
|
setDragX(null);
|
|
64
63
|
onDragEnd();
|
|
@@ -70,17 +69,15 @@ const TimelineUvCoordinateField = ({ field, propStatus, effectiveValue, onSave,
|
|
|
70
69
|
}
|
|
71
70
|
}, [dragY, codeY, propStatus, onSave, onDragEnd]);
|
|
72
71
|
const onXTextChange = (0, react_1.useCallback)((newVal) => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
83
|
-
}
|
|
72
|
+
const parsed = Number(newVal);
|
|
73
|
+
if (!Number.isNaN(parsed)) {
|
|
74
|
+
const currentY = dragY !== null && dragY !== void 0 ? dragY : codeY;
|
|
75
|
+
const newTuple = [parsed, currentY];
|
|
76
|
+
if (!tuplesEqual(propStatus.codeValue, newTuple)) {
|
|
77
|
+
setDragX(parsed);
|
|
78
|
+
onSave(newTuple).finally(() => {
|
|
79
|
+
setDragX(null);
|
|
80
|
+
});
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
83
|
}, [propStatus, dragY, codeY, onSave]);
|
|
@@ -92,8 +89,7 @@ const TimelineUvCoordinateField = ({ field, propStatus, effectiveValue, onSave,
|
|
|
92
89
|
const onYChangeEnd = (0, react_1.useCallback)((newVal) => {
|
|
93
90
|
const currentX = dragX !== null && dragX !== void 0 ? dragX : codeX;
|
|
94
91
|
const newTuple = [currentX, newVal];
|
|
95
|
-
if (propStatus.
|
|
96
|
-
!tuplesEqual(propStatus.codeValue, newTuple)) {
|
|
92
|
+
if (!tuplesEqual(propStatus.codeValue, newTuple)) {
|
|
97
93
|
onSave(newTuple).finally(() => {
|
|
98
94
|
setDragY(null);
|
|
99
95
|
onDragEnd();
|
|
@@ -105,17 +101,15 @@ const TimelineUvCoordinateField = ({ field, propStatus, effectiveValue, onSave,
|
|
|
105
101
|
}
|
|
106
102
|
}, [dragX, codeX, propStatus, onSave, onDragEnd]);
|
|
107
103
|
const onYTextChange = (0, react_1.useCallback)((newVal) => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
}
|
|
104
|
+
const parsed = Number(newVal);
|
|
105
|
+
if (!Number.isNaN(parsed)) {
|
|
106
|
+
const currentX = dragX !== null && dragX !== void 0 ? dragX : codeX;
|
|
107
|
+
const newTuple = [currentX, parsed];
|
|
108
|
+
if (!tuplesEqual(propStatus.codeValue, newTuple)) {
|
|
109
|
+
setDragY(parsed);
|
|
110
|
+
onSave(newTuple).finally(() => {
|
|
111
|
+
setDragY(null);
|
|
112
|
+
});
|
|
119
113
|
}
|
|
120
114
|
}
|
|
121
115
|
}, [propStatus, onSave, dragX, codeX]);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponse } from 'remotion';
|
|
2
|
+
export declare const applyEffectResponseToCodeValues: ({ previous, response, }: {
|
|
3
|
+
previous: CanUpdateSequencePropsResponse;
|
|
4
|
+
response: CanUpdateEffectPropsResponse;
|
|
5
|
+
}) => CanUpdateSequencePropsResponse;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyEffectResponseToCodeValues = void 0;
|
|
4
|
+
const applyEffectResponseToCodeValues = ({ previous, response, }) => {
|
|
5
|
+
if (!previous.canUpdate) {
|
|
6
|
+
return previous;
|
|
7
|
+
}
|
|
8
|
+
const targetIndex = previous.effects.findIndex((effect) => effect.effectIndex === response.effectIndex);
|
|
9
|
+
if (targetIndex === -1) {
|
|
10
|
+
return previous;
|
|
11
|
+
}
|
|
12
|
+
const effects = [...previous.effects];
|
|
13
|
+
effects[targetIndex] = response;
|
|
14
|
+
return {
|
|
15
|
+
...previous,
|
|
16
|
+
effects,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
exports.applyEffectResponseToCodeValues = applyEffectResponseToCodeValues;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.callAddEffectKeyframe = exports.callAddSequenceKeyframe = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const call_api_1 = require("../call-api");
|
|
6
|
+
const apply_effect_response_to_code_values_1 = require("./apply-effect-response-to-code-values");
|
|
6
7
|
const save_prop_queue_1 = require("./save-prop-queue");
|
|
7
8
|
const callAddSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame, value, schema, setCodeValues, clientId, }) => {
|
|
8
9
|
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
@@ -13,6 +14,7 @@ const callAddSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame, va
|
|
|
13
14
|
fieldKey,
|
|
14
15
|
frame: sourceFrame,
|
|
15
16
|
value,
|
|
17
|
+
schema,
|
|
16
18
|
}),
|
|
17
19
|
apiCall: () => (0, call_api_1.callApi)('/api/add-sequence-keyframe', {
|
|
18
20
|
fileName,
|
|
@@ -37,7 +39,9 @@ const callAddEffectKeyframe = ({ fileName, nodePath, effectIndex, fieldKey, sour
|
|
|
37
39
|
fieldKey,
|
|
38
40
|
frame: sourceFrame,
|
|
39
41
|
value,
|
|
42
|
+
schema,
|
|
40
43
|
}),
|
|
44
|
+
applyServerResponse: (prev, response) => (0, apply_effect_response_to_code_values_1.applyEffectResponseToCodeValues)({ previous: prev, response }),
|
|
41
45
|
apiCall: () => (0, call_api_1.callApi)('/api/add-effect-keyframe', {
|
|
42
46
|
fileName,
|
|
43
47
|
sequenceNodePath: nodePath,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
2
|
+
import type { SetCodeValues } from './save-sequence-prop';
|
|
3
|
+
export type MoveSequenceKeyframeChange = {
|
|
4
|
+
fileName: string;
|
|
5
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
6
|
+
fieldKey: string;
|
|
7
|
+
fromFrame: number;
|
|
8
|
+
toFrame: number;
|
|
9
|
+
schema: SequenceSchema;
|
|
10
|
+
};
|
|
11
|
+
export type MoveEffectKeyframeChange = MoveSequenceKeyframeChange & {
|
|
12
|
+
effectIndex: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const callMoveKeyframes: ({ sequenceKeyframes, effectKeyframes, setCodeValues, clientId, }: {
|
|
15
|
+
sequenceKeyframes: MoveSequenceKeyframeChange[];
|
|
16
|
+
effectKeyframes: MoveEffectKeyframeChange[];
|
|
17
|
+
setCodeValues: SetCodeValues;
|
|
18
|
+
clientId: string;
|
|
19
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callMoveKeyframes = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const call_api_1 = require("../call-api");
|
|
6
|
+
const groupByNodePath = (keyframes) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const groups = new Map();
|
|
9
|
+
for (const keyframe of keyframes) {
|
|
10
|
+
const key = JSON.stringify(keyframe.nodePath);
|
|
11
|
+
const group = (_a = groups.get(key)) !== null && _a !== void 0 ? _a : [];
|
|
12
|
+
group.push(keyframe);
|
|
13
|
+
groups.set(key, group);
|
|
14
|
+
}
|
|
15
|
+
return [...groups.values()];
|
|
16
|
+
};
|
|
17
|
+
const callMoveKeyframes = ({ sequenceKeyframes, effectKeyframes, setCodeValues, clientId, }) => {
|
|
18
|
+
if (sequenceKeyframes.length === 0 && effectKeyframes.length === 0) {
|
|
19
|
+
return Promise.resolve();
|
|
20
|
+
}
|
|
21
|
+
for (const keyframes of groupByNodePath(sequenceKeyframes)) {
|
|
22
|
+
const [firstKeyframe] = keyframes;
|
|
23
|
+
if (!firstKeyframe) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
setCodeValues(firstKeyframe.nodePath, (prev) => (0, studio_shared_1.optimisticMoveSequenceKeyframes)({
|
|
27
|
+
previous: prev,
|
|
28
|
+
keyframes: keyframes.map((keyframe) => ({
|
|
29
|
+
fieldKey: keyframe.fieldKey,
|
|
30
|
+
fromFrame: keyframe.fromFrame,
|
|
31
|
+
toFrame: keyframe.toFrame,
|
|
32
|
+
})),
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
for (const keyframes of groupByNodePath(effectKeyframes)) {
|
|
36
|
+
const [firstKeyframe] = keyframes;
|
|
37
|
+
if (!firstKeyframe) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
setCodeValues(firstKeyframe.nodePath, (prev) => (0, studio_shared_1.optimisticMoveEffectKeyframes)({
|
|
41
|
+
previous: prev,
|
|
42
|
+
keyframes: keyframes.map((keyframe) => ({
|
|
43
|
+
effectIndex: keyframe.effectIndex,
|
|
44
|
+
fieldKey: keyframe.fieldKey,
|
|
45
|
+
fromFrame: keyframe.fromFrame,
|
|
46
|
+
toFrame: keyframe.toFrame,
|
|
47
|
+
})),
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
return (0, call_api_1.callApi)('/api/move-keyframes', {
|
|
51
|
+
sequenceKeyframes: sequenceKeyframes.map((keyframe) => ({
|
|
52
|
+
fileName: keyframe.fileName,
|
|
53
|
+
nodePath: keyframe.nodePath,
|
|
54
|
+
key: keyframe.fieldKey,
|
|
55
|
+
fromFrame: keyframe.fromFrame,
|
|
56
|
+
toFrame: keyframe.toFrame,
|
|
57
|
+
schema: keyframe.schema,
|
|
58
|
+
})),
|
|
59
|
+
effectKeyframes: effectKeyframes.map((keyframe) => ({
|
|
60
|
+
fileName: keyframe.fileName,
|
|
61
|
+
sequenceNodePath: keyframe.nodePath,
|
|
62
|
+
effectIndex: keyframe.effectIndex,
|
|
63
|
+
key: keyframe.fieldKey,
|
|
64
|
+
fromFrame: keyframe.fromFrame,
|
|
65
|
+
toFrame: keyframe.toFrame,
|
|
66
|
+
schema: keyframe.schema,
|
|
67
|
+
})),
|
|
68
|
+
clientId,
|
|
69
|
+
}).then(() => undefined);
|
|
70
|
+
};
|
|
71
|
+
exports.callMoveKeyframes = callMoveKeyframes;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type KeyframeSettings } from '@remotion/studio-shared';
|
|
2
|
+
import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
3
|
+
import type { SetCodeValues } from './save-sequence-prop';
|
|
4
|
+
export declare const callUpdateSequenceKeyframeSettings: ({ fileName, nodePath, fieldKey, settings, schema, setCodeValues, clientId, }: {
|
|
5
|
+
fileName: string;
|
|
6
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
7
|
+
fieldKey: string;
|
|
8
|
+
settings: KeyframeSettings;
|
|
9
|
+
schema: SequenceSchema;
|
|
10
|
+
setCodeValues: SetCodeValues;
|
|
11
|
+
clientId: string;
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
export declare const callUpdateEffectKeyframeSettings: ({ fileName, nodePath, effectIndex, fieldKey, settings, schema, setCodeValues, clientId, }: {
|
|
14
|
+
fileName: string;
|
|
15
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
16
|
+
effectIndex: number;
|
|
17
|
+
fieldKey: string;
|
|
18
|
+
settings: KeyframeSettings;
|
|
19
|
+
schema: SequenceSchema;
|
|
20
|
+
setCodeValues: SetCodeValues;
|
|
21
|
+
clientId: string;
|
|
22
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callUpdateEffectKeyframeSettings = exports.callUpdateSequenceKeyframeSettings = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const call_api_1 = require("../call-api");
|
|
6
|
+
const apply_effect_response_to_code_values_1 = require("./apply-effect-response-to-code-values");
|
|
7
|
+
const save_prop_queue_1 = require("./save-prop-queue");
|
|
8
|
+
const callUpdateSequenceKeyframeSettings = ({ fileName, nodePath, fieldKey, settings, schema, setCodeValues, clientId, }) => {
|
|
9
|
+
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
10
|
+
nodePath,
|
|
11
|
+
setCodeValues,
|
|
12
|
+
applyOptimistic: (prev) => (0, studio_shared_1.optimisticUpdateSequenceKeyframeSettings)({
|
|
13
|
+
previous: prev,
|
|
14
|
+
fieldKey,
|
|
15
|
+
settings,
|
|
16
|
+
}),
|
|
17
|
+
apiCall: () => (0, call_api_1.callApi)('/api/update-sequence-keyframe-settings', {
|
|
18
|
+
fileName,
|
|
19
|
+
nodePath,
|
|
20
|
+
key: fieldKey,
|
|
21
|
+
settings,
|
|
22
|
+
schema,
|
|
23
|
+
clientId,
|
|
24
|
+
}),
|
|
25
|
+
errorLabel: 'Could not update keyframe settings',
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
exports.callUpdateSequenceKeyframeSettings = callUpdateSequenceKeyframeSettings;
|
|
29
|
+
const callUpdateEffectKeyframeSettings = ({ fileName, nodePath, effectIndex, fieldKey, settings, schema, setCodeValues, clientId, }) => {
|
|
30
|
+
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
31
|
+
nodePath,
|
|
32
|
+
setCodeValues,
|
|
33
|
+
applyOptimistic: (prev) => (0, studio_shared_1.optimisticUpdateEffectKeyframeSettings)({
|
|
34
|
+
previous: prev,
|
|
35
|
+
effectIndex,
|
|
36
|
+
fieldKey,
|
|
37
|
+
settings,
|
|
38
|
+
}),
|
|
39
|
+
applyServerResponse: (prev, response) => (0, apply_effect_response_to_code_values_1.applyEffectResponseToCodeValues)({ previous: prev, response }),
|
|
40
|
+
apiCall: () => (0, call_api_1.callApi)('/api/update-effect-keyframe-settings', {
|
|
41
|
+
fileName,
|
|
42
|
+
sequenceNodePath: nodePath,
|
|
43
|
+
effectIndex,
|
|
44
|
+
key: fieldKey,
|
|
45
|
+
settings,
|
|
46
|
+
schema,
|
|
47
|
+
clientId,
|
|
48
|
+
}),
|
|
49
|
+
errorLabel: 'Could not update keyframe settings',
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
exports.callUpdateEffectKeyframeSettings = callUpdateEffectKeyframeSettings;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import type { OverrideIdToNodePaths, TSequence } from 'remotion';
|
|
2
|
+
import type { ConfirmationDialogFunction } from '../ConfirmationDialog-types';
|
|
2
3
|
import type { SetCodeValues } from './save-sequence-prop';
|
|
3
4
|
import type { TimelineSelection } from './TimelineSelection';
|
|
4
|
-
export declare const deleteSelectedTimelineItem: ({ selection, sequences, overrideIdsToNodePaths, setCodeValues, clientId, }: {
|
|
5
|
+
export declare const deleteSelectedTimelineItem: ({ selection, sequences, overrideIdsToNodePaths, setCodeValues, clientId, confirm, }: {
|
|
5
6
|
selection: TimelineSelection;
|
|
6
7
|
sequences: TSequence[];
|
|
7
8
|
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
8
9
|
setCodeValues: SetCodeValues;
|
|
9
10
|
clientId: string;
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
confirm: ConfirmationDialogFunction;
|
|
12
|
+
}) => Promise<boolean> | null;
|
|
13
|
+
export declare const deleteSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, setCodeValues, clientId, confirm, }: {
|
|
12
14
|
selections: readonly TimelineSelection[];
|
|
13
15
|
sequences: TSequence[];
|
|
14
16
|
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
15
17
|
setCodeValues: SetCodeValues;
|
|
16
18
|
clientId: string;
|
|
17
|
-
|
|
19
|
+
confirm: ConfirmationDialogFunction;
|
|
20
|
+
}) => Promise<boolean> | null;
|
|
@@ -4,27 +4,31 @@ exports.deleteSelectedTimelineItems = exports.deleteSelectedTimelineItem = void
|
|
|
4
4
|
const call_api_1 = require("../call-api");
|
|
5
5
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
6
6
|
const delete_selected_keyframe_1 = require("./delete-selected-keyframe");
|
|
7
|
-
const confirmDeletingDuplicatedSequences = (nodePathInfos) => {
|
|
7
|
+
const confirmDeletingDuplicatedSequences = (nodePathInfos, confirm) => {
|
|
8
8
|
const duplicatedNodePathInfos = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath > 1);
|
|
9
9
|
if (duplicatedNodePathInfos.length === 0) {
|
|
10
|
-
return true;
|
|
10
|
+
return Promise.resolve(true);
|
|
11
11
|
}
|
|
12
12
|
if (duplicatedNodePathInfos.length === 1) {
|
|
13
13
|
const [nodePathInfo] = duplicatedNodePathInfos;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
return confirm({
|
|
15
|
+
title: 'Delete sequence?',
|
|
16
|
+
message: 'This sequence is programmatically duplicated ' +
|
|
17
|
+
nodePathInfo.numberOfSequencesWithThisNodePath +
|
|
18
|
+
' times in the code. Deleting removes all instances. Continue?',
|
|
19
|
+
confirmLabel: 'Delete',
|
|
20
|
+
});
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
'
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
return confirm({
|
|
23
|
+
title: 'Delete sequences?',
|
|
24
|
+
message: duplicatedNodePathInfos.length +
|
|
25
|
+
' selected sequences are programmatically duplicated in the code. Deleting removes all instances. Continue?',
|
|
26
|
+
confirmLabel: 'Delete',
|
|
27
|
+
});
|
|
24
28
|
};
|
|
25
|
-
const deleteSequences = (nodePathInfos) => {
|
|
26
|
-
if (!confirmDeletingDuplicatedSequences(nodePathInfos)) {
|
|
27
|
-
return
|
|
29
|
+
const deleteSequences = async (nodePathInfos, confirm) => {
|
|
30
|
+
if (!(await confirmDeletingDuplicatedSequences(nodePathInfos, confirm))) {
|
|
31
|
+
return false;
|
|
28
32
|
}
|
|
29
33
|
return (0, call_api_1.callApi)('/api/delete-jsx-node', {
|
|
30
34
|
nodes: nodePathInfos.map((nodePathInfo) => {
|
|
@@ -44,14 +48,16 @@ const deleteSequences = (nodePathInfos) => {
|
|
|
44
48
|
else {
|
|
45
49
|
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
46
50
|
}
|
|
51
|
+
return true;
|
|
47
52
|
})
|
|
48
53
|
.catch((err) => {
|
|
49
54
|
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
55
|
+
return true;
|
|
50
56
|
});
|
|
51
57
|
};
|
|
52
58
|
const deleteEffects = (effects) => {
|
|
53
59
|
if (effects.length === 0) {
|
|
54
|
-
return Promise.resolve();
|
|
60
|
+
return Promise.resolve(false);
|
|
55
61
|
}
|
|
56
62
|
return (0, call_api_1.callApi)('/api/delete-effect', effects.map((effect) => {
|
|
57
63
|
const nodePath = effect.nodePathInfo.sequenceSubscriptionKey;
|
|
@@ -80,14 +86,17 @@ const deleteEffects = (effects) => {
|
|
|
80
86
|
else {
|
|
81
87
|
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
82
88
|
}
|
|
89
|
+
return true;
|
|
83
90
|
})
|
|
84
91
|
.catch((err) => {
|
|
85
92
|
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
93
|
+
return true;
|
|
86
94
|
});
|
|
87
95
|
};
|
|
88
|
-
const deleteSelectedTimelineItem = ({ selection, sequences, overrideIdsToNodePaths, setCodeValues, clientId, }) => {
|
|
96
|
+
const deleteSelectedTimelineItem = ({ selection, sequences, overrideIdsToNodePaths, setCodeValues, clientId, confirm, }) => {
|
|
97
|
+
var _a;
|
|
89
98
|
if (selection.type === 'keyframe') {
|
|
90
|
-
|
|
99
|
+
const promise = (0, delete_selected_keyframe_1.deleteSelectedKeyframe)({
|
|
91
100
|
nodePathInfo: selection.nodePathInfo,
|
|
92
101
|
frame: selection.frame,
|
|
93
102
|
sequences,
|
|
@@ -95,10 +104,11 @@ const deleteSelectedTimelineItem = ({ selection, sequences, overrideIdsToNodePat
|
|
|
95
104
|
setCodeValues,
|
|
96
105
|
clientId,
|
|
97
106
|
});
|
|
107
|
+
return (_a = promise === null || promise === void 0 ? void 0 : promise.then(() => true)) !== null && _a !== void 0 ? _a : null;
|
|
98
108
|
}
|
|
99
109
|
switch (selection.type) {
|
|
100
110
|
case 'sequence':
|
|
101
|
-
return deleteSequences([selection.nodePathInfo]);
|
|
111
|
+
return deleteSequences([selection.nodePathInfo], confirm);
|
|
102
112
|
case 'sequence-effect':
|
|
103
113
|
return deleteEffects([
|
|
104
114
|
{
|
|
@@ -134,7 +144,8 @@ const assertTimelineSelectionsHaveSameType = (selections) => {
|
|
|
134
144
|
}
|
|
135
145
|
}
|
|
136
146
|
};
|
|
137
|
-
const deleteSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodePaths, setCodeValues, clientId, }) => {
|
|
147
|
+
const deleteSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodePaths, setCodeValues, clientId, confirm, }) => {
|
|
148
|
+
var _a;
|
|
138
149
|
const firstSelection = selections[0];
|
|
139
150
|
if (!firstSelection) {
|
|
140
151
|
return null;
|
|
@@ -144,7 +155,7 @@ const deleteSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodeP
|
|
|
144
155
|
case 'sequence':
|
|
145
156
|
return deleteSequences(selections
|
|
146
157
|
.filter(isSequenceRowSelection)
|
|
147
|
-
.map((selection) => selection.nodePathInfo));
|
|
158
|
+
.map((selection) => selection.nodePathInfo), confirm);
|
|
148
159
|
case 'sequence-effect':
|
|
149
160
|
return deleteEffects(selections.filter(isSequenceEffectSelection).map((selection) => ({
|
|
150
161
|
type: 'single-effect',
|
|
@@ -152,7 +163,7 @@ const deleteSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodeP
|
|
|
152
163
|
effectIndex: selection.i,
|
|
153
164
|
})));
|
|
154
165
|
case 'keyframe': {
|
|
155
|
-
|
|
166
|
+
const promise = (0, delete_selected_keyframe_1.deleteSelectedKeyframes)({
|
|
156
167
|
keyframes: selections.filter(isKeyframeSelection).map((selection) => ({
|
|
157
168
|
nodePathInfo: selection.nodePathInfo,
|
|
158
169
|
frame: selection.frame,
|
|
@@ -162,6 +173,7 @@ const deleteSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodeP
|
|
|
162
173
|
setCodeValues,
|
|
163
174
|
clientId,
|
|
164
175
|
});
|
|
176
|
+
return (_a = promise === null || promise === void 0 ? void 0 : promise.then(() => true)) !== null && _a !== void 0 ? _a : null;
|
|
165
177
|
}
|
|
166
178
|
case 'sequence-prop':
|
|
167
179
|
case 'sequence-effect-prop':
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
2
|
+
import type { ConfirmationDialogFunction } from '../ConfirmationDialog-types';
|
|
2
3
|
import type { TimelineSelection } from './TimelineSelection';
|
|
3
|
-
export declare const duplicateSequencesFromSource: (nodePathInfos: readonly SequenceNodePathInfo[]) => Promise<void>;
|
|
4
|
+
export declare const duplicateSequencesFromSource: (nodePathInfos: readonly SequenceNodePathInfo[], confirm: ConfirmationDialogFunction) => Promise<void>;
|
|
4
5
|
export declare const isDuplicatableSequenceRowSelection: (selection: TimelineSelection) => selection is {
|
|
5
6
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
6
7
|
} & {
|
|
@@ -8,6 +9,7 @@ export declare const isDuplicatableSequenceRowSelection: (selection: TimelineSel
|
|
|
8
9
|
} & {
|
|
9
10
|
type: "sequence";
|
|
10
11
|
};
|
|
11
|
-
export declare const duplicateSelectedTimelineItems: ({ selections, }: {
|
|
12
|
+
export declare const duplicateSelectedTimelineItems: ({ selections, confirm, }: {
|
|
12
13
|
selections: readonly TimelineSelection[];
|
|
14
|
+
confirm: ConfirmationDialogFunction;
|
|
13
15
|
}) => Promise<void> | null;
|
|
@@ -3,22 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.duplicateSelectedTimelineItems = exports.isDuplicatableSequenceRowSelection = exports.duplicateSequencesFromSource = void 0;
|
|
4
4
|
const call_api_1 = require("../call-api");
|
|
5
5
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
6
|
-
const confirmDuplicatingProgrammaticallyDuplicatedSequences = (nodePathInfos) => {
|
|
6
|
+
const confirmDuplicatingProgrammaticallyDuplicatedSequences = (nodePathInfos, confirm) => {
|
|
7
7
|
if (nodePathInfos.length === 0) {
|
|
8
|
-
return true;
|
|
8
|
+
return Promise.resolve(true);
|
|
9
9
|
}
|
|
10
10
|
if (nodePathInfos.length === 1) {
|
|
11
11
|
const [nodePathInfo] = nodePathInfos;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
return confirm({
|
|
13
|
+
title: 'Duplicate sequence?',
|
|
14
|
+
message: 'This sequence is programmatically duplicated ' +
|
|
15
|
+
nodePathInfo.numberOfSequencesWithThisNodePath +
|
|
16
|
+
' times in the code. Duplicating inserts another copy. Continue?',
|
|
17
|
+
confirmLabel: 'Duplicate',
|
|
18
|
+
});
|
|
17
19
|
}
|
|
18
|
-
|
|
19
|
-
'
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
return confirm({
|
|
21
|
+
title: 'Duplicate sequences?',
|
|
22
|
+
message: nodePathInfos.length +
|
|
23
|
+
' selected sequences are programmatically duplicated in the code. Duplicating inserts another copy of each. Continue?',
|
|
24
|
+
confirmLabel: 'Duplicate',
|
|
25
|
+
});
|
|
22
26
|
};
|
|
23
27
|
const duplicateSequence = (nodePathInfo) => {
|
|
24
28
|
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
@@ -27,40 +31,41 @@ const duplicateSequence = (nodePathInfo) => {
|
|
|
27
31
|
nodePath: nodePath.nodePath,
|
|
28
32
|
});
|
|
29
33
|
};
|
|
30
|
-
const duplicateSequencesFromSource = (nodePathInfos) => {
|
|
34
|
+
const duplicateSequencesFromSource = (nodePathInfos, confirm) => {
|
|
31
35
|
const programmaticallyDuplicated = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath > 1);
|
|
32
36
|
const regular = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath <= 1);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
return Promise.all(toDuplicate.map(duplicateSequence))
|
|
42
|
-
.then((results) => {
|
|
43
|
-
const failedResult = results.find((result) => !result.success);
|
|
44
|
-
if (failedResult && !failedResult.success) {
|
|
45
|
-
(0, NotificationCenter_1.showNotification)(failedResult.reason, 4000);
|
|
46
|
-
return;
|
|
37
|
+
return confirmDuplicatingProgrammaticallyDuplicatedSequences(programmaticallyDuplicated, confirm).then((shouldDuplicateProgrammaticSequences) => {
|
|
38
|
+
const toDuplicate = [...regular];
|
|
39
|
+
if (shouldDuplicateProgrammaticSequences) {
|
|
40
|
+
toDuplicate.push(...programmaticallyDuplicated);
|
|
41
|
+
}
|
|
42
|
+
if (toDuplicate.length === 0) {
|
|
43
|
+
return Promise.resolve();
|
|
47
44
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
return Promise.all(toDuplicate.map(duplicateSequence))
|
|
46
|
+
.then((results) => {
|
|
47
|
+
const failedResult = results.find((result) => !result.success);
|
|
48
|
+
if (failedResult && !failedResult.success) {
|
|
49
|
+
(0, NotificationCenter_1.showNotification)(failedResult.reason, 4000);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
(0, NotificationCenter_1.showNotification)(toDuplicate.length === 1
|
|
53
|
+
? 'Duplicated sequence in source file'
|
|
54
|
+
: 'Duplicated sequences in source files', 2000);
|
|
55
|
+
})
|
|
56
|
+
.catch((err) => {
|
|
57
|
+
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
58
|
+
});
|
|
54
59
|
});
|
|
55
60
|
};
|
|
56
61
|
exports.duplicateSequencesFromSource = duplicateSequencesFromSource;
|
|
57
62
|
const isDuplicatableSequenceRowSelection = (selection) => selection.type === 'sequence';
|
|
58
63
|
exports.isDuplicatableSequenceRowSelection = isDuplicatableSequenceRowSelection;
|
|
59
|
-
const duplicateSelectedTimelineItems = ({ selections, }) => {
|
|
64
|
+
const duplicateSelectedTimelineItems = ({ selections, confirm, }) => {
|
|
60
65
|
const sequenceSelections = selections.filter(exports.isDuplicatableSequenceRowSelection);
|
|
61
66
|
if (sequenceSelections.length === 0) {
|
|
62
67
|
return null;
|
|
63
68
|
}
|
|
64
|
-
return (0, exports.duplicateSequencesFromSource)(sequenceSelections.map((selection) => selection.nodePathInfo));
|
|
69
|
+
return (0, exports.duplicateSequencesFromSource)(sequenceSelections.map((selection) => selection.nodePathInfo), confirm);
|
|
65
70
|
};
|
|
66
71
|
exports.duplicateSelectedTimelineItems = duplicateSelectedTimelineItems;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type TimelineKeyframeDragBoundsTarget = {
|
|
2
|
+
readonly displayFrame: number;
|
|
3
|
+
};
|
|
4
|
+
export declare const getBoundedKeyframeDragDelta: ({ delta, durationInFrames, targets, }: {
|
|
5
|
+
readonly delta: number;
|
|
6
|
+
readonly durationInFrames: number;
|
|
7
|
+
readonly targets: readonly TimelineKeyframeDragBoundsTarget[];
|
|
8
|
+
}) => number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBoundedKeyframeDragDelta = void 0;
|
|
4
|
+
const getBoundedKeyframeDragDelta = ({ delta, durationInFrames, targets, }) => {
|
|
5
|
+
if (targets.length === 0 || durationInFrames <= 0) {
|
|
6
|
+
return 0;
|
|
7
|
+
}
|
|
8
|
+
const minDelta = Math.max(...targets.map((target) => -target.displayFrame));
|
|
9
|
+
const maxDelta = Math.min(...targets.map((target) => durationInFrames - 1 - target.displayFrame));
|
|
10
|
+
return Math.min(Math.max(delta, minDelta), maxDelta);
|
|
11
|
+
};
|
|
12
|
+
exports.getBoundedKeyframeDragDelta = getBoundedKeyframeDragDelta;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const getPreviousKeyframeDisplayFrame: (keyframes: readonly {
|
|
2
2
|
frame: number;
|
|
3
|
-
}[], currentDisplayFrame: number) => number | null;
|
|
3
|
+
}[], currentDisplayFrame: number, durationInFrames: number) => number | null;
|
|
4
4
|
export declare const getNextKeyframeDisplayFrame: (keyframes: readonly {
|
|
5
5
|
frame: number;
|
|
6
|
-
}[], currentDisplayFrame: number) => number | null;
|
|
6
|
+
}[], currentDisplayFrame: number, durationInFrames: number) => number | null;
|
|
7
7
|
export declare const hasKeyframeAtSourceFrame: (keyframes: readonly {
|
|
8
8
|
frame: number;
|
|
9
9
|
}[], sourceFrame: number) => boolean;
|