@remotion/studio 4.0.499 → 4.0.500

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 (132) hide show
  1. package/dist/components/AssetSelector.js +8 -6
  2. package/dist/components/AssetSelectorItem.d.ts +24 -0
  3. package/dist/components/AssetSelectorItem.js +113 -80
  4. package/dist/components/CompositionSelector.js +2 -32
  5. package/dist/components/ControlButton.js +1 -0
  6. package/dist/components/ExplorerPanel.js +2 -1
  7. package/dist/components/ExplorerPanelRef.d.ts +2 -0
  8. package/dist/components/GlobalKeybindings.js +7 -1
  9. package/dist/components/InlineAction.d.ts +2 -1
  10. package/dist/components/InlineAction.js +2 -2
  11. package/dist/components/InlineDropdown.d.ts +1 -1
  12. package/dist/components/InlineDropdown.js +3 -2
  13. package/dist/components/InspectorPanel/AlignmentControls.d.ts +2 -2
  14. package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
  15. package/dist/components/InspectorPanel/CompositionInspector.js +8 -7
  16. package/dist/components/InspectorPanel/CompositionMetadata.js +170 -57
  17. package/dist/components/InspectorPanel/ConnectedCompositionsSection.d.ts +2 -2
  18. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -3
  19. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +7 -7
  20. package/dist/components/InspectorPanel/common.d.ts +17 -4
  21. package/dist/components/InspectorPanel/common.js +60 -6
  22. package/dist/components/InspectorPanel/use-composition-actions.js +1 -0
  23. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -1
  24. package/dist/components/InspectorSequenceSection.js +43 -19
  25. package/dist/components/KeyboardShortcutsExplainer.js +4 -2
  26. package/dist/components/Menu/MenuItem.js +2 -1
  27. package/dist/components/MenuCompositionName.js +30 -7
  28. package/dist/components/MenuToolbar.d.ts +0 -1
  29. package/dist/components/MenuToolbar.js +8 -7
  30. package/dist/components/MobilePanel.d.ts +2 -1
  31. package/dist/components/MobilePanel.js +29 -25
  32. package/dist/components/ModalContainer.d.ts +1 -0
  33. package/dist/components/ModalContainer.js +2 -2
  34. package/dist/components/Modals.js +1 -1
  35. package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
  36. package/dist/components/NewComposition/DismissableModal.js +2 -2
  37. package/dist/components/NewComposition/InputDragger.d.ts +7 -0
  38. package/dist/components/NewComposition/InputDragger.js +119 -8
  39. package/dist/components/OutlineToggle.d.ts +1 -3
  40. package/dist/components/OutlineToggle.js +2 -2
  41. package/dist/components/PreviewToolbar.js +10 -4
  42. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +7 -0
  43. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +44 -0
  44. package/dist/components/QuickSwitcher/NoResults.d.ts +1 -1
  45. package/dist/components/QuickSwitcher/NoResults.js +1 -0
  46. package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +5 -0
  47. package/dist/components/QuickSwitcher/QuickSwitcher.js +6 -2
  48. package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +5 -0
  49. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +76 -12
  50. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +4 -0
  51. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +11 -8
  52. package/dist/components/QuickSwitcher/asset-search.d.ts +9 -0
  53. package/dist/components/QuickSwitcher/asset-search.js +42 -0
  54. package/dist/components/SelectedOutlineCropControls.d.ts +8 -0
  55. package/dist/components/SelectedOutlineCropControls.js +299 -0
  56. package/dist/components/SelectedOutlineElement.js +83 -43
  57. package/dist/components/SelectedOutlineOverlay.d.ts +2 -2
  58. package/dist/components/SelectedOutlineOverlay.js +130 -8
  59. package/dist/components/SequencePropsSubscriptionProvider.d.ts +2 -0
  60. package/dist/components/SequencePropsSubscriptionProvider.js +31 -3
  61. package/dist/components/SidebarCollapserControls.d.ts +3 -1
  62. package/dist/components/SidebarCollapserControls.js +34 -29
  63. package/dist/components/SnappingToggle.d.ts +1 -3
  64. package/dist/components/SnappingToggle.js +2 -2
  65. package/dist/components/Timeline/TimelineAssetField.d.ts +9 -1
  66. package/dist/components/Timeline/TimelineAssetField.js +52 -100
  67. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +7 -3
  68. package/dist/components/Timeline/TimelineClipboardKeybindings.js +65 -38
  69. package/dist/components/Timeline/TimelineColorField.js +20 -1
  70. package/dist/components/Timeline/TimelineEffectPropItem.js +8 -77
  71. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
  72. package/dist/components/Timeline/TimelineHeightContainer.d.ts +2 -2
  73. package/dist/components/Timeline/TimelineKeyframeTracksContext.d.ts +3 -3
  74. package/dist/components/Timeline/TimelineList.d.ts +2 -2
  75. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +7 -1
  76. package/dist/components/Timeline/TimelineSelection.d.ts +5 -5
  77. package/dist/components/Timeline/TimelineSelection.js +8 -6
  78. package/dist/components/Timeline/TimelineSequence.js +1 -5
  79. package/dist/components/Timeline/TimelineSequenceItem.js +57 -10
  80. package/dist/components/Timeline/TimelineSequencePropItem.js +27 -75
  81. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +0 -1
  82. package/dist/components/Timeline/TimelineTrack.d.ts +2 -2
  83. package/dist/components/Timeline/TimelineTracks.d.ts +2 -2
  84. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  85. package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -12
  86. package/dist/components/Timeline/reset-selected-timeline-props.js +18 -10
  87. package/dist/components/Timeline/save-effect-prop.d.ts +10 -0
  88. package/dist/components/Timeline/save-effect-prop.js +52 -1
  89. package/dist/components/Timeline/should-show-track-in-timeline.d.ts +2 -2
  90. package/dist/components/Timeline/timeline-asset-link.js +17 -1
  91. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +4 -0
  92. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +9 -3
  93. package/dist/components/Timeline/use-timeline-height.d.ts +2 -2
  94. package/dist/components/TopPanel.js +2 -2
  95. package/dist/components/UndoRedoButtons.js +27 -5
  96. package/dist/components/composition-drop-preview.js +1 -0
  97. package/dist/components/menu-toolbar-height.d.ts +1 -0
  98. package/dist/components/menu-toolbar-height.js +4 -0
  99. package/dist/components/selected-outline-drag.d.ts +41 -4
  100. package/dist/components/selected-outline-drag.js +179 -2
  101. package/dist/components/selected-outline-geometry.d.ts +1 -0
  102. package/dist/components/selected-outline-measurement.d.ts +11 -0
  103. package/dist/components/selected-outline-measurement.js +64 -3
  104. package/dist/components/selected-outline-types.d.ts +44 -1
  105. package/dist/components/selected-outline-types.js +21 -1
  106. package/dist/error-overlay/remotion-overlay/Overlay.js +3 -3
  107. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -3
  108. package/dist/esm/{chunk-pk1zwsn1.js → chunk-dr1y1vm3.js} +8417 -7127
  109. package/dist/esm/internals.mjs +8417 -7127
  110. package/dist/esm/previewEntry.mjs +51241 -49953
  111. package/dist/esm/renderEntry.mjs +1 -1
  112. package/dist/helpers/calculate-timeline.d.ts +2 -2
  113. package/dist/helpers/calculate-timeline.js +8 -28
  114. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +3 -10
  115. package/dist/helpers/get-timeline-sequence-sort-key.js +5 -13
  116. package/dist/helpers/interactivity-enabled.d.ts +1 -0
  117. package/dist/helpers/interactivity-enabled.js +7 -2
  118. package/dist/helpers/is-mac.d.ts +1 -0
  119. package/dist/helpers/is-mac.js +4 -0
  120. package/dist/helpers/open-in-editor.d.ts +5 -1
  121. package/dist/helpers/open-in-editor.js +15 -1
  122. package/dist/helpers/sort-by-nonce-history.js +97 -19
  123. package/dist/helpers/use-keybinding.js +2 -3
  124. package/dist/helpers/use-menu-structure.js +10 -1
  125. package/dist/icons/caret.d.ts +1 -0
  126. package/dist/icons/caret.js +2 -2
  127. package/dist/icons/pen.d.ts +5 -0
  128. package/dist/icons/pen.js +8 -0
  129. package/dist/state/modals.d.ts +5 -0
  130. package/package.json +12 -12
  131. package/dist/helpers/get-timeline-sequence-hash.d.ts +0 -6
  132. package/dist/helpers/get-timeline-sequence-hash.js +0 -33
