@remotion/studio 4.0.513 → 4.0.515

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 (204) hide show
  1. package/dist/Studio.js +2 -1
  2. package/dist/api/install-package.js +14 -1
  3. package/dist/components/AskAiModal.js +1 -1
  4. package/dist/components/AssetSelector.js +2 -0
  5. package/dist/components/AssetSelectorItem.d.ts +2 -1
  6. package/dist/components/AssetSelectorItem.js +19 -16
  7. package/dist/components/AudioWaveform.d.ts +3 -0
  8. package/dist/components/AudioWaveform.js +65 -199
  9. package/dist/components/Canvas.js +40 -5
  10. package/dist/components/CanvasOrLoading.js +5 -0
  11. package/dist/components/CompositionSelector.js +2 -0
  12. package/dist/components/ConfigureDefaultEditorModal.js +17 -11
  13. package/dist/components/Editor.js +16 -1
  14. package/dist/components/ElementInstallConfirmation.d.ts +1 -0
  15. package/dist/components/ElementInstallConfirmation.js +4 -2
  16. package/dist/components/FixComputedValueModal.d.ts +9 -0
  17. package/dist/components/FixComputedValueModal.js +217 -0
  18. package/dist/components/InitialCompositionLoader.js +19 -0
  19. package/dist/components/InlineDropdown.js +4 -4
  20. package/dist/components/InspectorInfoHeader.js +3 -3
  21. package/dist/components/InspectorOpenInEditor.js +3 -1
  22. package/dist/components/InspectorPanel/CompositionInspector.js +37 -5
  23. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  24. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +1 -1
  25. package/dist/components/InspectorPanel/EasingInspector.js +1 -1
  26. package/dist/components/InspectorPanel/KeyframeInspector.js +2 -2
  27. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +1 -1
  28. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +35 -6
  29. package/dist/components/InspectorPanel/common.d.ts +5 -5
  30. package/dist/components/InspectorPanel/common.js +8 -8
  31. package/dist/components/InspectorPanel/styles.d.ts +1 -1
  32. package/dist/components/InspectorPanel/styles.js +4 -2
  33. package/dist/components/InspectorSourceLocation.d.ts +1 -1
  34. package/dist/components/InspectorSourceLocation.js +2 -2
  35. package/dist/components/InstallPackage.d.ts +1 -1
  36. package/dist/components/InstallPackage.js +38 -6
  37. package/dist/components/LicenseKeyValidation.js +2 -2
  38. package/dist/components/Menu/MenuDivider.js +1 -1
  39. package/dist/components/Modals.js +11 -3
  40. package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
  41. package/dist/components/NewComposition/CodemodFooter.js +10 -8
  42. package/dist/components/NewComposition/DeleteComposition.js +1 -1
  43. package/dist/components/NewComposition/DeleteFolder.js +1 -1
  44. package/dist/components/NewComposition/DuplicateComposition.js +7 -2
  45. package/dist/components/NewComposition/NewComposition.js +1 -1
  46. package/dist/components/NewComposition/NewFolder.js +1 -1
  47. package/dist/components/NewComposition/RenameComposition.js +1 -1
  48. package/dist/components/NewComposition/RenameFolder.js +1 -1
  49. package/dist/components/NewComposition/duplicate-composition-api.d.ts +16 -0
  50. package/dist/components/NewComposition/duplicate-composition-api.js +16 -0
  51. package/dist/components/NoRegisterRoot.js +1 -1
  52. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +4 -3
  53. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
  54. package/dist/components/QuickSwitcher/fuzzy-search.js +1 -1
  55. package/dist/components/RefreshCompositionOverlay.js +1 -1
  56. package/dist/components/RenderButton.js +6 -3
  57. package/dist/components/RenderModal/GuiRenderStatus.js +3 -1
  58. package/dist/components/RenderModal/RenderModalOutputName.js +3 -3
  59. package/dist/components/RenderModal/WebRenderModal.js +10 -4
  60. package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +2 -0
  61. package/dist/components/RenderModal/WebRenderModalAdvanced.js +9 -2
  62. package/dist/components/RenderModal/render-modals.js +5 -1
  63. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +5 -1
  64. package/dist/components/RenderQueue/RenderQueueItem.js +3 -1
  65. package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +3 -1
  66. package/dist/components/RenderQueue/RenderQueueRemoveItem.js +1 -1
  67. package/dist/components/RenderQueue/actions.js +12 -2
  68. package/dist/components/RenderQueue/client-side-render-types.d.ts +1 -0
  69. package/dist/components/RenderingSettings.d.ts +2 -0
  70. package/dist/components/RenderingSettings.js +355 -0
  71. package/dist/components/SelectedOutlineCanvasRotation.d.ts +1 -0
  72. package/dist/components/SelectedOutlineCanvasRotation.js +11 -4
  73. package/dist/components/SelectedOutlineElement.js +3 -3
  74. package/dist/components/SelectedOutlinePolygon.d.ts +2 -0
  75. package/dist/components/SelectedOutlinePolygon.js +54 -9
  76. package/dist/components/SettingsContext.d.ts +4 -1
  77. package/dist/components/SettingsContext.js +9 -2
  78. package/dist/components/SettingsModal.d.ts +1 -1
  79. package/dist/components/SettingsModal.js +10 -1
  80. package/dist/components/SettingsModalFooter.js +1 -1
  81. package/dist/components/StudioSettings.d.ts +2 -0
  82. package/dist/components/StudioSettings.js +185 -0
  83. package/dist/components/Timeline/LoopedIndicator.js +1 -1
  84. package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +3 -0
  85. package/dist/components/Timeline/LoopedTimelineIndicators.js +22 -14
  86. package/dist/components/Timeline/Timeline.js +11 -9
  87. package/dist/components/Timeline/TimelineAssetField.d.ts +2 -2
  88. package/dist/components/Timeline/TimelineAssetField.js +1 -1
  89. package/dist/components/Timeline/TimelineClipboardKeybindings.js +6 -2
  90. package/dist/components/Timeline/TimelineDragHandler.js +62 -76
  91. package/dist/components/Timeline/TimelineEffectItem.js +23 -6
  92. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +4 -2
  93. package/dist/components/Timeline/TimelineEffectPropItem.js +22 -13
  94. package/dist/components/Timeline/TimelineExpandArrowButton.js +10 -7
  95. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +4 -1
  96. package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -1
  97. package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
  98. package/dist/components/Timeline/TimelineExpandedSection.js +8 -5
  99. package/dist/components/Timeline/TimelineHeightContainer.d.ts +0 -4
  100. package/dist/components/Timeline/TimelineHeightContainer.js +4 -4
  101. package/dist/components/Timeline/TimelineImageInfo.d.ts +1 -0
  102. package/dist/components/Timeline/TimelineImageInfo.js +3 -2
  103. package/dist/components/Timeline/TimelineKeyframeControls.js +6 -1
  104. package/dist/components/Timeline/TimelineList.d.ts +1 -5
  105. package/dist/components/Timeline/TimelineList.js +14 -9
  106. package/dist/components/Timeline/TimelinePinchZoom.js +5 -5
  107. package/dist/components/Timeline/TimelineRowChrome.d.ts +1 -2
  108. package/dist/components/Timeline/TimelineRowChrome.js +50 -7
  109. package/dist/components/Timeline/TimelineSchemaField.d.ts +7 -3
  110. package/dist/components/Timeline/TimelineSchemaField.js +71 -13
  111. package/dist/components/Timeline/TimelineScrollable.js +3 -1
  112. package/dist/components/Timeline/TimelineSelection.d.ts +13 -5
  113. package/dist/components/Timeline/TimelineSelection.js +95 -106
  114. package/dist/components/Timeline/TimelineSequence.js +59 -25
  115. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -1
  116. package/dist/components/Timeline/TimelineSequenceItem.js +21 -12
  117. package/dist/components/Timeline/TimelineSequenceName.js +1 -1
  118. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +2 -1
  119. package/dist/components/Timeline/TimelineSequencePropItem.js +3 -3
  120. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +33 -10
  121. package/dist/components/Timeline/TimelineSlider.js +42 -33
  122. package/dist/components/Timeline/TimelineTimeIndicators.js +90 -98
  123. package/dist/components/Timeline/TimelineTrack.js +4 -1
  124. package/dist/components/Timeline/TimelineTracks.d.ts +0 -2
  125. package/dist/components/Timeline/TimelineTracks.js +11 -4
  126. package/dist/components/Timeline/TimelineTransformOriginField.js +1 -1
  127. package/dist/components/Timeline/TimelineVideoInfo.d.ts +4 -4
  128. package/dist/components/Timeline/TimelineVideoInfo.js +155 -63
  129. package/dist/components/Timeline/TimelineViewport.d.ts +12 -0
  130. package/dist/components/Timeline/TimelineViewport.js +62 -0
  131. package/dist/components/Timeline/TimelineVirtualization.d.ts +22 -0
  132. package/dist/components/Timeline/TimelineVirtualization.js +144 -0
  133. package/dist/components/Timeline/TimelineZoomControls.js +16 -8
  134. package/dist/components/Timeline/call-add-keyframe.js +31 -3
  135. package/dist/components/Timeline/call-delete-keyframe.js +13 -3
  136. package/dist/components/Timeline/call-move-keyframe.js +11 -1
  137. package/dist/components/Timeline/call-update-keyframe-settings.js +31 -3
  138. package/dist/components/Timeline/delete-selected-timeline-item.js +8 -3
  139. package/dist/components/Timeline/duplicate-selected-timeline-item.js +4 -2
  140. package/dist/components/Timeline/get-timeline-keyframes.d.ts +1 -2
  141. package/dist/components/Timeline/get-timeline-keyframes.js +1 -8
  142. package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +30 -0
  143. package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +61 -0
  144. package/dist/components/Timeline/save-effect-prop.js +3 -3
  145. package/dist/components/Timeline/split-selected-timeline-item.js +2 -2
  146. package/dist/components/Timeline/timeline-scroll-logic.d.ts +24 -0
  147. package/dist/components/Timeline/timeline-scroll-logic.js +127 -4
  148. package/dist/components/Timeline/use-timeline-height.d.ts +3 -5
  149. package/dist/components/Timeline/use-timeline-height.js +16 -18
  150. package/dist/components/UpdateCheck.d.ts +2 -10
  151. package/dist/components/UpdateCheck.js +8 -2
  152. package/dist/components/VisualControls/VisualControlHandle.js +8 -0
  153. package/dist/components/delete-jsx-node-api.d.ts +2 -0
  154. package/dist/components/delete-jsx-node-api.js +12 -0
  155. package/dist/components/effect-drag-and-drop.js +6 -3
  156. package/dist/components/effect-operations-api.d.ts +8 -0
  157. package/dist/components/effect-operations-api.js +52 -0
  158. package/dist/components/element-install-api.d.ts +3 -0
  159. package/dist/components/element-install-api.js +19 -0
  160. package/dist/components/import-assets.js +20 -9
  161. package/dist/components/reorder-sequence-api.d.ts +2 -0
  162. package/dist/components/reorder-sequence-api.js +12 -0
  163. package/dist/components/split-jsx-sequence-api.d.ts +2 -0
  164. package/dist/components/split-jsx-sequence-api.js +12 -0
  165. package/dist/components/split-video-from-audio-api.d.ts +2 -0
  166. package/dist/components/split-video-from-audio-api.js +12 -0
  167. package/dist/error-overlay/remotion-overlay/Overlay.js +1 -1
  168. package/dist/error-overlay/remotion-overlay/log-studio-error.js +4 -0
  169. package/dist/esm/{chunk-r46yxrjr.js → chunk-s6k99gh2.js} +1 -1
  170. package/dist/esm/{chunk-tv7r0jy3.js → chunk-v5a8vpv4.js} +11479 -7851
  171. package/dist/esm/index.mjs +7 -5
  172. package/dist/esm/internals.mjs +11479 -7851
  173. package/dist/esm/previewEntry.mjs +11311 -7683
  174. package/dist/esm/renderEntry.mjs +3 -4
  175. package/dist/helpers/browser-studio-operations.d.ts +5 -0
  176. package/dist/helpers/browser-studio-operations.js +27 -1
  177. package/dist/helpers/colors.d.ts +1 -1
  178. package/dist/helpers/colors.js +1 -1
  179. package/dist/helpers/get-timeline-max-zoom.d.ts +26 -0
  180. package/dist/helpers/get-timeline-max-zoom.js +45 -0
  181. package/dist/helpers/inject-css.js +7 -5
  182. package/dist/helpers/render-codec-label.d.ts +1 -1
  183. package/dist/helpers/retry-payload.js +1 -0
  184. package/dist/helpers/studio-runtime-config.d.ts +1 -1
  185. package/dist/helpers/studio-runtime-config.js +2 -3
  186. package/dist/helpers/timeline-layout.d.ts +3 -1
  187. package/dist/helpers/timeline-layout.js +6 -1
  188. package/dist/helpers/url-state.js +3 -2
  189. package/dist/helpers/use-max-media-duration.js +5 -3
  190. package/dist/helpers/use-media-metadata.js +37 -20
  191. package/dist/helpers/use-menu-structure.js +67 -84
  192. package/dist/helpers/use-runtime-values.d.ts +2 -1
  193. package/dist/helpers/use-runtime-values.js +7 -3
  194. package/dist/icons/cloud-download.d.ts +4 -0
  195. package/dist/icons/cloud-download.js +8 -0
  196. package/dist/icons/remotion-triangle.d.ts +2 -0
  197. package/dist/icons/remotion-triangle.js +7 -0
  198. package/dist/renderEntry.js +1 -1
  199. package/dist/state/composition-list.d.ts +13 -0
  200. package/dist/state/composition-list.js +21 -0
  201. package/dist/state/modals.d.ts +8 -2
  202. package/dist/state/timeline-zoom.d.ts +1 -2
  203. package/dist/state/timeline-zoom.js +9 -5
  204. package/package.json +14 -13
