@remotion/studio 4.0.473 → 4.0.474

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 (79) hide show
  1. package/dist/components/AssetSelectorItem.js +30 -6
  2. package/dist/components/Canvas.js +71 -0
  3. package/dist/components/Modals.js +1 -2
  4. package/dist/components/NewComposition/InputDragger.d.ts +1 -0
  5. package/dist/components/NewComposition/InputDragger.js +9 -6
  6. package/dist/components/SelectedOutlineOverlay.d.ts +7 -5
  7. package/dist/components/SelectedOutlineOverlay.js +78 -67
  8. package/dist/components/Timeline/KeyframeSettingsModal.js +4 -4
  9. package/dist/components/Timeline/SequencePropsObserver.js +3 -3
  10. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -7
  11. package/dist/components/Timeline/TimelineClipboardKeybindings.js +19 -16
  12. package/dist/components/Timeline/TimelineDeleteKeybindings.js +11 -9
  13. package/dist/components/Timeline/TimelineEffectItem.js +7 -7
  14. package/dist/components/Timeline/TimelineEffectPropItem.js +17 -17
  15. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +6 -1
  16. package/dist/components/Timeline/TimelineExpandedSection.js +5 -5
  17. package/dist/components/Timeline/TimelineKeyframeControls.js +8 -8
  18. package/dist/components/Timeline/TimelineKeyframeDiamond.js +0 -1
  19. package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +9 -0
  20. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +120 -0
  21. package/dist/components/Timeline/TimelineKeyframedValue.js +1 -1
  22. package/dist/components/Timeline/TimelineNumberField.js +15 -7
  23. package/dist/components/Timeline/TimelineRotationField.js +17 -11
  24. package/dist/components/Timeline/TimelineScaleField.js +16 -12
  25. package/dist/components/Timeline/TimelineSelection.d.ts +15 -0
  26. package/dist/components/Timeline/TimelineSelection.js +26 -1
  27. package/dist/components/Timeline/TimelineSequence.js +6 -6
  28. package/dist/components/Timeline/TimelineSequenceItem.js +21 -14
  29. package/dist/components/Timeline/TimelineSequencePropItem.js +37 -37
  30. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +5 -5
  31. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +46 -44
  32. package/dist/components/Timeline/TimelineTranslateField.js +24 -19
  33. package/dist/components/Timeline/TimelineUvCoordinateField.js +18 -12
  34. package/dist/components/Timeline/{apply-effect-response-to-code-values.d.ts → apply-effect-response-to-prop-statuses.d.ts} +1 -1
  35. package/dist/components/Timeline/{apply-effect-response-to-code-values.js → apply-effect-response-to-prop-statuses.js} +3 -3
  36. package/dist/components/Timeline/call-add-keyframe.d.ts +5 -5
  37. package/dist/components/Timeline/call-add-keyframe.js +6 -6
  38. package/dist/components/Timeline/call-delete-keyframe.d.ts +7 -7
  39. package/dist/components/Timeline/call-delete-keyframe.js +7 -7
  40. package/dist/components/Timeline/call-move-keyframe.d.ts +3 -3
  41. package/dist/components/Timeline/call-move-keyframe.js +3 -3
  42. package/dist/components/Timeline/call-update-keyframe-settings.d.ts +5 -5
  43. package/dist/components/Timeline/call-update-keyframe-settings.js +6 -6
  44. package/dist/components/Timeline/delete-selected-keyframe.d.ts +5 -5
  45. package/dist/components/Timeline/delete-selected-keyframe.js +5 -5
  46. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +5 -5
  47. package/dist/components/Timeline/delete-selected-timeline-item.js +6 -4
  48. package/dist/components/Timeline/get-node-keyframes.d.ts +3 -3
  49. package/dist/components/Timeline/get-node-keyframes.js +4 -4
  50. package/dist/components/Timeline/get-timeline-easing-segments.d.ts +9 -0
  51. package/dist/components/Timeline/get-timeline-easing-segments.js +19 -0
  52. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +7 -7
  53. package/dist/components/Timeline/reset-selected-timeline-props.js +10 -10
  54. package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
  55. package/dist/components/Timeline/save-effect-prop.js +5 -5
  56. package/dist/components/Timeline/save-prop-queue.d.ts +3 -3
  57. package/dist/components/Timeline/save-prop-queue.js +3 -3
  58. package/dist/components/Timeline/save-sequence-prop.d.ts +3 -3
  59. package/dist/components/Timeline/save-sequence-prop.js +4 -4
  60. package/dist/components/Timeline/timeline-field-utils.d.ts +10 -0
  61. package/dist/components/Timeline/timeline-field-utils.js +26 -5
  62. package/dist/components/Timeline/timeline-translate-utils.d.ts +1 -1
  63. package/dist/components/Timeline/timeline-translate-utils.js +4 -5
  64. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +7 -7
  65. package/dist/components/Timeline/use-sequence-props-subscription.js +3 -3
  66. package/dist/components/Timeline/use-timeline-height.js +3 -3
  67. package/dist/components/Timeline/use-timeline-keyframe-drag.js +13 -11
  68. package/dist/components/import-assets.d.ts +15 -0
  69. package/dist/components/import-assets.js +63 -1
  70. package/dist/esm/{chunk-q0jkt0zq.js → chunk-xjvc8qen.js} +1708 -1394
  71. package/dist/esm/internals.mjs +1708 -1394
  72. package/dist/esm/previewEntry.mjs +1711 -1397
  73. package/dist/esm/renderEntry.mjs +1 -1
  74. package/dist/helpers/timeline-layout.d.ts +6 -6
  75. package/dist/helpers/timeline-layout.js +5 -5
  76. package/dist/state/modals.d.ts +0 -3
  77. package/package.json +10 -10
  78. package/dist/components/NewComposition/DeleteStaticFile.d.ts +0 -4
  79. package/dist/components/NewComposition/DeleteStaticFile.js +0 -44