@@ -48,6 +48,7 @@ const z_index_1 = require("../state/z-index");
48
48
  const AssetSelectorItem_1 = require("./AssetSelectorItem");
49
49
  const styles_1 = require("./Menu/styles");
50
50
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
51
+ const ExplorerQuickSwitcherTrigger_1 = require("./QuickSwitcher/ExplorerQuickSwitcherTrigger");
51
52
  const use_static_files_1 = require("./use-static-files");
52
53
  const container = {
53
54
  display: 'flex',
@@ -158,11 +159,12 @@ const AssetSelector = ({ readOnlyStudio }) => {
158
159
  setDropLocation(null);
159
160
  }
160
161
  }, [dropLocation, staticFiles]);
161
- return (jsx_runtime_1.jsx("div", { style: container, onDragOver: shouldAllowUpload ? onDragOver : undefined, onDrop: shouldAllowUpload ? onDrop : undefined, children: staticFiles.length === 0 ? (publicFolderExists ? (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, place a file in the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
162
- " folder of your project or drag and drop a file here."] }) })) : (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, create a folder called", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
163
- " in the root of your project and place a file in it."] }) }))) : (jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: {
164
- ...list,
165
- backgroundColor: isDropDiv ? colors_1.WHITE_ALPHA_06 : colors_1.BACKGROUND,
166
- }, onDragEnter: onDragEnter, onDragLeave: onDragLeave, children: jsx_runtime_1.jsx(AssetSelectorItem_1.AssetFolderTree, { item: assetTree, level: 0, parentFolder: null, name: null, tabIndex: tabIndex, toggleFolder: toggleFolder, dropLocation: dropLocation, setDropLocation: setDropLocation, readOnlyStudio: readOnlyStudio }) })) }));
162
+ return (jsx_runtime_1.jsxs("div", { style: container, onDragOver: shouldAllowUpload ? onDragOver : undefined, onDrop: shouldAllowUpload ? onDrop : undefined, children: [
163
+ jsx_runtime_1.jsx(ExplorerQuickSwitcherTrigger_1.ExplorerQuickSwitcherTrigger, { mode: "assets", showShortcut: true, tabIndex: tabIndex }), staticFiles.length === 0 ? (publicFolderExists ? (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, place a file in the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
164
+ " folder of your project or drag and drop a file here."] }) })) : (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, create a folder called", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
165
+ " in the root of your project and place a file in it."] }) }))) : (jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: {
166
+ ...list,
167
+ backgroundColor: isDropDiv ? colors_1.WHITE_ALPHA_06 : colors_1.BACKGROUND,
168
+ }, onDragEnter: onDragEnter, onDragLeave: onDragLeave, children: jsx_runtime_1.jsx(AssetSelectorItem_1.AssetFolderTree, { item: assetTree, level: 0, parentFolder: null, name: null, tabIndex: tabIndex, toggleFolder: toggleFolder, dropLocation: dropLocation, setDropLocation: setDropLocation, readOnlyStudio: readOnlyStudio }) }))] }));
167
169
  };
