@remotion/studio 4.0.468 → 4.0.470

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/Studio.js +1 -1
  2. package/dist/api/save-render-output.js +3 -12
  3. package/dist/components/AudioWaveform.d.ts +1 -0
  4. package/dist/components/AudioWaveform.js +41 -23
  5. package/dist/components/CompositionSelectorItem.js +1 -1
  6. package/dist/components/ContextMenu.d.ts +1 -0
  7. package/dist/components/ContextMenu.js +8 -3
  8. package/dist/components/EditorContent.js +5 -4
  9. package/dist/components/EditorGuides/Guide.js +1 -1
  10. package/dist/components/ExpandedTracksProvider.js +3 -8
  11. package/dist/components/Menu/MenuItem.d.ts +1 -1
  12. package/dist/components/Menu/MenuItem.js +2 -2
  13. package/dist/components/Menu/MenuSubItem.js +5 -5
  14. package/dist/components/MenuBuildIndicator.js +0 -1
  15. package/dist/components/NewComposition/InputDragger.js +1 -0
  16. package/dist/components/Preview.js +4 -1
  17. package/dist/components/PreviewToolbar.js +2 -4
  18. package/dist/components/SelectedOutlineOverlay.d.ts +18 -0
  19. package/dist/components/SelectedOutlineOverlay.js +645 -0
  20. package/dist/components/Timeline/Timeline.js +18 -3
  21. package/dist/components/Timeline/TimelineDeleteKeybindings.d.ts +2 -0
  22. package/dist/components/Timeline/TimelineDeleteKeybindings.js +86 -0
  23. package/dist/components/Timeline/TimelineDragHandler.js +19 -244
  24. package/dist/components/Timeline/{TimelineEffectGroupRow.d.ts → TimelineEffectItem.d.ts} +1 -1
  25. package/dist/components/Timeline/{TimelineEffectGroupRow.js → TimelineEffectItem.js} +61 -35
  26. package/dist/components/Timeline/{TimelineEffectFieldRow.d.ts → TimelineEffectPropItem.d.ts} +4 -1
  27. package/dist/components/Timeline/{TimelineEffectFieldRow.js → TimelineEffectPropItem.js} +100 -16
  28. package/dist/components/Timeline/TimelineExpandArrowButton.js +5 -1
  29. package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +11 -0
  30. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +55 -0
  31. package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -0
  32. package/dist/components/Timeline/TimelineExpandedRow.js +29 -11
  33. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -0
  34. package/dist/components/Timeline/TimelineExpandedSection.js +4 -4
  35. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +1 -1
  36. package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +9 -120
  37. package/dist/components/Timeline/TimelineFieldLabel.d.ts +6 -0
  38. package/dist/components/Timeline/TimelineFieldLabel.js +30 -0
  39. package/dist/components/Timeline/TimelineInOutDragHandler.d.ts +2 -0
  40. package/dist/components/Timeline/TimelineInOutDragHandler.js +324 -0
  41. package/dist/components/Timeline/TimelineInOutPointer.js +3 -1
  42. package/dist/components/Timeline/TimelineInOutPointerHandle.d.ts +1 -0
  43. package/dist/components/Timeline/TimelineInOutPointerHandle.js +5 -4
  44. package/dist/components/Timeline/TimelineItemStack.d.ts +5 -0
  45. package/dist/components/Timeline/TimelineItemStack.js +82 -0
  46. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +17 -0
  47. package/dist/components/Timeline/TimelineKeyframeControls.js +217 -0
  48. package/dist/components/Timeline/TimelineKeyframeDiamond.d.ts +7 -0
  49. package/dist/components/Timeline/TimelineKeyframeDiamond.js +88 -0
  50. package/dist/components/Timeline/TimelineKeyframedValue.d.ts +8 -0
  51. package/dist/components/Timeline/TimelineKeyframedValue.js +36 -0
  52. package/dist/components/Timeline/TimelineLayerEye.js +1 -0
  53. package/dist/components/Timeline/TimelineList.js +3 -11
  54. package/dist/components/Timeline/TimelineMediaInfo.d.ts +13 -1
  55. package/dist/components/Timeline/TimelineMediaInfo.js +33 -80
  56. package/dist/components/Timeline/TimelineRowChrome.d.ts +10 -1
  57. package/dist/components/Timeline/TimelineRowChrome.js +64 -6
  58. package/dist/components/Timeline/TimelineSchemaField.js +7 -2
  59. package/dist/components/Timeline/TimelineSelection.d.ts +85 -0
  60. package/dist/components/Timeline/TimelineSelection.js +417 -0
  61. package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
  62. package/dist/components/Timeline/TimelineSequence.js +18 -6
  63. package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
  64. package/dist/components/Timeline/{TimelineListItem.d.ts → TimelineSequenceItem.d.ts} +2 -2
  65. package/dist/components/Timeline/{TimelineListItem.js → TimelineSequenceItem.js} +148 -63
  66. package/dist/components/Timeline/TimelineSequenceName.d.ts +7 -0
  67. package/dist/components/Timeline/TimelineSequenceName.js +50 -0
  68. package/dist/components/Timeline/{TimelineFieldRow.d.ts → TimelineSequencePropItem.d.ts} +5 -3
  69. package/dist/components/Timeline/TimelineSequencePropItem.js +183 -0
  70. package/dist/components/Timeline/TimelineTimeIndicators.js +0 -1
  71. package/dist/components/Timeline/TimelineTrack.d.ts +5 -0
  72. package/dist/components/Timeline/TimelineTrack.js +66 -0
  73. package/dist/components/Timeline/TimelineTracks.js +2 -16
  74. package/dist/components/Timeline/TimelineTranslateField.js +14 -22
  75. package/dist/components/Timeline/TimelineUvCoordinateField.d.ts +11 -0
  76. package/dist/components/Timeline/TimelineUvCoordinateField.js +126 -0
  77. package/dist/components/Timeline/TimelineVideoInfo.js +11 -12
  78. package/dist/components/Timeline/call-add-keyframe.d.ts +23 -0
  79. package/dist/components/Timeline/call-add-keyframe.js +54 -0
  80. package/dist/components/Timeline/call-delete-keyframe.d.ts +21 -0
  81. package/dist/components/Timeline/call-delete-keyframe.js +50 -0
  82. package/dist/components/Timeline/delete-selected-keyframe.d.ts +11 -0
  83. package/dist/components/Timeline/delete-selected-keyframe.js +51 -0
  84. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +17 -0
  85. package/dist/components/Timeline/delete-selected-timeline-item.js +183 -0
  86. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +13 -0
  87. package/dist/components/Timeline/duplicate-selected-timeline-item.js +66 -0
  88. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +7 -0
  89. package/dist/components/Timeline/find-track-for-node-path-info.js +13 -0
  90. package/dist/components/Timeline/get-keyframe-navigation.d.ts +9 -0
  91. package/dist/components/Timeline/get-keyframe-navigation.js +26 -0
  92. package/dist/components/Timeline/get-node-keyframes.d.ts +11 -0
  93. package/dist/components/Timeline/get-node-keyframes.js +23 -0
  94. package/dist/components/Timeline/get-timeline-keyframes.js +6 -8
  95. package/dist/components/Timeline/parse-keyframe-field-from-node-path.d.ts +8 -0
  96. package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +26 -0
  97. package/dist/components/Timeline/save-sequence-prop.d.ts +14 -2
  98. package/dist/components/Timeline/save-sequence-prop.js +42 -7
  99. package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -0
  100. package/dist/components/Timeline/timeline-field-row-layout.js +11 -1
  101. package/dist/components/Timeline/timeline-row-layout.d.ts +1 -0
  102. package/dist/components/Timeline/timeline-row-layout.js +2 -1
  103. package/dist/components/Timeline/timeline-translate-utils.d.ts +2 -0
  104. package/dist/components/Timeline/timeline-translate-utils.js +20 -0
  105. package/dist/components/Timeline/use-expanded-track-keyframe-rows.d.ts +17 -0
  106. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +52 -0
  107. package/dist/components/Timeline/use-open-sequence-in-editor.d.ts +6 -0
  108. package/dist/components/Timeline/use-open-sequence-in-editor.js +31 -0
  109. package/dist/components/composition-menu-items.js +32 -1
  110. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +0 -1
  111. package/dist/esm/{chunk-8q828zk7.js → chunk-dny42qnq.js} +10566 -6221
  112. package/dist/esm/internals.mjs +10566 -6221
  113. package/dist/esm/previewEntry.mjs +10548 -6203
  114. package/dist/esm/renderEntry.mjs +3 -1
  115. package/dist/helpers/colors.d.ts +1 -1
  116. package/dist/helpers/colors.js +1 -1
  117. package/dist/helpers/format-file-location.d.ts +9 -0
  118. package/dist/helpers/format-file-location.js +27 -0
  119. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
  120. package/dist/helpers/get-box-quads-polyfill-internals.js +2395 -0
  121. package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
  122. package/dist/helpers/get-box-quads-ponyfill.js +23 -0
  123. package/dist/helpers/open-in-editor.d.ts +1 -1
  124. package/dist/helpers/open-in-editor.js +11 -26
  125. package/dist/helpers/timeline-layout.d.ts +8 -7
  126. package/dist/helpers/timeline-layout.js +9 -8
  127. package/dist/helpers/timeline-node-path-key.d.ts +2 -0
  128. package/dist/helpers/timeline-node-path-key.js +10 -0
  129. package/dist/helpers/use-menu-structure.js +8 -16
  130. package/dist/renderEntry.js +2 -2
  131. package/package.json +10 -10
  132. package/dist/components/Timeline/TimelineFieldRow.js +0 -113
  133. package/dist/components/Timeline/TimelineStack/index.d.ts +0 -8
  134. package/dist/components/Timeline/TimelineStack/index.js +0 -119
