@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
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useDefaultCodingAgentInfo = exports.useDefaultEditorInfo = exports.getPreferredEditorId = exports.canUseEditorPicker = void 0;
3
+ exports.useDefaultCodingAgentInfo = exports.useDefaultEditorInfo = exports.useEditorOpening = exports.getPreferredEditorId = exports.canOpenInEditor = exports.canUseEditorPicker = void 0;
4
4
  const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
5
5
  const SettingsContext_1 = require("./SettingsContext");
6
6
  const canUseEditorPicker = (previewServerConnected) => {
@@ -9,6 +9,10 @@ const canUseEditorPicker = (previewServerConnected) => {
9
9
  (0, browser_studio_operations_1.getBrowserStudioOperations)() === null);
10
10
  };
11
11
  exports.canUseEditorPicker = canUseEditorPicker;
12
+ const canOpenInEditor = (previewServerConnected) => {
13
+ return previewServerConnected && (0, browser_studio_operations_1.getBrowserStudioOperations)() === null;
14
+ };
15
+ exports.canOpenInEditor = canOpenInEditor;
12
16
  const preferredFallbackEditorIds = [
13
17
  'zed',
14
18
  'vscode',
@@ -17,17 +21,14 @@ const preferredFallbackEditorIds = [
17
21
  const getPreferredEditorId = (editorInfo) => {
18
22
  var _a, _b, _c;
19
23
  var _d;
20
- const runningEditorId = (_a = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.nameWithType === window.remotion_editorName)) === null || _a === void 0 ? void 0 : _a.id;
21
- if (runningEditorId) {
22
- return runningEditorId;
23
- }
24
- if (window.remotion_editorName !== null) {
25
- return null;
26
- }
27
- const configuredEditorId = (_b = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.id === editorInfo.defaultEditor)) === null || _b === void 0 ? void 0 : _b.id;
24
+ const configuredEditorId = (_a = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.id === editorInfo.defaultEditor)) === null || _a === void 0 ? void 0 : _a.id;
28
25
  if (configuredEditorId) {
29
26
  return configuredEditorId;
30
27
  }
28
+ const runningEditorId = (_b = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.nameWithType === window.remotion_editorName)) === null || _b === void 0 ? void 0 : _b.id;
29
+ if (runningEditorId) {
30
+ return runningEditorId;
31
+ }
31
32
  return ((_d = (_c = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.slice().sort((a, b) => {
32
33
  const aPriority = preferredFallbackEditorIds.indexOf(a.id);
33
34
  const bPriority = preferredFallbackEditorIds.indexOf(b.id);
@@ -40,6 +41,21 @@ const getPreferredEditorId = (editorInfo) => {
40
41
  }).at(0)) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : null);
41
42
  };
42
43
  exports.getPreferredEditorId = getPreferredEditorId;
44
+ const useEditorOpening = (previewServerConnected) => {
45
+ var _a;
46
+ const editorConnectionAvailable = (0, exports.canOpenInEditor)(previewServerConnected);
47
+ const editorInfo = (0, exports.useDefaultEditorInfo)(editorConnectionAvailable);
48
+ const defaultEditorId = (0, exports.getPreferredEditorId)(editorInfo);
49
+ const defaultEditor = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.id === defaultEditorId);
50
+ return {
51
+ canConfigureApps: (0, exports.canUseEditorPicker)(previewServerConnected),
52
+ canOpenInEditor: editorConnectionAvailable && defaultEditorId !== null,
53
+ defaultEditorId,
54
+ defaultEditorName: (_a = defaultEditor === null || defaultEditor === void 0 ? void 0 : defaultEditor.nameWithType) !== null && _a !== void 0 ? _a : null,
55
+ editorInfo,
56
+ };
57
+ };
58
+ exports.useEditorOpening = useEditorOpening;
43
59
  const useDefaultEditorInfo = (enabled) => {
44
60
  const { editorInfo } = (0, SettingsContext_1.useSettings)();
45
61
  return enabled ? editorInfo : null;
@@ -7,6 +7,8 @@ const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
8
  const layout_1 = require("../../components/layout");
9
9
  const is_menu_item_1 = require("../../components/Menu/is-menu-item");
10
+ const use_default_editor_info_1 = require("../../components/use-default-editor-info");
11
+ const client_id_1 = require("../../helpers/client-id");
10
12
  const colors_1 = require("../../helpers/colors");
11
13
  const AskOnDiscord_1 = require("./AskOnDiscord");
12
14
  const CalculateMetadataErrorExplainer_1 = require("./CalculateMetadataErrorExplainer");
@@ -52,6 +54,8 @@ const spacer = {
52
54
  };
53
55
  const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButton, calculateMetadata, symbolicationFailure, }) => {
54
56
  var _a;
57
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
58
+ const { canOpenInEditor, defaultEditorId, defaultEditorName } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
55
59
  const highestLineNumber = Math.max(0, ...display.stackFrames
56
60
  .map((s) => s.originalScriptCode)
57
61
  .flat(1)
@@ -86,8 +90,11 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
86
90
  return (jsx_runtime_1.jsxs("div", { children: [
87
91
  jsx_runtime_1.jsx(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: display.error.name, message: message, canHaveDismissButton: canHaveDismissButton }), helpLink ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
88
92
  jsx_runtime_1.jsx(HelpLink_1.HelpLink, { link: helpLink, canHaveKeyboardShortcuts: keyboardShortcuts }), jsx_runtime_1.jsx("div", { style: spacer })
89
- ] })) : null, display.stackFrames.length > 0 && window.remotion_editorName ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
90
- jsx_runtime_1.jsx(OpenInEditor_1.OpenInEditor, { canHaveKeyboardShortcuts: keyboardShortcuts, stack: display.stackFrames[0] }), jsx_runtime_1.jsx("div", { style: spacer })
93
+ ] })) : null, display.stackFrames.length > 0 &&
94
+ canOpenInEditor &&
95
+ defaultEditorId &&
96
+ defaultEditorName ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
97
+ jsx_runtime_1.jsx(OpenInEditor_1.OpenInEditor, { canHaveKeyboardShortcuts: keyboardShortcuts, editorId: defaultEditorId, editorName: defaultEditorName, stack: display.stackFrames[0] }), jsx_runtime_1.jsx("div", { style: spacer })
91
98
  ] })) : null, jsx_runtime_1.jsx(CopyStackTrace_1.CopyStackTrace, { errorText: errorTextForCopy }), jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(SearchGitHubIssues_1.SearchGithubIssues, { canHaveKeyboardShortcuts: keyboardShortcuts, message: display.error.message }), jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(AskOnDiscord_1.AskOnDiscord, { canHaveKeyboardShortcuts: keyboardShortcuts }), onRetry ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