@@ -10,6 +10,7 @@ const CodingAgentIcon_1 = require("./CodingAgentIcon");
10
10
  const layout_1 = require("./layout");
11
11
  const ComboBox_1 = require("./NewComposition/ComboBox");
12
12
  const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
13
+ const layout_2 = require("./RenderModal/layout");
13
14
  const SettingsContext_1 = require("./SettingsContext");
14
15
  const use_auto_save_config_1 = require("./use-auto-save-config");
15
16
  const container = {
@@ -20,7 +21,6 @@ const container = {
20
21
  };
21
22
  const content = {
22
23
  flex: 1,
23
- padding: 16,
24
24
  };
25
25
  const description = {
26
26
  color: colors_1.LIGHT_TEXT,
@@ -29,16 +29,18 @@ const description = {
29
29
  lineHeight: 1.5,
30
30
  margin: 0,
31
31
  };
32
- const title = {
33
- color: colors_1.LIGHT_TEXT,
34
- fontFamily: 'sans-serif',
35
- fontSize: 14,
36
- lineHeight: 1.5,
37
- margin: 0,
38
- };
39
32
  const comboBoxStyle = {
40
33
  boxSizing: 'border-box',
41
- width: '100%',
34
+ width: 180,
35
+ };
36
+ const rightDescription = {
37
+ ...description,
38
+ textAlign: 'right',
39
+ };
40
+ const rightColumn = {
41
+ ...layout_2.rightRow,
42
+ alignItems: 'flex-end',
43
+ flexDirection: 'column',
42
44
  };
43
45
  const appLabel = {
44
46
  display: 'flex',
@@ -192,8 +194,12 @@ const DefaultEditorSettings = () => {
192
194
  });
193
195
  const displayedError = error !== null && error !== void 0 ? error : settingsError;
194
196
  return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs("div", { style: content, children: [
195
- jsx_runtime_1.jsx("p", { style: title, children: "Default editor" }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), editorInfo === null && displayedError === null ? (jsx_runtime_1.jsx("p", { style: description, children: "Loading installed editors..." })) : null, (editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.length) === 0 ? (jsx_runtime_1.jsx("p", { style: description, children: "No supported editors were found on this computer." })) : null, editorInfo === null ? null : (jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: editorValues, selectedId: selectedEditor !== null && selectedEditor !== void 0 ? selectedEditor : NO_PREFERENCE_ID, style: comboBoxStyle, title: "Default editor" })), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2, block: true }), jsx_runtime_1.jsx("p", { style: title, children: "Default coding agent" }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), codingAgentInfo === null && displayedError === null ? (jsx_runtime_1.jsx("p", { style: description, children: "Loading installed coding agents..." })) : null, (codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.installedCodingAgents.length) === 0 ? (jsx_runtime_1.jsx("p", { style: description, children: "No supported coding agents were found on this computer." })) : null, codingAgentInfo === null ? null : (jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: codingAgentValues, selectedId: selectedCodingAgent !== null && selectedCodingAgent !== void 0 ? selectedCodingAgent : NO_PREFERENCE_ID, style: comboBoxStyle, title: "Default coding agent" })), displayedError ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
196
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 1.5 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: displayedError, align: "flex-start", type: "error" })
197
+ jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
198
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Default editor" }), jsx_runtime_1.jsxs("div", { style: rightColumn, children: [editorInfo === null && displayedError === null ? (jsx_runtime_1.jsx("p", { style: rightDescription, children: "Loading installed editors..." })) : null, (editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.length) === 0 ? (jsx_runtime_1.jsx("p", { style: rightDescription, children: "No supported editors were found on this computer." })) : null, editorInfo === null ? null : (jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: editorValues, selectedId: selectedEditor !== null && selectedEditor !== void 0 ? selectedEditor : NO_PREFERENCE_ID, style: comboBoxStyle, title: "Default editor" }))] })
199
+ ] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
200
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Default coding agent" }), jsx_runtime_1.jsxs("div", { style: rightColumn, children: [codingAgentInfo === null && displayedError === null ? (jsx_runtime_1.jsx("p", { style: rightDescription, children: "Loading installed coding agents..." })) : null, (codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.installedCodingAgents.length) === 0 ? (jsx_runtime_1.jsx("p", { style: rightDescription, children: "No supported coding agents were found on this computer." })) : null, codingAgentInfo === null ? null : (jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: codingAgentValues, selectedId: selectedCodingAgent !== null && selectedCodingAgent !== void 0 ? selectedCodingAgent : NO_PREFERENCE_ID, style: comboBoxStyle, title: "Default coding agent" }))] })
201
+ ] }), displayedError ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
202
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1.5 }), jsx_runtime_1.jsx("div", { style: { paddingLeft: 16, paddingRight: 16 }, children: jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: displayedError, align: "flex-start", type: "error" }) })
197
203
  ] })) : null] }) }));
