@remotion/studio 4.0.513 → 4.0.514

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 (174) hide show
  1. package/dist/Studio.js +2 -1
  2. package/dist/components/AskAiModal.js +1 -1
  3. package/dist/components/AssetSelector.js +2 -0
  4. package/dist/components/AssetSelectorItem.js +1 -2
  5. package/dist/components/AudioWaveform.d.ts +3 -0
  6. package/dist/components/AudioWaveform.js +55 -67
  7. package/dist/components/Canvas.js +40 -5
  8. package/dist/components/CanvasOrLoading.js +5 -0
  9. package/dist/components/CompositionSelector.js +2 -0
  10. package/dist/components/ConfigureDefaultEditorModal.js +17 -11
  11. package/dist/components/Editor.js +16 -1
  12. package/dist/components/ElementInstallConfirmation.d.ts +1 -0
  13. package/dist/components/ElementInstallConfirmation.js +4 -2
  14. package/dist/components/FixComputedValueModal.d.ts +9 -0
  15. package/dist/components/FixComputedValueModal.js +217 -0
  16. package/dist/components/InitialCompositionLoader.js +19 -0
  17. package/dist/components/InlineDropdown.js +4 -4
  18. package/dist/components/InspectorInfoHeader.js +3 -3
  19. package/dist/components/InspectorOpenInEditor.js +3 -1
  20. package/dist/components/InspectorPanel/CompositionInspector.js +11 -1
  21. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +2 -2
  22. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +1 -1
  23. package/dist/components/InspectorPanel/EasingInspector.js +1 -1
  24. package/dist/components/InspectorPanel/KeyframeInspector.js +2 -2
  25. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +1 -1
  26. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +35 -6
  27. package/dist/components/InspectorPanel/common.d.ts +5 -5
  28. package/dist/components/InspectorPanel/common.js +8 -8
  29. package/dist/components/InspectorPanel/styles.d.ts +1 -1
  30. package/dist/components/InspectorPanel/styles.js +4 -2
  31. package/dist/components/InspectorSourceLocation.d.ts +1 -1
  32. package/dist/components/InspectorSourceLocation.js +2 -2
  33. package/dist/components/LicenseKeyValidation.js +2 -2
  34. package/dist/components/Modals.js +2 -1
  35. package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
  36. package/dist/components/NewComposition/CodemodFooter.js +10 -8
  37. package/dist/components/NewComposition/DeleteComposition.js +1 -1
  38. package/dist/components/NewComposition/DeleteFolder.js +1 -1
  39. package/dist/components/NewComposition/DuplicateComposition.js +7 -2
  40. package/dist/components/NewComposition/NewComposition.js +1 -1
  41. package/dist/components/NewComposition/NewFolder.js +1 -1
  42. package/dist/components/NewComposition/RenameComposition.js +1 -1
  43. package/dist/components/NewComposition/RenameFolder.js +1 -1
  44. package/dist/components/NewComposition/duplicate-composition-api.d.ts +16 -0
  45. package/dist/components/NewComposition/duplicate-composition-api.js +16 -0
  46. package/dist/components/NoRegisterRoot.js +1 -1
  47. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +4 -3
  48. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
  49. package/dist/components/QuickSwitcher/fuzzy-search.js +1 -1
  50. package/dist/components/RefreshCompositionOverlay.js +1 -1
  51. package/dist/components/RenderButton.js +6 -3
  52. package/dist/components/RenderModal/WebRenderModal.js +6 -2
  53. package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +2 -0
  54. package/dist/components/RenderModal/WebRenderModalAdvanced.js +9 -2
  55. package/dist/components/RenderModal/render-modals.js +5 -1
  56. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +5 -1
  57. package/dist/components/RenderQueue/actions.js +12 -2
  58. package/dist/components/RenderQueue/client-side-render-types.d.ts +1 -0
  59. package/dist/components/RenderingSettings.d.ts +2 -0
  60. package/dist/components/RenderingSettings.js +355 -0
  61. package/dist/components/SelectedOutlineElement.js +3 -3
  62. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  63. package/dist/components/SelectedOutlinePolygon.js +53 -9
  64. package/dist/components/SettingsContext.d.ts +4 -1
  65. package/dist/components/SettingsContext.js +9 -2
  66. package/dist/components/SettingsModal.d.ts +1 -1
  67. package/dist/components/SettingsModal.js +10 -1
  68. package/dist/components/SettingsModalFooter.js +1 -1
  69. package/dist/components/StudioSettings.d.ts +2 -0
  70. package/dist/components/StudioSettings.js +185 -0
  71. package/dist/components/Timeline/LoopedIndicator.js +1 -1
  72. package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +3 -0
  73. package/dist/components/Timeline/LoopedTimelineIndicators.js +22 -14
  74. package/dist/components/Timeline/Timeline.js +11 -9
  75. package/dist/components/Timeline/TimelineAssetField.d.ts +2 -2
  76. package/dist/components/Timeline/TimelineAssetField.js +1 -1
  77. package/dist/components/Timeline/TimelineDragHandler.js +62 -76
  78. package/dist/components/Timeline/TimelineEffectItem.js +1 -1
  79. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +4 -2
  80. package/dist/components/Timeline/TimelineEffectPropItem.js +16 -11
  81. package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -1
  82. package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
  83. package/dist/components/Timeline/TimelineExpandedSection.js +1 -1
  84. package/dist/components/Timeline/TimelineHeightContainer.d.ts +0 -4
  85. package/dist/components/Timeline/TimelineHeightContainer.js +4 -4
  86. package/dist/components/Timeline/TimelineImageInfo.d.ts +1 -0
  87. package/dist/components/Timeline/TimelineImageInfo.js +3 -2
  88. package/dist/components/Timeline/TimelineKeyframeControls.js +6 -1
  89. package/dist/components/Timeline/TimelineList.d.ts +1 -5
  90. package/dist/components/Timeline/TimelineList.js +14 -9
  91. package/dist/components/Timeline/TimelinePinchZoom.js +5 -5
  92. package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -2
  93. package/dist/components/Timeline/TimelineRowChrome.js +12 -5
  94. package/dist/components/Timeline/TimelineSchemaField.d.ts +7 -3
  95. package/dist/components/Timeline/TimelineSchemaField.js +71 -13
  96. package/dist/components/Timeline/TimelineScrollable.js +3 -1
  97. package/dist/components/Timeline/TimelineSelection.d.ts +5 -2
  98. package/dist/components/Timeline/TimelineSelection.js +90 -103
  99. package/dist/components/Timeline/TimelineSequence.js +59 -25
  100. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -1
  101. package/dist/components/Timeline/TimelineSequenceItem.js +15 -9
  102. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +2 -1
  103. package/dist/components/Timeline/TimelineSequencePropItem.js +3 -3
  104. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +33 -10
  105. package/dist/components/Timeline/TimelineSlider.js +42 -33
  106. package/dist/components/Timeline/TimelineTimeIndicators.js +90 -98
  107. package/dist/components/Timeline/TimelineTracks.d.ts +0 -2
  108. package/dist/components/Timeline/TimelineTracks.js +11 -4
  109. package/dist/components/Timeline/TimelineTransformOriginField.js +1 -1
  110. package/dist/components/Timeline/TimelineVideoInfo.d.ts +4 -4
  111. package/dist/components/Timeline/TimelineVideoInfo.js +151 -61
  112. package/dist/components/Timeline/TimelineViewport.d.ts +12 -0
  113. package/dist/components/Timeline/TimelineViewport.js +62 -0
  114. package/dist/components/Timeline/TimelineVirtualization.d.ts +22 -0
  115. package/dist/components/Timeline/TimelineVirtualization.js +144 -0
  116. package/dist/components/Timeline/TimelineZoomControls.js +16 -8
  117. package/dist/components/Timeline/call-add-keyframe.js +31 -3
  118. package/dist/components/Timeline/call-delete-keyframe.js +13 -3
  119. package/dist/components/Timeline/call-move-keyframe.js +11 -1
  120. package/dist/components/Timeline/call-update-keyframe-settings.js +31 -3
  121. package/dist/components/Timeline/delete-selected-timeline-item.js +2 -1
  122. package/dist/components/Timeline/get-timeline-keyframes.d.ts +1 -2
  123. package/dist/components/Timeline/get-timeline-keyframes.js +1 -8
  124. package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +30 -0
  125. package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +61 -0
  126. package/dist/components/Timeline/split-selected-timeline-item.js +2 -2
  127. package/dist/components/Timeline/timeline-scroll-logic.d.ts +24 -0
  128. package/dist/components/Timeline/timeline-scroll-logic.js +127 -4
  129. package/dist/components/Timeline/use-timeline-height.d.ts +3 -5
  130. package/dist/components/Timeline/use-timeline-height.js +16 -18
  131. package/dist/components/UpdateCheck.d.ts +2 -10
  132. package/dist/components/UpdateCheck.js +8 -2
  133. package/dist/components/VisualControls/VisualControlHandle.js +8 -0
  134. package/dist/components/delete-jsx-node-api.d.ts +2 -0
  135. package/dist/components/delete-jsx-node-api.js +12 -0
  136. package/dist/components/element-install-api.d.ts +3 -0
  137. package/dist/components/element-install-api.js +19 -0
  138. package/dist/components/import-assets.js +20 -9
  139. package/dist/components/reorder-sequence-api.d.ts +2 -0
  140. package/dist/components/reorder-sequence-api.js +12 -0
  141. package/dist/components/split-jsx-sequence-api.d.ts +2 -0
  142. package/dist/components/split-jsx-sequence-api.js +12 -0
  143. package/dist/components/split-video-from-audio-api.d.ts +2 -0
  144. package/dist/components/split-video-from-audio-api.js +12 -0
  145. package/dist/error-overlay/remotion-overlay/Overlay.js +1 -1
  146. package/dist/esm/{chunk-tv7r0jy3.js → chunk-xn2q7eem.js} +11073 -7495
  147. package/dist/esm/index.mjs +7 -5
  148. package/dist/esm/internals.mjs +11073 -7495
  149. package/dist/esm/previewEntry.mjs +10905 -7327
  150. package/dist/esm/renderEntry.mjs +2 -3
  151. package/dist/helpers/browser-studio-operations.d.ts +2 -0
  152. package/dist/helpers/browser-studio-operations.js +10 -1
  153. package/dist/helpers/get-timeline-max-zoom.d.ts +26 -0
  154. package/dist/helpers/get-timeline-max-zoom.js +45 -0
  155. package/dist/helpers/inject-css.js +2 -2
  156. package/dist/helpers/render-codec-label.d.ts +1 -1
  157. package/dist/helpers/retry-payload.js +1 -0
  158. package/dist/helpers/studio-runtime-config.d.ts +1 -1
  159. package/dist/helpers/studio-runtime-config.js +2 -3
  160. package/dist/helpers/timeline-layout.d.ts +3 -1
  161. package/dist/helpers/timeline-layout.js +6 -1
  162. package/dist/helpers/url-state.js +3 -2
  163. package/dist/helpers/use-menu-structure.js +1 -5
  164. package/dist/helpers/use-runtime-values.d.ts +2 -1
  165. package/dist/helpers/use-runtime-values.js +7 -3
  166. package/dist/icons/remotion-triangle.d.ts +2 -0
  167. package/dist/icons/remotion-triangle.js +7 -0
  168. package/dist/renderEntry.js +1 -1
  169. package/dist/state/composition-list.d.ts +13 -0
  170. package/dist/state/composition-list.js +21 -0
  171. package/dist/state/modals.d.ts +7 -1
  172. package/dist/state/timeline-zoom.d.ts +1 -2
  173. package/dist/state/timeline-zoom.js +9 -5
  174. package/package.json +14 -13
