@remotion/studio 4.0.512 → 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 (208) 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/CompositionSelectorItem.js +14 -1
  11. package/dist/components/ConfigureDefaultEditorModal.js +17 -11
  12. package/dist/components/Editor.js +16 -1
  13. package/dist/components/ElementInstallConfirmation.d.ts +1 -0
  14. package/dist/components/ElementInstallConfirmation.js +4 -2
  15. package/dist/components/FixComputedValueModal.d.ts +9 -0
  16. package/dist/components/FixComputedValueModal.js +217 -0
  17. package/dist/components/InitialCompositionLoader.js +19 -0
  18. package/dist/components/InlineDropdown.js +4 -4
  19. package/dist/components/InspectorInfoHeader.js +3 -3
  20. package/dist/components/InspectorOpenInEditor.js +26 -24
  21. package/dist/components/InspectorPanel/AlignmentControls.js +13 -2
  22. package/dist/components/InspectorPanel/CompositionInspector.js +11 -1
  23. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +12 -8
  24. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +13 -2
  25. package/dist/components/InspectorPanel/EasingInspector.js +12 -3
  26. package/dist/components/InspectorPanel/KeyframeInspector.js +21 -7
  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/easing-inspector-selection.js +7 -2
  32. package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +1 -0
  33. package/dist/components/InspectorPanel/styles.d.ts +1 -1
  34. package/dist/components/InspectorPanel/styles.js +4 -2
  35. package/dist/components/InspectorSourceLocation.d.ts +1 -1
  36. package/dist/components/InspectorSourceLocation.js +2 -2
  37. package/dist/components/LicenseKeyValidation.js +2 -2
  38. package/dist/components/Modals.js +2 -1
  39. package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
  40. package/dist/components/NewComposition/CodemodFooter.js +10 -8
  41. package/dist/components/NewComposition/DeleteComposition.js +1 -1
  42. package/dist/components/NewComposition/DeleteFolder.js +1 -1
  43. package/dist/components/NewComposition/DuplicateComposition.js +7 -2
  44. package/dist/components/NewComposition/NewComposition.js +1 -1
  45. package/dist/components/NewComposition/NewFolder.js +1 -1
  46. package/dist/components/NewComposition/RenameComposition.js +1 -1
  47. package/dist/components/NewComposition/RenameFolder.js +1 -1
  48. package/dist/components/NewComposition/duplicate-composition-api.d.ts +16 -0
  49. package/dist/components/NewComposition/duplicate-composition-api.js +16 -0
  50. package/dist/components/NoRegisterRoot.js +1 -1
  51. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +4 -3
  52. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
  53. package/dist/components/QuickSwitcher/fuzzy-search.js +1 -1
  54. package/dist/components/RefreshCompositionOverlay.js +1 -1
  55. package/dist/components/RenderButton.js +6 -3
  56. package/dist/components/RenderModal/WebRenderModal.js +6 -2
  57. package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +2 -0
  58. package/dist/components/RenderModal/WebRenderModalAdvanced.js +9 -2
  59. package/dist/components/RenderModal/render-modals.js +5 -1
  60. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +5 -1
  61. package/dist/components/RenderQueue/actions.js +12 -2
  62. package/dist/components/RenderQueue/client-side-render-types.d.ts +1 -0
  63. package/dist/components/RenderingSettings.d.ts +2 -0
  64. package/dist/components/RenderingSettings.js +355 -0
  65. package/dist/components/SelectedOutlineElement.js +15 -13
  66. package/dist/components/SelectedOutlineOverlay.js +30 -8
  67. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  68. package/dist/components/SelectedOutlinePolygon.js +53 -9
  69. package/dist/components/SettingsContext.d.ts +4 -1
  70. package/dist/components/SettingsContext.js +9 -2
  71. package/dist/components/SettingsModal.d.ts +1 -1
  72. package/dist/components/SettingsModal.js +10 -1
  73. package/dist/components/SettingsModalFooter.js +1 -1
  74. package/dist/components/StudioSettings.d.ts +2 -0
  75. package/dist/components/StudioSettings.js +185 -0
  76. package/dist/components/Timeline/LoopedIndicator.js +1 -1
  77. package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +3 -0
  78. package/dist/components/Timeline/LoopedTimelineIndicators.js +22 -14
  79. package/dist/components/Timeline/Timeline.js +11 -9
  80. package/dist/components/Timeline/TimelineArrayField.js +1 -0
  81. package/dist/components/Timeline/TimelineAssetField.d.ts +2 -2
  82. package/dist/components/Timeline/TimelineAssetField.js +1 -1
  83. package/dist/components/Timeline/TimelineDragHandler.js +62 -76
  84. package/dist/components/Timeline/TimelineEffectItem.js +1 -1
  85. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +4 -2
  86. package/dist/components/Timeline/TimelineEffectPropItem.js +25 -14
  87. package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -1
  88. package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
  89. package/dist/components/Timeline/TimelineExpandedSection.js +1 -1
  90. package/dist/components/Timeline/TimelineHeightContainer.d.ts +0 -4
  91. package/dist/components/Timeline/TimelineHeightContainer.js +4 -4
  92. package/dist/components/Timeline/TimelineImageInfo.d.ts +1 -0
  93. package/dist/components/Timeline/TimelineImageInfo.js +3 -2
  94. package/dist/components/Timeline/TimelineKeyframeControls.js +31 -8
  95. package/dist/components/Timeline/TimelineKeyframedValue.js +1 -0
  96. package/dist/components/Timeline/TimelineList.d.ts +1 -5
  97. package/dist/components/Timeline/TimelineList.js +14 -9
  98. package/dist/components/Timeline/TimelinePinchZoom.js +5 -5
  99. package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -2
  100. package/dist/components/Timeline/TimelineRowChrome.js +12 -5
  101. package/dist/components/Timeline/TimelineSchemaField.d.ts +7 -3
  102. package/dist/components/Timeline/TimelineSchemaField.js +71 -13
  103. package/dist/components/Timeline/TimelineScrollable.js +3 -1
  104. package/dist/components/Timeline/TimelineSelection.d.ts +5 -2
  105. package/dist/components/Timeline/TimelineSelection.js +90 -103
  106. package/dist/components/Timeline/TimelineSequence.js +59 -25
  107. package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -1
  108. package/dist/components/Timeline/TimelineSequenceItem.js +15 -9
  109. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +2 -1
  110. package/dist/components/Timeline/TimelineSequencePropItem.js +14 -7
  111. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -0
  112. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +128 -27
  113. package/dist/components/Timeline/TimelineSlider.js +42 -33
  114. package/dist/components/Timeline/TimelineTimeIndicators.js +90 -98
  115. package/dist/components/Timeline/TimelineTracks.d.ts +0 -2
  116. package/dist/components/Timeline/TimelineTracks.js +11 -4
  117. package/dist/components/Timeline/TimelineTransformOriginField.js +1 -1
  118. package/dist/components/Timeline/TimelineVideoInfo.d.ts +4 -4
  119. package/dist/components/Timeline/TimelineVideoInfo.js +151 -61
  120. package/dist/components/Timeline/TimelineViewport.d.ts +12 -0
  121. package/dist/components/Timeline/TimelineViewport.js +62 -0
  122. package/dist/components/Timeline/TimelineVirtualization.d.ts +22 -0
  123. package/dist/components/Timeline/TimelineVirtualization.js +144 -0
  124. package/dist/components/Timeline/TimelineZoomControls.js +16 -8
  125. package/dist/components/Timeline/call-add-keyframe.js +31 -3
  126. package/dist/components/Timeline/call-delete-keyframe.js +13 -3
  127. package/dist/components/Timeline/call-move-keyframe.d.ts +2 -1
  128. package/dist/components/Timeline/call-move-keyframe.js +81 -18
  129. package/dist/components/Timeline/call-update-keyframe-settings.js +31 -3
  130. package/dist/components/Timeline/delete-selected-keyframe.d.ts +0 -8
  131. package/dist/components/Timeline/delete-selected-keyframe.js +23 -44
  132. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +0 -8
  133. package/dist/components/Timeline/delete-selected-timeline-item.js +18 -44
  134. package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +8 -3
  135. package/dist/components/Timeline/get-sequence-context-menu-items.js +10 -8
  136. package/dist/components/Timeline/get-timeline-keyframes.d.ts +5 -2
  137. package/dist/components/Timeline/get-timeline-keyframes.js +16 -10
  138. package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +30 -0
  139. package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +61 -0
  140. package/dist/components/Timeline/keyframe-clipboard.js +9 -2
  141. package/dist/components/Timeline/split-selected-timeline-item.js +2 -2
  142. package/dist/components/Timeline/timeline-scroll-logic.d.ts +24 -0
  143. package/dist/components/Timeline/timeline-scroll-logic.js +127 -4
  144. package/dist/components/Timeline/use-open-sequence-in-apps.js +8 -8
  145. package/dist/components/Timeline/use-timeline-height.d.ts +3 -5
  146. package/dist/components/Timeline/use-timeline-height.js +16 -18
  147. package/dist/components/Timeline/use-timeline-keyframe-drag.js +14 -4
  148. package/dist/components/UpdateCheck.d.ts +2 -10
  149. package/dist/components/UpdateCheck.js +8 -2
  150. package/dist/components/VisualControls/ClickableFileName.js +13 -6
  151. package/dist/components/VisualControls/VisualControlHandle.js +8 -0
  152. package/dist/components/composition-menu-items.d.ts +6 -1
  153. package/dist/components/composition-menu-items.js +9 -6
  154. package/dist/components/delete-jsx-node-api.d.ts +2 -0
  155. package/dist/components/delete-jsx-node-api.js +12 -0
  156. package/dist/components/element-install-api.d.ts +3 -0
  157. package/dist/components/element-install-api.js +19 -0
  158. package/dist/components/folder-menu-items.d.ts +4 -1
  159. package/dist/components/folder-menu-items.js +4 -5
  160. package/dist/components/get-open-in-menu-items.d.ts +1 -1
  161. package/dist/components/get-open-in-menu-items.js +15 -13
  162. package/dist/components/import-assets.js +20 -9
  163. package/dist/components/reorder-sequence-api.d.ts +2 -0
  164. package/dist/components/reorder-sequence-api.js +12 -0
  165. package/dist/components/sequence-props-api.js +44 -3
  166. package/dist/components/split-jsx-sequence-api.d.ts +2 -0
  167. package/dist/components/split-jsx-sequence-api.js +12 -0
  168. package/dist/components/split-video-from-audio-api.d.ts +2 -0
  169. package/dist/components/split-video-from-audio-api.js +12 -0
  170. package/dist/components/use-default-editor-info.d.ts +8 -0
  171. package/dist/components/use-default-editor-info.js +25 -9
  172. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +10 -3
  173. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +3 -1
  174. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +6 -6
  175. package/dist/error-overlay/remotion-overlay/Overlay.js +14 -12
  176. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +2 -1
  177. package/dist/error-overlay/remotion-overlay/StackFrame.js +7 -4
  178. package/dist/esm/{chunk-s8gwjng0.js → chunk-xn2q7eem.js} +11983 -8035
  179. package/dist/esm/index.mjs +7 -5
  180. package/dist/esm/internals.mjs +11983 -8035
  181. package/dist/esm/previewEntry.mjs +13059 -9107
  182. package/dist/esm/renderEntry.mjs +2 -3
  183. package/dist/helpers/browser-studio-operations.d.ts +2 -0
  184. package/dist/helpers/browser-studio-operations.js +10 -1
  185. package/dist/helpers/get-timeline-max-zoom.d.ts +26 -0
  186. package/dist/helpers/get-timeline-max-zoom.js +45 -0
  187. package/dist/helpers/inject-css.js +2 -2
  188. package/dist/helpers/open-in-editor.d.ts +6 -4
  189. package/dist/helpers/open-in-editor.js +4 -4
  190. package/dist/helpers/render-codec-label.d.ts +1 -1
  191. package/dist/helpers/retry-payload.js +1 -0
  192. package/dist/helpers/studio-runtime-config.d.ts +1 -1
  193. package/dist/helpers/studio-runtime-config.js +2 -3
  194. package/dist/helpers/timeline-layout.d.ts +3 -1
  195. package/dist/helpers/timeline-layout.js +6 -1
  196. package/dist/helpers/url-state.js +3 -2
  197. package/dist/helpers/use-menu-structure.js +12 -11
  198. package/dist/helpers/use-runtime-values.d.ts +2 -1
  199. package/dist/helpers/use-runtime-values.js +7 -3
  200. package/dist/icons/remotion-triangle.d.ts +2 -0
  201. package/dist/icons/remotion-triangle.js +7 -0
  202. package/dist/renderEntry.js +1 -1
  203. package/dist/state/composition-list.d.ts +13 -0
  204. package/dist/state/composition-list.js +21 -0
  205. package/dist/state/modals.d.ts +7 -1
  206. package/dist/state/timeline-zoom.d.ts +1 -2
  207. package/dist/state/timeline-zoom.js +9 -5
  208. 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");