168
170
  exports.AssetSelector = AssetSelector;
@@ -1,5 +1,29 @@
1
1
  import React from 'react';
2
2
  import type { AssetStructure } from '../helpers/create-folder-tree';
3
+ import type { ComboboxValue } from './NewComposition/ComboBox';
4
+ export declare const getAssetActionAvailability: ({ readOnlyStudio, connectionStatus, publicFolderExists, }: {
5
+ readOnlyStudio: boolean;
6
+ connectionStatus: "connected" | "disconnected" | "init";
7
+ publicFolderExists: string | null;
8
+ }) => {
9
+ mutationsDisabled: boolean;
10
+ fileExplorerDisabled: boolean;
11
+ };
12
+ export declare const getCanDragAsset: ({ readOnlyStudio, relativePath, }: {
13
+ readOnlyStudio: boolean;
14
+ relativePath: string;
15
+ }) => boolean;
16
+ export declare const getAssetContextMenuItems: ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerDisabled, mutationsDisabled, }: {
17
+ relativePath: string;
18
+ fileManagerName: string;
19
+ copyFileName: () => void;
20
+ copyStaticFilePath: () => void;
21
+ openAssetInExplorer: () => void;
22
+ renameAsset: () => void;
23
+ deleteAsset: () => void;
24
+ fileExplorerDisabled: boolean;
25
+ mutationsDisabled: boolean;
26
+ }) => ComboboxValue[];
3
27
  export declare const AssetFolderTree: React.FC<{
4
28
  readonly item: AssetStructure;
5
29
  readonly name: string | null;
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.AssetFolderTree = void 0;
36
+ exports.AssetFolderTree = exports.getAssetContextMenuItems = exports.getCanDragAsset = exports.getAssetActionAvailability = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const drag_and_drop_1 = require("@remotion/drag-and-drop");
39
39
  const react_1 = require("react");
@@ -105,6 +105,91 @@ const revealIconStyle = {
105
105
  height: 12,
106
106
  color: colors_1.CURRENT_COLOR,
107
107
  };
108
+ const getAssetActionAvailability = ({ readOnlyStudio, connectionStatus, publicFolderExists, }) => {
109
+ return {
110
+ mutationsDisabled: readOnlyStudio || connectionStatus !== 'connected',
111
+ fileExplorerDisabled: publicFolderExists === null ||
112
+ readOnlyStudio ||
113
+ connectionStatus !== 'connected',
114
+ };
115
+ };
116
+ exports.getAssetActionAvailability = getAssetActionAvailability;
117
+ const getCanDragAsset = ({ readOnlyStudio, relativePath, }) => {
118
+ return !readOnlyStudio && (0, import_assets_1.getAssetElementFromPath)(relativePath) !== null;
119
+ };
120
+ exports.getCanDragAsset = getCanDragAsset;
121
+ const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerDisabled, mutationsDisabled, }) => {
122
+ return [
123
+ (0, open_in_new_window_1.getOpenInNewWindowMenuItem)(`/assets/${relativePath}`),
124
+ {
125
+ type: 'divider',
126
+ id: 'open-in-new-window-divider',
127
+ },
128
+ {
129
+ id: 'copy-asset-file-name',
130
+ keyHint: null,
131
+ label: 'Copy file name',
132
+ leftItem: null,
133
+ onClick: copyFileName,
134
+ quickSwitcherLabel: 'Copy asset file name',
135
+ subMenu: null,
136
+ type: 'item',
137
+ value: 'copy-asset-file-name',
138
+ },
139
+ {
140
+ id: 'copy-asset-static-file-path',
141
+ keyHint: null,
142
+ label: 'Copy staticFile() path',
143
+ leftItem: null,
144
+ onClick: copyStaticFilePath,
145
+ quickSwitcherLabel: 'Copy staticFile() path',
146
+ subMenu: null,
147
+ type: 'item',
148
+ value: 'copy-asset-static-file-path',
149
+ },
150
+ {
151
+ type: 'divider',
152
+ id: 'asset-file-actions-divider',
153
+ },
154
+ {
155
+ id: 'open-asset-in-explorer',
156
+ keyHint: null,
157
+ label: `Show in ${fileManagerName}`,
158
+ leftItem: null,
159
+ onClick: openAssetInExplorer,
160
+ quickSwitcherLabel: `Show asset in ${fileManagerName}`,
161
+ subMenu: null,
162
+ type: 'item',
163
+ value: 'open-asset-in-explorer',
164
+ disabled: fileExplorerDisabled,
165
+ },
166
+ {
167
+ id: 'rename-asset',
168
+ keyHint: null,
169
+ label: 'Rename...',
170
+ leftItem: null,
171
+ onClick: renameAsset,
172
+ quickSwitcherLabel: 'Rename asset...',
173
+ subMenu: null,
174
+ type: 'item',
175
+ value: 'rename-asset',
176
+ disabled: mutationsDisabled,
177
+ },
178
+ {
179
+ id: 'delete-asset',
180
+ keyHint: null,
181
+ label: 'Delete...',
182
+ leftItem: null,
183
+ onClick: deleteAsset,
184
+ quickSwitcherLabel: 'Delete asset...',
185
+ subMenu: null,
186
+ type: 'item',
187
+ value: 'delete-asset',
188
+ disabled: mutationsDisabled,
189
+ },
190
+ ];
191
+ };
192
+ exports.getAssetContextMenuItems = getAssetContextMenuItems;
108
193
  const AssetFolderItem = ({ tabIndex, item, level, parentFolder, toggleFolder, dropLocation, setDropLocation, readOnlyStudio, }) => {
109
194
  const [hovered, setHovered] = (0, react_1.useState)(false);
110
195
  const openFolderTimerRef = (0, react_1.useRef)(null);
@@ -199,7 +284,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
199
284
  return false;
200
285
  }, [canvasContent, relativePath]);