@@ -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: () => {
@@ -4,6 +4,7 @@ exports.CompositionInspector = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const client_id_1 = require("../../helpers/client-id");
7
+ const colors_1 = require("../../helpers/colors");
7
8
  const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
8
9
  const browse_elements_1 = require("../../icons/browse-elements");
9
10
  const frame_1 = require("../../icons/frame");
@@ -38,6 +39,13 @@ const browseElementsIconContainerStyle = {
38
39
  marginRight: -2,
39
40
  width: 22,
40
41
  };
42
+ const browseElementsArrowStyle = {
43
+ display: 'inline-block',
44
+ height: 12,
45
+ marginLeft: 4,
46
+ verticalAlign: -2,
47
+ width: 12,
48
+ };
41
49
  const CompositionActions = ({ readOnlyStudio }) => {
42
50
  const { canInsertAsset, canInsertComposition, canInsertSolid, canShowInsertAsset, canShowInsertComposition, canShowInsertSolid, insertAsset, insertComposition, insertSolid, } = (0, use_composition_actions_1.useCompositionActions)();
43
51
  const openElementsLibrary = (0, react_1.useCallback)(() => {
@@ -47,7 +55,9 @@ const CompositionActions = ({ readOnlyStudio }) => {
47
55
  (!canShowInsertAsset && !canShowInsertComposition && !canShowInsertSolid)) {
48
56
  return null;
49
57
  }
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] }));
58
+ 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",
59
+ 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" }) })
60
+ ] })) : null] }));
51
61
  };
