@remotion/studio 4.0.436 → 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.
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const Timeline: React.FC;
2
+ export declare const Timeline: React.NamedExoticComponent<{}>;
@@ -1,12 +1,47 @@
1
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
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.Timeline = void 0;
4
37
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
38
+ const react_1 = __importStar(require("react"));
6
39
  const remotion_1 = require("remotion");
7
40
  const calculate_timeline_1 = require("../../helpers/calculate-timeline");
41
+ const client_id_1 = require("../../helpers/client-id");
8
42
  const colors_1 = require("../../helpers/colors");
9
43
  const timeline_layout_1 = require("../../helpers/timeline-layout");
44
+ const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
10
45
  const is_menu_item_1 = require("../Menu/is-menu-item");
11
46
  const SplitterContainer_1 = require("../Splitter/SplitterContainer");
12
47
  const SplitterElement_1 = require("../Splitter/SplitterElement");
@@ -32,9 +67,13 @@ const container = {
32
67
  backgroundColor: colors_1.BACKGROUND,
33
68
  };
34
69
  const noop = () => undefined;
35
- const Timeline = () => {
70
+ const TimelineInner = () => {
36
71
  var _a;
37
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';
38
77
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
39
78
  const timeline = (0, react_1.useMemo)(() => {
40
79
  if (!videoConfig) {
@@ -58,9 +97,15 @@ const Timeline = () => {
58
97
  const inner = (0, react_1.useMemo)(() => {
59
98
  return {
60
99
  height: shown.reduce((acc, track) => {
100
+ var _a;
101
+ const isExpanded = visualModeEnabled && ((_a = expandedTracks[track.sequence.id]) !== null && _a !== void 0 ? _a : false);
61
102
  return (acc +
62
103
  (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type === 'video' ? 'video' : 'other') +
63
- 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));
64
109
  }, 0) +
65
110
  timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM +
66
111
  (hasBeenCut ? MaxTimelineTracks_1.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT : 0) +
@@ -70,11 +115,11 @@ const Timeline = () => {
70
115
  minHeight: '100%',
71
116
  overflowX: 'hidden',
72
117
  };
73
- }, [hasBeenCut, shown]);
118
+ }, [hasBeenCut, shown, expandedTracks, visualModeEnabled]);
74
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: [
75
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: [
76
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, {})
77
122
  ] }) })
78
123
  ] }) }) }) }));
79
124
  };
80
- exports.Timeline = Timeline;
125
+ exports.Timeline = react_1.default.memo(TimelineInner);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export declare const useResponsiveSidebarStatus: () => "collapsed" | "expanded";
3
- export declare const TopPanel: React.FC<{
3
+ export declare const TopPanel: React.NamedExoticComponent<{
4
4
  readonly readOnlyStudio: boolean;
5
5
  readonly onMounted: () => void;
6
6
  readonly drawRef: React.RefObject<HTMLDivElement | null>;
@@ -1,11 +1,44 @@
1
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
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
39
  exports.TopPanel = exports.useResponsiveSidebarStatus = void 0;
7
40
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = require("react");
41
+ const react_1 = __importStar(require("react"));
9
42
  const mobile_layout_1 = require("../helpers/mobile-layout");
10
43
  const use_breakpoint_1 = require("../helpers/use-breakpoint");
11
44
  const editor_rulers_1 = require("../state/editor-rulers");
@@ -48,7 +81,7 @@ const useResponsiveSidebarStatus = () => {
48
81
  return actualStateLeft;
49
82
  };
50
83
  exports.useResponsiveSidebarStatus = useResponsiveSidebarStatus;
51
- const TopPanel = ({ readOnlyStudio, onMounted, drawRef, bufferStateDelayInMilliseconds }) => {
84
+ const TopPanelInner = ({ readOnlyStudio, onMounted, drawRef, bufferStateDelayInMilliseconds }) => {
52
85
  const { setSidebarCollapsedState, sidebarCollapsedStateRight } = (0, react_1.useContext)(sidebar_1.SidebarContext);
53
86
  const rulersAreVisible = (0, use_is_ruler_visible_1.useIsRulerVisible)();
54
87
  const actualStateLeft = (0, exports.useResponsiveSidebarStatus)();
@@ -80,4 +113,4 @@ const TopPanel = ({ readOnlyStudio, onMounted, drawRef, bufferStateDelayInMillis
80
113
  ] }) }), jsx_runtime_1.jsx(PreviewToolbar_1.PreviewToolbar, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CurrentCompositionSideEffects_1.CurrentCompositionKeybindings, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CurrentCompositionSideEffects_1.TitleUpdater, {})
81
114
  ] }));
82
115
  };
83
- exports.TopPanel = TopPanel;
116
+ exports.TopPanel = react_1.default.memo(TopPanelInner);