@remotion/studio 4.0.500 → 4.0.502

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 (156) hide show
  1. package/dist/Studio.js +1 -1
  2. package/dist/api/delete-static-file.js +8 -3
  3. package/dist/api/rename-static-file.js +8 -0
  4. package/dist/api/watch-public-folder.js +2 -1
  5. package/dist/api/watch-static-file.js +2 -1
  6. package/dist/api/write-static-file.js +8 -3
  7. package/dist/components/AssetSelector.js +3 -1
  8. package/dist/components/AssetSelectorItem.d.ts +2 -1
  9. package/dist/components/AssetSelectorItem.js +7 -4
  10. package/dist/components/Canvas.js +9 -4
  11. package/dist/components/CaptionInspector.d.ts +10 -0
  12. package/dist/components/CaptionInspector.js +24 -0
  13. package/dist/components/CaptionTextEditor.d.ts +9 -0
  14. package/dist/components/CaptionTextEditor.js +132 -0
  15. package/dist/components/CompositionSelector.js +4 -4
  16. package/dist/components/CompositionSelectorItem.js +5 -5
  17. package/dist/components/CurrentAsset.js +3 -2
  18. package/dist/components/EditorContent.js +1 -1
  19. package/dist/components/EditorContexts.d.ts +0 -1
  20. package/dist/components/EditorContexts.js +2 -2
  21. package/dist/components/FpsCounter.js +3 -3
  22. package/dist/components/FullscreenToggle.d.ts +3 -1
  23. package/dist/components/FullscreenToggle.js +3 -2
  24. package/dist/components/GlobalKeybindings.js +2 -0
  25. package/dist/components/InitialCompositionLoader.d.ts +1 -1
  26. package/dist/components/InlineAction.js +2 -1
  27. package/dist/components/InlineCaptionInspector.d.ts +11 -0
  28. package/dist/components/InlineCaptionInspector.js +108 -0
  29. package/dist/components/InspectorPanel/CompositionInspector.js +5 -3
  30. package/dist/components/InspectorPanel/SelectedInspector.d.ts +1 -0
  31. package/dist/components/InspectorPanel/SelectedInspector.js +2 -2
  32. package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +1 -0
  33. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -4
  34. package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +22 -0
  35. package/dist/components/InspectorPanel/inspector-section-collapse.js +165 -0
  36. package/dist/components/InspectorPanel/styles.js +7 -1
  37. package/dist/components/InspectorPanel/use-composition-actions.d.ts +4 -1
  38. package/dist/components/InspectorPanel/use-composition-actions.js +135 -7
  39. package/dist/components/InspectorPanel.js +2 -2
  40. package/dist/components/InspectorSequenceSection.d.ts +2 -1
  41. package/dist/components/InspectorSequenceSection.js +238 -8
  42. package/dist/components/LoopToggle.d.ts +1 -0
  43. package/dist/components/LoopToggle.js +9 -5
  44. package/dist/components/Menu/MenuSubItem.js +9 -1
  45. package/dist/components/MenuToolbar.js +8 -1
  46. package/dist/components/Modals.js +1 -1
  47. package/dist/components/ObserveDefaultPropsContext.js +7 -4
  48. package/dist/components/PlayPause.d.ts +1 -0
  49. package/dist/components/PlayPause.js +2 -4
  50. package/dist/components/PlaybackRateSelector.d.ts +9 -2
  51. package/dist/components/PlaybackRateSelector.js +21 -10
  52. package/dist/components/PreviewToolbar.js +19 -109
  53. package/dist/components/PreviewToolbarOverflowButton.d.ts +12 -0
  54. package/dist/components/PreviewToolbarOverflowButton.js +217 -0
  55. package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
  56. package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +6 -0
  57. package/dist/components/QuickSwitcher/QuickSwitcher.js +2 -2
  58. package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +6 -0
  59. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +42 -9
  60. package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +2 -0
  61. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +7 -1
  62. package/dist/components/RenderButton.d.ts +1 -0
  63. package/dist/components/RenderButton.js +6 -4
  64. package/dist/components/RenderQueue/ClientRenderQueueProcessor.d.ts +0 -1
  65. package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +3 -14
  66. package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
  67. package/dist/components/SelectedOutlineElement.js +1 -4
  68. package/dist/components/SelectedOutlineOverlay.js +17 -8
  69. package/dist/components/ShowOutlinesProvider.js +4 -1
  70. package/dist/components/SizeSelector.d.ts +6 -0
  71. package/dist/components/SizeSelector.js +17 -8
  72. package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
  73. package/dist/components/Splitter/SplitterContainer.js +23 -3
  74. package/dist/components/Splitter/SplitterContext.d.ts +14 -0
  75. package/dist/components/Splitter/SplitterContext.js +16 -1
  76. package/dist/components/Splitter/SplitterHandle.js +8 -6
  77. package/dist/components/Timeline/Timeline.js +21 -6
  78. package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
  79. package/dist/components/Timeline/TimelineAssetField.js +37 -1
  80. package/dist/components/Timeline/TimelineDragHandler.js +1 -1
  81. package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +8 -2
  82. package/dist/components/Timeline/TimelinePrimitiveFieldValue.d.ts +7 -2
  83. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +3 -1
  84. package/dist/components/Timeline/TimelineRowChrome.d.ts +3 -0
  85. package/dist/components/Timeline/TimelineRowChrome.js +4 -3
  86. package/dist/components/Timeline/TimelineSelection.d.ts +4 -2
  87. package/dist/components/Timeline/TimelineSelection.js +9 -6
  88. package/dist/components/Timeline/TimelineSequence.js +1 -4
  89. package/dist/components/Timeline/TimelineSequenceItem.js +4 -5
  90. package/dist/components/Timeline/TimelineSequencePropItem.js +9 -10
  91. package/dist/components/Timeline/TimelineStack/get-stack.js +8 -0
  92. package/dist/components/Timeline/TimelineTrack.js +4 -2
  93. package/dist/components/Timeline/border-radius-representation.d.ts +16 -0
  94. package/dist/components/Timeline/border-radius-representation.js +60 -0
  95. package/dist/components/Timeline/delete-selected-timeline-item.js +1 -6
  96. package/dist/components/Timeline/get-sequence-prop-reset-changes.d.ts +10 -0
  97. package/dist/components/Timeline/get-sequence-prop-reset-changes.js +33 -0
  98. package/dist/components/Timeline/reset-selected-timeline-props.js +2 -8
  99. package/dist/components/Timeline/save-sequence-prop.d.ts +12 -1
  100. package/dist/components/Timeline/save-sequence-prop.js +28 -4
  101. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -2
  102. package/dist/components/Timeline/sequence-props-subscription-store.js +3 -3
  103. package/dist/components/Timeline/timeline-field-display-utils.js +1 -0
  104. package/dist/components/Timeline/use-timeline-asset-drop.js +4 -0
  105. package/dist/components/TopPanel.js +1 -1
  106. package/dist/components/UndoRedoButtons.js +15 -6
  107. package/dist/components/UpdateCheck.js +11 -4
  108. package/dist/components/default-props-api.d.ts +3 -0
  109. package/dist/components/default-props-api.js +19 -0
  110. package/dist/components/drop-handler-data.d.ts +1 -1
  111. package/dist/components/drop-handler-data.js +6 -6
  112. package/dist/components/effect-drag-and-drop.d.ts +1 -1
  113. package/dist/components/effect-drag-and-drop.js +3 -3
  114. package/dist/components/element-drag-and-drop.d.ts +1 -1
  115. package/dist/components/element-drag-and-drop.js +3 -3
  116. package/dist/components/handle-drop.d.ts +3 -2
  117. package/dist/components/handle-drop.js +2 -1
  118. package/dist/components/import-assets.d.ts +8 -6
  119. package/dist/components/import-assets.js +20 -7
  120. package/dist/components/sequence-props-api.d.ts +4 -0
  121. package/dist/components/sequence-props-api.js +26 -0
  122. package/dist/components/use-element-overwrite-confirmation.d.ts +2 -0
  123. package/dist/components/use-element-overwrite-confirmation.js +73 -0
  124. package/dist/components/use-static-files.js +7 -2
  125. package/dist/error-overlay/react-overlay/effects/resolve-file-source.js +13 -2
  126. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -0
  127. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +29 -5
  128. package/dist/error-overlay/remotion-overlay/ErrorLoader.js +4 -20
  129. package/dist/esm/{chunk-dr1y1vm3.js → chunk-fjv75ty4.js} +8478 -6609
  130. package/dist/esm/index.mjs +24 -8
  131. package/dist/esm/internals.mjs +8478 -6609
  132. package/dist/esm/previewEntry.mjs +8535 -6666
  133. package/dist/esm/renderEntry.mjs +1 -1
  134. package/dist/helpers/browser-studio-operations.d.ts +3 -0
  135. package/dist/helpers/browser-studio-operations.js +14 -0
  136. package/dist/helpers/client-id.d.ts +0 -1
  137. package/dist/helpers/client-id.js +15 -10
  138. package/dist/helpers/download-blob.d.ts +1 -0
  139. package/dist/helpers/download-blob.js +15 -0
  140. package/dist/helpers/inject-css.js +5 -3
  141. package/dist/helpers/open-in-editor.js +26 -5
  142. package/dist/helpers/preview-server-events.js +46 -9
  143. package/dist/helpers/use-create-composition.js +8 -6
  144. package/dist/helpers/use-menu-structure.js +29 -0
  145. package/dist/hot-middleware-client/client.js +3 -3
  146. package/dist/icons/border-radius.d.ts +4 -0
  147. package/dist/icons/border-radius.js +8 -0
  148. package/dist/icons/fullscreen.d.ts +4 -0
  149. package/dist/icons/fullscreen.js +6 -0
  150. package/dist/icons/upload.d.ts +4 -0
  151. package/dist/icons/upload.js +8 -0
  152. package/dist/previewEntry.js +1 -1
  153. package/dist/state/modals.d.ts +5 -0
  154. package/dist/state/timeline-sequence-hover.d.ts +17 -0
  155. package/dist/state/timeline-sequence-hover.js +33 -0
  156. package/package.json +13 -12
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unsubscribeFromSequenceProps = exports.subscribeToSequenceProps = exports.saveSequenceProps = void 0;
4
+ const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
5
+ const call_api_1 = require("./call-api");
6
+ const saveSequenceProps = (request) => {
7
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
8
+ return browserStudioOperations
9
+ ? browserStudioOperations.saveSequenceProps(request)
10
+ : (0, call_api_1.callApi)('/api/save-sequence-props', request);
11
+ };
12
+ exports.saveSequenceProps = saveSequenceProps;
13
+ const subscribeToSequenceProps = (request) => {
14
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
15
+ return browserStudioOperations
16
+ ? browserStudioOperations.subscribeToSequenceProps(request)
17
+ : (0, call_api_1.callApi)('/api/subscribe-to-sequence-props', request);
18
+ };
19
+ exports.subscribeToSequenceProps = subscribeToSequenceProps;
20
+ const unsubscribeFromSequenceProps = (request) => {
21
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
22
+ return browserStudioOperations
23
+ ? browserStudioOperations.unsubscribeFromSequenceProps(request)
24
+ : (0, call_api_1.callApi)('/api/unsubscribe-from-sequence-props', request);
25
+ };
26
+ exports.unsubscribeFromSequenceProps = unsubscribeFromSequenceProps;
@@ -0,0 +1,2 @@
1
+ import type { InsertElementFileConflict } from '@remotion/studio-shared';
2
+ export declare const useElementOverwriteConfirmation: () => (conflict: InsertElementFileConflict) => Promise<boolean>;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useElementOverwriteConfirmation = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const ConfirmationDialog_1 = require("./ConfirmationDialog");
7
+ const filePathStyle = {
8
+ color: 'inherit',
9
+ fontFamily: 'monospace',
10
+ fontSize: 13,
11
+ lineHeight: 1.4,
12
+ };
13
+ const warningStyle = {
14
+ color: 'inherit',
15
+ fontFamily: 'sans-serif',
16
+ fontSize: 14,
17
+ lineHeight: 1.4,
18
+ marginTop: 12,
19
+ };
20
+ const sourceDetailsStyle = {
21
+ color: 'inherit',
22
+ fontFamily: 'sans-serif',
23
+ fontSize: 13,
24
+ lineHeight: 1.4,
25
+ marginTop: 12,
26
+ };
27
+ const sourceSummaryStyle = {
28
+ color: 'inherit',
29
+ cursor: 'pointer',
30
+ fontFamily: 'sans-serif',
31
+ fontSize: 13,
32
+ fontWeight: 500,
33
+ lineHeight: 1.4,
34
+ };
35
+ const sourceCodeBlockStyle = {
36
+ backgroundColor: 'rgba(255, 255, 255, 0.06)',
37
+ borderRadius: 6,
38
+ color: 'inherit',
39
+ fontFamily: 'monospace',
40
+ fontSize: 12,
41
+ lineHeight: 1.5,
42
+ marginBottom: 0,
43
+ marginTop: 8,
44
+ maxHeight: 200,
45
+ overflow: 'auto',
46
+ padding: 12,
47
+ whiteSpace: 'pre',
48
+ };
49
+ const sourceCodeStyle = {
50
+ color: 'inherit',
51
+ fontFamily: 'monospace',
52
+ fontSize: 12,
53
+ lineHeight: 1.5,
54
+ };
55
+ const useElementOverwriteConfirmation = () => {
56
+ const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
57
+ return (0, react_1.useCallback)((conflict) => {
58
+ return confirm({
59
+ title: 'Overwrite Element file?',
60
+ message: (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["The Element file", ' ', jsx_runtime_1.jsx("code", { style: filePathStyle, children: conflict.filePath }),
61
+ " already exists with different contents.",
62
+ jsx_runtime_1.jsx("div", { style: warningStyle, children: "Overwriting will replace local changes in this file. The composition will only be updated if you choose Overwrite." }), jsx_runtime_1.jsxs("details", { style: sourceDetailsStyle, open: true, children: [
63
+ jsx_runtime_1.jsx("summary", { style: sourceSummaryStyle, children: "Existing source" }), jsx_runtime_1.jsx("pre", { style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: conflict.existingSource }) })
64
+ ] }), jsx_runtime_1.jsxs("details", { style: sourceDetailsStyle, children: [
65
+ jsx_runtime_1.jsx("summary", { style: sourceSummaryStyle, children: "Incoming source" }), jsx_runtime_1.jsx("pre", { style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: conflict.incomingSource }) })
66
+ ] })
67
+ ] })),
68
+ confirmLabel: 'Overwrite',
69
+ cancelLabel: 'Cancel',
70
+ });
71
+ }, [confirm]);
72
+ };
73
+ exports.useElementOverwriteConfirmation = useElementOverwriteConfirmation;
@@ -38,22 +38,27 @@ const react_1 = __importStar(require("react"));
38
38
  const remotion_1 = require("remotion");
