@remotion/studio 4.0.515 → 4.0.516

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 (196) hide show
  1. package/dist/api/restart-studio.js +4 -0
  2. package/dist/components/AssetSelector.js +3 -9
  3. package/dist/components/AssetSelectorItem.d.ts +2 -1
  4. package/dist/components/AssetSelectorItem.js +24 -29
  5. package/dist/components/Canvas.js +7 -4
  6. package/dist/components/CaptionInspector.d.ts +2 -0
  7. package/dist/components/CaptionInspector.js +3 -5
  8. package/dist/components/CompositionSelector.js +6 -3
  9. package/dist/components/CompositionSelectorItem.js +9 -10
  10. package/dist/components/ConfigSelect.d.ts +17 -0
  11. package/dist/components/ConfigSelect.js +50 -0
  12. package/dist/components/CurrentAsset.d.ts +10 -2
  13. package/dist/components/CurrentAsset.js +139 -46
  14. package/dist/components/FixComputedValueModal.js +54 -51
  15. package/dist/components/GlobalKeybindings.js +5 -5
  16. package/dist/components/InlineAction.d.ts +1 -1
  17. package/dist/components/InlineAction.js +12 -2
  18. package/dist/components/InlineCaptionInspector.d.ts +2 -0
  19. package/dist/components/InlineCaptionInspector.js +2 -2
  20. package/dist/components/InlineCompositionName.js +1 -1
  21. package/dist/components/InlineEditableTitle.js +3 -2
  22. package/dist/components/InspectorInfoHeader.js +1 -1
  23. package/dist/components/InspectorOpenInEditor.js +48 -72
  24. package/dist/components/InspectorPanel/AlignmentControls.js +2 -3
  25. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +7 -0
  26. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +39 -0
  27. package/dist/components/InspectorPanel/CompositionInspector.js +14 -7
  28. package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +10 -4
  29. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +2 -1
  30. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -4
  31. package/dist/components/InspectorPanel/common.d.ts +0 -12
  32. package/dist/components/InspectorPanel/common.js +3 -52
  33. package/dist/components/InspectorPanel/use-composition-actions.js +0 -1
  34. package/dist/components/InspectorPanelLayout.d.ts +1 -1
  35. package/dist/components/InspectorPanelLayout.js +1 -1
  36. package/dist/components/InspectorSequenceSection.js +40 -54
  37. package/dist/components/InstallPackage.d.ts +2 -1
  38. package/dist/components/InstallPackage.js +60 -30
  39. package/dist/components/InstallablePackage.js +37 -11
  40. package/dist/components/KeyboardShortcutsSettings.d.ts +2 -0
  41. package/dist/components/KeyboardShortcutsSettings.js +177 -0
  42. package/dist/components/MenuBuildIndicator.js +1 -1
  43. package/dist/components/Modals.js +6 -5
  44. package/dist/components/NewComposition/CodemodFooter.d.ts +0 -1
  45. package/dist/components/NewComposition/CodemodFooter.js +2 -8
  46. package/dist/components/NewComposition/DeleteComposition.js +1 -1
  47. package/dist/components/NewComposition/DeleteFolder.js +1 -1
  48. package/dist/components/NewComposition/DuplicateComposition.js +1 -1
  49. package/dist/components/NewComposition/InputDragger.js +27 -4
  50. package/dist/components/NewComposition/NewComposition.js +1 -1
  51. package/dist/components/NewComposition/NewFolder.js +1 -3
  52. package/dist/components/NewComposition/RenameComposition.js +1 -1
  53. package/dist/components/NewComposition/RenameFolder.js +1 -1
  54. package/dist/components/NewComposition/use-rename-static-file.js +1 -1
  55. package/dist/components/Notifications/NotificationCenter.d.ts +1 -0
  56. package/dist/components/Notifications/NotificationCenter.js +5 -0
  57. package/dist/components/OptionsPanel.js +9 -12
  58. package/dist/components/PreviewToolbar.js +5 -2
  59. package/dist/components/PreviewToolbarOverflowButton.js +30 -0
  60. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -2
  61. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +14 -30
  62. package/dist/components/RenderButton.js +66 -183
  63. package/dist/components/RenderModal/DataEditor.js +15 -12
  64. package/dist/components/RenderModal/RenderStatusModal.js +0 -1
  65. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +3 -1
  66. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.d.ts +15 -0
  67. package/dist/components/RenderModal/SchemaEditor/infer-zod-schema-from-value.js +95 -0
  68. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -6
  69. package/dist/components/RenderingSettings.js +7 -4
  70. package/dist/components/RulersAndGuidesToggle.d.ts +2 -0
  71. package/dist/components/RulersAndGuidesToggle.js +23 -0
  72. package/dist/components/SegmentedButton.d.ts +29 -0
  73. package/dist/components/SegmentedButton.js +226 -0
  74. package/dist/components/SelectedOutlineEditingHandles.d.ts +16 -0
  75. package/dist/components/SelectedOutlineEditingHandles.js +66 -0
  76. package/dist/components/SelectedOutlineElement.d.ts +2 -4
  77. package/dist/components/SelectedOutlineElement.js +15 -54
  78. package/dist/components/SelectedOutlineOverlay.js +32 -6
  79. package/dist/components/SelectedOutlinePolygon.d.ts +3 -4
  80. package/dist/components/SelectedOutlinePolygon.js +18 -16
  81. package/dist/components/SelectedOutlineRenderer.js +66 -14
  82. package/dist/components/SettingsModal.d.ts +1 -1
  83. package/dist/components/SettingsModal.js +30 -7
  84. package/dist/components/SettingsModalFooter.js +2 -1
  85. package/dist/components/SkillsSettings.d.ts +2 -0
  86. package/dist/components/SkillsSettings.js +129 -0
  87. package/dist/components/StaticFilePreview.js +7 -1
  88. package/dist/components/StudioSettings.js +7 -48
  89. package/dist/components/Tabs/index.js +1 -1
  90. package/dist/components/Timeline/Timeline.js +0 -1
  91. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  92. package/dist/components/Timeline/TimelineAssetField.js +15 -9
  93. package/dist/components/Timeline/TimelineBooleanField.js +1 -4
  94. package/dist/components/Timeline/TimelineClipboardKeybindings.js +7 -10
  95. package/dist/components/Timeline/TimelineEffectItem.d.ts +1 -0
  96. package/dist/components/Timeline/TimelineEffectItem.js +23 -10
  97. package/dist/components/Timeline/TimelineEffectPropItem.js +15 -2
  98. package/dist/components/Timeline/TimelineExpandedRow.js +5 -4
  99. package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
  100. package/dist/components/Timeline/TimelineFieldRowContent.d.ts +1 -2
  101. package/dist/components/Timeline/TimelineFieldRowContent.js +8 -21
  102. package/dist/components/Timeline/TimelineImageInfo.d.ts +0 -1
  103. package/dist/components/Timeline/TimelineImageInfo.js +13 -32
  104. package/dist/components/Timeline/TimelineKeyframeControls.js +10 -4
  105. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +1 -1
  106. package/dist/components/Timeline/TimelineRotationField.js +0 -2
  107. package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -1
  108. package/dist/components/Timeline/TimelineRowChrome.js +3 -4
  109. package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +0 -1
  110. package/dist/components/Timeline/TimelineRowLayoutContext.js +1 -4
  111. package/dist/components/Timeline/TimelineScaleField.js +2 -6
  112. package/dist/components/Timeline/TimelineSchemaField.js +9 -3
  113. package/dist/components/Timeline/TimelineSelection.js +1 -1
  114. package/dist/components/Timeline/TimelineSequence.d.ts +2 -0
  115. package/dist/components/Timeline/TimelineSequence.js +110 -19
  116. package/dist/components/Timeline/TimelineSequenceItem.js +5 -5
  117. package/dist/components/Timeline/TimelineSequencePropItem.js +15 -2
  118. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +4 -2
  119. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +85 -91
  120. package/dist/components/Timeline/TimelineTrack.js +1 -1
  121. package/dist/components/Timeline/TimelineTransformOriginField.js +0 -4
  122. package/dist/components/Timeline/TimelineTranslateField.js +0 -4
  123. package/dist/components/Timeline/TimelineVirtualization.js +3 -1
  124. package/dist/components/Timeline/duplicate-selected-timeline-item.js +3 -12
  125. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.d.ts +4 -0
  126. package/dist/components/Timeline/get-copy-context-for-agents-menu-item.js +26 -0
  127. package/dist/components/Timeline/get-sequence-context-menu-items.js +2 -19
  128. package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +6 -1
  129. package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +11 -4
  130. package/dist/components/Timeline/split-selected-timeline-item.js +0 -1
  131. package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
  132. package/dist/components/Timeline/timeline-field-row-layout.js +4 -7
  133. package/dist/components/Timeline/timeline-field-utils.js +0 -2
  134. package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
  135. package/dist/components/TimelineCombobox.js +25 -160
  136. package/dist/components/TimelineInOutToggle.js +4 -1
  137. package/dist/components/duplicate-jsx-node-api.d.ts +2 -0
  138. package/dist/components/duplicate-jsx-node-api.js +12 -0
  139. package/dist/components/effect-drag-and-drop.js +1 -4
  140. package/dist/components/handle-drop.d.ts +2 -1
  141. package/dist/components/handle-drop.js +3 -3
  142. package/dist/components/import-assets.js +9 -65
  143. package/dist/components/keyboard-shortcuts.d.ts +10 -0
  144. package/dist/components/keyboard-shortcuts.js +135 -0
  145. package/dist/components/selected-outline-control-layout.js +2 -6
  146. package/dist/components/selected-outline-measurement.d.ts +1 -1
  147. package/dist/components/selected-outline-measurement.js +16 -3
  148. package/dist/components/use-delete-asset.d.ts +1 -0
  149. package/dist/components/use-delete-asset.js +40 -0
  150. package/dist/components/use-selected-outline-control-target.d.ts +11 -0
  151. package/dist/components/use-selected-outline-control-target.js +79 -0
  152. package/dist/esm/{chunk-s6k99gh2.js → chunk-4bxz1d3g.js} +3 -2
  153. package/dist/esm/{chunk-v5a8vpv4.js → chunk-w4244j4n.js} +17766 -17618
  154. package/dist/esm/index.mjs +3 -0
  155. package/dist/esm/internals.mjs +17765 -17617
  156. package/dist/esm/previewEntry.mjs +17570 -17422
  157. package/dist/esm/renderEntry.mjs +2 -2
  158. package/dist/helpers/add-asset-cache-bust.d.ts +4 -0
  159. package/dist/helpers/add-asset-cache-bust.js +10 -0
  160. package/dist/helpers/calculate-timeline.js +2 -1
  161. package/dist/helpers/colors.d.ts +2 -0
  162. package/dist/helpers/colors.js +6 -2
  163. package/dist/helpers/drag-aware-double-click.d.ts +6 -0
  164. package/dist/helpers/drag-aware-double-click.js +20 -0
  165. package/dist/helpers/get-asset-metadata.js +25 -16
  166. package/dist/helpers/get-sequence-double-click-action.d.ts +2 -1
  167. package/dist/helpers/get-sequence-double-click-action.js +7 -1
  168. package/dist/helpers/get-timeline-sequence-layout.d.ts +4 -1
  169. package/dist/helpers/get-timeline-sequence-layout.js +15 -6
  170. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
  171. package/dist/helpers/hoverable.d.ts +1 -0
  172. package/dist/helpers/hoverable.js +2 -1
  173. package/dist/helpers/inject-css.js +3 -1
  174. package/dist/helpers/open-in-remotion-convert.d.ts +7 -0
  175. package/dist/helpers/open-in-remotion-convert.js +18 -0
  176. package/dist/helpers/use-media-metadata.d.ts +2 -1
  177. package/dist/helpers/use-media-metadata.js +12 -5
  178. package/dist/helpers/use-menu-structure.js +32 -32
  179. package/dist/icons/align-center-horizontal.js +1 -1
  180. package/dist/icons/align-left.js +1 -1
  181. package/dist/icons/align-right.js +1 -1
  182. package/dist/icons/keyboard.d.ts +4 -0
  183. package/dist/icons/keyboard.js +10 -0
  184. package/dist/icons/license.d.ts +4 -0
  185. package/dist/icons/license.js +8 -0
  186. package/dist/icons/package.d.ts +4 -0
  187. package/dist/icons/package.js +8 -0
  188. package/dist/icons/react.js +1 -1
  189. package/dist/icons/remotion-convert.d.ts +4 -0
  190. package/dist/icons/remotion-convert.js +10 -0
  191. package/dist/icons/skills.d.ts +4 -0
  192. package/dist/icons/skills.js +10 -0
  193. package/dist/state/modals.d.ts +2 -5
  194. package/package.json +12 -12
  195. package/dist/components/KeyboardShortcutsExplainer.d.ts +0 -2
  196. package/dist/components/KeyboardShortcutsExplainer.js +0 -194
