@remotion/studio 4.0.500 → 4.0.501
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Studio.js +1 -1
- package/dist/api/delete-static-file.js +8 -3
- package/dist/api/rename-static-file.js +8 -0
- package/dist/api/watch-public-folder.js +2 -1
- package/dist/api/watch-static-file.js +2 -1
- package/dist/api/write-static-file.js +8 -3
- package/dist/components/AssetSelector.js +3 -1
- package/dist/components/AssetSelectorItem.d.ts +2 -1
- package/dist/components/AssetSelectorItem.js +5 -2
- package/dist/components/Canvas.js +6 -1
- package/dist/components/CaptionInspector.d.ts +10 -0
- package/dist/components/CaptionInspector.js +24 -0
- package/dist/components/CaptionTextEditor.d.ts +9 -0
- package/dist/components/CaptionTextEditor.js +132 -0
- package/dist/components/CurrentAsset.js +3 -2
- package/dist/components/EditorContexts.d.ts +0 -1
- package/dist/components/EditorContexts.js +2 -2
- package/dist/components/FpsCounter.js +3 -3
- package/dist/components/FullscreenToggle.js +2 -1
- package/dist/components/GlobalKeybindings.js +2 -0
- package/dist/components/InitialCompositionLoader.d.ts +1 -1
- package/dist/components/InlineAction.js +1 -0
- package/dist/components/InlineCaptionInspector.d.ts +11 -0
- package/dist/components/InlineCaptionInspector.js +108 -0
- package/dist/components/InspectorPanel/CompositionInspector.js +5 -3
- package/dist/components/InspectorPanel/SelectedInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SelectedInspector.js +2 -2
- package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +1 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -4
- package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +22 -0
- package/dist/components/InspectorPanel/inspector-section-collapse.js +165 -0
- package/dist/components/InspectorPanel/styles.js +7 -1
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +3 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +91 -6
- package/dist/components/InspectorPanel.js +2 -2
- package/dist/components/InspectorSequenceSection.d.ts +2 -1
- package/dist/components/InspectorSequenceSection.js +238 -8
- package/dist/components/MenuToolbar.js +8 -1
- package/dist/components/Modals.js +1 -1
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.js +2 -2
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +5 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +26 -8
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.d.ts +0 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +3 -14
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
- package/dist/components/SelectedOutlineElement.js +1 -4
- package/dist/components/SelectedOutlineOverlay.js +17 -8
- package/dist/components/ShowOutlinesProvider.js +4 -1
- package/dist/components/Timeline/Timeline.js +19 -5
- package/dist/components/Timeline/TimelineAssetField.js +1 -0
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +8 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +7 -2
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +3 -1
- package/dist/components/Timeline/TimelineRowChrome.d.ts +3 -0
- package/dist/components/Timeline/TimelineRowChrome.js +4 -3
- package/dist/components/Timeline/TimelineSelection.d.ts +4 -2
- package/dist/components/Timeline/TimelineSelection.js +9 -6
- package/dist/components/Timeline/TimelineSequence.js +1 -4
- package/dist/components/Timeline/TimelineSequenceItem.js +4 -5
- package/dist/components/Timeline/TimelineSequencePropItem.js +9 -10
- package/dist/components/Timeline/TimelineTrack.js +4 -2
- package/dist/components/Timeline/border-radius-representation.d.ts +16 -0
- package/dist/components/Timeline/border-radius-representation.js +60 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +1 -6
- package/dist/components/Timeline/get-sequence-prop-reset-changes.d.ts +10 -0
- package/dist/components/Timeline/get-sequence-prop-reset-changes.js +33 -0
- package/dist/components/Timeline/reset-selected-timeline-props.js +2 -8
- package/dist/components/Timeline/save-sequence-prop.d.ts +12 -1
- package/dist/components/Timeline/save-sequence-prop.js +25 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +4 -0
- package/dist/components/UndoRedoButtons.js +15 -6
- package/dist/components/handle-drop.d.ts +3 -2
- package/dist/components/handle-drop.js +2 -1
- package/dist/components/import-assets.d.ts +4 -2
- package/dist/components/import-assets.js +20 -7
- package/dist/components/use-element-overwrite-confirmation.d.ts +2 -0
- package/dist/components/use-element-overwrite-confirmation.js +73 -0
- package/dist/components/use-static-files.js +7 -2
- package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +13 -2
- package/dist/esm/{chunk-dr1y1vm3.js → chunk-n1kj09yv.js} +7634 -6308
- package/dist/esm/index.mjs +24 -8
- package/dist/esm/internals.mjs +7634 -6308
- package/dist/esm/previewEntry.mjs +7646 -6320
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/browser-studio-operations.d.ts +3 -0
- package/dist/helpers/browser-studio-operations.js +14 -0
- package/dist/helpers/client-id.d.ts +0 -1
- package/dist/helpers/client-id.js +15 -10
- package/dist/helpers/download-blob.d.ts +1 -0
- package/dist/helpers/download-blob.js +15 -0
- package/dist/helpers/inject-css.js +5 -3
- package/dist/helpers/open-in-editor.js +26 -5
- package/dist/helpers/preview-server-events.js +46 -9
- package/dist/helpers/use-create-composition.js +8 -6
- package/dist/helpers/use-menu-structure.js +29 -0
- package/dist/hot-middleware-client/client.js +3 -3
- package/dist/icons/border-radius.d.ts +4 -0
- package/dist/icons/border-radius.js +8 -0
- package/dist/icons/fullscreen.d.ts +4 -0
- package/dist/icons/fullscreen.js +6 -0
- package/dist/previewEntry.js +1 -1
- package/dist/state/modals.d.ts +4 -0
- package/dist/state/timeline-sequence-hover.d.ts +17 -0
- package/dist/state/timeline-sequence-hover.js +33 -0
- package/package.json +13 -12
|
@@ -45,6 +45,7 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
|
45
45
|
const editor_guides_1 = require("../state/editor-guides");
|
|
46
46
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
47
47
|
const scale_lock_1 = require("../state/scale-lock");
|
|
48
|
+
const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
|
|
48
49
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
49
50
|
const selected_outline_drag_1 = require("./selected-outline-drag");
|
|
50
51
|
const selected_outline_measurement_1 = require("./selected-outline-measurement");
|
|
@@ -419,12 +420,12 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
419
420
|
const { setPropStatuses, setDragOverrides, clearDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
420
421
|
const { getScaleLockState } = (0, react_1.useContext)(scale_lock_1.ScaleLockContext);
|
|
421
422
|
const { editorShowOutlines } = (0, react_1.useContext)(editor_outlines_1.EditorShowOutlinesContext);
|
|
423
|
+
const { hoveredSequence, setHoveredSequence } = (0, react_1.useContext)(timeline_sequence_hover_1.TimelineSequenceHoverContext);
|
|
422
424
|
const { editorShowGuides, guidesList } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
|
|
423
425
|
const { frameBack, frameForward, getCurrentFrame, seek } = player_1.PlayerInternals.usePlayer();
|
|
424
426
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
425
427
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
426
428
|
const [outlines, setOutlines] = (0, react_1.useState)([]);
|
|
427
|
-
const [hoveredOutlineKey, setHoveredOutlineKey] = (0, react_1.useState)(null);
|
|
428
429
|
const [draggingOutline, setDraggingOutline] = (0, react_1.useState)(false);
|
|
429
430
|
const [activeSnapPoints, setActiveSnapPoints] = (0, react_1.useState)([]);
|
|
430
431
|
const overlayRef = (0, react_1.useRef)(null);
|
|
@@ -435,12 +436,20 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
435
436
|
const onDraggingChange = react_1.default.useCallback((dragging) => {
|
|
436
437
|
setDraggingOutline(dragging);
|
|
437
438
|
if (dragging) {
|
|
438
|
-
|
|
439
|
+
setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
|
|
439
440
|
}
|
|
440
441
|
else {
|
|
441
442
|
setActiveSnapPoints([]);
|
|
442
443
|
}
|
|
443
|
-
}, []);
|
|
444
|
+
}, [setHoveredSequence]);
|
|
445
|
+
const onHoverChange = (0, react_1.useCallback)((key) => {
|
|
446
|
+
setHoveredSequence((currentHover) => {
|
|
447
|
+
if (key !== null) {
|
|
448
|
+
return { key, source: 'canvas' };
|
|
449
|
+
}
|
|
450
|
+
return (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover;
|
|
451
|
+
});
|
|
452
|
+
}, [setHoveredSequence]);
|
|
444
453
|
const onSnapPointsChange = (0, react_1.useCallback)((snapPoints) => {
|
|
445
454
|
setActiveSnapPoints(snapPoints);
|
|
446
455
|
}, []);
|
|
@@ -757,11 +766,11 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
757
766
|
timelinePosition,
|
|
758
767
|
]);
|
|
759
768
|
(0, react_1.useEffect)(() => {
|
|
760
|
-
if (
|
|
761
|
-
!outlineTargets.some((target) => target.key ===
|
|
762
|
-
|
|
769
|
+
if ((hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.source) === 'canvas' &&
|
|
770
|
+
!outlineTargets.some((target) => target.key === hoveredSequence.key)) {
|
|
771
|
+
setHoveredSequence((currentHover) => (currentHover === null || currentHover === void 0 ? void 0 : currentHover.source) === 'canvas' ? null : currentHover);
|
|
763
772
|
}
|
|
764
|
-
}, [
|
|
773
|
+
}, [hoveredSequence, outlineTargets, setHoveredSequence]);
|
|
765
774
|
const targetsByKey = (0, react_1.useMemo)(() => {
|
|
766
775
|
return new Map(outlineTargets.map((target) => [target.key, target]));
|
|
767
776
|
}, [outlineTargets]);
|
|
@@ -1073,6 +1082,6 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
1073
1082
|
return null;
|
|
1074
1083
|
}
|
|
1075
1084
|
return (jsx_runtime_1.jsxs("svg", { ref: overlayRef, style: outlineContainer, width: "100%", height: "100%", "aria-hidden": "true", children: [
|
|
1076
|
-
jsx_runtime_1.jsx(SelectedOutlineSnapIndicators, { activeSnapPoints: activeSnapPoints, compositionHeight: compositionHeight, compositionWidth: compositionWidth, scale: scale }), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineElement, { allDragTargets: allDragTargets, allDragOutlines: allDragOutlines, allRotationDragTargets: allRotationDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered:
|
|
1085
|
+
jsx_runtime_1.jsx(SelectedOutlineSnapIndicators, { activeSnapPoints: activeSnapPoints, compositionHeight: compositionHeight, compositionWidth: compositionWidth, scale: scale }), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineElement, { allDragTargets: allDragTargets, allDragOutlines: allDragOutlines, allRotationDragTargets: allRotationDragTargets, allScaleDragTargets: allScaleDragTargets, dragging: draggingOutline, hovered: (hoveredSequence === null || hoveredSequence === void 0 ? void 0 : hoveredSequence.key) === outline.key, outline: outline, onDraggingChange: onDraggingChange, onHoverChange: onHoverChange, onSnapPointsChange: onSnapPointsChange, onSelect: selectOutlineItem, scale: scale, snapTargets: snapTargets, target: targetsByKey.get(outline.key) }, outline.key))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineElement_1.SelectedOutlineTransformOriginHandle, { outline: outline, onDraggingChange: onDraggingChange, target: targetsByKey.get(outline.key) }, `${outline.key}-transform-origin`))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleConnectionLayer, { outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-connection-lines`))), outlinesForRendering.map((outline) => (jsx_runtime_1.jsx(SelectedOutlineUvControls_1.SelectedOutlineUvHandleCircleLayer, { onDraggingChange: onDraggingChange, onSelect: selectOutlineItem, outline: outline, target: targetsByKey.get(outline.key) }, `${outline.key}-uv-handles`)))] }));
|
|
1077
1086
|
};
|
|
1078
1087
|
exports.SelectedOutlineOverlay = SelectedOutlineOverlay;
|
|
@@ -4,8 +4,10 @@ exports.ShowOutlinesProvider = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const editor_outlines_1 = require("../state/editor-outlines");
|
|
7
|
+
const timeline_sequence_hover_1 = require("../state/timeline-sequence-hover");
|
|
7
8
|
const ShowOutlinesProvider = ({ children }) => {
|
|
8
9
|
const [editorShowOutlines, setEditorShowOutlinesState] = (0, react_1.useState)(() => (0, editor_outlines_1.loadEditorShowOutlinesOption)());
|
|
10
|
+
const [hoveredSequence, setHoveredSequence] = (0, react_1.useState)(null);
|
|
9
11
|
const setEditorShowOutlines = (0, react_1.useCallback)((newValue) => {
|
|
10
12
|
setEditorShowOutlinesState((prevState) => {
|
|
11
13
|
const newVal = newValue(prevState);
|
|
@@ -19,6 +21,7 @@ const ShowOutlinesProvider = ({ children }) => {
|
|
|
19
21
|
setEditorShowOutlines,
|
|
20
22
|
};
|
|
21
23
|
}, [editorShowOutlines, setEditorShowOutlines]);
|
|
22
|
-
|
|
24
|
+
const timelineSequenceHoverCtx = (0, react_1.useMemo)(() => ({ hoveredSequence, setHoveredSequence }), [hoveredSequence]);
|
|
25
|
+
return (jsx_runtime_1.jsx(editor_outlines_1.EditorShowOutlinesContext.Provider, { value: editorShowOutlinesCtx, children: jsx_runtime_1.jsx(timeline_sequence_hover_1.TimelineSequenceHoverContext.Provider, { value: timelineSequenceHoverCtx, children: children }) }));
|
|
23
26
|
};
|
|
24
27
|
exports.ShowOutlinesProvider = ShowOutlinesProvider;
|
|
@@ -37,6 +37,7 @@ 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 browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
40
41
|
const calculate_timeline_1 = require("../../helpers/calculate-timeline");
|
|
41
42
|
const client_id_1 = require("../../helpers/client-id");
|
|
42
43
|
const colors_1 = require("../../helpers/colors");
|
|
@@ -93,6 +94,8 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
93
94
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
94
95
|
const previewConnected = previewServerState.type === 'connected';
|
|
95
96
|
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
97
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
98
|
+
const browserStudioCanInsertSolid = browserStudioOperations !== null;
|
|
96
99
|
const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
97
100
|
const currentComposition = (0, react_1.useMemo)(() => {
|
|
98
101
|
var _a;
|
|
@@ -102,12 +105,14 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
102
105
|
return ((_a = compositions.find((composition) => composition.id === currentCompositionId)) !== null && _a !== void 0 ? _a : null);
|
|
103
106
|
}, [compositions, currentCompositionId]);
|
|
104
107
|
const resolvedCompositionLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _a !== void 0 ? _a : null);
|
|
105
|
-
const compositionFile = (_b = resolvedCompositionLocation === null || resolvedCompositionLocation === void 0 ? void 0 : resolvedCompositionLocation.source) !== null && _b !== void 0 ? _b :
|
|
108
|
+
const compositionFile = (_b = resolvedCompositionLocation === null || resolvedCompositionLocation === void 0 ? void 0 : resolvedCompositionLocation.source) !== null && _b !== void 0 ? _b : (currentCompositionId && browserStudioOperations
|
|
109
|
+
? browserStudioOperations.getCompositionFile(currentCompositionId)
|
|
110
|
+
: null);
|
|
106
111
|
const compositionComponentInfo = (0, open_in_editor_1.useCachedCompositionComponentInfo)({
|
|
107
112
|
compositionFile,
|
|
108
113
|
compositionId: currentCompositionId,
|
|
109
114
|
});
|
|
110
|
-
const canInsertSolid = previewInteractive &&
|
|
115
|
+
const canInsertSolid = (previewInteractive || browserStudioCanInsertSolid) &&
|
|
111
116
|
(compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === true &&
|
|
112
117
|
currentCompositionId !== null &&
|
|
113
118
|
compositionFile !== null &&
|
|
@@ -128,7 +133,7 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
128
133
|
}
|
|
129
134
|
setIsAddingSolid(true);
|
|
130
135
|
try {
|
|
131
|
-
const
|
|
136
|
+
const request = {
|
|
132
137
|
compositionFile,
|
|
133
138
|
compositionId: currentCompositionId,
|
|
134
139
|
from: null,
|
|
@@ -138,7 +143,10 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
138
143
|
height: videoConfig.height,
|
|
139
144
|
position: null,
|
|
140
145
|
},
|
|
141
|
-
}
|
|
146
|
+
};
|
|
147
|
+
const result = browserStudioOperations
|
|
148
|
+
? await browserStudioOperations.insertSolid(request)
|
|
149
|
+
: await (0, call_api_1.callApi)('/api/insert-jsx-element', request);
|
|
142
150
|
if (result.success) {
|
|
143
151
|
(0, NotificationCenter_1.showNotification)('Added <Solid> to source file', 2000);
|
|
144
152
|
return;
|
|
@@ -151,7 +159,13 @@ const TimelineContextMenuArea = ({ children }) => {
|
|
|
151
159
|
finally {
|
|
152
160
|
setIsAddingSolid(false);
|
|
153
161
|
}
|
|
154
|
-
}, [
|
|
162
|
+
}, [
|
|
163
|
+
browserStudioOperations,
|
|
164
|
+
canInsertSolid,
|
|
165
|
+
compositionFile,
|
|
166
|
+
currentCompositionId,
|
|
167
|
+
videoConfig,
|
|
168
|
+
]);
|
|
155
169
|
const insertAsset = (0, react_1.useCallback)(async () => {
|
|
156
170
|
if (!canInsertAsset ||
|
|
157
171
|
currentCompositionId === null ||
|
|
@@ -58,6 +58,7 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
|
|
|
58
58
|
initialQuery,
|
|
59
59
|
onSelected: (asset) => onSelect(asset.name, asset.src),
|
|
60
60
|
},
|
|
61
|
+
compositionSelection: null,
|
|
61
62
|
});
|
|
62
63
|
}, [initialQuery, onSelect, setSelectedModal]);
|
|
63
64
|
const action = (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: openAssetSelection, disabled: window.remotion_isReadOnlyStudio, title: "Change source", renderAction: (color) => jsx_runtime_1.jsx(pen_1.PenIcon, { color: color, style: penIcon }) }));
|
|
@@ -42,8 +42,14 @@ const TimelineKeyframeDiamond_1 = require("./TimelineKeyframeDiamond");
|
|
|
42
42
|
const TimelineKeyframeEasingLine_1 = require("./TimelineKeyframeEasingLine");
|
|
43
43
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
44
44
|
const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
|
|
45
|
-
const
|
|
45
|
+
const rowClipper = {
|
|
46
|
+
marginLeft: -timeline_layout_1.TIMELINE_PADDING,
|
|
47
|
+
marginRight: -timeline_layout_1.TIMELINE_PADDING,
|
|
46
48
|
overflow: 'hidden',
|
|
49
|
+
paddingLeft: timeline_layout_1.TIMELINE_PADDING,
|
|
50
|
+
paddingRight: timeline_layout_1.TIMELINE_PADDING,
|
|
51
|
+
};
|
|
52
|
+
const row = {
|
|
47
53
|
position: 'relative',
|
|
48
54
|
};
|
|
49
55
|
const rowSeparator = {
|
|
@@ -55,7 +61,7 @@ const TimelineExpandedKeyframeRowUnmemoized = ({ height, keyframes, canEditEasin
|
|
|
55
61
|
const easingSegments = canEditEasing
|
|
56
62
|
? (0, get_timeline_easing_segments_1.getTimelineEasingSegments)(keyframes)
|
|
57
63
|
: [];
|
|
58
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showSeparator ? jsx_runtime_1.jsx("div", { style: rowSeparator }) : null, jsx_runtime_1.jsxs("div", { style: { ...row, height }, children: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : null, easingSegments.map((segment) => (jsx_runtime_1.jsx(TimelineKeyframeEasingLine_1.TimelineKeyframeEasingLine, { fromFrame: segment.fromFrame, toFrame: segment.toFrame, rowHeight: height, nodePathInfo: nodePathInfo, segmentIndex: segment.segmentIndex }, `${segment.segmentIndex}-${segment.fromFrame}-${segment.toFrame}`))), keyframes.map((keyframe) => (jsx_runtime_1.jsx(TimelineKeyframeDiamond_1.TimelineKeyframeDiamond, { frame: keyframe.frame, rowHeight: height, nodePathInfo: nodePathInfo }, keyframe.frame)))] })
|
|
64
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showSeparator ? jsx_runtime_1.jsx("div", { style: rowSeparator }) : null, jsx_runtime_1.jsx("div", { style: { ...rowClipper, height }, children: jsx_runtime_1.jsxs("div", { style: { ...row, height }, children: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : null, easingSegments.map((segment) => (jsx_runtime_1.jsx(TimelineKeyframeEasingLine_1.TimelineKeyframeEasingLine, { fromFrame: segment.fromFrame, toFrame: segment.toFrame, rowHeight: height, nodePathInfo: nodePathInfo, segmentIndex: segment.segmentIndex }, `${segment.segmentIndex}-${segment.fromFrame}-${segment.toFrame}`))), keyframes.map((keyframe) => (jsx_runtime_1.jsx(TimelineKeyframeDiamond_1.TimelineKeyframeDiamond, { frame: keyframe.frame, rowHeight: height, nodePathInfo: nodePathInfo }, keyframe.frame)))] }) })
|
|
59
65
|
] }));
|
|
60
66
|
};
|
|
61
67
|
exports.TimelineExpandedKeyframeRow = react_1.default.memo(TimelineExpandedKeyframeRowUnmemoized);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ArrayFieldSchema, CanUpdateSequencePropStatusStatic, SequencePropsSubscriptionKey, VisibleFieldSchema } from 'remotion';
|
|
3
3
|
import type { SchemaFieldInfo, TimelineFieldOnDragValueChange, TimelineFieldOnSave } from '../../helpers/timeline-layout';
|
|
4
|
+
type CaptionsFieldSchema = Extract<VisibleFieldSchema, {
|
|
5
|
+
type: 'remotion-captions';
|
|
6
|
+
}>;
|
|
7
|
+
type PrimitiveFieldSchema = Exclude<VisibleFieldSchema, ArrayFieldSchema | CaptionsFieldSchema>;
|
|
4
8
|
export type TimelinePrimitiveFieldInfo = Omit<SchemaFieldInfo, 'fieldSchema' | 'typeName'> & {
|
|
5
|
-
readonly fieldSchema:
|
|
6
|
-
readonly typeName:
|
|
9
|
+
readonly fieldSchema: PrimitiveFieldSchema;
|
|
10
|
+
readonly typeName: PrimitiveFieldSchema['type'];
|
|
7
11
|
};
|
|
8
12
|
export declare const isTimelinePrimitiveFieldInfo: (field: SchemaFieldInfo) => field is TimelinePrimitiveFieldInfo;
|
|
9
13
|
export declare const TimelinePrimitiveFieldValue: React.FC<{
|
|
@@ -15,3 +19,4 @@ export declare const TimelinePrimitiveFieldValue: React.FC<{
|
|
|
15
19
|
readonly effectiveValue: unknown;
|
|
16
20
|
readonly scaleLockNodePath: SequencePropsSubscriptionKey | null;
|
|
17
21
|
}>;
|
|
22
|
+
export {};
|
|
@@ -24,7 +24,9 @@ const assetInlineWrapper = {
|
|
|
24
24
|
minWidth: 0,
|
|
25
25
|
};
|
|
26
26
|
const isTimelinePrimitiveFieldInfo = (field) => {
|
|
27
|
-
return field.typeName !== 'array' &&
|
|
27
|
+
return (field.typeName !== 'array' &&
|
|
28
|
+
field.fieldSchema.type !== 'array' &&
|
|
29
|
+
field.fieldSchema.type !== 'remotion-captions');
|
|
28
30
|
};
|
|
29
31
|
exports.isTimelinePrimitiveFieldInfo = isTimelinePrimitiveFieldInfo;
|
|
30
32
|
const TimelinePrimitiveFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propStatus, effectiveValue, scaleLockNodePath, }) => {
|
|
@@ -14,9 +14,12 @@ export declare const TimelineRowChrome: React.FC<{
|
|
|
14
14
|
readonly onSelect: (interaction?: TimelineSelectionInteraction) => void;
|
|
15
15
|
readonly showSelectedBackground: boolean;
|
|
16
16
|
readonly containsSelection: boolean;
|
|
17
|
+
readonly hovered?: boolean;
|
|
17
18
|
readonly outerHeight: number | null;
|
|
18
19
|
readonly onDragLeave?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
19
20
|
readonly onDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
20
21
|
readonly onDrop?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
21
22
|
readonly onDoubleClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
23
|
+
readonly onPointerEnter?: () => void;
|
|
24
|
+
readonly onPointerLeave?: () => void;
|
|
22
25
|
}>;
|
|
@@ -24,7 +24,7 @@ const keyframeControlsColumnBaseStyle = {
|
|
|
24
24
|
flexShrink: 0,
|
|
25
25
|
justifyContent: 'flex-start',
|
|
26
26
|
};
|
|
27
|
-
const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, style, selected, selectable, selectionItem, onSelect, showSelectedBackground, containsSelection, outerHeight, onDragLeave, onDragOver, onDrop, onDoubleClick, }) => {
|
|
27
|
+
const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, style, selected, selectable, selectionItem, onSelect, showSelectedBackground, containsSelection, hovered = false, outerHeight, onDragLeave, onDragOver, onDrop, onDoubleClick, onPointerEnter, onPointerLeave, }) => {
|
|
28
28
|
const ref = (0, react_1.useRef)(null);
|
|
29
29
|
const { basePadding, keyframeControlsPadding, rowBorderRadius, rowHorizontalMargin, } = (0, react_1.useContext)(TimelineRowLayoutContext_1.TimelineRowLayoutContext);
|
|
30
30
|
const indentWidth = (0, timeline_row_layout_1.getTimelineRowIndentWidth)(depth);
|
|
@@ -59,6 +59,7 @@ const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, styl
|
|
|
59
59
|
showSelectedBackground,
|
|
60
60
|
selected,
|
|
61
61
|
containsSelection,
|
|
62
|
+
hovered,
|
|
62
63
|
});
|
|
63
64
|
const innerRowStyle = (0, react_1.useMemo)(() => ({
|
|
64
65
|
...rowBase,
|
|
@@ -89,8 +90,8 @@ const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, styl
|
|
|
89
90
|
const chrome = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
90
91
|
jsx_runtime_1.jsx("div", { style: leftChromeStyle, children: keyframeControls ? (jsx_runtime_1.jsx("div", { style: keyframeControlsColumnStyle, children: keyframeControls })) : (jsx_runtime_1.jsxs("div", { style: chromeColumnStyle, children: [eye, indentWidth > 0 ? jsx_runtime_1.jsx(Padder_1.Padder, { depth: depth }) : null, arrow] })) }), children] }));
|
|
91
92
|
if (outerStyle) {
|
|
92
|
-
return (jsx_runtime_1.jsx("div", { ref: ref, style: outerStyle, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, children: jsx_runtime_1.jsx("div", { style: innerRowStyle, children: chrome }) }));
|
|
93
|
+
return (jsx_runtime_1.jsx("div", { ref: ref, style: outerStyle, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: jsx_runtime_1.jsx("div", { style: innerRowStyle, children: chrome }) }));
|
|
93
94
|
}
|
|
94
|
-
return (jsx_runtime_1.jsx("div", { ref: ref, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, style: innerRowStyle, children: chrome }));
|
|
95
|
+
return (jsx_runtime_1.jsx("div", { ref: ref, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: innerRowStyle, children: chrome }));
|
|
95
96
|
};
|
|
96
97
|
exports.TimelineRowChrome = TimelineRowChrome;
|
|
@@ -3,16 +3,18 @@ import { type GetDragOverrides, type GetEffectDragOverrides, type PropStatuses }
|
|
|
3
3
|
import type { SequenceNodePathInfo, TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
4
|
import { type GetIsExpanded } from '../ExpandedTracksProvider';
|
|
5
5
|
export declare const TIMELINE_SELECTED_BACKGROUND = "#3B3F42";
|
|
6
|
+
export declare const TIMELINE_HOVER_BACKGROUND = "rgba(255, 255, 255, 0.05)";
|
|
6
7
|
export declare const TIMELINE_SELECTED_LABEL_BACKGROUND = "#B0B0B0";
|
|
7
8
|
export declare const TIMELINE_SELECTED_LABEL_TEXT = "black";
|
|
8
9
|
export declare const TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = 2;
|
|
9
10
|
export declare const getTimelineSelectedLabelStyle: (selected: boolean, subcategory: boolean) => CSSProperties;
|
|
10
11
|
export declare const getTimelineColor: (selected: boolean, subcategory: boolean) => "black" | "rgba(255, 255, 255, 0.8)";
|
|
11
12
|
export declare const getTimelineSelectedTrackHighlightStyle: (timelineWidth: number, backgroundColor?: string) => CSSProperties;
|
|
12
|
-
export declare const getTimelineRowHighlightBackground: ({ showSelectedBackground, selected, containsSelection, }: {
|
|
13
|
+
export declare const getTimelineRowHighlightBackground: ({ showSelectedBackground, selected, containsSelection, hovered, }: {
|
|
13
14
|
readonly showSelectedBackground: boolean;
|
|
14
15
|
readonly selected: boolean;
|
|
15
16
|
readonly containsSelection: boolean;
|
|
17
|
+
readonly hovered: boolean;
|
|
16
18
|
}) => string | undefined;
|
|
17
19
|
export declare const TIMELINE_BACKGROUND = "#0F1113";
|
|
18
20
|
export declare const TIMELINE_TICKS_BACKGROUND = "rgb(31,36,40)";
|
|
@@ -213,5 +215,5 @@ export declare const useTimelineGuideSelection: (guideId: string) => {
|
|
|
213
215
|
selectionItem: TimelineSelection;
|
|
214
216
|
};
|
|
215
217
|
export declare const useTimelineRowContainsSelection: (nodePathInfo: SequenceNodePathInfo | null) => boolean;
|
|
216
|
-
export declare const useTimelineRowHighlightBackground: (nodePathInfo: SequenceNodePathInfo | null) => string | undefined;
|
|
218
|
+
export declare const useTimelineRowHighlightBackground: (nodePathInfo: SequenceNodePathInfo | null, hovered?: boolean) => string | undefined;
|
|
217
219
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useTimelineRowHighlightBackground = exports.useTimelineRowContainsSelection = exports.useTimelineGuideSelection = exports.useTimelineEasingSelection = exports.useTimelineKeyframeSelection = exports.useTimelineRowSelection = exports.useTimelineFocusableItem = exports.useTimelineMarqueeSelectableItem = exports.useTimelineMarqueeSelection = exports.useCurrentTimelineSelectionStateAsRef = exports.TIMELINE_SCRUBBER_ATTR = exports.TIMELINE_MARQUEE_ITEM_ATTR = exports.useTimelineSelection = exports.TimelineSelectionProvider = exports.TimelineSelectableItemsProvider = exports.TimelineSelectAllKeybindings = exports.getTimelineSequenceSelectionKey = exports.getSelectableTimelineItems = exports.getSelectableTimelineSequenceSelections = exports.getTimelineSelectionKey = exports.getTimelineSelectionFromNodePathInfo = exports.TimelineSelectionOrderProvider = exports.extendTimelineMarqueeSelection = exports.getTimelineMarqueeSelection = exports.timelineMarqueeRectsIntersect = exports.getClampedTimelineMarqueePoint = exports.getNormalizedTimelineMarqueeRect = exports.getAvailableTimelineSelectionState = exports.getTimelineSelectionAfterInteraction = exports.EMPTY_TIMELINE_SELECTION_STATE = exports.shouldSelectTimelineRowOnPointerDown = exports.isTimelineSelectionModifierEvent = exports.TIMELINE_TICKS_BACKGROUND = exports.TIMELINE_BACKGROUND = exports.getTimelineRowHighlightBackground = 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.useTimelineRowHighlightBackground = exports.useTimelineRowContainsSelection = exports.useTimelineGuideSelection = exports.useTimelineEasingSelection = exports.useTimelineKeyframeSelection = exports.useTimelineRowSelection = exports.useTimelineFocusableItem = exports.useTimelineMarqueeSelectableItem = exports.useTimelineMarqueeSelection = exports.useCurrentTimelineSelectionStateAsRef = exports.TIMELINE_SCRUBBER_ATTR = exports.TIMELINE_MARQUEE_ITEM_ATTR = exports.useTimelineSelection = exports.TimelineSelectionProvider = exports.TimelineSelectableItemsProvider = exports.TimelineSelectAllKeybindings = exports.getTimelineSequenceSelectionKey = exports.getSelectableTimelineItems = exports.getSelectableTimelineSequenceSelections = exports.getTimelineSelectionKey = exports.getTimelineSelectionFromNodePathInfo = exports.TimelineSelectionOrderProvider = exports.extendTimelineMarqueeSelection = exports.getTimelineMarqueeSelection = exports.timelineMarqueeRectsIntersect = exports.getClampedTimelineMarqueePoint = exports.getNormalizedTimelineMarqueeRect = exports.getAvailableTimelineSelectionState = exports.getTimelineSelectionAfterInteraction = exports.EMPTY_TIMELINE_SELECTION_STATE = exports.shouldSelectTimelineRowOnPointerDown = exports.isTimelineSelectionModifierEvent = exports.TIMELINE_TICKS_BACKGROUND = exports.TIMELINE_BACKGROUND = exports.getTimelineRowHighlightBackground = exports.getTimelineSelectedTrackHighlightStyle = exports.getTimelineColor = exports.getTimelineSelectedLabelStyle = exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = exports.TIMELINE_SELECTED_LABEL_TEXT = exports.TIMELINE_SELECTED_LABEL_BACKGROUND = exports.TIMELINE_HOVER_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");
|
|
@@ -21,6 +21,7 @@ const timeline_refs_1 = require("./timeline-refs");
|
|
|
21
21
|
const TimelineClipboardKeybindings_1 = require("./TimelineClipboardKeybindings");
|
|
22
22
|
const TimelineDeleteKeybindings_1 = require("./TimelineDeleteKeybindings");
|
|
23
23
|
exports.TIMELINE_SELECTED_BACKGROUND = colors_1.TIMELINE_SELECTED_BACKGROUND_COLOR;
|
|
24
|
+
exports.TIMELINE_HOVER_BACKGROUND = colors_1.WHITE_ALPHA_05;
|
|
24
25
|
exports.TIMELINE_SELECTED_LABEL_BACKGROUND = colors_1.TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR;
|
|
25
26
|
exports.TIMELINE_SELECTED_LABEL_TEXT = colors_1.BLACK;
|
|
26
27
|
exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = 2;
|
|
@@ -54,10 +55,11 @@ const getTimelineSelectedTrackHighlightStyle = (timelineWidth, backgroundColor =
|
|
|
54
55
|
width: timelineWidth,
|
|
55
56
|
});
|
|
56
57
|
exports.getTimelineSelectedTrackHighlightStyle = getTimelineSelectedTrackHighlightStyle;
|
|
57
|
-
const getTimelineRowHighlightBackground = ({ showSelectedBackground, selected, containsSelection, }) => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const getTimelineRowHighlightBackground = ({ showSelectedBackground, selected, containsSelection, hovered, }) => {
|
|
59
|
+
if (showSelectedBackground && (selected || containsSelection)) {
|
|
60
|
+
return exports.TIMELINE_SELECTED_BACKGROUND;
|
|
61
|
+
}
|
|
62
|
+
return hovered ? exports.TIMELINE_HOVER_BACKGROUND : undefined;
|
|
61
63
|
};
|
|
62
64
|
exports.getTimelineRowHighlightBackground = getTimelineRowHighlightBackground;
|
|
63
65
|
exports.TIMELINE_BACKGROUND = colors_1.TIMELINE_BACKGROUND_COLOR;
|
|
@@ -1109,13 +1111,14 @@ const useTimelineRowContainsSelection = (nodePathInfo) => {
|
|
|
1109
1111
|
return containsSelection(nodePathInfo);
|
|
1110
1112
|
};
|
|
1111
1113
|
exports.useTimelineRowContainsSelection = useTimelineRowContainsSelection;
|
|
1112
|
-
const useTimelineRowHighlightBackground = (nodePathInfo) => {
|
|
1114
|
+
const useTimelineRowHighlightBackground = (nodePathInfo, hovered = false) => {
|
|
1113
1115
|
const { selected } = (0, exports.useTimelineRowSelection)(nodePathInfo);
|
|
1114
1116
|
const containsSelection = (0, exports.useTimelineRowContainsSelection)(nodePathInfo);
|
|
1115
1117
|
return (0, exports.getTimelineRowHighlightBackground)({
|
|
1116
1118
|
showSelectedBackground: true,
|
|
1117
1119
|
selected,
|
|
1118
1120
|
containsSelection,
|
|
1121
|
+
hovered,
|
|
1119
1122
|
});
|
|
1120
1123
|
};
|
|
1121
1124
|
exports.useTimelineRowHighlightBackground = useTimelineRowHighlightBackground;
|
|
@@ -291,10 +291,7 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
|
|
|
291
291
|
},
|
|
292
292
|
],
|
|
293
293
|
});
|
|
294
|
-
if (result.success) {
|
|
295
|
-
(0, NotificationCenter_1.showNotification)('Removed sequence from source file', 2000);
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
294
|
+
if (!result.success) {
|
|
298
295
|
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
299
296
|
}
|
|
300
297
|
}
|
|
@@ -46,6 +46,7 @@ const studio_runtime_config_1 = require("../../helpers/studio-runtime-config");
|
|
|
46
46
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
47
47
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
48
48
|
const modals_1 = require("../../state/modals");
|
|
49
|
+
const timeline_sequence_hover_1 = require("../../state/timeline-sequence-hover");
|
|
49
50
|
const call_api_1 = require("../call-api");
|
|
50
51
|
const CompositionOrStillIcon_1 = require("../CompositionOrStillIcon");
|
|
51
52
|
const ConfirmationDialog_1 = require("../ConfirmationDialog");
|
|
@@ -176,6 +177,7 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
176
177
|
var _a, _b, _c;
|
|
177
178
|
var _d, _e, _f;
|
|
178
179
|
const nodePath = (_d = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.sequenceSubscriptionKey) !== null && _d !== void 0 ? _d : null;
|
|
180
|
+
const { hovered, onPointerEnter, onPointerLeave } = (0, timeline_sequence_hover_1.useTimelineSequenceHover)(nodePathInfo);
|
|
179
181
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
180
182
|
const previewConnected = previewServerState.type === 'connected';
|
|
181
183
|
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
@@ -268,10 +270,7 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
268
270
|
},
|
|
269
271
|
],
|
|
270
272
|
});
|
|
271
|
-
if (result.success) {
|
|
272
|
-
(0, NotificationCenter_1.showNotification)('Removed sequence from source file', 2000);
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
273
|
+
if (!result.success) {
|
|
275
274
|
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
276
275
|
}
|
|
277
276
|
}
|
|
@@ -857,7 +856,7 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
|
|
|
857
856
|
clientId: previewServerState.clientId,
|
|
858
857
|
});
|
|
859
858
|
}, [canDropEffect, nodePath, previewServerState, validatedLocation]);
|
|
860
|
-
const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewInteractive, isExpanded: isExpanded, nodePathInfo: nodePathInfo, onToggleExpand: onToggleExpand, sequence: sequence })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {})), style: rowStyle, selected: selected, selectable: selectable, selectionItem: selectionItem, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick: canHandleSequenceDoubleClick ? onSequenceDoubleClick : undefined, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
859
|
+
const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewInteractive, isExpanded: isExpanded, nodePathInfo: nodePathInfo, onToggleExpand: onToggleExpand, sequence: sequence })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {})), style: rowStyle, selected: selected, selectable: selectable, selectionItem: selectionItem, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, hovered: hovered, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick: canHandleSequenceDoubleClick ? onSequenceDoubleClick : undefined, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
861
860
|
jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: (0, TimelineSelection_1.getTimelineColor)(false, false), composition: connectedCompositions[0], style: connectedCompositionIconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 })
|
|
862
861
|
] })) : null, jsx_runtime_1.jsx(TimelineSequenceName_1.TimelineSequenceName, { displayName: timelineDisplayName, fallbackDisplayName: fallbackDisplayName, selected: selected, containsSelection: containsSelection, editing: isRenaming, onCancelEditing: onCancelRenaming, onSaveName: onSaveName }), mediaSrc ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
863
862
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }),
|
|
@@ -10,6 +10,7 @@ const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
|
10
10
|
const ContextMenu_1 = require("../ContextMenu");
|
|
11
11
|
const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
|
|
12
12
|
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
13
|
+
const get_sequence_prop_reset_changes_1 = require("./get-sequence-prop-reset-changes");
|
|
13
14
|
const save_sequence_prop_1 = require("./save-sequence-prop");
|
|
14
15
|
const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
|
|
15
16
|
const TimelineFieldRowContent_1 = require("./TimelineFieldRowContent");
|
|
@@ -230,16 +231,14 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
|
|
|
230
231
|
(0, save_sequence_prop_1.saveSequenceProps)({
|
|
231
232
|
addedKeyframes: null,
|
|
232
233
|
movedKeyframes: null,
|
|
233
|
-
changes:
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
],
|
|
234
|
+
changes: (0, get_sequence_prop_reset_changes_1.getSequencePropResetChanges)({
|
|
235
|
+
fileName: validatedLocation.source,
|
|
236
|
+
nodePath,
|
|
237
|
+
fieldKey: field.key,
|
|
238
|
+
value: field.fieldSchema.default,
|
|
239
|
+
defaultValue,
|
|
240
|
+
schema,
|
|
241
|
+
}),
|
|
243
242
|
setPropStatuses,
|
|
244
243
|
clientId: previewServerState.clientId,
|
|
245
244
|
undoLabel: `Reset ${fieldLabel}`,
|
|
@@ -38,6 +38,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const client_id_1 = require("../../helpers/client-id");
|
|
40
40
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
41
|
+
const timeline_sequence_hover_1 = require("../../state/timeline-sequence-hover");
|
|
41
42
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
42
43
|
const TimelineExpandedTrackKeyframes_1 = require("./TimelineExpandedTrackKeyframes");
|
|
43
44
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
@@ -49,7 +50,8 @@ const TimelineTrackUnmemoized = ({ track }) => {
|
|
|
49
50
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
50
51
|
const previewServerConnected = previewServerState.type === 'connected';
|
|
51
52
|
const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
|
|
52
|
-
const
|
|
53
|
+
const { hovered, onPointerEnter, onPointerLeave } = (0, timeline_sequence_hover_1.useTimelineSequenceHover)(track.nodePathInfo);
|
|
54
|
+
const rowHighlightBackground = (0, TimelineSelection_1.useTimelineRowHighlightBackground)(track.nodePathInfo, hovered);
|
|
53
55
|
const layerStyle = (0, react_1.useMemo)(() => ({
|
|
54
56
|
height: (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type),
|
|
55
57
|
marginBottom: timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
@@ -58,7 +60,7 @@ const TimelineTrackUnmemoized = ({ track }) => {
|
|
|
58
60
|
const showExpandedKeyframes = track.nodePathInfo !== null &&
|
|
59
61
|
previewServerConnected &&
|
|
60
62
|
getIsExpanded(track.nodePathInfo);
|
|
61
|
-
return (jsx_runtime_1.jsxs("div", { children: [
|
|
63
|
+
return (jsx_runtime_1.jsxs("div", { onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: [
|
|
62
64
|
jsx_runtime_1.jsxs("div", { style: layerStyle, children: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : null, jsx_runtime_1.jsx(TimelineSequence_1.TimelineSequence, { s: track.sequence, connectedCompositions: (_a = track.connectedCompositions) !== null && _a !== void 0 ? _a : [], nodePathInfo: track.nodePathInfo, sequenceFrameOffset: track.sequenceFrameOffset })
|
|
63
65
|
] }), showExpandedKeyframes && track.nodePathInfo ? (jsx_runtime_1.jsx(TimelineExpandedTrackKeyframes_1.TimelineExpandedTrackKeyframes, { sequence: track.sequence, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset })) : null] }));
|
|
64
66
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BORDER_RADIUS_LONGHAND_KEYS, BORDER_RADIUS_SHORTHAND_KEY } from '@remotion/studio-shared';
|
|
2
|
+
import type { CanUpdateSequencePropStatus, DragOverrideValue } from 'remotion';
|
|
3
|
+
export { BORDER_RADIUS_LONGHAND_KEYS, BORDER_RADIUS_SHORTHAND_KEY };
|
|
4
|
+
export type BorderRadiusConversion = {
|
|
5
|
+
readonly type: 'individual';
|
|
6
|
+
readonly value: number;
|
|
7
|
+
} | {
|
|
8
|
+
readonly type: 'shorthand';
|
|
9
|
+
readonly value: number;
|
|
10
|
+
};
|
|
11
|
+
export type BorderRadiusConversionChange = {
|
|
12
|
+
readonly fieldKey: string;
|
|
13
|
+
readonly value: number | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare const getBorderRadiusConversionChanges: (conversion: BorderRadiusConversion) => BorderRadiusConversionChange[];
|
|
16
|
+
export declare const getBorderRadiusConversion: (props: Record<string, CanUpdateSequencePropStatus> | undefined, dragOverrides?: Record<string, DragOverrideValue>) => BorderRadiusConversion | null;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBorderRadiusConversion = exports.getBorderRadiusConversionChanges = exports.BORDER_RADIUS_SHORTHAND_KEY = exports.BORDER_RADIUS_LONGHAND_KEYS = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
Object.defineProperty(exports, "BORDER_RADIUS_LONGHAND_KEYS", { enumerable: true, get: function () { return studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS; } });
|
|
6
|
+
Object.defineProperty(exports, "BORDER_RADIUS_SHORTHAND_KEY", { enumerable: true, get: function () { return studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY; } });
|
|
7
|
+
const getBorderRadiusConversionChanges = (conversion) => {
|
|
8
|
+
if (conversion.type === 'individual') {
|
|
9
|
+
return [
|
|
10
|
+
{ fieldKey: studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY, value: undefined },
|
|
11
|
+
...studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS.map((fieldKey) => ({
|
|
12
|
+
fieldKey,
|
|
13
|
+
value: conversion.value,
|
|
14
|
+
})),
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
return [
|
|
18
|
+
...studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS.map((fieldKey) => ({
|
|
19
|
+
fieldKey,
|
|
20
|
+
value: undefined,
|
|
21
|
+
})),
|
|
22
|
+
{ fieldKey: studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY, value: conversion.value },
|
|
23
|
+
];
|
|
24
|
+
};
|
|
25
|
+
exports.getBorderRadiusConversionChanges = getBorderRadiusConversionChanges;
|
|
26
|
+
const getBorderRadiusConversion = (props, dragOverrides = {}) => {
|
|
27
|
+
const getStaticValue = (key) => {
|
|
28
|
+
const status = props === null || props === void 0 ? void 0 : props[key];
|
|
29
|
+
if (status !== undefined && status.status !== 'static') {
|
|
30
|
+
return { isStatic: false, value: undefined };
|
|
31
|
+
}
|
|
32
|
+
const dragOverride = dragOverrides[key];
|
|
33
|
+
if ((dragOverride === null || dragOverride === void 0 ? void 0 : dragOverride.type) === 'keyframed') {
|
|
34
|
+
return { isStatic: false, value: undefined };
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
isStatic: true,
|
|
38
|
+
value: (dragOverride === null || dragOverride === void 0 ? void 0 : dragOverride.type) === 'static'
|
|
39
|
+
? dragOverride.value
|
|
40
|
+
: status === null || status === void 0 ? void 0 : status.codeValue,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const shorthand = getStaticValue(studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY);
|
|
44
|
+
if (shorthand.isStatic && typeof shorthand.value === 'number') {
|
|
45
|
+
return { type: 'individual', value: shorthand.value };
|
|
46
|
+
}
|
|
47
|
+
const longhands = studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS.map(getStaticValue);
|
|
48
|
+
const hasNoAuthoredRadius = [shorthand, ...longhands].every((status) => status.isStatic && status.value === undefined);
|
|
49
|
+
if (hasNoAuthoredRadius) {
|
|
50
|
+
return { type: 'individual', value: 0 };
|
|
51
|
+
}
|
|
52
|
+
if (longhands.every((status) => status.isStatic && typeof status.value === 'number')) {
|
|
53
|
+
const values = longhands.map((status) => status.value);
|
|
54
|
+
if (values.every((value) => value === values[0])) {
|
|
55
|
+
return { type: 'shorthand', value: values[0] };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
};
|
|
60
|
+
exports.getBorderRadiusConversion = getBorderRadiusConversion;
|
|
@@ -46,12 +46,7 @@ const deleteSequencesFromSource = async (nodePathInfos, confirm) => {
|
|
|
46
46
|
}),
|
|
47
47
|
})
|
|
48
48
|
.then((result) => {
|
|
49
|
-
if (result.success) {
|
|
50
|
-
(0, NotificationCenter_1.showNotification)(nodePathInfos.length === 1
|
|
51
|
-
? 'Removed sequence from source file'
|
|
52
|
-
: 'Removed sequences from source files', 2000);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
49
|
+
if (!result.success) {
|
|
55
50
|
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
56
51
|
}
|
|
57
52
|
return true;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InteractivitySchema, SequencePropsSubscriptionKey } from 'remotion';
|
|
2
|
+
import type { SaveSequencePropChange } from './save-sequence-prop';
|
|
3
|
+
export declare const getSequencePropResetChanges: ({ fileName, nodePath, fieldKey, value, defaultValue, schema, }: {
|
|
4
|
+
readonly fileName: string;
|
|
5
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
6
|
+
readonly fieldKey: string;
|
|
7
|
+
readonly value: unknown;
|
|
8
|
+
readonly defaultValue: string | null;
|
|
9
|
+
readonly schema: InteractivitySchema;
|
|
10
|
+
}) => SaveSequencePropChange[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSequencePropResetChanges = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const remotion_1 = require("remotion");
|
|
6
|
+
const isVisibleFieldSchema = (fieldSchema) => fieldSchema !== undefined && fieldSchema.type !== 'hidden';
|
|
7
|
+
const getDefaultValue = (fieldSchema) => fieldSchema.default !== undefined
|
|
8
|
+
? JSON.stringify(fieldSchema.default)
|
|
9
|
+
: null;
|
|
10
|
+
const getSequencePropResetChanges = ({ fileName, nodePath, fieldKey, value, defaultValue, schema, }) => {
|
|
11
|
+
const flatSchema = remotion_1.Internals.getFlatSchemaWithAllKeys(schema);
|
|
12
|
+
const longhandChanges = (0, studio_shared_1.getStylePropertyLonghandKeys)(fieldKey).flatMap((longhandKey) => {
|
|
13
|
+
const fieldSchema = flatSchema[longhandKey];
|
|
14
|
+
if (!isVisibleFieldSchema(fieldSchema)) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
fileName,
|
|
20
|
+
nodePath,
|
|
21
|
+
fieldKey: longhandKey,
|
|
22
|
+
value: fieldSchema.default,
|
|
23
|
+
defaultValue: getDefaultValue(fieldSchema),
|
|
24
|
+
schema,
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
});
|
|
28
|
+
return [
|
|
29
|
+
{ fileName, nodePath, fieldKey, value, defaultValue, schema },
|
|
30
|
+
...longhandChanges,
|
|
31
|
+
];
|
|
32
|
+
};
|
|
33
|
+
exports.getSequencePropResetChanges = getSequencePropResetChanges;
|