@remotion/studio 4.0.491 → 4.0.493

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 (97) hide show
  1. package/dist/ResolveCompositionConfigInStudio.js +16 -6
  2. package/dist/components/AssetSelectorItem.js +7 -4
  3. package/dist/components/Canvas.js +1 -0
  4. package/dist/components/CompositionOrStillIcon.d.ts +7 -0
  5. package/dist/components/CompositionOrStillIcon.js +11 -0
  6. package/dist/components/CompositionSelector.js +14 -2
  7. package/dist/components/CompositionSelectorItem.js +34 -6
  8. package/dist/components/CurrentAsset.d.ts +6 -0
  9. package/dist/components/CurrentAsset.js +14 -8
  10. package/dist/components/CurrentComposition.d.ts +1 -1
  11. package/dist/components/CurrentComposition.js +3 -4
  12. package/dist/components/InlineEditableTitle.d.ts +1 -0
  13. package/dist/components/InlineEditableTitle.js +12 -7
  14. package/dist/components/InspectorInfoHeader.d.ts +2 -0
  15. package/dist/components/InspectorInfoHeader.js +12 -4
  16. package/dist/components/InspectorPanel/CompositionDimensions.d.ts +6 -0
  17. package/dist/components/InspectorPanel/CompositionDimensions.js +173 -0
  18. package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +9 -0
  19. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +32 -0
  20. package/dist/components/InspectorPanel/DefaultInspector.js +6 -3
  21. package/dist/components/InspectorPanel/EasingInspector.js +3 -3
  22. package/dist/components/InspectorPanel/KeyframeInspector.js +6 -4
  23. package/dist/components/InspectorPanel/KeyframeSettings.js +1 -1
  24. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
  25. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +9 -5
  26. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +5 -1
  27. package/dist/components/InspectorPanel/common.d.ts +2 -1
  28. package/dist/components/InspectorPanel/common.js +11 -7
  29. package/dist/components/InspectorPanel/optimistic-composition-metadata.d.ts +22 -0
  30. package/dist/components/InspectorPanel/optimistic-composition-metadata.js +41 -0
  31. package/dist/components/InspectorPanel/styles.d.ts +2 -0
  32. package/dist/components/InspectorPanel/styles.js +7 -2
  33. package/dist/components/InspectorSequenceSection.js +58 -7
  34. package/dist/components/NewComposition/NewComposition.js +11 -4
  35. package/dist/components/NewComposition/get-new-composition-defaults.d.ts +4 -0
  36. package/dist/components/NewComposition/get-new-composition-defaults.js +13 -0
  37. package/dist/components/SelectedOutlineElement.js +21 -2
  38. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  39. package/dist/components/SelectedOutlineOverlay.js +4 -3
  40. package/dist/components/Timeline/Timeline.js +8 -1
  41. package/dist/components/Timeline/TimelineAssetField.d.ts +14 -0
  42. package/dist/components/Timeline/TimelineAssetField.js +125 -0
  43. package/dist/components/Timeline/TimelineClipboardKeybindings.js +133 -1
  44. package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
  45. package/dist/components/Timeline/TimelineFieldLabel.js +4 -2
  46. package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
  47. package/dist/components/Timeline/TimelineList.js +2 -1
  48. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +5 -3
  49. package/dist/components/Timeline/TimelineRowChrome.js +8 -6
  50. package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +7 -0
  51. package/dist/components/Timeline/TimelineRowLayoutContext.js +13 -0
  52. package/dist/components/Timeline/TimelineSelection.js +20 -5
  53. package/dist/components/Timeline/TimelineSequenceItem.d.ts +2 -1
  54. package/dist/components/Timeline/TimelineSequenceItem.js +32 -8
  55. package/dist/components/Timeline/TimelineSequenceName.js +4 -0
  56. package/dist/components/Timeline/get-sequence-context-menu-items.js +3 -3
  57. package/dist/components/Timeline/keyframe-clipboard.d.ts +34 -0
  58. package/dist/components/Timeline/keyframe-clipboard.js +278 -0
  59. package/dist/components/Timeline/sequence-props-subscription-store.js +5 -1
  60. package/dist/components/Timeline/timeline-asset-link.d.ts +6 -0
  61. package/dist/components/Timeline/timeline-asset-link.js +27 -1
  62. package/dist/components/Timeline/timeline-field-display-utils.js +3 -1
  63. package/dist/components/Timeline/timeline-field-row-layout.d.ts +1 -1
  64. package/dist/components/Timeline/timeline-field-row-layout.js +2 -2
  65. package/dist/components/Timeline/timeline-row-layout.d.ts +3 -2
  66. package/dist/components/Timeline/timeline-row-layout.js +6 -5
  67. package/dist/components/Timeline/update-selected-easing.d.ts +1 -1
  68. package/dist/components/Timeline/update-selected-easing.js +4 -5
  69. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +4 -4
  70. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
  71. package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
  72. package/dist/components/Timeline/use-timeline-height.js +1 -0
  73. package/dist/components/import-assets.d.ts +10 -2
  74. package/dist/components/import-assets.js +20 -6
  75. package/dist/components/root-composition-menu-items.d.ts +8 -0
  76. package/dist/components/root-composition-menu-items.js +45 -0
  77. package/dist/components/selected-outline-measurement.d.ts +2 -5
  78. package/dist/components/selected-outline-measurement.js +3 -4
  79. package/dist/esm/{chunk-9wh9k3jj.js → chunk-mndqr3zx.js} +7439 -6121
  80. package/dist/esm/internals.mjs +7439 -6121
  81. package/dist/esm/previewEntry.mjs +7371 -6057
  82. package/dist/esm/renderEntry.mjs +1 -1
  83. package/dist/helpers/calculate-timeline.d.ts +2 -1
  84. package/dist/helpers/calculate-timeline.js +36 -5
  85. package/dist/helpers/get-connected-compositions.d.ts +6 -0
  86. package/dist/helpers/get-connected-compositions.js +11 -0
  87. package/dist/helpers/get-file-manager-name.d.ts +1 -0
  88. package/dist/helpers/get-file-manager-name.js +13 -0
  89. package/dist/helpers/get-sequence-double-click-action.d.ts +6 -0
  90. package/dist/helpers/get-sequence-double-click-action.js +13 -0
  91. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
  92. package/dist/helpers/timeline-layout.d.ts +2 -1
  93. package/dist/helpers/timeline-layout.js +5 -1
  94. package/dist/helpers/url-state.d.ts +1 -0
  95. package/dist/helpers/url-state.js +8 -6
  96. package/dist/helpers/use-menu-structure.js +4 -2
  97. package/package.json +11 -11
