@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
|
@@ -33,7 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.SelectedOutlineOverlay = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineDragValues = exports.getSequencesWithSelectableOutlines = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getUvCoordinateForPoint = exports.getUvHandleConnectionLines = exports.getUvHandlePosition = void 0;
|
|
36
|
+
exports.SelectedOutlineOverlay = exports.getSelectedOutlineScaleDragChanges = exports.getSelectedOutlineScaleDragValues = exports.getSelectedOutlineScaleDragStates = exports.getSelectedOutlineScaleEdgeInfo = exports.getSelectedOutlineDragChanges = exports.getSelectedOutlineDragValues = exports.getSequencesWithSelectableOutlines = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSelectedSequenceKeys = exports.getUvCoordinateForPoint = exports.getUvHandleConnectionLines = exports.getUvHandlePosition = void 0;
|
|
37
|
+
exports.constrainUv = constrainUv;
|
|
37
38
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
39
|
const react_1 = __importStar(require("react"));
|
|
39
40
|
const remotion_1 = require("remotion");
|
|
@@ -51,7 +52,6 @@ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
|
51
52
|
const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
52
53
|
const save_effect_prop_1 = require("./Timeline/save-effect-prop");
|
|
53
54
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
54
|
-
const timeline_field_utils_1 = require("./Timeline/timeline-field-utils");
|
|
55
55
|
const timeline_translate_utils_1 = require("./Timeline/timeline-translate-utils");
|
|
56
56
|
const TimelineScaleField_1 = require("./Timeline/TimelineScaleField");
|
|
57
57
|
const TimelineSelection_1 = require("./Timeline/TimelineSelection");
|
|
@@ -242,22 +242,12 @@ exports.getUvCoordinateForPoint = getUvCoordinateForPoint;
|
|
|
242
242
|
const clamp = (value, min, max) => {
|
|
243
243
|
return Math.min(max, Math.max(min, value));
|
|
244
244
|
};
|
|
245
|
-
|
|
246
|
-
if (step === undefined || !Number.isFinite(step) || step <= 0) {
|
|
247
|
-
return value;
|
|
248
|
-
}
|
|
249
|
-
const decimals = (0, timeline_field_utils_1.getDecimalPlaces)(step);
|
|
250
|
-
return Number((Math.round(value / step) * step).toFixed(decimals));
|
|
251
|
-
};
|
|
252
|
-
const constrainUv = (value, schema) => {
|
|
245
|
+
function constrainUv(value, schema) {
|
|
253
246
|
var _a, _b;
|
|
254
247
|
const min = (_a = schema.min) !== null && _a !== void 0 ? _a : -Infinity;
|
|
255
248
|
const max = (_b = schema.max) !== null && _b !== void 0 ? _b : Infinity;
|
|
256
|
-
return [
|
|
257
|
-
|
|
258
|
-
clamp(roundToStep(value[1], schema.step), min, max),
|
|
259
|
-
];
|
|
260
|
-
};
|
|
249
|
+
return [clamp(value[0], min, max), clamp(value[1], min, max)];
|
|
250
|
+
}
|
|
261
251
|
const rectToPoints = (elementRect, containerRect) => {
|
|
262
252
|
const left = elementRect.left - containerRect.left;
|
|
263
253
|
const top = elementRect.top - containerRect.top;
|
|
@@ -300,6 +290,12 @@ const getElementOutlinePoints = (element, containerRect) => {
|
|
|
300
290
|
return quadToPoints(quad, containerRect);
|
|
301
291
|
};
|
|
302
292
|
const getSelectedSequenceKeys = (selectedItems) => {
|
|
293
|
+
return new Set(selectedItems
|
|
294
|
+
.filter((item) => item.type === 'sequence')
|
|
295
|
+
.map((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo)));
|
|
296
|
+
};
|
|
297
|
+
exports.getSelectedSequenceKeys = getSelectedSequenceKeys;
|
|
298
|
+
const getSequenceKeysContainingSelection = (selectedItems) => {
|
|
303
299
|
return new Set(selectedItems.map((item) => (0, TimelineSelection_1.getTimelineSequenceSelectionKey)(item.nodePathInfo)));
|
|
304
300
|
};
|
|
305
301
|
const getOutlineSelectionInteraction = ({ shiftKey, metaKey, ctrlKey, }) => ({
|
|
@@ -321,7 +317,12 @@ const getSelectedEffectFieldsBySequenceKey = (selectedItems) => {
|
|
|
321
317
|
allFields: false,
|
|
322
318
|
fieldKeys: new Set(),
|
|
323
319
|
};
|
|
324
|
-
|
|
320
|
+
if (item.type === 'sequence-effect') {
|
|
321
|
+
selectedFields.allFields = true;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
selectedFields.fieldKeys.add(item.key);
|
|
325
|
+
}
|
|
325
326
|
effectsForSequence.set(item.i, selectedFields);
|
|
326
327
|
selectedEffects.set(sequenceKey, effectsForSequence);
|
|
327
328
|
}
|
|
@@ -355,7 +356,7 @@ const getSequencesWithSelectableOutlines = ({ sequences, overrideIdsToNodePaths,
|
|
|
355
356
|
});
|
|
356
357
|
};
|
|
357
358
|
exports.getSequencesWithSelectableOutlines = getSequencesWithSelectableOutlines;
|
|
358
|
-
const getSelectedUvHandles = ({
|
|
359
|
+
const getSelectedUvHandles = ({ propStatuses, clientId, getEffectDragOverrides, nodePath, selectedEffects, sequence, }) => {
|
|
359
360
|
if (clientId === null || selectedEffects === undefined) {
|
|
360
361
|
return [];
|
|
361
362
|
}
|
|
@@ -365,8 +366,8 @@ const getSelectedUvHandles = ({ codeValues, clientId, getEffectDragOverrides, no
|
|
|
365
366
|
if (!effect) {
|
|
366
367
|
continue;
|
|
367
368
|
}
|
|
368
|
-
const effectStatus = remotion_1.Internals.
|
|
369
|
-
|
|
369
|
+
const effectStatus = remotion_1.Internals.getEffectPropStatusesCtx({
|
|
370
|
+
propStatuses,
|
|
370
371
|
nodePath,
|
|
371
372
|
effectIndex,
|
|
372
373
|
});
|
|
@@ -396,7 +397,7 @@ const getSelectedUvHandles = ({ codeValues, clientId, getEffectDragOverrides, no
|
|
|
396
397
|
}
|
|
397
398
|
const dragOverrideValue = dragOverrides[fieldKey];
|
|
398
399
|
const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
399
|
-
|
|
400
|
+
propStatus,
|
|
400
401
|
dragOverrideValue,
|
|
401
402
|
defaultValue: fieldSchema.default,
|
|
402
403
|
shouldResortToDefaultValueIfUndefined: true,
|
|
@@ -407,7 +408,7 @@ const getSelectedUvHandles = ({ codeValues, clientId, getEffectDragOverrides, no
|
|
|
407
408
|
}
|
|
408
409
|
handles.push({
|
|
409
410
|
clientId,
|
|
410
|
-
|
|
411
|
+
propStatus,
|
|
411
412
|
effectIndex,
|
|
412
413
|
fieldDefault: fieldSchema.default,
|
|
413
414
|
fieldKey,
|
|
@@ -459,7 +460,7 @@ const getSelectedOutlineDragStates = ({ dragTargets, getDragOverrides, timelineP
|
|
|
459
460
|
const dragOverrideValue = ((_a = getDragOverrides(target.nodePath)) !== null && _a !== void 0 ? _a : {})[translateFieldKey];
|
|
460
461
|
const sourceFrame = timelinePosition - target.keyframeDisplayOffset;
|
|
461
462
|
const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
462
|
-
|
|
463
|
+
propStatus: target.propStatus,
|
|
463
464
|
dragOverrideValue,
|
|
464
465
|
defaultValue: target.fieldDefault,
|
|
465
466
|
frame: sourceFrame,
|
|
@@ -492,7 +493,7 @@ const getSelectedOutlineDragChanges = ({ dragStates, lastValues, }) => {
|
|
|
492
493
|
if (value === undefined) {
|
|
493
494
|
continue;
|
|
494
495
|
}
|
|
495
|
-
if (dragState.target.
|
|
496
|
+
if (dragState.target.propStatus.status === 'keyframed') {
|
|
496
497
|
const startValue = (0, timeline_translate_utils_1.serializeTranslate)(dragState.startX, dragState.startY);
|
|
497
498
|
if (value === startValue) {
|
|
498
499
|
continue;
|
|
@@ -510,9 +511,9 @@ const getSelectedOutlineDragChanges = ({ dragStates, lastValues, }) => {
|
|
|
510
511
|
continue;
|
|
511
512
|
}
|
|
512
513
|
const stringifiedValue = JSON.stringify(value);
|
|
513
|
-
const shouldSave = value !== dragState.target.
|
|
514
|
+
const shouldSave = value !== dragState.target.propStatus.codeValue &&
|
|
514
515
|
!(dragState.defaultValue === stringifiedValue &&
|
|
515
|
-
dragState.target.
|
|
516
|
+
dragState.target.propStatus.codeValue === undefined);
|
|
516
517
|
if (!shouldSave) {
|
|
517
518
|
continue;
|
|
518
519
|
}
|
|
@@ -559,7 +560,7 @@ const getSelectedOutlineScaleDragStates = ({ dragTargets, getDragOverrides, }) =
|
|
|
559
560
|
var _a;
|
|
560
561
|
const dragOverrideValue = ((_a = getDragOverrides(target.nodePath)) !== null && _a !== void 0 ? _a : {})[scaleFieldKey];
|
|
561
562
|
const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
562
|
-
|
|
563
|
+
propStatus: target.propStatus,
|
|
563
564
|
dragOverrideValue,
|
|
564
565
|
defaultValue: target.fieldDefault,
|
|
565
566
|
shouldResortToDefaultValueIfUndefined: true,
|
|
@@ -613,9 +614,9 @@ const getSelectedOutlineScaleDragChanges = ({ dragStates, lastValues, }) => {
|
|
|
613
614
|
}
|
|
614
615
|
const stringifiedValue = JSON.stringify(value);
|
|
615
616
|
const shouldSave = stringifiedValue !==
|
|
616
|
-
JSON.stringify(dragState.target.
|
|
617
|
+
JSON.stringify(dragState.target.propStatus.codeValue) &&
|
|
617
618
|
!(dragState.defaultValue === stringifiedValue &&
|
|
618
|
-
dragState.target.
|
|
619
|
+
dragState.target.propStatus.codeValue === undefined);
|
|
619
620
|
if (!shouldSave) {
|
|
620
621
|
return [];
|
|
621
622
|
}
|
|
@@ -643,9 +644,9 @@ const clearSelectedOutlineScaleDragOverrides = ({ clearDragOverrides, dragStates
|
|
|
643
644
|
}
|
|
644
645
|
};
|
|
645
646
|
const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, hovered, onContextMenuOpen, outline, onDraggingChange, onHoverChange, onSelect, scale, target, }) => {
|
|
646
|
-
var _a, _b;
|
|
647
|
+
var _a, _b, _c;
|
|
647
648
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
648
|
-
const {
|
|
649
|
+
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
649
650
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
650
651
|
const timelinePositionRef = (0, react_1.useRef)(timelinePosition);
|
|
651
652
|
timelinePositionRef.current = timelinePosition;
|
|
@@ -653,7 +654,8 @@ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, h
|
|
|
653
654
|
const points = (0, react_1.useMemo)(() => outline.points.map(pointToString).join(' '), [outline.points]);
|
|
654
655
|
const drag = (_a = target === null || target === void 0 ? void 0 : target.drag) !== null && _a !== void 0 ? _a : null;
|
|
655
656
|
const selected = (_b = target === null || target === void 0 ? void 0 : target.selected) !== null && _b !== void 0 ? _b : false;
|
|
656
|
-
const
|
|
657
|
+
const containsSelection = (_c = target === null || target === void 0 ? void 0 : target.containsSelection) !== null && _c !== void 0 ? _c : false;
|
|
658
|
+
const visible = containsSelection || hovered;
|
|
657
659
|
const onPointerDown = react_1.default.useCallback((event) => {
|
|
658
660
|
if (event.button !== 0 || target === undefined) {
|
|
659
661
|
return;
|
|
@@ -689,9 +691,9 @@ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, h
|
|
|
689
691
|
if (value === undefined) {
|
|
690
692
|
throw new Error('Expected drag value to be available');
|
|
691
693
|
}
|
|
692
|
-
if (dragState.target.
|
|
694
|
+
if (dragState.target.propStatus.status === 'keyframed') {
|
|
693
695
|
setDragOverrides(dragState.target.nodePath, translateFieldKey, remotion_1.Internals.makeKeyframedDragOverride({
|
|
694
|
-
status: dragState.target.
|
|
696
|
+
status: dragState.target.propStatus,
|
|
695
697
|
frame: dragState.sourceFrame,
|
|
696
698
|
value,
|
|
697
699
|
}));
|
|
@@ -720,7 +722,7 @@ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, h
|
|
|
720
722
|
staticChanges.length > 0
|
|
721
723
|
? (0, save_sequence_prop_1.saveSequenceProps)({
|
|
722
724
|
changes: staticChanges,
|
|
723
|
-
|
|
725
|
+
setPropStatuses,
|
|
724
726
|
clientId: drag.clientId,
|
|
725
727
|
undoLabel: changes.length > 1
|
|
726
728
|
? 'Move selected sequences'
|
|
@@ -737,7 +739,7 @@ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, h
|
|
|
737
739
|
sourceFrame: change.sourceFrame,
|
|
738
740
|
value: change.value,
|
|
739
741
|
schema: change.schema,
|
|
740
|
-
|
|
742
|
+
setPropStatuses,
|
|
741
743
|
clientId: change.clientId,
|
|
742
744
|
})),
|
|
743
745
|
])
|
|
@@ -760,7 +762,7 @@ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, h
|
|
|
760
762
|
onSelect,
|
|
761
763
|
scale,
|
|
762
764
|
selected,
|
|
763
|
-
|
|
765
|
+
setPropStatuses,
|
|
764
766
|
setDragOverrides,
|
|
765
767
|
target,
|
|
766
768
|
]);
|
|
@@ -779,7 +781,7 @@ const SelectedOutlinePolygon = ({ allDragTargets, contextMenuValues, dragging, h
|
|
|
779
781
|
const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, contextMenuValues, dragging, edge, outline, onDraggingChange, onContextMenuOpen, onHoverChange, onSelect, target, }) => {
|
|
780
782
|
var _a, _b;
|
|
781
783
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
782
|
-
const {
|
|
784
|
+
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
783
785
|
const scaleDrag = (_a = target === null || target === void 0 ? void 0 : target.scaleDrag) !== null && _a !== void 0 ? _a : null;
|
|
784
786
|
const selected = (_b = target === null || target === void 0 ? void 0 : target.selected) !== null && _b !== void 0 ? _b : false;
|
|
785
787
|
const lineRef = (0, react_1.useRef)(null);
|
|
@@ -844,7 +846,7 @@ const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, contextMenuValues,
|
|
|
844
846
|
}
|
|
845
847
|
(0, save_sequence_prop_1.saveSequenceProps)({
|
|
846
848
|
changes,
|
|
847
|
-
|
|
849
|
+
setPropStatuses,
|
|
848
850
|
clientId: scaleDrag.clientId,
|
|
849
851
|
undoLabel: changes.length > 1 ? 'Scale selected sequences' : 'Scale sequence',
|
|
850
852
|
redoLabel: changes.length > 1
|
|
@@ -873,7 +875,7 @@ const SelectedOutlineScaleEdgeLine = ({ allScaleDragTargets, contextMenuValues,
|
|
|
873
875
|
onSelect,
|
|
874
876
|
scaleDrag,
|
|
875
877
|
selected,
|
|
876
|
-
|
|
878
|
+
setPropStatuses,
|
|
877
879
|
setDragOverrides,
|
|
878
880
|
target,
|
|
879
881
|
]);
|
|
@@ -903,7 +905,7 @@ const SelectedUvHandleConnectionLines = ({ handles, outline }) => {
|
|
|
903
905
|
return (jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: lines.map((line) => (jsx_runtime_1.jsx("line", { x1: line.from.x, y1: line.from.y, x2: line.to.x, y2: line.to.y, stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: "none" }, line.key))) }));
|
|
904
906
|
};
|
|
905
907
|
const SelectedUvHandleCircle = ({ handle, onDraggingChange, outline }) => {
|
|
906
|
-
const { setEffectDragOverrides, clearEffectDragOverrides,
|
|
908
|
+
const { setEffectDragOverrides, clearEffectDragOverrides, setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
907
909
|
const position = (0, react_1.useMemo)(() => (0, exports.getUvHandlePosition)(outline.points, handle.value), [handle.value, outline.points]);
|
|
908
910
|
const onPointerDown = react_1.default.useCallback((event) => {
|
|
909
911
|
if (event.button !== 0) {
|
|
@@ -942,9 +944,9 @@ const SelectedUvHandleCircle = ({ handle, onDraggingChange, outline }) => {
|
|
|
942
944
|
onDraggingChange(false);
|
|
943
945
|
const stringifiedValue = lastValue === null ? null : JSON.stringify(lastValue);
|
|
944
946
|
const shouldSave = lastValue !== null &&
|
|
945
|
-
!tuplesEqual(handle.
|
|
947
|
+
!tuplesEqual(handle.propStatus.codeValue, lastValue) &&
|
|
946
948
|
!(defaultValue === stringifiedValue &&
|
|
947
|
-
handle.
|
|
949
|
+
handle.propStatus.codeValue === undefined);
|
|
948
950
|
if (!shouldSave) {
|
|
949
951
|
clearEffectDragOverrides(handle.nodePath, handle.effectIndex);
|
|
950
952
|
return;
|
|
@@ -958,7 +960,7 @@ const SelectedUvHandleCircle = ({ handle, onDraggingChange, outline }) => {
|
|
|
958
960
|
value: lastValue,
|
|
959
961
|
defaultValue,
|
|
960
962
|
schema: handle.schema,
|
|
961
|
-
|
|
963
|
+
setPropStatuses,
|
|
962
964
|
clientId: handle.clientId,
|
|
963
965
|
}).finally(() => {
|
|
964
966
|
clearEffectDragOverrides(handle.nodePath, handle.effectIndex);
|
|
@@ -972,10 +974,10 @@ const SelectedUvHandleCircle = ({ handle, onDraggingChange, outline }) => {
|
|
|
972
974
|
handle,
|
|
973
975
|
onDraggingChange,
|
|
974
976
|
outline.points,
|
|
975
|
-
|
|
977
|
+
setPropStatuses,
|
|
976
978
|
setEffectDragOverrides,
|
|
977
979
|
]);
|
|
978
|
-
return (jsx_runtime_1.jsx("circle", { cx: position.x, cy: position.y, r: 6, fill: "white", stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: "all", cursor: "
|
|
980
|
+
return (jsx_runtime_1.jsx("circle", { cx: position.x, cy: position.y, r: 6, fill: "white", stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: "all", cursor: "default", onPointerDown: onPointerDown }));
|
|
979
981
|
};
|
|
980
982
|
const SelectedOutlineElement = ({ allDragTargets, allScaleDragTargets, dragging, hovered, outline, onDraggingChange, onHoverChange, onSelect, scale, target, }) => {
|
|
981
983
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
@@ -1054,20 +1056,26 @@ const SelectedOutlineElement = ({ allDragTargets, allScaleDragTargets, dragging,
|
|
|
1054
1056
|
].filter(no_react_1.NoReactInternals.truthy);
|
|
1055
1057
|
}, [onSelect, previewServerState.type, target, updateResolvedStackTrace]);
|
|
1056
1058
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
1057
|
-
jsx_runtime_1.jsx(SelectedOutlinePolygon, { allDragTargets: allDragTargets, contextMenuValues: emptyContextMenuValues, dragging: dragging, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, scale: scale, target: target }), (target === null || target === void 0 ? void 0 : target.
|
|
1059
|
+
jsx_runtime_1.jsx(SelectedOutlinePolygon, { allDragTargets: allDragTargets, contextMenuValues: emptyContextMenuValues, dragging: dragging, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, scale: scale, target: target }), (target === null || target === void 0 ? void 0 : target.containsSelection) || hovered
|
|
1058
1060
|
? ['top', 'right', 'bottom', 'left'].map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine, { allScaleDragTargets: allScaleDragTargets, contextMenuValues: emptyContextMenuValues, dragging: dragging, edge: edge, outline: outline, onContextMenuOpen: onContextMenuOpen, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, target: target }, edge)))
|
|
1059
|
-
: null, (target === null || target === void 0 ? void 0 : target.selected)
|
|
1060
|
-
? (() => {
|
|
1061
|
-
const { uvHandles } = target;
|
|
1062
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
1063
|
-
jsx_runtime_1.jsx(SelectedUvHandleConnectionLines, { handles: uvHandles, outline: outline }), uvHandles.map((handle) => (jsx_runtime_1.jsx(SelectedUvHandleCircle, { handle: handle, onDraggingChange: onDraggingChange, outline: outline }, `${handle.effectIndex}-${handle.fieldKey}`)))] }));
|
|
1064
|
-
})()
|
|
1065
1061
|
: null] }));
|
|
1066
1062
|
};
|
|
1063
|
+
const SelectedOutlineUvHandleConnectionLayer = ({ outline, target }) => {
|
|
1064
|
+
if (!(target === null || target === void 0 ? void 0 : target.containsSelection) || target.uvHandles.length === 0) {
|
|
1065
|
+
return null;
|
|
1066
|
+
}
|
|
1067
|
+
return (jsx_runtime_1.jsx(SelectedUvHandleConnectionLines, { handles: target.uvHandles, outline: outline }));
|
|
1068
|
+
};
|
|
1069
|
+
const SelectedOutlineUvHandleCircleLayer = ({ onDraggingChange, outline, target }) => {
|
|
1070
|
+
if (!(target === null || target === void 0 ? void 0 : target.containsSelection) || target.uvHandles.length === 0) {
|
|
1071
|
+
return null;
|
|
1072
|
+
}
|
|
1073
|
+
return (jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: target.uvHandles.map((handle) => (jsx_runtime_1.jsx(SelectedUvHandleCircle, { handle: handle, onDraggingChange: onDraggingChange, outline: outline }, `${handle.effectIndex}-${handle.fieldKey}`))) }));
|
|
1074
|
+
};
|
|
1067
1075
|
const SelectedOutlineOverlay = ({ scale }) => {
|
|
1068
1076
|
const { selectedItems, selectItem } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
1069
1077
|
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
1070
|
-
const {
|
|
1078
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
1071
1079
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
1072
1080
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
1073
1081
|
const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
@@ -1087,7 +1095,8 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
1087
1095
|
if (!TimelineSelection_1.ENABLE_OUTLINES || !editorShowOutlines) {
|
|
1088
1096
|
return [];
|
|
1089
1097
|
}
|
|
1090
|
-
const selectedSequenceKeys = getSelectedSequenceKeys(selectedItems);
|
|
1098
|
+
const selectedSequenceKeys = (0, exports.getSelectedSequenceKeys)(selectedItems);
|
|
1099
|
+
const sequenceKeysContainingSelection = getSequenceKeysContainingSelection(selectedItems);
|
|
1091
1100
|
const selectedEffectsBySequenceKey = (0, exports.getSelectedEffectFieldsBySequenceKey)(selectedItems);
|
|
1092
1101
|
const clientId = previewServerState.type === 'connected'
|
|
1093
1102
|
? previewServerState.clientId
|
|
@@ -1101,15 +1110,16 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
1101
1110
|
throw new Error('Expected sequence to have a ref for outline');
|
|
1102
1111
|
}
|
|
1103
1112
|
const selected = selectedSequenceKeys.has(key);
|
|
1113
|
+
const containsSelection = sequenceKeysContainingSelection.has(key);
|
|
1104
1114
|
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
1105
1115
|
const { controls } = sequence;
|
|
1106
1116
|
const fieldSchema = controls === null || controls === void 0 ? void 0 : controls.schema[translateFieldKey];
|
|
1107
|
-
const
|
|
1117
|
+
const propStatus = (_a = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _a === void 0 ? void 0 : _a[translateFieldKey];
|
|
1108
1118
|
const scaleFieldSchema = controls === null || controls === void 0 ? void 0 : controls.schema[scaleFieldKey];
|
|
1109
|
-
const
|
|
1110
|
-
const canDragStatus = (
|
|
1111
|
-
((
|
|
1112
|
-
|
|
1119
|
+
const scalePropStatus = (_b = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)) === null || _b === void 0 ? void 0 : _b[scaleFieldKey];
|
|
1120
|
+
const canDragStatus = (propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'static' ||
|
|
1121
|
+
((propStatus === null || propStatus === void 0 ? void 0 : propStatus.status) === 'keyframed' &&
|
|
1122
|
+
propStatus.interpolationFunction === 'interpolate');
|
|
1113
1123
|
const canDrag = previewServerState.type === 'connected' &&
|
|
1114
1124
|
controls !== null &&
|
|
1115
1125
|
(fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) === 'translate' &&
|
|
@@ -1117,9 +1127,10 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
1117
1127
|
const canScaleDrag = previewServerState.type === 'connected' &&
|
|
1118
1128
|
controls !== null &&
|
|
1119
1129
|
(scaleFieldSchema === null || scaleFieldSchema === void 0 ? void 0 : scaleFieldSchema.type) === 'scale' &&
|
|
1120
|
-
(
|
|
1130
|
+
(scalePropStatus === null || scalePropStatus === void 0 ? void 0 : scalePropStatus.status) === 'static';
|
|
1121
1131
|
return {
|
|
1122
1132
|
key,
|
|
1133
|
+
containsSelection,
|
|
1123
1134
|
nodePathInfo,
|
|
1124
1135
|
ref: sequence.refForOutline,
|
|
1125
1136
|
selected,
|
|
@@ -1127,7 +1138,7 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
1127
1138
|
sequence,
|
|
1128
1139
|
drag: canDrag
|
|
1129
1140
|
? {
|
|
1130
|
-
|
|
1141
|
+
propStatus,
|
|
1131
1142
|
clientId: previewServerState.clientId,
|
|
1132
1143
|
fieldDefault: fieldSchema.default,
|
|
1133
1144
|
keyframeDisplayOffset,
|
|
@@ -1137,7 +1148,7 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
1137
1148
|
: null,
|
|
1138
1149
|
scaleDrag: canScaleDrag
|
|
1139
1150
|
? {
|
|
1140
|
-
|
|
1151
|
+
propStatus: scalePropStatus,
|
|
1141
1152
|
clientId: previewServerState.clientId,
|
|
1142
1153
|
fieldDefault: scaleFieldSchema.default,
|
|
1143
1154
|
fieldSchema: scaleFieldSchema,
|
|
@@ -1148,7 +1159,7 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
1148
1159
|
var _a;
|
|
1149
1160
|
const dragOverrideValue = ((_a = getDragOverrides(nodePath)) !== null && _a !== void 0 ? _a : {})[scaleFieldKey];
|
|
1150
1161
|
const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
1151
|
-
|
|
1162
|
+
propStatus: scalePropStatus,
|
|
1152
1163
|
dragOverrideValue,
|
|
1153
1164
|
defaultValue: scaleFieldSchema.default,
|
|
1154
1165
|
shouldResortToDefaultValueIfUndefined: true,
|
|
@@ -1161,9 +1172,9 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
1161
1172
|
schema: controls.schema,
|
|
1162
1173
|
}
|
|
1163
1174
|
: null,
|
|
1164
|
-
uvHandles:
|
|
1175
|
+
uvHandles: containsSelection
|
|
1165
1176
|
? getSelectedUvHandles({
|
|
1166
|
-
|
|
1177
|
+
propStatuses,
|
|
1167
1178
|
clientId,
|
|
1168
1179
|
getEffectDragOverrides,
|
|
1169
1180
|
nodePath,
|
|
@@ -1174,7 +1185,7 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
1174
1185
|
};
|
|
1175
1186
|
});
|
|
1176
1187
|
}, [
|
|
1177
|
-
|
|
1188
|
+
propStatuses,
|
|
1178
1189
|
getDragOverrides,
|
|
1179
1190
|
getEffectDragOverrides,
|
|
1180
1191
|
getScaleLockState,
|
|
@@ -1224,6 +1235,6 @@ const SelectedOutlineOverlay = ({ scale }) => {
|
|
|
1224
1235
|
if (outlineTargets.length === 0) {
|
|
1225
1236
|
return null;
|
|
1226
1237
|
}
|
|
1227
|
-
return (jsx_runtime_1.
|
|
1238
|
+
return (jsx_runtime_1.jsxs("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: [outlines.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement, { allDragTargets: allDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered: hoveredOutlineKey === outline.key, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: setHoveredOutlineKey, onSelect: selectItem, scale: scale, target: targetsByKey.get(outline.key) }, outline.key))), outlines.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvHandleConnectionLayer, { outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-connection-lines`))), outlines.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvHandleCircleLayer, { onDraggingChange: onDraggingChange, outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-handles`)))] }));
|
|
1228
1239
|
};
|
|
1229
1240
|
exports.SelectedOutlineOverlay = SelectedOutlineOverlay;
|
|
@@ -68,7 +68,7 @@ const getExtrapolateValues = (onSelect) => {
|
|
|
68
68
|
const KeyframeSettingsModal = ({ state }) => {
|
|
69
69
|
var _a;
|
|
70
70
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
71
|
-
const {
|
|
71
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
72
72
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
73
73
|
const [left, setLeft] = (0, react_1.useState)(state.status.clamping.left);
|
|
74
74
|
const [right, setRight] = (0, react_1.useState)(state.status.clamping.right);
|
|
@@ -103,7 +103,7 @@ const KeyframeSettingsModal = ({ state }) => {
|
|
|
103
103
|
fieldKey: state.fieldKey,
|
|
104
104
|
settings,
|
|
105
105
|
schema: state.schema,
|
|
106
|
-
|
|
106
|
+
setPropStatuses,
|
|
107
107
|
clientId: previewServerState.clientId,
|
|
108
108
|
})
|
|
109
109
|
: (0, call_update_keyframe_settings_1.callUpdateEffectKeyframeSettings)({
|
|
@@ -113,7 +113,7 @@ const KeyframeSettingsModal = ({ state }) => {
|
|
|
113
113
|
fieldKey: state.fieldKey,
|
|
114
114
|
settings,
|
|
115
115
|
schema: state.schema,
|
|
116
|
-
|
|
116
|
+
setPropStatuses,
|
|
117
117
|
clientId: previewServerState.clientId,
|
|
118
118
|
});
|
|
119
119
|
promise.then(close).finally(() => {
|
|
@@ -126,7 +126,7 @@ const KeyframeSettingsModal = ({ state }) => {
|
|
|
126
126
|
posterize,
|
|
127
127
|
previewServerState,
|
|
128
128
|
right,
|
|
129
|
-
|
|
129
|
+
setPropStatuses,
|
|
130
130
|
state,
|
|
131
131
|
]);
|
|
132
132
|
const saveDisabled = saving || previewServerState.type !== 'connected';
|
|
@@ -6,19 +6,19 @@ const remotion_1 = require("remotion");
|
|
|
6
6
|
const client_id_1 = require("../../helpers/client-id");
|
|
7
7
|
const SequencePropsObserver = () => {
|
|
8
8
|
const { subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
9
|
-
const {
|
|
9
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
10
10
|
(0, react_1.useEffect)(() => {
|
|
11
11
|
const handleEvent = (event) => {
|
|
12
12
|
if (event.type !== 'sequence-props-updated') {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
setPropStatuses(event.nodePath, () => event.result);
|
|
16
16
|
};
|
|
17
17
|
const unsubscribe = subscribeToEvent('sequence-props-updated', handleEvent);
|
|
18
18
|
return () => {
|
|
19
19
|
unsubscribe();
|
|
20
20
|
};
|
|
21
|
-
}, [
|
|
21
|
+
}, [setPropStatuses, subscribeToEvent]);
|
|
22
22
|
return null;
|
|
23
23
|
};
|
|
24
24
|
exports.SequencePropsObserver = SequencePropsObserver;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EffectClipboardSnapshot, type EffectPropClipboardData } from '@remotion/studio-shared';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
import { type
|
|
3
|
+
import { type OverrideIdToNodePaths, type PropStatuses, type SequencePropsSubscriptionKey, type SequenceSchema, type TSequence } from 'remotion';
|
|
4
4
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
5
5
|
import { type TimelineSelection } from './TimelineSelection';
|
|
6
6
|
export type PasteEffectsTarget = {
|
|
@@ -25,18 +25,18 @@ export type PasteEffectPropTarget = {
|
|
|
25
25
|
readonly type: 'none' | 'multiple' | 'unsupported' | 'effect-type-mismatch' | 'prop-mismatch' | 'uncopyable';
|
|
26
26
|
};
|
|
27
27
|
export declare const getPasteEffectsTarget: (selectedItems: readonly TimelineSelection[]) => PasteEffectsTarget;
|
|
28
|
-
export declare const getSnapshotsFromSelection: ({ selection,
|
|
28
|
+
export declare const getSnapshotsFromSelection: ({ selection, propStatuses, }: {
|
|
29
29
|
selection: TimelineSelection;
|
|
30
|
-
|
|
30
|
+
propStatuses: PropStatuses;
|
|
31
31
|
}) => EffectClipboardSnapshot[] | null;
|
|
32
|
-
export declare const getEffectPropClipboardDataFromSelection: ({ selection,
|
|
32
|
+
export declare const getEffectPropClipboardDataFromSelection: ({ selection, propStatuses, }: {
|
|
33
33
|
selection: TimelineSelection;
|
|
34
|
-
|
|
34
|
+
propStatuses: PropStatuses;
|
|
35
35
|
}) => EffectPropClipboardData | null;
|
|
36
|
-
export declare const getPasteEffectPropTarget: ({ selectedItems, payload,
|
|
36
|
+
export declare const getPasteEffectPropTarget: ({ selectedItems, payload, propStatuses, sequences, overrideIdsToNodePaths, }: {
|
|
37
37
|
readonly selectedItems: readonly TimelineSelection[];
|
|
38
38
|
readonly payload: EffectPropClipboardData;
|
|
39
|
-
readonly
|
|
39
|
+
readonly propStatuses: PropStatuses;
|
|
40
40
|
readonly sequences: TSequence[];
|
|
41
41
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
42
42
|
}) => PasteEffectPropTarget;
|
|
@@ -113,13 +113,13 @@ const effectStatusToSnapshot = (effect) => {
|
|
|
113
113
|
params,
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
|
-
const getSnapshotsFromSelection = ({ selection,
|
|
116
|
+
const getSnapshotsFromSelection = ({ selection, propStatuses, }) => {
|
|
117
117
|
if (selection.type !== 'sequence-effect' &&
|
|
118
118
|
selection.type !== 'sequence-all-effects') {
|
|
119
119
|
return null;
|
|
120
120
|
}
|
|
121
121
|
const { sequenceSubscriptionKey } = selection.nodePathInfo;
|
|
122
|
-
const sequenceStatus =
|
|
122
|
+
const sequenceStatus = propStatuses[remotion_1.Internals.makeSequencePropsSubscriptionKey(sequenceSubscriptionKey)];
|
|
123
123
|
if (!sequenceStatus || !sequenceStatus.canUpdate) {
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
@@ -143,11 +143,11 @@ const getSnapshotsFromSelection = ({ selection, codeValues, }) => {
|
|
|
143
143
|
return snapshots;
|
|
144
144
|
};
|
|
145
145
|
exports.getSnapshotsFromSelection = getSnapshotsFromSelection;
|
|
146
|
-
const getEffectPropClipboardDataFromSelection = ({ selection,
|
|
146
|
+
const getEffectPropClipboardDataFromSelection = ({ selection, propStatuses, }) => {
|
|
147
147
|
if (selection.type !== 'sequence-effect-prop') {
|
|
148
148
|
return null;
|
|
149
149
|
}
|
|
150
|
-
const sequenceStatus =
|
|
150
|
+
const sequenceStatus = propStatuses[remotion_1.Internals.makeSequencePropsSubscriptionKey(selection.nodePathInfo.sequenceSubscriptionKey)];
|
|
151
151
|
if (!sequenceStatus || !sequenceStatus.canUpdate) {
|
|
152
152
|
return null;
|
|
153
153
|
}
|
|
@@ -176,7 +176,7 @@ const getEffectPropClipboardDataFromSelection = ({ selection, codeValues, }) =>
|
|
|
176
176
|
};
|
|
177
177
|
};
|
|
178
178
|
exports.getEffectPropClipboardDataFromSelection = getEffectPropClipboardDataFromSelection;
|
|
179
|
-
const getPasteEffectPropTarget = ({ selectedItems, payload,
|
|
179
|
+
const getPasteEffectPropTarget = ({ selectedItems, payload, propStatuses, sequences, overrideIdsToNodePaths, }) => {
|
|
180
180
|
var _a;
|
|
181
181
|
if (selectedItems.length === 0) {
|
|
182
182
|
return { type: 'none' };
|
|
@@ -223,7 +223,7 @@ const getPasteEffectPropTarget = ({ selectedItems, payload, codeValues, sequence
|
|
|
223
223
|
if (!effect || !isVisibleFieldSchema(fieldSchema)) {
|
|
224
224
|
return { type: 'prop-mismatch' };
|
|
225
225
|
}
|
|
226
|
-
const sequenceStatus =
|
|
226
|
+
const sequenceStatus = propStatuses[remotion_1.Internals.makeSequencePropsSubscriptionKey(selection.nodePathInfo.sequenceSubscriptionKey)];
|
|
227
227
|
if (!(sequenceStatus === null || sequenceStatus === void 0 ? void 0 : sequenceStatus.canUpdate)) {
|
|
228
228
|
return { type: 'uncopyable' };
|
|
229
229
|
}
|
|
@@ -254,9 +254,9 @@ const TimelineClipboardKeybindings = () => {
|
|
|
254
254
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
255
255
|
const { canSelect } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
256
256
|
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
257
|
-
const
|
|
258
|
-
const {
|
|
259
|
-
const
|
|
257
|
+
const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
|
|
258
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
259
|
+
const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
|
|
260
260
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
261
261
|
(0, react_1.useEffect)(() => {
|
|
262
262
|
if (!canSelect || previewServerState.type !== 'connected') {
|
|
@@ -269,6 +269,7 @@ const TimelineClipboardKeybindings = () => {
|
|
|
269
269
|
callback: (e) => {
|
|
270
270
|
var _a;
|
|
271
271
|
const { selectedItems } = currentSelection.current;
|
|
272
|
+
const propStatuses = propStatusesRef.current;
|
|
272
273
|
if (selectedItems.length === 0) {
|
|
273
274
|
return;
|
|
274
275
|
}
|
|
@@ -281,7 +282,7 @@ const TimelineClipboardKeybindings = () => {
|
|
|
281
282
|
}
|
|
282
283
|
const payload = (0, exports.getEffectPropClipboardDataFromSelection)({
|
|
283
284
|
selection: selectedItems[0],
|
|
284
|
-
|
|
285
|
+
propStatuses,
|
|
285
286
|
});
|
|
286
287
|
if (payload === null) {
|
|
287
288
|
(0, NotificationCenter_1.showNotification)('Cannot copy effect prop because its value cannot be copied', 3000);
|
|
@@ -310,7 +311,7 @@ const TimelineClipboardKeybindings = () => {
|
|
|
310
311
|
const snapshots = selectedItems.flatMap((selection) => {
|
|
311
312
|
const itemSnapshots = (0, exports.getSnapshotsFromSelection)({
|
|
312
313
|
selection,
|
|
313
|
-
|
|
314
|
+
propStatuses,
|
|
314
315
|
});
|
|
315
316
|
return itemSnapshots !== null && itemSnapshots !== void 0 ? itemSnapshots : [null];
|
|
316
317
|
});
|
|
@@ -352,6 +353,8 @@ const TimelineClipboardKeybindings = () => {
|
|
|
352
353
|
navigator.clipboard
|
|
353
354
|
.readText()
|
|
354
355
|
.then((text) => {
|
|
356
|
+
const propStatuses = propStatusesRef.current;
|
|
357
|
+
const sequences = sequencesRef.current;
|
|
355
358
|
const effectPropResult = (0, studio_shared_1.parseEffectPropClipboardDataResult)(text);
|
|
356
359
|
if (effectPropResult.status !== 'invalid') {
|
|
357
360
|
e.preventDefault();
|
|
@@ -362,7 +365,7 @@ const TimelineClipboardKeybindings = () => {
|
|
|
362
365
|
const effectPropTarget = (0, exports.getPasteEffectPropTarget)({
|
|
363
366
|
selectedItems,
|
|
364
367
|
payload: effectPropResult.data,
|
|
365
|
-
|
|
368
|
+
propStatuses,
|
|
366
369
|
sequences,
|
|
367
370
|
overrideIdsToNodePaths: overrideIdToNodePathMappings,
|
|
368
371
|
});
|
|
@@ -406,7 +409,7 @@ const TimelineClipboardKeybindings = () => {
|
|
|
406
409
|
}),
|
|
407
410
|
defaultValue: effectPropTarget.defaultValue,
|
|
408
411
|
schema: effectPropTarget.schema,
|
|
409
|
-
|
|
412
|
+
setPropStatuses,
|
|
410
413
|
clientId,
|
|
411
414
|
}).then(() => {
|
|
412
415
|
(0, NotificationCenter_1.showNotification)('Pasted effect prop', 2000);
|
|
@@ -466,13 +469,13 @@ const TimelineClipboardKeybindings = () => {
|
|
|
466
469
|
};
|
|
467
470
|
}, [
|
|
468
471
|
canSelect,
|
|
469
|
-
codeValues,
|
|
470
472
|
currentSelection,
|
|
471
473
|
keybindings,
|
|
472
474
|
overrideIdToNodePathMappings,
|
|
475
|
+
propStatusesRef,
|
|
473
476
|
previewServerState,
|
|
474
|
-
|
|
475
|
-
|
|
477
|
+
sequencesRef,
|
|
478
|
+
setPropStatuses,
|
|
476
479
|
]);
|
|
477
480
|
return null;
|
|
478
481
|
};
|