@remotion/studio 4.0.517 → 4.0.519

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 (146) hide show
  1. package/dist/components/AppLaunchButton.d.ts +16 -0
  2. package/dist/components/AppLaunchButton.js +90 -0
  3. package/dist/components/AssetSelector.js +64 -22
  4. package/dist/components/AssetSelectorItem.d.ts +14 -1
  5. package/dist/components/AssetSelectorItem.js +219 -70
  6. package/dist/components/Button.js +20 -7
  7. package/dist/components/Canvas.js +109 -78
  8. package/dist/components/CanvasOrLoading.js +7 -7
  9. package/dist/components/CaptionTextEditor.js +32 -8
  10. package/dist/components/CodingAgentButton.d.ts +7 -0
  11. package/dist/components/CodingAgentButton.js +59 -0
  12. package/dist/components/CompositionContextButton.d.ts +1 -0
  13. package/dist/components/CompositionContextButton.js +7 -3
  14. package/dist/components/CompositionSelector.js +16 -11
  15. package/dist/components/CompositionSelectorItem.js +16 -23
  16. package/dist/components/ConfigureLicenseModal.js +4 -48
  17. package/dist/components/CurrentAsset.js +1 -1
  18. package/dist/components/EditorContent.js +6 -3
  19. package/dist/components/ElementInstallConfirmation.d.ts +25 -7
  20. package/dist/components/ElementInstallConfirmation.js +347 -30
  21. package/dist/components/ElementLibraryModal.js +3 -1
  22. package/dist/components/FixComputedValueModal.js +5 -131
  23. package/dist/components/InitialCompositionLoader.js +3 -2
  24. package/dist/components/InlineCaptionInspector.js +13 -2
  25. package/dist/components/InspectorOpenInEditor.js +48 -33
  26. package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
  27. package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
  28. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
  29. package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
  30. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
  31. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
  32. package/dist/components/InspectorPanel/common.js +1 -0
  33. package/dist/components/InspectorPanel/styles.js +1 -0
  34. package/dist/components/InspectorSequenceSection.js +8 -3
  35. package/dist/components/InspectorSourceLocation.js +5 -1
  36. package/dist/components/KnownBugs.d.ts +1 -1
  37. package/dist/components/KnownBugs.js +1 -1
  38. package/dist/components/LicenseExplanation.d.ts +2 -0
  39. package/dist/components/LicenseExplanation.js +63 -0
  40. package/dist/components/MenuToolbar.js +7 -1
  41. package/dist/components/Modals.js +50 -2
  42. package/dist/components/NewComposition/InputDragger.js +29 -2
  43. package/dist/components/NewComposition/NewCompDuration.js +1 -1
  44. package/dist/components/NewComposition/NewComposition.d.ts +23 -0
  45. package/dist/components/NewComposition/NewComposition.js +217 -80
  46. package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
  47. package/dist/components/PlaybackRateSelector.js +2 -5
  48. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.d.ts +2 -0
  49. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +28 -7
  50. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +21 -13
  51. package/dist/components/RenderQueue/actions.d.ts +1 -0
  52. package/dist/components/RenderQueue/actions.js +5 -1
  53. package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
  54. package/dist/components/SelectedOutlineElement.js +2 -1
  55. package/dist/components/SelectedOutlineOverlay.js +9 -10
  56. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  57. package/dist/components/SelectedOutlinePolygon.js +12 -4
  58. package/dist/components/SelectedOutlineRenderer.d.ts +1 -1
  59. package/dist/components/SelectedOutlineRenderer.js +33 -35
  60. package/dist/components/SettingsContext.js +2 -1
  61. package/dist/components/SettingsModal.d.ts +1 -1
  62. package/dist/components/SettingsModal.js +19 -3
  63. package/dist/components/SidebarRenderButton.d.ts +1 -0
  64. package/dist/components/SidebarRenderButton.js +15 -5
  65. package/dist/components/Timeline/SequencePropsObserver.js +29 -14
  66. package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
  67. package/dist/components/Timeline/TimelineRowChrome.js +4 -2
  68. package/dist/components/Timeline/TimelineSequence.js +40 -8
  69. package/dist/components/Timeline/TimelineSequenceItem.js +34 -1
  70. package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
  71. package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
  72. package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
  73. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
  74. package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
  75. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
  76. package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
  77. package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
  78. package/dist/components/TimelineCombobox.js +1 -0
  79. package/dist/components/UpdateCheck.d.ts +0 -8
  80. package/dist/components/UpdateCheck.js +7 -54
  81. package/dist/components/UpdateStatusContext.d.ts +18 -0
  82. package/dist/components/UpdateStatusContext.js +74 -0
  83. package/dist/components/UpdatesSettings.d.ts +2 -0
  84. package/dist/components/UpdatesSettings.js +251 -0
  85. package/dist/components/WebMcp.d.ts +2 -0
  86. package/dist/components/WebMcp.js +945 -0
  87. package/dist/components/composition-menu-items.js +26 -0
  88. package/dist/components/get-open-in-menu-items.d.ts +4 -0
  89. package/dist/components/get-open-in-menu-items.js +28 -24
  90. package/dist/components/root-composition-menu-items.d.ts +4 -1
  91. package/dist/components/root-composition-menu-items.js +38 -1
  92. package/dist/components/selected-outline-measurement.d.ts +11 -0
  93. package/dist/components/selected-outline-measurement.js +13 -5
  94. package/dist/components/use-configure-default-apps.d.ts +1 -0
  95. package/dist/components/use-configure-default-apps.js +24 -0
  96. package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
  97. package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
  98. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
  99. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +1 -1
  100. package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
  101. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
  102. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
  103. package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
  104. package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
  105. package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
  106. package/dist/esm/{chunk-gzqm3g2m.js → chunk-1fkq5bfq.js} +24093 -21093
  107. package/dist/esm/chunk-6jf1natv.js +25 -0
  108. package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
  109. package/dist/esm/chunk-m0jqdbkr.js +14571 -0
  110. package/dist/esm/index.mjs +0 -2
  111. package/dist/esm/internals.mjs +43231 -25675
  112. package/dist/esm/previewEntry.mjs +46334 -28776
  113. package/dist/esm/renderEntry.mjs +6 -3
  114. package/dist/helpers/can-show-updates.d.ts +5 -0
  115. package/dist/helpers/can-show-updates.js +7 -0
  116. package/dist/helpers/colors.d.ts +0 -3
  117. package/dist/helpers/colors.js +2 -5
  118. package/dist/helpers/create-folder-tree.d.ts +5 -0
  119. package/dist/helpers/create-folder-tree.js +40 -2
  120. package/dist/helpers/format-file-location.d.ts +8 -0
  121. package/dist/helpers/format-file-location.js +14 -3
  122. package/dist/helpers/get-asset-metadata.js +1 -1
  123. package/dist/helpers/get-git-menu-item.d.ts +5 -0
  124. package/dist/helpers/get-git-menu-item.js +15 -1
  125. package/dist/helpers/get-timeline-max-zoom.d.ts +8 -0
  126. package/dist/helpers/get-timeline-max-zoom.js +17 -6
  127. package/dist/helpers/hoverable.d.ts +1 -0
  128. package/dist/helpers/hoverable.js +14 -6
  129. package/dist/helpers/open-in-editor.js +51 -1
  130. package/dist/helpers/preview-server-events.js +3 -0
  131. package/dist/helpers/timeline-layout.d.ts +0 -1
  132. package/dist/helpers/timeline-layout.js +1 -5
  133. package/dist/helpers/url-state.d.ts +1 -0
  134. package/dist/helpers/url-state.js +12 -5
  135. package/dist/icons/enter.d.ts +4 -0
  136. package/dist/icons/enter.js +10 -0
  137. package/dist/renderEntry.js +2 -0
  138. package/dist/state/folders.d.ts +3 -0
  139. package/dist/state/folders.js +40 -1
  140. package/dist/state/modals.d.ts +1 -6
  141. package/dist/state/playbackrate.d.ts +1 -0
  142. package/dist/state/playbackrate.js +4 -1
  143. package/package.json +17 -14
  144. package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
  145. package/dist/components/UpdateModal/UpdateModal.js +0 -104
  146. /package/dist/components/{UpdateModal/OpenIssueButton.d.ts → OpenIssueButton.d.ts} +0 -0