201
286
  const canDragAsset = (0, react_1.useMemo)(() => {
202
- return !readOnlyStudio && (0, import_assets_1.getAssetElementFromPath)(relativePath) !== null;
287
+ return (0, exports.getCanDragAsset)({ readOnlyStudio, relativePath });
203
288
  }, [readOnlyStudio, relativePath]);
204
289
  const onPointerLeave = (0, react_1.useCallback)(() => {
205
290
  setHovered(false);
@@ -313,7 +398,11 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
313
398
  (0, NotificationCenter_1.showNotification)(`Could not open file: ${err.message}`, 2000);
314
399
  });
315
400
  }, [relativePath]);
316
- const serverActionDisabled = readOnlyStudio || connectionStatus !== 'connected';
401
+ const { mutationsDisabled, fileExplorerDisabled } = (0, exports.getAssetActionAvailability)({
402
+ readOnlyStudio,
403
+ connectionStatus,
404
+ publicFolderExists: window.remotion_publicFolderExists,
405
+ });
317
406
  const deleteAsset = (0, react_1.useCallback)(() => {
318
407
  confirm({
319
408
  title: 'Delete asset',
@@ -338,90 +427,34 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
338
427
  (0, NotificationCenter_1.showNotification)(`Could not delete ${relativePath}: ${err.message}`, 3000);
339
428
  });
340
429
  }, [confirm, relativePath]);
