@remotion/studio 4.0.500 → 4.0.502

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 (156) hide show
  1. package/dist/Studio.js +1 -1
  2. package/dist/api/delete-static-file.js +8 -3
  3. package/dist/api/rename-static-file.js +8 -0
  4. package/dist/api/watch-public-folder.js +2 -1
  5. package/dist/api/watch-static-file.js +2 -1
  6. package/dist/api/write-static-file.js +8 -3
  7. package/dist/components/AssetSelector.js +3 -1
  8. package/dist/components/AssetSelectorItem.d.ts +2 -1
  9. package/dist/components/AssetSelectorItem.js +7 -4
  10. package/dist/components/Canvas.js +9 -4
  11. package/dist/components/CaptionInspector.d.ts +10 -0
  12. package/dist/components/CaptionInspector.js +24 -0
  13. package/dist/components/CaptionTextEditor.d.ts +9 -0
  14. package/dist/components/CaptionTextEditor.js +132 -0
  15. package/dist/components/CompositionSelector.js +4 -4
  16. package/dist/components/CompositionSelectorItem.js +5 -5
  17. package/dist/components/CurrentAsset.js +3 -2
  18. package/dist/components/EditorContent.js +1 -1
  19. package/dist/components/EditorContexts.d.ts +0 -1
  20. package/dist/components/EditorContexts.js +2 -2
  21. package/dist/components/FpsCounter.js +3 -3
  22. package/dist/components/FullscreenToggle.d.ts +3 -1
  23. package/dist/components/FullscreenToggle.js +3 -2
  24. package/dist/components/GlobalKeybindings.js +2 -0
  25. package/dist/components/InitialCompositionLoader.d.ts +1 -1
  26. package/dist/components/InlineAction.js +2 -1
  27. package/dist/components/InlineCaptionInspector.d.ts +11 -0
  28. package/dist/components/InlineCaptionInspector.js +108 -0
  29. package/dist/components/InspectorPanel/CompositionInspector.js +5 -3
  30. package/dist/components/InspectorPanel/SelectedInspector.d.ts +1 -0
  31. package/dist/components/InspectorPanel/SelectedInspector.js +2 -2
  32. package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +1 -0
  33. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -4
  34. package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +22 -0
  35. package/dist/components/InspectorPanel/inspector-section-collapse.js +165 -0
  36. package/dist/components/InspectorPanel/styles.js +7 -1
  37. package/dist/components/InspectorPanel/use-composition-actions.d.ts +4 -1
  38. package/dist/components/InspectorPanel/use-composition-actions.js +135 -7
  39. package/dist/components/InspectorPanel.js +2 -2
  40. package/dist/components/InspectorSequenceSection.d.ts +2 -1
  41. package/dist/components/InspectorSequenceSection.js +238 -8
  42. package/dist/components/LoopToggle.d.ts +1 -0
  43. package/dist/components/LoopToggle.js +9 -5
  44. package/dist/components/Menu/MenuSubItem.js +9 -1
  45. package/dist/components/MenuToolbar.js +8 -1
  46. package/dist/components/Modals.js +1 -1
  47. package/dist/components/ObserveDefaultPropsContext.js +7 -4
  48. package/dist/components/PlayPause.d.ts +1 -0
  49. package/dist/components/PlayPause.js +2 -4
  50. package/dist/components/PlaybackRateSelector.d.ts +9 -2
  51. package/dist/components/PlaybackRateSelector.js +21 -10
  52. package/dist/components/PreviewToolbar.js +19 -109
  53. package/dist/components/PreviewToolbarOverflowButton.d.ts +12 -0
  54. package/dist/components/PreviewToolbarOverflowButton.js +217 -0
  55. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
  56. package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +6 -0
  57. package/dist/components/QuickSwitcher/QuickSwitcher.js +2 -2
  58. package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +6 -0
  59. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +42 -9
  60. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +2 -0
  61. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +7 -1
  62. package/dist/components/RenderButton.d.ts +1 -0
  63. package/dist/components/RenderButton.js +6 -4
  64. package/dist/components/RenderQueue/ClientRenderQueueProcessor.d.ts +0 -1
  65. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +3 -14
  66. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
  67. package/dist/components/SelectedOutlineElement.js +1 -4
  68. package/dist/components/SelectedOutlineOverlay.js +17 -8
  69. package/dist/components/ShowOutlinesProvider.js +4 -1
  70. package/dist/components/SizeSelector.d.ts +6 -0
  71. package/dist/components/SizeSelector.js +17 -8
  72. package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
  73. package/dist/components/Splitter/SplitterContainer.js +23 -3
  74. package/dist/components/Splitter/SplitterContext.d.ts +14 -0
  75. package/dist/components/Splitter/SplitterContext.js +16 -1
  76. package/dist/components/Splitter/SplitterHandle.js +8 -6
  77. package/dist/components/Timeline/Timeline.js +21 -6
  78. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  79. package/dist/components/Timeline/TimelineAssetField.js +37 -1
  80. package/dist/components/Timeline/TimelineDragHandler.js +1 -1
  81. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +8 -2
  82. package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +7 -2
  83. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +3 -1
  84. package/dist/components/Timeline/TimelineRowChrome.d.ts +3 -0
  85. package/dist/components/Timeline/TimelineRowChrome.js +4 -3
  86. package/dist/components/Timeline/TimelineSelection.d.ts +4 -2
  87. package/dist/components/Timeline/TimelineSelection.js +9 -6
  88. package/dist/components/Timeline/TimelineSequence.js +1 -4
  89. package/dist/components/Timeline/TimelineSequenceItem.js +4 -5
  90. package/dist/components/Timeline/TimelineSequencePropItem.js +9 -10
  91. package/dist/components/Timeline/TimelineStack/get-stack.js +8 -0
  92. package/dist/components/Timeline/TimelineTrack.js +4 -2
  93. package/dist/components/Timeline/border-radius-representation.d.ts +16 -0
  94. package/dist/components/Timeline/border-radius-representation.js +60 -0
  95. package/dist/components/Timeline/delete-selected-timeline-item.js +1 -6
  96. package/dist/components/Timeline/get-sequence-prop-reset-changes.d.ts +10 -0
  97. package/dist/components/Timeline/get-sequence-prop-reset-changes.js +33 -0
  98. package/dist/components/Timeline/reset-selected-timeline-props.js +2 -8
  99. package/dist/components/Timeline/save-sequence-prop.d.ts +12 -1
  100. package/dist/components/Timeline/save-sequence-prop.js +28 -4
  101. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -2
  102. package/dist/components/Timeline/sequence-props-subscription-store.js +3 -3
  103. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  104. package/dist/components/Timeline/use-timeline-asset-drop.js +4 -0
  105. package/dist/components/TopPanel.js +1 -1
  106. package/dist/components/UndoRedoButtons.js +15 -6
  107. package/dist/components/UpdateCheck.js +11 -4
  108. package/dist/components/default-props-api.d.ts +3 -0
  109. package/dist/components/default-props-api.js +19 -0
  110. package/dist/components/drop-handler-data.d.ts +1 -1
  111. package/dist/components/drop-handler-data.js +6 -6
  112. package/dist/components/effect-drag-and-drop.d.ts +1 -1
  113. package/dist/components/effect-drag-and-drop.js +3 -3
  114. package/dist/components/element-drag-and-drop.d.ts +1 -1
  115. package/dist/components/element-drag-and-drop.js +3 -3
  116. package/dist/components/handle-drop.d.ts +3 -2
  117. package/dist/components/handle-drop.js +2 -1
  118. package/dist/components/import-assets.d.ts +8 -6
  119. package/dist/components/import-assets.js +20 -7
  120. package/dist/components/sequence-props-api.d.ts +4 -0
  121. package/dist/components/sequence-props-api.js +26 -0
  122. package/dist/components/use-element-overwrite-confirmation.d.ts +2 -0
  123. package/dist/components/use-element-overwrite-confirmation.js +73 -0
  124. package/dist/components/use-static-files.js +7 -2
  125. package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +13 -2
  126. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -0
  127. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +29 -5
  128. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +4 -20
  129. package/dist/esm/{chunk-dr1y1vm3.js → chunk-fjv75ty4.js} +8478 -6609
  130. package/dist/esm/index.mjs +24 -8
  131. package/dist/esm/internals.mjs +8478 -6609
  132. package/dist/esm/previewEntry.mjs +8535 -6666
  133. package/dist/esm/renderEntry.mjs +1 -1
  134. package/dist/helpers/browser-studio-operations.d.ts +3 -0
  135. package/dist/helpers/browser-studio-operations.js +14 -0
  136. package/dist/helpers/client-id.d.ts +0 -1
  137. package/dist/helpers/client-id.js +15 -10
  138. package/dist/helpers/download-blob.d.ts +1 -0
  139. package/dist/helpers/download-blob.js +15 -0
  140. package/dist/helpers/inject-css.js +5 -3
  141. package/dist/helpers/open-in-editor.js +26 -5
  142. package/dist/helpers/preview-server-events.js +46 -9
  143. package/dist/helpers/use-create-composition.js +8 -6
  144. package/dist/helpers/use-menu-structure.js +29 -0
  145. package/dist/hot-middleware-client/client.js +3 -3
  146. package/dist/icons/border-radius.d.ts +4 -0
  147. package/dist/icons/border-radius.js +8 -0
  148. package/dist/icons/fullscreen.d.ts +4 -0
  149. package/dist/icons/fullscreen.js +6 -0
  150. package/dist/icons/upload.d.ts +4 -0
  151. package/dist/icons/upload.js +8 -0
  152. package/dist/previewEntry.js +1 -1
  153. package/dist/state/modals.d.ts +5 -0
  154. package/dist/state/timeline-sequence-hover.d.ts +17 -0
  155. package/dist/state/timeline-sequence-hover.js +33 -0
  156. package/package.json +13 -12