52
62
  const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, readOnlyStudio, setDefaultProps }) => {
53
63
  var _a;
@@ -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;
@@ -6,6 +6,7 @@ const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const client_id_1 = require("../../helpers/client-id");
8
8
  const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
9
+ const audio_1 = require("../../icons/audio");
9
10
  const duplicate_1 = require("../../icons/duplicate");
10
11
  const scissors_1 = require("../../icons/scissors");
11
12
  const snowflake_1 = require("../../icons/snowflake");
@@ -13,6 +14,8 @@ const trash_1 = require("../../icons/trash");
13
14
  const ConfirmationDialog_1 = require("../ConfirmationDialog");
14
15
  const InspectorSequenceSection_1 = require("../InspectorSequenceSection");
15
16
  const is_menu_item_1 = require("../Menu/is-menu-item");
17
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
18
+ const split_video_from_audio_api_1 = require("../split-video-from-audio-api");
16
19
  const delete_selected_timeline_item_1 = require("../Timeline/delete-selected-timeline-item");
17
20
  const duplicate_selected_timeline_item_1 = require("../Timeline/duplicate-selected-timeline-item");
18
21
  const split_selected_timeline_item_1 = require("../Timeline/split-selected-timeline-item");
@@ -34,7 +37,7 @@ const largeActionIconStyle = {
34
37
  height: 20,
35
38
  width: 20,
36
39
  };
37
- const SplitSequenceAction = ({ selection, track }) => {
40
+ const SplitSequenceQuickAction = ({ selection, track }) => {
38
41
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
39
42
  const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
40
43
  const sequencePropStatuses = (0, react_1.useMemo)(() => remotion_1.Internals.getPropStatusesCtx(propStatuses, selection.nodePathInfo.sequenceSubscriptionKey), [propStatuses, selection]);
@@ -63,9 +66,9 @@ const SplitSequenceAction = ({ selection, track }) => {
63
66
  : eligibility.canSplit
64
67
  ? undefined
65
68
  : eligibility.reason;
66
- return (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: !canSplit, onClick: onSplit, title: disabledReason, renderIcon: (color) => (jsx_runtime_1.jsx(scissors_1.ScissorsIcon, { style: actionIconStyle, color: color })), children: "Split clip" }));
69
+ return (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canSplit, onClick: onSplit, title: disabledReason, renderIcon: (color) => (jsx_runtime_1.jsx(scissors_1.ScissorsIcon, { style: actionIconStyle, color: color })), children: "Split clip" }));
67
70
  };