430
+ const renameAsset = (0, react_1.useCallback)(() => {
431
+ setSelectedModal({
432
+ type: 'rename-static-file',
433
+ relativePath,
434
+ });
435
+ }, [relativePath, setSelectedModal]);
341
436
  const contextMenu = (0, react_1.useMemo)(() => {
342
- return [
343
- (0, open_in_new_window_1.getOpenInNewWindowMenuItem)(`/assets/${relativePath}`),
344
- {
345
- type: 'divider',
346
- id: 'open-in-new-window-divider',
347
- },
348
- {
349
- id: 'copy-asset-file-name',
350
- keyHint: null,
351
- label: 'Copy file name',
352
- leftItem: null,
353
- onClick: copyFileName,
354
- quickSwitcherLabel: 'Copy asset file name',
355
- subMenu: null,
356
- type: 'item',
357
- value: 'copy-asset-file-name',
358
- },
359
- {
360
- id: 'copy-asset-static-file-path',
361
- keyHint: null,
362
- label: 'Copy staticFile() path',
363
- leftItem: null,
364
- onClick: copyStaticFilePath,
365
- quickSwitcherLabel: 'Copy staticFile() path',
366
- subMenu: null,
367
- type: 'item',
368
- value: 'copy-asset-static-file-path',
369
- },
370
- {
371
- type: 'divider',
372
- id: 'asset-file-actions-divider',
373
- },
374
- {
375
- id: 'open-asset-in-explorer',
376
- keyHint: null,
377
- label: `Show in ${fileManagerName}`,
378
- leftItem: null,
379
- onClick: openAssetInExplorer,
380
- quickSwitcherLabel: `Show asset in ${fileManagerName}`,
381
- subMenu: null,
382
- type: 'item',
383
- value: 'open-asset-in-explorer',
384
- disabled: serverActionDisabled || window.remotion_publicFolderExists === null,
385
- },
386
- {
387
- id: 'rename-asset',
388
- keyHint: null,
389
- label: 'Rename...',
390
- leftItem: null,
391
- onClick: () => {
392
- setSelectedModal({
393
- type: 'rename-static-file',
394
- relativePath,
395
- });
396
- },
397
- quickSwitcherLabel: 'Rename asset...',
398
- subMenu: null,
399
- type: 'item',
400
- value: 'rename-asset',
401
- disabled: serverActionDisabled,
402
- },
403
- {
404
- id: 'delete-asset',
405
- keyHint: null,
406
- label: 'Delete...',
407
- leftItem: null,
408
- onClick: deleteAsset,
409
- quickSwitcherLabel: 'Delete asset...',
410
- subMenu: null,
411
- type: 'item',
412
- value: 'delete-asset',
413
- disabled: serverActionDisabled,
414
- },
415
- ];
437
+ return (0, exports.getAssetContextMenuItems)({
438
+ relativePath,
439
+ fileManagerName,
440
+ copyFileName,
441
+ copyStaticFilePath,
442
+ openAssetInExplorer,
443
+ renameAsset,
444
+ deleteAsset,
445
+ fileExplorerDisabled,
446
+ mutationsDisabled,
447
+ });
416
448
  }, [
417
449
  copyFileName,
418
450
  copyStaticFilePath,
419
451
  deleteAsset,
452
+ fileExplorerDisabled,
420
453
  fileManagerName,
454
+ mutationsDisabled,
421
455
  openAssetInExplorer,
456
+ renameAsset,
422
457
  relativePath,
423
- serverActionDisabled,
424
- setSelectedModal,
425
458
  ]);
426
459
  const revealInExplorer = (0, react_1.useCallback)((e) => {
427
460
  e.stopPropagation();
@@ -433,7 +466,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
433
466
  }, [copyStaticFilePath]);
434
467
  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: [
435
468
  jsx_runtime_1.jsx(AssetFileIcon_1.AssetFileIcon, { fileType: previewFileType, 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: [
436
- 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: [
469
+ 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 }), fileExplorerDisabled ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
437
470
  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 })
438
471
  ] }))] })) : null] }) }) }));
439
472
  };
@@ -6,19 +6,18 @@ const drag_and_drop_1 = require("@remotion/drag-and-drop");
6
6
  const studio_shared_1 = require("@remotion/studio-shared");
7
7
  const react_1 = require("react");
8
8
  const remotion_1 = require("remotion");
9
- const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
10
9
  const client_id_1 = require("../helpers/client-id");
11
10
  const colors_1 = require("../helpers/colors");
12
11
  const create_folder_tree_1 = require("../helpers/create-folder-tree");
13
12
  const persist_open_folders_1 = require("../helpers/persist-open-folders");
14
13
  const sort_by_nonce_history_1 = require("../helpers/sort-by-nonce-history");
15
- const use_keybinding_1 = require("../helpers/use-keybinding");
16
14
  const modals_1 = require("../state/modals");
17
15
  const z_index_1 = require("../state/z-index");
18
16
  const CompositionSelectorItem_1 = require("./CompositionSelectorItem");
19
17
  const ContextMenu_1 = require("./ContextMenu");
20
18
  const InitialCompositionLoader_1 = require("./InitialCompositionLoader");
21
19
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
20
+ const ExplorerQuickSwitcherTrigger_1 = require("./QuickSwitcher/ExplorerQuickSwitcherTrigger");
22
21
  const actions_1 = require("./RenderQueue/actions");
23
22
  const root_composition_menu_items_1 = require("./root-composition-menu-items");