@@ -37,6 +37,7 @@ exports.Timeline = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const remotion_1 = require("remotion");
40
+ const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
40
41
  const calculate_timeline_1 = require("../../helpers/calculate-timeline");
41
42
  const client_id_1 = require("../../helpers/client-id");
42
43
  const colors_1 = require("../../helpers/colors");
@@ -74,6 +75,7 @@ const TimelineTracks_1 = require("./TimelineTracks");
74
75
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
75
76
  const use_resolved_stack_1 = require("./use-resolved-stack");
76
77
  const use_timeline_asset_drop_1 = require("./use-timeline-asset-drop");
78
+ const MIN_TIMELINE_LABELS_WIDTH = 240;
77
79
  const container = {
78
80
  minHeight: '100%',
79
81
  flex: 1,
@@ -93,6 +95,8 @@ const TimelineContextMenuArea = ({ children }) => {
93
95
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
94
96
  const previewConnected = previewServerState.type === 'connected';
95
97
  const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
98
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
99
+ const browserStudioCanInsertSolid = browserStudioOperations !== null;
96
100
  const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
97
101
  const currentComposition = (0, react_1.useMemo)(() => {
98
102
  var _a;
@@ -102,12 +106,14 @@ const TimelineContextMenuArea = ({ children }) => {
102
106
  return ((_a = compositions.find((composition) => composition.id === currentCompositionId)) !== null && _a !== void 0 ? _a : null);
103
107
  }, [compositions, currentCompositionId]);
104
108
  const resolvedCompositionLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _a !== void 0 ? _a : null);
105
- const compositionFile = (_b = resolvedCompositionLocation === null || resolvedCompositionLocation === void 0 ? void 0 : resolvedCompositionLocation.source) !== null && _b !== void 0 ? _b : null;
109
+ const compositionFile = (_b = resolvedCompositionLocation === null || resolvedCompositionLocation === void 0 ? void 0 : resolvedCompositionLocation.source) !== null && _b !== void 0 ? _b : (currentCompositionId && browserStudioOperations
110
+ ? browserStudioOperations.getCompositionFile(currentCompositionId)
111
+ : null);
106
112
  const compositionComponentInfo = (0, open_in_editor_1.useCachedCompositionComponentInfo)({
107
113
  compositionFile,
108
114
  compositionId: currentCompositionId,
109
115
  });
110
- const canInsertSolid = previewInteractive &&
116
+ const canInsertSolid = (previewInteractive || browserStudioCanInsertSolid) &&
111
117
  (compositionComponentInfo === null || compositionComponentInfo === void 0 ? void 0 : compositionComponentInfo.canAddSequence) === true &&
112
118
  currentCompositionId !== null &&
113
119
  compositionFile !== null &&
@@ -128,7 +134,7 @@ const TimelineContextMenuArea = ({ children }) => {
128
134
  }
129
135
  setIsAddingSolid(true);
130
136
  try {
131
- const result = await (0, call_api_1.callApi)('/api/insert-jsx-element', {
137
+ const request = {
132
138
  compositionFile,
133
139
  compositionId: currentCompositionId,
134
140
  from: null,
@@ -138,7 +144,10 @@ const TimelineContextMenuArea = ({ children }) => {
138
144
  height: videoConfig.height,
139
145
  position: null,
140
146
  },
141
- });
147
+ };
148
+ const result = browserStudioOperations
149
+ ? await browserStudioOperations.insertSolid(request)
150
+ : await (0, call_api_1.callApi)('/api/insert-jsx-element', request);
142
151
  if (result.success) {
143
152
  (0, NotificationCenter_1.showNotification)('Added <Solid> to source file', 2000);
144
153
  return;
@@ -151,7 +160,13 @@ const TimelineContextMenuArea = ({ children }) => {
151
160
  finally {
152
161
  setIsAddingSolid(false);
153
162
  }
154
- }, [canInsertSolid, compositionFile, currentCompositionId, videoConfig]);
163
+ }, [
164
+ browserStudioOperations,
165
+ canInsertSolid,
166
+ compositionFile,
167
+ currentCompositionId,
168
+ videoConfig,
169
+ ]);
155
170
  const insertAsset = (0, react_1.useCallback)(async () => {
156
171
  if (!canInsertAsset ||
157
172
  currentCompositionId === null ||
@@ -253,7 +268,7 @@ const TimelineInner = () => {
253
268
  }
254
269
  return (jsx_runtime_1.jsx(SubscribeToNodePaths_1.SubscribeToNodePaths, { overrideId: sequence.controls.overrideId, componentIdentity: sequence.controls.componentIdentity, schema: sequence.controls.schema, getStack: sequence.getStack, effects: sequence.effects }, sequence.id));
255
270
  }), (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? jsx_runtime_1.jsx(SequencePropsObserver_1.SequencePropsObserver, {}) : null, jsx_runtime_1.jsx(TimelineKeyframeTracksContext_1.TimelineKeyframeTracksProvider, { tracks: filtered, children: jsx_runtime_1.jsxs(TimelineSelection_1.TimelineSelectableItemsProvider, { timeline: shown, children: [(0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectAllKeybindings, { timeline: shown })) : null, jsx_runtime_1.jsx(TimelineHeightContainer_1.TimelineHeightContainer, { shown: shown, hasBeenCut: hasBeenCut, children: isStill ? (jsx_runtime_1.jsx(TimelineList_1.TimelineList, { timeline: shown })) : (jsx_runtime_1.jsxs(TimelineWidthProvider_1.TimelineWidthProvider, { children: [
256
- jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, maxFlexerSize: null, maxAntiFlexerSize: null, children: [
271
+ jsx_runtime_1.jsx(TimelinePinchZoom_1.TimelinePinchZoom, {}), jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "vertical", defaultFlex: 0.2, id: "names-to-timeline", maxFlex: 0.5, minFlex: 0.15, maxFlexerSize: null, minFlexerSize: MIN_TIMELINE_LABELS_WIDTH, maxAntiFlexerSize: null, children: [
257
272
  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: [
258
273
  jsx_runtime_1.jsx(TimelineTracks_1.TimelineTracks, { timeline: shown, hasBeenCut: hasBeenCut }), jsx_runtime_1.jsx(TimelinePlayCursorSyncer_1.TimelinePlayCursorSyncer, {}), jsx_runtime_1.jsx(TimelineInOutPointer_1.TimelineInOutPointer, {}), jsx_runtime_1.jsx(TimelineTimeIndicators_1.TimelineTimeIndicators, {}), jsx_runtime_1.jsx(TimelineDragHandler_1.TimelineDragHandler, {}), (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineInOutDragHandler_1.TimelineInOutDragHandler, {})) : null, jsx_runtime_1.jsx(TimelineSlider_1.TimelineSlider, {})
259
274
  ] }) })
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { CanUpdateSequencePropStatusStatic } from 'remotion';
2
+ import { type CanUpdateSequencePropStatusStatic } from 'remotion';
3
3
  import type { SchemaFieldInfo, TimelineFieldOnDragValueChange, TimelineFieldOnSave } from '../../helpers/timeline-layout';
4
4
  import { type InspectorInlineActionProps } from '../InspectorPanel/common';
5
5
  export type InspectorSourceAction = Omit<InspectorInlineActionProps, 'variant'>;
@@ -3,11 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TimelineAssetField = exports.toFileToken = exports.AssetSelectionContext = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
6
7
  const no_react_1 = require("remotion/no-react");
8
+ const write_static_file_1 = require("../../api/write-static-file");
7
9
  const pen_1 = require("../../icons/pen");
8
10
  const modals_1 = require("../../state/modals");
11
+ const import_assets_1 = require("../import-assets");
9
12
  const InlineAction_1 = require("../InlineAction");
10
13
  const common_1 = require("../InspectorPanel/common");
14
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
15
+ const use_static_files_1 = require("../use-static-files");
11
16
  const penIcon = {
12
17
  display: 'block',
13
18
  height: 14,
@@ -30,6 +35,7 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
30
35
  throw new Error('TimelineAssetField rendered for non-asset field');
31
36
  }
32
37
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
38
+ const staticFiles = (0, use_static_files_1.useStaticFiles)();
33
39
  const { getSourceAction, initialQuery, sourceAction } = (0, react_1.useContext)(exports.AssetSelectionContext);
34
40
  const inlineSourceAction = (0, react_1.useMemo)(() => {
35
41
  if (field.key !== 'src') {
@@ -49,6 +55,32 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
49
55
  onDragEnd();
50
56
  });
51
57
  }, [propStatus.codeValue, onDragValueChange, onSave, onDragEnd]);
58
+ const selectFile = (0, react_1.useCallback)(async () => {
59
+ const [file] = await (0, import_assets_1.pickFilesToImport)({ multiple: false });
60
+ if (!file) {
61
+ return;
62
+ }
63
+ const existing = staticFiles.find((candidate) => candidate.name === file.name);
64
+ if (existing && existing.sizeInBytes !== file.size) {
65
+ (0, NotificationCenter_1.showNotification)(`File with name ${file.name} already exists and is different`, 4000);
66
+ return;
67
+ }
68
+ try {
69
+ if (!existing) {
70
+ await (0, write_static_file_1.writeStaticFile)({
71
+ contents: await file.arrayBuffer(),
72
+ filePath: file.name,
73
+ });
74
+ }
75
+ onSelect(file.name, (0, remotion_1.staticFile)(file.name));
76
+ if (!existing) {
77
+ (0, NotificationCenter_1.showNotification)(`Created ${file.name} in public folder`, 3000);
78
+ }
79
+ }
80
+ catch (error) {
81
+ (0, NotificationCenter_1.showNotification)(`Could not upload asset: ${error instanceof Error ? error.message : String(error)}`, 4000);
82
+ }
83
+ }, [onSelect, staticFiles]);
52
84
  const openAssetSelection = (0, react_1.useCallback)(() => {
53
85
  setSelectedModal({
54
86
  type: 'quick-switcher',
@@ -56,10 +88,14 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
56
88
  invocationTimestamp: Date.now(),
57
89
  assetSelection: {
58
90
  initialQuery,
91
+ onSelectFile: () => {
92
+ selectFile().catch(() => undefined);
93
+ },
59
94
  onSelected: (asset) => onSelect(asset.name, asset.src),
60
95
  },
96
+ compositionSelection: null,
61
97
  });
62
- }, [initialQuery, onSelect, setSelectedModal]);
98
+ }, [initialQuery, onSelect, selectFile, setSelectedModal]);
63
99
  const action = (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: openAssetSelection, disabled: window.remotion_isReadOnlyStudio, title: "Change source", renderAction: (color) => jsx_runtime_1.jsx(pen_1.PenIcon, { color: color, style: penIcon }) }));
64
100
  if (inlineSourceAction === null) {
65
101
  return action;
@@ -89,7 +89,7 @@ const TimelineDragHandler = () => {
89
89
  if (!canvasContent || canvasContent.type !== 'composition') {
90
90
  return null;
91
91
  }
92
- return (jsx_runtime_1.jsx("div", { ref: timeline_refs_1.sliderAreaRef, style: containerStyle, [TimelineSelection_1.TIMELINE_SCRUBBER_ATTR]: true, children: video && (0, interactivity_enabled_1.isStudioInteractivityEnabled)() ? (jsx_runtime_1.jsx(TimelineDragHandlerInnerMemo, {})) : null }));
92
+ return (jsx_runtime_1.jsx("div", { ref: timeline_refs_1.sliderAreaRef, style: containerStyle, [TimelineSelection_1.TIMELINE_SCRUBBER_ATTR]: true, children: video && (0, interactivity_enabled_1.isStudioSelectionEnabled)() ? (jsx_runtime_1.jsx(TimelineDragHandlerInnerMemo, {})) : null }));
93
93
  };
94
94
  exports.TimelineDragHandler = TimelineDragHandler;
95
95
  const TimelineDragHandlerInner = () => {
@@ -42,8 +42,14 @@ const TimelineKeyframeDiamond_1 = require("./TimelineKeyframeDiamond");
42
42
  const TimelineKeyframeEasingLine_1 = require("./TimelineKeyframeEasingLine");
43
43
  const TimelineSelection_1 = require("./TimelineSelection");
44
44
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
45
- const row = {
45
+ const rowClipper = {
46
+ marginLeft: -timeline_layout_1.TIMELINE_PADDING,
47
+ marginRight: -timeline_layout_1.TIMELINE_PADDING,
46
48
  overflow: 'hidden',
49
+ paddingLeft: timeline_layout_1.TIMELINE_PADDING,
50
+ paddingRight: timeline_layout_1.TIMELINE_PADDING,
51
+ };
52
+ const row = {
47
53
  position: 'relative',
48
54
  };
49
55
  const rowSeparator = {
@@ -55,7 +61,7 @@ const TimelineExpandedKeyframeRowUnmemoized = ({ height, keyframes, canEditEasin
55
61
  const easingSegments = canEditEasing
56
62
  ? (0, get_timeline_easing_segments_1.getTimelineEasingSegments)(keyframes)
57
63
  : [];
58
- 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: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : 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)))] })
64
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showSeparator ? jsx_runtime_1.jsx("div", { style: rowSeparator }) : null, jsx_runtime_1.jsx("div", { style: { ...rowClipper, height }, children: jsx_runtime_1.jsxs("div", { style: { ...row, height }, children: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : 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)))] }) })
59
65
  ] }));
