@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
|
@@ -30,6 +30,11 @@ export type TimelineSelection = (TimelineSelectionBase & {
|
|
|
30
30
|
}) | (TimelineSelectionBase & {
|
|
31
31
|
readonly type: 'keyframe';
|
|
32
32
|
readonly frame: number;
|
|
33
|
+
}) | (TimelineSelectionBase & {
|
|
34
|
+
readonly type: 'easing';
|
|
35
|
+
readonly fromFrame: number;
|
|
36
|
+
readonly toFrame: number;
|
|
37
|
+
readonly segmentIndex: number;
|
|
33
38
|
});
|
|
34
39
|
export type TimelineSelectionInteraction = {
|
|
35
40
|
readonly shiftKey: boolean;
|
|
@@ -81,5 +86,15 @@ export declare const useTimelineKeyframeSelection: (nodePathInfo: SequenceNodePa
|
|
|
81
86
|
selectable: boolean;
|
|
82
87
|
selected: boolean;
|
|
83
88
|
};
|
|
89
|
+
export declare const useTimelineEasingSelection: ({ nodePathInfo, fromFrame, toFrame, segmentIndex, }: {
|
|
90
|
+
readonly nodePathInfo: SequenceNodePathInfo;
|
|
91
|
+
readonly fromFrame: number;
|
|
92
|
+
readonly toFrame: number;
|
|
93
|
+
readonly segmentIndex: number;
|
|
94
|
+
}) => {
|
|
95
|
+
onSelect: (interaction?: TimelineSelectionInteraction | undefined) => void;
|
|
96
|
+
selectable: boolean;
|
|
97
|
+
selected: boolean;
|
|
98
|
+
};
|
|
84
99
|
export declare const useTimelineRowContainsSelection: (nodePathInfo: SequenceNodePathInfo | null) => boolean;
|
|
85
100
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTimelineRowContainsSelection = exports.useTimelineKeyframeSelection = exports.useTimelineRowSelection = exports.useCurrentTimelineSelectionStateAsRef = exports.useTimelineSelection = exports.TimelineSelectionProvider = exports.TimelineSelectAllKeybindings = exports.getTimelineSequenceSelectionKey = exports.getSelectableTimelineSequenceSelections = exports.getTimelineSelectionFromNodePathInfo = exports.getTimelineSelectionAfterInteraction = exports.isTimelineSelectionModifierEvent = exports.ENABLE_OUTLINES = exports.TIMELINE_TOP_DRAG = exports.SELECTION_ENABLED = exports.getTimelineSelectedTrackHighlightStyle = exports.getTimelineColor = exports.getTimelineSelectedLabelStyle = exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = exports.TIMELINE_SELECTED_LABEL_TEXT = exports.TIMELINE_SELECTED_LABEL_BACKGROUND = exports.TIMELINE_SELECTED_BACKGROUND = void 0;
|
|
3
|
+
exports.useTimelineRowContainsSelection = exports.useTimelineEasingSelection = exports.useTimelineKeyframeSelection = exports.useTimelineRowSelection = exports.useCurrentTimelineSelectionStateAsRef = exports.useTimelineSelection = exports.TimelineSelectionProvider = exports.TimelineSelectAllKeybindings = exports.getTimelineSequenceSelectionKey = exports.getSelectableTimelineSequenceSelections = exports.getTimelineSelectionFromNodePathInfo = exports.getTimelineSelectionAfterInteraction = exports.isTimelineSelectionModifierEvent = exports.ENABLE_OUTLINES = exports.TIMELINE_TOP_DRAG = exports.SELECTION_ENABLED = exports.getTimelineSelectedTrackHighlightStyle = exports.getTimelineColor = exports.getTimelineSelectedLabelStyle = exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = exports.TIMELINE_SELECTED_LABEL_TEXT = exports.TIMELINE_SELECTED_LABEL_BACKGROUND = exports.TIMELINE_SELECTED_BACKGROUND = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -191,6 +191,8 @@ const getTimelineSelectionKey = (item) => {
|
|
|
191
191
|
return `${sequenceKey}.sequence-effect-prop.${item.i}.${item.key}`;
|
|
192
192
|
case 'keyframe':
|
|
193
193
|
return `${(0, timeline_node_path_key_1.timelineNodePathInfoToKey)(item.nodePathInfo)}.keyframe.${item.frame}`;
|
|
194
|
+
case 'easing':
|
|
195
|
+
return `${(0, timeline_node_path_key_1.timelineNodePathInfoToKey)(item.nodePathInfo)}.easing.${item.segmentIndex}.${item.fromFrame}.${item.toFrame}`;
|
|
194
196
|
default:
|
|
195
197
|
throw new Error(`Unexpected timeline selection type: ${item}`);
|
|
196
198
|
}
|
|
@@ -408,6 +410,29 @@ const useTimelineKeyframeSelection = (nodePathInfo, frame) => {
|
|
|
408
410
|
};
|
|
409
411
|
};
|
|
410
412
|
exports.useTimelineKeyframeSelection = useTimelineKeyframeSelection;
|
|
413
|
+
const useTimelineEasingSelection = ({ nodePathInfo, fromFrame, toFrame, segmentIndex, }) => {
|
|
414
|
+
const { canSelect, isSelected, selectItem, registerSelectableItem } = (0, exports.useTimelineSelection)();
|
|
415
|
+
const selectionItem = (0, react_1.useMemo)(() => ({
|
|
416
|
+
type: 'easing',
|
|
417
|
+
nodePathInfo,
|
|
418
|
+
fromFrame,
|
|
419
|
+
toFrame,
|
|
420
|
+
segmentIndex,
|
|
421
|
+
}), [nodePathInfo, fromFrame, segmentIndex, toFrame]);
|
|
422
|
+
(0, react_1.useEffect)(() => {
|
|
423
|
+
return registerSelectableItem(selectionItem);
|
|
424
|
+
}, [registerSelectableItem, selectionItem]);
|
|
425
|
+
const selected = isSelected(selectionItem);
|
|
426
|
+
const onSelect = (0, react_1.useCallback)((interaction) => {
|
|
427
|
+
selectItem(selectionItem, interaction);
|
|
428
|
+
}, [selectItem, selectionItem]);
|
|
429
|
+
return {
|
|
430
|
+
onSelect,
|
|
431
|
+
selectable: canSelect,
|
|
432
|
+
selected,
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
exports.useTimelineEasingSelection = useTimelineEasingSelection;
|
|
411
436
|
const useTimelineRowContainsSelection = (nodePathInfo) => {
|
|
412
437
|
const { containsSelection } = (0, exports.useTimelineSelection)();
|
|
413
438
|
if (nodePathInfo === null) {
|
|
@@ -151,15 +151,15 @@ const TimelineSequenceInner = ({ s, windowWidth, nodePathInfo, sequenceFrameOffs
|
|
|
151
151
|
column: (_a = originalLocation.column) !== null && _a !== void 0 ? _a : 0,
|
|
152
152
|
};
|
|
153
153
|
}, [originalLocation]);
|
|
154
|
-
const {
|
|
154
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
155
155
|
const nodePath = (_d = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.sequenceSubscriptionKey) !== null && _d !== void 0 ? _d : null;
|
|
156
|
-
const
|
|
156
|
+
const propStatusesForOverride = (0, react_1.useMemo)(() => {
|
|
157
157
|
return nodePath
|
|
158
|
-
? remotion_1.Internals.
|
|
158
|
+
? remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)
|
|
159
159
|
: undefined;
|
|
160
|
-
}, [
|
|
161
|
-
const durationCanUpdate = Boolean(((_a =
|
|
162
|
-
const fromCanUpdate = Boolean(((_b =
|
|
160
|
+
}, [propStatuses, nodePath]);
|
|
161
|
+
const durationCanUpdate = Boolean(((_a = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.durationInFrames) === null || _a === void 0 ? void 0 : _a.status) === 'static');
|
|
162
|
+
const fromCanUpdate = Boolean(((_b = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.from) === null || _b === void 0 ? void 0 : _b.status) === 'static');
|
|
163
163
|
const { onPointerDown: onMoveDragPointerDown } = (0, TimelineSequenceRightEdgeDragHandle_1.useTimelineSequenceFromDrag)({
|
|
164
164
|
nodePathInfo,
|
|
165
165
|
windowWidth,
|
|
@@ -73,6 +73,9 @@ const sequenceReorderRejectionStyle = {
|
|
|
73
73
|
const hasSequenceReorderDragType = (dataTransfer) => {
|
|
74
74
|
return Array.from(dataTransfer.types).includes(SEQUENCE_REORDER_MIME_TYPE);
|
|
75
75
|
};
|
|
76
|
+
const isSequenceReorderDrag = (dataTransfer) => {
|
|
77
|
+
return (currentSequenceDrag !== null || hasSequenceReorderDragType(dataTransfer));
|
|
78
|
+
};
|
|
76
79
|
const getSequenceReorderDragData = (dataTransfer) => {
|
|
77
80
|
if (currentSequenceDrag) {
|
|
78
81
|
return currentSequenceDrag;
|
|
@@ -130,8 +133,8 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
130
133
|
const previewConnected = previewServerState.type === 'connected';
|
|
131
134
|
const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
|
|
132
135
|
const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
|
|
133
|
-
const {
|
|
134
|
-
const {
|
|
136
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
137
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
135
138
|
const selectAsset = (0, use_select_asset_1.useSelectAsset)();
|
|
136
139
|
const { onSelect, selectable, selected } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
137
140
|
const containsSelection = (0, TimelineSelection_1.useTimelineRowContainsSelection)(nodePathInfo);
|
|
@@ -526,26 +529,26 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
526
529
|
e.stopPropagation();
|
|
527
530
|
openInEditor();
|
|
528
531
|
}, [canOpenInEditor, openInEditor]);
|
|
529
|
-
const
|
|
532
|
+
const propStatusesForOverride = (0, react_1.useMemo)(() => {
|
|
530
533
|
return nodePath
|
|
531
|
-
? remotion_1.Internals.
|
|
534
|
+
? remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)
|
|
532
535
|
: undefined;
|
|
533
|
-
}, [
|
|
534
|
-
const codeHiddenStatus =
|
|
536
|
+
}, [propStatuses, nodePath]);
|
|
537
|
+
const codeHiddenStatus = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.hidden;
|
|
535
538
|
const isItemHidden = (0, react_1.useMemo)(() => {
|
|
536
539
|
var _a;
|
|
537
|
-
const
|
|
540
|
+
const propStatus = codeHiddenStatus && codeHiddenStatus.status === 'static'
|
|
538
541
|
? codeHiddenStatus.codeValue
|
|
539
542
|
: undefined;
|
|
540
543
|
const runtimeValue = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.currentRuntimeValueDotNotation.hidden;
|
|
541
|
-
const effective = (
|
|
544
|
+
const effective = (propStatus !== null && propStatus !== void 0 ? propStatus : runtimeValue);
|
|
542
545
|
return effective !== null && effective !== void 0 ? effective : false;
|
|
543
546
|
}, [codeHiddenStatus, (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.currentRuntimeValueDotNotation]);
|
|
544
547
|
const onToggleVisibility = (0, react_1.useCallback)((type) => {
|
|
545
548
|
if (!sequence.controls ||
|
|
546
549
|
!nodePath ||
|
|
547
550
|
!validatedLocation ||
|
|
548
|
-
!
|
|
551
|
+
!propStatusesForOverride ||
|
|
549
552
|
!codeHiddenStatus ||
|
|
550
553
|
codeHiddenStatus.status !== 'static' ||
|
|
551
554
|
previewServerState.type !== 'connected') {
|
|
@@ -568,18 +571,18 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
568
571
|
schema,
|
|
569
572
|
},
|
|
570
573
|
],
|
|
571
|
-
|
|
574
|
+
setPropStatuses,
|
|
572
575
|
clientId: previewServerState.clientId,
|
|
573
576
|
undoLabel: newValue ? 'Hide sequence' : 'Show sequence',
|
|
574
577
|
redoLabel: newValue ? 'Hide sequence again' : 'Show sequence again',
|
|
575
578
|
});
|
|
576
579
|
}, [
|
|
577
580
|
codeHiddenStatus,
|
|
578
|
-
|
|
581
|
+
propStatusesForOverride,
|
|
579
582
|
nodePath,
|
|
580
583
|
previewServerState,
|
|
581
584
|
sequence.controls,
|
|
582
|
-
|
|
585
|
+
setPropStatuses,
|
|
583
586
|
validatedLocation,
|
|
584
587
|
]);
|
|
585
588
|
const outerHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getTimelineLayerHeight)(sequence.type) + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM, [sequence.type]);
|
|
@@ -623,7 +626,9 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
623
626
|
};
|
|
624
627
|
}, [sequenceDropIndicator]);
|
|
625
628
|
const onEffectDragOver = (0, react_1.useCallback)((e) => {
|
|
626
|
-
if (!canDropEffect ||
|
|
629
|
+
if (!canDropEffect ||
|
|
630
|
+
isSequenceReorderDrag(e.dataTransfer) ||
|
|
631
|
+
!hasEffectDragType(e.dataTransfer)) {
|
|
627
632
|
return;
|
|
628
633
|
}
|
|
629
634
|
e.preventDefault();
|
|
@@ -640,7 +645,9 @@ const TimelineSequenceItem = ({ nestedDepth, sequence, nodePathInfo, keyframeDis
|
|
|
640
645
|
if (!canDropEffect ||
|
|
641
646
|
previewServerState.type !== 'connected' ||
|
|
642
647
|
nodePath === null ||
|
|
643
|
-
validatedLocation === null
|
|
648
|
+
validatedLocation === null ||
|
|
649
|
+
isSequenceReorderDrag(e.dataTransfer) ||
|
|
650
|
+
!hasEffectDragType(e.dataTransfer)) {
|
|
644
651
|
return;
|
|
645
652
|
}
|
|
646
653
|
e.preventDefault();
|
|
@@ -37,7 +37,7 @@ const isResettableStatus = ({ status, defaultValue, }) => {
|
|
|
37
37
|
const effectiveCodeValue = (_a = status.codeValue) !== null && _a !== void 0 ? _a : defaultValue;
|
|
38
38
|
return JSON.stringify(effectiveCodeValue) !== JSON.stringify(defaultValue);
|
|
39
39
|
};
|
|
40
|
-
const Value = ({ field, nodePath, validatedLocation, schema,
|
|
40
|
+
const Value = ({ field, nodePath, validatedLocation, schema, propStatus }) => {
|
|
41
41
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
42
42
|
const { setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
43
43
|
const dragOverrideValue = (0, react_1.useMemo)(() => {
|
|
@@ -47,12 +47,12 @@ const Value = ({ field, nodePath, validatedLocation, schema, codeValue }) => {
|
|
|
47
47
|
: ((_a = getDragOverrides(nodePath)) !== null && _a !== void 0 ? _a : {})[field.key];
|
|
48
48
|
}, [getDragOverrides, nodePath, field.key]);
|
|
49
49
|
const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
50
|
-
|
|
50
|
+
propStatus,
|
|
51
51
|
dragOverrideValue,
|
|
52
52
|
defaultValue: field.fieldSchema.default,
|
|
53
53
|
shouldResortToDefaultValueIfUndefined: true,
|
|
54
54
|
});
|
|
55
|
-
const {
|
|
55
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
56
56
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
57
57
|
const clientId = previewServerState.type === 'connected'
|
|
58
58
|
? previewServerState.clientId
|
|
@@ -67,11 +67,11 @@ const Value = ({ field, nodePath, validatedLocation, schema, codeValue }) => {
|
|
|
67
67
|
: null;
|
|
68
68
|
const stringifiedValue = JSON.stringify(value);
|
|
69
69
|
const fieldLabel = (_a = field.description) !== null && _a !== void 0 ? _a : field.key;
|
|
70
|
-
if (value ===
|
|
70
|
+
if (value === propStatus.codeValue) {
|
|
71
71
|
return Promise.resolve();
|
|
72
72
|
}
|
|
73
73
|
if (defaultValue === stringifiedValue &&
|
|
74
|
-
|
|
74
|
+
propStatus.codeValue === undefined) {
|
|
75
75
|
return Promise.resolve();
|
|
76
76
|
}
|
|
77
77
|
return (0, save_sequence_prop_1.saveSequenceProps)({
|
|
@@ -85,20 +85,20 @@ const Value = ({ field, nodePath, validatedLocation, schema, codeValue }) => {
|
|
|
85
85
|
schema,
|
|
86
86
|
},
|
|
87
87
|
],
|
|
88
|
-
|
|
88
|
+
setPropStatuses,
|
|
89
89
|
clientId,
|
|
90
90
|
undoLabel: `Update ${fieldLabel}`,
|
|
91
91
|
redoLabel: `Update ${fieldLabel} again`,
|
|
92
92
|
});
|
|
93
93
|
}, [
|
|
94
|
-
|
|
94
|
+
propStatus,
|
|
95
95
|
clientId,
|
|
96
96
|
field.description,
|
|
97
97
|
field.fieldSchema.default,
|
|
98
98
|
field.key,
|
|
99
99
|
nodePath,
|
|
100
100
|
schema,
|
|
101
|
-
|
|
101
|
+
setPropStatuses,
|
|
102
102
|
validatedLocation,
|
|
103
103
|
]);
|
|
104
104
|
const onDragValueChange = (0, react_1.useCallback)((value) => {
|
|
@@ -113,36 +113,36 @@ const Value = ({ field, nodePath, validatedLocation, schema, codeValue }) => {
|
|
|
113
113
|
}
|
|
114
114
|
clearDragOverrides(nodePath);
|
|
115
115
|
}, [clearDragOverrides, nodePath]);
|
|
116
|
-
return (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus:
|
|
116
|
+
return (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: propStatus, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, effectiveValue: effectiveValue, scaleLockNodePath: nodePath }));
|
|
117
117
|
};
|
|
118
118
|
const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath, nodePathInfo, schema, keyframeDisplayOffset, }) => {
|
|
119
119
|
var _a, _b;
|
|
120
|
-
const {
|
|
120
|
+
const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
121
121
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
122
|
-
const {
|
|
122
|
+
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
123
123
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
124
124
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
125
125
|
const selection = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
|
|
126
126
|
const clientId = previewServerState.type === 'connected'
|
|
127
127
|
? previewServerState.clientId
|
|
128
128
|
: null;
|
|
129
|
-
const
|
|
130
|
-
const
|
|
129
|
+
const propStatusesForOverride = remotion_1.Internals.getPropStatusesCtx(visualModePropStatuses, nodePath);
|
|
130
|
+
const propStatus = (_a = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride[field.key]) !== null && _a !== void 0 ? _a : null;
|
|
131
131
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
132
132
|
const jsxFrame = timelinePosition - keyframeDisplayOffset;
|
|
133
133
|
const dragOverrideValue = (0, react_1.useMemo)(() => {
|
|
134
134
|
var _a;
|
|
135
135
|
return ((_a = getDragOverrides(nodePath)) !== null && _a !== void 0 ? _a : {})[field.key];
|
|
136
136
|
}, [getDragOverrides, nodePath, field.key]);
|
|
137
|
-
const keyframeControls =
|
|
137
|
+
const keyframeControls = propStatus !== null &&
|
|
138
138
|
(0, TimelineKeyframeControls_1.shouldShowTimelineKeyframeControls)({
|
|
139
|
-
propStatus
|
|
139
|
+
propStatus,
|
|
140
140
|
selected: selection.selected,
|
|
141
141
|
keyframable: (0, studio_shared_1.isSchemaFieldKeyframable)({
|
|
142
142
|
schema,
|
|
143
143
|
key: field.key,
|
|
144
144
|
}),
|
|
145
|
-
}) ? (jsx_runtime_1.jsx(TimelineKeyframeControls_1.TimelineKeyframeControls, { fieldKey: field.key, propStatus:
|
|
145
|
+
}) ? (jsx_runtime_1.jsx(TimelineKeyframeControls_1.TimelineKeyframeControls, { fieldKey: field.key, propStatus: propStatus, nodePath: nodePath, fileName: validatedLocation.source, keyframeDisplayOffset: keyframeDisplayOffset, defaultValue: field.fieldSchema.default, dragOverrideValue: dragOverrideValue, schema: schema, effectIndex: null })) : null;
|
|
146
146
|
const style = (0, react_1.useMemo)(() => {
|
|
147
147
|
return {
|
|
148
148
|
...fieldRowBase,
|
|
@@ -150,24 +150,24 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
150
150
|
};
|
|
151
151
|
}, [field.rowHeight]);
|
|
152
152
|
const canResetToDefault = (0, react_1.useMemo)(() => {
|
|
153
|
-
if (!
|
|
153
|
+
if (!propStatus || propStatus.status === 'computed') {
|
|
154
154
|
return false;
|
|
155
155
|
}
|
|
156
156
|
return isResettableStatus({
|
|
157
|
-
status:
|
|
157
|
+
status: propStatus,
|
|
158
158
|
defaultValue: field.fieldSchema.default,
|
|
159
159
|
});
|
|
160
|
-
}, [
|
|
160
|
+
}, [propStatus, field.fieldSchema.default]);
|
|
161
161
|
const canPerformReset = previewServerState.type === 'connected' &&
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
propStatus !== null &&
|
|
163
|
+
propStatus.status !== 'computed';
|
|
164
164
|
const canShowReset = canPerformReset && field.fieldSchema.default !== undefined;
|
|
165
165
|
const onReset = (0, react_1.useCallback)(() => {
|
|
166
166
|
var _a;
|
|
167
167
|
if (!canShowReset ||
|
|
168
168
|
!canResetToDefault ||
|
|
169
169
|
previewServerState.type !== 'connected' ||
|
|
170
|
-
|
|
170
|
+
propStatus === null) {
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
const defaultValue = field.fieldSchema.default !== undefined
|
|
@@ -185,7 +185,7 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
185
185
|
schema,
|
|
186
186
|
},
|
|
187
187
|
],
|
|
188
|
-
|
|
188
|
+
setPropStatuses,
|
|
189
189
|
clientId: previewServerState.clientId,
|
|
190
190
|
undoLabel: `Reset ${fieldLabel}`,
|
|
191
191
|
redoLabel: `Reapply ${fieldLabel}`,
|
|
@@ -199,9 +199,9 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
199
199
|
nodePath,
|
|
200
200
|
previewServerState,
|
|
201
201
|
schema,
|
|
202
|
-
|
|
202
|
+
setPropStatuses,
|
|
203
203
|
validatedLocation.source,
|
|
204
|
-
|
|
204
|
+
propStatus,
|
|
205
205
|
]);
|
|
206
206
|
const onSaveKeyframed = (0, react_1.useCallback)((value, sourceFrame) => {
|
|
207
207
|
if (!clientId) {
|
|
@@ -214,7 +214,7 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
214
214
|
sourceFrame,
|
|
215
215
|
value,
|
|
216
216
|
schema,
|
|
217
|
-
|
|
217
|
+
setPropStatuses,
|
|
218
218
|
clientId,
|
|
219
219
|
});
|
|
220
220
|
}, [
|
|
@@ -222,25 +222,25 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
222
222
|
field.key,
|
|
223
223
|
nodePath,
|
|
224
224
|
schema,
|
|
225
|
-
|
|
225
|
+
setPropStatuses,
|
|
226
226
|
validatedLocation.source,
|
|
227
227
|
]);
|
|
228
228
|
const onKeyframedDragValueChange = (0, react_1.useCallback)((value) => {
|
|
229
|
-
if (
|
|
229
|
+
if (propStatus === null || !isKeyframedStatus(propStatus)) {
|
|
230
230
|
throw new Error('Expected keyframed status');
|
|
231
231
|
}
|
|
232
232
|
setDragOverrides(nodePath, field.key, remotion_1.Internals.makeKeyframedDragOverride({
|
|
233
|
-
status:
|
|
233
|
+
status: propStatus,
|
|
234
234
|
frame: jsxFrame,
|
|
235
235
|
value,
|
|
236
236
|
}));
|
|
237
|
-
}, [
|
|
237
|
+
}, [propStatus, field.key, jsxFrame, nodePath, setDragOverrides]);
|
|
238
238
|
const onKeyframedDragEnd = (0, react_1.useCallback)(() => {
|
|
239
239
|
clearDragOverrides(nodePath);
|
|
240
240
|
}, [clearDragOverrides, nodePath]);
|
|
241
241
|
const onOpenKeyframeSettings = (0, react_1.useCallback)(() => {
|
|
242
242
|
var _a;
|
|
243
|
-
if (
|
|
243
|
+
if (propStatus === null || !isKeyframedStatus(propStatus)) {
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
246
|
setSelectedModal({
|
|
@@ -249,12 +249,12 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
249
249
|
nodePath,
|
|
250
250
|
fieldKey: field.key,
|
|
251
251
|
fieldLabel: (_a = field.description) !== null && _a !== void 0 ? _a : field.key,
|
|
252
|
-
status:
|
|
252
|
+
status: propStatus,
|
|
253
253
|
schema,
|
|
254
254
|
effectIndex: null,
|
|
255
255
|
});
|
|
256
256
|
}, [
|
|
257
|
-
|
|
257
|
+
propStatus,
|
|
258
258
|
field.description,
|
|
259
259
|
field.key,
|
|
260
260
|
nodePath,
|
|
@@ -277,7 +277,7 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
277
277
|
value: 'reset-sequence-field',
|
|
278
278
|
},
|
|
279
279
|
];
|
|
280
|
-
if (
|
|
280
|
+
if (propStatus !== null && isKeyframedStatus(propStatus)) {
|
|
281
281
|
values.push({
|
|
282
282
|
type: 'item',
|
|
283
283
|
id: 'keyframe-settings-sequence-field',
|
|
@@ -294,16 +294,16 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
294
294
|
return values;
|
|
295
295
|
}, [
|
|
296
296
|
canShowReset,
|
|
297
|
-
|
|
297
|
+
propStatus,
|
|
298
298
|
onOpenKeyframeSettings,
|
|
299
299
|
onReset,
|
|
300
300
|
previewServerState,
|
|
301
301
|
]);
|
|
302
|
-
if (
|
|
302
|
+
if (propStatus === null) {
|
|
303
303
|
return null;
|
|
304
304
|
}
|
|
305
305
|
const row = (jsx_runtime_1.jsxs(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), keyframeControls: keyframeControls, arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: style, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: [
|
|
306
|
-
jsx_runtime_1.jsx(TimelineFieldLabel_1.TimelineFieldLabel, { rowDepth: rowDepth, selected: selection.selected, label: (_b = field.description) !== null && _b !== void 0 ? _b : field.key }), isKeyframedStatus(
|
|
306
|
+
jsx_runtime_1.jsx(TimelineFieldLabel_1.TimelineFieldLabel, { rowDepth: rowDepth, selected: selection.selected, label: (_b = field.description) !== null && _b !== void 0 ? _b : field.key }), isKeyframedStatus(propStatus) ? (jsx_runtime_1.jsx("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: jsx_runtime_1.jsx(TimelineKeyframedValue_1.TimelineKeyframedValue, { field: field, propStatus: propStatus, keyframeDisplayOffset: keyframeDisplayOffset, dragOverrideValue: dragOverrideValue, onSave: onSaveKeyframed, onDragValueChange: onKeyframedDragValueChange, onDragEnd: onKeyframedDragEnd, scaleLockNodePath: nodePath }) })) : propStatus.status === 'static' ? (jsx_runtime_1.jsx("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: jsx_runtime_1.jsx(Value, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, schema: schema, propStatus: propStatus }) })) : (jsx_runtime_1.jsx("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineNonEditableStatus, { propStatus: propStatus }) }))] }));
|
|
307
307
|
return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: selection.selectable ? selection.onSelect : null, children: row }));
|
|
308
308
|
};
|
|
309
309
|
exports.TimelineSequencePropItem = TimelineSequencePropItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { OverrideIdToNodePaths, PropStatuses, SequencePropsSubscriptionKey, TSequence } from 'remotion';
|
|
3
3
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
4
|
import { type SaveSequencePropChange } from './save-sequence-prop';
|
|
5
5
|
import { type TimelineSelection } from './TimelineSelection';
|
|
@@ -29,19 +29,19 @@ export declare const getTimelineSequenceFromDragChanges: ({ targets, deltaFrames
|
|
|
29
29
|
readonly targets: readonly TimelineSequenceFromDragTarget[];
|
|
30
30
|
readonly deltaFrames: number;
|
|
31
31
|
}) => SaveSequencePropChange[];
|
|
32
|
-
export declare const getTimelineSequenceDurationDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths,
|
|
32
|
+
export declare const getTimelineSequenceDurationDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
33
33
|
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
34
34
|
readonly selectedItems: readonly TimelineSelection[];
|
|
35
35
|
readonly sequences: TSequence[];
|
|
36
36
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
37
|
-
readonly
|
|
37
|
+
readonly propStatuses: PropStatuses;
|
|
38
38
|
}) => TimelineSequenceDurationDragTarget[] | null;
|
|
39
|
-
export declare const getTimelineSequenceFromDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths,
|
|
39
|
+
export declare const getTimelineSequenceFromDragTargets: ({ draggedNodePathInfo, selectedItems, sequences, overrideIdsToNodePaths, propStatuses, }: {
|
|
40
40
|
readonly draggedNodePathInfo: SequenceNodePathInfo;
|
|
41
41
|
readonly selectedItems: readonly TimelineSelection[];
|
|
42
42
|
readonly sequences: TSequence[];
|
|
43
43
|
readonly overrideIdsToNodePaths: OverrideIdToNodePaths;
|
|
44
|
-
readonly
|
|
44
|
+
readonly propStatuses: PropStatuses;
|
|
45
45
|
}) => TimelineSequenceFromDragTarget[] | null;
|
|
46
46
|
export declare const useTimelineSequenceFromDrag: ({ nodePathInfo, windowWidth, timelineDurationInFrames, }: {
|
|
47
47
|
readonly nodePathInfo: SequenceNodePathInfo | null;
|