39
39
  const get_static_files_1 = require("../api/get-static-files");
40
40
  const watch_public_folder_1 = require("../api/watch-public-folder");
41
+ const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
42
+ const client_id_1 = require("../helpers/client-id");
41
43
  const StaticFilesContext = (0, react_1.createContext)([]);
42
44
  const StaticFilesProvider = ({ children }) => {
43
45
  const [files, setFiles] = (0, react_1.useState)(() => (0, get_static_files_1.getStaticFiles)());
44
46
  const env = (0, remotion_1.useRemotionEnvironment)();
47
+ const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
48
+ const browserStudioCanWatch = previewServerState.type === 'connected' &&
49
+ (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
45
50
  (0, react_1.useEffect)(() => {
46
51
  if (!env.isStudio) {
47
52
  return;
48
53
  }
49
- if (env.isReadOnlyStudio) {
54
+ if (env.isReadOnlyStudio && !browserStudioCanWatch) {
50
55
  return;
51
56
  }
52
57
  const { cancel } = (0, watch_public_folder_1.watchPublicFolder)((newFiles) => {
53
58
  setFiles(newFiles);
54
59
  });
55
60
  return cancel;
56
- }, [env.isStudio, env.isReadOnlyStudio]);
61
+ }, [browserStudioCanWatch, env.isStudio, env.isReadOnlyStudio]);
57
62
  return react_1.default.createElement(StaticFilesContext.Provider, { value: files }, children);
58
63
  };