60
66
  };
61
67
  exports.TimelineExpandedKeyframeRow = react_1.default.memo(TimelineExpandedKeyframeRowUnmemoized);
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { ArrayFieldSchema, CanUpdateSequencePropStatusStatic, SequencePropsSubscriptionKey, VisibleFieldSchema } from 'remotion';
3
3
  import type { SchemaFieldInfo, TimelineFieldOnDragValueChange, TimelineFieldOnSave } from '../../helpers/timeline-layout';
4
+ type CaptionsFieldSchema = Extract<VisibleFieldSchema, {
5
+ type: 'remotion-captions';
6
+ }>;
7
+ type PrimitiveFieldSchema = Exclude<VisibleFieldSchema, ArrayFieldSchema | CaptionsFieldSchema>;
4
8
  export type TimelinePrimitiveFieldInfo = Omit<SchemaFieldInfo, 'fieldSchema' | 'typeName'> & {
5
- readonly fieldSchema: Exclude<VisibleFieldSchema, ArrayFieldSchema>;
6
- readonly typeName: Exclude<VisibleFieldSchema['type'], 'array'>;
9
+ readonly fieldSchema: PrimitiveFieldSchema;
10
+ readonly typeName: PrimitiveFieldSchema['type'];
7
11
  };
8
12
  export declare const isTimelinePrimitiveFieldInfo: (field: SchemaFieldInfo) => field is TimelinePrimitiveFieldInfo;
