@remotion/studio 4.0.516 → 4.0.518

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 (157) hide show
  1. package/dist/components/AssetSelector.js +63 -22
  2. package/dist/components/AssetSelectorItem.d.ts +2 -1
  3. package/dist/components/AssetSelectorItem.js +41 -10
  4. package/dist/components/Canvas.js +15 -12
  5. package/dist/components/CanvasCaptureDropHandler.d.ts +4 -0
  6. package/dist/components/CanvasCaptureDropHandler.js +42 -0
  7. package/dist/components/CanvasOrLoading.js +4 -3
  8. package/dist/components/CaptionInspector.js +1 -1
  9. package/dist/components/CaptionTextEditor.js +32 -8
  10. package/dist/components/CheckboardToggle.js +1 -1
  11. package/dist/components/Checkbox.d.ts +0 -1
  12. package/dist/components/Checkbox.js +2 -19
  13. package/dist/components/CompositionContextButton.js +2 -1
  14. package/dist/components/CompositionSelector.js +1 -1
  15. package/dist/components/ConfigureLicenseModal.js +79 -46
  16. package/dist/components/CurrentAsset.d.ts +1 -1
  17. package/dist/components/CurrentAsset.js +9 -4
  18. package/dist/components/Editor.js +2 -1
  19. package/dist/components/EditorContent.js +11 -5
  20. package/dist/components/EditorContexts.js +2 -1
  21. package/dist/components/EditorRuler/Ruler.d.ts +1 -0
  22. package/dist/components/EditorRuler/Ruler.js +9 -8
  23. package/dist/components/EditorRuler/index.d.ts +1 -0
  24. package/dist/components/EditorRuler/index.js +3 -4
  25. package/dist/components/EditorRuler/use-is-ruler-visible.d.ts +1 -1
  26. package/dist/components/EditorRuler/use-is-ruler-visible.js +8 -2
  27. package/dist/components/ElementInstallConfirmation.d.ts +5 -0
  28. package/dist/components/ElementInstallConfirmation.js +25 -1
  29. package/dist/components/ElementLibraryModal.d.ts +5 -0
  30. package/dist/components/ElementLibraryModal.js +40 -0
  31. package/dist/components/FilePreview.js +71 -0
  32. package/dist/components/InlineCaptionInspector.js +13 -2
  33. package/dist/components/InlineEditableTitle.js +2 -2
  34. package/dist/components/InspectorPanel/CompositionInspector.js +11 -38
  35. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  36. package/dist/components/InspectorPanel/CompositionMetadata.js +11 -4
  37. package/dist/components/InspectorPanel/EasingInspector.js +2 -2
  38. package/dist/components/InspectorPanel/ElementLibraryButton.d.ts +2 -0
  39. package/dist/components/InspectorPanel/ElementLibraryButton.js +139 -0
  40. package/dist/components/InspectorPanel/KeyframeInspector.js +1 -1
  41. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +12 -5
  42. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -3
  43. package/dist/components/InspectorPanel/common.d.ts +0 -1
  44. package/dist/components/InspectorPanel/common.js +3 -7
  45. package/dist/components/InspectorPanel/inspector-selection.d.ts +2 -2
  46. package/dist/components/InspectorPanel/styles.d.ts +0 -1
  47. package/dist/components/InspectorPanel/styles.js +3 -4
  48. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +1 -2
  49. package/dist/components/InspectorSequenceSection.d.ts +1 -2
  50. package/dist/components/InspectorSourceLocation.js +1 -1
  51. package/dist/components/Menu/MenuItem.js +15 -6
  52. package/dist/components/MenuToolbar.js +7 -3
  53. package/dist/components/Modals.js +51 -1
  54. package/dist/components/PlaybackRateSelector.js +3 -6
  55. package/dist/components/Preview.js +83 -5
  56. package/dist/components/PreviewToolbar.js +10 -4
  57. package/dist/components/PreviewToolbarOverflowButton.d.ts +1 -0
  58. package/dist/components/PreviewToolbarOverflowButton.js +9 -2
  59. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +2 -0
  60. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +28 -8
  61. package/dist/components/RadioButton.d.ts +6 -0
  62. package/dist/components/RadioButton.js +62 -0
  63. package/dist/components/RenderButton.js +2 -1
  64. package/dist/components/RulersAndGuidesToggle.d.ts +3 -1
  65. package/dist/components/RulersAndGuidesToggle.js +18 -7
  66. package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
  67. package/dist/components/SelectedOutlineOverlay.d.ts +1 -3
  68. package/dist/components/SelectedOutlineOverlay.js +21 -17
  69. package/dist/components/SelectedOutlinePolygon.d.ts +1 -2
  70. package/dist/components/SelectedOutlineRenderer.d.ts +2 -3
  71. package/dist/components/SelectedOutlineRenderer.js +9 -78
  72. package/dist/components/SelectedOutlineUvControls.d.ts +1 -1
  73. package/dist/components/SettingsModal.js +1 -1
  74. package/dist/components/SettingsModalFooter.d.ts +3 -1
  75. package/dist/components/SettingsModalFooter.js +19 -4
  76. package/dist/components/ShowPixelGridProvider.d.ts +4 -0
  77. package/dist/components/ShowPixelGridProvider.js +24 -0
  78. package/dist/components/SidebarCollapserControls.js +2 -2
  79. package/dist/components/SidebarRenderButton.js +2 -1
  80. package/dist/components/Timeline/Timeline.js +41 -0
  81. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +6 -7
  82. package/dist/components/Timeline/TimelineDragHandler.js +11 -4
  83. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -2
  84. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +4 -2
  85. package/dist/components/Timeline/TimelineSelection.d.ts +29 -66
  86. package/dist/components/Timeline/TimelineSelection.js +30 -170
  87. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -0
  88. package/dist/components/Timeline/TimelineSequenceItem.js +8 -6
  89. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -4
  90. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +3 -4
  91. package/dist/components/Timeline/duplicate-selected-timeline-item.d.ts +3 -4
  92. package/dist/components/Timeline/find-track-for-node-path-info.d.ts +1 -1
  93. package/dist/components/Timeline/keyframe-clipboard.d.ts +2 -3
  94. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +2 -3
  95. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +2 -3
  96. package/dist/components/Timeline/split-selected-timeline-item.d.ts +2 -3
  97. package/dist/components/Timeline/timeline-expanded-filter.d.ts +1 -2
  98. package/dist/components/Timeline/timeline-scroll-logic.d.ts +7 -5
  99. package/dist/components/Timeline/timeline-scroll-logic.js +12 -7
  100. package/dist/components/Timeline/update-selected-easing.d.ts +7 -7
  101. package/dist/components/Timeline/use-timeline-asset-drop.js +24 -1
  102. package/dist/components/Timeline/use-timeline-keyframe-drag.d.ts +6 -7
  103. package/dist/components/WebMcp.d.ts +2 -0
  104. package/dist/components/WebMcp.js +945 -0
  105. package/dist/components/canvas-capture-drop.d.ts +4 -0
  106. package/dist/components/canvas-capture-drop.js +22 -0
  107. package/dist/components/composition-menu-items.js +26 -0
  108. package/dist/components/selected-outline-geometry.d.ts +2 -21
  109. package/dist/components/selected-outline-geometry.js +5 -16
  110. package/dist/components/selected-outline-measurement.d.ts +8 -37
  111. package/dist/components/selected-outline-measurement.js +1 -231
  112. package/dist/components/selected-outline-types.d.ts +2 -15
  113. package/dist/components/selected-outline-uv.js +3 -106
  114. package/dist/esm/{chunk-w4244j4n.js → chunk-7prjt5n5.js} +32831 -26820
  115. package/dist/esm/internals.mjs +32831 -26820
  116. package/dist/esm/previewEntry.mjs +17304 -11293
  117. package/dist/esm/renderEntry.mjs +1 -1
  118. package/dist/helpers/calculate-timeline.d.ts +1 -7
  119. package/dist/helpers/calculate-timeline.js +2 -146
  120. package/dist/helpers/create-folder-tree.js +16 -1
  121. package/dist/helpers/editor-ruler.js +6 -5
  122. package/dist/helpers/format-file-location.d.ts +8 -0
  123. package/dist/helpers/format-file-location.js +14 -3
  124. package/dist/helpers/get-asset-metadata.d.ts +19 -0
  125. package/dist/helpers/get-asset-metadata.js +51 -6
  126. package/dist/helpers/get-connected-compositions.d.ts +1 -6
  127. package/dist/helpers/get-connected-compositions.js +2 -8
  128. package/dist/helpers/get-sequence-visible-range.d.ts +1 -5
  129. package/dist/helpers/get-sequence-visible-range.js +6 -51
  130. package/dist/helpers/get-timeline-max-zoom.d.ts +8 -0
  131. package/dist/helpers/get-timeline-max-zoom.js +17 -6
  132. package/dist/helpers/get-timeline-nestedness.d.ts +1 -2
  133. package/dist/helpers/get-timeline-nestedness.js +2 -12
  134. package/dist/helpers/get-timeline-sequence-sort-key.d.ts +2 -22
  135. package/dist/helpers/get-timeline-sequence-sort-key.js +2 -16
  136. package/dist/helpers/hoverable.d.ts +1 -0
  137. package/dist/helpers/hoverable.js +4 -1
  138. package/dist/helpers/is-current-selected-still.js +4 -2
  139. package/dist/helpers/sort-by-nonce-history.d.ts +1 -5
  140. package/dist/helpers/sort-by-nonce-history.js +3 -148
  141. package/dist/helpers/timeline-node-path-key.d.ts +1 -2
  142. package/dist/helpers/timeline-node-path-key.js +2 -2
  143. package/dist/helpers/use-menu-structure.js +20 -0
  144. package/dist/icons/enter.d.ts +4 -0
  145. package/dist/icons/enter.js +10 -0
  146. package/dist/state/editor-pixel-grid.d.ts +8 -0
  147. package/dist/state/editor-pixel-grid.js +18 -0
  148. package/dist/state/modals.d.ts +4 -0
  149. package/dist/state/playbackrate.d.ts +1 -0
  150. package/dist/state/playbackrate.js +4 -1
  151. package/package.json +14 -12
  152. package/dist/components/selected-outline-order.d.ts +0 -12
  153. package/dist/components/selected-outline-order.js +0 -251
  154. package/dist/helpers/get-box-quads-polyfill-internals.d.ts +0 -82
  155. package/dist/helpers/get-box-quads-polyfill-internals.js +0 -2403
  156. package/dist/helpers/get-box-quads-ponyfill.d.ts +0 -10
  157. package/dist/helpers/get-box-quads-ponyfill.js +0 -23
