@remotion/studio 4.0.525 → 4.0.527

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 (195) hide show
  1. package/dist/api/focus-default-props-path.js +7 -1
  2. package/dist/api/restart-studio.d.ts +1 -1
  3. package/dist/api/restart-studio.js +1 -1
  4. package/dist/components/AgentPrompt.d.ts +6 -0
  5. package/dist/components/AgentPrompt.js +107 -0
  6. package/dist/components/AssetFileIcon.js +2 -0
  7. package/dist/components/AssetSelectorItem.d.ts +1 -23
  8. package/dist/components/AssetSelectorItem.js +10 -200
  9. package/dist/components/Canvas.js +109 -44
  10. package/dist/components/CanvasCaptureDropHandler.js +63 -0
  11. package/dist/components/CanvasOrLoading.js +10 -2
  12. package/dist/components/CaptionInspector.js +9 -3
  13. package/dist/{error-overlay/remotion-overlay → components}/CodeFrame.d.ts +2 -0
  14. package/dist/components/CodeFrame.js +77 -0
  15. package/dist/components/CompositionSelectorItem.js +7 -17
  16. package/dist/components/CurrentAsset.js +6 -4
  17. package/dist/components/ElementInstallConfirmation.js +69 -38
  18. package/dist/components/FilePreview.js +4 -0
  19. package/dist/components/FixComputedValueModal.js +64 -96
  20. package/dist/components/GenerateWithAgentModal.d.ts +9 -0
  21. package/dist/components/GenerateWithAgentModal.js +39 -0
  22. package/dist/components/InitialCompositionLoader.js +1 -1
  23. package/dist/components/InlineDropdown.js +26 -2
  24. package/dist/components/InlineEditableTitle.js +3 -0
  25. package/dist/components/InspectorOpenInEditor.js +8 -4
  26. package/dist/components/InspectorPanel/CollapsibleInspectorSection.d.ts +7 -0
  27. package/dist/components/InspectorPanel/CollapsibleInspectorSection.js +14 -0
  28. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +1 -1
  29. package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +20 -8
  30. package/dist/components/InspectorPanel/CompositionInspector.js +32 -15
  31. package/dist/components/InspectorPanel/CompositionMetadata.js +7 -0
  32. package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +6 -12
  33. package/dist/components/InspectorPanel/ElementLibraryButton.js +2 -0
  34. package/dist/components/InspectorPanel/GuideInspector.js +2 -3
  35. package/dist/components/InspectorPanel/KeyframeSettings.js +5 -6
  36. package/dist/components/InspectorPanel/MultiSequenceInspector.js +34 -2
  37. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +45 -4
  38. package/dist/components/InspectorPanel/common.d.ts +4 -0
  39. package/dist/components/InspectorPanel/common.js +15 -2
  40. package/dist/components/InspectorPanel/styles.d.ts +0 -3
  41. package/dist/components/InspectorPanel/styles.js +3 -27
  42. package/dist/components/InspectorPanel/use-composition-actions.d.ts +2 -0
  43. package/dist/components/InspectorPanel/use-composition-actions.js +16 -0
  44. package/dist/components/InspectorPanel/use-inspector-section-expanded.d.ts +1 -0
  45. package/dist/components/InspectorPanel/use-inspector-section-expanded.js +21 -0
  46. package/dist/components/InspectorSequenceSection.js +44 -35
  47. package/dist/components/InspectorSourceLocation.js +4 -0
  48. package/dist/components/KeyboardShortcutsSettings.js +12 -4
  49. package/dist/components/LutPreview.d.ts +4 -0
  50. package/dist/components/LutPreview.js +192 -0
  51. package/dist/components/MenuBuildIndicator.js +1 -0
  52. package/dist/components/MenuCompositionName.js +4 -9
  53. package/dist/components/Modals.js +3 -6
  54. package/dist/components/ModelsSettings.js +15 -4
  55. package/dist/components/NewComposition/CancelButton.js +1 -1
  56. package/dist/components/Notifications/NotificationCenter.d.ts +0 -1
  57. package/dist/components/Notifications/NotificationCenter.js +1 -22
  58. package/dist/components/Preview.js +3 -0
  59. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
  60. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
  61. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +4 -9
  62. package/dist/components/RadioButton.js +1 -0
  63. package/dist/components/RenderModal/DataEditor.js +4 -1
  64. package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.d.ts +1 -0
  65. package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.js +2 -1
  66. package/dist/components/RenderModal/WebRenderModal.js +10 -2
  67. package/dist/components/RenderQueue/CaptionQueueItem.js +5 -2
  68. package/dist/components/RenderQueue/CaptionQueueProcessor.js +35 -8
  69. package/dist/components/RenderQueue/VideoMattingQueueItem.js +1 -0
  70. package/dist/components/RenderQueue/caption-job-types.d.ts +6 -0
  71. package/dist/components/RenderQueue/index.js +1 -0
  72. package/dist/components/RendersTab.js +4 -0
  73. package/dist/components/SelectedOutlineElement.js +6 -0
  74. package/dist/components/SelectedOutlineSnapIndicators.d.ts +6 -0
  75. package/dist/components/SelectedOutlineSnapIndicators.js +16 -12
  76. package/dist/components/SequencePropsSubscriptionProvider.d.ts +3 -0
  77. package/dist/components/SequencePropsSubscriptionProvider.js +8 -6
  78. package/dist/components/SettingsButton.js +11 -2
  79. package/dist/components/SettingsModal.d.ts +1 -2
  80. package/dist/components/SettingsModal.js +24 -6
  81. package/dist/components/SettingsModalFooter.js +17 -3
  82. package/dist/components/SkillsSettings.d.ts +5 -0
  83. package/dist/components/SkillsSettings.js +29 -26
  84. package/dist/components/Timeline/Timeline.js +10 -11
  85. package/dist/components/Timeline/TimelineAssetField.js +81 -51
  86. package/dist/components/Timeline/TimelineDeleteKeybindings.js +6 -9
  87. package/dist/components/Timeline/TimelineEffectItem.js +1 -0
  88. package/dist/components/Timeline/TimelineExpandArrowButton.js +1 -0
  89. package/dist/components/Timeline/TimelineExpandedRow.js +1 -0
  90. package/dist/components/Timeline/TimelineFieldLabel.js +1 -0
  91. package/dist/components/Timeline/TimelineHeightContainer.js +11 -1
  92. package/dist/components/Timeline/TimelineKeyframeControls.js +16 -1
  93. package/dist/components/Timeline/TimelineLayerChildren.d.ts +3 -3
  94. package/dist/components/Timeline/TimelineLayerChildren.js +11 -9
  95. package/dist/components/Timeline/TimelineLayerEye.d.ts +1 -1
  96. package/dist/components/Timeline/TimelineLayerEye.js +6 -3
  97. package/dist/components/Timeline/TimelineList.js +9 -3
  98. package/dist/components/Timeline/TimelineSchemaField.js +2 -6
  99. package/dist/components/Timeline/TimelineSelection.d.ts +14 -3
  100. package/dist/components/Timeline/TimelineSelection.js +91 -49
  101. package/dist/components/Timeline/TimelineSequence.js +28 -2
  102. package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
  103. package/dist/components/Timeline/TimelineSequenceItem.d.ts +2 -0
  104. package/dist/components/Timeline/TimelineSequenceItem.js +45 -13
  105. package/dist/components/Timeline/TimelineViewport.d.ts +1 -0
  106. package/dist/components/Timeline/TimelineViewport.js +10 -1
  107. package/dist/components/Timeline/TimelineVirtualization.d.ts +3 -3
  108. package/dist/components/Timeline/delete-selected-timeline-item.js +2 -2
  109. package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -2
  110. package/dist/components/Timeline/get-sequence-context-menu-items.js +143 -46
  111. package/dist/components/Timeline/normalize-font-weight-for-keyframe.d.ts +1 -0
  112. package/dist/components/Timeline/normalize-font-weight-for-keyframe.js +19 -0
  113. package/dist/components/Timeline/split-selected-timeline-item.d.ts +13 -10
  114. package/dist/components/Timeline/split-selected-timeline-item.js +58 -35
  115. package/dist/components/Timeline/timeline-display-groups.d.ts +9 -0
  116. package/dist/components/Timeline/timeline-display-groups.js +66 -0
  117. package/dist/components/Timeline/use-timeline-asset-drop.js +21 -21
  118. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
  119. package/dist/components/Timeline/use-timeline-expanded-tree.js +1 -2
  120. package/dist/components/TimelineCombobox.js +1 -0
  121. package/dist/components/Transcription/TranscriptionModal.js +16 -11
  122. package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +1 -1
  123. package/dist/components/UpdateStatusContext.d.ts +2 -2
  124. package/dist/components/UpdateStatusContext.js +6 -7
  125. package/dist/components/UpdatesSettings.js +6 -6
  126. package/dist/components/WebMcp.js +41 -41
  127. package/dist/components/asset-context-menu.d.ts +32 -0
  128. package/dist/components/asset-context-menu.js +242 -0
  129. package/dist/components/composition-drop-preview.d.ts +9 -2
  130. package/dist/components/composition-drop-preview.js +7 -4
  131. package/dist/components/composition-menu-items.d.ts +4 -6
  132. package/dist/components/composition-menu-items.js +191 -75
  133. package/dist/components/delete-jsx-nodes-api.d.ts +2 -0
  134. package/dist/components/{delete-jsx-node-api.js → delete-jsx-nodes-api.js} +5 -5
  135. package/dist/components/get-open-in-menu-items.d.ts +6 -5
  136. package/dist/components/get-open-in-menu-items.js +22 -16
  137. package/dist/components/keyboard-shortcuts.d.ts +4 -4
  138. package/dist/components/keyboard-shortcuts.js +3 -1
  139. package/dist/components/public-output-name.d.ts +1 -0
  140. package/dist/components/public-output-name.js +7 -3
  141. package/dist/components/selected-outline-order.js +18 -12
  142. package/dist/components/use-open-in-menu-apps.d.ts +14 -0
  143. package/dist/components/use-open-in-menu-apps.js +33 -0
  144. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +2 -2
  145. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +1 -0
  146. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +3 -3
  147. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +5 -1
  148. package/dist/error-overlay/remotion-overlay/StackFrame.js +26 -19
  149. package/dist/esm/{CaptionQueueProcessor-k0yrm3dj.mjs → CaptionQueueProcessor-npa6szn1.mjs} +39 -8
  150. package/dist/esm/{LazyModels-gfmpcy4h.mjs → LazyModels-nh3c8h9p.mjs} +4 -3
  151. package/dist/esm/{LazyModels-m1rf06wh.mjs → LazyModels-rr5v8h5y.mjs} +4 -3
  152. package/dist/esm/{TranscriptionModal-8pvrehg4.mjs → TranscriptionModal-79m5wgcj.mjs} +25 -17
  153. package/dist/esm/{VideoMattingModal-fefbzgka.mjs → VideoMattingModal-31pew0xj.mjs} +9 -6
  154. package/dist/esm/index-21hxsfaa.mjs +239 -0
  155. package/dist/esm/{index-s848rffx.mjs → index-4zen9prq.mjs} +5438 -4686
  156. package/dist/esm/index-5t2dwxsk.mjs +530 -0
  157. package/dist/esm/{index-vsxrxfpj.mjs → index-614tdz2q.mjs} +1 -1
  158. package/dist/esm/{index-0x13f28h.mjs → index-9xxg6218.mjs} +20 -541
  159. package/dist/esm/{index-hbezgbbq.mjs → index-ac5550e7.mjs} +1 -1
  160. package/dist/esm/{index-41kqns5c.mjs → index-e855w59j.mjs} +15 -92
  161. package/dist/esm/{index-tzxb8808.mjs → index-n5gmcvhz.mjs} +8 -8
  162. package/dist/esm/{index-ggqpre9v.mjs → index-ppspzgn9.mjs} +4963 -4178
  163. package/dist/esm/{index-jrw61pkj.mjs → index-r0ejh5sy.mjs} +1 -1
  164. package/dist/esm/index-r1gr3j3a.mjs +80 -0
  165. package/dist/esm/{index-mww32xc8.mjs → index-s7qa3xbw.mjs} +6 -4
  166. package/dist/esm/{index-1089795y.mjs → index-vxwg66ar.mjs} +7 -22
  167. package/dist/esm/index.mjs +13 -6
  168. package/dist/esm/internals.mjs +10 -7
  169. package/dist/esm/previewEntry.mjs +10 -7
  170. package/dist/esm/{resolve-composition-component-location-bt2d6qxq.mjs → resolve-composition-component-location-qrp05g62.mjs} +1 -1
  171. package/dist/helpers/client-id.d.ts +1 -0
  172. package/dist/helpers/client-id.js +8 -4
  173. package/dist/helpers/copy-text.js +1 -16
  174. package/dist/helpers/cube-lut.d.ts +12 -0
  175. package/dist/helpers/cube-lut.js +160 -0
  176. package/dist/helpers/get-preview-file-type.d.ts +1 -1
  177. package/dist/helpers/get-preview-file-type.js +3 -0
  178. package/dist/helpers/hoverable.js +2 -1
  179. package/dist/helpers/open-in-editor.d.ts +5 -2
  180. package/dist/helpers/open-in-editor.js +13 -5
  181. package/dist/helpers/settings-tab-availability.d.ts +14 -0
  182. package/dist/helpers/settings-tab-availability.js +35 -0
  183. package/dist/helpers/studio-runtime-config.d.ts +1 -1
  184. package/dist/helpers/use-keybinding.d.ts +1 -1
  185. package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
  186. package/dist/helpers/use-menu-structure.js +31 -21
  187. package/dist/icons/lut.d.ts +4 -0
  188. package/dist/icons/lut.js +6 -0
  189. package/dist/icons/sparkles.d.ts +4 -0
  190. package/dist/icons/sparkles.js +6 -0
  191. package/dist/state/modals.d.ts +17 -2
  192. package/dist/state/timeline-zoom.js +4 -0
  193. package/package.json +19 -19
  194. package/dist/components/delete-jsx-node-api.d.ts +0 -2
  195. package/dist/error-overlay/remotion-overlay/CodeFrame.js +0 -62