9
13
  export declare const TimelinePrimitiveFieldValue: React.FC<{
@@ -15,3 +19,4 @@ export declare const TimelinePrimitiveFieldValue: React.FC<{
15
19
  readonly effectiveValue: unknown;
16
20
  readonly scaleLockNodePath: SequencePropsSubscriptionKey | null;
17
21
  }>;
22
+ export {};
@@ -24,7 +24,9 @@ const assetInlineWrapper = {
24
24
  minWidth: 0,
25
25
  };
26
26
  const isTimelinePrimitiveFieldInfo = (field) => {
27
- return field.typeName !== 'array' && field.fieldSchema.type !== 'array';
27
+ return (field.typeName !== 'array' &&
28
+ field.fieldSchema.type !== 'array' &&
29
+ field.fieldSchema.type !== 'remotion-captions');
28
30
  };
29
31
  exports.isTimelinePrimitiveFieldInfo = isTimelinePrimitiveFieldInfo;
30
32
  const TimelinePrimitiveFieldValue = ({ field, onSave, onDragValueChange, onDragEnd, propStatus, effectiveValue, scaleLockNodePath, }) => {
@@ -14,9 +14,12 @@ export declare const TimelineRowChrome: React.FC<{
14
14
  readonly onSelect: (interaction?: TimelineSelectionInteraction) => void;
15
15
  readonly showSelectedBackground: boolean;
16
16
  readonly containsSelection: boolean;
17
+ readonly hovered?: boolean;
17
18
  readonly outerHeight: number | null;
18
19
  readonly onDragLeave?: (e: React.DragEvent<HTMLDivElement>) => void;
19
20
  readonly onDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;
20
21
  readonly onDrop?: (e: React.DragEvent<HTMLDivElement>) => void;
21
22
  readonly onDoubleClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
23
+ readonly onPointerEnter?: () => void;
24
+ readonly onPointerLeave?: () => void;
22
25
  }>;
@@ -24,7 +24,7 @@ const keyframeControlsColumnBaseStyle = {
24
24
  flexShrink: 0,
25
25
  justifyContent: 'flex-start',
26
26
  };
27
- const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, style, selected, selectable, selectionItem, onSelect, showSelectedBackground, containsSelection, outerHeight, onDragLeave, onDragOver, onDrop, onDoubleClick, }) => {
27
+ const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, style, selected, selectable, selectionItem, onSelect, showSelectedBackground, containsSelection, hovered = false, outerHeight, onDragLeave, onDragOver, onDrop, onDoubleClick, onPointerEnter, onPointerLeave, }) => {
28
28
  const ref = (0, react_1.useRef)(null);
29
29
  const { basePadding, keyframeControlsPadding, rowBorderRadius, rowHorizontalMargin, } = (0, react_1.useContext)(TimelineRowLayoutContext_1.TimelineRowLayoutContext);
30
30
  const indentWidth = (0, timeline_row_layout_1.getTimelineRowIndentWidth)(depth);
@@ -59,6 +59,7 @@ const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, styl
59
59
  showSelectedBackground,
60
60
  selected,
61
61
  containsSelection,
62
+ hovered,
62
63
  });
