@remotion/studio 4.0.468 → 4.0.470
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Studio.js +1 -1
- package/dist/api/save-render-output.js +3 -12
- package/dist/components/AudioWaveform.d.ts +1 -0
- package/dist/components/AudioWaveform.js +41 -23
- package/dist/components/CompositionSelectorItem.js +1 -1
- package/dist/components/ContextMenu.d.ts +1 -0
- package/dist/components/ContextMenu.js +8 -3
- package/dist/components/EditorContent.js +5 -4
- package/dist/components/EditorGuides/Guide.js +1 -1
- package/dist/components/ExpandedTracksProvider.js +3 -8
- package/dist/components/Menu/MenuItem.d.ts +1 -1
- package/dist/components/Menu/MenuItem.js +2 -2
- package/dist/components/Menu/MenuSubItem.js +5 -5
- package/dist/components/MenuBuildIndicator.js +0 -1
- package/dist/components/NewComposition/InputDragger.js +1 -0
- package/dist/components/Preview.js +4 -1
- package/dist/components/PreviewToolbar.js +2 -4
- package/dist/components/SelectedOutlineOverlay.d.ts +18 -0
- package/dist/components/SelectedOutlineOverlay.js +645 -0
- package/dist/components/Timeline/Timeline.js +18 -3
- package/dist/components/Timeline/TimelineDeleteKeybindings.d.ts +2 -0
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +86 -0
- package/dist/components/Timeline/TimelineDragHandler.js +19 -244
- package/dist/components/Timeline/{TimelineEffectGroupRow.d.ts → TimelineEffectItem.d.ts} +1 -1
- package/dist/components/Timeline/{TimelineEffectGroupRow.js → TimelineEffectItem.js} +61 -35
- package/dist/components/Timeline/{TimelineEffectFieldRow.d.ts → TimelineEffectPropItem.d.ts} +4 -1
- package/dist/components/Timeline/{TimelineEffectFieldRow.js → TimelineEffectPropItem.js} +100 -16
- package/dist/components/Timeline/TimelineExpandArrowButton.js +5 -1
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +11 -0
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +55 -0
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +29 -11
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +4 -4
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +9 -120
- package/dist/components/Timeline/TimelineFieldLabel.d.ts +6 -0
- package/dist/components/Timeline/TimelineFieldLabel.js +30 -0
- package/dist/components/Timeline/TimelineInOutDragHandler.d.ts +2 -0
- package/dist/components/Timeline/TimelineInOutDragHandler.js +324 -0
- package/dist/components/Timeline/TimelineInOutPointer.js +3 -1
- package/dist/components/Timeline/TimelineInOutPointerHandle.d.ts +1 -0
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +5 -4
- package/dist/components/Timeline/TimelineItemStack.d.ts +5 -0
- package/dist/components/Timeline/TimelineItemStack.js +82 -0
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +17 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +217 -0
- package/dist/components/Timeline/TimelineKeyframeDiamond.d.ts +7 -0
- package/dist/components/Timeline/TimelineKeyframeDiamond.js +88 -0
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +8 -0
- package/dist/components/Timeline/TimelineKeyframedValue.js +36 -0
- package/dist/components/Timeline/TimelineLayerEye.js +1 -0
- package/dist/components/Timeline/TimelineList.js +3 -11
- package/dist/components/Timeline/TimelineMediaInfo.d.ts +13 -1
- package/dist/components/Timeline/TimelineMediaInfo.js +33 -80
- package/dist/components/Timeline/TimelineRowChrome.d.ts +10 -1
- package/dist/components/Timeline/TimelineRowChrome.js +64 -6
- package/dist/components/Timeline/TimelineSchemaField.js +7 -2
- package/dist/components/Timeline/TimelineSelection.d.ts +85 -0
- package/dist/components/Timeline/TimelineSelection.js +417 -0
- package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequence.js +18 -6
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/{TimelineListItem.d.ts → TimelineSequenceItem.d.ts} +2 -2
- package/dist/components/Timeline/{TimelineListItem.js → TimelineSequenceItem.js} +148 -63
- package/dist/components/Timeline/TimelineSequenceName.d.ts +7 -0
- package/dist/components/Timeline/TimelineSequenceName.js +50 -0
- package/dist/components/Timeline/{TimelineFieldRow.d.ts → TimelineSequencePropItem.d.ts} +5 -3
- package/dist/components/Timeline/TimelineSequencePropItem.js +183 -0
- package/dist/components/Timeline/TimelineTimeIndicators.js +0 -1
- package/dist/components/Timeline/TimelineTrack.d.ts +5 -0
- package/dist/components/Timeline/TimelineTrack.js +66 -0
- package/dist/components/Timeline/TimelineTracks.js +2 -16
- package/dist/components/Timeline/TimelineTranslateField.js +14 -22
- package/dist/components/Timeline/TimelineUvCoordinateField.d.ts +11 -0
- package/dist/components/Timeline/TimelineUvCoordinateField.js +126 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +11 -12
- package/dist/components/Timeline/call-add-keyframe.d.ts +23 -0
- package/dist/components/Timeline/call-add-keyframe.js +54 -0
- package/dist/components/Timeline/call-delete-keyframe.d.ts +21 -0
- package/dist/components/Timeline/call-delete-keyframe.js +50 -0
- package/dist/components/Timeline/delete-selected-keyframe.d.ts +11 -0
- package/dist/components/Timeline/delete-selected-keyframe.js +51 -0
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +17 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +183 -0
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +13 -0
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +66 -0
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +7 -0
- package/dist/components/Timeline/find-track-for-node-path-info.js +13 -0
- package/dist/components/Timeline/get-keyframe-navigation.d.ts +9 -0
- package/dist/components/Timeline/get-keyframe-navigation.js +26 -0
- package/dist/components/Timeline/get-node-keyframes.d.ts +11 -0
- package/dist/components/Timeline/get-node-keyframes.js +23 -0
- package/dist/components/Timeline/get-timeline-keyframes.js +6 -8
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.d.ts +8 -0
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +26 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +14 -2
- package/dist/components/Timeline/save-sequence-prop.js +42 -7
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +11 -1
- package/dist/components/Timeline/timeline-row-layout.d.ts +1 -0
- package/dist/components/Timeline/timeline-row-layout.js +2 -1
- package/dist/components/Timeline/timeline-translate-utils.d.ts +2 -0
- package/dist/components/Timeline/timeline-translate-utils.js +20 -0
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +17 -0
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +52 -0
- package/dist/components/Timeline/use-open-sequence-in-editor.d.ts +6 -0
- package/dist/components/Timeline/use-open-sequence-in-editor.js +31 -0
- package/dist/components/composition-menu-items.js +32 -1
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +0 -1
- package/dist/esm/{chunk-8q828zk7.js → chunk-dny42qnq.js} +10566 -6221
- package/dist/esm/internals.mjs +10566 -6221
- package/dist/esm/previewEntry.mjs +10548 -6203
- package/dist/esm/renderEntry.mjs +3 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/colors.js +1 -1
- package/dist/helpers/format-file-location.d.ts +9 -0
- package/dist/helpers/format-file-location.js +27 -0
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
- package/dist/helpers/get-box-quads-polyfill-internals.js +2395 -0
- package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
- package/dist/helpers/get-box-quads-ponyfill.js +23 -0
- package/dist/helpers/open-in-editor.d.ts +1 -1
- package/dist/helpers/open-in-editor.js +11 -26
- package/dist/helpers/timeline-layout.d.ts +8 -7
- package/dist/helpers/timeline-layout.js +9 -8
- package/dist/helpers/timeline-node-path-key.d.ts +2 -0
- package/dist/helpers/timeline-node-path-key.js +10 -0
- package/dist/helpers/use-menu-structure.js +8 -16
- package/dist/renderEntry.js +2 -2
- package/package.json +10 -10
- package/dist/components/Timeline/TimelineFieldRow.js +0 -113
- package/dist/components/Timeline/TimelineStack/index.d.ts +0 -8
- package/dist/components/Timeline/TimelineStack/index.js +0 -119
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
2
|
+
import type { SetCodeValues } from './save-sequence-prop';
|
|
3
|
+
export declare const callAddSequenceKeyframe: ({ fileName, nodePath, fieldKey, sourceFrame, value, schema, setCodeValues, clientId, }: {
|
|
4
|
+
fileName: string;
|
|
5
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
6
|
+
fieldKey: string;
|
|
7
|
+
sourceFrame: number;
|
|
8
|
+
value: unknown;
|
|
9
|
+
schema: SequenceSchema;
|
|
10
|
+
setCodeValues: SetCodeValues;
|
|
11
|
+
clientId: string;
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
export declare const callAddEffectKeyframe: ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, value, schema, setCodeValues, clientId, }: {
|
|
14
|
+
fileName: string;
|
|
15
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
16
|
+
effectIndex: number;
|
|
17
|
+
fieldKey: string;
|
|
18
|
+
sourceFrame: number;
|
|
19
|
+
value: unknown;
|
|
20
|
+
schema: SequenceSchema;
|
|
21
|
+
setCodeValues: SetCodeValues;
|
|
22
|
+
clientId: string;
|
|
23
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callAddEffectKeyframe = exports.callAddSequenceKeyframe = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const call_api_1 = require("../call-api");
|
|
6
|
+
const save_prop_queue_1 = require("./save-prop-queue");
|
|
7
|
+
const callAddSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame, value, schema, setCodeValues, clientId, }) => {
|
|
8
|
+
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
9
|
+
nodePath,
|
|
10
|
+
setCodeValues,
|
|
11
|
+
applyOptimistic: (prev) => (0, studio_shared_1.optimisticAddSequenceKeyframe)({
|
|
12
|
+
previous: prev,
|
|
13
|
+
fieldKey,
|
|
14
|
+
frame: sourceFrame,
|
|
15
|
+
value,
|
|
16
|
+
}),
|
|
17
|
+
apiCall: () => (0, call_api_1.callApi)('/api/add-sequence-keyframe', {
|
|
18
|
+
fileName,
|
|
19
|
+
nodePath,
|
|
20
|
+
key: fieldKey,
|
|
21
|
+
frame: sourceFrame,
|
|
22
|
+
value: JSON.stringify(value),
|
|
23
|
+
schema,
|
|
24
|
+
clientId,
|
|
25
|
+
}),
|
|
26
|
+
errorLabel: 'Could not add keyframe',
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
exports.callAddSequenceKeyframe = callAddSequenceKeyframe;
|
|
30
|
+
const callAddEffectKeyframe = ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, value, schema, setCodeValues, clientId, }) => {
|
|
31
|
+
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
32
|
+
nodePath,
|
|
33
|
+
setCodeValues,
|
|
34
|
+
applyOptimistic: (prev) => (0, studio_shared_1.optimisticAddEffectKeyframe)({
|
|
35
|
+
previous: prev,
|
|
36
|
+
effectIndex,
|
|
37
|
+
fieldKey,
|
|
38
|
+
frame: sourceFrame,
|
|
39
|
+
value,
|
|
40
|
+
}),
|
|
41
|
+
apiCall: () => (0, call_api_1.callApi)('/api/add-effect-keyframe', {
|
|
42
|
+
fileName,
|
|
43
|
+
sequenceNodePath: nodePath,
|
|
44
|
+
effectIndex,
|
|
45
|
+
key: fieldKey,
|
|
46
|
+
frame: sourceFrame,
|
|
47
|
+
value: JSON.stringify(value),
|
|
48
|
+
schema,
|
|
49
|
+
clientId,
|
|
50
|
+
}),
|
|
51
|
+
errorLabel: 'Could not add keyframe',
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
exports.callAddEffectKeyframe = callAddEffectKeyframe;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
2
|
+
import type { SetCodeValues } from './save-sequence-prop';
|
|
3
|
+
export declare const callDeleteSequenceKeyframe: ({ fileName, nodePath, fieldKey, sourceFrame, schema, setCodeValues, clientId, }: {
|
|
4
|
+
fileName: string;
|
|
5
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
6
|
+
fieldKey: string;
|
|
7
|
+
sourceFrame: number;
|
|
8
|
+
schema: SequenceSchema;
|
|
9
|
+
setCodeValues: SetCodeValues;
|
|
10
|
+
clientId: string;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
export declare const callDeleteEffectKeyframe: ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, schema, setCodeValues, clientId, }: {
|
|
13
|
+
fileName: string;
|
|
14
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
15
|
+
effectIndex: number;
|
|
16
|
+
fieldKey: string;
|
|
17
|
+
sourceFrame: number;
|
|
18
|
+
schema: SequenceSchema;
|
|
19
|
+
setCodeValues: SetCodeValues;
|
|
20
|
+
clientId: string;
|
|
21
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callDeleteEffectKeyframe = exports.callDeleteSequenceKeyframe = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const call_api_1 = require("../call-api");
|
|
6
|
+
const save_prop_queue_1 = require("./save-prop-queue");
|
|
7
|
+
const callDeleteSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame, schema, setCodeValues, clientId, }) => {
|
|
8
|
+
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
9
|
+
nodePath,
|
|
10
|
+
setCodeValues,
|
|
11
|
+
applyOptimistic: (prev) => (0, studio_shared_1.optimisticDeleteSequenceKeyframe)({
|
|
12
|
+
previous: prev,
|
|
13
|
+
fieldKey,
|
|
14
|
+
frame: sourceFrame,
|
|
15
|
+
}),
|
|
16
|
+
apiCall: () => (0, call_api_1.callApi)('/api/delete-sequence-keyframe', {
|
|
17
|
+
fileName,
|
|
18
|
+
nodePath,
|
|
19
|
+
key: fieldKey,
|
|
20
|
+
frame: sourceFrame,
|
|
21
|
+
schema,
|
|
22
|
+
clientId,
|
|
23
|
+
}),
|
|
24
|
+
errorLabel: 'Could not delete keyframe',
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
exports.callDeleteSequenceKeyframe = callDeleteSequenceKeyframe;
|
|
28
|
+
const callDeleteEffectKeyframe = ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, schema, setCodeValues, clientId, }) => {
|
|
29
|
+
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
30
|
+
nodePath,
|
|
31
|
+
setCodeValues,
|
|
32
|
+
applyOptimistic: (prev) => (0, studio_shared_1.optimisticDeleteEffectKeyframe)({
|
|
33
|
+
previous: prev,
|
|
34
|
+
effectIndex,
|
|
35
|
+
fieldKey,
|
|
36
|
+
frame: sourceFrame,
|
|
37
|
+
}),
|
|
38
|
+
apiCall: () => (0, call_api_1.callApi)('/api/delete-effect-keyframe', {
|
|
39
|
+
fileName,
|
|
40
|
+
sequenceNodePath: nodePath,
|
|
41
|
+
effectIndex,
|
|
42
|
+
key: fieldKey,
|
|
43
|
+
frame: sourceFrame,
|
|
44
|
+
schema,
|
|
45
|
+
clientId,
|
|
46
|
+
}),
|
|
47
|
+
errorLabel: 'Could not delete keyframe',
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
exports.callDeleteEffectKeyframe = callDeleteEffectKeyframe;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OverrideIdToNodePaths, TSequence } from 'remotion';
|
|
2
|
+
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
|
+
import type { SetCodeValues } from './save-sequence-prop';
|
|
4
|
+
export declare const deleteSelectedKeyframe: ({ nodePathInfo, frame, sequences, overrideIdsToNodePaths, setCodeValues, clientId, }: {
|
|
5
|
+
nodePathInfo: SequenceNodePathInfo;
|
|
6
|
+
frame: number;
|
|
7
|
+
sequences: TSequence[];
|
|
8
|
+
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
9
|
+
setCodeValues: SetCodeValues;
|
|
10
|
+
clientId: string;
|
|
11
|
+
}) => Promise<void> | null;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteSelectedKeyframe = void 0;
|
|
4
|
+
const call_delete_keyframe_1 = require("./call-delete-keyframe");
|
|
5
|
+
const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info");
|
|
6
|
+
const parse_keyframe_field_from_node_path_1 = require("./parse-keyframe-field-from-node-path");
|
|
7
|
+
const deleteSelectedKeyframe = ({ nodePathInfo, frame, sequences, overrideIdsToNodePaths, setCodeValues, clientId, }) => {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
const field = (0, parse_keyframe_field_from_node_path_1.parseKeyframeFieldFromNodePath)(nodePathInfo.auxiliaryKeys);
|
|
10
|
+
if (field === null) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const track = (0, find_track_for_node_path_info_1.findTrackForNodePathInfo)({
|
|
14
|
+
sequences,
|
|
15
|
+
overrideIdsToNodePaths,
|
|
16
|
+
nodePathInfo,
|
|
17
|
+
});
|
|
18
|
+
const sequence = (_a = track === null || track === void 0 ? void 0 : track.sequence) !== null && _a !== void 0 ? _a : null;
|
|
19
|
+
if (!(sequence === null || sequence === void 0 ? void 0 : sequence.controls)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const sourceFrame = frame - ((_b = track === null || track === void 0 ? void 0 : track.keyframeDisplayOffset) !== null && _b !== void 0 ? _b : 0);
|
|
23
|
+
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
24
|
+
const fileName = nodePath.absolutePath;
|
|
25
|
+
if (field.type === 'effect') {
|
|
26
|
+
const effect = sequence.effects[field.effectIndex];
|
|
27
|
+
if (!effect) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return (0, call_delete_keyframe_1.callDeleteEffectKeyframe)({
|
|
31
|
+
fileName,
|
|
32
|
+
nodePath,
|
|
33
|
+
effectIndex: field.effectIndex,
|
|
34
|
+
fieldKey: field.fieldKey,
|
|
35
|
+
sourceFrame,
|
|
36
|
+
schema: effect.schema,
|
|
37
|
+
setCodeValues,
|
|
38
|
+
clientId,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return (0, call_delete_keyframe_1.callDeleteSequenceKeyframe)({
|
|
42
|
+
fileName,
|
|
43
|
+
nodePath,
|
|
44
|
+
fieldKey: field.fieldKey,
|
|
45
|
+
sourceFrame,
|
|
46
|
+
schema: sequence.controls.schema,
|
|
47
|
+
setCodeValues,
|
|
48
|
+
clientId,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
exports.deleteSelectedKeyframe = deleteSelectedKeyframe;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OverrideIdToNodePaths, TSequence } from 'remotion';
|
|
2
|
+
import type { SetCodeValues } from './save-sequence-prop';
|
|
3
|
+
import type { TimelineSelection } from './TimelineSelection';
|
|
4
|
+
export declare const deleteSelectedTimelineItem: ({ selection, sequences, overrideIdsToNodePaths, setCodeValues, clientId, }: {
|
|
5
|
+
selection: TimelineSelection;
|
|
6
|
+
sequences: TSequence[];
|
|
7
|
+
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
8
|
+
setCodeValues: SetCodeValues;
|
|
9
|
+
clientId: string;
|
|
10
|
+
}) => Promise<void> | null;
|
|
11
|
+
export declare const deleteSelectedTimelineItems: ({ selections, sequences, overrideIdsToNodePaths, setCodeValues, clientId, }: {
|
|
12
|
+
selections: readonly TimelineSelection[];
|
|
13
|
+
sequences: TSequence[];
|
|
14
|
+
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
15
|
+
setCodeValues: SetCodeValues;
|
|
16
|
+
clientId: string;
|
|
17
|
+
}) => Promise<void> | null;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteSelectedTimelineItems = exports.deleteSelectedTimelineItem = void 0;
|
|
4
|
+
const call_api_1 = require("../call-api");
|
|
5
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
6
|
+
const delete_selected_keyframe_1 = require("./delete-selected-keyframe");
|
|
7
|
+
const confirmDeletingDuplicatedSequences = (nodePathInfos) => {
|
|
8
|
+
const duplicatedNodePathInfos = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath > 1);
|
|
9
|
+
if (duplicatedNodePathInfos.length === 0) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (duplicatedNodePathInfos.length === 1) {
|
|
13
|
+
const [nodePathInfo] = duplicatedNodePathInfos;
|
|
14
|
+
const singleDuplicatedSequenceMessage = 'This sequence is programmatically duplicated ' +
|
|
15
|
+
nodePathInfo.numberOfSequencesWithThisNodePath +
|
|
16
|
+
' times in the code. Deleting removes all instances. Continue?';
|
|
17
|
+
// eslint-disable-next-line no-alert -- native confirm before deleting all instances of a duplicated sequence
|
|
18
|
+
return window.confirm(singleDuplicatedSequenceMessage);
|
|
19
|
+
}
|
|
20
|
+
const multipleDuplicatedSequencesMessage = duplicatedNodePathInfos.length +
|
|
21
|
+
' selected sequences are programmatically duplicated in the code. Deleting removes all instances. Continue?';
|
|
22
|
+
// eslint-disable-next-line no-alert -- native confirm before deleting all instances of duplicated sequences
|
|
23
|
+
return window.confirm(multipleDuplicatedSequencesMessage);
|
|
24
|
+
};
|
|
25
|
+
const deleteSequences = (nodePathInfos) => {
|
|
26
|
+
if (!confirmDeletingDuplicatedSequences(nodePathInfos)) {
|
|
27
|
+
return Promise.resolve();
|
|
28
|
+
}
|
|
29
|
+
return (0, call_api_1.callApi)('/api/delete-jsx-node', {
|
|
30
|
+
nodes: nodePathInfos.map((nodePathInfo) => {
|
|
31
|
+
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
32
|
+
return {
|
|
33
|
+
fileName: nodePath.absolutePath,
|
|
34
|
+
nodePath: nodePath.nodePath,
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
})
|
|
38
|
+
.then((result) => {
|
|
39
|
+
if (result.success) {
|
|
40
|
+
(0, NotificationCenter_1.showNotification)(nodePathInfos.length === 1
|
|
41
|
+
? 'Removed sequence from source file'
|
|
42
|
+
: 'Removed sequences from source files', 2000);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
.catch((err) => {
|
|
49
|
+
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const deleteEffects = (effects) => {
|
|
53
|
+
if (effects.length === 0) {
|
|
54
|
+
return Promise.resolve();
|
|
55
|
+
}
|
|
56
|
+
return (0, call_api_1.callApi)('/api/delete-effect', effects.map((effect) => {
|
|
57
|
+
const nodePath = effect.nodePathInfo.sequenceSubscriptionKey;
|
|
58
|
+
return effect.type === 'single-effect'
|
|
59
|
+
? {
|
|
60
|
+
type: 'single-effect',
|
|
61
|
+
fileName: nodePath.absolutePath,
|
|
62
|
+
sequenceNodePath: nodePath,
|
|
63
|
+
effectIndex: effect.effectIndex,
|
|
64
|
+
}
|
|
65
|
+
: {
|
|
66
|
+
type: 'all-effects',
|
|
67
|
+
fileName: nodePath.absolutePath,
|
|
68
|
+
sequenceNodePath: nodePath,
|
|
69
|
+
};
|
|
70
|
+
}))
|
|
71
|
+
.then((result) => {
|
|
72
|
+
if (result.success) {
|
|
73
|
+
const singleEffect = effects[0];
|
|
74
|
+
(0, NotificationCenter_1.showNotification)(effects.length === 1 && (singleEffect === null || singleEffect === void 0 ? void 0 : singleEffect.type) === 'single-effect'
|
|
75
|
+
? 'Removed effect from source file'
|
|
76
|
+
: effects.length === 1
|
|
77
|
+
? 'Removed effects from source file'
|
|
78
|
+
: 'Removed effects from source files', 2000);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
.catch((err) => {
|
|
85
|
+
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
const deleteSelectedTimelineItem = ({ selection, sequences, overrideIdsToNodePaths, setCodeValues, clientId, }) => {
|
|
89
|
+
if (selection.type === 'keyframe') {
|
|
90
|
+
return (0, delete_selected_keyframe_1.deleteSelectedKeyframe)({
|
|
91
|
+
nodePathInfo: selection.nodePathInfo,
|
|
92
|
+
frame: selection.frame,
|
|
93
|
+
sequences,
|
|
94
|
+
overrideIdsToNodePaths,
|
|
95
|
+
setCodeValues,
|
|
96
|
+
clientId,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
switch (selection.type) {
|
|
100
|
+
case 'sequence':
|
|
101
|
+
return deleteSequences([selection.nodePathInfo]);
|
|
102
|
+
case 'sequence-effect':
|
|
103
|
+
return deleteEffects([
|
|
104
|
+
{
|
|
105
|
+
type: 'single-effect',
|
|
106
|
+
nodePathInfo: selection.nodePathInfo,
|
|
107
|
+
effectIndex: selection.i,
|
|
108
|
+
},
|
|
109
|
+
]);
|
|
110
|
+
case 'sequence-prop':
|
|
111
|
+
case 'sequence-effect-prop':
|
|
112
|
+
return null;
|
|
113
|
+
case 'sequence-all-effects':
|
|
114
|
+
return deleteEffects([
|
|
115
|
+
{ type: 'all-effects', nodePathInfo: selection.nodePathInfo },
|
|
116
|
+
]);
|
|
117
|
+
default:
|
|
118
|
+
throw new Error(`Unexpected timeline selection type: ${selection}`);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
exports.deleteSelectedTimelineItem = deleteSelectedTimelineItem;
|
|
122
|
+
const isSequenceRowSelection = (selection) => selection.type === 'sequence';
|
|
123
|
+
const isSequenceEffectSelection = (selection) => selection.type === 'sequence-effect';
|
|
124
|
+
const isSequenceAllEffectsSelection = (selection) => selection.type === 'sequence-all-effects';
|
|
125
|
+
const isKeyframeSelection = (selection) => selection.type === 'keyframe';
|
|
126
|
+
const assertTimelineSelectionsHaveSameType = (selections) => {
|
|
127
|
+
const firstSelection = selections[0];
|
|
128
|
+
if (!firstSelection) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
for (const selection of selections) {
|
|
132
|
+
if (selection.type !== firstSelection.type) {
|
|
133
|
+
throw new Error(`Assertion failed: Cannot delete timeline selections of different types (${firstSelection.type}, ${selection.type})`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const deleteSelectedTimelineItems = ({ selections, sequences, overrideIdsToNodePaths, setCodeValues, clientId, }) => {
|
|
138
|
+
const firstSelection = selections[0];
|
|
139
|
+
if (!firstSelection) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
assertTimelineSelectionsHaveSameType(selections);
|
|
143
|
+
switch (firstSelection.type) {
|
|
144
|
+
case 'sequence':
|
|
145
|
+
return deleteSequences(selections
|
|
146
|
+
.filter(isSequenceRowSelection)
|
|
147
|
+
.map((selection) => selection.nodePathInfo));
|
|
148
|
+
case 'sequence-effect':
|
|
149
|
+
return deleteEffects(selections.filter(isSequenceEffectSelection).map((selection) => ({
|
|
150
|
+
type: 'single-effect',
|
|
151
|
+
nodePathInfo: selection.nodePathInfo,
|
|
152
|
+
effectIndex: selection.i,
|
|
153
|
+
})));
|
|
154
|
+
case 'keyframe': {
|
|
155
|
+
const deletePromises = selections
|
|
156
|
+
.filter(isKeyframeSelection)
|
|
157
|
+
.map((selection) => (0, delete_selected_keyframe_1.deleteSelectedKeyframe)({
|
|
158
|
+
nodePathInfo: selection.nodePathInfo,
|
|
159
|
+
frame: selection.frame,
|
|
160
|
+
sequences,
|
|
161
|
+
overrideIdsToNodePaths,
|
|
162
|
+
setCodeValues,
|
|
163
|
+
clientId,
|
|
164
|
+
}))
|
|
165
|
+
.filter((promise) => promise !== null);
|
|
166
|
+
if (deletePromises.length === 0) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
return Promise.all(deletePromises).then(() => undefined);
|
|
170
|
+
}
|
|
171
|
+
case 'sequence-prop':
|
|
172
|
+
case 'sequence-effect-prop':
|
|
173
|
+
return null;
|
|
174
|
+
case 'sequence-all-effects':
|
|
175
|
+
return deleteEffects(selections.filter(isSequenceAllEffectsSelection).map((selection) => ({
|
|
176
|
+
type: 'all-effects',
|
|
177
|
+
nodePathInfo: selection.nodePathInfo,
|
|
178
|
+
})));
|
|
179
|
+
default:
|
|
180
|
+
throw new Error(`Unexpected timeline selection type: ${firstSelection}`);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
exports.deleteSelectedTimelineItems = deleteSelectedTimelineItems;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
2
|
+
import type { TimelineSelection } from './TimelineSelection';
|
|
3
|
+
export declare const duplicateSequencesFromSource: (nodePathInfos: readonly SequenceNodePathInfo[]) => Promise<void>;
|
|
4
|
+
export declare const isDuplicatableSequenceRowSelection: (selection: TimelineSelection) => selection is {
|
|
5
|
+
readonly nodePathInfo: SequenceNodePathInfo;
|
|
6
|
+
} & {
|
|
7
|
+
readonly type: "sequence";
|
|
8
|
+
} & {
|
|
9
|
+
type: "sequence";
|
|
10
|
+
};
|
|
11
|
+
export declare const duplicateSelectedTimelineItems: ({ selections, }: {
|
|
12
|
+
selections: readonly TimelineSelection[];
|
|
13
|
+
}) => Promise<void> | null;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.duplicateSelectedTimelineItems = exports.isDuplicatableSequenceRowSelection = exports.duplicateSequencesFromSource = void 0;
|
|
4
|
+
const call_api_1 = require("../call-api");
|
|
5
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
6
|
+
const confirmDuplicatingProgrammaticallyDuplicatedSequences = (nodePathInfos) => {
|
|
7
|
+
if (nodePathInfos.length === 0) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
if (nodePathInfos.length === 1) {
|
|
11
|
+
const [nodePathInfo] = nodePathInfos;
|
|
12
|
+
const singleDuplicatedSequenceMessage = 'This sequence is programmatically duplicated ' +
|
|
13
|
+
nodePathInfo.numberOfSequencesWithThisNodePath +
|
|
14
|
+
' times in the code. Duplicating inserts another copy. Continue?';
|
|
15
|
+
// eslint-disable-next-line no-alert -- native confirm before applying duplicate codemod in .map callbacks
|
|
16
|
+
return window.confirm(singleDuplicatedSequenceMessage);
|
|
17
|
+
}
|
|
18
|
+
const multipleDuplicatedSequencesMessage = nodePathInfos.length +
|
|
19
|
+
' selected sequences are programmatically duplicated in the code. Duplicating inserts another copy of each. Continue?';
|
|
20
|
+
// eslint-disable-next-line no-alert -- native confirm before applying duplicate codemod in .map callbacks
|
|
21
|
+
return window.confirm(multipleDuplicatedSequencesMessage);
|
|
22
|
+
};
|
|
23
|
+
const duplicateSequence = (nodePathInfo) => {
|
|
24
|
+
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
25
|
+
return (0, call_api_1.callApi)('/api/duplicate-jsx-node', {
|
|
26
|
+
fileName: nodePath.absolutePath,
|
|
27
|
+
nodePath: nodePath.nodePath,
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const duplicateSequencesFromSource = (nodePathInfos) => {
|
|
31
|
+
const programmaticallyDuplicated = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath > 1);
|
|
32
|
+
const regular = nodePathInfos.filter((nodePathInfo) => nodePathInfo.numberOfSequencesWithThisNodePath <= 1);
|
|
33
|
+
const toDuplicate = [...regular];
|
|
34
|
+
if (programmaticallyDuplicated.length === 0 ||
|
|
35
|
+
confirmDuplicatingProgrammaticallyDuplicatedSequences(programmaticallyDuplicated)) {
|
|
36
|
+
toDuplicate.push(...programmaticallyDuplicated);
|
|
37
|
+
}
|
|
38
|
+
if (toDuplicate.length === 0) {
|
|
39
|
+
return Promise.resolve();
|
|
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;
|
|
47
|
+
}
|
|
48
|
+
(0, NotificationCenter_1.showNotification)(toDuplicate.length === 1
|
|
49
|
+
? 'Duplicated sequence in source file'
|
|
50
|
+
: 'Duplicated sequences in source files', 2000);
|
|
51
|
+
})
|
|
52
|
+
.catch((err) => {
|
|
53
|
+
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
exports.duplicateSequencesFromSource = duplicateSequencesFromSource;
|
|
57
|
+
const isDuplicatableSequenceRowSelection = (selection) => selection.type === 'sequence';
|
|
58
|
+
exports.isDuplicatableSequenceRowSelection = isDuplicatableSequenceRowSelection;
|
|
59
|
+
const duplicateSelectedTimelineItems = ({ selections, }) => {
|
|
60
|
+
const sequenceSelections = selections.filter(exports.isDuplicatableSequenceRowSelection);
|
|
61
|
+
if (sequenceSelections.length === 0) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
return (0, exports.duplicateSequencesFromSource)(sequenceSelections.map((selection) => selection.nodePathInfo));
|
|
65
|
+
};
|
|
66
|
+
exports.duplicateSelectedTimelineItems = duplicateSelectedTimelineItems;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OverrideIdToNodePaths, TSequence } from 'remotion';
|
|
2
|
+
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
|
+
export declare const findTrackForNodePathInfo: ({ sequences, overrideIdsToNodePaths, nodePathInfo, }: {
|
|
4
|
+
sequences: TSequence[];
|
|
5
|
+
overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
6
|
+
nodePathInfo: SequenceNodePathInfo;
|
|
7
|
+
}) => import("../../helpers/get-timeline-sequence-sort-key").TrackWithHash | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findTrackForNodePathInfo = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const calculate_timeline_1 = require("../../helpers/calculate-timeline");
|
|
6
|
+
const findTrackForNodePathInfo = ({ sequences, overrideIdsToNodePaths, nodePathInfo, }) => {
|
|
7
|
+
const tracks = (0, calculate_timeline_1.calculateTimeline)({ sequences, overrideIdsToNodePaths });
|
|
8
|
+
return tracks.find((candidate) => candidate.nodePathInfo !== null &&
|
|
9
|
+
(0, studio_shared_1.stringifySequenceSubscriptionKey)(candidate.nodePathInfo.sequenceSubscriptionKey) ===
|
|
10
|
+
(0, studio_shared_1.stringifySequenceSubscriptionKey)(nodePathInfo.sequenceSubscriptionKey) &&
|
|
11
|
+
candidate.nodePathInfo.index === nodePathInfo.index);
|
|
12
|
+
};
|
|
13
|
+
exports.findTrackForNodePathInfo = findTrackForNodePathInfo;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const getPreviousKeyframeDisplayFrame: (keyframes: readonly {
|
|
2
|
+
frame: number;
|
|
3
|
+
}[], currentDisplayFrame: number) => number | null;
|
|
4
|
+
export declare const getNextKeyframeDisplayFrame: (keyframes: readonly {
|
|
5
|
+
frame: number;
|
|
6
|
+
}[], currentDisplayFrame: number) => number | null;
|
|
7
|
+
export declare const hasKeyframeAtSourceFrame: (keyframes: readonly {
|
|
8
|
+
frame: number;
|
|
9
|
+
}[], sourceFrame: number) => boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasKeyframeAtSourceFrame = exports.getNextKeyframeDisplayFrame = exports.getPreviousKeyframeDisplayFrame = void 0;
|
|
4
|
+
const getPreviousKeyframeDisplayFrame = (keyframes, currentDisplayFrame) => {
|
|
5
|
+
let previous = null;
|
|
6
|
+
for (const keyframe of keyframes) {
|
|
7
|
+
if (keyframe.frame < currentDisplayFrame) {
|
|
8
|
+
previous = keyframe.frame;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return previous;
|
|
12
|
+
};
|
|
13
|
+
exports.getPreviousKeyframeDisplayFrame = getPreviousKeyframeDisplayFrame;
|
|
14
|
+
const getNextKeyframeDisplayFrame = (keyframes, currentDisplayFrame) => {
|
|
15
|
+
for (const keyframe of keyframes) {
|
|
16
|
+
if (keyframe.frame > currentDisplayFrame) {
|
|
17
|
+
return keyframe.frame;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
};
|
|
22
|
+
exports.getNextKeyframeDisplayFrame = getNextKeyframeDisplayFrame;
|
|
23
|
+
const hasKeyframeAtSourceFrame = (keyframes, sourceFrame) => {
|
|
24
|
+
return keyframes.some((keyframe) => keyframe.frame === sourceFrame);
|
|
25
|
+
};
|
|
26
|
+
exports.hasKeyframeAtSourceFrame = hasKeyframeAtSourceFrame;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CodeValues, type SequencePropsSubscriptionKey } from 'remotion';
|
|
2
|
+
import type { TimelineTreeNode } from '../../helpers/timeline-layout';
|
|
3
|
+
export declare const getNodeKeyframes: ({ node, nodePath, codeValues, keyframeDisplayOffset, }: {
|
|
4
|
+
node: TimelineTreeNode;
|
|
5
|
+
nodePath: SequencePropsSubscriptionKey;
|
|
6
|
+
codeValues: CodeValues;
|
|
7
|
+
keyframeDisplayOffset: number;
|
|
8
|
+
}) => {
|
|
9
|
+
frame: number;
|
|
10
|
+
value: unknown;
|
|
11
|
+
}[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNodeKeyframes = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
|
|
6
|
+
const getNodeKeyframes = ({ node, nodePath, codeValues, keyframeDisplayOffset, }) => {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
if (node.kind !== 'field' || node.field === null) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
if (node.field.kind === 'sequence-field') {
|
|
12
|
+
return (0, get_timeline_keyframes_1.getTimelineKeyframes)((_a = remotion_1.Internals.getCodeValuesCtx(codeValues, nodePath)) === null || _a === void 0 ? void 0 : _a[node.field.key], keyframeDisplayOffset);
|
|
13
|
+
}
|
|
14
|
+
const effectStatus = remotion_1.Internals.getEffectCodeValuesCtx({
|
|
15
|
+
codeValues,
|
|
16
|
+
nodePath,
|
|
17
|
+
effectIndex: node.field.effectIndex,
|
|
18
|
+
});
|
|
19
|
+
return (0, get_timeline_keyframes_1.getTimelineKeyframes)(effectStatus.type === 'can-update-effect'
|
|
20
|
+
? (_b = effectStatus.props) === null || _b === void 0 ? void 0 : _b[node.field.key]
|
|
21
|
+
: null, keyframeDisplayOffset);
|
|
22
|
+
};
|
|
23
|
+
exports.getNodeKeyframes = getNodeKeyframes;
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTimelineKeyframes = exports.getComputedStatusLabel = void 0;
|
|
4
4
|
const getComputedStatusLabel = (propStatus) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
throw new Error(`Unsupported prop status: ${propStatus.reason}`);
|
|
5
|
+
if (propStatus.reason === 'computed') {
|
|
6
|
+
return 'computed';
|
|
8
7
|
}
|
|
9
|
-
return
|
|
8
|
+
return 'keyframed';
|
|
10
9
|
};
|
|
11
10
|
exports.getComputedStatusLabel = getComputedStatusLabel;
|
|
12
11
|
const getTimelineKeyframes = (propStatus, keyframeDisplayOffset = 0) => {
|
|
13
|
-
var _a;
|
|
14
12
|
if (!propStatus || propStatus.canUpdate) {
|
|
15
13
|
return [];
|
|
16
14
|
}
|
|
17
|
-
if (propStatus.reason
|
|
18
|
-
|
|
15
|
+
if (propStatus.reason === 'computed') {
|
|
16
|
+
return [];
|
|
19
17
|
}
|
|
20
|
-
const keyframes
|
|
18
|
+
const { keyframes } = propStatus;
|
|
21
19
|
if (keyframeDisplayOffset === 0) {
|
|
22
20
|
return keyframes;
|
|
23
21
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseKeyframeFieldFromNodePath = void 0;
|
|
4
|
+
const parseKeyframeFieldFromNodePath = (auxiliaryKeys) => {
|
|
5
|
+
// Sequence control field: ['controls', fieldKey]
|
|
6
|
+
if (auxiliaryKeys[0] === 'controls' && auxiliaryKeys.length >= 2) {
|
|
7
|
+
return {
|
|
8
|
+
type: 'sequence',
|
|
9
|
+
fieldKey: auxiliaryKeys[1],
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
// Effect field: ['effects', effectIndex, fieldKey]
|
|
13
|
+
if (auxiliaryKeys[0] === 'effects' && auxiliaryKeys.length >= 3) {
|
|
14
|
+
const effectIndex = Number(auxiliaryKeys[1]);
|
|
15
|
+
if (!Number.isInteger(effectIndex) || effectIndex < 0) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
type: 'effect',
|
|
20
|
+
effectIndex,
|
|
21
|
+
fieldKey: auxiliaryKeys[2],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
};
|
|
26
|
+
exports.parseKeyframeFieldFromNodePath = parseKeyframeFieldFromNodePath;
|