@remotion/studio 4.0.473 → 4.0.474
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssetSelectorItem.js +30 -6
- package/dist/components/Canvas.js +71 -0
- package/dist/components/Modals.js +1 -2
- package/dist/components/NewComposition/InputDragger.d.ts +1 -0
- package/dist/components/NewComposition/InputDragger.js +9 -6
- package/dist/components/SelectedOutlineOverlay.d.ts +7 -5
- package/dist/components/SelectedOutlineOverlay.js +78 -67
- package/dist/components/Timeline/KeyframeSettingsModal.js +4 -4
- package/dist/components/Timeline/SequencePropsObserver.js +3 -3
- package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -7
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +19 -16
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +11 -9
- package/dist/components/Timeline/TimelineEffectItem.js +7 -7
- package/dist/components/Timeline/TimelineEffectPropItem.js +17 -17
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +6 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +5 -5
- package/dist/components/Timeline/TimelineKeyframeControls.js +8 -8
- package/dist/components/Timeline/TimelineKeyframeDiamond.js +0 -1
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +9 -0
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +120 -0
- package/dist/components/Timeline/TimelineKeyframedValue.js +1 -1
- package/dist/components/Timeline/TimelineNumberField.js +15 -7
- package/dist/components/Timeline/TimelineRotationField.js +17 -11
- package/dist/components/Timeline/TimelineScaleField.js +16 -12
- package/dist/components/Timeline/TimelineSelection.d.ts +15 -0
- package/dist/components/Timeline/TimelineSelection.js +26 -1
- package/dist/components/Timeline/TimelineSequence.js +6 -6
- package/dist/components/Timeline/TimelineSequenceItem.js +21 -14
- package/dist/components/Timeline/TimelineSequencePropItem.js +37 -37
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +5 -5
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +46 -44
- package/dist/components/Timeline/TimelineTranslateField.js +24 -19
- package/dist/components/Timeline/TimelineUvCoordinateField.js +18 -12
- package/dist/components/Timeline/{apply-effect-response-to-code-values.d.ts → apply-effect-response-to-prop-statuses.d.ts} +1 -1
- package/dist/components/Timeline/{apply-effect-response-to-code-values.js → apply-effect-response-to-prop-statuses.js} +3 -3
- package/dist/components/Timeline/call-add-keyframe.d.ts +5 -5
- package/dist/components/Timeline/call-add-keyframe.js +6 -6
- package/dist/components/Timeline/call-delete-keyframe.d.ts +7 -7
- package/dist/components/Timeline/call-delete-keyframe.js +7 -7
- package/dist/components/Timeline/call-move-keyframe.d.ts +3 -3
- package/dist/components/Timeline/call-move-keyframe.js +3 -3
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +5 -5
- package/dist/components/Timeline/call-update-keyframe-settings.js +6 -6
- package/dist/components/Timeline/delete-selected-keyframe.d.ts +5 -5
- package/dist/components/Timeline/delete-selected-keyframe.js +5 -5
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +5 -5
- package/dist/components/Timeline/delete-selected-timeline-item.js +6 -4
- package/dist/components/Timeline/get-node-keyframes.d.ts +3 -3
- package/dist/components/Timeline/get-node-keyframes.js +4 -4
- package/dist/components/Timeline/get-timeline-easing-segments.d.ts +9 -0
- package/dist/components/Timeline/get-timeline-easing-segments.js +19 -0
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +7 -7
- package/dist/components/Timeline/reset-selected-timeline-props.js +10 -10
- package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
- package/dist/components/Timeline/save-effect-prop.js +5 -5
- package/dist/components/Timeline/save-prop-queue.d.ts +3 -3
- package/dist/components/Timeline/save-prop-queue.js +3 -3
- package/dist/components/Timeline/save-sequence-prop.d.ts +3 -3
- package/dist/components/Timeline/save-sequence-prop.js +4 -4
- package/dist/components/Timeline/timeline-field-utils.d.ts +10 -0
- package/dist/components/Timeline/timeline-field-utils.js +26 -5
- package/dist/components/Timeline/timeline-translate-utils.d.ts +1 -1
- package/dist/components/Timeline/timeline-translate-utils.js +4 -5
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +7 -7
- package/dist/components/Timeline/use-sequence-props-subscription.js +3 -3
- package/dist/components/Timeline/use-timeline-height.js +3 -3
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +13 -11
- package/dist/components/import-assets.d.ts +15 -0
- package/dist/components/import-assets.js +63 -1
- package/dist/esm/{chunk-q0jkt0zq.js → chunk-xjvc8qen.js} +1708 -1394
- package/dist/esm/internals.mjs +1708 -1394
- package/dist/esm/previewEntry.mjs +1711 -1397
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/timeline-layout.d.ts +6 -6
- package/dist/helpers/timeline-layout.js +5 -5
- package/dist/state/modals.d.ts +0 -3
- package/package.json +10 -10
- package/dist/components/NewComposition/DeleteStaticFile.d.ts +0 -4
- package/dist/components/NewComposition/DeleteStaticFile.js +0 -44
|
@@ -22,14 +22,14 @@ const baseStyle = {
|
|
|
22
22
|
zIndex: 1,
|
|
23
23
|
touchAction: 'none',
|
|
24
24
|
};
|
|
25
|
-
const canUpdateDurationInFrames = ({
|
|
25
|
+
const canUpdateDurationInFrames = ({ propStatuses, nodePath, }) => {
|
|
26
26
|
var _a, _b;
|
|
27
|
-
const status = (_b = (_a = remotion_1.Internals.
|
|
27
|
+
const status = (_b = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a.durationInFrames) === null || _b === void 0 ? void 0 : _b.status;
|
|
28
28
|
return status === 'static';
|
|
29
29
|
};
|
|
30
|
-
const canUpdateFrom = ({
|
|
30
|
+
const canUpdateFrom = ({ propStatuses, nodePath, }) => {
|
|
31
31
|
var _a, _b;
|
|
32
|
-
const status = (_b = (_a = remotion_1.Internals.
|
|
32
|
+
const status = (_b = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a.from) === null || _b === void 0 ? void 0 : _b.status;
|
|
33
33
|
return status === 'static';
|
|
34
34
|
};
|
|
35
35
|
const isDurationDraggableSequence = (sequence) => {
|
|
@@ -100,7 +100,7 @@ const findSequenceTrack = ({ tracks, nodePathInfo, }) => {
|
|
|
100
100
|
return ((0, studio_shared_1.stringifySequenceSubscriptionKey)(candidate.nodePathInfo.sequenceSubscriptionKey) === key && candidate.nodePathInfo.index === nodePathInfo.index);
|
|
101
101
|
});
|
|
102
102
|
};
|
|
103
|
-
const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths,
|
|
103
|
+
const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }) => {
|
|
104
104
|
const draggedSelectionKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(draggedNodePathInfo);
|
|
105
105
|
const selectedSequenceItems = selectedItems.filter((item) => item.type === 'sequence');
|
|
106
106
|
const draggedItemIsSelected = selectedSequenceItems.some((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo) ===
|
|
@@ -125,7 +125,7 @@ const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedI
|
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
127
127
|
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
128
|
-
if (!canUpdateDurationInFrames({
|
|
128
|
+
if (!canUpdateDurationInFrames({ propStatuses, nodePath })) {
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
const key = (0, studio_shared_1.stringifySequenceSubscriptionKey)(nodePath);
|
|
@@ -140,7 +140,7 @@ const getTimelineSequenceDurationDragTargets = ({ draggedNodePathInfo, selectedI
|
|
|
140
140
|
return [...targets.values()];
|
|
141
141
|
};
|
|
142
142
|
exports.getTimelineSequenceDurationDragTargets = getTimelineSequenceDurationDragTargets;
|
|
143
|
-
const getTimelineSequenceFromDragTargets = ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths,
|
|
143
|
+
const getTimelineSequenceFromDragTargets = ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }) => {
|
|
144
144
|
const draggedSelectionKey = (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(draggedNodePathInfo);
|
|
145
145
|
const selectedSequenceItems = selectedItems.filter((item) => item.type === 'sequence');
|
|
146
146
|
const draggedItemIsSelected = selectedSequenceItems.some((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo) ===
|
|
@@ -165,7 +165,7 @@ const getTimelineSequenceFromDragTargets = ({ draggedNodePathInfo, selectedItems
|
|
|
165
165
|
return null;
|
|
166
166
|
}
|
|
167
167
|
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
168
|
-
if (!canUpdateFrom({
|
|
168
|
+
if (!canUpdateFrom({ propStatuses, nodePath })) {
|
|
169
169
|
return null;
|
|
170
170
|
}
|
|
171
171
|
const key = (0, studio_shared_1.stringifySequenceSubscriptionKey)(nodePath);
|
|
@@ -191,35 +191,29 @@ const clearFromDragOverrides = ({ clearDragOverrides, targets, }) => {
|
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
193
|
const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurationInFrames, }) => {
|
|
194
|
-
const {
|
|
195
|
-
const
|
|
196
|
-
const
|
|
194
|
+
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
195
|
+
const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
|
|
196
|
+
const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
|
|
197
197
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
198
198
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
199
|
-
const
|
|
199
|
+
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
200
200
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
201
201
|
const dragStateRef = (0, react_1.useRef)(null);
|
|
202
202
|
const latestRef = (0, react_1.useRef)({
|
|
203
203
|
nodePathInfo,
|
|
204
|
-
|
|
204
|
+
setPropStatuses,
|
|
205
205
|
setDragOverrides,
|
|
206
206
|
clearDragOverrides,
|
|
207
207
|
previewServerState,
|
|
208
|
-
codeValues,
|
|
209
|
-
sequences,
|
|
210
208
|
overrideIdToNodePathMappings,
|
|
211
|
-
selectedItems,
|
|
212
209
|
});
|
|
213
210
|
latestRef.current = {
|
|
214
211
|
nodePathInfo,
|
|
215
|
-
|
|
212
|
+
setPropStatuses,
|
|
216
213
|
setDragOverrides,
|
|
217
214
|
clearDragOverrides,
|
|
218
215
|
previewServerState,
|
|
219
|
-
codeValues,
|
|
220
|
-
sequences,
|
|
221
216
|
overrideIdToNodePathMappings,
|
|
222
|
-
selectedItems,
|
|
223
217
|
};
|
|
224
218
|
const finishDrag = (0, react_1.useCallback)((commit) => {
|
|
225
219
|
const dragState = dragStateRef.current;
|
|
@@ -230,7 +224,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
230
224
|
if (!dragState) {
|
|
231
225
|
return;
|
|
232
226
|
}
|
|
233
|
-
const {
|
|
227
|
+
const { setPropStatuses: latestSetPropStatuses, clearDragOverrides: latestClear, previewServerState: latestServerState, } = latestRef.current;
|
|
234
228
|
const changes = (0, exports.getTimelineSequenceFromDragChanges)({
|
|
235
229
|
targets: dragState.targets,
|
|
236
230
|
deltaFrames: dragState.latestDeltaFrames,
|
|
@@ -246,7 +240,7 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
246
240
|
}
|
|
247
241
|
const savePromise = (0, save_sequence_prop_1.saveSequenceProps)({
|
|
248
242
|
changes,
|
|
249
|
-
|
|
243
|
+
setPropStatuses: latestSetPropStatuses,
|
|
250
244
|
clientId: latestServerState.clientId,
|
|
251
245
|
undoLabel: changes.length > 1 ? 'Move selected sequences' : 'Move sequence',
|
|
252
246
|
redoLabel: changes.length > 1
|
|
@@ -274,16 +268,17 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
274
268
|
if (pxPerFrame <= 0) {
|
|
275
269
|
return;
|
|
276
270
|
}
|
|
277
|
-
const { nodePathInfo: latestNodePathInfo,
|
|
271
|
+
const { nodePathInfo: latestNodePathInfo, overrideIdToNodePathMappings: latestOverrideIdsToNodePaths, } = latestRef.current;
|
|
272
|
+
const { selectedItems: latestSelectedItems } = currentSelection.current;
|
|
278
273
|
if (latestNodePathInfo === null) {
|
|
279
274
|
return;
|
|
280
275
|
}
|
|
281
276
|
const targets = (0, exports.getTimelineSequenceFromDragTargets)({
|
|
282
277
|
draggedNodePathInfo: latestNodePathInfo,
|
|
283
278
|
selectedItems: latestSelectedItems,
|
|
284
|
-
sequences:
|
|
279
|
+
sequences: sequencesRef.current,
|
|
285
280
|
overrideIdsToNodePaths: latestOverrideIdsToNodePaths,
|
|
286
|
-
|
|
281
|
+
propStatuses: propStatusesRef.current,
|
|
287
282
|
});
|
|
288
283
|
if (targets === null || targets.length === 0) {
|
|
289
284
|
return;
|
|
@@ -299,7 +294,13 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
299
294
|
document.body.style.userSelect = 'none';
|
|
300
295
|
document.body.style.webkitUserSelect = 'none';
|
|
301
296
|
setDragging(true);
|
|
302
|
-
}, [
|
|
297
|
+
}, [
|
|
298
|
+
currentSelection,
|
|
299
|
+
propStatusesRef,
|
|
300
|
+
sequencesRef,
|
|
301
|
+
timelineDurationInFrames,
|
|
302
|
+
windowWidth,
|
|
303
|
+
]);
|
|
303
304
|
(0, react_1.useEffect)(() => {
|
|
304
305
|
if (!dragging) {
|
|
305
306
|
return;
|
|
@@ -354,36 +355,30 @@ const useTimelineSequenceFromDrag = ({ nodePathInfo, windowWidth, timelineDurati
|
|
|
354
355
|
};
|
|
355
356
|
exports.useTimelineSequenceFromDrag = useTimelineSequenceFromDrag;
|
|
356
357
|
const TimelineSequenceRightEdgeDragHandle = ({ nodePathInfo, windowWidth, timelineDurationInFrames }) => {
|
|
357
|
-
const {
|
|
358
|
-
const
|
|
359
|
-
const
|
|
358
|
+
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
359
|
+
const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
|
|
360
|
+
const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
|
|
360
361
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
361
362
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
362
|
-
const
|
|
363
|
+
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
363
364
|
const [dragging, setDragging] = (0, react_1.useState)(false);
|
|
364
365
|
const dragStateRef = (0, react_1.useRef)(null);
|
|
365
366
|
// Keep latest props/setters available to window listeners installed once at pointerdown.
|
|
366
367
|
const latestRef = (0, react_1.useRef)({
|
|
367
368
|
nodePathInfo,
|
|
368
|
-
|
|
369
|
+
setPropStatuses,
|
|
369
370
|
setDragOverrides,
|
|
370
371
|
clearDragOverrides,
|
|
371
372
|
previewServerState,
|
|
372
|
-
codeValues,
|
|
373
|
-
sequences,
|
|
374
373
|
overrideIdToNodePathMappings,
|
|
375
|
-
selectedItems,
|
|
376
374
|
});
|
|
377
375
|
latestRef.current = {
|
|
378
376
|
nodePathInfo,
|
|
379
|
-
|
|
377
|
+
setPropStatuses,
|
|
380
378
|
setDragOverrides,
|
|
381
379
|
clearDragOverrides,
|
|
382
380
|
previewServerState,
|
|
383
|
-
codeValues,
|
|
384
|
-
sequences,
|
|
385
381
|
overrideIdToNodePathMappings,
|
|
386
|
-
selectedItems,
|
|
387
382
|
};
|
|
388
383
|
const finishDrag = (0, react_1.useCallback)((commit) => {
|
|
389
384
|
const dragState = dragStateRef.current;
|
|
@@ -395,7 +390,7 @@ const TimelineSequenceRightEdgeDragHandle = ({ nodePathInfo, windowWidth, timeli
|
|
|
395
390
|
if (!dragState) {
|
|
396
391
|
return;
|
|
397
392
|
}
|
|
398
|
-
const {
|
|
393
|
+
const { setPropStatuses: latestSetPropStatuses, clearDragOverrides: latestClear, previewServerState: latestServerState, } = latestRef.current;
|
|
399
394
|
const changes = (0, exports.getTimelineSequenceDurationDragChanges)({
|
|
400
395
|
targets: dragState.targets,
|
|
401
396
|
deltaFrames: dragState.latestDeltaFrames,
|
|
@@ -411,7 +406,7 @@ const TimelineSequenceRightEdgeDragHandle = ({ nodePathInfo, windowWidth, timeli
|
|
|
411
406
|
}
|
|
412
407
|
const savePromise = (0, save_sequence_prop_1.saveSequenceProps)({
|
|
413
408
|
changes,
|
|
414
|
-
|
|
409
|
+
setPropStatuses: latestSetPropStatuses,
|
|
415
410
|
clientId: latestServerState.clientId,
|
|
416
411
|
undoLabel: changes.length > 1 ? 'Resize selected sequences' : 'Resize sequence',
|
|
417
412
|
redoLabel: changes.length > 1
|
|
@@ -439,13 +434,14 @@ const TimelineSequenceRightEdgeDragHandle = ({ nodePathInfo, windowWidth, timeli
|
|
|
439
434
|
if (pxPerFrame <= 0) {
|
|
440
435
|
return;
|
|
441
436
|
}
|
|
442
|
-
const { nodePathInfo: latestNodePathInfo,
|
|
437
|
+
const { nodePathInfo: latestNodePathInfo, overrideIdToNodePathMappings: latestOverrideIdsToNodePaths, } = latestRef.current;
|
|
438
|
+
const { selectedItems: latestSelectedItems } = currentSelection.current;
|
|
443
439
|
const targets = (0, exports.getTimelineSequenceDurationDragTargets)({
|
|
444
440
|
draggedNodePathInfo: latestNodePathInfo,
|
|
445
441
|
selectedItems: latestSelectedItems,
|
|
446
|
-
sequences:
|
|
442
|
+
sequences: sequencesRef.current,
|
|
447
443
|
overrideIdsToNodePaths: latestOverrideIdsToNodePaths,
|
|
448
|
-
|
|
444
|
+
propStatuses: propStatusesRef.current,
|
|
449
445
|
});
|
|
450
446
|
if (targets === null || targets.length === 0) {
|
|
451
447
|
return;
|
|
@@ -463,7 +459,13 @@ const TimelineSequenceRightEdgeDragHandle = ({ nodePathInfo, windowWidth, timeli
|
|
|
463
459
|
document.body.style.webkitUserSelect = 'none';
|
|
464
460
|
(0, ForceSpecificCursor_1.forceSpecificCursor)('ew-resize');
|
|
465
461
|
setDragging(true);
|
|
466
|
-
}, [
|
|
462
|
+
}, [
|
|
463
|
+
currentSelection,
|
|
464
|
+
propStatusesRef,
|
|
465
|
+
sequencesRef,
|
|
466
|
+
timelineDurationInFrames,
|
|
467
|
+
windowWidth,
|
|
468
|
+
]);
|
|
467
469
|
// Install global pointer listeners while dragging. They survive parent re-renders
|
|
468
470
|
// and element remounts that would otherwise drop React's synthetic handlers or
|
|
469
471
|
// pointer capture.
|
|
@@ -17,27 +17,32 @@ const containerStyle = {
|
|
|
17
17
|
gap: 4,
|
|
18
18
|
};
|
|
19
19
|
const TimelineTranslateField = ({ field, propStatus, effectiveValue, onSave, onDragValueChange, onDragEnd, }) => {
|
|
20
|
-
var _a;
|
|
21
20
|
const [dragX, setDragX] = (0, react_1.useState)(null);
|
|
22
21
|
const [dragY, setDragY] = (0, react_1.useState)(null);
|
|
23
22
|
const [codeX, codeY] = (0, react_1.useMemo)(() => (0, timeline_translate_utils_1.parseTranslate)(String(effectiveValue !== null && effectiveValue !== void 0 ? effectiveValue : '0px 0px')), [effectiveValue]);
|
|
24
|
-
const
|
|
25
|
-
const
|
|
23
|
+
const configuredStep = field.fieldSchema.type === 'translate' ? field.fieldSchema.step : undefined;
|
|
24
|
+
const step = configuredStep !== null && configuredStep !== void 0 ? configuredStep : 1;
|
|
25
|
+
const decimalPlaces = (0, react_1.useMemo)(() => (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
|
|
26
|
+
defaultDecimalPlaces: 1,
|
|
27
|
+
step: configuredStep,
|
|
28
|
+
}), [configuredStep]);
|
|
26
29
|
const formatter = (0, react_1.useCallback)((v) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
const formatted = (0, timeline_field_utils_1.formatTimelineNumber)({
|
|
31
|
+
decimalPlaces,
|
|
32
|
+
fixed: false,
|
|
33
|
+
value: v,
|
|
34
|
+
});
|
|
30
35
|
return `${formatted}px`;
|
|
31
|
-
}, [
|
|
36
|
+
}, [decimalPlaces]);
|
|
32
37
|
// --- X callbacks ---
|
|
33
38
|
const onXChange = (0, react_1.useCallback)((newVal) => {
|
|
34
39
|
setDragX(newVal);
|
|
35
40
|
const currentY = dragY !== null && dragY !== void 0 ? dragY : codeY;
|
|
36
|
-
onDragValueChange((0, timeline_translate_utils_1.serializeTranslate)(newVal, currentY));
|
|
37
|
-
}, [onDragValueChange, dragY, codeY]);
|
|
41
|
+
onDragValueChange((0, timeline_translate_utils_1.serializeTranslate)(newVal, currentY, decimalPlaces));
|
|
42
|
+
}, [onDragValueChange, dragY, codeY, decimalPlaces]);
|
|
38
43
|
const onXChangeEnd = (0, react_1.useCallback)((newVal) => {
|
|
39
44
|
const currentY = dragY !== null && dragY !== void 0 ? dragY : codeY;
|
|
40
|
-
const newStr = (0, timeline_translate_utils_1.serializeTranslate)(newVal, currentY);
|
|
45
|
+
const newStr = (0, timeline_translate_utils_1.serializeTranslate)(newVal, currentY, decimalPlaces);
|
|
41
46
|
if (newStr !== propStatus.codeValue) {
|
|
42
47
|
onSave(newStr).finally(() => {
|
|
43
48
|
setDragX(null);
|
|
@@ -48,12 +53,12 @@ const TimelineTranslateField = ({ field, propStatus, effectiveValue, onSave, onD
|
|
|
48
53
|
setDragX(null);
|
|
49
54
|
onDragEnd();
|
|
50
55
|
}
|
|
51
|
-
}, [dragY, codeY, propStatus, onSave, onDragEnd]);
|
|
56
|
+
}, [dragY, codeY, decimalPlaces, propStatus, onSave, onDragEnd]);
|
|
52
57
|
const onXTextChange = (0, react_1.useCallback)((newVal) => {
|
|
53
58
|
const parsed = Number(newVal);
|
|
54
59
|
if (!Number.isNaN(parsed)) {
|
|
55
60
|
const currentY = dragY !== null && dragY !== void 0 ? dragY : codeY;
|
|
56
|
-
const newStr = (0, timeline_translate_utils_1.serializeTranslate)(parsed, currentY);
|
|
61
|
+
const newStr = (0, timeline_translate_utils_1.serializeTranslate)(parsed, currentY, decimalPlaces);
|
|
57
62
|
if (newStr !== propStatus.codeValue) {
|
|
58
63
|
setDragX(parsed);
|
|
59
64
|
onSave(newStr).finally(() => {
|
|
@@ -61,16 +66,16 @@ const TimelineTranslateField = ({ field, propStatus, effectiveValue, onSave, onD
|
|
|
61
66
|
});
|
|
62
67
|
}
|
|
63
68
|
}
|
|
64
|
-
}, [propStatus, dragY, codeY, onSave]);
|
|
69
|
+
}, [propStatus, dragY, codeY, decimalPlaces, onSave]);
|
|
65
70
|
// --- Y callbacks ---
|
|
66
71
|
const onYChange = (0, react_1.useCallback)((newVal) => {
|
|
67
72
|
setDragY(newVal);
|
|
68
73
|
const currentX = dragX !== null && dragX !== void 0 ? dragX : codeX;
|
|
69
|
-
onDragValueChange((0, timeline_translate_utils_1.serializeTranslate)(currentX, newVal));
|
|
70
|
-
}, [onDragValueChange, dragX, codeX]);
|
|
74
|
+
onDragValueChange((0, timeline_translate_utils_1.serializeTranslate)(currentX, newVal, decimalPlaces));
|
|
75
|
+
}, [onDragValueChange, dragX, codeX, decimalPlaces]);
|
|
71
76
|
const onYChangeEnd = (0, react_1.useCallback)((newVal) => {
|
|
72
77
|
const currentX = dragX !== null && dragX !== void 0 ? dragX : codeX;
|
|
73
|
-
const newStr = (0, timeline_translate_utils_1.serializeTranslate)(currentX, newVal);
|
|
78
|
+
const newStr = (0, timeline_translate_utils_1.serializeTranslate)(currentX, newVal, decimalPlaces);
|
|
74
79
|
if (newStr !== propStatus.codeValue) {
|
|
75
80
|
onSave(newStr).finally(() => {
|
|
76
81
|
setDragY(null);
|
|
@@ -81,12 +86,12 @@ const TimelineTranslateField = ({ field, propStatus, effectiveValue, onSave, onD
|
|
|
81
86
|
setDragY(null);
|
|
82
87
|
onDragEnd();
|
|
83
88
|
}
|
|
84
|
-
}, [dragX, codeX, propStatus, onSave, onDragEnd]);
|
|
89
|
+
}, [dragX, codeX, decimalPlaces, propStatus, onSave, onDragEnd]);
|
|
85
90
|
const onYTextChange = (0, react_1.useCallback)((newVal) => {
|
|
86
91
|
const parsed = Number(newVal);
|
|
87
92
|
if (!Number.isNaN(parsed)) {
|
|
88
93
|
const currentX = dragX !== null && dragX !== void 0 ? dragX : codeX;
|
|
89
|
-
const newStr = (0, timeline_translate_utils_1.serializeTranslate)(currentX, parsed);
|
|
94
|
+
const newStr = (0, timeline_translate_utils_1.serializeTranslate)(currentX, parsed, decimalPlaces);
|
|
90
95
|
if (newStr !== propStatus.codeValue) {
|
|
91
96
|
setDragY(parsed);
|
|
92
97
|
onSave(newStr).finally(() => {
|
|
@@ -94,7 +99,7 @@ const TimelineTranslateField = ({ field, propStatus, effectiveValue, onSave, onD
|
|
|
94
99
|
});
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
|
-
}, [propStatus, onSave, dragX, codeX]);
|
|
102
|
+
}, [propStatus, onSave, dragX, codeX, decimalPlaces]);
|
|
98
103
|
return (jsx_runtime_1.jsxs("span", { style: containerStyle, children: [
|
|
99
104
|
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: dragX !== null && dragX !== void 0 ? dragX : codeX, style: leftDraggerStyle, status: "ok", small: true, onValueChange: onXChange, onValueChangeEnd: onXChangeEnd, onTextChange: onXTextChange, min: -Infinity, max: Infinity, step: step, formatter: formatter, rightAlign: false }), jsx_runtime_1.jsx("div", { style: { marginLeft: -6, marginRight: -6 } }), jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: dragY !== null && dragY !== void 0 ? dragY : codeY, style: rightDraggerStyle, status: "ok", small: true, onValueChange: onYChange, onValueChangeEnd: onYChangeEnd, onTextChange: onYTextChange, min: -Infinity, max: Infinity, step: step, formatter: formatter, rightAlign: false })
|
|
100
105
|
] }));
|
|
@@ -30,25 +30,31 @@ const tuplesEqual = (left, right) => {
|
|
|
30
30
|
return left[0] === right[0] && left[1] === right[1];
|
|
31
31
|
};
|
|
32
32
|
const TimelineUvCoordinateField = ({ field, propStatus, effectiveValue, onSave, onDragValueChange, onDragEnd, }) => {
|
|
33
|
-
var _a, _b
|
|
33
|
+
var _a, _b;
|
|
34
34
|
const [dragX, setDragX] = (0, react_1.useState)(null);
|
|
35
35
|
const [dragY, setDragY] = (0, react_1.useState)(null);
|
|
36
36
|
const [codeX, codeY] = (0, react_1.useMemo)(() => parseUvCoordinate(effectiveValue), [effectiveValue]);
|
|
37
|
-
const
|
|
38
|
-
?
|
|
39
|
-
:
|
|
37
|
+
const configuredStep = field.fieldSchema.type === 'uv-coordinate'
|
|
38
|
+
? field.fieldSchema.step
|
|
39
|
+
: undefined;
|
|
40
|
+
const step = configuredStep !== null && configuredStep !== void 0 ? configuredStep : 0.01;
|
|
40
41
|
const min = field.fieldSchema.type === 'uv-coordinate'
|
|
41
|
-
? ((
|
|
42
|
+
? ((_a = field.fieldSchema.min) !== null && _a !== void 0 ? _a : -Infinity)
|
|
42
43
|
: -Infinity;
|
|
43
44
|
const max = field.fieldSchema.type === 'uv-coordinate'
|
|
44
|
-
? ((
|
|
45
|
+
? ((_b = field.fieldSchema.max) !== null && _b !== void 0 ? _b : Infinity)
|
|
45
46
|
: Infinity;
|
|
46
|
-
const
|
|
47
|
+
const decimalPlaces = (0, react_1.useMemo)(() => (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
|
|
48
|
+
defaultDecimalPlaces: 2,
|
|
49
|
+
step: configuredStep,
|
|
50
|
+
}), [configuredStep]);
|
|
47
51
|
const formatter = (0, react_1.useCallback)((v) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
return (0, timeline_field_utils_1.formatTimelineNumber)({
|
|
53
|
+
decimalPlaces,
|
|
54
|
+
fixed: true,
|
|
55
|
+
value: v,
|
|
56
|
+
});
|
|
57
|
+
}, [decimalPlaces]);
|
|
52
58
|
const onXChange = (0, react_1.useCallback)((newVal) => {
|
|
53
59
|
setDragX(newVal);
|
|
54
60
|
const currentY = dragY !== null && dragY !== void 0 ? dragY : codeY;
|
|
@@ -114,7 +120,7 @@ const TimelineUvCoordinateField = ({ field, propStatus, effectiveValue, onSave,
|
|
|
114
120
|
}
|
|
115
121
|
}, [propStatus, onSave, dragX, codeX]);
|
|
116
122
|
return (jsx_runtime_1.jsxs("span", { style: containerStyle, children: [
|
|
117
|
-
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: dragX !== null && dragX !== void 0 ? dragX : codeX, style: leftDraggerStyle, status: "ok", small: true, onValueChange: onXChange, onValueChangeEnd: onXChangeEnd, onTextChange: onXTextChange, min: min, max: max, step: step, formatter: formatter, rightAlign: false }), jsx_runtime_1.jsx("div", { style: { marginLeft: -6, marginRight: -6 } }), jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: dragY !== null && dragY !== void 0 ? dragY : codeY, style: rightDraggerStyle, status: "ok", small: true, onValueChange: onYChange, onValueChangeEnd: onYChangeEnd, onTextChange: onYTextChange, min: min, max: max, step: step, formatter: formatter, rightAlign: false })
|
|
123
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: dragX !== null && dragX !== void 0 ? dragX : codeX, style: leftDraggerStyle, status: "ok", small: true, onValueChange: onXChange, onValueChangeEnd: onXChangeEnd, onTextChange: onXTextChange, min: min, max: max, step: step, formatter: formatter, rightAlign: false, snapToStep: false }), jsx_runtime_1.jsx("div", { style: { marginLeft: -6, marginRight: -6 } }), jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: dragY !== null && dragY !== void 0 ? dragY : codeY, style: rightDraggerStyle, status: "ok", small: true, onValueChange: onYChange, onValueChangeEnd: onYChangeEnd, onTextChange: onYTextChange, min: min, max: max, step: step, formatter: formatter, rightAlign: false, snapToStep: false })
|
|
118
124
|
] }));
|
|
119
125
|
};
|
|
120
126
|
exports.TimelineUvCoordinateField = TimelineUvCoordinateField;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CanUpdateEffectPropsResponse, CanUpdateSequencePropsResponse } from 'remotion';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const applyEffectResponseToPropStatuses: ({ previous, response, }: {
|
|
3
3
|
previous: CanUpdateSequencePropsResponse;
|
|
4
4
|
response: CanUpdateEffectPropsResponse;
|
|
5
5
|
}) => CanUpdateSequencePropsResponse;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.applyEffectResponseToPropStatuses = void 0;
|
|
4
|
+
const applyEffectResponseToPropStatuses = ({ previous, response, }) => {
|
|
5
5
|
if (!previous.canUpdate) {
|
|
6
6
|
return previous;
|
|
7
7
|
}
|
|
@@ -16,4 +16,4 @@ const applyEffectResponseToCodeValues = ({ previous, response, }) => {
|
|
|
16
16
|
effects,
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
exports.
|
|
19
|
+
exports.applyEffectResponseToPropStatuses = applyEffectResponseToPropStatuses;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const callAddSequenceKeyframe: ({ fileName, nodePath, fieldKey, sourceFrame, value, schema,
|
|
2
|
+
import type { SetPropStatuses } from './save-sequence-prop';
|
|
3
|
+
export declare const callAddSequenceKeyframe: ({ fileName, nodePath, fieldKey, sourceFrame, value, schema, setPropStatuses, clientId, }: {
|
|
4
4
|
fileName: string;
|
|
5
5
|
nodePath: SequencePropsSubscriptionKey;
|
|
6
6
|
fieldKey: string;
|
|
7
7
|
sourceFrame: number;
|
|
8
8
|
value: unknown;
|
|
9
9
|
schema: SequenceSchema;
|
|
10
|
-
|
|
10
|
+
setPropStatuses: SetPropStatuses;
|
|
11
11
|
clientId: string;
|
|
12
12
|
}) => Promise<void>;
|
|
13
|
-
export declare const callAddEffectKeyframe: ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, value, schema,
|
|
13
|
+
export declare const callAddEffectKeyframe: ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, value, schema, setPropStatuses, clientId, }: {
|
|
14
14
|
fileName: string;
|
|
15
15
|
nodePath: SequencePropsSubscriptionKey;
|
|
16
16
|
effectIndex: number;
|
|
@@ -18,6 +18,6 @@ export declare const callAddEffectKeyframe: ({ fileName, nodePath, effectIndex,
|
|
|
18
18
|
sourceFrame: number;
|
|
19
19
|
value: unknown;
|
|
20
20
|
schema: SequenceSchema;
|
|
21
|
-
|
|
21
|
+
setPropStatuses: SetPropStatuses;
|
|
22
22
|
clientId: string;
|
|
23
23
|
}) => Promise<void>;
|
|
@@ -3,12 +3,12 @@ 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
|
|
6
|
+
const apply_effect_response_to_prop_statuses_1 = require("./apply-effect-response-to-prop-statuses");
|
|
7
7
|
const save_prop_queue_1 = require("./save-prop-queue");
|
|
8
|
-
const callAddSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame, value, schema,
|
|
8
|
+
const callAddSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame, value, schema, setPropStatuses, clientId, }) => {
|
|
9
9
|
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
10
10
|
nodePath,
|
|
11
|
-
|
|
11
|
+
setPropStatuses,
|
|
12
12
|
applyOptimistic: (prev) => (0, studio_shared_1.optimisticAddSequenceKeyframe)({
|
|
13
13
|
previous: prev,
|
|
14
14
|
fieldKey,
|
|
@@ -29,10 +29,10 @@ const callAddSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame, va
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
exports.callAddSequenceKeyframe = callAddSequenceKeyframe;
|
|
32
|
-
const callAddEffectKeyframe = ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, value, schema,
|
|
32
|
+
const callAddEffectKeyframe = ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, value, schema, setPropStatuses, clientId, }) => {
|
|
33
33
|
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
34
34
|
nodePath,
|
|
35
|
-
|
|
35
|
+
setPropStatuses,
|
|
36
36
|
applyOptimistic: (prev) => (0, studio_shared_1.optimisticAddEffectKeyframe)({
|
|
37
37
|
previous: prev,
|
|
38
38
|
effectIndex,
|
|
@@ -41,7 +41,7 @@ const callAddEffectKeyframe = ({ fileName, nodePath, effectIndex, fieldKey, sour
|
|
|
41
41
|
value,
|
|
42
42
|
schema,
|
|
43
43
|
}),
|
|
44
|
-
applyServerResponse: (prev, response) => (0,
|
|
44
|
+
applyServerResponse: (prev, response) => (0, apply_effect_response_to_prop_statuses_1.applyEffectResponseToPropStatuses)({ previous: prev, response }),
|
|
45
45
|
apiCall: () => (0, call_api_1.callApi)('/api/add-effect-keyframe', {
|
|
46
46
|
fileName,
|
|
47
47
|
sequenceNodePath: nodePath,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SetPropStatuses } from './save-sequence-prop';
|
|
3
3
|
export type DeleteSequenceKeyframeChange = {
|
|
4
4
|
fileName: string;
|
|
5
5
|
nodePath: SequencePropsSubscriptionKey;
|
|
@@ -10,28 +10,28 @@ export type DeleteSequenceKeyframeChange = {
|
|
|
10
10
|
export type DeleteEffectKeyframeChange = DeleteSequenceKeyframeChange & {
|
|
11
11
|
effectIndex: number;
|
|
12
12
|
};
|
|
13
|
-
export declare const callDeleteSequenceKeyframe: ({ fileName, nodePath, fieldKey, sourceFrame, schema,
|
|
13
|
+
export declare const callDeleteSequenceKeyframe: ({ fileName, nodePath, fieldKey, sourceFrame, schema, setPropStatuses, clientId, }: {
|
|
14
14
|
fileName: string;
|
|
15
15
|
nodePath: SequencePropsSubscriptionKey;
|
|
16
16
|
fieldKey: string;
|
|
17
17
|
sourceFrame: number;
|
|
18
18
|
schema: SequenceSchema;
|
|
19
|
-
|
|
19
|
+
setPropStatuses: SetPropStatuses;
|
|
20
20
|
clientId: string;
|
|
21
21
|
}) => Promise<void>;
|
|
22
|
-
export declare const callDeleteEffectKeyframe: ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, schema,
|
|
22
|
+
export declare const callDeleteEffectKeyframe: ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, schema, setPropStatuses, clientId, }: {
|
|
23
23
|
fileName: string;
|
|
24
24
|
nodePath: SequencePropsSubscriptionKey;
|
|
25
25
|
effectIndex: number;
|
|
26
26
|
fieldKey: string;
|
|
27
27
|
sourceFrame: number;
|
|
28
28
|
schema: SequenceSchema;
|
|
29
|
-
|
|
29
|
+
setPropStatuses: SetPropStatuses;
|
|
30
30
|
clientId: string;
|
|
31
31
|
}) => Promise<void>;
|
|
32
|
-
export declare const callDeleteKeyframes: ({ sequenceKeyframes, effectKeyframes,
|
|
32
|
+
export declare const callDeleteKeyframes: ({ sequenceKeyframes, effectKeyframes, setPropStatuses, clientId, }: {
|
|
33
33
|
sequenceKeyframes: DeleteSequenceKeyframeChange[];
|
|
34
34
|
effectKeyframes: DeleteEffectKeyframeChange[];
|
|
35
|
-
|
|
35
|
+
setPropStatuses: SetPropStatuses;
|
|
36
36
|
clientId: string;
|
|
37
37
|
}) => Promise<void>;
|
|
@@ -15,10 +15,10 @@ const groupByNodePath = (keyframes) => {
|
|
|
15
15
|
}
|
|
16
16
|
return [...groups.values()];
|
|
17
17
|
};
|
|
18
|
-
const callDeleteSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame, schema,
|
|
18
|
+
const callDeleteSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame, schema, setPropStatuses, clientId, }) => {
|
|
19
19
|
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
20
20
|
nodePath,
|
|
21
|
-
|
|
21
|
+
setPropStatuses,
|
|
22
22
|
applyOptimistic: (prev) => (0, studio_shared_1.optimisticDeleteSequenceKeyframe)({
|
|
23
23
|
previous: prev,
|
|
24
24
|
fieldKey,
|
|
@@ -41,10 +41,10 @@ const callDeleteSequenceKeyframe = ({ fileName, nodePath, fieldKey, sourceFrame,
|
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
exports.callDeleteSequenceKeyframe = callDeleteSequenceKeyframe;
|
|
44
|
-
const callDeleteEffectKeyframe = ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, schema,
|
|
44
|
+
const callDeleteEffectKeyframe = ({ fileName, nodePath, effectIndex, fieldKey, sourceFrame, schema, setPropStatuses, clientId, }) => {
|
|
45
45
|
return (0, save_prop_queue_1.enqueueSavePropChange)({
|
|
46
46
|
nodePath,
|
|
47
|
-
|
|
47
|
+
setPropStatuses,
|
|
48
48
|
applyOptimistic: (prev) => (0, studio_shared_1.optimisticDeleteEffectKeyframe)({
|
|
49
49
|
previous: prev,
|
|
50
50
|
effectIndex,
|
|
@@ -69,7 +69,7 @@ const callDeleteEffectKeyframe = ({ fileName, nodePath, effectIndex, fieldKey, s
|
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
71
|
exports.callDeleteEffectKeyframe = callDeleteEffectKeyframe;
|
|
72
|
-
const callDeleteKeyframes = ({ sequenceKeyframes, effectKeyframes,
|
|
72
|
+
const callDeleteKeyframes = ({ sequenceKeyframes, effectKeyframes, setPropStatuses, clientId, }) => {
|
|
73
73
|
if (sequenceKeyframes.length === 0 && effectKeyframes.length === 0) {
|
|
74
74
|
return Promise.resolve();
|
|
75
75
|
}
|
|
@@ -78,7 +78,7 @@ const callDeleteKeyframes = ({ sequenceKeyframes, effectKeyframes, setCodeValues
|
|
|
78
78
|
if (!firstKeyframe) {
|
|
79
79
|
continue;
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
setPropStatuses(firstKeyframe.nodePath, (prev) => (0, studio_shared_1.optimisticDeleteSequenceKeyframes)({
|
|
82
82
|
previous: prev,
|
|
83
83
|
keyframes: keyframes.map((keyframe) => ({
|
|
84
84
|
fieldKey: keyframe.fieldKey,
|
|
@@ -91,7 +91,7 @@ const callDeleteKeyframes = ({ sequenceKeyframes, effectKeyframes, setCodeValues
|
|
|
91
91
|
if (!firstKeyframe) {
|
|
92
92
|
continue;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
setPropStatuses(firstKeyframe.nodePath, (prev) => (0, studio_shared_1.optimisticDeleteEffectKeyframes)({
|
|
95
95
|
previous: prev,
|
|
96
96
|
keyframes: keyframes.map((keyframe) => ({
|
|
97
97
|
effectIndex: keyframe.effectIndex,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SetPropStatuses } from './save-sequence-prop';
|
|
3
3
|
export type MoveSequenceKeyframeChange = {
|
|
4
4
|
fileName: string;
|
|
5
5
|
nodePath: SequencePropsSubscriptionKey;
|
|
@@ -11,9 +11,9 @@ export type MoveSequenceKeyframeChange = {
|
|
|
11
11
|
export type MoveEffectKeyframeChange = MoveSequenceKeyframeChange & {
|
|
12
12
|
effectIndex: number;
|
|
13
13
|
};
|
|
14
|
-
export declare const callMoveKeyframes: ({ sequenceKeyframes, effectKeyframes,
|
|
14
|
+
export declare const callMoveKeyframes: ({ sequenceKeyframes, effectKeyframes, setPropStatuses, clientId, }: {
|
|
15
15
|
sequenceKeyframes: MoveSequenceKeyframeChange[];
|
|
16
16
|
effectKeyframes: MoveEffectKeyframeChange[];
|
|
17
|
-
|
|
17
|
+
setPropStatuses: SetPropStatuses;
|
|
18
18
|
clientId: string;
|
|
19
19
|
}) => Promise<void>;
|
|
@@ -14,7 +14,7 @@ const groupByNodePath = (keyframes) => {
|
|
|
14
14
|
}
|
|
15
15
|
return [...groups.values()];
|
|
16
16
|
};
|
|
17
|
-
const callMoveKeyframes = ({ sequenceKeyframes, effectKeyframes,
|
|
17
|
+
const callMoveKeyframes = ({ sequenceKeyframes, effectKeyframes, setPropStatuses, clientId, }) => {
|
|
18
18
|
if (sequenceKeyframes.length === 0 && effectKeyframes.length === 0) {
|
|
19
19
|
return Promise.resolve();
|
|
20
20
|
}
|
|
@@ -23,7 +23,7 @@ const callMoveKeyframes = ({ sequenceKeyframes, effectKeyframes, setCodeValues,
|
|
|
23
23
|
if (!firstKeyframe) {
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
setPropStatuses(firstKeyframe.nodePath, (prev) => (0, studio_shared_1.optimisticMoveSequenceKeyframes)({
|
|
27
27
|
previous: prev,
|
|
28
28
|
keyframes: keyframes.map((keyframe) => ({
|
|
29
29
|
fieldKey: keyframe.fieldKey,
|
|
@@ -37,7 +37,7 @@ const callMoveKeyframes = ({ sequenceKeyframes, effectKeyframes, setCodeValues,
|
|
|
37
37
|
if (!firstKeyframe) {
|
|
38
38
|
continue;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
setPropStatuses(firstKeyframe.nodePath, (prev) => (0, studio_shared_1.optimisticMoveEffectKeyframes)({
|
|
41
41
|
previous: prev,
|
|
42
42
|
keyframes: keyframes.map((keyframe) => ({
|
|
43
43
|
effectIndex: keyframe.effectIndex,
|