@@ -48,6 +48,7 @@ const use_asset_drag_events_1 = __importStar(require("../helpers/use-asset-drag-
48
48
  const folders_1 = require("../state/folders");
49
49
  const z_index_1 = require("../state/z-index");
50
50
  const AssetSelectorItem_1 = require("./AssetSelectorItem");
51
+ const import_assets_1 = require("./import-assets");
51
52
  const styles_1 = require("./Menu/styles");
52
53
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
53
54
  const ExplorerQuickSwitcherTrigger_1 = require("./QuickSwitcher/ExplorerQuickSwitcherTrigger");
@@ -97,6 +98,28 @@ const AssetSelector = ({ readOnlyStudio }) => {
97
98
  const assetTree = (0, react_1.useMemo)(() => {
98
99
  return (0, create_folder_tree_1.buildAssetFolderStructure)(staticFiles, null, assetFoldersExpanded);
99
100
  }, [assetFoldersExpanded, staticFiles]);
101
+ const writeFilesToPublicFolder = (0, react_1.useCallback)(async ({ files, assetPath, }) => {
102
+ const makePath = (file) => {
103
+ return [assetPath, file.name].filter(Boolean).join('/');
104
+ };
105
+ const differentExistingFile = files.find((file) => {
106
+ const filePath = makePath(file);
107
+ return staticFiles.some((staticFile) => staticFile.name === filePath &&
108
+ staticFile.sizeInBytes !== file.size);
109
+ });
110
+ if (differentExistingFile) {
111
+ (0, NotificationCenter_1.showNotification)(`File with name ${makePath(differentExistingFile)} already exists and is different`, 4000);
112
+ return false;
113
+ }
114
+ for (const file of files) {
115
+ const body = await file.arrayBuffer();
116
+ await (0, write_static_file_1.writeStaticFile)({
117
+ contents: body,
118
+ filePath: makePath(file),
119
+ });
120
+ }
121
+ return true;
122
+ }, [staticFiles]);
100
123
  const toggleFolder = (0, react_1.useCallback)((folderName, parentName) => {
101
124
  setAssetFoldersExpanded((p) => {
102
125
  const key = [parentName, folderName].filter(Boolean).join('/');
@@ -140,30 +163,12 @@ const AssetSelector = ({ readOnlyStudio }) => {
140
163
  }
141
164
  return;
142
165
  }
143
- const { files } = e.dataTransfer;
166
+ const files = Array.from(e.dataTransfer.files);
144
167
  if (files.length === 0) {
145
168
  setDropLocation(null);
146
169
  return;
147
170
  }
148
- const makePath = (file) => {
149
- return [assetPath, file.name].filter(Boolean).join('/');
150
- };
151
- const differentExistingFile = Array.from(files).find((file) => {
152
- const filePath = makePath(file);
153
- return staticFiles.some((staticFile) => staticFile.name === filePath &&
154
- staticFile.sizeInBytes !== file.size);
155
- });
156
- if (differentExistingFile) {
157
- (0, NotificationCenter_1.showNotification)(`File with name ${makePath(differentExistingFile)} already exists and is different`, 4000);
158
- return;
159
- }
160
- for (const file of files) {
161
- const body = await file.arrayBuffer();
162
- await (0, write_static_file_1.writeStaticFile)({
163
- contents: body,
164
- filePath: makePath(file),
165
- });
166
- }
171
+ await writeFilesToPublicFolder({ files, assetPath });
167
172
  }
168
173
  catch (error) {
169
174
  (0, NotificationCenter_1.showNotification)(`Error during upload: ${error}`, 3000);
@@ -171,9 +176,45 @@ const AssetSelector = ({ readOnlyStudio }) => {
171
176
  finally {
172
177
  setDropLocation(null);
173
178
  }
174
- }, [dropLocation, staticFiles]);
179
+ }, [dropLocation, writeFilesToPublicFolder]);
180
+ const uploadAssets = (0, react_1.useCallback)(async () => {
181
+ try {
182
+ const files = await (0, import_assets_1.pickFilesToImport)();
183
+ if (files.length === 0) {
184
+ return;
185
+ }
186
+ const wereWritten = await writeFilesToPublicFolder({
187
+ files,
188
+ assetPath: null,
189
+ });
190
+ if (wereWritten) {
191
+ (0, NotificationCenter_1.showNotification)(files.length === 1
192
+ ? `Uploaded ${files[0].name} to public folder`
193
+ : `Uploaded ${files.length} assets to public folder`, 3000);
194
+ }
195
+ }
196
+ catch (error) {
197
+ (0, NotificationCenter_1.showNotification)(`Error during upload: ${error}`, 3000);
198
+ }
199
+ }, [writeFilesToPublicFolder]);
200
+ const getAssetActions = (0, react_1.useCallback)(() => {
201
+ return [
202
+ {
203
+ id: 'upload-assets',
204
+ keyHint: null,
205
+ label: 'Upload...',
206
+ leftItem: null,
207
+ onClick: uploadAssets,
208
+ quickSwitcherLabel: 'Upload assets...',
209
+ subMenu: null,
210
+ type: 'item',
211
+ value: 'upload-assets',
212
+ disabled: !shouldAllowUpload,
213
+ },
214
+ ];
215
+ }, [shouldAllowUpload, uploadAssets]);
175
216
  return (jsx_runtime_1.jsxs("div", { "data-asset-selector": true, style: container, onDragOver: shouldAllowUpload ? onDragOver : undefined, onDrop: shouldAllowUpload ? onDrop : undefined, children: [
176
- 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" }),
217
+ jsx_runtime_1.jsx(ExplorerQuickSwitcherTrigger_1.ExplorerQuickSwitcherTrigger, { mode: "assets", showShortcut: true, tabIndex: tabIndex, getActions: getAssetActions }), 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" }),
177
218
  " 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" }),
178
219
  " in the root of your project and place a file in it."] }) }))) : (jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: {
179
220
  ...list,
@@ -14,11 +14,12 @@ export declare const getCanDragAsset: ({ readOnlyStudio, relativePath, }: {
14
14
  readOnlyStudio: boolean;
15
15
  relativePath: string;
16
16
  }) => boolean;
17
- export declare const getAssetContextMenuItems: ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInConvert, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }: {
17
+ export declare const getAssetContextMenuItems: ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, copyAbsolutePath, openAssetInConvert, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }: {
18
18
  relativePath: string;
19
19
  fileManagerName: string;
20
20
  copyFileName: () => void;
21
21
  copyStaticFilePath: () => void;
22
+ copyAbsolutePath: (() => void) | null;
22
23
  openAssetInConvert: () => void;
23
24
  openAssetInExplorer: () => void;
24
25
  renameAsset: () => void;
@@ -45,19 +45,21 @@ const colors_1 = require("../helpers/colors");
45
45
  const copy_text_1 = require("../helpers/copy-text");
46
46
  const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
47
47
  const get_preview_file_type_1 = require("../helpers/get-preview-file-type");
48
+ const hoverable_1 = require("../helpers/hoverable");
48
49
  const open_in_remotion_convert_1 = require("../helpers/open-in-remotion-convert");
49
50
  const sidebar_scroll_into_view_1 = require("../helpers/sidebar-scroll-into-view");
50
51
  const url_state_1 = require("../helpers/url-state");
51
52
  const use_asset_drag_events_1 = __importStar(require("../helpers/use-asset-drag-events"));
52
53
  const use_image_metadata_1 = require("../helpers/use-image-metadata");
53
54
  const use_media_metadata_1 = require("../helpers/use-media-metadata");
54
- const clipboard_1 = require("../icons/clipboard");
55
+ const ellipsis_1 = require("../icons/ellipsis");
55
56
  const folder_1 = require("../icons/folder");
56
57
  const modals_1 = require("../state/modals");
57
58
  const AssetFileIcon_1 = require("./AssetFileIcon");
58
59
  const ContextMenu_1 = require("./ContextMenu");
59
60
  const import_assets_1 = require("./import-assets");
60
61
  const InlineAction_1 = require("./InlineAction");
62
+ const InlineDropdown_1 = require("./InlineDropdown");
61
63
  const layout_1 = require("./layout");
62
64
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
63
65
  const open_in_new_window_1 = require("./open-in-new-window");
@@ -102,6 +104,11 @@ const revealIconStyle = {
102
104
  height: 12,
103
105
  color: colors_1.CURRENT_COLOR,
104
106
  };
107
+ const ellipsisIconStyle = {
108
+ style: {
109
+ height: 12,
110
+ },
111
+ };
105
112
  const getAssetActionAvailability = ({ browserStudioCanMutateAssets, readOnlyStudio, connectionStatus, publicFolderExists, }) => {
106
113
  return {
107
114
  mutationsDisabled: browserStudioCanMutateAssets !== true &&
@@ -116,7 +123,7 @@ const getCanDragAsset = ({ readOnlyStudio, relativePath, }) => {
116
123
  return !readOnlyStudio && (0, import_assets_1.getAssetElementFromPath)(relativePath) !== null;
117
124
  };
118
125
  exports.getCanDragAsset = getCanDragAsset;
119
- const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, openAssetInConvert, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }) => {
126
+ const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName, copyStaticFilePath, copyAbsolutePath, openAssetInConvert, openAssetInExplorer, renameAsset, deleteAsset, fileExplorerAvailable, fileExplorerDisabled, mutationsDisabled, }) => {
120
127
  const previewFileType = (0, get_preview_file_type_1.getPreviewFileType)(relativePath);
121
128
  const canOpenInConvert = previewFileType === 'audio' || previewFileType === 'video';
122
129
  const items = [
@@ -160,6 +167,19 @@ const getAssetContextMenuItems = ({ relativePath, fileManagerName, copyFileName,
160
167
  type: 'item',
161
168
  value: 'copy-asset-static-file-path',
162
169
  },
170
+ copyAbsolutePath
171
+ ? {
172
+ id: 'copy-asset-absolute-path',
173
+ keyHint: null,
174
+ label: 'Copy absolute path',
175
+ leftItem: null,
176
+ onClick: copyAbsolutePath,
177
+ quickSwitcherLabel: 'Copy asset absolute path',
178
+ subMenu: null,
179
+ type: 'item',
180
+ value: 'copy-asset-absolute-path',
181
+ }
182
+ : null,
163
183
  {
164
184
  type: 'divider',
165
185
  id: 'asset-file-actions-divider',
@@ -370,8 +390,8 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
370
390
  const renderFileExplorerAction = (0, react_1.useCallback)((color) => {
371
391
  return jsx_runtime_1.jsx(folder_1.ExpandedFolderIcon, { style: revealIconStyle, color: color });
372
392
  }, []);
373
- const renderCopyAction = (0, react_1.useCallback)((color) => {
374
- return jsx_runtime_1.jsx(clipboard_1.ClipboardIcon, { style: revealIconStyle, color: color });
393
+ const renderContextMenuAction = (0, react_1.useCallback)((color) => {
394
+ return jsx_runtime_1.jsx(ellipsis_1.EllipsisIcon, { svgProps: ellipsisIconStyle, fill: color });
375
395
  }, []);
376
396
  const copyFileName = (0, react_1.useCallback)(() => {
377
397
  (0, copy_text_1.copyText)(item.name)
@@ -392,6 +412,19 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
392
412
  (0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
393
413
  });
394
414
  }, [relativePath]);
415
+ const copyAbsolutePath = (0, react_1.useCallback)(() => {
416
+ if (window.remotion_publicFolderExists === null) {
417
+ return;
418
+ }
419
+ const content = `${window.remotion_publicFolderExists}/${relativePath}`;
420
+ (0, copy_text_1.copyText)(content)
421
+ .then(() => {
422
+ (0, NotificationCenter_1.showNotification)(`Copied '${content}' to clipboard`, 1000);
423
+ })
424
+ .catch((err) => {
425
+ (0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
426
+ });
427
+ }, [relativePath]);
395
428
  const openAssetInConvert = (0, react_1.useCallback)(() => {
396
429
  (0, open_in_remotion_convert_1.openInRemotionConvert)({ relativePath });
397
430
  }, [relativePath]);
@@ -425,6 +458,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
425
458
  fileManagerName,
426
459
  copyFileName,
427
460
  copyStaticFilePath,
461
+ copyAbsolutePath: window.remotion_publicFolderExists === null ? null : copyAbsolutePath,
428
462
  openAssetInConvert,
429
463
  openAssetInExplorer,
430
464
  renameAsset,
@@ -436,6 +470,7 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
436
470
  }, [
437
471
  copyFileName,
438
472
  copyStaticFilePath,
473
+ copyAbsolutePath,
439
474
  deleteAsset,
440
475
  fileExplorerDisabled,
441
476
  fileManagerName,
@@ -449,13 +484,9 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder, readOnlyStudio
449
484
  e.stopPropagation();
450
485
  openAssetInExplorer();
451
486
  }, [openAssetInExplorer]);
452
- const copyToClipboard = (0, react_1.useCallback)((e) => {
453
- e.stopPropagation();
454
- copyStaticFilePath();
455
- }, [copyStaticFilePath]);
456
487
  return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, 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: [
457
488
  jsx_runtime_1.jsx(AssetFileIcon_1.AssetFileIcon, { fileType: previewFileType, style: iconStyle, color: hovered || selected ? colors_1.WHITE : 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: [
458
- jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, title: "Copy staticFile() path", renderAction: renderCopyAction, onClick: copyToClipboard }), fileExplorerDisabled ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
459
- jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, title: `Show in ${fileManagerName}`, renderAction: renderFileExplorerAction, onClick: revealInExplorer })
489
+ jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { variant: null, title: "More actions", renderAction: renderContextMenuAction, getItems: getContextMenuItems, style: hoverable_1.NO_HOVER_BACKGROUND_STYLE, className: hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME }), fileExplorerDisabled ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
490
+ jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, title: `Show in ${fileManagerName}`, renderAction: renderFileExplorerAction, onClick: revealInExplorer, style: hoverable_1.NO_HOVER_BACKGROUND_STYLE, className: hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME })
460
491
  ] }))] })) : null] }) }) }));
