@remotion/studio 4.0.443 → 4.0.444
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/CanvasOrLoading.js +5 -0
- package/dist/components/Editor.js +10 -2
- package/dist/components/RenderErrorContext.d.ts +4 -0
- package/dist/components/RenderErrorContext.js +7 -0
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +7 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +5 -1
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +5 -3
- package/dist/components/Timeline/TimelineListItem.js +71 -8
- package/dist/components/Timeline/TimelineVideoInfo.js +1 -18
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +1 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +25 -6
- package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +1 -5
- package/dist/error-overlay/remotion-overlay/CopyStackTrace.d.ts +5 -0
- package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +50 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +16 -13
- package/dist/error-overlay/remotion-overlay/MediaPlaybackErrorExplainer.d.ts +4 -0
- package/dist/error-overlay/remotion-overlay/MediaPlaybackErrorExplainer.js +87 -0
- package/dist/esm/{chunk-cpv44d93.js → chunk-1zvzzrkf.js} +2481 -2300
- package/dist/esm/internals.mjs +2481 -2300
- package/dist/esm/previewEntry.mjs +2813 -2636
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/frame-database.d.ts +2 -2
- package/dist/helpers/frame-database.js +36 -25
- package/dist/helpers/use-max-media-duration.js +1 -1
- package/package.json +9 -9
- package/dist/error-overlay/remotion-overlay/CompositionIdsDropdown.d.ts +0 -5
- package/dist/error-overlay/remotion-overlay/CompositionIdsDropdown.js +0 -108
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -208,7 +208,7 @@ var renderContent = (Root) => {
|
|
|
208
208
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
209
209
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
210
210
|
}));
|
|
211
|
-
import("./chunk-
|
|
211
|
+
import("./chunk-1zvzzrkf.js").then(({ StudioInternals }) => {
|
|
212
212
|
window.remotion_isStudio = true;
|
|
213
213
|
window.remotion_isReadOnlyStudio = true;
|
|
214
214
|
window.remotion_inputProps = "{}";
|
|
@@ -6,11 +6,11 @@ export declare const getFrameDatabaseKeyPrefix: (src: string) => string;
|
|
|
6
6
|
type VideoFrameAndLastUsed = {
|
|
7
7
|
frame: VideoFrame;
|
|
8
8
|
lastUsed: number;
|
|
9
|
+
size: number;
|
|
9
10
|
};
|
|
10
11
|
export declare const frameDatabase: Map<FrameDatabaseKey, VideoFrameAndLastUsed>;
|
|
11
12
|
export declare const aspectRatioCache: Map<string, number>;
|
|
12
13
|
export declare const getTimestampFromFrameDatabaseKey: (key: FrameDatabaseKey) => number;
|
|
13
14
|
export declare const getAspectRatioFromCache: (src: string) => number | null;
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const clearFramesForSrc: (src: string) => void;
|
|
15
|
+
export declare const addFrameToCache: (key: FrameDatabaseKey, frame: VideoFrame) => void;
|
|
16
16
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Cache the thumbnails of the timeline
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.addFrameToCache = exports.getAspectRatioFromCache = exports.getTimestampFromFrameDatabaseKey = exports.aspectRatioCache = exports.frameDatabase = exports.getFrameDatabaseKeyPrefix = exports.makeFrameDatabaseKey = void 0;
|
|
5
5
|
const KEY_SEPARATOR = '|';
|
|
6
6
|
const makeFrameDatabaseKey = (src, timestamp) => `${src}${KEY_SEPARATOR}${timestamp}`;
|
|
7
7
|
exports.makeFrameDatabaseKey = makeFrameDatabaseKey;
|
|
@@ -9,6 +9,8 @@ const getFrameDatabaseKeyPrefix = (src) => {
|
|
|
9
9
|
return `${src}${KEY_SEPARATOR}`;
|
|
10
10
|
};
|
|
11
11
|
exports.getFrameDatabaseKeyPrefix = getFrameDatabaseKeyPrefix;
|
|
12
|
+
const MAX_CACHE_SIZE_BYTES = 10 * 1024 * 1024; // 10 MB
|
|
13
|
+
let totalCacheSize = 0;
|
|
12
14
|
exports.frameDatabase = new Map();
|
|
13
15
|
exports.aspectRatioCache = new Map();
|
|
14
16
|
const getTimestampFromFrameDatabaseKey = (key) => {
|
|
@@ -24,31 +26,40 @@ const getAspectRatioFromCache = (src) => {
|
|
|
24
26
|
return null;
|
|
25
27
|
};
|
|
26
28
|
exports.getAspectRatioFromCache = getAspectRatioFromCache;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (key.startsWith(prefix)) {
|
|
46
|
-
frame.frame.close();
|
|
47
|
-
keysToRemove.push(key);
|
|
29
|
+
const evictLRU = () => {
|
|
30
|
+
while (totalCacheSize > MAX_CACHE_SIZE_BYTES && exports.frameDatabase.size > 0) {
|
|
31
|
+
let oldestKey;
|
|
32
|
+
let oldestTime = Infinity;
|
|
33
|
+
for (const [key, candidate] of exports.frameDatabase) {
|
|
34
|
+
if (candidate.lastUsed < oldestTime) {
|
|
35
|
+
oldestTime = candidate.lastUsed;
|
|
36
|
+
oldestKey = key;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (!oldestKey) {
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
const entry = exports.frameDatabase.get(oldestKey);
|
|
43
|
+
if (entry) {
|
|
44
|
+
totalCacheSize -= entry.size;
|
|
45
|
+
entry.frame.close();
|
|
46
|
+
exports.frameDatabase.delete(oldestKey);
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
};
|
|
50
|
+
const addFrameToCache = (key, frame) => {
|
|
51
|
+
const existing = exports.frameDatabase.get(key);
|
|
52
|
+
if (existing) {
|
|
53
|
+
totalCacheSize -= existing.size;
|
|
54
|
+
existing.frame.close();
|
|
52
55
|
}
|
|
56
|
+
const size = frame.allocationSize();
|
|
57
|
+
totalCacheSize += size;
|
|
58
|
+
exports.frameDatabase.set(key, {
|
|
59
|
+
frame,
|
|
60
|
+
lastUsed: Date.now(),
|
|
61
|
+
size,
|
|
62
|
+
});
|
|
63
|
+
evictLRU();
|
|
53
64
|
};
|
|
54
|
-
exports.
|
|
65
|
+
exports.addFrameToCache = addFrameToCache;
|
|
@@ -53,7 +53,7 @@ const useMaxMediaDuration = (s, fps) => {
|
|
|
53
53
|
};
|
|
54
54
|
}, [src, fps]);
|
|
55
55
|
if (maxMediaDuration !== null && (s.type === 'audio' || s.type === 'video')) {
|
|
56
|
-
return maxMediaDuration
|
|
56
|
+
return maxMediaDuration;
|
|
57
57
|
}
|
|
58
58
|
return maxMediaDuration;
|
|
59
59
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.444",
|
|
7
7
|
"description": "APIs for interacting with the Remotion Studio",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"semver": "7.5.3",
|
|
29
|
-
"remotion": "4.0.
|
|
30
|
-
"@remotion/player": "4.0.
|
|
31
|
-
"@remotion/media-utils": "4.0.
|
|
32
|
-
"@remotion/renderer": "4.0.
|
|
33
|
-
"@remotion/web-renderer": "4.0.
|
|
34
|
-
"@remotion/studio-shared": "4.0.
|
|
35
|
-
"@remotion/zod-types": "4.0.
|
|
29
|
+
"remotion": "4.0.444",
|
|
30
|
+
"@remotion/player": "4.0.444",
|
|
31
|
+
"@remotion/media-utils": "4.0.444",
|
|
32
|
+
"@remotion/renderer": "4.0.444",
|
|
33
|
+
"@remotion/web-renderer": "4.0.444",
|
|
34
|
+
"@remotion/studio-shared": "4.0.444",
|
|
35
|
+
"@remotion/zod-types": "4.0.444",
|
|
36
36
|
"mediabunny": "1.39.2",
|
|
37
37
|
"memfs": "3.4.3",
|
|
38
38
|
"source-map": "0.7.3",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"react": "19.2.3",
|
|
44
44
|
"react-dom": "19.2.3",
|
|
45
45
|
"@types/semver": "^7.3.4",
|
|
46
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
46
|
+
"@remotion/eslint-config-internal": "4.0.444",
|
|
47
47
|
"eslint": "9.19.0",
|
|
48
48
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
49
49
|
},
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompositionIdsDropdown = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const Button_1 = require("../../components/Button");
|
|
7
|
-
const colors_1 = require("../../helpers/colors");
|
|
8
|
-
const carets_1 = require("./carets");
|
|
9
|
-
const CompositionIdListItem_1 = require("./CompositionIdListItem");
|
|
10
|
-
const containerStyle = {
|
|
11
|
-
display: 'inline-block',
|
|
12
|
-
position: 'relative',
|
|
13
|
-
};
|
|
14
|
-
// Button styling provided by shared Button component
|
|
15
|
-
const dropdownStyle = {
|
|
16
|
-
position: 'absolute',
|
|
17
|
-
top: '110%',
|
|
18
|
-
left: 0,
|
|
19
|
-
width: 320,
|
|
20
|
-
maxHeight: 300,
|
|
21
|
-
overflowY: 'auto',
|
|
22
|
-
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
23
|
-
border: `1px solid ${colors_1.INPUT_BORDER_COLOR_UNHOVERED}`,
|
|
24
|
-
borderRadius: 8,
|
|
25
|
-
padding: 8,
|
|
26
|
-
boxShadow: '0 6px 24px rgba(0,0,0,0.35)',
|
|
27
|
-
zIndex: 1000,
|
|
28
|
-
fontFamily: 'inherit',
|
|
29
|
-
fontSize: 14,
|
|
30
|
-
};
|
|
31
|
-
const searchStyle = {
|
|
32
|
-
width: '100%',
|
|
33
|
-
padding: '6px 8px',
|
|
34
|
-
borderRadius: 6,
|
|
35
|
-
border: `1px solid ${colors_1.INPUT_BORDER_COLOR_UNHOVERED}`,
|
|
36
|
-
background: colors_1.INPUT_BACKGROUND,
|
|
37
|
-
color: colors_1.TEXT_COLOR,
|
|
38
|
-
marginBottom: 8,
|
|
39
|
-
outline: 'none',
|
|
40
|
-
fontFamily: 'inherit',
|
|
41
|
-
fontSize: 14,
|
|
42
|
-
};
|
|
43
|
-
const CompositionIdsDropdown = ({ compositionIds, currentId }) => {
|
|
44
|
-
const [open, setOpen] = (0, react_1.useState)(false);
|
|
45
|
-
const [query, setQuery] = (0, react_1.useState)('');
|
|
46
|
-
const containerRef = (0, react_1.useRef)(null);
|
|
47
|
-
const filtered = (0, react_1.useMemo)(() => {
|
|
48
|
-
const q = query.trim().toLowerCase();
|
|
49
|
-
if (!q) {
|
|
50
|
-
return compositionIds;
|
|
51
|
-
}
|
|
52
|
-
return compositionIds.filter((id) => id.toLowerCase().includes(q));
|
|
53
|
-
}, [compositionIds, query]);
|
|
54
|
-
const onSelect = (id) => {
|
|
55
|
-
const isQuery = window.remotion_isReadOnlyStudio;
|
|
56
|
-
if (isQuery) {
|
|
57
|
-
window.location.href = `${window.location.pathname}?/${id}`;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
window.location.href = `/${id}`;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
(0, react_1.useEffect)(() => {
|
|
64
|
-
if (!open) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const onClickAway = (e) => {
|
|
68
|
-
if (!containerRef.current) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (!containerRef.current.contains(e.target)) {
|
|
72
|
-
setOpen(false);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const onKey = (e) => {
|
|
76
|
-
if (e.key === 'Escape') {
|
|
77
|
-
setOpen(false);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
document.addEventListener('mousedown', onClickAway);
|
|
81
|
-
document.addEventListener('touchstart', onClickAway, { passive: true });
|
|
82
|
-
document.addEventListener('keydown', onKey);
|
|
83
|
-
return () => {
|
|
84
|
-
document.removeEventListener('mousedown', onClickAway);
|
|
85
|
-
document.removeEventListener('touchstart', onClickAway);
|
|
86
|
-
document.removeEventListener('keydown', onKey);
|
|
87
|
-
};
|
|
88
|
-
}, [open, containerRef]);
|
|
89
|
-
return (jsx_runtime_1.jsxs("div", { ref: containerRef, style: containerStyle, children: [
|
|
90
|
-
jsx_runtime_1.jsxs(Button_1.Button, { onClick: () => setOpen((p) => !p), buttonContainerStyle: {
|
|
91
|
-
display: 'flex',
|
|
92
|
-
alignItems: 'center',
|
|
93
|
-
justifyContent: 'space-between',
|
|
94
|
-
gap: 8,
|
|
95
|
-
minWidth: 180,
|
|
96
|
-
}, children: [
|
|
97
|
-
jsx_runtime_1.jsx("span", { style: {
|
|
98
|
-
overflow: 'hidden',
|
|
99
|
-
textOverflow: 'ellipsis',
|
|
100
|
-
whiteSpace: 'nowrap',
|
|
101
|
-
fontSize: '14px',
|
|
102
|
-
lineHeight: '24px',
|
|
103
|
-
}, children: currentId !== null && currentId !== void 0 ? currentId : 'Select composition' }), jsx_runtime_1.jsx(carets_1.CaretDown, { size: 20, invert: open })
|
|
104
|
-
] }), open ? (jsx_runtime_1.jsxs("div", { style: dropdownStyle, children: [
|
|
105
|
-
jsx_runtime_1.jsx("input", { value: query, onChange: (e) => setQuery(e.target.value), placeholder: "Search compositions...", style: searchStyle, "aria-label": "Search compositions" }), jsx_runtime_1.jsx("div", { children: filtered.length === 0 ? (jsx_runtime_1.jsx("div", { style: { opacity: 0.7, padding: 8, textAlign: 'center' }, children: "No compositions found" })) : (filtered.map((id) => (jsx_runtime_1.jsx(CompositionIdListItem_1.CompositionIdListItem, { id: id, isActive: id === currentId, onSelect: onSelect }, id)))) })
|
|
106
|
-
] })) : null] }));
|
|
107
|
-
};
|
|
108
|
-
exports.CompositionIdsDropdown = CompositionIdsDropdown;
|