@@ -47,7 +47,7 @@ const ResolveCompositionConfigInStudio = ({ children }) => {
47
47
  return controller;
48
48
  }
49
49
  const { signal } = controller;
50
- const result = remotion_1.Internals.resolveVideoConfigOrCatch({
50
+ const result = remotion_1.Internals.resolveVideoConfigWithMetadataOrCatch({
51
51
  compositionId,
52
52
  calculateMetadata: calculateMetadata,
53
53
  inputProps: combinedProps,
@@ -79,6 +79,7 @@ const ResolveCompositionConfigInStudio = ({ children }) => {
79
79
  [compositionId]: {
80
80
  type: 'success-and-refreshing',
81
81
  result: prev.result,
82
+ metadataSource: prev.metadataSource,
82
83
  },
83
84
  };
84
85
  }
@@ -98,7 +99,8 @@ const ResolveCompositionConfigInStudio = ({ children }) => {
98
99
  ...r,
99
100
  [compositionId]: {
100
101
  type: 'success',
101
- result: c,
102
+ result: c.videoConfig,
103
+ metadataSource: c.metadataSource,
102
104
  },
103
105
  }));
104
106
  })
@@ -120,7 +122,8 @@ const ResolveCompositionConfigInStudio = ({ children }) => {
120
122
  ...r,
121
123
  [compositionId]: {
122
124
  type: 'success',
123
- result: promOrNot,
125
+ result: promOrNot.videoConfig,
126
+ metadataSource: promOrNot.metadataSource,
124
127
  },
125
128
  }));
126
129
  }
@@ -143,7 +146,7 @@ const ResolveCompositionConfigInStudio = ({ children }) => {
143
146
  ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
144
147
  };
145
148
  const controller = new AbortController();
146
- const result = remotion_1.Internals.resolveVideoConfigOrCatch({
149
+ const result = remotion_1.Internals.resolveVideoConfigWithMetadataOrCatch({
147
150
  compositionId: composition.id,
148
151
  calculateMetadata: composition.calculateMetadata,
149
152
  inputProps: combinedProps,
@@ -162,10 +165,11 @@ const ResolveCompositionConfigInStudio = ({ children }) => {
162
165
  ...configs,
163
166
  [composition.id]: {
164
167
  type: 'success',
165
- result: resolved,
168
+ result: resolved.videoConfig,
169
+ metadataSource: resolved.metadataSource,
166
170
  },
167
171
  }));
168
- return resolved;
172
+ return resolved.videoConfig;
169
173
  }, [allEditorProps, compositions, inputProps]);