@@ -42,16 +43,14 @@ const mainButtonBase = {
42
43
  };
43
44
  const editorButtonIconSize = 18;
44
45
  const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locationType }) => {
45
- var _a, _b;
46
46
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
47
47
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
48
48
  const { tabIndex } = (0, z_index_1.useZIndex)();
49
49
  const [hovered, setHovered] = (0, react_1.useState)(false);
50
50
  const [dropdownOpened, setDropdownOpened] = (0, react_1.useState)(false);
51
51
  const ignorePointerEnter = (0, react_1.useRef)(false);
52
- const editorPickerAvailable = (0, use_default_editor_info_1.canUseEditorPicker)(previewServerState.type === 'connected');
53
- const editorInfo = (0, use_default_editor_info_1.useDefaultEditorInfo)(editorPickerAvailable);
54
- const codingAgentInfo = (0, use_default_editor_info_1.useDefaultCodingAgentInfo)(editorPickerAvailable);
52
+ const { canConfigureApps, canOpenInEditor, defaultEditorId, defaultEditorName, editorInfo, } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
53
+ const codingAgentInfo = (0, use_default_editor_info_1.useDefaultCodingAgentInfo)(canConfigureApps);
55
54
  const openWithEditor = (0, react_1.useCallback)(async (editorId) => {
56
55
  if (!location) {
57
56
  return;
@@ -63,8 +62,6 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
63
62
  (0, NotificationCenter_1.showNotification)(err.message, 2000);
64
63
  }
65
64
  }, [location]);
66
- const preferredEditorId = (0, use_default_editor_info_1.getPreferredEditorId)(editorInfo);
67
- const preferredEditor = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.id === preferredEditorId);
68
65
  const openWithCodingAgent = (0, react_1.useCallback)(async (codingAgentId, codingAgentName) => {
69
66
  try {
70
67
  const response = await (0, open_in_editor_1.openInCodingAgent)(codingAgentId, codingAgentId === 'copilot' ? null : contextForAgents);
@@ -76,13 +73,14 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
76
73
  (0, NotificationCenter_1.showNotification)(err.message, 2000);
77
74
  }
78
75
  }, [contextForAgents]);