461
492
  };
@@ -16,7 +16,6 @@ const clipboard_images_1 = require("../helpers/clipboard-images");
16
16
  const clipboard_svg_1 = require("../helpers/clipboard-svg");
17
17
  const colors_1 = require("../helpers/colors");
18
18
  const get_asset_metadata_1 = require("../helpers/get-asset-metadata");
19
- const get_canvas_capture_import_1 = require("../helpers/get-canvas-capture-import");
20
19
  const get_effective_translation_1 = require("../helpers/get-effective-translation");
21
20
  const install_required_package_1 = require("../helpers/install-required-package");
22
21
  const open_in_editor_1 = require("../helpers/open-in-editor");
@@ -29,6 +28,7 @@ const editor_snapping_1 = require("../state/editor-snapping");
29
28
  const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
30
29
  const modals_1 = require("../state/modals");
31
30
  const call_api_1 = require("./call-api");
31
+ const canvas_capture_drop_1 = require("./canvas-capture-drop");
32
32
  const composition_drop_preview_1 = require("./composition-drop-preview");
33
33
  const ConfirmationDialog_1 = require("./ConfirmationDialog");
34
34
  const drop_handler_data_1 = require("./drop-handler-data");
@@ -135,6 +135,7 @@ const Canvas = ({ canvasContent, size }) => {
135
135
  const { editorShowGuides } = (0, react_1.useContext)(editor_guides_1.EditorShowGuidesContext);
136
136
  const { editorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
137
137
  const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
138
+ const { setCurrentAssetMetadata } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
138
139
  const { previewServerState, subscribeToEvent } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
139
140
  const previewServerClientId = previewServerState.type === 'connected'
140
141
  ? previewServerState.clientId
@@ -146,6 +147,7 @@ const Canvas = ({ canvasContent, size }) => {
146
147
  const [activeElementInstallRequest, setActiveElementInstallRequest] = (0, react_1.useState)(null);
147
148
  const lastFocusedAtRef = (0, react_1.useRef)(typeof document === 'undefined' || document.hasFocus() ? Date.now() : null);
148
149
  const [assetResolution, setAssetResolution] = (0, react_1.useState)(null);
150
+ const metadataRequestRef = (0, react_1.useRef)(0);
149
151
  const currentCompositionId = canvasContent.type === 'composition' ? canvasContent.compositionId : null;
150
152
  const currentComposition = (0, react_1.useMemo)(() => {
151
153
  var _a;
@@ -530,13 +532,19 @@ const Canvas = ({ canvasContent, size }) => {
530
532
  };
531
533
  }, [keybindings, onReset, onZoomIn, onZoomOut]);
532
534
  const fetchMetadata = (0, react_1.useCallback)(async () => {
535
+ const request = ++metadataRequestRef.current;
533
536
  setAssetResolution(null);
534
537
  if (canvasContent.type === 'composition') {
538
+ setCurrentAssetMetadata(null);
535
539
  return;
536
540
  }
537
541
  const metadata = await (0, get_asset_metadata_1.getAssetMetadata)(canvasContent, canvasContent.type === 'asset');
542
+ if (request !== metadataRequestRef.current) {
543
+ return;
544
+ }
538
545
  setAssetResolution(metadata);
539
- }, [canvasContent]);
546
+ setCurrentAssetMetadata((0, get_asset_metadata_1.getAssetPreviewMetadata)({ canvasContent, metadata }));
547
+ }, [canvasContent, setCurrentAssetMetadata]);
540
548
  (0, react_1.useEffect)(() => {
541
549
  if (canvasContent.type !== 'asset') {
542
550
  return;
@@ -855,15 +863,10 @@ const Canvas = ({ canvasContent, size }) => {
855
863
  if (localFiles.length === 1) {
856
864
  setIsAddingAsset(true);
857
865
  try {
858
- const canvasCapture = await (0, get_canvas_capture_import_1.getCanvasCaptureImport)(localFiles[0]);
859
- if (canvasCapture !== null) {
860
- setSelectedModal({
861
- type: 'new-comp',
862
- canvasCapture,
863
- folderName: null,
864
- parentName: null,
865
- stack: null,
866
- });
866
+ if (await (0, canvas_capture_drop_1.handleCanvasCaptureDrop)({
867
+ files: localFiles,
868
+ setSelectedModal,
869
+ })) {
867
870
  return;
868
871
  }
869
872
  }
@@ -1097,6 +1100,6 @@ const Canvas = ({ canvasContent, size }) => {
1097
1100
  };
1098
1101
  }, [compositionDropPreview, contentDimensions, previewSize, size]);
1099
1102
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
1100
- jsx_runtime_1.jsxs("div", { ref: canvas_ref_1.canvasRef, style: getContainerStyle(editorZoomGestures), children: [size ? (jsx_runtime_1.jsx(Preview_1.VideoPreview, { canvasContent: canvasContent, contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, onRetryAssetMetadata: fetchMetadata })) : null, compositionDropPreviewStyle === null ? null : (jsx_runtime_1.jsx("div", { className: "css-reset", "data-testid": "composition-drop-preview", style: compositionDropPreviewStyle })), isFit ? null : (jsx_runtime_1.jsx("div", { style: resetZoom, className: "css-reset", children: jsx_runtime_1.jsx(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) })), editorShowGuides && canvasContent.type === 'composition' && (jsx_runtime_1.jsx(EditorGuides_1.default, { canvasSize: size, contentDimensions: contentDimensions, assetMetadata: assetResolution }))] }), areRulersVisible && (jsx_runtime_1.jsx(EditorRuler_1.EditorRulers, { contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, containerRef: canvas_ref_1.canvasRef }))] }));
1103
+ jsx_runtime_1.jsxs("div", { ref: canvas_ref_1.canvasRef, style: getContainerStyle(editorZoomGestures), children: [size ? (jsx_runtime_1.jsx(Preview_1.VideoPreview, { canvasContent: canvasContent, contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, onRetryAssetMetadata: fetchMetadata })) : null, compositionDropPreviewStyle === null ? null : (jsx_runtime_1.jsx("div", { className: "css-reset", "data-testid": "composition-drop-preview", style: compositionDropPreviewStyle })), isFit ? null : (jsx_runtime_1.jsx("div", { style: resetZoom, className: "css-reset", children: jsx_runtime_1.jsx(ResetZoomButton_1.ResetZoomButton, { onClick: onReset }) })), editorShowGuides && canvasContent.type === 'composition' && (jsx_runtime_1.jsx(EditorGuides_1.default, { canvasSize: size, contentDimensions: contentDimensions, assetMetadata: assetResolution }))] }), areRulersVisible && (jsx_runtime_1.jsx(EditorRuler_1.EditorRulers, { canCreateGuides: canvasContent.type === 'composition', contentDimensions: contentDimensions, canvasSize: size, assetMetadata: assetResolution, containerRef: canvas_ref_1.canvasRef }))] }));
1101
1104
  };