198
204
  };
199
205
  exports.DefaultEditorSettings = DefaultEditorSettings;
@@ -44,6 +44,7 @@ const noop_1 = require("../helpers/noop");
44
44
  const studio_fit_padding_1 = require("../helpers/studio-fit-padding");
45
45
  const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
46
46
  const canvas_ref_1 = require("../state/canvas-ref");
47
+ const composition_list_1 = require("../state/composition-list");
47
48
  const scale_lock_1 = require("../state/scale-lock");
48
49
  const timeline_zoom_1 = require("../state/timeline-zoom");
49
50
  const z_index_1 = require("../state/z-index");
@@ -62,6 +63,20 @@ const background = {
62
63
  flexDirection: 'column',
63
64
  position: 'absolute',
64
65
  };
66
+ const RootCompositionLoader = ({ Root }) => {
67
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
68
+ jsx_runtime_1.jsx(Root, {}), jsx_runtime_1.jsx(CompositionListRenderMarker, {})
69
+ ] }));
70
+ };
71
+ const CompositionListRenderMarker = () => {
72
+ (0, react_1.useLayoutEffect)(() => {
73
+ composition_list_1.compositionListRenderedRef.current = true;
74
+ return () => {
75
+ composition_list_1.compositionListRenderedRef.current = false;
76
+ };
77
+ }, []);
78
+ return null;
79
+ };
65
80
  const Editor = ({ Root, readOnlyStudio }) => {
66
81
  (0, client_id_1.useStudioConfigRevision)();
67
82
  const [drawElement, setDrawElement] = (0, react_1.useState)(null);
@@ -97,7 +112,7 @@ const Editor = ({ Root, readOnlyStudio }) => {
97
112
  return (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(timeline_zoom_1.TimelineZoomContext, { children: jsx_runtime_1.jsxs(SequencePropsSubscriptionProvider_1.SequencePropsSubscriptionProvider, { children: [
98
113
  jsx_runtime_1.jsxs(remotion_1.Internals.CurrentScaleContext.Provider, { value: value, children: [
99
114
  jsx_runtime_1.jsx(ForceSpecificCursor_1.ForceSpecificCursor, {}), jsx_runtime_1.jsx(scale_lock_1.ScaleLockProvider, { children: jsx_runtime_1.jsxs("div", { style: background, children: [
100
- jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsx(remotion_1.Internals.CanUseRemotionHooksProvider, { children: jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds: (0, studio_runtime_config_1.getStudioBufferStateDelayInMilliseconds)(), onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }) })
115
+ jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? (jsx_runtime_1.jsx(RootCompositionLoader, { Root: MemoRoot })) : null }), jsx_runtime_1.jsx(remotion_1.Internals.CanUseRemotionHooksProvider, { children: jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds: (0, studio_runtime_config_1.getStudioBufferStateDelayInMilliseconds)(), onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }) })
101
116
  ] }) })
102
117
  ] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
103
118
  ] }) }) }));
