@remotion/studio 4.0.499 → 4.0.501

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 (204) 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 +11 -7
  8. package/dist/components/AssetSelectorItem.d.ts +25 -0
  9. package/dist/components/AssetSelectorItem.js +116 -80
  10. package/dist/components/Canvas.js +6 -1
  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 +2 -32
  16. package/dist/components/ControlButton.js +1 -0
  17. package/dist/components/CurrentAsset.js +3 -2
  18. package/dist/components/EditorContexts.d.ts +0 -1
  19. package/dist/components/EditorContexts.js +2 -2
  20. package/dist/components/ExplorerPanel.js +2 -1
  21. package/dist/components/ExplorerPanelRef.d.ts +2 -0
  22. package/dist/components/FpsCounter.js +3 -3
  23. package/dist/components/FullscreenToggle.js +2 -1
  24. package/dist/components/GlobalKeybindings.js +9 -1
  25. package/dist/components/InitialCompositionLoader.d.ts +1 -1
  26. package/dist/components/InlineAction.d.ts +2 -1
  27. package/dist/components/InlineAction.js +3 -2
  28. package/dist/components/InlineCaptionInspector.d.ts +11 -0
  29. package/dist/components/InlineCaptionInspector.js +108 -0
  30. package/dist/components/InlineDropdown.d.ts +1 -1
  31. package/dist/components/InlineDropdown.js +3 -2
  32. package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
  33. package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
  34. package/dist/components/InspectorPanel/CompositionInspector.js +12 -9
  35. package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
  36. package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
  37. package/dist/components/InspectorPanel/SelectedInspector.d.ts +1 -0
  38. package/dist/components/InspectorPanel/SelectedInspector.js +2 -2
  39. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
  40. package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +1 -0
  41. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +10 -10
  42. package/dist/components/InspectorPanel/common.d.ts +17 -4
  43. package/dist/components/InspectorPanel/common.js +60 -6
  44. package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +22 -0
  45. package/dist/components/InspectorPanel/inspector-section-collapse.js +165 -0
  46. package/dist/components/InspectorPanel/styles.js +7 -1
  47. package/dist/components/InspectorPanel/use-composition-actions.d.ts +3 -0
  48. package/dist/components/InspectorPanel/use-composition-actions.js +91 -5
  49. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
  50. package/dist/components/InspectorPanel.js +2 -2
  51. package/dist/components/InspectorSequenceSection.d.ts +2 -1
  52. package/dist/components/InspectorSequenceSection.js +279 -25
  53. package/dist/components/KeyboardShortcutsExplainer.js +4 -2
  54. package/dist/components/Menu/MenuItem.js +2 -1
  55. package/dist/components/MenuCompositionName.js +30 -7
  56. package/dist/components/MenuToolbar.d.ts +0 -1
  57. package/dist/components/MenuToolbar.js +15 -7
  58. package/dist/components/MobilePanel.d.ts +2 -1
  59. package/dist/components/MobilePanel.js +29 -25
  60. package/dist/components/ModalContainer.d.ts +1 -0
  61. package/dist/components/ModalContainer.js +2 -2
  62. package/dist/components/Modals.js +1 -1
  63. package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
  64. package/dist/components/NewComposition/DismissableModal.js +2 -2
  65. package/dist/components/NewComposition/InputDragger.d.ts +7 -0
  66. package/dist/components/NewComposition/InputDragger.js +119 -8
  67. package/dist/components/OutlineToggle.d.ts +1 -3
  68. package/dist/components/OutlineToggle.js +2 -2
  69. package/dist/components/PreviewToolbar.js +10 -4
  70. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
  71. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +45 -0
  72. package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
  73. package/dist/components/QuickSwitcher/NoResults.js +1 -0
  74. package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +10 -0
  75. package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
  76. package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +10 -0
  77. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +95 -13
  78. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
  79. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
  80. package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
  81. package/dist/components/QuickSwitcher/asset-search.js +42 -0
  82. package/dist/components/RenderQueue/ClientRenderQueueProcessor.d.ts +0 -1
  83. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +3 -14
  84. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
  85. package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
  86. package/dist/components/SelectedOutlineCropControls.js +299 -0
  87. package/dist/components/SelectedOutlineElement.js +84 -47
  88. package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
  89. package/dist/components/SelectedOutlineOverlay.js +147 -16
  90. package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
  91. package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
  92. package/dist/components/ShowOutlinesProvider.js +4 -1
  93. package/dist/components/SidebarCollapserControls.d.ts +3 -1
  94. package/dist/components/SidebarCollapserControls.js +34 -29
  95. package/dist/components/SnappingToggle.d.ts +1 -3
  96. package/dist/components/SnappingToggle.js +2 -2
  97. package/dist/components/Timeline/Timeline.js +19 -5
  98. package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
  99. package/dist/components/Timeline/TimelineAssetField.js +53 -100
  100. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
  101. package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
  102. package/dist/components/Timeline/TimelineColorField.js +20 -1
  103. package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
  104. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +8 -1
  105. package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
  106. package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
  107. package/dist/components/Timeline/TimelineList.d.ts +2 -2
  108. package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +7 -2
  109. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +10 -2
  110. package/dist/components/Timeline/TimelineRowChrome.d.ts +3 -0
  111. package/dist/components/Timeline/TimelineRowChrome.js +4 -3
  112. package/dist/components/Timeline/TimelineSelection.d.ts +9 -7
  113. package/dist/components/Timeline/TimelineSelection.js +17 -12
  114. package/dist/components/Timeline/TimelineSequence.js +2 -9
  115. package/dist/components/Timeline/TimelineSequenceItem.js +61 -15
  116. package/dist/components/Timeline/TimelineSequencePropItem.js +36 -85
  117. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +0 -1
  118. package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
  119. package/dist/components/Timeline/TimelineTrack.js +4 -2
  120. package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
  121. package/dist/components/Timeline/border-radius-representation.d.ts +16 -0
  122. package/dist/components/Timeline/border-radius-representation.js +60 -0
  123. package/dist/components/Timeline/delete-selected-timeline-item.js +1 -6
  124. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  125. package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
  126. package/dist/components/Timeline/get-sequence-prop-reset-changes.d.ts +10 -0
  127. package/dist/components/Timeline/get-sequence-prop-reset-changes.js +33 -0
  128. package/dist/components/Timeline/reset-selected-timeline-props.js +20 -18
  129. package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
  130. package/dist/components/Timeline/save-effect-prop.js +52 -1
  131. package/dist/components/Timeline/save-sequence-prop.d.ts +12 -1
  132. package/dist/components/Timeline/save-sequence-prop.js +25 -1
  133. package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
  134. package/dist/components/Timeline/timeline-asset-link.js +17 -1
  135. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  136. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
  137. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
  138. package/dist/components/Timeline/use-timeline-asset-drop.js +4 -0
  139. package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
  140. package/dist/components/TopPanel.js +2 -2
  141. package/dist/components/UndoRedoButtons.js +42 -11
  142. package/dist/components/composition-drop-preview.js +1 -0
  143. package/dist/components/handle-drop.d.ts +3 -2
  144. package/dist/components/handle-drop.js +2 -1
  145. package/dist/components/import-assets.d.ts +4 -2
  146. package/dist/components/import-assets.js +20 -7
  147. package/dist/components/menu-toolbar-height.d.ts +1 -0
  148. package/dist/components/menu-toolbar-height.js +4 -0
  149. package/dist/components/selected-outline-drag.d.ts +41 -4
  150. package/dist/components/selected-outline-drag.js +179 -2
  151. package/dist/components/selected-outline-geometry.d.ts +1 -0
  152. package/dist/components/selected-outline-measurement.d.ts +11 -0
  153. package/dist/components/selected-outline-measurement.js +64 -3
  154. package/dist/components/selected-outline-types.d.ts +44 -1
  155. package/dist/components/selected-outline-types.js +21 -1
  156. package/dist/components/use-element-overwrite-confirmation.d.ts +2 -0
  157. package/dist/components/use-element-overwrite-confirmation.js +73 -0
  158. package/dist/components/use-static-files.js +7 -2
  159. package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +13 -2
  160. package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
  161. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
  162. package/dist/esm/{chunk-pk1zwsn1.js → chunk-n1kj09yv.js} +10618 -8002
  163. package/dist/esm/index.mjs +24 -8
  164. package/dist/esm/internals.mjs +10618 -8002
  165. package/dist/esm/previewEntry.mjs +40002 -37388
  166. package/dist/esm/renderEntry.mjs +1 -1
  167. package/dist/helpers/browser-studio-operations.d.ts +3 -0
  168. package/dist/helpers/browser-studio-operations.js +14 -0
  169. package/dist/helpers/calculate-timeline.d.ts +2 -2
  170. package/dist/helpers/calculate-timeline.js +8 -28
  171. package/dist/helpers/client-id.d.ts +0 -1
  172. package/dist/helpers/client-id.js +15 -10
  173. package/dist/helpers/download-blob.d.ts +1 -0
  174. package/dist/helpers/download-blob.js +15 -0
  175. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
  176. package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
  177. package/dist/helpers/inject-css.js +5 -3
  178. package/dist/helpers/interactivity-enabled.d.ts +1 -0
  179. package/dist/helpers/interactivity-enabled.js +7 -2
  180. package/dist/helpers/is-mac.d.ts +1 -0
  181. package/dist/helpers/is-mac.js +4 -0
  182. package/dist/helpers/open-in-editor.d.ts +5 -1
  183. package/dist/helpers/open-in-editor.js +39 -4
  184. package/dist/helpers/preview-server-events.js +46 -9
  185. package/dist/helpers/sort-by-nonce-history.js +97 -19
  186. package/dist/helpers/use-create-composition.js +8 -6
  187. package/dist/helpers/use-keybinding.js +2 -3
  188. package/dist/helpers/use-menu-structure.js +39 -1
  189. package/dist/hot-middleware-client/client.js +3 -3
  190. package/dist/icons/border-radius.d.ts +4 -0
  191. package/dist/icons/border-radius.js +8 -0
  192. package/dist/icons/caret.d.ts +1 -0
  193. package/dist/icons/caret.js +2 -2
  194. package/dist/icons/fullscreen.d.ts +4 -0
  195. package/dist/icons/fullscreen.js +6 -0
  196. package/dist/icons/pen.d.ts +5 -0
  197. package/dist/icons/pen.js +8 -0
  198. package/dist/previewEntry.js +1 -1
  199. package/dist/state/modals.d.ts +9 -0
  200. package/dist/state/timeline-sequence-hover.d.ts +17 -0
  201. package/dist/state/timeline-sequence-hover.js +33 -0
  202. package/package.json +13 -12
  203. package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
  204. package/dist/helpers/get-timeline-sequence-hash.js +0 -33
