@remotion/studio 4.0.483 → 4.0.485
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/ColorPicker/ColorPicker.js +65 -3
- package/dist/components/ColorPicker/ColorPickerPopup.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPickerPopup.js +3 -2
- package/dist/components/ContextMenu.js +75 -1
- package/dist/components/CurrentComposition.js +3 -2
- package/dist/components/InlineCompositionName.d.ts +7 -0
- package/dist/components/InlineCompositionName.js +58 -0
- package/dist/components/InlineEditableTitle.d.ts +7 -0
- package/dist/components/InlineEditableTitle.js +129 -0
- package/dist/components/InspectorPanel/EasingInspector.js +184 -10
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.d.ts +14 -0
- package/dist/components/InspectorPanel/KeyframeEasingNavigator.js +146 -0
- package/dist/components/InspectorPanel/KeyframeInspector.d.ts +1 -1
- package/dist/components/InspectorPanel/KeyframeInspector.js +229 -5
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +17 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +80 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -58
- package/dist/components/InspectorPanel/common.d.ts +12 -0
- package/dist/components/InspectorPanel/common.js +78 -1
- package/dist/components/InspectorPanel/easing-inspector-selection.d.ts +14 -0
- package/dist/components/InspectorPanel/easing-inspector-selection.js +18 -0
- package/dist/components/InspectorPanel/keyframe-easing-navigator-items.d.ts +24 -0
- package/dist/components/InspectorPanel/keyframe-easing-navigator-items.js +40 -0
- package/dist/components/InspectorPanel/keyframe-inspector-frame.d.ts +8 -0
- package/dist/components/InspectorPanel/keyframe-inspector-frame.js +14 -0
- package/dist/components/InspectorPanel/styles.d.ts +1 -0
- package/dist/components/InspectorPanel/styles.js +9 -3
- package/dist/components/InspectorSequenceSection.js +37 -10
- package/dist/components/Modals.js +1 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +7 -1
- package/dist/components/NewComposition/CodemodFooter.js +17 -12
- package/dist/components/NewComposition/DeleteComposition.js +7 -1
- package/dist/components/NewComposition/DeleteFolder.js +7 -1
- package/dist/components/NewComposition/DuplicateComposition.js +17 -10
- package/dist/components/NewComposition/InputAndValidationContainer.d.ts +3 -0
- package/dist/components/NewComposition/InputAndValidationContainer.js +15 -0
- package/dist/components/NewComposition/NewCompDuration.js +7 -6
- package/dist/components/NewComposition/NewComposition.d.ts +5 -1
- package/dist/components/NewComposition/NewComposition.js +29 -86
- package/dist/components/NewComposition/RenameComposition.js +13 -14
- package/dist/components/NewComposition/RenameFolder.js +9 -2
- package/dist/components/NewComposition/RenameStaticFile.js +2 -1
- package/dist/components/NewComposition/ValidationMessage.js +9 -1
- package/dist/components/OptionsPanel.d.ts +0 -3
- package/dist/components/OptionsPanel.js +7 -3
- package/dist/components/Preview.js +1 -1
- package/dist/components/RenderModal/ServerRenderModal.js +4 -3
- package/dist/components/RenderModal/WebRenderModal.js +2 -1
- package/dist/components/SelectedOutlineElement.js +45 -3
- package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
- package/dist/components/SelectedOutlineOverlay.js +48 -15
- package/dist/components/Timeline/EasingEditorModal.js +9 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +45 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +82 -1
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +2 -1
- package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -1
- package/dist/components/Timeline/TimelineKeyframeControls.js +38 -7
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +4 -0
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +12 -6
- package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
- package/dist/components/Timeline/TimelineSelection.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +13 -62
- package/dist/components/Timeline/TimelineSequenceName.d.ts +1 -0
- package/dist/components/Timeline/TimelineSequenceName.js +7 -6
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +1 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +86 -4
- package/dist/components/Timeline/TimelineSlider.js +17 -3
- package/dist/components/Timeline/TimelineTextContentField.d.ts +12 -0
- package/dist/components/Timeline/TimelineTextContentField.js +100 -0
- package/dist/components/Timeline/TimelineWidthProvider.js +18 -3
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +8 -2
- package/dist/components/Timeline/delete-selected-timeline-item.js +80 -1
- package/dist/components/Timeline/focus-inspector-field.d.ts +16 -0
- package/dist/components/Timeline/focus-inspector-field.js +49 -0
- package/dist/components/Timeline/get-animation-item-selection-for-frame.d.ts +18 -0
- package/dist/components/Timeline/get-animation-item-selection-for-frame.js +49 -0
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.d.ts +15 -0
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +26 -0
- package/dist/components/Timeline/save-sequence-prop.js +2 -0
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +38 -0
- package/dist/components/Timeline/split-selected-timeline-item.js +156 -0
- package/dist/components/Timeline/timeline-field-display-utils.js +2 -0
- package/dist/components/Timeline/update-selected-easing.d.ts +1 -0
- package/dist/components/Timeline/update-selected-easing.js +4 -3
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
- package/dist/components/Timeline/use-rename-sequence.d.ts +30 -0
- package/dist/components/Timeline/use-rename-sequence.js +115 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
- package/dist/components/Timeline/use-timeline-height.js +1 -0
- package/dist/components/composition-menu-items.js +3 -0
- package/dist/components/folder-menu-items.js +20 -0
- package/dist/components/options-sidebar-tabs.d.ts +4 -0
- package/dist/components/options-sidebar-tabs.js +5 -0
- package/dist/components/selected-outline-types.d.ts +6 -1
- package/dist/esm/{chunk-fq0j774v.js → chunk-103pp4n7.js} +17652 -15098
- package/dist/esm/internals.mjs +17652 -15098
- package/dist/esm/previewEntry.mjs +18357 -15803
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/render-codec-label.d.ts +1 -1
- package/dist/helpers/timeline-layout.d.ts +4 -3
- package/dist/helpers/timeline-layout.js +3 -1
- package/dist/helpers/use-create-composition.d.ts +35 -0
- package/dist/helpers/use-create-composition.js +111 -0
- package/dist/helpers/use-menu-structure.js +0 -14
- package/dist/helpers/use-rename-composition.d.ts +16 -0
- package/dist/helpers/use-rename-composition.js +49 -0
- package/dist/state/modals.d.ts +3 -0
- package/dist/state/timeline-zoom.js +17 -14
- package/dist/state/z-index.d.ts +1 -0
- package/dist/state/z-index.js +11 -2
- package/package.json +12 -12
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNavigatorItemPlayheadFrame = exports.getKeyframeEasingNavigatorItems = void 0;
|
|
4
|
+
const getKeyframeEasingNavigatorItems = ({ includeEasings, keyframes, nodePathInfo, }) => {
|
|
5
|
+
return keyframes.flatMap((keyframe, index) => {
|
|
6
|
+
const keyframeItem = {
|
|
7
|
+
type: 'keyframe',
|
|
8
|
+
selection: {
|
|
9
|
+
type: 'keyframe',
|
|
10
|
+
nodePathInfo,
|
|
11
|
+
frame: keyframe.frame,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
const nextKeyframe = keyframes[index + 1];
|
|
15
|
+
if (!includeEasings || !nextKeyframe) {
|
|
16
|
+
return [keyframeItem];
|
|
17
|
+
}
|
|
18
|
+
return [
|
|
19
|
+
keyframeItem,
|
|
20
|
+
{
|
|
21
|
+
type: 'easing',
|
|
22
|
+
selection: {
|
|
23
|
+
type: 'easing',
|
|
24
|
+
nodePathInfo,
|
|
25
|
+
fromFrame: keyframe.frame,
|
|
26
|
+
toFrame: nextKeyframe.frame,
|
|
27
|
+
segmentIndex: index,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.getKeyframeEasingNavigatorItems = getKeyframeEasingNavigatorItems;
|
|
34
|
+
const getNavigatorItemPlayheadFrame = (item) => {
|
|
35
|
+
if (item.type === 'keyframe') {
|
|
36
|
+
return item.selection.frame;
|
|
37
|
+
}
|
|
38
|
+
return Math.round((item.selection.fromFrame + item.selection.toFrame) / 2);
|
|
39
|
+
};
|
|
40
|
+
exports.getNavigatorItemPlayheadFrame = getNavigatorItemPlayheadFrame;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const clampInspectorKeyframeDisplayFrame: ({ durationInFrames, frame, }: {
|
|
2
|
+
readonly durationInFrames: number;
|
|
3
|
+
readonly frame: number;
|
|
4
|
+
}) => number;
|
|
5
|
+
export declare const getInspectorKeyframeSourceFrame: ({ displayFrame, keyframeDisplayOffset, }: {
|
|
6
|
+
readonly displayFrame: number;
|
|
7
|
+
readonly keyframeDisplayOffset: number;
|
|
8
|
+
}) => number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInspectorKeyframeSourceFrame = exports.clampInspectorKeyframeDisplayFrame = void 0;
|
|
4
|
+
const clampInspectorKeyframeDisplayFrame = ({ durationInFrames, frame, }) => {
|
|
5
|
+
if (durationInFrames <= 0) {
|
|
6
|
+
return 0;
|
|
7
|
+
}
|
|
8
|
+
return Math.min(Math.max(Math.round(frame), 0), durationInFrames - 1);
|
|
9
|
+
};
|
|
10
|
+
exports.clampInspectorKeyframeDisplayFrame = clampInspectorKeyframeDisplayFrame;
|
|
11
|
+
const getInspectorKeyframeSourceFrame = ({ displayFrame, keyframeDisplayOffset, }) => {
|
|
12
|
+
return displayFrame - keyframeDisplayOffset;
|
|
13
|
+
};
|
|
14
|
+
exports.getInspectorKeyframeSourceFrame = getInspectorKeyframeSourceFrame;
|
|
@@ -5,6 +5,7 @@ export declare const defaultPropsSection: React.CSSProperties;
|
|
|
5
5
|
export declare const visualControlsSection: React.CSSProperties;
|
|
6
6
|
export declare const compositionSection: React.CSSProperties;
|
|
7
7
|
export declare const inspectorSectionDivider: React.CSSProperties;
|
|
8
|
+
export declare const sequenceHeaderDivider: React.CSSProperties;
|
|
8
9
|
export declare const sectionHeader: React.CSSProperties;
|
|
9
10
|
export declare const sequenceHeader: React.CSSProperties;
|
|
10
11
|
export declare const sequenceHeaderTitle: React.CSSProperties;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.keyframeEditorValue = exports.keyframeEditorLabel = exports.keyframeEditorRow = exports.detailValue = exports.detailLabel = exports.detailRow = exports.guideDetailsContainer = exports.detailsContainer = exports.centeredMessage = exports.selectedContainer = exports.resolveLinkStyle = exports.defaultPropsWarningMessages = exports.defaultPropsWarningContainer = exports.sectionHeaderEnd = exports.sectionHeaderStart = exports.sectionHeaderTitle = exports.sectionHeaderRow = exports.sequenceHeaderSubtitle = exports.sequenceHeaderTitle = exports.sequenceHeader = exports.sectionHeader = exports.inspectorSectionDivider = exports.compositionSection = exports.visualControlsSection = exports.defaultPropsSection = exports.scrollableContainer = exports.container = void 0;
|
|
3
|
+
exports.keyframeEditorValue = exports.keyframeEditorLabel = exports.keyframeEditorRow = exports.detailValue = exports.detailLabel = exports.detailRow = exports.guideDetailsContainer = exports.detailsContainer = exports.centeredMessage = exports.selectedContainer = exports.resolveLinkStyle = exports.defaultPropsWarningMessages = exports.defaultPropsWarningContainer = exports.sectionHeaderEnd = exports.sectionHeaderStart = exports.sectionHeaderTitle = exports.sectionHeaderRow = exports.sequenceHeaderSubtitle = exports.sequenceHeaderTitle = exports.sequenceHeader = exports.sectionHeader = exports.sequenceHeaderDivider = exports.inspectorSectionDivider = exports.compositionSection = exports.visualControlsSection = exports.defaultPropsSection = exports.scrollableContainer = exports.container = void 0;
|
|
4
4
|
const colors_1 = require("../../helpers/colors");
|
|
5
5
|
const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
|
|
6
6
|
exports.container = {
|
|
@@ -31,6 +31,12 @@ exports.compositionSection = {
|
|
|
31
31
|
exports.inspectorSectionDivider = {
|
|
32
32
|
borderBottom: `1px solid ${colors_1.LINE_COLOR}`,
|
|
33
33
|
};
|
|
34
|
+
exports.sequenceHeaderDivider = {
|
|
35
|
+
backgroundColor: colors_1.LINE_COLOR,
|
|
36
|
+
flexShrink: 0,
|
|
37
|
+
height: 1,
|
|
38
|
+
margin: '4px 0',
|
|
39
|
+
};
|
|
34
40
|
exports.sectionHeader = {
|
|
35
41
|
color: colors_1.LIGHT_TEXT,
|
|
36
42
|
fontSize: 12,
|
|
@@ -46,11 +52,11 @@ exports.sequenceHeader = {
|
|
|
46
52
|
padding: `6px ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px 4px`,
|
|
47
53
|
};
|
|
48
54
|
exports.sequenceHeaderTitle = {
|
|
49
|
-
alignSelf: '
|
|
55
|
+
alignSelf: 'stretch',
|
|
50
56
|
backgroundColor: colors_1.BACKGROUND,
|
|
51
57
|
border: 'none',
|
|
52
58
|
color: 'white',
|
|
53
|
-
display: '
|
|
59
|
+
display: 'flex',
|
|
54
60
|
fontFamily: 'sans-serif',
|
|
55
61
|
fontSize: 12,
|
|
56
62
|
lineHeight: '18px',
|
|
@@ -60,14 +60,8 @@ const emptyState = {
|
|
|
60
60
|
lineHeight: 1.4,
|
|
61
61
|
padding: '0 12px 8px',
|
|
62
62
|
};
|
|
63
|
-
const divider = {
|
|
64
|
-
backgroundColor: colors_1.LINE_COLOR,
|
|
65
|
-
flexShrink: 0,
|
|
66
|
-
height: 1,
|
|
67
|
-
margin: '4px 0',
|
|
68
|
-
};
|
|
69
63
|
const controlsEffectsDivider = {
|
|
70
|
-
...
|
|
64
|
+
...styles_1.sequenceHeaderDivider,
|
|
71
65
|
margin: '8px 0 4px',
|
|
72
66
|
};
|
|
73
67
|
const effectsHeaderTitle = {
|
|
@@ -85,9 +79,40 @@ const isEffectsRoot = (node) => {
|
|
|
85
79
|
const { auxiliaryKeys } = node.nodePathInfo;
|
|
86
80
|
return auxiliaryKeys[auxiliaryKeys.length - 1] === 'effects';
|
|
87
81
|
};
|
|
82
|
+
const INSPECTOR_COLLAPSED_ROWS_SESSION_STORAGE_KEY = 'remotion.editor.inspectorCollapsedRows';
|
|
88
83
|
const getInspectorExpansionKey = (nodePathInfo) => {
|
|
89
84
|
return JSON.stringify(nodePathInfo);
|
|
90
85
|
};
|
|
86
|
+
const loadInspectorCollapsedKeys = () => {
|
|
87
|
+
if (typeof window === 'undefined') {
|
|
88
|
+
return new Set();
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
const raw = window.sessionStorage.getItem(INSPECTOR_COLLAPSED_ROWS_SESSION_STORAGE_KEY);
|
|
92
|
+
if (raw === null) {
|
|
93
|
+
return new Set();
|
|
94
|
+
}
|
|
95
|
+
const parsed = JSON.parse(raw);
|
|
96
|
+
if (!Array.isArray(parsed)) {
|
|
97
|
+
return new Set();
|
|
98
|
+
}
|
|
99
|
+
return new Set(parsed.filter((key) => typeof key === 'string'));
|
|
100
|
+
}
|
|
101
|
+
catch (_a) {
|
|
102
|
+
return new Set();
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const persistInspectorCollapsedKeys = (keys) => {
|
|
106
|
+
if (typeof window === 'undefined') {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
window.sessionStorage.setItem(INSPECTOR_COLLAPSED_ROWS_SESSION_STORAGE_KEY, JSON.stringify([...keys]));
|
|
111
|
+
}
|
|
112
|
+
catch (_a) {
|
|
113
|
+
// Ignore quota errors or disabled storage.
|
|
114
|
+
}
|
|
115
|
+
};
|
|
91
116
|
const getInspectorControlGroups = (rows) => {
|
|
92
117
|
return timeline_layout_1.SCHEMA_FIELD_GROUPS.map((group) => ({
|
|
93
118
|
...group,
|
|
@@ -112,8 +137,9 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
112
137
|
const { tree } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
113
138
|
sequence,
|
|
114
139
|
nodePathInfo,
|
|
140
|
+
includeTextContent: true,
|
|
115
141
|
});
|
|
116
|
-
const [collapsedKeys, setCollapsedKeys] = (0, react_1.useState)(
|
|
142
|
+
const [collapsedKeys, setCollapsedKeys] = (0, react_1.useState)(loadInspectorCollapsedKeys);
|
|
117
143
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
118
144
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
119
145
|
const getIsExpanded = (0, react_1.useCallback)((candidate) => {
|
|
@@ -129,6 +155,7 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
129
155
|
else {
|
|
130
156
|
next.add(key);
|
|
131
157
|
}
|
|
158
|
+
persistInspectorCollapsedKeys(next);
|
|
132
159
|
return next;
|
|
133
160
|
});
|
|
134
161
|
}, []);
|
|
@@ -191,10 +218,10 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
191
218
|
};
|
|
192
219
|
if (controlRows.length === 0 && !showEffectsSection) {
|
|
193
220
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
194
|
-
jsx_runtime_1.jsx("div", { style:
|
|
221
|
+
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider }), jsx_runtime_1.jsx("div", { style: emptyState, children: "No schema" })
|
|
195
222
|
] }));
|
|
196
223
|
}
|
|
197
224
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
198
|
-
jsx_runtime_1.jsx("div", { style:
|
|
225
|
+
jsx_runtime_1.jsx("div", { style: styles_1.sequenceHeaderDivider }), controlRows.length > 0 ? (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: controlSelectableItems, children: controlGroups.map((group, i) => (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [i === 0 ? null : jsx_runtime_1.jsx("div", { style: controlsEffectsDivider }), renderSectionHeader(group.label), group.rows.map(renderRow)] }, group.id))) })) : null, showEffectsSection ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [showControlsEffectsDivider ? (jsx_runtime_1.jsx("div", { style: controlsEffectsDivider })) : null, renderEffectsHeader(), effectRows.length === 0 ? (jsx_runtime_1.jsx("div", { style: emptyState, children: "None" })) : (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionOrderProvider, { items: effectSelectableItems, children: effectRows.map(renderRow) }))] })) : null] }));
|
|
199
226
|
};
|
|
200
227
|
exports.InspectorSequenceSection = InspectorSequenceSection;
|
|
@@ -31,7 +31,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
31
31
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
32
32
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
33
33
|
'connected';
|
|
34
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, {})), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'keyframe-settings' && (jsx_runtime_1.jsx(KeyframeSettingsModal_1.KeyframeSettingsModal, { state: modalContextType })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
34
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'keyframe-settings' && (jsx_runtime_1.jsx(KeyframeSettingsModal_1.KeyframeSettingsModal, { state: modalContextType })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
35
35
|
modalContextType.type === 'server-render' &&
|
|
36
36
|
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), process.env.ASK_AI_ENABLED && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
37
37
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type { RecastCodemod } from '@remotion/studio-shared';
|
|
1
|
+
import type { ApplyCodemodResponse, RecastCodemod, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
type ApplyCodemodAction = (options: {
|
|
4
|
+
signal: AbortSignal;
|
|
5
|
+
symbolicatedStack: SymbolicatedStackFrame | null;
|
|
6
|
+
}) => Promise<ApplyCodemodResponse>;
|
|
3
7
|
export declare const CodemodFooter: React.FC<{
|
|
4
8
|
readonly valid: boolean;
|
|
5
9
|
readonly codemod: RecastCodemod;
|
|
@@ -13,4 +17,6 @@ export declare const CodemodFooter: React.FC<{
|
|
|
13
17
|
}) => string;
|
|
14
18
|
readonly onSuccess: (() => void) | null;
|
|
15
19
|
readonly fallbackToRootFile?: boolean;
|
|
20
|
+
readonly applyCodemod: ApplyCodemodAction;
|
|
16
21
|
}>;
|
|
22
|
+
export {};
|
|
@@ -13,7 +13,15 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
|
13
13
|
const actions_1 = require("../RenderQueue/actions");
|
|
14
14
|
const use_resolved_stack_1 = require("../Timeline/use-resolved-stack");
|
|
15
15
|
const DiffPreview_1 = require("./DiffPreview");
|
|
16
|
-
const
|
|
16
|
+
const CodemodFooterPresentation = ({ codemodStatus, disabled, genericSubmitLabel, relativeFilePath, submitLabel, trigger, }) => {
|
|
17
|
+
return (jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
18
|
+
jsx_runtime_1.jsx(DiffPreview_1.CodemodDiffPreview, { status: codemodStatus }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(layout_1.Spacing, { block: true, x: 2 }), jsx_runtime_1.jsxs(ModalButton_1.ModalButton, { onClick: trigger, disabled: disabled, children: [relativeFilePath
|
|
19
|
+
? submitLabel({ relativeRootPath: relativeFilePath })
|
|
20
|
+
: genericSubmitLabel, jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: false })
|
|
21
|
+
] })
|
|
22
|
+
] }));
|
|
23
|
+
};
|
|
24
|
+
const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNotification, errorNotification, genericSubmitLabel, submitLabel, onSuccess, fallbackToRootFile = false, applyCodemod, }) => {
|
|
17
25
|
var _a;
|
|
18
26
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
19
27
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -27,13 +35,15 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
27
35
|
setSubmitting(true);
|
|
28
36
|
setSelectedModal(null);
|
|
29
37
|
const notification = (0, NotificationCenter_1.showNotification)(loadingNotification, null);
|
|
30
|
-
|
|
31
|
-
codemod,
|
|
32
|
-
dryRun: false,
|
|
38
|
+
applyCodemod({
|
|
33
39
|
symbolicatedStack,
|
|
34
40
|
signal: new AbortController().signal,
|
|
35
41
|
})
|
|
36
|
-
.then(() => {
|
|
42
|
+
.then((result) => {
|
|
43
|
+
if (!result.success) {
|
|
44
|
+
notification.replaceContent(`${errorNotification}: ${result.reason}`, 2000);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
37
47
|
notification.replaceContent(successNotification, 2000);
|
|
38
48
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
39
49
|
})
|
|
@@ -41,7 +51,7 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
41
51
|
notification.replaceContent(`${errorNotification}: ${err.message}`, 2000);
|
|
42
52
|
});
|
|
43
53
|
}, [
|
|
44
|
-
|
|
54
|
+
applyCodemod,
|
|
45
55
|
errorNotification,
|
|
46
56
|
loadingNotification,
|
|
47
57
|
onSuccess,
|
|
@@ -145,11 +155,6 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
145
155
|
enter.unregister();
|
|
146
156
|
};
|
|
147
157
|
}, [disabled, registerKeybinding, trigger, valid]);
|
|
148
|
-
return (jsx_runtime_1.
|
|
149
|
-
jsx_runtime_1.jsx(DiffPreview_1.CodemodDiffPreview, { status: codemodStatus }), jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(layout_1.Spacing, { block: true, x: 2 }), jsx_runtime_1.jsxs(ModalButton_1.ModalButton, { onClick: trigger, disabled: disabled, children: [relativeFilePath
|
|
150
|
-
? submitLabel({ relativeRootPath: relativeFilePath })
|
|
151
|
-
: genericSubmitLabel, jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: false })
|
|
152
|
-
] })
|
|
153
|
-
] }));
|
|
158
|
+
return (jsx_runtime_1.jsx(CodemodFooterPresentation, { codemodStatus: codemodStatus, disabled: disabled, genericSubmitLabel: genericSubmitLabel, relativeFilePath: relativeFilePath, submitLabel: submitLabel, trigger: trigger }));
|
|
154
159
|
};
|
|
155
160
|
exports.CodemodFooter = CodemodFooter;
|
|
@@ -7,6 +7,7 @@ const styles_1 = require("../Menu/styles");
|
|
|
7
7
|
const ModalFooter_1 = require("../ModalFooter");
|
|
8
8
|
const ModalHeader_1 = require("../ModalHeader");
|
|
9
9
|
const ResolveCompositionBeforeModal_1 = require("../RenderModal/ResolveCompositionBeforeModal");
|
|
10
|
+
const actions_1 = require("../RenderQueue/actions");
|
|
10
11
|
const CodemodFooter_1 = require("./CodemodFooter");
|
|
11
12
|
const DismissableModal_1 = require("./DismissableModal");
|
|
12
13
|
const content = {
|
|
@@ -38,7 +39,12 @@ const DeleteCompositionLoaded = ({ compositionId }) => {
|
|
|
38
39
|
jsx_runtime_1.jsx("br", {}),
|
|
39
40
|
"The associated ",
|
|
40
41
|
jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "component" }),
|
|
41
|
-
" will remain in your code."] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete composition`, loadingNotification: 'Deleting', successNotification: `Deleted ${unresolved.id}`, genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: true, onSuccess: null })
|
|
42
|
+
" will remain in your code."] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete composition`, loadingNotification: 'Deleting', successNotification: `Deleted ${unresolved.id}`, genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: true, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
|
|
43
|
+
codemod,
|
|
44
|
+
dryRun: false,
|
|
45
|
+
signal,
|
|
46
|
+
symbolicatedStack,
|
|
47
|
+
}) }) })
|
|
42
48
|
] })
|
|
43
49
|
] }));
|
|
44
50
|
};
|
|
@@ -7,6 +7,7 @@ const get_folder_id_1 = require("../../helpers/get-folder-id");
|
|
|
7
7
|
const styles_1 = require("../Menu/styles");
|
|
8
8
|
const ModalFooter_1 = require("../ModalFooter");
|
|
9
9
|
const ModalHeader_1 = require("../ModalHeader");
|
|
10
|
+
const actions_1 = require("../RenderQueue/actions");
|
|
10
11
|
const CodemodFooter_1 = require("./CodemodFooter");
|
|
11
12
|
const DismissableModal_1 = require("./DismissableModal");
|
|
12
13
|
const content = {
|
|
@@ -32,7 +33,12 @@ const DeleteFolder = ({ folderName, parentName, stack }) => {
|
|
|
32
33
|
jsx_runtime_1.jsxs("div", { style: content, children: ["Do you want to delete the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "Folder" }),
|
|
33
34
|
" with ID ", '"', folderId, '"', "?",
|
|
34
35
|
jsx_runtime_1.jsx("br", {}),
|
|
35
|
-
"The compositions and nested folders inside it will stay in your code."] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete folder`, loadingNotification: 'Deleting folder', successNotification: `Deleted folder ${folderId}`, genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, stack: stack, valid: true, onSuccess: null })
|
|
36
|
+
"The compositions and nested folders inside it will stay in your code."] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete folder`, loadingNotification: 'Deleting folder', successNotification: `Deleted folder ${folderId}`, genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, stack: stack, valid: true, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
|
|
37
|
+
codemod,
|
|
38
|
+
dryRun: false,
|
|
39
|
+
signal,
|
|
40
|
+
symbolicatedStack,
|
|
41
|
+
}) }) })
|
|
36
42
|
] })
|
|
37
43
|
] }));
|
|
38
44
|
};
|
|
@@ -11,9 +11,11 @@ const ModalFooter_1 = require("../ModalFooter");
|
|
|
11
11
|
const ModalHeader_1 = require("../ModalHeader");
|
|
12
12
|
const layout_2 = require("../RenderModal/layout");
|
|
13
13
|
const ResolveCompositionBeforeModal_1 = require("../RenderModal/ResolveCompositionBeforeModal");
|
|
14
|
+
const actions_1 = require("../RenderQueue/actions");
|
|
14
15
|
const CodemodFooter_1 = require("./CodemodFooter");
|
|
15
16
|
const ComboBox_1 = require("./ComboBox");
|
|
16
17
|
const DismissableModal_1 = require("./DismissableModal");
|
|
18
|
+
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
17
19
|
const InputDragger_1 = require("./InputDragger");
|
|
18
20
|
const NewCompDuration_1 = require("./NewCompDuration");
|
|
19
21
|
const RemInput_1 = require("./RemInput");
|
|
@@ -183,25 +185,30 @@ const DuplicateCompositionLoaded = ({ initialType }) => {
|
|
|
183
185
|
jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
184
186
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Type" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: "Type of composition", style: comboBoxStyle, values: typeValues, selectedId: type }) })
|
|
185
187
|
] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
186
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(
|
|
188
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
187
189
|
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
188
190
|
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })
|
|
189
191
|
] })) : null] }) })
|
|
190
192
|
] }), hadDimensionsDefined ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
191
193
|
jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
192
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
195
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
196
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })
|
|
197
|
+
] })) : null] }) })
|
|
196
198
|
] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
197
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
200
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
201
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })
|
|
202
|
+
] })) : null] }) })
|
|
201
203
|
] })
|
|
202
204
|
] })) : null, type === 'composition' && hadDurationDefined ? (jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames })) : null, type === 'composition' && hadFpsDefined ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
203
205
|
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "FPS" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })
|
|
204
|
-
] })) : null] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Duplicating...', errorNotification: 'Could not duplicate composition', successNotification: `Duplicated ${unresolved.id} as ${newId}`, genericSubmitLabel: 'Duplicate', submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: valid, onSuccess: onDuplicateSuccess })
|
|
206
|
+
] })) : null] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Duplicating...', errorNotification: 'Could not duplicate composition', successNotification: `Duplicated ${unresolved.id} as ${newId}`, genericSubmitLabel: 'Duplicate', submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: valid, onSuccess: onDuplicateSuccess, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
|
|
207
|
+
codemod,
|
|
208
|
+
dryRun: false,
|
|
209
|
+
signal,
|
|
210
|
+
symbolicatedStack,
|
|
211
|
+
}) }) })
|
|
205
212
|
] })
|
|
206
213
|
] }));
|
|
207
214
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InputAndValidationContainer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const container = {
|
|
6
|
+
width: 250,
|
|
7
|
+
minWidth: 0,
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexDirection: 'column',
|
|
10
|
+
alignItems: 'flex-end',
|
|
11
|
+
};
|
|
12
|
+
const InputAndValidationContainer = ({ children, }) => {
|
|
13
|
+
return jsx_runtime_1.jsx("div", { style: container, children: children });
|
|
14
|
+
};
|
|
15
|
+
exports.InputAndValidationContainer = InputAndValidationContainer;
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const validate_new_comp_data_1 = require("../../helpers/validate-new-comp-data");
|
|
7
7
|
const layout_1 = require("../layout");
|
|
8
8
|
const layout_2 = require("../RenderModal/layout");
|
|
9
|
+
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
9
10
|
const InputDragger_1 = require("./InputDragger");
|
|
10
11
|
const ValidationMessage_1 = require("./ValidationMessage");
|
|
11
12
|
const NewCompDuration = ({ durationInFrames, setDurationInFrames }) => {
|
|
@@ -17,12 +18,12 @@ const NewCompDuration = ({ durationInFrames, setDurationInFrames }) => {
|
|
|
17
18
|
}, [setDurationInFrames]);
|
|
18
19
|
const compDurationErrMessage = (0, validate_new_comp_data_1.validateCompositionDuration)(durationInFrames);
|
|
19
20
|
return (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
|
|
20
|
-
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Duration in frames" }), jsx_runtime_1.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Duration in frames" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
|
|
22
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: durationInFrames, onTextChange: onDurationInFramesChanged, placeholder: "Duration (frames)", name: "durationInFrames", min: 1, step: 1, required: true, status: "ok",
|
|
23
|
+
// Hitting Promise.all() limit in Chrome
|
|
24
|
+
max: 300000, onValueChange: onDurationChangedDirectly, rightAlign: false }), compDurationErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
25
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compDurationErrMessage, type: "error" })
|
|
26
|
+
] })) : null] }) })
|
|
26
27
|
] }));
|
|
27
28
|
};
|
|
28
29
|
exports.NewCompDuration = NewCompDuration;
|