@@ -9,4 +9,5 @@ export declare const ElementInstallConfirmation: React.FC<{
9
9
  readonly dependenciesToReview: string[];
10
10
  readonly missingPackages: string[];
11
11
  readonly sourceCode: string;
12
+ readonly usesBrowserDependencyResolution: boolean;
12
13
  }>;
@@ -171,7 +171,7 @@ const makeSourceControlsVisible = (sourceCode) => {
171
171
  return `\\u${(_a = character.codePointAt(0)) === null || _a === void 0 ? void 0 : _a.toString(16).padStart(4, '0')}`;
172
172
  });
173
173
  };
174
- const ElementInstallConfirmation = ({ displayName, sourceLabel, sourceIsUnverified, compositionId, filePath, overwritesExistingFile, dependenciesToReview, missingPackages, sourceCode, }) => {
174
+ const ElementInstallConfirmation = ({ displayName, sourceLabel, sourceIsUnverified, compositionId, filePath, overwritesExistingFile, dependenciesToReview, missingPackages, sourceCode, usesBrowserDependencyResolution, }) => {
175
175
  return (jsx_runtime_1.jsxs("div", { style: container, children: [
176
176
  jsx_runtime_1.jsxs("dl", { style: metadataStyle, "aria-label": "Installation details", children: [
177
177
  jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
@@ -196,7 +196,9 @@ const ElementInstallConfirmation = ({ displayName, sourceLabel, sourceIsUnverifi
196
196
  ] }, packageName));
197
197
  }) })
198
198
  ] })) : null, jsx_runtime_1.jsxs("div", { style: warningStyle, children: [
199
- jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsx("p", { style: warningDescriptionStyle, children: "This adds executable source code to your project. Package lifecycle scripts may also run during installation, with access to your files and the network." })
199
+ jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: warningDescriptionStyle, children: ["This adds executable source code to your project.", usesBrowserDependencyResolution
200
+ ? null
201
+ : ' Package lifecycle scripts may also run during installation, with access to your files and the network.'] })
200
202
  ] }), jsx_runtime_1.jsxs("details", { style: sourceDetailsStyle, children: [
201
203
  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(sourceCode) }) })