@@ -1,29 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimelineEffectFieldRow = void 0;
3
+ exports.TimelineEffectPropItem = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const studio_shared_1 = require("@remotion/studio-shared");
6
6
  const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
8
  const client_id_1 = require("../../helpers/client-id");
9
- const timeline_layout_1 = require("../../helpers/timeline-layout");
10
9
  const call_api_1 = require("../call-api");
10
+ const ContextMenu_1 = require("../ContextMenu");
11
11
  const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
12
+ const save_effect_prop_1 = require("./save-effect-prop");
12
13
  const save_prop_queue_1 = require("./save-prop-queue");
13
14
  const timeline_field_row_layout_1 = require("./timeline-field-row-layout");
14
15
  const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
16
+ const TimelineFieldLabel_1 = require("./TimelineFieldLabel");
17
+ const TimelineKeyframeControls_1 = require("./TimelineKeyframeControls");
18
+ const TimelineKeyframedValue_1 = require("./TimelineKeyframedValue");
15
19
  const TimelineLayerEye_1 = require("./TimelineLayerEye");
16
20
  const TimelineRowChrome_1 = require("./TimelineRowChrome");
17
21
  const TimelineSchemaField_1 = require("./TimelineSchemaField");
18
- const fieldRowBase = {
19
- paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
20
- };
21
- const fieldName = {
22
- fontSize: 12,
23
- color: 'rgba(255, 255, 255, 0.8)',
24
- userSelect: 'none',
25
- };
26
- const Value = ({ field, nodePath, validatedLocation }) => {
22
+ const TimelineSelection_1 = require("./TimelineSelection");
23
+ const fieldRowBase = {};
24
+ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) => {
27
25
  var _a;
28
26
  var _b;
29
27
  const { setEffectDragOverrides, clearEffectDragOverrides, setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
@@ -130,6 +128,9 @@ const Value = ({ field, nodePath, validatedLocation }) => {
130
128
  throw new Error(`Unsupported effect status: ${effectStatus.reason}`);
131
129
  }
132
130
  if (propStatus === null || !propStatus.canUpdate) {
131
+ if ((propStatus === null || propStatus === void 0 ? void 0 : propStatus.reason) === 'keyframed') {
132
+ return (jsx_runtime_1.jsx(TimelineKeyframedValue_1.TimelineKeyframedValue, { field: field, propStatus: propStatus, keyframeDisplayOffset: keyframeDisplayOffset }));
133
+ }
133
134
  if ((propStatus === null || propStatus === void 0 ? void 0 : propStatus.reason) === 'computed') {
134
135
  return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: (0, get_timeline_keyframes_1.getComputedStatusLabel)(propStatus) });
135
136
  }
@@ -143,17 +144,100 @@ const Value = ({ field, nodePath, validatedLocation }) => {
143
144
  });