@@ -7,10 +7,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.restartStudio = void 0;
8
8
  const remotion_1 = require("remotion");
9
9
  const call_api_1 = require("../components/call-api");
10
+ const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
10
11
  const restartStudio = () => {
11
12
  if (!(0, remotion_1.getRemotionEnvironment)().isStudio) {
12
13
  throw new Error('restartStudio() is only available in the Studio');
13
14
  }
15
+ if ((0, browser_studio_operations_1.getBrowserStudioOperations)() !== null) {
16
+ throw new Error('restartStudio() is not supported in Browser Studio');
17
+ }
14
18
  if (window.remotion_isReadOnlyStudio) {
15
19
  throw new Error('restartStudio() is not available in read-only Studio');
16
20
  }
@@ -135,9 +135,9 @@ const AssetSelector = ({ readOnlyStudio }) => {
135
135
  outputPath: renderOutput.outputPath,
136
136
  assetPath: destination,
137
137
  });
138
- (0, NotificationCenter_1.showNotification)(result.created
139
- ? `Created ${destination}`
140
- : `${destination} already exists`, 3000);
138
+ if (!result.created) {
139
+ (0, NotificationCenter_1.showNotification)(`${destination} already exists`, 3000);
140
+ }
141
141
  return;
142
142
  }
143
143
  const { files } = e.dataTransfer;
