@remotion/studio 4.0.512 → 4.0.514
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/Studio.js +2 -1
- package/dist/components/AskAiModal.js +1 -1
- package/dist/components/AssetSelector.js +2 -0
- package/dist/components/AssetSelectorItem.js +1 -2
- package/dist/components/AudioWaveform.d.ts +3 -0
- package/dist/components/AudioWaveform.js +55 -67
- package/dist/components/Canvas.js +40 -5
- package/dist/components/CanvasOrLoading.js +5 -0
- package/dist/components/CompositionSelector.js +2 -0
- package/dist/components/CompositionSelectorItem.js +14 -1
- package/dist/components/ConfigureDefaultEditorModal.js +17 -11
- package/dist/components/Editor.js +16 -1
- package/dist/components/ElementInstallConfirmation.d.ts +1 -0
- package/dist/components/ElementInstallConfirmation.js +4 -2
- package/dist/components/FixComputedValueModal.d.ts +9 -0
- package/dist/components/FixComputedValueModal.js +217 -0
- package/dist/components/InitialCompositionLoader.js +19 -0
- package/dist/components/InlineDropdown.js +4 -4
- package/dist/components/InspectorInfoHeader.js +3 -3
- package/dist/components/InspectorOpenInEditor.js +26 -24
- package/dist/components/InspectorPanel/AlignmentControls.js +13 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +11 -1
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +12 -8
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +13 -2
- package/dist/components/InspectorPanel/EasingInspector.js +12 -3
- package/dist/components/InspectorPanel/KeyframeInspector.js +21 -7
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +1 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +35 -6
- package/dist/components/InspectorPanel/common.d.ts +5 -5
- package/dist/components/InspectorPanel/common.js +8 -8
- package/dist/components/InspectorPanel/easing-inspector-selection.js +7 -2
- package/dist/components/InspectorPanel/inspector-section-collapse.d.ts +1 -0
- package/dist/components/InspectorPanel/styles.d.ts +1 -1
- package/dist/components/InspectorPanel/styles.js +4 -2
- package/dist/components/InspectorSourceLocation.d.ts +1 -1
- package/dist/components/InspectorSourceLocation.js +2 -2
- package/dist/components/LicenseKeyValidation.js +2 -2
- package/dist/components/Modals.js +2 -1
- package/dist/components/NewComposition/CodemodFooter.d.ts +1 -0
- package/dist/components/NewComposition/CodemodFooter.js +10 -8
- package/dist/components/NewComposition/DeleteComposition.js +1 -1
- package/dist/components/NewComposition/DeleteFolder.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +7 -2
- package/dist/components/NewComposition/NewComposition.js +1 -1
- package/dist/components/NewComposition/NewFolder.js +1 -1
- package/dist/components/NewComposition/RenameComposition.js +1 -1
- package/dist/components/NewComposition/RenameFolder.js +1 -1
- package/dist/components/NewComposition/duplicate-composition-api.d.ts +16 -0
- package/dist/components/NewComposition/duplicate-composition-api.js +16 -0
- package/dist/components/NoRegisterRoot.js +1 -1
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +4 -3
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
- package/dist/components/QuickSwitcher/fuzzy-search.js +1 -1
- package/dist/components/RefreshCompositionOverlay.js +1 -1
- package/dist/components/RenderButton.js +6 -3
- package/dist/components/RenderModal/WebRenderModal.js +6 -2
- package/dist/components/RenderModal/WebRenderModalAdvanced.d.ts +2 -0
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +9 -2
- package/dist/components/RenderModal/render-modals.js +5 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +5 -1
- package/dist/components/RenderQueue/actions.js +12 -2
- package/dist/components/RenderQueue/client-side-render-types.d.ts +1 -0
- package/dist/components/RenderingSettings.d.ts +2 -0
- package/dist/components/RenderingSettings.js +355 -0
- package/dist/components/SelectedOutlineElement.js +15 -13
- package/dist/components/SelectedOutlineOverlay.js +30 -8
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +53 -9
- package/dist/components/SettingsContext.d.ts +4 -1
- package/dist/components/SettingsContext.js +9 -2
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +10 -1
- package/dist/components/SettingsModalFooter.js +1 -1
- package/dist/components/StudioSettings.d.ts +2 -0
- package/dist/components/StudioSettings.js +185 -0
- package/dist/components/Timeline/LoopedIndicator.js +1 -1
- package/dist/components/Timeline/LoopedTimelineIndicators.d.ts +3 -0
- package/dist/components/Timeline/LoopedTimelineIndicators.js +22 -14
- package/dist/components/Timeline/Timeline.js +11 -9
- package/dist/components/Timeline/TimelineArrayField.js +1 -0
- package/dist/components/Timeline/TimelineAssetField.d.ts +2 -2
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineDragHandler.js +62 -76
- package/dist/components/Timeline/TimelineEffectItem.js +1 -1
- package/dist/components/Timeline/TimelineEffectPropItem.d.ts +4 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +25 -14
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +1 -1
- package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
- package/dist/components/Timeline/TimelineExpandedSection.js +1 -1
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +0 -4
- package/dist/components/Timeline/TimelineHeightContainer.js +4 -4
- package/dist/components/Timeline/TimelineImageInfo.d.ts +1 -0
- package/dist/components/Timeline/TimelineImageInfo.js +3 -2
- package/dist/components/Timeline/TimelineKeyframeControls.js +31 -8
- package/dist/components/Timeline/TimelineKeyframedValue.js +1 -0
- package/dist/components/Timeline/TimelineList.d.ts +1 -5
- package/dist/components/Timeline/TimelineList.js +14 -9
- package/dist/components/Timeline/TimelinePinchZoom.js +5 -5
- package/dist/components/Timeline/TimelineRowChrome.d.ts +0 -2
- package/dist/components/Timeline/TimelineRowChrome.js +12 -5
- package/dist/components/Timeline/TimelineSchemaField.d.ts +7 -3
- package/dist/components/Timeline/TimelineSchemaField.js +71 -13
- package/dist/components/Timeline/TimelineScrollable.js +3 -1
- package/dist/components/Timeline/TimelineSelection.d.ts +5 -2
- package/dist/components/Timeline/TimelineSelection.js +90 -103
- package/dist/components/Timeline/TimelineSequence.js +59 -25
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +1 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +15 -9
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +2 -1
- package/dist/components/Timeline/TimelineSequencePropItem.js +14 -7
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +3 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +128 -27
- package/dist/components/Timeline/TimelineSlider.js +42 -33
- package/dist/components/Timeline/TimelineTimeIndicators.js +90 -98
- package/dist/components/Timeline/TimelineTracks.d.ts +0 -2
- package/dist/components/Timeline/TimelineTracks.js +11 -4
- package/dist/components/Timeline/TimelineTransformOriginField.js +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +4 -4
- package/dist/components/Timeline/TimelineVideoInfo.js +151 -61
- package/dist/components/Timeline/TimelineViewport.d.ts +12 -0
- package/dist/components/Timeline/TimelineViewport.js +62 -0
- package/dist/components/Timeline/TimelineVirtualization.d.ts +22 -0
- package/dist/components/Timeline/TimelineVirtualization.js +144 -0
- package/dist/components/Timeline/TimelineZoomControls.js +16 -8
- package/dist/components/Timeline/call-add-keyframe.js +31 -3
- package/dist/components/Timeline/call-delete-keyframe.js +13 -3
- package/dist/components/Timeline/call-move-keyframe.d.ts +2 -1
- package/dist/components/Timeline/call-move-keyframe.js +81 -18
- package/dist/components/Timeline/call-update-keyframe-settings.js +31 -3
- package/dist/components/Timeline/delete-selected-keyframe.d.ts +0 -8
- package/dist/components/Timeline/delete-selected-keyframe.js +23 -44
- package/dist/components/Timeline/delete-selected-timeline-item.d.ts +0 -8
- package/dist/components/Timeline/delete-selected-timeline-item.js +18 -44
- package/dist/components/Timeline/get-easing-selection-after-keyframe-delete.js +8 -3
- package/dist/components/Timeline/get-sequence-context-menu-items.js +10 -8
- package/dist/components/Timeline/get-timeline-keyframes.d.ts +5 -2
- package/dist/components/Timeline/get-timeline-keyframes.js +16 -10
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.d.ts +30 -0
- package/dist/components/Timeline/get-timeline-sequence-visible-layout.js +61 -0
- package/dist/components/Timeline/keyframe-clipboard.js +9 -2
- package/dist/components/Timeline/split-selected-timeline-item.js +2 -2
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +24 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +127 -4
- package/dist/components/Timeline/use-open-sequence-in-apps.js +8 -8
- package/dist/components/Timeline/use-timeline-height.d.ts +3 -5
- package/dist/components/Timeline/use-timeline-height.js +16 -18
- package/dist/components/Timeline/use-timeline-keyframe-drag.js +14 -4
- package/dist/components/UpdateCheck.d.ts +2 -10
- package/dist/components/UpdateCheck.js +8 -2
- package/dist/components/VisualControls/ClickableFileName.js +13 -6
- package/dist/components/VisualControls/VisualControlHandle.js +8 -0
- package/dist/components/composition-menu-items.d.ts +6 -1
- package/dist/components/composition-menu-items.js +9 -6
- package/dist/components/delete-jsx-node-api.d.ts +2 -0
- package/dist/components/delete-jsx-node-api.js +12 -0
- package/dist/components/element-install-api.d.ts +3 -0
- package/dist/components/element-install-api.js +19 -0
- package/dist/components/folder-menu-items.d.ts +4 -1
- package/dist/components/folder-menu-items.js +4 -5
- package/dist/components/get-open-in-menu-items.d.ts +1 -1
- package/dist/components/get-open-in-menu-items.js +15 -13
- package/dist/components/import-assets.js +20 -9
- package/dist/components/reorder-sequence-api.d.ts +2 -0
- package/dist/components/reorder-sequence-api.js +12 -0
- package/dist/components/sequence-props-api.js +44 -3
- package/dist/components/split-jsx-sequence-api.d.ts +2 -0
- package/dist/components/split-jsx-sequence-api.js +12 -0
- package/dist/components/split-video-from-audio-api.d.ts +2 -0
- package/dist/components/split-video-from-audio-api.js +12 -0
- package/dist/components/use-default-editor-info.d.ts +8 -0
- package/dist/components/use-default-editor-info.js +25 -9
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +10 -3
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +3 -1
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +6 -6
- package/dist/error-overlay/remotion-overlay/Overlay.js +14 -12
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +2 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +7 -4
- package/dist/esm/{chunk-s8gwjng0.js → chunk-xn2q7eem.js} +11983 -8035
- package/dist/esm/index.mjs +7 -5
- package/dist/esm/internals.mjs +11983 -8035
- package/dist/esm/previewEntry.mjs +13059 -9107
- package/dist/esm/renderEntry.mjs +2 -3
- package/dist/helpers/browser-studio-operations.d.ts +2 -0
- package/dist/helpers/browser-studio-operations.js +10 -1
- package/dist/helpers/get-timeline-max-zoom.d.ts +26 -0
- package/dist/helpers/get-timeline-max-zoom.js +45 -0
- package/dist/helpers/inject-css.js +2 -2
- package/dist/helpers/open-in-editor.d.ts +6 -4
- package/dist/helpers/open-in-editor.js +4 -4
- package/dist/helpers/render-codec-label.d.ts +1 -1
- package/dist/helpers/retry-payload.js +1 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -1
- package/dist/helpers/studio-runtime-config.js +2 -3
- package/dist/helpers/timeline-layout.d.ts +3 -1
- package/dist/helpers/timeline-layout.js +6 -1
- package/dist/helpers/url-state.js +3 -2
- package/dist/helpers/use-menu-structure.js +12 -11
- package/dist/helpers/use-runtime-values.d.ts +2 -1
- package/dist/helpers/use-runtime-values.js +7 -3
- package/dist/icons/remotion-triangle.d.ts +2 -0
- package/dist/icons/remotion-triangle.js +7 -0
- package/dist/renderEntry.js +1 -1
- package/dist/state/composition-list.d.ts +13 -0
- package/dist/state/composition-list.js +21 -0
- package/dist/state/modals.d.ts +7 -1
- package/dist/state/timeline-zoom.d.ts +1 -2
- package/dist/state/timeline-zoom.js +9 -5
- package/package.json +14 -13
|
@@ -12,6 +12,7 @@ const render_frame_1 = require("../../state/render-frame");
|
|
|
12
12
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
13
13
|
const call_add_keyframe_1 = require("../Timeline/call-add-keyframe");
|
|
14
14
|
const EasingEditorModal_1 = require("../Timeline/EasingEditorModal");
|
|
15
|
+
const get_timeline_keyframes_1 = require("../Timeline/get-timeline-keyframes");
|
|
15
16
|
const TimelineSelection_1 = require("../Timeline/TimelineSelection");
|
|
16
17
|
const update_selected_easing_1 = require("../Timeline/update-selected-easing");
|
|
17
18
|
const common_1 = require("./common");
|
|
@@ -117,6 +118,12 @@ const EasingInspector = ({ selection }) => {
|
|
|
117
118
|
segmentIndex: easingUpdate.segmentIndex,
|
|
118
119
|
});
|
|
119
120
|
}, [easingUpdate, selection.nodePathInfo, track]);
|
|
121
|
+
const easingKeyframeDisplayOffset = easingUpdate === null || track === null
|
|
122
|
+
? 0
|
|
123
|
+
: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
124
|
+
propStatus: easingUpdate.propStatus,
|
|
125
|
+
keyframeDisplayOffset: track.keyframeDisplayOffset,
|
|
126
|
+
});
|
|
120
127
|
const state = (0, react_1.useMemo)(() => {
|
|
121
128
|
if (initialEasing === null || currentEasingSelection === null) {
|
|
122
129
|
return null;
|
|
@@ -147,7 +154,7 @@ const EasingInspector = ({ selection }) => {
|
|
|
147
154
|
previewServerState.type !== 'connected') {
|
|
148
155
|
return;
|
|
149
156
|
}
|
|
150
|
-
const sourceFrame = timelinePosition -
|
|
157
|
+
const sourceFrame = timelinePosition - easingKeyframeDisplayOffset;
|
|
151
158
|
const value = remotion_1.Internals.getEffectiveVisualModeValue({
|
|
152
159
|
propStatus: easingUpdate.propStatus,
|
|
153
160
|
dragOverrideValue: easingDetails.dragOverrideValue,
|
|
@@ -196,11 +203,12 @@ const EasingInspector = ({ selection }) => {
|
|
|
196
203
|
setPropStatuses,
|
|
197
204
|
timelinePosition,
|
|
198
205
|
track,
|
|
206
|
+
easingKeyframeDisplayOffset,
|
|
199
207
|
]);
|
|
200
208
|
const renderHeader = (0, react_1.useCallback)(() => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
201
209
|
jsx_runtime_1.jsx(common_1.InspectorBackAction, { disabled: parentSelection === null, onClick: onSelectParent, title: "Back to property", children: fieldLabel }), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), easingUpdate === null || track === null ? null : (jsx_runtime_1.jsx(KeyframeEasingNavigator_1.KeyframeEasingNavigator, { currentSelection: currentEasingSelection !== null && currentEasingSelection !== void 0 ? currentEasingSelection : selection, includeEasings: true, keyframes: easingUpdate.propStatus.keyframes.map((keyframe) => ({
|
|
202
210
|
...keyframe,
|
|
203
|
-
frame: keyframe.frame +
|
|
211
|
+
frame: keyframe.frame + easingKeyframeDisplayOffset,
|
|
204
212
|
})), nodePathInfo: selection.nodePathInfo }))] })), [
|
|
205
213
|
currentEasingSelection,
|
|
206
214
|
easingUpdate,
|
|
@@ -209,6 +217,7 @@ const EasingInspector = ({ selection }) => {
|
|
|
209
217
|
parentSelection,
|
|
210
218
|
selection,
|
|
211
219
|
track,
|
|
220
|
+
easingKeyframeDisplayOffset,
|
|
212
221
|
]);
|
|
213
222
|
if (state === null ||
|
|
214
223
|
track === null ||
|
|
@@ -217,6 +226,6 @@ const EasingInspector = ({ selection }) => {
|
|
|
217
226
|
return jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Easing unavailable" });
|
|
218
227
|
}
|
|
219
228
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
|
|
220
|
-
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorSections, { track: track }), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(KeyframeSettings_1.KeyframeSettings, { update: easingUpdate }), canAddKeyframeAtPlayhead ? (jsx_runtime_1.jsx(common_1.
|
|
229
|
+
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorSections, { track: track }), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(EasingEditorModal_1.EasingEditor, { state: state, renderHeader: renderHeader }, (0, TimelineSelection_1.getTimelineSelectionKey)(currentEasingSelection)), jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(KeyframeSettings_1.KeyframeSettings, { update: easingUpdate }), canAddKeyframeAtPlayhead ? (jsx_runtime_1.jsx(common_1.InspectorQuickActionsSection, { children: jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: addKeyframeDisabled, onClick: onAddKeyframeAtPlayhead, renderIcon: (color) => (jsx_runtime_1.jsx(plus_1.Plus, { color: color, style: addKeyframeIcon })), children: `Add keyframe at ${addKeyframeTime}` }) })) : null] }));
|
|
221
230
|
};
|
|
222
231
|
exports.EasingInspector = EasingInspector;
|
|
@@ -13,6 +13,7 @@ const InputDragger_1 = require("../NewComposition/InputDragger");
|
|
|
13
13
|
const call_delete_keyframe_1 = require("../Timeline/call-delete-keyframe");
|
|
14
14
|
const call_move_keyframe_1 = require("../Timeline/call-move-keyframe");
|
|
15
15
|
const get_easing_selection_after_keyframe_delete_1 = require("../Timeline/get-easing-selection-after-keyframe-delete");
|
|
16
|
+
const get_timeline_keyframes_1 = require("../Timeline/get-timeline-keyframes");
|
|
16
17
|
const imperative_state_1 = require("../Timeline/imperative-state");
|
|
17
18
|
const parse_keyframe_field_from_node_path_1 = require("../Timeline/parse-keyframe-field-from-node-path");
|
|
18
19
|
const TimelineEffectPropItem_1 = require("../Timeline/TimelineEffectPropItem");
|
|
@@ -80,7 +81,6 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
80
81
|
}
|
|
81
82
|
const nodePath = selection.nodePathInfo.sequenceSubscriptionKey;
|
|
82
83
|
const { keyframeDisplayOffset } = track;
|
|
83
|
-
const sourceFrame = selection.frame - keyframeDisplayOffset;
|
|
84
84
|
if (keyframeField.type === 'sequence') {
|
|
85
85
|
const sequenceFields = (0, timeline_layout_1.getFieldsToShow)({
|
|
86
86
|
schema: track.sequence.controls.schema,
|
|
@@ -100,11 +100,18 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
100
100
|
field: sequenceField,
|
|
101
101
|
fieldLabel: (_d = sequenceField.description) !== null && _d !== void 0 ? _d : sequenceField.key,
|
|
102
102
|
fileName: nodePath.absolutePath,
|
|
103
|
-
keyframeDisplayOffset,
|
|
103
|
+
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
104
|
+
propStatus: sequencePropStatus,
|
|
105
|
+
keyframeDisplayOffset,
|
|
106
|
+
}),
|
|
104
107
|
nodePath,
|
|
105
108
|
propStatus: sequencePropStatus,
|
|
106
109
|
schema: track.sequence.controls.schema,
|
|
107
|
-
sourceFrame
|
|
110
|
+
sourceFrame: selection.frame -
|
|
111
|
+
(0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
112
|
+
propStatus: sequencePropStatus,
|
|
113
|
+
keyframeDisplayOffset,
|
|
114
|
+
}),
|
|
108
115
|
};
|
|
109
116
|
}
|
|
110
117
|
const effect = track.sequence.effects[keyframeField.effectIndex];
|
|
@@ -136,11 +143,18 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
136
143
|
field: effectField,
|
|
137
144
|
fieldLabel: (_g = effectField.description) !== null && _g !== void 0 ? _g : effectField.key,
|
|
138
145
|
fileName: nodePath.absolutePath,
|
|
139
|
-
keyframeDisplayOffset,
|
|
146
|
+
keyframeDisplayOffset: (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
147
|
+
propStatus: effectPropStatus,
|
|
148
|
+
keyframeDisplayOffset,
|
|
149
|
+
}),
|
|
140
150
|
nodePath,
|
|
141
151
|
propStatus: effectPropStatus,
|
|
142
152
|
schema: effect.schema,
|
|
143
|
-
sourceFrame
|
|
153
|
+
sourceFrame: selection.frame -
|
|
154
|
+
(0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
155
|
+
propStatus: effectPropStatus,
|
|
156
|
+
keyframeDisplayOffset,
|
|
157
|
+
}),
|
|
144
158
|
validatedLocation: {
|
|
145
159
|
source: nodePath.absolutePath,
|
|
146
160
|
line: 1,
|
|
@@ -329,8 +343,8 @@ const KeyframeInspector = ({ selection }) => {
|
|
|
329
343
|
frame: keyframe.frame + details.keyframeDisplayOffset,
|
|
330
344
|
})), nodePathInfo: selection.nodePathInfo }), jsx_runtime_1.jsxs("div", { style: styles_1.detailsWithInlineAction, children: [
|
|
331
345
|
jsx_runtime_1.jsxs("div", { style: styles_1.detailsBeforeInlineAction, children: [
|
|
332
|
-
jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Frame", children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: draftFrame, status: "ok", onValueChange: onFrameChange, onValueChangeEnd: onFrameChangeEnd, onTextChange: () => undefined, min: 0, max: Math.max(0, videoConfig.durationInFrames - 1), step: 1, formatter: (value) => String(Math.round(Number(value))), rightAlign: true, small: true }) }), jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorRow, children: jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: details.fieldLabel, children: jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorValue, children: details.type === 'sequence' ? (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequenceKeyframedValue, { field: details.field, fileName: details.fileName, nodePath: details.nodePath, schema: details.schema, propStatus: details.propStatus, sourceFrame: details.sourceFrame })) : (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropValue, { field: details.field, nodePath: details.nodePath, validatedLocation: details.validatedLocation, sourceFrame: details.sourceFrame })) }) }) })
|
|
333
|
-
] }), jsx_runtime_1.jsx(common_1.
|
|
346
|
+
jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Frame", children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: draftFrame, status: "ok", onValueChange: onFrameChange, onValueChangeEnd: onFrameChangeEnd, onTextChange: () => undefined, min: 0, max: Math.max(0, videoConfig.durationInFrames - 1), step: 1, formatter: (value) => String(Math.round(Number(value))), rightAlign: true, small: true }) }), jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorRow, children: jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: details.fieldLabel, children: jsx_runtime_1.jsx("div", { style: styles_1.keyframeEditorValue, children: details.type === 'sequence' ? (jsx_runtime_1.jsx(TimelineSequencePropItem_1.TimelineSequenceKeyframedValue, { field: details.field, fileName: details.fileName, nodePath: details.nodePath, schema: details.schema, propStatus: details.propStatus, sourceFrame: details.sourceFrame })) : (jsx_runtime_1.jsx(TimelineEffectPropItem_1.TimelineEffectPropValue, { field: details.field, nodePath: details.nodePath, validatedLocation: details.validatedLocation, sourceFrame: details.sourceFrame, runtimeValueStore: null })) }) }) })
|
|
347
|
+
] }), jsx_runtime_1.jsx(common_1.InspectorQuickActionsSection, { children: jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: removeDisabled, onClick: onRemoveKeyframe, renderIcon: (color) => jsx_runtime_1.jsx(TrashIcon, { color: color }), children: "Remove keyframe" }) })
|
|
334
348
|
] })
|
|
335
349
|
] }));
|
|
336
350
|
};
|
|
@@ -95,7 +95,7 @@ const SequenceInspectorHeader = ({ sourceLocation, track }) => {
|
|
|
95
95
|
saveName(newName).catch(() => undefined);
|
|
96
96
|
}, [saveName]);
|
|
97
97
|
return (jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: true, padding: "4px 0", children: jsx_runtime_1.jsxs(InspectorLocationCopy_1.InspectorLocationCopy, { location: sourceLocation.validatedLocation, name: componentName !== null && componentName !== void 0 ? componentName : null, openInEditorLocation: sourceLocation.validatedLocation, children: [
|
|
98
|
-
jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename, size: "inspector" }), documentationLink ? (jsx_runtime_1.jsx(common_1.
|
|
98
|
+
jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: sequenceDisplayName, canRename: canRename, onCommit: onRename, size: "inspector" }), documentationLink ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, style: defaultCursor, size: "compact", title: "Open component docs", onClick: openDocumentationLink, children: componentName })) : (jsx_runtime_1.jsx("div", { style: subtitleStyle, children: componentName })), jsx_runtime_1.jsx(InspectorSourceLocation_1.InspectorSourceLocation, { location: sourceLocation.validatedLocation, canOpen: sourceLocation.canOpenInEditor, onOpen: sourceLocation.openFileLocation, renderIcon: renderReactIcon, size: "quick-action" })
|
|
99
99
|
] }) }));
|
|
100
100
|
};
|
|
101
101
|
exports.SequenceInspectorHeader = SequenceInspectorHeader;
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const client_id_1 = require("../../helpers/client-id");
|
|
8
8
|
const interactivity_enabled_1 = require("../../helpers/interactivity-enabled");
|
|
9
|
+
const audio_1 = require("../../icons/audio");
|
|
9
10
|
const duplicate_1 = require("../../icons/duplicate");
|
|
10
11
|
const scissors_1 = require("../../icons/scissors");
|
|
11
12
|
const snowflake_1 = require("../../icons/snowflake");
|
|
@@ -13,6 +14,8 @@ const trash_1 = require("../../icons/trash");
|
|
|
13
14
|
const ConfirmationDialog_1 = require("../ConfirmationDialog");
|
|
14
15
|
const InspectorSequenceSection_1 = require("../InspectorSequenceSection");
|
|
15
16
|
const is_menu_item_1 = require("../Menu/is-menu-item");
|
|
17
|
+
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
18
|
+
const split_video_from_audio_api_1 = require("../split-video-from-audio-api");
|
|
16
19
|
const delete_selected_timeline_item_1 = require("../Timeline/delete-selected-timeline-item");
|
|
17
20
|
const duplicate_selected_timeline_item_1 = require("../Timeline/duplicate-selected-timeline-item");
|
|
18
21
|
const split_selected_timeline_item_1 = require("../Timeline/split-selected-timeline-item");
|
|
@@ -34,7 +37,7 @@ const largeActionIconStyle = {
|
|
|
34
37
|
height: 20,
|
|
35
38
|
width: 20,
|
|
36
39
|
};
|
|
37
|
-
const
|
|
40
|
+
const SplitSequenceQuickAction = ({ selection, track }) => {
|
|
38
41
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
39
42
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
40
43
|
const sequencePropStatuses = (0, react_1.useMemo)(() => remotion_1.Internals.getPropStatusesCtx(propStatuses, selection.nodePathInfo.sequenceSubscriptionKey), [propStatuses, selection]);
|
|
@@ -63,9 +66,9 @@ const SplitSequenceAction = ({ selection, track }) => {
|
|
|
63
66
|
: eligibility.canSplit
|
|
64
67
|
? undefined
|
|
65
68
|
: eligibility.reason;
|
|
66
|
-
return (jsx_runtime_1.jsx(common_1.
|
|
69
|
+
return (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canSplit, onClick: onSplit, title: disabledReason, renderIcon: (color) => (jsx_runtime_1.jsx(scissors_1.ScissorsIcon, { style: actionIconStyle, color: color })), children: "Split clip" }));
|
|
67
70
|
};
|
|
68
|
-
const
|
|
71
|
+
const SequenceSourceQuickActions = ({ selection, track, validatedSource }) => {
|
|
69
72
|
const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
70
73
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
71
74
|
const { propStatuses } = (0, react_1.useContext)(remotion_1.Internals.VisualModePropStatusesContext);
|
|
@@ -97,7 +100,33 @@ const SequenceSourceActions = ({ selection, track, validatedSource }) => {
|
|
|
97
100
|
}
|
|
98
101
|
(0, delete_selected_timeline_item_1.deleteSequencesFromSource)([selection.nodePathInfo], confirm).catch(() => undefined);
|
|
99
102
|
}, [confirm, selection.nodePathInfo, sourceActionsDisabled]);
|
|
100
|
-
|
|
103
|
+
const splitVideoFromAudioDisabledReason = sourceActionsDisabled
|
|
104
|
+
? 'Studio is read-only'
|
|
105
|
+
: selection.nodePathInfo.numberOfSequencesWithThisNodePath > 1
|
|
106
|
+
? 'Programmatically duplicated sequences cannot be split from source'
|
|
107
|
+
: undefined;
|
|
108
|
+
const onSplitVideoFromAudio = (0, react_1.useCallback)(() => {
|
|
109
|
+
if (splitVideoFromAudioDisabledReason !== undefined) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const nodePath = selection.nodePathInfo.sequenceSubscriptionKey;
|
|
113
|
+
(0, split_video_from_audio_api_1.splitVideoFromAudio)({
|
|
114
|
+
fileName: nodePath.absolutePath,
|
|
115
|
+
nodePath: nodePath.nodePath,
|
|
116
|
+
})
|
|
117
|
+
.then((result) => {
|
|
118
|
+
if (result.success) {
|
|
119
|
+
(0, NotificationCenter_1.showNotification)('Split video from audio', 2000);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
.catch((err) => {
|
|
126
|
+
(0, NotificationCenter_1.showNotification)(err.message, 4000);
|
|
127
|
+
});
|
|
128
|
+
}, [selection.nodePathInfo, splitVideoFromAudioDisabledReason]);
|
|
129
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [(freezeFrameMenuItem === null || freezeFrameMenuItem === void 0 ? void 0 : freezeFrameMenuItem.type) === 'item' ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: Boolean(freezeFrameMenuItem.disabled), onClick: () => freezeFrameMenuItem.onClick(freezeFrameMenuItem.id, null), renderIcon: (color) => (jsx_runtime_1.jsx(snowflake_1.SnowflakeIcon, { style: largeActionIconStyle, color: color })), children: freezeFrameMenuItem.label })) : null, track.sequence.type === 'video' ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: splitVideoFromAudioDisabledReason !== undefined, onClick: onSplitVideoFromAudio, title: splitVideoFromAudioDisabledReason, renderIcon: (color) => (jsx_runtime_1.jsx(audio_1.AudioIcon, { style: actionIconStyle, color: color })), children: "Split video from audio" })) : null, jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: sourceActionsDisabled, onClick: onDuplicate, renderIcon: (color) => (jsx_runtime_1.jsx(duplicate_1.DuplicateIcon, { style: largeActionIconStyle, color: color })), children: "Duplicate" }), jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: sourceActionsDisabled, onClick: onDelete, renderIcon: (color) => (jsx_runtime_1.jsx(trash_1.TrashIcon, { style: actionIconStyle, color: color })), children: "Delete" })] }));
|
|
101
130
|
};
|
|
102
131
|
const SequenceExpandedInspector = ({ track, readOnlyStudio }) => {
|
|
103
132
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
@@ -144,8 +173,8 @@ const SequenceExpandedInspector = ({ track, readOnlyStudio }) => {
|
|
|
144
173
|
return (jsx_runtime_1.jsxs("div", { style: styles_1.selectedContainer, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, onPointerDown: selectSequenceOnInspectorPointerDown, children: [
|
|
145
174
|
jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorHeader, { sourceLocation: sourceLocation, track: track }, stackKey !== null && stackKey !== void 0 ? stackKey : track.sequence.id), jsx_runtime_1.jsx(SequenceInspectorHeader_1.SequenceInspectorDuplicationSection, { track: track }), connectedCompositions.length > 0 ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
146
175
|
jsx_runtime_1.jsx(common_1.InspectorSectionDivider, {}), jsx_runtime_1.jsx(ConnectedCompositionsSection_1.ConnectedCompositionsSection, { connectedCompositions: connectedCompositions })
|
|
147
|
-
] })) : null, validatedLocation ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.jsxs(common_1.
|
|
148
|
-
jsx_runtime_1.jsx(
|
|
176
|
+
] })) : null, validatedLocation ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(InspectorSequenceSection_1.InspectorSequenceSection, { sequence: track.sequence, readOnlyStudio: readOnlyStudio, validatedLocation: validatedLocation, nodePathInfo: track.nodePathInfo, keyframeDisplayOffset: track.keyframeDisplayOffset, renderTransformControls: () => jsx_runtime_1.jsx(AlignmentControls_1.AlignmentControls, { track: track }) }), jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [
|
|
177
|
+
jsx_runtime_1.jsx(SplitSequenceQuickAction, { selection: sequenceSelection, track: track }), jsx_runtime_1.jsx(SequenceSourceQuickActions, { selection: sequenceSelection, track: track, validatedSource: validatedLocation.source })
|
|
149
178
|
] })
|
|
150
179
|
] })) : (jsx_runtime_1.jsx(common_1.InspectorMessage, { children: "Source controls unavailable" }))] }));
|
|
151
180
|
};
|
|
@@ -4,7 +4,7 @@ export declare const InspectorSectionHeader: React.FC<{
|
|
|
4
4
|
readonly children: React.ReactNode;
|
|
5
5
|
}>;
|
|
6
6
|
export declare const InspectorSectionDivider: React.FC;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const InspectorQuickActionsSection: React.FC<{
|
|
8
8
|
readonly children: React.ReactNode;
|
|
9
9
|
}>;
|
|
10
10
|
export declare const InspectorSection: React.FC<{
|
|
@@ -24,13 +24,13 @@ export declare const InspectorDetailRow: React.FC<{
|
|
|
24
24
|
readonly label: React.ReactNode | ((hovered: boolean) => React.ReactNode);
|
|
25
25
|
readonly children: React.ReactNode;
|
|
26
26
|
}>;
|
|
27
|
-
export type
|
|
27
|
+
export type InspectorQuickActionSegment = {
|
|
28
28
|
readonly disabled: boolean;
|
|
29
29
|
readonly onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
30
30
|
readonly renderIcon: (color: string) => React.ReactNode;
|
|
31
31
|
readonly title?: string;
|
|
32
32
|
};
|
|
33
|
-
export type
|
|
33
|
+
export type InspectorQuickActionProps = {
|
|
34
34
|
readonly children: React.ReactNode;
|
|
35
35
|
readonly disabled: boolean;
|
|
36
36
|
readonly iconContainerStyle?: React.CSSProperties;
|
|
@@ -43,10 +43,10 @@ export type InspectorInlineActionProps = {
|
|
|
43
43
|
readonly type: 'single';
|
|
44
44
|
} | {
|
|
45
45
|
readonly type: 'segmented';
|
|
46
|
-
readonly trailing:
|
|
46
|
+
readonly trailing: InspectorQuickActionSegment;
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
export declare const
|
|
49
|
+
export declare const InspectorQuickAction: React.FC<InspectorQuickActionProps>;
|
|
50
50
|
export declare const InspectorDefaultPropsWarnings: React.FC<{
|
|
51
51
|
readonly warnings: RenderModalWarning[];
|
|
52
52
|
}>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.InspectorDefaultPropsWarnings = exports.
|
|
6
|
+
exports.InspectorDefaultPropsWarnings = exports.InspectorQuickAction = exports.InspectorDetailRow = exports.InspectorMessage = exports.InspectorBackAction = exports.InspectorSection = exports.InspectorQuickActionsSection = exports.InspectorSectionDivider = exports.InspectorSectionHeader = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const colors_1 = require("../../helpers/colors");
|
|
@@ -16,10 +16,10 @@ const InspectorSectionHeader = ({ children }) => jsx_runtime_1.jsx("div", { styl
|
|
|
16
16
|
exports.InspectorSectionHeader = InspectorSectionHeader;
|
|
17
17
|
const InspectorSectionDivider = () => (jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionDivider }));
|
|
18
18
|
exports.InspectorSectionDivider = InspectorSectionDivider;
|
|
19
|
-
const
|
|
20
|
-
jsx_runtime_1.jsx(exports.InspectorSectionDivider, {}), jsx_runtime_1.jsx("div", { style: styles_1.
|
|
19
|
+
const InspectorQuickActionsSection = ({ children }) => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
20
|
+
jsx_runtime_1.jsx(exports.InspectorSectionDivider, {}), jsx_runtime_1.jsx("div", { style: styles_1.inspectorQuickActionsSection, children: children })
|
|
21
21
|
] }));
|
|
22
|
-
exports.
|
|
22
|
+
exports.InspectorQuickActionsSection = InspectorQuickActionsSection;
|
|
23
23
|
const InspectorSection = ({ children, header }) => {
|
|
24
24
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
25
25
|
jsx_runtime_1.jsx(exports.InspectorSectionDivider, {}), jsx_runtime_1.jsx(exports.InspectorSectionHeader, { children: header }), children === null ? null : (jsx_runtime_1.jsx("div", { style: styles_1.inspectorSectionBody, children: children }))] }));
|
|
@@ -34,7 +34,7 @@ const BackArrow = ({ color }) => {
|
|
|
34
34
|
return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 512 512", style: backArrowIcon, children: jsx_runtime_1.jsx("path", { d: "M7 239c-9.4 9.4-9.4 24.6 0 33.9L175 441c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L81.9 280 488 280c13.3 0 24-10.7 24-24s-10.7-24-24-24L81.9 232 209 105c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L7 239z", fill: color }) }));
|
|
35
35
|
};
|
|
36
36
|
const InspectorBackAction = ({ children, disabled, onClick, title }) => {
|
|
37
|
-
return (jsx_runtime_1.jsx("div", { style: styles_1.
|
|
37
|
+
return (jsx_runtime_1.jsx("div", { style: styles_1.inspectorQuickActionsSection, children: jsx_runtime_1.jsx(exports.InspectorQuickAction, { disabled: disabled, onClick: onClick, renderIcon: (color) => jsx_runtime_1.jsx(BackArrow, { color: color }), title: title, children: children }) }));
|
|
38
38
|
};
|
|
39
39
|
exports.InspectorBackAction = InspectorBackAction;
|
|
40
40
|
const InspectorMessage = ({ children }) => jsx_runtime_1.jsx("div", { style: styles_1.centeredMessage, children: children });
|
|
@@ -115,7 +115,7 @@ const segmentedTrailingAction = {
|
|
|
115
115
|
padding: 0,
|
|
116
116
|
width: 28,
|
|
117
117
|
};
|
|
118
|
-
const
|
|
118
|
+
const InspectorQuickAction = ({ children, disabled, iconContainerStyle, onClick, renderIcon, size = 'default', style, title, variant = { type: 'single' }, }) => {
|
|
119
119
|
const isSegmented = variant.type === 'segmented';
|
|
120
120
|
// A non-clickable single action (onClick === null) never shows a hover
|
|
121
121
|
// effect. In the segmented variant, the main segment highlights whenever
|
|
@@ -137,7 +137,7 @@ const InspectorInlineAction = ({ children, disabled, iconContainerStyle, onClick
|
|
|
137
137
|
}), [disabled, showsHover, isSegmented, size, style]);
|
|
138
138
|
const mainContent = (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [renderIcon ? (jsx_runtime_1.jsx("span", { style: { ...inlineLabelIcon, ...iconContainerStyle }, children: renderIcon(colors_1.CURRENT_COLOR) })) : null, jsx_runtime_1.jsx("span", { style: inlineLabelText, children: children })
|
|
139
139
|
] }));
|
|
140
|
-
const mainAction = onClick ? (jsx_runtime_1.jsx("button", { className: `__remotion-inspector-
|
|
140
|
+
const mainAction = onClick ? (jsx_runtime_1.jsx("button", { className: `__remotion-inspector-quick-action ${hoverable_1.HOVERABLE_CLASS_NAME}`, type: "button", disabled: disabled, style: buttonStyle, title: title, onClick: onClick, children: mainContent })) : (jsx_runtime_1.jsx("div", { className: hoverable_1.HOVERABLE_CLASS_NAME, style: buttonStyle, title: title, children: mainContent }));
|
|
141
141
|
if (variant.type === 'segmented') {
|
|
142
142
|
const trailingStyle = {
|
|
143
143
|
...segmentedTrailingAction,
|
|
@@ -159,7 +159,7 @@ const InspectorInlineAction = ({ children, disabled, iconContainerStyle, onClick
|
|
|
159
159
|
}
|
|
160
160
|
return mainAction;
|
|
161
161
|
};
|
|
162
|
-
exports.
|
|
162
|
+
exports.InspectorQuickAction = InspectorQuickAction;
|
|
163
163
|
const InspectorDefaultPropsWarnings = ({ warnings }) => {
|
|
164
164
|
return (jsx_runtime_1.jsx("div", { style: styles_1.defaultPropsWarningMessages, children: warnings.map((warning) => (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: warning.message, align: "flex-start", type: "warning", size: "compact", action: warning.resolveLink ? (jsx_runtime_1.jsx("a", { href: warning.resolveLink, target: "_blank", rel: "noopener noreferrer", style: styles_1.resolveLinkStyle, children: "Resolve" })) : null }, warning.id))) }));
|
|
165
165
|
};
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getEasingSelectionFromCurrentKeyframes = void 0;
|
|
4
|
+
const get_timeline_keyframes_1 = require("../Timeline/get-timeline-keyframes");
|
|
4
5
|
const getEasingSelectionFromCurrentKeyframes = ({ keyframeDisplayOffset, nodePathInfo, propStatus, segmentIndex, }) => {
|
|
5
6
|
const fromKeyframe = propStatus.keyframes[segmentIndex];
|
|
6
7
|
const toKeyframe = propStatus.keyframes[segmentIndex + 1];
|
|
7
8
|
if (!fromKeyframe || !toKeyframe) {
|
|
8
9
|
return null;
|
|
9
10
|
}
|
|
11
|
+
const resolvedKeyframeDisplayOffset = (0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
12
|
+
propStatus,
|
|
13
|
+
keyframeDisplayOffset,
|
|
14
|
+
});
|
|
10
15
|
return {
|
|
11
16
|
type: 'easing',
|
|
12
17
|
nodePathInfo,
|
|
13
|
-
fromFrame: fromKeyframe.frame +
|
|
14
|
-
toFrame: toKeyframe.frame +
|
|
18
|
+
fromFrame: fromKeyframe.frame + resolvedKeyframeDisplayOffset,
|
|
19
|
+
toFrame: toKeyframe.frame + resolvedKeyframeDisplayOffset,
|
|
15
20
|
segmentIndex,
|
|
16
21
|
};
|
|
17
22
|
};
|
|
@@ -4,6 +4,7 @@ export type SmartCollapsibleInspectorGroup = Extract<SchemaFieldGroup, 'backgrou
|
|
|
4
4
|
export type InspectorSectionActivity = 'active' | 'inactive' | 'unknown';
|
|
5
5
|
type InspectorSectionPropStatus = {
|
|
6
6
|
readonly status: 'static';
|
|
7
|
+
readonly keyframeDisplayOffsetAdjustment: number | null;
|
|
7
8
|
readonly codeValue: unknown;
|
|
8
9
|
} | {
|
|
9
10
|
readonly status: 'computed' | 'keyframed';
|
|
@@ -20,7 +20,7 @@ export declare const selectedContainer: React.CSSProperties;
|
|
|
20
20
|
export declare const centeredMessage: React.CSSProperties;
|
|
21
21
|
export declare const detailsContainer: React.CSSProperties;
|
|
22
22
|
export declare const detailsWithInlineAction: React.CSSProperties;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const inspectorQuickActionsSection: React.CSSProperties;
|
|
24
24
|
export declare const detailsBeforeInlineAction: React.CSSProperties;
|
|
25
25
|
export declare const guideDetailsContainer: React.CSSProperties;
|
|
26
26
|
export declare const detailRow: React.CSSProperties;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.keyframeEditorValue = exports.keyframeEditorRow = exports.detailValue = exports.detailLabel = exports.detailRow = exports.guideDetailsContainer = exports.detailsBeforeInlineAction = exports.
|
|
3
|
+
exports.keyframeEditorValue = exports.keyframeEditorRow = exports.detailValue = exports.detailLabel = exports.detailRow = exports.guideDetailsContainer = exports.detailsBeforeInlineAction = exports.inspectorQuickActionsSection = exports.detailsWithInlineAction = exports.detailsContainer = exports.centeredMessage = exports.selectedContainer = exports.resolveLinkStyle = exports.defaultPropsWarningMessages = exports.defaultPropsWarningContainer = exports.sectionHeaderEnd = exports.sectionHeaderStart = exports.sectionHeaderTitle = exports.sectionHeaderRow = exports.sequenceHeaderSubtitle = exports.inspectorSectionBody = exports.sectionHeader = exports.sequenceHeaderDivider = exports.inspectorSectionDivider = exports.inspectorOverviewSection = exports.compositionVisualControlsSection = exports.compositionDefaultPropsSection = 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 = {
|
|
@@ -14,6 +14,7 @@ exports.container = {
|
|
|
14
14
|
};
|
|
15
15
|
exports.scrollableContainer = {
|
|
16
16
|
...exports.container,
|
|
17
|
+
overflowX: 'hidden',
|
|
17
18
|
overflowY: 'auto',
|
|
18
19
|
};
|
|
19
20
|
exports.compositionDefaultPropsSection = {
|
|
@@ -127,6 +128,7 @@ exports.selectedContainer = {
|
|
|
127
128
|
backgroundColor: colors_1.BACKGROUND,
|
|
128
129
|
flex: 1,
|
|
129
130
|
minHeight: 0,
|
|
131
|
+
overflowX: 'hidden',
|
|
130
132
|
overflowY: 'auto',
|
|
131
133
|
};
|
|
132
134
|
exports.centeredMessage = {
|
|
@@ -145,7 +147,7 @@ exports.detailsContainer = {
|
|
|
145
147
|
exports.detailsWithInlineAction = {
|
|
146
148
|
paddingBottom: InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING,
|
|
147
149
|
};
|
|
148
|
-
exports.
|
|
150
|
+
exports.inspectorQuickActionsSection = {
|
|
149
151
|
padding: '4px 0',
|
|
150
152
|
};
|
|
151
153
|
exports.detailsBeforeInlineAction = {
|
|
@@ -5,5 +5,5 @@ export declare const InspectorSourceLocation: React.FC<{
|
|
|
5
5
|
readonly canOpen: boolean;
|
|
6
6
|
readonly onOpen: () => void;
|
|
7
7
|
readonly renderIcon?: (color: string) => React.ReactNode;
|
|
8
|
-
readonly size?: 'default' | '
|
|
8
|
+
readonly size?: 'default' | 'quick-action';
|
|
9
9
|
}>;
|
|
@@ -81,8 +81,8 @@ const InspectorSourceLocation = ({ location, canOpen, onOpen, renderIcon, size =
|
|
|
81
81
|
if (!label) {
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
|
-
if (size === '
|
|
85
|
-
return (jsx_runtime_1.jsx(common_1.
|
|
84
|
+
if (size === 'quick-action') {
|
|
85
|
+
return (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: !canOpen, onClick: onClick, renderIcon: (iconColor) => renderIcon === null || renderIcon === void 0 ? void 0 : renderIcon(iconColor), size: "compact", title: fileLocation !== null && fileLocation !== void 0 ? fileLocation : undefined, children: label }));
|
|
86
86
|
}
|
|
87
87
|
return (jsx_runtime_1.jsxs("button", { type: "button", style: style, title: fileLocation !== null && fileLocation !== void 0 ? fileLocation : undefined, onClick: onClick, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), children: [renderIcon ? renderIcon(color) : null, jsx_runtime_1.jsx("span", { style: sourceLocationLabelStyle, children: label })
|
|
88
88
|
] }));
|
|
@@ -102,9 +102,9 @@ const LicenseKeyDetailsDisplay = ({ details }) => {
|
|
|
102
102
|
const projectUrl = `${PRO_HOST}/projects/${details.projectSlug}`;
|
|
103
103
|
const usageUrl = `${projectUrl}/usage#client-renders-usage`;
|
|
104
104
|
const hasActiveLicense = (0, exports.hasActiveCompanyLicense)(details);
|
|
105
|
-
return (jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsx(common_1.
|
|
105
|
+
return (jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, onClick: () => window.open(usageUrl, '_blank', 'noopener,noreferrer'), renderIcon: (color) => (jsx_runtime_1.jsx(check_circle_filled_1.CheckCircleFilled, { style: { ...iconStyle, fill: color } })), style: actionStyle, title: "View license usage", children: jsx_runtime_1.jsxs("span", { style: actionContent, children: [
|
|
106
106
|
jsx_runtime_1.jsxs("span", { style: actionText, children: ["Belongs to ", details.projectName] }), jsx_runtime_1.jsx("span", { style: actionLabel, children: "View usage" })
|
|
107
|
-
] }) }), jsx_runtime_1.jsx(common_1.
|
|
107
|
+
] }) }), jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: false, onClick: () => window.open(projectUrl, '_blank', 'noopener,noreferrer'), renderIcon: (color) => hasActiveLicense ? (jsx_runtime_1.jsx(check_circle_filled_1.CheckCircleFilled, { style: { ...iconStyle, fill: color } })) : (jsx_runtime_1.jsx(ErrorIcon, {})), style: actionStyle, title: "Manage Company License", children: jsx_runtime_1.jsxs("span", { style: actionContent, children: [
|
|
108
108
|
jsx_runtime_1.jsx("span", { style: hasActiveLicense ? actionText : inactiveLicenseText, children: hasActiveLicense
|
|
109
109
|
? 'Active Company License'
|
|
110
110
|
: 'No active Company License' }), jsx_runtime_1.jsx("span", { style: actionLabel, children: "Manage" })
|
|
@@ -12,6 +12,7 @@ const modals_1 = require("../state/modals");
|
|
|
12
12
|
const AskAiModal_1 = require("./AskAiModal");
|
|
13
13
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
14
14
|
const EffectPickerModal_1 = require("./EffectPickerModal");
|
|
15
|
+
const FixComputedValueModal_1 = require("./FixComputedValueModal");
|
|
15
16
|
const InstallPackage_1 = require("./InstallPackage");
|
|
16
17
|
const DeleteComposition_1 = require("./NewComposition/DeleteComposition");
|
|
17
18
|
const DeleteFolder_1 = require("./NewComposition/DeleteFolder");
|
|
@@ -49,6 +50,6 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
49
50
|
}, [setSelectedModal, subscribeToEvent]);
|
|
50
51
|
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, canvasCapture: modalContextType.canvasCapture })), 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 === 'settings' && (jsx_runtime_1.jsx(SettingsModal_1.SettingsModal, { initialTab: modalContextType.initialTab, initialPublicLicenseKey: modalContextType.initialPublicLicenseKey }, `${modalContextType.initialTab}-${modalContextType.initialPublicLicenseKey}`)), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
51
52
|
modalContextType.type === 'server-render' &&
|
|
52
|
-
(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, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), 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 })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
53
|
+
(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 === 'fix-computed-value' && (jsx_runtime_1.jsx(FixComputedValueModal_1.FixComputedValueModal, { state: modalContextType })), 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, assetSelection: modalContextType.assetSelection, compositionSelection: modalContextType.compositionSelection })), 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 })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
53
54
|
};
|
|
54
55
|
exports.Modals = Modals;
|
|
@@ -21,7 +21,7 @@ const CodemodFooterPresentation = ({ codemodStatus, disabled, genericSubmitLabel
|
|
|
21
21
|
] })
|
|
22
22
|
] }));
|
|
23
23
|
};
|
|
24
|
-
const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNotification, errorNotification, genericSubmitLabel, submitLabel, onSuccess, fallbackToRootFile = false, applyCodemod, }) => {
|
|
24
|
+
const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNotification, errorNotification, genericSubmitLabel, submitLabel, onSuccess, fallbackToRootFile = false, applyCodemod, applyCodemodForPreview, }) => {
|
|
25
25
|
var _a;
|
|
26
26
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
27
27
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
@@ -79,12 +79,14 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
79
79
|
symbolicatedStack,
|
|
80
80
|
]);
|
|
81
81
|
const getCanApplyCodemod = (0, react_1.useCallback)(async (signal) => {
|
|
82
|
-
const res =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
const res = applyCodemodForPreview
|
|
83
|
+
? await applyCodemodForPreview({ signal, symbolicatedStack })
|
|
84
|
+
: await (0, actions_1.applyCodemod)({
|
|
85
|
+
codemod,
|
|
86
|
+
dryRun: true,
|
|
87
|
+
symbolicatedStack,
|
|
88
|
+
signal,
|
|
89
|
+
});
|
|
88
90
|
if (res.success) {
|
|
89
91
|
setCanApplyCodemod({ type: 'success', diff: res.diff });
|
|
90
92
|
}
|
|
@@ -94,7 +96,7 @@ const CodemodFooter = ({ codemod, stack, valid, loadingNotification, successNoti
|
|
|
94
96
|
error: res.reason,
|
|
95
97
|
});
|
|
96
98
|
}
|
|
97
|
-
}, [codemod, symbolicatedStack]);
|
|
99
|
+
}, [applyCodemodForPreview, codemod, symbolicatedStack]);
|
|
98
100
|
(0, react_1.useEffect)(() => {
|
|
99
101
|
if (!stack) {
|
|
100
102
|
if (fallbackToRootFile) {
|
|
@@ -11,10 +11,10 @@ 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");
|
|
15
14
|
const CodemodFooter_1 = require("./CodemodFooter");
|
|
16
15
|
const ComboBox_1 = require("./ComboBox");
|
|
17
16
|
const DismissableModal_1 = require("./DismissableModal");
|
|
17
|
+
const duplicate_composition_api_1 = require("./duplicate-composition-api");
|
|
18
18
|
const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
|
|
19
19
|
const InputDragger_1 = require("./InputDragger");
|
|
20
20
|
const NewCompDuration_1 = require("./NewCompDuration");
|
|
@@ -203,11 +203,16 @@ const DuplicateCompositionLoaded = ({ initialType }) => {
|
|
|
203
203
|
] })
|
|
204
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: [
|
|
205
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 }) })
|
|
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,
|
|
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, duplicate_composition_api_1.duplicateComposition)({
|
|
207
207
|
codemod,
|
|
208
208
|
dryRun: false,
|
|
209
209
|
signal,
|
|
210
210
|
symbolicatedStack,
|
|
211
|
+
}), applyCodemodForPreview: ({ signal, symbolicatedStack }) => (0, duplicate_composition_api_1.duplicateComposition)({
|
|
212
|
+
codemod,
|
|
213
|
+
dryRun: true,
|
|
214
|
+
signal,
|
|
215
|
+
symbolicatedStack,
|
|
211
216
|
}) }) })
|
|
212
217
|
] })
|
|
213
218
|
] }));
|
|
@@ -160,7 +160,7 @@ const NewCompositionLoaded = ({ canvasCapture, folderName, parentName, stack })
|
|
|
160
160
|
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: null, errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => createCanvasCaptureComposition({
|
|
161
161
|
signal,
|
|
162
162
|
symbolicatedStack,
|
|
163
|
-
}), fallbackToRootFile: true }) })
|
|
163
|
+
}), applyCodemodForPreview: null, fallbackToRootFile: true }) })
|
|
164
164
|
] })
|
|
165
165
|
] }));
|
|
166
166
|
};
|