@@ -3,18 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InspectorSequenceSection = exports.hasSequenceControls = exports.getInspectorSelectableItems = 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 client_id_1 = require("../helpers/client-id");
7
8
  const colors_1 = require("../helpers/colors");
8
9
  const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
10
+ const interactivity_enabled_1 = require("../helpers/interactivity-enabled");
9
11
  const timeline_layout_1 = require("../helpers/timeline-layout");
12
+ const border_radius_1 = require("../icons/border-radius");
13
+ const fullscreen_1 = require("../icons/fullscreen");
10
14
  const plus_1 = require("../icons/plus");
11
15
  const modals_1 = require("../state/modals");
12
16
  const AssetFileIcon_1 = require("./AssetFileIcon");
13
17
  const InlineAction_1 = require("./InlineAction");
18
+ const InlineCaptionInspector_1 = require("./InlineCaptionInspector");
14
19
  const common_1 = require("./InspectorPanel/common");
20
+ const inspector_section_collapse_1 = require("./InspectorPanel/inspector-section-collapse");
15
21
  const styles_1 = require("./InspectorPanel/styles");
16
- const InspectorPanelLayout_1 = require("./InspectorPanelLayout");
22
+ const asset_search_1 = require("./QuickSwitcher/asset-search");
23
+ const border_radius_representation_1 = require("./Timeline/border-radius-representation");
24
+ const save_sequence_prop_1 = require("./Timeline/save-sequence-prop");
17
25
  const timeline_asset_link_1 = require("./Timeline/timeline-asset-link");