@@ -44,9 +44,7 @@ const getOutlineBounds = (outline) => {
44
44
  minY: Math.min(...ys),
45
45
  };
46
46
  };
47
- const outlineBoundsOverlap = (a, b) => {
48
- const aBounds = getOutlineBounds(a);
49
- const bBounds = getOutlineBounds(b);
47
+ const outlineBoundsOverlap = (aBounds, bBounds) => {
50
48
  return (aBounds.minX <= bBounds.maxX + outlineBoundsOverlapTolerance &&
51
49
  aBounds.maxX + outlineBoundsOverlapTolerance >= bBounds.minX &&
52
50
  aBounds.minY <= bBounds.maxY + outlineBoundsOverlapTolerance &&
@@ -177,13 +175,26 @@ const orderOutlineGroup = ({ outlines, parentBySequenceId, targetsByKey, }) => {
177
175
  // For unrelated overlapping outlines, put broader hit targets below
178
176
  // smaller ones so a large selected sequence cannot swallow clicks on
179
177
  // a more specific element in the same canvas area.
178
+ const bounds = outlines.map(getOutlineBounds);
179
+ const areas = outlines.map(getOutlineHitArea);
180
180
  for (let i = 0; i < outlines.length; i++) {
181
+ const a = outlines[i];
182
+ const aTarget = targetsByKey.get(a.key);
183
+ if (aTarget === undefined) {
184
+ continue;
185
+ }
181
186
  for (let j = i + 1; j < outlines.length; j++) {
182
- const a = outlines[i];
187
+ if (!outlineBoundsOverlap(bounds[i], bounds[j])) {
188
+ continue;
189
+ }
190
+ const aArea = areas[i];
191
+ const bArea = areas[j];
192
+ if (Math.abs(aArea - bArea) <= outlineAreaEqualityTolerance) {
193
+ continue;
194
+ }
183
195
  const b = outlines[j];
184
- const aTarget = targetsByKey.get(a.key);
185
196
  const bTarget = targetsByKey.get(b.key);
186
- if (aTarget === undefined || bTarget === undefined) {
197
+ if (bTarget === undefined) {
187
198
  continue;
188
199
  }
189
200
  const aAncestorOfB = isAncestorTarget({
@@ -196,12 +207,7 @@ const orderOutlineGroup = ({ outlines, parentBySequenceId, targetsByKey, }) => {
196
207
  descendant: aTarget,
197
208
  parentBySequenceId,
198
209
  });
199
- if (aAncestorOfB || bAncestorOfA || !outlineBoundsOverlap(a, b)) {
200
- continue;
201
- }
202
- const aArea = getOutlineHitArea(a);
203
- const bArea = getOutlineHitArea(b);
204
- if (Math.abs(aArea - bArea) <= outlineAreaEqualityTolerance) {
210
+ if (aAncestorOfB || bAncestorOfA) {
205
211
  continue;
206
212
  }
207
213
  if (aArea > bArea) {
@@ -0,0 +1,14 @@
1
+ import type { EditorPickerId, GetDefaultCodingAgentInfoResponse, GetDefaultEditorInfoResponse } from '@remotion/studio-shared';
2
+ export type OpenInMenuApps = {
3
+ readonly canOpenDesktopApps: boolean;
4
+ readonly canOpenInEditor: boolean;
5
+ readonly codingAgentInfo: GetDefaultCodingAgentInfoResponse | null;
6
+ readonly defaultEditorId: EditorPickerId | null;
7
+ readonly defaultEditorName: string | null;
8
+ readonly editorInfo: GetDefaultEditorInfoResponse | null;
9
+ readonly onConfigureApps: (() => void) | null;
10
+ };
11
+ export declare const useOpenInMenuApps: () => {
12
+ connectionStatus: "connected" | "disconnected" | "init";
13
+ openInApps: OpenInMenuApps;
14
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useOpenInMenuApps = void 0;
4
+ const react_1 = require("react");
5
+ const client_id_1 = require("../helpers/client-id");
6
+ const use_configure_default_apps_1 = require("./use-configure-default-apps");
7
+ const use_default_editor_info_1 = require("./use-default-editor-info");
8
+ const useOpenInMenuApps = () => {
9
+ const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
10
+ .previewServerState.type;
11
+ const { canConfigureApps, canOpenInEditor, defaultEditorId, defaultEditorName, editorInfo, } = (0, use_default_editor_info_1.useEditorOpening)(connectionStatus === 'connected');
12
+ const codingAgentInfo = (0, use_default_editor_info_1.useDefaultCodingAgentInfo)(canConfigureApps);
13
+ const onConfigureApps = (0, use_configure_default_apps_1.useConfigureDefaultApps)();
14
+ const openInApps = (0, react_1.useMemo)(() => ({
15
+ canOpenDesktopApps: canConfigureApps,
16
+ canOpenInEditor,
17
+ codingAgentInfo,
18
+ defaultEditorId,
19
+ defaultEditorName,
20
+ editorInfo,
21
+ onConfigureApps,
22
+ }), [
23
+ canOpenInEditor,
24
+ canConfigureApps,
25
+ codingAgentInfo,
26
+ defaultEditorId,
27
+ defaultEditorName,
28
+ editorInfo,
29
+ onConfigureApps,
30
+ ]);
31
+ return { connectionStatus, openInApps };
32
+ };
33
+ exports.useOpenInMenuApps = useOpenInMenuApps;
@@ -123,7 +123,7 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
123
123
  canOpenInEditor &&
124
124
  defaultEditorId &&
125
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 })
126
+ jsx_runtime_1.jsx(OpenInEditor_1.OpenInEditor, { canHaveKeyboardShortcuts: keyboardShortcuts, editorId: defaultEditorId, editorName: defaultEditorName, size: "default", stack: stackFrames[0] }), jsx_runtime_1.jsx("div", { style: spacer })
127
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
128
  jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(Retry_1.RetryButton, { onClick: onRetry, label: calculateMetadata ? 'Retry calculateMetadata()' : 'Retry' })
129
129
  ] })) : null] }), calculateMetadata ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
@@ -133,7 +133,7 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
133
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) => {
134
134
  return (jsx_runtime_1.jsx(StackFrame_1.StackElement
135
135
  // eslint-disable-next-line react/no-array-index-key
136
- , { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)', editorId: canOpenInEditor ? defaultEditorId : null }, i));
136
+ , { collapsible: true, isFirst: i === 0, s: s, fontSize: 14, headerAction: null, horizontalSpacing: 14, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)', editorId: canOpenInEditor ? defaultEditorId : null }, i));
137
137
  }) })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
