@remotion/studio 4.0.437 → 4.0.438
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.
|
@@ -38,8 +38,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
40
40
|
const calculate_timeline_1 = require("../../helpers/calculate-timeline");
|
|
41
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
41
42
|
const colors_1 = require("../../helpers/colors");
|
|
42
43
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
44
|
+
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
43
45
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
44
46
|
const SplitterContainer_1 = require("../Splitter/SplitterContainer");
|
|
45
47
|
const SplitterElement_1 = require("../Splitter/SplitterElement");
|
|
@@ -68,6 +70,10 @@ const noop = () => undefined;
|
|
|
68
70
|
const TimelineInner = () => {
|
|
69
71
|
var _a;
|
|
70
72
|
const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
|
|
73
|
+
const { expandedTracks } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksContext);
|
|
74
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
75
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) &&
|
|
76
|
+
previewServerState.type === 'connected';
|
|
71
77
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
72
78
|
const timeline = (0, react_1.useMemo)(() => {
|
|
73
79
|
if (!videoConfig) {
|
|
@@ -91,9 +97,15 @@ const TimelineInner = () => {
|
|
|
91
97
|
const inner = (0, react_1.useMemo)(() => {
|
|
92
98
|
return {
|
|
93
99
|
height: shown.reduce((acc, track) => {
|
|
100
|
+
var _a;
|
|
101
|
+
const isExpanded = visualModeEnabled && ((_a = expandedTracks[track.sequence.id]) !== null && _a !== void 0 ? _a : false);
|
|
94
102
|
return (acc +
|
|
95
103
|
(0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type === 'video' ? 'video' : 'other') +
|
|
96
|
-
Number(timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM)
|
|
104
|
+
Number(timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM) +
|
|
105
|
+
(isExpanded
|
|
106
|
+
? (0, timeline_layout_1.getExpandedTrackHeight)(track.sequence.controls) +
|
|
107
|
+
timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM
|
|
108
|
+
: 0));
|
|
97
109
|
}, 0) +
|
|
98
110
|
timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM +
|
|
99
111
|
(hasBeenCut ? MaxTimelineTracks_1.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) +
|
|
@@ -103,7 +115,7 @@ const TimelineInner = () => {
|
|
|
103
115
|
minHeight: '100%',
|
|
104
116
|
overflowX: 'hidden',
|
|
105
117
|
};
|
|
106
|
-
}, [hasBeenCut, shown]);
|
|
118
|
+
}, [hasBeenCut, shown, expandedTracks, visualModeEnabled]);
|
|
107
119
|
return (jsx_runtime_1.jsx("div", { ref: timeline_refs_1.timelineVerticalScroll, style: container, className: 'css-reset ' + is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(TimelineWidthProvider_1.TimelineWidthProvider, { children: jsx_runtime_1.jsx("div", { style: inner, children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, children: [
|
|
108
120
|
jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "flexer", sticky: jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimePlaceholders, {}), children: jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown }) }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { onCollapse: noop, allowToCollapse: "none" }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { type: "anti-flexer", sticky: null, children: jsx_runtime_1.jsxs(TimelineScrollable_1.TimelineScrollable, { children: [
|
|
109
121
|
jsx_runtime_1.jsx(TimelineTracks_1.TimelineTracks, { timeline: shown, hasBeenCut: hasBeenCut }), jsx_runtime_1.jsx(TimelineInOutPointer_1.TimelineInOutPointer, {}), jsx_runtime_1.jsx(TimelinePlayCursorSyncer_1.TimelinePlayCursorSyncer, {}), jsx_runtime_1.jsx(TimelineDragHandler_1.TimelineDragHandler, {}), jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimeIndicators, {}), jsx_runtime_1.jsx(TimelineSlider_1.TimelineSlider, {})
|
|
@@ -20773,6 +20773,33 @@ var calculateTimeline = ({
|
|
|
20773
20773
|
});
|
|
20774
20774
|
};
|
|
20775
20775
|
|
|
20776
|
+
// src/components/ExpandedTracksProvider.tsx
|
|
20777
|
+
import { createContext as createContext21, useCallback as useCallback96, useMemo as useMemo101, useState as useState67 } from "react";
|
|
20778
|
+
import { jsx as jsx188 } from "react/jsx-runtime";
|
|
20779
|
+
var ExpandedTracksContext = createContext21({
|
|
20780
|
+
expandedTracks: {},
|
|
20781
|
+
toggleTrack: () => {
|
|
20782
|
+
throw new Error("ExpandedTracksContext not initialized");
|
|
20783
|
+
}
|
|
20784
|
+
});
|
|
20785
|
+
var ExpandedTracksProvider = ({ children }) => {
|
|
20786
|
+
const [expandedTracks, setExpandedTracks] = useState67({});
|
|
20787
|
+
const toggleTrack = useCallback96((id) => {
|
|
20788
|
+
setExpandedTracks((prev) => ({
|
|
20789
|
+
...prev,
|
|
20790
|
+
[id]: !prev[id]
|
|
20791
|
+
}));
|
|
20792
|
+
}, []);
|
|
20793
|
+
const value = useMemo101(() => ({
|
|
20794
|
+
expandedTracks,
|
|
20795
|
+
toggleTrack
|
|
20796
|
+
}), [expandedTracks, toggleTrack]);
|
|
20797
|
+
return /* @__PURE__ */ jsx188(ExpandedTracksContext.Provider, {
|
|
20798
|
+
value,
|
|
20799
|
+
children
|
|
20800
|
+
});
|
|
20801
|
+
};
|
|
20802
|
+
|
|
20776
20803
|
// src/components/Timeline/is-collapsed.ts
|
|
20777
20804
|
var isTrackHidden = (track) => {
|
|
20778
20805
|
if (!track.sequence.parent) {
|
|
@@ -20812,19 +20839,19 @@ var MaxTimelineTracksReached = () => {
|
|
|
20812
20839
|
// src/components/Timeline/TimelineDragHandler.tsx
|
|
20813
20840
|
import { PlayerInternals as PlayerInternals16 } from "@remotion/player";
|
|
20814
20841
|
import {
|
|
20815
|
-
useCallback as
|
|
20842
|
+
useCallback as useCallback97,
|
|
20816
20843
|
useContext as useContext65,
|
|
20817
20844
|
useEffect as useEffect65,
|
|
20818
|
-
useMemo as
|
|
20845
|
+
useMemo as useMemo103,
|
|
20819
20846
|
useRef as useRef36,
|
|
20820
|
-
useState as
|
|
20847
|
+
useState as useState68
|
|
20821
20848
|
} from "react";
|
|
20822
20849
|
import { Internals as Internals47, useVideoConfig as useVideoConfig4 } from "remotion";
|
|
20823
20850
|
|
|
20824
20851
|
// src/components/Timeline/TimelineInOutPointer.tsx
|
|
20825
20852
|
import { createRef as createRef10, useContext as useContext63 } from "react";
|
|
20826
20853
|
import { Internals as Internals46 } from "remotion";
|
|
20827
|
-
import { jsx as
|
|
20854
|
+
import { jsx as jsx189, jsxs as jsxs90, Fragment as Fragment27 } from "react/jsx-runtime";
|
|
20828
20855
|
var areaHighlight = {
|
|
20829
20856
|
position: "absolute",
|
|
20830
20857
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
@@ -20843,7 +20870,7 @@ var TimelineInOutPointer = () => {
|
|
|
20843
20870
|
}
|
|
20844
20871
|
return /* @__PURE__ */ jsxs90(Fragment27, {
|
|
20845
20872
|
children: [
|
|
20846
|
-
inFrame !== null && /* @__PURE__ */
|
|
20873
|
+
inFrame !== null && /* @__PURE__ */ jsx189("div", {
|
|
20847
20874
|
ref: inMarkerAreaRef,
|
|
20848
20875
|
style: {
|
|
20849
20876
|
...areaHighlight,
|
|
@@ -20851,7 +20878,7 @@ var TimelineInOutPointer = () => {
|
|
|
20851
20878
|
width: getXPositionOfItemInTimelineImperatively(inFrame, videoConfig.durationInFrames, timelineWidth)
|
|
20852
20879
|
}
|
|
20853
20880
|
}),
|
|
20854
|
-
outFrame !== null && /* @__PURE__ */
|
|
20881
|
+
outFrame !== null && /* @__PURE__ */ jsx189("div", {
|
|
20855
20882
|
ref: outMarkerAreaRef,
|
|
20856
20883
|
style: {
|
|
20857
20884
|
...areaHighlight,
|
|
@@ -20864,9 +20891,9 @@ var TimelineInOutPointer = () => {
|
|
|
20864
20891
|
};
|
|
20865
20892
|
|
|
20866
20893
|
// src/components/Timeline/TimelineInOutPointerHandle.tsx
|
|
20867
|
-
import { createRef as createRef11, useContext as useContext64, useMemo as
|
|
20894
|
+
import { createRef as createRef11, useContext as useContext64, useMemo as useMemo102 } from "react";
|
|
20868
20895
|
import { useVideoConfig as useVideoConfig3 } from "remotion";
|
|
20869
|
-
import { jsx as
|
|
20896
|
+
import { jsx as jsx190 } from "react/jsx-runtime";
|
|
20870
20897
|
var line3 = {
|
|
20871
20898
|
height: "100%",
|
|
20872
20899
|
width: 1,
|
|
@@ -20880,14 +20907,14 @@ var inPointerHandle = createRef11();
|
|
|
20880
20907
|
var outPointerHandle = createRef11();
|
|
20881
20908
|
var InnerTimelineInOutPointerHandle = ({ atFrame, dragging, timelineWidth, type }) => {
|
|
20882
20909
|
const videoConfig = useVideoConfig3();
|
|
20883
|
-
const style10 =
|
|
20910
|
+
const style10 = useMemo102(() => {
|
|
20884
20911
|
return {
|
|
20885
20912
|
...line3,
|
|
20886
20913
|
backgroundColor: dragging ? LIGHT_TRANSPARENT : "rgba(255, 255, 255, 0.1)",
|
|
20887
20914
|
transform: `translateX(${getXPositionOfItemInTimelineImperatively(atFrame, videoConfig.durationInFrames, timelineWidth)}px)`
|
|
20888
20915
|
};
|
|
20889
20916
|
}, [atFrame, dragging, timelineWidth, videoConfig.durationInFrames]);
|
|
20890
|
-
return /* @__PURE__ */
|
|
20917
|
+
return /* @__PURE__ */ jsx190("div", {
|
|
20891
20918
|
ref: type === "in" ? inPointerHandle : outPointerHandle,
|
|
20892
20919
|
style: style10
|
|
20893
20920
|
});
|
|
@@ -20901,7 +20928,7 @@ var TimelineInOutPointerHandle = ({
|
|
|
20901
20928
|
if (timelineWidth === null) {
|
|
20902
20929
|
return null;
|
|
20903
20930
|
}
|
|
20904
|
-
return /* @__PURE__ */
|
|
20931
|
+
return /* @__PURE__ */ jsx190(InnerTimelineInOutPointerHandle, {
|
|
20905
20932
|
atFrame,
|
|
20906
20933
|
dragging,
|
|
20907
20934
|
timelineWidth,
|
|
@@ -20910,7 +20937,7 @@ var TimelineInOutPointerHandle = ({
|
|
|
20910
20937
|
};
|
|
20911
20938
|
|
|
20912
20939
|
// src/components/Timeline/TimelineDragHandler.tsx
|
|
20913
|
-
import { jsx as
|
|
20940
|
+
import { jsx as jsx191, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
20914
20941
|
var inner = {
|
|
20915
20942
|
overflowY: "auto",
|
|
20916
20943
|
overflowX: "hidden"
|
|
@@ -20935,7 +20962,7 @@ var TimelineDragHandler = () => {
|
|
|
20935
20962
|
const video = Internals47.useUnsafeVideoConfig();
|
|
20936
20963
|
const { zoom: zoomMap } = useContext65(TimelineZoomCtx);
|
|
20937
20964
|
const { canvasContent } = useContext65(Internals47.CompositionManager);
|
|
20938
|
-
const containerStyle3 =
|
|
20965
|
+
const containerStyle3 = useMemo103(() => {
|
|
20939
20966
|
if (!canvasContent || canvasContent.type !== "composition") {
|
|
20940
20967
|
return {};
|
|
20941
20968
|
}
|
|
@@ -20948,10 +20975,10 @@ var TimelineDragHandler = () => {
|
|
|
20948
20975
|
if (!canvasContent || canvasContent.type !== "composition") {
|
|
20949
20976
|
return null;
|
|
20950
20977
|
}
|
|
20951
|
-
return /* @__PURE__ */
|
|
20978
|
+
return /* @__PURE__ */ jsx191("div", {
|
|
20952
20979
|
ref: sliderAreaRef,
|
|
20953
20980
|
style: containerStyle3,
|
|
20954
|
-
children: video ? /* @__PURE__ */
|
|
20981
|
+
children: video ? /* @__PURE__ */ jsx191(Inner2, {}) : null
|
|
20955
20982
|
});
|
|
20956
20983
|
};
|
|
20957
20984
|
var Inner2 = () => {
|
|
@@ -20962,11 +20989,11 @@ var Inner2 = () => {
|
|
|
20962
20989
|
});
|
|
20963
20990
|
const { isHighestContext } = useZIndex();
|
|
20964
20991
|
const setFrame = Internals47.useTimelineSetFrame();
|
|
20965
|
-
const [inOutDragging, setInOutDragging] =
|
|
20992
|
+
const [inOutDragging, setInOutDragging] = useState68({
|
|
20966
20993
|
dragging: false
|
|
20967
20994
|
});
|
|
20968
20995
|
const timelineWidth = useContext65(TimelineWidthContext);
|
|
20969
|
-
const get =
|
|
20996
|
+
const get = useCallback97((frame2) => {
|
|
20970
20997
|
if (timelineWidth === null) {
|
|
20971
20998
|
throw new Error("timeline width is not yet determined");
|
|
20972
20999
|
}
|
|
@@ -20976,7 +21003,7 @@ var Inner2 = () => {
|
|
|
20976
21003
|
const left3 = size4?.left ?? 0;
|
|
20977
21004
|
const { inFrame, outFrame } = useTimelineInOutFramePosition();
|
|
20978
21005
|
const { setInAndOutFrames } = useTimelineSetInOutFramePosition();
|
|
20979
|
-
const [dragging, setDragging] =
|
|
21006
|
+
const [dragging, setDragging] = useState68({
|
|
20980
21007
|
dragging: false
|
|
20981
21008
|
});
|
|
20982
21009
|
const { playing, play, pause, seek } = PlayerInternals16.usePlayer();
|
|
@@ -20987,7 +21014,7 @@ var Inner2 = () => {
|
|
|
20987
21014
|
scroller.current = null;
|
|
20988
21015
|
}
|
|
20989
21016
|
};
|
|
20990
|
-
const onPointerDown =
|
|
21017
|
+
const onPointerDown = useCallback97((e) => {
|
|
20991
21018
|
if (e.button !== 0) {
|
|
20992
21019
|
return;
|
|
20993
21020
|
}
|
|
@@ -21053,7 +21080,7 @@ var Inner2 = () => {
|
|
|
21053
21080
|
get,
|
|
21054
21081
|
outFrame
|
|
21055
21082
|
]);
|
|
21056
|
-
const onPointerMoveScrubbing =
|
|
21083
|
+
const onPointerMoveScrubbing = useCallback97((e) => {
|
|
21057
21084
|
if (!videoConfig) {
|
|
21058
21085
|
return;
|
|
21059
21086
|
}
|
|
@@ -21123,7 +21150,7 @@ var Inner2 = () => {
|
|
|
21123
21150
|
seek(frame2);
|
|
21124
21151
|
}
|
|
21125
21152
|
}, [videoConfig, dragging.dragging, left3, width, seek]);
|
|
21126
|
-
const onPointerMoveInOut =
|
|
21153
|
+
const onPointerMoveInOut = useCallback97((e) => {
|
|
21127
21154
|
if (!videoConfig) {
|
|
21128
21155
|
return;
|
|
21129
21156
|
}
|
|
@@ -21159,7 +21186,7 @@ var Inner2 = () => {
|
|
|
21159
21186
|
outMarkerAreaRef.current.style.width = String(width - get(outFrame) - offset) + "px";
|
|
21160
21187
|
}
|
|
21161
21188
|
}, [get, inFrame, inOutDragging, outFrame, videoConfig, width]);
|
|
21162
|
-
const onPointerUpScrubbing =
|
|
21189
|
+
const onPointerUpScrubbing = useCallback97((e) => {
|
|
21163
21190
|
stopInterval();
|
|
21164
21191
|
document.body.style.userSelect = "";
|
|
21165
21192
|
document.body.style.webkitUserSelect = "";
|
|
@@ -21187,7 +21214,7 @@ var Inner2 = () => {
|
|
|
21187
21214
|
play();
|
|
21188
21215
|
}
|
|
21189
21216
|
}, [dragging, left3, play, videoConfig, setFrame, width]);
|
|
21190
|
-
const onPointerUpInOut =
|
|
21217
|
+
const onPointerUpInOut = useCallback97((e) => {
|
|
21191
21218
|
document.body.style.userSelect = "";
|
|
21192
21219
|
document.body.style.webkitUserSelect = "";
|
|
21193
21220
|
if (!videoConfig) {
|
|
@@ -21273,7 +21300,7 @@ var Inner2 = () => {
|
|
|
21273
21300
|
window.removeEventListener("pointerup", onPointerUpInOut);
|
|
21274
21301
|
};
|
|
21275
21302
|
}, [inOutDragging.dragging, onPointerMoveInOut, onPointerUpInOut]);
|
|
21276
|
-
const inContextMenu =
|
|
21303
|
+
const inContextMenu = useMemo103(() => {
|
|
21277
21304
|
return [
|
|
21278
21305
|
{
|
|
21279
21306
|
id: "hide-in",
|
|
@@ -21298,7 +21325,7 @@ var Inner2 = () => {
|
|
|
21298
21325
|
}
|
|
21299
21326
|
];
|
|
21300
21327
|
}, [setInAndOutFrames, videoConfig.id]);
|
|
21301
|
-
const outContextMenu =
|
|
21328
|
+
const outContextMenu = useMemo103(() => {
|
|
21302
21329
|
return [
|
|
21303
21330
|
{
|
|
21304
21331
|
id: "hide-out",
|
|
@@ -21327,21 +21354,21 @@ var Inner2 = () => {
|
|
|
21327
21354
|
style: style10,
|
|
21328
21355
|
onPointerDown,
|
|
21329
21356
|
children: [
|
|
21330
|
-
/* @__PURE__ */
|
|
21357
|
+
/* @__PURE__ */ jsx191("div", {
|
|
21331
21358
|
style: inner,
|
|
21332
21359
|
className: VERTICAL_SCROLLBAR_CLASSNAME
|
|
21333
21360
|
}),
|
|
21334
|
-
inFrame !== null && /* @__PURE__ */
|
|
21361
|
+
inFrame !== null && /* @__PURE__ */ jsx191(ContextMenu, {
|
|
21335
21362
|
values: inContextMenu,
|
|
21336
|
-
children: /* @__PURE__ */
|
|
21363
|
+
children: /* @__PURE__ */ jsx191(TimelineInOutPointerHandle, {
|
|
21337
21364
|
type: "in",
|
|
21338
21365
|
atFrame: inFrame,
|
|
21339
21366
|
dragging: inOutDragging.dragging === "in"
|
|
21340
21367
|
})
|
|
21341
21368
|
}),
|
|
21342
|
-
outFrame !== null && /* @__PURE__ */
|
|
21369
|
+
outFrame !== null && /* @__PURE__ */ jsx191(ContextMenu, {
|
|
21343
21370
|
values: outContextMenu,
|
|
21344
|
-
children: /* @__PURE__ */
|
|
21371
|
+
children: /* @__PURE__ */ jsx191(TimelineInOutPointerHandle, {
|
|
21345
21372
|
type: "out",
|
|
21346
21373
|
dragging: inOutDragging.dragging === "out",
|
|
21347
21374
|
atFrame: outFrame
|
|
@@ -21359,33 +21386,6 @@ import { useRef as useRef40 } from "react";
|
|
|
21359
21386
|
import { useCallback as useCallback106, useContext as useContext70, useMemo as useMemo111 } from "react";
|
|
21360
21387
|
import { Internals as Internals51 } from "remotion";
|
|
21361
21388
|
|
|
21362
|
-
// src/components/ExpandedTracksProvider.tsx
|
|
21363
|
-
import { createContext as createContext21, useCallback as useCallback97, useMemo as useMemo103, useState as useState68 } from "react";
|
|
21364
|
-
import { jsx as jsx191 } from "react/jsx-runtime";
|
|
21365
|
-
var ExpandedTracksContext = createContext21({
|
|
21366
|
-
expandedTracks: {},
|
|
21367
|
-
toggleTrack: () => {
|
|
21368
|
-
throw new Error("ExpandedTracksContext not initialized");
|
|
21369
|
-
}
|
|
21370
|
-
});
|
|
21371
|
-
var ExpandedTracksProvider = ({ children }) => {
|
|
21372
|
-
const [expandedTracks, setExpandedTracks] = useState68({});
|
|
21373
|
-
const toggleTrack = useCallback97((id) => {
|
|
21374
|
-
setExpandedTracks((prev) => ({
|
|
21375
|
-
...prev,
|
|
21376
|
-
[id]: !prev[id]
|
|
21377
|
-
}));
|
|
21378
|
-
}, []);
|
|
21379
|
-
const value = useMemo103(() => ({
|
|
21380
|
-
expandedTracks,
|
|
21381
|
-
toggleTrack
|
|
21382
|
-
}), [expandedTracks, toggleTrack]);
|
|
21383
|
-
return /* @__PURE__ */ jsx191(ExpandedTracksContext.Provider, {
|
|
21384
|
-
value,
|
|
21385
|
-
children
|
|
21386
|
-
});
|
|
21387
|
-
};
|
|
21388
|
-
|
|
21389
21389
|
// src/components/Timeline/TimelineExpandedSection.tsx
|
|
21390
21390
|
import React137, { useMemo as useMemo108 } from "react";
|
|
21391
21391
|
|
|
@@ -23976,6 +23976,9 @@ var noop3 = () => {
|
|
|
23976
23976
|
};
|
|
23977
23977
|
var TimelineInner = () => {
|
|
23978
23978
|
const { sequences } = useContext75(Internals57.SequenceManager);
|
|
23979
|
+
const { expandedTracks } = useContext75(ExpandedTracksContext);
|
|
23980
|
+
const { previewServerState } = useContext75(StudioServerConnectionCtx);
|
|
23981
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
23979
23982
|
const videoConfig = Internals57.useUnsafeVideoConfig();
|
|
23980
23983
|
const timeline = useMemo118(() => {
|
|
23981
23984
|
if (!videoConfig) {
|
|
@@ -23999,14 +24002,15 @@ var TimelineInner = () => {
|
|
|
23999
24002
|
const inner2 = useMemo118(() => {
|
|
24000
24003
|
return {
|
|
24001
24004
|
height: shown.reduce((acc, track) => {
|
|
24002
|
-
|
|
24005
|
+
const isExpanded = visualModeEnabled && (expandedTracks[track.sequence.id] ?? false);
|
|
24006
|
+
return acc + getTimelineLayerHeight(track.sequence.type === "video" ? "video" : "other") + Number(TIMELINE_ITEM_BORDER_BOTTOM) + (isExpanded ? getExpandedTrackHeight(track.sequence.controls) + TIMELINE_ITEM_BORDER_BOTTOM : 0);
|
|
24003
24007
|
}, 0) + TIMELINE_ITEM_BORDER_BOTTOM + (hasBeenCut ? MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) + TIMELINE_TIME_INDICATOR_HEIGHT,
|
|
24004
24008
|
display: "flex",
|
|
24005
24009
|
flex: 1,
|
|
24006
24010
|
minHeight: "100%",
|
|
24007
24011
|
overflowX: "hidden"
|
|
24008
24012
|
};
|
|
24009
|
-
}, [hasBeenCut, shown]);
|
|
24013
|
+
}, [hasBeenCut, shown, expandedTracks, visualModeEnabled]);
|
|
24010
24014
|
return /* @__PURE__ */ jsx214("div", {
|
|
24011
24015
|
ref: timelineVerticalScroll,
|
|
24012
24016
|
style: container45,
|
package/dist/esm/internals.mjs
CHANGED
|
@@ -20792,6 +20792,33 @@ var calculateTimeline = ({
|
|
|
20792
20792
|
});
|
|
20793
20793
|
};
|
|
20794
20794
|
|
|
20795
|
+
// src/components/ExpandedTracksProvider.tsx
|
|
20796
|
+
import { createContext as createContext21, useCallback as useCallback96, useMemo as useMemo101, useState as useState67 } from "react";
|
|
20797
|
+
import { jsx as jsx188 } from "react/jsx-runtime";
|
|
20798
|
+
var ExpandedTracksContext = createContext21({
|
|
20799
|
+
expandedTracks: {},
|
|
20800
|
+
toggleTrack: () => {
|
|
20801
|
+
throw new Error("ExpandedTracksContext not initialized");
|
|
20802
|
+
}
|
|
20803
|
+
});
|
|
20804
|
+
var ExpandedTracksProvider = ({ children }) => {
|
|
20805
|
+
const [expandedTracks, setExpandedTracks] = useState67({});
|
|
20806
|
+
const toggleTrack = useCallback96((id) => {
|
|
20807
|
+
setExpandedTracks((prev) => ({
|
|
20808
|
+
...prev,
|
|
20809
|
+
[id]: !prev[id]
|
|
20810
|
+
}));
|
|
20811
|
+
}, []);
|
|
20812
|
+
const value = useMemo101(() => ({
|
|
20813
|
+
expandedTracks,
|
|
20814
|
+
toggleTrack
|
|
20815
|
+
}), [expandedTracks, toggleTrack]);
|
|
20816
|
+
return /* @__PURE__ */ jsx188(ExpandedTracksContext.Provider, {
|
|
20817
|
+
value,
|
|
20818
|
+
children
|
|
20819
|
+
});
|
|
20820
|
+
};
|
|
20821
|
+
|
|
20795
20822
|
// src/components/Timeline/is-collapsed.ts
|
|
20796
20823
|
var isTrackHidden = (track) => {
|
|
20797
20824
|
if (!track.sequence.parent) {
|
|
@@ -20831,19 +20858,19 @@ var MaxTimelineTracksReached = () => {
|
|
|
20831
20858
|
// src/components/Timeline/TimelineDragHandler.tsx
|
|
20832
20859
|
import { PlayerInternals as PlayerInternals16 } from "@remotion/player";
|
|
20833
20860
|
import {
|
|
20834
|
-
useCallback as
|
|
20861
|
+
useCallback as useCallback97,
|
|
20835
20862
|
useContext as useContext65,
|
|
20836
20863
|
useEffect as useEffect65,
|
|
20837
|
-
useMemo as
|
|
20864
|
+
useMemo as useMemo103,
|
|
20838
20865
|
useRef as useRef36,
|
|
20839
|
-
useState as
|
|
20866
|
+
useState as useState68
|
|
20840
20867
|
} from "react";
|
|
20841
20868
|
import { Internals as Internals47, useVideoConfig as useVideoConfig4 } from "remotion";
|
|
20842
20869
|
|
|
20843
20870
|
// src/components/Timeline/TimelineInOutPointer.tsx
|
|
20844
20871
|
import { createRef as createRef10, useContext as useContext63 } from "react";
|
|
20845
20872
|
import { Internals as Internals46 } from "remotion";
|
|
20846
|
-
import { jsx as
|
|
20873
|
+
import { jsx as jsx189, jsxs as jsxs90, Fragment as Fragment27 } from "react/jsx-runtime";
|
|
20847
20874
|
var areaHighlight = {
|
|
20848
20875
|
position: "absolute",
|
|
20849
20876
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
@@ -20862,7 +20889,7 @@ var TimelineInOutPointer = () => {
|
|
|
20862
20889
|
}
|
|
20863
20890
|
return /* @__PURE__ */ jsxs90(Fragment27, {
|
|
20864
20891
|
children: [
|
|
20865
|
-
inFrame !== null && /* @__PURE__ */
|
|
20892
|
+
inFrame !== null && /* @__PURE__ */ jsx189("div", {
|
|
20866
20893
|
ref: inMarkerAreaRef,
|
|
20867
20894
|
style: {
|
|
20868
20895
|
...areaHighlight,
|
|
@@ -20870,7 +20897,7 @@ var TimelineInOutPointer = () => {
|
|
|
20870
20897
|
width: getXPositionOfItemInTimelineImperatively(inFrame, videoConfig.durationInFrames, timelineWidth)
|
|
20871
20898
|
}
|
|
20872
20899
|
}),
|
|
20873
|
-
outFrame !== null && /* @__PURE__ */
|
|
20900
|
+
outFrame !== null && /* @__PURE__ */ jsx189("div", {
|
|
20874
20901
|
ref: outMarkerAreaRef,
|
|
20875
20902
|
style: {
|
|
20876
20903
|
...areaHighlight,
|
|
@@ -20883,9 +20910,9 @@ var TimelineInOutPointer = () => {
|
|
|
20883
20910
|
};
|
|
20884
20911
|
|
|
20885
20912
|
// src/components/Timeline/TimelineInOutPointerHandle.tsx
|
|
20886
|
-
import { createRef as createRef11, useContext as useContext64, useMemo as
|
|
20913
|
+
import { createRef as createRef11, useContext as useContext64, useMemo as useMemo102 } from "react";
|
|
20887
20914
|
import { useVideoConfig as useVideoConfig3 } from "remotion";
|
|
20888
|
-
import { jsx as
|
|
20915
|
+
import { jsx as jsx190 } from "react/jsx-runtime";
|
|
20889
20916
|
var line3 = {
|
|
20890
20917
|
height: "100%",
|
|
20891
20918
|
width: 1,
|
|
@@ -20899,14 +20926,14 @@ var inPointerHandle = createRef11();
|
|
|
20899
20926
|
var outPointerHandle = createRef11();
|
|
20900
20927
|
var InnerTimelineInOutPointerHandle = ({ atFrame, dragging, timelineWidth, type }) => {
|
|
20901
20928
|
const videoConfig = useVideoConfig3();
|
|
20902
|
-
const style10 =
|
|
20929
|
+
const style10 = useMemo102(() => {
|
|
20903
20930
|
return {
|
|
20904
20931
|
...line3,
|
|
20905
20932
|
backgroundColor: dragging ? LIGHT_TRANSPARENT : "rgba(255, 255, 255, 0.1)",
|
|
20906
20933
|
transform: `translateX(${getXPositionOfItemInTimelineImperatively(atFrame, videoConfig.durationInFrames, timelineWidth)}px)`
|
|
20907
20934
|
};
|
|
20908
20935
|
}, [atFrame, dragging, timelineWidth, videoConfig.durationInFrames]);
|
|
20909
|
-
return /* @__PURE__ */
|
|
20936
|
+
return /* @__PURE__ */ jsx190("div", {
|
|
20910
20937
|
ref: type === "in" ? inPointerHandle : outPointerHandle,
|
|
20911
20938
|
style: style10
|
|
20912
20939
|
});
|
|
@@ -20920,7 +20947,7 @@ var TimelineInOutPointerHandle = ({
|
|
|
20920
20947
|
if (timelineWidth === null) {
|
|
20921
20948
|
return null;
|
|
20922
20949
|
}
|
|
20923
|
-
return /* @__PURE__ */
|
|
20950
|
+
return /* @__PURE__ */ jsx190(InnerTimelineInOutPointerHandle, {
|
|
20924
20951
|
atFrame,
|
|
20925
20952
|
dragging,
|
|
20926
20953
|
timelineWidth,
|
|
@@ -20929,7 +20956,7 @@ var TimelineInOutPointerHandle = ({
|
|
|
20929
20956
|
};
|
|
20930
20957
|
|
|
20931
20958
|
// src/components/Timeline/TimelineDragHandler.tsx
|
|
20932
|
-
import { jsx as
|
|
20959
|
+
import { jsx as jsx191, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
20933
20960
|
var inner = {
|
|
20934
20961
|
overflowY: "auto",
|
|
20935
20962
|
overflowX: "hidden"
|
|
@@ -20954,7 +20981,7 @@ var TimelineDragHandler = () => {
|
|
|
20954
20981
|
const video = Internals47.useUnsafeVideoConfig();
|
|
20955
20982
|
const { zoom: zoomMap } = useContext65(TimelineZoomCtx);
|
|
20956
20983
|
const { canvasContent } = useContext65(Internals47.CompositionManager);
|
|
20957
|
-
const containerStyle3 =
|
|
20984
|
+
const containerStyle3 = useMemo103(() => {
|
|
20958
20985
|
if (!canvasContent || canvasContent.type !== "composition") {
|
|
20959
20986
|
return {};
|
|
20960
20987
|
}
|
|
@@ -20967,10 +20994,10 @@ var TimelineDragHandler = () => {
|
|
|
20967
20994
|
if (!canvasContent || canvasContent.type !== "composition") {
|
|
20968
20995
|
return null;
|
|
20969
20996
|
}
|
|
20970
|
-
return /* @__PURE__ */
|
|
20997
|
+
return /* @__PURE__ */ jsx191("div", {
|
|
20971
20998
|
ref: sliderAreaRef,
|
|
20972
20999
|
style: containerStyle3,
|
|
20973
|
-
children: video ? /* @__PURE__ */
|
|
21000
|
+
children: video ? /* @__PURE__ */ jsx191(Inner2, {}) : null
|
|
20974
21001
|
});
|
|
20975
21002
|
};
|
|
20976
21003
|
var Inner2 = () => {
|
|
@@ -20981,11 +21008,11 @@ var Inner2 = () => {
|
|
|
20981
21008
|
});
|
|
20982
21009
|
const { isHighestContext } = useZIndex();
|
|
20983
21010
|
const setFrame = Internals47.useTimelineSetFrame();
|
|
20984
|
-
const [inOutDragging, setInOutDragging] =
|
|
21011
|
+
const [inOutDragging, setInOutDragging] = useState68({
|
|
20985
21012
|
dragging: false
|
|
20986
21013
|
});
|
|
20987
21014
|
const timelineWidth = useContext65(TimelineWidthContext);
|
|
20988
|
-
const get =
|
|
21015
|
+
const get = useCallback97((frame2) => {
|
|
20989
21016
|
if (timelineWidth === null) {
|
|
20990
21017
|
throw new Error("timeline width is not yet determined");
|
|
20991
21018
|
}
|
|
@@ -20995,7 +21022,7 @@ var Inner2 = () => {
|
|
|
20995
21022
|
const left3 = size4?.left ?? 0;
|
|
20996
21023
|
const { inFrame, outFrame } = useTimelineInOutFramePosition();
|
|
20997
21024
|
const { setInAndOutFrames } = useTimelineSetInOutFramePosition();
|
|
20998
|
-
const [dragging, setDragging] =
|
|
21025
|
+
const [dragging, setDragging] = useState68({
|
|
20999
21026
|
dragging: false
|
|
21000
21027
|
});
|
|
21001
21028
|
const { playing, play, pause, seek } = PlayerInternals16.usePlayer();
|
|
@@ -21006,7 +21033,7 @@ var Inner2 = () => {
|
|
|
21006
21033
|
scroller.current = null;
|
|
21007
21034
|
}
|
|
21008
21035
|
};
|
|
21009
|
-
const onPointerDown =
|
|
21036
|
+
const onPointerDown = useCallback97((e) => {
|
|
21010
21037
|
if (e.button !== 0) {
|
|
21011
21038
|
return;
|
|
21012
21039
|
}
|
|
@@ -21072,7 +21099,7 @@ var Inner2 = () => {
|
|
|
21072
21099
|
get,
|
|
21073
21100
|
outFrame
|
|
21074
21101
|
]);
|
|
21075
|
-
const onPointerMoveScrubbing =
|
|
21102
|
+
const onPointerMoveScrubbing = useCallback97((e) => {
|
|
21076
21103
|
if (!videoConfig) {
|
|
21077
21104
|
return;
|
|
21078
21105
|
}
|
|
@@ -21142,7 +21169,7 @@ var Inner2 = () => {
|
|
|
21142
21169
|
seek(frame2);
|
|
21143
21170
|
}
|
|
21144
21171
|
}, [videoConfig, dragging.dragging, left3, width, seek]);
|
|
21145
|
-
const onPointerMoveInOut =
|
|
21172
|
+
const onPointerMoveInOut = useCallback97((e) => {
|
|
21146
21173
|
if (!videoConfig) {
|
|
21147
21174
|
return;
|
|
21148
21175
|
}
|
|
@@ -21178,7 +21205,7 @@ var Inner2 = () => {
|
|
|
21178
21205
|
outMarkerAreaRef.current.style.width = String(width - get(outFrame) - offset) + "px";
|
|
21179
21206
|
}
|
|
21180
21207
|
}, [get, inFrame, inOutDragging, outFrame, videoConfig, width]);
|
|
21181
|
-
const onPointerUpScrubbing =
|
|
21208
|
+
const onPointerUpScrubbing = useCallback97((e) => {
|
|
21182
21209
|
stopInterval();
|
|
21183
21210
|
document.body.style.userSelect = "";
|
|
21184
21211
|
document.body.style.webkitUserSelect = "";
|
|
@@ -21206,7 +21233,7 @@ var Inner2 = () => {
|
|
|
21206
21233
|
play();
|
|
21207
21234
|
}
|
|
21208
21235
|
}, [dragging, left3, play, videoConfig, setFrame, width]);
|
|
21209
|
-
const onPointerUpInOut =
|
|
21236
|
+
const onPointerUpInOut = useCallback97((e) => {
|
|
21210
21237
|
document.body.style.userSelect = "";
|
|
21211
21238
|
document.body.style.webkitUserSelect = "";
|
|
21212
21239
|
if (!videoConfig) {
|
|
@@ -21292,7 +21319,7 @@ var Inner2 = () => {
|
|
|
21292
21319
|
window.removeEventListener("pointerup", onPointerUpInOut);
|
|
21293
21320
|
};
|
|
21294
21321
|
}, [inOutDragging.dragging, onPointerMoveInOut, onPointerUpInOut]);
|
|
21295
|
-
const inContextMenu =
|
|
21322
|
+
const inContextMenu = useMemo103(() => {
|
|
21296
21323
|
return [
|
|
21297
21324
|
{
|
|
21298
21325
|
id: "hide-in",
|
|
@@ -21317,7 +21344,7 @@ var Inner2 = () => {
|
|
|
21317
21344
|
}
|
|
21318
21345
|
];
|
|
21319
21346
|
}, [setInAndOutFrames, videoConfig.id]);
|
|
21320
|
-
const outContextMenu =
|
|
21347
|
+
const outContextMenu = useMemo103(() => {
|
|
21321
21348
|
return [
|
|
21322
21349
|
{
|
|
21323
21350
|
id: "hide-out",
|
|
@@ -21346,21 +21373,21 @@ var Inner2 = () => {
|
|
|
21346
21373
|
style: style10,
|
|
21347
21374
|
onPointerDown,
|
|
21348
21375
|
children: [
|
|
21349
|
-
/* @__PURE__ */
|
|
21376
|
+
/* @__PURE__ */ jsx191("div", {
|
|
21350
21377
|
style: inner,
|
|
21351
21378
|
className: VERTICAL_SCROLLBAR_CLASSNAME
|
|
21352
21379
|
}),
|
|
21353
|
-
inFrame !== null && /* @__PURE__ */
|
|
21380
|
+
inFrame !== null && /* @__PURE__ */ jsx191(ContextMenu, {
|
|
21354
21381
|
values: inContextMenu,
|
|
21355
|
-
children: /* @__PURE__ */
|
|
21382
|
+
children: /* @__PURE__ */ jsx191(TimelineInOutPointerHandle, {
|
|
21356
21383
|
type: "in",
|
|
21357
21384
|
atFrame: inFrame,
|
|
21358
21385
|
dragging: inOutDragging.dragging === "in"
|
|
21359
21386
|
})
|
|
21360
21387
|
}),
|
|
21361
|
-
outFrame !== null && /* @__PURE__ */
|
|
21388
|
+
outFrame !== null && /* @__PURE__ */ jsx191(ContextMenu, {
|
|
21362
21389
|
values: outContextMenu,
|
|
21363
|
-
children: /* @__PURE__ */
|
|
21390
|
+
children: /* @__PURE__ */ jsx191(TimelineInOutPointerHandle, {
|
|
21364
21391
|
type: "out",
|
|
21365
21392
|
dragging: inOutDragging.dragging === "out",
|
|
21366
21393
|
atFrame: outFrame
|
|
@@ -21378,33 +21405,6 @@ import { useRef as useRef40 } from "react";
|
|
|
21378
21405
|
import { useCallback as useCallback106, useContext as useContext70, useMemo as useMemo111 } from "react";
|
|
21379
21406
|
import { Internals as Internals51 } from "remotion";
|
|
21380
21407
|
|
|
21381
|
-
// src/components/ExpandedTracksProvider.tsx
|
|
21382
|
-
import { createContext as createContext21, useCallback as useCallback97, useMemo as useMemo103, useState as useState68 } from "react";
|
|
21383
|
-
import { jsx as jsx191 } from "react/jsx-runtime";
|
|
21384
|
-
var ExpandedTracksContext = createContext21({
|
|
21385
|
-
expandedTracks: {},
|
|
21386
|
-
toggleTrack: () => {
|
|
21387
|
-
throw new Error("ExpandedTracksContext not initialized");
|
|
21388
|
-
}
|
|
21389
|
-
});
|
|
21390
|
-
var ExpandedTracksProvider = ({ children }) => {
|
|
21391
|
-
const [expandedTracks, setExpandedTracks] = useState68({});
|
|
21392
|
-
const toggleTrack = useCallback97((id) => {
|
|
21393
|
-
setExpandedTracks((prev) => ({
|
|
21394
|
-
...prev,
|
|
21395
|
-
[id]: !prev[id]
|
|
21396
|
-
}));
|
|
21397
|
-
}, []);
|
|
21398
|
-
const value = useMemo103(() => ({
|
|
21399
|
-
expandedTracks,
|
|
21400
|
-
toggleTrack
|
|
21401
|
-
}), [expandedTracks, toggleTrack]);
|
|
21402
|
-
return /* @__PURE__ */ jsx191(ExpandedTracksContext.Provider, {
|
|
21403
|
-
value,
|
|
21404
|
-
children
|
|
21405
|
-
});
|
|
21406
|
-
};
|
|
21407
|
-
|
|
21408
21408
|
// src/components/Timeline/TimelineExpandedSection.tsx
|
|
21409
21409
|
import React137, { useMemo as useMemo108 } from "react";
|
|
21410
21410
|
|
|
@@ -23995,6 +23995,9 @@ var noop3 = () => {
|
|
|
23995
23995
|
};
|
|
23996
23996
|
var TimelineInner = () => {
|
|
23997
23997
|
const { sequences } = useContext75(Internals57.SequenceManager);
|
|
23998
|
+
const { expandedTracks } = useContext75(ExpandedTracksContext);
|
|
23999
|
+
const { previewServerState } = useContext75(StudioServerConnectionCtx);
|
|
24000
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
23998
24001
|
const videoConfig = Internals57.useUnsafeVideoConfig();
|
|
23999
24002
|
const timeline = useMemo118(() => {
|
|
24000
24003
|
if (!videoConfig) {
|
|
@@ -24018,14 +24021,15 @@ var TimelineInner = () => {
|
|
|
24018
24021
|
const inner2 = useMemo118(() => {
|
|
24019
24022
|
return {
|
|
24020
24023
|
height: shown.reduce((acc, track) => {
|
|
24021
|
-
|
|
24024
|
+
const isExpanded = visualModeEnabled && (expandedTracks[track.sequence.id] ?? false);
|
|
24025
|
+
return acc + getTimelineLayerHeight(track.sequence.type === "video" ? "video" : "other") + Number(TIMELINE_ITEM_BORDER_BOTTOM) + (isExpanded ? getExpandedTrackHeight(track.sequence.controls) + TIMELINE_ITEM_BORDER_BOTTOM : 0);
|
|
24022
24026
|
}, 0) + TIMELINE_ITEM_BORDER_BOTTOM + (hasBeenCut ? MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) + TIMELINE_TIME_INDICATOR_HEIGHT,
|
|
24023
24027
|
display: "flex",
|
|
24024
24028
|
flex: 1,
|
|
24025
24029
|
minHeight: "100%",
|
|
24026
24030
|
overflowX: "hidden"
|
|
24027
24031
|
};
|
|
24028
|
-
}, [hasBeenCut, shown]);
|
|
24032
|
+
}, [hasBeenCut, shown, expandedTracks, visualModeEnabled]);
|
|
24029
24033
|
return /* @__PURE__ */ jsx214("div", {
|
|
24030
24034
|
ref: timelineVerticalScroll,
|
|
24031
24035
|
style: container45,
|
|
@@ -21449,6 +21449,33 @@ var calculateTimeline = ({
|
|
|
21449
21449
|
});
|
|
21450
21450
|
};
|
|
21451
21451
|
|
|
21452
|
+
// src/components/ExpandedTracksProvider.tsx
|
|
21453
|
+
import { createContext as createContext21, useCallback as useCallback97, useMemo as useMemo101, useState as useState69 } from "react";
|
|
21454
|
+
import { jsx as jsx191 } from "react/jsx-runtime";
|
|
21455
|
+
var ExpandedTracksContext = createContext21({
|
|
21456
|
+
expandedTracks: {},
|
|
21457
|
+
toggleTrack: () => {
|
|
21458
|
+
throw new Error("ExpandedTracksContext not initialized");
|
|
21459
|
+
}
|
|
21460
|
+
});
|
|
21461
|
+
var ExpandedTracksProvider = ({ children }) => {
|
|
21462
|
+
const [expandedTracks, setExpandedTracks] = useState69({});
|
|
21463
|
+
const toggleTrack = useCallback97((id) => {
|
|
21464
|
+
setExpandedTracks((prev) => ({
|
|
21465
|
+
...prev,
|
|
21466
|
+
[id]: !prev[id]
|
|
21467
|
+
}));
|
|
21468
|
+
}, []);
|
|
21469
|
+
const value = useMemo101(() => ({
|
|
21470
|
+
expandedTracks,
|
|
21471
|
+
toggleTrack
|
|
21472
|
+
}), [expandedTracks, toggleTrack]);
|
|
21473
|
+
return /* @__PURE__ */ jsx191(ExpandedTracksContext.Provider, {
|
|
21474
|
+
value,
|
|
21475
|
+
children
|
|
21476
|
+
});
|
|
21477
|
+
};
|
|
21478
|
+
|
|
21452
21479
|
// src/components/Timeline/is-collapsed.ts
|
|
21453
21480
|
var isTrackHidden = (track) => {
|
|
21454
21481
|
if (!track.sequence.parent) {
|
|
@@ -21488,19 +21515,19 @@ var MaxTimelineTracksReached = () => {
|
|
|
21488
21515
|
// src/components/Timeline/TimelineDragHandler.tsx
|
|
21489
21516
|
import { PlayerInternals as PlayerInternals16 } from "@remotion/player";
|
|
21490
21517
|
import {
|
|
21491
|
-
useCallback as
|
|
21518
|
+
useCallback as useCallback98,
|
|
21492
21519
|
useContext as useContext65,
|
|
21493
21520
|
useEffect as useEffect66,
|
|
21494
|
-
useMemo as
|
|
21521
|
+
useMemo as useMemo103,
|
|
21495
21522
|
useRef as useRef36,
|
|
21496
|
-
useState as
|
|
21523
|
+
useState as useState70
|
|
21497
21524
|
} from "react";
|
|
21498
21525
|
import { Internals as Internals47, useVideoConfig as useVideoConfig4 } from "remotion";
|
|
21499
21526
|
|
|
21500
21527
|
// src/components/Timeline/TimelineInOutPointer.tsx
|
|
21501
21528
|
import { createRef as createRef11, useContext as useContext63 } from "react";
|
|
21502
21529
|
import { Internals as Internals46 } from "remotion";
|
|
21503
|
-
import { jsx as
|
|
21530
|
+
import { jsx as jsx192, jsxs as jsxs91, Fragment as Fragment27 } from "react/jsx-runtime";
|
|
21504
21531
|
var areaHighlight = {
|
|
21505
21532
|
position: "absolute",
|
|
21506
21533
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
@@ -21519,7 +21546,7 @@ var TimelineInOutPointer = () => {
|
|
|
21519
21546
|
}
|
|
21520
21547
|
return /* @__PURE__ */ jsxs91(Fragment27, {
|
|
21521
21548
|
children: [
|
|
21522
|
-
inFrame !== null && /* @__PURE__ */
|
|
21549
|
+
inFrame !== null && /* @__PURE__ */ jsx192("div", {
|
|
21523
21550
|
ref: inMarkerAreaRef,
|
|
21524
21551
|
style: {
|
|
21525
21552
|
...areaHighlight,
|
|
@@ -21527,7 +21554,7 @@ var TimelineInOutPointer = () => {
|
|
|
21527
21554
|
width: getXPositionOfItemInTimelineImperatively(inFrame, videoConfig.durationInFrames, timelineWidth)
|
|
21528
21555
|
}
|
|
21529
21556
|
}),
|
|
21530
|
-
outFrame !== null && /* @__PURE__ */
|
|
21557
|
+
outFrame !== null && /* @__PURE__ */ jsx192("div", {
|
|
21531
21558
|
ref: outMarkerAreaRef,
|
|
21532
21559
|
style: {
|
|
21533
21560
|
...areaHighlight,
|
|
@@ -21540,9 +21567,9 @@ var TimelineInOutPointer = () => {
|
|
|
21540
21567
|
};
|
|
21541
21568
|
|
|
21542
21569
|
// src/components/Timeline/TimelineInOutPointerHandle.tsx
|
|
21543
|
-
import { createRef as createRef12, useContext as useContext64, useMemo as
|
|
21570
|
+
import { createRef as createRef12, useContext as useContext64, useMemo as useMemo102 } from "react";
|
|
21544
21571
|
import { useVideoConfig as useVideoConfig3 } from "remotion";
|
|
21545
|
-
import { jsx as
|
|
21572
|
+
import { jsx as jsx193 } from "react/jsx-runtime";
|
|
21546
21573
|
var line3 = {
|
|
21547
21574
|
height: "100%",
|
|
21548
21575
|
width: 1,
|
|
@@ -21556,14 +21583,14 @@ var inPointerHandle = createRef12();
|
|
|
21556
21583
|
var outPointerHandle = createRef12();
|
|
21557
21584
|
var InnerTimelineInOutPointerHandle = ({ atFrame, dragging, timelineWidth, type }) => {
|
|
21558
21585
|
const videoConfig = useVideoConfig3();
|
|
21559
|
-
const style10 =
|
|
21586
|
+
const style10 = useMemo102(() => {
|
|
21560
21587
|
return {
|
|
21561
21588
|
...line3,
|
|
21562
21589
|
backgroundColor: dragging ? LIGHT_TRANSPARENT : "rgba(255, 255, 255, 0.1)",
|
|
21563
21590
|
transform: `translateX(${getXPositionOfItemInTimelineImperatively(atFrame, videoConfig.durationInFrames, timelineWidth)}px)`
|
|
21564
21591
|
};
|
|
21565
21592
|
}, [atFrame, dragging, timelineWidth, videoConfig.durationInFrames]);
|
|
21566
|
-
return /* @__PURE__ */
|
|
21593
|
+
return /* @__PURE__ */ jsx193("div", {
|
|
21567
21594
|
ref: type === "in" ? inPointerHandle : outPointerHandle,
|
|
21568
21595
|
style: style10
|
|
21569
21596
|
});
|
|
@@ -21577,7 +21604,7 @@ var TimelineInOutPointerHandle = ({
|
|
|
21577
21604
|
if (timelineWidth === null) {
|
|
21578
21605
|
return null;
|
|
21579
21606
|
}
|
|
21580
|
-
return /* @__PURE__ */
|
|
21607
|
+
return /* @__PURE__ */ jsx193(InnerTimelineInOutPointerHandle, {
|
|
21581
21608
|
atFrame,
|
|
21582
21609
|
dragging,
|
|
21583
21610
|
timelineWidth,
|
|
@@ -21586,7 +21613,7 @@ var TimelineInOutPointerHandle = ({
|
|
|
21586
21613
|
};
|
|
21587
21614
|
|
|
21588
21615
|
// src/components/Timeline/TimelineDragHandler.tsx
|
|
21589
|
-
import { jsx as
|
|
21616
|
+
import { jsx as jsx194, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
21590
21617
|
var inner = {
|
|
21591
21618
|
overflowY: "auto",
|
|
21592
21619
|
overflowX: "hidden"
|
|
@@ -21611,7 +21638,7 @@ var TimelineDragHandler = () => {
|
|
|
21611
21638
|
const video = Internals47.useUnsafeVideoConfig();
|
|
21612
21639
|
const { zoom: zoomMap } = useContext65(TimelineZoomCtx);
|
|
21613
21640
|
const { canvasContent } = useContext65(Internals47.CompositionManager);
|
|
21614
|
-
const containerStyle3 =
|
|
21641
|
+
const containerStyle3 = useMemo103(() => {
|
|
21615
21642
|
if (!canvasContent || canvasContent.type !== "composition") {
|
|
21616
21643
|
return {};
|
|
21617
21644
|
}
|
|
@@ -21624,10 +21651,10 @@ var TimelineDragHandler = () => {
|
|
|
21624
21651
|
if (!canvasContent || canvasContent.type !== "composition") {
|
|
21625
21652
|
return null;
|
|
21626
21653
|
}
|
|
21627
|
-
return /* @__PURE__ */
|
|
21654
|
+
return /* @__PURE__ */ jsx194("div", {
|
|
21628
21655
|
ref: sliderAreaRef,
|
|
21629
21656
|
style: containerStyle3,
|
|
21630
|
-
children: video ? /* @__PURE__ */
|
|
21657
|
+
children: video ? /* @__PURE__ */ jsx194(Inner2, {}) : null
|
|
21631
21658
|
});
|
|
21632
21659
|
};
|
|
21633
21660
|
var Inner2 = () => {
|
|
@@ -21638,11 +21665,11 @@ var Inner2 = () => {
|
|
|
21638
21665
|
});
|
|
21639
21666
|
const { isHighestContext } = useZIndex();
|
|
21640
21667
|
const setFrame = Internals47.useTimelineSetFrame();
|
|
21641
|
-
const [inOutDragging, setInOutDragging] =
|
|
21668
|
+
const [inOutDragging, setInOutDragging] = useState70({
|
|
21642
21669
|
dragging: false
|
|
21643
21670
|
});
|
|
21644
21671
|
const timelineWidth = useContext65(TimelineWidthContext);
|
|
21645
|
-
const get =
|
|
21672
|
+
const get = useCallback98((frame2) => {
|
|
21646
21673
|
if (timelineWidth === null) {
|
|
21647
21674
|
throw new Error("timeline width is not yet determined");
|
|
21648
21675
|
}
|
|
@@ -21652,7 +21679,7 @@ var Inner2 = () => {
|
|
|
21652
21679
|
const left3 = size4?.left ?? 0;
|
|
21653
21680
|
const { inFrame, outFrame } = useTimelineInOutFramePosition();
|
|
21654
21681
|
const { setInAndOutFrames } = useTimelineSetInOutFramePosition();
|
|
21655
|
-
const [dragging, setDragging] =
|
|
21682
|
+
const [dragging, setDragging] = useState70({
|
|
21656
21683
|
dragging: false
|
|
21657
21684
|
});
|
|
21658
21685
|
const { playing, play, pause, seek } = PlayerInternals16.usePlayer();
|
|
@@ -21663,7 +21690,7 @@ var Inner2 = () => {
|
|
|
21663
21690
|
scroller.current = null;
|
|
21664
21691
|
}
|
|
21665
21692
|
};
|
|
21666
|
-
const onPointerDown =
|
|
21693
|
+
const onPointerDown = useCallback98((e) => {
|
|
21667
21694
|
if (e.button !== 0) {
|
|
21668
21695
|
return;
|
|
21669
21696
|
}
|
|
@@ -21729,7 +21756,7 @@ var Inner2 = () => {
|
|
|
21729
21756
|
get,
|
|
21730
21757
|
outFrame
|
|
21731
21758
|
]);
|
|
21732
|
-
const onPointerMoveScrubbing =
|
|
21759
|
+
const onPointerMoveScrubbing = useCallback98((e) => {
|
|
21733
21760
|
if (!videoConfig) {
|
|
21734
21761
|
return;
|
|
21735
21762
|
}
|
|
@@ -21799,7 +21826,7 @@ var Inner2 = () => {
|
|
|
21799
21826
|
seek(frame2);
|
|
21800
21827
|
}
|
|
21801
21828
|
}, [videoConfig, dragging.dragging, left3, width, seek]);
|
|
21802
|
-
const onPointerMoveInOut =
|
|
21829
|
+
const onPointerMoveInOut = useCallback98((e) => {
|
|
21803
21830
|
if (!videoConfig) {
|
|
21804
21831
|
return;
|
|
21805
21832
|
}
|
|
@@ -21835,7 +21862,7 @@ var Inner2 = () => {
|
|
|
21835
21862
|
outMarkerAreaRef.current.style.width = String(width - get(outFrame) - offset) + "px";
|
|
21836
21863
|
}
|
|
21837
21864
|
}, [get, inFrame, inOutDragging, outFrame, videoConfig, width]);
|
|
21838
|
-
const onPointerUpScrubbing =
|
|
21865
|
+
const onPointerUpScrubbing = useCallback98((e) => {
|
|
21839
21866
|
stopInterval();
|
|
21840
21867
|
document.body.style.userSelect = "";
|
|
21841
21868
|
document.body.style.webkitUserSelect = "";
|
|
@@ -21863,7 +21890,7 @@ var Inner2 = () => {
|
|
|
21863
21890
|
play();
|
|
21864
21891
|
}
|
|
21865
21892
|
}, [dragging, left3, play, videoConfig, setFrame, width]);
|
|
21866
|
-
const onPointerUpInOut =
|
|
21893
|
+
const onPointerUpInOut = useCallback98((e) => {
|
|
21867
21894
|
document.body.style.userSelect = "";
|
|
21868
21895
|
document.body.style.webkitUserSelect = "";
|
|
21869
21896
|
if (!videoConfig) {
|
|
@@ -21949,7 +21976,7 @@ var Inner2 = () => {
|
|
|
21949
21976
|
window.removeEventListener("pointerup", onPointerUpInOut);
|
|
21950
21977
|
};
|
|
21951
21978
|
}, [inOutDragging.dragging, onPointerMoveInOut, onPointerUpInOut]);
|
|
21952
|
-
const inContextMenu =
|
|
21979
|
+
const inContextMenu = useMemo103(() => {
|
|
21953
21980
|
return [
|
|
21954
21981
|
{
|
|
21955
21982
|
id: "hide-in",
|
|
@@ -21974,7 +22001,7 @@ var Inner2 = () => {
|
|
|
21974
22001
|
}
|
|
21975
22002
|
];
|
|
21976
22003
|
}, [setInAndOutFrames, videoConfig.id]);
|
|
21977
|
-
const outContextMenu =
|
|
22004
|
+
const outContextMenu = useMemo103(() => {
|
|
21978
22005
|
return [
|
|
21979
22006
|
{
|
|
21980
22007
|
id: "hide-out",
|
|
@@ -22003,21 +22030,21 @@ var Inner2 = () => {
|
|
|
22003
22030
|
style: style10,
|
|
22004
22031
|
onPointerDown,
|
|
22005
22032
|
children: [
|
|
22006
|
-
/* @__PURE__ */
|
|
22033
|
+
/* @__PURE__ */ jsx194("div", {
|
|
22007
22034
|
style: inner,
|
|
22008
22035
|
className: VERTICAL_SCROLLBAR_CLASSNAME
|
|
22009
22036
|
}),
|
|
22010
|
-
inFrame !== null && /* @__PURE__ */
|
|
22037
|
+
inFrame !== null && /* @__PURE__ */ jsx194(ContextMenu, {
|
|
22011
22038
|
values: inContextMenu,
|
|
22012
|
-
children: /* @__PURE__ */
|
|
22039
|
+
children: /* @__PURE__ */ jsx194(TimelineInOutPointerHandle, {
|
|
22013
22040
|
type: "in",
|
|
22014
22041
|
atFrame: inFrame,
|
|
22015
22042
|
dragging: inOutDragging.dragging === "in"
|
|
22016
22043
|
})
|
|
22017
22044
|
}),
|
|
22018
|
-
outFrame !== null && /* @__PURE__ */
|
|
22045
|
+
outFrame !== null && /* @__PURE__ */ jsx194(ContextMenu, {
|
|
22019
22046
|
values: outContextMenu,
|
|
22020
|
-
children: /* @__PURE__ */
|
|
22047
|
+
children: /* @__PURE__ */ jsx194(TimelineInOutPointerHandle, {
|
|
22021
22048
|
type: "out",
|
|
22022
22049
|
dragging: inOutDragging.dragging === "out",
|
|
22023
22050
|
atFrame: outFrame
|
|
@@ -22035,33 +22062,6 @@ import { useRef as useRef40 } from "react";
|
|
|
22035
22062
|
import { useCallback as useCallback107, useContext as useContext70, useMemo as useMemo111 } from "react";
|
|
22036
22063
|
import { Internals as Internals51 } from "remotion";
|
|
22037
22064
|
|
|
22038
|
-
// src/components/ExpandedTracksProvider.tsx
|
|
22039
|
-
import { createContext as createContext21, useCallback as useCallback98, useMemo as useMemo103, useState as useState70 } from "react";
|
|
22040
|
-
import { jsx as jsx194 } from "react/jsx-runtime";
|
|
22041
|
-
var ExpandedTracksContext = createContext21({
|
|
22042
|
-
expandedTracks: {},
|
|
22043
|
-
toggleTrack: () => {
|
|
22044
|
-
throw new Error("ExpandedTracksContext not initialized");
|
|
22045
|
-
}
|
|
22046
|
-
});
|
|
22047
|
-
var ExpandedTracksProvider = ({ children }) => {
|
|
22048
|
-
const [expandedTracks, setExpandedTracks] = useState70({});
|
|
22049
|
-
const toggleTrack = useCallback98((id) => {
|
|
22050
|
-
setExpandedTracks((prev) => ({
|
|
22051
|
-
...prev,
|
|
22052
|
-
[id]: !prev[id]
|
|
22053
|
-
}));
|
|
22054
|
-
}, []);
|
|
22055
|
-
const value = useMemo103(() => ({
|
|
22056
|
-
expandedTracks,
|
|
22057
|
-
toggleTrack
|
|
22058
|
-
}), [expandedTracks, toggleTrack]);
|
|
22059
|
-
return /* @__PURE__ */ jsx194(ExpandedTracksContext.Provider, {
|
|
22060
|
-
value,
|
|
22061
|
-
children
|
|
22062
|
-
});
|
|
22063
|
-
};
|
|
22064
|
-
|
|
22065
22065
|
// src/components/Timeline/TimelineExpandedSection.tsx
|
|
22066
22066
|
import React139, { useMemo as useMemo108 } from "react";
|
|
22067
22067
|
|
|
@@ -24652,6 +24652,9 @@ var noop3 = () => {
|
|
|
24652
24652
|
};
|
|
24653
24653
|
var TimelineInner = () => {
|
|
24654
24654
|
const { sequences } = useContext75(Internals57.SequenceManager);
|
|
24655
|
+
const { expandedTracks } = useContext75(ExpandedTracksContext);
|
|
24656
|
+
const { previewServerState } = useContext75(StudioServerConnectionCtx);
|
|
24657
|
+
const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) && previewServerState.type === "connected";
|
|
24655
24658
|
const videoConfig = Internals57.useUnsafeVideoConfig();
|
|
24656
24659
|
const timeline = useMemo118(() => {
|
|
24657
24660
|
if (!videoConfig) {
|
|
@@ -24675,14 +24678,15 @@ var TimelineInner = () => {
|
|
|
24675
24678
|
const inner2 = useMemo118(() => {
|
|
24676
24679
|
return {
|
|
24677
24680
|
height: shown.reduce((acc, track) => {
|
|
24678
|
-
|
|
24681
|
+
const isExpanded = visualModeEnabled && (expandedTracks[track.sequence.id] ?? false);
|
|
24682
|
+
return acc + getTimelineLayerHeight(track.sequence.type === "video" ? "video" : "other") + Number(TIMELINE_ITEM_BORDER_BOTTOM) + (isExpanded ? getExpandedTrackHeight(track.sequence.controls) + TIMELINE_ITEM_BORDER_BOTTOM : 0);
|
|
24679
24683
|
}, 0) + TIMELINE_ITEM_BORDER_BOTTOM + (hasBeenCut ? MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) + TIMELINE_TIME_INDICATOR_HEIGHT,
|
|
24680
24684
|
display: "flex",
|
|
24681
24685
|
flex: 1,
|
|
24682
24686
|
minHeight: "100%",
|
|
24683
24687
|
overflowX: "hidden"
|
|
24684
24688
|
};
|
|
24685
|
-
}, [hasBeenCut, shown]);
|
|
24689
|
+
}, [hasBeenCut, shown, expandedTracks, visualModeEnabled]);
|
|
24686
24690
|
return /* @__PURE__ */ jsx217("div", {
|
|
24687
24691
|
ref: timelineVerticalScroll,
|
|
24688
24692
|
style: container46,
|
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -208,7 +208,7 @@ var renderContent = (Root) => {
|
|
|
208
208
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
209
209
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
210
210
|
}));
|
|
211
|
-
import("./chunk-
|
|
211
|
+
import("./chunk-ba0scebn.js").then(({ StudioInternals }) => {
|
|
212
212
|
window.remotion_isStudio = true;
|
|
213
213
|
window.remotion_isReadOnlyStudio = true;
|
|
214
214
|
window.remotion_inputProps = "{}";
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.438",
|
|
7
7
|
"description": "APIs for interacting with the Remotion Studio",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"semver": "7.5.3",
|
|
29
|
-
"remotion": "4.0.
|
|
30
|
-
"@remotion/player": "4.0.
|
|
31
|
-
"@remotion/media-utils": "4.0.
|
|
32
|
-
"@remotion/renderer": "4.0.
|
|
33
|
-
"@remotion/web-renderer": "4.0.
|
|
34
|
-
"@remotion/studio-shared": "4.0.
|
|
35
|
-
"@remotion/zod-types": "4.0.
|
|
29
|
+
"remotion": "4.0.438",
|
|
30
|
+
"@remotion/player": "4.0.438",
|
|
31
|
+
"@remotion/media-utils": "4.0.438",
|
|
32
|
+
"@remotion/renderer": "4.0.438",
|
|
33
|
+
"@remotion/web-renderer": "4.0.438",
|
|
34
|
+
"@remotion/studio-shared": "4.0.438",
|
|
35
|
+
"@remotion/zod-types": "4.0.438",
|
|
36
36
|
"mediabunny": "1.39.2",
|
|
37
37
|
"memfs": "3.4.3",
|
|
38
38
|
"source-map": "0.7.3",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"react": "19.2.3",
|
|
44
44
|
"react-dom": "19.2.3",
|
|
45
45
|
"@types/semver": "^7.3.4",
|
|
46
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
46
|
+
"@remotion/eslint-config-internal": "4.0.438",
|
|
47
47
|
"eslint": "9.19.0",
|
|
48
48
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
49
49
|
},
|