59
64
  exports.StaticFilesProvider = StaticFilesProvider;
@@ -1,9 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveFileSource = void 0;
4
+ const browser_studio_operations_1 = require("../../../helpers/browser-studio-operations");
4
5
  const resolveFileSource = async (location, contextLines) => {
5
- const res = await fetch(`/api/file-source?f=${encodeURIComponent(location.fileName)}`);
6
- const text = await res.text();
6
+ const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
7
+ let text;
8
+ if (browserStudioOperations) {
9
+ const browserSource = await browserStudioOperations.getFileSource(location.fileName);
10
+ if (browserSource === null) {
11
+ throw new Error(`Could not find ${location.fileName}`);
12
+ }
13
+ text = browserSource;
14
+ }
15
+ else {
16
+ text = await (await fetch(`/api/file-source?f=${encodeURIComponent(location.fileName)}`)).text();
17
+ }
7
18
  const lines = text
8
19
  .split('\n')
9
20
  .map((l, i) => {
@@ -7,4 +7,5 @@ export declare const ErrorDisplay: React.FC<{
7
7
  readonly onRetry: OnRetry;
8
8
  readonly canHaveDismissButton: boolean;
9
9
  readonly calculateMetadata: boolean;
10
+ readonly symbolicationFailure: string | null;
10
11
  }>;
@@ -7,6 +7,7 @@ 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 colors_1 = require("../../helpers/colors");
10
11
  const AskOnDiscord_1 = require("./AskOnDiscord");
11
12
  const CalculateMetadataErrorExplainer_1 = require("./CalculateMetadataErrorExplainer");
12
13
  const CopyStackTrace_1 = require("./CopyStackTrace");
@@ -23,12 +24,35 @@ const stack = {
23
24
  overflowX: 'scroll',
24
25
  marginBottom: '10vh',
25
26
  };
27
+ const rawStack = {
28
+ backgroundColor: colors_1.ERROR_CODE_FRAME_BACKGROUND,
29
+ boxSizing: 'border-box',
30
+ color: colors_1.WHITE,
31
+ fontFamily: 'monospace',
32
+ fontSize: 14,
33
+ lineHeight: 1.7,
34
+ marginBottom: 0,
35
+ marginTop: 17,
36
+ maxWidth: '100%',
37
+ overflowX: 'auto',
38
+ padding: 12,
39
+ whiteSpace: 'pre',
40
+ };
41
+ const symbolicationFailureStyle = {
42
+ color: colors_1.WHITE_ALPHA_60,
43
+ fontFamily: 'SF Pro Text, sans-serif',
44
+ fontSize: 14,
45
+ lineHeight: 1.5,
46
+ marginBottom: '10vh',
47
+ marginTop: 24,
48
+ };
26
49
  const spacer = {
27
50
  width: 5,
28
51
  display: 'inline-block',
29
52
  };
30
- const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButton, calculateMetadata, }) => {
31
- const highestLineNumber = Math.max(...display.stackFrames
53
+ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButton, calculateMetadata, symbolicationFailure, }) => {
54
+ var _a;
55
+ const highestLineNumber = Math.max(0, ...display.stackFrames
32
56
  .map((s) => s.originalScriptCode)
33
57
  .flat(1)
34
58
  .map((s) => {
@@ -70,11 +94,11 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
70
94
  jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx(layout_1.Spacing, { y: 0.5 }), jsx_runtime_1.jsx(CalculateMetadataErrorExplainer_1.CalculateMetadataErrorExplainer, {})
71
95
  ] })) : null, display.error instanceof remotion_1.MediaPlaybackError ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
72
96
  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 })