138
138
  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] }))] }));
139
139
  };
@@ -5,4 +5,5 @@ export declare const OpenInEditor: React.FC<{
5
5
  readonly canHaveKeyboardShortcuts: boolean;
6
6
  readonly editorId: EditorPickerId;
7
7
  readonly editorName: string;
8
+ readonly size: 'compact' | 'default';
8
9
  }>;
@@ -17,7 +17,7 @@ const menuLabel = {
17
17
  fontSize: 13,
18
18
  lineHeight: '16px',
19
19
  };
20
- const OpenInEditor = ({ stack, canHaveKeyboardShortcuts, editorId, editorName }) => {
20
+ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts, editorId, editorName, size }) => {
21
21
  const { editorInfo } = (0, SettingsContext_1.useSettings)();
22
22
  const configureDefaultApps = (0, use_configure_default_apps_1.useConfigureDefaultApps)();
23
23
  const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
@@ -68,8 +68,8 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts, editorId, editorName })
68
68
  }));
69
69
  return editorItems;
70
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 }),
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: size, style: null, title: `Open in ${editorName}`, children: [
72
+ jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: editorId, size: size === 'default' ? 14 : 18 }),
73
73
  "Open in ", editorName, canHaveKeyboardShortcuts ? (jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "o", cmdOrCtrl: true })) : null] }));