@@ -13,10 +13,10 @@ const TimelineSelection_1 = require("./TimelineSelection");
13
13
  const TimelineDeleteKeybindings = () => {
14
14
  const keybindings = (0, use_keybinding_1.useKeybinding)();
15
15
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
16
- const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
16
+ const sequencesRef = (0, react_1.useContext)(remotion_1.Internals.SequenceManagerRefContext);
17
17
  const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
18
- const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
19
- const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
18
+ const propStatusesRef = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesRefContext);
19
+ const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
20
20
  const { canSelect } = (0, TimelineSelection_1.useTimelineSelection)();
21
21
  const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
22
22
  const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
@@ -30,6 +30,8 @@ const TimelineDeleteKeybindings = () => {
30
30
  key: 'Backspace',
31
31
  callback: () => {
32
32
  const { selectedItems, clearSelection } = currentSelection.current;
33
+ const sequences = sequencesRef.current;
34
+ const propStatuses = propStatusesRef.current;
33
35
  if (selectedItems.length === 0) {
34
36
  return;
35
37
  }
@@ -37,8 +39,8 @@ const TimelineDeleteKeybindings = () => {
37
39
  selections: selectedItems,
38
40
  sequences,
39
41
  overrideIdsToNodePaths: overrideIdToNodePathMappings,
40
- codeValues,
41
- setCodeValues,
42
+ propStatuses,
43
+ setPropStatuses,
42
44
  clientId,
43
45
  });
44
46
  if (resetPromise !== null) {
@@ -49,7 +51,7 @@ const TimelineDeleteKeybindings = () => {
49
51
  selections: selectedItems,
50
52
  sequences,
51
53
  overrideIdsToNodePaths: overrideIdToNodePathMappings,
52
- setCodeValues,
54
+ setPropStatuses,
53
55
  clientId,
54
56
  confirm,
55
57
  });
@@ -97,14 +99,14 @@ const TimelineDeleteKeybindings = () => {
97
99
  };
98
100
  }, [
99
101
  canSelect,
100
- codeValues,
101
102
  confirm,
102
103
  currentSelection,
103
104
  keybindings,
104
105
  overrideIdToNodePathMappings,
106
+ propStatusesRef,
105
107
  previewServerState,
106
- sequences,
107
- setCodeValues,
108
+ sequencesRef,
109
+ setPropStatuses,
108
110
  ]);
109
111
  return null;
110
112
  };
@@ -68,15 +68,15 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
68
68
  var _b;
69
69
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
70
70
  const previewConnected = previewServerState.type === 'connected';
71
- const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
72
- const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
71
+ const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
72
+ const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
73
73
  const selection = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
74
74
  const [dropIndicator, setDropIndicator] = (0, react_1.useState)(null);
75
- const effectStatus = (0, react_1.useMemo)(() => remotion_1.Internals.getEffectCodeValuesCtx({
76
- codeValues,
75
+ const effectStatus = (0, react_1.useMemo)(() => remotion_1.Internals.getEffectPropStatusesCtx({
76
+ propStatuses,
77
77
  nodePath,
78
78
  effectIndex,
79
- }), [codeValues, nodePath, effectIndex]);
79
+ }), [propStatuses, nodePath, effectIndex]);
80
80
  const disabledStatus = effectStatus.type === 'can-update-effect'
81
81
  ? ((_b = (_a = effectStatus.props) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : null)
82
82
  : null;
@@ -186,7 +186,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
186
186
  value: newValue,
187
187
  defaultValue,
188
188
  schema: effectSchema,
189
- setCodeValues,
189
+ setPropStatuses,
190
190
  clientId: previewServerState.clientId,
191
191
  });