26
+ const TimelineAssetField_1 = require("./Timeline/TimelineAssetField");
18
27
  const TimelineExpandedRow_1 = require("./Timeline/TimelineExpandedRow");
19
28
  const TimelineRowLayoutContext_1 = require("./Timeline/TimelineRowLayoutContext");
20
29
  const TimelineSelection_1 = require("./Timeline/TimelineSelection");
@@ -42,20 +51,56 @@ const plusIcon = {
42
51
  width: 15,
43
52
  height: 15,
44
53
  };
54
+ const borderRadiusToggleIcon = {
55
+ flexShrink: 0,
56
+ height: 15,
57
+ width: 15,
58
+ };
59
+ const collapsibleSectionHeaderButton = {
60
+ appearance: 'none',
61
+ backgroundColor: 'transparent',
62
+ border: 'none',
63
+ borderRadius: 3,
64
+ cursor: 'default',
65
+ display: 'block',
66
+ flex: 1,
67
+ fontFamily: 'Arial, Helvetica, sans-serif',
68
+ fontSize: 12,
69
+ fontWeight: 'bold',
70
+ lineHeight: '16px',
71
+ margin: 0,
72
+ minWidth: 0,
73
+ overflow: 'hidden',
74
+ padding: '4px 0',
75
+ textAlign: 'left',
76
+ textOverflow: 'ellipsis',
77
+ userSelect: 'none',
78
+ whiteSpace: 'nowrap',
79
+ };
80
+ const CollapsibleInspectorSectionHeader = ({ action, expanded, label, onToggle }) => {
81
+ const [hovered, setHovered] = (0, react_1.useState)(false);
82
+ const style = (0, react_1.useMemo)(() => {
83
+ return {
84
+ ...collapsibleSectionHeaderButton,
85
+ color: hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
86
+ };
87
+ }, [hovered]);
88
+ return (jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
89
+ jsx_runtime_1.jsx("button", { type: "button", "aria-expanded": expanded, "aria-label": `${expanded ? 'Collapse' : 'Expand'} ${label}`, className: "__remotion-inspector-section-title", onClick: onToggle, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), style: style, children: label }), action] }));
90
+ };
45
91
  const assetSelectorIcon = {
46
92
  flexShrink: 0,
47
93
  height: 18,
48
94
  width: 18,
49
95
  };