170
174
  (0, react_1.useImperativeHandle)(remotion_1.Internals.resolveCompositionsRef, () => {
171
175
  return {
@@ -305,6 +309,12 @@ const ResolveCompositionConfigInStudio = ({ children }) => {
305
309
  [curr.id]: {
306
310
  type: 'success',
307
311
  result: { ...curr, defaultProps: (_a = curr.defaultProps) !== null && _a !== void 0 ? _a : {} },
312
+ metadataSource: {
313
+ durationInFrames: 'composition',
314
+ fps: 'composition',
315
+ height: 'composition',
316
+ width: 'composition',
317
+ },
308
318
  },
309
319
  };
310
320
  }, {}),
@@ -43,6 +43,7 @@ const delete_static_file_1 = require("../api/delete-static-file");
43
43
  const client_id_1 = require("../helpers/client-id");
44
44
  const colors_1 = require("../helpers/colors");
45
45
  const copy_text_1 = require("../helpers/copy-text");
46
+ const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
46
47
  const mobile_layout_1 = require("../helpers/mobile-layout");
47
48
  const sidebar_scroll_into_view_1 = require("../helpers/sidebar-scroll-into-view");
48
49
  const url_state_1 = require("../helpers/url-state");
@@ -165,6 +166,7 @@ const AssetFolderTree = ({ item, level, name, parentFolder, toggleFolder, tabInd
165
166
  };
166
167
  exports.AssetFolderTree = AssetFolderTree;
167
168
  const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio }) => {
169
+ const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
168
170
  const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
169
171
  const [hovered, setHovered] = (0, react_1.useState)(false);
170
172
  const [isDragging, setIsDragging] = (0, react_1.useState)(false);
@@ -338,10 +340,10 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
338
340
  {
339
341
  id: 'open-asset-in-explorer',
340
342
  keyHint: null,
341
- label: 'Open in Explorer',
343
+ label: `Show in ${fileManagerName}`,
342
344
  leftItem: null,
343
345
  onClick: openAssetInExplorer,
344
- quickSwitcherLabel: 'Open asset in Explorer',
346
+ quickSwitcherLabel: `Show asset in ${fileManagerName}`,
345
347
  subMenu: null,
346
348
  type: 'item',
347
349
  value: 'open-asset-in-explorer',
@@ -380,8 +382,9 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
380
382
  }, [
381
383
  copyFileName,
382
384
  copyStaticFilePath,
383
- openAssetInExplorer,
384
385
  deleteAsset,
386
+ fileManagerName,
387
+ openAssetInExplorer,
385
388
  relativePath,
386
389
  serverActionDisabled,
387
390
  setSelectedModal,
@@ -397,6 +400,6 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
397
400
  return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("div", { ref: rowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, draggable: canDragAsset, onDragStart: onDragStart, onDragEnd: onDragEnd, tabIndex: tabIndex, title: item.name, children: [
398
401
  jsx_runtime_1.jsx(file_1.FileIcon, { style: iconStyle, color: colors_1.LIGHT_TEXT }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.name }), hovered && !isDragging ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
399
402
  jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { title: "Copy staticFile() path", renderAction: renderCopyAction, onClick: copyToClipboard }), serverActionDisabled ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
400
- jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { title: "Open in Explorer", renderAction: renderFileExplorerAction, onClick: revealInExplorer })
403
+ jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { title: `Show in ${fileManagerName}`, renderAction: renderFileExplorerAction, onClick: revealInExplorer })
401
404
  ] }))] })) : null] }) }) }));
402
405
  };
@@ -840,6 +840,7 @@ const Canvas = ({ canvasContent, size }) => {
840
840
  composition: compositionDragData,
841
841
  compositionFile,
842
842
  compositionId: currentCompositionId,
843
+ destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
843
844
  dropPosition,
844
845
  });
845
846
  }
@@ -0,0 +1,7 @@
1
+ import type React from 'react';
2
+ import type { _InternalTypes } from 'remotion';
3
+ export declare const CompositionOrStillIcon: React.FC<{
4
+ readonly color: string;
5
+ readonly composition: _InternalTypes['AnyComposition'];
6
+ readonly style: React.CSSProperties;
7
+ }>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompositionOrStillIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const is_composition_still_1 = require("../helpers/is-composition-still");
6
+ const still_1 = require("../icons/still");
7
+ const video_1 = require("../icons/video");
8
+ const CompositionOrStillIcon = ({ color, composition, style }) => {
9
+ return (0, is_composition_still_1.isCompositionStill)(composition) ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: color, style: style })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: style }));
10
+ };
11
+ exports.CompositionOrStillIcon = CompositionOrStillIcon;
@@ -6,6 +6,7 @@ const studio_shared_1 = require("@remotion/studio-shared");
6
6
  const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
8
  const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
9
+ const client_id_1 = require("../helpers/client-id");
9
10
  const colors_1 = require("../helpers/colors");
10
11
  const create_folder_tree_1 = require("../helpers/create-folder-tree");
11
12
  const persist_open_folders_1 = require("../helpers/persist-open-folders");
@@ -14,9 +15,11 @@ const use_keybinding_1 = require("../helpers/use-keybinding");
14
15
  const modals_1 = require("../state/modals");
