@remotion/studio 4.0.469 → 4.0.471
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/save-render-output.js +3 -12
- package/dist/components/AudioWaveform.js +19 -2
- package/dist/components/ContextMenu.d.ts +7 -2
- package/dist/components/ContextMenu.js +53 -9
- package/dist/components/EditorContent.js +5 -4
- package/dist/components/Menu/MenuItem.d.ts +1 -1
- package/dist/components/MenuBuildIndicator.js +0 -1
- package/dist/components/NewComposition/InputDragger.js +1 -0
- package/dist/components/Preview.js +6 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +49 -0
- package/dist/components/SelectedOutlineOverlay.js +710 -0
- package/dist/components/Timeline/Timeline.js +102 -13
- package/dist/components/Timeline/TimelineDeleteKeybindings.d.ts +2 -0
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +101 -0
- package/dist/components/Timeline/TimelineDragHandler.js +20 -244
- package/dist/components/Timeline/{TimelineEffectGroupRow.d.ts → TimelineEffectItem.d.ts} +1 -1
- package/dist/components/Timeline/TimelineEffectItem.js +323 -0
- package/dist/components/Timeline/{TimelineEffectFieldRow.d.ts → TimelineEffectPropItem.d.ts} +2 -1
- package/dist/components/Timeline/{TimelineEffectFieldRow.js → TimelineEffectPropItem.js} +97 -8
- package/dist/components/Timeline/TimelineExpandArrowButton.js +5 -1
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +37 -5
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +9 -7
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +2 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.d.ts +2 -0
- package/dist/components/Timeline/TimelineInOutDragHandler.js +324 -0
- package/dist/components/Timeline/TimelineInOutPointer.js +3 -1
- package/dist/components/Timeline/TimelineInOutPointerHandle.d.ts +1 -0
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +5 -4
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +17 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +222 -0
- package/dist/components/Timeline/TimelineKeyframeDiamond.js +7 -6
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +8 -0
- package/dist/components/Timeline/TimelineKeyframedValue.js +36 -0
- package/dist/components/Timeline/TimelineList.js +3 -15
- package/dist/components/Timeline/TimelineRowChrome.d.ts +6 -1
- package/dist/components/Timeline/TimelineRowChrome.js +25 -7
- package/dist/components/Timeline/TimelineSelection.d.ts +53 -9
- package/dist/components/Timeline/TimelineSelection.js +305 -48
- package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequence.js +18 -6
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/{TimelineListItem.d.ts → TimelineSequenceItem.d.ts} +2 -1
- package/dist/components/Timeline/{TimelineListItem.js → TimelineSequenceItem.js} +140 -34
- package/dist/components/Timeline/{TimelineFieldRow.d.ts → TimelineSequencePropItem.d.ts} +2 -1
- package/dist/components/Timeline/{TimelineFieldRow.js → TimelineSequencePropItem.js} +81 -5
- package/dist/components/Timeline/TimelineTimeIndicators.js +0 -1
- package/dist/components/Timeline/TimelineTrack.js +3 -1
- package/dist/components/Timeline/TimelineTranslateField.js +14 -22
- package/dist/components/Timeline/call-add-keyframe.d.ts +23 -0
- package/dist/components/Timeline/call-add-keyframe.js +54 -0
- package/dist/components/Timeline/call-delete-keyframe.d.ts +37 -0
- package/dist/components/Timeline/call-delete-keyframe.js +122 -0
- package/dist/components/Timeline/delete-selected-keyframe.d.ts +21 -0
- package/dist/components/Timeline/delete-selected-keyframe.js +92 -0
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +17 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +178 -0
- package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +13 -0
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +66 -0
- package/dist/components/Timeline/find-track-for-node-path-info.d.ts +7 -0
- package/dist/components/Timeline/find-track-for-node-path-info.js +13 -0
- package/dist/components/Timeline/get-keyframe-navigation.d.ts +9 -0
- package/dist/components/Timeline/get-keyframe-navigation.js +26 -0
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.d.ts +8 -0
- package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +26 -0
- package/dist/components/Timeline/reset-selected-timeline-props.d.ts +38 -0
- package/dist/components/Timeline/reset-selected-timeline-props.js +143 -0
- package/dist/components/Timeline/save-sequence-prop.d.ts +14 -2
- package/dist/components/Timeline/save-sequence-prop.js +42 -7
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -2
- package/dist/components/Timeline/sequence-props-subscription-store.js +2 -1
- package/dist/components/Timeline/timeline-row-layout.d.ts +1 -0
- package/dist/components/Timeline/timeline-row-layout.js +2 -1
- package/dist/components/Timeline/timeline-scroll-logic.js +3 -3
- package/dist/components/Timeline/timeline-translate-utils.d.ts +2 -0
- package/dist/components/Timeline/timeline-translate-utils.js +20 -0
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +10 -3
- package/dist/components/Timeline/use-sequence-props-subscription.js +2 -1
- package/dist/components/composition-menu-items.js +32 -1
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +0 -1
- package/dist/esm/{chunk-1mp51e0w.js → chunk-z0z9d4r0.js} +10422 -5958
- package/dist/esm/internals.mjs +10422 -5958
- package/dist/esm/previewEntry.mjs +10419 -5953
- package/dist/esm/renderEntry.mjs +3 -1
- package/dist/helpers/format-file-location.d.ts +9 -0
- package/dist/helpers/format-file-location.js +27 -0
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
- package/dist/helpers/get-box-quads-polyfill-internals.js +2395 -0
- package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
- package/dist/helpers/get-box-quads-ponyfill.js +23 -0
- package/dist/helpers/get-left-of-timeline-slider.js +1 -1
- package/dist/helpers/get-timeline-sequence-layout.js +10 -11
- package/dist/helpers/open-in-editor.d.ts +20 -2
- package/dist/helpers/open-in-editor.js +53 -30
- package/dist/helpers/use-menu-structure.js +8 -17
- package/dist/renderEntry.js +2 -2
- package/dist/state/z-index.js +5 -2
- package/package.json +10 -10
- package/dist/components/Timeline/TimelineEffectGroupRow.js +0 -153
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TimelineInOutDragHandler = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const player_1 = require("@remotion/player");
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const remotion_1 = require("remotion");
|
|
41
|
+
const get_left_of_timeline_slider_1 = require("../../helpers/get-left-of-timeline-slider");
|
|
42
|
+
const in_out_1 = require("../../state/in-out");
|
|
43
|
+
const z_index_1 = require("../../state/z-index");
|
|
44
|
+
const ContextMenu_1 = require("../ContextMenu");
|
|
45
|
+
const ForceSpecificCursor_1 = require("../ForceSpecificCursor");
|
|
46
|
+
const TimelineInOutToggle_1 = require("../TimelineInOutToggle");
|
|
47
|
+
const timeline_refs_1 = require("./timeline-refs");
|
|
48
|
+
const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
|
|
49
|
+
const TimelineInOutPointer_1 = require("./TimelineInOutPointer");
|
|
50
|
+
const TimelineInOutPointerHandle_1 = require("./TimelineInOutPointerHandle");
|
|
51
|
+
const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
|
|
52
|
+
const getClientXWithScroll = (x) => {
|
|
53
|
+
var _a;
|
|
54
|
+
return x + ((_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.scrollLeft);
|
|
55
|
+
};
|
|
56
|
+
const TimelineInOutDragHandler = () => {
|
|
57
|
+
const video = remotion_1.Internals.useUnsafeVideoConfig();
|
|
58
|
+
const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
59
|
+
if (!canvasContent || canvasContent.type !== 'composition') {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return video ? jsx_runtime_1.jsx(TimelineInOutDragHandlerInnerMemo, {}) : null;
|
|
63
|
+
};
|
|
64
|
+
exports.TimelineInOutDragHandler = TimelineInOutDragHandler;
|
|
65
|
+
const TimelineInOutDragHandlerInner = () => {
|
|
66
|
+
var _a;
|
|
67
|
+
var _b, _c;
|
|
68
|
+
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
69
|
+
const size = player_1.PlayerInternals.useElementSize(timeline_refs_1.scrollableRef, {
|
|
70
|
+
triggerOnWindowResize: true,
|
|
71
|
+
shouldApplyCssTransforms: true,
|
|
72
|
+
});
|
|
73
|
+
const { isHighestContext } = (0, z_index_1.useZIndex)();
|
|
74
|
+
const [inOutDragging, setInOutDragging] = (0, react_1.useState)({
|
|
75
|
+
dragging: false,
|
|
76
|
+
});
|
|
77
|
+
const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
|
|
78
|
+
const get = (0, react_1.useCallback)((frame) => {
|
|
79
|
+
if (timelineWidth === null) {
|
|
80
|
+
throw new Error('timeline width is not yet determined');
|
|
81
|
+
}
|
|
82
|
+
return (0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(frame, videoConfig.durationInFrames, timelineWidth);
|
|
83
|
+
}, [timelineWidth, videoConfig.durationInFrames]);
|
|
84
|
+
const width = (_b = (_a = timeline_refs_1.scrollableRef.current) === null || _a === void 0 ? void 0 : _a.scrollWidth) !== null && _b !== void 0 ? _b : 0;
|
|
85
|
+
const left = (_c = size === null || size === void 0 ? void 0 : size.left) !== null && _c !== void 0 ? _c : 0;
|
|
86
|
+
const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
|
|
87
|
+
const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
|
|
88
|
+
const onInPointerDown = (0, react_1.useCallback)((e) => {
|
|
89
|
+
if (e.button !== 0) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (!isHighestContext) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (!videoConfig) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (inFrame === null) {
|
|
99
|
+
throw new Error('expected in frame');
|
|
100
|
+
}
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
document.body.style.userSelect = 'none';
|
|
103
|
+
document.body.style.webkitUserSelect = 'none';
|
|
104
|
+
const inMarker = get(inFrame);
|
|
105
|
+
const outMarker = outFrame === null ? Infinity : get(outFrame - 1);
|
|
106
|
+
(0, ForceSpecificCursor_1.forceSpecificCursor)('ew-resize');
|
|
107
|
+
setInOutDragging({
|
|
108
|
+
dragging: 'in',
|
|
109
|
+
initialOffset: getClientXWithScroll(e.clientX),
|
|
110
|
+
boundaries: [-Infinity, outMarker - inMarker],
|
|
111
|
+
});
|
|
112
|
+
}, [isHighestContext, videoConfig, inFrame, get, outFrame]);
|
|
113
|
+
const onOutPointerDown = (0, react_1.useCallback)((e) => {
|
|
114
|
+
if (e.button !== 0) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (!isHighestContext) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (!videoConfig) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (outFrame === null) {
|
|
124
|
+
throw new Error('expected out frame');
|
|
125
|
+
}
|
|
126
|
+
e.stopPropagation();
|
|
127
|
+
document.body.style.userSelect = 'none';
|
|
128
|
+
document.body.style.webkitUserSelect = 'none';
|
|
129
|
+
const outMarker = get(outFrame);
|
|
130
|
+
const inMarker = inFrame === null ? -Infinity : get(inFrame + 1);
|
|
131
|
+
(0, ForceSpecificCursor_1.forceSpecificCursor)('ew-resize');
|
|
132
|
+
setInOutDragging({
|
|
133
|
+
dragging: 'out',
|
|
134
|
+
initialOffset: getClientXWithScroll(e.clientX),
|
|
135
|
+
boundaries: [inMarker - outMarker, Infinity],
|
|
136
|
+
});
|
|
137
|
+
}, [isHighestContext, videoConfig, inFrame, get, outFrame]);
|
|
138
|
+
const onPointerMoveInOut = (0, react_1.useCallback)((e) => {
|
|
139
|
+
if (!videoConfig) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (!inOutDragging.dragging) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const offset = Math.max(inOutDragging.boundaries[0], Math.min(inOutDragging.boundaries[1], getClientXWithScroll(e.clientX) - inOutDragging.initialOffset));
|
|
146
|
+
if (inOutDragging.dragging === 'in') {
|
|
147
|
+
if (!TimelineInOutPointerHandle_1.inPointerHandle.current) {
|
|
148
|
+
throw new Error('in pointer handle');
|
|
149
|
+
}
|
|
150
|
+
if (!TimelineInOutPointer_1.inMarkerAreaRef.current) {
|
|
151
|
+
throw new Error('expected inMarkerAreaRef');
|
|
152
|
+
}
|
|
153
|
+
if (!inFrame) {
|
|
154
|
+
throw new Error('expected inframes');
|
|
155
|
+
}
|
|
156
|
+
TimelineInOutPointerHandle_1.inPointerHandle.current.style.transform = `translateX(${get(inFrame) + offset}px)`;
|
|
157
|
+
TimelineInOutPointer_1.inMarkerAreaRef.current.style.width =
|
|
158
|
+
String(get(inFrame) + offset) + 'px';
|
|
159
|
+
}
|
|
160
|
+
if (inOutDragging.dragging === 'out') {
|
|
161
|
+
if (!TimelineInOutPointerHandle_1.outPointerHandle.current) {
|
|
162
|
+
throw new Error('in pointer handle');
|
|
163
|
+
}
|
|
164
|
+
if (!TimelineInOutPointer_1.outMarkerAreaRef.current) {
|
|
165
|
+
throw new Error('in outMarkerAreaRef');
|
|
166
|
+
}
|
|
167
|
+
if (!outFrame) {
|
|
168
|
+
throw new Error('expected outframes');
|
|
169
|
+
}
|
|
170
|
+
TimelineInOutPointerHandle_1.outPointerHandle.current.style.transform = `translateX(${get(outFrame) + offset}px)`;
|
|
171
|
+
TimelineInOutPointer_1.outMarkerAreaRef.current.style.left =
|
|
172
|
+
String(get(outFrame) + offset) + 'px';
|
|
173
|
+
TimelineInOutPointer_1.outMarkerAreaRef.current.style.width =
|
|
174
|
+
String(width - get(outFrame) - offset) + 'px';
|
|
175
|
+
}
|
|
176
|
+
}, [get, inFrame, inOutDragging, outFrame, videoConfig, width]);
|
|
177
|
+
const onPointerUpInOut = (0, react_1.useCallback)((e) => {
|
|
178
|
+
document.body.style.userSelect = '';
|
|
179
|
+
document.body.style.webkitUserSelect = '';
|
|
180
|
+
(0, ForceSpecificCursor_1.stopForcingSpecificCursor)();
|
|
181
|
+
if (!videoConfig) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (!inOutDragging.dragging) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
setInOutDragging({
|
|
188
|
+
dragging: false,
|
|
189
|
+
});
|
|
190
|
+
const frame = (0, timeline_scroll_logic_1.getFrameFromX)({
|
|
191
|
+
clientX: getClientXWithScroll(e.clientX) - left,
|
|
192
|
+
durationInFrames: videoConfig.durationInFrames,
|
|
193
|
+
width,
|
|
194
|
+
extrapolate: 'extend',
|
|
195
|
+
});
|
|
196
|
+
if (inOutDragging.dragging === 'in') {
|
|
197
|
+
if (frame < 1) {
|
|
198
|
+
return setInAndOutFrames((prev) => {
|
|
199
|
+
var _a;
|
|
200
|
+
return ({
|
|
201
|
+
...prev,
|
|
202
|
+
[videoConfig.id]: {
|
|
203
|
+
...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
|
|
204
|
+
inFrame: null,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
const maxFrame = outFrame === null ? Infinity : outFrame - 1;
|
|
210
|
+
setInAndOutFrames((prev) => {
|
|
211
|
+
var _a;
|
|
212
|
+
return ({
|
|
213
|
+
...prev,
|
|
214
|
+
[videoConfig.id]: {
|
|
215
|
+
...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
|
|
216
|
+
inFrame: Math.min(maxFrame, frame),
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
if (frame > videoConfig.durationInFrames - 2) {
|
|
223
|
+
return setInAndOutFrames((prev) => {
|
|
224
|
+
var _a;
|
|
225
|
+
return ({
|
|
226
|
+
...prev,
|
|
227
|
+
[videoConfig.id]: {
|
|
228
|
+
...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
|
|
229
|
+
outFrame: null,
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
const minFrame = inFrame === null ? -Infinity : inFrame + 1;
|
|
235
|
+
setInAndOutFrames((prev) => {
|
|
236
|
+
var _a;
|
|
237
|
+
return ({
|
|
238
|
+
...prev,
|
|
239
|
+
[videoConfig.id]: {
|
|
240
|
+
...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
|
|
241
|
+
outFrame: Math.max(minFrame, frame),
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}, [
|
|
247
|
+
inFrame,
|
|
248
|
+
inOutDragging.dragging,
|
|
249
|
+
left,
|
|
250
|
+
outFrame,
|
|
251
|
+
setInAndOutFrames,
|
|
252
|
+
videoConfig,
|
|
253
|
+
width,
|
|
254
|
+
]);
|
|
255
|
+
(0, react_1.useEffect)(() => {
|
|
256
|
+
if (inOutDragging.dragging === false) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
window.addEventListener('pointermove', onPointerMoveInOut);
|
|
260
|
+
window.addEventListener('pointerup', onPointerUpInOut);
|
|
261
|
+
return () => {
|
|
262
|
+
window.removeEventListener('pointermove', onPointerMoveInOut);
|
|
263
|
+
window.removeEventListener('pointerup', onPointerUpInOut);
|
|
264
|
+
};
|
|
265
|
+
}, [inOutDragging.dragging, onPointerMoveInOut, onPointerUpInOut]);
|
|
266
|
+
const inContextMenu = (0, react_1.useMemo)(() => {
|
|
267
|
+
return [
|
|
268
|
+
{
|
|
269
|
+
id: 'hide-in',
|
|
270
|
+
keyHint: null,
|
|
271
|
+
label: 'Clear In marker',
|
|
272
|
+
leftItem: null,
|
|
273
|
+
onClick: (_, e) => {
|
|
274
|
+
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
275
|
+
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
276
|
+
setInAndOutFrames((prev) => {
|
|
277
|
+
var _a;
|
|
278
|
+
return ({
|
|
279
|
+
...prev,
|
|
280
|
+
[videoConfig.id]: {
|
|
281
|
+
...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
|
|
282
|
+
inFrame: null,
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
},
|
|
287
|
+
quickSwitcherLabel: null,
|
|
288
|
+
subMenu: null,
|
|
289
|
+
type: 'item',
|
|
290
|
+
value: 'hide-in',
|
|
291
|
+
},
|
|
292
|
+
];
|
|
293
|
+
}, [setInAndOutFrames, videoConfig.id]);
|
|
294
|
+
const outContextMenu = (0, react_1.useMemo)(() => {
|
|
295
|
+
return [
|
|
296
|
+
{
|
|
297
|
+
id: 'hide-out',
|
|
298
|
+
keyHint: null,
|
|
299
|
+
label: 'Clear Out marker',
|
|
300
|
+
leftItem: null,
|
|
301
|
+
onClick: (_, e) => {
|
|
302
|
+
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
303
|
+
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
304
|
+
setInAndOutFrames((prev) => {
|
|
305
|
+
var _a;
|
|
306
|
+
return ({
|
|
307
|
+
...prev,
|
|
308
|
+
[videoConfig.id]: {
|
|
309
|
+
...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
|
|
310
|
+
outFrame: null,
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
},
|
|
315
|
+
quickSwitcherLabel: null,
|
|
316
|
+
subMenu: null,
|
|
317
|
+
type: 'item',
|
|
318
|
+
value: 'hide-out',
|
|
319
|
+
},
|
|
320
|
+
];
|
|
321
|
+
}, [setInAndOutFrames, videoConfig.id]);
|
|
322
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [inFrame !== null && (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: inContextMenu, onOpen: null, children: jsx_runtime_1.jsx(TimelineInOutPointerHandle_1.TimelineInOutPointerHandle, { type: "in", atFrame: inFrame, dragging: inOutDragging.dragging === 'in', onPointerDown: onInPointerDown }) })), outFrame !== null && (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: outContextMenu, onOpen: null, children: jsx_runtime_1.jsx(TimelineInOutPointerHandle_1.TimelineInOutPointerHandle, { type: "out", dragging: inOutDragging.dragging === 'out', atFrame: outFrame, onPointerDown: onOutPointerDown }) }))] }));
|
|
323
|
+
};
|
|
324
|
+
const TimelineInOutDragHandlerInnerMemo = react_1.default.memo(TimelineInOutDragHandlerInner);
|
|
@@ -13,6 +13,7 @@ const areaHighlight = {
|
|
|
13
13
|
height: '100%',
|
|
14
14
|
bottom: 0,
|
|
15
15
|
top: 0,
|
|
16
|
+
pointerEvents: 'none',
|
|
16
17
|
};
|
|
17
18
|
exports.inMarkerAreaRef = (0, react_1.createRef)();
|
|
18
19
|
exports.outMarkerAreaRef = (0, react_1.createRef)();
|
|
@@ -31,7 +32,8 @@ const TimelineInOutPointer = () => {
|
|
|
31
32
|
...areaHighlight,
|
|
32
33
|
left: (0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(outFrame, videoConfig.durationInFrames, timelineWidth),
|
|
33
34
|
width: timelineWidth -
|
|
34
|
-
(0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(outFrame, videoConfig.durationInFrames,
|
|
35
|
+
(0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(outFrame, videoConfig.durationInFrames + 1, // last frame also has width of 1 frame
|
|
36
|
+
timelineWidth),
|
|
35
37
|
} }))] }));
|
|
36
38
|
};
|
|
37
39
|
exports.TimelineInOutPointer = TimelineInOutPointer;
|
|
@@ -18,7 +18,7 @@ const line = {
|
|
|
18
18
|
};
|
|
19
19
|
exports.inPointerHandle = (0, react_1.createRef)();
|
|
20
20
|
exports.outPointerHandle = (0, react_1.createRef)();
|
|
21
|
-
const InnerTimelineInOutPointerHandle = ({ atFrame, dragging, timelineWidth, type }) => {
|
|
21
|
+
const InnerTimelineInOutPointerHandle = ({ atFrame, dragging, onPointerDown, timelineWidth, type }) => {
|
|
22
22
|
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
23
23
|
const style = (0, react_1.useMemo)(() => {
|
|
24
24
|
return {
|
|
@@ -27,17 +27,18 @@ const InnerTimelineInOutPointerHandle = ({ atFrame, dragging, timelineWidth, typ
|
|
|
27
27
|
? colors_1.LIGHT_TRANSPARENT
|
|
28
28
|
: 'rgba(255, 255, 255, 0.1)',
|
|
29
29
|
transform: `translateX(${(0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(atFrame, videoConfig.durationInFrames, timelineWidth)}px)`,
|
|
30
|
+
top: 0,
|
|
30
31
|
};
|
|
31
32
|
}, [atFrame, dragging, timelineWidth, videoConfig.durationInFrames]);
|
|
32
|
-
return (jsx_runtime_1.jsx("div", { ref: type === 'in' ? exports.inPointerHandle : exports.outPointerHandle, style: style }));
|
|
33
|
+
return (jsx_runtime_1.jsx("div", { ref: type === 'in' ? exports.inPointerHandle : exports.outPointerHandle, style: style, onPointerDown: onPointerDown }));
|
|
33
34
|
};
|
|
34
|
-
const TimelineInOutPointerHandle = ({ dragging, type, atFrame, }) => {
|
|
35
|
+
const TimelineInOutPointerHandle = ({ dragging, onPointerDown, type, atFrame, }) => {
|
|
35
36
|
const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
|
|
36
37
|
// When switching from a content which has no timeline (still or asset preview)
|
|
37
38
|
// the timeline first needs to mount, so we need to wait for the timeline width
|
|
38
39
|
if (timelineWidth === null) {
|
|
39
40
|
return null;
|
|
40
41
|
}
|
|
41
|
-
return (jsx_runtime_1.jsx(InnerTimelineInOutPointerHandle, { atFrame: atFrame, dragging: dragging, timelineWidth: timelineWidth, type: type }));
|
|
42
|
+
return (jsx_runtime_1.jsx(InnerTimelineInOutPointerHandle, { atFrame: atFrame, dragging: dragging, onPointerDown: onPointerDown, timelineWidth: timelineWidth, type: type }));
|
|
42
43
|
};
|
|
43
44
|
exports.TimelineInOutPointerHandle = TimelineInOutPointerHandle;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CanUpdateSequencePropStatus, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
3
|
+
export declare const shouldShowTimelineKeyframeControls: ({ propStatus, selected, }: {
|
|
4
|
+
propStatus: CanUpdateSequencePropStatus | null;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
}) => boolean;
|
|
7
|
+
export declare const TimelineKeyframeControls: React.FC<{
|
|
8
|
+
readonly fieldKey: string;
|
|
9
|
+
readonly propStatus: CanUpdateSequencePropStatus;
|
|
10
|
+
readonly nodePath: SequencePropsSubscriptionKey;
|
|
11
|
+
readonly fileName: string;
|
|
12
|
+
readonly keyframeDisplayOffset: number;
|
|
13
|
+
readonly defaultValue: unknown;
|
|
14
|
+
readonly dragOverrideValue: unknown | undefined;
|
|
15
|
+
readonly schema: SequenceSchema;
|
|
16
|
+
readonly effectIndex: number | null;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimelineKeyframeControls = exports.shouldShowTimelineKeyframeControls = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const colors_1 = require("../../helpers/colors");
|
|
9
|
+
const call_add_keyframe_1 = require("./call-add-keyframe");
|
|
10
|
+
const call_delete_keyframe_1 = require("./call-delete-keyframe");
|
|
11
|
+
const get_keyframe_navigation_1 = require("./get-keyframe-navigation");
|
|
12
|
+
const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
|
|
13
|
+
const TimelineSelection_1 = require("./TimelineSelection");
|
|
14
|
+
const controlsContainerStyle = {
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexShrink: 0,
|
|
18
|
+
gap: 1,
|
|
19
|
+
marginRight: 4,
|
|
20
|
+
};
|
|
21
|
+
const navButtonStyle = {
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
background: 'none',
|
|
24
|
+
border: 'none',
|
|
25
|
+
color: 'white',
|
|
26
|
+
cursor: 'pointer',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexShrink: 0,
|
|
29
|
+
height: 12,
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
lineHeight: 1,
|
|
32
|
+
outline: 'none',
|
|
33
|
+
padding: 0,
|
|
34
|
+
userSelect: 'none',
|
|
35
|
+
width: 12,
|
|
36
|
+
};
|
|
37
|
+
const diamondButtonStyle = {
|
|
38
|
+
...navButtonStyle,
|
|
39
|
+
background: 'none',
|
|
40
|
+
};
|
|
41
|
+
const diamondIconStyle = {
|
|
42
|
+
borderRadius: 1,
|
|
43
|
+
boxShadow: '0 0 0 1px rgba(0, 0, 0, 0.4)',
|
|
44
|
+
height: 7,
|
|
45
|
+
transform: 'rotate(45deg)',
|
|
46
|
+
width: 7,
|
|
47
|
+
};
|
|
48
|
+
const svgStyle = { display: 'block' };
|
|
49
|
+
const getCurrentKeyframeValue = ({ propStatus, jsxFrame, defaultValue, dragOverrideValue, }) => {
|
|
50
|
+
if (propStatus.canUpdate) {
|
|
51
|
+
return remotion_1.Internals.getEffectiveVisualModeValue({
|
|
52
|
+
codeValue: propStatus,
|
|
53
|
+
dragOverrideValue,
|
|
54
|
+
defaultValue,
|
|
55
|
+
shouldResortToDefaultValueIfUndefined: true,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (propStatus.reason === 'keyframed') {
|
|
59
|
+
return remotion_1.Internals.interpolateKeyframedStatus({
|
|
60
|
+
frame: jsxFrame,
|
|
61
|
+
status: propStatus,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
};
|
|
66
|
+
const shouldShowTimelineKeyframeControls = ({ propStatus, selected, }) => {
|
|
67
|
+
if (propStatus === null) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (selected) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return (TimelineSelection_1.SELECTION_ENABLED &&
|
|
74
|
+
!propStatus.canUpdate &&
|
|
75
|
+
propStatus.reason === 'keyframed');
|
|
76
|
+
};
|
|
77
|
+
exports.shouldShowTimelineKeyframeControls = shouldShowTimelineKeyframeControls;
|
|
78
|
+
const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, keyframeDisplayOffset, defaultValue, dragOverrideValue, schema, effectIndex, }) => {
|
|
79
|
+
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
80
|
+
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
81
|
+
const setFrame = remotion_1.Internals.useTimelineSetFrame();
|
|
82
|
+
const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
83
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
84
|
+
const clientId = previewServerState.type === 'connected'
|
|
85
|
+
? previewServerState.clientId
|
|
86
|
+
: null;
|
|
87
|
+
const jsxFrame = timelinePosition - keyframeDisplayOffset;
|
|
88
|
+
const keyframes = (0, react_1.useMemo)(() => (0, get_timeline_keyframes_1.getTimelineKeyframes)(propStatus, keyframeDisplayOffset), [propStatus, keyframeDisplayOffset]);
|
|
89
|
+
const hasKeyframeAtCurrentFrame = (0, react_1.useMemo)(() => {
|
|
90
|
+
if (propStatus.canUpdate || propStatus.reason === 'computed') {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
return (0, get_keyframe_navigation_1.hasKeyframeAtSourceFrame)(propStatus.keyframes, jsxFrame);
|
|
94
|
+
}, [jsxFrame, propStatus]);
|
|
95
|
+
const previousDisplayFrame = (0, react_1.useMemo)(() => (0, get_keyframe_navigation_1.getPreviousKeyframeDisplayFrame)(keyframes, timelinePosition), [keyframes, timelinePosition]);
|
|
96
|
+
const nextDisplayFrame = (0, react_1.useMemo)(() => (0, get_keyframe_navigation_1.getNextKeyframeDisplayFrame)(keyframes, timelinePosition), [keyframes, timelinePosition]);
|
|
97
|
+
const canToggleKeyframe = propStatus.canUpdate || propStatus.reason === 'keyframed';
|
|
98
|
+
const seekToDisplayFrame = (0, react_1.useCallback)((frame) => {
|
|
99
|
+
setFrame((current) => {
|
|
100
|
+
const next = { ...current, [videoConfig.id]: frame };
|
|
101
|
+
remotion_1.Internals.persistCurrentFrame(next);
|
|
102
|
+
return next;
|
|
103
|
+
});
|
|
104
|
+
}, [setFrame, videoConfig.id]);
|
|
105
|
+
const onPrevious = (0, react_1.useCallback)((e) => {
|
|
106
|
+
e.stopPropagation();
|
|
107
|
+
if (previousDisplayFrame !== null) {
|
|
108
|
+
seekToDisplayFrame(previousDisplayFrame);
|
|
109
|
+
}
|
|
110
|
+
}, [previousDisplayFrame, seekToDisplayFrame]);
|
|
111
|
+
const onNext = (0, react_1.useCallback)((e) => {
|
|
112
|
+
e.stopPropagation();
|
|
113
|
+
if (nextDisplayFrame !== null) {
|
|
114
|
+
seekToDisplayFrame(nextDisplayFrame);
|
|
115
|
+
}
|
|
116
|
+
}, [nextDisplayFrame, seekToDisplayFrame]);
|
|
117
|
+
const onToggleKeyframe = (0, react_1.useCallback)(async (e) => {
|
|
118
|
+
e.stopPropagation();
|
|
119
|
+
if (!clientId || !canToggleKeyframe) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (hasKeyframeAtCurrentFrame &&
|
|
123
|
+
!propStatus.canUpdate &&
|
|
124
|
+
propStatus.reason === 'keyframed') {
|
|
125
|
+
if (effectIndex === null) {
|
|
126
|
+
await (0, call_delete_keyframe_1.callDeleteSequenceKeyframe)({
|
|
127
|
+
fileName,
|
|
128
|
+
nodePath,
|
|
129
|
+
fieldKey,
|
|
130
|
+
sourceFrame: jsxFrame,
|
|
131
|
+
schema,
|
|
132
|
+
setCodeValues,
|
|
133
|
+
clientId,
|
|
134
|
+
});
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
await (0, call_delete_keyframe_1.callDeleteEffectKeyframe)({
|
|
138
|
+
fileName,
|
|
139
|
+
nodePath,
|
|
140
|
+
effectIndex,
|
|
141
|
+
fieldKey,
|
|
142
|
+
sourceFrame: jsxFrame,
|
|
143
|
+
schema,
|
|
144
|
+
setCodeValues,
|
|
145
|
+
clientId,
|
|
146
|
+
});
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const value = getCurrentKeyframeValue({
|
|
150
|
+
propStatus,
|
|
151
|
+
jsxFrame,
|
|
152
|
+
defaultValue,
|
|
153
|
+
dragOverrideValue,
|
|
154
|
+
});
|
|
155
|
+
if (value === null) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (effectIndex === null) {
|
|
159
|
+
await (0, call_add_keyframe_1.callAddSequenceKeyframe)({
|
|
160
|
+
fileName,
|
|
161
|
+
nodePath,
|
|
162
|
+
fieldKey,
|
|
163
|
+
sourceFrame: jsxFrame,
|
|
164
|
+
value,
|
|
165
|
+
schema,
|
|
166
|
+
setCodeValues,
|
|
167
|
+
clientId,
|
|
168
|
+
});
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
await (0, call_add_keyframe_1.callAddEffectKeyframe)({
|
|
172
|
+
fileName,
|
|
173
|
+
nodePath,
|
|
174
|
+
effectIndex,
|
|
175
|
+
fieldKey,
|
|
176
|
+
sourceFrame: jsxFrame,
|
|
177
|
+
value,
|
|
178
|
+
schema,
|
|
179
|
+
setCodeValues,
|
|
180
|
+
clientId,
|
|
181
|
+
});
|
|
182
|
+
}, [
|
|
183
|
+
canToggleKeyframe,
|
|
184
|
+
clientId,
|
|
185
|
+
defaultValue,
|
|
186
|
+
dragOverrideValue,
|
|
187
|
+
effectIndex,
|
|
188
|
+
fieldKey,
|
|
189
|
+
fileName,
|
|
190
|
+
hasKeyframeAtCurrentFrame,
|
|
191
|
+
jsxFrame,
|
|
192
|
+
nodePath,
|
|
193
|
+
propStatus,
|
|
194
|
+
schema,
|
|
195
|
+
setCodeValues,
|
|
196
|
+
]);
|
|
197
|
+
const previousDisabled = previousDisplayFrame === null;
|
|
198
|
+
const nextDisabled = nextDisplayFrame === null;
|
|
199
|
+
const previousStyle = (0, react_1.useMemo)(() => ({
|
|
200
|
+
...navButtonStyle,
|
|
201
|
+
cursor: previousDisabled ? 'default' : 'pointer',
|
|
202
|
+
opacity: previousDisabled ? 0.35 : 1,
|
|
203
|
+
}), [previousDisabled]);
|
|
204
|
+
const nextStyle = (0, react_1.useMemo)(() => ({
|
|
205
|
+
...navButtonStyle,
|
|
206
|
+
cursor: nextDisabled ? 'default' : 'pointer',
|
|
207
|
+
opacity: nextDisabled ? 0.35 : 1,
|
|
208
|
+
}), [nextDisabled]);
|
|
209
|
+
const diamondStyle = (0, react_1.useMemo)(() => ({
|
|
210
|
+
...diamondButtonStyle,
|
|
211
|
+
cursor: canToggleKeyframe && clientId ? 'pointer' : 'default',
|
|
212
|
+
opacity: canToggleKeyframe && clientId ? 1 : 0.35,
|
|
213
|
+
}), [canToggleKeyframe, clientId]);
|
|
214
|
+
const diamondIcon = (0, react_1.useMemo)(() => ({
|
|
215
|
+
...diamondIconStyle,
|
|
216
|
+
backgroundColor: hasKeyframeAtCurrentFrame ? colors_1.BLUE : colors_1.LIGHT_TEXT,
|
|
217
|
+
}), [hasKeyframeAtCurrentFrame]);
|
|
218
|
+
return (jsx_runtime_1.jsxs("div", { style: controlsContainerStyle, children: [
|
|
219
|
+
jsx_runtime_1.jsx("button", { type: "button", style: previousStyle, disabled: previousDisabled, onPointerDown: previousDisabled ? undefined : onPrevious, "aria-label": "Go to previous keyframe", title: "Previous keyframe", children: jsx_runtime_1.jsx("svg", { width: "14", height: "14", viewBox: "0 0 10 10", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M7 1.5L3 5L7 8.5Z", fill: "#ccc" }) }) }), jsx_runtime_1.jsx("button", { type: "button", style: diamondStyle, disabled: !canToggleKeyframe || !clientId, onPointerDown: canToggleKeyframe && clientId ? onToggleKeyframe : undefined, "aria-label": hasKeyframeAtCurrentFrame ? 'Remove keyframe' : 'Add keyframe', title: hasKeyframeAtCurrentFrame ? 'Remove keyframe' : 'Add keyframe', children: jsx_runtime_1.jsx("span", { style: diamondIcon }) }), jsx_runtime_1.jsx("button", { type: "button", style: nextStyle, disabled: nextDisabled, onPointerDown: nextDisabled ? undefined : onNext, "aria-label": "Go to next keyframe", title: "Next keyframe", children: jsx_runtime_1.jsx("svg", { width: "14", height: "14", viewBox: "0 0 10 10", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M3 1.5L7 5L3 8.5Z", fill: "#ccc" }) }) })
|
|
220
|
+
] }));
|
|
221
|
+
};
|
|
222
|
+
exports.TimelineKeyframeControls = TimelineKeyframeControls;
|
|
@@ -49,7 +49,6 @@ const diamondBase = {
|
|
|
49
49
|
backgroundColor: colors_1.LIGHT_TEXT,
|
|
50
50
|
borderRadius: 1,
|
|
51
51
|
boxShadow: '0 0 0 1px rgba(0, 0, 0, 0.4)',
|
|
52
|
-
pointerEvents: 'none',
|
|
53
52
|
};
|
|
54
53
|
const TimelineKeyframeDiamondUnmemoized = ({ frame, rowHeight, nodePathInfo }) => {
|
|
55
54
|
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
@@ -61,11 +60,10 @@ const TimelineKeyframeDiamondUnmemoized = ({ frame, rowHeight, nodePathInfo }) =
|
|
|
61
60
|
}
|
|
62
61
|
return {
|
|
63
62
|
...diamondBase,
|
|
64
|
-
backgroundColor:
|
|
65
|
-
|
|
66
|
-
: colors_1.LIGHT_TEXT,
|
|
63
|
+
backgroundColor: colors_1.LIGHT_TEXT,
|
|
64
|
+
outline: selected ? '2px solid ' + colors_1.BLUE : 'none',
|
|
67
65
|
border: 'none',
|
|
68
|
-
cursor: '
|
|
66
|
+
cursor: 'pointer',
|
|
69
67
|
left: (0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(frame, videoConfig.durationInFrames, timelineWidth) - timeline_layout_1.TIMELINE_PADDING,
|
|
70
68
|
padding: 0,
|
|
71
69
|
pointerEvents: 'auto',
|
|
@@ -76,7 +74,10 @@ const TimelineKeyframeDiamondUnmemoized = ({ frame, rowHeight, nodePathInfo }) =
|
|
|
76
74
|
const onPointerDown = (0, react_1.useCallback)((e) => {
|
|
77
75
|
if (e.button === 0) {
|
|
78
76
|
e.stopPropagation();
|
|
79
|
-
onSelect(
|
|
77
|
+
onSelect({
|
|
78
|
+
shiftKey: e.shiftKey,
|
|
79
|
+
toggleKey: e.metaKey || e.ctrlKey,
|
|
80
|
+
});
|
|
80
81
|
}
|
|
81
82
|
}, [onSelect]);
|
|
82
83
|
if (style === null) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CanUpdateSequencePropStatusKeyframed } from 'remotion';
|
|
3
|
+
import type { SchemaFieldInfo } from '../../helpers/timeline-layout';
|
|
4
|
+
export declare const TimelineKeyframedValue: React.FC<{
|
|
5
|
+
readonly field: SchemaFieldInfo;
|
|
6
|
+
readonly propStatus: CanUpdateSequencePropStatusKeyframed;
|
|
7
|
+
readonly keyframeDisplayOffset: number;
|
|
8
|
+
}>;
|