@remotion/cli 4.1.0-alpha10 → 4.1.0-alpha11
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/editor/components/NewComposition/RemInput.d.ts +2 -2
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/editor/helpers/colors.d.ts +1 -1
- package/package.json +8 -8
- package/dist/editor/components/AssetSelector.d.ts +0 -2
- package/dist/editor/components/AssetSelector.js +0 -30
- package/dist/editor/components/AssetSelectorItem.d.ts +0 -6
- package/dist/editor/components/AssetSelectorItem.js +0 -109
- package/dist/editor/components/ExplorerPanel.d.ts +0 -8
- package/dist/editor/components/ExplorerPanel.js +0 -67
- package/dist/editor/components/OptionsPanel.d.ts +0 -8
- package/dist/editor/components/OptionsPanel.js +0 -79
- package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +0 -42
- package/dist/error-with-stack-frame.d.ts +0 -19
- package/dist/error-with-stack-frame.js +0 -81
- package/dist/handle-javascript-error.d.ts +0 -20
- package/dist/handle-javascript-error.js +0 -81
- package/dist/symbolicate-error.d.ts +0 -3
- package/dist/symbolicate-error.js +0 -24
- package/dist/symbolicate-errors.d.ts +0 -7
- package/dist/symbolicate-errors.js +0 -90
- package/dist/symbolicate-stacktrace.d.ts +0 -28
- package/dist/symbolicate-stacktrace.js +0 -135
- package/dist/symbolicateable-error.d.ts +0 -16
- package/dist/symbolicateable-error.js +0 -18
|
@@ -12,6 +12,6 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
|
|
|
12
12
|
status: 'error' | 'warning' | 'ok';
|
|
13
13
|
isFocused: boolean;
|
|
14
14
|
isHovered: boolean;
|
|
15
|
-
}) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#
|
|
16
|
-
export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" |
|
|
15
|
+
}) => "#ff3232" | "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#f1c40f";
|
|
16
|
+
export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
17
17
|
export {};
|
|
@@ -4,5 +4,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
4
4
|
status: RemInputStatus;
|
|
5
5
|
name: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement
|
|
7
|
+
export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
8
8
|
export {};
|
|
@@ -16,4 +16,4 @@ export declare const BLUE_DISABLED = "#284f73";
|
|
|
16
16
|
export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
|
|
17
17
|
selected: boolean;
|
|
18
18
|
hovered: boolean;
|
|
19
|
-
}) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "
|
|
19
|
+
}) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "rgba(255, 255, 255, 0.06)" | "hsla(0, 0%, 100%, 0.25)";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cli",
|
|
3
|
-
"version": "4.1.0-
|
|
3
|
+
"version": "4.1.0-alpha11",
|
|
4
4
|
"description": "CLI for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"prompts": "2.4.1",
|
|
36
36
|
"semver": "7.5.3",
|
|
37
37
|
"source-map": "0.6.1",
|
|
38
|
-
"@remotion/
|
|
39
|
-
"@remotion/
|
|
40
|
-
"
|
|
41
|
-
"@remotion/
|
|
42
|
-
"remotion": "4.1.0-
|
|
38
|
+
"@remotion/bundler": "4.1.0-alpha11",
|
|
39
|
+
"@remotion/media-utils": "4.1.0-alpha11",
|
|
40
|
+
"remotion": "4.1.0-alpha11",
|
|
41
|
+
"@remotion/renderer": "4.1.0-alpha11",
|
|
42
|
+
"@remotion/player": "4.1.0-alpha11"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=16.8.0",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"typescript": "4.9.5",
|
|
66
66
|
"vitest": "0.31.1",
|
|
67
67
|
"zod": "^3.21.4",
|
|
68
|
-
"@remotion/
|
|
69
|
-
"@remotion/
|
|
68
|
+
"@remotion/zod-types": "4.1.0-alpha11",
|
|
69
|
+
"@remotion/tailwind": "4.1.0-alpha11"
|
|
70
70
|
},
|
|
71
71
|
"keywords": [
|
|
72
72
|
"remotion",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AssetSelector = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const remotion_1 = require("remotion");
|
|
10
|
-
const colors_1 = require("../helpers/colors");
|
|
11
|
-
const z_index_1 = require("../state/z-index");
|
|
12
|
-
const AssetSelectorItem_1 = require("./AssetSelectorItem");
|
|
13
|
-
const container = {
|
|
14
|
-
display: 'flex',
|
|
15
|
-
flexDirection: 'column',
|
|
16
|
-
flex: 1,
|
|
17
|
-
overflow: 'hidden',
|
|
18
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
19
|
-
};
|
|
20
|
-
const list = {
|
|
21
|
-
overflowY: 'auto',
|
|
22
|
-
};
|
|
23
|
-
const AssetSelector = () => {
|
|
24
|
-
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
25
|
-
const staticFiles = react_1.default.useMemo(() => (0, remotion_1.getStaticFiles)(), []);
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)("div", { className: "__remotion-vertical-scrollbar", style: list, children: staticFiles.map((file) => {
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(AssetSelectorItem_1.AssetSelectorItem, { item: file, tabIndex: tabIndex }, `${file.src}`));
|
|
28
|
-
}) }) }));
|
|
29
|
-
};
|
|
30
|
-
exports.AssetSelector = AssetSelector;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.AssetSelectorItem = void 0;
|
|
27
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
-
const react_1 = __importStar(require("react"));
|
|
29
|
-
const colors_1 = require("../helpers/colors");
|
|
30
|
-
const file_1 = require("../icons/file");
|
|
31
|
-
const folder_1 = require("../icons/folder");
|
|
32
|
-
const InlineAction_1 = require("./InlineAction");
|
|
33
|
-
const layout_1 = require("./layout");
|
|
34
|
-
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
35
|
-
const actions_1 = require("./RenderQueue/actions");
|
|
36
|
-
const ASSET_ITEM_HEIGHT = 32;
|
|
37
|
-
const itemStyle = {
|
|
38
|
-
paddingRight: 10,
|
|
39
|
-
paddingTop: 6,
|
|
40
|
-
paddingBottom: 6,
|
|
41
|
-
fontSize: 13,
|
|
42
|
-
display: 'flex',
|
|
43
|
-
textDecoration: 'none',
|
|
44
|
-
cursor: 'default',
|
|
45
|
-
alignItems: 'center',
|
|
46
|
-
marginBottom: 1,
|
|
47
|
-
appearance: 'none',
|
|
48
|
-
border: 'none',
|
|
49
|
-
width: '100%',
|
|
50
|
-
textAlign: 'left',
|
|
51
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
52
|
-
height: ASSET_ITEM_HEIGHT,
|
|
53
|
-
};
|
|
54
|
-
const labelStyle = {
|
|
55
|
-
textAlign: 'left',
|
|
56
|
-
textDecoration: 'none',
|
|
57
|
-
fontSize: 13,
|
|
58
|
-
flex: '1 1 0%',
|
|
59
|
-
whiteSpace: 'nowrap',
|
|
60
|
-
overflow: 'hidden',
|
|
61
|
-
textOverflow: 'ellipsis',
|
|
62
|
-
};
|
|
63
|
-
const iconStyle = {
|
|
64
|
-
width: 18,
|
|
65
|
-
height: 18,
|
|
66
|
-
flexShrink: 0,
|
|
67
|
-
};
|
|
68
|
-
const revealIconStyle = {
|
|
69
|
-
height: 12,
|
|
70
|
-
color: 'currentColor',
|
|
71
|
-
};
|
|
72
|
-
const AssetSelectorItem = ({ item, tabIndex }) => {
|
|
73
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
74
|
-
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
75
|
-
setHovered(true);
|
|
76
|
-
}, []);
|
|
77
|
-
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
78
|
-
setHovered(false);
|
|
79
|
-
}, []);
|
|
80
|
-
const style = (0, react_1.useMemo)(() => {
|
|
81
|
-
return {
|
|
82
|
-
...itemStyle,
|
|
83
|
-
backgroundColor: hovered ? colors_1.CLEAR_HOVER : 'transparent',
|
|
84
|
-
paddingLeft: 12,
|
|
85
|
-
color: hovered ? 'white' : colors_1.LIGHT_TEXT,
|
|
86
|
-
};
|
|
87
|
-
}, [hovered]);
|
|
88
|
-
const label = (0, react_1.useMemo)(() => {
|
|
89
|
-
return {
|
|
90
|
-
...labelStyle,
|
|
91
|
-
color: hovered ? 'white' : colors_1.LIGHT_TEXT,
|
|
92
|
-
};
|
|
93
|
-
}, [hovered]);
|
|
94
|
-
const onClick = (0, react_1.useCallback)(() => {
|
|
95
|
-
console.log('Clicked', item);
|
|
96
|
-
}, [item]);
|
|
97
|
-
const renderAction = (0, react_1.useCallback)((color) => {
|
|
98
|
-
return (0, jsx_runtime_1.jsx)(folder_1.ExpandedFolderIconSolid, { style: revealIconStyle, color: color });
|
|
99
|
-
}, []);
|
|
100
|
-
const revealInExplorer = react_1.default.useCallback(() => {
|
|
101
|
-
(0, actions_1.openInFileExplorer)({
|
|
102
|
-
directory: 'public/' + item.name,
|
|
103
|
-
}).catch((err) => {
|
|
104
|
-
(0, NotificationCenter_1.sendErrorNotification)(`Could not open file: ${err.message}`);
|
|
105
|
-
});
|
|
106
|
-
}, [item.name]);
|
|
107
|
-
return ((0, jsx_runtime_1.jsx)(layout_1.Row, { align: "center", children: (0, jsx_runtime_1.jsxs)("button", { style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, onClick: onClick, type: "button", title: item.name, children: [(0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: iconStyle, color: hovered ? 'white' : colors_1.LIGHT_TEXT }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: label, children: item.name }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: revealInExplorer })] }) }));
|
|
108
|
-
};
|
|
109
|
-
exports.AssetSelectorItem = AssetSelectorItem;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type OptionsSidebarPanel = 'compositions' | 'assets';
|
|
3
|
-
export declare const persistSelectedOptionsSidebarPanel: (panel: OptionsSidebarPanel) => void;
|
|
4
|
-
export declare const optionsSidebarTabs: import("react").RefObject<{
|
|
5
|
-
selectRendersPanel: () => void;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const ExplorerPanel: React.FC<{}>;
|
|
8
|
-
export {};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExplorerPanel = exports.optionsSidebarTabs = exports.persistSelectedOptionsSidebarPanel = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
|
-
const colors_1 = require("../helpers/colors");
|
|
8
|
-
const AssetSelector_1 = require("./AssetSelector");
|
|
9
|
-
const CompositionSelector_1 = require("./CompositionSelector");
|
|
10
|
-
const Tabs_1 = require("./Tabs");
|
|
11
|
-
const container = {
|
|
12
|
-
height: '100%',
|
|
13
|
-
width: '100%',
|
|
14
|
-
maxWidth: '100%',
|
|
15
|
-
display: 'flex',
|
|
16
|
-
flexDirection: 'column',
|
|
17
|
-
flex: 1,
|
|
18
|
-
};
|
|
19
|
-
const localStorageKey = 'remotion.sidebarPanel';
|
|
20
|
-
const getSelectedPanel = () => {
|
|
21
|
-
const panel = localStorage.getItem(localStorageKey);
|
|
22
|
-
if (panel === 'assets') {
|
|
23
|
-
return 'assets';
|
|
24
|
-
}
|
|
25
|
-
return 'compositions';
|
|
26
|
-
};
|
|
27
|
-
const tabsContainer = {
|
|
28
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
29
|
-
};
|
|
30
|
-
const persistSelectedOptionsSidebarPanel = (panel) => {
|
|
31
|
-
localStorage.setItem(localStorageKey, panel);
|
|
32
|
-
};
|
|
33
|
-
exports.persistSelectedOptionsSidebarPanel = persistSelectedOptionsSidebarPanel;
|
|
34
|
-
exports.optionsSidebarTabs = (0, react_1.createRef)();
|
|
35
|
-
const ExplorerPanel = () => {
|
|
36
|
-
const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
|
|
37
|
-
const onCompositionsSelected = (0, react_1.useCallback)(() => {
|
|
38
|
-
setPanel('compositions');
|
|
39
|
-
(0, exports.persistSelectedOptionsSidebarPanel)('compositions');
|
|
40
|
-
}, []);
|
|
41
|
-
const onAssetsSelected = (0, react_1.useCallback)(() => {
|
|
42
|
-
setPanel('assets');
|
|
43
|
-
(0, exports.persistSelectedOptionsSidebarPanel)('assets');
|
|
44
|
-
}, []);
|
|
45
|
-
(0, react_1.useImperativeHandle)(exports.optionsSidebarTabs, () => {
|
|
46
|
-
return {
|
|
47
|
-
selectRendersPanel: () => {
|
|
48
|
-
setPanel('assets');
|
|
49
|
-
(0, exports.persistSelectedOptionsSidebarPanel)('assets');
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
}, []);
|
|
53
|
-
const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
54
|
-
const composition = (0, react_1.useMemo)(() => {
|
|
55
|
-
for (const comp of compositions) {
|
|
56
|
-
if (comp.id === currentComposition) {
|
|
57
|
-
return comp;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
}, [compositions, currentComposition]);
|
|
62
|
-
if (composition === null) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'compositions', onClick: onCompositionsSelected, children: "Compositions" }), (0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'assets', onClick: onAssetsSelected, children: "Assets" })] }) }), panel === 'compositions' ? (0, jsx_runtime_1.jsx)(CompositionSelector_1.CompositionSelector, {}) : (0, jsx_runtime_1.jsx)(AssetSelector_1.AssetSelector, {})] }));
|
|
66
|
-
};
|
|
67
|
-
exports.ExplorerPanel = ExplorerPanel;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type OptionsSidebarPanel = 'input-props' | 'renders';
|
|
3
|
-
export declare const persistSelectedOptionsSidebarPanel: (panel: OptionsSidebarPanel) => void;
|
|
4
|
-
export declare const optionsSidebarTabs: React.RefObject<{
|
|
5
|
-
selectRendersPanel: () => void;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const OptionsPanel: React.FC<{}>;
|
|
8
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OptionsPanel = exports.optionsSidebarTabs = exports.persistSelectedOptionsSidebarPanel = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
|
-
const colors_1 = require("../helpers/colors");
|
|
8
|
-
const DataEditor_1 = require("./RenderModal/DataEditor");
|
|
9
|
-
const RenderQueue_1 = require("./RenderQueue");
|
|
10
|
-
const RendersTab_1 = require("./RendersTab");
|
|
11
|
-
const Tabs_1 = require("./Tabs");
|
|
12
|
-
const container = {
|
|
13
|
-
height: '100%',
|
|
14
|
-
width: '100%',
|
|
15
|
-
position: 'absolute',
|
|
16
|
-
display: 'flex',
|
|
17
|
-
flexDirection: 'column',
|
|
18
|
-
};
|
|
19
|
-
const PropsEditor = ({ composition }) => {
|
|
20
|
-
const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
21
|
-
const setInputProps = (0, react_1.useCallback)((newProps) => {
|
|
22
|
-
updateProps({
|
|
23
|
-
id: composition.id,
|
|
24
|
-
defaultProps: composition.defaultProps,
|
|
25
|
-
newProps,
|
|
26
|
-
});
|
|
27
|
-
}, [composition.defaultProps, composition.id, updateProps]);
|
|
28
|
-
const actualProps = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {}; }, [composition.defaultProps, composition.id, props]);
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props" }, composition.id));
|
|
30
|
-
};
|
|
31
|
-
const localStorageKey = 'remotion.sidebarPanel';
|
|
32
|
-
const getSelectedPanel = () => {
|
|
33
|
-
const panel = localStorage.getItem(localStorageKey);
|
|
34
|
-
if (panel === 'renders') {
|
|
35
|
-
return 'renders';
|
|
36
|
-
}
|
|
37
|
-
return 'input-props';
|
|
38
|
-
};
|
|
39
|
-
const tabsContainer = {
|
|
40
|
-
backgroundColor: colors_1.BACKGROUND,
|
|
41
|
-
};
|
|
42
|
-
const persistSelectedOptionsSidebarPanel = (panel) => {
|
|
43
|
-
localStorage.setItem(localStorageKey, panel);
|
|
44
|
-
};
|
|
45
|
-
exports.persistSelectedOptionsSidebarPanel = persistSelectedOptionsSidebarPanel;
|
|
46
|
-
exports.optionsSidebarTabs = (0, react_1.createRef)();
|
|
47
|
-
const OptionsPanel = () => {
|
|
48
|
-
const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
|
|
49
|
-
const onPropsSelected = (0, react_1.useCallback)(() => {
|
|
50
|
-
setPanel('input-props');
|
|
51
|
-
(0, exports.persistSelectedOptionsSidebarPanel)('input-props');
|
|
52
|
-
}, []);
|
|
53
|
-
const onRendersSelected = (0, react_1.useCallback)(() => {
|
|
54
|
-
setPanel('renders');
|
|
55
|
-
(0, exports.persistSelectedOptionsSidebarPanel)('renders');
|
|
56
|
-
}, []);
|
|
57
|
-
(0, react_1.useImperativeHandle)(exports.optionsSidebarTabs, () => {
|
|
58
|
-
return {
|
|
59
|
-
selectRendersPanel: () => {
|
|
60
|
-
setPanel('renders');
|
|
61
|
-
(0, exports.persistSelectedOptionsSidebarPanel)('renders');
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
}, []);
|
|
65
|
-
const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
66
|
-
const composition = (0, react_1.useMemo)(() => {
|
|
67
|
-
for (const comp of compositions) {
|
|
68
|
-
if (comp.id === currentComposition) {
|
|
69
|
-
return comp;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return null;
|
|
73
|
-
}, [compositions, currentComposition]);
|
|
74
|
-
if (composition === null) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'input-props', onClick: onPropsSelected, children: "Props" }), (0, jsx_runtime_1.jsx)(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })] }) }), panel === 'renders' ? ((0, jsx_runtime_1.jsx)(RenderQueue_1.RenderQueue, {})) : ((0, jsx_runtime_1.jsx)(PropsEditor, { composition: composition }))] }));
|
|
78
|
-
};
|
|
79
|
-
exports.OptionsPanel = OptionsPanel;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type SerializedJSONWithCustomFields = {
|
|
2
|
-
serializedString: string;
|
|
3
|
-
customDateUsed: boolean;
|
|
4
|
-
customFileUsed: boolean;
|
|
5
|
-
mapUsed: boolean;
|
|
6
|
-
setUsed: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const FILE_TOKEN = "remotion-file:";
|
|
9
|
-
export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
|
|
10
|
-
data: unknown;
|
|
11
|
-
indent: number | undefined;
|
|
12
|
-
staticBase: string;
|
|
13
|
-
}) => SerializedJSONWithCustomFields;
|
|
14
|
-
export declare const deserializeJSONWithCustomFields: (data: string) => any;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeJSONWithCustomFields = exports.serializeJSONWithDate = exports.FILE_TOKEN = void 0;
|
|
4
|
-
const DATE_TOKEN = 'remotion-date:';
|
|
5
|
-
exports.FILE_TOKEN = 'remotion-file:';
|
|
6
|
-
const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
|
|
7
|
-
let customDateUsed = false;
|
|
8
|
-
let customFileUsed = false;
|
|
9
|
-
let mapUsed = false;
|
|
10
|
-
let setUsed = false;
|
|
11
|
-
const serializedString = JSON.stringify(data, function (key, value) {
|
|
12
|
-
const item = this[key];
|
|
13
|
-
if (item instanceof Date) {
|
|
14
|
-
customDateUsed = true;
|
|
15
|
-
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
16
|
-
}
|
|
17
|
-
if (item instanceof Map) {
|
|
18
|
-
mapUsed = true;
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
if (item instanceof Set) {
|
|
22
|
-
setUsed = true;
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
if (typeof item === 'string' && item.startsWith(staticBase)) {
|
|
26
|
-
customFileUsed = true;
|
|
27
|
-
return `${exports.FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
|
|
28
|
-
}
|
|
29
|
-
return value;
|
|
30
|
-
}, indent);
|
|
31
|
-
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
32
|
-
};
|
|
33
|
-
exports.serializeJSONWithDate = serializeJSONWithDate;
|
|
34
|
-
const deserializeJSONWithCustomFields = (data) => {
|
|
35
|
-
return JSON.parse(data, (_, value) => {
|
|
36
|
-
if (typeof value === 'string' && value.startsWith(DATE_TOKEN)) {
|
|
37
|
-
return new Date(value.replace(DATE_TOKEN, ''));
|
|
38
|
-
}
|
|
39
|
-
return value;
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
exports.deserializeJSONWithCustomFields = deserializeJSONWithCustomFields;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Page, SymbolicatedStackFrame } from '@remotion/renderer';
|
|
2
|
-
export declare class ErrorWithStackFrame extends Error {
|
|
3
|
-
symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
|
|
4
|
-
frame: number | null;
|
|
5
|
-
name: string;
|
|
6
|
-
delayRenderCall: SymbolicatedStackFrame[] | null;
|
|
7
|
-
constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }: {
|
|
8
|
-
message: string;
|
|
9
|
-
symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
|
|
10
|
-
frame: number | null;
|
|
11
|
-
name: string;
|
|
12
|
-
delayRenderCall: SymbolicatedStackFrame[] | null;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
export declare const handleJavascriptException: ({ page, onError, frame, }: {
|
|
16
|
-
page: Page;
|
|
17
|
-
frame: number | null;
|
|
18
|
-
onError: (err: Error) => void;
|
|
19
|
-
}) => () => void;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleJavascriptException = exports.ErrorWithStackFrame = void 0;
|
|
4
|
-
const remotion_1 = require("remotion");
|
|
5
|
-
const renderer_1 = require("@remotion/renderer");
|
|
6
|
-
const log_1 = require("./log");
|
|
7
|
-
class ErrorWithStackFrame extends Error {
|
|
8
|
-
constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.symbolicatedStackFrames = symbolicatedStackFrames;
|
|
11
|
-
this.frame = frame;
|
|
12
|
-
this.name = name;
|
|
13
|
-
this.delayRenderCall = delayRenderCall;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.ErrorWithStackFrame = ErrorWithStackFrame;
|
|
17
|
-
const cleanUpErrorMessage = (exception) => {
|
|
18
|
-
var _a, _b, _c, _d;
|
|
19
|
-
let errorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
20
|
-
if (!errorMessage) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
24
|
-
const prefix = `${errorType}: `;
|
|
25
|
-
if (errorMessage.startsWith(prefix)) {
|
|
26
|
-
errorMessage = errorMessage.substring(prefix.length);
|
|
27
|
-
}
|
|
28
|
-
const frames = (_d = (_c = exception.exceptionDetails.stackTrace) === null || _c === void 0 ? void 0 : _c.callFrames.length) !== null && _d !== void 0 ? _d : 0;
|
|
29
|
-
const split = errorMessage.split('\n');
|
|
30
|
-
return split.slice(0, Math.max(1, split.length - frames)).join('\n');
|
|
31
|
-
};
|
|
32
|
-
const removeDelayRenderStack = (message) => {
|
|
33
|
-
const index = message.indexOf(remotion_1.Internals.DELAY_RENDER_CALLSTACK_TOKEN);
|
|
34
|
-
if (index === -1) {
|
|
35
|
-
return message;
|
|
36
|
-
}
|
|
37
|
-
return message.substring(0, index);
|
|
38
|
-
};
|
|
39
|
-
const callFrameToStackFrame = (callFrame) => {
|
|
40
|
-
return {
|
|
41
|
-
columnNumber: callFrame.columnNumber,
|
|
42
|
-
fileName: callFrame.url,
|
|
43
|
-
functionName: callFrame.functionName,
|
|
44
|
-
lineNumber: callFrame.lineNumber,
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
const handleJavascriptException = ({ page, onError, frame, }) => {
|
|
48
|
-
const client = page._client();
|
|
49
|
-
const handler = (exception) => {
|
|
50
|
-
var _a, _b, _c;
|
|
51
|
-
const rawErrorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
52
|
-
const cleanErrorMessage = cleanUpErrorMessage(exception);
|
|
53
|
-
if (!cleanErrorMessage) {
|
|
54
|
-
log_1.Log.error(exception);
|
|
55
|
-
const err = new Error(rawErrorMessage);
|
|
56
|
-
err.stack = rawErrorMessage;
|
|
57
|
-
onError(err);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (!exception.exceptionDetails.stackTrace) {
|
|
61
|
-
const err = new Error(removeDelayRenderStack(cleanErrorMessage));
|
|
62
|
-
err.stack = rawErrorMessage;
|
|
63
|
-
onError(err);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
67
|
-
const symbolicatedErr = new renderer_1.RenderInternals.SymbolicateableError({
|
|
68
|
-
message: removeDelayRenderStack(cleanErrorMessage),
|
|
69
|
-
stackFrame: exception.exceptionDetails.stackTrace.callFrames.map((f) => callFrameToStackFrame(f)),
|
|
70
|
-
frame,
|
|
71
|
-
name: errorType,
|
|
72
|
-
stack: (_c = exception.exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description,
|
|
73
|
-
});
|
|
74
|
-
onError(symbolicatedErr);
|
|
75
|
-
};
|
|
76
|
-
client.on('Runtime.exceptionThrown', handler);
|
|
77
|
-
return () => {
|
|
78
|
-
client.off('Runtime.exceptionThrown', handler);
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
exports.handleJavascriptException = handleJavascriptException;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Page } from '../browser/BrowserPage';
|
|
2
|
-
import type { SymbolicatedStackFrame } from '../symbolicate-stacktrace';
|
|
3
|
-
export declare class ErrorWithStackFrame extends Error {
|
|
4
|
-
symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
|
|
5
|
-
frame: number | null;
|
|
6
|
-
name: string;
|
|
7
|
-
delayRenderCall: SymbolicatedStackFrame[] | null;
|
|
8
|
-
constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }: {
|
|
9
|
-
message: string;
|
|
10
|
-
symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
|
|
11
|
-
frame: number | null;
|
|
12
|
-
name: string;
|
|
13
|
-
delayRenderCall: SymbolicatedStackFrame[] | null;
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
export declare const handleJavascriptException: ({ page, onError, frame, }: {
|
|
17
|
-
page: Page;
|
|
18
|
-
frame: number | null;
|
|
19
|
-
onError: (err: Error) => void;
|
|
20
|
-
}) => () => void;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleJavascriptException = exports.ErrorWithStackFrame = void 0;
|
|
4
|
-
const remotion_1 = require("remotion");
|
|
5
|
-
const symbolicateable_error_1 = require("./symbolicateable-error");
|
|
6
|
-
const log_1 = require("./log");
|
|
7
|
-
class ErrorWithStackFrame extends Error {
|
|
8
|
-
constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.symbolicatedStackFrames = symbolicatedStackFrames;
|
|
11
|
-
this.frame = frame;
|
|
12
|
-
this.name = name;
|
|
13
|
-
this.delayRenderCall = delayRenderCall;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.ErrorWithStackFrame = ErrorWithStackFrame;
|
|
17
|
-
const cleanUpErrorMessage = (exception) => {
|
|
18
|
-
var _a, _b, _c, _d;
|
|
19
|
-
let errorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
20
|
-
if (!errorMessage) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
24
|
-
const prefix = `${errorType}: `;
|
|
25
|
-
if (errorMessage.startsWith(prefix)) {
|
|
26
|
-
errorMessage = errorMessage.substring(prefix.length);
|
|
27
|
-
}
|
|
28
|
-
const frames = (_d = (_c = exception.exceptionDetails.stackTrace) === null || _c === void 0 ? void 0 : _c.callFrames.length) !== null && _d !== void 0 ? _d : 0;
|
|
29
|
-
const split = errorMessage.split('\n');
|
|
30
|
-
return split.slice(0, Math.max(1, split.length - frames)).join('\n');
|
|
31
|
-
};
|
|
32
|
-
const removeDelayRenderStack = (message) => {
|
|
33
|
-
const index = message.indexOf(remotion_1.Internals.DELAY_RENDER_CALLSTACK_TOKEN);
|
|
34
|
-
if (index === -1) {
|
|
35
|
-
return message;
|
|
36
|
-
}
|
|
37
|
-
return message.substring(0, index);
|
|
38
|
-
};
|
|
39
|
-
const callFrameToStackFrame = (callFrame) => {
|
|
40
|
-
return {
|
|
41
|
-
columnNumber: callFrame.columnNumber,
|
|
42
|
-
fileName: callFrame.url,
|
|
43
|
-
functionName: callFrame.functionName,
|
|
44
|
-
lineNumber: callFrame.lineNumber,
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
const handleJavascriptException = ({ page, onError, frame, }) => {
|
|
48
|
-
const client = page._client();
|
|
49
|
-
const handler = (exception) => {
|
|
50
|
-
var _a, _b, _c;
|
|
51
|
-
const rawErrorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
|
|
52
|
-
const cleanErrorMessage = cleanUpErrorMessage(exception);
|
|
53
|
-
if (!cleanErrorMessage) {
|
|
54
|
-
log_1.Log.error(exception);
|
|
55
|
-
const err = new Error(rawErrorMessage);
|
|
56
|
-
err.stack = rawErrorMessage;
|
|
57
|
-
onError(err);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (!exception.exceptionDetails.stackTrace) {
|
|
61
|
-
const err = new Error(removeDelayRenderStack(cleanErrorMessage));
|
|
62
|
-
err.stack = rawErrorMessage;
|
|
63
|
-
onError(err);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
|
|
67
|
-
const symbolicatedErr = new symbolicateable_error_1.SymbolicateableError({
|
|
68
|
-
message: removeDelayRenderStack(cleanErrorMessage),
|
|
69
|
-
stackFrame: exception.exceptionDetails.stackTrace.callFrames.map((f) => callFrameToStackFrame(f)),
|
|
70
|
-
frame,
|
|
71
|
-
name: errorType,
|
|
72
|
-
stack: (_c = exception.exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description,
|
|
73
|
-
});
|
|
74
|
-
onError(symbolicatedErr);
|
|
75
|
-
};
|
|
76
|
-
client.on('Runtime.exceptionThrown', handler);
|
|
77
|
-
return () => {
|
|
78
|
-
client.off('Runtime.exceptionThrown', handler);
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
exports.handleJavascriptException = handleJavascriptException;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.symbolicateError = void 0;
|
|
4
|
-
const symbolicate_stacktrace_1 = require("../symbolicate-stacktrace");
|
|
5
|
-
const handle_javascript_exception_1 = require("./handle-javascript-exception");
|
|
6
|
-
const truthy_1 = require("./truthy");
|
|
7
|
-
const symbolicateError = async (symbolicateableError) => {
|
|
8
|
-
const { delayRenderCall, stackFrame } = symbolicateableError;
|
|
9
|
-
const [mainErrorFrames, delayRenderFrames] = await Promise.all([
|
|
10
|
-
stackFrame ? (0, symbolicate_stacktrace_1.symbolicateStackTraceFromRemoteFrames)(stackFrame) : null,
|
|
11
|
-
delayRenderCall
|
|
12
|
-
? (0, symbolicate_stacktrace_1.symbolicateStackTraceFromRemoteFrames)(delayRenderCall)
|
|
13
|
-
: null,
|
|
14
|
-
].filter(truthy_1.truthy));
|
|
15
|
-
const symbolicatedErr = new handle_javascript_exception_1.ErrorWithStackFrame({
|
|
16
|
-
message: symbolicateableError.message,
|
|
17
|
-
symbolicatedStackFrames: mainErrorFrames,
|
|
18
|
-
frame: symbolicateableError.frame,
|
|
19
|
-
name: symbolicateableError.name,
|
|
20
|
-
delayRenderCall: delayRenderFrames,
|
|
21
|
-
});
|
|
22
|
-
return symbolicatedErr;
|
|
23
|
-
};
|
|
24
|
-
exports.symbolicateError = symbolicateError;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SymbolicatedStackFrame, UnsymbolicatedStackFrame } from '@remotion/renderer';
|
|
2
|
-
import type { SourceMapConsumer } from 'source-map';
|
|
3
|
-
import { ErrorWithStackFrame } from './error-with-stack-frame';
|
|
4
|
-
export declare const symbolicateError: (symbolicateableError: SymbolicateableError) => Promise<ErrorWithStackFrame>;
|
|
5
|
-
export declare const symbolicateStackTraceFromRemoteFrames: (frames: UnsymbolicatedStackFrame[]) => Promise<SymbolicatedStackFrame[]>;
|
|
6
|
-
export declare const getSourceMapFromRemoteFile: (fileName: string) => Promise<any>;
|
|
7
|
-
export declare const symbolicateFromSources: (frames: UnsymbolicatedStackFrame[], mapValues: Record<string, SourceMapConsumer | null>) => SymbolicatedStackFrame[];
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.symbolicateFromSources = exports.getSourceMapFromRemoteFile = exports.symbolicateStackTraceFromRemoteFrames = exports.symbolicateError = void 0;
|
|
4
|
-
const renderer_1 = require("@remotion/renderer");
|
|
5
|
-
const truthy_1 = require("./truthy");
|
|
6
|
-
const error_with_stack_frame_1 = require("./error-with-stack-frame");
|
|
7
|
-
const symbolicateError = async (symbolicateableError) => {
|
|
8
|
-
const { delayRenderCall, stackFrame } = symbolicateableError;
|
|
9
|
-
const [mainErrorFrames, delayRenderFrames] = await Promise.all([
|
|
10
|
-
stackFrame ? (0, exports.symbolicateStackTraceFromRemoteFrames)(stackFrame) : null,
|
|
11
|
-
delayRenderCall
|
|
12
|
-
? (0, exports.symbolicateStackTraceFromRemoteFrames)(delayRenderCall)
|
|
13
|
-
: null,
|
|
14
|
-
].filter(truthy_1.truthy));
|
|
15
|
-
const symbolicatedErr = new error_with_stack_frame_1.ErrorWithStackFrame({
|
|
16
|
-
message: symbolicateableError.message,
|
|
17
|
-
symbolicatedStackFrames: mainErrorFrames,
|
|
18
|
-
frame: symbolicateableError.frame,
|
|
19
|
-
name: symbolicateableError.name,
|
|
20
|
-
delayRenderCall: delayRenderFrames,
|
|
21
|
-
});
|
|
22
|
-
return symbolicatedErr;
|
|
23
|
-
};
|
|
24
|
-
exports.symbolicateError = symbolicateError;
|
|
25
|
-
const symbolicateStackTraceFromRemoteFrames = async (frames) => {
|
|
26
|
-
const uniqueFileNames = [
|
|
27
|
-
...new Set(frames
|
|
28
|
-
.map((f) => f.fileName)
|
|
29
|
-
.filter((f) => f.startsWith('http://') || f.startsWith('https://'))
|
|
30
|
-
.filter(truthy_1.truthy)),
|
|
31
|
-
];
|
|
32
|
-
const maps = await Promise.all(uniqueFileNames.map((fileName) => {
|
|
33
|
-
return (0, exports.getSourceMapFromRemoteFile)(fileName);
|
|
34
|
-
}));
|
|
35
|
-
const mapValues = {};
|
|
36
|
-
for (let i = 0; i < uniqueFileNames.length; i++) {
|
|
37
|
-
mapValues[uniqueFileNames[i]] = maps[i];
|
|
38
|
-
}
|
|
39
|
-
return (0, exports.symbolicateFromSources)(frames, mapValues);
|
|
40
|
-
};
|
|
41
|
-
exports.symbolicateStackTraceFromRemoteFrames = symbolicateStackTraceFromRemoteFrames;
|
|
42
|
-
const getSourceMapFromRemoteFile = async (fileName) => {
|
|
43
|
-
const fileContents = await renderer_1.RenderInternals.fetchUrl(fileName);
|
|
44
|
-
return renderer_1.RenderInternals.getSourceMap(fileName, fileContents, 'remote');
|
|
45
|
-
};
|
|
46
|
-
exports.getSourceMapFromRemoteFile = getSourceMapFromRemoteFile;
|
|
47
|
-
const symbolicateFromSources = (frames, mapValues) => {
|
|
48
|
-
return frames
|
|
49
|
-
.map((frame) => {
|
|
50
|
-
const map = mapValues[frame.fileName];
|
|
51
|
-
if (!map) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
return symbolicateStackFrame(frame, map);
|
|
55
|
-
})
|
|
56
|
-
.filter(truthy_1.truthy);
|
|
57
|
-
};
|
|
58
|
-
exports.symbolicateFromSources = symbolicateFromSources;
|
|
59
|
-
const symbolicateStackFrame = (frame, map) => {
|
|
60
|
-
const pos = getOriginalPosition(map, frame.lineNumber, frame.columnNumber);
|
|
61
|
-
const hasSource = pos.source ? map.sourceContentFor(pos.source, false) : null;
|
|
62
|
-
const scriptCode = hasSource && pos.line
|
|
63
|
-
? getLinesAround(pos.line, 3, hasSource.split('\n'))
|
|
64
|
-
: null;
|
|
65
|
-
return {
|
|
66
|
-
originalColumnNumber: pos.column,
|
|
67
|
-
originalFileName: pos.source,
|
|
68
|
-
originalFunctionName: frame.functionName,
|
|
69
|
-
originalLineNumber: pos.line,
|
|
70
|
-
originalScriptCode: scriptCode,
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
const getOriginalPosition = (source_map, line, column) => {
|
|
74
|
-
const result = source_map.originalPositionFor({
|
|
75
|
-
line,
|
|
76
|
-
column,
|
|
77
|
-
});
|
|
78
|
-
return { line: result.line, column: result.column, source: result.source };
|
|
79
|
-
};
|
|
80
|
-
function getLinesAround(line, count, lines) {
|
|
81
|
-
const result = [];
|
|
82
|
-
for (let index = Math.max(0, line - 1 - count) + 1; index <= Math.min(lines.length - 1, line - 1 + count); ++index) {
|
|
83
|
-
result.push({
|
|
84
|
-
lineNumber: index + 1,
|
|
85
|
-
content: lines[index],
|
|
86
|
-
highlight: index + 1 === line,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return result;
|
|
90
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { BasicSourceMapConsumer, IndexedSourceMapConsumer } from 'source-map';
|
|
2
|
-
import { SourceMapConsumer } from 'source-map';
|
|
3
|
-
import type { UnsymbolicatedStackFrame } from './parse-browser-error-stack';
|
|
4
|
-
type ScriptLine = {
|
|
5
|
-
lineNumber: number;
|
|
6
|
-
content: string;
|
|
7
|
-
highlight: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type SymbolicatedStackFrame = {
|
|
10
|
-
originalFunctionName: string | null;
|
|
11
|
-
originalFileName: string | null;
|
|
12
|
-
originalLineNumber: number | null;
|
|
13
|
-
originalColumnNumber: number | null;
|
|
14
|
-
originalScriptCode: ScriptLine[] | null;
|
|
15
|
-
};
|
|
16
|
-
export declare const symbolicateStackTraceFromRemoteFrames: (frames: UnsymbolicatedStackFrame[]) => Promise<SymbolicatedStackFrame[]>;
|
|
17
|
-
export declare const symbolicateFromSources: (frames: UnsymbolicatedStackFrame[], mapValues: Record<string, SourceMapConsumer | null>) => SymbolicatedStackFrame[];
|
|
18
|
-
export declare const symbolicateStackFrame: (frame: UnsymbolicatedStackFrame, map: SourceMapConsumer) => {
|
|
19
|
-
originalColumnNumber: number | null;
|
|
20
|
-
originalFileName: string | null;
|
|
21
|
-
originalFunctionName: any;
|
|
22
|
-
originalLineNumber: number | null;
|
|
23
|
-
originalScriptCode: ScriptLine[] | null;
|
|
24
|
-
};
|
|
25
|
-
export declare const getSourceMapFromRemoteFile: (fileName: string) => Promise<SourceMapConsumer | null>;
|
|
26
|
-
export declare const getSourceMapFromLocalFile: (fileName: string) => Promise<SourceMapConsumer | null>;
|
|
27
|
-
export type AnySourceMapConsumer = BasicSourceMapConsumer | IndexedSourceMapConsumer;
|
|
28
|
-
export {};
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getSourceMapFromLocalFile = exports.getSourceMapFromRemoteFile = exports.symbolicateStackFrame = exports.symbolicateFromSources = exports.symbolicateStackTraceFromRemoteFrames = void 0;
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const source_map_1 = require("source-map");
|
|
10
|
-
const read_file_1 = require("./assets/read-file");
|
|
11
|
-
const truthy_1 = require("./truthy");
|
|
12
|
-
function extractSourceMapUrl(fileContents) {
|
|
13
|
-
const regex = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;
|
|
14
|
-
let match = null;
|
|
15
|
-
for (;;) {
|
|
16
|
-
const next = regex.exec(fileContents);
|
|
17
|
-
if (next === null || next === undefined) {
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
match = next;
|
|
21
|
-
}
|
|
22
|
-
if (!(match === null || match === void 0 ? void 0 : match[1])) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return match[1].toString();
|
|
26
|
-
}
|
|
27
|
-
const getSourceMap = async (filePath, fileContents, type) => {
|
|
28
|
-
const sm = extractSourceMapUrl(fileContents);
|
|
29
|
-
if (sm === null) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
if (sm.indexOf('data:') === 0) {
|
|
33
|
-
const base64 = /^data:application\/json;([\w=:"-]+;)*base64,/;
|
|
34
|
-
const match2 = sm.match(base64);
|
|
35
|
-
if (!match2) {
|
|
36
|
-
throw new Error('Sorry, non-base64 inline source-map encoding is not supported.');
|
|
37
|
-
}
|
|
38
|
-
const converted = window.atob(sm.substring(match2[0].length));
|
|
39
|
-
return new source_map_1.SourceMapConsumer(JSON.parse(converted));
|
|
40
|
-
}
|
|
41
|
-
if (type === 'local') {
|
|
42
|
-
// Find adjacent file: bundle.js -> bundle.js.map
|
|
43
|
-
const newFilePath = path_1.default.join(path_1.default.dirname(filePath), sm);
|
|
44
|
-
return new source_map_1.SourceMapConsumer((0, fs_1.readFileSync)(newFilePath, 'utf8'));
|
|
45
|
-
}
|
|
46
|
-
const index = filePath.lastIndexOf('/');
|
|
47
|
-
const url = filePath.substring(0, index + 1) + sm;
|
|
48
|
-
const obj = await fetchUrl(url);
|
|
49
|
-
return new source_map_1.SourceMapConsumer(obj);
|
|
50
|
-
};
|
|
51
|
-
const fetchUrl = async (url) => {
|
|
52
|
-
const res = await (0, read_file_1.readFile)(url);
|
|
53
|
-
return new Promise((resolve, reject) => {
|
|
54
|
-
let downloaded = '';
|
|
55
|
-
res.on('data', (d) => {
|
|
56
|
-
downloaded += d;
|
|
57
|
-
});
|
|
58
|
-
res.on('end', () => {
|
|
59
|
-
resolve(downloaded);
|
|
60
|
-
});
|
|
61
|
-
res.on('error', (err) => reject(err));
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
function getLinesAround(line, count, lines) {
|
|
65
|
-
const result = [];
|
|
66
|
-
for (let index = Math.max(0, line - 1 - count) + 1; index <= Math.min(lines.length - 1, line - 1 + count); ++index) {
|
|
67
|
-
result.push({
|
|
68
|
-
lineNumber: index + 1,
|
|
69
|
-
content: lines[index],
|
|
70
|
-
highlight: index + 1 === line,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
return result;
|
|
74
|
-
}
|
|
75
|
-
const getOriginalPosition = (source_map, line, column) => {
|
|
76
|
-
const result = source_map.originalPositionFor({
|
|
77
|
-
line,
|
|
78
|
-
column,
|
|
79
|
-
});
|
|
80
|
-
return { line: result.line, column: result.column, source: result.source };
|
|
81
|
-
};
|
|
82
|
-
const symbolicateStackTraceFromRemoteFrames = async (frames) => {
|
|
83
|
-
const uniqueFileNames = [
|
|
84
|
-
...new Set(frames
|
|
85
|
-
.map((f) => f.fileName)
|
|
86
|
-
.filter((f) => f.startsWith('http://') || f.startsWith('https://'))
|
|
87
|
-
.filter(truthy_1.truthy)),
|
|
88
|
-
];
|
|
89
|
-
const maps = await Promise.all(uniqueFileNames.map((fileName) => {
|
|
90
|
-
return (0, exports.getSourceMapFromRemoteFile)(fileName);
|
|
91
|
-
}));
|
|
92
|
-
const mapValues = {};
|
|
93
|
-
for (let i = 0; i < uniqueFileNames.length; i++) {
|
|
94
|
-
mapValues[uniqueFileNames[i]] = maps[i];
|
|
95
|
-
}
|
|
96
|
-
return (0, exports.symbolicateFromSources)(frames, mapValues);
|
|
97
|
-
};
|
|
98
|
-
exports.symbolicateStackTraceFromRemoteFrames = symbolicateStackTraceFromRemoteFrames;
|
|
99
|
-
const symbolicateFromSources = (frames, mapValues) => {
|
|
100
|
-
return frames
|
|
101
|
-
.map((frame) => {
|
|
102
|
-
const map = mapValues[frame.fileName];
|
|
103
|
-
if (!map) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
return (0, exports.symbolicateStackFrame)(frame, map);
|
|
107
|
-
})
|
|
108
|
-
.filter(truthy_1.truthy);
|
|
109
|
-
};
|
|
110
|
-
exports.symbolicateFromSources = symbolicateFromSources;
|
|
111
|
-
const symbolicateStackFrame = (frame, map) => {
|
|
112
|
-
const pos = getOriginalPosition(map, frame.lineNumber, frame.columnNumber);
|
|
113
|
-
const hasSource = pos.source ? map.sourceContentFor(pos.source, false) : null;
|
|
114
|
-
const scriptCode = hasSource && pos.line
|
|
115
|
-
? getLinesAround(pos.line, 3, hasSource.split('\n'))
|
|
116
|
-
: null;
|
|
117
|
-
return {
|
|
118
|
-
originalColumnNumber: pos.column,
|
|
119
|
-
originalFileName: pos.source,
|
|
120
|
-
originalFunctionName: frame.functionName,
|
|
121
|
-
originalLineNumber: pos.line,
|
|
122
|
-
originalScriptCode: scriptCode,
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
exports.symbolicateStackFrame = symbolicateStackFrame;
|
|
126
|
-
const getSourceMapFromRemoteFile = async (fileName) => {
|
|
127
|
-
const fileContents = await fetchUrl(fileName);
|
|
128
|
-
return getSourceMap(fileName, fileContents, 'remote');
|
|
129
|
-
};
|
|
130
|
-
exports.getSourceMapFromRemoteFile = getSourceMapFromRemoteFile;
|
|
131
|
-
const getSourceMapFromLocalFile = (fileName) => {
|
|
132
|
-
const fileContents = (0, fs_1.readFileSync)(fileName, 'utf8');
|
|
133
|
-
return getSourceMap(fileName, fileContents, 'local');
|
|
134
|
-
};
|
|
135
|
-
exports.getSourceMapFromLocalFile = getSourceMapFromLocalFile;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A symbolicateable error is an error that can be symolicated by fetching the original sources. By throwing a symbolicateable error, Remotion CLI will attempt to symplicate it
|
|
3
|
-
*/
|
|
4
|
-
import type { UnsymbolicatedStackFrame } from '../parse-browser-error-stack';
|
|
5
|
-
export declare class SymbolicateableError extends Error {
|
|
6
|
-
stackFrame: UnsymbolicatedStackFrame[] | null;
|
|
7
|
-
delayRenderCall: UnsymbolicatedStackFrame[] | null;
|
|
8
|
-
frame: number | null;
|
|
9
|
-
constructor({ message, stack, stackFrame, frame, name, }: {
|
|
10
|
-
message: string;
|
|
11
|
-
stack: string | undefined;
|
|
12
|
-
frame: number | null;
|
|
13
|
-
name: string;
|
|
14
|
-
stackFrame: UnsymbolicatedStackFrame[] | null;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* A symbolicateable error is an error that can be symolicated by fetching the original sources. By throwing a symbolicateable error, Remotion CLI will attempt to symplicate it
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SymbolicateableError = void 0;
|
|
7
|
-
const delay_render_embedded_stack_1 = require("../delay-render-embedded-stack");
|
|
8
|
-
class SymbolicateableError extends Error {
|
|
9
|
-
constructor({ message, stack, stackFrame, frame, name, }) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.stack = stack;
|
|
12
|
-
this.stackFrame = stackFrame;
|
|
13
|
-
this.frame = frame;
|
|
14
|
-
this.name = name;
|
|
15
|
-
this.delayRenderCall = stack ? (0, delay_render_embedded_stack_1.parseDelayRenderEmbeddedStack)(stack) : null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.SymbolicateableError = SymbolicateableError;
|