@remotion/studio 4.0.457 → 4.0.459

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.
Files changed (37) hide show
  1. package/dist/components/FramePersistor.js +1 -1
  2. package/dist/components/PlaybackRatePersistor.js +1 -1
  3. package/dist/components/PreviewToolbar.js +1 -1
  4. package/dist/components/Timeline/Padder.d.ts +4 -0
  5. package/dist/components/Timeline/Padder.js +14 -0
  6. package/dist/components/Timeline/Timeline.js +10 -3
  7. package/dist/components/Timeline/TimelineEnumField.d.ts +11 -0
  8. package/dist/components/Timeline/TimelineEnumField.js +34 -0
  9. package/dist/components/Timeline/TimelineExpandArrowButton.d.ts +0 -1
  10. package/dist/components/Timeline/TimelineExpandArrowButton.js +3 -4
  11. package/dist/components/Timeline/TimelineExpandedRow.d.ts +16 -0
  12. package/dist/components/Timeline/TimelineExpandedRow.js +49 -0
  13. package/dist/components/Timeline/TimelineExpandedSection.d.ts +2 -2
  14. package/dist/components/Timeline/TimelineExpandedSection.js +11 -63
  15. package/dist/components/Timeline/TimelineFieldRow.d.ts +3 -1
  16. package/dist/components/Timeline/TimelineFieldRow.js +13 -12
  17. package/dist/components/Timeline/TimelineListItem.d.ts +1 -1
  18. package/dist/components/Timeline/TimelineListItem.js +6 -15
  19. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +5 -5
  20. package/dist/components/Timeline/TimelineSchemaField.js +4 -0
  21. package/dist/components/Timeline/TimelineSequence.d.ts +1 -1
  22. package/dist/components/Timeline/TimelineSequence.js +93 -51
  23. package/dist/components/Timeline/TimelineStack/index.js +1 -1
  24. package/dist/components/Timeline/TimelineTimeIndicators.js +10 -3
  25. package/dist/components/Timeline/TimelineTracks.js +5 -4
  26. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +19 -0
  27. package/dist/components/Timeline/sequence-props-subscription-store.js +151 -0
  28. package/dist/components/Timeline/use-sequence-props-subscription.js +35 -112
  29. package/dist/components/draw-peaks.js +7 -0
  30. package/dist/esm/audio-waveform-worker.mjs +3 -0
  31. package/dist/esm/{chunk-0y1jhm8s.js → chunk-0njpenna.js} +2171 -1959
  32. package/dist/esm/internals.mjs +2171 -1959
  33. package/dist/esm/previewEntry.mjs +2179 -1967
  34. package/dist/esm/renderEntry.mjs +1 -1
  35. package/dist/helpers/timeline-layout.d.ts +15 -17
  36. package/dist/helpers/timeline-layout.js +32 -52
  37. package/package.json +9 -9
