@remotion/studio 4.0.445 → 4.0.446
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 +11 -1
- package/dist/components/Canvas.js +1 -1
- package/dist/components/CanvasOrLoading.js +4 -4
- package/dist/components/CompositionSelectorItem.js +15 -1
- package/dist/components/FilePreview.js +3 -0
- package/dist/components/InitialCompositionLoader.js +10 -4
- package/dist/components/Preview.d.ts +1 -0
- package/dist/components/Preview.js +14 -1
- package/dist/components/Timeline/TimelineListItem.js +53 -2
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +4 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +10 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +1 -1
- package/dist/error-overlay/remotion-overlay/Retry.d.ts +1 -0
- package/dist/error-overlay/remotion-overlay/Retry.js +2 -2
- package/dist/esm/{chunk-bqd9dhnk.js → chunk-2dkkw8x5.js} +4398 -4172
- package/dist/esm/internals.mjs +4398 -4172
- package/dist/esm/previewEntry.mjs +392 -168
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/get-asset-metadata.d.ts +3 -0
- package/dist/helpers/get-asset-metadata.js +51 -43
- package/dist/helpers/sidebar-scroll-into-view.d.ts +13 -0
- package/dist/helpers/sidebar-scroll-into-view.js +83 -0
- package/dist/helpers/use-studio-canvas-dimensions.js +3 -1
- package/package.json +9 -9
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-2dkkw8x5.js").then(({ StudioInternals }) => {
|
|
212
212
|
window.remotion_isStudio = true;
|
|
213
213
|
window.remotion_isReadOnlyStudio = true;
|
|
214
214
|
window.remotion_inputProps = "{}";
|
|
@@ -23,55 +23,63 @@ const getAssetMetadata = async (canvasContent, addTime) => {
|
|
|
23
23
|
if (canvasContent.type === 'composition') {
|
|
24
24
|
throw new Error('cannot get dimensions for composition');
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
try {
|
|
27
|
+
const src = getSrcFromCanvasContent(canvasContent);
|
|
28
|
+
const file = await fetch(src, {
|
|
29
|
+
method: 'HEAD',
|
|
30
|
+
});
|
|
31
|
+
if (file.status === 404) {
|
|
32
|
+
return { type: 'not-found' };
|
|
33
|
+
}
|
|
34
|
+
if (file.status !== 200) {
|
|
35
|
+
throw new Error(`Expected status code 200 or 404 for file, got ${file.status}`);
|
|
36
|
+
}
|
|
37
|
+
const size = file.headers.get('content-length');
|
|
38
|
+
if (!size) {
|
|
39
|
+
throw new Error('Unexpected error: content-length is null');
|
|
40
|
+
}
|
|
41
|
+
const fetchedAt = Date.now();
|
|
42
|
+
const srcWithTime = addTime ? `${src}?date=${fetchedAt}` : src;
|
|
43
|
+
const fileType = (0, Preview_1.getPreviewFileType)(src);
|
|
44
|
+
if (fileType === 'video') {
|
|
45
|
+
const resolution = await (0, media_utils_1.getVideoMetadata)(srcWithTime);
|
|
46
|
+
return {
|
|
47
|
+
type: 'found',
|
|
48
|
+
size: Number(size),
|
|
49
|
+
dimensions: { width: resolution.width, height: resolution.height },
|
|
50
|
+
fetchedAt,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (fileType === 'image') {
|
|
54
|
+
const resolution = await new Promise((resolve, reject) => {
|
|
55
|
+
const img = new Image();
|
|
56
|
+
img.onload = () => {
|
|
57
|
+
resolve({
|
|
58
|
+
type: 'found',
|
|
59
|
+
size: Number(size),
|
|
60
|
+
dimensions: { width: img.width, height: img.height },
|
|
61
|
+
fetchedAt,
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
img.onerror = () => {
|
|
65
|
+
reject(new Error('Failed to load image'));
|
|
66
|
+
};
|
|
67
|
+
img.src = srcWithTime;
|
|
68
|
+
});
|
|
69
|
+
return resolution;
|
|
70
|
+
}
|
|
45
71
|
return {
|
|
46
72
|
type: 'found',
|
|
73
|
+
dimensions: 'none',
|
|
47
74
|
size: Number(size),
|
|
48
|
-
dimensions: { width: resolution.width, height: resolution.height },
|
|
49
75
|
fetchedAt,
|
|
50
76
|
};
|
|
51
77
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
type: 'found',
|
|
58
|
-
size: Number(size),
|
|
59
|
-
dimensions: { width: img.width, height: img.height },
|
|
60
|
-
fetchedAt,
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
img.onerror = () => {
|
|
64
|
-
reject(new Error('Failed to load image'));
|
|
65
|
-
};
|
|
66
|
-
img.src = srcWithTime;
|
|
67
|
-
});
|
|
68
|
-
return resolution;
|
|
78
|
+
catch (err) {
|
|
79
|
+
return {
|
|
80
|
+
type: 'metadata-error',
|
|
81
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
82
|
+
};
|
|
69
83
|
}
|
|
70
|
-
return {
|
|
71
|
-
type: 'found',
|
|
72
|
-
dimensions: 'none',
|
|
73
|
-
size: Number(size),
|
|
74
|
-
fetchedAt,
|
|
75
|
-
};
|
|
76
84
|
};
|
|
77
85
|
exports.getAssetMetadata = getAssetMetadata;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const scrollSidebarRowIntoViewIfNeeded: (element: HTMLElement | null) => void;
|
|
2
|
+
export declare const markCompositionSidebarScrollFromRowClick: (compositionId: string) => void;
|
|
3
|
+
export declare const maybeScrollCompositionSidebarRowIntoView: ({ element, compositionId, selected, }: {
|
|
4
|
+
element: HTMLElement | null;
|
|
5
|
+
compositionId: string;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
}) => void;
|
|
8
|
+
export declare const markAssetSidebarScrollFromRowClick: (assetPath: string) => void;
|
|
9
|
+
export declare const maybeScrollAssetSidebarRowIntoView: ({ element, assetPath, selected, }: {
|
|
10
|
+
element: HTMLElement | null;
|
|
11
|
+
assetPath: string;
|
|
12
|
+
selected: boolean;
|
|
13
|
+
}) => void;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maybeScrollAssetSidebarRowIntoView = exports.markAssetSidebarScrollFromRowClick = exports.maybeScrollCompositionSidebarRowIntoView = exports.markCompositionSidebarScrollFromRowClick = exports.scrollSidebarRowIntoViewIfNeeded = void 0;
|
|
4
|
+
const getComputedOverflowY = (el) => {
|
|
5
|
+
return getComputedStyle(el).overflowY;
|
|
6
|
+
};
|
|
7
|
+
const findVerticalScrollParent = (element) => {
|
|
8
|
+
var _a;
|
|
9
|
+
let cur = (_a = element === null || element === void 0 ? void 0 : element.parentElement) !== null && _a !== void 0 ? _a : null;
|
|
10
|
+
while (cur) {
|
|
11
|
+
const overflowY = getComputedOverflowY(cur);
|
|
12
|
+
if (overflowY === 'auto' ||
|
|
13
|
+
overflowY === 'scroll' ||
|
|
14
|
+
overflowY === 'overlay') {
|
|
15
|
+
return cur;
|
|
16
|
+
}
|
|
17
|
+
cur = cur.parentElement;
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
};
|
|
21
|
+
const isVerticallyFullyVisibleInSidebarList = (element) => {
|
|
22
|
+
const scrollParent = findVerticalScrollParent(element);
|
|
23
|
+
const rect = element.getBoundingClientRect();
|
|
24
|
+
if (!scrollParent) {
|
|
25
|
+
return rect.top >= 0 && rect.bottom <= window.innerHeight;
|
|
26
|
+
}
|
|
27
|
+
const parentRect = scrollParent.getBoundingClientRect();
|
|
28
|
+
return rect.top >= parentRect.top && rect.bottom <= parentRect.bottom;
|
|
29
|
+
};
|
|
30
|
+
const scrollSidebarRowIntoViewIfNeeded = (element) => {
|
|
31
|
+
if (!element) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (isVerticallyFullyVisibleInSidebarList(element)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
element.scrollIntoView({ block: 'nearest', behavior: 'auto' });
|
|
38
|
+
};
|
|
39
|
+
exports.scrollSidebarRowIntoViewIfNeeded = scrollSidebarRowIntoViewIfNeeded;
|
|
40
|
+
let skipCompositionScrollIntoViewForId = null;
|
|
41
|
+
const markCompositionSidebarScrollFromRowClick = (compositionId) => {
|
|
42
|
+
skipCompositionScrollIntoViewForId = compositionId;
|
|
43
|
+
};
|
|
44
|
+
exports.markCompositionSidebarScrollFromRowClick = markCompositionSidebarScrollFromRowClick;
|
|
45
|
+
const shouldSkipCompositionScrollIntoView = (compositionId) => {
|
|
46
|
+
if (skipCompositionScrollIntoViewForId === compositionId) {
|
|
47
|
+
skipCompositionScrollIntoViewForId = null;
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
};
|
|
52
|
+
const maybeScrollCompositionSidebarRowIntoView = ({ element, compositionId, selected, }) => {
|
|
53
|
+
if (!selected) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (shouldSkipCompositionScrollIntoView(compositionId)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
(0, exports.scrollSidebarRowIntoViewIfNeeded)(element);
|
|
60
|
+
};
|
|
61
|
+
exports.maybeScrollCompositionSidebarRowIntoView = maybeScrollCompositionSidebarRowIntoView;
|
|
62
|
+
let skipAssetScrollIntoViewForPath = null;
|
|
63
|
+
const markAssetSidebarScrollFromRowClick = (assetPath) => {
|
|
64
|
+
skipAssetScrollIntoViewForPath = assetPath;
|
|
65
|
+
};
|
|
66
|
+
exports.markAssetSidebarScrollFromRowClick = markAssetSidebarScrollFromRowClick;
|
|
67
|
+
const shouldSkipAssetScrollIntoView = (assetPath) => {
|
|
68
|
+
if (skipAssetScrollIntoViewForPath === assetPath) {
|
|
69
|
+
skipAssetScrollIntoViewForPath = null;
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
};
|
|
74
|
+
const maybeScrollAssetSidebarRowIntoView = ({ element, assetPath, selected, }) => {
|
|
75
|
+
if (!selected) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (shouldSkipAssetScrollIntoView(assetPath)) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
(0, exports.scrollSidebarRowIntoViewIfNeeded)(element);
|
|
82
|
+
};
|
|
83
|
+
exports.maybeScrollAssetSidebarRowIntoView = maybeScrollAssetSidebarRowIntoView;
|
|
@@ -9,7 +9,9 @@ const useStudioCanvasDimensions = ({ canvasSize, contentDimensions, assetMetadat
|
|
|
9
9
|
const { centerX, centerY, scale } = (0, react_1.useMemo)(() => {
|
|
10
10
|
if (contentDimensions === 'none' ||
|
|
11
11
|
contentDimensions === null ||
|
|
12
|
-
(assetMetadata &&
|
|
12
|
+
(assetMetadata &&
|
|
13
|
+
(assetMetadata.type === 'not-found' ||
|
|
14
|
+
assetMetadata.type === 'metadata-error')) ||
|
|
13
15
|
!canvasSize) {
|
|
14
16
|
return {
|
|
15
17
|
centerX: previewSize.translation.x,
|
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.446",
|
|
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.446",
|
|
30
|
+
"@remotion/player": "4.0.446",
|
|
31
|
+
"@remotion/media-utils": "4.0.446",
|
|
32
|
+
"@remotion/renderer": "4.0.446",
|
|
33
|
+
"@remotion/web-renderer": "4.0.446",
|
|
34
|
+
"@remotion/studio-shared": "4.0.446",
|
|
35
|
+
"@remotion/zod-types": "4.0.446",
|
|
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.446",
|
|
47
47
|
"eslint": "9.19.0",
|
|
48
48
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
49
49
|
},
|