74
74
  };
75
75
  exports.OpenInEditor = OpenInEditor;
@@ -4,6 +4,10 @@ export declare const StackElement: React.FC<{
4
4
  readonly s: SymbolicatedStackFrame;
5
5
  readonly lineNumberWidth: number;
6
6
  readonly isFirst: boolean;
7
- readonly defaultFunctionName: string;
7
+ readonly defaultFunctionName: string | null;
8
8
  readonly editorId: EditorPickerId | null;
9
+ readonly collapsible: boolean;
10
+ readonly fontSize: number;
11
+ readonly horizontalSpacing: number;
12
+ readonly headerAction: React.ReactNode;
9
13
  }>;
@@ -4,22 +4,20 @@ exports.StackElement = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const Button_1 = require("../../components/Button");
7
+ const CodeFrame_1 = require("../../components/CodeFrame");
7
8
  const colors_1 = require("../../helpers/colors");
9
+ const hoverable_1 = require("../../helpers/hoverable");
8
10
  const open_in_editor_1 = require("../../helpers/open-in-editor");
9
11
  const caret_1 = require("../../icons/caret");
10
- const CodeFrame_1 = require("./CodeFrame");
11
12
  const format_location_1 = require("./format-location");
12
13
  const location = {
13
14
  color: colors_1.LIGHT_TEXT,
14
15
  fontFamily: 'monospace',
15
- fontSize: 14,
16
16
  overflowWrap: 'anywhere',
17
17
  };
