@remotion/studio 4.0.490 → 4.0.492

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 (120) hide show
  1. package/dist/components/AssetSelectorItem.js +7 -4
  2. package/dist/components/Canvas.js +2 -0
  3. package/dist/components/CompositionOrStillIcon.d.ts +7 -0
  4. package/dist/components/CompositionOrStillIcon.js +11 -0
  5. package/dist/components/CompositionSelector.js +13 -1
  6. package/dist/components/CompositionSelectorItem.js +33 -5
  7. package/dist/components/CurrentAsset.d.ts +6 -0
  8. package/dist/components/CurrentAsset.js +14 -8
  9. package/dist/components/CurrentComposition.js +4 -1
  10. package/dist/components/EditorContent.js +1 -1
  11. package/dist/components/GlobalKeybindings.d.ts +1 -3
  12. package/dist/components/GlobalKeybindings.js +2 -9
  13. package/dist/components/InlineEditableTitle.d.ts +1 -0
  14. package/dist/components/InlineEditableTitle.js +12 -7
  15. package/dist/components/InspectorInfoHeader.d.ts +1 -0
  16. package/dist/components/InspectorInfoHeader.js +7 -4
  17. package/dist/components/InspectorLocationCopy.d.ts +7 -0
  18. package/dist/components/InspectorLocationCopy.js +65 -0
  19. package/dist/components/InspectorPanel/SequenceCompositionsSection.d.ts +5 -0
  20. package/dist/components/InspectorPanel/SequenceCompositionsSection.js +37 -0
  21. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +6 -4
  22. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -1
  23. package/dist/components/InspectorPanel/common.js +1 -1
  24. package/dist/components/InspectorPanel/get-compositions-matching-single-child.d.ts +6 -0
  25. package/dist/components/InspectorPanel/get-compositions-matching-single-child.js +11 -0
  26. package/dist/components/InspectorSequenceSection.js +57 -3
  27. package/dist/components/KeyboardShortcutsExplainer.js +4 -0
  28. package/dist/components/NewComposition/NewComposition.js +11 -4
  29. package/dist/components/NewComposition/get-new-composition-defaults.d.ts +4 -0
  30. package/dist/components/NewComposition/get-new-composition-defaults.js +13 -0
  31. package/dist/components/OptionsPanel.js +4 -8
  32. package/dist/components/OutlineToggle.d.ts +3 -1
  33. package/dist/components/OutlineToggle.js +2 -2
  34. package/dist/components/PreviewToolbar.js +1 -1
  35. package/dist/components/RenderButton.js +9 -33
  36. package/dist/components/RenderModal/WebRenderModal.js +3 -8
  37. package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +0 -2
  38. package/dist/components/RenderModal/WebRenderModalAdvanced.js +2 -9
  39. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +0 -2
  40. package/dist/components/RenderQueue/client-side-render-types.d.ts +0 -1
  41. package/dist/components/RenderQueue/index.js +0 -9
  42. package/dist/components/SelectedOutlineElement.js +40 -38
  43. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  44. package/dist/components/SelectedOutlineOverlay.js +2 -13
  45. package/dist/components/SnappingToggle.d.ts +3 -1
  46. package/dist/components/SnappingToggle.js +2 -2
  47. package/dist/components/Timeline/TimelineAssetField.d.ts +14 -0
  48. package/dist/components/Timeline/TimelineAssetField.js +125 -0
  49. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +20 -1
  50. package/dist/components/Timeline/TimelineClipboardKeybindings.js +301 -155
  51. package/dist/components/Timeline/TimelineEffectPropItem.js +7 -11
  52. package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
  53. package/dist/components/Timeline/TimelineFieldLabel.d.ts +1 -0
  54. package/dist/components/Timeline/TimelineFieldLabel.js +7 -3
  55. package/dist/components/Timeline/TimelineFieldRowContent.d.ts +8 -0
  56. package/dist/components/Timeline/TimelineFieldRowContent.js +16 -0
  57. package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
  58. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +5 -1
  59. package/dist/components/Timeline/TimelineRowChrome.js +8 -4
  60. package/dist/components/Timeline/TimelineRowLayoutContext.d.ts +7 -0
  61. package/dist/components/Timeline/TimelineRowLayoutContext.js +13 -0
  62. package/dist/components/Timeline/TimelineSelection.js +1 -0
  63. package/dist/components/Timeline/TimelineSequence.js +2 -4
  64. package/dist/components/Timeline/TimelineSequenceItem.js +1 -0
  65. package/dist/components/Timeline/TimelineSequencePropItem.js +8 -10
  66. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -0
  67. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +18 -6
  68. package/dist/components/Timeline/TimelineTextContentField.js +12 -5
  69. package/dist/components/Timeline/TimelineVideoInfo.d.ts +3 -1
  70. package/dist/components/Timeline/TimelineVideoInfo.js +11 -4
  71. package/dist/components/Timeline/delete-selected-timeline-item.js +4 -5
  72. package/dist/components/Timeline/effects-clipboard.d.ts +14 -0
  73. package/dist/components/Timeline/effects-clipboard.js +68 -0
  74. package/dist/components/Timeline/get-sequence-context-menu-items.js +40 -3
  75. package/dist/components/Timeline/get-timeline-media-start-frame.d.ts +6 -0
  76. package/dist/components/Timeline/get-timeline-media-start-frame.js +15 -0
  77. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -2
  78. package/dist/components/Timeline/sequence-props-subscription-store.js +8 -2
  79. package/dist/components/Timeline/timeline-asset-link.d.ts +6 -0
  80. package/dist/components/Timeline/timeline-asset-link.js +27 -1
  81. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  82. package/dist/components/Timeline/timeline-field-row-layout.d.ts +2 -1
  83. package/dist/components/Timeline/timeline-field-row-layout.js +10 -3
  84. package/dist/components/Timeline/timeline-row-layout.d.ts +4 -3
  85. package/dist/components/Timeline/timeline-row-layout.js +7 -6
  86. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
  87. package/dist/components/Timeline/use-sequence-props-subscription.js +10 -1
  88. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
  89. package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
  90. package/dist/components/Timeline/use-timeline-height.js +1 -0
  91. package/dist/components/import-assets.d.ts +14 -2
  92. package/dist/components/import-assets.js +28 -7
  93. package/dist/components/root-composition-menu-items.d.ts +8 -0
  94. package/dist/components/root-composition-menu-items.js +45 -0
  95. package/dist/components/selected-outline-measurement.d.ts +4 -0
  96. package/dist/components/selected-outline-measurement.js +3 -1
  97. package/dist/components/selected-outline-types.d.ts +1 -6
  98. package/dist/esm/{chunk-16nwrbrm.js → chunk-ewx0568t.js} +7962 -7216
  99. package/dist/esm/index.mjs +0 -1
  100. package/dist/esm/internals.mjs +7962 -7216
  101. package/dist/esm/previewEntry.mjs +7332 -6586
  102. package/dist/esm/renderEntry.mjs +1 -1
  103. package/dist/helpers/format-file-location.d.ts +5 -0
  104. package/dist/helpers/format-file-location.js +9 -1
  105. package/dist/helpers/get-file-manager-name.d.ts +1 -0
  106. package/dist/helpers/get-file-manager-name.js +13 -0
  107. package/dist/helpers/retry-payload.js +0 -1
  108. package/dist/helpers/studio-runtime-config.d.ts +0 -1
  109. package/dist/helpers/studio-runtime-config.js +1 -6
  110. package/dist/helpers/timeline-layout.d.ts +2 -1
  111. package/dist/helpers/timeline-layout.js +5 -1
  112. package/dist/helpers/url-state.d.ts +1 -0
  113. package/dist/helpers/url-state.js +8 -6
  114. package/dist/helpers/use-menu-structure.js +19 -20
  115. package/dist/state/modals.d.ts +0 -1
  116. package/package.json +11 -11
  117. package/dist/components/RenderModal/WebRendererExperimentalBadge.d.ts +0 -1
  118. package/dist/components/RenderModal/WebRendererExperimentalBadge.js +0 -35
  119. package/dist/helpers/show-browser-rendering.d.ts +0 -1
  120. package/dist/helpers/show-browser-rendering.js +0 -5