79
- const editorName = (_b = (_a = window.remotion_editorName) !== null && _a !== void 0 ? _a : preferredEditor === null || preferredEditor === void 0 ? void 0 : preferredEditor.nameWithType) !== null && _b !== void 0 ? _b : 'default editor';
80
- const canOpenDefault = location !== null &&
81
- (window.remotion_editorName !== null || preferredEditorId !== null);
76
+ const editorName = defaultEditorName !== null && defaultEditorName !== void 0 ? defaultEditorName : 'default editor';
77
+ const canOpenDefault = location !== null && canOpenInEditor;
82
78
  const onOpenDefault = (0, react_1.useCallback)((event) => {
83
79
  event.stopPropagation();
84
- openWithEditor(window.remotion_editorName === null ? preferredEditorId : null).catch(() => undefined);
85
- }, [openWithEditor, preferredEditorId]);
80
+ if (defaultEditorId) {
81
+ openWithEditor(defaultEditorId).catch(() => undefined);
82
+ }
83
+ }, [defaultEditorId, openWithEditor]);
86
84
  const onDropdownOpenChange = (0, react_1.useCallback)((open) => {
87
85
  setDropdownOpened(open);
88
86
  if (!open) {
@@ -123,19 +121,21 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
123
121
  editorDisabled: location === null,
124
122
  editorInfo,
125
123
  excludeCodingAgentId: null,
126
- excludeEditorId: preferredEditorId,
124
+ excludeEditorId: defaultEditorId,
127
125
  fileManagerDisabled: !(location === null || location === void 0 ? void 0 : location.source),
128
126
  folder: locationType === 'folder',
129
127
  location,
130
- onConfigureApps: () => {
131
- var _a;
132
- var _b;
133
- setSelectedModal({
134
- type: 'settings',
135
- initialTab: 'apps',
136
- initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
137
- });
138
- },
128
+ onConfigureApps: canConfigureApps
129
+ ? () => {
130
+ var _a;
131
+ var _b;
132
+ setSelectedModal({
133
+ type: 'settings',
134
+ initialTab: 'apps',
135
+ initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
136
+ });
137
+ }
138
+ : null,
139
139
  onOpenInCodingAgent: (codingAgentId, codingAgentName) => {
140
140
  openWithCodingAgent(codingAgentId, codingAgentName).catch(() => undefined);
141
141
  },
@@ -178,15 +178,17 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
178
178
  });
179
179
  }, [
180
180
  codingAgentInfo,
181
+ canConfigureApps,
182
+ defaultEditorId,
181
183
  editorInfo,
182
184
  location,
183
185
  locationType,
184
186
  openWithCodingAgent,
185
187
  openWithEditor,
186
- preferredEditorId,
187
188
  setSelectedModal,
188
189
  ]);