@@ -164,12 +164,6 @@ const AssetSelector = ({ readOnlyStudio }) => {
164
164
  filePath: makePath(file),
165
165
  });
166
166
  }
167
- if (files.length === 1) {
168
- (0, NotificationCenter_1.showNotification)(`Created ${makePath(files[0])}`, 3000);
169
- }
170
- else {
171
- (0, NotificationCenter_1.showNotification)(`Added ${files.length} files to ${assetPath}`, 3000);
172
- }
173
167
  }
174
168
  catch (error) {
175
169
  (0, NotificationCenter_1.showNotification)(`Error during upload: ${error}`, 3000);
@@ -14,11 +14,12 @@ export declare const getCanDragAsset: ({ readOnlyStudio, relativePath, }: {
14
14
  readOnlyStudio: boolean;
15
15
  relativePath: string;
16
16
  }) => boolean;
17
- export declare const getAssetContextMenuItems: ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }: {
17
+ export declare const getAssetContextMenuItems: ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInConvert, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }: {
18
18
  relativePath: string;
19
19
  fileManagerName: string;
20
20
  copyFileName: () => void;
21
21
  copyStaticFilePath: () => void;
22
+ openAssetInConvert: () => void;
22
23
  openAssetInExplorer: () => void;
23
24
  renameAsset: () => void;
24
25
  deleteAsset: () => void;
@@ -39,13 +39,13 @@ const studio_protocol_1 = require("@remotion/studio-protocol");
39
39
  const react_1 = require("react");
40
40
  const remotion_1 = require("remotion");
41
41
  const no_react_1 = require("remotion/no-react");
42
- const delete_static_file_1 = require("../api/delete-static-file");
43
42
  const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
44
43
  const client_id_1 = require("../helpers/client-id");
45
44
  const colors_1 = require("../helpers/colors");
46
45
  const copy_text_1 = require("../helpers/copy-text");
47
46
  const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
48
47
  const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
48
+ const open_in_remotion_convert_1 = require("../helpers/open-in-remotion-convert");
49
49
  const sidebar_scroll_into_view_1 = require("../helpers/sidebar-scroll-into-view");
50
50
  const url_state_1 = require("../helpers/url-state");
51
51
  const use_asset_drag_events_1 = __importStar(require("../helpers/use-asset-drag-events"));
@@ -55,15 +55,14 @@ const clipboard_1 = require("../icons/clipboard");
55
55
  const folder_1 = require("../icons/folder");
56
56
  const modals_1 = require("../state/modals");
57
57
  const AssetFileIcon_1 = require("./AssetFileIcon");
58
- const ConfirmationDialog_1 = require("./ConfirmationDialog");
59
58
  const ContextMenu_1 = require("./ContextMenu");
60
59
  const import_assets_1 = require("./import-assets");
61
60
  const InlineAction_1 = require("./InlineAction");
62
61
  const layout_1 = require("./layout");
63
- const styles_1 = require("./Menu/styles");
64
62
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
65
63
  const open_in_new_window_1 = require("./open-in-new-window");
66
64
  const actions_1 = require("./RenderQueue/actions");
65
+ const use_delete_asset_1 = require("./use-delete-asset");
67
66
  const iconStyle = {
68
67
  width: 18,
69
68
  height: 18,
@@ -117,9 +116,24 @@ const getCanDragAsset = ({ readOnlyStudio, relativePath, }) => {
117
116
  return !readOnlyStudio && (0, import_assets_1.getAssetElementFromPath)(relativePath) !== null;
118
117
  };
119
118
  exports.getCanDragAsset = getCanDragAsset;
120
- const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }) => {
119
+ const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInConvert, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }) => {
120
+ const previewFileType = (0, get_preview_file_type_1.getPreviewFileType)(relativePath);
121
+ const canOpenInConvert = previewFileType === 'audio' || previewFileType === 'video';
121
122
  const items = [
122
123
  (0, open_in_new_window_1.getOpenInNewWindowMenuItem)(`/assets/${relativePath}`),
124
+ canOpenInConvert
125
+ ? {
126
+ id: 'open-asset-in-convert',
127
+ keyHint: null,
128
+ label: 'Open in Remotion Convert',
129
+ leftItem: null,
130
+ onClick: openAssetInConvert,
131
+ quickSwitcherLabel: 'Open asset in Remotion Convert',
132
+ subMenu: null,
133
+ type: 'item',
134
+ value: 'open-asset-in-convert',
135
+ }
136
+ : null,
123
137
  {
124
138
  type: 'divider',
125
139
  id: 'open-in-new-window-divider',
@@ -263,7 +277,6 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
263
277
  const [hovered, setHovered] = (0, react_1.useState)(false);
264
278
  const [isDragging, setIsDragging] = (0, react_1.useState)(false);
265
279
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
266
- const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
267
280
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
268
281
  .previewServerState.type;
269
282
  const onPointerEnter = (0, react_1.useCallback)(() => {
@@ -379,6 +392,9 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
379
392
  (0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
380
393
  });
381
394
  }, [relativePath]);
395
+ const openAssetInConvert = (0, react_1.useCallback)(() => {
396
+ (0, open_in_remotion_convert_1.openInRemotionConvert)({ relativePath });
397
+ }, [relativePath]);
382
398
  const openAssetInExplorer = (0, react_1.useCallback)(() => {
383
399
  if (!window.remotion_publicFolderExists) {
384
400
  (0, NotificationCenter_1.showNotification)('Could not find the public folder', 2000);
@@ -396,30 +412,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
396
412
  connectionStatus,
397
413
  publicFolderExists: window.remotion_publicFolderExists,
398
414
  });
399
- const deleteAsset = (0, react_1.useCallback)(() => {
400
- confirm({
401
- title: 'Delete asset',
402
- message: (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Do you want to delete the asset", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: relativePath }),
403
- " from your public folder?"] })),
404
- confirmLabel: 'Delete',
405
- })
406
- .then((confirmed) => {
407
- if (!confirmed) {
408
- return;
409
- }
410
- const notification = (0, NotificationCenter_1.showNotification)(`Deleting ${relativePath}...`, null);
411
- (0, delete_static_file_1.deleteStaticFile)(relativePath)
412
- .then(() => {
413
- notification.replaceContent(`Deleted ${relativePath}`, 2000);
414
- })
415
- .catch((err) => {
416
- notification.replaceContent(`Could not delete ${relativePath}: ${err.message}`, 3000);
417
- });
418
- })
419
- .catch((err) => {
420
- (0, NotificationCenter_1.showNotification)(`Could not delete ${relativePath}: ${err.message}`, 3000);
421
- });
422
- }, [confirm, relativePath]);
415
+ const deleteAsset = (0, use_delete_asset_1.useDeleteAsset)(relativePath);
423
416
  const renameAsset = (0, react_1.useCallback)(() => {
424
417
  setSelectedModal({
425
418
  type: 'rename-static-file',
@@ -432,6 +425,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
432
425
  fileManagerName,
433
426
  copyFileName,
434
427
  copyStaticFilePath,
428
+ openAssetInConvert,
435
429
  openAssetInExplorer,
436
430
  renameAsset,
437
431
  deleteAsset,
@@ -446,6 +440,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
446
440
  fileExplorerDisabled,
447
441
  fileManagerName,
448
442
  mutationsDisabled,
443
+ openAssetInConvert,
449
444
  openAssetInExplorer,
450
445
  renameAsset,
451
446
  relativePath,
@@ -846,14 +846,16 @@ const Canvas = ({ canvasContent, size }) => {
846
846
  if (!(0, drop_handler_data_1.isSupportedDropEvent)(event) || !isDragEventInsideCanvas(event)) {
847
847
  return;
848
848
  }
849
- if ((0, drop_handler_data_1.isFileDragEvent)(event) && !window.remotion_isReadOnlyStudio) {
849
+ const localFiles = (0, drop_handler_data_1.isFileDragEvent)(event)
850
+ ? Array.from((_c = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _c !== void 0 ? _c : [])
851
+ : null;
852
+ if (localFiles !== null && !window.remotion_isReadOnlyStudio) {
850
853
  event.preventDefault();
851
854
  event.stopPropagation();
852
- const files = Array.from((_c = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _c !== void 0 ? _c : []);
853
- if (files.length === 1) {
855
+ if (localFiles.length === 1) {
854
856
  setIsAddingAsset(true);
855
857
  try {
856
- const canvasCapture = await (0, get_canvas_capture_import_1.getCanvasCaptureImport)(files[0]);
858
+ const canvasCapture = await (0, get_canvas_capture_import_1.getCanvasCaptureImport)(localFiles[0]);
857
859
  if (canvasCapture !== null) {
858
860
  setSelectedModal({
859
861
  type: 'new-comp',
@@ -936,6 +938,7 @@ const Canvas = ({ canvasContent, size }) => {
936
938
  event,
937
939
  fps: config.fps,
938
940
  from: (0, imperative_state_1.getCurrentFrame)(),
941
+ localFiles,
939
942
  preferCompositionStart: true,
940
943
  });
941
944
  }
@@ -2,9 +2,11 @@ import type { Caption } from '@remotion/captions';
2
2
  import React from 'react';
3
3
  export declare const CaptionInspector: React.FC<{
4
4
  readonly captions: Caption[];
5
+ readonly expanded: boolean;
5
6
  readonly onTextChange: (captions: Caption[]) => void;
6
7
  readonly onTextSave: ((captions: Caption[]) => void) | null;
7
8
  readonly onTextCancel: (() => void) | null;
9
+ readonly onToggle: () => void;
8
10
  readonly readOnly: boolean;
9
11
  readonly readOnlyTitle: string | null;
10
12
  }>;
@@ -4,6 +4,7 @@ exports.CaptionInspector = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const colors_1 = require("../helpers/colors");
6
6
  const CaptionTextEditor_1 = require("./CaptionTextEditor");
7
+ const CollapsibleInspectorSectionHeader_1 = require("./InspectorPanel/CollapsibleInspectorSectionHeader");
7
8
  const common_1 = require("./InspectorPanel/common");
8
9
  const styles_1 = require("./InspectorPanel/styles");
9
10
  const readOnlyStatus = {
@@ -14,11 +15,8 @@ const readOnlyStatus = {
14
15
  lineHeight: '16px',
15
16
  marginLeft: 12,
16
17
  };
17
- const CaptionInspector = ({ captions, onTextChange, onTextSave, onTextCancel, readOnly, readOnlyTitle, }) => {
18
+ const CaptionInspector = ({ captions, expanded, onTextChange, onTextSave, onTextCancel, onToggle, readOnly, readOnlyTitle, }) => {
18
19
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
19
- jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsxs("div", { style: styles_1.sectionHeaderRow, children: [
20
- jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderTitle, children: "Captions" }), jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null })
21
- ] }) }), jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })
22
- ] }));
20
+ jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null }), expanded: expanded, label: "Captions", onToggle: onToggle }) }), expanded ? (jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })) : null] }));
23
21
  };