@@ -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
  };
@@ -636,6 +636,7 @@ const Canvas = ({ canvasContent, size }) => {
636
636
  canInstall: canInstallElements,
637
637
  lastFocusedAt: lastFocusedAtRef.current,
638
638
  readOnly: window.remotion_isReadOnlyStudio,
639
+ studioUrl: window.location.href,
639
640
  }).catch(() => undefined);
640
641
  }, [
641
642
  canInstallElements,
@@ -839,6 +840,7 @@ const Canvas = ({ canvasContent, size }) => {
839
840
  composition: compositionDragData,
840
841
  compositionFile,
841
842
  compositionId: currentCompositionId,
843
+ destinationDimensions: contentDimensions === 'none' ? null : contentDimensions,
842
844
  dropPosition,
843
845
  });
844
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);
@@ -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,
@@ -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;
@@ -12,6 +12,7 @@ const video_1 = require("../icons/video");
12
12
  const render_frame_1 = require("../state/render-frame");
13
13
  const InlineCompositionName_1 = require("./InlineCompositionName");
14
14
  const InspectorInfoHeader_1 = require("./InspectorInfoHeader");
15
+ const InspectorLocationCopy_1 = require("./InspectorLocationCopy");
15
16
  const InspectorSourceLocation_1 = require("./InspectorSourceLocation");