189
- if (!editorPickerAvailable) {
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: () => {
@@ -197,7 +199,7 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
197
199
  ignorePointerEnter.current = false;
198
200
  setHovered(false);
199
201
  }, children: [
200
- jsx_runtime_1.jsxs("button", { "aria-label": `Open in ${editorName}`, disabled: !canOpenDefault, onClick: onOpenDefault, style: mainButtonStyle, tabIndex: tabIndex, title: `Open in ${editorName}`, type: "button", children: [label, jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: preferredEditorId, size: editorButtonIconSize })
202
+ jsx_runtime_1.jsxs("button", { "aria-label": `Open in ${editorName}`, disabled: !canOpenDefault, onClick: onOpenDefault, style: mainButtonStyle, tabIndex: tabIndex, title: `Open in ${editorName}`, type: "button", children: [label, jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: defaultEditorId, size: editorButtonIconSize })
201
203
  ] }), jsx_runtime_1.jsx(InlineDropdown_1.InlineDropdown, { onOpenChange: onDropdownOpenChange, renderAction: renderDropdownAction, style: dropdownStyle, title: "Open in another app", unhoveredColor: dropdownForegroundColor, values: menuItems, variant: "compact" })
202
204
  ] }));
203
205
  };
@@ -18,6 +18,7 @@ const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
18
18
  const selected_outline_drag_1 = require("../selected-outline-drag");
