@remotion/studio 4.0.482 → 4.0.484
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Canvas.js +19 -0
- package/dist/components/ColorPicker/ColorPicker.js +65 -3
- package/dist/components/ColorPicker/ColorPickerPopup.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPickerPopup.js +3 -2
- package/dist/components/InspectorPanel/EasingInspector.js +184 -10
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.d.ts +14 -0
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +146 -0
- package/dist/components/InspectorPanel/KeyframeInspector.d.ts +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +228 -5
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +17 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +93 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -58
- package/dist/components/InspectorPanel/common.d.ts +12 -0
- package/dist/components/InspectorPanel/common.js +78 -1
- package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +14 -0
- package/dist/components/InspectorPanel/easing-inspector-selection.js +18 -0
- package/dist/components/InspectorPanel/keyframe-easing-navigator-items.d.ts +24 -0
- package/dist/components/InspectorPanel/keyframe-easing-navigator-items.js +40 -0
- package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +8 -0
- package/dist/components/InspectorPanel/keyframe-inspector-frame.js +14 -0
- package/dist/components/InspectorPanel/styles.d.ts +1 -0
- package/dist/components/InspectorPanel/styles.js +9 -1
- package/dist/components/InspectorSequenceSection.js +47 -10
- package/dist/components/Preview.js +1 -1
- package/dist/components/SelectedOutlineOverlay.d.ts +2 -0
- package/dist/components/SelectedOutlineOverlay.js +33 -12
- package/dist/components/SelectedOutlineUvControls.js +461 -2
- package/dist/components/Timeline/EasingEditorModal.js +48 -5
- package/dist/components/Timeline/Timeline.js +2 -1
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +11 -1
- package/dist/components/Timeline/TimelineEffectItem.js +8 -5
- package/dist/components/Timeline/TimelineEffectPropItem.js +82 -1
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +2 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +37 -7
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +4 -0
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +12 -6
- package/dist/components/Timeline/TimelineKeyframedValue.js +1 -0
- package/dist/components/Timeline/TimelineRowChrome.js +6 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +7 -1
- package/dist/components/Timeline/TimelineSelection.js +19 -3
- package/dist/components/Timeline/TimelineSequence.js +20 -8
- package/dist/components/Timeline/TimelineSequenceItem.js +64 -28
- package/dist/components/Timeline/TimelineSequenceName.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceName.js +7 -6
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +1 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +80 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +40 -1
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +308 -1
- package/dist/components/Timeline/TimelineSlider.js +17 -3
- package/dist/components/Timeline/TimelineTrack.js +2 -4
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +8 -2
- package/dist/components/Timeline/delete-selected-timeline-item.js +80 -1
- package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +18 -0
- package/dist/components/Timeline/get-animation-item-selection-for-frame.js +49 -0
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +15 -0
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +26 -0
- package/dist/components/Timeline/save-sequence-prop.js +2 -0
- package/dist/components/Timeline/should-subscribe-to-sequence-props.d.ts +4 -0
- package/dist/components/Timeline/should-subscribe-to-sequence-props.js +10 -0
- package/dist/components/Timeline/update-selected-easing.d.ts +1 -0
- package/dist/components/Timeline/update-selected-easing.js +4 -3
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +2 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +19 -13
- package/dist/components/element-drag-and-drop.d.ts +3 -0
- package/dist/components/element-drag-and-drop.js +30 -0
- package/dist/components/import-assets.d.ts +11 -0
- package/dist/components/import-assets.js +23 -1
- package/dist/components/selected-outline-uv.d.ts +71 -1
- package/dist/components/selected-outline-uv.js +332 -10
- package/dist/esm/{chunk-nkqfa5bw.js → chunk-9erwh79m.js} +11896 -9019
- package/dist/esm/internals.mjs +11896 -9019
- package/dist/esm/previewEntry.mjs +11923 -9046
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/timeline-layout.d.ts +3 -3
- package/dist/helpers/timeline-layout.js +3 -1
- package/dist/helpers/use-menu-structure.js +0 -14
- package/package.json +11 -11
|
@@ -2,20 +2,69 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KeyframeInspector = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const remotion_1 = require("remotion");
|
|
8
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
7
9
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
8
10
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
11
|
+
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
12
|
+
const call_delete_keyframe_1 = require("../Timeline/call-delete-keyframe");
|
|
13
|
+
const call_move_keyframe_1 = require("../Timeline/call-move-keyframe");
|
|
14
|
+
const get_easing_selection_after_keyframe_delete_1 = require("../Timeline/get-easing-selection-after-keyframe-delete");
|
|
9
15
|
const parse_keyframe_field_from_node_path_1 = require("../Timeline/parse-keyframe-field-from-node-path");
|
|
10
16
|
const TimelineEffectPropItem_1 = require("../Timeline/TimelineEffectPropItem");
|
|
17
|
+
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
11
18
|
const TimelineSequencePropItem_1 = require("../Timeline/TimelineSequencePropItem");
|
|
19
|
+
const update_selected_easing_1 = require("../Timeline/update-selected-easing");
|
|
12
20
|
const common_1 = require("./common");
|
|
21
|
+
const keyframe_inspector_frame_1 = require("./keyframe-inspector-frame");
|
|
22
|
+
const KeyframeEasingNavigator_1 = require("./KeyframeEasingNavigator");
|
|
23
|
+
const SequenceInspectorHeader_1 = require("./SequenceInspectorHeader");
|
|
13
24
|
const styles_1 = require("./styles");
|
|
14
25
|
const use_track_for_selection_1 = require("./use-track-for-selection");
|
|
26
|
+
const makeMovedKeyframedDragOverride = ({ details, toFrame, }) => {
|
|
27
|
+
if (!(0, studio_shared_1.canMoveKeyframesWithoutCollisions)({
|
|
28
|
+
status: details.propStatus,
|
|
29
|
+
moves: [{ fromFrame: details.sourceFrame, toFrame }],
|
|
30
|
+
})) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const movedStatus = (0, studio_shared_1.moveKeyframesInPropStatus)({
|
|
34
|
+
status: details.propStatus,
|
|
35
|
+
moves: [{ fromFrame: details.sourceFrame, toFrame }],
|
|
36
|
+
});
|
|
37
|
+
if (movedStatus.status !== 'keyframed') {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
type: 'keyframed',
|
|
42
|
+
status: movedStatus,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const removeKeyframeIcon = {
|
|
46
|
+
display: 'block',
|
|
47
|
+
flexShrink: 0,
|
|
48
|
+
height: 13,
|
|
49
|
+
width: 12,
|
|
50
|
+
};
|
|
51
|
+
const TrashIcon = ({ color }) => {
|
|
52
|
+
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 448 512", style: removeKeyframeIcon, children: jsx_runtime_1.jsx("path", { fill: color, d: "M136.7 5.9C141.1-7.2 153.3-16 167.1-16l113.9 0c13.8 0 26 8.8 30.4 21.9L320 32 416 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 8.7-26.1zM32 144l384 0 0 304c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-304zm88 64c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24z" }) }));
|
|
53
|
+
};
|
|
15
54
|
const KeyframeInspector = ({ selection }) => {
|
|
16
55
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
56
|
+
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
57
|
+
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
17
58
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
59
|
+
const { clearDragOverrides, clearEffectDragOverrides, setDragOverrides, setEffectDragOverrides, setPropStatuses, } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
18
60
|
const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
61
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
62
|
+
const { selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
63
|
+
const [draftFrame, setDraftFrame] = (0, react_1.useState)(selection.frame);
|
|
64
|
+
const parentSelection = (0, react_1.useMemo)(() => (0, TimelineSelection_1.getTimelineSelectionFromNodePathInfo)(selection.nodePathInfo), [selection.nodePathInfo]);
|
|
65
|
+
(0, react_1.useEffect)(() => {
|
|
66
|
+
setDraftFrame(selection.frame);
|
|
67
|
+
}, [selection.frame]);
|
|
19
68
|
const details = (0, react_1.useMemo)(() => {
|
|
20
69
|
var _a;
|
|
21
70
|
var _b, _c, _d, _e, _f, _g;
|
|
@@ -47,6 +96,7 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
47
96
|
field: sequenceField,
|
|
48
97
|
fieldLabel: (_d = sequenceField.description) !== null && _d !== void 0 ? _d : sequenceField.key,
|
|
49
98
|
fileName: nodePath.absolutePath,
|
|
99
|
+
keyframeDisplayOffset,
|
|
50
100
|
nodePath,
|
|
51
101
|
propStatus: sequencePropStatus,
|
|
52
102
|
schema: track.sequence.controls.schema,
|
|
@@ -78,9 +128,14 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
78
128
|
}
|
|
79
129
|
return {
|
|
80
130
|
type: 'effect',
|
|
131
|
+
effectIndex: keyframeField.effectIndex,
|
|
81
132
|
field: effectField,
|
|
82
133
|
fieldLabel: (_g = effectField.description) !== null && _g !== void 0 ? _g : effectField.key,
|
|
134
|
+
fileName: nodePath.absolutePath,
|
|
135
|
+
keyframeDisplayOffset,
|
|
83
136
|
nodePath,
|
|
137
|
+
propStatus: effectPropStatus,
|
|
138
|
+
schema: effect.schema,
|
|
84
139
|
sourceFrame,
|
|
85
140
|
validatedLocation: {
|
|
86
141
|
source: nodePath.absolutePath,
|
|
@@ -95,15 +150,183 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
95
150
|
selection,
|
|
96
151
|
track,
|
|
97
152
|
]);
|
|
98
|
-
|
|
153
|
+
const clearFrameDragOverride = (0, react_1.useCallback)((detailsToClear) => {
|
|
154
|
+
if (detailsToClear === null) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (detailsToClear.type === 'sequence') {
|
|
158
|
+
clearDragOverrides(detailsToClear.nodePath);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
clearEffectDragOverrides(detailsToClear.nodePath, detailsToClear.effectIndex);
|
|
162
|
+
}, [clearDragOverrides, clearEffectDragOverrides]);
|
|
163
|
+
const onFrameChange = (0, react_1.useCallback)((value) => {
|
|
164
|
+
const displayFrame = (0, keyframe_inspector_frame_1.clampInspectorKeyframeDisplayFrame)({
|
|
165
|
+
durationInFrames: videoConfig.durationInFrames,
|
|
166
|
+
frame: value,
|
|
167
|
+
});
|
|
168
|
+
setDraftFrame(displayFrame);
|
|
169
|
+
if (details === null) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const toFrame = (0, keyframe_inspector_frame_1.getInspectorKeyframeSourceFrame)({
|
|
173
|
+
displayFrame,
|
|
174
|
+
keyframeDisplayOffset: details.keyframeDisplayOffset,
|
|
175
|
+
});
|
|
176
|
+
if (displayFrame === selection.frame || toFrame === details.sourceFrame) {
|
|
177
|
+
clearFrameDragOverride(details);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const dragOverrideValue = makeMovedKeyframedDragOverride({
|
|
181
|
+
details,
|
|
182
|
+
toFrame,
|
|
183
|
+
});
|
|
184
|
+
if (dragOverrideValue === null) {
|
|
185
|
+
clearFrameDragOverride(details);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (details.type === 'sequence') {
|
|
189
|
+
setDragOverrides(details.nodePath, details.field.key, dragOverrideValue);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
setEffectDragOverrides(details.nodePath, details.effectIndex, details.field.key, dragOverrideValue);
|
|
193
|
+
}, [
|
|
194
|
+
clearFrameDragOverride,
|
|
195
|
+
details,
|
|
196
|
+
selection.frame,
|
|
197
|
+
setDragOverrides,
|
|
198
|
+
setEffectDragOverrides,
|
|
199
|
+
videoConfig.durationInFrames,
|
|
200
|
+
]);
|
|
201
|
+
const onFrameChangeEnd = (0, react_1.useCallback)((value) => {
|
|
202
|
+
if (details === null || previewServerState.type !== 'connected') {
|
|
203
|
+
clearFrameDragOverride(details);
|
|
204
|
+
setDraftFrame(selection.frame);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const displayFrame = (0, keyframe_inspector_frame_1.clampInspectorKeyframeDisplayFrame)({
|
|
208
|
+
durationInFrames: videoConfig.durationInFrames,
|
|
209
|
+
frame: value,
|
|
210
|
+
});
|
|
211
|
+
const toFrame = (0, keyframe_inspector_frame_1.getInspectorKeyframeSourceFrame)({
|
|
212
|
+
displayFrame,
|
|
213
|
+
keyframeDisplayOffset: details.keyframeDisplayOffset,
|
|
214
|
+
});
|
|
215
|
+
setDraftFrame(displayFrame);
|
|
216
|
+
clearFrameDragOverride(details);
|
|
217
|
+
if (displayFrame === selection.frame || toFrame === details.sourceFrame) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (makeMovedKeyframedDragOverride({ details, toFrame }) === null) {
|
|
221
|
+
setDraftFrame(selection.frame);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
selectItems([
|
|
225
|
+
{
|
|
226
|
+
...selection,
|
|
227
|
+
frame: displayFrame,
|
|
228
|
+
},
|
|
229
|
+
], { reveal: true });
|
|
230
|
+
const move = {
|
|
231
|
+
fileName: details.fileName,
|
|
232
|
+
nodePath: details.nodePath,
|
|
233
|
+
fieldKey: details.field.key,
|
|
234
|
+
fromFrame: details.sourceFrame,
|
|
235
|
+
toFrame,
|
|
236
|
+
schema: details.schema,
|
|
237
|
+
};
|
|
238
|
+
(0, call_move_keyframe_1.callMoveKeyframes)({
|
|
239
|
+
sequenceKeyframes: details.type === 'sequence' ? [move] : [],
|
|
240
|
+
effectKeyframes: details.type === 'effect'
|
|
241
|
+
? [
|
|
242
|
+
{
|
|
243
|
+
...move,
|
|
244
|
+
effectIndex: details.effectIndex,
|
|
245
|
+
},
|
|
246
|
+
]
|
|
247
|
+
: [],
|
|
248
|
+
setPropStatuses,
|
|
249
|
+
clientId: previewServerState.clientId,
|
|
250
|
+
}).catch(() => undefined);
|
|
251
|
+
}, [
|
|
252
|
+
clearFrameDragOverride,
|
|
253
|
+
details,
|
|
254
|
+
previewServerState,
|
|
255
|
+
selection,
|
|
256
|
+
selectItems,
|
|
257
|
+
setPropStatuses,
|
|
258
|
+
videoConfig.durationInFrames,
|
|
259
|
+
]);
|
|
260
|
+
const onSelectParent = (0, react_1.useCallback)((event) => {
|
|
261
|
+
event.stopPropagation();
|
|
262
|
+
if (parentSelection === null) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
selectItems([parentSelection], { reveal: true });
|
|
266
|
+
}, [parentSelection, selectItems]);
|
|
267
|
+
const removeDisabled = previewServerState.type !== 'connected';
|
|
268
|
+
const onRemoveKeyframe = (0, react_1.useCallback)((event) => {
|
|
269
|
+
event.stopPropagation();
|
|
270
|
+
if (details === null || previewServerState.type !== 'connected') {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const easingSelection = (0, update_selected_easing_1.canEditEasingForInterpolationFunction)(details.propStatus.interpolationFunction)
|
|
274
|
+
? (0, get_easing_selection_after_keyframe_delete_1.getEasingSelectionAfterKeyframeDelete)({
|
|
275
|
+
deletedSourceFrames: [details.sourceFrame],
|
|
276
|
+
keyframeDisplayOffset: details.keyframeDisplayOffset,
|
|
277
|
+
nodePathInfo: selection.nodePathInfo,
|
|
278
|
+
propStatus: details.propStatus,
|
|
279
|
+
timelinePosition,
|
|
280
|
+
})
|
|
281
|
+
: null;
|
|
282
|
+
if (easingSelection !== null) {
|
|
283
|
+
selectItems([easingSelection], { reveal: true });
|
|
284
|
+
}
|
|
285
|
+
else if (parentSelection !== null) {
|
|
286
|
+
selectItems([parentSelection], { reveal: true });
|
|
287
|
+
}
|
|
288
|
+
if (details.type === 'sequence') {
|
|
289
|
+
(0, call_delete_keyframe_1.callDeleteSequenceKeyframe)({
|
|
290
|
+
fileName: details.fileName,
|
|
291
|
+
nodePath: details.nodePath,
|
|
292
|
+
fieldKey: details.field.key,
|
|
293
|
+
sourceFrame: details.sourceFrame,
|
|
294
|
+
schema: details.schema,
|
|
295
|
+
setPropStatuses,
|
|
296
|
+
clientId: previewServerState.clientId,
|
|
297
|
+
}).catch(() => undefined);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
(0, call_delete_keyframe_1.callDeleteEffectKeyframe)({
|
|
301
|
+
fileName: details.fileName,
|
|
302
|
+
nodePath: details.nodePath,
|
|
303
|
+
effectIndex: details.effectIndex,
|
|
304
|
+
fieldKey: details.field.key,
|
|
305
|
+
sourceFrame: details.sourceFrame,
|
|
306
|
+
schema: details.schema,
|
|
307
|
+
setPropStatuses,
|
|
308
|
+
clientId: previewServerState.clientId,
|
|
309
|
+
}).catch(() => undefined);
|
|
310
|
+
}, [
|
|
311
|
+
details,
|
|
312
|
+
parentSelection,
|
|
313
|
+
previewServerState,
|
|
314
|
+
selectItems,
|
|
315
|
+
selection.nodePathInfo,
|
|
316
|
+
setPropStatuses,
|
|
317
|
+
timelinePosition,
|
|
318
|
+
]);
|
|
319
|
+
if (details === null || track === null) {
|
|
99
320
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Keyframe unavailable" });
|
|
100
321
|
}
|
|
101
322
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
|
|
102
|
-
jsx_runtime_1.jsx(
|
|
103
|
-
|
|
323
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeaderWithDivider, { track: track }), jsx_runtime_1.jsx(common_1.InspectorBackHeaderWithDivider, { disabled: parentSelection === null, onClick: onSelectParent, title: "Back to property", children: jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderTitle, children: details.fieldLabel }) }), jsx_runtime_1.jsx(KeyframeEasingNavigator_1.KeyframeEasingNavigator, { currentSelection: selection, includeEasings: (0, update_selected_easing_1.canEditEasingForInterpolationFunction)(details.propStatus.interpolationFunction), keyframes: details.propStatus.keyframes.map((keyframe) => ({
|
|
324
|
+
...keyframe,
|
|
325
|
+
frame: keyframe.frame + details.keyframeDisplayOffset,
|
|
326
|
+
})), nodePathInfo: selection.nodePathInfo }), jsx_runtime_1.jsxs("div", { style: styles_1.detailsContainer, children: [
|
|
327
|
+
jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Frame", children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: draftFrame, status: "ok", onValueChange: onFrameChange, onValueChangeEnd: onFrameChangeEnd, onTextChange: () => undefined, min: 0, max: Math.max(0, videoConfig.durationInFrames - 1), step: 1, formatter: (value) => String(Math.round(Number(value))), rightAlign: true, small: true }) }), jsx_runtime_1.jsxs("div", { style: styles_1.keyframeEditorRow, children: [
|
|
104
328
|
jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorLabel, children: details.fieldLabel }), jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorValue, children: details.type === 'sequence' ? (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequenceKeyframedValue, { field: details.field, fileName: details.fileName, nodePath: details.nodePath, schema: details.schema, propStatus: details.propStatus, sourceFrame: details.sourceFrame })) : (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropValue, { field: details.field, nodePath: details.nodePath, validatedLocation: details.validatedLocation, sourceFrame: details.sourceFrame })) })
|
|
105
|
-
] })
|
|
106
|
-
] })
|
|
329
|
+
] }), jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: removeDisabled, onClick: onRemoveKeyframe, renderIcon: (color) => jsx_runtime_1.jsx(TrashIcon, { color: color }), children: "Remove keyframe" })] })
|
|
107
330
|
] }));
|
|
108
331
|
};
|
|
109
332
|
exports.KeyframeInspector = KeyframeInspector;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CodePosition } from '../../error-overlay/react-overlay/utils/get-source-map';
|
|
3
|
+
import type { TrackWithHash } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
|
+
type SequenceInspectorSourceLocation = {
|
|
5
|
+
readonly canOpenInEditor: boolean;
|
|
6
|
+
readonly openFileLocation: () => void;
|
|
7
|
+
readonly validatedLocation: CodePosition | null;
|
|
8
|
+
};
|
|
9
|
+
export declare const useSequenceInspectorSourceLocation: (sequence: import("remotion").TSequence) => SequenceInspectorSourceLocation;
|
|
10
|
+
export declare const SequenceInspectorHeader: React.FC<{
|
|
11
|
+
readonly sourceLocation: SequenceInspectorSourceLocation;
|
|
12
|
+
readonly track: TrackWithHash;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const SequenceInspectorHeaderWithDivider: React.FC<{
|
|
15
|
+
readonly track: TrackWithHash;
|
|
16
|
+
}>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SequenceInspectorHeaderWithDivider = exports.SequenceInspectorHeader = exports.useSequenceInspectorSourceLocation = 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 InspectorSourceLocation_1 = require("../InspectorSourceLocation");
|
|
8
|
+
const use_open_sequence_in_editor_1 = require("../Timeline/use-open-sequence-in-editor");
|
|
9
|
+
const styles_1 = require("./styles");
|
|
10
|
+
const useSequenceInspectorSourceLocation = (sequence) => {
|
|
11
|
+
const { canOpenInEditor, openInEditor, originalLocation } = (0, use_open_sequence_in_editor_1.useOpenSequenceInEditor)(sequence);
|
|
12
|
+
const validatedLocation = (0, react_1.useMemo)(() => {
|
|
13
|
+
var _a;
|
|
14
|
+
if (!originalLocation ||
|
|
15
|
+
!originalLocation.source ||
|
|
16
|
+
!originalLocation.line) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
source: originalLocation.source,
|
|
21
|
+
line: originalLocation.line,
|
|
22
|
+
column: (_a = originalLocation.column) !== null && _a !== void 0 ? _a : 0,
|
|
23
|
+
};
|
|
24
|
+
}, [originalLocation]);
|
|
25
|
+
const openFileLocation = (0, react_1.useCallback)(() => {
|
|
26
|
+
if (!canOpenInEditor) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
openInEditor();
|
|
30
|
+
}, [canOpenInEditor, openInEditor]);
|
|
31
|
+
return {
|
|
32
|
+
canOpenInEditor,
|
|
33
|
+
openFileLocation,
|
|
34
|
+
validatedLocation,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
exports.useSequenceInspectorSourceLocation = useSequenceInspectorSourceLocation;
|
|
38
|
+
const useSequenceDisplayName = (track) => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
var _c;
|
|
41
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
42
|
+
const nodePath = (_c = (_a = track.nodePathInfo) === null || _a === void 0 ? void 0 : _a.sequenceSubscriptionKey) !== null && _c !== void 0 ? _c : null;
|
|
43
|
+
return (0, react_1.useMemo)(() => {
|
|
44
|
+
var _a;
|
|
45
|
+
const propStatusesForOverride = nodePath
|
|
46
|
+
? remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)
|
|
47
|
+
: undefined;
|
|
48
|
+
const codeNameStatus = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.name;
|
|
49
|
+
const fallbackDisplayName = ((_a = track.sequence.controls) === null || _a === void 0 ? void 0 : _a.componentName) || '<Sequence>';
|
|
50
|
+
if ((codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status) === 'static' &&
|
|
51
|
+
typeof codeNameStatus.codeValue === 'string') {
|
|
52
|
+
return codeNameStatus.codeValue;
|
|
53
|
+
}
|
|
54
|
+
if ((codeNameStatus === null || codeNameStatus === void 0 ? void 0 : codeNameStatus.status) === 'static') {
|
|
55
|
+
return fallbackDisplayName;
|
|
56
|
+
}
|
|
57
|
+
return track.sequence.displayName || fallbackDisplayName;
|
|
58
|
+
}, [
|
|
59
|
+
nodePath,
|
|
60
|
+
propStatuses,
|
|
61
|
+
(_b = track.sequence.controls) === null || _b === void 0 ? void 0 : _b.componentName,
|
|
62
|
+
track.sequence.displayName,
|
|
63
|
+
]);
|
|
64
|
+
};
|
|
65
|
+
const SequenceInspectorHeader = ({ sourceLocation, track }) => {
|
|
66
|
+
var _a;
|
|
67
|
+
const sequenceDisplayName = useSequenceDisplayName(track);
|
|
68
|
+
const { documentationLink } = track.sequence;
|
|
69
|
+
const openDocumentationLink = (0, react_1.useCallback)(() => {
|
|
70
|
+
if (!documentationLink) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
window.open(documentationLink, '_blank', 'noopener,noreferrer');
|
|
74
|
+
}, [documentationLink]);
|
|
75
|
+
const subtitleStyle = (0, react_1.useMemo)(() => {
|
|
76
|
+
return {
|
|
77
|
+
...styles_1.sequenceHeaderSubtitle,
|
|
78
|
+
cursor: documentationLink ? 'pointer' : 'default',
|
|
79
|
+
};
|
|
80
|
+
}, [documentationLink]);
|
|
81
|
+
const componentName = (_a = track.sequence.controls) === null || _a === void 0 ? void 0 : _a.componentName;
|
|
82
|
+
return (jsx_runtime_1.jsxs("div", { style: styles_1.sequenceHeader, children: [
|
|
83
|
+
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderTitle, children: sequenceDisplayName }), documentationLink ? (jsx_runtime_1.jsx("button", { type: "button", style: subtitleStyle, title: "Open component docs", onClick: openDocumentationLink, children: componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation })
|
|
84
|
+
] }));
|
|
85
|
+
};
|
|
86
|
+
exports.SequenceInspectorHeader = SequenceInspectorHeader;
|
|
87
|
+
const SequenceInspectorHeaderWithDivider = ({ track }) => {
|
|
88
|
+
const sourceLocation = (0, exports.useSequenceInspectorSourceLocation)(track.sequence);
|
|
89
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
90
|
+
jsx_runtime_1.jsx(exports.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider })
|
|
91
|
+
] }));
|
|
92
|
+
};
|
|
93
|
+
exports.SequenceInspectorHeaderWithDivider = SequenceInspectorHeaderWithDivider;
|
|
@@ -3,71 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SequenceSelectionInspector = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
6
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
7
|
const InspectorSequenceSection_1 = require("../InspectorSequenceSection");
|
|
9
|
-
const InspectorSourceLocation_1 = require("../InspectorSourceLocation");
|
|
10
8
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
11
9
|
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
12
|
-
const use_open_sequence_in_editor_1 = require("../Timeline/use-open-sequence-in-editor");
|
|
13
10
|
const common_1 = require("./common");
|
|
11
|
+
const SequenceInspectorHeader_1 = require("./SequenceInspectorHeader");
|
|
14
12
|
const styles_1 = require("./styles");
|
|
15
13
|
const use_track_for_selection_1 = require("./use-track-for-selection");
|
|
16
|
-
const useSequenceDisplayName = (track) => {
|
|
17
|
-
var _a;
|
|
18
|
-
var _b;
|
|
19
|
-
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
20
|
-
const nodePath = (_b = (_a = track.nodePathInfo) === null || _a === void 0 ? void 0 : _a.sequenceSubscriptionKey) !== null && _b !== void 0 ? _b : null;
|
|
21
|
-
return (0, react_1.useMemo)(() => {
|
|
22
|
-
const propStatusesForOverride = nodePath
|
|
23
|
-
? remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath)
|
|
24
|
-
: undefined;
|
|
25
|
-
const codeNameStatus = propStatusesForOverride === null || propStatusesForOverride === void 0 ? void 0 : propStatusesForOverride.name;
|
|
26
|
-
const displayName = codeNameStatus &&
|
|
27
|
-
codeNameStatus.status === 'static' &&
|
|
28
|
-
typeof codeNameStatus.codeValue === 'string'
|
|
29
|
-
? codeNameStatus.codeValue
|
|
30
|
-
: track.sequence.displayName;
|
|
31
|
-
return displayName || '<Sequence>';
|
|
32
|
-
}, [nodePath, propStatuses, track.sequence.displayName]);
|
|
33
|
-
};
|
|
34
14
|
const SequenceExpandedInspector = ({ track }) => {
|
|
35
15
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
36
16
|
const { selectedItems, selectItems } = (0, TimelineSelection_1.useTimelineSelection)();
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const { documentationLink } = track.sequence;
|
|
40
|
-
const validatedLocation = (0, react_1.useMemo)(() => {
|
|
41
|
-
var _a;
|
|
42
|
-
if (!originalLocation ||
|
|
43
|
-
!originalLocation.source ||
|
|
44
|
-
!originalLocation.line) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
source: originalLocation.source,
|
|
49
|
-
line: originalLocation.line,
|
|
50
|
-
column: (_a = originalLocation.column) !== null && _a !== void 0 ? _a : 0,
|
|
51
|
-
};
|
|
52
|
-
}, [originalLocation]);
|
|
53
|
-
const openFileLocation = (0, react_1.useCallback)(() => {
|
|
54
|
-
if (!canOpenInEditor) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
openInEditor();
|
|
58
|
-
}, [canOpenInEditor, openInEditor]);
|
|
59
|
-
const openDocumentationLink = (0, react_1.useCallback)(() => {
|
|
60
|
-
if (!documentationLink) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
window.open(documentationLink, '_blank', 'noopener,noreferrer');
|
|
64
|
-
}, [documentationLink]);
|
|
65
|
-
const subtitleStyle = (0, react_1.useMemo)(() => {
|
|
66
|
-
return {
|
|
67
|
-
...styles_1.sequenceHeaderSubtitle,
|
|
68
|
-
cursor: documentationLink ? 'pointer' : 'default',
|
|
69
|
-
};
|
|
70
|
-
}, [documentationLink]);
|
|
17
|
+
const sourceLocation = (0, SequenceInspectorHeader_1.useSequenceInspectorSourceLocation)(track.sequence);
|
|
18
|
+
const { validatedLocation } = sourceLocation;
|
|
71
19
|
const sequenceSelection = (0, react_1.useMemo)(() => {
|
|
72
20
|
if (!track.nodePathInfo) {
|
|
73
21
|
return null;
|
|
@@ -103,9 +51,7 @@ const SequenceExpandedInspector = ({ track }) => {
|
|
|
103
51
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
104
52
|
}
|
|
105
53
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
|
|
106
|
-
jsx_runtime_1.
|
|
107
|
-
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderTitle, children: sequenceDisplayName }), documentationLink ? (jsx_runtime_1.jsx("button", { type: "button", style: subtitleStyle, title: "Open component docs", onClick: openDocumentationLink, children: track.sequence.controls.componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: track.sequence.controls.componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: canOpenInEditor, onOpen: openFileLocation })
|
|
108
|
-
] }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })) })] }));
|
|
54
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })) })] }));
|
|
109
55
|
};
|
|
110
56
|
const SequenceSelectionInspector = ({ selection }) => {
|
|
111
57
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
@@ -3,6 +3,12 @@ import type { RenderModalWarning } from '../RenderModal/DataEditor';
|
|
|
3
3
|
export declare const InspectorSectionHeader: React.FC<{
|
|
4
4
|
readonly children: React.ReactNode;
|
|
5
5
|
}>;
|
|
6
|
+
export declare const InspectorBackHeaderWithDivider: React.FC<{
|
|
7
|
+
readonly children: React.ReactNode;
|
|
8
|
+
readonly disabled: boolean;
|
|
9
|
+
readonly onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
}>;
|
|
6
12
|
export declare const InspectorMessage: React.FC<{
|
|
7
13
|
readonly children: React.ReactNode;
|
|
8
14
|
}>;
|
|
@@ -10,6 +16,12 @@ export declare const InspectorDetailRow: React.FC<{
|
|
|
10
16
|
readonly label: string;
|
|
11
17
|
readonly children: React.ReactNode;
|
|
12
18
|
}>;
|
|
19
|
+
export declare const InspectorInlineAction: React.FC<{
|
|
20
|
+
readonly children: React.ReactNode;
|
|
21
|
+
readonly disabled: boolean;
|
|
22
|
+
readonly onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
23
|
+
readonly renderIcon: (color: string) => React.ReactNode;
|
|
24
|
+
}>;
|
|
13
25
|
export declare const InspectorDefaultPropsWarnings: React.FC<{
|
|
14
26
|
readonly warnings: RenderModalWarning[];
|
|
15
27
|
}>;
|
|
@@ -1,17 +1,94 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InspectorDefaultPropsWarnings = exports.InspectorDetailRow = exports.InspectorMessage = exports.InspectorSectionHeader = void 0;
|
|
6
|
+
exports.InspectorDefaultPropsWarnings = exports.InspectorInlineAction = exports.InspectorDetailRow = exports.InspectorMessage = exports.InspectorBackHeaderWithDivider = exports.InspectorSectionHeader = void 0;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const colors_1 = require("../../helpers/colors");
|
|
10
|
+
const InlineAction_1 = require("../InlineAction");
|
|
5
11
|
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
6
12
|
const styles_1 = require("./styles");
|
|
7
13
|
const InspectorSectionHeader = ({ children }) => jsx_runtime_1.jsx("div", { style: styles_1.sectionHeader, children: children });
|
|
8
14
|
exports.InspectorSectionHeader = InspectorSectionHeader;
|
|
15
|
+
const backIcon = {
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
height: 12,
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
width: 12,
|
|
21
|
+
};
|
|
22
|
+
const BackChevron = ({ color }) => {
|
|
23
|
+
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 8 12", style: backIcon, children: jsx_runtime_1.jsx("path", { d: "M6 1L2 6L6 11", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }));
|
|
24
|
+
};
|
|
25
|
+
const InspectorBackHeaderWithDivider = ({ children, disabled, onClick, title }) => {
|
|
26
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
27
|
+
jsx_runtime_1.jsx(exports.InspectorSectionHeader, { children: jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderRow, children: jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderStart, children: [jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: disabled, onClick: onClick, title: title, renderAction: (color) => jsx_runtime_1.jsx(BackChevron, { color: color }) }), children] }) }) }), jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider })
|
|
28
|
+
] }));
|
|
29
|
+
};
|
|
30
|
+
exports.InspectorBackHeaderWithDivider = InspectorBackHeaderWithDivider;
|
|
9
31
|
const InspectorMessage = ({ children }) => jsx_runtime_1.jsx("div", { style: styles_1.centeredMessage, children: children });
|
|
10
32
|
exports.InspectorMessage = InspectorMessage;
|
|
11
33
|
const InspectorDetailRow = ({ label, children }) => (jsx_runtime_1.jsxs("div", { style: styles_1.detailRow, children: [
|
|
12
34
|
jsx_runtime_1.jsx("div", { style: styles_1.detailLabel, children: label }), jsx_runtime_1.jsx("div", { style: styles_1.detailValue, children: children })
|
|
13
35
|
] }));
|
|
14
36
|
exports.InspectorDetailRow = InspectorDetailRow;
|
|
37
|
+
const inlineLabelButton = {
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
appearance: 'none',
|
|
40
|
+
backgroundColor: 'transparent',
|
|
41
|
+
border: 'none',
|
|
42
|
+
color: colors_1.LIGHT_TEXT,
|
|
43
|
+
cursor: 'default',
|
|
44
|
+
display: 'flex',
|
|
45
|
+
fontFamily: 'sans-serif',
|
|
46
|
+
fontSize: 13,
|
|
47
|
+
gap: 8,
|
|
48
|
+
lineHeight: '18px',
|
|
49
|
+
margin: 0,
|
|
50
|
+
padding: '10px 0 0',
|
|
51
|
+
};
|
|
52
|
+
const inlineLabelButtonDisabled = {
|
|
53
|
+
...inlineLabelButton,
|
|
54
|
+
opacity: 0.35,
|
|
55
|
+
};
|
|
56
|
+
const inlineLabelText = {
|
|
57
|
+
color: colors_1.LIGHT_TEXT,
|
|
58
|
+
fontFamily: 'sans-serif',
|
|
59
|
+
fontSize: 13,
|
|
60
|
+
lineHeight: '18px',
|
|
61
|
+
};
|
|
62
|
+
const inlineLabelIcon = {
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
display: 'flex',
|
|
65
|
+
flexShrink: 0,
|
|
66
|
+
height: 13,
|
|
67
|
+
justifyContent: 'center',
|
|
68
|
+
width: 13,
|
|
69
|
+
};
|
|
70
|
+
const InspectorInlineAction = ({ children, disabled, onClick, renderIcon }) => {
|
|
71
|
+
const [hovered, setHovered] = react_1.default.useState(false);
|
|
72
|
+
const color = hovered && !disabled ? 'white' : colors_1.LIGHT_TEXT;
|
|
73
|
+
const buttonStyle = react_1.default.useMemo(() => ({
|
|
74
|
+
...(disabled ? inlineLabelButtonDisabled : inlineLabelButton),
|
|
75
|
+
color,
|
|
76
|
+
}), [color, disabled]);
|
|
77
|
+
const textStyle = react_1.default.useMemo(() => ({
|
|
78
|
+
...inlineLabelText,
|
|
79
|
+
color,
|
|
80
|
+
}), [color]);
|
|
81
|
+
const onPointerEnter = react_1.default.useCallback(() => {
|
|
82
|
+
setHovered(true);
|
|
83
|
+
}, []);
|
|
84
|
+
const onPointerLeave = react_1.default.useCallback(() => {
|
|
85
|
+
setHovered(false);
|
|
86
|
+
}, []);
|
|
87
|
+
return (jsx_runtime_1.jsxs("button", { type: "button", disabled: disabled, style: buttonStyle, onClick: onClick, onPointerEnter: disabled ? undefined : onPointerEnter, onPointerLeave: onPointerLeave, children: [
|
|
88
|
+
jsx_runtime_1.jsx("span", { style: inlineLabelIcon, children: renderIcon(color) }), jsx_runtime_1.jsx("span", { style: textStyle, children: children })
|
|
89
|
+
] }));
|
|
90
|
+
};
|
|
91
|
+
exports.InspectorInlineAction = InspectorInlineAction;
|
|
15
92
|
const InspectorDefaultPropsWarnings = ({ warnings }) => {
|
|
16
93
|
return (jsx_runtime_1.jsx("div", { style: styles_1.defaultPropsWarningMessages, children: warnings.map((warning) => (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: warning.message, align: "flex-start", type: "warning", size: "compact", action: warning.resolveLink ? (jsx_runtime_1.jsx("a", { href: warning.resolveLink, target: "_blank", rel: "noopener noreferrer", style: styles_1.resolveLinkStyle, children: "Resolve" })) : null }, warning.id))) }));
|
|
17
94
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CanUpdateSequencePropStatusKeyframed } from 'remotion';
|
|
2
|
+
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
3
|
+
export declare const getEasingSelectionFromCurrentKeyframes: ({ keyframeDisplayOffset, nodePathInfo, propStatus, segmentIndex, }: {
|
|
4
|
+
readonly keyframeDisplayOffset: number;
|
|
5
|
+
readonly nodePathInfo: SequenceNodePathInfo;
|
|
6
|
+
readonly propStatus: CanUpdateSequencePropStatusKeyframed;
|
|
7
|
+
readonly segmentIndex: number;
|
|
8
|
+
}) => {
|
|
9
|
+
readonly type: "easing";
|
|
10
|
+
readonly nodePathInfo: SequenceNodePathInfo;
|
|
11
|
+
readonly fromFrame: number;
|
|
12
|
+
readonly toFrame: number;
|
|
13
|
+
readonly segmentIndex: number;
|
|
14
|
+
} | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEasingSelectionFromCurrentKeyframes = void 0;
|
|
4
|
+
const getEasingSelectionFromCurrentKeyframes = ({ keyframeDisplayOffset, nodePathInfo, propStatus, segmentIndex, }) => {
|
|
5
|
+
const fromKeyframe = propStatus.keyframes[segmentIndex];
|
|
6
|
+
const toKeyframe = propStatus.keyframes[segmentIndex + 1];
|
|
7
|
+
if (!fromKeyframe || !toKeyframe) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
type: 'easing',
|
|
12
|
+
nodePathInfo,
|
|
13
|
+
fromFrame: fromKeyframe.frame + keyframeDisplayOffset,
|
|
14
|
+
toFrame: toKeyframe.frame + keyframeDisplayOffset,
|
|
15
|
+
segmentIndex,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
exports.getEasingSelectionFromCurrentKeyframes = getEasingSelectionFromCurrentKeyframes;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
2
|
+
import type { TimelineSelection } from '../Timeline/TimelineSelection';
|
|
3
|
+
export type KeyframeNavigatorItem = {
|
|
4
|
+
readonly selection: Extract<TimelineSelection, {
|
|
5
|
+
type: 'keyframe';
|
|
6
|
+
}>;
|
|
7
|
+
readonly type: 'keyframe';
|
|
8
|
+
};
|
|
9
|
+
export type EasingNavigatorItem = {
|
|
10
|
+
readonly selection: Extract<TimelineSelection, {
|
|
11
|
+
type: 'easing';
|
|
12
|
+
}>;
|
|
13
|
+
readonly type: 'easing';
|
|
14
|
+
};
|
|
15
|
+
export type NavigatorItem = KeyframeNavigatorItem | EasingNavigatorItem;
|
|
16
|
+
export type NavigatorKeyframe = {
|
|
17
|
+
readonly frame: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const getKeyframeEasingNavigatorItems: ({ includeEasings, keyframes, nodePathInfo, }: {
|
|
20
|
+
readonly includeEasings: boolean;
|
|
21
|
+
readonly keyframes: readonly NavigatorKeyframe[];
|
|
22
|
+
readonly nodePathInfo: SequenceNodePathInfo;
|
|
23
|
+
}) => NavigatorItem[];
|
|
24
|
+
export declare const getNavigatorItemPlayheadFrame: (item: NavigatorItem) => number;
|