24
23
  const useCompositionNavigation = () => {
@@ -65,28 +64,6 @@ const container = {
65
64
  overflow: 'hidden',
66
65
  backgroundColor: colors_1.BACKGROUND,
67
66
  };
68
- const quickSwitcherArea = {
69
- padding: '4px 12px',
70
- borderBottom: `1px solid ${colors_1.BLACK_HEX}`,
71
- };
72
- const quickSwitcherTrigger = {
73
- backgroundColor: colors_1.WHITE_ALPHA_06,
74
- borderRadius: 5,
75
- padding: '4px 10px',
76
- color: colors_1.LIGHT_TEXT,
77
- fontSize: 12,
78
- cursor: 'pointer',
79
- display: 'flex',
80
- alignItems: 'center',
81
- justifyContent: 'space-between',
82
- border: 'none',
83
- width: '100%',
84
- appearance: 'none',
85
- };
86
- const shortcutLabel = {
87
- fontSize: 11,
88
- opacity: 0.6,
89
- };
90
67
  const autoScrollThreshold = 70;
91
68
  const maxAutoScrollSpeed = 18;
92
69
  const getAutoScrollSpeed = ({ clientY, element, }) => {
@@ -146,13 +123,6 @@ const CompositionSelector = () => {
146
123
  var _a;
147
124
  (_a = remotion_1.Internals.compositionSelectorRef.current) === null || _a === void 0 ? void 0 : _a.toggleFolder(folderName, parentName);
148
125
  }, []);
149
- const openQuickSwitcher = (0, react_1.useCallback)(() => {
150
- setSelectedModal({
151
- type: 'quick-switcher',
152
- mode: 'compositions',
153
- invocationTimestamp: Date.now(),
154
- });
155
- }, [setSelectedModal]);
156
126
  const clearRootDragHover = (0, react_1.useCallback)(() => {
157
127
  setRootDragHovered(false);
158
128
  }, []);
@@ -264,7 +234,7 @@ const CompositionSelector = () => {
264
234
  }
265
235
  }, [compositions, stopCompositionListAutoScroll]);
