@remotion/studio 4.0.521 → 4.0.523

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 (264) hide show
  1. package/dist/api/install-package.js +4 -2
  2. package/dist/components/AssetAudioVolume.d.ts +5 -0
  3. package/dist/components/AssetAudioVolume.js +33 -0
  4. package/dist/components/Canvas.js +5 -6
  5. package/dist/components/CanvasIfSizeIsAvailable.js +7 -0
  6. package/dist/components/CaptionInspector.js +74 -20
  7. package/dist/components/CheckboardToggle.js +8 -6
  8. package/dist/components/Checkbox.d.ts +1 -0
  9. package/dist/components/Checkbox.js +2 -2
  10. package/dist/components/CompositionContextButton.js +4 -1
  11. package/dist/components/CompositionSelectorItem.js +2 -2
  12. package/dist/components/ConfigureLicenseModal.js +1 -1
  13. package/dist/components/CopyButton.js +7 -14
  14. package/dist/components/CurrentAsset.js +40 -6
  15. package/dist/components/Editor.js +6 -5
  16. package/dist/components/EditorContent.js +1 -1
  17. package/dist/components/EditorContexts.js +3 -1
  18. package/dist/components/ElementInstallConfirmation.js +290 -136
  19. package/dist/components/FixComputedValueModal.js +56 -16
  20. package/dist/components/FullscreenToggle.js +9 -8
  21. package/dist/components/GlobalKeybindings.js +50 -49
  22. package/dist/components/HighlightedElementSource.d.ts +5 -0
  23. package/dist/components/HighlightedElementSource.js +78 -0
  24. package/dist/components/InspectorLocationCopy.js +10 -5
  25. package/dist/components/InspectorPanel/MultiSequenceField.d.ts +12 -0
  26. package/dist/components/InspectorPanel/MultiSequenceField.js +131 -0
  27. package/dist/components/InspectorPanel/MultiSequenceInspector.d.ts +8 -0
  28. package/dist/components/InspectorPanel/MultiSequenceInspector.js +102 -0
  29. package/dist/components/InspectorPanel/MultiSequenceNumberField.d.ts +9 -0
  30. package/dist/components/InspectorPanel/MultiSequenceNumberField.js +88 -0
  31. package/dist/components/InspectorPanel.js +4 -0
  32. package/dist/components/InspectorSequenceSection.js +64 -1
  33. package/dist/components/InstallPackage.js +4 -5
  34. package/dist/components/KeyboardShortcutsSettings.js +212 -33
  35. package/dist/components/MenuBuildIndicator.js +7 -2
  36. package/dist/components/MenuCompositionName.js +62 -6
  37. package/dist/components/MenuToolbar.js +7 -5
  38. package/dist/components/ModalContainer.d.ts +1 -0
  39. package/dist/components/ModalContainer.js +2 -2
  40. package/dist/components/Modals.js +3 -1
  41. package/dist/components/ModelManager.d.ts +16 -0
  42. package/dist/components/ModelManager.js +200 -0
  43. package/dist/components/ModelsSettings.d.ts +2 -0
  44. package/dist/components/ModelsSettings.js +133 -0
  45. package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
  46. package/dist/components/NewComposition/DismissableModal.js +2 -2
  47. package/dist/components/NewComposition/InputDragger.d.ts +2 -2
  48. package/dist/components/NewComposition/InputDragger.js +6 -6
  49. package/dist/components/NewComposition/NewFolder.js +11 -8
  50. package/dist/components/NewComposition/RenameFolder.js +17 -10
  51. package/dist/components/OptionalPackageModal.d.ts +11 -0
  52. package/dist/components/OptionalPackageModal.js +155 -0
  53. package/dist/components/PlayPause.js +4 -8
  54. package/dist/components/PlaybackKeyboardShortcutsManager.js +3 -6
  55. package/dist/components/PreviewToolbarOverflowButton.js +11 -2
  56. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +5 -2
  57. package/dist/components/RadioButton.d.ts +1 -0
  58. package/dist/components/RadioButton.js +2 -2
  59. package/dist/components/RenderButton.js +5 -1
  60. package/dist/components/RenderModal/CliCopyButton.js +13 -27
  61. package/dist/components/RenderModal/NumberSetting.d.ts +6 -1
  62. package/dist/components/RenderModal/NumberSetting.js +2 -2
  63. package/dist/components/RenderModal/RenderModalBasic.js +1 -1
  64. package/dist/components/RenderModal/RenderModalOutputName.d.ts +3 -1
  65. package/dist/components/RenderModal/RenderModalOutputName.js +4 -4
  66. package/dist/components/RenderModal/SeparateAudioOption.js +1 -1
  67. package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
  68. package/dist/components/RenderQueue/CaptionQueueItem.d.ts +6 -0
  69. package/dist/components/RenderQueue/CaptionQueueItem.js +129 -0
  70. package/dist/components/RenderQueue/CaptionQueueProcessor.d.ts +1 -0
  71. package/dist/components/RenderQueue/CaptionQueueProcessor.js +110 -0
  72. package/dist/components/RenderQueue/CaptionQueueProcessorLoader.d.ts +2 -0
  73. package/dist/components/RenderQueue/CaptionQueueProcessorLoader.js +54 -0
  74. package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +7 -4
  75. package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
  76. package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
  77. package/dist/components/RenderQueue/VideoMattingQueueItem.js +129 -0
  78. package/dist/components/RenderQueue/VideoMattingQueueProcessor.d.ts +1 -0
  79. package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +105 -0
  80. package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.d.ts +2 -0
  81. package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.js +54 -0
  82. package/dist/components/RenderQueue/caption-job-types.d.ts +47 -0
  83. package/dist/components/RenderQueue/caption-job-types.js +7 -0
  84. package/dist/components/RenderQueue/context.d.ts +16 -0
  85. package/dist/components/RenderQueue/context.js +224 -11
  86. package/dist/components/RenderQueue/index.js +34 -10
  87. package/dist/components/RenderQueue/item-style.d.ts +1 -0
  88. package/dist/components/RenderQueue/item-style.js +2 -1
  89. package/dist/components/RenderQueue/load-model-for-job.d.ts +11 -0
  90. package/dist/components/RenderQueue/load-model-for-job.js +14 -0
  91. package/dist/components/RenderQueue/video-matting-job-types.d.ts +38 -0
  92. package/dist/components/RenderQueue/video-matting-job-types.js +5 -0
  93. package/dist/components/RendersTab.js +4 -4
  94. package/dist/components/SegmentedControl.d.ts +2 -2
  95. package/dist/components/SegmentedControl.js +38 -13
  96. package/dist/components/SelectedOutlinePolygon.js +8 -2
  97. package/dist/components/SettingsButton.d.ts +4 -0
  98. package/dist/components/SettingsButton.js +49 -0
  99. package/dist/components/SettingsModal.d.ts +1 -1
  100. package/dist/components/SettingsModal.js +3 -1
  101. package/dist/components/ShowOutlinesProvider.js +12 -0
  102. package/dist/components/SidebarCollapserControls.js +21 -16
  103. package/dist/components/SizeSelector.js +10 -2
  104. package/dist/components/SkillsSettings.js +11 -8
  105. package/dist/components/SnappingToggle.js +5 -2
  106. package/dist/components/Splitter/SplitterContainer.js +63 -10
  107. package/dist/components/Splitter/SplitterContext.d.ts +3 -0
  108. package/dist/components/Splitter/SplitterContext.js +5 -1
  109. package/dist/components/Splitter/SplitterElement.js +11 -2
  110. package/dist/components/Splitter/SplitterHandle.d.ts +1 -0
  111. package/dist/components/Splitter/SplitterHandle.js +55 -25
  112. package/dist/components/Tabs/vertical.d.ts +1 -0
  113. package/dist/components/Tabs/vertical.js +2 -2
  114. package/dist/components/TimeValue.js +2 -3
  115. package/dist/components/Timeline/SequencePropsObserver.js +4 -0
  116. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -1
  117. package/dist/components/Timeline/SubscribeToNodePaths.js +2 -1
  118. package/dist/components/Timeline/Timeline.js +17 -46
  119. package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
  120. package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
  121. package/dist/components/Timeline/TimelineDragHandler.js +11 -6
  122. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
  123. package/dist/components/Timeline/TimelinePinchZoom.js +6 -30
  124. package/dist/components/Timeline/TimelinePlayCursorSyncer.js +1 -7
  125. package/dist/components/Timeline/TimelineRowChrome.js +11 -3
  126. package/dist/components/Timeline/TimelineSchemaField.js +8 -4
  127. package/dist/components/Timeline/TimelineSelection.d.ts +2 -0
  128. package/dist/components/Timeline/TimelineSelection.js +55 -2
  129. package/dist/components/Timeline/TimelineSequence.js +148 -25
  130. package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
  131. package/dist/components/Timeline/TimelineSequenceItem.js +220 -112
  132. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +35 -5
  133. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +233 -138
  134. package/dist/components/Timeline/TimelineSlider.js +1 -4
  135. package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
  136. package/dist/components/Timeline/TimelineWidthProvider.js +2 -5
  137. package/dist/components/Timeline/TimelineZoomControls.js +20 -20
  138. package/dist/components/Timeline/get-sequence-split-menu-item.d.ts +11 -0
  139. package/dist/components/Timeline/get-sequence-split-menu-item.js +55 -0
  140. package/dist/components/Timeline/use-asset-timeline-context-menu.d.ts +2 -0
  141. package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
  142. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -2
  143. package/dist/components/Timeline/use-sequence-props-subscription.js +4 -10
  144. package/dist/components/TimelineInOutToggle.js +20 -17
  145. package/dist/components/TopPanel.js +3 -19
  146. package/dist/components/Transcription/LazyModels.d.ts +1 -0
  147. package/dist/components/Transcription/LazyModels.js +5 -0
  148. package/dist/components/Transcription/Models.d.ts +6 -0
  149. package/dist/components/Transcription/Models.js +18 -0
  150. package/dist/components/Transcription/TranscriptionModal.d.ts +3 -0
  151. package/dist/components/Transcription/TranscriptionModal.js +428 -0
  152. package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.d.ts +5 -0
  153. package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +48 -0
  154. package/dist/components/Transcription/caption-output-name.d.ts +2 -0
  155. package/dist/components/Transcription/caption-output-name.js +10 -0
  156. package/dist/components/Transcription/resample-media-to-16-khz.d.ts +6 -0
  157. package/dist/components/Transcription/resample-media-to-16-khz.js +82 -0
  158. package/dist/components/Transcription/whisper-languages.d.ts +2 -0
  159. package/dist/components/Transcription/whisper-languages.js +104 -0
  160. package/dist/components/Transcription/whisper-webgpu-capability.d.ts +2 -0
  161. package/dist/components/Transcription/whisper-webgpu-capability.js +7 -0
  162. package/dist/components/UndoRedoButtons.js +13 -38
  163. package/dist/components/UpdatesSettings.js +17 -17
  164. package/dist/components/VideoMatting/LazyModels.d.ts +1 -0
  165. package/dist/components/VideoMatting/LazyModels.js +5 -0
  166. package/dist/components/VideoMatting/Models.d.ts +6 -0
  167. package/dist/components/VideoMatting/Models.js +18 -0
  168. package/dist/components/VideoMatting/VideoMattingModal.d.ts +3 -0
  169. package/dist/components/VideoMatting/VideoMattingModal.js +207 -0
  170. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.d.ts +5 -0
  171. package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +46 -0
  172. package/dist/components/VideoMatting/video-matting-capability.d.ts +2 -0
  173. package/dist/components/VideoMatting/video-matting-capability.js +7 -0
  174. package/dist/components/WebMcp.js +439 -22
  175. package/dist/components/ZoomPersistor.js +6 -3
  176. package/dist/components/composition-menu-items.js +1 -1
  177. package/dist/components/import-assets.d.ts +3 -2
  178. package/dist/components/import-assets.js +5 -9
  179. package/dist/components/keyboard-shortcuts.d.ts +17 -1
  180. package/dist/components/keyboard-shortcuts.js +177 -89
  181. package/dist/components/public-output-name.d.ts +5 -0
  182. package/dist/components/public-output-name.js +60 -0
  183. package/dist/components/use-model-cache-status.d.ts +7 -0
  184. package/dist/components/use-model-cache-status.js +35 -0
  185. package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
  186. package/dist/esm/HighlightedElementSource-jfc66k4p.mjs +1236 -0
  187. package/dist/esm/LazyModels-2trdm224.mjs +11 -0
  188. package/dist/esm/LazyModels-fjb5ckaq.mjs +11 -0
  189. package/dist/esm/TranscriptionModal-916jqhry.mjs +1011 -0
  190. package/dist/esm/VideoMattingModal-2tm79s9b.mjs +374 -0
  191. package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
  192. package/dist/esm/index-1x7bsdh6.mjs +261 -0
  193. package/dist/esm/index-3hgr6gjx.mjs +41 -0
  194. package/dist/esm/index-5qddp5h7.mjs +36 -0
  195. package/dist/esm/index-5zrb1ft4.mjs +39 -0
  196. package/dist/esm/index-6cvm9a65.mjs +45923 -0
  197. package/dist/esm/index-7tt71e8n.mjs +36 -0
  198. package/dist/esm/index-9x6e1dq0.mjs +428 -0
  199. package/dist/esm/index-cw0pnpg5.mjs +50 -0
  200. package/dist/esm/index-czwvnn9g.mjs +35 -0
  201. package/dist/esm/index-hy4xcgty.mjs +1366 -0
  202. package/dist/esm/{chunk-je0h1bgt.js → index-jg13hf2g.mjs} +3 -1
  203. package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
  204. package/dist/esm/index-sgtmgc4h.mjs +423 -0
  205. package/dist/esm/index-te66vvrp.mjs +142 -0
  206. package/dist/esm/index-v4tr1bft.mjs +20 -0
  207. package/dist/esm/index-x7t2y7ws.mjs +54194 -0
  208. package/dist/esm/index-xhe2m2qr.mjs +1146 -0
  209. package/dist/esm/index.mjs +45 -933
  210. package/dist/esm/internals.mjs +13 -114127
  211. package/dist/esm/previewEntry.mjs +387 -114784
  212. package/dist/esm/renderEntry.mjs +3 -3
  213. package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-14148845.mjs} +1 -1
  214. package/dist/helpers/copy-text.js +1 -2
  215. package/dist/helpers/drag-aware-double-click.d.ts +2 -1
  216. package/dist/helpers/drag-aware-double-click.js +12 -1
  217. package/dist/helpers/get-asset-metadata.d.ts +1 -0
  218. package/dist/helpers/get-asset-metadata.js +4 -0
  219. package/dist/helpers/hoverable.js +8 -0
  220. package/dist/helpers/inject-css.js +2 -0
  221. package/dist/helpers/optional-package-dependencies.d.ts +3 -0
  222. package/dist/helpers/optional-package-dependencies.js +24 -0
  223. package/dist/helpers/pointer-session.d.ts +6 -0
  224. package/dist/helpers/pointer-session.js +36 -14
  225. package/dist/helpers/prism-tomorrow.d.ts +1 -0
  226. package/dist/helpers/prism-tomorrow.js +151 -0
  227. package/dist/helpers/sequence-node-path-mutations.js +11 -0
  228. package/dist/helpers/slugify-name.d.ts +1 -0
  229. package/dist/helpers/slugify-name.js +14 -0
  230. package/dist/helpers/studio-runtime-config.d.ts +1 -0
  231. package/dist/helpers/studio-runtime-config.js +6 -1
  232. package/dist/helpers/use-copy-feedback.d.ts +4 -0
  233. package/dist/helpers/use-copy-feedback.js +19 -0
  234. package/dist/helpers/use-keybinding.d.ts +9 -3
  235. package/dist/helpers/use-keybinding.js +8 -9
  236. package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -0
  237. package/dist/helpers/use-keyboard-shortcut-label.js +15 -0
  238. package/dist/helpers/use-menu-structure.js +58 -13
  239. package/dist/icons/copy.d.ts +5 -0
  240. package/dist/icons/copy.js +12 -0
  241. package/dist/icons/input-props.d.ts +1 -1
  242. package/dist/icons/input-props.js +2 -2
  243. package/dist/icons/models.d.ts +4 -0
  244. package/dist/icons/models.js +7 -0
  245. package/dist/icons/separation.d.ts +4 -0
  246. package/dist/icons/separation.js +7 -0
  247. package/dist/icons/transcription.d.ts +4 -0
  248. package/dist/icons/transcription.js +7 -0
  249. package/dist/icons/upload.js +1 -1
  250. package/dist/state/canvas-ref.d.ts +1 -0
  251. package/dist/state/canvas-ref.js +2 -1
  252. package/dist/state/modals.d.ts +14 -2
  253. package/dist/state/sidebar.d.ts +3 -0
  254. package/dist/state/sidebar.js +6 -1
  255. package/dist/state/timeline-zoom.d.ts +1 -1
  256. package/dist/state/timeline-zoom.js +3 -3
  257. package/dist/visual-controls/VisualControls.js +4 -0
  258. package/package.json +34 -20
  259. package/dist/components/UpdateCheck.d.ts +0 -1
  260. package/dist/components/UpdateCheck.js +0 -79
  261. package/dist/esm/chunk-emw4k5b0.js +0 -99527
  262. package/dist/esm/chunk-vkrvnx2h.js +0 -99378
  263. package/dist/helpers/use-max-media-duration.d.ts +0 -2
  264. package/dist/helpers/use-max-media-duration.js +0 -61
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.ElementInstallConfirmation = exports.ElementLibraryAddConfirmation = void 0;
4
37
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -7,7 +40,6 @@ const react_1 = require("react");
7
40
  const react_dom_1 = require("react-dom");
