@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
|
@@ -10,6 +10,7 @@ const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
|
10
10
|
const call_move_keyframe_1 = require("./call-move-keyframe");
|
|
11
11
|
const find_track_for_node_path_info_1 = require("./find-track-for-node-path-info");
|
|
12
12
|
const get_bounded_keyframe_drag_delta_1 = require("./get-bounded-keyframe-drag-delta");
|
|
13
|
+
const get_timeline_keyframes_1 = require("./get-timeline-keyframes");
|
|
13
14
|
const parse_keyframe_field_from_node_path_1 = require("./parse-keyframe-field-from-node-path");
|
|
14
15
|
const TimelineKeyframeDragState_1 = require("./TimelineKeyframeDragState");
|
|
15
16
|
const TimelineSelection_1 = require("./TimelineSelection");
|
|
@@ -101,7 +102,7 @@ const getTimelineSelectionsAfterEasingKeyframeDrag = ({ delta, selections, targe
|
|
|
101
102
|
exports.getTimelineSelectionsAfterEasingKeyframeDrag = getTimelineSelectionsAfterEasingKeyframeDrag;
|
|
102
103
|
const getCodeValueForTarget = ({ propStatuses, nodePath, }) => propStatuses[remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath)];
|
|
103
104
|
const getTimelineKeyframeDragTarget = ({ propStatuses, displayFrame, nodePathInfo, overrideIdsToNodePaths, sequences, }) => {
|
|
104
|
-
var _a, _b;
|
|
105
|
+
var _a, _b, _c;
|
|
105
106
|
const field = (0, parse_keyframe_field_from_node_path_1.parseKeyframeFieldFromNodePath)(nodePathInfo.auxiliaryKeys);
|
|
106
107
|
if (field === null) {
|
|
107
108
|
return null;
|
|
@@ -115,7 +116,6 @@ const getTimelineKeyframeDragTarget = ({ propStatuses, displayFrame, nodePathInf
|
|
|
115
116
|
if (!(sequence === null || sequence === void 0 ? void 0 : sequence.controls)) {
|
|
116
117
|
return null;
|
|
117
118
|
}
|
|
118
|
-
const sourceFrame = displayFrame - ((_b = track === null || track === void 0 ? void 0 : track.keyframeDisplayOffset) !== null && _b !== void 0 ? _b : 0);
|
|
119
119
|
const nodePath = nodePathInfo.sequenceSubscriptionKey;
|
|
120
120
|
const fileName = nodePath.absolutePath;
|
|
121
121
|
const sequenceStatus = getCodeValueForTarget({ propStatuses, nodePath });
|
|
@@ -132,7 +132,12 @@ const getTimelineKeyframeDragTarget = ({ propStatuses, displayFrame, nodePathInf
|
|
|
132
132
|
if ((effectPropStatus === null || effectPropStatus === void 0 ? void 0 : effectPropStatus.status) !== 'keyframed') {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
const effectSourceFrame = displayFrame -
|
|
136
|
+
(0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
137
|
+
propStatus: effectPropStatus,
|
|
138
|
+
keyframeDisplayOffset: (_b = track === null || track === void 0 ? void 0 : track.keyframeDisplayOffset) !== null && _b !== void 0 ? _b : 0,
|
|
139
|
+
});
|
|
140
|
+
if (!effectPropStatus.keyframes.some((keyframe) => keyframe.frame === effectSourceFrame)) {
|
|
136
141
|
return null;
|
|
137
142
|
}
|
|
138
143
|
return {
|
|
@@ -145,13 +150,18 @@ const getTimelineKeyframeDragTarget = ({ propStatuses, displayFrame, nodePathInf
|
|
|
145
150
|
nodePathInfo,
|
|
146
151
|
propStatus: effectPropStatus,
|
|
147
152
|
schema: effect.schema,
|
|
148
|
-
sourceFrame,
|
|
153
|
+
sourceFrame: effectSourceFrame,
|
|
149
154
|
};
|
|
150
155
|
}
|
|
151
156
|
const sequencePropStatus = sequenceStatus.props[field.fieldKey];
|
|
152
157
|
if ((sequencePropStatus === null || sequencePropStatus === void 0 ? void 0 : sequencePropStatus.status) !== 'keyframed') {
|
|
153
158
|
return null;
|
|
154
159
|
}
|
|
160
|
+
const sourceFrame = displayFrame -
|
|
161
|
+
(0, get_timeline_keyframes_1.getKeyframeDisplayOffset)({
|
|
162
|
+
propStatus: sequencePropStatus,
|
|
163
|
+
keyframeDisplayOffset: (_c = track === null || track === void 0 ? void 0 : track.keyframeDisplayOffset) !== null && _c !== void 0 ? _c : 0,
|
|
164
|
+
});
|
|
155
165
|
if (!sequencePropStatus.keyframes.some((keyframe) => keyframe.frame === sourceFrame)) {
|
|
156
166
|
return null;
|
|
157
167
|
}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type UpdateInfo =
|
|
3
|
-
currentVersion: string;
|
|
4
|
-
latestVersion: string;
|
|
5
|
-
updateAvailable: boolean;
|
|
6
|
-
skillsUpdateAvailable: boolean;
|
|
7
|
-
remotionUpgradeSkillAvailable: boolean;
|
|
8
|
-
timedOut: boolean;
|
|
9
|
-
packageManager: PackageManager | 'unknown';
|
|
10
|
-
};
|
|
1
|
+
import type { GetRemotionSkillsInfoResponse, UpdateAvailableResponse } from '@remotion/studio-shared';
|
|
2
|
+
export type UpdateInfo = UpdateAvailableResponse & Pick<GetRemotionSkillsInfoResponse, 'remotionUpgradeSkillAvailable'>;
|
|
11
3
|
export type Bug = {
|
|
12
4
|
title: string;
|
|
13
5
|
description: string;
|
|
@@ -9,6 +9,7 @@ const modals_1 = require("../state/modals");
|
|
|
9
9
|
const z_index_1 = require("../state/z-index");
|
|
10
10
|
const InlineAction_1 = require("./InlineAction");
|
|
11
11
|
const actions_1 = require("./RenderQueue/actions");
|
|
12
|
+
const SettingsContext_1 = require("./SettingsContext");
|
|
12
13
|
const buttonStyle = {
|
|
13
14
|
appearance: 'none',
|
|
14
15
|
border: 'none',
|
|
@@ -28,6 +29,7 @@ const updateIconContainer = {
|
|
|
28
29
|
const UpdateCheck = () => {
|
|
29
30
|
const [info, setInfo] = (0, react_1.useState)(null);
|
|
30
31
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
32
|
+
const { remotionSkillsInfo } = (0, SettingsContext_1.useSettings)();
|
|
31
33
|
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
32
34
|
const [knownBugs, setKnownBugs] = (0, react_1.useState)(null);
|
|
33
35
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
@@ -76,12 +78,16 @@ const UpdateCheck = () => {
|
|
|
76
78
|
};
|
|
77
79
|
}, [checkForBugs, checkForUpdates]);
|
|
78
80
|
const openModal = (0, react_1.useCallback)(() => {
|
|
81
|
+
var _a;
|
|
79
82
|
setSelectedModal({
|
|
80
83
|
type: 'update',
|
|
81
|
-
info:
|
|
84
|
+
info: {
|
|
85
|
+
...info,
|
|
86
|
+
remotionUpgradeSkillAvailable: (_a = remotionSkillsInfo === null || remotionSkillsInfo === void 0 ? void 0 : remotionSkillsInfo.remotionUpgradeSkillAvailable) !== null && _a !== void 0 ? _a : false,
|
|
87
|
+
},
|
|
82
88
|
knownBugs: knownBugs,
|
|
83
89
|
});
|
|
84
|
-
}, [info, knownBugs, setSelectedModal]);
|
|
90
|
+
}, [info, knownBugs, remotionSkillsInfo, setSelectedModal]);
|
|
85
91
|
const dynButtonStyle = (0, react_1.useMemo)(() => {
|
|
86
92
|
return {
|
|
87
93
|
...buttonStyle,
|
|
@@ -3,18 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ClickableFileName = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
6
7
|
const colors_1 = require("../../helpers/colors");
|
|
7
8
|
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
8
9
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
9
10
|
const Fieldset_1 = require("../RenderModal/SchemaEditor/Fieldset");
|
|
10
11
|
const source_attribution_1 = require("../Timeline/TimelineStack/source-attribution");
|
|
12
|
+
const use_default_editor_info_1 = require("../use-default-editor-info");
|
|
11
13
|
const container = {
|
|
12
14
|
paddingLeft: (0, Fieldset_1.getSchemaEditorFieldsetPadding)(),
|
|
13
15
|
paddingTop: (0, Fieldset_1.getSchemaEditorFieldsetPadding)() / 2,
|
|
14
16
|
};
|
|
15
17
|
const ClickableFileName = ({ originalFileName, }) => {
|
|
16
18
|
const [titleHovered, setTitleHovered] = (0, react_1.useState)(false);
|
|
17
|
-
const
|
|
19
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
20
|
+
const { canOpenInEditor, defaultEditorId } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
|
|
21
|
+
const canOpen = canOpenInEditor &&
|
|
22
|
+
defaultEditorId !== null &&
|
|
23
|
+
originalFileName.type === 'loaded';
|
|
24
|
+
const hoverEffect = titleHovered && canOpen;
|
|
18
25
|
const onTitlePointerEnter = (0, react_1.useCallback)(() => {
|
|
19
26
|
setTitleHovered(true);
|
|
20
27
|
}, []);
|
|
@@ -24,19 +31,19 @@ const ClickableFileName = ({ originalFileName, }) => {
|
|
|
24
31
|
const style = (0, react_1.useMemo)(() => {
|
|
25
32
|
return {
|
|
26
33
|
fontSize: 12,
|
|
27
|
-
cursor:
|
|
34
|
+
cursor: canOpen ? 'pointer' : undefined,
|
|
28
35
|
borderBottom: hoverEffect ? colors_1.BORDER_WHITE : 'none',
|
|
29
36
|
color: hoverEffect ? colors_1.WHITE_HEX : colors_1.LIGHT_COLOR,
|
|
30
37
|
};
|
|
31
|
-
}, [
|
|
38
|
+
}, [canOpen, hoverEffect]);
|
|
32
39
|
const onClick = (0, react_1.useCallback)(() => {
|
|
33
|
-
if (originalFileName.type !== 'loaded') {
|
|
40
|
+
if (originalFileName.type !== 'loaded' || !canOpen || !defaultEditorId) {
|
|
34
41
|
return;
|
|
35
42
|
}
|
|
36
|
-
(0, open_in_editor_1.openOriginalPositionInEditor)(originalFileName.originalFileName,
|
|
43
|
+
(0, open_in_editor_1.openOriginalPositionInEditor)(originalFileName.originalFileName, defaultEditorId).catch((err) => {
|
|
37
44
|
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
38
45
|
});
|
|
39
|
-
}, [originalFileName]);
|
|
46
|
+
}, [canOpen, defaultEditorId, originalFileName]);
|
|
40
47
|
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsx("span", { style: style, onClick: onClick, onPointerEnter: onTitlePointerEnter, onPointerLeave: onTitlePointerLeave, children: originalFileName.type === 'loaded'
|
|
41
48
|
? (0, source_attribution_1.getOriginalSourceAttribution)(originalFileName.originalFileName)
|
|
42
49
|
: originalFileName.type === 'loading'
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const no_react_1 = require("remotion/no-react");
|
|
7
7
|
const fast_refresh_context_1 = require("../../fast-refresh-context");
|
|
8
|
+
const browser_studio_operations_1 = require("../../helpers/browser-studio-operations");
|
|
8
9
|
const get_current_edited_value_1 = require("../../visual-controls/get-current-edited-value");
|
|
9
10
|
const VisualControls_1 = require("../../visual-controls/VisualControls");
|
|
10
11
|
const get_zod_if_possible_1 = require("../get-zod-if-possible");
|
|
@@ -35,6 +36,13 @@ const VisualControlHandle = ({ value, keyName }) => {
|
|
|
35
36
|
if (disableSave) {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
39
|
+
// Saving visual control changes goes through
|
|
40
|
+
// /api/apply-visual-control-change, which Browser Studio does not
|
|
41
|
+
// support.
|
|
42
|
+
if ((0, browser_studio_operations_1.getBrowserStudioOperations)()) {
|
|
43
|
+
(0, NotificationCenter_1.showNotification)('Saving visual control changes is not supported in Browser Studio', 4000);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
38
46
|
if (originalFileName.type !== 'loaded') {
|
|
39
47
|
throw new Error('Original file name is not loaded');
|
|
40
48
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { EditorPickerId } from '@remotion/studio-shared';
|
|
1
2
|
import type { SetStateAction } from 'react';
|
|
2
3
|
import type { ResolvedStackLocation } from 'remotion';
|
|
3
4
|
import type { ModalState } from '../state/modals';
|
|
4
5
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
5
|
-
export declare const getCompositionMenuItems: ({ composition, connectionStatus, resolvedLocation, setSelectedModal, closeMenu, readOnlyStudio, includeCompositionManagementItems, }: {
|
|
6
|
+
export declare const getCompositionMenuItems: ({ composition, connectionStatus, resolvedLocation, setSelectedModal, closeMenu, readOnlyStudio, includeCompositionManagementItems, editorId, editorName, }: {
|
|
6
7
|
composition: import("remotion").AnyComposition | null;
|
|
7
8
|
connectionStatus: "connected" | "disconnected" | "init";
|
|
8
9
|
resolvedLocation: ResolvedStackLocation | null;
|
|
@@ -10,6 +11,8 @@ export declare const getCompositionMenuItems: ({ composition, connectionStatus,
|
|
|
10
11
|
closeMenu: () => void;
|
|
11
12
|
readOnlyStudio: boolean;
|
|
12
13
|
includeCompositionManagementItems: boolean;
|
|
14
|
+
editorId: EditorPickerId | null;
|
|
15
|
+
editorName: string | null;
|
|
13
16
|
}) => ComboboxValue[];
|
|
14
17
|
export declare const getCompositionContextMenuItems: (args: Omit<{
|
|
15
18
|
composition: import("remotion").AnyComposition | null;
|
|
@@ -19,6 +22,8 @@ export declare const getCompositionContextMenuItems: (args: Omit<{
|
|
|
19
22
|
closeMenu: () => void;
|
|
20
23
|
readOnlyStudio: boolean;
|
|
21
24
|
includeCompositionManagementItems: boolean;
|
|
25
|
+
editorId: EditorPickerId | null;
|
|
26
|
+
editorName: string | null;
|
|
22
27
|
}, "includeCompositionManagementItems"> & {
|
|
23
28
|
readonly includeCompositionManagementItems: boolean;
|
|
24
29
|
}) => ComboboxValue[];
|
|
@@ -6,13 +6,15 @@ const format_file_location_1 = require("../helpers/format-file-location");
|
|
|
6
6
|
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
7
7
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
8
8
|
const open_in_new_window_1 = require("./open-in-new-window");
|
|
9
|
-
const getCompositionMenuItems = ({ composition, connectionStatus, resolvedLocation, setSelectedModal, closeMenu, readOnlyStudio, includeCompositionManagementItems, }) => {
|
|
10
|
-
const editorName = window.remotion_editorName;
|
|
9
|
+
const getCompositionMenuItems = ({ composition, connectionStatus, resolvedLocation, setSelectedModal, closeMenu, readOnlyStudio, includeCompositionManagementItems, editorId, editorName, }) => {
|
|
11
10
|
const fileLocation = (0, format_file_location_1.formatFileLocation)({
|
|
12
11
|
location: resolvedLocation,
|
|
13
12
|
root: window.remotion_cwd,
|
|
14
13
|
});
|
|
15
|
-
const showInEditorDisabled = !
|
|
14
|
+
const showInEditorDisabled = !editorId ||
|
|
15
|
+
!composition ||
|
|
16
|
+
connectionStatus !== 'connected' ||
|
|
17
|
+
!resolvedLocation;
|
|
16
18
|
const openComponentInEditorDisabled = showInEditorDisabled || !(resolvedLocation === null || resolvedLocation === void 0 ? void 0 : resolvedLocation.source);
|
|
17
19
|
const copyFileLocationDisabled = !composition || !fileLocation;
|
|
18
20
|
return [
|
|
@@ -24,11 +26,11 @@ const getCompositionMenuItems = ({ composition, connectionStatus, resolvedLocati
|
|
|
24
26
|
leftItem: null,
|
|
25
27
|
onClick: async () => {
|
|
26
28
|
closeMenu();
|
|
27
|
-
if (!composition || !resolvedLocation) {
|
|
29
|
+
if (!composition || !resolvedLocation || !editorId) {
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
30
32
|
try {
|
|
31
|
-
await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation,
|
|
33
|
+
await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation, editorId);
|
|
32
34
|
}
|
|
33
35
|
catch (err) {
|
|
34
36
|
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
@@ -49,13 +51,14 @@ const getCompositionMenuItems = ({ composition, connectionStatus, resolvedLocati
|
|
|
49
51
|
leftItem: null,
|
|
50
52
|
onClick: async () => {
|
|
51
53
|
closeMenu();
|
|
52
|
-
if (!composition || !(resolvedLocation === null || resolvedLocation === void 0 ? void 0 : resolvedLocation.source)) {
|
|
54
|
+
if (!composition || !(resolvedLocation === null || resolvedLocation === void 0 ? void 0 : resolvedLocation.source) || !editorId) {
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
57
|
try {
|
|
56
58
|
await (0, open_in_editor_1.openCompositionComponentInEditor)({
|
|
57
59
|
compositionFile: resolvedLocation.source,
|
|
58
60
|
compositionId: composition.id,
|
|
61
|
+
editorId,
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
catch (err) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteJsxNode = void 0;
|
|
4
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
|
+
const call_api_1 = require("./call-api");
|
|
6
|
+
const deleteJsxNode = (request) => {
|
|
7
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
8
|
+
return browserStudioOperations
|
|
9
|
+
? browserStudioOperations.deleteJsxNode(request)
|
|
10
|
+
: (0, call_api_1.callApi)('/api/delete-jsx-node', request);
|
|
11
|
+
};
|
|
12
|
+
exports.deleteJsxNode = deleteJsxNode;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { InsertElementRequest, InsertElementResponse, PrepareElementInstallRequest, PrepareElementInstallResponse } from '@remotion/studio-shared';
|
|
2
|
+
export declare const prepareElementInstall: (request: PrepareElementInstallRequest) => Promise<PrepareElementInstallResponse>;
|
|
3
|
+
export declare const installElement: (request: InsertElementRequest) => Promise<InsertElementResponse>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.installElement = exports.prepareElementInstall = void 0;
|
|
4
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
|
+
const call_api_1 = require("./call-api");
|
|
6
|
+
const prepareElementInstall = (request) => {
|
|
7
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
8
|
+
return browserStudioOperations
|
|
9
|
+
? browserStudioOperations.prepareElementInstall(request)
|
|
10
|
+
: (0, call_api_1.callApi)('/api/prepare-element-install', request);
|
|
11
|
+
};
|
|
12
|
+
exports.prepareElementInstall = prepareElementInstall;
|
|
13
|
+
const installElement = (request) => {
|
|
14
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
15
|
+
return browserStudioOperations
|
|
16
|
+
? browserStudioOperations.insertElement(request)
|
|
17
|
+
: (0, call_api_1.callApi)('/api/insert-element', request);
|
|
18
|
+
};
|
|
19
|
+
exports.installElement = installElement;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import type { EditorPickerId } from '@remotion/studio-shared';
|
|
1
2
|
import type { SetStateAction } from 'react';
|
|
2
3
|
import type { ResolvedStackLocation } from 'remotion';
|
|
3
4
|
import type { ModalState } from '../state/modals';
|
|
4
5
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
5
|
-
export declare const getFolderMenuItems: ({ closeMenu, connectionStatus, folder, readOnlyStudio, resolvedLocation, setSelectedModal, }: {
|
|
6
|
+
export declare const getFolderMenuItems: ({ closeMenu, connectionStatus, folder, readOnlyStudio, resolvedLocation, setSelectedModal, editorId, editorName, }: {
|
|
6
7
|
closeMenu: () => void;
|
|
7
8
|
connectionStatus: "connected" | "disconnected" | "init";
|
|
8
9
|
folder: import("remotion").TFolder;
|
|
9
10
|
readOnlyStudio: boolean;
|
|
10
11
|
resolvedLocation: ResolvedStackLocation | null;
|
|
11
12
|
setSelectedModal: (value: SetStateAction<ModalState | null>) => void;
|
|
13
|
+
editorId: EditorPickerId | null;
|
|
14
|
+
editorName: string | null;
|
|
12
15
|
}) => ComboboxValue[];
|
|
@@ -6,8 +6,7 @@ const format_file_location_1 = require("../helpers/format-file-location");
|
|
|
6
6
|
const get_folder_id_1 = require("../helpers/get-folder-id");
|
|
7
7
|
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
8
8
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
9
|
-
const getFolderMenuItems = ({ closeMenu, connectionStatus, folder, readOnlyStudio, resolvedLocation, setSelectedModal, }) => {
|
|
10
|
-
const editorName = window.remotion_editorName;
|
|
9
|
+
const getFolderMenuItems = ({ closeMenu, connectionStatus, folder, readOnlyStudio, resolvedLocation, setSelectedModal, editorId, editorName, }) => {
|
|
11
10
|
const folderId = (0, get_folder_id_1.getFolderId)({
|
|
12
11
|
folderName: folder.name,
|
|
13
12
|
parentName: folder.parent,
|
|
@@ -16,7 +15,7 @@ const getFolderMenuItems = ({ closeMenu, connectionStatus, folder, readOnlyStudi
|
|
|
16
15
|
location: resolvedLocation,
|
|
17
16
|
root: window.remotion_cwd,
|
|
18
17
|
});
|
|
19
|
-
const showInEditorDisabled = connectionStatus !== 'connected' || !resolvedLocation;
|
|
18
|
+
const showInEditorDisabled = !editorId || connectionStatus !== 'connected' || !resolvedLocation;
|
|
20
19
|
const copyFileLocationDisabled = !fileLocation;
|
|
21
20
|
const codemodDisabled = readOnlyStudio || !folder.stack;
|
|
22
21
|
return [
|
|
@@ -28,11 +27,11 @@ const getFolderMenuItems = ({ closeMenu, connectionStatus, folder, readOnlyStudi
|
|
|
28
27
|
leftItem: null,
|
|
29
28
|
onClick: async () => {
|
|
30
29
|
closeMenu();
|
|
31
|
-
if (!resolvedLocation) {
|
|
30
|
+
if (!resolvedLocation || !editorId) {
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
34
33
|
try {
|
|
35
|
-
await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation,
|
|
34
|
+
await (0, open_in_editor_1.openOriginalPositionInEditor)(resolvedLocation, editorId);
|
|
36
35
|
}
|
|
37
36
|
catch (err) {
|
|
38
37
|
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
@@ -11,7 +11,7 @@ export declare const getOpenInMenuItems: ({ codingAgentInfo, editorDisabled, edi
|
|
|
11
11
|
readonly fileManagerDisabled: boolean;
|
|
12
12
|
readonly folder: boolean;
|
|
13
13
|
readonly location: OriginalPosition | null;
|
|
14
|
-
readonly onConfigureApps: () => void;
|
|
14
|
+
readonly onConfigureApps: (() => void) | null;
|
|
15
15
|
readonly onOpenInCodingAgent: (codingAgentId: "claude-code" | "codex" | "copilot" | "cursor", codingAgentName: string) => void;
|
|
16
16
|
readonly onOpenInEditor: (editorId: EditorPickerId) => void;
|
|
17
17
|
readonly onOpenInFileExplorer: () => void;
|
|
@@ -174,20 +174,22 @@ const getOpenInMenuItems = ({ codingAgentInfo, editorDisabled, editorInfo, exclu
|
|
|
174
174
|
...systemApps,
|
|
175
175
|
]
|
|
176
176
|
: []),
|
|
177
|
-
...(hasCategorizedApps || systemApps.length > 0
|
|
177
|
+
...(onConfigureApps && (hasCategorizedApps || systemApps.length > 0)
|
|
178
178
|
? [{ type: 'divider', id: 'open-in-settings-divider' }]
|
|
179
179
|
: []),
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
180
|
+
onConfigureApps
|
|
181
|
+
? {
|
|
182
|
+
id: 'change-default-apps',
|
|
183
|
+
keyHint: null,
|
|
184
|
+
label: jsx_runtime_1.jsx("span", { style: menuLabel, children: "Change default apps..." }),
|
|
185
|
+
leftItem: null,
|
|
186
|
+
onClick: onConfigureApps,
|
|
187
|
+
quickSwitcherLabel: null,
|
|
188
|
+
subMenu: null,
|
|
189
|
+
type: 'item',
|
|
190
|
+
value: 'change-default-apps',
|
|
191
|
+
}
|
|
192
|
+
: null,
|
|
193
|
+
].filter(no_react_1.NoReactInternals.truthy);
|
|
192
194
|
};
|
|
193
195
|
exports.getOpenInMenuItems = getOpenInMenuItems;
|
|
@@ -6,11 +6,13 @@ const remotion_1 = require("remotion");
|
|
|
6
6
|
const no_react_1 = require("remotion/no-react");
|
|
7
7
|
const get_static_files_1 = require("../api/get-static-files");
|
|
8
8
|
const write_static_file_1 = require("../api/write-static-file");
|
|
9
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
9
10
|
const clipboard_figma_1 = require("../helpers/clipboard-figma");
|
|
10
11
|
const inserted_element_selection_1 = require("../helpers/inserted-element-selection");
|
|
11
12
|
const install_required_package_1 = require("../helpers/install-required-package");
|
|
12
13
|
const use_media_metadata_1 = require("../helpers/use-media-metadata");
|
|
13
14
|
const call_api_1 = require("./call-api");
|
|
15
|
+
const element_install_api_1 = require("./element-install-api");
|
|
14
16
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
15
17
|
const getFromForDrop = ({ durationInFrames, from, preferCompositionStart, }) => {
|
|
16
18
|
if (preferCompositionStart !== true) {
|
|
@@ -494,13 +496,14 @@ const notifyUnsupportedFiles = (unsupportedFiles) => {
|
|
|
494
496
|
};
|
|
495
497
|
const insertCompositionElement = async ({ compositionFile, compositionId, element, from, }) => {
|
|
496
498
|
const requiredPackage = (0, studio_shared_1.getRequiredPackageForInsertableElement)(element);
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
499
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
500
|
+
if (browserStudioOperations === null) {
|
|
501
|
+
await (0, install_required_package_1.installRequiredPackages)(requiredPackage ? [{ name: requiredPackage, version: null }] : []);
|
|
502
|
+
}
|
|
503
|
+
const request = { compositionFile, compositionId, element, from };
|
|
504
|
+
const result = browserStudioOperations
|
|
505
|
+
? await browserStudioOperations.insertJsxElement(request)
|
|
506
|
+
: await (0, call_api_1.callApi)('/api/insert-jsx-element', request);
|
|
504
507
|
if (!result.success) {
|
|
505
508
|
(0, NotificationCenter_1.showNotification)(result.reason, 4000);
|
|
506
509
|
return false;
|
|
@@ -635,6 +638,12 @@ const importAssets = async ({ compositionFile, compositionId, destinationDimensi
|
|
|
635
638
|
};
|
|
636
639
|
exports.importAssets = importAssets;
|
|
637
640
|
const importFigmaClipboard = async ({ compositionFile, compositionId, destinationDimensions, dropPosition, html, }) => {
|
|
641
|
+
// Figma clipboard conversion requires the SVGR-based pipeline in
|
|
642
|
+
// @remotion/studio-server, which Browser Studio does not support.
|
|
643
|
+
if ((0, browser_studio_operations_1.getBrowserStudioOperations)()) {
|
|
644
|
+
(0, NotificationCenter_1.showNotification)('Importing Figma clipboard data is not supported in Browser Studio', 4000);
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
638
647
|
try {
|
|
639
648
|
const converted = await (0, call_api_1.callApi)('/api/convert-figma-clipboard-to-svg', {
|
|
640
649
|
html,
|
|
@@ -925,8 +934,10 @@ const insertComposition = async ({ composition, compositionFile, compositionId,
|
|
|
925
934
|
exports.insertComposition = insertComposition;
|
|
926
935
|
const insertElement = async ({ compositionFile, compositionId, element, expectedFileState, position, from, overwriteExisting, }) => {
|
|
927
936
|
try {
|
|
928
|
-
|
|
929
|
-
|
|
937
|
+
if ((0, browser_studio_operations_1.getBrowserStudioOperations)() === null) {
|
|
938
|
+
await (0, install_required_package_1.installRequiredPackages)(element.dependencies);
|
|
939
|
+
}
|
|
940
|
+
const response = await (0, element_install_api_1.installElement)({
|
|
930
941
|
compositionFile,
|
|
931
942
|
compositionId,
|
|
932
943
|
element,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reorderSequence = void 0;
|
|
4
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
|
+
const call_api_1 = require("./call-api");
|
|
6
|
+
const reorderSequence = (request) => {
|
|
7
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
8
|
+
return browserStudioOperations
|
|
9
|
+
? browserStudioOperations.reorderSequence(request)
|
|
10
|
+
: (0, call_api_1.callApi)('/api/reorder-sequence', request);
|
|
11
|
+
};
|
|
12
|
+
exports.reorderSequence = reorderSequence;
|
|
@@ -3,6 +3,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.unsubscribeFromSequenceProps = exports.subscribeToSequenceProps = exports.saveSequenceProps = void 0;
|
|
4
4
|
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
5
|
const call_api_1 = require("./call-api");
|
|
6
|
+
let pendingSequencePropsSubscriptions = [];
|
|
7
|
+
let sequencePropsSubscriptionTimer = null;
|
|
8
|
+
const flushSequencePropsSubscriptions = () => {
|
|
9
|
+
sequencePropsSubscriptionTimer = null;
|
|
10
|
+
const pending = pendingSequencePropsSubscriptions;
|
|
11
|
+
pendingSequencePropsSubscriptions = [];
|
|
12
|
+
const firstRequest = pending[0].request;
|
|
13
|
+
(0, call_api_1.callApi)('/api/subscribe-to-sequence-props', {
|
|
14
|
+
...firstRequest,
|
|
15
|
+
requests: pending.map(({ request }) => request),
|
|
16
|
+
}).then((response) => {
|
|
17
|
+
if (!Array.isArray(response.results)) {
|
|
18
|
+
pending[0].resolve(response);
|
|
19
|
+
const error = new Error('Legacy single subscription response received for a batched request');
|
|
20
|
+
for (const item of pending.slice(1)) {
|
|
21
|
+
item.reject(error);
|
|
22
|
+
}
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (response.results.length !== pending.length) {
|
|
26
|
+
const error = new Error(`Expected ${pending.length} sequence prop subscription results, got ${response.results.length}`);
|
|
27
|
+
for (const item of pending) {
|
|
28
|
+
item.reject(error);
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
for (let index = 0; index < pending.length; index++) {
|
|
33
|
+
pending[index].resolve(response.results[index]);
|
|
34
|
+
}
|
|
35
|
+
}, (error) => {
|
|
36
|
+
for (const item of pending) {
|
|
37
|
+
item.reject(error);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
|
6
41
|
const saveSequenceProps = (request) => {
|
|
7
42
|
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
8
43
|
return browserStudioOperations
|
|
@@ -12,9 +47,15 @@ const saveSequenceProps = (request) => {
|
|
|
12
47
|
exports.saveSequenceProps = saveSequenceProps;
|
|
13
48
|
const subscribeToSequenceProps = (request) => {
|
|
14
49
|
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
50
|
+
if (browserStudioOperations) {
|
|
51
|
+
return browserStudioOperations.subscribeToSequenceProps(request);
|
|
52
|
+
}
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
pendingSequencePropsSubscriptions.push({ request, resolve, reject });
|
|
55
|
+
if (sequencePropsSubscriptionTimer === null) {
|
|
56
|
+
sequencePropsSubscriptionTimer = setTimeout(flushSequencePropsSubscriptions, 0);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
18
59
|
};
|
|
19
60
|
exports.subscribeToSequenceProps = subscribeToSequenceProps;
|
|
20
61
|
const unsubscribeFromSequenceProps = (request) => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitJsxSequence = void 0;
|
|
4
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
|
+
const call_api_1 = require("./call-api");
|
|
6
|
+
const splitJsxSequence = (request) => {
|
|
7
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
8
|
+
return browserStudioOperations
|
|
9
|
+
? browserStudioOperations.splitJsxSequence(request)
|
|
10
|
+
: (0, call_api_1.callApi)('/api/split-jsx-sequence', request);
|
|
11
|
+
};
|
|
12
|
+
exports.splitJsxSequence = splitJsxSequence;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitVideoFromAudio = void 0;
|
|
4
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
|
+
const call_api_1 = require("./call-api");
|
|
6
|
+
const splitVideoFromAudio = (request) => {
|
|
7
|
+
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
8
|
+
return browserStudioOperations
|
|
9
|
+
? browserStudioOperations.splitVideoFromAudio(request)
|
|
10
|
+
: (0, call_api_1.callApi)('/api/split-video-from-audio', request);
|
|
11
|
+
};
|
|
12
|
+
exports.splitVideoFromAudio = splitVideoFromAudio;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import type { EditorPickerId, GetDefaultEditorInfoResponse } from '@remotion/studio-shared';
|
|
2
2
|
export declare const canUseEditorPicker: (previewServerConnected: boolean) => boolean;
|
|
3
|
+
export declare const canOpenInEditor: (previewServerConnected: boolean) => boolean;
|
|
3
4
|
export declare const getPreferredEditorId: (editorInfo: GetDefaultEditorInfoResponse | null) => EditorPickerId | null;
|
|
5
|
+
export declare const useEditorOpening: (previewServerConnected: boolean) => {
|
|
6
|
+
canConfigureApps: boolean;
|
|
7
|
+
canOpenInEditor: boolean;
|
|
8
|
+
defaultEditorId: EditorPickerId | null;
|
|
9
|
+
defaultEditorName: string | null;
|
|
10
|
+
editorInfo: GetDefaultEditorInfoResponse | null;
|
|
11
|
+
};
|
|
4
12
|
export declare const useDefaultEditorInfo: (enabled: boolean) => GetDefaultEditorInfoResponse | null;
|
|
5
13
|
export declare const useDefaultCodingAgentInfo: (enabled: boolean) => import("@remotion/studio-shared").GetDefaultCodingAgentInfoResponse | null;
|