50
- const remoteSourceLabel = {
51
- color: colors_1.LIGHT_TEXT,
96
+ const remoteSourcePartsContainer = {
97
+ color: 'inherit',
52
98
  display: 'flex',
53
99
  fontFamily: 'Arial, Helvetica, sans-serif',
54
100
  fontSize: 12,
55
101
  lineHeight: '18px',
56
102
  minWidth: 0,
57
103
  overflow: 'hidden',
58
- padding: `6px ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px`,
59
104
  whiteSpace: 'nowrap',
60
105
  };
61
106
  const remoteSourceLeading = {
@@ -87,6 +132,7 @@ const isEffectsRoot = (node) => {
87
132
  return auxiliaryKeys[auxiliaryKeys.length - 1] === 'effects';
88
133
  };
89
134
  const INSPECTOR_COLLAPSED_ROWS_SESSION_STORAGE_KEY = 'remotion.editor.inspectorCollapsedRows';
135
+ const INSPECTOR_SECTION_EXPANSION_OVERRIDES_SESSION_STORAGE_KEY = 'remotion.editor.inspectorSectionExpansionOverrides';
90
136
  const getInspectorExpansionKey = (nodePathInfo) => {
91
137
  return JSON.stringify(nodePathInfo);
92
138
  };
@@ -120,6 +166,48 @@ const persistInspectorCollapsedKeys = (keys) => {
120
166
  // Ignore quota errors or disabled storage.
121
167
  }
122
168
  };
169
+ const loadInspectorSectionExpansionOverrides = () => {
170
+ if (typeof window === 'undefined') {
171
+ return {};
172
+ }
173
+ try {
174
+ const raw = window.sessionStorage.getItem(INSPECTOR_SECTION_EXPANSION_OVERRIDES_SESSION_STORAGE_KEY);
175
+ if (raw === null) {
176
+ return {};
177
+ }
178
+ const parsed = JSON.parse(raw);
179
+ if (parsed === null ||
180
+ typeof parsed !== 'object' ||
181
+ Array.isArray(parsed)) {
182
+ return {};
183
+ }
184
+ return Object.fromEntries(Object.entries(parsed).filter((entry) => {
185
+ return typeof entry[1] === 'boolean';
186
+ }));
187
+ }
188
+ catch (_a) {
189
+ return {};
190
+ }
191
+ };
192
+ const persistInspectorSectionExpansionOverrides = (overrides) => {
193
+ if (typeof window === 'undefined') {
194
+ return;
195
+ }
196
+ try {
197
+ window.sessionStorage.setItem(INSPECTOR_SECTION_EXPANSION_OVERRIDES_SESSION_STORAGE_KEY, JSON.stringify(overrides));
198
+ }
199
+ catch (_a) {
200
+ // Ignore quota errors or disabled storage.
201
+ }
202
+ };
203
+ const getInspectorSectionExpansionKey = ({ nodePathInfo, groupId, }) => {
204
+ return JSON.stringify([
205
+ nodePathInfo.sequenceSubscriptionKey.absolutePath,
206
+ nodePathInfo.sequenceSubscriptionKey.nodePath,
207
+ nodePathInfo.index,
208
+ groupId,
209
+ ]);
210
+ };
123
211
  const getInspectorControlGroups = (rows) => {
124
212
  return timeline_layout_1.SCHEMA_FIELD_GROUPS.map((group) => ({
125
213
  ...group,
@@ -140,31 +228,58 @@ const hasSequenceControls = (sequence) => {
140
228
  return sequence.controls !== null;
141
229
  };
142
230
  exports.hasSequenceControls = hasSequenceControls;
143
- const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderTransformControls, }) => {
231
+ const InspectorSequenceSection = ({ sequence, readOnlyStudio, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderTransformControls, }) => {
144
232
  var _a;
145
- const { tree } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
233
+ const { tree, propStatuses } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
146
234
  sequence,
147
235
  nodePathInfo,
148
236
  includeTextContent: true,
149
237
  includeSourceControls: true,
150
238
  });
151
239
  const [collapsedKeys, setCollapsedKeys] = (0, react_1.useState)(loadInspectorCollapsedKeys);
240
+ const [sectionExpansionOverrides, setSectionExpansionOverrides] = (0, react_1.useState)(loadInspectorSectionExpansionOverrides);
241
+ const [automaticSectionExpansion, setAutomaticSectionExpansion] = (0, react_1.useState)({});
152
242
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
243
+ const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
244
+ const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
153
245
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
154
246
  const selectAsset = (0, use_select_asset_1.useSelectAsset)();
155
247
  const mediaSrc = (0, timeline_asset_link_1.getTimelineAssetSrcFromSchema)(sequence.controls);
156
- const assetLinkInfo = (0, react_1.useMemo)(() => (mediaSrc ? (0, timeline_asset_link_1.getTimelineAssetLinkInfo)(mediaSrc) : null), [mediaSrc]);
157
- const localAsset = (assetLinkInfo === null || assetLinkInfo === void 0 ? void 0 : assetLinkInfo.kind) === 'local' ? assetLinkInfo : null;
158
- const remoteAsset = (assetLinkInfo === null || assetLinkInfo === void 0 ? void 0 : assetLinkInfo.kind) === 'remote' ? assetLinkInfo : null;
159
- const remoteSourceParts = (0, react_1.useMemo)(() => remoteAsset ? (0, timeline_asset_link_1.splitRemoteSourceForMiddleEllipsis)(remoteAsset.href) : null, [remoteAsset]);
160
- const jumpToAsset = (0, react_1.useCallback)(() => {
161
- if (localAsset) {
162
- (0, timeline_asset_link_1.openTimelineAssetLink)(localAsset, selectAsset);
248
+ const assetSelectionInitialQuery = (0, asset_search_1.getAssetSearchQueryForComponent)(sequence.controls.componentIdentity);
249
+ const getSourceAction = (0, react_1.useCallback)((src) => {
250
+ var _a;
251
+ const linkInfo = (0, timeline_asset_link_1.getTimelineAssetLinkInfo)(src);
252
+ if ((linkInfo === null || linkInfo === void 0 ? void 0 : linkInfo.kind) === 'local') {
253
+ const fileName = (_a = linkInfo.assetPath.split('/').pop()) !== null && _a !== void 0 ? _a : linkInfo.assetPath;
254
+ return {
255
+ children: fileName,
256
+ disabled: false,
257
+ onClick: () => (0, timeline_asset_link_1.openTimelineAssetLink)(linkInfo, selectAsset),
258
+ renderIcon: (color) => (jsx_runtime_1.jsx(AssetFileIcon_1.AssetFileIcon, { color: color, fileType: (0, get_preview_file_type_1.getPreviewFileType)(linkInfo.assetPath), style: assetSelectorIcon })),
259
+ title: linkInfo.assetPath,
260
+ };
163
261
  }
164
- }, [localAsset, selectAsset]);
165
- const localAssetFileName = localAsset
166
- ? ((_a = localAsset.assetPath.split('/').pop()) !== null && _a !== void 0 ? _a : localAsset.assetPath)
167
- : null;
262
+ if ((linkInfo === null || linkInfo === void 0 ? void 0 : linkInfo.kind) === 'remote') {
263
+ const parts = (0, timeline_asset_link_1.splitRemoteSourceForMiddleEllipsis)(linkInfo.href);
264
+ return {
265
+ children: (jsx_runtime_1.jsxs("span", { style: remoteSourcePartsContainer, children: [
266
+ jsx_runtime_1.jsx("span", { style: remoteSourceLeading, children: parts.leading }), jsx_runtime_1.jsx("span", { style: remoteSourceTrailing, children: parts.trailing })
267
+ ] })),
268
+ disabled: false,
269
+ onClick: null,
270
+ title: linkInfo.href,
271
+ };
272
+ }
273
+ return null;
274
+ }, [selectAsset]);
275
+ const sourceAction = (0, react_1.useMemo)(() => {
276
+ return mediaSrc ? getSourceAction(mediaSrc) : null;
277
+ }, [getSourceAction, mediaSrc]);
278
+ const assetSelectionContextValue = (0, react_1.useMemo)(() => ({
279
+ getSourceAction,
280
+ initialQuery: assetSelectionInitialQuery,
281
+ sourceAction,
282
+ }), [assetSelectionInitialQuery, getSourceAction, sourceAction]);
168
283
  const getIsExpanded = (0, react_1.useCallback)((candidate) => {
169
284
  return !collapsedKeys.has(getInspectorExpansionKey(candidate));
170
285
  }, [collapsedKeys]);
@@ -206,16 +321,106 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
206
321
  }),
207
322
  };
208
323
  }, [getIsExpanded, tree]);