144
145
  return (jsx_runtime_1.jsx(TimelineSchemaField_1.TimelineFieldValue, { field: field, propStatus: propStatus, onSave: onSave, onDragValueChange: onDragValueChange, onDragEnd: onDragEnd, effectiveValue: effectiveValue }));
145
146
  };
146
- const TimelineEffectFieldRow = ({ field, validatedLocation, rowDepth, nodePath }) => {
147
+ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath, nodePathInfo, keyframeDisplayOffset, }) => {
147
148
  var _a;
149
+ var _b, _c;
150
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
151
+ const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
152
+ const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
153
+ const { getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
154
+ const selection = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
148
155
  const style = (0, react_1.useMemo)(() => {
149
156
  return {
150
157
  ...fieldRowBase,
151
158
  height: field.rowHeight,
152
159
  };
153
160
  }, [field.rowHeight]);
154
- const labelRowStyle = (0, react_1.useMemo)(() => (0, timeline_field_row_layout_1.getTimelineFieldLabelRowStyle)(rowDepth), [rowDepth]);
155
- return (jsx_runtime_1.jsxs(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: style, children: [
156
- jsx_runtime_1.jsx("div", { style: labelRowStyle, children: jsx_runtime_1.jsx("span", { style: fieldName, children: (_a = field.description) !== null && _a !== void 0 ? _a : field.key }) }), jsx_runtime_1.jsx(Value, { field: field, nodePath: nodePath, validatedLocation: validatedLocation })
161
+ const effectStatus = (0, react_1.useMemo)(() => remotion_1.Internals.getEffectCodeValuesCtx({
162
+ codeValues,
163
+ nodePath,
164
+ effectIndex: field.effectIndex,
165
+ }), [codeValues, nodePath, field.effectIndex]);
166
+ const propStatus = effectStatus.type === 'can-update-effect'
167
+ ? ((_b = (_a = effectStatus.props) === null || _a === void 0 ? void 0 : _a[field.key]) !== null && _b !== void 0 ? _b : null)
168
+ : null;
169
+ const dragOverrideValue = (0, react_1.useMemo)(() => {
170
+ const overrides = getEffectDragOverrides(nodePath, field.effectIndex);
171
+ return overrides[field.key];
172
+ }, [getEffectDragOverrides, nodePath, field.effectIndex, field.key]);
173
+ const keyframeControls = propStatus !== null &&
174
+ (0, TimelineKeyframeControls_1.shouldShowTimelineKeyframeControls)({
175
+ propStatus,
176
+ selected: selection.selected,
177
+ }) ? (jsx_runtime_1.jsx(TimelineKeyframeControls_1.TimelineKeyframeControls, { fieldKey: field.key, propStatus: propStatus, nodePath: nodePath, fileName: validatedLocation.source, keyframeDisplayOffset: keyframeDisplayOffset, defaultValue: field.fieldSchema.default, dragOverrideValue: dragOverrideValue, schema: field.effectSchema, effectIndex: field.effectIndex })) : null;
178
+ const isNonDefault = (0, react_1.useMemo)(() => {
179
+ var _a;
180
+ if (!propStatus || !propStatus.canUpdate) {
181
+ return false;
182
+ }
183
+ const effectiveCodeValue = (_a = propStatus.codeValue) !== null && _a !== void 0 ? _a : field.fieldSchema.default;
184
+ return (JSON.stringify(effectiveCodeValue) !==
185
+ JSON.stringify(field.fieldSchema.default));
186
+ }, [field.fieldSchema.default, propStatus]);
187
+ const canPerformReset = previewServerState.type === 'connected' &&
188
+ propStatus !== null &&
189
+ propStatus.canUpdate;
190
+ const onReset = (0, react_1.useCallback)(() => {
191
+ if (!canPerformReset ||
192
+ previewServerState.type !== 'connected' ||
193
+ !isNonDefault) {
194
+ return;
195
+ }
196
+ const defaultValue = field.fieldSchema.default !== undefined
197
+ ? JSON.stringify(field.fieldSchema.default)
198
+ : null;
199
+ (0, save_effect_prop_1.saveEffectProp)({
200
+ fileName: validatedLocation.source,
201
+ nodePath,
202
+ effectIndex: field.effectIndex,
203
+ fieldKey: field.key,
204
+ value: field.fieldSchema.default,
205
+ defaultValue,
206
+ schema: field.effectSchema,
207
+ setCodeValues,
208
+ clientId: previewServerState.clientId,
209
+ });
210
+ }, [
211
+ canPerformReset,
212
+ field.effectIndex,
213
+ field.effectSchema,
214
+ field.fieldSchema.default,
215
+ field.key,
216
+ isNonDefault,
217
+ nodePath,
218
+ previewServerState,
219
+ setCodeValues,
220
+ validatedLocation.source,
221
+ ]);
222
+ const contextMenuValues = (0, react_1.useMemo)(() => {
223
+ return [
224
+ {
225
+ type: 'item',
226
+ id: 'reset-effect-field',
227
+ keyHint: null,
228
+ label: 'Reset',
229
+ leftItem: null,
230
+ disabled: !canPerformReset,
231
+ onClick: onReset,
232
+ quickSwitcherLabel: null,
233
+ subMenu: null,
234
+ value: 'reset-effect-field',
235
+ },
236
+ ];
237
+ }, [canPerformReset, onReset]);
238
+ const row = (jsx_runtime_1.jsxs(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), keyframeControls: keyframeControls, arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: style, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: [
239
+ jsx_runtime_1.jsx(TimelineFieldLabel_1.TimelineFieldLabel, { rowDepth: rowDepth, selected: selection.selected, label: (_c = field.description) !== null && _c !== void 0 ? _c : field.key }), jsx_runtime_1.jsx("div", { style: timeline_field_row_layout_1.timelineFieldValueColumnStyle, children: jsx_runtime_1.jsx(Value, { field: field, nodePath: nodePath, validatedLocation: validatedLocation, keyframeDisplayOffset: keyframeDisplayOffset }) })
157
240
  ] }));
241
+ return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, onOpen: selection.selectable ? selection.onSelect : null, children: row }));
158
242
  };