68
- const SequenceSourceActions = ({ selection, track, validatedSource }) => {
71
+ const SequenceSourceQuickActions = ({ selection, track, validatedSource }) => {
69
72
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
70
73
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
71
74
  const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
@@ -97,7 +100,33 @@ const SequenceSourceActions = ({ selection, track, validatedSource }) => {
97
100
  }
98
101
  (0, delete_selected_timeline_item_1.deleteSequencesFromSource)([selection.nodePathInfo], confirm).catch(() => undefined);
99
102
  }, [confirm, selection.nodePathInfo, sourceActionsDisabled]);
100
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [(freezeFrameMenuItem === null || freezeFrameMenuItem === void 0 ? void 0 : freezeFrameMenuItem.type) === 'item' ? (jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: Boolean(freezeFrameMenuItem.disabled), onClick: () => freezeFrameMenuItem.onClick(freezeFrameMenuItem.id, null), renderIcon: (color) => (jsx_runtime_1.jsx(snowflake_1.SnowflakeIcon, { style: largeActionIconStyle, color: color })), children: freezeFrameMenuItem.label })) : null, jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: sourceActionsDisabled, onClick: onDuplicate, renderIcon: (color) => (jsx_runtime_1.jsx(duplicate_1.DuplicateIcon, { style: largeActionIconStyle, color: color })), children: "Duplicate" }), jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: sourceActionsDisabled, onClick: onDelete, renderIcon: (color) => (jsx_runtime_1.jsx(trash_1.TrashIcon, { style: actionIconStyle, color: color })), children: "Delete" })] }));
103
+ const splitVideoFromAudioDisabledReason = sourceActionsDisabled
104
+ ? 'Studio is read-only'
105
+ : selection.nodePathInfo.numberOfSequencesWithThisNodePath > 1
106
+ ? 'Programmatically duplicated sequences cannot be split from source'
107
+ : undefined;
108
+ const onSplitVideoFromAudio = (0, react_1.useCallback)(() => {
109
+ if (splitVideoFromAudioDisabledReason !== undefined) {
110
+ return;
111
+ }
112
+ const nodePath = selection.nodePathInfo.sequenceSubscriptionKey;
113
+ (0, split_video_from_audio_api_1.splitVideoFromAudio)({
114
+ fileName: nodePath.absolutePath,
115
+ nodePath: nodePath.nodePath,
116
+ })
117
+ .then((result) => {
118
+ if (result.success) {
119
+ (0, NotificationCenter_1.showNotification)('Split video from audio', 2000);
120
+ }
121
+ else {
122
+ (0, NotificationCenter_1.showNotification)(result.reason, 4000);
123
+ }
124
+ })
125
+ .catch((err) => {
126
+ (0, NotificationCenter_1.showNotification)(err.message, 4000);
127
+ });
128
+ }, [selection.nodePathInfo, splitVideoFromAudioDisabledReason]);
129
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [(freezeFrameMenuItem === null || freezeFrameMenuItem === void 0 ? void 0 : freezeFrameMenuItem.type) === 'item' ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: Boolean(freezeFrameMenuItem.disabled), onClick: () => freezeFrameMenuItem.onClick(freezeFrameMenuItem.id, null), renderIcon: (color) => (jsx_runtime_1.jsx(snowflake_1.SnowflakeIcon, { style: largeActionIconStyle, color: color })), children: freezeFrameMenuItem.label })) : null, track.sequence.type === 'video' ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: splitVideoFromAudioDisabledReason !== undefined, onClick: onSplitVideoFromAudio, title: splitVideoFromAudioDisabledReason, renderIcon: (color) => (jsx_runtime_1.jsx(audio_1.AudioIcon, { style: actionIconStyle, color: color })), children: "Split video from audio" })) : null, jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: sourceActionsDisabled, onClick: onDuplicate, renderIcon: (color) => (jsx_runtime_1.jsx(duplicate_1.DuplicateIcon, { style: largeActionIconStyle, color: color })), children: "Duplicate" }), jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: sourceActionsDisabled, onClick: onDelete, renderIcon: (color) => (jsx_runtime_1.jsx(trash_1.TrashIcon, { style: actionIconStyle, color: color })), children: "Delete" })] }));
101
130
  };