16
17
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
17
18
  const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
@@ -86,6 +87,8 @@ const CurrentComposition = () => {
86
87
  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 }));
87
88
  }, [video]);
88
89
  return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { children: video ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
89
- 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 }), 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 }));
90
+ jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: validatedLocation, name: video.id, children: [
91
+ 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 }));
90
93
  };
91
94
  exports.CurrentComposition = CurrentComposition;
@@ -39,7 +39,7 @@ const EditorContent = ({ readOnlyStudio, children }) => {
39
39
  jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: children }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: showTimeline ? jsx_runtime_1.jsx(Timeline_1.Timeline, {}) : jsx_runtime_1.jsx(TimelineEmptyState_1.TimelineEmptyState, {}) })
40
40
  ] }));
41
41
  return (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionProvider, { children: jsx_runtime_1.jsxs(StudioClearSelectionArea, { children: [
42
- jsx_runtime_1.jsx(InitialCompositionLoader_1.InitialCompositionLoader, {}), jsx_runtime_1.jsx(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(GlobalKeybindings_1.GlobalKeybindings, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(TimelineKeyframeDragState_1.TimelineKeyframeDragStateProvider, { children: content })
42
+ jsx_runtime_1.jsx(InitialCompositionLoader_1.InitialCompositionLoader, {}), jsx_runtime_1.jsx(MenuToolbar_1.MenuToolbar, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(GlobalKeybindings_1.GlobalKeybindings, {}), jsx_runtime_1.jsx(TimelineKeyframeDragState_1.TimelineKeyframeDragStateProvider, { children: content })
43
43
  ] }) }));
44
44
  };
45
45
  exports.EditorContent = EditorContent;
@@ -1,4 +1,2 @@
1
1
  import type React from 'react';
2
- export declare const GlobalKeybindings: React.FC<{
3
- readonly readOnlyStudio: boolean;
4
- }>;
2
+ export declare const GlobalKeybindings: React.FC;
@@ -4,8 +4,6 @@ exports.GlobalKeybindings = void 0;
4
4
  const react_1 = require("react");
5
5
  const remotion_1 = require("remotion");
6
6
  const calculate_timeline_1 = require("../helpers/calculate-timeline");
7
- const client_id_1 = require("../helpers/client-id");
8
- const show_browser_rendering_1 = require("../helpers/show-browser-rendering");
9
7
  const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
10
8
  const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
11
9
  const use_keybinding_1 = require("../helpers/use-keybinding");
@@ -23,7 +21,7 @@ const sequencePropShortcuts = {
23
21
  t: 'style.opacity',
24
22
  };
25
23
  const hasOwnProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
26
- const GlobalKeybindings = ({ readOnlyStudio }) => {
24
+ const GlobalKeybindings = () => {
27
25
  const keybindings = (0, use_keybinding_1.useKeybinding)();
28
26
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
29
27
  const { setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
@@ -32,7 +30,6 @@ const GlobalKeybindings = ({ readOnlyStudio }) => {
32
30
  const { sequences } = (0, react_1.useContext)(remotion_1.Internals.SequenceManager);
33
31
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
34
32
  const { overrideIdToNodePathMappings } = (0, react_1.useContext)(remotion_1.Internals.OverrideIdsToNodePathsGettersContext);
35
- const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState;
36
33
  const { navigateToNextComposition, navigateToPreviousComposition } = (0, CompositionSelector_1.useCompositionNavigation)();
37
34
  const video = remotion_1.Internals.useVideo();
38
35
  const timeline = (0, react_1.useMemo)(() => {
@@ -81,13 +78,9 @@ const GlobalKeybindings = ({ readOnlyStudio }) => {
81
78
  if (!video) {
82
79
  return;
83
80
  }
84
- if (type !== 'connected' && !show_browser_rendering_1.SHOW_BROWSER_RENDERING && !readOnlyStudio) {
85
- (0, NotificationCenter_1.showNotification)('Studio server is offline', 2000);
86
- return;
87
- }
88
81
  const renderButton = document.getElementById('render-modal-button');
89
82
  renderButton.click();
90
- }, [readOnlyStudio, type, video]);
83
+ }, [video]);
91
84
  (0, react_1.useEffect)(() => {
92
85
  const onSequencePropKey = (event) => {
93
86
  const key = event.key.toLowerCase();
@@ -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,7 @@ 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;
5
6
  }>;
6
7
  export declare const InspectorInfoTitle: React.FC<{
7
8
  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,8 @@ 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 }) => {
48
+ return (jsx_runtime_1.jsx("div", { style: contentSized ? containerBase : container, children: children === undefined || children === null ? null : (jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsx("div", { style: content, children: children }) })) }));
46
49
  };
47
50
  exports.InspectorInfoHeader = InspectorInfoHeader;
48
51
  const InspectorInfoTitle = ({ children }) => {
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
3
+ export declare const InspectorLocationCopy: React.FC<{
4
+ readonly children: React.ReactNode;
5
+ readonly location: OriginalPosition | null;
6
+ readonly name: string | null;
7
+ }>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InspectorLocationCopy = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const format_file_location_1 = require("../helpers/format-file-location");
7
+ const clipboard_1 = require("../icons/clipboard");
8
+ const InlineAction_1 = require("./InlineAction");
9
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
10
+ const row = {
11
+ alignItems: 'center',
12
+ display: 'flex',
13
+ flexDirection: 'row',
14
+ minWidth: 0,
15
+ width: '100%',
16
+ };
17
+ const content = {
18
+ display: 'flex',
19
+ flex: 1,
20
+ flexDirection: 'column',
21
+ minWidth: 0,
22
+ overflow: 'hidden',
23
+ };
24
+ const action = {
25
+ flexShrink: 0,
26
+ height: 24,
27
+ marginLeft: 4,
28
+ marginRight: -4,
29
+ };
30
+ const icon = {
31
+ flexShrink: 0,
32
+ height: 12,
33
+ width: 12,
34
+ };
35
+ const InspectorLocationCopy = ({ children, location, name }) => {
36
+ const [hovered, setHovered] = (0, react_1.useState)(false);
37
+ const [focusedWithin, setFocusedWithin] = (0, react_1.useState)(false);
38
+ const textToCopy = (0, react_1.useMemo)(() => {
39
+ return (0, format_file_location_1.formatLocationForAgents)({
40
+ location,
41
+ name,
42
+ root: window.remotion_cwd,
43
+ });
44
+ }, [location, name]);
45
+ const renderCopyAction = (0, react_1.useCallback)((color) => {
46
+ return jsx_runtime_1.jsx(clipboard_1.ClipboardIcon, { style: icon, color: color });
47
+ }, []);
48
+ const onCopy = (0, react_1.useCallback)((event) => {
49
+ event.stopPropagation();
50
+ if (!textToCopy) {
51
+ return;
52
+ }
53
+ navigator.clipboard.writeText(textToCopy).catch((err) => {
54
+ (0, NotificationCenter_1.showNotification)(`Could not copy to clipboard: ${err.message}`, 2000);
55
+ });
56
+ }, [textToCopy]);
57
+ const showAction = hovered || focusedWithin;
58
+ return (jsx_runtime_1.jsxs("div", { style: row, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), onFocus: () => setFocusedWithin(true), onBlur: () => setFocusedWithin(false), children: [
59
+ jsx_runtime_1.jsx("div", { style: content, children: children }), textToCopy ? (jsx_runtime_1.jsx("div", { style: {
60
+ ...action,
61
+ opacity: showAction ? 1 : 0,
62
+ pointerEvents: showAction ? 'auto' : 'none',
63
+ }, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onCopy, renderAction: renderCopyAction, title: "Copy location for agents" }) })) : null] }));
64
+ };
65
+ exports.InspectorLocationCopy = InspectorLocationCopy;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { TrackWithHash } from '../../helpers/get-timeline-sequence-sort-key';
3
+ export declare const SequenceCompositionsSection: React.FC<{
4
+ readonly track: TrackWithHash;
5
+ }>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SequenceCompositionsSection = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const CompositionOrStillIcon_1 = require("../CompositionOrStillIcon");
8
+ const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
9
+ const common_1 = require("./common");
10
+ const get_compositions_matching_single_child_1 = require("./get-compositions-matching-single-child");
11
+ const styles_1 = require("./styles");
12
+ const compositionIconStyle = {
13
+ height: 13,
14
+ width: 13,
15
+ };
16
+ const compositionListStyle = {
17
+ ...styles_1.detailsContainer,
18
+ display: 'flex',
19
+ flexDirection: 'column',
20
+ paddingBottom: 6,
21
+ paddingTop: 6,
22
+ };
23
+ const SequenceCompositionsSection = ({ track }) => {
24
+ const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
25
+ const selectComposition = (0, InitialCompositionLoader_1.useSelectComposition)();
26
+ const matchingCompositions = (0, react_1.useMemo)(() => (0, get_compositions_matching_single_child_1.getCompositionsMatchingSingleChild)({
27
+ compositions,
28
+ singleChildComponent: track.sequence.singleChildComponent,
29
+ }), [compositions, track.sequence.singleChildComponent]);
30
+ if (matchingCompositions.length === 0) {
31
+ return null;
32
+ }
33
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
34
+ jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }), jsx_runtime_1.jsx("div", { style: compositionListStyle, children: matchingCompositions.map((composition) => (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => selectComposition(composition, true), renderIcon: (color) => (jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: color, composition: composition, style: compositionIconStyle })), children: composition.id }, composition.id))) })
35
+ ] }));
36
+ };
37
+ exports.SequenceCompositionsSection = SequenceCompositionsSection;
@@ -5,9 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const client_id_1 = require("../../helpers/client-id");
7
7
  const InlineEditableTitle_1 = require("../InlineEditableTitle");