192
192
  }, [
@@ -195,7 +195,7 @@ const TimelineEffectItem = ({ label, nodePathInfo, effectIndex, effectSchema, do
195
195
  effectSchema,
196
196
  nodePath,
197
197
  previewServerState,
198
- setCodeValues,
198
+ setPropStatuses,
199
199
  validatedLocation.source,
200
200
  ]);
201
201
  const isExpanded = getIsExpanded(nodePathInfo);
@@ -43,15 +43,15 @@ const isResettableStatus = ({ status, defaultValue, }) => {
43
43
  const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) => {
44
44
  var _a;
45
45
  var _b;
46
- const { setEffectDragOverrides, clearEffectDragOverrides, setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
46
+ const { setEffectDragOverrides, clearEffectDragOverrides, setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
47
47
  const { getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
48
- const { codeValues: visualModeCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
48
+ const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
49
49
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
50
50
  const clientId = previewServerState.type === 'connected'
51
51
  ? previewServerState.clientId
52
52
  : null;
53
- const effectStatus = remotion_1.Internals.getEffectCodeValuesCtx({
54
- codeValues: visualModeCodeValues,
53
+ const effectStatus = remotion_1.Internals.getEffectPropStatusesCtx({
54
+ propStatuses: visualModePropStatuses,
55
55
  nodePath,
56
56
  effectIndex: field.effectIndex,
57
57
  });
@@ -110,8 +110,8 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
110
110
  }
111
111
  return (0, save_prop_queue_1.enqueueSavePropChange)({
112
112
  nodePath,
113
- setCodeValues,
114
- applyOptimistic: (prev) => (0, studio_shared_1.optimisticUpdateForEffectCodeValues)({
113
+ setPropStatuses,
114
+ applyOptimistic: (prev) => (0, studio_shared_1.optimisticUpdateForEffectPropStatuses)({
115
115
  previous: prev,
116
116
  effectIndex: field.effectIndex,
117
117
  fieldKey: field.key,
@@ -139,7 +139,7 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
139
139
  field.key,
140
140
  nodePath,
141
141
  propStatus,
142
- setCodeValues,
142
+ setPropStatuses,
143
143
  validatedLocation,
144
144
  ]);
145
145
  const onSaveKeyframed = (0, react_1.useCallback)((value, sourceFrame) => {
@@ -157,7 +157,7 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
157
157
  sourceFrame,
158
158
  value,
159
159
  schema: field.effectSchema,
160
- setCodeValues,
160
+ setPropStatuses,
161
161
  clientId,
162
162
  });
163
163
  }, [
@@ -166,7 +166,7 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
166
166
  field.effectSchema,
167
167
  field.key,
168
168
  nodePath,
169
- setCodeValues,
169
+ setPropStatuses,
170
170
  validatedLocation,
171
171
  ]);
172
172
  if (field.fieldSchema.type === 'scale') {
@@ -203,7 +203,7 @@ const Value = ({ field, nodePath, validatedLocation, keyframeDisplayOffset }) =>
203
203
  return jsx_runtime_1.jsx(TimelineSchemaField_1.UnsupportedStatus, { label: (0, get_timeline_keyframes_1.getComputedStatusLabel)(propStatus) });
204
204
  }
205
205
  const effectiveValue = remotion_1.Internals.getEffectiveVisualModeValue({
206
- codeValue: propStatus,
206
+ propStatus,
207
207
  dragOverrideValue,
208
208
  defaultValue: field.fieldSchema.default,
209
209
  frame: jsxFrame,
@@ -216,8 +216,8 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
216
216
  var _b, _c;
217
217
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
218
218
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
219
- const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
220
- const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
219
+ const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
220
+ const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
221
221
  const { getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
222
222
  const selection = (0, TimelineSelection_1.useTimelineRowSelection)(nodePathInfo);
223
223
  const style = (0, react_1.useMemo)(() => {
@@ -226,11 +226,11 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
226
226
  height: field.rowHeight,
227
227
  };
228
228
  }, [field.rowHeight]);
229
- const effectStatus = (0, react_1.useMemo)(() => remotion_1.Internals.getEffectCodeValuesCtx({
230
- codeValues,
229
+ const effectStatus = (0, react_1.useMemo)(() => remotion_1.Internals.getEffectPropStatusesCtx({
230
+ propStatuses,
231
231
  nodePath,
232
232
  effectIndex: field.effectIndex,
233
- }), [codeValues, nodePath, field.effectIndex]);
233
+ }), [propStatuses, nodePath, field.effectIndex]);
234
234
  const propStatus = effectStatus.type === 'can-update-effect'
235
235
  ? ((_b = (_a = effectStatus.props) === null || _a === void 0 ? void 0 : _a[field.key]) !== null && _b !== void 0 ? _b : null)
236
236
  : null;
@@ -278,7 +278,7 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
278
278
  value: field.fieldSchema.default,
279
279
  defaultValue,
280
280
  schema: field.effectSchema,
281
- setCodeValues,
281
+ setPropStatuses,
282
282
  clientId: previewServerState.clientId,
283
283
  });
284
284
  }, [
@@ -290,7 +290,7 @@ const TimelineEffectPropItem = ({ field, validatedLocation, rowDepth, nodePath,
290
290
  field.key,
291
291
  nodePath,
292
292
  previewServerState,
293
- setCodeValues,
293
+ setPropStatuses,
294
294
  validatedLocation.source,
295
295
  ]);
296
296
  const onOpenKeyframeSettings = (0, react_1.useCallback)(() => {
@@ -37,7 +37,9 @@ exports.TimelineExpandedKeyframeRow = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const timeline_layout_1 = require("../../helpers/timeline-layout");
40
+ const get_timeline_easing_segments_1 = require("./get-timeline-easing-segments");
40
41
  const TimelineKeyframeDiamond_1 = require("./TimelineKeyframeDiamond");
42
+ const TimelineKeyframeEasingLine_1 = require("./TimelineKeyframeEasingLine");
41
43
  const TimelineSelection_1 = require("./TimelineSelection");
42
44
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
43
45
  const row = {
@@ -49,7 +51,10 @@ const rowSeparator = {
49
51
  const TimelineExpandedKeyframeRowUnmemoized = ({ height, keyframes, nodePathInfo, showSeparator }) => {
50
52
  const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
51
53
  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)))] })
54
+ const easingSegments = TimelineSelection_1.ENABLE_OUTLINES
55
+ ? (0, get_timeline_easing_segments_1.getTimelineEasingSegments)(keyframes)
56
+ : [];
57
+ 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, easingSegments.map((segment) => (jsx_runtime_1.jsx(TimelineKeyframeEasingLine_1.TimelineKeyframeEasingLine, { fromFrame: segment.fromFrame, toFrame: segment.toFrame, rowHeight: height, nodePathInfo: nodePathInfo, segmentIndex: segment.segmentIndex }, `${segment.segmentIndex}-${segment.fromFrame}-${segment.toFrame}`))), keyframes.map((keyframe) => (jsx_runtime_1.jsx(TimelineKeyframeDiamond_1.TimelineKeyframeDiamond, { frame: keyframe.frame, rowHeight: height, nodePathInfo: nodePathInfo }, keyframe.frame)))] })
53
58
  ] }));
54
59
  };