8
41
  const remotion_1 = require("remotion");
9
42
  const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
10
- const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
11
43
  const colors_1 = require("../helpers/colors");
12
44
  const hoverable_1 = require("../helpers/hoverable");
13
45
  const resolved_stack_to_symbolicated_1 = require("../helpers/resolved-stack-to-symbolicated");
@@ -18,20 +50,25 @@ const Button_1 = require("./Button");
18
50
  const element_install_api_1 = require("./element-install-api");
19
51
  const import_assets_1 = require("./import-assets");
20
52
  const layout_1 = require("./layout");
53
+ const is_menu_item_1 = require("./Menu/is-menu-item");
21
54
  const portals_1 = require("./Menu/portals");
22
55
  const ModalButton_1 = require("./ModalButton");
23
56
  const ModalContainer_1 = require("./ModalContainer");
24
57
  const ModalFooter_1 = require("./ModalFooter");
25
58
  const ModalHeader_1 = require("./ModalHeader");
26
59
  const NewComposition_1 = require("./NewComposition/NewComposition");
60
+ const RemInput_1 = require("./NewComposition/RemInput");
27
61
  const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
28
62
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
63
+ const RadioButton_1 = require("./RadioButton");
64
+ const SegmentedControl_1 = require("./SegmentedControl");
29
65
  const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