209
- const controlSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(controlRows.filter(({ node }) => {
210
- var _a;
211
- return node.kind !== 'field' || ((_a = node.field) === null || _a === void 0 ? void 0 : _a.key) !== 'src';
212
- })), [controlRows]);
213
324
  const effectSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(effectRows), [effectRows]);
214
325
  const controlGroups = (0, react_1.useMemo)(() => getInspectorControlGroups(controlRows), [controlRows]);
326
+ const layoutGroup = controlGroups.find((group) => group.id === 'layout');
327
+ const controlGroupsWithoutLayout = controlGroups.filter((group) => group.id !== 'layout');
328
+ const sequencePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePathInfo.sequenceSubscriptionKey);
215
329
  const { schema } = sequence.controls;
330
+ const getControlGroupActivity = (0, react_1.useCallback)((group) => {
331
+ if (!(0, inspector_section_collapse_1.isSmartCollapsibleInspectorGroup)(group.id)) {
332
+ return 'active';
333
+ }
334
+ return (0, inspector_section_collapse_1.getInspectorSectionActivity)({
335
+ group: group.id,
336
+ propStatuses: sequencePropStatuses,
337
+ schema,
338
+ });
339
+ }, [schema, sequencePropStatuses]);
340
+ (0, react_1.useEffect)(() => {
341
+ setAutomaticSectionExpansion((previous) => {
342
+ let changed = false;
343
+ const next = { ...previous };
344
+ for (const group of controlGroups) {
345
+ if (!(0, inspector_section_collapse_1.isSmartCollapsibleInspectorGroup)(group.id)) {
346
+ continue;
347
+ }
348
+ const expansionKey = getInspectorSectionExpansionKey({
349
+ nodePathInfo,
350
+ groupId: group.id,
351
+ });
352
+ const activity = getControlGroupActivity(group);
353
+ if (activity === 'active' && next[expansionKey] !== true) {
354
+ next[expansionKey] = true;
355
+ changed = true;
356
+ }
357
+ else if (activity === 'inactive' &&
358
+ next[expansionKey] === undefined) {
359
+ next[expansionKey] = false;
360
+ changed = true;
361
+ }
362
+ }
363
+ return changed ? next : previous;
364
+ });
365
+ }, [controlGroups, getControlGroupActivity, nodePathInfo]);
366
+ const isControlGroupExpanded = (0, react_1.useCallback)((group) => {
367
+ if (!(0, inspector_section_collapse_1.isSmartCollapsibleInspectorGroup)(group.id)) {
368
+ return true;
369
+ }
370
+ const expansionKey = getInspectorSectionExpansionKey({
371
+ nodePathInfo,
372
+ groupId: group.id,
373
+ });
374
+ const override = sectionExpansionOverrides[expansionKey];
375
+ if (override !== undefined) {
376
+ return override;
377
+ }
378
+ const automaticExpansion = automaticSectionExpansion[expansionKey];
379
+ if (automaticExpansion !== undefined) {
380
+ return automaticExpansion;
381
+ }
382
+ return getControlGroupActivity(group) !== 'inactive';
383
+ }, [
384
+ automaticSectionExpansion,
385
+ getControlGroupActivity,
386
+ nodePathInfo,
387
+ sectionExpansionOverrides,
388
+ ]);
389
+ const toggleControlGroup = (0, react_1.useCallback)((group) => {
390
+ const expansionKey = getInspectorSectionExpansionKey({
391
+ nodePathInfo,
392
+ groupId: group.id,
393
+ });
394
+ const nextExpanded = !isControlGroupExpanded(group);
395
+ setSectionExpansionOverrides((previous) => {
396
+ const next = { ...previous, [expansionKey]: nextExpanded };
397
+ persistInspectorSectionExpansionOverrides(next);
398
+ return next;
399
+ });
400
+ }, [isControlGroupExpanded, nodePathInfo]);
401
+ const visibleControlRows = controlGroups.flatMap((group) => {
402
+ return isControlGroupExpanded(group) ? group.rows : [];
403
+ });
404
+ const controlSelectableItems = (0, react_1.useMemo)(() => (0, exports.getInspectorSelectableItems)(visibleControlRows.filter(({ node }) => {
405
+ var _a;
406
+ return node.kind !== 'field' || ((_a = node.field) === null || _a === void 0 ? void 0 : _a.key) !== 'src';
407
+ })), [visibleControlRows]);
408
+ const borderRadiusGroup = controlGroups.find((group) => group.id === 'border-radius');
409
+ const borderRadiusUsesShorthand = borderRadiusGroup === null || borderRadiusGroup === void 0 ? void 0 : borderRadiusGroup.rows.some(({ node }) => {
410
+ var _a;
411
+ return node.kind === 'field' && ((_a = node.field) === null || _a === void 0 ? void 0 : _a.key) === border_radius_representation_1.BORDER_RADIUS_SHORTHAND_KEY;
412
+ });
413
+ const borderRadiusConversion = (0, border_radius_representation_1.getBorderRadiusConversion)(sequencePropStatuses, getDragOverrides(nodePathInfo.sequenceSubscriptionKey));
414
+ const inlineCaptionValue = ((_a = schema.captions) === null || _a === void 0 ? void 0 : _a.type) === 'remotion-captions'
415
+ ? sequence.controls.currentRuntimeValueDotNotation.captions
416
+ : null;
417
+ const inlineCaptions = Array.isArray(inlineCaptionValue)
418
+ ? inlineCaptionValue
419
+ : null;
216
420
  const showEffectsSection = nodePathInfo.supportsEffects || effectRows.length > 0;
217
421
  const canAddEffect = nodePathInfo.supportsEffects &&
218
422
  previewServerState.type === 'connected' &&