102
131
  const SequenceExpandedInspector = ({ track, readOnlyStudio }) => {
103
132
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
@@ -144,8 +173,8 @@ const SequenceExpandedInspector = ({ track, readOnlyStudio }) => {
144
173
  return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
145
174
  jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }, stackKey !== null && stackKey !== void 0 ? stackKey : track.sequence.id), jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
146
175
  jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })
147
- ] })) : null, validatedLocation ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.jsxs(common_1.InspectorActionSection, { children: [
148
- jsx_runtime_1.jsx(SplitSequenceAction, { selection: sequenceSelection, track: track }), jsx_runtime_1.jsx(SequenceSourceActions, { selection: sequenceSelection, track: track, validatedSource: validatedLocation.source })
176
+ ] })) : null, validatedLocation ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [
177
+ jsx_runtime_1.jsx(SplitSequenceQuickAction, { selection: sequenceSelection, track: track }), jsx_runtime_1.jsx(SequenceSourceQuickActions, { selection: sequenceSelection, track: track, validatedSource: validatedLocation.source })
149
178
  ] })
150
179
  ] })) : (jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Source controls unavailable" }))] }));
151
180
  };
@@ -4,7 +4,7 @@ export declare const InspectorSectionHeader: React.FC<{
4
4
  readonly children: React.ReactNode;
5
5
  }>;