92
99
  jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(Retry_1.RetryButton, { onClick: onRetry, label: calculateMetadata ? 'Retry calculateMetadata()' : 'Retry' })
93
100
  ] })) : null, calculateMetadata ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
@@ -97,7 +104,7 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
97
104
  ] })) : null, display.stackFrames.length > 0 ? (jsx_runtime_1.jsx("div", { style: stack, className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, children: display.stackFrames.map((s, i) => {
98
105
  return (jsx_runtime_1.jsx(StackFrame_1.StackElement
99
106
  // eslint-disable-next-line react/no-array-index-key
100
- , { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)' }, i));
107
+ , { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)', editorId: canOpenInEditor ? defaultEditorId : null }, i));
101
108
  }) })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
102
109
  jsx_runtime_1.jsx("pre", { "aria-label": "Unsymbolicated stack trace", className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, style: rawStack, children: (_a = display.error.stack) !== null && _a !== void 0 ? _a : 'Check the Terminal and browser console for error messages.' }), symbolicationFailure ? (jsx_runtime_1.jsx("div", { style: symbolicationFailureStyle, children: symbolicationFailure })) : null] }))] }));
103
110
  };
@@ -1,6 +1,8 @@
1
- import type { SymbolicatedStackFrame } from '@remotion/studio-shared';
1
+ import type { EditorPickerId, SymbolicatedStackFrame } from '@remotion/studio-shared';
2
2
  import React from 'react';
3
3
  export declare const OpenInEditor: React.FC<{
4
4
  readonly stack: SymbolicatedStackFrame;
5
5
  readonly canHaveKeyboardShortcuts: boolean;
6
+ readonly editorId: EditorPickerId;
7
+ readonly editorName: string;
6
8
  }>;
@@ -31,7 +31,7 @@ const reducer = (state, action) => {
31
31
  }
32
32
  return state;
33
33
  };
34
- const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
34
+ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts, editorId, editorName }) => {
35
35
  const isMounted = (0, react_1.useRef)(true);
36
36
  const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
37
37
  const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
@@ -42,7 +42,7 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
42
42
  }, []);
43
43
  const openInBrowser = (0, react_1.useCallback)(() => {
44
44
  dispatch({ type: 'start' });
45
- (0, open_in_editor_1.openInEditor)(stack, null)
45
+ (0, open_in_editor_1.openInEditor)(stack, editorId)
46
46
  .then((data) => {
47
47
  if (data.success) {
48
48
  dispatchIfMounted({ type: 'succeed' });
@@ -60,7 +60,7 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
60
60
  dispatchIfMounted({ type: 'reset' });
61
61
  }, 2000);
62
62
  });
63
- }, [dispatchIfMounted, stack]);
63
+ }, [dispatchIfMounted, editorId, stack]);
64
64
  (0, react_1.useEffect)(() => {
65
65
  return () => {
66
66
  isMounted.current = false;
@@ -89,15 +89,15 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
89
89
  case 'error':
90
90
  return 'Failed to open';
91
91
  case 'idle':
92
- return `Open in ${window.remotion_editorName}`;
92
+ return `Open in ${editorName}`;
93
93
  case 'success':
94
- return `Opened in ${window.remotion_editorName}`;
94
+ return `Opened in ${editorName}`;
95
95
  case 'load':
96
96
  return `Opening...`;
97
97
  default:
98
98
  throw new Error('invalid state');
99
99
  }
100
- }, [state.type]);
100
+ }, [editorName, state.type]);
101
101
  return (jsx_runtime_1.jsxs(Button_1.Button, { onClick: openInBrowser, disabled: state.type !== 'idle', children: [label, canHaveKeyboardShortcuts ? (jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "o", cmdOrCtrl: true })) : null] }));