1102
1105
  exports.Canvas = Canvas;
@@ -0,0 +1,4 @@
1
+ import { type FC } from 'react';
2
+ export declare const CanvasCaptureDropHandler: FC<{
3
+ readonly readOnlyStudio: boolean;
4
+ }>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CanvasCaptureDropHandler = void 0;
4
+ const react_1 = require("react");
5
+ const modals_1 = require("../state/modals");
6
+ const canvas_capture_drop_1 = require("./canvas-capture-drop");
7
+ const drop_handler_data_1 = require("./drop-handler-data");
8
+ const CanvasCaptureDropHandler = ({ readOnlyStudio }) => {
9
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
10
+ const onDragOver = (0, react_1.useCallback)((event) => {
11
+ if (readOnlyStudio || !(0, drop_handler_data_1.isFileDragEvent)(event)) {
12
+ return;
13
+ }
14
+ event.preventDefault();
15
+ if (event.dataTransfer) {
16
+ event.dataTransfer.dropEffect = 'copy';
17
+ }
18
+ }, [readOnlyStudio]);
19
+ const onDrop = (0, react_1.useCallback)(async (event) => {
20
+ var _a;
21
+ var _b;
22
+ if (readOnlyStudio || !(0, drop_handler_data_1.isFileDragEvent)(event)) {
23
+ return;
24
+ }
25
+ const files = Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : []);
26
+ if (files.length === 0) {
27
+ return;
28
+ }
29
+ event.preventDefault();
30
+ await (0, canvas_capture_drop_1.handleCanvasCaptureDrop)({ files, setSelectedModal });
31
+ }, [readOnlyStudio, setSelectedModal]);
32
+ (0, react_1.useEffect)(() => {
33
+ document.addEventListener('dragover', onDragOver);
34
+ document.addEventListener('drop', onDrop);
35
+ return () => {
36
+ document.removeEventListener('dragover', onDragOver);
37
+ document.removeEventListener('drop', onDrop);
38
+ };
39
+ }, [onDragOver, onDrop]);
40
+ return null;
41
+ };
42
+ exports.CanvasCaptureDropHandler = CanvasCaptureDropHandler;
@@ -58,9 +58,10 @@ const CanvasOrLoading = ({ size }) => {
58
58
  }