73
- ] })) : null, jsx_runtime_1.jsx("div", { style: stack, className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, children: display.stackFrames.map((s, i) => {
97
+ ] })) : 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) => {
74
98
  return (jsx_runtime_1.jsx(StackFrame_1.StackElement
75
99
  // eslint-disable-next-line react/no-array-index-key
76
100
  , { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)' }, i));
77
- }) })
78
- ] }));
101
+ }) })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
102
+ 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] }))] }));
79
103
  };
80
104
  exports.ErrorDisplay = ErrorDisplay;
@@ -4,7 +4,6 @@ exports.ErrorLoader = void 0;
4
4
  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
- const colors_1 = require("../../helpers/colors");
8
7
  const error_origin_1 = require("../error-origin");
9
8
  const listen_to_runtime_errors_1 = require("../react-overlay/listen-to-runtime-errors");
10
9
  const ErrorDisplay_1 = require("./ErrorDisplay");
@@ -19,17 +18,7 @@ const container = {
19
18
  marginRight: 'auto',
20
19
  fontFamily: 'SF Pro Text, sans-serif',
21
20
  paddingTop: '5vh',
22
- };
23
- const errorWhileErrorStyle = {
24
- color: colors_1.WHITE,
25
- lineHeight: 1.5,
26
- whiteSpace: 'pre',
27
- };
28
- const errorWhileSymbolicatingStyle = {
29
- color: colors_1.WHITE,
30
- lineHeight: 1.5,
31
- marginTop: 24,
32
- opacity: 0.7,
21
+ boxSizing: 'border-box',
33
22
  };