202
204
  ] })
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ModalState } from '../state/modals';
3
+ type FixComputedValueModalState = Extract<ModalState, {
4
+ type: 'fix-computed-value';
5
+ }>;
6
+ export declare const FixComputedValueModal: React.FC<{
7
+ readonly state: FixComputedValueModalState;
8
+ }>;
9
+ export {};
@@ -0,0 +1,217 @@
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
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.FixComputedValueModal = void 0;
37
+ const jsx_runtime_1 = require("react/jsx-runtime");
38
+ const react_1 = __importStar(require("react"));
39
+ const colors_1 = require("../helpers/colors");
40
+ const copy_text_1 = require("../helpers/copy-text");
41
+ const open_in_editor_1 = require("../helpers/open-in-editor");
42
+ const caret_1 = require("../icons/caret");
43
+ const clipboard_1 = require("../icons/clipboard");
44
+ const z_index_1 = require("../state/z-index");
45
+ const CodingAgentIcon_1 = require("./CodingAgentIcon");
46
+ const InlineAction_1 = require("./InlineAction");
47
+ const InlineDropdown_1 = require("./InlineDropdown");
48
+ const ModalFooter_1 = require("./ModalFooter");
49
+ const ModalHeader_1 = require("./ModalHeader");
50
+ const DismissableModal_1 = require("./NewComposition/DismissableModal");
51
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
52
+ const SettingsContext_1 = require("./SettingsContext");
53
+ const panelStyle = {
54
+ borderRadius: 6,
55
+ overflow: 'hidden',
56
+ };
57
+ const container = {
58
+ padding: '12px 16px 18px',
59
+ };
60
+ const text = {
61
+ color: colors_1.LIGHT_TEXT,
62
+ fontFamily: 'sans-serif',
63
+ fontSize: 14,
64
+ lineHeight: 1.5,
65
+ };
66
+ const commandField = {
67
+ alignItems: 'center',
68
+ background: colors_1.SELECTED_BACKGROUND,
69
+ borderRadius: 6,
70
+ boxSizing: 'border-box',
71
+ display: 'flex',
72
+ marginTop: 10,
73
+ padding: '8px 8px 8px 10px',
74
+ width: '100%',
75
+ };
76
+ const code = {
77
+ color: colors_1.WHITE,
78
+ flex: 1,
79
+ fontFamily: 'monospace',
80
+ fontSize: 14,
81
+ lineHeight: 1.5,
82
+ margin: 0,
83
+ minWidth: 0,
84
+ overflowX: 'auto',
85
+ whiteSpace: 'pre-wrap',
86
+ };
87
+ const copyIcon = {
88
+ flexShrink: 0,
89
+ height: 12,
90
+ width: 12,
91
+ };
92
+ const footer = {
93
+ display: 'flex',
94
+ flex: 'none',
95
+ justifyContent: 'flex-end',
96
+ };
97
+ const splitButton = {
98
+ alignItems: 'center',
99
+ borderRadius: 4,
100
+ display: 'inline-flex',
101
+ flexDirection: 'row',
102
+ gap: 1,
103
+ height: 24,
104
+ overflow: 'hidden',
105
+ };
106
+ const mainButtonBase = {
107
+ alignItems: 'center',
108
+ background: colors_1.TRANSPARENT,
109
+ border: 'none',
110
+ borderRadius: '4px 0 0 4px',
111
+ color: colors_1.LIGHT_TEXT,
112
+ display: 'inline-flex',
113
+ fontFamily: 'sans-serif',
114
+ fontSize: 12,
115
+ gap: 6,
116
+ height: 24,
117
+ padding: '0 9px',
118
+ whiteSpace: 'nowrap',
119
+ };
120
+ const singleButton = {
121
+ borderRadius: 4,
122
+ };
123
+ const dropdownButton = {
124
+ borderRadius: '0 4px 4px 0',
125
+ height: 24,
126
+ width: 24,
127
+ };
128
+ const menuLabel = {
129
+ color: 'inherit',
130
+ fontFamily: 'sans-serif',
131
+ fontSize: 13,
132
+ lineHeight: '16px',
133
+ };
134
+ const FixComputedValueModal = ({ state }) => {
135
+ var _a, _b;
136
+ const { codingAgentInfo } = (0, SettingsContext_1.useSettings)();
137
+ const { tabIndex } = (0, z_index_1.useZIndex)();
138
+ const [hovered, setHovered] = react_1.default.useState(false);
139
+ const prompt = `/remotion-interactivity ${state.context} make "${state.prop}" interactive`;
140
+ const installCommand = 'npx remotion skills add';
141
+ const installedCodingAgents = (_a = codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.installedCodingAgents) !== null && _a !== void 0 ? _a : [];
142
+ const defaultCodingAgent = (_b = installedCodingAgents.find((agent) => agent.id === (codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.defaultCodingAgent))) !== null && _b !== void 0 ? _b : installedCodingAgents[0];
143
+ const alternativeCodingAgents = installedCodingAgents.filter((agent) => agent.id !== (defaultCodingAgent === null || defaultCodingAgent === void 0 ? void 0 : defaultCodingAgent.id));
144
+ const onCopyPrompt = (0, react_1.useCallback)(() => {
145
+ (0, copy_text_1.copyText)(prompt).catch((err) => {
146
+ (0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
147
+ });
148
+ }, [prompt]);
149
+ const onCopyInstallCommand = (0, react_1.useCallback)(() => {
150
+ (0, copy_text_1.copyText)(installCommand).catch((err) => {
151
+ (0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
152
+ });
153
+ }, [installCommand]);
154
+ const renderCopyAction = (0, react_1.useCallback)((color) => {
155
+ return jsx_runtime_1.jsx(clipboard_1.ClipboardIcon, { color: color, style: copyIcon });
156
+ }, []);
157
+ const openWithCodingAgent = (0, react_1.useCallback)(async (codingAgentId, codingAgentName) => {
158
+ try {
159
+ const response = await (0, open_in_editor_1.openInCodingAgent)(codingAgentId, codingAgentId === 'copilot' ? null : prompt);
160
+ if (!response.success) {
161
+ (0, NotificationCenter_1.showNotification)(`Could not open ${codingAgentName}`, 2000);
162
+ }
163
+ }
164
+ catch (err) {
165
+ (0, NotificationCenter_1.showNotification)(err.message, 2000);
166
+ }
167
+ }, [prompt]);
168
+ const agentMenuItems = react_1.default.useMemo(() => {
169
+ return alternativeCodingAgents.map((codingAgent) => ({
170
+ id: `fix-computed-value-in-${codingAgent.id}`,
171
+ keyHint: null,
172
+ label: jsx_runtime_1.jsx("span", { style: menuLabel, children: codingAgent.name }),
173
+ leftItem: jsx_runtime_1.jsx(CodingAgentIcon_1.CodingAgentIcon, { codingAgentId: codingAgent.id, size: 18 }),
174
+ onClick: () => {
175
+ openWithCodingAgent(codingAgent.id, codingAgent.nameWithType).catch(() => undefined);
176
+ },
177
+ quickSwitcherLabel: null,
178
+ subMenu: null,
179
+ type: 'item',
180
+ value: `coding-agent-${codingAgent.id}`,
181
+ }));
182
+ }, [alternativeCodingAgents, openWithCodingAgent]);
183
+ const renderDropdownAction = (0, react_1.useCallback)((color) => {
184
+ return jsx_runtime_1.jsx(caret_1.CaretDown, { color: color, small: true });
185
+ }, []);
186
+ const mainButtonStyle = react_1.default.useMemo(() => {
187
+ return {
188
+ ...mainButtonBase,
189
+ ...(alternativeCodingAgents.length === 0 ? singleButton : null),
190
+ background: (0, colors_1.getBackgroundFromHoverState)({
191
+ hovered,
192
+ selected: false,
193
+ }),
194
+ color: hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
195
+ };
196
+ }, [alternativeCodingAgents.length, hovered]);
197
+ return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
198
+ jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Fix computed value" }), jsx_runtime_1.jsxs("div", { style: container, children: [state.remotionInteractivitySkillAvailable ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
199
+ jsx_runtime_1.jsx("div", { style: text, children: "First, install the Remotion Agent Skills:" }), jsx_runtime_1.jsxs("div", { style: commandField, children: [
200
+ jsx_runtime_1.jsx("pre", { style: code, children: installCommand }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: onCopyInstallCommand, renderAction: renderCopyAction, title: "Copy command" })
201
+ ] })
202
+ ] })), jsx_runtime_1.jsx("div", { style: {
203
+ ...text,
204
+ marginTop: state.remotionInteractivitySkillAvailable ? 0 : 16,
205
+ }, children: state.remotionInteractivitySkillAvailable
206
+ ? 'Paste this prompt into your coding agent to make this value editable in Studio:'
207
+ : 'Then, paste this prompt into your coding agent:' }), jsx_runtime_1.jsxs("div", { style: commandField, children: [
208
+ jsx_runtime_1.jsx("pre", { style: code, children: prompt }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: onCopyPrompt, renderAction: renderCopyAction, title: "Copy prompt" })
209
+ ] })
210
+ ] }), defaultCodingAgent ? (jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footer, children: jsx_runtime_1.jsxs("div", { style: splitButton, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [
211
+ jsx_runtime_1.jsxs("button", { "aria-label": `Open in ${defaultCodingAgent.nameWithType}`, onClick: () => {
212
+ openWithCodingAgent(defaultCodingAgent.id, defaultCodingAgent.nameWithType).catch(() => undefined);
213
+ }, style: mainButtonStyle, tabIndex: tabIndex, title: `Open in ${defaultCodingAgent.nameWithType}`, type: "button", children: [
214
+ jsx_runtime_1.jsx(CodingAgentIcon_1.CodingAgentIcon, { codingAgentId: defaultCodingAgent.id, size: 18 }),
215
+ "Open in ", defaultCodingAgent.name] }), alternativeCodingAgents.length > 0 ? (jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { renderAction: renderDropdownAction, style: dropdownButton, title: "Open in another coding agent", values: agentMenuItems, variant: null })) : null] }) })) : null] }));
216
+ };
217
+ exports.FixComputedValueModal = FixComputedValueModal;
@@ -6,6 +6,7 @@ const remotion_1 = require("remotion");
6
6
  const create_folder_tree_1 = require("../helpers/create-folder-tree");
7
7
  const persist_open_folders_1 = require("../helpers/persist-open-folders");