59
59
  const content = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
60
60
  jsx_runtime_1.jsx(ZoomPersistor_1.ZoomPersistor, {}), jsx_runtime_1.jsx(Canvas_1.Canvas, { size: size, canvasContent: canvasContent }), (resolved === null || resolved === void 0 ? void 0 : resolved.type) === 'success-and-refreshing' ? (jsx_runtime_1.jsx(RefreshCompositionOverlay_1.RefreshCompositionOverlay, {})) : null] }));
61
- if (canvasContent.type === 'asset' ||
62
- canvasContent.type === 'output' ||
63
- canvasContent.type === 'output-blob') {
61
+ if (canvasContent.type === 'output' || canvasContent.type === 'output-blob') {
62
+ return content;
63
+ }
64
+ if (canvasContent.type === 'asset' && resolved === null) {
64
65
  return content;
65
66
  }
66
67
  if (!resolved) {
@@ -17,6 +17,6 @@ const readOnlyStatus = {
17
17
  };
18
18
  const CaptionInspector = ({ captions, expanded, onTextChange, onTextSave, onTextCancel, onToggle, readOnly, readOnlyTitle, }) => {
19
19
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
20
- jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null }), expanded: expanded, label: "Captions", onToggle: onToggle }) }), expanded ? (jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })) : null] }));
20
+ jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: jsx_runtime_1.jsx("div", { style: styles_1.sectionHeaderEnd, children: readOnly ? (jsx_runtime_1.jsx("div", { style: readOnlyStatus, title: readOnlyTitle !== null && readOnlyTitle !== void 0 ? readOnlyTitle : undefined, children: "Read only" })) : null }), expanded: expanded, label: "Captions", onToggle: onToggle }) }), expanded ? (jsx_runtime_1.jsx(CaptionTextEditor_1.CaptionTextEditor, { captions: captions, onChange: onTextChange, onSave: onTextSave, onCancel: onTextCancel, readOnly: readOnly })) : null] }));
21
21
  };