34
23
  const shouldLogError = (error) => {
35
24
  return (!(0, error_origin_1.wasErrorLoggedByServer)(error) && (0, studio_shared_1.getLocationFromBuildError)(error) === null);
@@ -58,7 +47,6 @@ const logSymbolicatedStudioError = (record) => {
58
47
  });
59
48
  };
60
49
  const ErrorLoader = ({ error, keyboardShortcuts, onRetry, canHaveDismissButton, calculateMetadata, }) => {
61
- var _a;
62
50
  const [state, setState] = (0, react_1.useState)({
63
51
  type: 'loading',
64
52
  });
@@ -97,15 +85,11 @@ const ErrorLoader = ({ error, keyboardShortcuts, onRetry, canHaveDismissButton,
97
85
  return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx(ErrorTitle_1.ErrorTitle, { symbolicating: true, name: error.name, message: error.message, canHaveDismissButton: canHaveDismissButton }) }));
98
86
  }
99
87
  if (state.type === 'error') {
100
- return (jsx_runtime_1.jsxs("div", { style: container, children: [
101
- jsx_runtime_1.jsx(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: error.name, message: error.message, canHaveDismissButton: canHaveDismissButton }), jsx_runtime_1.jsx("div", { style: errorWhileErrorStyle, children: (_a = error.stack) !== null && _a !== void 0 ? _a : 'Check the Terminal and browser console for error messages.' }), jsx_runtime_1.jsxs("div", { style: errorWhileSymbolicatingStyle, children: ["Could not symbolicate the stack trace: ", state.err.message] })
102
- ] }));
88
+ return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx(ErrorDisplay_1.ErrorDisplay, { keyboardShortcuts: keyboardShortcuts, display: { error, contextSize: 0, stackFrames: [] }, onRetry: onRetry, canHaveDismissButton: canHaveDismissButton, calculateMetadata: calculateMetadata, symbolicationFailure: `Could not symbolicate the stack trace: ${state.err.message}` }) }));
103
89
  }