63
64
  const innerRowStyle = (0, react_1.useMemo)(() => ({
64
65
  ...rowBase,
@@ -89,8 +90,8 @@ const TimelineRowChrome = ({ depth, eye, keyframeControls, arrow, children, styl
89
90
  const chrome = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
90
91
  jsx_runtime_1.jsx("div", { style: leftChromeStyle, children: keyframeControls ? (jsx_runtime_1.jsx("div", { style: keyframeControlsColumnStyle, children: keyframeControls })) : (jsx_runtime_1.jsxs("div", { style: chromeColumnStyle, children: [eye, indentWidth > 0 ? jsx_runtime_1.jsx(Padder_1.Padder, { depth: depth }) : null, arrow] })) }), children] }));
91
92
  if (outerStyle) {
92
- return (jsx_runtime_1.jsx("div", { ref: ref, style: outerStyle, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, children: jsx_runtime_1.jsx("div", { style: innerRowStyle, children: chrome }) }));
93
+ return (jsx_runtime_1.jsx("div", { ref: ref, style: outerStyle, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: jsx_runtime_1.jsx("div", { style: innerRowStyle, children: chrome }) }));
93
94
  }
94
- return (jsx_runtime_1.jsx("div", { ref: ref, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, style: innerRowStyle, children: chrome }));
95
+ return (jsx_runtime_1.jsx("div", { ref: ref, onDragLeave: onDragLeave, onDragOver: onDragOver, onDrop: onDrop, onPointerDown: selectable ? onPointerDown : undefined, onContextMenu: selectable ? onContextMenu : undefined, onDoubleClick: onDoubleClick, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: innerRowStyle, children: chrome }));
95
96
  };
96
97
  exports.TimelineRowChrome = TimelineRowChrome;