8
+ const InspectorLocationCopy_1 = require("../InspectorLocationCopy");
8
9
  const InspectorSourceLocation_1 = require("../InspectorSourceLocation");
9
10
  const use_open_sequence_in_editor_1 = require("../Timeline/use-open-sequence-in-editor");
10
11
  const use_rename_sequence_1 = require("../Timeline/use-rename-sequence");
12
+ const SequenceCompositionsSection_1 = require("./SequenceCompositionsSection");
11
13
  const styles_1 = require("./styles");
12
14
  const useSequenceInspectorSourceLocation = (sequence) => {
13
15
  const { canOpenInEditor, openInEditor, originalLocation } = (0, use_open_sequence_in_editor_1.useOpenSequenceInEditor)(sequence);
@@ -66,15 +68,15 @@ const SequenceInspectorHeader = ({ sourceLocation, track }) => {
66
68
  const onRename = (0, react_1.useCallback)((newName) => {
67
69
  saveName(newName).catch(() => undefined);
68
70
  }, [saveName]);
69
- return (jsx_runtime_1.jsxs("div", { style: styles_1.sequenceHeader, children: [
70
- jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderTitle, children: jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename }) }), documentationLink ? (jsx_runtime_1.jsx("button", { type: "button", style: subtitleStyle, title: "Open component docs", onClick: openDocumentationLink, children: componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation })
71
- ] }));
71
+ return (jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeader, children: jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: sourceLocation.validatedLocation, name: componentName !== null && componentName !== void 0 ? componentName : null, children: [
72
+ jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderTitle, children: jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename }) }), documentationLink ? (jsx_runtime_1.jsx("button", { type: "button", style: subtitleStyle, title: "Open component docs", onClick: openDocumentationLink, children: componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation })
73
+ ] }) }));
72
74
  };
73
75
  exports.SequenceInspectorHeader = SequenceInspectorHeader;
74
76
  const SequenceInspectorHeaderWithDivider = ({ track }) => {
75
77
  const sourceLocation = (0, exports.useSequenceInspectorSourceLocation)(track.sequence);
76
78
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
77
- jsx_runtime_1.jsx(exports.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider })
79
+ jsx_runtime_1.jsx(exports.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(SequenceCompositionsSection_1.SequenceCompositionsSection, { track: track }), jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider })
78
80
  ] }));
79
81
  };
80
82
  exports.SequenceInspectorHeaderWithDivider = SequenceInspectorHeaderWithDivider;