18
18
  const header = {
19
- paddingLeft: 14,
20
19
  paddingTop: 10,
21
20
  paddingBottom: 10,
22
- paddingRight: 14,
23
21
  display: 'flex',
24
22
  flexDirection: 'row',
25
23
  alignItems: 'center',
@@ -30,11 +28,10 @@ const left = {
30
28
  minWidth: 0,
31
29
  };
32
30
  const fnName = {
33
- fontSize: 14,
34
31
  lineHeight: 1.5,
35
32
  marginBottom: 3,
36
33
  };
37
- const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName, editorId }) => {
34
+ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName, editorId, collapsible, fontSize, horizontalSpacing, headerAction, }) => {
38
35
  var _a;
39
36
  const [showCodeFrame, setShowCodeFrame] = (0, react_1.useState)(() => {
40
37
  var _a, _b;
@@ -42,7 +39,6 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName, editor
42
39
  !((_b = s.originalFileName) === null || _b === void 0 ? void 0 : _b.startsWith('webpack/'))) ||
43
40
  isFirst;
44
41
  });
45
- const [locationHovered, setLocationHovered] = (0, react_1.useState)(false);
46
42
  const canOpenFileLocation = Boolean(editorId && s.originalFileName);
47
43
  const onOpenFileLocation = (0, react_1.useCallback)(() => {
48
44
  if (!canOpenFileLocation) {
@@ -59,26 +55,37 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName, editor
59
55
  const toggleCodeFrame = (0, react_1.useCallback)(() => {
60
56
  setShowCodeFrame((f) => !f);
61
57
  }, []);
58
+ const functionName = (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName;
59
+ const shouldShowCodeFrame = collapsible ? showCodeFrame : true;
62
60
  return (jsx_runtime_1.jsxs("div", { className: "css-reset", children: [
63
61
  jsx_runtime_1.jsxs("div", { style: {
64
62
  ...header,
65
- borderBottom: showCodeFrame ? 'none' : colors_1.BORDER_WHITE_ALPHA_12,
63
+ borderBottom: shouldShowCodeFrame ? 'none' : colors_1.BORDER_WHITE_ALPHA_12,
64
+ paddingLeft: horizontalSpacing,
65
+ paddingRight: horizontalSpacing,
66
66
  }, children: [
67
- jsx_runtime_1.jsxs("div", { style: left, children: [
68
- jsx_runtime_1.jsx("div", { style: fnName, children: (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName }), s.originalFileName ? (jsx_runtime_1.jsx("div", { style: location, children: canOpenFileLocation ? (jsx_runtime_1.jsxs("span", { onClick: onOpenFileLocation, onPointerEnter: () => {
69
- setLocationHovered(true);
70
- }, onPointerLeave: () => {
71
- setLocationHovered(false);
72
- }, style: {
67
+ jsx_runtime_1.jsxs("div", { style: left, children: [functionName === null ? null : (jsx_runtime_1.jsx("div", { style: { ...fnName, fontSize }, children: functionName })), s.originalFileName ? (jsx_runtime_1.jsx("div", { style: { ...location, fontSize }, children: canOpenFileLocation ? (jsx_runtime_1.jsxs("button", { type: "button", className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: onOpenFileLocation, style: {
73
68
  ...location,
74
- color: locationHovered ? colors_1.WHITE : colors_1.LIGHT_TEXT,
75
- cursor: 'pointer',
76
- }, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) })) : null] }), s.originalScriptCode && s.originalScriptCode.length > 0 ? (jsx_runtime_1.jsx(Button_1.Button, { onClick: toggleCodeFrame, children: jsx_runtime_1.jsx("div", { style: {
69
+ ...(0, hoverable_1.hoverableStyle)({
70
+ idleBackground: colors_1.TRANSPARENT,
71
+ hoverBackground: colors_1.TRANSPARENT,
72
+ idleColor: colors_1.LIGHT_TEXT,
73
+ hoverColor: colors_1.WHITE,
74
+ }),
75
+ appearance: 'none',
76
+ border: 'none',
77
+ color: undefined,
78
+ cursor: 'default',
79
+ fontSize,
80
+ padding: 0,
81
+ }, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) })) : null] }), headerAction, collapsible &&
82
+ s.originalScriptCode &&
83
+ s.originalScriptCode.length > 0 ? (jsx_runtime_1.jsx(Button_1.Button, { onClick: toggleCodeFrame, children: jsx_runtime_1.jsx("div", { style: {
77
84
  display: 'flex',
78
- transform: showCodeFrame ? undefined : 'rotate(-90deg)',
85
+ transform: shouldShowCodeFrame ? undefined : 'rotate(-90deg)',
79
86
  }, children: jsx_runtime_1.jsx(caret_1.CaretDown, {}) }) })) : null] }), jsx_runtime_1.jsx("div", { children: s.originalScriptCode &&
80
87
  s.originalScriptCode.length > 0 &&
81
- showCodeFrame ? (jsx_runtime_1.jsx(CodeFrame_1.CodeFrame, { lineNumberWidth: lineNumberWidth, source: s.originalScriptCode })) : null })
88
+ shouldShowCodeFrame ? (jsx_runtime_1.jsx(CodeFrame_1.CodeFrame, { fontSize: fontSize, horizontalMargin: horizontalSpacing, lineNumberWidth: lineNumberWidth, source: s.originalScriptCode })) : null })
82
89
  ] }));
83
90
  };
84
91
  exports.StackElement = StackElement;
@@ -1,12 +1,22 @@
1
1
  import {
2
2
  loadModelForJob
3
3
  } from "./index-v4tr1bft.mjs";
4
+ import {
5
+ installRequiredPackages
6
+ } from "./index-21hxsfaa.mjs";
4
7
  import {
5
8
  RenderQueueContext
6
9
  } from "./index-9x6e1dq0.mjs";
7
10
  import {
11
+ callApi
12
+ } from "./index-r1gr3j3a.mjs";
13
+ import {
14
+ getBrowserStudioOperations,
8
15
  writeStaticFile
9
16
  } from "./index-cw0pnpg5.mjs";
17
+ import"./index-9xxg6218.mjs";
18
+ import"./index-5zrb1ft4.mjs";
19
+ import"./index-k426ye99.mjs";
10
20
  import"./index-rcv7qkt5.mjs";
11
21
 
12
22
  // src/components/RenderQueue/CaptionQueueProcessor.tsx
@@ -179,14 +189,35 @@ var CaptionQueueProcessor = () => {
179
189
  const { captions } = toCaptions({
180
190
  whisperWebGpuOutput: transcription
181
191
  });
182
- updateCaptionJobProgress(job.id, {
183
- message: `Saving ${job.outName}...`,
184
- value: 0.95
185
- });
186
- await writeStaticFile({
187
- contents: JSON.stringify(captions, null, 2),
188
- filePath: job.outName
189
- });
192
+ if (job.target === null) {
193
+ updateCaptionJobProgress(job.id, {
194
+ message: `Saving ${job.outName}...`,
195
+ value: 0.95
196
+ });
197
+ await writeStaticFile({
198
+ contents: JSON.stringify(captions, null, 2),
199
+ filePath: job.outName
200
+ });
201
+ } else {
202
+ updateCaptionJobProgress(job.id, {
203
+ message: "Adding Basic captions...",
204
+ value: 0.95
205
+ });
206
+ await installRequiredPackages([
207
+ { name: "@remotion/captions", version: null }
208
+ ]);
209
+ const request = {
210
+ fileName: job.target.fileName,
211
+ nodePath: job.target.nodePath.nodePath,
212
+ durationInFrames: job.target.durationInFrames,
213
+ captions
214
+ };
215
+ const browserStudioOperations = getBrowserStudioOperations();
216
+ const response = browserStudioOperations ? await browserStudioOperations.insertBasicCaptions(request) : await callApi("/api/insert-basic-captions", request);
217
+ if (!response.success) {
218
+ throw new Error(response.reason);
219
+ }
220
+ }
190
221
  captionCount = captions.length;
191
222
  } catch (error) {
192
223
  processingError = error instanceof Error ? error : new Error(String(error));
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  Models
3
- } from "./index-vsxrxfpj.mjs";
4
- import"./index-jrw61pkj.mjs";
5
- import"./index-0x13f28h.mjs";
3
+ } from "./index-614tdz2q.mjs";
4
+ import"./index-r0ejh5sy.mjs";
5
+ import"./index-5t2dwxsk.mjs";
6
+ import"./index-9xxg6218.mjs";
6
7
  import"./index-5zrb1ft4.mjs";
7
8
  import"./index-k426ye99.mjs";
8
9
  import"./index-rcv7qkt5.mjs";
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  Models
3
- } from "./index-hbezgbbq.mjs";
4
- import"./index-jrw61pkj.mjs";
5
- import"./index-0x13f28h.mjs";
3
+ } from "./index-ac5550e7.mjs";
4
+ import"./index-r0ejh5sy.mjs";
5
+ import"./index-5t2dwxsk.mjs";
6
+ import"./index-9xxg6218.mjs";
6
7
  import"./index-5zrb1ft4.mjs";
7
8
  import"./index-k426ye99.mjs";
8
9
  import"./index-rcv7qkt5.mjs";
@@ -6,7 +6,7 @@ import {
6
6
  NumberSetting,
7
7
  getDefaultCaptionOutputName,
8
8
  validateCaptionOutputName
9
- } from "./index-1089795y.mjs";
9
+ } from "./index-vxwg66ar.mjs";
10
10
  import {
11
11
  Button,
12
12
  Checkbox,
@@ -30,22 +30,25 @@ import {
30
30
  optionsSidebarTabs,
31
31
  persistSelectedOptionsSidebarPanel,
32
32
  rightRow,
33
- showNotification,
34
33
  useStaticFiles
35
- } from "./index-ggqpre9v.mjs";
34
+ } from "./index-ppspzgn9.mjs";
35
+ import {
36
+ showNotification
37
+ } from "./index-21hxsfaa.mjs";
36
38
  import {
37
39
  RenderQueueContext
38
40
  } from "./index-9x6e1dq0.mjs";
39
41
  import {
40
42
  openInFileExplorer
41
- } from "./index-41kqns5c.mjs";
43
+ } from "./index-e855w59j.mjs";
44
+ import"./index-r1gr3j3a.mjs";
42
45
  import {
43
46
  getBrowserStudioOperations
44
47
  } from "./index-cw0pnpg5.mjs";
45
48
  import {
46
49
  Models
47
- } from "./index-vsxrxfpj.mjs";
48
- import"./index-jrw61pkj.mjs";
50
+ } from "./index-614tdz2q.mjs";
51
+ import"./index-r0ejh5sy.mjs";
49
52
  import {
50
53
  InlineAction,
51
54
  Spacing,
@@ -61,7 +64,8 @@ import {
61
64
  leftSidebar,
62
65
  optionsPanel,
63
66
  outerModalStyle
64
- } from "./index-0x13f28h.mjs";
67
+ } from "./index-5t2dwxsk.mjs";
68
+ import"./index-9xxg6218.mjs";
65
69
  import"./index-5zrb1ft4.mjs";
66
70
  import {
67
71
  BLUE_DISABLED,
@@ -770,7 +774,8 @@ var TranscriptionModal = ({
770
774
  audioStreamIndex,
771
775
  displayName,
772
776
  requestInit,
773
- src
777
+ src,
778
+ target
774
779
  }) => {
775
780
  const [tab, setTab] = useState("transcribe");
776
781
  const isModelCached = useCallback((model) => isWhisperModelCached({ model }), []);
@@ -811,8 +816,8 @@ var TranscriptionModal = ({
811
816
  };
812
817
  }, []);
813
818
  const normalizedOutName = outName.normalize("NFC").toLowerCase();
814
- const queuedOutputExists = captionJobs.some((job) => (job.status === "idle" || job.status === "running") && job.outName.normalize("NFC").toLowerCase() === normalizedOutName);
815
- const outputValidationMessage = validateCaptionOutputName(outName) ?? (queuedOutputExists ? "Another caption job is already using this output file" : null);
819
+ const queuedOutputExists = captionJobs.some((job) => job.target === null && (job.status === "idle" || job.status === "running") && job.outName.normalize("NFC").toLowerCase() === normalizedOutName);
820
+ const outputValidationMessage = target === null ? validateCaptionOutputName(outName) ?? (queuedOutputExists ? "Another caption job is already using this output file" : null) : null;
816
821
  const exists = staticFiles.some((file) => file.name.normalize("NFC").toLowerCase() === normalizedOutName);
817
822
  const chunkValidationMessage = strideLengthInSeconds * 2 >= chunkLengthInSeconds ? "Stride length must be less than half of chunk length" : null;
818
823
  const decodingValidationMessage = !Number.isFinite(temperature) ? "Temperature must be a finite number greater than 0" : temperature <= 0 ? "Temperature must be greater than 0" : !Number.isInteger(topK) || topK < 0 ? "Top K must be a non-negative integer" : !Number.isFinite(repetitionPenalty) ? "Repetition penalty must be a finite number greater than 0" : repetitionPenalty <= 0 ? "Repetition penalty must be greater than 0" : !Number.isInteger(noRepeatNgramSize) || noRepeatNgramSize < 0 ? "No-repeat n-gram size must be a non-negative integer" : null;
@@ -834,7 +839,8 @@ var TranscriptionModal = ({
834
839
  displayName,
835
840
  audioStreamIndex,
836
841
  requestInit,
837
- outName,
842
+ outName: target === null ? outName : "Basic captions",
843
+ target,
838
844
  model: selectedModel,
839
845
  language: modelInfo.multilingual ? selectedLanguage : null,
840
846
  task: modelInfo.supportsTranslation ? selectedTask : "transcribe",
@@ -861,6 +867,7 @@ var TranscriptionModal = ({
861
867
  forceFullSequences,
862
868
  noRepeatNgramSize,
863
869
  outName,
870
+ target,
864
871
  repetitionPenalty,
865
872
  requestInit,
866
873
  src,
@@ -873,13 +880,14 @@ var TranscriptionModal = ({
873
880
  temperature,
874
881
  topK
875
882
  ]);
883
+ const title = target === null ? `Transcribe ${displayName}` : "Generate captions";
876
884
  return /* @__PURE__ */ jsx(DismissableModal, {
877
- ariaLabel: `Transcribe ${displayName}`,
885
+ ariaLabel: title,
878
886
  children: /* @__PURE__ */ jsxs("div", {
879
887
  style: transcriptionModalStyle,
880
888
  children: [
881
889
  /* @__PURE__ */ jsx(ModalHeader, {
882
- title: `Transcribe ${displayName}`
890
+ title
883
891
  }),
884
892
  /* @__PURE__ */ jsxs("div", {
885
893
  style: container,
@@ -895,7 +903,7 @@ var TranscriptionModal = ({
895
903
  ...buttonStyle,
896
904
  backgroundColor: canTranscribe ? buttonStyle.backgroundColor : BLUE_DISABLED
897
905
  },
898
- children: "Transcribe"
906
+ children: target === null ? "Transcribe" : "Generate captions"
899
907
  })
900
908
  ]
901
909
  }),
@@ -951,13 +959,13 @@ var TranscriptionModal = ({
951
959
  style: tab === "transcribe" ? settingsPanel : hiddenPanel,
952
960
  className: VERTICAL_SCROLLBAR_CLASSNAME,
953
961
  children: [
954
- /* @__PURE__ */ jsx(OutputSettings, {
962
+ target === null ? /* @__PURE__ */ jsx(OutputSettings, {
955
963
  exists,
956
964
  onOutNameChange,
957
965
  outName,
958
966
  validationMessage: outputValidationMessage
959
- }),
960
- /* @__PURE__ */ jsx(RenderModalHr, {}),
967
+ }) : null,
968
+ target === null ? /* @__PURE__ */ jsx(RenderModalHr, {}) : null,
961
969
  /* @__PURE__ */ jsx(ModelSettings, {
962
970
  cachedModels,
963
971
  selectedLanguage,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-7tt71e8n.mjs";
4
4
  import {
5
5
  RenderModalOutputName
6
- } from "./index-mww32xc8.mjs";
6
+ } from "./index-s7qa3xbw.mjs";
7
7
  import {
8
8
  Button,
9
9
  Checkmark,
@@ -25,16 +25,18 @@ import {
25
25
  rightRow,
26
26
  useStaticFiles,
27
27
  validatePublicOutputName
28
- } from "./index-ggqpre9v.mjs";
28
+ } from "./index-ppspzgn9.mjs";
29
+ import"./index-21hxsfaa.mjs";
29
30
  import {
30
31
  RenderQueueContext
31
32
  } from "./index-9x6e1dq0.mjs";
32
- import"./index-41kqns5c.mjs";
33
+ import"./index-e855w59j.mjs";
34
+ import"./index-r1gr3j3a.mjs";
33
35
  import"./index-cw0pnpg5.mjs";
34
36
  import {
35
37
  Models
36
- } from "./index-hbezgbbq.mjs";
37
- import"./index-jrw61pkj.mjs";
38
+ } from "./index-ac5550e7.mjs";
39
+ import"./index-r0ejh5sy.mjs";
38
40
  import {
39
41
  VERTICAL_SCROLLBAR_CLASSNAME,
40
42
  ValidationMessage,
@@ -48,7 +50,8 @@ import {
48
50
  leftSidebar,
49
51
  optionsPanel,
50
52
  outerModalStyle
51
- } from "./index-0x13f28h.mjs";
53
+ } from "./index-5t2dwxsk.mjs";
54
+ import"./index-9xxg6218.mjs";
52
55
  import"./index-5zrb1ft4.mjs";
53
56
  import {
54
57
  BLUE_DISABLED