24
22
  exports.CaptionInspector = CaptionInspector;
@@ -227,9 +227,12 @@ const CompositionSelector = () => {
227
227
  signal: controller.signal,
228
228
  symbolicatedStack: (0, studio_shared_1.compositionDragDataToSymbolicatedStack)(compositionDragData),
229
229
  });
230
- notification.replaceContent(result.success
231
- ? `Moved ${compositionDragData.compositionId} outside of folder`
232
- : result.reason, result.success ? 2000 : 4000);
230
+ if (result.success) {
231
+ notification.dismiss();
232
+ }
233
+ else {
234
+ notification.replaceContent(result.reason, 4000);
235
+ }
233
236
  }
234
237
  catch (err) {
235
238
  notification.replaceContent(err instanceof Error ? err.message : String(err), 4000);
@@ -7,7 +7,6 @@ const studio_shared_1 = require("@remotion/studio-shared");
7
7
  const react_1 = require("react");
8
8
  const client_id_1 = require("../helpers/client-id");
9
9
  const colors_1 = require("../helpers/colors");
10
- const get_folder_id_1 = require("../helpers/get-folder-id");
11
10
  const noop_1 = require("../helpers/noop");
12
11
  const sidebar_scroll_into_view_1 = require("../helpers/sidebar-scroll-into-view");
13
12
  const folder_1 = require("../icons/folder");
@@ -33,11 +32,12 @@ const itemStyle = {
33
32
  cursor: 'default',
34
33
  alignItems: 'center',
35
34
  marginBottom: 1,
36
- marginLeft: 4,
35
+ marginLeft: 8,
36
+ marginRight: 4,
37
37
  appearance: 'none',
38
38
  border: 'none',
39
39
  borderRadius: 4,
40
- width: 'calc(100% - 4px)',
40
+ width: 'calc(100% - 12px)',
41
41
  textAlign: 'left',
42
42
  backgroundColor: colors_1.BACKGROUND,
43
43
  height: layout_1.COMPACT_CONTROL_ROW_HEIGHT,
@@ -223,10 +223,6 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
223
223
  if (isAlreadyDirectChild) {
224
224
  return;
225
225
  }
226
- const folderId = (0, get_folder_id_1.getFolderId)({
227
- folderName: item.folderName,
228
- parentName: item.parentName,
229
- });
230
226
  const notification = (0, NotificationCenter_1.showNotification)(`Moving ${compositionDragData.compositionId}...`, null);
231
227
  const controller = new AbortController();
232
228
  try {
@@ -241,9 +237,12 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
241
237
  signal: controller.signal,
242
238
  symbolicatedStack: (0, studio_shared_1.compositionDragDataToSymbolicatedStack)(compositionDragData),
243
239
  });
244
- notification.replaceContent(result.success
245
- ? `Moved ${compositionDragData.compositionId} to ${folderId}`
246
- : result.reason, result.success ? 2000 : 4000);
240
+ if (result.success) {
241
+ notification.dismiss();
242
+ }
243
+ else {
244
+ notification.replaceContent(result.reason, 4000);
245
+ }
247
246
  if (result.success && !item.expanded) {
248
247
  toggleFolder(item.folderName, item.parentName);
249
248
  }
@@ -0,0 +1,17 @@
1
+ export declare const booleanOptions: readonly [{
2
+ readonly label: "Enabled";
3
+ readonly value: true;
4
+ }, {
5
+ readonly label: "Disabled";
6
+ readonly value: false;
7
+ }];
8
+ export declare const ConfigSelect: <T extends string | boolean>({ defaultLabel, name, onChange, options, value, }: {
9
+ readonly defaultLabel: string;
10
+ readonly name: string;
11
+ readonly onChange: (value: T | null) => void;
12
+ readonly options: readonly {
13
+ label: string;
14
+ value: T;
15
+ }[];
16
+ readonly value: T | null;
17
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfigSelect = exports.booleanOptions = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Checkmark_1 = require("../icons/Checkmark");
6
+ const ComboBox_1 = require("./NewComposition/ComboBox");
7
+ const layout_1 = require("./RenderModal/layout");
8
+ const DEFAULT_VALUE = 'studio-default';
9
+ const controlWidth = {
10
+ boxSizing: 'border-box',
11
+ width: 180,
12
+ };
13
+ exports.booleanOptions = [
14
+ { label: 'Enabled', value: true },
15
+ { label: 'Disabled', value: false },
16
+ ];
17
+ const ConfigSelect = ({ defaultLabel, name, onChange, options, value, }) => {
18
+ const values = [
19
+ {
20
+ id: DEFAULT_VALUE,
21
+ keyHint: null,
22
+ label: `Default (${defaultLabel})`,
23
+ leftItem: value === null ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
24
+ onClick: () => onChange(null),
25
+ quickSwitcherLabel: null,
26
+ subMenu: null,
27
+ type: 'item',
28
+ value: DEFAULT_VALUE,
29
+ },
30
+ { id: `${DEFAULT_VALUE}-divider`, type: 'divider' },
31
+ ...options.map((option) => {
32
+ const id = `${name}-${String(option.value)}`;
33
+ return {
34
+ id,
35
+ keyHint: null,
36
+ label: option.label,
37
+ leftItem: value === option.value ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
38
+ onClick: () => onChange(option.value),
39
+ quickSwitcherLabel: null,
40
+ subMenu: null,
41
+ type: 'item',
42
+ value: id,
43
+ };
44
+ }),
45
+ ];
46
+ return (jsx_runtime_1.jsxs("div", { style: layout_1.optionRow, children: [
47
+ jsx_runtime_1.jsx("div", { style: layout_1.label, children: name }), jsx_runtime_1.jsx("div", { style: layout_1.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: values, selectedId: value === null ? DEFAULT_VALUE : `${name}-${String(value)}`, style: controlWidth, title: name }) })
48
+ ] }));
49
+ };
50
+ exports.ConfigSelect = ConfigSelect;
@@ -1,9 +1,16 @@
1
1
  import React from 'react';
2
2
  import type { MediaMetadata } from '../helpers/use-media-metadata';
3
- export declare const CURRENT_ASSET_HEIGHT = 84;
3
+ export declare const CURRENT_ASSET_HEIGHT: number;
4
4
  export declare const getCurrentAssetMetadataSource: (assetName: string | null) => string | null;
5
5
  export declare const getCurrentAssetImageMetadataSource: (assetName: string | null) => string | null;
6
- export declare const getCurrentAssetMediaDetailLines: (mediaMetadata: MediaMetadata) => string[];
6
+ type CurrentAssetDetail = {
7
+ readonly label: string;
8
+ readonly value: string;
9
+ };
10
+ export declare const getCurrentAssetMediaSections: (mediaMetadata: MediaMetadata) => {
11
+ audio: CurrentAssetDetail[] | null;
12
+ video: CurrentAssetDetail[] | null;
13
+ };
7
14
  export declare const AssetInfo: React.FC<{
8
15
  readonly assetName: string | null;
9
16
  readonly contentSized?: boolean;
@@ -13,3 +20,4 @@ export declare const AssetInfo: React.FC<{
13
20
  export declare const CurrentAsset: React.FC<{
14
21
  readonly readOnlyStudio: boolean;
15
22
  }>;
23
+ export {};