@@ -3,16 +3,18 @@ import { type GetDragOverrides, type GetEffectDragOverrides, type PropStatuses }
3
3
  import type { SequenceNodePathInfo, TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
4
4
  import { type GetIsExpanded } from '../ExpandedTracksProvider';
5
5
  export declare const TIMELINE_SELECTED_BACKGROUND = "#3B3F42";
6
+ export declare const TIMELINE_HOVER_BACKGROUND = "rgba(255, 255, 255, 0.05)";
6
7
  export declare const TIMELINE_SELECTED_LABEL_BACKGROUND = "#B0B0B0";
7
8
  export declare const TIMELINE_SELECTED_LABEL_TEXT = "black";
8
9
  export declare const TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = 2;
9
10
  export declare const getTimelineSelectedLabelStyle: (selected: boolean, subcategory: boolean) => CSSProperties;
10
11
  export declare const getTimelineColor: (selected: boolean, subcategory: boolean) => "black" | "rgba(255, 255, 255, 0.8)";
11
12
  export declare const getTimelineSelectedTrackHighlightStyle: (timelineWidth: number, backgroundColor?: string) => CSSProperties;
12
- export declare const getTimelineRowHighlightBackground: ({ showSelectedBackground, selected, containsSelection, }: {
13
+ export declare const getTimelineRowHighlightBackground: ({ showSelectedBackground, selected, containsSelection, hovered, }: {
13
14
  readonly showSelectedBackground: boolean;
14
15
  readonly selected: boolean;
15
16
  readonly containsSelection: boolean;
17
+ readonly hovered: boolean;
16
18
  }) => string | undefined;
17
19
  export declare const TIMELINE_BACKGROUND = "#0F1113";
18
20
  export declare const TIMELINE_TICKS_BACKGROUND = "rgb(31,36,40)";
@@ -213,5 +215,5 @@ export declare const useTimelineGuideSelection: (guideId: string) => {
213
215
  selectionItem: TimelineSelection;
214
216
  };
215
217
  export declare const useTimelineRowContainsSelection: (nodePathInfo: SequenceNodePathInfo | null) => boolean;
216
- export declare const useTimelineRowHighlightBackground: (nodePathInfo: SequenceNodePathInfo | null) => string | undefined;
218
+ export declare const useTimelineRowHighlightBackground: (nodePathInfo: SequenceNodePathInfo | null, hovered?: boolean) => string | undefined;
217
219
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useTimelineRowHighlightBackground = exports.useTimelineRowContainsSelection = exports.useTimelineGuideSelection = exports.useTimelineEasingSelection = exports.useTimelineKeyframeSelection = exports.useTimelineRowSelection = exports.useTimelineFocusableItem = exports.useTimelineMarqueeSelectableItem = exports.useTimelineMarqueeSelection = exports.useCurrentTimelineSelectionStateAsRef = exports.TIMELINE_SCRUBBER_ATTR = exports.TIMELINE_MARQUEE_ITEM_ATTR = exports.useTimelineSelection = exports.TimelineSelectionProvider = exports.TimelineSelectableItemsProvider = exports.TimelineSelectAllKeybindings = exports.getTimelineSequenceSelectionKey = exports.getSelectableTimelineItems = exports.getSelectableTimelineSequenceSelections = exports.getTimelineSelectionKey = exports.getTimelineSelectionFromNodePathInfo = exports.TimelineSelectionOrderProvider = exports.extendTimelineMarqueeSelection = exports.getTimelineMarqueeSelection = exports.timelineMarqueeRectsIntersect = exports.getClampedTimelineMarqueePoint = exports.getNormalizedTimelineMarqueeRect = exports.getAvailableTimelineSelectionState = exports.getTimelineSelectionAfterInteraction = exports.EMPTY_TIMELINE_SELECTION_STATE = exports.shouldSelectTimelineRowOnPointerDown = exports.isTimelineSelectionModifierEvent = exports.TIMELINE_TICKS_BACKGROUND = exports.TIMELINE_BACKGROUND = exports.getTimelineRowHighlightBackground = exports.getTimelineSelectedTrackHighlightStyle = exports.getTimelineColor = exports.getTimelineSelectedLabelStyle = exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = exports.TIMELINE_SELECTED_LABEL_TEXT = exports.TIMELINE_SELECTED_LABEL_BACKGROUND = exports.TIMELINE_SELECTED_BACKGROUND = void 0;
3
+ exports.useTimelineRowHighlightBackground = exports.useTimelineRowContainsSelection = exports.useTimelineGuideSelection = exports.useTimelineEasingSelection = exports.useTimelineKeyframeSelection = exports.useTimelineRowSelection = exports.useTimelineFocusableItem = exports.useTimelineMarqueeSelectableItem = exports.useTimelineMarqueeSelection = exports.useCurrentTimelineSelectionStateAsRef = exports.TIMELINE_SCRUBBER_ATTR = exports.TIMELINE_MARQUEE_ITEM_ATTR = exports.useTimelineSelection = exports.TimelineSelectionProvider = exports.TimelineSelectableItemsProvider = exports.TimelineSelectAllKeybindings = exports.getTimelineSequenceSelectionKey = exports.getSelectableTimelineItems = exports.getSelectableTimelineSequenceSelections = exports.getTimelineSelectionKey = exports.getTimelineSelectionFromNodePathInfo = exports.TimelineSelectionOrderProvider = exports.extendTimelineMarqueeSelection = exports.getTimelineMarqueeSelection = exports.timelineMarqueeRectsIntersect = exports.getClampedTimelineMarqueePoint = exports.getNormalizedTimelineMarqueeRect = exports.getAvailableTimelineSelectionState = exports.getTimelineSelectionAfterInteraction = exports.EMPTY_TIMELINE_SELECTION_STATE = exports.shouldSelectTimelineRowOnPointerDown = exports.isTimelineSelectionModifierEvent = exports.TIMELINE_TICKS_BACKGROUND = exports.TIMELINE_BACKGROUND = exports.getTimelineRowHighlightBackground = exports.getTimelineSelectedTrackHighlightStyle = exports.getTimelineColor = exports.getTimelineSelectedLabelStyle = exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = exports.TIMELINE_SELECTED_LABEL_TEXT = exports.TIMELINE_SELECTED_LABEL_BACKGROUND = exports.TIMELINE_HOVER_BACKGROUND = exports.TIMELINE_SELECTED_BACKGROUND = 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");
@@ -21,6 +21,7 @@ const timeline_refs_1 = require("./timeline-refs");
21
21
  const TimelineClipboardKeybindings_1 = require("./TimelineClipboardKeybindings");
22
22
  const TimelineDeleteKeybindings_1 = require("./TimelineDeleteKeybindings");
23
23
  exports.TIMELINE_SELECTED_BACKGROUND = colors_1.TIMELINE_SELECTED_BACKGROUND_COLOR;
24
+ exports.TIMELINE_HOVER_BACKGROUND = colors_1.WHITE_ALPHA_05;
24
25
  exports.TIMELINE_SELECTED_LABEL_BACKGROUND = colors_1.TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR;
25
26
  exports.TIMELINE_SELECTED_LABEL_TEXT = colors_1.BLACK;
26
27
  exports.TIMELINE_SELECTED_LABEL_HORIZONTAL_PADDING = 2;
@@ -54,10 +55,11 @@ const getTimelineSelectedTrackHighlightStyle = (timelineWidth, backgroundColor =
54
55
  width: timelineWidth,
55
56
  });
56
57
  exports.getTimelineSelectedTrackHighlightStyle = getTimelineSelectedTrackHighlightStyle;
57
- const getTimelineRowHighlightBackground = ({ showSelectedBackground, selected, containsSelection, }) => {
58
- return showSelectedBackground && (selected || containsSelection)
59
- ? exports.TIMELINE_SELECTED_BACKGROUND
60
- : undefined;
58
+ const getTimelineRowHighlightBackground = ({ showSelectedBackground, selected, containsSelection, hovered, }) => {
59
+ if (showSelectedBackground && (selected || containsSelection)) {
60
+ return exports.TIMELINE_SELECTED_BACKGROUND;
61
+ }
62
+ return hovered ? exports.TIMELINE_HOVER_BACKGROUND : undefined;
61
63
  };
62
64
  exports.getTimelineRowHighlightBackground = getTimelineRowHighlightBackground;
63
65
  exports.TIMELINE_BACKGROUND = colors_1.TIMELINE_BACKGROUND_COLOR;
@@ -1109,13 +1111,14 @@ const useTimelineRowContainsSelection = (nodePathInfo) => {
1109
1111
  return containsSelection(nodePathInfo);
1110
1112
  };
1111
1113
  exports.useTimelineRowContainsSelection = useTimelineRowContainsSelection;
1112
- const useTimelineRowHighlightBackground = (nodePathInfo) => {
1114
+ const useTimelineRowHighlightBackground = (nodePathInfo, hovered = false) => {
1113
1115
  const { selected } = (0, exports.useTimelineRowSelection)(nodePathInfo);
1114
1116
  const containsSelection = (0, exports.useTimelineRowContainsSelection)(nodePathInfo);
1115
1117
  return (0, exports.getTimelineRowHighlightBackground)({
1116
1118
  showSelectedBackground: true,
1117
1119
  selected,
1118
1120
  containsSelection,
1121
+ hovered,
1119
1122
  });
1120
1123
  };
1121
1124
  exports.useTimelineRowHighlightBackground = useTimelineRowHighlightBackground;
@@ -291,10 +291,7 @@ const TimelineSequenceInner = ({ s, connectedCompositions, windowWidth, nodePath
291
291
  },
292
292
  ],
293
293
  });
294
- if (result.success) {
295
- (0, NotificationCenter_1.showNotification)('Removed sequence from source file', 2000);
296
- }
297
- else {
294
+ if (!result.success) {
298
295
  (0, NotificationCenter_1.showNotification)(result.reason, 4000);
299
296
  }
300
297
  }
@@ -46,6 +46,7 @@ const studio_runtime_config_1 = require("../../helpers/studio-runtime-config");
46
46
  const timeline_layout_1 = require("../../helpers/timeline-layout");
47
47
  const use_keybinding_1 = require("../../helpers/use-keybinding");
48
48
  const modals_1 = require("../../state/modals");
49
+ const timeline_sequence_hover_1 = require("../../state/timeline-sequence-hover");
49
50
  const call_api_1 = require("../call-api");
50
51
  const CompositionOrStillIcon_1 = require("../CompositionOrStillIcon");
51
52
  const ConfirmationDialog_1 = require("../ConfirmationDialog");
@@ -176,6 +177,7 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
176
177
  var _a, _b, _c;
177
178
  var _d, _e, _f;
178
179
  const nodePath = (_d = nodePathInfo === null || nodePathInfo === void 0 ? void 0 : nodePathInfo.sequenceSubscriptionKey) !== null && _d !== void 0 ? _d : null;
180
+ const { hovered, onPointerEnter, onPointerLeave } = (0, timeline_sequence_hover_1.useTimelineSequenceHover)(nodePathInfo);
179
181
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
180
182
  const previewConnected = previewServerState.type === 'connected';
181
183
  const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
@@ -268,10 +270,7 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
268
270
  },
269
271
  ],