@@ -7,10 +7,16 @@ const open_in_editor_1 = require("../helpers/open-in-editor");
7
7
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
8
8
  const open_in_new_window_1 = require("./open-in-new-window");
9
9
  const getCompositionMenuItems = ({ composition, connectionStatus, resolvedLocation, setSelectedModal, closeMenu, readOnlyStudio, includeCompositionManagementItems, editorId, editorName, }) => {
10
+ var _a;
10
11
  const fileLocation = (0, format_file_location_1.formatFileLocation)({
11
12
  location: resolvedLocation,
12
13
  root: window.remotion_cwd,
13
14
  });
15
+ const contextForAgents = (0, format_file_location_1.formatContextForAgents)({
16
+ location: resolvedLocation,
17
+ name: (_a = composition === null || composition === void 0 ? void 0 : composition.id) !== null && _a !== void 0 ? _a : null,
18
+ root: window.remotion_cwd,
19
+ });
14
20
  const showInEditorDisabled = !editorId ||
15
21
  !composition ||
16
22
  connectionStatus !== 'connected' ||
@@ -154,6 +160,26 @@ const getCompositionMenuItems = ({ composition, connectionStatus, resolvedLocati
154
160
  id: 'copy-actions-divider',
155
161
  }
156
162
  : null,
163
+ {
164
+ id: 'copy-context-for-agents',
165
+ keyHint: null,
166
+ label: `Copy context for agents`,
167
+ leftItem: null,
168
+ onClick: () => {
169
+ closeMenu();
170
+ if (!contextForAgents) {
171
+ return;
172
+ }
173
+ navigator.clipboard.writeText(contextForAgents).catch((err) => {
174
+ (0, NotificationCenter_1.showNotification)(`Could not copy to clipboard: ${err.message}`, 1000);
175
+ });
176
+ },
177
+ quickSwitcherLabel: null,
178
+ subMenu: null,
179
+ type: 'item',
180
+ value: 'copy-context-for-agents',
181
+ disabled: !contextForAgents,
182
+ },
157
183
  {
158
184
  id: 'copy-file-location',
159
185
  keyHint: null,
@@ -2,6 +2,10 @@ import type { TerminalId } from '@remotion/studio-shared';
2
2
  import type { EditorPickerId, GetDefaultCodingAgentInfoResponse, GetDefaultEditorInfoResponse } from '@remotion/studio-shared';
3
3
  import type { OriginalPosition } from '../error-overlay/react-overlay/utils/get-source-map';
4
4
  import type { ComboboxValue } from './NewComposition/ComboBox';
5
+ export declare const getConfigureDefaultAppsMenuItems: ({ hasPreviousItems, onConfigureApps, }: {
6
+ readonly hasPreviousItems: boolean;
7
+ readonly onConfigureApps: (() => void) | null;
8
+ }) => ComboboxValue[];
5
9
  export declare const getOpenInMenuItems: ({ codingAgentInfo, editorDisabled, editorInfo, excludeCodingAgentId, excludeEditorId, fileManagerDisabled, folder, location, onConfigureApps, onOpenInCodingAgent, onOpenInEditor, onOpenInFileExplorer, onOpenInGitClient, onOpenInTerminal, }: {
6
10
  readonly codingAgentInfo: GetDefaultCodingAgentInfoResponse | null;
7
11
  readonly editorDisabled: boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOpenInMenuItems = void 0;
3
+ exports.getOpenInMenuItems = exports.getConfigureDefaultAppsMenuItems = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const no_react_1 = require("remotion/no-react");
6
6
  const get_file_manager_name_1 = require("../helpers/get-file-manager-name");
@@ -17,6 +17,28 @@ const menuLabel = {
17
17
  fontSize: 13,
18
18
  lineHeight: '16px',
19
19
  };
20
+ const getConfigureDefaultAppsMenuItems = ({ hasPreviousItems, onConfigureApps, }) => {
21
+ if (!onConfigureApps) {
22
+ return [];
23
+ }
24
+ return [
25
+ ...(hasPreviousItems
26
+ ? [{ type: 'divider', id: 'open-in-settings-divider' }]
27
+ : []),
28
+ {
29
+ id: 'change-default-apps',
30
+ keyHint: null,
31
+ label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Configure default apps..." }),
32
+ leftItem: null,
33
+ onClick: onConfigureApps,
34
+ quickSwitcherLabel: null,
35
+ subMenu: null,
36
+ type: 'item',
37
+ value: 'change-default-apps',
38
+ },
39
+ ];
40
+ };
41
+ exports.getConfigureDefaultAppsMenuItems = getConfigureDefaultAppsMenuItems;
20
42
  const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, excludeCodingAgentId, excludeEditorId, fileManagerDisabled, folder, location, onConfigureApps, onOpenInCodingAgent, onOpenInEditor, onOpenInFileExplorer, onOpenInGitClient, onOpenInTerminal, }) => {
21
43
  var _a, _b, _c, _d;
22
44
  const showFinder = window.remotion_fileSystemPlatform === 'darwin';
@@ -61,13 +83,7 @@ const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, exclu
61
83
  label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "GitHub.com" }),
62
84
  leftItem: jsx_runtime_1.jsx(github_1.GitHubIcon, { size: 18 }),
63
85
  onClick: () => {
64
- const gitSource = window.remotion_gitSource;
65
- if (!gitSource) {
66
- return;
67
- }
68
- window.open(folder || !location
69
- ? (0, get_git_menu_item_1.getGitSourceBranchUrl)(gitSource)
70
- : (0, get_git_menu_item_1.getGitRefUrl)(gitSource, location, window.remotion_cwd), '_blank');
86
+ (0, get_git_menu_item_1.openGitSource)({ folder, location });
71
87
  },
72
88
  quickSwitcherLabel: null,
73
89
  subMenu: null,
@@ -174,22 +190,10 @@ const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, exclu
174
190
  ...systemApps,
175
191
  ]
176
192
  : []),