159
- exports.TimelineEffectFieldRow = TimelineEffectFieldRow;
243
+ exports.TimelineEffectPropItem = TimelineEffectPropItem;
@@ -21,6 +21,10 @@ const arrowButton = {
21
21
  outline: 'none',
22
22
  lineHeight: 1,
23
23
  };
24
+ const arrowSpacer = {
25
+ ...arrowButton,
26
+ cursor: 'default',
27
+ };
24
28
  const svgStyle = { display: 'block' };
25
29
  const TimelineExpandArrowButton = ({ isExpanded, onClick, label, disabled = false }) => {
26
30
  const style = (0, react_1.useMemo)(() => {
@@ -35,6 +39,6 @@ const TimelineExpandArrowButton = ({ isExpanded, onClick, label, disabled = fals
35
39
  };
36
40
  exports.TimelineExpandArrowButton = TimelineExpandArrowButton;
37
41
  const TimelineExpandArrowSpacer = () => {
38
- return jsx_runtime_1.jsx("div", { style: arrowButton });
42
+ return jsx_runtime_1.jsx("div", { style: arrowSpacer });
39
43
  };
40
44
  exports.TimelineExpandArrowSpacer = TimelineExpandArrowSpacer;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
3
+ export declare const TimelineExpandedKeyframeRow: React.NamedExoticComponent<{
4
+ readonly height: number;
5
+ readonly keyframes: {
6
+ frame: number;
7
+ value: unknown;
8
+ }[];
9
+ readonly nodePathInfo: SequenceNodePathInfo;
10
+ readonly showSeparator: boolean;
11
+ }>;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.TimelineExpandedKeyframeRow = void 0;
37
+ const jsx_runtime_1 = require("react/jsx-runtime");
38
+ const react_1 = __importStar(require("react"));
39
+ const timeline_layout_1 = require("../../helpers/timeline-layout");
40
+ const TimelineKeyframeDiamond_1 = require("./TimelineKeyframeDiamond");
41
+ const TimelineSelection_1 = require("./TimelineSelection");
42
+ const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
43
+ const row = {
44
+ position: 'relative',
45
+ };
46
+ const rowSeparator = {
47
+ height: timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
48
+ };
49
+ const TimelineExpandedKeyframeRowUnmemoized = ({ height, keyframes, nodePathInfo, showSeparator }) => {
50
+ const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
51
+ const { selected: rowSelected } = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
52
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showSeparator ? jsx_runtime_1.jsx("div", { style: rowSeparator }) : null, jsx_runtime_1.jsxs("div", { style: { ...row, height }, children: [rowSelected && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth) })) : null, keyframes.map((keyframe) => (jsx_runtime_1.jsx(TimelineKeyframeDiamond_1.TimelineKeyframeDiamond, { frame: keyframe.frame, rowHeight: height, nodePathInfo: nodePathInfo }, keyframe.frame)))] })
53
+ ] }));
54
+ };
55
+ exports.TimelineExpandedKeyframeRow = react_1.default.memo(TimelineExpandedKeyframeRowUnmemoized);
@@ -13,4 +13,5 @@ export declare const TimelineExpandedRow: React.FC<{
13
13
  readonly validatedLocation: CodePosition;
14
14
  readonly nodePath: SequencePropsSubscriptionKey;
15
15
  readonly schema: SequenceSchema;
16
+ readonly keyframeDisplayOffset: number;
16
17
  }>;