8
8
  const url_state_1 = require("../helpers/url-state");
9
+ const composition_list_1 = require("../state/composition-list");
9
10
  const folders_1 = require("../state/folders");
10
11
  const ExplorerPanelRef_1 = require("./ExplorerPanelRef");
11
12
  const load_canvas_content_from_url_1 = require("./load-canvas-content-from-url");
@@ -45,11 +46,16 @@ exports.useSelectComposition = useSelectComposition;
45
46
  const InitialCompositionLoader = () => {
46
47
  const { compositions, canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
47
48
  const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
49
+ const { setCompositionListState } = (0, react_1.useContext)(composition_list_1.CompositionListContext);
48
50
  const selectComposition = (0, exports.useSelectComposition)();
49
51
  const selectAsset = (0, use_select_asset_1.useSelectAsset)();
50
52
  const staticFiles = (0, use_static_files_1.useStaticFiles)();
51
53
  (0, react_1.useEffect)(() => {
54
+ var _a;
52
55
  const canvasContentFromUrl = (0, load_canvas_content_from_url_1.deriveCanvasContentFromUrl)();
56
+ const seenCompositionIds = (_a = window.remotion_seenCompositionIds) !== null && _a !== void 0 ? _a : [];
57
+ const compositionListIsReady = composition_list_1.compositionListRenderedRef.current &&
58
+ seenCompositionIds.every((id) => compositions.some((composition) => composition.id === id));
53
59
  if (canvasContent) {
54
60
  // If the URL points to a different composition than the one currently
55
61
  // displayed, switch to it. This handles the case where the URL is
@@ -63,13 +69,19 @@ const InitialCompositionLoader = () => {
63
69
  selectComposition(exists, false);
64
70
  }
65
71
  }
72
+ setCompositionListState('ready');
66
73
  return;
67
74
  }
68
75
  if (canvasContentFromUrl && canvasContentFromUrl.type === 'composition') {
76
+ if (!compositionListIsReady) {
77
+ return;
78
+ }
69
79
  const exists = compositions.find((c) => c.id === canvasContentFromUrl.compositionId);
70
80
  if (exists) {
71
81
  selectComposition(exists, false);
82
+ return;
72
83
  }
84
+ setCompositionListState('ready');
73
85
  return;
74
86
  }
75
87
  if (canvasContentFromUrl && canvasContentFromUrl.type === 'asset') {
@@ -80,14 +92,21 @@ const InitialCompositionLoader = () => {
80
92
  setCanvasContent(canvasContentFromUrl);
81
93
  return;
82
94
  }
95
+ if (!compositionListIsReady) {
96
+ return;
97
+ }
83
98
  if (compositions.length > 0) {
84
99
  selectComposition(compositions[0], true);
85
100
  }
101
+ else {
102
+ setCompositionListState('ready');
103
+ }
86
104
  }, [
87
105
  compositions,
88
106
  canvasContent,
89
107
  selectComposition,
90
108
  setCanvasContent,
109
+ setCompositionListState,
91
110
  selectAsset,
92
111
  ]);
93
112
  (0, react_1.useEffect)(() => {
@@ -31,11 +31,11 @@ const InlineDropdown = ({ values, getItems, onOpenChange, unhoveredColor, ...pro
31
31
  });
32
32
  const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
33
33
  const onClick = (0, react_1.useCallback)((e) => {
34
- var _a;
34
+ var _a, _b;
35
35
  e.preventDefault();
36
36
  e.stopPropagation();
37
- const invocationValues = (_a = getItems === null || getItems === void 0 ? void 0 : getItems()) !== null && _a !== void 0 ? _a : null;
38
- if ((invocationValues === null || invocationValues === void 0 ? void 0 : invocationValues.length) === 0) {
37
+ const invocationValues = (_b = (_a = getItems === null || getItems === void 0 ? void 0 : getItems()) !== null && _a !== void 0 ? _a : values) !== null && _b !== void 0 ? _b : [];
38
+ if (invocationValues.length === 0) {
39
39
  return;
40
40
  }
41
41
  setOpened({
@@ -45,7 +45,7 @@ const InlineDropdown = ({ values, getItems, onOpenChange, unhoveredColor, ...pro
45
45
  values: invocationValues,
46
46
  });
47
47
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(true);
48
- }, [getItems, onOpenChange]);
48
+ }, [getItems, onOpenChange, values]);
49
49
  const spaceToBottom = (0, react_1.useMemo)(() => {
50
50
  if (size && opened.type === 'open') {
51
51
  return size.windowSize.height - opened.top;
@@ -49,10 +49,10 @@ const inspectorSubtitle = {
49
49
  boxSizing: 'border-box',
50
50
  fontFamily: 'sans-serif',
51
51
  fontSize: 13,
52
- height: 28,
53
- lineHeight: '18px',
52
+ height: 20,
53
+ lineHeight: '20px',
54
54
  margin: '0 4px',
55
- padding: '5px 8px',
55
+ padding: '0 8px',
56
56
  width: 'calc(100% - 8px)',
57
57
  };
58
58
  const InspectorInfoHeader = ({ children, contentSized = false, minHeight, padding }) => {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InspectorOpenInEditor = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
6
7
  const client_id_1 = require("../helpers/client-id");
7
8
  const colors_1 = require("../helpers/colors");
8
9
  const open_in_editor_1 = require("../helpers/open-in-editor");
@@ -186,7 +187,8 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
186
187
  openWithEditor,
187
188
  setSelectedModal,
188
189
  ]);
189
- if (previewServerState.type !== 'connected') {
190
+ if (previewServerState.type !== 'connected' ||
191
+ (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null) {
190
192
  return null;
191
193
  }
192
194
  return (jsx_runtime_1.jsxs("div", { style: splitButton, onPointerEnter: () => {
@@ -3,9 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompositionInspector = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
6
7
  const client_id_1 = require("../../helpers/client-id");
8
+ const colors_1 = require("../../helpers/colors");
9
+ const download_blob_1 = require("../../helpers/download-blob");
7
10
  const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
8
11
  const browse_elements_1 = require("../../icons/browse-elements");
12
+ const cloud_download_1 = require("../../icons/cloud-download");
9
13
  const frame_1 = require("../../icons/frame");
10
14
  const solid_1 = require("../../icons/solid");
11
15
  const video_1 = require("../../icons/video");
@@ -13,6 +17,7 @@ const VisualControls_1 = require("../../visual-controls/VisualControls");
13
17
  const DefaultPropsEditor_1 = require("../DefaultPropsEditor");
14
18
  const get_zod_if_possible_1 = require("../get-zod-if-possible");
15
19
  const is_menu_item_1 = require("../Menu/is-menu-item");
20
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
16
21
  const ObserveDefaultPropsContext_1 = require("../ObserveDefaultPropsContext");
17
22
  const DataEditor_1 = require("../RenderModal/DataEditor");
18
23
  const zod_schema_type_1 = require("../RenderModal/SchemaEditor/zod-schema-type");
@@ -38,16 +43,43 @@ const browseElementsIconContainerStyle = {
38
43
  marginRight: -2,
39
44
  width: 22,
40
45
  };
41
- const CompositionActions = ({ readOnlyStudio }) => {
46
+ const browseElementsArrowStyle = {
47
+ display: 'inline-block',
48
+ height: 12,
49
+ marginLeft: 4,
50
+ verticalAlign: -2,
51
+ width: 12,
52
+ };
53
+ const CompositionActions = () => {
54
+ var _a;
55
+ var _b;
42
56
  const { canInsertAsset, canInsertComposition, canInsertSolid, canShowInsertAsset, canShowInsertComposition, canShowInsertSolid, insertAsset, insertComposition, insertSolid, } = (0, use_composition_actions_1.useCompositionActions)();
57
+ const downloadProject = (_b = (_a = (0, browser_studio_operations_1.getBrowserStudioOperations)()) === null || _a === void 0 ? void 0 : _a.downloadProject) !== null && _b !== void 0 ? _b : null;
58
+ const onDownloadProject = (0, react_1.useCallback)(async () => {
59
+ if (downloadProject === null) {
60
+ return;
61
+ }
62
+ try {
63
+ const { data, fileName } = await downloadProject();
64
+ const arrayBuffer = data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
65
+ (0, download_blob_1.downloadBlob)(new Blob([arrayBuffer], { type: 'application/zip' }), fileName);
66
+ }
67
+ catch (error) {
68
+ (0, NotificationCenter_1.showNotification)(`Could not download project: ${error instanceof Error ? error.message : String(error)}`, 2000);
69
+ }
70
+ }, [downloadProject]);
43
71
  const openElementsLibrary = (0, react_1.useCallback)(() => {
44
72
  window.open('https://www.remotion.dev/elements', '_blank', 'noopener,noreferrer');
45
73
  }, []);
46
- if ((readOnlyStudio && !canShowInsertSolid) ||
47
- (!canShowInsertAsset && !canShowInsertComposition && !canShowInsertSolid)) {
74
+ if (!canShowInsertAsset &&
75
+ !canShowInsertComposition &&
76
+ !canShowInsertSolid &&
77
+ downloadProject === null) {
48
78
  return null;
49
79
  }
50
- return (jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, iconContainerStyle: browseElementsIconContainerStyle, onClick: openElementsLibrary, renderIcon: (color) => (jsx_runtime_1.jsx(browse_elements_1.BrowseElementsIcon, { color: color, style: browseElementsIconStyle })), title: "Open the Remotion Elements library in a new tab. Install an Element there to send it to this composition.", children: "Browse Elements..." })) : null] }));
80
+ return (jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [canShowInsertSolid ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canInsertSolid, onClick: insertSolid, renderIcon: (color) => (jsx_runtime_1.jsx(solid_1.SolidIcon, { color: color, style: actionIconStyle })), children: "Add Solid" })) : null, canShowInsertAsset ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canInsertAsset, onClick: insertAsset, renderIcon: (color) => (jsx_runtime_1.jsx(frame_1.PicIcon, { color: color, style: actionIconStyle })), children: "Add asset..." })) : null, canShowInsertComposition ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canInsertComposition, onClick: insertComposition, renderIcon: (color) => (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: actionIconStyle })), children: "Add composition..." })) : null, canShowInsertAsset ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: false, iconContainerStyle: browseElementsIconContainerStyle, onClick: openElementsLibrary, renderIcon: (color) => (jsx_runtime_1.jsx(browse_elements_1.BrowseElementsIcon, { color: color, style: browseElementsIconStyle })), title: "Open the Remotion Elements library in a new tab. Install an Element there to send it to this composition.", children: ["Browse Elements",
81
+ jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: browseElementsArrowStyle, children: jsx_runtime_1.jsx("path", { d: "M4 12 12 4M6 4h6v6", fill: "none", stroke: colors_1.CURRENT_COLOR, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) })
82
+ ] })) : null, downloadProject ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, onClick: onDownloadProject, renderIcon: (color) => (jsx_runtime_1.jsx(cloud_download_1.CloudDownloadIcon, { color: color, style: actionIconStyle })), children: "Download project" })) : null] }));
51
83
  };