19
19
  const selected_outline_types_1 = require("../selected-outline-types");
20
20
  const call_add_keyframe_1 = require("../Timeline/call-add-keyframe");
21
+ const get_timeline_keyframes_1 = require("../Timeline/get-timeline-keyframes");
21
22
  const save_sequence_prop_1 = require("../Timeline/save-sequence-prop");
22
23
  const timeline_translate_utils_1 = require("../Timeline/timeline-translate-utils");
23
24
  const alignment_controls_1 = require("./alignment-controls");
@@ -77,7 +78,12 @@ const AlignmentControls = ({ track }) => {
77
78
  }
78
79
  const nodePath = track.nodePathInfo.sequenceSubscriptionKey;
79
80
  const nodePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath);
80
- const sourceFrame = timelinePosition - track.keyframeDisplayOffset;
81
+ const firstKeyframedStatus = Object.values(nodePropStatuses !== null && nodePropStatuses !== void 0 ? nodePropStatuses : {}).find((status) => status.status === 'keyframed');
82
+ const sourceFrame = timelinePosition -
83
+ (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
84
+ propStatus: firstKeyframedStatus,
85
+ keyframeDisplayOffset: track.keyframeDisplayOffset,
86
+ });
81
87
  const dragOverrides = (_b = getDragOverrides(nodePath)) !== null && _b !== void 0 ? _b : {};