@@ -1,44 +1,62 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.TimelineExpandedRow = void 0;
4
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = __importDefault(require("react"));
5
9
  const timeline_layout_1 = require("../../helpers/timeline-layout");
6
10
  const timeline_row_layout_1 = require("./timeline-row-layout");
7
- const TimelineEffectFieldRow_1 = require("./TimelineEffectFieldRow");
8
- const TimelineEffectGroupRow_1 = require("./TimelineEffectGroupRow");
11
+ const TimelineEffectItem_1 = require("./TimelineEffectItem");
12
+ const TimelineEffectPropItem_1 = require("./TimelineEffectPropItem");
9
13
  const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
10
- const TimelineFieldRow_1 = require("./TimelineFieldRow");
11
14
  const TimelineLayerEye_1 = require("./TimelineLayerEye");
12
15
  const TimelineRowChrome_1 = require("./TimelineRowChrome");
16
+ const TimelineSelection_1 = require("./TimelineSelection");
17
+ const TimelineSequencePropItem_1 = require("./TimelineSequencePropItem");
13
18
  const rowLabel = {
14
19
  fontSize: 12,
15
20
  color: 'rgba(255, 255, 255, 0.8)',
16
21
  userSelect: 'none',
17
22
  };
18
- const TimelineExpandedRow = ({ node, depth, nestedDepth, getIsExpanded, toggleTrack, validatedLocation, nodePath, schema, }) => {
23
+ const TimelineExpandedRow = ({ node, depth, nestedDepth, getIsExpanded, toggleTrack, validatedLocation, nodePath, schema, keyframeDisplayOffset, }) => {
19
24
  const rowDepth = (0, timeline_row_layout_1.getExpandedRowDepth)({ nestedDepth, treeDepth: depth });
25
+ const selection = (0, TimelineSelection_1.useTimelineRowSelection)(node.nodePathInfo);
26
+ const labelStyle = react_1.default.useMemo(() => ({
27
+ ...rowLabel,
28
+ ...(0, TimelineSelection_1.getTimelineSelectedLabelStyle)(selection.selected, true),
29
+ alignSelf: 'stretch',
30
+ alignItems: 'center',
31
+ color: (0, TimelineSelection_1.getTimelineColor)(selection.selected, true),
32
+ display: 'flex',
33
+ flex: 1,
34
+ minWidth: 0,
35
+ paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
36
+ }), [selection.selected]);
20
37
  if (node.kind === 'group') {
21
38
  if (node.effectInfo) {
22
- return (jsx_runtime_1.jsx(TimelineEffectGroupRow_1.TimelineEffectGroupRow, { label: node.label, nodePathInfo: node.nodePathInfo, effectIndex: node.effectInfo.effectIndex, effectSchema: node.effectInfo.effectSchema, documentationLink: node.effectInfo.documentationLink, nodePath: nodePath, validatedLocation: validatedLocation, rowDepth: rowDepth, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack }));
39
+ return (
40
+ // A single effect
41
+ jsx_runtime_1.jsx(TimelineEffectItem_1.TimelineEffectItem, { label: node.label, nodePathInfo: node.nodePathInfo, effectIndex: node.effectInfo.effectIndex, effectSchema: node.effectInfo.effectSchema, documentationLink: node.effectInfo.documentationLink, nodePath: nodePath, validatedLocation: validatedLocation, rowDepth: rowDepth, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack }));
23
42
  }
43
+ // Group like "Effects"
24
44
  const isExpanded = getIsExpanded(node.nodePathInfo);
25
45
  return (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(node.nodePathInfo), label: `${node.label} section`, disabled: false }), style: {
26
46
  height: timeline_layout_1.TREE_GROUP_ROW_HEIGHT,
27
- paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
28
- }, children: jsx_runtime_1.jsx("span", { style: rowLabel, children: node.label }) }));
47
+ }, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { style: labelStyle, children: node.label }) }));
29
48
  }