52
84
  const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
53
85
  var _a;
@@ -128,7 +160,7 @@ const CompositionInspector = ({ composition, currentDefaultProps, readOnlyStudio
128
160
  return (jsx_runtime_1.jsxs("div", { style: styles_1.scrollableContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
129
161
  jsx_runtime_1.jsxs("div", { style: styles_1.inspectorOverviewSection, children: [
130
162
  jsx_runtime_1.jsx(CompositionInspectorHeader_1.CompositionInspectorHeader, {}), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(CompositionMetadata_1.CompositionMetadata, { compositionId: composition.id, disabled: readOnlyStudio || previewServerState.type !== 'connected', stack: composition.stack })
131
- ] }), jsx_runtime_1.jsx(CompositionDefaultPropsSection, { composition: composition, currentDefaultProps: currentDefaultProps, readOnlyStudio: readOnlyStudio, setDefaultProps: setDefaultProps }), jsx_runtime_1.jsx(CompositionVisualControlsSection, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CompositionActions, { readOnlyStudio: readOnlyStudio })
163
+ ] }), jsx_runtime_1.jsx(CompositionDefaultPropsSection, { composition: composition, currentDefaultProps: currentDefaultProps, readOnlyStudio: readOnlyStudio, setDefaultProps: setDefaultProps }), jsx_runtime_1.jsx(CompositionVisualControlsSection, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CompositionActions, {})
132
164
  ] }));
133
165
  };
134
166
  exports.CompositionInspector = CompositionInspector;
@@ -95,8 +95,8 @@ const CompositionInspectorHeader = () => {
95
95
  return (0, is_composition_still_1.isCompositionStill)(video) ? (jsx_runtime_1.jsx(still_1.StillIcon, { color: color, style: sourceLocationIconStyle })) : (jsx_runtime_1.jsx(video_1.FilmIcon, { color: color, style: sourceLocationIconStyle }));
96
96
  }, [video]);
97
97
  return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { minHeight: COMPOSITION_INSPECTOR_HEADER_HEIGHT, padding: "4px 0", children: video ? (jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: validatedLocation, name: video.id, openInEditorLocation: componentLocation, children: [
98
- jsx_runtime_1.jsx(InlineCompositionName_1.InlineCompositionName, { compositionId: video.id, stack: (_e = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _e !== void 0 ? _e : null, compositions: compositions }, video.id), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: validatedLocation !== null && canOpenInEditor, onOpen: openFileLocation, renderIcon: renderCompositionIcon, size: "inline-action" }), compositionComponentInfo === null &&
98
+ jsx_runtime_1.jsx(InlineCompositionName_1.InlineCompositionName, { compositionId: video.id, stack: (_e = currentComposition === null || currentComposition === void 0 ? void 0 : currentComposition.stack) !== null && _e !== void 0 ? _e : null, compositions: compositions }, video.id), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: validatedLocation, canOpen: validatedLocation !== null && canOpenInEditor, onOpen: openFileLocation, renderIcon: renderCompositionIcon, size: "quick-action" }), compositionComponentInfo === null &&
99
99
  compositionFile !== null &&
