@remotion/studio 4.0.464 → 4.0.466
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CompositionSelectorItem.js +16 -79
- package/dist/components/EditorContent.js +1 -3
- package/dist/components/Menu/MenuItem.d.ts +1 -1
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
- package/dist/components/NewComposition/CodemodFooter.js +35 -23
- package/dist/components/NewComposition/DeleteComposition.js +3 -1
- package/dist/components/NewComposition/DiffPreview.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +3 -1
- package/dist/components/NewComposition/MenuContent.js +1 -0
- package/dist/components/NewComposition/RenameComposition.js +4 -2
- package/dist/components/RenderButton.js +1 -0
- package/dist/components/RenderModal/RenderModalAdvanced.d.ts +1 -11
- package/dist/components/RenderModal/RenderModalAdvanced.js +4 -50
- package/dist/components/RenderModal/RenderModalEncoding.d.ts +37 -0
- package/dist/components/RenderModal/RenderModalEncoding.js +165 -0
- package/dist/components/RenderModal/RenderModalPicture.d.ts +1 -22
- package/dist/components/RenderModal/RenderModalPicture.js +6 -84
- package/dist/components/RenderModal/ServerRenderModal.d.ts +1 -0
- package/dist/components/RenderModal/ServerRenderModal.js +16 -4
- package/dist/components/RenderQueue/actions.d.ts +4 -2
- package/dist/components/RenderQueue/actions.js +4 -2
- package/dist/components/SidebarRenderButton.js +1 -0
- package/dist/components/Timeline/Timeline.js +6 -4
- package/dist/components/Timeline/TimelineEffectFieldRow.js +2 -1
- package/dist/components/Timeline/TimelineEffectGroupRow.d.ts +1 -0
- package/dist/components/Timeline/TimelineEffectGroupRow.js +70 -2
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedRow.js +1 -1
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +7 -0
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +123 -0
- package/dist/components/Timeline/TimelineSchemaField.js +2 -1
- package/dist/components/Timeline/TimelineStack/index.js +7 -47
- package/dist/components/Timeline/TimelineTimeIndicators.js +4 -11
- package/dist/components/Timeline/TimelineTracks.js +2 -16
- package/dist/components/Timeline/TimelineVideoInfo.js +25 -8
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +6 -0
- package/dist/components/Timeline/get-timeline-keyframes.js +22 -0
- package/dist/components/Timeline/get-timeline-video-info-widths.d.ts +9 -0
- package/dist/components/Timeline/get-timeline-video-info-widths.js +11 -0
- package/dist/components/Timeline/use-resolved-stack.d.ts +1 -0
- package/dist/components/Timeline/use-resolved-stack.js +10 -1
- package/dist/components/composition-menu-items.d.ts +12 -0
- package/dist/components/composition-menu-items.js +166 -0
- package/dist/esm/{chunk-mawnnpzg.js → chunk-sa3dm85y.js} +3843 -3284
- package/dist/esm/internals.mjs +3843 -3284
- package/dist/esm/previewEntry.mjs +3585 -3026
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/make-render-command.d.ts +2 -2
- package/dist/helpers/make-render-command.js +2 -1
- package/dist/helpers/open-in-editor.d.ts +8 -0
- package/dist/helpers/open-in-editor.js +58 -1
- package/dist/helpers/render-modal-sections.d.ts +1 -1
- package/dist/helpers/render-modal-sections.js +35 -5
- package/dist/helpers/resolved-stack-to-symbolicated.d.ts +3 -0
- package/dist/helpers/resolved-stack-to-symbolicated.js +16 -0
- package/dist/helpers/retry-payload.js +3 -0
- package/dist/helpers/timeline-layout.d.ts +1 -0
- package/dist/helpers/timeline-layout.js +6 -1
- package/dist/helpers/use-menu-structure.js +43 -0
- package/dist/state/modals.d.ts +1 -0
- package/package.json +10 -10
|
@@ -6,6 +6,9 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
8
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
9
|
+
const call_api_1 = require("../call-api");
|
|
10
|
+
const ContextMenu_1 = require("../ContextMenu");
|
|
11
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
9
12
|
const save_effect_prop_1 = require("./save-effect-prop");
|
|
10
13
|
const TimelineExpandArrowButton_1 = require("./TimelineExpandArrowButton");
|
|
11
14
|
const TimelineLayerEye_1 = require("./TimelineLayerEye");
|
|
@@ -15,9 +18,10 @@ const rowLabel = {
|
|
|
15
18
|
color: 'rgba(255, 255, 255, 0.8)',
|
|
16
19
|
userSelect: 'none',
|
|
17
20
|
};
|
|
18
|
-
const TimelineEffectGroupRow = ({ label, nodePathInfo, effectIndex, effectSchema, nodePath, validatedLocation, rowDepth, getIsExpanded, toggleTrack, }) => {
|
|
21
|
+
const TimelineEffectGroupRow = ({ label, nodePathInfo, effectIndex, effectSchema, documentationLink, nodePath, validatedLocation, rowDepth, getIsExpanded, toggleTrack, }) => {
|
|
19
22
|
var _a;
|
|
20
23
|
var _b;
|
|
24
|
+
const [labelHovered, setLabelHovered] = (0, react_1.useState)(false);
|
|
21
25
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
22
26
|
const previewConnected = previewServerState.type === 'connected';
|
|
23
27
|
const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
|
|
@@ -37,6 +41,54 @@ const TimelineEffectGroupRow = ({ label, nodePathInfo, effectIndex, effectSchema
|
|
|
37
41
|
return false;
|
|
38
42
|
}, [disabledStatus]);
|
|
39
43
|
const canToggle = previewConnected && disabledStatus !== null && disabledStatus.canUpdate;
|
|
44
|
+
const deleteDisabled = !previewConnected ||
|
|
45
|
+
effectStatus.type !== 'can-update-effect' ||
|
|
46
|
+
!validatedLocation.source;
|
|
47
|
+
const onDeleteEffectFromSource = (0, react_1.useCallback)(async () => {
|
|
48
|
+
if (deleteDisabled) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const result = await (0, call_api_1.callApi)('/api/delete-effect', {
|
|
53
|
+
fileName: validatedLocation.source,
|
|
54
|
+
sequenceNodePath: nodePath,
|
|
55
|
+
effectIndex,
|
|
56
|
+
});
|
|
57
|
+
if (result.success) {
|
|
58
|
+
(0, NotificationCenter_1.showNotification)('Removed effect from source file', 2000);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
66
|
+
}
|
|
67
|
+
}, [deleteDisabled, effectIndex, nodePath, validatedLocation.source]);
|
|
68
|
+
const contextMenuValues = (0, react_1.useMemo)(() => {
|
|
69
|
+
if (!previewConnected) {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
return [
|
|
73
|
+
{
|
|
74
|
+
type: 'item',
|
|
75
|
+
id: 'delete-effect',
|
|
76
|
+
keyHint: null,
|
|
77
|
+
label: 'Delete',
|
|
78
|
+
leftItem: null,
|
|
79
|
+
disabled: deleteDisabled,
|
|
80
|
+
onClick: () => {
|
|
81
|
+
if (deleteDisabled) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
onDeleteEffectFromSource();
|
|
85
|
+
},
|
|
86
|
+
quickSwitcherLabel: null,
|
|
87
|
+
subMenu: null,
|
|
88
|
+
value: 'delete-effect',
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
}, [deleteDisabled, onDeleteEffectFromSource, previewConnected]);
|
|
40
92
|
const onToggle = (0, react_1.useCallback)((type) => {
|
|
41
93
|
if (!canToggle || previewServerState.type !== 'connected') {
|
|
42
94
|
return;
|
|
@@ -71,6 +123,22 @@ const TimelineEffectGroupRow = ({ label, nodePathInfo, effectIndex, effectSchema
|
|
|
71
123
|
height: timeline_layout_1.TREE_GROUP_ROW_HEIGHT,
|
|
72
124
|
paddingRight: timeline_layout_1.EXPANDED_SECTION_PADDING_RIGHT,
|
|
73
125
|
}), []);
|
|
74
|
-
|
|
126
|
+
const labelStyle = (0, react_1.useMemo)(() => {
|
|
127
|
+
const hoverEffect = labelHovered && documentationLink !== null;
|
|
128
|
+
return {
|
|
129
|
+
...rowLabel,
|
|
130
|
+
textDecoration: hoverEffect ? 'underline' : 'none',
|
|
131
|
+
textUnderlineOffset: 2,
|
|
132
|
+
cursor: hoverEffect ? 'pointer' : undefined,
|
|
133
|
+
};
|
|
134
|
+
}, [documentationLink, labelHovered]);
|
|
135
|
+
const onClickLabel = (0, react_1.useCallback)(() => {
|
|
136
|
+
if (documentationLink === null) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
window.open(documentationLink, '_blank', 'noopener,noreferrer');
|
|
140
|
+
}, [documentationLink]);
|
|
141
|
+
const row = (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: canToggle ? (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEye, { type: "effect", hidden: isDisabled, onInvoked: onToggle })) : (jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {})), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(nodePathInfo), label: `${label} section`, disabled: false }), style: rowStyle, children: jsx_runtime_1.jsx("span", { onPointerEnter: () => setLabelHovered(true), onPointerLeave: () => setLabelHovered(false), onClick: onClickLabel, title: documentationLink ? `Open documentation: ${documentationLink}` : label, style: labelStyle, children: label }) }));
|
|
142
|
+
return previewConnected ? (jsx_runtime_1.jsx(ContextMenu_1.ContextMenu, { values: contextMenuValues, children: row })) : (row);
|
|
75
143
|
};
|
|
76
144
|
exports.TimelineEffectGroupRow = TimelineEffectGroupRow;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
|
|
3
3
|
import type { CodePosition } from '../../error-overlay/react-overlay/utils/get-source-map';
|
|
4
4
|
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
5
5
|
import type { TimelineTreeNode } from '../../helpers/timeline-layout';
|
|
@@ -19,7 +19,7 @@ const TimelineExpandedRow = ({ node, depth, nestedDepth, getIsExpanded, toggleTr
|
|
|
19
19
|
const rowDepth = (0, timeline_row_layout_1.getExpandedRowDepth)({ nestedDepth, treeDepth: depth });
|
|
20
20
|
if (node.kind === 'group') {
|
|
21
21
|
if (node.effectInfo) {
|
|
22
|
-
return (jsx_runtime_1.jsx(TimelineEffectGroupRow_1.TimelineEffectGroupRow, { label: node.label, nodePathInfo: node.nodePathInfo, effectIndex: node.effectInfo.effectIndex, effectSchema: node.effectInfo.effectSchema, nodePath: nodePath, validatedLocation: validatedLocation, rowDepth: rowDepth, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack }));
|
|
22
|
+
return (jsx_runtime_1.jsx(TimelineEffectGroupRow_1.TimelineEffectGroupRow, { label: node.label, nodePathInfo: node.nodePathInfo, effectIndex: node.effectInfo.effectIndex, effectSchema: node.effectInfo.effectSchema, documentationLink: node.effectInfo.documentationLink, nodePath: nodePath, validatedLocation: validatedLocation, rowDepth: rowDepth, getIsExpanded: getIsExpanded, toggleTrack: toggleTrack }));
|
|
23
23
|
}
|
|
24
24
|
const isExpanded = getIsExpanded(node.nodePathInfo);
|
|
25
25
|
return (jsx_runtime_1.jsx(TimelineRowChrome_1.TimelineRowChrome, { depth: rowDepth, eye: jsx_runtime_1.jsx(TimelineLayerEye_1.TimelineLayerEyeSpacer, {}), arrow: jsx_runtime_1.jsx(TimelineExpandArrowButton_1.TimelineExpandArrowButton, { isExpanded: isExpanded, onClick: () => toggleTrack(node.nodePathInfo), label: `${node.label} section`, disabled: false }), style: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TSequence } from 'remotion';
|
|
3
|
+
import type { SequenceNodePathInfo } from '../../helpers/get-timeline-sequence-sort-key';
|
|
4
|
+
export declare const TimelineExpandedTrackKeyframes: React.NamedExoticComponent<{
|
|
5
|
+
readonly sequence: TSequence;
|
|
6
|
+
readonly nodePathInfo: SequenceNodePathInfo;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,123 @@
|
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TimelineExpandedTrackKeyframes = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const remotion_1 = require("remotion");
|
|
40
|
+
const colors_1 = require("../../helpers/colors");
|
|
41
|
+
const get_left_of_timeline_slider_1 = require("../../helpers/get-left-of-timeline-slider");
|
|
42
|
+
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
43
|
+
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
44
|
+
const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
|
|
45
|
+
const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
|
|
46
|
+
const row = {
|
|
47
|
+
position: 'relative',
|
|
48
|
+
};
|
|
49
|
+
const separator = {
|
|
50
|
+
height: 1,
|
|
51
|
+
backgroundColor: colors_1.TIMELINE_TRACK_SEPARATOR,
|
|
52
|
+
};
|
|
53
|
+
const section = {
|
|
54
|
+
borderBottom: `1px solid ${colors_1.TIMELINE_TRACK_SEPARATOR}`,
|
|
55
|
+
};
|
|
56
|
+
const diamondBase = {
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
width: 8,
|
|
59
|
+
height: 8,
|
|
60
|
+
backgroundColor: colors_1.LIGHT_TEXT,
|
|
61
|
+
borderRadius: 1,
|
|
62
|
+
boxShadow: '0 0 0 1px rgba(0, 0, 0, 0.4)',
|
|
63
|
+
pointerEvents: 'none',
|
|
64
|
+
};
|
|
65
|
+
const getNodeKeyframes = ({ node, nodePath, codeValues, }) => {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
if (node.kind !== 'field' || node.field === null) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
if (node.field.kind === 'sequence-field') {
|
|
71
|
+
return (0, get_timeline_keyframes_1.getTimelineKeyframes)((_a = remotion_1.Internals.getCodeValuesCtx(codeValues, nodePath)) === null || _a === void 0 ? void 0 : _a[node.field.key]);
|
|
72
|
+
}
|
|
73
|
+
const effectStatus = remotion_1.Internals.getEffectCodeValuesCtx({
|
|
74
|
+
codeValues,
|
|
75
|
+
nodePath,
|
|
76
|
+
effectIndex: node.field.effectIndex,
|
|
77
|
+
});
|
|
78
|
+
return (0, get_timeline_keyframes_1.getTimelineKeyframes)(effectStatus.type === 'can-update-effect'
|
|
79
|
+
? (_b = effectStatus.props) === null || _b === void 0 ? void 0 : _b[node.field.key]
|
|
80
|
+
: null);
|
|
81
|
+
};
|
|
82
|
+
const TimelineExpandedTrackKeyframesInner = ({ nodePathInfo, sequence }) => {
|
|
83
|
+
const videoConfig = (0, remotion_1.useVideoConfig)();
|
|
84
|
+
const timelineWidth = (0, react_1.useContext)(TimelineWidthProvider_1.TimelineWidthContext);
|
|
85
|
+
const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
|
|
86
|
+
const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
|
|
87
|
+
const tree = (0, react_1.useMemo)(() => (0, timeline_layout_1.buildTimelineTree)({
|
|
88
|
+
sequence,
|
|
89
|
+
nodePathInfo,
|
|
90
|
+
getDragOverrides: () => ({}),
|
|
91
|
+
codeValues,
|
|
92
|
+
}), [codeValues, nodePathInfo, sequence]);
|
|
93
|
+
const flat = (0, react_1.useMemo)(() => (0, timeline_layout_1.flattenVisibleTreeNodes)({ nodes: tree, getIsExpanded }), [tree, getIsExpanded]);
|
|
94
|
+
const expandedHeight = (0, react_1.useMemo)(() => (0, timeline_layout_1.getExpandedTrackHeight)({
|
|
95
|
+
sequence,
|
|
96
|
+
nodePathInfo,
|
|
97
|
+
getIsExpanded,
|
|
98
|
+
codeValues,
|
|
99
|
+
}), [codeValues, getIsExpanded, nodePathInfo, sequence]);
|
|
100
|
+
const rows = (0, react_1.useMemo)(() => flat.map(({ node }) => ({
|
|
101
|
+
height: (0, timeline_layout_1.getTreeRowHeight)(node),
|
|
102
|
+
keyframes: getNodeKeyframes({
|
|
103
|
+
node,
|
|
104
|
+
nodePath: nodePathInfo.sequenceSubscriptionKey,
|
|
105
|
+
codeValues,
|
|
106
|
+
}),
|
|
107
|
+
key: JSON.stringify(node.nodePathInfo),
|
|
108
|
+
})), [codeValues, flat, nodePathInfo.sequenceSubscriptionKey]);
|
|
109
|
+
return (jsx_runtime_1.jsx("div", { style: {
|
|
110
|
+
height: expandedHeight + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
111
|
+
}, children: jsx_runtime_1.jsx("div", { style: { ...section, height: expandedHeight }, children: rows.map(({ height, keyframes, key }, i) => {
|
|
112
|
+
return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i > 0 ? jsx_runtime_1.jsx("div", { style: separator }) : null, jsx_runtime_1.jsx("div", { style: { ...row, height }, children: timelineWidth === null
|
|
113
|
+
? null
|
|
114
|
+
: keyframes.map((keyframe) => (jsx_runtime_1.jsx("div", { style: {
|
|
115
|
+
...diamondBase,
|
|
116
|
+
left: (0, get_left_of_timeline_slider_1.getXPositionOfItemInTimelineImperatively)(keyframe.frame, videoConfig.durationInFrames, timelineWidth) - timeline_layout_1.TIMELINE_PADDING,
|
|
117
|
+
top: height / 2,
|
|
118
|
+
transform: 'translate(-50%, -50%) rotate(45deg)',
|
|
119
|
+
}, title: `Keyframe at frame ${keyframe.frame}` }, String(keyframe.frame)))) })
|
|
120
|
+
] }, key));
|
|
121
|
+
}) }) }));
|
|
122
|
+
};
|
|
123
|
+
exports.TimelineExpandedTrackKeyframes = react_1.default.memo(TimelineExpandedTrackKeyframesInner);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimelineFieldValue = exports.TimelineNonEditableStatus = exports.UnsupportedStatus = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
|
|
5
6
|
const TimelineBooleanField_1 = require("./TimelineBooleanField");
|
|
6
7
|
const TimelineColorField_1 = require("./TimelineColorField");
|
|
7
8
|
const TimelineEnumField_1 = require("./TimelineEnumField");
|
|
@@ -30,7 +31,7 @@ const TimelineNonEditableStatus = ({ propStatus }) => {
|
|
|
30
31
|
return null;
|
|
31
32
|
}
|
|
32
33
|
if (propStatus.reason === 'computed') {
|
|
33
|
-
return jsx_runtime_1.jsx("span", { style: unsupportedLabel, children:
|
|
34
|
+
return (jsx_runtime_1.jsx("span", { style: unsupportedLabel, children: (0, get_timeline_keyframes_1.getComputedStatusLabel)(propStatus) }));
|
|
34
35
|
}
|
|
35
36
|
throw new Error(`Unsupported prop status: ${propStatus.reason}`);
|
|
36
37
|
};
|
|
@@ -7,8 +7,6 @@ const client_id_1 = require("../../../helpers/client-id");
|
|
|
7
7
|
const colors_1 = require("../../../helpers/colors");
|
|
8
8
|
const get_git_menu_item_1 = require("../../../helpers/get-git-menu-item");
|
|
9
9
|
const open_in_editor_1 = require("../../../helpers/open-in-editor");
|
|
10
|
-
const url_state_1 = require("../../../helpers/url-state");
|
|
11
|
-
const InitialCompositionLoader_1 = require("../../InitialCompositionLoader");
|
|
12
10
|
const layout_1 = require("../../layout");
|
|
13
11
|
const NotificationCenter_1 = require("../../Notifications/NotificationCenter");
|
|
14
12
|
const Spinner_1 = require("../../Spinner");
|
|
@@ -17,26 +15,8 @@ const TimelineStack = ({ isCompact, sequence, originalLocation }) => {
|
|
|
17
15
|
const [stackHovered, setStackHovered] = (0, react_1.useState)(false);
|
|
18
16
|
const [titleHovered, setTitleHovered] = (0, react_1.useState)(false);
|
|
19
17
|
const [opening, setOpening] = (0, react_1.useState)(false);
|
|
20
|
-
const selectAsset = (0, InitialCompositionLoader_1.useSelectAsset)();
|
|
21
18
|
const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx)
|
|
22
19
|
.previewServerState.type;
|
|
23
|
-
const assetPath = (0, react_1.useMemo)(() => {
|
|
24
|
-
if (sequence.type !== 'video' &&
|
|
25
|
-
sequence.type !== 'audio' &&
|
|
26
|
-
sequence.type !== 'image') {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
const isStatic = sequence.src.startsWith(window.remotion_staticBase);
|
|
30
|
-
if (!isStatic) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
const relativePath = sequence.src.replace(window.remotion_staticBase + '/', '');
|
|
34
|
-
return relativePath;
|
|
35
|
-
}, [sequence]);
|
|
36
|
-
const navigateToAsset = (0, react_1.useCallback)((asset) => {
|
|
37
|
-
selectAsset(asset);
|
|
38
|
-
(0, url_state_1.pushUrl)(`/assets/${asset}`);
|
|
39
|
-
}, [selectAsset]);
|
|
40
20
|
const openEditor = (0, react_1.useCallback)(async (location) => {
|
|
41
21
|
if (!window.remotion_editorName) {
|
|
42
22
|
return;
|
|
@@ -56,35 +36,15 @@ const TimelineStack = ({ isCompact, sequence, originalLocation }) => {
|
|
|
56
36
|
connectionStatus === 'connected' &&
|
|
57
37
|
originalLocation;
|
|
58
38
|
const canOpenInGitHub = window.remotion_gitSource && originalLocation;
|
|
59
|
-
const
|
|
39
|
+
const { documentationLink } = sequence;
|
|
40
|
+
const titleHoverable = documentationLink !== null;
|
|
60
41
|
const stackHoverable = !isCompact && (canOpenInEditor || canOpenInGitHub);
|
|
61
42
|
const onClickTitle = (0, react_1.useCallback)(() => {
|
|
62
|
-
if (
|
|
43
|
+
if (documentationLink === null) {
|
|
63
44
|
return null;
|
|
64
45
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (!originalLocation) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (canOpenInEditor) {
|
|
73
|
-
openEditor(originalLocation);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (canOpenInGitHub) {
|
|
77
|
-
window.open((0, get_git_menu_item_1.getGitRefUrl)(window.remotion_gitSource, originalLocation), '_blank');
|
|
78
|
-
}
|
|
79
|
-
}, [
|
|
80
|
-
assetPath,
|
|
81
|
-
canOpenInEditor,
|
|
82
|
-
canOpenInGitHub,
|
|
83
|
-
navigateToAsset,
|
|
84
|
-
openEditor,
|
|
85
|
-
originalLocation,
|
|
86
|
-
titleHoverable,
|
|
87
|
-
]);
|
|
46
|
+
window.open(documentationLink, '_blank', 'noopener,noreferrer');
|
|
47
|
+
}, [documentationLink]);
|
|
88
48
|
const onClickStack = (0, react_1.useCallback)(() => {
|
|
89
49
|
if (!originalLocation) {
|
|
90
50
|
return;
|
|
@@ -150,8 +110,8 @@ const TimelineStack = ({ isCompact, sequence, originalLocation }) => {
|
|
|
150
110
|
? sequence.displayName.slice(0, 1000) + '...'
|
|
151
111
|
: sequence.displayName;
|
|
152
112
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
153
|
-
jsx_runtime_1.jsx("div", { onPointerEnter: onTitlePointerEnter, onPointerLeave: onTitlePointerLeave, title:
|
|
154
|
-
?
|
|
113
|
+
jsx_runtime_1.jsx("div", { onPointerEnter: onTitlePointerEnter, onPointerLeave: onTitlePointerLeave, title: documentationLink
|
|
114
|
+
? `Open documentation: ${documentationLink}`
|
|
155
115
|
: text || '<Sequence>', style: titleStyle, onClick: onClickTitle, children: text || '<Sequence>' }), isCompact || !originalLocation ? null : (jsx_runtime_1.jsx("div", { onPointerEnter: onStackPointerEnter, onPointerLeave: onStackPointerLeave, onClick: onClickStack, style: style, children: (0, source_attribution_1.getOriginalSourceAttribution)(originalLocation) })), opening ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
156
116
|
jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(Spinner_1.Spinner, { duration: 0.5, size: 12 })
|
|
157
117
|
] })) : null] }));
|
|
@@ -7,14 +7,13 @@ const remotion_1 = require("remotion");
|
|
|
7
7
|
const colors_1 = require("../../helpers/colors");
|
|
8
8
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
9
9
|
const render_frame_1 = require("../../state/render-frame");
|
|
10
|
-
const SplitterHandle_1 = require("../Splitter/SplitterHandle");
|
|
11
10
|
const TimeValue_1 = require("../TimeValue");
|
|
12
11
|
const timeline_refs_1 = require("./timeline-refs");
|
|
13
12
|
const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
|
|
14
13
|
const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
|
|
15
14
|
exports.TIMELINE_TIME_INDICATOR_HEIGHT = 39;
|
|
16
15
|
const container = {
|
|
17
|
-
height: exports.TIMELINE_TIME_INDICATOR_HEIGHT
|
|
16
|
+
height: exports.TIMELINE_TIME_INDICATOR_HEIGHT,
|
|
18
17
|
boxShadow: `0 0 4px ${colors_1.TIMELINE_BACKGROUND}`,
|
|
19
18
|
position: 'absolute',
|
|
20
19
|
backgroundColor: colors_1.TIMELINE_BACKGROUND,
|
|
@@ -94,10 +93,8 @@ const TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) =>
|
|
|
94
93
|
const style = (0, react_1.useMemo)(() => {
|
|
95
94
|
return {
|
|
96
95
|
...container,
|
|
97
|
-
width: windowWidth
|
|
96
|
+
width: windowWidth,
|
|
98
97
|
overflow: 'hidden',
|
|
99
|
-
// Since
|
|
100
|
-
marginLeft: SplitterHandle_1.SPLITTER_HANDLE_SIZE / 2,
|
|
101
98
|
pointerEvents: 'none',
|
|
102
99
|
};
|
|
103
100
|
}, [windowWidth]);
|
|
@@ -119,9 +116,7 @@ const TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) =>
|
|
|
119
116
|
frame: index * fps,
|
|
120
117
|
style: {
|
|
121
118
|
...secondTick,
|
|
122
|
-
left: frameInterval * index * fps +
|
|
123
|
-
timeline_layout_1.TIMELINE_PADDING -
|
|
124
|
-
SplitterHandle_1.SPLITTER_HANDLE_SIZE / 2,
|
|
119
|
+
left: frameInterval * index * fps + timeline_layout_1.TIMELINE_PADDING,
|
|
125
120
|
},
|
|
126
121
|
showTime: index > 0,
|
|
127
122
|
};
|
|
@@ -134,9 +129,7 @@ const TimelineTimeIndicatorsInner = ({ windowWidth, durationInFrames, fps }) =>
|
|
|
134
129
|
frame: index,
|
|
135
130
|
style: {
|
|
136
131
|
...tick,
|
|
137
|
-
left: frameInterval * index +
|
|
138
|
-
timeline_layout_1.TIMELINE_PADDING -
|
|
139
|
-
SplitterHandle_1.SPLITTER_HANDLE_SIZE / 2,
|
|
132
|
+
left: frameInterval * index + timeline_layout_1.TIMELINE_PADDING,
|
|
140
133
|
height: index % fps === 0
|
|
141
134
|
? 10
|
|
142
135
|
: (index / frameMarkerEveryNth) % 2 === 0
|
|
@@ -36,11 +36,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.TimelineTracks = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
|
-
const remotion_1 = require("remotion");
|
|
40
39
|
const client_id_1 = require("../../helpers/client-id");
|
|
41
40
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
42
41
|
const ExpandedTracksProvider_1 = require("../ExpandedTracksProvider");
|
|
43
42
|
const MaxTimelineTracks_1 = require("./MaxTimelineTracks");
|
|
43
|
+
const TimelineExpandedTrackKeyframes_1 = require("./TimelineExpandedTrackKeyframes");
|
|
44
44
|
const TimelineSequence_1 = require("./TimelineSequence");
|
|
45
45
|
const TimelineTimeIndicators_1 = require("./TimelineTimeIndicators");
|
|
46
46
|
const content = {
|
|
@@ -51,18 +51,9 @@ const content = {
|
|
|
51
51
|
const timelineContent = {
|
|
52
52
|
minHeight: '100%',
|
|
53
53
|
};
|
|
54
|
-
const getExpandedPlaceholderStyle = ({ sequence, nodePathInfo, getIsExpanded, codeValues, }) => ({
|
|
55
|
-
height: (0, timeline_layout_1.getExpandedTrackHeight)({
|
|
56
|
-
sequence,
|
|
57
|
-
nodePathInfo,
|
|
58
|
-
getIsExpanded,
|
|
59
|
-
codeValues,
|
|
60
|
-
}) + timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
61
|
-
});
|
|
62
54
|
const TimelineTracksInner = ({ timeline, hasBeenCut }) => {
|
|
63
55
|
const { getIsExpanded } = (0, react_1.useContext)(ExpandedTracksProvider_1.ExpandedTracksGetterContext);
|
|
64
56
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
65
|
-
const { codeValues } = (0, react_1.useContext)(remotion_1.Internals.VisualModeCodeValuesContext);
|
|
66
57
|
const previewServerConnected = previewServerState.type === 'connected';
|
|
67
58
|
const timelineStyle = (0, react_1.useMemo)(() => {
|
|
68
59
|
return {
|
|
@@ -78,12 +69,7 @@ const TimelineTracksInner = ({ timeline, hasBeenCut }) => {
|
|
|
78
69
|
jsx_runtime_1.jsx("div", { style: {
|
|
79
70
|
height: (0, timeline_layout_1.getTimelineLayerHeight)(track.sequence.type),
|
|
80
71
|
marginBottom: timeline_layout_1.TIMELINE_ITEM_BORDER_BOTTOM,
|
|
81
|
-
}, children: jsx_runtime_1.jsx(TimelineSequence_1.TimelineSequence, { s: track.sequence }) }), isExpanded && track.nodePathInfo && previewServerConnected ? (jsx_runtime_1.jsx(
|
|
82
|
-
sequence: track.sequence,
|
|
83
|
-
nodePathInfo: track.nodePathInfo,
|
|
84
|
-
getIsExpanded,
|
|
85
|
-
codeValues,
|
|
86
|
-
}) })) : null] }, track.sequence.id));
|
|
72
|
+
}, children: jsx_runtime_1.jsx(TimelineSequence_1.TimelineSequence, { s: track.sequence }) }), isExpanded && track.nodePathInfo && previewServerConnected ? (jsx_runtime_1.jsx(TimelineExpandedTrackKeyframes_1.TimelineExpandedTrackKeyframes, { sequence: track.sequence, nodePathInfo: track.nodePathInfo })) : null] }, track.sequence.id));
|
|
87
73
|
})] }), hasBeenCut ? jsx_runtime_1.jsx(MaxTimelineTracks_1.MaxTimelineTracksReached, {}) : null] }));
|
|
88
74
|
};
|
|
89
75
|
exports.TimelineTracks = react_1.default.memo(TimelineTracksInner);
|
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const remotion_1 = require("remotion");
|
|
8
8
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
9
9
|
const AudioWaveform_1 = require("../AudioWaveform");
|
|
10
|
+
const get_timeline_video_info_widths_1 = require("./get-timeline-video-info-widths");
|
|
10
11
|
const FILMSTRIP_HEIGHT = timeline_layout_1.TIMELINE_LAYER_HEIGHT_IMAGE - 2;
|
|
11
12
|
const outerStyle = {
|
|
12
13
|
width: '100%',
|
|
@@ -16,7 +17,6 @@ const outerStyle = {
|
|
|
16
17
|
};
|
|
17
18
|
const filmstripContainerStyle = {
|
|
18
19
|
height: FILMSTRIP_HEIGHT,
|
|
19
|
-
width: '100%',
|
|
20
20
|
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
21
21
|
display: 'flex',
|
|
22
22
|
borderTopLeftRadius: 2,
|
|
@@ -28,6 +28,14 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
28
28
|
const ref = (0, react_1.useRef)(null);
|
|
29
29
|
const [error, setError] = (0, react_1.useState)(null);
|
|
30
30
|
const aspectRatio = (0, react_1.useRef)((0, timeline_utils_1.getAspectRatioFromCache)(src));
|
|
31
|
+
const { mediaVisualizationWidth, mediaNaturalWidth } = (0, react_1.useMemo)(() => {
|
|
32
|
+
return (0, get_timeline_video_info_widths_1.getTimelineVideoInfoWidths)({
|
|
33
|
+
visualizationWidth,
|
|
34
|
+
naturalWidth,
|
|
35
|
+
premountWidth,
|
|
36
|
+
postmountWidth,
|
|
37
|
+
});
|
|
38
|
+
}, [naturalWidth, postmountWidth, premountWidth, visualizationWidth]);
|
|
31
39
|
// for rendering frames
|
|
32
40
|
(0, react_1.useEffect)(() => {
|
|
33
41
|
if (error) {
|
|
@@ -39,7 +47,7 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
39
47
|
}
|
|
40
48
|
const controller = new AbortController();
|
|
41
49
|
const canvas = document.createElement('canvas');
|
|
42
|
-
canvas.width =
|
|
50
|
+
canvas.width = mediaVisualizationWidth;
|
|
43
51
|
canvas.height = FILMSTRIP_HEIGHT;
|
|
44
52
|
const ctx = canvas.getContext('2d');
|
|
45
53
|
if (!ctx) {
|
|
@@ -47,7 +55,7 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
47
55
|
}
|
|
48
56
|
current.appendChild(canvas);
|
|
49
57
|
const loopWidth = (0, timeline_utils_1.getLoopDisplayWidth)({
|
|
50
|
-
visualizationWidth:
|
|
58
|
+
visualizationWidth: mediaNaturalWidth,
|
|
51
59
|
loopDisplay,
|
|
52
60
|
});
|
|
53
61
|
const shouldRepeatVideo = (0, timeline_utils_1.shouldTileLoopDisplay)(loopDisplay);
|
|
@@ -85,7 +93,9 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
85
93
|
// Trim is applied first, then playbackRate. Each composition frame
|
|
86
94
|
// advances the source video by `playbackRate` source frames.
|
|
87
95
|
const toSeconds = fromSeconds + (visibleDurationInFrames * playbackRate) / fps;
|
|
88
|
-
const targetWidth = shouldRepeatVideo
|
|
96
|
+
const targetWidth = shouldRepeatVideo
|
|
97
|
+
? targetCanvas.width
|
|
98
|
+
: mediaNaturalWidth;
|
|
89
99
|
if (aspectRatio.current !== null) {
|
|
90
100
|
(0, timeline_utils_1.ensureSlots)({
|
|
91
101
|
filledSlots,
|
|
@@ -207,13 +217,20 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
207
217
|
error,
|
|
208
218
|
fps,
|
|
209
219
|
loopDisplay,
|
|
210
|
-
|
|
220
|
+
mediaNaturalWidth,
|
|
221
|
+
mediaVisualizationWidth,
|
|
211
222
|
playbackRate,
|
|
212
223
|
src,
|
|
213
224
|
trimBefore,
|
|
214
|
-
visualizationWidth,
|
|
215
225
|
]);
|
|
216
|
-
const audioWidth =
|
|
226
|
+
const audioWidth = mediaVisualizationWidth;
|
|
227
|
+
const filmstripStyle = (0, react_1.useMemo)(() => {
|
|
228
|
+
return {
|
|
229
|
+
...filmstripContainerStyle,
|
|
230
|
+
width: mediaVisualizationWidth,
|
|
231
|
+
marginLeft: premountWidth,
|
|
232
|
+
};
|
|
233
|
+
}, [mediaVisualizationWidth, premountWidth]);
|
|
217
234
|
const audioStyle = (0, react_1.useMemo)(() => {
|
|
218
235
|
return {
|
|
219
236
|
height: timeline_layout_1.TIMELINE_LAYER_HEIGHT_AUDIO,
|
|
@@ -223,7 +240,7 @@ const TimelineVideoInfo = ({ src, visualizationWidth, naturalWidth, trimBefore,
|
|
|
223
240
|
};
|
|
224
241
|
}, [audioWidth, premountWidth]);
|
|
225
242
|
return (jsx_runtime_1.jsxs("div", { style: outerStyle, children: [
|
|
226
|
-
jsx_runtime_1.jsx("div", { ref: ref, style:
|
|
243
|
+
jsx_runtime_1.jsx("div", { ref: ref, style: filmstripStyle }), jsx_runtime_1.jsx("div", { style: audioStyle, children: jsx_runtime_1.jsx(AudioWaveform_1.AudioWaveform, { src: src, visualizationWidth: audioWidth, startFrom: trimBefore, durationInFrames: durationInFrames, volume: volume, doesVolumeChange: doesVolumeChange, playbackRate: playbackRate, loopDisplay: loopDisplay }) })
|
|
227
244
|
] }));
|
|
228
245
|
};
|
|
229
246
|
exports.TimelineVideoInfo = TimelineVideoInfo;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CanUpdateSequencePropStatus, CanUpdateSequencePropStatusFalse } from 'remotion';
|
|
2
|
+
export declare const getComputedStatusLabel: (propStatus: CanUpdateSequencePropStatusFalse) => string;
|
|
3
|
+
export declare const getTimelineKeyframes: (propStatus: CanUpdateSequencePropStatus | null | undefined) => {
|
|
4
|
+
frame: number;
|
|
5
|
+
value: unknown;
|
|
6
|
+
}[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTimelineKeyframes = exports.getComputedStatusLabel = void 0;
|
|
4
|
+
const getComputedStatusLabel = (propStatus) => {
|
|
5
|
+
var _a;
|
|
6
|
+
if (propStatus.reason !== 'computed') {
|
|
7
|
+
throw new Error(`Unsupported prop status: ${propStatus.reason}`);
|
|
8
|
+
}
|
|
9
|
+
return ((_a = propStatus.keyframes) === null || _a === void 0 ? void 0 : _a.length) ? 'keyframed' : 'computed';
|
|
10
|
+
};
|
|
11
|
+
exports.getComputedStatusLabel = getComputedStatusLabel;
|
|
12
|
+
const getTimelineKeyframes = (propStatus) => {
|
|
13
|
+
var _a;
|
|
14
|
+
if (!propStatus || propStatus.canUpdate) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
if (propStatus.reason !== 'computed') {
|
|
18
|
+
throw new Error(`Unsupported prop status: ${propStatus.reason}`);
|
|
19
|
+
}
|
|
20
|
+
return (_a = propStatus.keyframes) !== null && _a !== void 0 ? _a : [];
|
|
21
|
+
};
|
|
22
|
+
exports.getTimelineKeyframes = getTimelineKeyframes;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const getTimelineVideoInfoWidths: ({ visualizationWidth, naturalWidth, premountWidth, postmountWidth, }: {
|
|
2
|
+
visualizationWidth: number;
|
|
3
|
+
naturalWidth: number;
|
|
4
|
+
premountWidth: number;
|
|
5
|
+
postmountWidth: number;
|
|
6
|
+
}) => {
|
|
7
|
+
mediaVisualizationWidth: number;
|
|
8
|
+
mediaNaturalWidth: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTimelineVideoInfoWidths = void 0;
|
|
4
|
+
const getTimelineVideoInfoWidths = ({ visualizationWidth, naturalWidth, premountWidth, postmountWidth, }) => {
|
|
5
|
+
const mountWidth = premountWidth + postmountWidth;
|
|
6
|
+
return {
|
|
7
|
+
mediaVisualizationWidth: Math.max(0, visualizationWidth - mountWidth),
|
|
8
|
+
mediaNaturalWidth: Math.max(0, naturalWidth - mountWidth),
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
exports.getTimelineVideoInfoWidths = getTimelineVideoInfoWidths;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useResolvedStack = void 0;
|
|
3
|
+
exports.useResolvedStack = exports.hasResolvedStack = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const get_stack_1 = require("./TimelineStack/get-stack");
|
|
7
7
|
const resolvedCache = new Map();
|
|
8
|
+
const hasResolvedStack = (stack) => {
|
|
9
|
+
if (!stack) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return resolvedCache.has(stack);
|
|
13
|
+
};
|
|
14
|
+
exports.hasResolvedStack = hasResolvedStack;
|
|
8
15
|
const inFlight = new Set();
|
|
9
16
|
const subscribers = new Map();
|
|
10
17
|
const useResolvedStack = (stack) => {
|
|
@@ -40,6 +47,8 @@ const useResolvedStack = (stack) => {
|
|
|
40
47
|
.catch((err) => {
|
|
41
48
|
// eslint-disable-next-line no-console
|
|
42
49
|
console.error('Could not get original location of Sequence', err);
|
|
50
|
+
resolvedCache.set(stack, null);
|
|
51
|
+
subs.forEach((fn) => fn(null));
|
|
43
52
|
})
|
|
44
53
|
.finally(() => {
|
|
45
54
|
inFlight.delete(stack);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SetStateAction } from 'react';
|
|
2
|
+
import type { ResolvedStackLocation } from 'remotion';
|
|
3
|
+
import type { ModalState } from '../state/modals';
|
|
4
|
+
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
5
|
+
export declare const getCompositionMenuItems: ({ composition, connectionStatus, resolvedLocation, setSelectedModal, closeMenu, readOnlyStudio, }: {
|
|
6
|
+
composition: import("remotion").AnyComposition | null;
|
|
7
|
+
connectionStatus: "connected" | "disconnected" | "init";
|
|
8
|
+
resolvedLocation: ResolvedStackLocation | null;
|
|
9
|
+
setSelectedModal: (value: SetStateAction<ModalState | null>) => void;
|
|
10
|
+
closeMenu: () => void;
|
|
11
|
+
readOnlyStudio: boolean;
|
|
12
|
+
}) => ComboboxValue[];
|