266
236
  return (jsx_runtime_1.jsxs("div", { style: container, children: [
267
- 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) => {
237
+ jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: listRef, values: rootContextMenuItems, onOpen: null }), jsx_runtime_1.jsx(ExplorerQuickSwitcherTrigger_1.ExplorerQuickSwitcherTrigger, { mode: "compositions", showShortcut: true, tabIndex: tabIndex }), 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) => {
268
238
  return (jsx_runtime_1.jsx(CompositionSelectorItem_1.CompositionSelectorItem, { level: 0, currentComposition: canvasContent && canvasContent.type === 'composition'
269
239
  ? canvasContent.compositionId
270
240
  : null, selectComposition: selectComposition, toggleFolder: toggleFolder, clearRootDragHover: clearRootDragHover, tabIndex: tabIndex, item: c }, c.key + c.type));
@@ -15,6 +15,7 @@ const ControlButton = (props) => {
15
15
  justifyContent: 'center',
16
16
  width: exports.CONTROL_BUTTON_SIZE,
17
17
  height: exports.CONTROL_BUTTON_SIZE,
18
+ flexShrink: 0,
18
19
  background: 'none',
19
20
  border: 'none',
20
21
  padding: 0,
@@ -43,6 +43,7 @@ const ExplorerPanel = ({ readOnlyStudio }) => {
43
43
  }, []);
44
44
  (0, react_1.useImperativeHandle)(ExplorerPanelRef_1.explorerSidebarTabs, () => {
45
45
  return {
46
+ getSelectedPanel: () => panel,
46
47
  selectAssetsPanel: () => {
47
48
  setPanel('assets');
48
49
  persistSelectedOptionsSidebarPanel('assets');
@@ -52,7 +53,7 @@ const ExplorerPanel = ({ readOnlyStudio }) => {
52
53
  persistSelectedOptionsSidebarPanel('compositions');
53
54
  },
54
55
  };
55
- }, []);
56
+ }, [panel]);
56
57
  const onPointerDown = (0, react_1.useCallback)((e) => {
57
58
  // Prevent deselection of currently selected items
58
59
  e.stopPropagation();
@@ -1,4 +1,6 @@
1
+ export type ExplorerSidebarPanel = 'assets' | 'compositions';
1
2
  export declare const explorerSidebarTabs: import("react").RefObject<{
3
+ getSelectedPanel: () => ExplorerSidebarPanel;
2
4
  selectAssetsPanel: () => void;
3
5
  selectCompositionPanel: () => void;
4
6
  } | null>;
@@ -12,6 +12,7 @@ const editor_snapping_1 = require("../state/editor-snapping");
12
12
  const modals_1 = require("../state/modals");
13
13
  const AskAiModal_1 = require("./AskAiModal");
14
14
  const CompositionSelector_1 = require("./CompositionSelector");
15
+ const ExplorerPanelRef_1 = require("./ExplorerPanelRef");
15
16
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
16
17
  const TimelineSelection_1 = require("./Timeline/TimelineSelection");
17
18
  const sequencePropShortcuts = {
@@ -106,10 +107,14 @@ const GlobalKeybindings = () => {
106
107
  event: 'keydown',
107
108
  key: 'k',
108
109
  callback: () => {
110
+ var _a;
109
111
  setSelectedModal({
110
112
  type: 'quick-switcher',
111
- mode: 'compositions',
113
+ mode: ((_a = ExplorerPanelRef_1.explorerSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.getSelectedPanel()) === 'assets'
114
+ ? 'assets'
115
+ : 'compositions',
112
116
  invocationTimestamp: Date.now(),
117
+ assetSelection: null,
113
118
  });
114
119
  },
115
120
  triggerIfInputFieldFocused: true,
@@ -159,6 +164,7 @@ const GlobalKeybindings = () => {
159
164
  type: 'quick-switcher',
160
165
  mode: 'docs',
161
166
  invocationTimestamp: Date.now(),
167
+ assetSelection: null,
162
168
  });
163
169
  },
164
170
  commandCtrlKey: false,
@@ -5,5 +5,6 @@ export type InlineActionProps = {
5
5
  readonly disabled?: boolean;
6
6
  readonly renderAction: RenderInlineAction;
7
7
  readonly title?: string;
8
+ readonly unhoveredColor?: string;
8
9
  };
9
- export declare const InlineAction: ({ renderAction, onClick, disabled, title, }: InlineActionProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const InlineAction: ({ renderAction, onClick, disabled, title, unhoveredColor, }: InlineActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../helpers/colors");
7
7
  const z_index_1 = require("../state/z-index");
8
- const InlineAction = ({ renderAction, onClick, disabled, title, }) => {
8
+ const InlineAction = ({ renderAction, onClick, disabled, title, unhoveredColor = colors_1.LIGHT_TEXT, }) => {
9
9
  const { tabIndex } = (0, z_index_1.useZIndex)();
10
10
  const [hovered, setHovered] = (0, react_1.useState)(false);
11
11
  const onPointerEnter = (0, react_1.useCallback)(() => {
@@ -30,6 +30,6 @@ const InlineAction = ({ renderAction, onClick, disabled, title, }) => {
30
30
  pointerEvents: disabled ? 'none' : 'auto',
31
31
  };
32
32
  }, [disabled, hovered]);
33
- return (jsx_runtime_1.jsx("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, title: title, children: renderAction(hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT) }));
33
+ return (jsx_runtime_1.jsx("button", { type: "button", disabled: disabled, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, title: title, children: renderAction(hovered ? colors_1.WHITE : unhoveredColor) }));
34
34
  };
35
35
  exports.InlineAction = InlineAction;
@@ -1,5 +1,5 @@
1
1
  import { type InlineActionProps } from './InlineAction';
2
2
  import type { ComboboxValue } from './NewComposition/ComboBox';
3
- export declare const InlineDropdown: ({ values, ...props }: Omit<InlineActionProps, "onClick"> & {
3
+ export declare const InlineDropdown: ({ values, unhoveredColor, ...props }: Omit<InlineActionProps, "onClick"> & {
4
4
  readonly values: ComboboxValue[];
5
5
  }) => import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const player_1 = require("@remotion/player");
9
9
  const react_1 = require("react");
10
10
  const react_dom_1 = __importDefault(require("react-dom"));
11
+ const colors_1 = require("../helpers/colors");
11
12
  const mobile_layout_1 = require("../helpers/mobile-layout");
12
13
  const noop_1 = require("../helpers/noop");
13
14
  const z_index_1 = require("../state/z-index");
@@ -15,7 +16,7 @@ const InlineAction_1 = require("./InlineAction");
15
16
  const portals_1 = require("./Menu/portals");
16
17
  const styles_1 = require("./Menu/styles");
17
18
  const MenuContent_1 = require("./NewComposition/MenuContent");
18
- const InlineDropdown = ({ values, ...props }) => {
19
+ const InlineDropdown = ({ values, unhoveredColor, ...props }) => {
19
20
  const ref = (0, react_1.useRef)(null);
20
21
  const [opened, setOpened] = (0, react_1.useState)({ type: 'not-open' });
21
22
  const { currentZIndex } = (0, z_index_1.useZIndex)();
@@ -79,7 +80,7 @@ const InlineDropdown = ({ values, ...props }) => {
79
80
  setOpened({ type: 'not-open' });
80
81
  }, []);
81
82
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
82
- jsx_runtime_1.jsx("div", { ref: ref, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, ...props }) }), portalStyle
83
+ jsx_runtime_1.jsx("div", { ref: ref, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, unhoveredColor: opened.type === 'open' ? colors_1.WHITE : unhoveredColor, ...props }) }), portalStyle
83
84
  ? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
84
85
  : null] }));
85
86
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { TrackWithHash } from '../../helpers/get-timeline-sequence-sort-key';
2
+ import type { TimelineTrackData } from '../../helpers/get-timeline-sequence-sort-key';
3
3
  export declare const AlignmentControls: React.FC<{
4
- readonly track: TrackWithHash;
4
+ readonly track: TimelineTrackData;
5
5
  }>;
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const client_id_1 = require("../../helpers/client-id");
8
+ const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
8
9
  const align_bottom_1 = require("../../icons/align-bottom");
9
10
  const align_center_horizontal_1 = require("../../icons/align-center-horizontal");
10
11
  const align_center_vertical_1 = require("../../icons/align-center-vertical");
@@ -62,7 +63,8 @@ const AlignmentControls = ({ track }) => {
62
63
  const handleAlign = (0, react_1.useCallback)((direction) => {
63
64
  var _a;
64
65
  var _b, _c, _d, _e;
65
- if (previewServerState.type !== 'connected' ||
66
+ if (!(0, interactivity_enabled_1.isStudioInteractivityEnabled)() ||
67
+ previewServerState.type !== 'connected' ||
66
68
  !track.nodePathInfo ||
67
69
  !track.sequence.controls) {
68
70
  return;
@@ -177,7 +179,8 @@ const AlignmentControls = ({ track }) => {
177
179
  getDragOverrides,
178
180
  setPropStatuses,
179
181
  ]);
180
- if (previewServerState.type !== 'connected' ||
182
+ if (!(0, interactivity_enabled_1.isStudioInteractivityEnabled)() ||
183
+ previewServerState.type !== 'connected' ||
181
184
  !track.nodePathInfo ||
182
185
  !track.sequence.controls ||
183
186
  !currentCompositionMetadata) {
@@ -25,14 +25,14 @@ const actionIconStyle = {
25
25
  height: 18,
26
26
  width: 18,
27
27
  };
28
- const CompositionActions = () => {
28
+ const CompositionActions = ({ readOnlyStudio }) => {
29
29
  const { canInsertAsset, canInsertSolid, canShowInsertAsset, canShowInsertSolid, insertAsset, insertSolid, } = (0, use_composition_actions_1.useCompositionActions)();
30
- if (!canShowInsertAsset && !canShowInsertSolid) {
30
+ if (readOnlyStudio || (!canShowInsertAsset && !canShowInsertSolid)) {
31
31
  return null;
32
32
  }
33
33
  return (jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null] }));
34
34
  };
35
- const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, setDefaultProps }) => {
35
+ const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
36
36
  var _a;
37
37
  const z = (0, get_zod_if_possible_1.useZodIfPossible)();
38
38
  const canSaveDefaultProps = (0, react_1.useContext)(ObserveDefaultPropsContext_1.ObserveDefaultPropsContext);
@@ -79,7 +79,7 @@ const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, setD
79
79
  propsEditType: 'default-props',
80
80
  showCannotSaveDefaultPropsWarning: canShowDefaultPropsSection,
81
81
  });
82
- if (!canShowDefaultPropsSection) {
82
+ if (readOnlyStudio || !canShowDefaultPropsSection) {
83
83
  return null;
84
84
  }
85
85
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
@@ -92,9 +92,10 @@ const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, setD
92
92
  ] })
93
93
  ] }));