@@ -11,7 +11,7 @@ const FramePersistor = () => {
11
11
  (0, react_1.useEffect)(() => {
12
12
  if (!playing) {
13
13
  setFrame((f) => {
14
- const newObj = { ...f, [config.id]: frame };
14
+ const newObj = f[config.id] === frame ? f : { ...f, [config.id]: frame };
15
15
  remotion_1.Internals.persistCurrentFrame(newObj);
16
16
  return newObj;
17
17
  });
@@ -5,7 +5,7 @@ const react_1 = require("react");
5
5
  const remotion_1 = require("remotion");
6
6
  const playbackrate_1 = require("../state/playbackrate");
7
7
  const PlaybackRatePersistor = () => {
8
- const { setPlaybackRate, playbackRate } = remotion_1.Internals.useTimelineContext();
8
+ const { setPlaybackRate, playbackRate } = remotion_1.Internals.usePlaybackRate();
9
9
  (0, react_1.useEffect)(() => {
10
10
  setPlaybackRate((0, playbackrate_1.loadPlaybackRate)());
11
11
  }, [setPlaybackRate]);
@@ -73,7 +73,7 @@ const padding = {
73
73
  width: timeline_layout_1.TIMELINE_PADDING,
74
74
  };
75
75
  const PreviewToolbar = ({ readOnlyStudio, bufferStateDelayInMilliseconds }) => {
76
- const { playbackRate, setPlaybackRate } = remotion_1.Internals.useTimelineContext();
76
+ const { playbackRate, setPlaybackRate } = remotion_1.Internals.usePlaybackRate();
77
77
  const { mediaMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
78
78
  const { setMediaMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
79
79
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const Padder: React.FC<{
3
+ readonly depth: number;
4
+ }>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Padder = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const TimelineListItem_1 = require("./TimelineListItem");
7
+ const Padder = ({ depth }) => {
8
+ const style = (0, react_1.useMemo)(() => ({
9
+ width: TimelineListItem_1.INDENT * depth,
10
+ flexShrink: 0,
11
+ }), [depth]);
12
+ return jsx_runtime_1.jsx("div", { style: style });
13
+ };
14
+ exports.Padder = Padder;
@@ -73,6 +73,7 @@ const TimelineInner = () => {
73
73
  const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
74
74
  const { expandedTracks } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksContext);
75
75
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
76
+ const { dragOverrides, codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeOverridesContext);
76
77
  const visualModeEnabled = Boolean(process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) &&
77
78
  previewServerState.type === 'connected';
78
79
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
@@ -104,8 +105,7 @@ const TimelineInner = () => {
104
105
  (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type) +
105
106
  Number(timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM) +
106
107
  (isExpanded
107
- ? (0, timeline_layout_1.getExpandedTrackHeight)(track.sequence, expandedTracks) +
108
- timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM
108
+ ? (0, timeline_layout_1.getExpandedTrackHeight)(track.sequence, expandedTracks, dragOverrides, codeValues) + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM
109
109
  : 0));
110
110
  }, 0) +
111
111
  timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM +
@@ -116,7 +116,14 @@ const TimelineInner = () => {
116
116
  minHeight: '100%',
117
117
  overflowX: 'hidden',
118
118
  };
119
- }, [hasBeenCut, shown, expandedTracks, visualModeEnabled]);
119
+ }, [
120
+ hasBeenCut,
121
+ shown,
122
+ expandedTracks,
123
+ visualModeEnabled,
124
+ codeValues,
125
+ dragOverrides,
126
+ ]);
120
127
  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.jsxs(TimelineWidthProvider_1.TimelineWidthProvider, { children: [
121
128
  jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), 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: [
122
129
  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: [
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { SchemaFieldInfo } from '../../helpers/timeline-layout';
3
+ export declare const TimelineEnumField: React.FC<{
4
+ readonly field: SchemaFieldInfo;
5
+ readonly codeValue: unknown;
6
+ readonly effectiveValue: unknown;
7
+ readonly canUpdate: boolean;
8
+ readonly onSave: (key: string, value: unknown) => Promise<void>;
9
+ readonly onDragValueChange: (key: string, value: unknown) => void;
10
+ readonly onDragEnd: () => void;
11
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimelineEnumField = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const selectStyle = {
7
+ marginLeft: 8,
8
+ background: 'transparent',
9
+ color: 'white',
10
+ border: '1px solid rgba(255, 255, 255, 0.2)',
11
+ borderRadius: 3,
12
+ fontSize: 12,
13
+ padding: '1px 4px',
14
+ };
15
+ const TimelineEnumField = ({ field, codeValue, effectiveValue, canUpdate, onSave, onDragValueChange, onDragEnd, }) => {
16
+ const { fieldSchema } = field;
17
+ if (fieldSchema.type !== 'enum') {
18
+ throw new Error('TimelineEnumField rendered for non-enum field');
19
+ }
20
+ const variantKeys = Object.keys(fieldSchema.variants);
21
+ const current = String(effectiveValue !== null && effectiveValue !== void 0 ? effectiveValue : fieldSchema.default);
22
+ const onChange = (0, react_1.useCallback)((e) => {
23
+ const newValue = e.target.value;
24
+ if (!canUpdate || newValue === codeValue) {
25
+ return;
26
+ }
27
+ onDragValueChange(field.key, newValue);
28
+ onSave(field.key, newValue).finally(() => {
29
+ onDragEnd();
30
+ });
31
+ }, [canUpdate, codeValue, field.key, onSave, onDragValueChange, onDragEnd]);
32
+ return (jsx_runtime_1.jsx("select", { disabled: !canUpdate, value: current, onChange: onChange, style: selectStyle, children: variantKeys.map((key) => (jsx_runtime_1.jsx("option", { value: key, children: key }, key))) }));
33
+ };
34
+ exports.TimelineEnumField = TimelineEnumField;
@@ -3,6 +3,5 @@ export declare const TimelineExpandArrowButton: React.FC<{
3
3
  readonly isExpanded: boolean;
4
4
  readonly onClick: () => void;
5
5
  readonly label: string;
6
- readonly hasExpandableContent: boolean;
7
6
  }>;
8
7
  export declare const TimelineExpandArrowSpacer: React.FC;
@@ -22,15 +22,14 @@ const arrowButton = {
22
22
  lineHeight: 1,
23
23
  };
24
24
  const svgStyle = { display: 'block' };
25
- const TimelineExpandArrowButton = ({ isExpanded, onClick, label, hasExpandableContent }) => {
25
+ const TimelineExpandArrowButton = ({ isExpanded, onClick, label }) => {
26
26
  const style = (0, react_1.useMemo)(() => {
27
27
  return {
28
28
  ...arrowButton,
29
29
  transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
30
- opacity: hasExpandableContent ? 1 : 0.2,
31
30
  };
32
- }, [isExpanded, hasExpandableContent]);
33
- return (jsx_runtime_1.jsx("button", { type: "button", style: style, onClick: onClick, disabled: !hasExpandableContent, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} ${label}`, children: jsx_runtime_1.jsx("svg", { width: "12", height: "12", viewBox: "0 0 8 8", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M2 1L6 4L2 7Z", fill: "white" }) }) }));
31
+ }, [isExpanded]);
32
+ return (jsx_runtime_1.jsx("button", { type: "button", style: style, onClick: onClick, "aria-expanded": isExpanded, "aria-label": `${isExpanded ? 'Collapse' : 'Expand'} ${label}`, children: jsx_runtime_1.jsx("svg", { width: "12", height: "12", viewBox: "0 0 8 8", style: svgStyle, children: jsx_runtime_1.jsx("path", { d: "M2 1L6 4L2 7Z", fill: "white" }) }) }));
34
33
  };
35
34
  exports.TimelineExpandArrowButton = TimelineExpandArrowButton;
36
35
  const TimelineExpandArrowSpacer = () => {
@@ -0,0 +1,16 @@
1
+ import type { SequenceNodePath } from '@remotion/studio-shared';
2
+ import React from 'react';
3
+ import type { SequenceSchema } from 'remotion';
4
+ import type { CodePosition } from '../../error-overlay/react-overlay/utils/get-source-map';
5
+ import type { TimelineTreeNode } from '../../helpers/timeline-layout';
6
+ export declare const TimelineExpandedRow: React.FC<{
7
+ readonly node: TimelineTreeNode;
8
+ readonly depth: number;
9
+ readonly nestedDepth: number;
10
+ readonly expandedTracks: Record<string, boolean>;
11
+ readonly toggleTrack: (id: string) => void;
12
+ readonly overrideId: string;
13
+ readonly validatedLocation: CodePosition | null;
14
+ readonly nodePath: SequenceNodePath | null;
15
+ readonly schema: SequenceSchema;
16
+ }>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimelineExpandedRow = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const timeline_layout_1 = require("../../helpers/timeline-layout");
7
+ const Padder_1 = require("./Padder");
8
+ const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
9
+ const TimelineFieldRow_1 = require("./TimelineFieldRow");
10
+ const TimelineListItem_1 = require("./TimelineListItem");
11
+ const groupRowBase = {
12
+ height: timeline_layout_1.TREE_GROUP_ROW_HEIGHT,
13
+ display: 'flex',
14
+ alignItems: 'center',
15
+ paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
16
+ };
17
+ const rowLabel = {
18
+ fontSize: 12,
19
+ color: 'rgba(255, 255, 255, 0.8)',
20
+ userSelect: 'none',
21
+ };
22
+ const labelOnlyRowBase = {
23
+ display: 'flex',
24
+ alignItems: 'center',
25
+ paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
26
+ };
27
+ const TimelineExpandedRow = ({ node, depth, nestedDepth, expandedTracks, toggleTrack, overrideId, validatedLocation, nodePath, schema, }) => {
28
+ var _a;
29
+ const paddingLeft = timeline_layout_1.EXPANDED_SECTION_PADDING_LEFT + depth * TimelineListItem_1.INDENT;
30
+ const groupStyle = (0, react_1.useMemo)(() => ({ ...groupRowBase, paddingLeft }), [paddingLeft]);
31
+ const labelOnlyStyle = (0, react_1.useMemo)(() => ({
32
+ ...labelOnlyRowBase,
33
+ height: (0, timeline_layout_1.getTreeRowHeight)(node),
34
+ paddingLeft,
35
+ }), [node, paddingLeft]);
36
+ if (node.kind === 'group') {
37
+ const isExpanded = (_a = expandedTracks[node.id]) !== null && _a !== void 0 ? _a : false;
38
+ return (jsx_runtime_1.jsxs("div", { style: groupStyle, children: [
39
+ jsx_runtime_1.jsx(Padder_1.Padder, { depth: nestedDepth + 1 }), jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(node.id), label: `${node.label} section` }), jsx_runtime_1.jsx("span", { style: rowLabel, children: node.label })
40
+ ] }));
41
+ }
42
+ if (node.field) {
43
+ return (jsx_runtime_1.jsx(TimelineFieldRow_1.TimelineFieldRow, { field: node.field, overrideId: overrideId, validatedLocation: validatedLocation, paddingLeft: paddingLeft, nestedDepth: nestedDepth, nodePath: nodePath, schema: schema }));
44
+ }
45
+ return (jsx_runtime_1.jsxs("div", { style: labelOnlyStyle, children: [
46
+ jsx_runtime_1.jsx(Padder_1.Padder, { depth: nestedDepth + 1 }), jsx_runtime_1.jsx("span", { style: rowLabel, children: node.label })
47
+ ] }));
48
+ };
49
+ exports.TimelineExpandedRow = TimelineExpandedRow;
@@ -1,10 +1,10 @@
1
1
  import type { SequenceNodePath } from '@remotion/studio-shared';
2
2
  import React from 'react';
3
- import type { TSequence } from 'remotion';
3
+ import { type TSequence } from 'remotion';
4
4
  import type { OriginalPosition } from '../../error-overlay/react-overlay/utils/get-source-map';
5
5
  export declare const TimelineExpandedSection: React.FC<{
6
6
  readonly sequence: TSequence;
7
7
  readonly originalLocation: OriginalPosition | null;
8
- readonly nestedDepth: number;
9
8
  readonly nodePath: SequenceNodePath | null;
9
+ readonly nestedDepth: number;
10
10
  }>;
@@ -36,12 +36,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.TimelineExpandedSection = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
+ const remotion_1 = require("remotion");
39
40
  const colors_1 = require("../../helpers/colors");
40
41
  const timeline_layout_1 = require("../../helpers/timeline-layout");
41
42
  const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
42
- const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
43
- const TimelineFieldRow_1 = require("./TimelineFieldRow");
44
- const TimelineListItem_1 = require("./TimelineListItem");
43
+ const TimelineExpandedRow_1 = require("./TimelineExpandedRow");
45
44
  const expandedSectionBase = {
46
45
  color: 'white',
47
46
  fontFamily: 'Arial, Helvetica, sans-serif',
@@ -54,27 +53,10 @@ const separator = {
54
53
  height: 1,
55
54
  backgroundColor: colors_1.TIMELINE_TRACK_SEPARATOR,
56
55
  };
57
- const groupRowBase = {
58
- height: timeline_layout_1.TREE_GROUP_ROW_HEIGHT,
59
- display: 'flex',
60
- alignItems: 'center',
61
- paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
62
- };
63
- const rowLabel = {
64
- fontSize: 12,
65
- color: 'rgba(255, 255, 255, 0.8)',
66
- userSelect: 'none',
67
- };
68
- const labelOnlyRowBase = {
69
- display: 'flex',
70
- alignItems: 'center',
71
- paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
72
- };
73
- const TimelineExpandedSection = ({ sequence, originalLocation, nestedDepth, nodePath }) => {
74
- var _a;
75
- var _b;
56
+ const TimelineExpandedSection = ({ sequence, originalLocation, nodePath, nestedDepth }) => {
76
57
  const { expandedTracks, toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksContext);
77
- const overrideId = (_b = (_a = sequence.controls) === null || _a === void 0 ? void 0 : _a.overrideId) !== null && _b !== void 0 ? _b : sequence.id;
58
+ const { dragOverrides, codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeOverridesContext);
59
+ const { overrideId } = sequence.controls;
78
60
  const validatedLocation = (0, react_1.useMemo)(() => {
79
61
  var _a;
80
62
  if (!originalLocation ||
@@ -88,56 +70,22 @@ const TimelineExpandedSection = ({ sequence, originalLocation, nestedDepth, node
88
70
  column: (_a = originalLocation.column) !== null && _a !== void 0 ? _a : 0,
89
71
  };
90
72
  }, [originalLocation]);
91
- const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)(sequence), [sequence]);
92
- const flat = (0, react_1.useMemo)(() => (0, timeline_layout_1.flattenVisibleTreeNodes)(tree, expandedTracks), [tree, expandedTracks]);
93
- const expandedHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getExpandedTrackHeight)(sequence, expandedTracks), [sequence, expandedTracks]);
94
- const sequenceOffsetPx = TimelineListItem_1.SPACING * 3 * nestedDepth;
95
- const keysToObserve = (0, react_1.useMemo)(() => {
96
- const fields = (0, timeline_layout_1.getSchemaFields)(sequence.controls);
97
- if (!fields) {
98
- return [];
99
- }
100
- return fields.map((f) => f.key);
101
- }, [sequence.controls]);
73
+ const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({ sequence, dragOverrides, codeValues }), [sequence, dragOverrides, codeValues]);
74
+ const flat = (0, react_1.useMemo)(() => (0, timeline_layout_1.flattenVisibleTreeNodes)({ nodes: tree, expandedTracks }), [tree, expandedTracks]);
75
+ const expandedHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getExpandedTrackHeight)(sequence, expandedTracks, dragOverrides, codeValues), [sequence, expandedTracks, dragOverrides, codeValues]);
102
76
  const style = (0, react_1.useMemo)(() => {
103
77
  return {
104
78
  ...expandedSectionBase,
105
79
  height: expandedHeight,
106
80
  };
107
81
  }, [expandedHeight]);
108
- const renderRow = (0, react_1.useCallback)((node, depth) => {
109
- var _a;
110
- const paddingLeft = timeline_layout_1.EXPANDED_SECTION_PADDING_LEFT +
111
- depth * timeline_layout_1.TREE_INDENT_PER_LEVEL +
112
- sequenceOffsetPx;
113
- if (node.kind === 'group') {
114
- const isExpanded = (_a = expandedTracks[node.id]) !== null && _a !== void 0 ? _a : false;
115
- return (jsx_runtime_1.jsxs("div", { style: { ...groupRowBase, paddingLeft }, children: [
116
- jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(node.id), label: `${node.label} section`, hasExpandableContent: true }), jsx_runtime_1.jsx("span", { style: rowLabel, children: node.label })
117
- ] }));
118
- }
119
- if (node.field) {
120
- return (jsx_runtime_1.jsx(TimelineFieldRow_1.TimelineFieldRow, { field: node.field, overrideId: overrideId, validatedLocation: validatedLocation, paddingLeft: paddingLeft, nodePath: nodePath, keysToObserve: keysToObserve }));
121
- }
122
- return (jsx_runtime_1.jsx("div", { style: {
123
- ...labelOnlyRowBase,
124
- height: (0, timeline_layout_1.getTreeRowHeight)(node),
125
- paddingLeft,
126
- }, children: jsx_runtime_1.jsx("span", { style: rowLabel, children: node.label }) }));
127
- }, [
128
- expandedTracks,
129
- keysToObserve,
130
- nodePath,
131
- overrideId,
132
- sequenceOffsetPx,
133
- toggleTrack,
134
- validatedLocation,
135
- ]);
82
+ const { schema } = sequence.controls;
136
83
  if (flat.length === 0) {
137
84
  return jsx_runtime_1.jsx("div", { style: style, children: "No schema" });
138
85
  }
139
86
  return (jsx_runtime_1.jsx("div", { style: style, children: flat.map(({ node, depth }, i) => {
140
- return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i > 0 ? jsx_runtime_1.jsx("div", { style: separator }) : null, renderRow(node, depth)] }, node.id));
87
+ return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i > 0 ? jsx_runtime_1.jsx("div", { style: separator }) : null, jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: nestedDepth, expandedTracks: expandedTracks, toggleTrack: toggleTrack, overrideId: overrideId, validatedLocation: validatedLocation, nodePath: nodePath, schema: schema })
88
+ ] }, node.id));
141
89
  }) }));
142
90
  };
143
91
  exports.TimelineExpandedSection = TimelineExpandedSection;
@@ -1,5 +1,6 @@
1
1
  import type { SequenceNodePath } from '@remotion/studio-shared';
2
2
  import React from 'react';
3
+ import type { SequenceSchema } from 'remotion';
3
4
  import type { CodePosition } from '../../error-overlay/react-overlay/utils/get-source-map';
4
5
  import type { SchemaFieldInfo } from '../../helpers/timeline-layout';
5
6
  export declare const TimelineFieldRow: React.FC<{
@@ -7,6 +8,7 @@ export declare const TimelineFieldRow: React.FC<{
7
8
  readonly overrideId: string;
8
9
  readonly validatedLocation: CodePosition | null;
9
10
  readonly paddingLeft: number;
11
+ readonly nestedDepth: number;
10
12
  readonly nodePath: SequenceNodePath | null;
11
- readonly keysToObserve: string[];
13
+ readonly schema: SequenceSchema;
12
14
  }>;
@@ -6,6 +6,7 @@ const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const timeline_layout_1 = require("../../helpers/timeline-layout");
8
8
  const call_api_1 = require("../call-api");
9
+ const Padder_1 = require("./Padder");
9
10
  const TimelineSchemaField_1 = require("./TimelineSchemaField");
10
11
  const fieldRowBase = {
11
12
  display: 'flex',
@@ -25,28 +26,28 @@ const fieldLabelRow = {
25
26
  alignItems: 'center',
26
27
  gap: 6,
27
28
  };
28
- const TimelineFieldRow = ({ field, overrideId, validatedLocation, paddingLeft, nodePath, keysToObserve, }) => {
29
+ const TimelineFieldRow = ({ field, overrideId, validatedLocation, paddingLeft, nestedDepth, nodePath, schema, }) => {
29
30
  var _a, _b, _c, _d;
30
- const { setDragOverrides, clearDragOverrides, dragOverrides, codeValues: allPropStatuses, } = (0, react_1.useContext)(remotion_1.Internals.VisualModeOverridesContext);
31
- const propStatuses = ((_a = allPropStatuses[overrideId]) !== null && _a !== void 0 ? _a : null);
32
- const propStatus = (_b = propStatuses === null || propStatuses === void 0 ? void 0 : propStatuses[field.key]) !== null && _b !== void 0 ? _b : null;
31
+ const { setDragOverrides, clearDragOverrides, dragOverrides, codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeOverridesContext);
32
+ const codeValuesForOverride = (_a = codeValues[overrideId]) !== null && _a !== void 0 ? _a : null;
33
+ const codeValue = (_b = codeValuesForOverride === null || codeValuesForOverride === void 0 ? void 0 : codeValuesForOverride[field.key]) !== null && _b !== void 0 ? _b : null;
33
34
  const dragOverrideValue = (0, react_1.useMemo)(() => {
34
35
  var _a;
35
36
  return ((_a = dragOverrides[overrideId]) !== null && _a !== void 0 ? _a : {})[field.key];
36
37
  }, [dragOverrides, overrideId, field.key]);
37
38
  const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
38
- codeValue: propStatus,
39
- runtimeValue: field.currentValue,
39
+ codeValue,
40
+ runtimeValue: field.currentRuntimeValue,
40
41
  dragOverrideValue,
41
42
  defaultValue: field.fieldSchema.default,
42
43
  shouldResortToDefaultValueIfUndefined: true,
43
44
  });
44
45
  const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeOverridesContext);
45
46
  const onSave = (0, react_1.useCallback)((key, value) => {
46
- if (!propStatuses || !validatedLocation || !nodePath) {
47
+ if (!codeValuesForOverride || !validatedLocation || !nodePath) {
47
48
  return Promise.reject(new Error('Cannot save'));
48
49
  }
49
- const status = propStatuses[key];
50
+ const status = codeValuesForOverride[key];
50
51
  if (!status || !status.canUpdate) {
51
52
  return Promise.reject(new Error('Cannot save'));
52
53
  }
@@ -59,7 +60,7 @@ const TimelineFieldRow = ({ field, overrideId, validatedLocation, paddingLeft, n
59
60
  key,
60
61
  value: JSON.stringify(value),
61
62
  defaultValue,
62
- observedKeys: keysToObserve,
63
+ schema,
63
64
  }).then((data) => {
64
65
  if (data.success) {
65
66
  if (data.newStatus.canUpdate) {
@@ -73,11 +74,11 @@ const TimelineFieldRow = ({ field, overrideId, validatedLocation, paddingLeft, n
73
74
  return Promise.reject(new Error(data.reason));
74
75
  });
75
76
  }, [
77
+ codeValuesForOverride,
76
78
  field.fieldSchema.default,
77
- keysToObserve,
78
79
  nodePath,
79
80
  overrideId,
80
- propStatuses,
81
+ schema,
81
82
  setCodeValues,
82
83
  validatedLocation,
83
84
  ]);
@@ -95,7 +96,7 @@ const TimelineFieldRow = ({ field, overrideId, validatedLocation, paddingLeft, n
95
96
  };
96
97
  }, [field.rowHeight, paddingLeft]);
97
98
  return (jsx_runtime_1.jsxs("div", { style: style, children: [
98
- jsx_runtime_1.jsx("div", { style: fieldLabelRow, children: jsx_runtime_1.jsx("span", { style: fieldName, children: (_c = field.description) !== null && _c !== void 0 ? _c : field.key }) }), jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: propStatus, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, canUpdate: (_d = propStatus === null || propStatus === void 0 ? void 0 : propStatus.canUpdate) !== null && _d !== void 0 ? _d : false, effectiveValue: effectiveValue, codeValue: propStatus })
99
+ jsx_runtime_1.jsx(Padder_1.Padder, { depth: nestedDepth + 1 }), jsx_runtime_1.jsx("div", { style: fieldLabelRow, children: jsx_runtime_1.jsx("span", { style: fieldName, children: (_c = field.description) !== null && _c !== void 0 ? _c : field.key }) }), jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: codeValue, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, canUpdate: (_d = codeValue === null || codeValue === void 0 ? void 0 : codeValue.canUpdate) !== null && _d !== void 0 ? _d : false, effectiveValue: effectiveValue, codeValue: codeValue })
99
100
  ] }));
100
101
  };
101
102
  exports.TimelineFieldRow = TimelineFieldRow;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { TSequence } from 'remotion';
3
- export declare const SPACING = 5;
3
+ export declare const INDENT = 10;
4
4
  export declare const TimelineListItem: React.FC<{
5
5
  readonly sequence: TSequence;
6
6
  readonly nestedDepth: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimelineListItem = exports.SPACING = void 0;
3
+ exports.TimelineListItem = exports.INDENT = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
@@ -11,17 +11,14 @@ const call_api_1 = require("../call-api");
11
11
  const ContextMenu_1 = require("../ContextMenu");
12
12
  const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
13
13
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
14
+ const Padder_1 = require("./Padder");
14
15
  const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
15
16
  const TimelineExpandedSection_1 = require("./TimelineExpandedSection");
16
17
  const TimelineLayerEye_1 = require("./TimelineLayerEye");
17
18
  const TimelineStack_1 = require("./TimelineStack");
18
19
  const use_resolved_stack_1 = require("./use-resolved-stack");
19
20
  const use_sequence_props_subscription_1 = require("./use-sequence-props-subscription");
20
- exports.SPACING = 5;
21
- const space = {
22
- width: exports.SPACING,
23
- flexShrink: 0,
24
- };
21
+ exports.INDENT = 10;
25
22
  const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
26
23
  var _a, _b;
27
24
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
@@ -146,12 +143,6 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
146
143
  const onToggleExpand = (0, react_1.useCallback)(() => {
147
144
  toggleTrack(sequence.id);
148
145
  }, [sequence.id, toggleTrack]);
149
- const padder = (0, react_1.useMemo)(() => {
150
- return {
151
- width: Number(exports.SPACING) * nestedDepth,
152
- flexShrink: 0,
153
- };
154
- }, [nestedDepth]);
155
146
  const isItemHidden = (0, react_1.useMemo)(() => {
156
147
  var _a;
157
148
  return (_a = hidden[sequence.id]) !== null && _a !== void 0 ? _a : false;
@@ -181,13 +172,13 @@ const TimelineListItem = ({ nestedDepth, sequence, isCompact }) => {
181
172
  alignItems: 'center',
182
173
  wordBreak: 'break-all',
183
174
  textAlign: 'left',
184
- paddingLeft: exports.SPACING,
175
+ paddingLeft: 5,
185
176
  };
186
177
  }, []);
187
178
  const hasExpandableContent = Boolean(sequence.controls) || sequence.effects.length > 0;
188
179
  const trackRow = (jsx_runtime_1.jsx("div", { style: outer, children: jsx_runtime_1.jsxs("div", { style: inner, children: [
189
- jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility }), jsx_runtime_1.jsx("div", { style: padder }), sequence.parent && nestedDepth > 0 ? jsx_runtime_1.jsx("div", { style: space }) : null, visualModeActive ? (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: onToggleExpand, label: "track properties", hasExpandableContent: hasExpandableContent })) : null, jsx_runtime_1.jsx(TimelineStack_1.TimelineStack, { sequence: sequence, isCompact: isCompact, originalLocation: originalLocation })
180
+ jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility }), jsx_runtime_1.jsx(Padder_1.Padder, { depth: nestedDepth }), visualModeActive ? (hasExpandableContent ? (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: onToggleExpand, label: "track properties" })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}))) : null, jsx_runtime_1.jsx(TimelineStack_1.TimelineStack, { sequence: sequence, isCompact: isCompact, originalLocation: originalLocation })
190
181
  ] }) }));
191
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [visualModeEnvEnabled ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, children: trackRow })) : (trackRow), visualModeActive && isExpanded && hasExpandableContent ? (jsx_runtime_1.jsx(TimelineExpandedSection_1.TimelineExpandedSection, { sequence: sequence, originalLocation: originalLocation, nestedDepth: nestedDepth, nodePath: nodePath })) : null] }));
182
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [visualModeEnvEnabled ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, children: trackRow })) : (trackRow), visualModeActive && isExpanded && hasExpandableContent ? (jsx_runtime_1.jsx(TimelineExpandedSection_1.TimelineExpandedSection, { sequence: sequence, originalLocation: originalLocation, nodePath: nodePath, nestedDepth: nestedDepth })) : null] }));
192
183
  };
193
184
  exports.TimelineListItem = TimelineListItem;
@@ -9,10 +9,11 @@ const timeline_refs_1 = require("./timeline-refs");
9
9
  const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
10
10
  let lastTimelinePositionWhileScrolling = null;
11
11
  const TimelinePlayCursorSyncer = () => {
12
- var _a, _b;
12
+ var _a;
13
13
  const video = remotion_1.Internals.useVideo();
14
- const timelineContext = remotion_1.Internals.useTimelineContext();
15
14
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
15
+ const [playing] = remotion_1.Internals.Timeline.usePlayingState();
16
+ const { playbackRate } = remotion_1.Internals.usePlaybackRate();
16
17
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
17
18
  const { zoom: zoomMap } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
18
19
  const compositionId = canvasContent && canvasContent.type === 'composition'
@@ -27,7 +28,6 @@ const TimelinePlayCursorSyncer = () => {
27
28
  (0, imperative_state_1.setCurrentDuration)(video.durationInFrames);
28
29
  (0, imperative_state_1.setCurrentFps)(video.fps);
29
30
  }
30
- const playing = (_b = timelineContext.playing) !== null && _b !== void 0 ? _b : false;
31
31
  /**
32
32
  * While playing (forwards or backwards), jump one viewport width to the left or right when the cursor goes out of the viewport.
33
33
  */
@@ -39,11 +39,11 @@ const TimelinePlayCursorSyncer = () => {
39
39
  return;
40
40
  }
41
41
  (0, timeline_scroll_logic_1.ensureFrameIsInViewport)({
42
- direction: timelineContext.playbackRate > 0 ? 'page-right' : 'page-left',
42
+ direction: playbackRate > 0 ? 'page-right' : 'page-left',
43
43
  durationInFrames: video.durationInFrames,
44
44
  frame: timelinePosition,
45
45
  });
46
- }, [playing, timelineContext, timelinePosition, video]);
46
+ }, [playbackRate, playing, timelinePosition, video]);
47
47
  /**
48
48
  * Restore state if `enter` is being pressed
49
49
  */
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TimelineFieldValue = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const TimelineBooleanField_1 = require("./TimelineBooleanField");
6
+ const TimelineEnumField_1 = require("./TimelineEnumField");
6
7
  const TimelineNumberField_1 = require("./TimelineNumberField");
7
8
  const TimelineRotationField_1 = require("./TimelineRotationField");
8
9
  const TimelineTranslateField_1 = require("./TimelineTranslateField");
@@ -44,6 +45,9 @@ const TimelineFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propS
44
45
  if (field.typeName === 'boolean') {
45
46
  return (jsx_runtime_1.jsx("span", { style: wrapperStyle, children: jsx_runtime_1.jsx(TimelineBooleanField_1.TimelineBooleanField, { field: field, codeValue: codeValue, canUpdate: canUpdate, onSave: onSave, effectiveValue: effectiveValue }) }));
46
47
  }
48
+ if (field.typeName === 'enum') {
49
+ return (jsx_runtime_1.jsx("span", { style: wrapperStyle, children: jsx_runtime_1.jsx(TimelineEnumField_1.TimelineEnumField, { field: field, codeValue: codeValue, canUpdate: canUpdate, onSave: onSave, effectiveValue: effectiveValue, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd }) }));
50
+ }
47
51
  return (jsx_runtime_1.jsx("span", { style: { ...unsupportedLabel, fontStyle: 'normal' }, children: String(effectiveValue) }));
48
52
  };
49
53
  exports.TimelineFieldValue = TimelineFieldValue;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { TSequence } from 'remotion';
3
- export declare const TimelineSequence: React.FC<{
3
+ export declare const TimelineSequence: React.NamedExoticComponent<{
4
4
  readonly s: TSequence;
5
5
  }>;