423
+ (0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
219
424
  Boolean(validatedLocation.source);
220
425
  const onAddEffect = (0, react_1.useCallback)(() => {
221
426
  if (!canAddEffect || previewServerState.type !== 'connected') {
@@ -234,16 +439,65 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
234
439
  setSelectedModal,
235
440
  validatedLocation.source,
236
441
  ]);
442
+ const onConvertBorderRadius = (0, react_1.useCallback)(() => {
443
+ if (borderRadiusConversion === null ||
444
+ previewServerState.type !== 'connected') {
445
+ return;
446
+ }
447
+ const common = {
448
+ fileName: validatedLocation.source,
449
+ nodePath: nodePathInfo.sequenceSubscriptionKey,
450
+ defaultValue: null,
451
+ schema,
452
+ };
453
+ const changes = (0, border_radius_representation_1.getBorderRadiusConversionChanges)(borderRadiusConversion).map((change) => ({ ...common, ...change }));
454
+ (0, save_sequence_prop_1.saveSequenceProps)({
455
+ changes,
456
+ addedKeyframes: null,
457
+ movedKeyframes: null,
458
+ setPropStatuses,
459
+ clientId: previewServerState.clientId,
460
+ undoLabel: 'Change border radius representation',
461
+ redoLabel: 'Change border radius representation again',
462
+ });
463
+ }, [
464
+ borderRadiusConversion,
465
+ nodePathInfo.sequenceSubscriptionKey,
466
+ previewServerState,
467
+ schema,
468
+ setPropStatuses,
469
+ validatedLocation.source,
470
+ ]);
471
+ const borderRadiusAction = borderRadiusGroup ? (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: borderRadiusConversion === null ||
472
+ previewServerState.type !== 'connected', onClick: onConvertBorderRadius, title: borderRadiusConversion === null
473
+ ? borderRadiusUsesShorthand
474
+ ? 'A static border radius is required to use individual corners'
475
+ : 'All four corners must have the same static value'
476
+ : borderRadiusUsesShorthand
477
+ ? 'Use individual corner radii'
478
+ : 'Use one border radius value', renderAction: (color) => borderRadiusUsesShorthand ? (jsx_runtime_1.jsx(fullscreen_1.FullscreenIcon, { color: color, style: borderRadiusToggleIcon })) : (jsx_runtime_1.jsx(border_radius_1.BorderRadiusIcon, { color: color, style: borderRadiusToggleIcon })) })) : null;
237
479
  const effectsHeader = (jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
238
480
  jsx_runtime_1.jsx("div", { style: effectsHeaderTitle, children: "Effects" }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { disabled: !canAddEffect, onClick: onAddEffect, title: canAddEffect ? 'Add effect' : undefined, renderAction: (color) => jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: plusIcon }) })] }));
239
481
  const renderRow = ({ node, depth }) => {
240
482
  return (jsx_runtime_1.jsx(TimelineRowLayoutContext_1.TimelineRowLayoutContext.Provider, { value: TimelineRowLayoutContext_1.INSPECTOR_TIMELINE_ROW_LAYOUT, children: jsx_runtime_1.jsx(TimelineExpandedRow_1.TimelineExpandedRow, { node: node, depth: depth, nestedDepth: 0, rowDepthBase: 0, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack, validatedLocation: validatedLocation, nodePath: nodePathInfo.sequenceSubscriptionKey, schema: schema, keyframeDisplayOffset: keyframeDisplayOffset, keyframeControlsMode: "inspector" }) }, JSON.stringify(node.nodePathInfo)));
241
483
  };
242
- if (controlRows.length === 0 && !showEffectsSection) {
484
+ const renderControlGroupHeader = (group) => {
485
+ const collapsible = (0, inspector_section_collapse_1.isSmartCollapsibleInspectorGroup)(group.id);
486
+ const expanded = isControlGroupExpanded(group);
487
+ if (collapsible) {
488
+ return (jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader, { action: group.id === 'border-radius' && expanded ? borderRadiusAction : null, expanded: expanded, label: group.label, onToggle: () => toggleControlGroup(group) }));
489
+ }
490
+ return (jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderRow, children: jsx_runtime_1.jsx("div", { style: effectsHeaderTitle, children: group.label }) }));
491
+ };
492
+ if (controlRows.length === 0 &&
493
+ !showEffectsSection &&
494
+ inlineCaptions === null) {
243
495
  return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Controls", children: jsx_runtime_1.jsx("div", { style: emptyState, children: "No schema" }) }) }));
244
496
  }
245
- return (jsx_runtime_1.jsxs("div", { style: container, children: [controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group) => (jsx_runtime_1.jsxs(common_1.InspectorSection, { header: group.label, children: [group.id === 'source' && localAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: jumpToAsset, renderIcon: (color) => (jsx_runtime_1.jsx(AssetFileIcon_1.AssetFileIcon, { color: color, fileType: (0, get_preview_file_type_1.getPreviewFileType)(localAsset.assetPath), style: assetSelectorIcon })), size: "compact", title: localAsset.assetPath, children: localAssetFileName })) : null, group.id === 'source' && remoteAsset && remoteSourceParts ? (jsx_runtime_1.jsxs("div", { style: remoteSourceLabel, title: remoteAsset.href, children: [
246
- jsx_runtime_1.jsx("span", { style: remoteSourceLeading, children: remoteSourceParts.leading }), jsx_runtime_1.jsx("span", { style: remoteSourceTrailing, children: remoteSourceParts.trailing })
247
- ] })) : null, group.id === 'transforms' ? renderTransformControls() : null, group.id === 'source' ? null : group.rows.map(renderRow)] }, group.id))) })) : null, showEffectsSection ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: effectsHeader, children: effectRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) })) : null })) : null] }));
497
+ return (jsx_runtime_1.jsx(TimelineAssetField_1.AssetSelectionContext.Provider, { value: assetSelectionContextValue, children: jsx_runtime_1.jsxs("div", { style: container, children: [controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroupsWithoutLayout.map((group) => (jsx_runtime_1.jsx(common_1.InspectorSection, { header: renderControlGroupHeader(group), children: isControlGroupExpanded(group) ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [group.id === 'transforms'
498
+ ? renderTransformControls()
499
+ : null, group.rows.map(renderRow)] })) : null }, group.id))) })) : null, inlineCaptions ? (jsx_runtime_1.jsx(InlineCaptionInspector_1.InlineCaptionInspector, { captions: inlineCaptions, controls: sequence.controls, nodePath: nodePathInfo.sequenceSubscriptionKey, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation })) : null, showEffectsSection ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: effectsHeader, children: effectRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) })) : null })) : null, layoutGroup ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: jsx_runtime_1.jsx(common_1.InspectorSection, { header: renderControlGroupHeader(layoutGroup), children: isControlGroupExpanded(layoutGroup)
500
+ ? layoutGroup.rows.map(renderRow)
501
+ : null }) })) : null] }) }));
248
502
  };