30
49
  if (node.field) {
31
50
  if (node.field.kind === 'effect-field') {
32
- return (jsx_runtime_1.jsx(TimelineEffectFieldRow_1.TimelineEffectFieldRow, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath }));
51
+ return (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropItem, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath, nodePathInfo: node.nodePathInfo, keyframeDisplayOffset: keyframeDisplayOffset }));
33
52
  }
34
53
  if (node.field.kind === 'sequence-field') {
35
- return (jsx_runtime_1.jsx(TimelineFieldRow_1.TimelineFieldRow, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath, schema: schema }));
54
+ return (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequencePropItem, { field: node.field, validatedLocation: validatedLocation, rowDepth: rowDepth, nodePath: nodePath, nodePathInfo: node.nodePathInfo, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset }));
36
55
  }
37
56
  throw new Error('Unexpected field kind: ' + JSON.stringify(node.field));
38
57
  }
39
58
  return (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {}), style: {
40
59
  height: (0, timeline_layout_1.getTreeRowHeight)(node),
41
- paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
42
- }, children: jsx_runtime_1.jsx("span", { style: rowLabel, children: node.label }) }));
60
+ }, selected: selection.selected, selectable: selection.selectable, onSelect: selection.onSelect, showSelectedBackground: true, containsSelection: false, outerHeight: null, children: jsx_runtime_1.jsx("span", { style: labelStyle, children: node.label }) }));
43
61
  };
44
62
  exports.TimelineExpandedRow = TimelineExpandedRow;
@@ -7,4 +7,5 @@ export declare const TimelineExpandedSection: React.FC<{
7
7
  readonly validatedLocation: CodePosition;
8
8
  readonly nodePathInfo: SequenceNodePathInfo;
9
9
  readonly nestedDepth: number;
10
+ readonly keyframeDisplayOffset: number;
10
11
  }>;