15
16
  const z_index_1 = require("../state/z-index");
16
17
  const CompositionSelectorItem_1 = require("./CompositionSelectorItem");
18
+ const ContextMenu_1 = require("./ContextMenu");
17
19
  const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
18
20
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
19
21
  const actions_1 = require("./RenderQueue/actions");
22
+ const root_composition_menu_items_1 = require("./root-composition-menu-items");
20
23
  const useCompositionNavigation = () => {
21
24
  const { compositions, canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
22
25
  const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
@@ -107,6 +110,15 @@ const CompositionSelector = () => {
107
110
  const { compositions, canvasContent, folders } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
108
111
  const { foldersExpanded } = (0, react_1.useContext)(persist_open_folders_1.ExpandedFoldersContext);
109
112
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
113
+ const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
114
+ .previewServerState.type;
115
+ const rootContextMenuItems = (0, react_1.useMemo)(() => {
116
+ return (0, root_composition_menu_items_1.getRootCompositionMenuItems)({
117
+ connectionStatus,
118
+ readOnlyStudio: window.remotion_isReadOnlyStudio,
119
+ setSelectedModal,
120
+ });
121
+ }, [connectionStatus, setSelectedModal]);
110
122
  const [rootDragHovered, setRootDragHovered] = (0, react_1.useState)(false);
111
123
  const listRef = (0, react_1.useRef)(null);
112
124
  const autoScrollAnimation = (0, react_1.useRef)(null);
@@ -238,7 +250,7 @@ const CompositionSelector = () => {
238
250
  },
239
251
  dryRun: false,
240
252
  signal: controller.signal,
241
- symbolicatedStack: null,
253
+ symbolicatedStack: (0, studio_shared_1.compositionDragDataToSymbolicatedStack)(parsed),
242
254
  });
243
255
  notification.replaceContent(result.success
244
256
  ? `Moved ${parsed.compositionId} outside of folder`
@@ -249,7 +261,7 @@ const CompositionSelector = () => {
249
261
  }
250
262
  }, [compositions, stopCompositionListAutoScroll]);