104
90
  if (state.type === 'no-record') {
105
- return (jsx_runtime_1.jsxs("div", { style: container, children: [
106
- jsx_runtime_1.jsx(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: error.name, message: error.message, canHaveDismissButton: canHaveDismissButton }), jsx_runtime_1.jsx("div", { style: errorWhileErrorStyle, children: "Check the Terminal and browser console for error messages." })
107
- ] }));
91
+ return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx(ErrorDisplay_1.ErrorDisplay, { keyboardShortcuts: keyboardShortcuts, display: { error, contextSize: 0, stackFrames: [] }, onRetry: onRetry, canHaveDismissButton: canHaveDismissButton, calculateMetadata: calculateMetadata, symbolicationFailure: "Could not symbolicate the stack trace." }) }));
108
92
  }
109
- return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx(ErrorDisplay_1.ErrorDisplay, { keyboardShortcuts: keyboardShortcuts, display: state.record, onRetry: onRetry, canHaveDismissButton: canHaveDismissButton, calculateMetadata: calculateMetadata }) }));
93
+ return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx(ErrorDisplay_1.ErrorDisplay, { keyboardShortcuts: keyboardShortcuts, display: state.record, onRetry: onRetry, canHaveDismissButton: canHaveDismissButton, calculateMetadata: calculateMetadata, symbolicationFailure: null }) }));
110
94
  };
111
95
  exports.ErrorLoader = ErrorLoader;