@remotion/studio 4.0.501 → 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.
- package/dist/components/AssetSelectorItem.js +2 -2
- package/dist/components/Canvas.js +3 -3
- package/dist/components/CompositionSelector.js +4 -4
- package/dist/components/CompositionSelectorItem.js +5 -5
- package/dist/components/EditorContent.js +1 -1
- package/dist/components/FullscreenToggle.d.ts +3 -1
- package/dist/components/FullscreenToggle.js +2 -2
- package/dist/components/InlineAction.js +1 -1
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +1 -1
- package/dist/components/InspectorPanel/use-composition-actions.js +46 -3
- package/dist/components/LoopToggle.d.ts +1 -0
- package/dist/components/LoopToggle.js +9 -5
- package/dist/components/Menu/MenuSubItem.js +9 -1
- package/dist/components/ObserveDefaultPropsContext.js +7 -4
- package/dist/components/PlayPause.d.ts +1 -0
- package/dist/components/PlayPause.js +2 -4
- package/dist/components/PlaybackRateSelector.d.ts +9 -2
- package/dist/components/PlaybackRateSelector.js +21 -10
- package/dist/components/PreviewToolbar.js +19 -109
- package/dist/components/PreviewToolbarOverflowButton.d.ts +12 -0
- package/dist/components/PreviewToolbarOverflowButton.js +217 -0
- package/dist/components/QuickSwitcher/QuickSwitcher.d.ts +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.d.ts +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +16 -1
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +2 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +7 -1
- package/dist/components/RenderButton.d.ts +1 -0
- package/dist/components/RenderButton.js +6 -4
- package/dist/components/SizeSelector.d.ts +6 -0
- package/dist/components/SizeSelector.js +17 -8
- package/dist/components/Splitter/SplitterContainer.d.ts +1 -0
- package/dist/components/Splitter/SplitterContainer.js +23 -3
- package/dist/components/Splitter/SplitterContext.d.ts +14 -0
- package/dist/components/Splitter/SplitterContext.js +16 -1
- package/dist/components/Splitter/SplitterHandle.js +8 -6
- package/dist/components/Timeline/Timeline.js +2 -1
- package/dist/components/Timeline/TimelineAssetField.d.ts +1 -1
- package/dist/components/Timeline/TimelineAssetField.js +36 -1
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineStack/get-stack.js +8 -0
- package/dist/components/Timeline/save-sequence-prop.js +4 -4
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -2
- package/dist/components/Timeline/sequence-props-subscription-store.js +3 -3
- package/dist/components/TopPanel.js +1 -1
- package/dist/components/UpdateCheck.js +11 -4
- package/dist/components/default-props-api.d.ts +3 -0
- package/dist/components/default-props-api.js +19 -0
- package/dist/components/drop-handler-data.d.ts +1 -1
- package/dist/components/drop-handler-data.js +6 -6
- package/dist/components/effect-drag-and-drop.d.ts +1 -1
- package/dist/components/effect-drag-and-drop.js +3 -3
- package/dist/components/element-drag-and-drop.d.ts +1 -1
- package/dist/components/element-drag-and-drop.js +3 -3
- package/dist/components/import-assets.d.ts +4 -4
- package/dist/components/sequence-props-api.d.ts +4 -0
- package/dist/components/sequence-props-api.js +26 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +29 -5
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +4 -20
- package/dist/esm/{chunk-n1kj09yv.js → chunk-fjv75ty4.js} +4122 -3579
- package/dist/esm/internals.mjs +4122 -3579
- package/dist/esm/previewEntry.mjs +4175 -3632
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/icons/upload.d.ts +4 -0
- package/dist/icons/upload.js +8 -0
- package/dist/state/modals.d.ts +1 -0
- package/package.json +13 -13
|
@@ -3,11 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TimelineAssetField = exports.toFileToken = exports.AssetSelectionContext = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
6
7
|
const no_react_1 = require("remotion/no-react");
|
|
8
|
+
const write_static_file_1 = require("../../api/write-static-file");
|
|
7
9
|
const pen_1 = require("../../icons/pen");
|
|
8
10
|
const modals_1 = require("../../state/modals");
|
|
11
|
+
const import_assets_1 = require("../import-assets");
|
|
9
12
|
const InlineAction_1 = require("../InlineAction");
|
|
10
13
|
const common_1 = require("../InspectorPanel/common");
|
|
14
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
15
|
+
const use_static_files_1 = require("../use-static-files");
|
|
11
16
|
const penIcon = {
|
|
12
17
|
display: 'block',
|
|
13
18
|
height: 14,
|
|
@@ -30,6 +35,7 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
|
|
|
30
35
|
throw new Error('TimelineAssetField rendered for non-asset field');
|
|
31
36
|
}
|
|
32
37
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
38
|
+
const staticFiles = (0, use_static_files_1.useStaticFiles)();
|
|
33
39
|
const { getSourceAction, initialQuery, sourceAction } = (0, react_1.useContext)(exports.AssetSelectionContext);
|
|
34
40
|
const inlineSourceAction = (0, react_1.useMemo)(() => {
|
|
35
41
|
if (field.key !== 'src') {
|
|
@@ -49,6 +55,32 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
|
|
|
49
55
|
onDragEnd();
|
|
50
56
|
});
|
|
51
57
|
}, [propStatus.codeValue, onDragValueChange, onSave, onDragEnd]);
|
|
58
|
+
const selectFile = (0, react_1.useCallback)(async () => {
|
|
59
|
+
const [file] = await (0, import_assets_1.pickFilesToImport)({ multiple: false });
|
|
60
|
+
if (!file) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const existing = staticFiles.find((candidate) => candidate.name === file.name);
|
|
64
|
+
if (existing && existing.sizeInBytes !== file.size) {
|
|
65
|
+
(0, NotificationCenter_1.showNotification)(`File with name ${file.name} already exists and is different`, 4000);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
if (!existing) {
|
|
70
|
+
await (0, write_static_file_1.writeStaticFile)({
|
|
71
|
+
contents: await file.arrayBuffer(),
|
|
72
|
+
filePath: file.name,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
onSelect(file.name, (0, remotion_1.staticFile)(file.name));
|
|
76
|
+
if (!existing) {
|
|
77
|
+
(0, NotificationCenter_1.showNotification)(`Created ${file.name} in public folder`, 3000);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
(0, NotificationCenter_1.showNotification)(`Could not upload asset: ${error instanceof Error ? error.message : String(error)}`, 4000);
|
|
82
|
+
}
|
|
83
|
+
}, [onSelect, staticFiles]);
|
|
52
84
|
const openAssetSelection = (0, react_1.useCallback)(() => {
|
|
53
85
|
setSelectedModal({
|
|
54
86
|
type: 'quick-switcher',
|
|
@@ -56,11 +88,14 @@ const TimelineAssetField = ({ field, effectiveValue, propStatus, onSave, onDragV
|
|
|
56
88
|
invocationTimestamp: Date.now(),
|
|
57
89
|
assetSelection: {
|
|
58
90
|
initialQuery,
|
|
91
|
+
onSelectFile: () => {
|
|
92
|
+
selectFile().catch(() => undefined);
|
|
93
|
+
},
|
|
59
94
|
onSelected: (asset) => onSelect(asset.name, asset.src),
|
|
60
95
|
},
|
|
61
96
|
compositionSelection: null,
|
|
62
97
|
});
|
|
63
|
-
}, [initialQuery, onSelect, setSelectedModal]);
|
|
98
|
+
}, [initialQuery, onSelect, selectFile, setSelectedModal]);
|
|
64
99
|
const action = (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: openAssetSelection, disabled: window.remotion_isReadOnlyStudio, title: "Change source", renderAction: (color) => jsx_runtime_1.jsx(pen_1.PenIcon, { color: color, style: penIcon }) }));
|
|
65
100
|
if (inlineSourceAction === null) {
|
|
66
101
|
return action;
|
|
@@ -89,7 +89,7 @@ const TimelineDragHandler = () => {
|
|
|
89
89
|
if (!canvasContent || canvasContent.type !== 'composition') {
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
return (jsx_runtime_1.jsx("div", { ref: timeline_refs_1.sliderAreaRef, style: containerStyle, [TimelineSelection_1.TIMELINE_SCRUBBER_ATTR]: true, children: video && (0, interactivity_enabled_1.
|
|
92
|
+
return (jsx_runtime_1.jsx("div", { ref: timeline_refs_1.sliderAreaRef, style: containerStyle, [TimelineSelection_1.TIMELINE_SCRUBBER_ATTR]: true, children: video && (0, interactivity_enabled_1.isStudioSelectionEnabled)() ? (jsx_runtime_1.jsx(TimelineDragHandlerInnerMemo, {})) : null }));
|
|
93
93
|
};
|
|
94
94
|
exports.TimelineDragHandler = TimelineDragHandler;
|
|
95
95
|
const TimelineDragHandlerInner = () => {
|
|
@@ -6,6 +6,7 @@ const get_source_map_1 = require("../../../error-overlay/react-overlay/utils/get
|
|
|
6
6
|
const get_location_of_sequence_1 = require("../../../helpers/get-location-of-sequence");
|
|
7
7
|
const traceMapCache = {};
|
|
8
8
|
const traceMapPromises = {};
|
|
9
|
+
const browserStudioOriginalSourcePrefix = 'browser-studio-original://';
|
|
9
10
|
const getSourceMapCache = async (fileName) => {
|
|
10
11
|
if (traceMapCache[fileName]) {
|
|
11
12
|
return traceMapCache[fileName];
|
|
@@ -32,6 +33,13 @@ const getOriginalLocationFromStack = async (stack, type) => {
|
|
|
32
33
|
if (!location) {
|
|
33
34
|
return null;
|
|
34
35
|
}
|
|
36
|
+
if (location.fileName.startsWith(browserStudioOriginalSourcePrefix)) {
|
|
37
|
+
return {
|
|
38
|
+
column: location.columnNumber,
|
|
39
|
+
line: location.lineNumber,
|
|
40
|
+
source: decodeURIComponent(location.fileName.slice(browserStudioOriginalSourcePrefix.length)),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
35
43
|
const map = await getSourceMapCache(location.fileName);
|
|
36
44
|
const originalPosition = (0, get_source_map_1.getOriginalPosition)(map, location.lineNumber, location.columnNumber);
|
|
37
45
|
return originalPosition;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.saveSequenceProps = exports.saveInlineCaptionPatches = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
-
const
|
|
5
|
+
const sequence_props_api_1 = require("../sequence-props-api");
|
|
6
6
|
const call_move_keyframe_1 = require("./call-move-keyframe");
|
|
7
7
|
const save_prop_queue_1 = require("./save-prop-queue");
|
|
8
8
|
const serializeSequencePropValue = (value) => {
|
|
@@ -22,7 +22,7 @@ const saveInlineCaptionPatches = ({ fileName, nodePath, schema, patches, nextCap
|
|
|
22
22
|
defaultValue: null,
|
|
23
23
|
schema,
|
|
24
24
|
}),
|
|
25
|
-
apiCall: () => (0,
|
|
25
|
+
apiCall: () => (0, sequence_props_api_1.saveSequenceProps)({
|
|
26
26
|
edits: [],
|
|
27
27
|
captionPatches: [{ fileName, nodePath, schema, patches }],
|
|
28
28
|
addedKeyframes: null,
|
|
@@ -65,7 +65,7 @@ const saveSequenceProps = ({ changes, addedKeyframes, movedKeyframes, setPropSta
|
|
|
65
65
|
}),
|
|
66
66
|
apiCall: () => {
|
|
67
67
|
var _a;
|
|
68
|
-
return (0,
|
|
68
|
+
return (0, sequence_props_api_1.saveSequenceProps)({
|
|
69
69
|
edits: [
|
|
70
70
|
{
|
|
71
71
|
fileName: change.fileName,
|
|
@@ -110,7 +110,7 @@ const saveSequenceProps = ({ changes, addedKeyframes, movedKeyframes, setPropSta
|
|
|
110
110
|
schema: change.schema,
|
|
111
111
|
}));
|
|
112
112
|
}
|
|
113
|
-
return (0,
|
|
113
|
+
return (0, sequence_props_api_1.saveSequenceProps)({
|
|
114
114
|
edits: changes.map((change) => {
|
|
115
115
|
var _a;
|
|
116
116
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SequenceNodePath, InteractivitySchema, VideoConfigValues } from 'remotion';
|
|
2
|
-
import {
|
|
3
|
-
type SubscribeResult = Awaited<ReturnType<typeof
|
|
2
|
+
import { subscribeToSequenceProps } from '../sequence-props-api';
|
|
3
|
+
type SubscribeResult = Awaited<ReturnType<typeof subscribeToSequenceProps>>;
|
|
4
4
|
type ApplyResult = (result: SubscribeResult) => void;
|
|
5
5
|
export declare const acquireSequencePropsSubscription: ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, videoConfigValues, }: {
|
|
6
6
|
fileName: string;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.acquireSequencePropsSubscription = void 0;
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
-
const
|
|
6
|
+
const sequence_props_api_1 = require("../sequence-props-api");
|
|
7
7
|
const makeKey = ({ fileName, line, column, componentIdentity, sequenceKeys, assetKeys, effectKeys, videoConfigValues, }) => `${fileName}\0${line}\0${column}\0${componentIdentity !== null && componentIdentity !== void 0 ? componentIdentity : ''}\0${sequenceKeys.join('\0')}\0${assetKeys.join('\0')}\0${effectKeys.map((keys) => keys.join('\0')).join('\0\0')}\0${JSON.stringify(videoConfigValues)}`;
|
|
8
8
|
const entries = new Map();
|
|
9
9
|
const acquireSequencePropsSubscription = ({ fileName, line, column, schema, componentIdentity, effects, nodePath, clientId, applyOnce, applyEach, videoConfigValues, }) => {
|
|
@@ -22,7 +22,7 @@ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, comp
|
|
|
22
22
|
});
|
|
23
23
|
let entry = entries.get(key);
|
|
24
24
|
if (!entry) {
|
|
25
|
-
const promise = (0,
|
|
25
|
+
const promise = (0, sequence_props_api_1.subscribeToSequenceProps)({
|
|
26
26
|
fileName,
|
|
27
27
|
line,
|
|
28
28
|
column,
|
|
@@ -86,7 +86,7 @@ const acquireSequencePropsSubscription = ({ fileName, line, column, schema, comp
|
|
|
86
86
|
if (!result.success) {
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
return (0,
|
|
89
|
+
return (0, sequence_props_api_1.unsubscribeFromSequenceProps)({
|
|
90
90
|
fileName: acquired.fileName,
|
|
91
91
|
nodePath: result.nodePath,
|
|
92
92
|
clientId: acquired.clientId,
|
|
@@ -114,7 +114,7 @@ const TopPanelInner = ({ readOnlyStudio, onMounted, drawRef, bufferStateDelayInM
|
|
|
114
114
|
return (jsx_runtime_1.jsx(ObserveDefaultPropsContext_1.ObserveDefaultProps, { compositionId: (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition'
|
|
115
115
|
? canvasContent.compositionId
|
|
116
116
|
: null, readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
117
|
-
jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, maxFlexerSize: MAX_SIDEBAR_WIDTH, maxAntiFlexerSize: null, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? (isMobileLayout ? (jsx_runtime_1.jsx(MobilePanel_1.default, { onClose: onCollapseLeft, side: "left", children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) })) : (jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) }))) : null, actualStateLeft === 'expanded' && !isMobileLayout ? (jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, maxFlexerSize: null, maxAntiFlexerSize: MAX_SIDEBAR_WIDTH, id: "canvas-to-right-sidebar", orientation: "vertical", children: [
|
|
117
|
+
jsx_runtime_1.jsx("div", { style: row, children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.15, maxFlex: 0.4, defaultFlex: 0.2, maxFlexerSize: MAX_SIDEBAR_WIDTH, minFlexerSize: null, maxAntiFlexerSize: null, id: "sidebar-to-preview", orientation: "vertical", children: [actualStateLeft === 'expanded' ? (isMobileLayout ? (jsx_runtime_1.jsx(MobilePanel_1.default, { onClose: onCollapseLeft, side: "left", children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) })) : (jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: jsx_runtime_1.jsx(ExplorerPanel_1.ExplorerPanel, { readOnlyStudio: readOnlyStudio }) }))) : null, actualStateLeft === 'expanded' && !isMobileLayout ? (jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "left", onCollapse: onCollapseLeft })) : null, jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { minFlex: 0.5, maxFlex: 0.8, defaultFlex: 0.7, maxFlexerSize: null, minFlexerSize: null, maxAntiFlexerSize: MAX_SIDEBAR_WIDTH, id: "canvas-to-right-sidebar", orientation: "vertical", children: [
|
|
118
118
|
jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: jsx_runtime_1.jsx("div", { ref: drawRef, style: canvasContainerStyle, children: jsx_runtime_1.jsx(CanvasIfSizeIsAvailable_1.CanvasIfSizeIsAvailable, {}) }) }), actualStateRight === 'expanded' && !isMobileLayout ? (jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "right", onCollapse: onCollapseRight })) : null, actualStateRight === 'expanded' ? (isMobileLayout ? (jsx_runtime_1.jsx(MobilePanel_1.default, { onClose: onCollapseRight, side: "right", children: jsx_runtime_1.jsx(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) })) : (jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: jsx_runtime_1.jsx(OptionsPanel_1.OptionsPanel, { readOnlyStudio: readOnlyStudio }) }))) : null] }) })
|
|
119
119
|
] }) }), jsx_runtime_1.jsx(PreviewToolbar_1.PreviewToolbar, { bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds, readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(CurrentCompositionSideEffects_1.TitleUpdater, {})
|
|
120
120
|
] }) }));
|
|
@@ -10,7 +10,6 @@ const z_index_1 = require("../state/z-index");
|
|
|
10
10
|
const actions_1 = require("./RenderQueue/actions");
|
|
11
11
|
const buttonStyle = {
|
|
12
12
|
appearance: 'none',
|
|
13
|
-
color: colors_1.BLUE,
|
|
14
13
|
border: 'none',
|
|
15
14
|
fontWeight: 'bold',
|
|
16
15
|
backgroundColor: colors_1.TRANSPARENT,
|
|
@@ -24,6 +23,7 @@ const UpdateCheck = () => {
|
|
|
24
23
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
25
24
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
26
25
|
const [knownBugs, setKnownBugs] = (0, react_1.useState)(null);
|
|
26
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
27
27
|
const hasKnownBugs = (0, react_1.useMemo)(() => {
|
|
28
28
|
return knownBugs && knownBugs.length > 0;
|
|
29
29
|
}, [knownBugs]);
|
|
@@ -78,18 +78,25 @@ const UpdateCheck = () => {
|
|
|
78
78
|
const dynButtonStyle = (0, react_1.useMemo)(() => {
|
|
79
79
|
return {
|
|
80
80
|
...buttonStyle,
|
|
81
|
-
color: hasKnownBugs ? colors_1.WARNING_COLOR : colors_1.
|
|
81
|
+
color: hovered ? colors_1.WHITE : hasKnownBugs ? colors_1.WARNING_COLOR : colors_1.WHITE_ALPHA_80,
|
|
82
82
|
};
|
|
83
|
-
}, [hasKnownBugs]);
|
|
83
|
+
}, [hasKnownBugs, hovered]);
|
|
84
|
+
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
85
|
+
setHovered(true);
|
|
86
|
+
}, []);
|
|
87
|
+
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
88
|
+
setHovered(false);
|
|
89
|
+
}, []);
|
|
84
90
|
if (!info) {
|
|
85
91
|
return null;
|
|
86
92
|
}
|
|
87
93
|
if (!info.updateAvailable) {
|
|
88
94
|
return null;
|
|
89
95
|
}
|
|
90
|
-
return (jsx_runtime_1.jsx("button", { tabIndex: tabIndex, style: dynButtonStyle, onClick: openModal, type: "button", title: hasKnownBugs ? 'Bugfixes available' : 'Update available', children: hasKnownBugs ? ('Bugfixes available') : (jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", style: {
|
|
96
|
+
return (jsx_runtime_1.jsx("button", { tabIndex: tabIndex, style: dynButtonStyle, onClick: openModal, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, type: "button", title: hasKnownBugs ? 'Bugfixes available' : 'Update available', children: hasKnownBugs ? ('Bugfixes available') : (jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", style: {
|
|
91
97
|
height: 16,
|
|
92
98
|
width: 16,
|
|
99
|
+
color: 'inherit',
|
|
93
100
|
}, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.CURRENT_COLOR_LOWERCASE, d: "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM135.1 217.4c-4.5 4.2-7.1 10.1-7.1 16.3c0 12.3 10 22.3 22.3 22.3H208v96c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32V256h57.7c12.3 0 22.3-10 22.3-22.3c0-6.2-2.6-12.1-7.1-16.3L269.8 117.5c-3.8-3.5-8.7-5.5-13.8-5.5s-10.1 2-13.8 5.5L135.1 217.4z" }) })) }));
|
|
94
101
|
};
|
|
95
102
|
exports.UpdateCheck = UpdateCheck;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SubscribeToDefaultPropsRequest, UnsubscribeFromDefaultPropsRequest } from '@remotion/studio-shared';
|
|
2
|
+
export declare const subscribeToDefaultProps: (request: SubscribeToDefaultPropsRequest) => Promise<import("@remotion/studio-shared").CanUpdateDefaultPropsResponse>;
|
|
3
|
+
export declare const unsubscribeFromDefaultProps: (request: UnsubscribeFromDefaultPropsRequest) => Promise<undefined>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unsubscribeFromDefaultProps = exports.subscribeToDefaultProps = void 0;
|
|
4
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
|
+
const call_api_1 = require("./call-api");
|
|
6
|
+
const subscribeToDefaultProps = (request) => {
|
|
7
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
8
|
+
return browserStudioOperations
|
|
9
|
+
? browserStudioOperations.subscribeToDefaultProps(request)
|
|
10
|
+
: (0, call_api_1.callApi)('/api/subscribe-to-default-props', request);
|
|
11
|
+
};
|
|
12
|
+
exports.subscribeToDefaultProps = subscribeToDefaultProps;
|
|
13
|
+
const unsubscribeFromDefaultProps = (request) => {
|
|
14
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
15
|
+
return browserStudioOperations
|
|
16
|
+
? browserStudioOperations.unsubscribeFromDefaultProps(request)
|
|
17
|
+
: (0, call_api_1.callApi)('/api/unsubscribe-from-default-props', request);
|
|
18
|
+
};
|
|
19
|
+
exports.unsubscribeFromDefaultProps = unsubscribeFromDefaultProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentDragData, type CompositionDragData } from '@remotion/
|
|
1
|
+
import { type ComponentDragData, type CompositionDragData } from '@remotion/studio-protocol';
|
|
2
2
|
export declare const isFileDragEvent: (event: DragEvent) => boolean;
|
|
3
3
|
export declare const isAssetDragEvent: (event: DragEvent) => boolean;
|
|
4
4
|
export declare const isComponentDragEvent: (event: DragEvent) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSfxDragUrl = exports.getComponentDragData = exports.getCompositionDragData = exports.getAssetDragPath = exports.isSupportedDropEvent = exports.isRemoteAssetDragEvent = exports.isSfxDragEvent = exports.isElementDragEvent = exports.isCompositionDragEvent = exports.isComponentDragEvent = exports.isAssetDragEvent = exports.isFileDragEvent = void 0;
|
|
4
|
-
const
|
|
4
|
+
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
5
5
|
const remote_asset_drag_1 = require("../helpers/remote-asset-drag");
|
|
6
6
|
const isFileDragEvent = (event) => {
|
|
7
7
|
var _a;
|
|
@@ -12,7 +12,7 @@ exports.isFileDragEvent = isFileDragEvent;
|
|
|
12
12
|
const isRemotionDragEvent = (event, type) => {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
var _c;
|
|
15
|
-
return (((_b =
|
|
15
|
+
return (((_b = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata((_c = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) !== null && _c !== void 0 ? _c : [])) === null || _b === void 0 ? void 0 : _b.type) === type);
|
|
16
16
|
};
|
|
17
17
|
const isAssetDragEvent = (event) => {
|
|
18
18
|
return isRemotionDragEvent(event, 'asset');
|
|
@@ -56,28 +56,28 @@ const isSupportedDropEvent = (event) => {
|
|
|
56
56
|
exports.isSupportedDropEvent = isSupportedDropEvent;
|
|
57
57
|
const getAssetDragPath = (event) => {
|
|
58
58
|
const parsed = event.dataTransfer
|
|
59
|
-
?
|
|
59
|
+
? studio_protocol_1.StudioProtocolInternals.parseDragData(event.dataTransfer)
|
|
60
60
|
: null;
|
|
61
61
|
return (parsed === null || parsed === void 0 ? void 0 : parsed.type) === 'asset' ? parsed.data.assetPath : null;
|
|
62
62
|
};
|
|
63
63
|
exports.getAssetDragPath = getAssetDragPath;
|
|
64
64
|
const getCompositionDragData = (event) => {
|
|
65
65
|
const parsed = event.dataTransfer
|
|
66
|
-
?
|
|
66
|
+
? studio_protocol_1.StudioProtocolInternals.parseDragData(event.dataTransfer)
|
|
67
67
|
: null;
|
|
68
68
|
return (parsed === null || parsed === void 0 ? void 0 : parsed.type) === 'composition' ? parsed.data : null;
|
|
69
69
|
};
|
|
70
70
|
exports.getCompositionDragData = getCompositionDragData;
|
|
71
71
|
const getComponentDragData = (event) => {
|
|
72
72
|
const parsed = event.dataTransfer
|
|
73
|
-
?
|
|
73
|
+
? studio_protocol_1.StudioProtocolInternals.parseDragData(event.dataTransfer)
|
|
74
74
|
: null;
|
|
75
75
|
return (parsed === null || parsed === void 0 ? void 0 : parsed.type) === 'component' ? parsed.data : null;
|
|
76
76
|
};
|
|
77
77
|
exports.getComponentDragData = getComponentDragData;
|
|
78
78
|
const getSfxDragUrl = (event) => {
|
|
79
79
|
const parsed = event.dataTransfer
|
|
80
|
-
?
|
|
80
|
+
? studio_protocol_1.StudioProtocolInternals.parseDragData(event.dataTransfer)
|
|
81
81
|
: null;
|
|
82
82
|
return (parsed === null || parsed === void 0 ? void 0 : parsed.type) === 'sfx' ? parsed.data.sfx.url : null;
|
|
83
83
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EffectDragData } from '@remotion/
|
|
1
|
+
import { type EffectDragData } from '@remotion/studio-protocol';
|
|
2
2
|
import type { SequencePropsSubscriptionKey } from 'remotion';
|
|
3
3
|
export declare const hasEffectDragType: (dataTransfer: DataTransfer) => boolean;
|
|
4
4
|
export declare const hasExplicitEffectDragType: (dataTransfer: DataTransfer) => boolean;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addEffectToSequence = exports.addEffectFromDragData = exports.getEffectDragData = exports.hasExplicitEffectDragType = exports.hasEffectDragType = void 0;
|
|
4
|
-
const
|
|
4
|
+
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
5
5
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
6
6
|
const install_required_package_1 = require("../helpers/install-required-package");
|
|
7
7
|
const call_api_1 = require("./call-api");
|
|
8
8
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
9
9
|
const hasEffectDragType = (dataTransfer) => {
|
|
10
10
|
var _a;
|
|
11
|
-
return (((_a =
|
|
11
|
+
return (((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata(dataTransfer.types)) === null || _a === void 0 ? void 0 : _a.type) ===
|
|
12
12
|
'effect');
|
|
13
13
|
};
|
|
14
14
|
exports.hasEffectDragType = hasEffectDragType;
|
|
@@ -17,7 +17,7 @@ const hasExplicitEffectDragType = (dataTransfer) => {
|
|
|
17
17
|
};
|
|
18
18
|
exports.hasExplicitEffectDragType = hasExplicitEffectDragType;
|
|
19
19
|
const getEffectDragData = (dataTransfer) => {
|
|
20
|
-
const parsed =
|
|
20
|
+
const parsed = studio_protocol_1.StudioProtocolInternals.parseDragData(dataTransfer);
|
|
21
21
|
return (parsed === null || parsed === void 0 ? void 0 : parsed.type) === 'effect' ? parsed.data : null;
|
|
22
22
|
};
|
|
23
23
|
exports.getEffectDragData = getEffectDragData;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type ElementDragData } from '@remotion/
|
|
1
|
+
import { type ElementDragData } from '@remotion/studio-protocol';
|
|
2
2
|
export declare const hasElementDragType: (dataTransfer: DataTransfer | null) => boolean;
|
|
3
3
|
export declare const getElementDragData: (dataTransfer: DataTransfer | null) => ElementDragData | null;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getElementDragData = exports.hasElementDragType = void 0;
|
|
4
|
-
const
|
|
4
|
+
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
5
5
|
const hasElementDragType = (dataTransfer) => {
|
|
6
6
|
var _a;
|
|
7
7
|
var _b;
|
|
8
|
-
return (((_a =
|
|
8
|
+
return (((_a = studio_protocol_1.StudioProtocolInternals.getDragPreviewMetadata((_b = dataTransfer === null || dataTransfer === void 0 ? void 0 : dataTransfer.types) !== null && _b !== void 0 ? _b : [])) === null || _a === void 0 ? void 0 : _a.type) === 'element');
|
|
9
9
|
};
|
|
10
10
|
exports.hasElementDragType = hasElementDragType;
|
|
11
11
|
const getElementDragData = (dataTransfer) => {
|
|
12
12
|
if (!dataTransfer) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
const parsed =
|
|
15
|
+
const parsed = studio_protocol_1.StudioProtocolInternals.parseDragData(dataTransfer);
|
|
16
16
|
return (parsed === null || parsed === void 0 ? void 0 : parsed.type) === 'element' ? parsed.data : null;
|
|
17
17
|
};
|
|
18
18
|
exports.getElementDragData = getElementDragData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CompositionDragData, type ComponentProp } from '@remotion/
|
|
1
|
+
import { type CompositionDragData, type ComponentProp } from '@remotion/studio-protocol';
|
|
2
2
|
import { type FileType, type InsertElementFileConflict, type InsertableCompositionElementPosition } from '@remotion/studio-shared';
|
|
3
3
|
import type { Dimensions } from '../helpers/is-current-selected-still';
|
|
4
4
|
export type InsertElementDropPosition = {
|
|
@@ -64,7 +64,7 @@ export declare const getAssetPositionForDrop: ({ assetDimensions, destinationDim
|
|
|
64
64
|
}) => InsertableCompositionElementPosition | null;
|
|
65
65
|
export declare const getComponentDimensions: (component: {
|
|
66
66
|
componentName: string;
|
|
67
|
-
dimensions?: import("@remotion/
|
|
67
|
+
dimensions?: import("@remotion/studio-protocol").ComponentDimensions | undefined;
|
|
68
68
|
importName: string;
|
|
69
69
|
importPath: string;
|
|
70
70
|
props: ComponentProp[];
|
|
@@ -128,7 +128,7 @@ export declare const insertExistingAssets: ({ assetPaths, compositionFile, compo
|
|
|
128
128
|
export declare const insertComponent: ({ component, compositionFile, compositionId, dropPosition, from, }: {
|
|
129
129
|
component: {
|
|
130
130
|
componentName: string;
|
|
131
|
-
dimensions?: import("@remotion/
|
|
131
|
+
dimensions?: import("@remotion/studio-protocol").ComponentDimensions | undefined;
|
|
132
132
|
importName: string;
|
|
133
133
|
importPath: string;
|
|
134
134
|
props: ComponentProp[];
|
|
@@ -155,7 +155,7 @@ export declare const insertElement: ({ compositionFile, compositionId, confirmOv
|
|
|
155
155
|
slug: string;
|
|
156
156
|
displayName: string;
|
|
157
157
|
sourceCode: string;
|
|
158
|
-
dimensions: import("@remotion/
|
|
158
|
+
dimensions: import("@remotion/studio-protocol").ComponentDimensions | null;
|
|
159
159
|
};
|
|
160
160
|
from: number | null;
|
|
161
161
|
}) => Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SaveSequencePropsRequest, SaveSequencePropsResponse, SubscribeToSequencePropsRequest, SubscribeToSequencePropsResponse, UnsubscribeFromSequencePropsRequest } from '@remotion/studio-shared';
|
|
2
|
+
export declare const saveSequenceProps: (request: SaveSequencePropsRequest) => Promise<SaveSequencePropsResponse>;
|
|
3
|
+
export declare const subscribeToSequenceProps: (request: SubscribeToSequencePropsRequest) => Promise<SubscribeToSequencePropsResponse>;
|
|
4
|
+
export declare const unsubscribeFromSequenceProps: (request: UnsubscribeFromSequencePropsRequest) => Promise<undefined>;
|
|
@@ -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;
|
|
@@ -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
|
-
|
|
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.
|
|
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.
|
|
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;
|