251
263
  return (jsx_runtime_1.jsxs("div", { style: container, children: [
252
- jsx_runtime_1.jsx("div", { style: quickSwitcherArea, children: jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, children: ["Search...", (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : (jsx_runtime_1.jsxs("span", { style: shortcutLabel, children: [ShortcutHint_1.cmdOrCtrlCharacter, "+K"] }))] }) }), jsx_runtime_1.jsx("div", { ref: listRef, className: "__remotion-vertical-scrollbar", style: list, onDragOverCapture: onCompositionListDragOverCapture, onDragEndCapture: stopCompositionListAutoScroll, onDragOver: onRootDragOver, onDragLeave: onRootDragLeave, onDropCapture: stopCompositionListAutoScroll, onDrop: onRootDrop, children: items.map((c) => {
264
+ jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: listRef, values: rootContextMenuItems, onOpen: null }), jsx_runtime_1.jsx("div", { style: quickSwitcherArea, children: jsx_runtime_1.jsxs("button", { type: "button", style: quickSwitcherTrigger, onClick: openQuickSwitcher, tabIndex: tabIndex, children: ["Search...", (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? null : (jsx_runtime_1.jsxs("span", { style: shortcutLabel, children: [ShortcutHint_1.cmdOrCtrlCharacter, "+K"] }))] }) }), jsx_runtime_1.jsx("div", { ref: listRef, className: "__remotion-vertical-scrollbar", style: list, onDragOverCapture: onCompositionListDragOverCapture, onDragEndCapture: stopCompositionListAutoScroll, onDragOver: onRootDragOver, onDragLeave: onRootDragLeave, onDropCapture: stopCompositionListAutoScroll, onDrop: onRootDrop, children: items.map((c) => {
253
265
  return (jsx_runtime_1.jsx(CompositionSelectorItem_1.CompositionSelectorItem, { level: 0, currentComposition: canvasContent && canvasContent.type === 'composition'
254
266
  ? canvasContent.compositionId
255
267
  : null, selectComposition: selectComposition, toggleFolder: toggleFolder, clearRootDragHover: clearRootDragHover, tabIndex: tabIndex, item: c }, c.key + c.type));
@@ -7,15 +7,14 @@ const react_1 = require("react");
7
7
  const client_id_1 = require("../helpers/client-id");
8
8
  const colors_1 = require("../helpers/colors");
9
9
  const get_folder_id_1 = require("../helpers/get-folder-id");
10
- const is_composition_still_1 = require("../helpers/is-composition-still");
11
10
  const noop_1 = require("../helpers/noop");
12
11
  const sidebar_scroll_into_view_1 = require("../helpers/sidebar-scroll-into-view");
12
+ const url_state_1 = require("../helpers/url-state");
13
13
  const folder_1 = require("../icons/folder");
14
- const still_1 = require("../icons/still");
15
- const video_1 = require("../icons/video");
16
14
  const modals_1 = require("../state/modals");
17
15
  const composition_menu_items_1 = require("./composition-menu-items");
18
16
  const CompositionContextButton_1 = require("./CompositionContextButton");
17
+ const CompositionOrStillIcon_1 = require("./CompositionOrStillIcon");
19
18
  const ContextMenu_1 = require("./ContextMenu");
20
19
  const folder_menu_items_1 = require("./folder-menu-items");
21
20
  const layout_1 = require("./layout");
@@ -119,7 +118,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
119
118
  const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(item.type === 'composition' ? item.composition.stack : item.folder.stack);
120
119
  const contextMenu = (0, react_1.useMemo)(() => {
121
120
  if (item.type === 'composition') {
122
- return (0, composition_menu_items_1.getCompositionMenuItems)({
121
+ const compositionMenuItems = (0, composition_menu_items_1.getCompositionMenuItems)({
123
122
  closeMenu: noop_1.noop,
124
123
  composition: item.composition,
125
124
  connectionStatus,
@@ -127,6 +126,34 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
127
126
  setSelectedModal,
128
127
  readOnlyStudio: window.remotion_isReadOnlyStudio,
129
128
  });
129
+ return [
130
+ {
131
+ id: 'open-in-new-window',
132
+ keyHint: null,
133
+ label: 'Open in new window',
134
+ leftItem: null,
135
+ onClick: () => {
136
+ var _a, _b;
137
+ const screen = window.screen;
138
+ const width = Math.min(1200, Math.floor(screen.availWidth * 0.8));
139
+ const height = Math.min(800, Math.floor(screen.availHeight * 0.8));
140
+ const displayLeft = (_a = screen.availLeft) !== null && _a !== void 0 ? _a : 0;
141
+ const displayTop = (_b = screen.availTop) !== null && _b !== void 0 ? _b : 0;
142
+ const left = Math.round(Math.min(Math.max(window.screenX + (window.outerWidth - width) / 2, displayLeft), displayLeft + screen.availWidth - width));
143
+ const top = Math.round(Math.min(Math.max(window.screenY + (window.outerHeight - height) / 2, displayTop), displayTop + screen.availHeight - height));
144
+ window.open((0, url_state_1.getUrlForRoute)(`/${item.composition.id}`), '_blank', `popup,width=${width},height=${height},left=${left},top=${top}`);
145
+ },
146
+ quickSwitcherLabel: null,
147
+ subMenu: null,
148
+ type: 'item',
149
+ value: 'open-in-new-window',
150
+ },
151
+ {
152
+ type: 'divider',
153
+ id: 'open-in-new-window-divider',
154
+ },
155
+ ...compositionMenuItems,
156
+ ];
130
157
  }
131
158
  return (0, folder_menu_items_1.getFolderMenuItems)({
132
159
  closeMenu: noop_1.noop,
@@ -211,7 +238,7 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
211
238
  },
212
239
  dryRun: false,
213
240
  signal: controller.signal,
214
- symbolicatedStack: null,
241
+ symbolicatedStack: (0, studio_shared_1.compositionDragDataToSymbolicatedStack)(parsed),
215
242
  });
216
243
  notification.replaceContent(result.success
217
244
  ? `Moved ${parsed.compositionId} to ${folderId}`
@@ -231,7 +258,8 @@ const CompositionSelectorItem = ({ item, level, currentComposition, tabIndex, se
231
258
  return (jsx_runtime_1.jsx(exports.CompositionSelectorItem, { currentComposition: currentComposition, selectComposition: selectComposition, item: childItem, tabIndex: tabIndex, level: level + 1, toggleFolder: toggleFolder, clearRootDragHover: clearRootDragHover }, childItem.key + childItem.type));
232
259
  }) })) : null] }));
233
260
  }
234
- return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("a", { ref: compositionRowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, onKeyDown: onKeyDown, draggable: !window.remotion_isReadOnlyStudio, onDragStart: onCompositionDragStart, type: "button", title: item.composition.id, className: "__remotion-composition", "data-compname": item.composition.id, children: [(0, is_composition_still_1.isCompositionStill)(item.composition) ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: hovered || selected ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: hovered || selected ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle })), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.composition.id }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(CompositionContextButton_1.CompositionContextButton, { values: contextMenu, visible: hovered }), jsx_runtime_1.jsx(SidebarRenderButton_1.SidebarRenderButton, { visible: hovered, composition: item.composition })
261
+ return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenu, onOpen: null, children: jsx_runtime_1.jsx(layout_1.Row, { align: "center", children: jsx_runtime_1.jsxs("a", { ref: compositionRowRef, style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, onKeyDown: onKeyDown, draggable: !window.remotion_isReadOnlyStudio, onDragStart: onCompositionDragStart, type: "button", title: item.composition.id, className: "__remotion-composition", "data-compname": item.composition.id, children: [
262
+ jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { composition: item.composition, color: hovered || selected ? colors_1.WHITE : colors_1.LIGHT_TEXT, style: iconStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: label, children: item.composition.id }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(CompositionContextButton_1.CompositionContextButton, { values: contextMenu, visible: hovered }), jsx_runtime_1.jsx(SidebarRenderButton_1.SidebarRenderButton, { visible: hovered, composition: item.composition })
235
263
  ] }) }) }));
236
264
  };
237
265
  exports.CompositionSelectorItem = CompositionSelectorItem;
@@ -3,6 +3,12 @@ import type { MediaMetadata } from '../helpers/use-media-metadata';
3
3
  export declare const CURRENT_ASSET_HEIGHT = 84;
4
4
  export declare const getCurrentAssetMetadataSource: (assetName: string | null) => string | null;
5
5
  export declare const getCurrentAssetMediaDetailLines: (mediaMetadata: MediaMetadata) => string[];
6
+ export declare const AssetInfo: React.FC<{
7
+ readonly assetName: string | null;
8
+ readonly contentSized?: boolean;
9
+ readonly onAssetClick?: () => void;
10
+ readonly readOnlyStudio: boolean;
11
+ }>;
6
12
  export declare const CurrentAsset: React.FC<{
7
13
  readonly readOnlyStudio: boolean;
8
14
  }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CurrentAsset = exports.getCurrentAssetMediaDetailLines = exports.getCurrentAssetMetadataSource = exports.CURRENT_ASSET_HEIGHT = void 0;
3
+ exports.CurrentAsset = exports.AssetInfo = exports.getCurrentAssetMediaDetailLines = exports.getCurrentAssetMetadataSource = exports.CURRENT_ASSET_HEIGHT = 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");
@@ -55,12 +55,10 @@ const getCurrentAssetMediaDetailLines = (mediaMetadata) => {
55
55
  return detailLines;
56
56
  };
57
57
  exports.getCurrentAssetMediaDetailLines = getCurrentAssetMediaDetailLines;
58
- const CurrentAsset = ({ readOnlyStudio }) => {
58
+ const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStudio }) => {
59
59
  var _a;
60
- const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
61
60
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
62
61
  .previewServerState.type;
63
- const assetName = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' ? canvasContent.asset : null;
64
62
  const staticFiles = (0, use_static_files_1.useStaticFiles)();
65
63
  const renameFile = (0, use_rename_static_file_1.useRenameStaticFile)({
66
64
  relativePath: assetName !== null && assetName !== void 0 ? assetName : '',
@@ -76,12 +74,14 @@ const CurrentAsset = ({ readOnlyStudio }) => {
76
74
  }, [assetName, staticFiles]);
77
75
  const src = (0, exports.getCurrentAssetMetadataSource)(assetName);
78
76
  const mediaMetadata = (0, use_media_metadata_1.useMediaMetadata)(src);
79
- const canRename = connectionStatus === 'connected' && !readOnlyStudio;
77
+ const canRename = onAssetClick === undefined &&
78
+ connectionStatus === 'connected' &&
79
+ !readOnlyStudio;
80
80
  const onRename = (0, react_1.useCallback)((newName) => {
81
81
  renameFile(newName).catch(() => undefined);
82
82
  }, [renameFile]);
83
83
  if (!assetName) {
84
- return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, {});
84
+ return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: contentSized });
85
85
  }