@@ -50,10 +50,10 @@ const expandedSectionBase = {
50
50
  borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
51
51
  };
52
52
  const separator = {
53
- height: 1,
54
- backgroundColor: colors_1.TIMELINE_TRACK_SEPARATOR,
53
+ height: 0,
54
+ borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
55
55
  };
56
- const TimelineExpandedSection = ({ sequence, validatedLocation, nodePathInfo, nestedDepth }) => {
56
+ const TimelineExpandedSection = ({ sequence, validatedLocation, nodePathInfo, nestedDepth, keyframeDisplayOffset, }) => {
57
57
  const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
58
58
  const { toggleTrack } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksSetterContext);
59
59
  const { codeValues: visualModeCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
@@ -89,7 +89,7 @@ const TimelineExpandedSection = ({ sequence, validatedLocation, nodePathInfo, ne
89
89
  return jsx_runtime_1.jsx("div", { style: style, children: "No schema" });
90
90
  }
91
91
  return (jsx_runtime_1.jsx("div", { style: style, children: flat.map(({ node, depth }, i) => {
92
- 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, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema })
92
+ 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, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset })
93
93
  ] }, JSON.stringify(node.nodePathInfo)));
94
94
  }) }));
95
95
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type TSequence } from 'remotion';
2
+ import type { TSequence } from 'remotion';
3
3
  import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
4
4
  export declare const TimelineExpandedTrackKeyframes: React.NamedExoticComponent<{
5
5
  readonly sequence: TSequence;
@@ -1,130 +1,19 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
35
5
  Object.defineProperty(exports, "__esModule", { value: true });
36
6
  exports.TimelineExpandedTrackKeyframes = void 0;
37
7
  const jsx_runtime_1 = require("react/jsx-runtime");
38
- const react_1 = __importStar(require("react"));
39
- const remotion_1 = require("remotion");
40
- const colors_1 = require("../../helpers/colors");
41
- const get_left_of_timeline_slider_1 = require("../../helpers/get-left-of-timeline-slider");
42
- const timeline_layout_1 = require("../../helpers/timeline-layout");
43
- const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
44
- const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
45
- const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
46
- const row = {
47
- position: 'relative',
48
- };
49
- const separator = {
50
- height: 1,
51
- backgroundColor: colors_1.TIMELINE_TRACK_SEPARATOR,
52
- };
53
- const section = {
54
- borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
55
- };
56
- const diamondBase = {
57
- position: 'absolute',
58
- width: 8,
59
- height: 8,
60
- backgroundColor: colors_1.LIGHT_TEXT,
61
- borderRadius: 1,
62
- boxShadow: '0 0 0 1px rgba(0, 0, 0, 0.4)',
63
- pointerEvents: 'none',
64
- };
65
- const getNodeKeyframes = ({ node, nodePath, codeValues, keyframeDisplayOffset, }) => {
66
- var _a, _b;
67
- if (node.kind !== 'field' || node.field === null) {
68
- return [];
69
- }
70
- if (node.field.kind === 'sequence-field') {
71
- return (0, get_timeline_keyframes_1.getTimelineKeyframes)((_a = remotion_1.Internals.getCodeValuesCtx(codeValues, nodePath)) === null || _a === void 0 ? void 0 : _a[node.field.key], keyframeDisplayOffset);
72
- }
73
- const effectStatus = remotion_1.Internals.getEffectCodeValuesCtx({
74
- codeValues,
75
- nodePath,
76
- effectIndex: node.field.effectIndex,
77
- });
78
- return (0, get_timeline_keyframes_1.getTimelineKeyframes)(effectStatus.type === 'can-update-effect'
79
- ? (_b = effectStatus.props) === null || _b === void 0 ? void 0 : _b[node.field.key]
80
- : null, keyframeDisplayOffset);
81
- };
8
+ const react_1 = __importDefault(require("react"));
9
+ const TimelineExpandedKeyframeRow_1 = require("./TimelineExpandedKeyframeRow");
10
+ const use_expanded_track_keyframe_rows_1 = require("./use-expanded-track-keyframe-rows");
82
11
  const TimelineExpandedTrackKeyframesInner = ({ nodePathInfo, sequence, keyframeDisplayOffset }) => {
83
- const videoConfig = (0, remotion_1.useVideoConfig)();
84
- const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
85
- const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
86
- const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
87
- const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({
12
+ const { rows, expandedHeight } = (0, use_expanded_track_keyframe_rows_1.useExpandedTrackKeyframeRows)({
88
13
  sequence,
89
14
  nodePathInfo,
90
- getDragOverrides: () => ({}),
91
- getEffectDragOverrides: () => ({}),
92
- codeValues,
93
- }), [codeValues, nodePathInfo, sequence]);
94
- const flat = (0, react_1.useMemo)(() => (0, timeline_layout_1.flattenVisibleTreeNodes)({ nodes: tree, getIsExpanded }), [tree, getIsExpanded]);
95
- const expandedHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getExpandedTrackHeight)({
96
- sequence,
97
- nodePathInfo,
98
- getIsExpanded,
99
- codeValues,
100
- }), [codeValues, getIsExpanded, nodePathInfo, sequence]);
101
- const rows = (0, react_1.useMemo)(() => flat.map(({ node }) => ({
102
- height: (0, timeline_layout_1.getTreeRowHeight)(node),
103
- keyframes: getNodeKeyframes({
104
- node,
105
- nodePath: nodePathInfo.sequenceSubscriptionKey,
106
- codeValues,
107
- keyframeDisplayOffset,
108
- }),
109
- key: JSON.stringify(node.nodePathInfo),
110
- })), [
111
- codeValues,
112
- flat,
113
15
  keyframeDisplayOffset,
114
- nodePathInfo.sequenceSubscriptionKey,
115
- ]);
116
- return (jsx_runtime_1.jsx("div", { style: {
117
- height: expandedHeight + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
118
- }, children: jsx_runtime_1.jsx("div", { style: { ...section, height: expandedHeight }, children: rows.map(({ height, keyframes, key }, i) => {
119
- return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i > 0 ? jsx_runtime_1.jsx("div", { style: separator }) : null, jsx_runtime_1.jsx("div", { style: { ...row, height }, children: timelineWidth === null
120
- ? null
121
- : keyframes.map((keyframe) => (jsx_runtime_1.jsx("div", { style: {
122
- ...diamondBase,
123
- left: (0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(keyframe.frame, videoConfig.durationInFrames, timelineWidth) - timeline_layout_1.TIMELINE_PADDING,
124
- top: height / 2,
125
- transform: 'translate(-50%, -50%) rotate(45deg)',
126
- }, title: `Keyframe at frame ${keyframe.frame}` }, String(keyframe.frame)))) })
127
- ] }, key));
128
- }) }) }));
16
+ });
17
+ return (jsx_runtime_1.jsx("div", { style: { height: expandedHeight }, children: rows.map((row, index) => (jsx_runtime_1.jsx(TimelineExpandedKeyframeRow_1.TimelineExpandedKeyframeRow, { height: row.height, keyframes: row.keyframes, nodePathInfo: row.nodePathInfo, showSeparator: index > 0 }, row.rowKey))) }));
129
18
  };