55
60
  exports.TimelineExpandedKeyframeRow = react_1.default.memo(TimelineExpandedKeyframeRowUnmemoized);
@@ -56,28 +56,28 @@ const separator = {
56
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
- const { codeValues: visualModeCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
59
+ const { propStatuses: visualModePropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
60
60
  const { getDragOverrides, getEffectDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
61
61
  const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({
62
62
  sequence,
63
63
  nodePathInfo,
64
64
  getDragOverrides,
65
65
  getEffectDragOverrides,
66
- codeValues: visualModeCodeValues,
66
+ propStatuses: visualModePropStatuses,
67
67
  }), [
68
68
  sequence,
69
69
  nodePathInfo,
70
70
  getDragOverrides,
71
71
  getEffectDragOverrides,
72
- visualModeCodeValues,
72
+ visualModePropStatuses,
73
73
  ]);
74
74
  const flat = (0, react_1.useMemo)(() => (0, timeline_layout_1.flattenVisibleTreeNodes)({ nodes: tree, getIsExpanded }), [tree, getIsExpanded]);
75
75
  const expandedHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getExpandedTrackHeight)({
76
76
  sequence,
77
77
  nodePathInfo,
78
78
  getIsExpanded,
79
- codeValues: visualModeCodeValues,
80
- }), [sequence, nodePathInfo, getIsExpanded, visualModeCodeValues]);
79
+ propStatuses: visualModePropStatuses,
80
+ }), [sequence, nodePathInfo, getIsExpanded, visualModePropStatuses]);
81
81
  const style = (0, react_1.useMemo)(() => {
82
82
  return {
83
83
  ...expandedSectionBase,
@@ -47,7 +47,7 @@ const svgStyle = { display: 'block' };
47
47
  const getCurrentKeyframeValue = ({ propStatus, jsxFrame, defaultValue, dragOverrideValue, }) => {
48
48
  if (isKeyframedStatus(propStatus)) {
49
49
  return remotion_1.Internals.getEffectiveVisualModeValue({
50
- codeValue: propStatus,
50
+ propStatus,
51
51
  dragOverrideValue,
52
52
  frame: jsxFrame,
53
53
  defaultValue,
@@ -56,7 +56,7 @@ const getCurrentKeyframeValue = ({ propStatus, jsxFrame, defaultValue, dragOverr
56
56
  }
57
57
  if (propStatus.status === 'static') {
58
58
  return remotion_1.Internals.getEffectiveVisualModeValue({
59
- codeValue: propStatus,
59
+ propStatus,
60
60
  dragOverrideValue,
61
61
  frame: jsxFrame,
62
62
  defaultValue,
@@ -82,7 +82,7 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
82
82
  const videoConfig = (0, remotion_1.useVideoConfig)();
83
83
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
84
84
  const setFrame = remotion_1.Internals.useTimelineSetFrame();
85
- const { setCodeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
85
+ const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
86
86
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
87
87
  const clientId = previewServerState.type === 'connected'
88
88
  ? previewServerState.clientId
@@ -142,7 +142,7 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
142
142
  fieldKey,
143
143
  sourceFrame: jsxFrame,
144
144
  schema,
145
- setCodeValues,
145
+ setPropStatuses,
146
146
  clientId,
147
147
  });
148
148
  return;
@@ -154,7 +154,7 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
154
154
  fieldKey,
155
155
  sourceFrame: jsxFrame,
156
156
  schema,
157
- setCodeValues,
157
+ setPropStatuses,
158
158
  clientId,
159
159
  });
160
160
  return;
@@ -171,7 +171,7 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
171
171
  sourceFrame: jsxFrame,
172
172
  value,
173
173
  schema,
174
- setCodeValues,
174
+ setPropStatuses,
175
175
  clientId,
176
176
  });
177
177
  return;
@@ -184,7 +184,7 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
184
184
  sourceFrame: jsxFrame,
185
185
  value,
186
186
  schema,
187
- setCodeValues,
187
+ setPropStatuses,
188
188
  clientId,
189
189
  });
190
190
  }, [
@@ -199,7 +199,7 @@ const TimelineKeyframeControls = ({ fieldKey, propStatus, nodePath, fileName, ke
199
199
  nodePath,
200
200
  propStatus,
201
201
  schema,
202
- setCodeValues,
202
+ setPropStatuses,
203
203
  ]);
204
204
  const previousDisabled = previousDisplayFrame === null;
205
205
  const nextDisabled = nextDisplayFrame === null;
@@ -69,7 +69,6 @@ const TimelineKeyframeDiamondUnmemoized = ({ frame, rowHeight, nodePathInfo }) =
69
69
  }
70
70
  return {
71
71
  ...diamondBase,
72
- cursor: 'pointer',
73
72
  left: (0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(frame, videoConfig.durationInFrames, timelineWidth) - timeline_layout_1.TIMELINE_PADDING,
74
73
  pointerEvents: 'auto',
75
74
  top: rowHeight / 2,
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
3
+ export declare const TimelineKeyframeEasingLine: React.NamedExoticComponent<{
4
+ readonly fromFrame: number;
5
+ readonly toFrame: number;
6
+ readonly rowHeight: number;
7
+ readonly nodePathInfo: SequenceNodePathInfo;
8
+ readonly segmentIndex: number;
9
+ }>;
@@ -0,0 +1,120 @@
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.TimelineKeyframeEasingLine = void 0;
37
+ 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 TimelineSelection_1 = require("./TimelineSelection");
44
+ const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
45
+ const hitTargetHeight = 12;
46
+ const lineHeight = 2;
47
+ const easingLineButton = {
48
+ background: 'none',
49
+ border: 'none',
50
+ height: hitTargetHeight,
51
+ padding: 0,
52
+ position: 'absolute',
53
+ transform: 'translateY(-50%)',
54
+ };
55
+ const easingLine = {
56
+ backgroundColor: colors_1.LINE_COLOR,
57
+ borderRadius: lineHeight / 2,
58
+ height: lineHeight,
59
+ left: 0,
60
+ position: 'absolute',
61
+ right: 0,
62
+ top: '50%',
63
+ transform: 'translateY(-50%)',
64
+ };
65
+ const TimelineKeyframeEasingLineUnmemoized = ({ fromFrame, toFrame, rowHeight, nodePathInfo, segmentIndex }) => {
66
+ const videoConfig = (0, remotion_1.useVideoConfig)();
67
+ const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
68
+ const { selected, onSelect, selectable } = (0, TimelineSelection_1.useTimelineEasingSelection)({
69
+ nodePathInfo,
70
+ fromFrame,
71
+ toFrame,
72
+ segmentIndex,
73
+ });
74
+ const style = (0, react_1.useMemo)(() => {
75
+ if (timelineWidth === null) {
76
+ return null;
77
+ }
78
+ const fromLeft = (0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(fromFrame, videoConfig.durationInFrames, timelineWidth) - timeline_layout_1.TIMELINE_PADDING;
79
+ const toLeft = (0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(toFrame, videoConfig.durationInFrames, timelineWidth) - timeline_layout_1.TIMELINE_PADDING;
80
+ const left = Math.min(fromLeft, toLeft);
81
+ const width = Math.abs(toLeft - fromLeft);
82
+ if (width === 0) {
83
+ return null;
84
+ }
85
+ return {
86
+ ...easingLineButton,
87
+ left,
88
+ pointerEvents: selectable ? 'auto' : 'none',
89
+ top: rowHeight / 2,
90
+ width,
91
+ };
92
+ }, [
93
+ fromFrame,
94
+ rowHeight,
95
+ selectable,
96
+ timelineWidth,
97
+ toFrame,
98
+ videoConfig.durationInFrames,
99
+ ]);
100
+ const lineStyle = (0, react_1.useMemo)(() => ({
101
+ ...easingLine,
102
+ outline: selected ? `1px solid ${colors_1.BLUE}` : undefined,
103
+ }), [selected]);
104
+ const onPointerDown = (0, react_1.useCallback)((event) => {
105
+ if (!selectable || event.button !== 0) {
106
+ return;
107
+ }
108
+ event.preventDefault();
109
+ event.stopPropagation();
110
+ onSelect({
111
+ shiftKey: event.shiftKey,
112
+ toggleKey: event.metaKey || event.ctrlKey,
113
+ });
114
+ }, [onSelect, selectable]);
115
+ if (style === null) {
116
+ return null;
117
+ }
118
+ return (jsx_runtime_1.jsx("button", { type: "button", style: style, title: `Easing from frame ${fromFrame} to ${toFrame}`, "aria-label": `Select easing from frame ${fromFrame} to ${toFrame}`, onPointerDown: selectable ? onPointerDown : undefined, children: jsx_runtime_1.jsx("div", { style: lineStyle }) }));
119
+ };
120
+ exports.TimelineKeyframeEasingLine = react_1.default.memo(TimelineKeyframeEasingLineUnmemoized);
@@ -27,7 +27,7 @@ const TimelineKeyframedValue = ({ field, propStatus, keyframeDisplayOffset, drag
27
27
  }), [computedValue]);
28
28
  const effectiveValue = (0, react_1.useMemo)(() => {
29
29
  return remotion_1.Internals.getEffectiveVisualModeValue({
30
- codeValue: fakeStatus,
30
+ propStatus: fakeStatus,
31
31
  dragOverrideValue,
32
32
  frame: jsxFrame,
33
33
  defaultValue: field.fieldSchema.default,
@@ -6,7 +6,7 @@ const react_1 = require("react");
6
6
  const InputDragger_1 = require("../NewComposition/InputDragger");
7
7
  const timeline_field_utils_1 = require("./timeline-field-utils");
8
8
  const TimelineNumberField = ({ field, effectiveValue, onSave, onDragValueChange, onDragEnd, propStatus, }) => {
9
- var _a, _b, _c;
9
+ var _a, _b;
10
10
  const [dragValue, setDragValue] = (0, react_1.useState)(null);
11
11
  const onValueChange = (0, react_1.useCallback)((newVal) => {
12
12
  setDragValue(newVal);
@@ -33,17 +33,25 @@ const TimelineNumberField = ({ field, effectiveValue, onSave, onDragValueChange,
33
33
  });
34
34
  }
35
35
  }, [onSave, propStatus]);
36
- const step = field.fieldSchema.type === 'number' ? ((_a = field.fieldSchema.step) !== null && _a !== void 0 ? _a : 1) : 1;
37
- const stepDecimals = (0, react_1.useMemo)(() => (0, timeline_field_utils_1.getDecimalPlaces)(step), [step]);
36
+ const configuredStep = field.fieldSchema.type === 'number' ? field.fieldSchema.step : undefined;
37
+ const step = configuredStep !== null && configuredStep !== void 0 ? configuredStep : 1;
38
+ const stepDecimals = (0, react_1.useMemo)(() => configuredStep === undefined ? null : (0, timeline_field_utils_1.getDecimalPlaces)(configuredStep), [configuredStep]);
38
39
  const formatter = (0, react_1.useCallback)((v) => {
39
40
  const num = Number(v);
40
- const digits = Math.max(stepDecimals, (0, timeline_field_utils_1.getDecimalPlaces)(num));
41
- return digits === 0 ? String(num) : num.toFixed(digits);
41
+ if (stepDecimals === null) {
42
+ const digits = (0, timeline_field_utils_1.getDecimalPlaces)(num);
43
+ return digits === 0 ? String(num) : num.toFixed(digits);
44
+ }
45
+ return (0, timeline_field_utils_1.formatTimelineNumber)({
46
+ decimalPlaces: stepDecimals,
47
+ fixed: true,
48
+ value: num,
49
+ });
42
50
  }, [stepDecimals]);
43
51
  return (jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: dragValue !== null && dragValue !== void 0 ? dragValue : effectiveValue, style: timeline_field_utils_1.draggerStyle, status: "ok", small: true, onValueChange: onValueChange, onValueChangeEnd: onValueChangeEnd, onTextChange: onTextChange, min: field.fieldSchema.type === 'number'
44
- ? ((_b = field.fieldSchema.min) !== null && _b !== void 0 ? _b : -Infinity)
52
+ ? ((_a = field.fieldSchema.min) !== null && _a !== void 0 ? _a : -Infinity)
45
53
  : -Infinity, max: field.fieldSchema.type === 'number'
46
- ? ((_c = field.fieldSchema.max) !== null && _c !== void 0 ? _c : Infinity)
54
+ ? ((_b = field.fieldSchema.max) !== null && _b !== void 0 ? _b : Infinity)
47
55
  : Infinity, step: step, formatter: formatter, rightAlign: false }));
48
56
  };
49
57
  exports.TimelineNumberField = TimelineNumberField;
@@ -26,7 +26,7 @@ const parseCssRotationToDegrees = (value) => {
26
26
  }
27
27
  };
28
28
  const TimelineRotationField = ({ field, effectiveValue, propStatus, onSave, onDragValueChange, onDragEnd, }) => {
29
- var _a, _b, _c;
29
+ var _a, _b;
30
30
  const [dragValue, setDragValue] = (0, react_1.useState)(null);
31
31
  const isCssRotation = field.fieldSchema.type === 'rotation-css';
32
32
  const degrees = (0, react_1.useMemo)(() => {
@@ -68,23 +68,29 @@ const TimelineRotationField = ({ field, effectiveValue, propStatus, onSave, onDr
68
68
  }
69
69
  }
70
70
  }, [propStatus, onSave, serializeValue]);
71
- const step = field.fieldSchema.type === 'rotation-css' ||
71
+ const configuredStep = field.fieldSchema.type === 'rotation-css' ||
72
72
  field.fieldSchema.type === 'rotation-degrees'
73
- ? ((_a = field.fieldSchema.step) !== null && _a !== void 0 ? _a : 1)
74
- : 1;
73
+ ? field.fieldSchema.step
74
+ : undefined;
75
+ const step = configuredStep !== null && configuredStep !== void 0 ? configuredStep : 1;
75
76
  const min = field.fieldSchema.type === 'rotation-degrees'
76
- ? ((_b = field.fieldSchema.min) !== null && _b !== void 0 ? _b : -Infinity)
77
+ ? ((_a = field.fieldSchema.min) !== null && _a !== void 0 ? _a : -Infinity)
77
78
  : -Infinity;
78
79
  const max = field.fieldSchema.type === 'rotation-degrees'
79
- ? ((_c = field.fieldSchema.max) !== null && _c !== void 0 ? _c : Infinity)
80
+ ? ((_b = field.fieldSchema.max) !== null && _b !== void 0 ? _b : Infinity)
80
81
  : Infinity;
81
- const stepDecimals = (0, react_1.useMemo)(() => (0, timeline_field_utils_1.getDecimalPlaces)(step), [step]);
82
+ const decimalPlaces = (0, react_1.useMemo)(() => (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
83
+ defaultDecimalPlaces: 1,
84
+ step: configuredStep,
85
+ }), [configuredStep]);
82
86
  const formatter = (0, react_1.useCallback)((v) => {
83
- const num = (0, timeline_field_utils_1.normalizeTimelineNumber)(Number(v));
84
- const digits = Math.max(stepDecimals, (0, timeline_field_utils_1.getDecimalPlaces)(num));
85
- const formatted = digits === 0 ? String(num) : num.toFixed(digits);
87
+ const formatted = (0, timeline_field_utils_1.formatTimelineNumber)({
88
+ decimalPlaces,
89
+ fixed: false,
90
+ value: (0, timeline_field_utils_1.normalizeTimelineNumber)(Number(v)),
91
+ });
86
92
  return `${formatted}\u00B0`;
87
- }, [stepDecimals]);
93
+ }, [decimalPlaces]);
88
94
  return (jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: dragValue !== null && dragValue !== void 0 ? dragValue : degrees, style: timeline_field_utils_1.draggerStyle, status: "ok", small: true, onValueChange: onValueChange, onValueChangeEnd: onValueChangeEnd, onTextChange: onTextChange, min: min, max: max, step: step, formatter: formatter, rightAlign: false }));
89
95
  };
90
96
  exports.TimelineRotationField = TimelineRotationField;
@@ -24,7 +24,7 @@ const toggleStyle = {
24
24
  ...TimelineLayerEye_1.timelineLayerIconContainer,
25
25
  border: 'none',
26
26
  color: colors_1.LIGHT_COLOR,
27
- cursor: 'pointer',
27
+ cursor: 'default',
28
28
  marginRight: 0,
29
29
  padding: 0,
30
30
  };
@@ -78,7 +78,7 @@ const LinkToggle = ({ linked, onToggle }) => {
78
78
  return (jsx_runtime_1.jsx("button", { type: "button", style: toggleStyle, onPointerDown: onPointerDown, title: linked ? 'Unlink scale axes' : 'Link scale axes', "aria-label": linked ? 'Unlink scale axes' : 'Link scale axes', children: linked ? (jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 640 640", style: linkIconStyle, children: jsx_runtime_1.jsx("path", { fill: "currentcolor", d: "M32 320C32 214 118 128 224 128L288 128L288 192L224 192C153.3 192 96 249.3 96 320C96 390.7 153.3 448 224 448L288 448L288 512L224 512C118 512 32 426 32 320zM608 320C608 426 522 512 416 512L352 512L352 448L416 448C486.7 448 544 390.7 544 320C544 249.3 486.7 192 416 192L352 192L352 128L416 128C522 128 608 214 608 320zM224 288L448 288L448 352L192 352L192 288L224 288z" }) })) : null }));
79
79
  };
80
80
  const TimelineScaleField = ({ field, propStatus, effectiveValue, onSave, onDragValueChange, onDragEnd, scaleLockNodePath, }) => {
81
- var _a, _b, _c;
81
+ var _a, _b;
82
82
  const [dragX, setDragX] = (0, react_1.useState)(null);
83
83
  const [dragY, setDragY] = (0, react_1.useState)(null);
84
84
  const dragStartRef = (0, react_1.useRef)(null);
@@ -90,21 +90,25 @@ const TimelineScaleField = ({ field, propStatus, effectiveValue, onSave, onDragV
90
90
  fieldKey: field.key,
91
91
  defaultValue: defaultLinked,
92
92
  });
93
- const step = field.fieldSchema.type === 'scale'
94
- ? ((_a = field.fieldSchema.step) !== null && _a !== void 0 ? _a : 0.01)
95
- : 0.01;
93
+ const configuredStep = field.fieldSchema.type === 'scale' ? field.fieldSchema.step : undefined;
94
+ const step = configuredStep !== null && configuredStep !== void 0 ? configuredStep : 0.01;
96
95
  const min = field.fieldSchema.type === 'scale'
97
- ? ((_b = field.fieldSchema.min) !== null && _b !== void 0 ? _b : -Infinity)
96
+ ? ((_a = field.fieldSchema.min) !== null && _a !== void 0 ? _a : -Infinity)
98
97
  : -Infinity;
99
98
  const max = field.fieldSchema.type === 'scale'
100
- ? ((_c = field.fieldSchema.max) !== null && _c !== void 0 ? _c : Infinity)
99
+ ? ((_b = field.fieldSchema.max) !== null && _b !== void 0 ? _b : Infinity)
101
100
  : Infinity;
102
- const stepDecimals = (0, react_1.useMemo)(() => (0, timeline_field_utils_1.getDecimalPlaces)(step), [step]);
101
+ const decimalPlaces = (0, react_1.useMemo)(() => (0, timeline_field_utils_1.getTimelineDisplayDecimalPlaces)({
102
+ defaultDecimalPlaces: 2,
103
+ step: configuredStep,
104
+ }), [configuredStep]);
103
105
  const formatter = (0, react_1.useCallback)((v) => {
104
- const num = Number(v);
105
- const digits = Math.max(stepDecimals, (0, timeline_field_utils_1.getDecimalPlaces)(num));
106
- return digits === 0 ? String(num) : num.toFixed(digits);
107
- }, [stepDecimals]);
106
+ return (0, timeline_field_utils_1.formatTimelineNumber)({
107
+ decimalPlaces,
108
+ fixed: true,
109
+ value: v,
110
+ });
111
+ }, [decimalPlaces]);
108
112
  const getDragStart = (0, react_1.useCallback)(() => {
109
113
  if (dragStartRef.current === null) {
110
114
  dragStartRef.current = [dragX !== null && dragX !== void 0 ? dragX : codeX, dragY !== null && dragY !== void 0 ? dragY : codeY];