86
86
  const fileName = (_a = assetName.split('/').pop()) !== null && _a !== void 0 ? _a : assetName;
87
87
  const subtitleParts = [];
@@ -99,9 +99,15 @@ const CurrentAsset = ({ readOnlyStudio }) => {
99
99
  const mediaDetailLines = mediaMetadata
100
100
  ? (0, exports.getCurrentAssetMediaDetailLines)(mediaMetadata)
101
101
  : [];
102
- return (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoHeader, { children: [
103
- jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onCommit: onRename, title: assetName }), subtitleParts.length > 0 ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: subtitleParts.join(' · ') })) : null, mediaMetadata ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: (0, format_media_duration_1.formatMediaDuration)(mediaMetadata.duration) })) : null, mediaDetailLines.map((line) => {
102
+ return (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: contentSized, children: [
103
+ jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onClick: onAssetClick, onCommit: onRename, title: assetName }), subtitleParts.length > 0 ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: subtitleParts.join(' · ') })) : null, mediaMetadata ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: (0, format_media_duration_1.formatMediaDuration)(mediaMetadata.duration) })) : null, mediaDetailLines.map((line) => {
104
104
  return jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: line }, line);
105
105
  })] }));
106
106
  };
107
+ exports.AssetInfo = AssetInfo;
108
+ const CurrentAsset = ({ readOnlyStudio }) => {
109
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
110
+ const assetName = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'asset' ? canvasContent.asset : null;
111
+ return jsx_runtime_1.jsx(exports.AssetInfo, { assetName: assetName, readOnlyStudio: readOnlyStudio });
112
+ };
107
113
  exports.CurrentAsset = CurrentAsset;