66
+ const HighlightedElementSource = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./HighlightedElementSource'))));
30
67
  const container = {
31
68
  display: 'flex',
32
69
  flexDirection: 'column',
33
70
  gap: 20,
34
- color: colors_1.WHITE,
71
+ color: colors_1.LIGHT_TEXT,
35
72
  fontFamily: 'sans-serif',
36
73
  fontSize: 13,
37
74
  lineHeight: 1.5,
@@ -50,7 +87,7 @@ const sectionStyle = {
50
87
  };
51
88
  const sectionTitleStyle = {
52
89
  margin: 0,
53
- color: colors_1.WHITE,
90
+ color: colors_1.LIGHT_TEXT,
54
91
  fontFamily: 'sans-serif',
55
92
  fontSize: 13,
56
93
  fontWeight: 600,
@@ -78,7 +115,7 @@ const metadataTermStyle = {
78
115
  const metadataDescriptionStyle = {
79
116
  margin: 0,
80
117
  minWidth: 0,
81
- color: colors_1.WHITE,
118
+ color: colors_1.LIGHT_TEXT,
82
119
  fontFamily: 'sans-serif',
83
120
  fontSize: 13,
84
121
  fontWeight: 400,
@@ -121,10 +158,12 @@ const dependencyListStyle = {
121
158
  margin: 0,
122
159
  padding: 0,
123
160
  listStyleType: 'none',
161
+ textAlign: 'right',
162
+ minWidth: 0,
124
163
  };
125
164
  const dependencyNameStyle = {
126
165
  minWidth: 0,
127
- color: colors_1.WHITE,
166
+ color: colors_1.LIGHT_TEXT,
128
167
  fontFamily: 'sans-serif',
129
168
  fontSize: 13,
130
169
  lineHeight: 1.5,
@@ -137,9 +176,9 @@ const warningStyle = {
137
176
  minWidth: 0,
138
177
  };
139
178
  const warningIconStyle = {
140
- width: 16,
141
- height: 16,
142
- marginTop: 1,
179
+ width: 14,
180
+ height: 14,
181
+ marginTop: 2,
143
182
  flexShrink: 0,
144
183
  fill: colors_1.WARNING_COLOR,
145
184
  };
@@ -152,10 +191,6 @@ const warningDescriptionStyle = {
152
191
  fontWeight: 400,
153
192
  lineHeight: 1.5,
154
193
  };
155
- const installWarningDescriptionStyle = {
156
- ...warningDescriptionStyle,
157
- color: colors_1.WHITE,
158
- };
159
194
  const browseElementsStyle = {
160
195
  color: 'inherit',
161
196
  fontFamily: 'inherit',
@@ -171,22 +206,32 @@ const sourceDetailsStyle = {
171
206
  };
172
207
  const sourceSummaryStyle = {
173
208
  cursor: 'default',
174
- color: colors_1.WHITE,
209
+ ...(0, hoverable_1.hoverableStyle)({
210
+ idleBackground: colors_1.TRANSPARENT,
211
+ hoverBackground: colors_1.TRANSPARENT,
212
+ idleColor: colors_1.LIGHT_TEXT,
213
+ hoverColor: colors_1.WHITE,
214
+ }),
175
215
  fontFamily: 'sans-serif',
176
216
  fontSize: 13,
177
217
  fontWeight: 500,
178
218
  lineHeight: 1.5,
179
219
  };
180
- const sourceCodeBlockStyle = {
220
+ const sourceCodeContainerStyle = {
181
221
  marginTop: 10,
182
- marginBottom: 0,
183
- maxHeight: 240,
184
- overflow: 'auto',
185
- padding: 12,
222
+ overflow: 'hidden',
186
223
  border: `1px solid ${colors_1.WHITE_ALPHA_12}`,
187
224
  borderRadius: 6,
225
+ };
226
+ const sourceCodeBlockStyle = {
188
227
  backgroundColor: colors_1.INPUT_BACKGROUND,
189
- color: colors_1.WHITE,
228
+ margin: 0,
229
+ border: 0,
230
+ borderRadius: 0,
231
+ maxWidth: 'none',
232
+ maxHeight: 240,
233
+ overflow: 'auto',
234
+ padding: 12,
190
235
  fontFamily: 'monospace',
191
236
  fontSize: 12,
192
237
  lineHeight: 1.5,
@@ -206,36 +251,6 @@ const destinationControlStyle = {
206
251
  rowGap: 10,
207
252
  flexWrap: 'wrap',
208
253
  };
209
- const destinationOptionsStyle = {
210
- display: 'flex',
211
- overflow: 'hidden',
212
- maxWidth: '100%',
213
- marginLeft: 'auto',
214
- border: `1px solid ${colors_1.WHITE_ALPHA_12}`,
215
- borderRadius: 4,
216
- };
217
- const destinationOptionStyle = {
218
- appearance: 'none',
219
- minHeight: 26,
220
- border: 0,
221
- cursor: 'default',
222
- fontFamily: 'sans-serif',
223
- fontSize: 12,
224
- fontWeight: 400,
225
- lineHeight: '18px',
226
- padding: '4px 8px',
227
- whiteSpace: 'nowrap',
228
- };
229
- const getDestinationOptionStyle = ({ disabled, selected, }) => ({
230
- ...destinationOptionStyle,
231
- opacity: disabled ? 0.5 : 1,
232
- ...(0, hoverable_1.hoverableStyle)({
233
- idleBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
234
- hoverBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
235
- idleColor: selected ? colors_1.WHITE : colors_1.LIGHT_TEXT,
236
- hoverColor: disabled ? colors_1.LIGHT_TEXT : colors_1.WHITE,
237
- }),
238
- });
239
254
  const footerStyle = {
240
255
  minWidth: 0,
241
256
  };
@@ -267,8 +282,9 @@ const ElementLibraryAddConfirmation = ({ displayName, origin, url }) => {
267
282
  };
268
283
  exports.ElementLibraryAddConfirmation = ElementLibraryAddConfirmation;
269
284
  const ElementInstallConfirmation = ({ state }) => {
270
- var _a;
285
+ var _a, _b, _c, _d, _e, _f;
271
286
  const { currentPlan, missingPackages, newPlan, onClose, request, sourceIsUnverified, sourceLabel, } = state;
287
+ const sourcePreview = (0, react_1.useMemo)(() => makeSourceControlsVisible(request.element.sourceCode), [request.element.sourceCode]);
272
288
  const config = remotion_1.Internals.useUnsafeVideoConfig();
273
289
  const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
274
290
  const currentCompositionMetadata = config === null ||
@@ -281,13 +297,12 @@ const ElementInstallConfirmation = ({ state }) => {
281
297
  height: config.height,
282
298
  width: config.width,
283
299
  };
284
- const usesBrowserDependencyResolution = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
285
300
  const { currentZIndex } = (0, z_index_1.useZIndex)();
286
- const [mode, setMode] = (0, react_1.useState)(currentPlan === null ? 'new-composition' : 'current-composition');
301
+ const [mode, setMode] = (0, react_1.useState)(currentPlan === null || request.source.type === 'browser-studio-link'
302
+ ? 'new-composition'
303
+ : 'current-composition');
287
304
  const [submitting, setSubmitting] = (0, react_1.useState)(false);
288
305
  const inputRef = (0, react_1.useRef)(null);
289
- const currentDestinationRef = (0, react_1.useRef)(null);
290
- const newDestinationRef = (0, react_1.useRef)(null);
291
306
  const [newCompositionValues, setNewCompositionValues] = (0, react_1.useState)(() => {
292
307
  var _a, _b, _c, _d, _e;
293
308
  const elementComponentName = (_a = studio_protocol_1.StudioProtocolInternals.getElementComponentNameFromSourceCode(request.element.sourceCode)) !== null && _a !== void 0 ? _a : 'Element';
@@ -351,6 +366,7 @@ const ElementInstallConfirmation = ({ state }) => {
351
366
  type: 'loading',
352
367
  });
353
368
  (0, element_install_api_1.prepareElementInstall)({
369
+ installationName: null,
354
370
  destination: {
355
371
  type: 'new-composition',
356
372
  compositionFile: folderCompositionFile,
@@ -403,25 +419,151 @@ const ElementInstallConfirmation = ({ state }) => {
403
419
  ? activeNewCompositionPlanState.plan
404
420
  : null;
405
421
  const selectedPlan = mode === 'current-composition' ? currentPlan : selectedNewCompositionPlan;
422
+ const elementBaseName = (_b = request.element.slug.split('/').at(-1)) !== null && _b !== void 0 ? _b : '';
423
+ const [refreshPlan, setRefreshPlan] = (0, react_1.useState)(0);
424
+ const [input, setInput] = (0, react_1.useState)({
425
+ basePlan: selectedPlan,
426
+ baseName: elementBaseName,
427
+ refresh: refreshPlan,
428
+ name: null,
429
+ overwritePlan: null,
430
+ });
431
+ if (input.basePlan !== selectedPlan ||
432
+ input.baseName !== elementBaseName ||
433
+ input.refresh !== refreshPlan) {
434
+ setInput({
435
+ basePlan: selectedPlan,
436
+ baseName: elementBaseName,
437
+ refresh: refreshPlan,
438
+ name: null,
439
+ overwritePlan: null,
440
+ });
441
+ }
442
+ const requestedName = input.name;
443
+ const [preparation, setPreparation] = (0, react_1.useState)(null);
444
+ const currentPreparation = (preparation === null || preparation === void 0 ? void 0 : preparation.basePlan) === selectedPlan &&
445
+ (preparation === null || preparation === void 0 ? void 0 : preparation.refresh) === refreshPlan &&
446
+ (preparation === null || preparation === void 0 ? void 0 : preparation.requestedName) === requestedName
447
+ ? preparation
448
+ : null;
449
+ const preparedInstallation = (_c = currentPreparation === null || currentPreparation === void 0 ? void 0 : currentPreparation.installation) !== null && _c !== void 0 ? _c : null;
450
+ const planError = (_d = currentPreparation === null || currentPreparation === void 0 ? void 0 : currentPreparation.error) !== null && _d !== void 0 ? _d : null;
451
+ const installationName = (_e = requestedName !== null && requestedName !== void 0 ? requestedName : preparedInstallation === null || preparedInstallation === void 0 ? void 0 : preparedInstallation.name) !== null && _e !== void 0 ? _e : elementBaseName;
452
+ const [existingInstallation, setExistingInstallation] = (0, react_1.useState)(null);
453
+ const existingDestination = (existingInstallation === null || existingInstallation === void 0 ? void 0 : existingInstallation.basePlan) === selectedPlan &&
454
+ (existingInstallation === null || existingInstallation === void 0 ? void 0 : existingInstallation.refresh) === refreshPlan
455
+ ? existingInstallation
456
+ : null;
457
+ const overwriteExisting = existingDestination !== null &&
458
+ input.overwritePlan === existingDestination.plan;
459
+ const activePlan = overwriteExisting
460
+ ? existingDestination.plan
461
+ : ((_f = preparedInstallation === null || preparedInstallation === void 0 ? void 0 : preparedInstallation.plan) !== null && _f !== void 0 ? _f : null);
462
+ const [createdComposition, setCreatedComposition] = (0, react_1.useState)(null);
463
+ const creationKey = JSON.stringify(newCompositionValues);
464
+ const compositionAlreadyCreated = createdComposition === creationKey;
465
+ (0, react_1.useEffect)(() => {
466
+ if (selectedPlan === null) {
467
+ return;
468
+ }
469
+ let canceled = false;
470
+ (async () => {
471
+ let candidate = requestedName !== null && requestedName !== void 0 ? requestedName : elementBaseName;
472
+ let copyNumber = 1;
473
+ while (true) {
474
+ const result = await (0, element_install_api_1.prepareElementInstall)({
475
+ installationName: candidate,
476
+ destination: mode === 'current-composition'
477
+ ? {
478
+ type: 'current-composition',
479
+ compositionFile: request.compositionFile,
480
+ compositionId: request.compositionId,
481
+ }
482
+ : {
483
+ type: 'new-composition',
484
+ compositionFile: selectedPlan.compositionFile,
485
+ },
486
+ element: request.element,
487
+ });
488
+ if (canceled)
489
+ return;
490
+ if (!result.success)
491
+ throw new Error(result.reason);
492
+ const prepared = {
493
+ basePlan: selectedPlan,
494
+ name: candidate,
495
+ refresh: refreshPlan,
496
+ plan: result.plan,
497
+ };
498
+ if (result.plan.expectedFileState.exists) {
499
+ setExistingInstallation((previous) => (previous === null || previous === void 0 ? void 0 : previous.basePlan) === selectedPlan &&
500
+ previous.refresh === refreshPlan
501
+ ? previous
502
+ : prepared);
503
+ if (requestedName === null) {
504
+ candidate = `${elementBaseName}-copy${copyNumber === 1 ? '' : `-${copyNumber}`}`;
505
+ copyNumber++;
506
+ continue;
507
+ }
508
+ }
509
+ setPreparation({
510
+ basePlan: selectedPlan,
511
+ refresh: refreshPlan,
512
+ requestedName,
513
+ installation: prepared,
514
+ error: null,
515
+ });
516
+ return;
517
+ }
518
+ })().catch((error) => {
519
+ if (!canceled) {
520
+ setPreparation({
521
+ basePlan: selectedPlan,
522
+ refresh: refreshPlan,
523
+ requestedName,
524
+ installation: null,
525
+ error: error instanceof Error ? error.message : String(error),
526
+ });
527
+ }
528
+ });
529
+ return () => {
530
+ canceled = true;
531
+ };
532
+ }, [
533
+ elementBaseName,
534
+ requestedName,
535
+ mode,
536
+ refreshPlan,
537
+ request,
538
+ selectedPlan,
539
+ ]);
540
+ const installationNameError = installationName.length > 0
541
+ ? (planError !== null && planError !== void 0 ? planError : (requestedName !== null && (activePlan === null || activePlan === void 0 ? void 0 : activePlan.expectedFileState.exists)
542
+ ? 'Name already taken.'
543
+ : null))
544
+ : null;
406
545
  const folderTargetIsReady = selectedFolderStack === null ||
407
546
  ((0, use_resolved_stack_1.hasResolvedStack)(selectedFolderStack) && folderCompositionFile !== null);
408
547
  const title = `Install ${request.element.displayName}${request.element.displayName.endsWith(' Element') ? '' : ' Element'}`;
409
548
  const canSubmit = !submitting &&
549
+ (overwriteExisting ||
550
+ (planError === null &&
551
+ studio_protocol_1.StudioProtocolInternals.makeElementFileNameFromSlug(installationName) === `${installationName}.element.tsx` &&
552
+ (activePlan !== null
553
+ ? !activePlan.expectedFileState.exists
554
+ : requestedName !== null))) &&
410
555
  (mode === 'current-composition'
411
556
  ? currentPlan !== null
412
- : newCompositionValuesAreValid &&
557
+ : (newCompositionValuesAreValid || compositionAlreadyCreated) &&
413
558
  folderTargetIsReady &&
414
559
  selectedNewCompositionPlan !== null);
415
560
  const submit = (0, react_1.useCallback)(async () => {
416
- if (!canSubmit) {
561
+ var _a, _b;
562
+ if (!canSubmit || selectedPlan === null) {
417
563
  return;
418
564
  }
419
565
  setSubmitting(true);
420
- if (mode === 'new-composition') {
421
- if (selectedNewCompositionPlan === null) {
422
- setSubmitting(false);
423
- return;
424
- }
566
+ if (mode === 'new-composition' && !compositionAlreadyCreated) {
425
567
  const created = await createComposition({
426
568
  signal: new AbortController().signal,
427
569
  symbolicatedStack: selectedFolderStack === null ? null : folderSymbolicatedStack,
@@ -431,115 +573,127 @@ const ElementInstallConfirmation = ({ state }) => {
431
573
  setSubmitting(false);
432
574
  return;
433
575
  }
434
- await (0, import_assets_1.insertElement)({
435
- compositionFile: selectedNewCompositionPlan.compositionFile,
436
- compositionId: newCompositionValues.id,
437
- element: request.element,
438
- expectedFileState: selectedNewCompositionPlan.expectedFileState,
439
- from: null,
440
- overwriteExisting: selectedNewCompositionPlan.expectedFileState.exists,
441
- position: null,
442
- });
443
- onClose();
444
- return;
576
+ setCreatedComposition(creationKey);
445
577
  }
446
- if (currentPlan === null) {
447
- setSubmitting(false);
448
- return;
449
- }
450
- await (0, import_assets_1.insertElement)({
451
- compositionFile: request.compositionFile,
452
- compositionId: request.compositionId,
578
+ const installed = await (0, import_assets_1.insertElement)({
579
+ installationName: overwriteExisting
580
+ ? ((_a = existingDestination === null || existingDestination === void 0 ? void 0 : existingDestination.name) !== null && _a !== void 0 ? _a : installationName)
581
+ : installationName,
582
+ compositionFile: mode === 'new-composition'
583
+ ? selectedPlan.compositionFile
584
+ : request.compositionFile,
585
+ compositionId: mode === 'new-composition'
586
+ ? newCompositionValues.id
587
+ : request.compositionId,
453
588
  element: request.element,
454
- expectedFileState: currentPlan.expectedFileState,
455
- from: request.from,
456
- overwriteExisting: currentPlan.expectedFileState.exists,
457
- position: request.position,
589
+ // The insert operation revalidates this even if the name preflight is pending.
590
+ expectedFileState: (_b = activePlan === null || activePlan === void 0 ? void 0 : activePlan.expectedFileState) !== null && _b !== void 0 ? _b : { exists: false },
591
+ from: mode === 'new-composition' ? null : request.from,
592
+ overwriteExisting,
593
+ position: mode === 'new-composition' ? null : request.position,
458
594
  });
459
- onClose();
595
+ if (installed)
596
+ onClose();
597
+ else {
598
+ setSubmitting(false);
599
+ setRefreshPlan((value) => value + 1);
600
+ }
460
601
  }, [
602
+ activePlan,
603
+ existingDestination,
604
+ compositionAlreadyCreated,
605
+ creationKey,
606
+ installationName,
607
+ overwriteExisting,
461
608
  canSubmit,
462
609
  createComposition,
463
- currentPlan,
464
610
  folderSymbolicatedStack,
465
611
  mode,
466
612
  newCompositionValues.id,
467
613
  onClose,
468
614
  request,
469
615
  selectedFolderStack,
470
- selectedNewCompositionPlan,
616
+ selectedPlan,
471
617
  ]);
472
618
  const cancel = (0, react_1.useCallback)(() => {
473
619
  if (!submitting) {
474
620
  onClose();
475
621
  }
476
622
  }, [onClose, submitting]);
477
- const onDestinationKeyDown = (0, react_1.useCallback)((event) => {
478
- if (!['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
479
- return;
480
- }
481
- event.preventDefault();
482
- if (currentPlan === null) {
483
- return;
484
- }
485
- const nextMode = mode === 'current-composition'
486
- ? 'new-composition'
487
- : 'current-composition';
488
- setMode(nextMode);
489
- requestAnimationFrame(() => {
490
- var _a, _b;
491
- if (nextMode === 'current-composition') {
492
- (_a = currentDestinationRef.current) === null || _a === void 0 ? void 0 : _a.focus();
493
- }
494
- else {
495
- (_b = newDestinationRef.current) === null || _b === void 0 ? void 0 : _b.focus();
496
- }
497
- });
498
- }, [currentPlan, mode]);
623
+ const destinationOptions = (0, react_1.useMemo)(() => [
624
+ {
625
+ key: 'current-composition',
626
+ label: 'Current composition',
627
+ selected: mode === 'current-composition',
628
+ onClick: currentPlan === null ? null : () => setMode('current-composition'),
629
+ },
630
+ {
631
+ key: 'new-composition',
632
+ label: 'New composition',
633
+ selected: mode === 'new-composition',
634
+ onClick: () => {
635
+ setMode('new-composition');
636
+ requestAnimationFrame(() => {
637
+ var _a;
638
+ return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
639
+ });
640
+ },
641
+ },
642
+ ], [currentPlan, mode]);
499
643
  const onSubmit = (0, react_1.useCallback)((event) => {
500
644
  event.preventDefault();
501
645
  submit();
502
646
  }, [submit]);
503
647
  return (0, react_dom_1.createPortal)(jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { ariaLabelledBy: elementInstallTitleId, onOutsideClick: cancel, onEscape: cancel, children: [
504
648
  jsx_runtime_1.jsx("div", { id: elementInstallTitleId, children: jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: title, onClose: cancel }) }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
505
- jsx_runtime_1.jsxs("div", { style: dialogContent, children: [
649
+ jsx_runtime_1.jsxs("div", { style: dialogContent, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
506
650
  jsx_runtime_1.jsxs("dl", { style: requestSourceStyle, "aria-label": "Request source", children: [
507
651
  jsx_runtime_1.jsx("dt", { style: sectionTitleStyle, children: "From" }), jsx_runtime_1.jsx("dd", { style: sourceIsUnverified
508
652
  ? unverifiedRequestSourceStyle
509
653
  : requestSourceDescriptionStyle, children: sourceLabel })
510
- ] }), jsx_runtime_1.jsxs("div", { style: destinationControlStyle, children: [
511
- jsx_runtime_1.jsx("div", { style: sectionTitleStyle, children: "Destination" }), jsx_runtime_1.jsxs("div", { "aria-label": "Installation destination", onKeyDown: onDestinationKeyDown, role: "radiogroup", style: destinationOptionsStyle, children: [
512
- jsx_runtime_1.jsx("button", { ref: currentDestinationRef, "aria-checked": mode === 'current-composition', className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, disabled: currentPlan === null, onClick: () => setMode('current-composition'), role: "radio", style: getDestinationOptionStyle({
513
- disabled: currentPlan === null,
514
- selected: mode === 'current-composition',
515
- }), tabIndex: mode === 'current-composition' ? 0 : -1, type: "button", children: "Current composition" }), jsx_runtime_1.jsx("button", { ref: newDestinationRef, "aria-checked": mode === 'new-composition', className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: () => {
516
- setMode('new-composition');
517
- requestAnimationFrame(() => {
518
- var _a;
519
- return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
520
- });
521
- }, role: "radio", style: {
522
- ...getDestinationOptionStyle({
523
- disabled: false,
524
- selected: mode === 'new-composition',
525
- }),
526
- borderLeft: `1px solid ${colors_1.WHITE_ALPHA_12}`,
527
- }, tabIndex: mode === 'new-composition' ? 0 : -1, type: "button", children: "New composition" })
528
- ] })
654
+ ] }), activePlan ? (jsx_runtime_1.jsxs("dl", { style: requestSourceStyle, children: [
655
+ jsx_runtime_1.jsx("dt", { style: sectionTitleStyle, children: "Destination" }), jsx_runtime_1.jsx("dd", { style: requestSourceDescriptionStyle, children: activePlan.filePath })
656
+ ] })) : null, jsx_runtime_1.jsxs("div", { style: destinationControlStyle, children: [
657
+ jsx_runtime_1.jsx("div", { style: sectionTitleStyle, children: "Add to" }), jsx_runtime_1.jsx("div", { "aria-label": "Add to", role: "group", style: { marginLeft: 'auto' }, children: jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: destinationOptions, needsWrapping: false, size: "medium" }) })
529
658
  ] }), currentPlan === null ? (jsx_runtime_1.jsxs("div", { style: warningStyle, role: "status", children: [
530
- jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: installWarningDescriptionStyle, children: ["Studio could not find a safe place in \u201C", request.compositionId, "\u201D to insert the Element. Install it into a new composition instead."] })
531
- ] })) : null, mode === 'new-composition' ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-label": "New composition settings", children: [
532
- jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: nameValidationMessage, setValues: setNewCompositionValues, values: newCompositionValues, widthValidationMessage: widthValidationMessage }), (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'error' ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: activeNewCompositionPlanState.reason, type: "error" })) : null] })) : null, (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.expectedFileState.exists) ? (jsx_runtime_1.jsx("p", { style: overwriteStyle, role: "status", children: "This will replace the existing Element source file." })) : null, missingPackages.length > 0 ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-labelledby": "element-install-dependencies", children: [
659
+ jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: warningDescriptionStyle, children: ["Studio could not find a safe place in \u201C", request.compositionId, "\u201D to insert the Element. Install it into a new composition instead."] })
660
+ ] })) : null, mode === 'new-composition' ? (jsx_runtime_1.jsxs("section", { style: { ...sectionStyle, marginInline: -16 }, "aria-label": "New composition settings", children: [
661
+ jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: compositionAlreadyCreated ? null : nameValidationMessage, setValues: setNewCompositionValues, values: newCompositionValues, widthValidationMessage: widthValidationMessage }), (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'error' ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: activeNewCompositionPlanState.reason, type: "error" })) : null] })) : null, jsx_runtime_1.jsx("section", { style: sectionStyle, "aria-label": "Element implementation", children: existingDestination ? (jsx_runtime_1.jsxs("div", { role: "radiogroup", "aria-label": "Existing Element file", style: sectionStyle, children: [
662
+ jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: !overwriteExisting, disabled: submitting, onClick: () => setInput((previous) => ({ ...previous, overwritePlan: null })), children: "Create a copy" }), !overwriteExisting ? (jsx_runtime_1.jsxs("div", { style: {
663
+ ...sectionStyle,
664
+ paddingLeft: 28,
665
+ maxWidth: 320,
666
+ minWidth: 0,
667
+ }, children: [
668
+ jsx_runtime_1.jsx(RemInput_1.RemotionInput, { rightAlign: false, status: installationNameError ? 'error' : 'ok', id: "element-install-name", name: "installationName", "aria-label": "Installation name", placeholder: "New name", value: installationName, disabled: submitting, onChange: (event) => {
669
+ const name = event.target.value;
670
+ setInput((previous) => ({
671
+ ...previous,
672
+ name,
673
+ overwritePlan: null,
674
+ }));
675
+ } }), installationNameError ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: installationNameError, type: "error" })) : null] })) : null, jsx_runtime_1.jsxs("div", { style: sectionStyle, children: [
676
+ jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: overwriteExisting, disabled: submitting, onClick: () => setInput((previous) => ({
677
+ ...previous,
678
+ overwritePlan: existingDestination.plan,
679
+ })), children: "Replace existing" }), jsx_runtime_1.jsx("p", { style: {
680
+ ...warningDescriptionStyle,
681
+ paddingLeft: 28,
682
+ overflowWrap: 'anywhere',
683
+ }, children: existingDestination.plan.filePath }), overwriteExisting ? (jsx_runtime_1.jsx("p", { style: { ...overwriteStyle, paddingLeft: 28 }, children: "Overwrites customizations for all usages." })) : null] })
684
+ ] })) : !activePlan && planError ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: planError, type: "error" })) : null }), missingPackages.length > 0 ? (jsx_runtime_1.jsxs("section", { style: requestSourceStyle, "aria-labelledby": "element-install-dependencies", children: [
533
685
  jsx_runtime_1.jsx("h3", { id: "element-install-dependencies", style: sectionTitleStyle, children: "Packages to install" }), jsx_runtime_1.jsx("ul", { style: dependencyListStyle, role: "list", children: missingPackages.map((packageName) => (jsx_runtime_1.jsx("li", { style: dependencyNameStyle, children: packageName }, packageName))) })
534
686
  ] })) : null, jsx_runtime_1.jsxs("div", { style: warningStyle, children: [
535
- jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: installWarningDescriptionStyle, children: ["This adds executable source code to your project, with access to your files and the network.", usesBrowserDependencyResolution || missingPackages.length === 0
536
- ? null
537
- : ' Package lifecycle scripts may also run during installation.'] })
687
+ jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsx("p", { style: warningDescriptionStyle, children: "Installed code can access your files and network." })
538
688
  ] }), jsx_runtime_1.jsxs("details", { style: sourceDetailsStyle, children: [
539
- jsx_runtime_1.jsx("summary", { style: sourceSummaryStyle, children: "Source code" }), jsx_runtime_1.jsx("pre", { style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: makeSourceControlsVisible(request.element.sourceCode) }) })
689
+ jsx_runtime_1.jsx("summary", { className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: sourceSummaryStyle, children: "Source code" }), jsx_runtime_1.jsx("div", { style: sourceCodeContainerStyle, children: jsx_runtime_1.jsx("pre", { className: `language-tsx ${is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME} ${is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: jsx_runtime_1.jsx(react_1.Suspense, { fallback: sourcePreview, children: jsx_runtime_1.jsx(HighlightedElementSource, { source: sourcePreview }) }) }) }) })
540
690
  ] })
541
691
  ] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footerStyle, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
542
- jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(Button_1.Button, { disabled: submitting, onClick: cancel, style: cancelStyle, children: "Cancel" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs(ModalButton_1.ModalButton, { autoFocus: mode === 'current-composition', disabled: !canSubmit, onClick: submit, children: [submitting ? 'Installing…' : 'Install', jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: false })
692
+ jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(Button_1.Button, { disabled: submitting, onClick: cancel, style: cancelStyle, children: "Cancel" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs(ModalButton_1.ModalButton, { autoFocus: mode === 'current-composition', disabled: !canSubmit, onClick: submit, children: [submitting
693
+ ? 'Installing…'
694
+ : overwriteExisting
695
+ ? 'Replace and insert'
696
+ : 'Install', jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: false })
543
697
  ] })
544
698
  ] }) })
545
699
  ] })