130
19
  exports.TimelineExpandedTrackKeyframes = react_1.default.memo(TimelineExpandedTrackKeyframesInner);
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const TimelineFieldLabel: React.FC<{
3
+ readonly rowDepth: number;
4
+ readonly selected: boolean;
5
+ readonly label: string;
6
+ }>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimelineFieldLabel = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const timeline_field_row_layout_1 = require("./timeline-field-row-layout");
7
+ const TimelineSelection_1 = require("./TimelineSelection");
8
+ const fieldNameBase = {
9
+ fontSize: 12,
10
+ color: 'rgba(255, 255, 255, 0.8)',
11
+ userSelect: 'none',
12
+ whiteSpace: 'nowrap',
13
+ overflow: 'hidden',
14
+ textOverflow: 'ellipsis',
15
+ flex: 1,
16
+ minWidth: 0,
17
+ };
18
+ const TimelineFieldLabel = ({ rowDepth, selected, label }) => {
19
+ const labelRowStyle = (0, react_1.useMemo)(() => ({
20
+ ...(0, timeline_field_row_layout_1.getTimelineFieldLabelRowStyle)(rowDepth),
21
+ ...(0, TimelineSelection_1.getTimelineSelectedLabelStyle)(selected, true),
22
+ alignSelf: 'stretch',
23
+ }), [rowDepth, selected]);
24
+ const fieldNameStyle = (0, react_1.useMemo)(() => ({
25
+ ...fieldNameBase,
26
+ color: (0, TimelineSelection_1.getTimelineColor)(selected, true),
27
+ }), [selected]);
28
+ return (jsx_runtime_1.jsx("div", { style: labelRowStyle, children: jsx_runtime_1.jsx("span", { style: fieldNameStyle, title: label, children: label }) }));
29
+ };
30
+ exports.TimelineFieldLabel = TimelineFieldLabel;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const TimelineInOutDragHandler: React.FC;