@@ -1,2 +1,2 @@
1
- export declare const CURRENT_COMPOSITION_HEIGHT = 84;
1
+ export declare const CURRENT_COMPOSITION_HEIGHT = 66;
2
2
  export declare const CurrentComposition: () => import("react/jsx-runtime").JSX.Element;
@@ -9,14 +9,13 @@ const open_in_editor_1 = require("../helpers/open-in-editor");
9
9
  const react_2 = require("../icons/react");
10
10
  const still_1 = require("../icons/still");
11
11
  const video_1 = require("../icons/video");
12
- const render_frame_1 = require("../state/render-frame");
13
12
  const InlineCompositionName_1 = require("./InlineCompositionName");
14
13
  const InspectorInfoHeader_1 = require("./InspectorInfoHeader");
15
14
  const InspectorLocationCopy_1 = require("./InspectorLocationCopy");
16
15
  const InspectorSourceLocation_1 = require("./InspectorSourceLocation");
17
16
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
18
17
  const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
19
- exports.CURRENT_COMPOSITION_HEIGHT = InspectorInfoHeader_1.INSPECTOR_INFO_HEADER_MIN_HEIGHT;
18
+ exports.CURRENT_COMPOSITION_HEIGHT = 66;
20
19
  const sourceLocationIconStyle = {
21
20
  flexShrink: 0,
22
21
  height: 13,
@@ -86,9 +85,9 @@ const CurrentComposition = () => {
86
85
  }
87
86
  return (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: color, style: sourceLocationIconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: sourceLocationIconStyle }));
88
87
  }, [video]);
89
- return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { children: video ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
88
+ return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { minHeight: exports.CURRENT_COMPOSITION_HEIGHT, children: video ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
90
89
  jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: validatedLocation, name: video.id, children: [
91
90
  jsx_runtime_1.jsx(InlineCompositionName_1.InlineCompositionName, { compositionId: video.id, stack: (_e = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _e !== void 0 ? _e : null, compositions: compositions }, video.id), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: validatedLocation !== null, onOpen: openFileLocation, renderIcon: renderCompositionIcon }), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: componentLocation, canOpen: componentLocation !== null, onOpen: openComponentLocation, renderIcon: renderReactIcon })
92
- ] }), jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: [video.width, "x", video.height, (0, is_composition_still_1.isCompositionStill)(video) ? null : `, ${video.fps} FPS`] }), (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: "Still" })) : (jsx_runtime_1.jsxs(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: ["Duration ", (0, render_frame_1.renderFrame)(video.durationInFrames, video.fps)] }))] })) : null }));
91
+ ] }), (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoSubtitle, { children: "Still" })) : null] })) : null }));
93
92
  };
94
93
  exports.CurrentComposition = CurrentComposition;
@@ -3,6 +3,7 @@ export declare const InlineEditableTitle: React.FC<{
3
3
  readonly value: string;
4
4
  readonly canRename: boolean;
5
5
  readonly getInitialSelection?: (value: string) => [number, number];
6
+ readonly onClick?: () => void;
6
7
  readonly onCommit: (newValue: string) => void;
7
8
  readonly title?: string;
8
9
  }>;
@@ -53,7 +53,7 @@ const titleInput = {
53
53
  WebkitAppearance: 'none',
54
54
  width: '100%',
55
55
  };