102
102
  };
103
103
  exports.OpenInEditor = OpenInEditor;
@@ -5,6 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const menu_toolbar_height_1 = require("../../components/menu-toolbar-height");
8
+ const SettingsContext_1 = require("../../components/SettingsContext");
9
+ const client_id_1 = require("../../helpers/client-id");
8
10
  const colors_1 = require("../../helpers/colors");
9
11
  const keybindings_1 = require("../../state/keybindings");
10
12
  const ErrorLoader_1 = require("./ErrorLoader");
@@ -41,17 +43,17 @@ const Overlay = () => {
41
43
  if (errors.errors.length === 0) {
42
44
  return null;
43
45
  }
44
- return (jsx_runtime_1.jsx(keybindings_1.KeybindingContextProvider, { children: jsx_runtime_1.jsx(remotion_1.AbsoluteFill, { style: {
45
- backgroundColor: BACKGROUND_COLOR,
46
- overflow: 'auto',
47
- color: colors_1.WHITE,
48
- top: menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT,
49
- height: `calc(100% - ${menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT}px)`,
50
- }, children: errors.errors.map((err, i) => {
51
- var _a;
52
- return (jsx_runtime_1.jsx(ErrorLoader_1.ErrorLoader
53
- // eslint-disable-next-line react/no-array-index-key
54
- , { keyboardShortcuts: i === 0, error: err, onRetry: null, canHaveDismissButton: true, calculateMetadata: false }, ((_a = err.stack) !== null && _a !== void 0 ? _a : '') + i));
55
- }) }) }));
46
+ return (jsx_runtime_1.jsx(client_id_1.PreviewServerConnection, { children: jsx_runtime_1.jsx(SettingsContext_1.SettingsProvider, { children: jsx_runtime_1.jsx(keybindings_1.KeybindingContextProvider, { children: jsx_runtime_1.jsx(remotion_1.Internals.AbsoluteFillElement, { style: {
47
+ backgroundColor: BACKGROUND_COLOR,
48
+ overflow: 'auto',
49
+ color: colors_1.WHITE,
50
+ top: menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT,
51
+ height: `calc(100% - ${menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT}px)`,
52
+ }, children: errors.errors.map((err, i) => {
53
+ var _a;
54
+ return (jsx_runtime_1.jsx(ErrorLoader_1.ErrorLoader
55
+ // eslint-disable-next-line react/no-array-index-key
56
+ , { keyboardShortcuts: i === 0, error: err, onRetry: null, canHaveDismissButton: true, calculateMetadata: false }, ((_a = err.stack) !== null && _a !== void 0 ? _a : '') + i));
57
+ }) }) }) }) }));
56
58
  };
57
59
  exports.Overlay = Overlay;
@@ -1,8 +1,9 @@
1
- import type { SymbolicatedStackFrame } from '@remotion/studio-shared';
1
+ import type { EditorPickerId, SymbolicatedStackFrame } from '@remotion/studio-shared';
2
2
  import React from 'react';
3
3
  export declare const StackElement: React.FC<{
4
4
  readonly s: SymbolicatedStackFrame;
5
5
  readonly lineNumberWidth: number;
6
6
  readonly isFirst: boolean;
7
7
  readonly defaultFunctionName: string;
8
+ readonly editorId: EditorPickerId | null;
8
9
  }>;
@@ -34,7 +34,7 @@ const fnName = {
34
34
  lineHeight: 1.5,
35
35
  marginBottom: 3,
36
36
  };
37
- const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
37
+ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName, editorId }) => {
38
38
  var _a;
39
39
  const [showCodeFrame, setShowCodeFrame] = (0, react_1.useState)(() => {
40
40
  var _a, _b;
@@ -43,16 +43,19 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
43
43
  isFirst;
44
44
  });
45
45
  const [locationHovered, setLocationHovered] = (0, react_1.useState)(false);
46
- const canOpenFileLocation = Boolean(window.remotion_editorName && s.originalFileName);
46
+ const canOpenFileLocation = Boolean(editorId && s.originalFileName);
47
47
  const onOpenFileLocation = (0, react_1.useCallback)(() => {
48
48
  if (!canOpenFileLocation) {
49
49
  return;
50
50
  }
51
- (0, open_in_editor_1.openInEditor)(s, null).catch((err) => {
51
+ if (!editorId) {
52
+ return;
53
+ }
54
+ (0, open_in_editor_1.openInEditor)(s, editorId).catch((err) => {
52
55
  // eslint-disable-next-line no-console
53
56
  console.log('Could not open in editor', err);
54
57
  });
55
- }, [canOpenFileLocation, s]);
58
+ }, [canOpenFileLocation, editorId, s]);
56
59
  const toggleCodeFrame = (0, react_1.useCallback)(() => {
57
60
  setShowCodeFrame((f) => !f);
58
61
  }, []);