100
- compositionId !== null ? (jsx_runtime_1.jsx("div", { "aria-hidden": true, style: componentLocationPlaceholder })) : (jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: componentLocation, canOpen: componentLocation !== null && canOpenInEditor, onOpen: openComponentLocation, renderIcon: renderReactIcon, size: "inline-action" }))] })) : null }));
100
+ compositionId !== null ? (jsx_runtime_1.jsx("div", { "aria-hidden": true, style: componentLocationPlaceholder })) : (jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: componentLocation, canOpen: componentLocation !== null && canOpenInEditor, onOpen: openComponentLocation, renderIcon: renderReactIcon, size: "quick-action" }))] })) : null }));
101
101
  };
102
102
  exports.CompositionInspectorHeader = CompositionInspectorHeader;
@@ -64,5 +64,5 @@ const ConnectedCompositionRow = ({ composition }) => {
64
64
  resolvedLocation,
65
65
  setSelectedModal,
66
66
  ]);
67
- return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, style: compositionContextMenuStyle, children: jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => selectComposition(composition, true), renderIcon: (color) => (jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: color, composition: composition, style: compositionIconStyle })), children: composition.id }) }));
67
+ return (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { getItems: getContextMenuItems, style: compositionContextMenuStyle, children: jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, onClick: () => selectComposition(composition, true), renderIcon: (color) => (jsx_runtime_1.jsx(CompositionOrStillIcon_1.CompositionOrStillIcon, { color: color, composition: composition, style: compositionIconStyle })), children: composition.id }) }));
68
68
  };
@@ -226,6 +226,6 @@ const EasingInspector = ({ selection }) => {
226
226
  return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Easing unavailable" });
227
227
  }
228
228
  return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
229
- jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorSections, { track: track }), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(KeyframeSettings_1.KeyframeSettings, { update: easingUpdate }), canAddKeyframeAtPlayhead ? (jsx_runtime_1.jsx(common_1.InspectorActionSection, { children: jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: addKeyframeDisabled, onClick: onAddKeyframeAtPlayhead, renderIcon: (color) => (jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: addKeyframeIcon })), children: `Add keyframe at ${addKeyframeTime}` }) })) : null] }));
229
+ jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorSections, { track: track }), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(KeyframeSettings_1.KeyframeSettings, { update: easingUpdate }), canAddKeyframeAtPlayhead ? (jsx_runtime_1.jsx(common_1.InspectorQuickActionsSection, { children: jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: addKeyframeDisabled, onClick: onAddKeyframeAtPlayhead, renderIcon: (color) => (jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: addKeyframeIcon })), children: `Add keyframe at ${addKeyframeTime}` }) })) : null] }));
230
230
  };
231
231
  exports.EasingInspector = EasingInspector;
@@ -343,8 +343,8 @@ const KeyframeInspector = ({ selection }) => {
343
343
  frame: keyframe.frame + details.keyframeDisplayOffset,
344
344
  })), nodePathInfo: selection.nodePathInfo }), jsx_runtime_1.jsxs("div", { style: styles_1.detailsWithInlineAction, children: [
345
345
  jsx_runtime_1.jsxs("div", { style: styles_1.detailsBeforeInlineAction, children: [
346
- jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Frame", children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: draftFrame, status: "ok", onValueChange: onFrameChange, onValueChangeEnd: onFrameChangeEnd, onTextChange: () => undefined, min: 0, max: Math.max(0, videoConfig.durationInFrames - 1), step: 1, formatter: (value) => String(Math.round(Number(value))), rightAlign: true, small: true }) }), jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorRow, children: jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: details.fieldLabel, children: jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorValue, children: details.type === 'sequence' ? (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequenceKeyframedValue, { field: details.field, fileName: details.fileName, nodePath: details.nodePath, schema: details.schema, propStatus: details.propStatus, sourceFrame: details.sourceFrame })) : (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropValue, { field: details.field, nodePath: details.nodePath, validatedLocation: details.validatedLocation, sourceFrame: details.sourceFrame })) }) }) })
347
- ] }), jsx_runtime_1.jsx(common_1.InspectorActionSection, { children: jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: removeDisabled, onClick: onRemoveKeyframe, renderIcon: (color) => jsx_runtime_1.jsx(TrashIcon, { color: color }), children: "Remove keyframe" }) })
346
+ jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Frame", children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: draftFrame, status: "ok", onValueChange: onFrameChange, onValueChangeEnd: onFrameChangeEnd, onTextChange: () => undefined, min: 0, max: Math.max(0, videoConfig.durationInFrames - 1), step: 1, formatter: (value) => String(Math.round(Number(value))), rightAlign: true, small: true }) }), jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorRow, children: jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: details.fieldLabel, children: jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorValue, children: details.type === 'sequence' ? (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequenceKeyframedValue, { field: details.field, fileName: details.fileName, nodePath: details.nodePath, schema: details.schema, propStatus: details.propStatus, sourceFrame: details.sourceFrame })) : (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropValue, { field: details.field, nodePath: details.nodePath, validatedLocation: details.validatedLocation, sourceFrame: details.sourceFrame, runtimeValueStore: null })) }) }) })
347
+ ] }), jsx_runtime_1.jsx(common_1.InspectorQuickActionsSection, { children: jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: removeDisabled, onClick: onRemoveKeyframe, renderIcon: (color) => jsx_runtime_1.jsx(TrashIcon, { color: color }), children: "Remove keyframe" }) })
348
348
  ] })
349
349
  ] }));
350
350
  };
@@ -95,7 +95,7 @@ const SequenceInspectorHeader = ({ sourceLocation, track }) => {
95
95
  saveName(newName).catch(() => undefined);
96
96
  }, [saveName]);
97
97
  return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: true, padding: "4px 0", children: jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: sourceLocation.validatedLocation, name: componentName !== null && componentName !== void 0 ? componentName : null, openInEditorLocation: sourceLocation.validatedLocation, children: [
98
- jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename, size: "inspector" }), documentationLink ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, style: defaultCursor, size: "compact", title: "Open component docs", onClick: openDocumentationLink, children: componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation, renderIcon: renderReactIcon, size: "inline-action" })
98
+ jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename, size: "inspector" }), documentationLink ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, style: defaultCursor, size: "compact", title: "Open component docs", onClick: openDocumentationLink, children: componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation, renderIcon: renderReactIcon, size: "quick-action" })
99
99
  ] }) }));
100
100
  };
101
101
  exports.SequenceInspectorHeader = SequenceInspectorHeader;