270
272
  });
271
- if (result.success) {
272
- (0, NotificationCenter_1.showNotification)('Removed sequence from source file', 2000);
273
- }
274
- else {
273
+ if (!result.success) {
275
274
  (0, NotificationCenter_1.showNotification)(result.reason, 4000);
276
275
  }
277
276
  }
@@ -857,7 +856,7 @@ const TimelineSequenceItem = ({ children, connectedCompositions, nestedDepth, se
857
856
  clientId: previewServerState.clientId,
858
857
  });
859
858
  }, [canDropEffect, nodePath, previewServerState, validatedLocation]);
860
- const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewInteractive, isExpanded: isExpanded, nodePathInfo: nodePathInfo, onToggleExpand: onToggleExpand, sequence: sequence })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {})), style: rowStyle, selected: selected, selectable: selectable, selectionItem: selectionItem, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick: canHandleSequenceDoubleClick ? onSequenceDoubleClick : undefined, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
859
+ const trackRow = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: nestedDepth, eye: canToggleVisibility ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: sequence.type === 'audio' ? 'speaker' : 'eye', hidden: isItemHidden, onInvoked: onToggleVisibility })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: hasExpandableContent && nodePathInfo !== null ? (jsx_runtime_1.jsx(TimelineSequenceExpandArrow, { disabled: !previewInteractive, isExpanded: isExpanded, nodePathInfo: nodePathInfo, onToggleExpand: onToggleExpand, sequence: sequence })) : (jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowSpacer, {})), style: rowStyle, selected: selected, selectable: selectable, selectionItem: selectionItem, onSelect: onSelect, showSelectedBackground: true, containsSelection: containsSelection, hovered: hovered, outerHeight: outerHeight, onDragLeave: canDropEffect ? onEffectDragLeave : undefined, onDragOver: canDropEffect ? onEffectDragOver : undefined, onDrop: canDropEffect ? onEffectDrop : undefined, onDoubleClick: canHandleSequenceDoubleClick ? onSequenceDoubleClick : undefined, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: jsx_runtime_1.jsxs("div", { style: labelContainerStyle, children: [connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
861
860
  jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: (0, TimelineSelection_1.getTimelineColor)(false, false), composition: connectedCompositions[0], style: connectedCompositionIconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 })
862
861
  ] })) : null, jsx_runtime_1.jsx(TimelineSequenceName_1.TimelineSequenceName, { displayName: timelineDisplayName, fallbackDisplayName: fallbackDisplayName, selected: selected, containsSelection: containsSelection, editing: isRenaming, onCancelEditing: onCancelRenaming, onSaveName: onSaveName }), mediaSrc ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
863
862
  jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }),
@@ -10,6 +10,7 @@ const open_in_editor_1 = require("../../helpers/open-in-editor");
10
10
  const ContextMenu_1 = require("../ContextMenu");
11
11
  const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
12
12
  const call_add_keyframe_1 = require("./call-add-keyframe");
13
+ const get_sequence_prop_reset_changes_1 = require("./get-sequence-prop-reset-changes");
13
14
  const save_sequence_prop_1 = require("./save-sequence-prop");
14
15
  const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
15
16
  const TimelineFieldRowContent_1 = require("./TimelineFieldRowContent");
