@remotion/studio 4.0.468 → 4.0.470
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.d.ts +1 -0
- package/dist/components/AudioWaveform.js +41 -23
- package/dist/components/CompositionSelectorItem.js +1 -1
- package/dist/components/ContextMenu.d.ts +1 -0
- package/dist/components/ContextMenu.js +8 -3
- package/dist/components/EditorContent.js +5 -4
- package/dist/components/EditorGuides/Guide.js +1 -1
- package/dist/components/ExpandedTracksProvider.js +3 -8
- package/dist/components/Menu/MenuItem.d.ts +1 -1
- package/dist/components/Menu/MenuItem.js +2 -2
- package/dist/components/Menu/MenuSubItem.js +5 -5
- package/dist/components/MenuBuildIndicator.js +0 -1
- package/dist/components/NewComposition/InputDragger.js +1 -0
- package/dist/components/Preview.js +4 -1
- package/dist/components/PreviewToolbar.js +2 -4
- package/dist/components/SelectedOutlineOverlay.d.ts +18 -0
- package/dist/components/SelectedOutlineOverlay.js +645 -0
- package/dist/components/Timeline/Timeline.js +18 -3
- package/dist/components/Timeline/TimelineDeleteKeybindings.d.ts +2 -0
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +86 -0
- package/dist/components/Timeline/TimelineDragHandler.js +19 -244
- package/dist/components/Timeline/{TimelineEffectGroupRow.d.ts → TimelineEffectItem.d.ts} +1 -1
- package/dist/components/Timeline/{TimelineEffectGroupRow.js → TimelineEffectItem.js} +61 -35
- package/dist/components/Timeline/{TimelineEffectFieldRow.d.ts → TimelineEffectPropItem.d.ts} +4 -1
- package/dist/components/Timeline/{TimelineEffectFieldRow.js → TimelineEffectPropItem.js} +100 -16
- package/dist/components/Timeline/TimelineExpandArrowButton.js +5 -1
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +11 -0
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +55 -0
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +29 -11
- package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
- package/dist/components/Timeline/TimelineExpandedSection.js +4 -4
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +9 -120
- package/dist/components/Timeline/TimelineFieldLabel.d.ts +6 -0
- package/dist/components/Timeline/TimelineFieldLabel.js +30 -0
- 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/TimelineItemStack.d.ts +5 -0
- package/dist/components/Timeline/TimelineItemStack.js +82 -0
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +17 -0
- package/dist/components/Timeline/TimelineKeyframeControls.js +217 -0
- package/dist/components/Timeline/TimelineKeyframeDiamond.d.ts +7 -0
- package/dist/components/Timeline/TimelineKeyframeDiamond.js +88 -0
- package/dist/components/Timeline/TimelineKeyframedValue.d.ts +8 -0
- package/dist/components/Timeline/TimelineKeyframedValue.js +36 -0
- package/dist/components/Timeline/TimelineLayerEye.js +1 -0
- package/dist/components/Timeline/TimelineList.js +3 -11
- package/dist/components/Timeline/TimelineMediaInfo.d.ts +13 -1
- package/dist/components/Timeline/TimelineMediaInfo.js +33 -80
- package/dist/components/Timeline/TimelineRowChrome.d.ts +10 -1
- package/dist/components/Timeline/TimelineRowChrome.js +64 -6
- package/dist/components/Timeline/TimelineSchemaField.js +7 -2
- package/dist/components/Timeline/TimelineSelection.d.ts +85 -0
- package/dist/components/Timeline/TimelineSelection.js +417 -0
- 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 -2
- package/dist/components/Timeline/{TimelineListItem.js → TimelineSequenceItem.js} +148 -63
- package/dist/components/Timeline/TimelineSequenceName.d.ts +7 -0
- package/dist/components/Timeline/TimelineSequenceName.js +50 -0
- package/dist/components/Timeline/{TimelineFieldRow.d.ts → TimelineSequencePropItem.d.ts} +5 -3
- package/dist/components/Timeline/TimelineSequencePropItem.js +183 -0
- package/dist/components/Timeline/TimelineTimeIndicators.js +0 -1
- package/dist/components/Timeline/TimelineTrack.d.ts +5 -0
- package/dist/components/Timeline/TimelineTrack.js +66 -0
- package/dist/components/Timeline/TimelineTracks.js +2 -16
- package/dist/components/Timeline/TimelineTranslateField.js +14 -22
- package/dist/components/Timeline/TimelineUvCoordinateField.d.ts +11 -0
- package/dist/components/Timeline/TimelineUvCoordinateField.js +126 -0
- package/dist/components/Timeline/TimelineVideoInfo.js +11 -12
- 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 +21 -0
- package/dist/components/Timeline/call-delete-keyframe.js +50 -0
- package/dist/components/Timeline/delete-selected-keyframe.d.ts +11 -0
- package/dist/components/Timeline/delete-selected-keyframe.js +51 -0
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +17 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +183 -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/get-node-keyframes.d.ts +11 -0
- package/dist/components/Timeline/get-node-keyframes.js +23 -0
- package/dist/components/Timeline/get-timeline-keyframes.js +6 -8
- 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/save-sequence-prop.d.ts +14 -2
- package/dist/components/Timeline/save-sequence-prop.js +42 -7
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +11 -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-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.d.ts +17 -0
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +52 -0
- package/dist/components/Timeline/use-open-sequence-in-editor.d.ts +6 -0
- package/dist/components/Timeline/use-open-sequence-in-editor.js +31 -0
- package/dist/components/composition-menu-items.js +32 -1
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +0 -1
- package/dist/esm/{chunk-8q828zk7.js → chunk-dny42qnq.js} +10566 -6221
- package/dist/esm/internals.mjs +10566 -6221
- package/dist/esm/previewEntry.mjs +10548 -6203
- package/dist/esm/renderEntry.mjs +3 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/colors.js +1 -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/open-in-editor.d.ts +1 -1
- package/dist/helpers/open-in-editor.js +11 -26
- package/dist/helpers/timeline-layout.d.ts +8 -7
- package/dist/helpers/timeline-layout.js +9 -8
- package/dist/helpers/timeline-node-path-key.d.ts +2 -0
- package/dist/helpers/timeline-node-path-key.js +10 -0
- package/dist/helpers/use-menu-structure.js +8 -16
- package/dist/renderEntry.js +2 -2
- package/package.json +10 -10
- package/dist/components/Timeline/TimelineFieldRow.js +0 -113
- package/dist/components/Timeline/TimelineStack/index.d.ts +0 -8
- package/dist/components/Timeline/TimelineStack/index.js +0 -119
|
@@ -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,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimelineItemStack = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
7
|
+
const colors_1 = require("../../helpers/colors");
|
|
8
|
+
const get_git_menu_item_1 = require("../../helpers/get-git-menu-item");
|
|
9
|
+
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
10
|
+
const layout_1 = require("../layout");
|
|
11
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
12
|
+
const Spinner_1 = require("../Spinner");
|
|
13
|
+
const TimelineSelection_1 = require("./TimelineSelection");
|
|
14
|
+
const source_attribution_1 = require("./TimelineStack/source-attribution");
|
|
15
|
+
const TimelineItemStack = ({ originalLocation }) => {
|
|
16
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
17
|
+
const [opening, setOpening] = (0, react_1.useState)(false);
|
|
18
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
19
|
+
.previewServerState.type;
|
|
20
|
+
const openEditor = (0, react_1.useCallback)(async (location) => {
|
|
21
|
+
if (!window.remotion_editorName) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
setOpening(true);
|
|
25
|
+
try {
|
|
26
|
+
await (0, open_in_editor_1.openOriginalPositionInEditor)(location);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
setOpening(false);
|
|
33
|
+
}
|
|
34
|
+
}, []);
|
|
35
|
+
const canOpenInEditor = Boolean(window.remotion_editorName &&
|
|
36
|
+
connectionStatus === 'connected' &&
|
|
37
|
+
originalLocation);
|
|
38
|
+
const canOpenInGitHub = Boolean(window.remotion_gitSource && originalLocation);
|
|
39
|
+
const hoverable = !TimelineSelection_1.SELECTION_ENABLED && (canOpenInEditor || canOpenInGitHub);
|
|
40
|
+
const onClick = (0, react_1.useCallback)(() => {
|
|
41
|
+
if (!originalLocation) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (canOpenInEditor) {
|
|
45
|
+
openEditor(originalLocation);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (canOpenInGitHub) {
|
|
49
|
+
window.open((0, get_git_menu_item_1.getGitRefUrl)(window.remotion_gitSource, originalLocation), '_blank');
|
|
50
|
+
}
|
|
51
|
+
}, [canOpenInEditor, canOpenInGitHub, openEditor, originalLocation]);
|
|
52
|
+
const onPointerEnter = (0, react_1.useCallback)(() => setHovered(true), []);
|
|
53
|
+
const onPointerLeave = (0, react_1.useCallback)(() => setHovered(false), []);
|
|
54
|
+
const style = (0, react_1.useMemo)(() => {
|
|
55
|
+
return {
|
|
56
|
+
fontSize: 12,
|
|
57
|
+
color: opening
|
|
58
|
+
? colors_1.VERY_LIGHT_TEXT
|
|
59
|
+
: hovered && hoverable
|
|
60
|
+
? colors_1.LIGHT_TEXT
|
|
61
|
+
: colors_1.VERY_LIGHT_TEXT,
|
|
62
|
+
cursor: hoverable ? 'pointer' : undefined,
|
|
63
|
+
display: 'flex',
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
whiteSpace: 'nowrap',
|
|
67
|
+
textOverflow: 'ellipsis',
|
|
68
|
+
overflow: 'hidden',
|
|
69
|
+
flexShrink: 100000,
|
|
70
|
+
userSelect: 'none',
|
|
71
|
+
WebkitUserSelect: 'none',
|
|
72
|
+
};
|
|
73
|
+
}, [opening, hovered, hoverable]);
|
|
74
|
+
if (!originalLocation) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
78
|
+
jsx_runtime_1.jsx("div", { onPointerEnter: hoverable ? onPointerEnter : undefined, onPointerLeave: hoverable ? onPointerLeave : undefined, onClick: hoverable ? onClick : undefined, style: style, children: (0, source_attribution_1.getOriginalSourceAttribution)(originalLocation) }), opening ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
79
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: 12 })
|
|
80
|
+
] })) : null] }));
|
|
81
|
+
};
|
|
82
|
+
exports.TimelineItemStack = TimelineItemStack;
|
|
@@ -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
|
+
}>;
|