249
503
  exports.InspectorSequenceSection = InspectorSequenceSection;
@@ -4,6 +4,7 @@ exports.KeyboardShortcutsExplainer = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
6
6
  const colors_1 = require("../helpers/colors");
7
+ const is_mac_1 = require("../helpers/is-mac");
7
8
  const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
8
9
  const use_keybinding_1 = require("../helpers/use-keybinding");
9
10
  const keys_1 = require("../icons/keys");
@@ -141,8 +142,9 @@ const KeyboardShortcutsExplainer = () => {
141
142
  ] }), jsx_runtime_1.jsx("div", { style: right, children: "Undo" })
142
143
  ] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
143
144
  jsx_runtime_1.jsxs("div", { style: left, children: [
144
- jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "Y" })
145
- ] }), jsx_runtime_1.jsx("div", { style: right, children: "Redo" })
145
+ jsx_runtime_1.jsx("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), is_mac_1.isMac ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
146
+ jsx_runtime_1.jsx("kbd", { style: key, children: "Shift" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.3 }), jsx_runtime_1.jsx("kbd", { style: key, children: "Z" })
147
+ ] })) : (jsx_runtime_1.jsx("kbd", { style: key, children: "Y" }))] }), jsx_runtime_1.jsx("div", { style: right, children: "Redo" })
146
148
  ] }), jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx("div", { style: title, children: "Interactivity" }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
147
149
  jsx_runtime_1.jsx("div", { style: left, children: jsx_runtime_1.jsx("kbd", { style: key, children: "Shift" }) }), jsx_runtime_1.jsx("div", { style: right, children: "Select range / axis lock drag" })
148
150
  ] }), jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
@@ -16,7 +16,7 @@ const portals_1 = require("./portals");
16
16
  const styles_1 = require("./styles");
17
17
  const container = {
18
18
  fontSize: 13,
19
- color: colors_1.WHITE,
19
+ color: colors_1.WHITE_ALPHA_80,
20
20
  paddingLeft: 10,
21
21
  paddingRight: 10,
22
22
  cursor: 'default',
@@ -37,6 +37,7 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
37
37
  const containerStyle = (0, react_1.useMemo)(() => {
38
38
  return {
39
39
  ...container,
40
+ color: hovered || selected ? colors_1.WHITE : colors_1.WHITE_ALPHA_80,
40
41
  backgroundColor: (0, colors_1.getBackgroundFromHoverState)({
41
42
  hovered,
42
43
  selected,
@@ -6,8 +6,10 @@ const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const client_id_1 = require("../helpers/client-id");
8
8
  const colors_1 = require("../helpers/colors");
9
+ const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
9
10
  const open_in_editor_1 = require("../helpers/open-in-editor");
10
11
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
12
+ const actions_1 = require("./RenderQueue/actions");
11
13
  const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
12
14
  const baseStyle = {
13
15
  color: 'inherit',
@@ -35,7 +37,7 @@ const slashStyle = {
35
37
  top: 1,
36
38
  };
37
39
  const MenuCompositionName = () => {
38
- var _a;
40
+ var _a, _b;
39
41
  const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
40
42
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
41
43
  .previewServerState.type;
@@ -48,17 +50,30 @@ const MenuCompositionName = () => {
48
50
  }
49
51
  return ((_a = compositions.find((c) => c.id === canvasContent.compositionId)) !== null && _a !== void 0 ? _a : null);
50
52
  }, [canvasContent, compositions]);
53
+ const asset = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' ? canvasContent.asset : null;
51
54
  const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)((_a = composition === null || composition === void 0 ? void 0 : composition.stack) !== null && _a !== void 0 ? _a : null);
52
- const canOpen = resolvedLocation &&
55
+ const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
56
+ const canOpenComposition = resolvedLocation &&
53
57
  window.remotion_editorName &&
54
58
  connectionStatus === 'connected';
59
+ const canOpenAsset = asset !== null &&
60
+ window.remotion_publicFolderExists !== null &&
61
+ connectionStatus === 'connected';
62
+ const canOpen = canOpenComposition || canOpenAsset;
55
63
  const handleClick = (0, react_1.useCallback)(async () => {
56
- if (!canOpen || !resolvedLocation) {
64
+ if (!canOpen || opening) {
57
65
  return;
58
66
  }
59
67
  setOpening(true);
60
68
  try {
61
- await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation);
69
+ if (asset !== null && window.remotion_publicFolderExists !== null) {
70
+ await (0, actions_1.openInFileExplorer)({
71
+ directory: `${window.remotion_publicFolderExists}/${asset}`,
72
+ });
73
+ }
74
+ else if (resolvedLocation) {
75
+ await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation);
76
+ }
62
77
  }
63
78
  catch (err) {
64
79
  (0, NotificationCenter_1.showNotification)(err.message, 2000);
@@ -66,16 +81,24 @@ const MenuCompositionName = () => {
66
81
  finally {
67
82
  setOpening(false);
68
83
  }
69
- }, [canOpen, resolvedLocation]);
70
- if (!composition) {
84
+ }, [asset, canOpen, opening, resolvedLocation]);
85
+ if (!composition && asset === null) {
71
86
  return null;
72
87
  }
88
+ const name = (_b = composition === null || composition === void 0 ? void 0 : composition.id) !== null && _b !== void 0 ? _b : asset;
89
+ const title = composition
90
+ ? canOpenComposition
91
+ ? `Open in ${window.remotion_editorName}`
92
+ : composition.id
93
+ : canOpenAsset
94
+ ? `Show in ${fileManagerName}`
95
+ : (asset !== null && asset !== void 0 ? asset : undefined);
73
96
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
74
97
  jsx_runtime_1.jsx("span", { style: slashStyle, children: "/" }), jsx_runtime_1.jsx("a", { style: canOpen && !opening
75
98
  ? hovered
76
99
  ? clickableHoveredStyle
77
100
  : clickableStyle
78
- : compositionNameStyle, title: canOpen ? `Open in ${window.remotion_editorName}` : composition.id, onClick: handleClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: composition.id })
101
+ : compositionNameStyle, title: title, onClick: handleClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: name })
79
102
  ] }));