82
88
  const activeSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
83
89
  schema: track.sequence.controls.schema,
@@ -191,7 +197,12 @@ const AlignmentControls = ({ track }) => {
191
197
  }
192
198
  const renderNodePath = track.nodePathInfo.sequenceSubscriptionKey;
193
199
  const renderNodePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, renderNodePath);
194
- const renderSourceFrame = timelinePosition - track.keyframeDisplayOffset;
200
+ const firstRenderKeyframedStatus = Object.values(renderNodePropStatuses !== null && renderNodePropStatuses !== void 0 ? renderNodePropStatuses : {}).find((status) => status.status === 'keyframed');
201
+ const renderSourceFrame = timelinePosition -
202
+ (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
203
+ propStatus: firstRenderKeyframedStatus,
204
+ keyframeDisplayOffset: track.keyframeDisplayOffset,
205
+ });
195
206
  const renderDragOverrides = (_a = getDragOverrides(renderNodePath)) !== null && _a !== void 0 ? _a : {};
196
207
  const renderActiveSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
197
208
  schema: track.sequence.controls.schema,
@@ -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;
@@ -4,6 +4,7 @@ exports.CompositionInspectorHeader = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
+ const client_id_1 = require("../../helpers/client-id");
7
8
  const is_composition_still_1 = require("../../helpers/is-composition-still");
8
9
  const open_in_editor_1 = require("../../helpers/open-in-editor");
9
10
  const react_2 = require("../../icons/react");
@@ -16,6 +17,7 @@ const InspectorSourceLocation_1 = require("../InspectorSourceLocation");
16
17
  const layout_1 = require("../layout");
17
18
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
18
19
  const use_resolved_stack_1 = require("../Timeline/use-resolved-stack");
20
+ const use_default_editor_info_1 = require("../use-default-editor-info");
19
21
  const COMPOSITION_INSPECTOR_HEADER_HEIGHT = 66;