22
22
  exports.CaptionInspector = CaptionInspector;
@@ -4,6 +4,9 @@ exports.CaptionTextEditor = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../helpers/colors");
7
+ const hoverable_1 = require("../helpers/hoverable");
8
+ const enter_1 = require("../icons/enter");
9
+ const InlineAction_1 = require("./InlineAction");
7
10
  const RemInput_1 = require("./NewComposition/RemInput");
8
11
  const container = {
9
12
  alignSelf: 'stretch',
@@ -21,8 +24,8 @@ const row = {
21
24
  alignItems: 'center',
22
25
  borderBottom: `1px solid ${colors_1.LINE_COLOR}`,
23
26
  display: 'grid',
24
- gap: 12,
25
- gridTemplateColumns: '100px minmax(0, 1fr)',
27
+ gap: 8,
28
+ gridTemplateColumns: '100px minmax(0, 1fr) 24px',
26
29
  padding: '5px 12px',
27
30
  };
28
31
  const timing = {
@@ -77,18 +80,33 @@ const CaptionTextEditor = ({ captions, onChange, onSave, onCancel, readOnly }) =
77
80
  (0, react_1.useEffect)(() => {
78
81
  return commitPending;
79
82
  }, [commitPending]);
80
- const updateText = (0, react_1.useCallback)((index, text) => {
81
- var _a;
82
- if (((_a = latestRef.current.captions[index]) === null || _a === void 0 ? void 0 : _a.text) === text) {
83
+ const updateCaption = (0, react_1.useCallback)((index, changes) => {
84
+ const currentCaption = latestRef.current.captions[index];
85
+ if (!currentCaption) {
83
86
  return;
84
87
  }
85
88
  const nextCaptions = latestRef.current.captions.map((caption, captionIndex) => {
86
- return captionIndex === index ? { ...caption, text } : caption;
89
+ return captionIndex === index ? { ...caption, ...changes } : caption;
87
90
  });
88
91
  latestRef.current.captions = nextCaptions;
89
92
  dirtyRef.current = true;
90
93
  onChange(nextCaptions);
91
94
  }, [onChange]);
95
+ const updateText = (0, react_1.useCallback)((index, text) => {
96
+ var _a;
97
+ if (((_a = latestRef.current.captions[index]) === null || _a === void 0 ? void 0 : _a.text) === text) {
98
+ return;
99
+ }
100
+ updateCaption(index, { text });
101
+ }, [updateCaption]);
102
+ const updatePageBreakAfter = (0, react_1.useCallback)((index, pageBreakAfter) => {
103
+ var _a;
104
+ if (Boolean((_a = latestRef.current.captions[index]) === null || _a === void 0 ? void 0 : _a.pageBreakAfter) ===
105
+ pageBreakAfter) {
106
+ return;
107
+ }
108
+ updateCaption(index, { pageBreakAfter });
109
+ }, [updateCaption]);
92
110
  const focusSibling = (0, react_1.useCallback)((index) => {
93
111
  var _a;
94
112
  const input = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-caption-index="${index}"]`);
@@ -96,6 +114,10 @@ const CaptionTextEditor = ({ captions, onChange, onSave, onCancel, readOnly }) =
96
114
  input === null || input === void 0 ? void 0 : input.scrollIntoView({ block: 'nearest' });
97
115
  }, []);
98
116
  return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs("div", { ref: listRef, style: list, children: [captions.length === 0 ? jsx_runtime_1.jsx("div", { style: empty, children: "No captions" }) : null, captionRows.map(({ caption, key }, index) => {
117
+ const hasPageBreakAfter = Boolean(caption.pageBreakAfter);
118
+ const pageBreakTitle = hasPageBreakAfter
119
+ ? `Remove page break after caption ${index + 1}`
120
+ : `Add page break after caption ${index + 1}`;
99
121
  return (jsx_runtime_1.jsxs("div", { style: row, children: [
100
122
  jsx_runtime_1.jsxs("div", { style: timing, children: [formatMilliseconds(caption.startMs), " \u2192", ' ', formatMilliseconds(caption.endMs), " ms"] }), jsx_runtime_1.jsx(RemInput_1.RemotionInput, { "data-caption-index": index, disabled: readOnly, onBlur: (event) => {
101
123
  if (cancelledBlurIndexes.current.delete(index)) {
@@ -125,8 +147,10 @@ const CaptionTextEditor = ({ captions, onChange, onSave, onCancel, readOnly }) =
125
147
  fontFamily: 'sans-serif',
126
148
  fontSize: 12,
127
149
  lineHeight: '16px',
128
- }, value: caption.text })
129
- ] }, key));
150
+ }, value: caption.text }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { "aria-pressed": hasPageBreakAfter, className: hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME, disabled: readOnly, onClick: () => {
151
+ updatePageBreakAfter(index, !hasPageBreakAfter);
152
+ commitPending();
153
+ }, renderAction: (color) => (jsx_runtime_1.jsx(enter_1.EnterIcon, { "aria-hidden": "true", color: hasPageBreakAfter ? colors_1.BLUE : color, focusable: "false", style: { height: 16, width: 16 } })), title: pageBreakTitle, variant: null })] }, key));
130
154
  })] }) }));
131
155
  };
132
156
  exports.CaptionTextEditor = CaptionTextEditor;
@@ -21,7 +21,7 @@ const CheckboardToggle = () => {
21
21
  return !c;
22
22
  });
23
23
  }, [setCheckerboard]);
24
- return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (color) => (jsx_runtime_1.jsxs("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 18, height: 18 }, fill: "none", children: [
24
+ return (jsx_runtime_1.jsx(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, "aria-pressed": checkerboard, onClick: onClick, children: (color) => (jsx_runtime_1.jsxs("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 18, height: 18 }, fill: "none", children: [
25
25
  jsx_runtime_1.jsx("path", { fill: checkerboard ? colors_1.BLUE : color, d: "M256 48h184c13.3 0 24 10.7 24 24v184H256V48zM48 256h208v208H72c-13.3 0-24-10.7-24-24V256z" }), jsx_runtime_1.jsx("rect", { x: "48", y: "48", width: "416", height: "416", rx: "24", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" }), jsx_runtime_1.jsx("path", { d: "M256 48v416M48 256h416", stroke: checkerboard ? colors_1.BLUE : color, strokeWidth: "32" })
26
26
  ] })) }));
27
27
  };
@@ -8,7 +8,6 @@ export declare const Checkbox: React.FC<{
8
8
  readonly checked: boolean;
9
9
  readonly onChange: React.ChangeEventHandler<HTMLInputElement>;
10
10
  readonly name: string;
11
- readonly rounded?: boolean;
12
11
  readonly disabled?: boolean;
13
12
  readonly variant?: CheckboxVariant;
14
13
  }>;
@@ -9,30 +9,18 @@ const SIZES = {
9
9
  default: 20,
10
10
  small: 18,
11
11
  };
12
- const BULLET_SIZES = {
13
- default: 10,
14
- small: 9,
15
- };
16
12
  const CHECKMARK_SIZES = {
17
13
  default: 14,
18
14
  small: 13,
19
15
  };
20
- const Checkbox = ({ checked, onChange, disabled, name, rounded, variant = 'default' }) => {
21
- const ref = (0, react_1.useRef)(null);
16
+ const Checkbox = ({ checked, onChange, disabled, name, variant = 'default' }) => {
22
17
  const size = SIZES[variant];
23
- const bulletSize = BULLET_SIZES[variant];
24
18
  const checkmarkSize = CHECKMARK_SIZES[variant];
25
19
  const background = (0, react_1.useMemo)(() => ({
26
20
  height: size,
27
21
  width: size,
28
22
  position: 'relative',
29
23
  }), [size]);
30
- const bullet = (0, react_1.useMemo)(() => ({
31
- width: bulletSize,
32
- height: bulletSize,
33
- backgroundColor: colors_1.WHITE,
34
- borderRadius: '50%',
35
- }), [bulletSize]);
36
24
  const box = (0, react_1.useMemo)(() => ({
37
25
  display: 'flex',
38
26
  justifyContent: 'center',
@@ -58,13 +46,8 @@ const Checkbox = ({ checked, onChange, disabled, name, rounded, variant = 'defau
58
46
  margin: 0,
59
47
  };
60
48
  }, [disabled, size]);
61
- (0, react_1.useEffect)(() => {
62
- if (ref.current) {
63
- ref.current.style.setProperty('border-radius', rounded ? '50%' : '0%', 'important');
64
- }
65
- }, [rounded]);
66
49
  return (jsx_runtime_1.jsxs("div", { style: background, children: [
67
- jsx_runtime_1.jsx("input", { ref: ref, style: input, type: 'checkbox', checked: checked, onChange: onChange, disabled: disabled, name: name }), jsx_runtime_1.jsx("div", { style: box, children: checked ? (rounded ? (jsx_runtime_1.jsx("div", { style: bullet })) : (jsx_runtime_1.jsx(Checkmark_1.Checkmark, { size: checkmarkSize }))) : null })
50
+ jsx_runtime_1.jsx("input", { style: input, type: 'checkbox', checked: checked, onChange: onChange, disabled: disabled, name: name }), jsx_runtime_1.jsx("div", { style: box, children: checked ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, { size: checkmarkSize }) : null })
68
51
  ] }));
69
52
  };
70
53
  exports.Checkbox = Checkbox;
@@ -4,6 +4,7 @@ exports.CompositionContextButton = void 0;
4
4
  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
+ const hoverable_1 = require("../helpers/hoverable");
7
8
  const ellipsis_1 = require("../icons/ellipsis");
8
9
  const InlineDropdown_1 = require("./InlineDropdown");
9
10
  const CompositionContextButton = ({ visible, getItems }) => {
@@ -22,6 +23,6 @@ const CompositionContextButton = ({ visible, getItems }) => {
22
23
  if (!visible || connectionStatus !== 'connected') {
23
24
  return null;
24
25
  }
25
- return (jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: renderAction, getItems: getItems, variant: null }));
26
+ return (jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: renderAction, getItems: getItems, variant: null, style: hoverable_1.NO_HOVER_BACKGROUND_STYLE, className: hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME }));
26
27
  };
27
28
  exports.CompositionContextButton = CompositionContextButton;
@@ -239,7 +239,7 @@ const CompositionSelector = () => {
239
239
  }
240
240
  }, [compositions, stopCompositionListAutoScroll]);
241
241
  return (jsx_runtime_1.jsxs("div", { style: container, children: [
242
- jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: listRef, getItems: getRootContextMenuItems }), 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) => {
242
+ jsx_runtime_1.jsx(ContextMenu_1.ContextMenuForTarget, { triggerRef: listRef, getItems: getRootContextMenuItems }), jsx_runtime_1.jsx(ExplorerQuickSwitcherTrigger_1.ExplorerQuickSwitcherTrigger, { mode: "compositions", showShortcut: true, tabIndex: tabIndex, getActions: getRootContextMenuItems }), 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) => {
243
243
  return (jsx_runtime_1.jsx(CompositionSelectorItem_1.CompositionSelectorItem, { level: 0, currentComposition: canvasContent && canvasContent.type === 'composition'
244
244
  ? canvasContent.compositionId
245
245
  : null, selectComposition: selectComposition, toggleFolder: toggleFolder, clearRootDragHover: clearRootDragHover, tabIndex: tabIndex, item: c }, c.key + c.type));