56
- const InlineEditableTitle = ({ value, canRename, getInitialSelection, onCommit, title }) => {
56
+ const InlineEditableTitle = ({ value, canRename, getInitialSelection, onClick, onCommit, title }) => {
57
57
  const [isEditing, setIsEditing] = (0, react_1.useState)(false);
58
58
  const [isHovered, setIsHovered] = (0, react_1.useState)(false);
59
59
  const [draftValue, setDraftValue] = (0, react_1.useState)(value);
@@ -84,14 +84,18 @@ const InlineEditableTitle = ({ value, canRename, getInitialSelection, onCommit,
84
84
  setIsEditing(false);
85
85
  onCommit(newValue);
86
86
  }, [onCommit]);
87
- const startEditing = (0, react_1.useCallback)(() => {
87
+ const handleClick = (0, react_1.useCallback)(() => {
88
+ if (onClick) {
89
+ onClick();
90
+ return;
91
+ }
88
92
  if (!canRename) {
89
93
  return;
90
94
  }
91
95
  cancelledRef.current = false;
92
96
  setDraftValue(value);
93
97
  setIsEditing(true);
94
- }, [canRename, value]);
98
+ }, [canRename, onClick, value]);
95
99
  const onChange = (0, react_1.useCallback)((e) => {
96
100
  setDraftValue(e.target.value);
97
101
  }, []);
@@ -111,21 +115,22 @@ const InlineEditableTitle = ({ value, canRename, getInitialSelection, onCommit,
111
115
  setIsEditing(false);
112
116
  }
113
117
  }, [value]);
118
+ const isInteractive = canRename || onClick !== undefined;
114
119
  const backgroundColor = isEditing
115
120
  ? colors_1.INPUT_BACKGROUND
116
- : isHovered && canRename
121
+ : isHovered && isInteractive
117
122
  ? colors_1.WHITE_ALPHA_06
118
123
  : colors_1.TRANSPARENT;
119
124
  const innerStyle = (0, react_1.useMemo)(() => {
120
125
  return {
121
126
  ...titleInner,
122
127
  backgroundColor,
123
- cursor: isEditing ? 'text' : canRename ? 'pointer' : 'default',
128
+ cursor: isEditing ? 'text' : isInteractive ? 'pointer' : 'default',
124
129
  userSelect: isEditing ? 'text' : 'none',
125
130
  width: isEditing ? '100%' : undefined,
126
131
  };
127
- }, [backgroundColor, canRename, isEditing]);
128
- return (jsx_runtime_1.jsx("div", { style: titleWrapper, title: title !== null && title !== void 0 ? title : value, children: jsx_runtime_1.jsxs("span", { style: innerStyle, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: isEditing || !canRename ? undefined : startEditing, children: [
132
+ }, [backgroundColor, isEditing, isInteractive]);
133
+ return (jsx_runtime_1.jsx("div", { style: titleWrapper, title: title !== null && title !== void 0 ? title : value, children: jsx_runtime_1.jsxs("span", { style: innerStyle, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: isEditing || !isInteractive ? undefined : handleClick, children: [
129
134
  jsx_runtime_1.jsx("span", { "aria-hidden": isEditing, style: {
130
135
  ...titleGridItem,
131
136
  visibility: isEditing ? 'hidden' : 'visible',
@@ -2,6 +2,8 @@ import React from 'react';
2
2
  export declare const INSPECTOR_INFO_HEADER_MIN_HEIGHT = 84;
3
3
  export declare const InspectorInfoHeader: React.FC<{
4
4
  readonly children?: React.ReactNode;
5
+ readonly contentSized?: boolean;
6
+ readonly minHeight?: number;
5
7
  }>;
6
8
  export declare const InspectorInfoTitle: React.FC<{
7
9
  readonly children: React.ReactNode;
@@ -5,13 +5,16 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const colors_1 = require("../helpers/colors");
6
6
  const InspectorPanelLayout_1 = require("./InspectorPanelLayout");
7
7
  exports.INSPECTOR_INFO_HEADER_MIN_HEIGHT = 84;
8
- const container = {
8
+ const containerBase = {
9
9
  backgroundColor: colors_1.BACKGROUND,
10
10
  color: colors_1.WHITE,
11
11
  display: 'block',
12
- minHeight: exports.INSPECTOR_INFO_HEADER_MIN_HEIGHT,
13
12
  padding: `6px ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px`,
14
13
  };
14
+ const container = {
15
+ ...containerBase,
16
+ minHeight: exports.INSPECTOR_INFO_HEADER_MIN_HEIGHT,
17
+ };
15
18
  const row = {
16
19
  backgroundColor: colors_1.BACKGROUND,
17
20
  display: 'flex',
@@ -41,8 +44,13 @@ const subtitle = {
41
44
  textOverflow: 'ellipsis',
42
45
  whiteSpace: 'nowrap',
43
46
  };
44
- const InspectorInfoHeader = ({ children }) => {
45
- return (jsx_runtime_1.jsx("div", { style: container, children: children === undefined || children === null ? null : (jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsx("div", { style: content, children: children }) })) }));
47
+ const InspectorInfoHeader = ({ children, contentSized = false, minHeight }) => {
48
+ const style = contentSized
49
+ ? containerBase
50
+ : minHeight === undefined
51
+ ? container
52
+ : { ...containerBase, minHeight };
53
+ return (jsx_runtime_1.jsx("div", { style: style, children: children === undefined || children === null ? null : (jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsx("div", { style: content, children: children }) })) }));
46
54
  };
47
55
  exports.InspectorInfoHeader = InspectorInfoHeader;
48
56
  const InspectorInfoTitle = ({ children }) => {
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const CompositionDimensions: React.FC<{
3
+ readonly compositionId: string;
4
+ readonly disabled: boolean;
5
+ readonly stack: string | null;
6
+ }>;