80
103
  };
81
104
  exports.MenuCompositionName = MenuCompositionName;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- export declare const MENU_TOOLBAR_HEIGHT = 30;
3
2
  export declare const MenuToolbar: React.FC<{
4
3
  readonly readOnlyStudio: boolean;
5
4
  }>;
@@ -1,18 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MenuToolbar = exports.MENU_TOOLBAR_HEIGHT = void 0;
3
+ exports.MenuToolbar = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
7
+ const client_id_1 = require("../helpers/client-id");
6
8
  const colors_1 = require("../helpers/colors");
7
9
  const mobile_layout_1 = require("../helpers/mobile-layout");
8
10
  const use_menu_structure_1 = require("../helpers/use-menu-structure");
9
11
  const layout_1 = require("./layout");
12
+ const menu_toolbar_height_1 = require("./menu-toolbar-height");
10
13
  const MenuItem_1 = require("./Menu/MenuItem");
11
14
  const MenuBuildIndicator_1 = require("./MenuBuildIndicator");
12
15
  const SidebarCollapserControls_1 = require("./SidebarCollapserControls");
13
16
  const UndoRedoButtons_1 = require("./UndoRedoButtons");
14
17
  const UpdateCheck_1 = require("./UpdateCheck");
15
- exports.MENU_TOOLBAR_HEIGHT = 30;
16
18
  const row = {
17
19
  alignItems: 'center',
18
20
  flexDirection: 'row',
@@ -21,9 +23,9 @@ const row = {
21
23
  borderBottom: colors_1.BORDER_BLACK,
22
24
  boxSizing: 'border-box',
23
25
  fontSize: 13,
24
- height: exports.MENU_TOOLBAR_HEIGHT,
26
+ height: menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT,
25
27
  paddingLeft: 6,
26
- paddingRight: 10,
28
+ paddingRight: 6,
27
29
  backgroundColor: colors_1.BACKGROUND,
28
30
  };
29
31
  const flex = {
@@ -31,6 +33,11 @@ const flex = {
31
33
  };
32
34
  const MenuToolbar = ({ readOnlyStudio }) => {
33
35
  const [selected, setSelected] = (0, react_1.useState)(null);
36
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
37
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
38
+ const canUndoAndRedo = !readOnlyStudio ||
39
+ (previewServerState.type === 'connected' &&
40
+ browserStudioOperations !== null);
34
41
  const mobileLayout = (0, mobile_layout_1.useMobileLayout)();
35
42
  const fixedWidthRight = (0, react_1.useMemo)(() => {
36
43
  return {
@@ -98,10 +105,11 @@ const MenuToolbar = ({ readOnlyStudio }) => {
98
105
  e.stopPropagation();
99
106
  }, []);
100
107
  return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", className: "css-reset", style: row, onPointerDown: onPointerDown, children: [
101
- jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [structure.map((s) => {
108
+ jsx_runtime_1.jsxs("div", { style: fixedWidthLeft, children: [
109
+ jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "left" }), structure.map((s) => {
102
110
  return (jsx_runtime_1.jsx(MenuItem_1.MenuItem, { selected: selected === s.id, onItemSelected: itemClicked, onItemHovered: itemHovered, id: s.id, label: s.label, onItemQuit: onItemQuit, menu: s, onPreviousMenu: onPreviousMenu, onNextMenu: onNextMenu, leaveLeftPadding: s.leaveLeftPadding }, s.id));
103
- }), readOnlyStudio ? null : jsx_runtime_1.jsx(UpdateCheck_1.UpdateCheck, {})] }), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsx(MenuBuildIndicator_1.MenuBuildIndicator, {}), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsxs("div", { style: fixedWidthRight, children: [readOnlyStudio ? null : jsx_runtime_1.jsx(UndoRedoButtons_1.UndoRedoButtons, {}), jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControls, {})
104
- ] }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 })
111
+ }), readOnlyStudio ? null : jsx_runtime_1.jsx(UpdateCheck_1.UpdateCheck, {})] }), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsx(MenuBuildIndicator_1.MenuBuildIndicator, {}), jsx_runtime_1.jsx("div", { style: flex }), jsx_runtime_1.jsxs("div", { style: fixedWidthRight, children: [canUndoAndRedo ? jsx_runtime_1.jsx(UndoRedoButtons_1.UndoRedoButtons, {}) : null, jsx_runtime_1.jsx(SidebarCollapserControls_1.SidebarCollapserControl, { side: "right" })
112
+ ] })
105
113
  ] }));
106
114
  };
107
115
  exports.MenuToolbar = MenuToolbar;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- export default function MobilePanel({ children, onClose }: {
2
+ export default function MobilePanel({ children, onClose, side }: {
3
3
  children: React.ReactNode;
4
4
  onClose: () => void;
5
+ side: 'left' | 'right';
5
6
  }): React.ReactPortal;