@remotion/studio 4.0.512 → 4.0.513
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.
- package/dist/components/CompositionSelectorItem.js +14 -1
- package/dist/components/InspectorOpenInEditor.js +24 -24
- package/dist/components/InspectorPanel/AlignmentControls.js +13 -2
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +12 -8
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +12 -1
- package/dist/components/InspectorPanel/EasingInspector.js +11 -2
- package/dist/components/InspectorPanel/KeyframeInspector.js +19 -5
- package/dist/components/InspectorPanel/easing-inspector-selection.js +7 -2
- package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +1 -0
- package/dist/components/SelectedOutlineElement.js +12 -10
- package/dist/components/SelectedOutlineOverlay.js +30 -8
- package/dist/components/Timeline/TimelineArrayField.js +1 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +10 -4
- package/dist/components/Timeline/TimelineKeyframeControls.js +25 -7
- package/dist/components/Timeline/TimelineKeyframedValue.js +1 -0
- package/dist/components/Timeline/TimelineSequencePropItem.js +11 -4
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +96 -18
- package/dist/components/Timeline/call-move-keyframe.d.ts +2 -1
- package/dist/components/Timeline/call-move-keyframe.js +70 -17
- package/dist/components/Timeline/delete-selected-keyframe.d.ts +0 -8
- package/dist/components/Timeline/delete-selected-keyframe.js +23 -44
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +0 -8
- package/dist/components/Timeline/delete-selected-timeline-item.js +16 -43
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +8 -3
- package/dist/components/Timeline/get-sequence-context-menu-items.js +10 -8
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +4 -0
- package/dist/components/Timeline/get-timeline-keyframes.js +16 -3
- package/dist/components/Timeline/keyframe-clipboard.js +9 -2
- package/dist/components/Timeline/use-open-sequence-in-apps.js +8 -8
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +14 -4
- package/dist/components/VisualControls/ClickableFileName.js +13 -6
- package/dist/components/composition-menu-items.d.ts +6 -1
- package/dist/components/composition-menu-items.js +9 -6
- package/dist/components/folder-menu-items.d.ts +4 -1
- package/dist/components/folder-menu-items.js +4 -5
- package/dist/components/get-open-in-menu-items.d.ts +1 -1
- package/dist/components/get-open-in-menu-items.js +15 -13
- package/dist/components/sequence-props-api.js +44 -3
- package/dist/components/use-default-editor-info.d.ts +8 -0
- package/dist/components/use-default-editor-info.js +25 -9
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +10 -3
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +3 -1
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +6 -6
- package/dist/error-overlay/remotion-overlay/Overlay.js +14 -12
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +2 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +7 -4
- package/dist/esm/{chunk-s8gwjng0.js → chunk-tv7r0jy3.js} +1692 -1322
- package/dist/esm/internals.mjs +1692 -1322
- package/dist/esm/previewEntry.mjs +3167 -2793
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/open-in-editor.d.ts +6 -4
- package/dist/helpers/open-in-editor.js +4 -4
- package/dist/helpers/use-menu-structure.js +11 -6
- package/package.json +12 -12
|
@@ -3,6 +3,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.unsubscribeFromSequenceProps = exports.subscribeToSequenceProps = exports.saveSequenceProps = void 0;
|
|
4
4
|
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
5
|
const call_api_1 = require("./call-api");
|
|
6
|
+
let pendingSequencePropsSubscriptions = [];
|
|
7
|
+
let sequencePropsSubscriptionTimer = null;
|
|
8
|
+
const flushSequencePropsSubscriptions = () => {
|
|
9
|
+
sequencePropsSubscriptionTimer = null;
|
|
10
|
+
const pending = pendingSequencePropsSubscriptions;
|
|
11
|
+
pendingSequencePropsSubscriptions = [];
|
|
12
|
+
const firstRequest = pending[0].request;
|
|
13
|
+
(0, call_api_1.callApi)('/api/subscribe-to-sequence-props', {
|
|
14
|
+
...firstRequest,
|
|
15
|
+
requests: pending.map(({ request }) => request),
|
|
16
|
+
}).then((response) => {
|
|
17
|
+
if (!Array.isArray(response.results)) {
|
|
18
|
+
pending[0].resolve(response);
|
|
19
|
+
const error = new Error('Legacy single subscription response received for a batched request');
|
|
20
|
+
for (const item of pending.slice(1)) {
|
|
21
|
+
item.reject(error);
|
|
22
|
+
}
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (response.results.length !== pending.length) {
|
|
26
|
+
const error = new Error(`Expected ${pending.length} sequence prop subscription results, got ${response.results.length}`);
|
|
27
|
+
for (const item of pending) {
|
|
28
|
+
item.reject(error);
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
for (let index = 0; index < pending.length; index++) {
|
|
33
|
+
pending[index].resolve(response.results[index]);
|
|
34
|
+
}
|
|
35
|
+
}, (error) => {
|
|
36
|
+
for (const item of pending) {
|
|
37
|
+
item.reject(error);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
|
6
41
|
const saveSequenceProps = (request) => {
|
|
7
42
|
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
8
43
|
return browserStudioOperations
|
|
@@ -12,9 +47,15 @@ const saveSequenceProps = (request) => {
|
|
|
12
47
|
exports.saveSequenceProps = saveSequenceProps;
|
|
13
48
|
const subscribeToSequenceProps = (request) => {
|
|
14
49
|
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
50
|
+
if (browserStudioOperations) {
|
|
51
|
+
return browserStudioOperations.subscribeToSequenceProps(request);
|
|
52
|
+
}
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
pendingSequencePropsSubscriptions.push({ request, resolve, reject });
|
|
55
|
+
if (sequencePropsSubscriptionTimer === null) {
|
|
56
|
+
sequencePropsSubscriptionTimer = setTimeout(flushSequencePropsSubscriptions, 0);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
18
59
|
};
|
|
19
60
|
exports.subscribeToSequenceProps = subscribeToSequenceProps;
|
|
20
61
|
const unsubscribeFromSequenceProps = (request) => {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import type { EditorPickerId, GetDefaultEditorInfoResponse } from '@remotion/studio-shared';
|
|
2
2
|
export declare const canUseEditorPicker: (previewServerConnected: boolean) => boolean;
|
|
3
|
+
export declare const canOpenInEditor: (previewServerConnected: boolean) => boolean;
|
|
3
4
|
export declare const getPreferredEditorId: (editorInfo: GetDefaultEditorInfoResponse | null) => EditorPickerId | null;
|
|
5
|
+
export declare const useEditorOpening: (previewServerConnected: boolean) => {
|
|
6
|
+
canConfigureApps: boolean;
|
|
7
|
+
canOpenInEditor: boolean;
|
|
8
|
+
defaultEditorId: EditorPickerId | null;
|
|
9
|
+
defaultEditorName: string | null;
|
|
10
|
+
editorInfo: GetDefaultEditorInfoResponse | null;
|
|
11
|
+
};
|
|
4
12
|
export declare const useDefaultEditorInfo: (enabled: boolean) => GetDefaultEditorInfoResponse | null;
|
|
5
13
|
export declare const useDefaultCodingAgentInfo: (enabled: boolean) => import("@remotion/studio-shared").GetDefaultCodingAgentInfoResponse | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useDefaultCodingAgentInfo = exports.useDefaultEditorInfo = exports.getPreferredEditorId = exports.canUseEditorPicker = void 0;
|
|
3
|
+
exports.useDefaultCodingAgentInfo = exports.useDefaultEditorInfo = exports.useEditorOpening = exports.getPreferredEditorId = exports.canOpenInEditor = exports.canUseEditorPicker = void 0;
|
|
4
4
|
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
5
|
const SettingsContext_1 = require("./SettingsContext");
|
|
6
6
|
const canUseEditorPicker = (previewServerConnected) => {
|
|
@@ -9,6 +9,10 @@ const canUseEditorPicker = (previewServerConnected) => {
|
|
|
9
9
|
(0, browser_studio_operations_1.getBrowserStudioOperations)() === null);
|
|
10
10
|
};
|
|
11
11
|
exports.canUseEditorPicker = canUseEditorPicker;
|
|
12
|
+
const canOpenInEditor = (previewServerConnected) => {
|
|
13
|
+
return previewServerConnected && (0, browser_studio_operations_1.getBrowserStudioOperations)() === null;
|
|
14
|
+
};
|
|
15
|
+
exports.canOpenInEditor = canOpenInEditor;
|
|
12
16
|
const preferredFallbackEditorIds = [
|
|
13
17
|
'zed',
|
|
14
18
|
'vscode',
|
|
@@ -17,17 +21,14 @@ const preferredFallbackEditorIds = [
|
|
|
17
21
|
const getPreferredEditorId = (editorInfo) => {
|
|
18
22
|
var _a, _b, _c;
|
|
19
23
|
var _d;
|
|
20
|
-
const
|
|
21
|
-
if (runningEditorId) {
|
|
22
|
-
return runningEditorId;
|
|
23
|
-
}
|
|
24
|
-
if (window.remotion_editorName !== null) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const configuredEditorId = (_b = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.id === editorInfo.defaultEditor)) === null || _b === void 0 ? void 0 : _b.id;
|
|
24
|
+
const configuredEditorId = (_a = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.id === editorInfo.defaultEditor)) === null || _a === void 0 ? void 0 : _a.id;
|
|
28
25
|
if (configuredEditorId) {
|
|
29
26
|
return configuredEditorId;
|
|
30
27
|
}
|
|
28
|
+
const runningEditorId = (_b = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.nameWithType === window.remotion_editorName)) === null || _b === void 0 ? void 0 : _b.id;
|
|
29
|
+
if (runningEditorId) {
|
|
30
|
+
return runningEditorId;
|
|
31
|
+
}
|
|
31
32
|
return ((_d = (_c = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.slice().sort((a, b) => {
|
|
32
33
|
const aPriority = preferredFallbackEditorIds.indexOf(a.id);
|
|
33
34
|
const bPriority = preferredFallbackEditorIds.indexOf(b.id);
|
|
@@ -40,6 +41,21 @@ const getPreferredEditorId = (editorInfo) => {
|
|
|
40
41
|
}).at(0)) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : null);
|
|
41
42
|
};
|
|
42
43
|
exports.getPreferredEditorId = getPreferredEditorId;
|
|
44
|
+
const useEditorOpening = (previewServerConnected) => {
|
|
45
|
+
var _a;
|
|
46
|
+
const editorConnectionAvailable = (0, exports.canOpenInEditor)(previewServerConnected);
|
|
47
|
+
const editorInfo = (0, exports.useDefaultEditorInfo)(editorConnectionAvailable);
|
|
48
|
+
const defaultEditorId = (0, exports.getPreferredEditorId)(editorInfo);
|
|
49
|
+
const defaultEditor = editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.find((editor) => editor.id === defaultEditorId);
|
|
50
|
+
return {
|
|
51
|
+
canConfigureApps: (0, exports.canUseEditorPicker)(previewServerConnected),
|
|
52
|
+
canOpenInEditor: editorConnectionAvailable && defaultEditorId !== null,
|
|
53
|
+
defaultEditorId,
|
|
54
|
+
defaultEditorName: (_a = defaultEditor === null || defaultEditor === void 0 ? void 0 : defaultEditor.nameWithType) !== null && _a !== void 0 ? _a : null,
|
|
55
|
+
editorInfo,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
exports.useEditorOpening = useEditorOpening;
|
|
43
59
|
const useDefaultEditorInfo = (enabled) => {
|
|
44
60
|
const { editorInfo } = (0, SettingsContext_1.useSettings)();
|
|
45
61
|
return enabled ? editorInfo : null;
|
|
@@ -7,6 +7,8 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const layout_1 = require("../../components/layout");
|
|
9
9
|
const is_menu_item_1 = require("../../components/Menu/is-menu-item");
|
|
10
|
+
const use_default_editor_info_1 = require("../../components/use-default-editor-info");
|
|
11
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
10
12
|
const colors_1 = require("../../helpers/colors");
|
|
11
13
|
const AskOnDiscord_1 = require("./AskOnDiscord");
|
|
12
14
|
const CalculateMetadataErrorExplainer_1 = require("./CalculateMetadataErrorExplainer");
|
|
@@ -52,6 +54,8 @@ const spacer = {
|
|
|
52
54
|
};
|
|
53
55
|
const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButton, calculateMetadata, symbolicationFailure, }) => {
|
|
54
56
|
var _a;
|
|
57
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
58
|
+
const { canOpenInEditor, defaultEditorId, defaultEditorName } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
|
|
55
59
|
const highestLineNumber = Math.max(0, ...display.stackFrames
|
|
56
60
|
.map((s) => s.originalScriptCode)
|
|
57
61
|
.flat(1)
|
|
@@ -86,8 +90,11 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
|
|
|
86
90
|
return (jsx_runtime_1.jsxs("div", { children: [
|
|
87
91
|
jsx_runtime_1.jsx(ErrorTitle_1.ErrorTitle, { symbolicating: false, name: display.error.name, message: message, canHaveDismissButton: canHaveDismissButton }), helpLink ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
88
92
|
jsx_runtime_1.jsx(HelpLink_1.HelpLink, { link: helpLink, canHaveKeyboardShortcuts: keyboardShortcuts }), jsx_runtime_1.jsx("div", { style: spacer })
|
|
89
|
-
] })) : null, display.stackFrames.length > 0 &&
|
|
90
|
-
|
|
93
|
+
] })) : null, display.stackFrames.length > 0 &&
|
|
94
|
+
canOpenInEditor &&
|
|
95
|
+
defaultEditorId &&
|
|
96
|
+
defaultEditorName ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
97
|
+
jsx_runtime_1.jsx(OpenInEditor_1.OpenInEditor, { canHaveKeyboardShortcuts: keyboardShortcuts, editorId: defaultEditorId, editorName: defaultEditorName, stack: display.stackFrames[0] }), jsx_runtime_1.jsx("div", { style: spacer })
|
|
91
98
|
] })) : null, jsx_runtime_1.jsx(CopyStackTrace_1.CopyStackTrace, { errorText: errorTextForCopy }), jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(SearchGitHubIssues_1.SearchGithubIssues, { canHaveKeyboardShortcuts: keyboardShortcuts, message: display.error.message }), jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(AskOnDiscord_1.AskOnDiscord, { canHaveKeyboardShortcuts: keyboardShortcuts }), onRetry ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
92
99
|
jsx_runtime_1.jsx("div", { style: spacer }), jsx_runtime_1.jsx(Retry_1.RetryButton, { onClick: onRetry, label: calculateMetadata ? 'Retry calculateMetadata()' : 'Retry' })
|
|
93
100
|
] })) : null, calculateMetadata ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
@@ -97,7 +104,7 @@ const ErrorDisplay = ({ display, keyboardShortcuts, onRetry, canHaveDismissButto
|
|
|
97
104
|
] })) : null, display.stackFrames.length > 0 ? (jsx_runtime_1.jsx("div", { style: stack, className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, children: display.stackFrames.map((s, i) => {
|
|
98
105
|
return (jsx_runtime_1.jsx(StackFrame_1.StackElement
|
|
99
106
|
// eslint-disable-next-line react/no-array-index-key
|
|
100
|
-
, { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)' }, i));
|
|
107
|
+
, { isFirst: i === 0, s: s, lineNumberWidth: lineNumberWidth, defaultFunctionName: '(anonymous function)', editorId: canOpenInEditor ? defaultEditorId : null }, i));
|
|
101
108
|
}) })) : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
102
109
|
jsx_runtime_1.jsx("pre", { "aria-label": "Unsymbolicated stack trace", className: is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME, style: rawStack, children: (_a = display.error.stack) !== null && _a !== void 0 ? _a : 'Check the Terminal and browser console for error messages.' }), symbolicationFailure ? (jsx_runtime_1.jsx("div", { style: symbolicationFailureStyle, children: symbolicationFailure })) : null] }))] }));
|
|
103
110
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
1
|
+
import type { EditorPickerId, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const OpenInEditor: React.FC<{
|
|
4
4
|
readonly stack: SymbolicatedStackFrame;
|
|
5
5
|
readonly canHaveKeyboardShortcuts: boolean;
|
|
6
|
+
readonly editorId: EditorPickerId;
|
|
7
|
+
readonly editorName: string;
|
|
6
8
|
}>;
|
|
@@ -31,7 +31,7 @@ const reducer = (state, action) => {
|
|
|
31
31
|
}
|
|
32
32
|
return state;
|
|
33
33
|
};
|
|
34
|
-
const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
|
|
34
|
+
const OpenInEditor = ({ stack, canHaveKeyboardShortcuts, editorId, editorName }) => {
|
|
35
35
|
const isMounted = (0, react_1.useRef)(true);
|
|
36
36
|
const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
|
|
37
37
|
const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
|
|
@@ -42,7 +42,7 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
|
|
|
42
42
|
}, []);
|
|
43
43
|
const openInBrowser = (0, react_1.useCallback)(() => {
|
|
44
44
|
dispatch({ type: 'start' });
|
|
45
|
-
(0, open_in_editor_1.openInEditor)(stack,
|
|
45
|
+
(0, open_in_editor_1.openInEditor)(stack, editorId)
|
|
46
46
|
.then((data) => {
|
|
47
47
|
if (data.success) {
|
|
48
48
|
dispatchIfMounted({ type: 'succeed' });
|
|
@@ -60,7 +60,7 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
|
|
|
60
60
|
dispatchIfMounted({ type: 'reset' });
|
|
61
61
|
}, 2000);
|
|
62
62
|
});
|
|
63
|
-
}, [dispatchIfMounted, stack]);
|
|
63
|
+
}, [dispatchIfMounted, editorId, stack]);
|
|
64
64
|
(0, react_1.useEffect)(() => {
|
|
65
65
|
return () => {
|
|
66
66
|
isMounted.current = false;
|
|
@@ -89,15 +89,15 @@ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
|
|
|
89
89
|
case 'error':
|
|
90
90
|
return 'Failed to open';
|
|
91
91
|
case 'idle':
|
|
92
|
-
return `Open in ${
|
|
92
|
+
return `Open in ${editorName}`;
|
|
93
93
|
case 'success':
|
|
94
|
-
return `Opened in ${
|
|
94
|
+
return `Opened in ${editorName}`;
|
|
95
95
|
case 'load':
|
|
96
96
|
return `Opening...`;
|
|
97
97
|
default:
|
|
98
98
|
throw new Error('invalid state');
|
|
99
99
|
}
|
|
100
|
-
}, [state.type]);
|
|
100
|
+
}, [editorName, state.type]);
|
|
101
101
|
return (jsx_runtime_1.jsxs(Button_1.Button, { onClick: openInBrowser, disabled: state.type !== 'idle', children: [label, canHaveKeyboardShortcuts ? (jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "o", cmdOrCtrl: true })) : null] }));
|
|
102
102
|
};
|
|
103
103
|
exports.OpenInEditor = OpenInEditor;
|
|
@@ -5,6 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const menu_toolbar_height_1 = require("../../components/menu-toolbar-height");
|
|
8
|
+
const SettingsContext_1 = require("../../components/SettingsContext");
|
|
9
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
8
10
|
const colors_1 = require("../../helpers/colors");
|
|
9
11
|
const keybindings_1 = require("../../state/keybindings");
|
|
10
12
|
const ErrorLoader_1 = require("./ErrorLoader");
|
|
@@ -41,17 +43,17 @@ const Overlay = () => {
|
|
|
41
43
|
if (errors.errors.length === 0) {
|
|
42
44
|
return null;
|
|
43
45
|
}
|
|
44
|
-
return (jsx_runtime_1.jsx(keybindings_1.KeybindingContextProvider, { children: jsx_runtime_1.jsx(remotion_1.AbsoluteFill, { style: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
return (jsx_runtime_1.jsx(client_id_1.PreviewServerConnection, { children: jsx_runtime_1.jsx(SettingsContext_1.SettingsProvider, { children: jsx_runtime_1.jsx(keybindings_1.KeybindingContextProvider, { children: jsx_runtime_1.jsx(remotion_1.AbsoluteFill, { style: {
|
|
47
|
+
backgroundColor: BACKGROUND_COLOR,
|
|
48
|
+
overflow: 'auto',
|
|
49
|
+
color: colors_1.WHITE,
|
|
50
|
+
top: menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT,
|
|
51
|
+
height: `calc(100% - ${menu_toolbar_height_1.MENU_TOOLBAR_HEIGHT}px)`,
|
|
52
|
+
}, children: errors.errors.map((err, i) => {
|
|
53
|
+
var _a;
|
|
54
|
+
return (jsx_runtime_1.jsx(ErrorLoader_1.ErrorLoader
|
|
55
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
56
|
+
, { keyboardShortcuts: i === 0, error: err, onRetry: null, canHaveDismissButton: true, calculateMetadata: false }, ((_a = err.stack) !== null && _a !== void 0 ? _a : '') + i));
|
|
57
|
+
}) }) }) }) }));
|
|
56
58
|
};
|
|
57
59
|
exports.Overlay = Overlay;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
1
|
+
import type { EditorPickerId, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const StackElement: React.FC<{
|
|
4
4
|
readonly s: SymbolicatedStackFrame;
|
|
5
5
|
readonly lineNumberWidth: number;
|
|
6
6
|
readonly isFirst: boolean;
|
|
7
7
|
readonly defaultFunctionName: string;
|
|
8
|
+
readonly editorId: EditorPickerId | null;
|
|
8
9
|
}>;
|
|
@@ -34,7 +34,7 @@ const fnName = {
|
|
|
34
34
|
lineHeight: 1.5,
|
|
35
35
|
marginBottom: 3,
|
|
36
36
|
};
|
|
37
|
-
const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
|
|
37
|
+
const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName, editorId }) => {
|
|
38
38
|
var _a;
|
|
39
39
|
const [showCodeFrame, setShowCodeFrame] = (0, react_1.useState)(() => {
|
|
40
40
|
var _a, _b;
|
|
@@ -43,16 +43,19 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
|
|
|
43
43
|
isFirst;
|
|
44
44
|
});
|
|
45
45
|
const [locationHovered, setLocationHovered] = (0, react_1.useState)(false);
|
|
46
|
-
const canOpenFileLocation = Boolean(
|
|
46
|
+
const canOpenFileLocation = Boolean(editorId && s.originalFileName);
|
|
47
47
|
const onOpenFileLocation = (0, react_1.useCallback)(() => {
|
|
48
48
|
if (!canOpenFileLocation) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
if (!editorId) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
(0, open_in_editor_1.openInEditor)(s, editorId).catch((err) => {
|
|
52
55
|
// eslint-disable-next-line no-console
|
|
53
56
|
console.log('Could not open in editor', err);
|
|
54
57
|
});
|
|
55
|
-
}, [canOpenFileLocation, s]);
|
|
58
|
+
}, [canOpenFileLocation, editorId, s]);
|
|
56
59
|
const toggleCodeFrame = (0, react_1.useCallback)(() => {
|
|
57
60
|
setShowCodeFrame((f) => !f);
|
|
58
61
|
}, []);
|