177
- ...(onConfigureApps && (hasCategorizedApps || systemApps.length > 0)
178
- ? [{ type: 'divider', id: 'open-in-settings-divider' }]
179
- : []),
180
- onConfigureApps
181
- ? {
182
- id: 'change-default-apps',
183
- keyHint: null,
184
- label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Change default apps..." }),
185
- leftItem: null,
186
- onClick: onConfigureApps,
187
- quickSwitcherLabel: null,
188
- subMenu: null,
189
- type: 'item',
190
- value: 'change-default-apps',
191
- }
192
- : null,
193
+ ...(0, exports.getConfigureDefaultAppsMenuItems)({
194
+ hasPreviousItems: hasCategorizedApps || systemApps.length > 0,
195
+ onConfigureApps,
196
+ }),
193
197
  ].filter(no_react_1.NoReactInternals.truthy);
194
198
  };
195
199
  exports.getOpenInMenuItems = getOpenInMenuItems;
@@ -1,8 +1,11 @@
1
1
  import type { SetStateAction } from 'react';
2
+ import type { CompositionSortOrder } from '../state/folders';
2
3
  import type { ModalState } from '../state/modals';
3
4
  import type { ComboboxValue } from './NewComposition/ComboBox';
4
- export declare const getRootCompositionMenuItems: ({ connectionStatus, readOnlyStudio, setSelectedModal, }: {
5
+ export declare const getRootCompositionMenuItems: ({ connectionStatus, readOnlyStudio, setSelectedModal, compositionSortOrder, setCompositionSortOrder, }: {
5
6
  connectionStatus: "connected" | "disconnected" | "init";
6
7
  readOnlyStudio: boolean;
7
8
  setSelectedModal: (value: SetStateAction<ModalState | null>) => void;
9
+ compositionSortOrder: CompositionSortOrder;
10
+ setCompositionSortOrder: (sortOrder: CompositionSortOrder) => void;
8
11
  }) => ComboboxValue[];
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRootCompositionMenuItems = void 0;
4
- const getRootCompositionMenuItems = ({ connectionStatus, readOnlyStudio, setSelectedModal, }) => {
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Checkmark_1 = require("../icons/Checkmark");
6
+ const getRootCompositionMenuItems = ({ connectionStatus, readOnlyStudio, setSelectedModal, compositionSortOrder, setCompositionSortOrder, }) => {
5
7
  return [
6
8
  {
7
9
  id: 'new-root-composition',
@@ -41,6 +43,41 @@ const getRootCompositionMenuItems = ({ connectionStatus, readOnlyStudio, setSele
41
43
  value: 'new-root-folder',
42
44
  disabled: readOnlyStudio || connectionStatus !== 'connected',
43
45
  },
46
+ {
47
+ id: 'sort-compositions-divider',
48
+ type: 'divider',
49
+ },
50
+ {
51
+ id: 'sort-compositions-header',
52
+ label: 'Sort',
53
+ type: 'section-header',
54
+ },
55
+ {
56
+ id: 'sort-compositions-registration',
57
+ keyHint: null,
58
+ label: 'As registered',
59
+ leftItem: compositionSortOrder === 'registration' ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
60
+ onClick: () => {
61
+ setCompositionSortOrder('registration');
62
+ },
63
+ quickSwitcherLabel: 'Sort compositions as registered',
64
+ subMenu: null,
65
+ type: 'item',
66
+ value: 'registration',
67
+ },
68
+ {
69
+ id: 'sort-compositions-alphabetical',
70
+ keyHint: null,
71
+ label: 'Alphabetically',
72
+ leftItem: compositionSortOrder === 'alphabetical' ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
73
+ onClick: () => {
74
+ setCompositionSortOrder('alphabetical');
75
+ },
76
+ quickSwitcherLabel: 'Sort compositions alphabetically',
77
+ subMenu: null,
78
+ type: 'item',
79
+ value: 'alphabetical',
80
+ },
44
81
  ];
45
82
  };
46
83
  exports.getRootCompositionMenuItems = getRootCompositionMenuItems;
@@ -80,5 +80,16 @@ export declare const getSequencesWithSelectableOutlines: ({ sequences, overrideI
80
80
  readonly timelinePosition: number;
81
81
  }) => SequenceWithSelectedOutline[];
82
82
  export declare const measureOutlines: (container: SVGSVGElement, targets: readonly SelectedOutlineLayoutTarget[], hoveredTimelineNodePathKey: string | null) => SelectedOutline[];
83
+ export declare const measureOutlineTargets: (container: Element, targets: readonly {
84
+ readonly crop: {
85
+ readonly left: number;
86
+ readonly right: number;
87
+ readonly top: number;
88
+ readonly bottom: number;
89
+ };
90
+ readonly includeOutsideContainer: boolean;
91
+ readonly key: string;
92
+ readonly ref: import("react").RefObject<Element | null>;
93
+ }[]) => SelectedOutline[];
83
94
  export declare const outlinesAreEqual: (a: readonly SelectedOutline[], b: readonly SelectedOutline[]) => boolean;
84
95
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.outlinesAreEqual = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedRotationInfo = exports.getSelectedTransformOriginInfo = exports.getSelectedCropInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.cropOutlinePoints = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
3
+ exports.outlinesAreEqual = exports.measureOutlineTargets = exports.measureOutlines = exports.getSequencesWithSelectableOutlines = exports.getSelectedRotationInfo = exports.getSelectedTransformOriginInfo = exports.getSelectedCropInfo = exports.getSelectedEffectFieldsBySequenceKey = exports.getOutlineSelectionInteraction = exports.getSequenceKeysContainingSelection = exports.getSelectedSequenceKeys = exports.cropOutlinePoints = exports.getTransformedSvgViewportPoints = exports.getSelectedOutlineRotationPivot = exports.getSelectedOutlineRotationCornerInfo = exports.getRotationCursor = exports.getSelectedOutlineRotationDeltaDegrees = exports.getAngleDegrees = exports.vectorBetween = exports.vectorLength = exports.dot = exports.getOutlineCenter = exports.midpoint = exports.pointToString = void 0;
4
4
  const calculate_timeline_1 = require("../helpers/calculate-timeline");
5
5
  const colors_1 = require("../helpers/colors");
6
6
  const get_box_quads_polyfill_internals_js_1 = require("../helpers/get-box-quads-polyfill-internals.js");
@@ -420,6 +420,16 @@ const getSequencesWithSelectableOutlines = ({ sequences, overrideIdsToNodePaths,
420
420
  };
421
421
  exports.getSequencesWithSelectableOutlines = getSequencesWithSelectableOutlines;
422
422
  const measureOutlines = (container, targets, hoveredTimelineNodePathKey) => {
423
+ return (0, exports.measureOutlineTargets)(container, targets.map((target) => ({
424
+ crop: target.crop,
425
+ includeOutsideContainer: target.showSelectedOutline ||
426
+ (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(target.nodePathInfo.sequenceSubscriptionKey) === hoveredTimelineNodePathKey,
427
+ key: target.key,
428
+ ref: target.ref,
429
+ })));
430
+ };
431
+ exports.measureOutlines = measureOutlines;
432
+ const measureOutlineTargets = (container, targets) => {
423
433
  // Reuse shared ancestor geometry within this synchronous batch only.
424
434
  (0, get_box_quads_polyfill_internals_js_1.useCache)();
425
435
  const containerRect = container.getBoundingClientRect();
@@ -429,9 +439,7 @@ const measureOutlines = (container, targets, hoveredTimelineNodePathKey) => {
429
439
  if (element === null) {
430
440
  continue;
431
441
  }
432
- const includeOutsideContainer = target.showSelectedOutline ||
433
- (0, timeline_node_path_key_1.timelineSequenceNodePathToKey)(target.nodePathInfo.sequenceSubscriptionKey) === hoveredTimelineNodePathKey;
434
- const uncroppedPoints = getElementOutlinePoints(element, containerRect, includeOutsideContainer);
442
+ const uncroppedPoints = getElementOutlinePoints(element, containerRect, target.includeOutsideContainer);
435
443
  if (uncroppedPoints === null) {
436
444
  continue;
437
445
  }
@@ -455,7 +463,7 @@ const measureOutlines = (container, targets, hoveredTimelineNodePathKey) => {
455
463
  }
456
464
  return outlines;
457
465
  };
458
- exports.measureOutlines = measureOutlines;
466
+ exports.measureOutlineTargets = measureOutlineTargets;
459
467
  const outlinesAreEqual = (a, b) => {
460
468
  var _a, _b, _c, _d;
461
469
  if (a.length !== b.length) {
@@ -0,0 +1 @@
1
+ export declare const useConfigureDefaultApps: () => (() => void) | null;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useConfigureDefaultApps = void 0;
4
+ const react_1 = require("react");
5
+ const client_id_1 = require("../helpers/client-id");
6
+ const modals_1 = require("../state/modals");
7
+ const use_default_editor_info_1 = require("./use-default-editor-info");
8
+ const useConfigureDefaultApps = () => {
9
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
10
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
11
+ const configureDefaultApps = (0, react_1.useCallback)(() => {
12
+ var _a;
13
+ var _b;
14
+ setSelectedModal({
15
+ type: 'settings',
16
+ initialTab: 'apps',
17
+ initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
18
+ });
19
+ }, [setSelectedModal]);
20
+ return (0, use_default_editor_info_1.canUseEditorPicker)(previewServerState.type === 'connected')
21
+ ? configureDefaultApps
22
+ : null;
23
+ };
24
+ exports.useConfigureDefaultApps = useConfigureDefaultApps;
@@ -11,6 +11,7 @@ const container = {
11
11
  };
12
12
  const frame = {
13
13
  backgroundColor: colors_1.ERROR_CODE_FRAME_BACKGROUND,
14
+ borderRadius: 6,
14
15
  marginBottom: 20,
15
16
  overflowY: 'auto',
16
17
  };
@@ -32,16 +33,14 @@ const CodeFrame = ({ source, lineNumberWidth }) => {
32
33
  return (jsx_runtime_1.jsxs("div", { style: container, children: [
33
34
  jsx_runtime_1.jsx("div", { style: {
34
35
  ...lineNumber,
35
- backgroundColor: s.highlight
36
- ? colors_1.WHITE
37
- : colors_1.ERROR_CODE_FRAME_LINE_BACKGROUND,
38
- color: s.highlight ? colors_1.BLACK : colors_1.WHITE_ALPHA_60,
36
+ backgroundColor: colors_1.ERROR_CODE_FRAME_LINE_BACKGROUND,
37
+ color: s.highlight ? colors_1.WHITE : colors_1.WHITE_ALPHA_40,
39
38
  }, children: String(s.lineNumber).padStart(lineNumberWidth, ' ') }), jsx_runtime_1.jsx("div", { style: {
40
39
  fontFamily: 'monospace',
41
40
  whiteSpace: 'pre',
42
41
  tabSize: 2,
43
- color: s.highlight ? colors_1.WHITE : colors_1.WHITE_ALPHA_60,
44
- backgroundColor: s.highlight ? colors_1.BLUE : colors_1.TRANSPARENT,
42
+ color: s.highlight ? colors_1.WHITE : colors_1.WHITE_ALPHA_40,
43
+ backgroundColor: colors_1.TRANSPARENT,
45
44
  lineHeight: 1.7,
46
45
  paddingRight: 12,
47
46
  paddingLeft: 12,
@@ -25,7 +25,7 @@ const CopyStackTrace = ({ errorText }) => {
25
25
  if (copyState === 'failed') {
26
26
  return 'Failed!';
27
27
  }
28
- return 'Copy Stacktrace';
28
+ return 'Copy stack';
29
29
  }, [copyState]);
30
30
  return jsx_runtime_1.jsx(Button_1.Button, { onClick: handleCopyToClipboard, children: label });
31
31
  };
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const studio_shared_1 = require("@remotion/studio-shared");
6
6
  const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
+ const CodingAgentButton_1 = require("../../components/CodingAgentButton");
8
9
  const layout_1 = require("../../components/layout");
9
10
  const is_menu_item_1 = require("../../components/Menu/is-menu-item");
10
11
  const use_default_editor_info_1 = require("../../components/use-default-editor-info");
@@ -23,11 +24,12 @@ const SearchGitHubIssues_1 = require("./SearchGitHubIssues");
23
24
  const StackFrame_1 = require("./StackFrame");
24
25
  const stack = {
25
26
  marginTop: 17,
26
- overflowX: 'scroll',
27
- marginBottom: '10vh',
27
+ overflowX: 'hidden',
28
+ marginBottom: 14,
28
29
  };
29
30
  const rawStack = {
30
31
  backgroundColor: colors_1.ERROR_CODE_FRAME_BACKGROUND,
32
+ borderRadius: 6,
31
33
  boxSizing: 'border-box',
32
34
  color: colors_1.WHITE,
33
35
  fontFamily: 'monospace',
@@ -45,18 +47,44 @@ const symbolicationFailureStyle = {
45
47
  fontFamily: 'SF Pro Text, sans-serif',
46
48
  fontSize: 14,
47
49
  lineHeight: 1.5,
48
- marginBottom: '10vh',
50
+ marginBottom: 14,
49
51
  marginTop: 24,
50
52
  };
51
53
  const spacer = {
52
54
  width: 5,
53
55
  display: 'inline-block',
54
56
  };
57
+ const actionRow = {
58
+ alignItems: 'center',
59
+ display: 'flex',
60
+ flexWrap: 'wrap',
61
+ marginLeft: 4,
62
+ marginTop: -10,
63
+ };
64
+ const codingAgentButton = {
65
+ marginLeft: 1,
66
+ marginRight: 5,
67
+ };
55
68
  const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButton, calculateMetadata, symbolicationFailure, }) => {
56
69
  var _a;
57
70
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
58
71
  const { canOpenInEditor, defaultEditorId, defaultEditorName } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
59
- const highestLineNumber = Math.max(0, ...display.stackFrames
72
+ const stackFrames = (0, react_1.useMemo)(() => {
73
+ const withoutReactInternals = display.stackFrames.filter((frame) => {
74
+ var _a;
75
+ var _b;
76
+ const fileName = `/${(_b = (_a = frame.originalFileName) === null || _a === void 0 ? void 0 : _a.replaceAll('\\', '/')) !== null && _b !== void 0 ? _b : ''}`;
77
+ return ![
78
+ '/node_modules/react/',
79
+ '/node_modules/react-dom/',
80
+ '/node_modules/scheduler/',
81
+ ].some((packagePath) => fileName.includes(packagePath));
82
+ });
83
+ return withoutReactInternals.length > 0
84
+ ? withoutReactInternals
85
+ : display.stackFrames.slice(0, 1);
86
+ }, [display.stackFrames]);
87
+ const highestLineNumber = Math.max(0, ...stackFrames
60
88
  .map((s) => s.originalScriptCode)
61
89
  .flat(1)
62
90
  .map((s) => {
@@ -79,29 +107,30 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
79
107
  const helpLink = (0, get_help_link_1.getHelpLink)(message);
80
108
  const errorTextForCopy = (0, react_1.useMemo)(() => {
81
109
  const header = `${display.error.name}: ${message}`;
82
- if (display.stackFrames.length > 0) {
83
- const stackLines = display.stackFrames
110
+ if (stackFrames.length > 0) {
111
+ const stackLines = stackFrames
84
112
  .map((frame) => `at ${frame.originalFunctionName || '<anonymous>'} (${frame.originalFileName || 'unknown'}:${frame.originalLineNumber || '?'}:${frame.originalColumnNumber || '?'})`)
85
113
  .join('\n');
86
114
  return `${header}\n${stackLines}`;
87
115
  }
88
116
  return display.error.stack || header;
89
- }, [display.stackFrames, display.error, message]);
117
+ }, [display.error, message, stackFrames]);
118
+ const fixWithAgentPrompt = `Fix this error in my Remotion project:\n\n${errorTextForCopy}`;
90
119
  return (jsx_runtime_1.jsxs("div", { children: [
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: [
92
- jsx_runtime_1.jsx(HelpLink_1.HelpLink, { link: helpLink, canHaveKeyboardShortcuts: keyboardShortcuts }), 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 })
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: [
99
- jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(Retry_1.RetryButton, { onClick: onRetry, label: calculateMetadata ? 'Retry calculateMetadata()' : 'Retry' })
100
- ] })) : null, calculateMetadata ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
120
+ jsx_runtime_1.jsx(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: display.error.name, message: message, canHaveDismissButton: canHaveDismissButton }), jsx_runtime_1.jsxs("div", { style: actionRow, children: [helpLink ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
121
+ jsx_runtime_1.jsx(HelpLink_1.HelpLink, { link: helpLink, canHaveKeyboardShortcuts: keyboardShortcuts }), jsx_runtime_1.jsx("div", { style: spacer })
122
+ ] })) : null, stackFrames.length > 0 &&
123
+ canOpenInEditor &&
124
+ defaultEditorId &&
125
+ defaultEditorName ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
126
+ jsx_runtime_1.jsx(OpenInEditor_1.OpenInEditor, { canHaveKeyboardShortcuts: keyboardShortcuts, editorId: defaultEditorId, editorName: defaultEditorName, stack: stackFrames[0] }), jsx_runtime_1.jsx("div", { style: spacer })
127
+ ] })) : null, jsx_runtime_1.jsx(CodingAgentButton_1.CodingAgentButton, { label: "Fix with", prompt: fixWithAgentPrompt, size: "default", style: codingAgentButton }), 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: [
128
+ jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(Retry_1.RetryButton, { onClick: onRetry, label: calculateMetadata ? 'Retry calculateMetadata()' : 'Retry' })
129
+ ] })) : null] }), calculateMetadata ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
101
130
  jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx(layout_1.Spacing, { y: 0.5 }), jsx_runtime_1.jsx(CalculateMetadataErrorExplainer_1.CalculateMetadataErrorExplainer, {})
102
131
  ] })) : null, display.error instanceof remotion_1.MediaPlaybackError ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
103
132
  jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx(layout_1.Spacing, { y: 0.5 }), jsx_runtime_1.jsx(MediaPlaybackErrorExplainer_1.MediaPlaybackErrorExplainer, { src: display.error.src })
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) => {
133
+ ] })) : null, stackFrames.length > 0 ? (jsx_runtime_1.jsx("div", { style: stack, className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, children: stackFrames.map((s, i) => {
105
134
  return (jsx_runtime_1.jsx(StackFrame_1.StackElement
106
135
  // eslint-disable-next-line react/no-array-index-key
107
136
  , { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)', editorId: canOpenInEditor ? defaultEditorId : null }, i));
@@ -17,7 +17,7 @@ const container = {
17
17
  marginLeft: 'auto',
18
18
  marginRight: 'auto',
19
19
  fontFamily: 'SF Pro Text, sans-serif',
20
- paddingTop: '5vh',
20
+ paddingTop: 14,
21
21
  boxSizing: 'border-box',
22
22
  };
23
23
  const shouldLogError = (error) => {
@@ -15,6 +15,7 @@ const title = {
15
15
  };
16
16
  const left = {
17
17
  flex: 1,
18
+ paddingLeft: 14,
18
19
  paddingRight: 14,
19
20
  fontWeight: 'bold',
20
21
  maxWidth: '100%',
@@ -35,10 +36,10 @@ const spacer = {
35
36
  const ErrorTitle = ({ name, message, symbolicating, canHaveDismissButton }) => {
36
37
  return (jsx_runtime_1.jsxs("div", { style: title, className: "css-reset", children: [
37
38
  jsx_runtime_1.jsxs("div", { style: left, children: [
38
- jsx_runtime_1.jsx("span", { style: errName, children: name }), jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsxs("div", { style: row, children: [symbolicating ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
39
- jsx_runtime_1.jsx(Symbolicating_1.Symbolicating, {}), jsx_runtime_1.jsx("div", { style: spacer })
40
- ] })) : null, jsx_runtime_1.jsx(ErrorMessage_1.ErrorMessage, { message: message })
41
- ] })
39
+ jsx_runtime_1.jsxs("div", { style: row, children: [
40
+ jsx_runtime_1.jsx("span", { style: errName, children: name }), symbolicating ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
41
+ jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(Symbolicating_1.Symbolicating, {})
42
+ ] })) : null] }), jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsx(ErrorMessage_1.ErrorMessage, { message: message }) })
42
43
  ] }), (0, react_overlay_1.didUnmountReactApp)() ? null : canHaveDismissButton ? (jsx_runtime_1.jsx(DismissButton_1.DismissButton, {})) : null] }));
43
44
  };
