@remotion/studio 4.0.508 → 4.0.510
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Studio.d.ts +5 -0
- package/dist/Studio.js +2 -2
- package/dist/components/Canvas.js +41 -8
- package/dist/components/ColorPicker/AlphaSlider.js +2 -2
- package/dist/components/ColorPicker/HueSlider.js +2 -2
- package/dist/components/ColorPicker/SaturationValueArea.js +2 -2
- package/dist/components/CompositionSelectorItem.js +1 -1
- package/dist/components/EditorGuides/Guide.js +2 -2
- package/dist/components/EditorRuler/index.js +2 -2
- package/dist/components/ExplorerPanel.js +19 -1
- package/dist/components/InspectorOpenInEditor.js +19 -5
- package/dist/components/InspectorPanel/CompositionMetadata.js +23 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +3 -3
- package/dist/components/Menu/MenuItem.js +2 -2
- package/dist/components/ModalContainer.js +1 -1
- package/dist/components/Modals.js +2 -9
- package/dist/components/NewComposition/InputDragger.js +2 -2
- package/dist/components/NewComposition/NewComposition.d.ts +2 -0
- package/dist/components/NewComposition/NewComposition.js +38 -6
- package/dist/components/NewComposition/get-new-composition-defaults.d.ts +1 -1
- package/dist/components/NewComposition/get-new-composition-defaults.js +9 -1
- package/dist/components/QuickSwitcher/asset-search.js +1 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +6 -4
- package/dist/components/SelectedOutlineCropControls.js +3 -3
- package/dist/components/SelectedOutlineElement.js +6 -2
- package/dist/components/SelectedOutlinePolygon.js +4 -3
- package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +5 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.js +4 -4
- package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +1 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.js +4 -4
- package/dist/components/SelectedOutlineTransformOriginHandle.js +2 -2
- package/dist/components/SelectedOutlineUvControls.js +8 -8
- package/dist/components/Splitter/SplitterHandle.js +2 -2
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Timeline/EasingEditorModal.d.ts +8 -0
- package/dist/components/Timeline/EasingEditorModal.js +10 -11
- package/dist/components/Timeline/SubscribeToNodePaths.js +1 -1
- package/dist/components/Timeline/Timeline.js +55 -1
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +99 -35
- package/dist/components/Timeline/TimelineColorField.js +1 -6
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineEffectItem.js +1 -1
- package/dist/components/Timeline/TimelineEffectPropItem.js +8 -1
- package/dist/components/Timeline/TimelineEnumField.js +1 -4
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
- package/dist/components/Timeline/TimelineFieldRowContent.d.ts +2 -1
- package/dist/components/Timeline/TimelineFieldRowContent.js +18 -3
- package/dist/components/Timeline/TimelineFontFamilyField.js +1 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +3 -2
- package/dist/components/Timeline/TimelineLayerEye.js +2 -2
- package/dist/components/Timeline/TimelineNumberField.js +4 -2
- package/dist/components/Timeline/TimelineRotationField.js +3 -3
- package/dist/components/Timeline/TimelineRowChrome.d.ts +5 -0
- package/dist/components/Timeline/TimelineRowChrome.js +14 -9
- package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +1 -0
- package/dist/components/Timeline/TimelineRowLayoutContext.js +4 -1
- package/dist/components/Timeline/TimelineScaleField.js +4 -0
- package/dist/components/Timeline/TimelineSelection.js +2 -2
- package/dist/components/Timeline/TimelineSequenceItem.js +2 -25
- package/dist/components/Timeline/TimelineSequencePropItem.js +8 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +69 -20
- package/dist/components/Timeline/TimelineTextContentField.js +1 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -0
- package/dist/components/Timeline/keyframe-clipboard.d.ts +5 -1
- package/dist/components/Timeline/keyframe-clipboard.js +3 -2
- package/dist/components/Timeline/save-sequence-prop.js +16 -7
- package/dist/components/Timeline/sequence-prop-clipboard.d.ts +31 -0
- package/dist/components/Timeline/sequence-prop-clipboard.js +142 -0
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +0 -1
- package/dist/components/Timeline/split-selected-timeline-item.js +5 -13
- package/dist/components/Timeline/timeline-field-row-layout.js +2 -2
- package/dist/components/Timeline/timeline-field-utils.d.ts +1 -0
- package/dist/components/Timeline/timeline-field-utils.js +6 -1
- package/dist/components/Timeline/update-selected-easing.js +8 -0
- package/dist/components/Timeline/use-open-sequence-in-apps.js +3 -1
- package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +1 -1
- package/dist/components/Timeline/use-resolved-stack-react-to-change.js +24 -3
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +4 -4
- package/dist/components/UndoRedoButtons.js +5 -3
- package/dist/components/folder-menu-items.js +1 -0
- package/dist/components/get-open-in-menu-items.d.ts +4 -1
- package/dist/components/get-open-in-menu-items.js +99 -50
- package/dist/components/import-assets.js +7 -0
- package/dist/components/root-composition-menu-items.js +1 -0
- package/dist/components/selected-outline-control-layout.d.ts +14 -0
- package/dist/components/selected-outline-control-layout.js +94 -0
- package/dist/components/use-default-editor-info.js +28 -3
- package/dist/esm/{chunk-zpn4m49r.js → chunk-axbagh08.js} +6098 -5285
- package/dist/esm/{chunk-fgedsvhb.js → chunk-r46yxrjr.js} +1 -2
- package/dist/esm/internals.mjs +6097 -5284
- package/dist/esm/previewEntry.mjs +5989 -5176
- package/dist/esm/renderEntry.mjs +4 -2
- package/dist/helpers/get-canvas-capture-import.d.ts +7 -0
- package/dist/helpers/get-canvas-capture-import.js +43 -0
- package/dist/helpers/get-git-menu-item.d.ts +1 -1
- package/dist/helpers/get-git-menu-item.js +33 -3
- package/dist/helpers/inserted-element-selection.d.ts +12 -0
- package/dist/helpers/inserted-element-selection.js +29 -0
- package/dist/helpers/open-in-editor.d.ts +1 -0
- package/dist/helpers/open-in-editor.js +5 -1
- package/dist/helpers/pointer-session.d.ts +6 -2
- package/dist/helpers/pointer-session.js +29 -12
- package/dist/helpers/use-create-composition.d.ts +15 -2
- package/dist/helpers/use-create-composition.js +11 -17
- package/dist/helpers/use-menu-structure.js +1 -0
- package/dist/icons/git-client.d.ts +6 -0
- package/dist/icons/git-client.js +8 -0
- package/dist/icons/github.d.ts +4 -0
- package/dist/icons/github.js +11 -0
- package/dist/renderEntry.js +2 -2
- package/dist/state/modals.d.ts +9 -1
- package/dist/state/z-index.d.ts +0 -1
- package/dist/state/z-index.js +27 -33
- package/package.json +12 -12
|
@@ -7,7 +7,15 @@ const defaultCompositionDimensions = {
|
|
|
7
7
|
fps: 30,
|
|
8
8
|
durationInFrames: 150,
|
|
9
9
|
};
|
|
10
|
-
const
|
|
10
|
+
const canvasCaptureFps = 60;
|
|
11
|
+
const getNewCompositionDefaults = (composition, canvasCaptureDurationInSeconds) => {
|
|
12
|
+
if (canvasCaptureDurationInSeconds !== null) {
|
|
13
|
+
return {
|
|
14
|
+
...defaultCompositionDimensions,
|
|
15
|
+
fps: canvasCaptureFps,
|
|
16
|
+
durationInFrames: Math.max(1, Math.ceil(canvasCaptureDurationInSeconds * canvasCaptureFps)),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
11
19
|
return composition !== null && composition !== void 0 ? composition : defaultCompositionDimensions;
|
|
12
20
|
};
|
|
13
21
|
exports.getNewCompositionDefaults = getNewCompositionDefaults;
|
|
@@ -30,6 +30,7 @@ const componentAssetTypes = {
|
|
|
30
30
|
'dev.remotion.media.Audio': 'audio',
|
|
31
31
|
'dev.remotion.media.Video': 'video',
|
|
32
32
|
'dev.remotion.remotion.AnimatedImage': 'image',
|
|
33
|
+
'dev.remotion.remotion.CanvasImage': 'image',
|
|
33
34
|
'dev.remotion.remotion.Img': 'image',
|
|
34
35
|
};
|
|
35
36
|
const getAssetSearchQueryForComponent = (componentIdentity) => {
|
|
@@ -75,6 +75,8 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
75
75
|
if (svg === null) {
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
+
const previousSvgCursor = svg.style.cursor;
|
|
79
|
+
svg.style.cursor = canvas_rotation_cursor_1.canvasRotationCursor;
|
|
78
80
|
const startPointer = { x: event.clientX, y: event.clientY };
|
|
79
81
|
const center = (0, svg_point_to_client_point_1.svgPointToClientPoint)((0, selected_outline_measurement_1.getSelectedOutlineRotationPivot)({
|
|
80
82
|
dimensions: outline.dimensions,
|
|
@@ -104,6 +106,7 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
104
106
|
return;
|
|
105
107
|
}
|
|
106
108
|
dragStarted = true;
|
|
109
|
+
(0, ForceSpecificCursor_1.forceSpecificCursor)(canvas_rotation_cursor_1.canvasRotationCursor);
|
|
107
110
|
onDraggingChange(true);
|
|
108
111
|
}
|
|
109
112
|
if (rotationDrag.transform3DMode) {
|
|
@@ -123,7 +126,6 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
123
126
|
rotationXDeltaDegrees,
|
|
124
127
|
rotationYDeltaDegrees,
|
|
125
128
|
});
|
|
126
|
-
(0, ForceSpecificCursor_1.forceSpecificCursor)(canvas_rotation_cursor_1.canvasRotationCursor);
|
|
127
129
|
}
|
|
128
130
|
else {
|
|
129
131
|
const nextAngle = (0, selected_outline_measurement_1.getAngleDegrees)(center, {
|
|
@@ -145,7 +147,6 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
145
147
|
dragStates,
|
|
146
148
|
rotationDeltaDegrees,
|
|
147
149
|
});
|
|
148
|
-
(0, ForceSpecificCursor_1.forceSpecificCursor)(canvas_rotation_cursor_1.canvasRotationCursor);
|
|
149
150
|
}
|
|
150
151
|
for (const dragState of dragStates) {
|
|
151
152
|
const value = lastValues.get(dragState.key);
|
|
@@ -165,6 +166,7 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
165
166
|
}
|
|
166
167
|
};
|
|
167
168
|
const onPointerUp = () => {
|
|
169
|
+
svg.style.cursor = previousSvgCursor;
|
|
168
170
|
if (dragStarted) {
|
|
169
171
|
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
170
172
|
onDraggingChange(false);
|
|
@@ -213,9 +215,9 @@ const SelectedOutlineCanvasRotation = ({ getLatestTargetByKey, layoutTarget, onD
|
|
|
213
215
|
};
|
|
214
216
|
// The polygon gates pointer-down, while the stable overlay keeps the
|
|
215
217
|
// session alive after the pointer leaves the selected item.
|
|
216
|
-
(0, pointer_session_1.
|
|
218
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
217
219
|
event,
|
|
218
|
-
|
|
220
|
+
captureTarget: svg,
|
|
219
221
|
onMove: onPointerMove,
|
|
220
222
|
onEnd: onPointerUp,
|
|
221
223
|
});
|
|
@@ -268,9 +268,9 @@ const CropHandle = ({ handle, outline, onDraggingChange, target }) => {
|
|
|
268
268
|
clearDragOverrides(cropDrag.nodePath);
|
|
269
269
|
});
|
|
270
270
|
};
|
|
271
|
-
(0, pointer_session_1.
|
|
271
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
272
272
|
event,
|
|
273
|
-
|
|
273
|
+
captureTarget: event.currentTarget,
|
|
274
274
|
onMove: onPointerMove,
|
|
275
275
|
onEnd: onPointerUp,
|
|
276
276
|
});
|
|
@@ -287,7 +287,7 @@ const CropHandle = ({ handle, outline, onDraggingChange, target }) => {
|
|
|
287
287
|
setPropStatuses,
|
|
288
288
|
]);
|
|
289
289
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
290
|
-
jsx_runtime_1.jsx("path", { d: path, fill: "none", stroke: colors_1.TRANSPARENT, strokeWidth: CROP_HANDLE_HIT_WIDTH, strokeLinejoin: "miter", vectorEffect: "non-scaling-stroke", pointerEvents: "stroke", cursor: cursor, onPointerDown: onPointerDown }), jsx_runtime_1.jsx("path", { d: path, fill: "none", stroke: colors_1.BLUE, strokeWidth: CROP_HANDLE_THICKNESS, strokeLinejoin: "miter", strokeLinecap: "butt", vectorEffect: "non-scaling-stroke", pointerEvents: "none"
|
|
290
|
+
jsx_runtime_1.jsx("path", { d: path, fill: "none", stroke: colors_1.TRANSPARENT, strokeWidth: CROP_HANDLE_HIT_WIDTH, strokeLinejoin: "miter", vectorEffect: "non-scaling-stroke", pointerEvents: "stroke", cursor: cursor, onPointerDown: onPointerDown }), jsx_runtime_1.jsx("path", { d: path, fill: "none", stroke: colors_1.BLUE, strokeWidth: CROP_HANDLE_THICKNESS, strokeLinejoin: "miter", strokeLinecap: "butt", vectorEffect: "non-scaling-stroke", pointerEvents: "none" })
|
|
291
291
|
] }));
|
|
292
292
|
};
|
|
293
293
|
const SelectedOutlineCropControls = ({ outline, onDraggingChange, target }) => {
|
|
@@ -50,6 +50,7 @@ const call_api_1 = require("./call-api");
|
|
|
50
50
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
51
51
|
const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
|
|
52
52
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
53
|
+
const selected_outline_control_layout_1 = require("./selected-outline-control-layout");
|
|
53
54
|
const selected_outline_types_1 = require("./selected-outline-types");
|
|
54
55
|
const SelectedOutlineCanvasRotation_1 = require("./SelectedOutlineCanvasRotation");
|
|
55
56
|
const SelectedOutlineCropControls_1 = require("./SelectedOutlineCropControls");
|
|
@@ -80,6 +81,7 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
80
81
|
const { setManuallyEnabled } = (0, react_1.useContext)(transform_3d_mode_1.Transform3DModeStateContext);
|
|
81
82
|
const setHoveredSequence = (0, timeline_sequence_hover_1.useSetTimelineSequenceHover)();
|
|
82
83
|
const targetRef = (0, react_1.useRef)(layoutTarget);
|
|
84
|
+
const controlLayout = (0, react_1.useMemo)(() => (0, selected_outline_control_layout_1.getSelectedOutlineControlLayout)(outline.points), [outline.points]);
|
|
83
85
|
(0, react_1.useLayoutEffect)(() => {
|
|
84
86
|
targetRef.current = layoutTarget;
|
|
85
87
|
}, [layoutTarget]);
|
|
@@ -391,10 +393,12 @@ const SelectedOutlineElementUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
391
393
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
392
394
|
jsx_runtime_1.jsx(SelectedOutlinePolygon_1.SelectedOutlinePolygon, { compositionHeight: compositionHeight, compositionWidth: compositionWidth, dragging: dragging, getAllDragOutlines: getAllDragOutlines, getAllDragTargets: getAllDragTargets, getLayoutTarget: getLayoutTarget, getTarget: getTarget, hasTarget: layoutTarget !== undefined, hovered: hovered, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: onSelect, onDoubleClickTarget: onDoubleClickTarget, scale: scale, showSelectedOutline: (_a = layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.showSelectedOutline) !== null && _a !== void 0 ? _a : false }), (layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.selectedForRotation) && (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.rotationDrag) ? (jsx_runtime_1.jsx(SelectedOutlineCanvasRotation_1.SelectedOutlineCanvasRotation, { getLatestTargetByKey: getLatestTargetByKey, layoutTarget: layoutTarget, onDraggingChange: onDraggingChange, outline: outline })) : null, jsx_runtime_1.jsx(SelectedOutlineCropControls_1.SelectedOutlineCropControls, { outline: outline, onDraggingChange: onDraggingChange, target: controlTarget }), (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
393
395
|
((layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) || hovered)
|
|
394
|
-
?
|
|
396
|
+
? controlLayout.scaleEdges.map((edge) => (jsx_runtime_1.jsx(SelectedOutlineScaleEdgeLine_1.SelectedOutlineScaleEdgeLine, { getAllScaleDragTargets: getAllScaleDragTargets, dragging: dragging, edge: edge, hitWidth: edge === 'top' || edge === 'bottom'
|
|
397
|
+
? controlLayout.scaleHitWidth.horizontal
|
|
398
|
+
: controlLayout.scaleHitWidth.vertical, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, target: controlTarget }, edge)))
|
|
395
399
|
: null, (controlTarget === null || controlTarget === void 0 ? void 0 : controlTarget.cropDrag) === null &&
|
|
396
400
|
((layoutTarget === null || layoutTarget === void 0 ? void 0 : layoutTarget.containsSelection) || hovered)
|
|
397
|
-
?
|
|
401
|
+
? controlLayout.rotationCorners.map(({ corner, point }) => (jsx_runtime_1.jsx(SelectedOutlineRotationCornerHandle_1.SelectedOutlineRotationCornerHandle, { getAllRotationDragTargets: getAllRotationDragTargets, corner: corner, dragging: dragging, handlePoint: point, outline: outline, onContextMenuOpen: onContextMenuOpen, onContextMenuOpenChange: onContextMenuOpenChange, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSelect: onSelect, radius: controlLayout.rotationHandleRadius, target: controlTarget }, corner)))
|
|
398
402
|
: null] }));
|
|
399
403
|
};
|
|
400
404
|
exports.SelectedOutlineElement = react_1.default.memo(SelectedOutlineElementUnmemoized);
|
|
@@ -55,6 +55,7 @@ const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
|
55
55
|
const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
56
56
|
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
57
57
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
58
|
+
const should_clear_selection_on_pointer_down_1 = require("./Timeline/should-clear-selection-on-pointer-down");
|
|
58
59
|
const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth, dragging, getAllDragOutlines, getAllDragTargets, getLayoutTarget, getTarget, hasTarget, hovered, onContextMenuOpen, onContextMenuOpenChange, outline, onDraggingChange, onHoverChange, onSnapPointsChange, onSelect, onDoubleClickTarget, scale, showSelectedOutline, }) => {
|
|
59
60
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
60
61
|
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
@@ -259,9 +260,9 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
259
260
|
(0, selected_outline_drag_1.clearSelectedOutlineDragOverrides)({ clearDragOverrides, dragStates });
|
|
260
261
|
});
|
|
261
262
|
};
|
|
262
|
-
(0, pointer_session_1.
|
|
263
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
263
264
|
event,
|
|
264
|
-
|
|
265
|
+
captureTarget: event.currentTarget,
|
|
265
266
|
onMove: onPointerMove,
|
|
266
267
|
onEnd: onPointerUp,
|
|
267
268
|
});
|
|
@@ -346,7 +347,7 @@ const SelectedOutlinePolygonUnmemoized = ({ compositionHeight, compositionWidth,
|
|
|
346
347
|
});
|
|
347
348
|
}, [getEffectDropTarget]);
|
|
348
349
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
349
|
-
jsx_runtime_1.jsx("polygon", { ref: polygonRef, points: points, fill: effectDropHovered ? colors_1.TIMELINE_DROP_BLUE_ALPHA_12 : colors_1.TRANSPARENT, stroke: colors_1.BLUE, strokeOpacity: visible || effectDropHovered ? 1 : 0, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: hasTarget ? 'all' : undefined, onPointerEnter: () => {
|
|
350
|
+
jsx_runtime_1.jsx("polygon", { ref: polygonRef, [should_clear_selection_on_pointer_down_1.PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR]: 'true', points: points, fill: effectDropHovered ? colors_1.TIMELINE_DROP_BLUE_ALPHA_12 : colors_1.TRANSPARENT, stroke: colors_1.BLUE, strokeOpacity: visible || effectDropHovered ? 1 : 0, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: hasTarget ? 'all' : undefined, onPointerEnter: () => {
|
|
350
351
|
if (!dragging) {
|
|
351
352
|
onHoverChange(outline.key);
|
|
352
353
|
}
|
|
@@ -7,11 +7,16 @@ export declare const SelectedOutlineRotationCornerHandle: React.FC<{
|
|
|
7
7
|
readonly getAllRotationDragTargets: () => readonly SelectedOutlineRotationDragTarget[];
|
|
8
8
|
readonly corner: SelectedOutlineRotationCorner;
|
|
9
9
|
readonly dragging: boolean;
|
|
10
|
+
readonly handlePoint: {
|
|
11
|
+
readonly x: number;
|
|
12
|
+
readonly y: number;
|
|
13
|
+
};
|
|
10
14
|
readonly outline: SelectedOutline;
|
|
11
15
|
readonly onDraggingChange: (dragging: boolean) => void;
|
|
12
16
|
readonly onContextMenuOpen: SelectedOutlineContextMenuOpenHandler;
|
|
13
17
|
readonly onContextMenuOpenChange: (open: boolean) => void;
|
|
14
18
|
readonly onHoverChange: (key: string | null) => void;
|
|
15
19
|
readonly onSelect: (item: TimelineSelection, interaction: TimelineSelectionInteraction) => void;
|
|
20
|
+
readonly radius: number;
|
|
16
21
|
readonly target: SelectedOutlineTarget | undefined;
|
|
17
22
|
}>;
|
|
@@ -51,7 +51,7 @@ const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
|
51
51
|
const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
52
52
|
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
53
53
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
54
|
-
const SelectedOutlineRotationCornerHandle = ({ getAllRotationDragTargets, corner, dragging, outline, onDraggingChange, onContextMenuOpen, onContextMenuOpenChange, onHoverChange, onSelect, target, }) => {
|
|
54
|
+
const SelectedOutlineRotationCornerHandle = ({ getAllRotationDragTargets, corner, dragging, handlePoint, outline, onDraggingChange, onContextMenuOpen, onContextMenuOpenChange, onHoverChange, onSelect, radius, target, }) => {
|
|
55
55
|
var _a, _b, _c;
|
|
56
56
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
57
57
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -227,9 +227,9 @@ const SelectedOutlineRotationCornerHandle = ({ getAllRotationDragTargets, corner
|
|
|
227
227
|
});
|
|
228
228
|
});
|
|
229
229
|
};
|
|
230
|
-
(0, pointer_session_1.
|
|
230
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
231
231
|
event,
|
|
232
|
-
|
|
232
|
+
captureTarget: event.currentTarget,
|
|
233
233
|
onMove: onPointerMove,
|
|
234
234
|
onEnd: onPointerUp,
|
|
235
235
|
});
|
|
@@ -257,7 +257,7 @@ const SelectedOutlineRotationCornerHandle = ({ getAllRotationDragTargets, corner
|
|
|
257
257
|
return null;
|
|
258
258
|
}
|
|
259
259
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
260
|
-
jsx_runtime_1.jsx("circle", { ref: circleRef, cx:
|
|
260
|
+
jsx_runtime_1.jsx("circle", { ref: circleRef, cx: handlePoint.x, cy: handlePoint.y, r: radius, fill: colors_1.TRANSPARENT, stroke: colors_1.TRANSPARENT, vectorEffect: "non-scaling-stroke", pointerEvents: "all", cursor: cornerInfo.cursor, "data-remotion-studio-rotation-corner": corner, "data-remotion-studio-rotation-corner-contains-selection": containsSelection, onPointerEnter: () => {
|
|
261
261
|
if (!dragging) {
|
|
262
262
|
onHoverChange(outline.key);
|
|
263
263
|
}
|
|
@@ -7,6 +7,7 @@ export declare const SelectedOutlineScaleEdgeLine: React.FC<{
|
|
|
7
7
|
readonly getAllScaleDragTargets: () => readonly SelectedOutlineScaleDragTarget[];
|
|
8
8
|
readonly dragging: boolean;
|
|
9
9
|
readonly edge: SelectedOutlineScaleEdge;
|
|
10
|
+
readonly hitWidth: number;
|
|
10
11
|
readonly outline: SelectedOutline;
|
|
11
12
|
readonly onDraggingChange: (dragging: boolean) => void;
|
|
12
13
|
readonly onContextMenuOpen: SelectedOutlineContextMenuOpenHandler;
|
|
@@ -49,7 +49,7 @@ const call_add_keyframe_1 = require("./Timeline/call-add-keyframe");
|
|
|
49
49
|
const focus_inspector_field_1 = require("./Timeline/focus-inspector-field");
|
|
50
50
|
const imperative_state_1 = require("./Timeline/imperative-state");
|
|
51
51
|
const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
|
|
52
|
-
const SelectedOutlineScaleEdgeLine = ({ getAllScaleDragTargets, dragging, edge, outline, onDraggingChange, onContextMenuOpen, onContextMenuOpenChange, onHoverChange, onSelect, target, }) => {
|
|
52
|
+
const SelectedOutlineScaleEdgeLine = ({ getAllScaleDragTargets, dragging, edge, hitWidth, outline, onDraggingChange, onContextMenuOpen, onContextMenuOpenChange, onHoverChange, onSelect, target, }) => {
|
|
53
53
|
var _a, _b, _c, _d;
|
|
54
54
|
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
55
55
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
@@ -177,9 +177,9 @@ const SelectedOutlineScaleEdgeLine = ({ getAllScaleDragTargets, dragging, edge,
|
|
|
177
177
|
});
|
|
178
178
|
});
|
|
179
179
|
};
|
|
180
|
-
(0, pointer_session_1.
|
|
180
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
181
181
|
event,
|
|
182
|
-
|
|
182
|
+
captureTarget: event.currentTarget,
|
|
183
183
|
onMove: onPointerMove,
|
|
184
184
|
onEnd: onPointerUp,
|
|
185
185
|
});
|
|
@@ -201,7 +201,7 @@ const SelectedOutlineScaleEdgeLine = ({ getAllScaleDragTargets, dragging, edge,
|
|
|
201
201
|
return null;
|
|
202
202
|
}
|
|
203
203
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
204
|
-
jsx_runtime_1.jsx("line", { ref: lineRef, x1: edgeInfo.start.x, y1: edgeInfo.start.y, x2: edgeInfo.end.x, y2: edgeInfo.end.y, stroke: colors_1.TRANSPARENT, strokeWidth:
|
|
204
|
+
jsx_runtime_1.jsx("line", { ref: lineRef, x1: edgeInfo.start.x, y1: edgeInfo.start.y, x2: edgeInfo.end.x, y2: edgeInfo.end.y, stroke: colors_1.TRANSPARENT, strokeWidth: hitWidth, strokeLinecap: "butt", vectorEffect: "non-scaling-stroke", pointerEvents: "stroke", cursor: edgeInfo.cursor, "data-remotion-studio-scale-edge": edge, "data-remotion-studio-scale-edge-contains-selection": (_d = target === null || target === void 0 ? void 0 : target.containsSelection) !== null && _d !== void 0 ? _d : false, onPointerEnter: () => {
|
|
205
205
|
if (!dragging) {
|
|
206
206
|
onHoverChange(outline.key);
|
|
207
207
|
}
|
|
@@ -279,9 +279,9 @@ const SelectedOutlineTransformOriginHandle = ({ getLatestTargetByKey, layoutTarg
|
|
|
279
279
|
clearDragOverrides(transformOriginDrag.nodePath);
|
|
280
280
|
});
|
|
281
281
|
};
|
|
282
|
-
(0, pointer_session_1.
|
|
282
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
283
283
|
event,
|
|
284
|
-
|
|
284
|
+
captureTarget: event.currentTarget,
|
|
285
285
|
onMove: onPointerMove,
|
|
286
286
|
onEnd: onPointerUp,
|
|
287
287
|
});
|
|
@@ -236,9 +236,9 @@ const SelectedUvEllipseStartHandle = ({ control, onDraggingChange, outline }) =>
|
|
|
236
236
|
sourceFrame: control.handle.sourceFrame,
|
|
237
237
|
});
|
|
238
238
|
};
|
|
239
|
-
(0, pointer_session_1.
|
|
239
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
240
240
|
event,
|
|
241
|
-
|
|
241
|
+
captureTarget: event.currentTarget,
|
|
242
242
|
onMove: onPointerMove,
|
|
243
243
|
onEnd: onPointerUp,
|
|
244
244
|
});
|
|
@@ -336,9 +336,9 @@ const SelectedUvEllipseResizeHandle = ({ axis, control, onDraggingChange, outlin
|
|
|
336
336
|
sourceFrame: control.handle.sourceFrame,
|
|
337
337
|
});
|
|
338
338
|
};
|
|
339
|
-
(0, pointer_session_1.
|
|
339
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
340
340
|
event,
|
|
341
|
-
|
|
341
|
+
captureTarget: event.currentTarget,
|
|
342
342
|
onMove: onPointerMove,
|
|
343
343
|
onEnd: onPointerUp,
|
|
344
344
|
});
|
|
@@ -491,9 +491,9 @@ const SelectedUvEllipseRotationHandle = ({ control, onDraggingChange }) => {
|
|
|
491
491
|
sourceFrame: control.handle.sourceFrame,
|
|
492
492
|
});
|
|
493
493
|
};
|
|
494
|
-
(0, pointer_session_1.
|
|
494
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
495
495
|
event,
|
|
496
|
-
|
|
496
|
+
captureTarget: event.currentTarget,
|
|
497
497
|
onMove: onPointerMove,
|
|
498
498
|
onEnd: onPointerUp,
|
|
499
499
|
});
|
|
@@ -645,9 +645,9 @@ const SelectedUvHandleCircle = ({ handle, nodePathInfo, onDraggingChange, onSele
|
|
|
645
645
|
clearEffectDragOverrides(handle.nodePath, handle.effectIndex);
|
|
646
646
|
});
|
|
647
647
|
};
|
|
648
|
-
(0, pointer_session_1.
|
|
648
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
649
649
|
event,
|
|
650
|
-
|
|
650
|
+
captureTarget: event.currentTarget,
|
|
651
651
|
onMove: onPointerMove,
|
|
652
652
|
onEnd: onPointerUp,
|
|
653
653
|
});
|
|
@@ -96,9 +96,9 @@ const SplitterHandle = ({ allowToCollapse, onCollapse }) => {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
endDrag = (0, pointer_session_1.
|
|
99
|
+
endDrag = (0, pointer_session_1.startCapturedPointerSession)({
|
|
100
100
|
event: e,
|
|
101
|
-
|
|
101
|
+
captureTarget: current,
|
|
102
102
|
onMove: onPointerMove,
|
|
103
103
|
onEnd: (reason, endEvent) => {
|
|
104
104
|
if ((reason === 'pointerup' || reason === 'buttons-released') &&
|
|
@@ -5,6 +5,8 @@ export declare const Tabs: React.FC<{
|
|
|
5
5
|
}>;
|
|
6
6
|
export declare const Tab: React.FC<{
|
|
7
7
|
readonly children: React.ReactNode;
|
|
8
|
+
readonly onDragEnter?: React.DragEventHandler<HTMLDivElement>;
|
|
9
|
+
readonly onDragLeave?: React.DragEventHandler<HTMLDivElement>;
|
|
8
10
|
readonly onClick: React.MouseEventHandler<HTMLDivElement>;
|
|
9
11
|
readonly style?: React.CSSProperties;
|
|
10
12
|
readonly selected: boolean;
|
|
@@ -34,7 +34,7 @@ const selectorButton = {
|
|
|
34
34
|
userSelect: 'none',
|
|
35
35
|
WebkitUserSelect: 'none',
|
|
36
36
|
};
|
|
37
|
-
const Tab = ({ children, onClick, style, selected }) => {
|
|
37
|
+
const Tab = ({ children, onClick, onDragEnter, onDragLeave, style, selected }) => {
|
|
38
38
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
39
39
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
40
40
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
@@ -55,6 +55,6 @@ const Tab = ({ children, onClick, style, selected }) => {
|
|
|
55
55
|
boxShadow: selected ? 'none' : undefined,
|
|
56
56
|
...style,
|
|
57
57
|
}), [hovered, selected, style]);
|
|
58
|
-
return (jsx_runtime_1.jsx("div", { style: definiteStyle, role: "button", onClick: onClick, tabIndex: tabIndex, onPointerLeave: onPointerLeave, onPointerEnter: onPointerEnter, children: children }));
|
|
58
|
+
return (jsx_runtime_1.jsx("div", { style: definiteStyle, role: "button", onClick: onClick, onDragEnter: onDragEnter, onDragLeave: onDragLeave, tabIndex: tabIndex, onPointerLeave: onPointerLeave, onPointerEnter: onPointerEnter, children: children }));
|
|
59
59
|
};
|
|
60
60
|
exports.Tab = Tab;
|
|
@@ -2,6 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import type { SegmentedControlItem } from '../SegmentedControl';
|
|
3
3
|
import type { TimelineSelection } from './TimelineSelection';
|
|
4
4
|
import type { TimelineEasingValue } from './update-selected-easing';
|
|
5
|
+
export declare const EasingPresetPreview: React.FC<{
|
|
6
|
+
readonly color: string;
|
|
7
|
+
readonly easing: TimelineEasingValue;
|
|
8
|
+
readonly height?: number;
|
|
9
|
+
readonly nonScalingStroke?: boolean;
|
|
10
|
+
readonly strokeWidth?: number;
|
|
11
|
+
readonly width?: number;
|
|
12
|
+
}>;
|
|
5
13
|
export type EasingEditorState = {
|
|
6
14
|
initialEasing: TimelineEasingValue;
|
|
7
15
|
selections: TimelineSelection[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EasingEditor = void 0;
|
|
3
|
+
exports.EasingEditor = exports.EasingPresetPreview = 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");
|
|
@@ -110,8 +110,6 @@ const presetButtonBase = {
|
|
|
110
110
|
};
|
|
111
111
|
const presetPreviewSvgStyle = {
|
|
112
112
|
display: 'block',
|
|
113
|
-
height: PRESET_PREVIEW_HEIGHT,
|
|
114
|
-
width: PRESET_PREVIEW_WIDTH,
|
|
115
113
|
};
|
|
116
114
|
const coordinatesGridBase = {
|
|
117
115
|
display: 'grid',
|
|
@@ -363,6 +361,11 @@ const getPresetPreviewPath = (easing) => {
|
|
|
363
361
|
}
|
|
364
362
|
return points.join(' ');
|
|
365
363
|
};
|
|
364
|
+
const EasingPresetPreview = ({ color, easing, height = PRESET_PREVIEW_HEIGHT, nonScalingStroke = false, strokeWidth = 2, width = PRESET_PREVIEW_WIDTH, }) => {
|
|
365
|
+
const path = (0, react_1.useMemo)(() => getPresetPreviewPath(easing), [easing]);
|
|
366
|
+
return (jsx_runtime_1.jsx("svg", { width: width, height: height, viewBox: `0 0 ${PRESET_PREVIEW_WIDTH} ${PRESET_PREVIEW_HEIGHT}`, style: presetPreviewSvgStyle, "aria-hidden": "true", focusable: false, children: jsx_runtime_1.jsx("path", { d: path, fill: "none", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: nonScalingStroke ? 'non-scaling-stroke' : undefined }) }));
|
|
367
|
+
};
|
|
368
|
+
exports.EasingPresetPreview = EasingPresetPreview;
|
|
366
369
|
const pointFromBezier = (bezier, handle) => {
|
|
367
370
|
const x = handle === 0 ? bezier[0] : bezier[2];
|
|
368
371
|
const y = handle === 0 ? bezier[1] : bezier[3];
|
|
@@ -401,7 +404,6 @@ const EasingGraphScaffold = ({ labels }) => {
|
|
|
401
404
|
const EasingPresetButton = ({ currentEasing, disabled, onClick, preset }) => {
|
|
402
405
|
const selected = areEasingsEqual(currentEasing, preset.easing);
|
|
403
406
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
404
|
-
const path = (0, react_1.useMemo)(() => getPresetPreviewPath(preset.easing), [preset.easing]);
|
|
405
407
|
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
406
408
|
setHovered(true);
|
|
407
409
|
}, []);
|
|
@@ -417,7 +419,7 @@ const EasingPresetButton = ({ currentEasing, disabled, onClick, preset }) => {
|
|
|
417
419
|
const handleClick = (0, react_1.useCallback)(() => {
|
|
418
420
|
onClick(preset.easing);
|
|
419
421
|
}, [onClick, preset.easing]);
|
|
420
|
-
return (jsx_runtime_1.jsx("button", { type: "button", style: style, title: preset.label, "aria-label": `Apply ${preset.label} easing`, disabled: disabled, onClick: handleClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: jsx_runtime_1.jsx(
|
|
422
|
+
return (jsx_runtime_1.jsx("button", { type: "button", style: style, title: preset.label, "aria-label": `Apply ${preset.label} easing`, disabled: disabled, onClick: handleClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: jsx_runtime_1.jsx(exports.EasingPresetPreview, { color: selected || hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, easing: preset.easing }) }));
|
|
421
423
|
};
|
|
422
424
|
const EasingEditor = ({ state, renderHeader }) => {
|
|
423
425
|
var _a, _b;
|
|
@@ -434,7 +436,6 @@ const EasingEditor = ({ state, renderHeader }) => {
|
|
|
434
436
|
const springRef = (0, react_1.useRef)(spring);
|
|
435
437
|
const liveOverrideVersionRef = (0, react_1.useRef)(0);
|
|
436
438
|
const pendingOverrideTargetsRef = (0, react_1.useRef)([]);
|
|
437
|
-
const [activeHandle, setActiveHandle] = (0, react_1.useState)(null);
|
|
438
439
|
(0, react_1.useEffect)(() => {
|
|
439
440
|
const nextBezier = easingToBezier(state.initialEasing);
|
|
440
441
|
const nextSpring = easingToSpring(state.initialEasing);
|
|
@@ -679,11 +680,10 @@ const EasingEditor = ({ state, renderHeader }) => {
|
|
|
679
680
|
event.preventDefault();
|
|
680
681
|
event.stopPropagation();
|
|
681
682
|
const bezierBeforeDrag = [...bezierRef.current];
|
|
682
|
-
setActiveHandle(handle);
|
|
683
683
|
updateHandleFromPointer(handle, event);
|
|
684
|
-
(0, pointer_session_1.
|
|
684
|
+
(0, pointer_session_1.startCapturedPointerSession)({
|
|
685
685
|
event,
|
|
686
|
-
|
|
686
|
+
captureTarget: event.currentTarget,
|
|
687
687
|
onMove: (moveEvent) => {
|
|
688
688
|
updateHandleFromPointer(handle, moveEvent);
|
|
689
689
|
},
|
|
@@ -697,7 +697,6 @@ const EasingEditor = ({ state, renderHeader }) => {
|
|
|
697
697
|
bezierRef.current = bezierBeforeDrag;
|
|
698
698
|
setBezier(bezierBeforeDrag);
|
|
699
699
|
}
|
|
700
|
-
setActiveHandle(null);
|
|
701
700
|
},
|
|
702
701
|
});
|
|
703
702
|
}, [
|
|
@@ -777,7 +776,7 @@ const EasingEditor = ({ state, renderHeader }) => {
|
|
|
777
776
|
const modeSwitcher = (jsx_runtime_1.jsx("div", { style: segmentedControlWrapper, children: jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: modeItems, needsWrapping: false }) }));
|
|
778
777
|
return (jsx_runtime_1.jsxs("div", { style: inlineContainer, children: [renderHeader ? renderHeader(modeItems) : null, jsx_runtime_1.jsx("div", { style: renderHeader ? inspectorPresetButtonsWrapper : presetButtonsWrapper, children: EDITOR_EASING_PRESETS.map((preset) => (jsx_runtime_1.jsx(EasingPresetButton, { currentEasing: currentEasing, disabled: disabled, onClick: applyPreset, preset: preset }, preset.id))) }), mode === 'bezier' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
779
778
|
jsx_runtime_1.jsxs("svg", { ref: svgRef, width: SVG_WIDTH, height: SVG_HEIGHT, viewBox: `0 0 ${SVG_WIDTH} ${SVG_HEIGHT}`, style: svgStyle, "aria-label": "Bezier curve editor", children: [
|
|
780
|
-
jsx_runtime_1.jsx(EasingGraphScaffold, { labels: graphLabels }), jsx_runtime_1.jsx("line", { x1: startPoint.x, y1: startPoint.y, x2: firstHandle.x, y2: firstHandle.y, stroke: colors_1.WHITE_ALPHA_35, strokeWidth: 1 }), jsx_runtime_1.jsx("line", { x1: endPoint.x, y1: endPoint.y, x2: secondHandle.x, y2: secondHandle.y, stroke: colors_1.WHITE_ALPHA_35, strokeWidth: 1 }), jsx_runtime_1.jsx("path", { d: bezierPath, fill: "none", stroke: colors_1.BLUE, strokeWidth: 3 }), jsx_runtime_1.jsx("circle", { cx: startPoint.x, cy: startPoint.y, r: 4, fill: colors_1.WHITE }), jsx_runtime_1.jsx("circle", { cx: endPoint.x, cy: endPoint.y, r: 4, fill: colors_1.WHITE }), jsx_runtime_1.jsx("circle", { cx: firstHandle.x, cy: firstHandle.y, r: 6, fill: colors_1.WHITE, stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: disabled ? 'none' : 'all', cursor:
|
|
779
|
+
jsx_runtime_1.jsx(EasingGraphScaffold, { labels: graphLabels }), jsx_runtime_1.jsx("line", { x1: startPoint.x, y1: startPoint.y, x2: firstHandle.x, y2: firstHandle.y, stroke: colors_1.WHITE_ALPHA_35, strokeWidth: 1 }), jsx_runtime_1.jsx("line", { x1: endPoint.x, y1: endPoint.y, x2: secondHandle.x, y2: secondHandle.y, stroke: colors_1.WHITE_ALPHA_35, strokeWidth: 1 }), jsx_runtime_1.jsx("path", { d: bezierPath, fill: "none", stroke: colors_1.BLUE, strokeWidth: 3 }), jsx_runtime_1.jsx("circle", { cx: startPoint.x, cy: startPoint.y, r: 4, fill: colors_1.WHITE }), jsx_runtime_1.jsx("circle", { cx: endPoint.x, cy: endPoint.y, r: 4, fill: colors_1.WHITE }), jsx_runtime_1.jsx("circle", { cx: firstHandle.x, cy: firstHandle.y, r: 6, fill: colors_1.WHITE, stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: disabled ? 'none' : 'all', cursor: "default", onPointerDown: (event) => onHandlePointerDown(0, event) }), jsx_runtime_1.jsx("circle", { cx: secondHandle.x, cy: secondHandle.y, r: 6, fill: colors_1.WHITE, stroke: colors_1.BLUE, strokeWidth: 2, vectorEffect: "non-scaling-stroke", pointerEvents: disabled ? 'none' : 'all', cursor: "default", onPointerDown: (event) => onHandlePointerDown(1, event) })
|
|
781
780
|
] }), modeSwitcher, jsx_runtime_1.jsxs("div", { style: coordinatesGrid, children: [
|
|
782
781
|
jsx_runtime_1.jsxs("div", { style: coordinateRow, children: [
|
|
783
782
|
jsx_runtime_1.jsx("div", { style: coordinateLabel, children: "X1" }), jsx_runtime_1.jsx("div", { style: coordinateInputWrapper, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: bezier[0], status: "ok", onValueChange: (value) => setCoordinate(0, 'x', value, false), onValueChangeEnd: (value) => setCoordinate(0, 'x', value, true), onTextChange: () => undefined, min: 0, max: 1, step: 0.01, formatter: formatNumber, rightAlign: false, style: numberInputStyle, snapToStep: false, disabled: disabled }) })
|
|
@@ -6,7 +6,7 @@ const no_react_1 = require("remotion/no-react");
|
|
|
6
6
|
const use_resolved_stack_react_to_change_1 = require("./use-resolved-stack-react-to-change");
|
|
7
7
|
const use_sequence_props_subscription_1 = require("./use-sequence-props-subscription");
|
|
8
8
|
const SubscribeToNodePaths = ({ overrideId, componentIdentity, schema, getStack, effects }) => {
|
|
9
|
-
const { resolvedLocation, stack, preferMappedNodePath } = (0, use_resolved_stack_react_to_change_1.useResolveStackAndReactToChange)(getStack);
|
|
9
|
+
const { resolvedLocation, stack, preferMappedNodePath } = (0, use_resolved_stack_react_to_change_1.useResolveStackAndReactToChange)(getStack, overrideId);
|
|
10
10
|
const effectSubscriptions = (0, react_1.useMemo)(() => {
|
|
11
11
|
return effects
|
|
12
12
|
.map((effect) => {
|
|
@@ -37,10 +37,12 @@ exports.Timeline = void 0;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
40
|
+
const fast_refresh_context_1 = require("../../fast-refresh-context");
|
|
40
41
|
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
41
42
|
const calculate_timeline_1 = require("../../helpers/calculate-timeline");
|
|
42
43
|
const client_id_1 = require("../../helpers/client-id");
|
|
43
44
|
const colors_1 = require("../../helpers/colors");
|
|
45
|
+
const inserted_element_selection_1 = require("../../helpers/inserted-element-selection");
|
|
44
46
|
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
45
47
|
const is_current_selected_still_1 = require("../../helpers/is-current-selected-still");
|
|
46
48
|
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
@@ -230,7 +232,7 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
230
232
|
const TimelineInner = () => {
|
|
231
233
|
var _a;
|
|
232
234
|
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
233
|
-
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
235
|
+
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
234
236
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
235
237
|
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
236
238
|
const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
|
|
@@ -253,6 +255,58 @@ const TimelineInner = () => {
|
|
|
253
255
|
overrideIdToNodePathMappings,
|
|
254
256
|
compositions,
|
|
255
257
|
]);
|
|
258
|
+
const pendingInsertedElementSelection = (0, react_1.useSyncExternalStore)(inserted_element_selection_1.subscribeToInsertedElementSelection, inserted_element_selection_1.getInsertedElementSelection, inserted_element_selection_1.getInsertedElementSelection);
|
|
259
|
+
const { fastRefreshes } = (0, react_1.useContext)(fast_refresh_context_1.FastRefreshContext);
|
|
260
|
+
const pendingSelectionStart = (0, react_1.useRef)(null);
|
|
261
|
+
const { selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
262
|
+
(0, react_1.useEffect)(() => {
|
|
263
|
+
var _a;
|
|
264
|
+
if (pendingInsertedElementSelection === null) {
|
|
265
|
+
pendingSelectionStart.current = null;
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const matchesInsertedNodePath = (track) => track.nodePathInfo !== null &&
|
|
269
|
+
track.nodePathInfo.sequenceSubscriptionKey.absolutePath ===
|
|
270
|
+
pendingInsertedElementSelection.nodePath.absolutePath &&
|
|
271
|
+
JSON.stringify(track.nodePathInfo.sequenceSubscriptionKey.nodePath) ===
|
|
272
|
+
JSON.stringify(pendingInsertedElementSelection.nodePath.nodePath);
|
|
273
|
+
if (((_a = pendingSelectionStart.current) === null || _a === void 0 ? void 0 : _a.selection) !==
|
|
274
|
+
pendingInsertedElementSelection) {
|
|
275
|
+
pendingSelectionStart.current = {
|
|
276
|
+
selection: pendingInsertedElementSelection,
|
|
277
|
+
fastRefreshes,
|
|
278
|
+
existingSequenceIds: new Set(timeline
|
|
279
|
+
.filter(matchesInsertedNodePath)
|
|
280
|
+
.map((track) => track.sequence.id)),
|
|
281
|
+
};
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (pendingSelectionStart.current.fastRefreshes === fastRefreshes) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' &&
|
|
288
|
+
canvasContent.compositionId !==
|
|
289
|
+
pendingInsertedElementSelection.compositionId) {
|
|
290
|
+
(0, inserted_element_selection_1.clearInsertedElementSelection)(pendingInsertedElementSelection);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const insertedTrack = timeline.find((track) => {
|
|
294
|
+
var _a;
|
|
295
|
+
return matchesInsertedNodePath(track) &&
|
|
296
|
+
!((_a = pendingSelectionStart.current) === null || _a === void 0 ? void 0 : _a.existingSequenceIds.has(track.sequence.id));
|
|
297
|
+
});
|
|
298
|
+
if (!insertedTrack || insertedTrack.nodePathInfo === null) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
selectItems([{ type: 'sequence', nodePathInfo: insertedTrack.nodePathInfo }], { reveal: true });
|
|
302
|
+
(0, inserted_element_selection_1.clearInsertedElementSelection)(pendingInsertedElementSelection);
|
|
303
|
+
}, [
|
|
304
|
+
canvasContent,
|
|
305
|
+
fastRefreshes,
|
|
306
|
+
pendingInsertedElementSelection,
|
|
307
|
+
selectItems,
|
|
308
|
+
timeline,
|
|
309
|
+
]);
|
|
256
310
|
const durationInFrames = (_a = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.durationInFrames) !== null && _a !== void 0 ? _a : 0;
|
|
257
311
|
const filtered = (0, react_1.useMemo)(() => {
|
|
258
312
|
return timeline.filter((t) => (0, should_show_track_in_timeline_1.shouldShowTrackInTimeline)(t, durationInFrames));
|