20
22
  const sourceLocationIconStyle = {
21
23
  flexShrink: 0,
@@ -33,6 +35,8 @@ const CompositionInspectorHeader = () => {
33
35
  var _a, _b, _c, _d, _e;
34
36
  const video = remotion_1.Internals.useVideo();
35
37
  const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
38
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
39
+ const { canOpenInEditor, defaultEditorId } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
36
40
  const currentComposition = (0, react_1.useMemo)(() => {
37
41
  var _a;
38
42
  if (!video) {
@@ -69,21 +73,21 @@ const CompositionInspectorHeader = () => {
69
73
  });
70
74
  }, [compositionFile, compositionId]);
71
75
  const openFileLocation = (0, react_1.useCallback)(() => {
72
- if (!validatedLocation) {
76
+ if (!validatedLocation || !defaultEditorId || !canOpenInEditor) {
73
77
  return;
74
78
  }
75
- (0, open_in_editor_1.openOriginalPositionInEditor)(validatedLocation, null).catch((err) => {
79
+ (0, open_in_editor_1.openOriginalPositionInEditor)(validatedLocation, defaultEditorId).catch((err) => {
76
80
  (0, NotificationCenter_1.showNotification)(err.message, 2000);
77
81
  });
78
- }, [validatedLocation]);
82
+ }, [canOpenInEditor, defaultEditorId, validatedLocation]);
79
83
  const openComponentLocation = (0, react_1.useCallback)(() => {
80
- if (!componentLocation) {
84
+ if (!componentLocation || !defaultEditorId || !canOpenInEditor) {
81
85
  return;
82
86
  }
83
- (0, open_in_editor_1.openOriginalPositionInEditor)(componentLocation, null).catch((err) => {
87
+ (0, open_in_editor_1.openOriginalPositionInEditor)(componentLocation, defaultEditorId).catch((err) => {
84
88
  (0, NotificationCenter_1.showNotification)(err.message, 2000);
85
89
  });
86
- }, [componentLocation]);
90
+ }, [canOpenInEditor, componentLocation, defaultEditorId]);
87
91
  const renderCompositionIcon = (0, react_1.useCallback)((color) => {
88
92
  if (!video) {
89
93
  return null;
@@ -91,8 +95,8 @@ const CompositionInspectorHeader = () => {
91
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 }));
92
96
  }, [video]);
93
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: [
94
- 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, 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 &&
95
99
  compositionFile !== null &&
96
- compositionId !== null ? (jsx_runtime_1.jsx("div", { "aria-hidden": true, style: componentLocationPlaceholder })) : (jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: componentLocation, canOpen: componentLocation !== null, 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 }));
97
101
  };
98
102
  exports.CompositionInspectorHeader = CompositionInspectorHeader;
@@ -13,6 +13,7 @@ const CompositionOrStillIcon_1 = require("../CompositionOrStillIcon");
13
13
  const ContextMenu_1 = require("../ContextMenu");
14
14
  const InitialCompositionLoader_1 = require("../InitialCompositionLoader");
15
15
  const use_resolved_stack_1 = require("../Timeline/use-resolved-stack");
16
+ const use_default_editor_info_1 = require("../use-default-editor-info");
16
17
  const common_1 = require("./common");
17
18
  const compositionIconStyle = {
18
19
  height: 18,
@@ -43,15 +44,25 @@ const ConnectedCompositionRow = ({ composition }) => {
43
44
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
44
45
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
45
46
  .previewServerState.type;
47
+ const { defaultEditorId, defaultEditorName } = (0, use_default_editor_info_1.useEditorOpening)(connectionStatus === 'connected');
46
48
  const resolvedLocation = (0, use_resolved_stack_1.useResolvedStack)(composition.stack);
47
49
  const getContextMenuItems = (0, react_1.useCallback)(() => (0, composition_menu_items_1.getCompositionContextMenuItems)({
48
50
  closeMenu: noop_1.noop,
49
51
  composition,
50
52
  connectionStatus,
53
+ editorId: defaultEditorId,
54
+ editorName: defaultEditorName,
51
55
  includeCompositionManagementItems: false,
52
56
  readOnlyStudio: window.remotion_isReadOnlyStudio,
53
57
  resolvedLocation,
54
58
  setSelectedModal,
55
- }), [composition, connectionStatus, resolvedLocation, setSelectedModal]);
56
- 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 }) }));
59
+ }), [
60
+ composition,
61
+ connectionStatus,
62
+ defaultEditorId,
63
+ defaultEditorName,
64
+ resolvedLocation,
65
+ setSelectedModal,
66
+ ]);
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 }) }));
57
68
  };