6
6
  export declare const InspectorSectionDivider: React.FC;
7
- export declare const InspectorActionSection: React.FC<{
7
+ export declare const InspectorQuickActionsSection: React.FC<{
8
8
  readonly children: React.ReactNode;
9
9
  }>;
10
10
  export declare const InspectorSection: React.FC<{
@@ -24,13 +24,13 @@ export declare const InspectorDetailRow: React.FC<{
24
24
  readonly label: React.ReactNode | ((hovered: boolean) => React.ReactNode);
25
25
  readonly children: React.ReactNode;
26
26
  }>;
27
- export type InspectorInlineActionSegment = {
27
+ export type InspectorQuickActionSegment = {
28
28
  readonly disabled: boolean;
29
29
  readonly onClick: React.MouseEventHandler<HTMLButtonElement>;
30
30
  readonly renderIcon: (color: string) => React.ReactNode;
31
31
  readonly title?: string;
32
32
  };
33
- export type InspectorInlineActionProps = {
33
+ export type InspectorQuickActionProps = {
34
34
  readonly children: React.ReactNode;
35
35
  readonly disabled: boolean;
36
36
  readonly iconContainerStyle?: React.CSSProperties;
@@ -43,10 +43,10 @@ export type InspectorInlineActionProps = {
43
43
  readonly type: 'single';
44
44
  } | {
45
45
  readonly type: 'segmented';
46
- readonly trailing: InspectorInlineActionSegment;
46
+ readonly trailing: InspectorQuickActionSegment;
47
47
  };
48
48
  };
49
- export declare const InspectorInlineAction: React.FC<InspectorInlineActionProps>;
49
+ export declare const InspectorQuickAction: React.FC<InspectorQuickActionProps>;
50
50
  export declare const InspectorDefaultPropsWarnings: React.FC<{
51
51
  readonly warnings: RenderModalWarning[];
52
52
  }>;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.InspectorDefaultPropsWarnings = exports.InspectorInlineAction = exports.InspectorDetailRow = exports.InspectorMessage = exports.InspectorBackAction = exports.InspectorSection = exports.InspectorActionSection = exports.InspectorSectionDivider = exports.InspectorSectionHeader = void 0;
6
+ exports.InspectorDefaultPropsWarnings = exports.InspectorQuickAction = exports.InspectorDetailRow = exports.InspectorMessage = exports.InspectorBackAction = exports.InspectorSection = exports.InspectorQuickActionsSection = exports.InspectorSectionDivider = exports.InspectorSectionHeader = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const colors_1 = require("../../helpers/colors");
@@ -16,10 +16,10 @@ const InspectorSectionHeader = ({ children }) => jsx_runtime_1.jsx("div", { styl
16
16
  exports.InspectorSectionHeader = InspectorSectionHeader;
17
17
  const InspectorSectionDivider = () => (jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }));
18
18
  exports.InspectorSectionDivider = InspectorSectionDivider;
19
- const InspectorActionSection = ({ children }) => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
20
- jsx_runtime_1.jsx(exports.InspectorSectionDivider, {}), jsx_runtime_1.jsx("div", { style: styles_1.inspectorActionSection, children: children })
19
+ const InspectorQuickActionsSection = ({ children }) => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
20
+ jsx_runtime_1.jsx(exports.InspectorSectionDivider, {}), jsx_runtime_1.jsx("div", { style: styles_1.inspectorQuickActionsSection, children: children })
21
21
  ] }));
22
- exports.InspectorActionSection = InspectorActionSection;
22
+ exports.InspectorQuickActionsSection = InspectorQuickActionsSection;
23
23
  const InspectorSection = ({ children, header }) => {
24
24
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
25
25
  jsx_runtime_1.jsx(exports.InspectorSectionDivider, {}), jsx_runtime_1.jsx(exports.InspectorSectionHeader, { children: header }), children === null ? null : (jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionBody, children: children }))] }));