@@ -230,16 +231,14 @@ const TimelineSequencePropItem = ({ field, validatedLocation, rowDepth, nodePath
230
231
  (0, save_sequence_prop_1.saveSequenceProps)({
231
232
  addedKeyframes: null,
232
233
  movedKeyframes: null,
233
- changes: [
234
- {
235
- fileName: validatedLocation.source,
236
- nodePath,
237
- fieldKey: field.key,
238
- value: field.fieldSchema.default,
239
- defaultValue,
240
- schema,
241
- },
242
- ],
234
+ changes: (0, get_sequence_prop_reset_changes_1.getSequencePropResetChanges)({
235
+ fileName: validatedLocation.source,
236
+ nodePath,
237
+ fieldKey: field.key,
238
+ value: field.fieldSchema.default,
239
+ defaultValue,
240
+ schema,
241
+ }),
243
242
  setPropStatuses,
244
243
  clientId: previewServerState.clientId,
245
244
  undoLabel: `Reset ${fieldLabel}`,
@@ -6,6 +6,7 @@ const get_source_map_1 = require("../../../error-overlay/react-overlay/utils/get
6
6
  const get_location_of_sequence_1 = require("../../../helpers/get-location-of-sequence");
7
7
  const traceMapCache = {};
8
8
  const traceMapPromises = {};
9
+ const browserStudioOriginalSourcePrefix = 'browser-studio-original://';
9
10
  const getSourceMapCache = async (fileName) => {
10
11
  if (traceMapCache[fileName]) {
11
12
  return traceMapCache[fileName];
@@ -32,6 +33,13 @@ const getOriginalLocationFromStack = async (stack, type) => {
32
33
  if (!location) {
33
34
  return null;
34
35
  }
36
+ if (location.fileName.startsWith(browserStudioOriginalSourcePrefix)) {
37
+ return {
38
+ column: location.columnNumber,
39
+ line: location.lineNumber,
40
+ source: decodeURIComponent(location.fileName.slice(browserStudioOriginalSourcePrefix.length)),
41
+ };
42
+ }
35
43
  const map = await getSourceMapCache(location.fileName);
36
44
  const originalPosition = (0, get_source_map_1.getOriginalPosition)(map, location.lineNumber, location.columnNumber);
37
45
  return originalPosition;
@@ -38,6 +38,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const client_id_1 = require("../../helpers/client-id");
40
40
  const timeline_layout_1 = require("../../helpers/timeline-layout");
41
+ const timeline_sequence_hover_1 = require("../../state/timeline-sequence-hover");
41
42
  const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
42
43
  const TimelineExpandedTrackKeyframes_1 = require("./TimelineExpandedTrackKeyframes");
43
44
  const TimelineSelection_1 = require("./TimelineSelection");
@@ -49,7 +50,8 @@ const TimelineTrackUnmemoized = ({ track }) => {
49
50
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
50
51
  const previewServerConnected = previewServerState.type === 'connected';
51
52
  const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
52
- const rowHighlightBackground = (0, TimelineSelection_1.useTimelineRowHighlightBackground)(track.nodePathInfo);
53
+ const { hovered, onPointerEnter, onPointerLeave } = (0, timeline_sequence_hover_1.useTimelineSequenceHover)(track.nodePathInfo);
54
+ const rowHighlightBackground = (0, TimelineSelection_1.useTimelineRowHighlightBackground)(track.nodePathInfo, hovered);
53
55
  const layerStyle = (0, react_1.useMemo)(() => ({
54
56
  height: (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type),
55
57
  marginBottom: timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
@@ -58,7 +60,7 @@ const TimelineTrackUnmemoized = ({ track }) => {
58
60
  const showExpandedKeyframes = track.nodePathInfo !== null &&
59
61
  previewServerConnected &&
60
62
  getIsExpanded(track.nodePathInfo);
61
- return (jsx_runtime_1.jsxs("div", { children: [
63
+ return (jsx_runtime_1.jsxs("div", { onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: [
62
64
  jsx_runtime_1.jsxs("div", { style: layerStyle, children: [rowHighlightBackground && timelineWidth !== null ? (jsx_runtime_1.jsx("div", { style: (0, TimelineSelection_1.getTimelineSelectedTrackHighlightStyle)(timelineWidth, rowHighlightBackground) })) : null, jsx_runtime_1.jsx(TimelineSequence_1.TimelineSequence, { s: track.sequence, connectedCompositions: (_a = track.connectedCompositions) !== null && _a !== void 0 ? _a : [], nodePathInfo: track.nodePathInfo, sequenceFrameOffset: track.sequenceFrameOffset })
63
65
  ] }), showExpandedKeyframes && track.nodePathInfo ? (jsx_runtime_1.jsx(TimelineExpandedTrackKeyframes_1.TimelineExpandedTrackKeyframes, { sequence: track.sequence, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset })) : null] }));
64
66
  };
@@ -0,0 +1,16 @@
1
+ import { BORDER_RADIUS_LONGHAND_KEYS, BORDER_RADIUS_SHORTHAND_KEY } from '@remotion/studio-shared';
2
+ import type { CanUpdateSequencePropStatus, DragOverrideValue } from 'remotion';
3
+ export { BORDER_RADIUS_LONGHAND_KEYS, BORDER_RADIUS_SHORTHAND_KEY };
4
+ export type BorderRadiusConversion = {
5
+ readonly type: 'individual';
6
+ readonly value: number;
7
+ } | {
8
+ readonly type: 'shorthand';
9
+ readonly value: number;
10
+ };
11
+ export type BorderRadiusConversionChange = {
12
+ readonly fieldKey: string;
13
+ readonly value: number | undefined;
14
+ };
15
+ export declare const getBorderRadiusConversionChanges: (conversion: BorderRadiusConversion) => BorderRadiusConversionChange[];
16
+ export declare const getBorderRadiusConversion: (props: Record<string, CanUpdateSequencePropStatus> | undefined, dragOverrides?: Record<string, DragOverrideValue>) => BorderRadiusConversion | null;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBorderRadiusConversion = exports.getBorderRadiusConversionChanges = exports.BORDER_RADIUS_SHORTHAND_KEY = exports.BORDER_RADIUS_LONGHAND_KEYS = void 0;
4
+ const studio_shared_1 = require("@remotion/studio-shared");
5
+ Object.defineProperty(exports, "BORDER_RADIUS_LONGHAND_KEYS", { enumerable: true, get: function () { return studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS; } });
6
+ Object.defineProperty(exports, "BORDER_RADIUS_SHORTHAND_KEY", { enumerable: true, get: function () { return studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY; } });
7
+ const getBorderRadiusConversionChanges = (conversion) => {
8
+ if (conversion.type === 'individual') {
9
+ return [
10
+ { fieldKey: studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY, value: undefined },
11
+ ...studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS.map((fieldKey) => ({
12
+ fieldKey,
13
+ value: conversion.value,
14
+ })),
15
+ ];
16
+ }
17
+ return [
18
+ ...studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS.map((fieldKey) => ({
19
+ fieldKey,
20
+ value: undefined,
21
+ })),
22
+ { fieldKey: studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY, value: conversion.value },
23
+ ];
24
+ };
25
+ exports.getBorderRadiusConversionChanges = getBorderRadiusConversionChanges;
26
+ const getBorderRadiusConversion = (props, dragOverrides = {}) => {
27
+ const getStaticValue = (key) => {
28
+ const status = props === null || props === void 0 ? void 0 : props[key];
29
+ if (status !== undefined && status.status !== 'static') {
30
+ return { isStatic: false, value: undefined };
31
+ }
32
+ const dragOverride = dragOverrides[key];
33
+ if ((dragOverride === null || dragOverride === void 0 ? void 0 : dragOverride.type) === 'keyframed') {
34
+ return { isStatic: false, value: undefined };
35
+ }
36
+ return {
37
+ isStatic: true,
38
+ value: (dragOverride === null || dragOverride === void 0 ? void 0 : dragOverride.type) === 'static'
39
+ ? dragOverride.value
40
+ : status === null || status === void 0 ? void 0 : status.codeValue,
41
+ };
42
+ };
43
+ const shorthand = getStaticValue(studio_shared_1.BORDER_RADIUS_SHORTHAND_KEY);
44
+ if (shorthand.isStatic && typeof shorthand.value === 'number') {
45
+ return { type: 'individual', value: shorthand.value };
46
+ }
47
+ const longhands = studio_shared_1.BORDER_RADIUS_LONGHAND_KEYS.map(getStaticValue);
48
+ const hasNoAuthoredRadius = [shorthand, ...longhands].every((status) => status.isStatic && status.value === undefined);
49
+ if (hasNoAuthoredRadius) {
50
+ return { type: 'individual', value: 0 };
51
+ }
52
+ if (longhands.every((status) => status.isStatic && typeof status.value === 'number')) {
53
+ const values = longhands.map((status) => status.value);
54
+ if (values.every((value) => value === values[0])) {
55
+ return { type: 'shorthand', value: values[0] };
56
+ }
57
+ }
58
+ return null;
59
+ };
60
+ exports.getBorderRadiusConversion = getBorderRadiusConversion;
@@ -46,12 +46,7 @@ const deleteSequencesFromSource = async (nodePathInfos, confirm) => {
46
46
  }),
47
47
  })
48
48
  .then((result) => {
49
- if (result.success) {
50
- (0, NotificationCenter_1.showNotification)(nodePathInfos.length === 1
51
- ? 'Removed sequence from source file'
52
- : 'Removed sequences from source files', 2000);
53
- }
54
- else {
49
+ if (!result.success) {
55
50
  (0, NotificationCenter_1.showNotification)(result.reason, 4000);
56
51
  }
57
52
  return true;
@@ -0,0 +1,10 @@
1
+ import type { InteractivitySchema, SequencePropsSubscriptionKey } from 'remotion';
2
+ import type { SaveSequencePropChange } from './save-sequence-prop';
3
+ export declare const getSequencePropResetChanges: ({ fileName, nodePath, fieldKey, value, defaultValue, schema, }: {
4
+ readonly fileName: string;
5
+ readonly nodePath: SequencePropsSubscriptionKey;
6
+ readonly fieldKey: string;
7
+ readonly value: unknown;
8
+ readonly defaultValue: string | null;
9
+ readonly schema: InteractivitySchema;
10
+ }) => SaveSequencePropChange[];