94
94
  };
95
- const CompositionVisualControlsSection = () => {
95
+ const CompositionVisualControlsSection = ({ readOnlyStudio }) => {
96
96
  const { handles: visualControlHandles } = (0, react_1.useContext)(VisualControls_1.VisualControlsContext);
97
- const hasVisualControls = (0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
97
+ const hasVisualControls = !readOnlyStudio &&
98
+ (0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
98
99
  Object.keys(visualControlHandles).length > 0;
99
100
  if (!hasVisualControls) {
100
101
  return null;
@@ -109,7 +110,7 @@ const CompositionInspector = ({ composition, currentDefaultProps, readOnlyStudio
109
110
  return (jsx_runtime_1.jsxs("div", { style: styles_1.scrollableContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
110
111
  jsx_runtime_1.jsxs("div", { style: styles_1.inspectorOverviewSection, children: [
111
112
  jsx_runtime_1.jsx(CompositionInspectorHeader_1.CompositionInspectorHeader, {}), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(CompositionMetadata_1.CompositionMetadata, { compositionId: composition.id, disabled: readOnlyStudio, stack: composition.stack })
112
- ] }), jsx_runtime_1.jsx(CompositionDefaultPropsSection, { composition: composition, currentDefaultProps: currentDefaultProps, setDefaultProps: setDefaultProps }), jsx_runtime_1.jsx(CompositionVisualControlsSection, {}), jsx_runtime_1.jsx(CompositionActions, {})
113
+ ] }), jsx_runtime_1.jsx(CompositionDefaultPropsSection, { composition: composition, currentDefaultProps: currentDefaultProps, readOnlyStudio: readOnlyStudio, setDefaultProps: setDefaultProps }), jsx_runtime_1.jsx(CompositionVisualControlsSection, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CompositionActions, { readOnlyStudio: readOnlyStudio })
113
114
  ] }));
114
115
  };
115
116
  exports.CompositionInspector = CompositionInspector;