@@ -34,7 +34,7 @@ const BackArrow = ({ color }) => {
34
34
  return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: backArrowIcon, children: jsx_runtime_1.jsx("path", { d: "M7 239c-9.4 9.4-9.4 24.6 0 33.9L175 441c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L81.9 280 488 280c13.3 0 24-10.7 24-24s-10.7-24-24-24L81.9 232 209 105c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L7 239z", fill: color }) }));
35
35
  };
36
36
  const InspectorBackAction = ({ children, disabled, onClick, title }) => {
37
- return (jsx_runtime_1.jsx("div", { style: styles_1.inspectorActionSection, children: jsx_runtime_1.jsx(exports.InspectorInlineAction, { disabled: disabled, onClick: onClick, renderIcon: (color) => jsx_runtime_1.jsx(BackArrow, { color: color }), title: title, children: children }) }));
37
+ return (jsx_runtime_1.jsx("div", { style: styles_1.inspectorQuickActionsSection, children: jsx_runtime_1.jsx(exports.InspectorQuickAction, { disabled: disabled, onClick: onClick, renderIcon: (color) => jsx_runtime_1.jsx(BackArrow, { color: color }), title: title, children: children }) }));
38
38
  };
39
39
  exports.InspectorBackAction = InspectorBackAction;
40
40
  const InspectorMessage = ({ children }) => jsx_runtime_1.jsx("div", { style: styles_1.centeredMessage, children: children });
@@ -115,7 +115,7 @@ const segmentedTrailingAction = {
115
115
  padding: 0,
116
116
  width: 28,
117
117
  };
118
- const InspectorInlineAction = ({ children, disabled, iconContainerStyle, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
118
+ const InspectorQuickAction = ({ children, disabled, iconContainerStyle, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
119
119
  const isSegmented = variant.type === 'segmented';
120
120
  // A non-clickable single action (onClick === null) never shows a hover
121
121
  // effect. In the segmented variant, the main segment highlights whenever
@@ -137,7 +137,7 @@ const InspectorInlineAction = ({ children, disabled, iconContainerStyle, onClick
137
137
  }), [disabled, showsHover, isSegmented, size, style]);
138
138
  const mainContent = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderIcon ? (jsx_runtime_1.jsx("span", { style: { ...inlineLabelIcon, ...iconContainerStyle }, children: renderIcon(colors_1.CURRENT_COLOR) })) : null, jsx_runtime_1.jsx("span", { style: inlineLabelText, children: children })
139
139
  ] }));
140
- const mainAction = onClick ? (jsx_runtime_1.jsx("button", { className: `__remotion-inspector-inline-action ${hoverable_1.HOVERABLE_CLASS_NAME}`, type: "button", disabled: disabled, style: buttonStyle, title: title, onClick: onClick, children: mainContent })) : (jsx_runtime_1.jsx("div", { className: hoverable_1.HOVERABLE_CLASS_NAME, style: buttonStyle, title: title, children: mainContent }));
140
+ const mainAction = onClick ? (jsx_runtime_1.jsx("button", { className: `__remotion-inspector-quick-action ${hoverable_1.HOVERABLE_CLASS_NAME}`, type: "button", disabled: disabled, style: buttonStyle, title: title, onClick: onClick, children: mainContent })) : (jsx_runtime_1.jsx("div", { className: hoverable_1.HOVERABLE_CLASS_NAME, style: buttonStyle, title: title, children: mainContent }));
141
141
  if (variant.type === 'segmented') {
142
142
  const trailingStyle = {
143
143
  ...segmentedTrailingAction,
@@ -159,7 +159,7 @@ const InspectorInlineAction = ({ children, disabled, iconContainerStyle, onClick
159
159
  }
160
160
  return mainAction;
161
161
  };
162
- exports.InspectorInlineAction = InspectorInlineAction;
162
+ exports.InspectorQuickAction = InspectorQuickAction;
163
163
  const InspectorDefaultPropsWarnings = ({ warnings }) => {
164
164
  return (jsx_runtime_1.jsx("div", { style: styles_1.defaultPropsWarningMessages, children: warnings.map((warning) => (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: warning.message, align: "flex-start", type: "warning", size: "compact", action: warning.resolveLink ? (jsx_runtime_1.jsx("a", { href: warning.resolveLink, target: "_blank", rel: "noopener noreferrer", style: styles_1.resolveLinkStyle, children: "Resolve" })) : null }, warning.id))) }));
165
165
  };