@remotion/studio 4.0.489 → 4.0.490
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/Canvas.js +19 -2
- package/dist/components/InspectorPanel/AlignmentControls.d.ts +5 -0
- package/dist/components/InspectorPanel/AlignmentControls.js +205 -0
- package/dist/components/InspectorPanel/EasingInspector.js +8 -2
- package/dist/components/InspectorPanel/KeyframeSettings.d.ts +5 -0
- package/dist/components/InspectorPanel/KeyframeSettings.js +142 -0
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +2 -1
- package/dist/components/InspectorPanel/alignment-controls.d.ts +12 -0
- package/dist/components/InspectorPanel/alignment-controls.js +42 -0
- package/dist/components/InspectorSequenceSection.d.ts +1 -0
- package/dist/components/InspectorSequenceSection.js +2 -2
- package/dist/components/MobilePanel.js +9 -3
- package/dist/components/Modals.js +1 -2
- package/dist/components/NewComposition/CancelButton.d.ts +1 -0
- package/dist/components/NewComposition/CancelButton.js +6 -2
- package/dist/components/Preview.js +1 -1
- package/dist/components/SelectedOutlineOverlay.d.ts +6 -1
- package/dist/components/SelectedOutlineOverlay.js +247 -9
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +3 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +2 -50
- package/dist/components/Timeline/TimelineSequenceItem.js +6 -9
- package/dist/components/Timeline/TimelineSequenceName.js +1 -3
- package/dist/components/Timeline/TimelineSequencePropItem.js +2 -49
- package/dist/components/import-assets.d.ts +1 -0
- package/dist/components/import-assets.js +1 -0
- package/dist/esm/{chunk-jrta3xaf.js → chunk-16nwrbrm.js} +4914 -4322
- package/dist/esm/internals.mjs +4914 -4322
- package/dist/esm/previewEntry.mjs +4952 -4360
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/install-required-package.d.ts +1 -0
- package/dist/helpers/install-required-package.js +3 -2
- package/dist/icons/align-bottom.d.ts +3 -0
- package/dist/icons/align-bottom.js +12 -0
- package/dist/icons/align-center-horizontal.d.ts +3 -0
- package/dist/icons/align-center-horizontal.js +12 -0
- package/dist/icons/align-center-vertical.d.ts +3 -0
- package/dist/icons/align-center-vertical.js +12 -0
- package/dist/icons/align-left.d.ts +3 -0
- package/dist/icons/align-left.js +12 -0
- package/dist/icons/align-right.d.ts +3 -0
- package/dist/icons/align-right.js +12 -0
- package/dist/icons/align-top.d.ts +3 -0
- package/dist/icons/align-top.js +12 -0
- package/dist/state/modals.d.ts +1 -2
- package/package.json +11 -11
- package/dist/components/Timeline/KeyframeSettingsModal.d.ts +0 -15
- package/dist/components/Timeline/KeyframeSettingsModal.js +0 -151
|
@@ -12,6 +12,7 @@ const client_id_1 = require("../helpers/client-id");
|
|
|
12
12
|
const colors_1 = require("../helpers/colors");
|
|
13
13
|
const get_asset_metadata_1 = require("../helpers/get-asset-metadata");
|
|
14
14
|
const get_effective_translation_1 = require("../helpers/get-effective-translation");
|
|
15
|
+
const install_required_package_1 = require("../helpers/install-required-package");
|
|
15
16
|
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
16
17
|
const remote_asset_drag_1 = require("../helpers/remote-asset-drag");
|
|
17
18
|
const smooth_zoom_1 = require("../helpers/smooth-zoom");
|
|
@@ -35,6 +36,18 @@ const elementInstallCompositionIdStyle = {
|
|
|
35
36
|
fontFamily: 'monospace',
|
|
36
37
|
fontSize: 13,
|
|
37
38
|
};
|
|
39
|
+
const elementInstallDependencyListStyle = {
|
|
40
|
+
marginTop: 8,
|
|
41
|
+
marginBottom: 0,
|
|
42
|
+
paddingLeft: 24,
|
|
43
|
+
listStyleType: 'disc',
|
|
44
|
+
};
|
|
45
|
+
const elementInstallDependencyStyle = {
|
|
46
|
+
color: 'inherit',
|
|
47
|
+
fontFamily: 'monospace',
|
|
48
|
+
fontSize: 13,
|
|
49
|
+
lineHeight: 1.5,
|
|
50
|
+
};
|
|
38
51
|
const elementInstallCodeDetailsStyle = {
|
|
39
52
|
marginTop: 12,
|
|
40
53
|
fontSize: 13,
|
|
@@ -693,10 +706,14 @@ const Canvas = ({ canvasContent, size }) => {
|
|
|
693
706
|
let canceled = false;
|
|
694
707
|
const handleInstallRequest = async () => {
|
|
695
708
|
setInstallingElementName(activeElementInstallRequest.element.displayName);
|
|
709
|
+
const missingPackages = (0, install_required_package_1.getMissingPackages)(activeElementInstallRequest.element.dependencies);
|
|
696
710
|
const accepted = await confirm({
|
|
697
711
|
title: 'Install Element',
|
|
698
|
-
message: (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Install \u201C", activeElementInstallRequest.element.displayName, "\u201D into", ' ', jsx_runtime_1.jsx("code", { style: elementInstallCompositionIdStyle, children: activeElementInstallRequest.compositionId }), ' ', "composition? This will create an Element source file and update the composition source.",
|
|
699
|
-
|
|
712
|
+
message: (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Install \u201C", activeElementInstallRequest.element.displayName, "\u201D into", ' ', jsx_runtime_1.jsx("code", { style: elementInstallCompositionIdStyle, children: activeElementInstallRequest.compositionId }), ' ', "composition? This will create an Element source file and update the composition source.", missingPackages.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
713
|
+
jsx_runtime_1.jsx("br", {}), jsx_runtime_1.jsx("br", {}),
|
|
714
|
+
"The following dependencies will also be installed:",
|
|
715
|
+
jsx_runtime_1.jsx("ul", { style: elementInstallDependencyListStyle, children: missingPackages.map((packageName) => (jsx_runtime_1.jsx("li", { style: elementInstallDependencyStyle, children: packageName }, packageName))) })
|
|
716
|
+
] })) : null, jsx_runtime_1.jsxs("details", { style: elementInstallCodeDetailsStyle, children: [
|
|
700
717
|
jsx_runtime_1.jsx("summary", { style: elementInstallCodeSummaryStyle, children: "Preview Element source" }), jsx_runtime_1.jsx("pre", { style: elementInstallCodeBlockStyle, children: jsx_runtime_1.jsx("code", { children: activeElementInstallRequest.element.sourceCode }) })
|
|
701
718
|
] })
|
|
702
719
|
] })),
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlignmentControls = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const align_bottom_1 = require("../../icons/align-bottom");
|
|
9
|
+
const align_center_horizontal_1 = require("../../icons/align-center-horizontal");
|
|
10
|
+
const align_center_vertical_1 = require("../../icons/align-center-vertical");
|
|
11
|
+
const align_left_1 = require("../../icons/align-left");
|
|
12
|
+
const align_right_1 = require("../../icons/align-right");
|
|
13
|
+
const align_top_1 = require("../../icons/align-top");
|
|
14
|
+
const InlineAction_1 = require("../InlineAction");
|
|
15
|
+
const InspectorPanelLayout_1 = require("../InspectorPanelLayout");
|
|
16
|
+
const selected_outline_drag_1 = require("../selected-outline-drag");
|
|
17
|
+
const selected_outline_types_1 = require("../selected-outline-types");
|
|
18
|
+
const call_add_keyframe_1 = require("../Timeline/call-add-keyframe");
|
|
19
|
+
const save_sequence_prop_1 = require("../Timeline/save-sequence-prop");
|
|
20
|
+
const timeline_translate_utils_1 = require("../Timeline/timeline-translate-utils");
|
|
21
|
+
const alignment_controls_1 = require("./alignment-controls");
|
|
22
|
+
const isPropStatusDraggable = (propStatus) => {
|
|
23
|
+
return (!propStatus ||
|
|
24
|
+
propStatus.status === 'static' ||
|
|
25
|
+
(propStatus.status === 'keyframed' &&
|
|
26
|
+
propStatus.interpolationFunction === 'interpolate'));
|
|
27
|
+
};
|
|
28
|
+
const container = {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
gap: 4,
|
|
32
|
+
padding: `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px 12px`,
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
};
|
|
35
|
+
const iconStyle = {
|
|
36
|
+
width: 16,
|
|
37
|
+
height: 16,
|
|
38
|
+
};
|
|
39
|
+
const verticalDivider = {
|
|
40
|
+
width: 1,
|
|
41
|
+
height: 16,
|
|
42
|
+
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
43
|
+
margin: '0 8px',
|
|
44
|
+
};
|
|
45
|
+
const AlignmentButton = ({ onClick, title, Icon, disabled }) => {
|
|
46
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { title: title, onClick: onClick, renderAction: (color) => jsx_runtime_1.jsx(Icon, { style: iconStyle, color: color }), disabled: disabled }));
|
|
47
|
+
};
|
|
48
|
+
const AlignmentControls = ({ track }) => {
|
|
49
|
+
var _a;
|
|
50
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
51
|
+
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
52
|
+
const { getDragOverrides } = (0, react_1.useContext)(remotion_1.Internals.VisualModeDragOverridesContext);
|
|
53
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
54
|
+
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
55
|
+
const currentCompositionMetadata = (0, react_1.useMemo)(() => {
|
|
56
|
+
var _a;
|
|
57
|
+
if ((canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) !== 'composition')
|
|
58
|
+
return null;
|
|
59
|
+
return ((_a = compositions.find((c) => c.id === canvasContent.compositionId)) !== null && _a !== void 0 ? _a : null);
|
|
60
|
+
}, [canvasContent, compositions]);
|
|
61
|
+
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
62
|
+
const handleAlign = (0, react_1.useCallback)((direction) => {
|
|
63
|
+
var _a;
|
|
64
|
+
var _b, _c, _d, _e;
|
|
65
|
+
if (previewServerState.type !== 'connected' ||
|
|
66
|
+
!track.nodePathInfo ||
|
|
67
|
+
!track.sequence.controls) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const ref = (_a = track.sequence.refForOutline) === null || _a === void 0 ? void 0 : _a.current;
|
|
71
|
+
if (!ref) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const nodePath = track.nodePathInfo.sequenceSubscriptionKey;
|
|
75
|
+
const nodePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, nodePath);
|
|
76
|
+
const sourceFrame = timelinePosition - track.keyframeDisplayOffset;
|
|
77
|
+
const dragOverrides = (_b = getDragOverrides(nodePath)) !== null && _b !== void 0 ? _b : {};
|
|
78
|
+
const activeSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
|
|
79
|
+
schema: track.sequence.controls.schema,
|
|
80
|
+
currentRuntimeValueDotNotation: track.sequence.controls.currentRuntimeValueDotNotation,
|
|
81
|
+
dragOverrides,
|
|
82
|
+
propStatus: nodePropStatuses,
|
|
83
|
+
frame: sourceFrame,
|
|
84
|
+
});
|
|
85
|
+
const fieldSchema = activeSchema === null || activeSchema === void 0 ? void 0 : activeSchema[selected_outline_types_1.translateFieldKey];
|
|
86
|
+
const propStatus = nodePropStatuses === null || nodePropStatuses === void 0 ? void 0 : nodePropStatuses[selected_outline_types_1.translateFieldKey];
|
|
87
|
+
if ((fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) !== 'translate') {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (!isPropStatusDraggable(propStatus)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
let elementRect;
|
|
94
|
+
try {
|
|
95
|
+
elementRect = ref.getBoundingClientRect();
|
|
96
|
+
}
|
|
97
|
+
catch (_f) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!(currentCompositionMetadata === null || currentCompositionMetadata === void 0 ? void 0 : currentCompositionMetadata.width)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const compositionRect = remotion_1.Internals.portalNode().getBoundingClientRect();
|
|
104
|
+
if (compositionRect.width === 0 || compositionRect.height === 0) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const scale = compositionRect.width / currentCompositionMetadata.width;
|
|
108
|
+
const currentTranslate = propStatus
|
|
109
|
+
? String((_d = (_c = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
|
+
propStatus: propStatus,
|
|
112
|
+
dragOverrideValue: dragOverrides[selected_outline_types_1.translateFieldKey],
|
|
113
|
+
defaultValue: fieldSchema.default,
|
|
114
|
+
frame: sourceFrame,
|
|
115
|
+
shouldResortToDefaultValueIfUndefined: true,
|
|
116
|
+
})) !== null && _c !== void 0 ? _c : fieldSchema.default) !== null && _d !== void 0 ? _d : '0px 0px')
|
|
117
|
+
: String((_e = fieldSchema.default) !== null && _e !== void 0 ? _e : '0px 0px');
|
|
118
|
+
const [currentX, currentY] = (0, timeline_translate_utils_1.parseTranslate)(currentTranslate);
|
|
119
|
+
const { x: newX, y: newY } = (0, alignment_controls_1.computeAlignedTranslate)({
|
|
120
|
+
direction,
|
|
121
|
+
elementRect,
|
|
122
|
+
compositionRect,
|
|
123
|
+
currentTranslateX: currentX,
|
|
124
|
+
currentTranslateY: currentY,
|
|
125
|
+
scale,
|
|
126
|
+
});
|
|
127
|
+
const newValue = (0, timeline_translate_utils_1.serializeTranslate)(newX, newY);
|
|
128
|
+
const undoLabels = {
|
|
129
|
+
left: 'Align left',
|
|
130
|
+
'center-h': 'Align center horizontally',
|
|
131
|
+
right: 'Align right',
|
|
132
|
+
top: 'Align top',
|
|
133
|
+
'center-v': 'Align center vertically',
|
|
134
|
+
bottom: 'Align bottom',
|
|
135
|
+
};
|
|
136
|
+
const label = undoLabels[direction];
|
|
137
|
+
if (!propStatus || propStatus.status === 'static') {
|
|
138
|
+
(0, save_sequence_prop_1.saveSequenceProps)({
|
|
139
|
+
changes: [
|
|
140
|
+
{
|
|
141
|
+
fileName: nodePath.absolutePath,
|
|
142
|
+
nodePath,
|
|
143
|
+
fieldKey: selected_outline_types_1.translateFieldKey,
|
|
144
|
+
value: newValue,
|
|
145
|
+
defaultValue: fieldSchema.default !== undefined
|
|
146
|
+
? JSON.stringify(fieldSchema.default)
|
|
147
|
+
: null,
|
|
148
|
+
schema: track.sequence.controls.schema,
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
setPropStatuses,
|
|
152
|
+
clientId: previewServerState.clientId,
|
|
153
|
+
undoLabel: label,
|
|
154
|
+
redoLabel: label,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
(0, call_add_keyframe_1.callAddSequenceKeyframe)({
|
|
159
|
+
fileName: nodePath.absolutePath,
|
|
160
|
+
nodePath,
|
|
161
|
+
fieldKey: selected_outline_types_1.translateFieldKey,
|
|
162
|
+
sourceFrame,
|
|
163
|
+
value: newValue,
|
|
164
|
+
schema: track.sequence.controls.schema,
|
|
165
|
+
setPropStatuses,
|
|
166
|
+
clientId: previewServerState.clientId,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}, [
|
|
170
|
+
previewServerState,
|
|
171
|
+
track,
|
|
172
|
+
currentCompositionMetadata,
|
|
173
|
+
timelinePosition,
|
|
174
|
+
propStatuses,
|
|
175
|
+
getDragOverrides,
|
|
176
|
+
setPropStatuses,
|
|
177
|
+
]);
|
|
178
|
+
if (previewServerState.type !== 'connected' ||
|
|
179
|
+
!track.nodePathInfo ||
|
|
180
|
+
!track.sequence.controls ||
|
|
181
|
+
!currentCompositionMetadata) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
const renderNodePath = track.nodePathInfo.sequenceSubscriptionKey;
|
|
185
|
+
const renderNodePropStatuses = remotion_1.Internals.getPropStatusesCtx(propStatuses, renderNodePath);
|
|
186
|
+
const renderSourceFrame = timelinePosition - track.keyframeDisplayOffset;
|
|
187
|
+
const renderDragOverrides = (_a = getDragOverrides(renderNodePath)) !== null && _a !== void 0 ? _a : {};
|
|
188
|
+
const renderActiveSchema = (0, selected_outline_drag_1.getSelectedOutlineActiveSchema)({
|
|
189
|
+
schema: track.sequence.controls.schema,
|
|
190
|
+
currentRuntimeValueDotNotation: track.sequence.controls.currentRuntimeValueDotNotation,
|
|
191
|
+
dragOverrides: renderDragOverrides,
|
|
192
|
+
propStatus: renderNodePropStatuses,
|
|
193
|
+
frame: renderSourceFrame,
|
|
194
|
+
});
|
|
195
|
+
const renderFieldSchema = renderActiveSchema === null || renderActiveSchema === void 0 ? void 0 : renderActiveSchema[selected_outline_types_1.translateFieldKey];
|
|
196
|
+
const renderPropStatus = renderNodePropStatuses === null || renderNodePropStatuses === void 0 ? void 0 : renderNodePropStatuses[selected_outline_types_1.translateFieldKey];
|
|
197
|
+
if ((renderFieldSchema === null || renderFieldSchema === void 0 ? void 0 : renderFieldSchema.type) !== 'translate') {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
const alignmentDisabled = !isPropStatusDraggable(renderPropStatus);
|
|
201
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
202
|
+
jsx_runtime_1.jsx(AlignmentButton, { title: "Align left", onClick: () => handleAlign('left'), Icon: align_left_1.AlignLeftIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align center horizontally", onClick: () => handleAlign('center-h'), Icon: align_center_horizontal_1.AlignCenterHorizontalIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align right", onClick: () => handleAlign('right'), Icon: align_right_1.AlignRightIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx("div", { style: verticalDivider }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align top", onClick: () => handleAlign('top'), Icon: align_top_1.AlignTopIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align center vertically", onClick: () => handleAlign('center-v'), Icon: align_center_vertical_1.AlignCenterVerticalIcon, disabled: alignmentDisabled }), jsx_runtime_1.jsx(AlignmentButton, { title: "Align bottom", onClick: () => handleAlign('bottom'), Icon: align_bottom_1.AlignBottomIcon, disabled: alignmentDisabled })
|
|
203
|
+
] }));
|
|
204
|
+
};
|
|
205
|
+
exports.AlignmentControls = AlignmentControls;
|
|
@@ -16,6 +16,7 @@ const update_selected_easing_1 = require("../Timeline/update-selected-easing");
|
|
|
16
16
|
const common_1 = require("./common");
|
|
17
17
|
const easing_inspector_selection_1 = require("./easing-inspector-selection");
|
|
18
18
|
const KeyframeEasingNavigator_1 = require("./KeyframeEasingNavigator");
|
|
19
|
+
const KeyframeSettings_1 = require("./KeyframeSettings");
|
|
19
20
|
const SequenceInspectorHeader_1 = require("./SequenceInspectorHeader");
|
|
20
21
|
const styles_1 = require("./styles");
|
|
21
22
|
const use_track_for_selection_1 = require("./use-track-for-selection");
|
|
@@ -206,10 +207,15 @@ const EasingInspector = ({ selection }) => {
|
|
|
206
207
|
selection,
|
|
207
208
|
track,
|
|
208
209
|
]);
|
|
209
|
-
if (state === null ||
|
|
210
|
+
if (state === null ||
|
|
211
|
+
track === null ||
|
|
212
|
+
currentEasingSelection === null ||
|
|
213
|
+
easingUpdate === null) {
|
|
210
214
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Easing unavailable" });
|
|
211
215
|
}
|
|
212
216
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
|
|
213
|
-
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeaderWithDivider, { track: track }), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)),
|
|
217
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeaderWithDivider, { track: track }), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)), jsx_runtime_1.jsx(KeyframeSettings_1.KeyframeSettings, { update: easingUpdate }), canAddKeyframeAtPlayhead ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
218
|
+
jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }), jsx_runtime_1.jsx("div", { style: styles_1.detailsContainer, children: jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: addKeyframeDisabled, onClick: onAddKeyframeAtPlayhead, renderIcon: (color) => (jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: addKeyframeIcon })), children: `Add keyframe at ${addKeyframeTime}` }) })
|
|
219
|
+
] })) : null] }));
|
|
214
220
|
};
|
|
215
221
|
exports.EasingInspector = EasingInspector;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyframeSettings = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
8
|
+
const ComboBox_1 = require("../NewComposition/ComboBox");
|
|
9
|
+
const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
10
|
+
const call_update_keyframe_settings_1 = require("../Timeline/call-update-keyframe-settings");
|
|
11
|
+
const common_1 = require("./common");
|
|
12
|
+
const styles_1 = require("./styles");
|
|
13
|
+
const comboStyle = {
|
|
14
|
+
minWidth: 120,
|
|
15
|
+
};
|
|
16
|
+
const keyframeSettingsContainer = {
|
|
17
|
+
...styles_1.detailsContainer,
|
|
18
|
+
paddingBottom: 0,
|
|
19
|
+
};
|
|
20
|
+
const extrapolateOptions = [
|
|
21
|
+
'extend',
|
|
22
|
+
'clamp',
|
|
23
|
+
'identity',
|
|
24
|
+
'wrap',
|
|
25
|
+
];
|
|
26
|
+
const labelForExtrapolate = (value) => value[0].toUpperCase() + value.slice(1);
|
|
27
|
+
const getExtrapolateValues = (onSelect, disabled) => {
|
|
28
|
+
return extrapolateOptions.map((value) => ({
|
|
29
|
+
type: 'item',
|
|
30
|
+
id: value,
|
|
31
|
+
keyHint: null,
|
|
32
|
+
label: labelForExtrapolate(value),
|
|
33
|
+
leftItem: null,
|
|
34
|
+
disabled,
|
|
35
|
+
onClick: () => onSelect(value),
|
|
36
|
+
quickSwitcherLabel: null,
|
|
37
|
+
subMenu: null,
|
|
38
|
+
value,
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
const outputOptions = [
|
|
42
|
+
'linear',
|
|
43
|
+
'perceptual-scale',
|
|
44
|
+
];
|
|
45
|
+
const labelForOutput = (value) => {
|
|
46
|
+
return value === 'perceptual-scale' ? 'Perceptual scale' : 'Linear';
|
|
47
|
+
};
|
|
48
|
+
const getOutputValues = (onSelect, disabled) => {
|
|
49
|
+
return outputOptions.map((value) => ({
|
|
50
|
+
type: 'item',
|
|
51
|
+
id: value,
|
|
52
|
+
keyHint: null,
|
|
53
|
+
label: labelForOutput(value),
|
|
54
|
+
leftItem: null,
|
|
55
|
+
disabled,
|
|
56
|
+
onClick: () => onSelect(value),
|
|
57
|
+
quickSwitcherLabel: null,
|
|
58
|
+
subMenu: null,
|
|
59
|
+
value,
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
const KeyframeSettings = ({ update }) => {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
const { setPropStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModeSettersContext);
|
|
65
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
66
|
+
const { propStatus } = update;
|
|
67
|
+
const [posterize, setPosterize] = (0, react_1.useState)((_a = propStatus.posterize) !== null && _a !== void 0 ? _a : 0);
|
|
68
|
+
const canEditInterpolationSettings = propStatus.interpolationFunction === 'interpolate';
|
|
69
|
+
const disabled = previewServerState.type !== 'connected';
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
var _a;
|
|
72
|
+
setPosterize((_a = propStatus.posterize) !== null && _a !== void 0 ? _a : 0);
|
|
73
|
+
}, [propStatus.posterize]);
|
|
74
|
+
const save = (0, react_1.useCallback)((settings) => {
|
|
75
|
+
if (previewServerState.type !== 'connected') {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (update.type === 'sequence') {
|
|
79
|
+
(0, call_update_keyframe_settings_1.callUpdateSequenceKeyframeSettings)({
|
|
80
|
+
fileName: update.fileName,
|
|
81
|
+
nodePath: update.nodePath,
|
|
82
|
+
fieldKey: update.fieldKey,
|
|
83
|
+
settings,
|
|
84
|
+
schema: update.schema,
|
|
85
|
+
setPropStatuses,
|
|
86
|
+
clientId: previewServerState.clientId,
|
|
87
|
+
}).catch(() => undefined);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
(0, call_update_keyframe_settings_1.callUpdateEffectKeyframeSettings)({
|
|
91
|
+
fileName: update.fileName,
|
|
92
|
+
nodePath: update.nodePath,
|
|
93
|
+
effectIndex: update.effectIndex,
|
|
94
|
+
fieldKey: update.fieldKey,
|
|
95
|
+
settings,
|
|
96
|
+
schema: update.schema,
|
|
97
|
+
setPropStatuses,
|
|
98
|
+
clientId: previewServerState.clientId,
|
|
99
|
+
}).catch(() => undefined);
|
|
100
|
+
}, [previewServerState, setPropStatuses, update]);
|
|
101
|
+
const saveSettings = (0, react_1.useCallback)((_a) => {
|
|
102
|
+
var _b, _c;
|
|
103
|
+
var { left = propStatus.clamping.left, output = (_b = propStatus.output) !== null && _b !== void 0 ? _b : 'linear', posterize: nextPosterize = (_c = propStatus.posterize) !== null && _c !== void 0 ? _c : 0, right = propStatus.clamping.right, } = _a;
|
|
104
|
+
save({
|
|
105
|
+
type: 'settings',
|
|
106
|
+
clamping: canEditInterpolationSettings ? { left, right } : undefined,
|
|
107
|
+
output: canEditInterpolationSettings ? output : undefined,
|
|
108
|
+
posterize: nextPosterize <= 0 ? undefined : nextPosterize,
|
|
109
|
+
});
|
|
110
|
+
}, [
|
|
111
|
+
canEditInterpolationSettings,
|
|
112
|
+
propStatus.clamping.left,
|
|
113
|
+
propStatus.clamping.right,
|
|
114
|
+
propStatus.output,
|
|
115
|
+
propStatus.posterize,
|
|
116
|
+
save,
|
|
117
|
+
]);
|
|
118
|
+
const onSelectLeft = (0, react_1.useCallback)((left) => saveSettings({ left }), [saveSettings]);
|
|
119
|
+
const onSelectRight = (0, react_1.useCallback)((right) => saveSettings({ right }), [saveSettings]);
|
|
120
|
+
const onSelectOutput = (0, react_1.useCallback)((output) => saveSettings({ output }), [saveSettings]);
|
|
121
|
+
const leftValues = (0, react_1.useMemo)(() => getExtrapolateValues(onSelectLeft, disabled), [disabled, onSelectLeft]);
|
|
122
|
+
const rightValues = (0, react_1.useMemo)(() => getExtrapolateValues(onSelectRight, disabled), [disabled, onSelectRight]);
|
|
123
|
+
const outputValues = (0, react_1.useMemo)(() => getOutputValues(onSelectOutput, disabled), [disabled, onSelectOutput]);
|
|
124
|
+
const onPosterizeChange = (0, react_1.useCallback)((value) => {
|
|
125
|
+
setPosterize(Math.max(0, Math.round(value)));
|
|
126
|
+
}, []);
|
|
127
|
+
const onPosterizeChangeEnd = (0, react_1.useCallback)((value) => {
|
|
128
|
+
const nextPosterize = Math.max(0, Math.round(value));
|
|
129
|
+
setPosterize(nextPosterize);
|
|
130
|
+
saveSettings({ posterize: nextPosterize });
|
|
131
|
+
}, [saveSettings]);
|
|
132
|
+
const posterizeFormatter = (0, react_1.useCallback)((value) => {
|
|
133
|
+
return String(Math.round(Number(value)));
|
|
134
|
+
}, []);
|
|
135
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
136
|
+
jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }), jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: "Keyframe settings" }), jsx_runtime_1.jsxs("div", { style: keyframeSettingsContainer, children: [canEditInterpolationSettings ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
137
|
+
jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Extrapolate left", children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: leftValues, selectedId: propStatus.clamping.left, title: "Extrapolate left", style: comboStyle, small: true }) }), jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Extrapolate right", children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: rightValues, selectedId: propStatus.clamping.right, title: "Extrapolate right", style: comboStyle, small: true }) }), jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Output", children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: outputValues, selectedId: (_b = propStatus.output) !== null && _b !== void 0 ? _b : 'linear', title: "Output", style: comboStyle, small: true }) })
|
|
138
|
+
] })) : null, jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Posterize", children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: posterize, status: "ok", onValueChange: onPosterizeChange, onValueChangeEnd: onPosterizeChangeEnd, onTextChange: () => undefined, min: 0, step: 1, formatter: posterizeFormatter, rightAlign: true, small: true, disabled: disabled }) })
|
|
139
|
+
] })
|
|
140
|
+
] }));
|
|
141
|
+
};
|
|
142
|
+
exports.KeyframeSettings = KeyframeSettings;
|
|
@@ -7,6 +7,7 @@ const client_id_1 = require("../../helpers/client-id");
|
|
|
7
7
|
const InspectorSequenceSection_1 = require("../InspectorSequenceSection");
|
|
8
8
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
9
9
|
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
10
|
+
const AlignmentControls_1 = require("./AlignmentControls");
|
|
10
11
|
const common_1 = require("./common");
|
|
11
12
|
const SequenceInspectorHeader_1 = require("./SequenceInspectorHeader");
|
|
12
13
|
const styles_1 = require("./styles");
|
|
@@ -51,7 +52,7 @@ const SequenceExpandedInspector = ({ track }) => {
|
|
|
51
52
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Sequence inspector unavailable" });
|
|
52
53
|
}
|
|
53
54
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
|
|
54
|
-
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })) })] }));
|
|
55
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }), jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderSectionHeader: (children) => (jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: children })), renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) })] }));
|
|
55
56
|
};
|
|
56
57
|
const SequenceSelectionInspector = ({ selection }) => {
|
|
57
58
|
const track = (0, use_track_for_selection_1.useTrackForSelection)(selection);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AlignmentDirection = 'left' | 'center-h' | 'right' | 'top' | 'center-v' | 'bottom';
|
|
2
|
+
export declare const computeAlignedTranslate: ({ direction, elementRect, compositionRect, currentTranslateX, currentTranslateY, scale, }: {
|
|
3
|
+
readonly direction: AlignmentDirection;
|
|
4
|
+
readonly elementRect: DOMRect;
|
|
5
|
+
readonly compositionRect: DOMRect;
|
|
6
|
+
readonly currentTranslateX: number;
|
|
7
|
+
readonly currentTranslateY: number;
|
|
8
|
+
readonly scale: number;
|
|
9
|
+
}) => {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeAlignedTranslate = void 0;
|
|
4
|
+
const computeAlignedTranslate = ({ direction, elementRect, compositionRect, currentTranslateX, currentTranslateY, scale, }) => {
|
|
5
|
+
let deltaX = 0;
|
|
6
|
+
let deltaY = 0;
|
|
7
|
+
// Note: elementRect and compositionRect are in screen space (pixels).
|
|
8
|
+
// We divide by scale to convert back to composition space.
|
|
9
|
+
switch (direction) {
|
|
10
|
+
case 'left':
|
|
11
|
+
deltaX = compositionRect.left - elementRect.left;
|
|
12
|
+
break;
|
|
13
|
+
case 'center-h': {
|
|
14
|
+
const compCenter = compositionRect.left + compositionRect.width / 2;
|
|
15
|
+
const elemCenter = elementRect.left + elementRect.width / 2;
|
|
16
|
+
deltaX = compCenter - elemCenter;
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
case 'right':
|
|
20
|
+
deltaX = compositionRect.right - elementRect.right;
|
|
21
|
+
break;
|
|
22
|
+
case 'top':
|
|
23
|
+
deltaY = compositionRect.top - elementRect.top;
|
|
24
|
+
break;
|
|
25
|
+
case 'center-v': {
|
|
26
|
+
const compCenter = compositionRect.top + compositionRect.height / 2;
|
|
27
|
+
const elemCenter = elementRect.top + elementRect.height / 2;
|
|
28
|
+
deltaY = compCenter - elemCenter;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case 'bottom':
|
|
32
|
+
deltaY = compositionRect.bottom - elementRect.bottom;
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
x: currentTranslateX + deltaX / scale,
|
|
39
|
+
y: currentTranslateY + deltaY / scale,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.computeAlignedTranslate = computeAlignedTranslate;
|
|
@@ -15,5 +15,6 @@ export declare const InspectorSequenceSection: React.FC<{
|
|
|
15
15
|
readonly nodePathInfo: SequenceNodePathInfo;
|
|
16
16
|
readonly keyframeDisplayOffset: number;
|
|
17
17
|
readonly renderSectionHeader: (children: React.ReactNode) => React.ReactNode;
|
|
18
|
+
readonly renderTransformControls: () => React.ReactNode;
|
|
18
19
|
}>;
|
|
19
20
|
export {};
|
|
@@ -133,7 +133,7 @@ const hasSequenceControls = (sequence) => {
|
|
|
133
133
|
return sequence.controls !== null;
|
|
134
134
|
};
|
|
135
135
|
exports.hasSequenceControls = hasSequenceControls;
|
|
136
|
-
const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderSectionHeader, }) => {
|
|
136
|
+
const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, keyframeDisplayOffset, renderSectionHeader, renderTransformControls, }) => {
|
|
137
137
|
const { tree } = (0, use_timeline_expanded_tree_1.useTimelineExpandedTree)({
|
|
138
138
|
sequence,
|
|
139
139
|
nodePathInfo,
|
|
@@ -222,6 +222,6 @@ const InspectorSequenceSection = ({ sequence, validatedLocation, nodePathInfo, k
|
|
|
222
222
|
] }));
|
|
223
223
|
}
|
|
224
224
|
return (jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
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] }));
|
|
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.id === 'transforms' ? renderTransformControls() : null, 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] }));
|
|
226
226
|
};
|
|
227
227
|
exports.InspectorSequenceSection = InspectorSequenceSection;
|
|
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
9
9
|
const colors_1 = require("../helpers/colors");
|
|
10
10
|
const z_index_1 = require("../state/z-index");
|
|
11
|
+
const InlineAction_1 = require("./InlineAction");
|
|
11
12
|
const portals_1 = require("./Menu/portals");
|
|
12
13
|
const CancelButton_1 = require("./NewComposition/CancelButton");
|
|
13
14
|
const container = {
|
|
@@ -25,13 +26,18 @@ const buttonContainer = {
|
|
|
25
26
|
alignItems: 'center',
|
|
26
27
|
display: 'flex',
|
|
27
28
|
justifyContent: 'flex-end',
|
|
29
|
+
paddingRight: 8,
|
|
28
30
|
};
|
|
29
31
|
const button = {
|
|
30
|
-
height:
|
|
31
|
-
width:
|
|
32
|
+
height: 16,
|
|
33
|
+
width: 16,
|
|
34
|
+
flexShrink: 0,
|
|
35
|
+
};
|
|
36
|
+
const renderCloseIcon = (color) => {
|
|
37
|
+
return jsx_runtime_1.jsx(CancelButton_1.CancelIcon, { style: { ...button, color } });
|
|
32
38
|
};
|
|
33
39
|
function MobilePanel({ children, onClose, }) {
|
|
34
40
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
35
41
|
return react_dom_1.default.createPortal(jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
36
|
-
jsx_runtime_1.jsx("div", { style: buttonContainer, children: jsx_runtime_1.jsx(
|
|
42
|
+
jsx_runtime_1.jsx("div", { style: buttonContainer, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClose, renderAction: renderCloseIcon, title: "Close sidebar" }) }), children] }), (0, portals_1.getPortal)(currentZIndex));
|
|
37
43
|
}
|
|
@@ -26,14 +26,13 @@ const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher")
|
|
|
26
26
|
const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
27
27
|
const ServerRenderModal_1 = require("./RenderModal/ServerRenderModal");
|
|
28
28
|
const WebRenderModal_1 = require("./RenderModal/WebRenderModal");
|
|
29
|
-
const KeyframeSettingsModal_1 = require("./Timeline/KeyframeSettingsModal");
|
|
30
29
|
const UpdateModal_1 = require("./UpdateModal/UpdateModal");
|
|
31
30
|
const Modals = ({ readOnlyStudio }) => {
|
|
32
31
|
var _a;
|
|
33
32
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
34
33
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
35
34
|
'connected';
|
|
36
|
-
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 === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { 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 === '
|
|
35
|
+
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 === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { 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 === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
37
36
|
modalContextType.type === 'server-render' &&
|
|
38
37
|
(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 })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
39
38
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CancelButton = void 0;
|
|
3
|
+
exports.CancelButton = exports.CancelIcon = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const colors_1 = require("../../helpers/colors");
|
|
6
6
|
const z_index_1 = require("../../state/z-index");
|
|
@@ -14,8 +14,12 @@ const style = {
|
|
|
14
14
|
justifyContent: 'center',
|
|
15
15
|
alignItems: 'center',
|
|
16
16
|
};
|
|
17
|
+
const CancelIcon = (props) => {
|
|
18
|
+
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 320 512", ...props, children: jsx_runtime_1.jsx("path", { fill: colors_1.CURRENT_COLOR, d: "M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z" }) }));
|
|
19
|
+
};
|
|
20
|
+
exports.CancelIcon = CancelIcon;
|
|
17
21
|
const CancelButton = ({ onPress, ...props }) => {
|
|
18
22
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
19
|
-
return (jsx_runtime_1.jsx("button", { tabIndex: tabIndex, style: style, type: "button", onClick: onPress, children: jsx_runtime_1.jsx(
|
|
23
|
+
return (jsx_runtime_1.jsx("button", { tabIndex: tabIndex, style: style, type: "button", onClick: onPress, children: jsx_runtime_1.jsx(exports.CancelIcon, { ...props }) }));
|
|
20
24
|
};
|
|
21
25
|
exports.CancelButton = CancelButton;
|