44
45
  exports.ErrorTitle = ErrorTitle;
@@ -3,101 +3,73 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OpenInEditor = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const Button_1 = require("../../components/Button");
6
+ const AppLaunchButton_1 = require("../../components/AppLaunchButton");
7
+ const NotificationCenter_1 = require("../../components/Notifications/NotificationCenter");
8
+ const SettingsContext_1 = require("../../components/SettingsContext");
9
+ const use_configure_default_apps_1 = require("../../components/use-configure-default-apps");
7
10
  const open_in_editor_1 = require("../../helpers/open-in-editor");
8
11
  const use_keybinding_1 = require("../../helpers/use-keybinding");
12
+ const editor_1 = require("../../icons/editor");
9
13
  const ShortcutHint_1 = require("./ShortcutHint");
10
- const initialState = { type: 'idle' };
11
- const reducer = (state, action) => {
12
- if (action.type === 'start') {
13
- return {
14
- type: 'load',
15
- };
16
- }
17
- if (action.type === 'fail') {
18
- return {
19
- type: 'error',
20
- };
21
- }
22
- if (action.type === 'reset') {
23
- return {
24
- type: 'idle',
25
- };
26
- }
27
- if (action.type === 'succeed') {
28
- return {
29
- type: 'success',
30
- };
31
- }
32
- return state;
14
+ const menuLabel = {
15
+ color: 'inherit',
16
+ fontFamily: 'sans-serif',
17
+ fontSize: 13,
18
+ lineHeight: '16px',
33
19
  };
34
20
  const OpenInEditor = ({ stack, canHaveKeyboardShortcuts, editorId, editorName }) => {
35
- const isMounted = (0, react_1.useRef)(true);
36
- const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
21
+ const { editorInfo } = (0, SettingsContext_1.useSettings)();
22
+ const configureDefaultApps = (0, use_configure_default_apps_1.useConfigureDefaultApps)();
37
23
  const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
38
- const dispatchIfMounted = (0, react_1.useCallback)((payload) => {
39
- if (isMounted.current === false)
40
- return;
41
- dispatch(payload);
42
- }, []);
43
- const openInBrowser = (0, react_1.useCallback)(() => {
44
- dispatch({ type: 'start' });
45
- (0, open_in_editor_1.openInEditor)(stack, editorId)
46
- .then((data) => {
47
- if (data.success) {
48
- dispatchIfMounted({ type: 'succeed' });
49
- }
50
- else {
51
- dispatchIfMounted({ type: 'fail' });
24
+ const openWithEditor = (0, react_1.useCallback)(async (selectedEditorId, selectedEditorName) => {
25
+ try {
26
+ const response = await (0, open_in_editor_1.openInEditor)(stack, selectedEditorId);
27
+ if (!response.success) {
28
+ (0, NotificationCenter_1.showNotification)(`Could not open ${selectedEditorName}`, 2000);
52
29
  }
53
- })
54
- .catch((err) => {
55
- dispatchIfMounted({ type: 'fail' });
56
- console.log('Could not open browser', err);
57
- })
58
- .finally(() => {
59
- setTimeout(() => {
60
- dispatchIfMounted({ type: 'reset' });
61
- }, 2000);
62
- });
63
- }, [dispatchIfMounted, editorId, stack]);
64
- (0, react_1.useEffect)(() => {
65
- return () => {
66
- isMounted.current = false;
67
- };
68
- }, []);
30
+ }
31
+ catch (err) {
32
+ (0, NotificationCenter_1.showNotification)(err.message, 2000);
33
+ }
34
+ }, [stack]);
35
+ const openPreferredEditor = (0, react_1.useCallback)(() => {
36
+ openWithEditor(editorId, editorName).catch(() => undefined);
37
+ }, [editorId, editorName, openWithEditor]);
69
38
  (0, react_1.useEffect)(() => {
70
39
  if (!canHaveKeyboardShortcuts) {
71
40
  return;
72
41
  }
73
- const onEditor = () => {
74
- openInBrowser();
75
- };
76
42
  const { unregister } = registerKeybinding({
77
43
  event: 'keydown',
78
44
  key: 'o',
79
- callback: onEditor,
45
+ callback: openPreferredEditor,
80
46
  commandCtrlKey: true,
81
47
  preventDefault: true,
82
48
  triggerIfInputFieldFocused: false,
83
49
  keepRegisteredWhenNotHighestContext: false,
84
50
  });
85
51
  return () => unregister();
86
- }, [canHaveKeyboardShortcuts, openInBrowser, registerKeybinding]);
87
- const label = (0, react_1.useMemo)(() => {
88
- switch (state.type) {
89
- case 'error':
90
- return 'Failed to open';
91
- case 'idle':
92
- return `Open in ${editorName}`;
93
- case 'success':
94
- return `Opened in ${editorName}`;
95
- case 'load':
96
- return `Opening...`;
97
- default:
98
- throw new Error('invalid state');
99
- }
100
- }, [editorName, state.type]);
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] }));
52
+ }, [canHaveKeyboardShortcuts, openPreferredEditor, registerKeybinding]);
53
+ const menuItems = (0, react_1.useMemo)(() => {
54
+ var _a;
55
+ const alternativeEditors = ((_a = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors) !== null && _a !== void 0 ? _a : []).filter((editor) => editor.id !== editorId);
56
+ const editorItems = alternativeEditors.map((editor) => ({
57
+ id: `open-in-${editor.id}`,
58
+ keyHint: null,
59
+ label: jsx_runtime_1.jsx("span", { style: menuLabel, children: editor.nameWithType }),
60
+ leftItem: jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: editor.id, size: 18 }),
61
+ onClick: () => {
62
+ openWithEditor(editor.id, editor.nameWithType).catch(() => undefined);
63
+ },
64
+ quickSwitcherLabel: null,
65
+ subMenu: null,
66
+ type: 'item',
67
+ value: editor.id,
68
+ }));
69
+ return editorItems;
70
+ }, [editorId, editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors, openWithEditor]);
71
+ return (jsx_runtime_1.jsxs(AppLaunchButton_1.AppLaunchButton, { actionButtonId: "error-overlay-open-in-editor", ariaLabel: `Open in ${editorName}`, disabled: false, menuAriaLabel: "Open in another app", menuButtonId: "error-overlay-open-in-another-app", menuItems: menuItems, onConfigureApps: configureDefaultApps, onClick: openPreferredEditor, size: "default", style: null, title: `Open in ${editorName}`, children: [
72
+ jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: editorId, size: 14 }),
73
+ "Open in ", editorName, canHaveKeyboardShortcuts ? (jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "o", cmdOrCtrl: true })) : null] }));
102
74
  };
103
75
  exports.OpenInEditor = OpenInEditor;