@remotion/studio 4.0.518 → 4.0.520
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/api/visual-control.js +2 -2
- package/dist/components/AppLaunchButton.d.ts +16 -0
- package/dist/components/AppLaunchButton.js +90 -0
- package/dist/components/AssetSelector.js +7 -6
- package/dist/components/AssetSelectorItem.d.ts +12 -0
- package/dist/components/AssetSelectorItem.js +180 -62
- package/dist/components/AudioWaveform.js +6 -1
- package/dist/components/Button.js +20 -7
- package/dist/components/Canvas.js +117 -92
- package/dist/components/CanvasOrLoading.js +7 -7
- package/dist/components/CodingAgentButton.d.ts +7 -0
- package/dist/components/CodingAgentButton.js +59 -0
- package/dist/components/CompositionContextButton.d.ts +1 -0
- package/dist/components/CompositionContextButton.js +6 -3
- package/dist/components/CompositionSelector.js +21 -20
- package/dist/components/CompositionSelectorItem.js +23 -35
- package/dist/components/ConfigureLicenseModal.js +4 -48
- package/dist/components/CurrentAsset.js +1 -1
- package/dist/components/CurrentCompositionSideEffects.js +5 -0
- package/dist/components/ElementInstallConfirmation.d.ts +2 -10
- package/dist/components/ElementInstallConfirmation.js +339 -32
- package/dist/components/FixComputedValueModal.js +5 -131
- package/dist/components/FpsCounter.js +1 -1
- package/dist/components/FramePersistor.js +1 -1
- package/dist/components/InitialCompositionLoader.js +3 -2
- package/dist/components/InspectorOpenInEditor.js +48 -33
- package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +5 -4
- package/dist/components/InspectorPanel/common.js +1 -0
- package/dist/components/InspectorPanel/styles.js +1 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +5 -8
- package/dist/components/InspectorSequenceSection.js +8 -3
- package/dist/components/InspectorSourceLocation.js +5 -1
- package/dist/components/KnownBugs.d.ts +1 -1
- package/dist/components/KnownBugs.js +1 -1
- package/dist/components/LicenseExplanation.d.ts +2 -0
- package/dist/components/LicenseExplanation.js +63 -0
- package/dist/components/MenuToolbar.js +7 -1
- package/dist/components/Modals.js +1 -2
- package/dist/components/NewComposition/InputDragger.js +29 -2
- package/dist/components/NewComposition/NewCompDuration.js +1 -1
- package/dist/components/NewComposition/NewComposition.d.ts +23 -0
- package/dist/components/NewComposition/NewComposition.js +217 -80
- package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
- package/dist/components/PlayPause.js +2 -13
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +50 -28
- package/dist/components/QuickSwitcher/QuickSwitcherResult.d.ts +14 -1
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +64 -9
- package/dist/components/QuickSwitcher/composition-search.d.ts +16 -0
- package/dist/components/QuickSwitcher/composition-search.js +136 -0
- package/dist/components/RenderQueue/actions.d.ts +1 -0
- package/dist/components/RenderQueue/actions.js +5 -1
- package/dist/components/ResetZoomButton.js +17 -2
- package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
- package/dist/components/SelectedOutlineElement.js +12 -31
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
- package/dist/components/SelectedOutlineOverlay.js +21 -26
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +12 -4
- package/dist/components/SelectedOutlineRenderer.js +88 -21
- package/dist/components/SettingsContext.js +2 -1
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +19 -3
- package/dist/components/SidebarRenderButton.d.ts +1 -0
- package/dist/components/SidebarRenderButton.js +14 -5
- package/dist/components/Timeline/SequencePropsObserver.js +29 -14
- package/dist/components/Timeline/Timeline.js +2 -1
- package/dist/components/Timeline/TimelineAssetField.js +1 -0
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +5 -90
- package/dist/components/Timeline/TimelineDragHandler.js +18 -8
- package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -3
- package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
- package/dist/components/Timeline/TimelinePinchZoom.js +14 -4
- package/dist/components/Timeline/TimelinePlayCursorSyncer.js +8 -4
- package/dist/components/Timeline/TimelineRowChrome.js +4 -2
- package/dist/components/Timeline/TimelineSequence.js +52 -45
- package/dist/components/Timeline/TimelineSequenceItem.js +44 -32
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +3 -3
- package/dist/components/Timeline/TimelineSlider.js +2 -2
- package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
- package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
- package/dist/components/Timeline/TimelineWidthProvider.js +15 -8
- package/dist/components/Timeline/TimelineZoomControls.js +25 -8
- package/dist/components/Timeline/delete-selected-timeline-item.js +2 -2
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
- package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +1 -0
- package/dist/components/Timeline/timeline-scroll-logic.js +21 -17
- package/dist/components/Timeline/use-delete-timeline-items.d.ts +1 -0
- package/dist/components/Timeline/use-delete-timeline-items.js +118 -0
- package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +8 -14
- package/dist/components/TimelineCombobox.js +1 -0
- package/dist/components/UpdateCheck.d.ts +0 -8
- package/dist/components/UpdateCheck.js +7 -54
- package/dist/components/UpdateStatusContext.d.ts +18 -0
- package/dist/components/UpdateStatusContext.js +74 -0
- package/dist/components/UpdatesSettings.d.ts +2 -0
- package/dist/components/UpdatesSettings.js +251 -0
- package/dist/components/WebMcp.js +64 -11
- package/dist/components/ZoomPersistor.js +2 -2
- package/dist/components/composition-drag-data.d.ts +36 -0
- package/dist/components/composition-drag-data.js +232 -0
- package/dist/components/drop-handler-data.d.ts +2 -1
- package/dist/components/drop-handler-data.js +6 -4
- package/dist/components/effect-drag-and-drop.d.ts +2 -5
- package/dist/components/get-open-in-menu-items.d.ts +4 -0
- package/dist/components/get-open-in-menu-items.js +28 -24
- package/dist/components/handle-drop.js +6 -2
- package/dist/components/import-assets.d.ts +5 -13
- package/dist/components/root-composition-menu-items.d.ts +4 -1
- package/dist/components/root-composition-menu-items.js +38 -1
- package/dist/components/selected-outline-geometry.d.ts +21 -2
- package/dist/components/selected-outline-geometry.js +16 -5
- package/dist/components/selected-outline-measurement.d.ts +40 -1
- package/dist/components/selected-outline-measurement.js +239 -1
- package/dist/components/selected-outline-order.d.ts +12 -0
- package/dist/components/selected-outline-order.js +251 -0
- package/dist/components/selected-outline-types.d.ts +15 -2
- package/dist/components/selected-outline-uv.js +106 -3
- package/dist/components/use-configure-default-apps.d.ts +1 -0
- package/dist/components/use-configure-default-apps.js +24 -0
- package/dist/error-overlay/current-error.d.ts +13 -0
- package/dist/error-overlay/current-error.js +21 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
- package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +6 -2
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
- package/dist/esm/chunk-6jf1natv.js +25 -0
- package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
- package/dist/esm/chunk-m0jqdbkr.js +14571 -0
- package/dist/esm/{chunk-7prjt5n5.js → chunk-np6q13k5.js} +18637 -12189
- package/dist/esm/index.mjs +4 -3
- package/dist/esm/internals.mjs +35826 -14822
- package/dist/esm/previewEntry.mjs +40028 -18935
- package/dist/esm/renderEntry.mjs +6 -3
- package/dist/helpers/can-show-updates.d.ts +5 -0
- package/dist/helpers/can-show-updates.js +7 -0
- package/dist/helpers/colors.d.ts +0 -3
- package/dist/helpers/colors.js +2 -5
- package/dist/helpers/create-folder-tree.d.ts +5 -0
- package/dist/helpers/create-folder-tree.js +26 -6
- package/dist/helpers/document-title.d.ts +2 -0
- package/dist/helpers/document-title.js +14 -3
- package/dist/helpers/get-asset-metadata.js +1 -1
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
- package/dist/helpers/get-box-quads-polyfill-internals.js +2403 -0
- package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
- package/dist/helpers/get-box-quads-ponyfill.js +23 -0
- package/dist/helpers/get-git-menu-item.d.ts +5 -0
- package/dist/helpers/get-git-menu-item.js +15 -1
- package/dist/helpers/get-timeline-max-zoom.d.ts +34 -28
- package/dist/helpers/get-timeline-max-zoom.js +46 -29
- package/dist/helpers/hoverable.js +10 -5
- package/dist/helpers/install-fiber-sequence-order-observer.d.ts +37 -0
- package/dist/helpers/install-fiber-sequence-order-observer.js +109 -0
- package/dist/helpers/open-in-editor.js +53 -2
- package/dist/helpers/preview-server-events.js +3 -0
- package/dist/helpers/timeline-layout.d.ts +0 -1
- package/dist/helpers/timeline-layout.js +1 -5
- package/dist/helpers/url-state.d.ts +1 -0
- package/dist/helpers/url-state.js +12 -5
- package/dist/helpers/use-runtime-values.d.ts +1 -1
- package/dist/helpers/use-runtime-values.js +5 -4
- package/dist/helpers/use-sync-external-store.d.ts +3 -0
- package/dist/helpers/use-sync-external-store.js +5 -0
- package/dist/previewEntry.js +2 -0
- package/dist/renderEntry.js +2 -0
- package/dist/state/folders.d.ts +3 -0
- package/dist/state/folders.js +40 -1
- package/dist/state/modals.d.ts +19 -8
- package/dist/state/timeline-sequence-hover.js +3 -2
- package/dist/state/timeline-zoom.d.ts +0 -1
- package/dist/state/timeline-zoom.js +13 -6
- package/package.json +18 -15
- package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
- package/dist/components/UpdateModal/UpdateModal.js +0 -104
- package/dist/helpers/sort-by-nonce-history.d.ts +0 -1
- package/dist/helpers/sort-by-nonce-history.js +0 -6
- /package/dist/components/{UpdateModal/OpenIssueButton.d.ts → OpenIssueButton.d.ts} +0 -0
|
@@ -2,8 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ElementInstallConfirmation = exports.ElementLibraryAddConfirmation = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const react_dom_1 = require("react-dom");
|
|
8
|
+
const remotion_1 = require("remotion");
|
|
9
|
+
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
10
|
+
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
5
11
|
const colors_1 = require("../helpers/colors");
|
|
12
|
+
const hoverable_1 = require("../helpers/hoverable");
|
|
13
|
+
const resolved_stack_to_symbolicated_1 = require("../helpers/resolved-stack-to-symbolicated");
|
|
14
|
+
const use_create_composition_1 = require("../helpers/use-create-composition");
|
|
15
|
+
const validate_new_comp_data_1 = require("../helpers/validate-new-comp-data");
|
|
16
|
+
const z_index_1 = require("../state/z-index");
|
|
17
|
+
const Button_1 = require("./Button");
|
|
18
|
+
const element_install_api_1 = require("./element-install-api");
|
|
19
|
+
const import_assets_1 = require("./import-assets");
|
|
20
|
+
const layout_1 = require("./layout");
|
|
21
|
+
const portals_1 = require("./Menu/portals");
|
|
22
|
+
const ModalButton_1 = require("./ModalButton");
|
|
23
|
+
const ModalContainer_1 = require("./ModalContainer");
|
|
24
|
+
const ModalFooter_1 = require("./ModalFooter");
|
|
25
|
+
const ModalHeader_1 = require("./ModalHeader");
|
|
26
|
+
const NewComposition_1 = require("./NewComposition/NewComposition");
|
|
6
27
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
28
|
+
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
29
|
+
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
7
30
|
const container = {
|
|
8
31
|
display: 'flex',
|
|
9
32
|
flexDirection: 'column',
|
|
@@ -13,6 +36,13 @@ const container = {
|
|
|
13
36
|
fontSize: 13,
|
|
14
37
|
lineHeight: 1.5,
|
|
15
38
|
};
|
|
39
|
+
const dialogContent = {
|
|
40
|
+
...container,
|
|
41
|
+
padding: 16,
|
|
42
|
+
width: 'min(640px, calc(100vw - 40px))',
|
|
43
|
+
maxHeight: 'min(720px, calc(100vh - 140px))',
|
|
44
|
+
overflowY: 'auto',
|
|
45
|
+
};
|
|
16
46
|
const sectionStyle = {
|
|
17
47
|
display: 'flex',
|
|
18
48
|
flexDirection: 'column',
|
|
@@ -34,7 +64,7 @@ const metadataStyle = {
|
|
|
34
64
|
};
|
|
35
65
|
const metadataRowStyle = {
|
|
36
66
|
display: 'grid',
|
|
37
|
-
gridTemplateColumns: '
|
|
67
|
+
gridTemplateColumns: '120px minmax(0, 1fr)',
|
|
38
68
|
alignItems: 'baseline',
|
|
39
69
|
gap: 12,
|
|
40
70
|
};
|
|
@@ -172,6 +202,44 @@ const sourceCodeStyle = {
|
|
|
172
202
|
fontSize: 'inherit',
|
|
173
203
|
lineHeight: 'inherit',
|
|
174
204
|
};
|
|
205
|
+
const destinationControlStyle = {
|
|
206
|
+
display: 'flex',
|
|
207
|
+
alignItems: 'center',
|
|
208
|
+
justifyContent: 'space-between',
|
|
209
|
+
gap: 16,
|
|
210
|
+
};
|
|
211
|
+
const destinationOptionsStyle = {
|
|
212
|
+
display: 'flex',
|
|
213
|
+
overflow: 'hidden',
|
|
214
|
+
border: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
215
|
+
borderRadius: 4,
|
|
216
|
+
};
|
|
217
|
+
const destinationOptionStyle = {
|
|
218
|
+
appearance: 'none',
|
|
219
|
+
border: 0,
|
|
220
|
+
cursor: 'default',
|
|
221
|
+
fontFamily: 'sans-serif',
|
|
222
|
+
fontSize: 11,
|
|
223
|
+
fontWeight: 400,
|
|
224
|
+
lineHeight: 1.5,
|
|
225
|
+
padding: '2px 7px',
|
|
226
|
+
};
|
|
227
|
+
const getDestinationOptionStyle = ({ disabled, selected, }) => ({
|
|
228
|
+
...destinationOptionStyle,
|
|
229
|
+
opacity: disabled ? 0.5 : 1,
|
|
230
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
231
|
+
idleBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
|
|
232
|
+
hoverBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
|
|
233
|
+
idleColor: selected ? colors_1.WHITE : colors_1.LIGHT_TEXT,
|
|
234
|
+
hoverColor: disabled ? colors_1.LIGHT_TEXT : colors_1.WHITE,
|
|
235
|
+
}),
|
|
236
|
+
});
|
|
237
|
+
const footerStyle = {
|
|
238
|
+
minWidth: 0,
|
|
239
|
+
};
|
|
240
|
+
const cancelStyle = {
|
|
241
|
+
minWidth: 90,
|
|
242
|
+
};
|
|
175
243
|
const makeSourceControlsVisible = (sourceCode) => {
|
|
176
244
|
return sourceCode.replace(/[\u200b-\u200f\u202a-\u202e\u2066-\u2069\ufeff]/g, (character) => {
|
|
177
245
|
var _a;
|
|
@@ -195,37 +263,276 @@ const ElementLibraryAddConfirmation = ({ displayName, origin, url }) => {
|
|
|
195
263
|
] }));
|
|
196
264
|
};
|
|
197
265
|
exports.ElementLibraryAddConfirmation = ElementLibraryAddConfirmation;
|
|
198
|
-
const ElementInstallConfirmation = ({
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
266
|
+
const ElementInstallConfirmation = ({ state }) => {
|
|
267
|
+
var _a, _b;
|
|
268
|
+
const { currentPlan, dependenciesToReview, missingPackages, newPlan, onClose, request, sourceIsUnverified, sourceLabel, } = state;
|
|
269
|
+
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
270
|
+
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
271
|
+
const currentCompositionMetadata = config === null ||
|
|
272
|
+
(canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) !== 'composition' ||
|
|
273
|
+
canvasContent.compositionId !== request.compositionId
|
|
274
|
+
? null
|
|
275
|
+
: {
|
|
276
|
+
durationInFrames: config.durationInFrames,
|
|
277
|
+
fps: config.fps,
|
|
278
|
+
height: config.height,
|
|
279
|
+
width: config.width,
|
|
280
|
+
};
|
|
281
|
+
const usesBrowserDependencyResolution = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
282
|
+
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
283
|
+
const [mode, setMode] = (0, react_1.useState)(currentPlan === null ? 'new-composition' : 'current-composition');
|
|
284
|
+
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
285
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
286
|
+
const [newCompositionValues, setNewCompositionValues] = (0, react_1.useState)(() => {
|
|
287
|
+
var _a, _b, _c, _d, _e;
|
|
288
|
+
const elementComponentName = (_a = studio_protocol_1.StudioProtocolInternals.getElementComponentNameFromSourceCode(request.element.sourceCode)) !== null && _a !== void 0 ? _a : 'Element';
|
|
289
|
+
const baseName = `${elementComponentName}Composition`;
|
|
290
|
+
let candidate = baseName;
|
|
291
|
+
let suffix = 2;
|
|
292
|
+
while ((0, validate_new_comp_data_1.validateCompositionName)(candidate, compositions) !== null) {
|
|
293
|
+
candidate = `${baseName}${suffix}`;
|
|
294
|
+
suffix++;
|
|
295
|
+
}
|
|
296
|
+
const size = (_b = request.element.dimensions) !== null && _b !== void 0 ? _b : (currentCompositionMetadata === null
|
|
297
|
+
? { width: 1920, height: 1080 }
|
|
298
|
+
: {
|
|
299
|
+
width: currentCompositionMetadata.width,
|
|
300
|
+
height: currentCompositionMetadata.height,
|
|
301
|
+
});
|
|
302
|
+
return {
|
|
303
|
+
durationInFrames: (_d = (_c = request.element.durationInFrames) !== null && _c !== void 0 ? _c : currentCompositionMetadata === null || currentCompositionMetadata === void 0 ? void 0 : currentCompositionMetadata.durationInFrames) !== null && _d !== void 0 ? _d : 150,
|
|
304
|
+
folder: { folderName: null, parentName: null, stack: null },
|
|
305
|
+
fps: (_e = currentCompositionMetadata === null || currentCompositionMetadata === void 0 ? void 0 : currentCompositionMetadata.fps) !== null && _e !== void 0 ? _e : 30,
|
|
306
|
+
id: candidate,
|
|
307
|
+
size,
|
|
308
|
+
};
|
|
309
|
+
});
|
|
310
|
+
const selectedFolderStack = newCompositionValues.folder.stack;
|
|
311
|
+
const resolvedFolderLocation = (0, use_resolved_stack_1.useResolvedStack)(selectedFolderStack);
|
|
312
|
+
const folderSymbolicatedStack = (0, react_1.useMemo)(() => (0, resolved_stack_to_symbolicated_1.resolvedStackToSymbolicated)(resolvedFolderLocation), [resolvedFolderLocation]);
|
|
313
|
+
const folderCompositionFile = (_a = folderSymbolicatedStack === null || folderSymbolicatedStack === void 0 ? void 0 : folderSymbolicatedStack.originalFileName) !== null && _a !== void 0 ? _a : null;
|
|
314
|
+
const [newCompositionPlanState, setNewCompositionPlanState] = (0, react_1.useState)({
|
|
315
|
+
folderStack: null,
|
|
316
|
+
type: 'ready',
|
|
317
|
+
plan: newPlan,
|
|
318
|
+
});
|
|
319
|
+
(0, react_1.useEffect)(() => {
|
|
320
|
+
if (selectedFolderStack === null) {
|
|
321
|
+
setNewCompositionPlanState({
|
|
322
|
+
folderStack: null,
|
|
323
|
+
type: 'ready',
|
|
324
|
+
plan: newPlan,
|
|
325
|
+
});
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (!(0, use_resolved_stack_1.hasResolvedStack)(selectedFolderStack)) {
|
|
329
|
+
setNewCompositionPlanState({
|
|
330
|
+
folderStack: selectedFolderStack,
|
|
331
|
+
type: 'loading',
|
|
332
|
+
});
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (folderCompositionFile === null) {
|
|
336
|
+
setNewCompositionPlanState({
|
|
337
|
+
folderStack: selectedFolderStack,
|
|
338
|
+
type: 'error',
|
|
339
|
+
reason: 'Could not determine where the new composition should be created.',
|
|
340
|
+
});
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
let canceled = false;
|
|
344
|
+
setNewCompositionPlanState({
|
|
345
|
+
folderStack: selectedFolderStack,
|
|
346
|
+
type: 'loading',
|
|
347
|
+
});
|
|
348
|
+
(0, element_install_api_1.prepareElementInstall)({
|
|
349
|
+
destination: {
|
|
350
|
+
type: 'new-composition',
|
|
351
|
+
compositionFile: folderCompositionFile,
|
|
352
|
+
},
|
|
353
|
+
element: request.element,
|
|
354
|
+
})
|
|
355
|
+
.then((result) => {
|
|
356
|
+
if (canceled) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
setNewCompositionPlanState(result.success
|
|
360
|
+
? {
|
|
361
|
+
folderStack: selectedFolderStack,
|
|
362
|
+
type: 'ready',
|
|
363
|
+
plan: result.plan,
|
|
364
|
+
}
|
|
365
|
+
: {
|
|
366
|
+
folderStack: selectedFolderStack,
|
|
367
|
+
type: 'error',
|
|
368
|
+
reason: result.reason,
|
|
369
|
+
});
|
|
370
|
+
})
|
|
371
|
+
.catch((error) => {
|
|
372
|
+
if (!canceled) {
|
|
373
|
+
setNewCompositionPlanState({
|
|
374
|
+
folderStack: selectedFolderStack,
|
|
375
|
+
type: 'error',
|
|
376
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
return () => {
|
|
381
|
+
canceled = true;
|
|
382
|
+
};
|
|
383
|
+
}, [folderCompositionFile, newPlan, request.element, selectedFolderStack]);
|
|
384
|
+
const { createComposition, heightValidationMessage, nameValidationMessage, valid: newCompositionValuesAreValid, widthValidationMessage, } = (0, use_create_composition_1.useCreateComposition)({
|
|
385
|
+
canvasCapture: null,
|
|
386
|
+
compositions,
|
|
387
|
+
durationInFrames: newCompositionValues.durationInFrames,
|
|
388
|
+
folderName: newCompositionValues.folder.folderName,
|
|
389
|
+
newId: newCompositionValues.id,
|
|
390
|
+
parentName: newCompositionValues.folder.parentName,
|
|
391
|
+
selectedFrameRate: newCompositionValues.fps,
|
|
392
|
+
size: newCompositionValues.size,
|
|
393
|
+
});
|
|
394
|
+
const activeNewCompositionPlanState = newCompositionPlanState.folderStack === selectedFolderStack
|
|
395
|
+
? newCompositionPlanState
|
|
396
|
+
: null;
|
|
397
|
+
const selectedNewCompositionPlan = (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'ready'
|
|
398
|
+
? activeNewCompositionPlanState.plan
|
|
399
|
+
: null;
|
|
400
|
+
const selectedPlan = mode === 'current-composition' ? currentPlan : selectedNewCompositionPlan;
|
|
401
|
+
const folderTargetIsReady = selectedFolderStack === null ||
|
|
402
|
+
((0, use_resolved_stack_1.hasResolvedStack)(selectedFolderStack) && folderCompositionFile !== null);
|
|
403
|
+
const canSubmit = !submitting &&
|
|
404
|
+
(mode === 'current-composition'
|
|
405
|
+
? currentPlan !== null
|
|
406
|
+
: newCompositionValuesAreValid &&
|
|
407
|
+
folderTargetIsReady &&
|
|
408
|
+
selectedNewCompositionPlan !== null);
|
|
409
|
+
const submit = (0, react_1.useCallback)(async () => {
|
|
410
|
+
if (!canSubmit) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
setSubmitting(true);
|
|
414
|
+
if (mode === 'new-composition') {
|
|
415
|
+
if (selectedNewCompositionPlan === null) {
|
|
416
|
+
setSubmitting(false);
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
const created = await createComposition({
|
|
420
|
+
signal: new AbortController().signal,
|
|
421
|
+
symbolicatedStack: selectedFolderStack === null ? null : folderSymbolicatedStack,
|
|
422
|
+
});
|
|
423
|
+
if (!created.success) {
|
|
424
|
+
(0, NotificationCenter_1.showNotification)(`Could not create composition: ${created.reason}`, 4000);
|
|
425
|
+
setSubmitting(false);
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
await (0, import_assets_1.insertElement)({
|
|
429
|
+
compositionFile: selectedNewCompositionPlan.compositionFile,
|
|
430
|
+
compositionId: newCompositionValues.id,
|
|
431
|
+
element: request.element,
|
|
432
|
+
expectedFileState: selectedNewCompositionPlan.expectedFileState,
|
|
433
|
+
from: null,
|
|
434
|
+
overwriteExisting: selectedNewCompositionPlan.expectedFileState.exists,
|
|
435
|
+
position: null,
|
|
436
|
+
});
|
|
437
|
+
onClose();
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (currentPlan === null) {
|
|
441
|
+
setSubmitting(false);
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
await (0, import_assets_1.insertElement)({
|
|
445
|
+
compositionFile: request.compositionFile,
|
|
446
|
+
compositionId: request.compositionId,
|
|
447
|
+
element: request.element,
|
|
448
|
+
expectedFileState: currentPlan.expectedFileState,
|
|
449
|
+
from: request.from,
|
|
450
|
+
overwriteExisting: currentPlan.expectedFileState.exists,
|
|
451
|
+
position: request.position,
|
|
452
|
+
});
|
|
453
|
+
onClose();
|
|
454
|
+
}, [
|
|
455
|
+
canSubmit,
|
|
456
|
+
createComposition,
|
|
457
|
+
currentPlan,
|
|
458
|
+
folderSymbolicatedStack,
|
|
459
|
+
mode,
|
|
460
|
+
newCompositionValues.id,
|
|
461
|
+
onClose,
|
|
462
|
+
request,
|
|
463
|
+
selectedFolderStack,
|
|
464
|
+
selectedNewCompositionPlan,
|
|
465
|
+
]);
|
|
466
|
+
const cancel = (0, react_1.useCallback)(() => {
|
|
467
|
+
if (!submitting) {
|
|
468
|
+
onClose();
|
|
469
|
+
}
|
|
470
|
+
}, [onClose, submitting]);
|
|
471
|
+
const onSubmit = (0, react_1.useCallback)((event) => {
|
|
472
|
+
event.preventDefault();
|
|
473
|
+
submit();
|
|
474
|
+
}, [submit]);
|
|
475
|
+
return (0, react_dom_1.createPortal)(jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { onOutsideClick: cancel, onEscape: cancel, children: [
|
|
476
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Install Element", onClose: cancel }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
477
|
+
jsx_runtime_1.jsxs("div", { style: dialogContent, children: [
|
|
478
|
+
jsx_runtime_1.jsxs("div", { style: destinationControlStyle, children: [
|
|
479
|
+
jsx_runtime_1.jsx("div", { style: sectionTitleStyle, children: "Add to" }), jsx_runtime_1.jsxs("div", { "aria-label": "Installation destination", role: "group", style: destinationOptionsStyle, children: [
|
|
480
|
+
jsx_runtime_1.jsx("button", { "aria-pressed": mode === 'current-composition', className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, disabled: currentPlan === null, onClick: () => setMode('current-composition'), style: getDestinationOptionStyle({
|
|
481
|
+
disabled: currentPlan === null,
|
|
482
|
+
selected: mode === 'current-composition',
|
|
483
|
+
}), type: "button", children: "Current composition" }), jsx_runtime_1.jsx("button", { "aria-pressed": mode === 'new-composition', className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: () => {
|
|
484
|
+
setMode('new-composition');
|
|
485
|
+
requestAnimationFrame(() => {
|
|
486
|
+
var _a;
|
|
487
|
+
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
488
|
+
});
|
|
489
|
+
}, style: {
|
|
490
|
+
...getDestinationOptionStyle({
|
|
491
|
+
disabled: false,
|
|
492
|
+
selected: mode === 'new-composition',
|
|
493
|
+
}),
|
|
494
|
+
borderLeft: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
495
|
+
}, type: "button", children: "New composition" })
|
|
496
|
+
] })
|
|
497
|
+
] }), currentPlan === null ? (jsx_runtime_1.jsxs("div", { style: warningStyle, role: "status", children: [
|
|
498
|
+
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: warningDescriptionStyle, children: ["Studio could not find a safe place in \u201C", request.compositionId, "\u201D to insert the Element. Install it into a new composition instead."] })
|
|
499
|
+
] })) : null, mode === 'new-composition' ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-label": "New composition settings", children: [
|
|
500
|
+
jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: nameValidationMessage, setValues: setNewCompositionValues, values: newCompositionValues, widthValidationMessage: widthValidationMessage }), (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'error' ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: activeNewCompositionPlanState.reason, type: "error" })) : null] })) : null, jsx_runtime_1.jsxs("dl", { style: metadataStyle, "aria-label": "Installation details", children: [
|
|
501
|
+
jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
502
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Element" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: request.element.displayName })
|
|
503
|
+
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
504
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Request source" }), jsx_runtime_1.jsx("dd", { style: sourceIsUnverified
|
|
505
|
+
? unverifiedSourceStyle
|
|
506
|
+
: metadataDescriptionStyle, children: sourceLabel })
|
|
507
|
+
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
508
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Composition" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: jsx_runtime_1.jsx("code", { style: codeStyle, children: mode === 'current-composition'
|
|
509
|
+
? request.compositionId
|
|
510
|
+
: newCompositionValues.id }) })
|
|
511
|
+
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
512
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Destination" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: jsx_runtime_1.jsx("code", { style: codeStyle, children: (_b = selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.filePath) !== null && _b !== void 0 ? _b : 'Reviewing destination…' }) })
|
|
513
|
+
] }), (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.expectedFileState.exists) ? (jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
514
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "File change" }), jsx_runtime_1.jsx("dd", { style: overwriteStyle, children: "Replace existing source file" })
|
|
515
|
+
] })) : null] }), dependenciesToReview.length > 0 ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-labelledby": "element-install-dependencies", children: [
|
|
516
|
+
jsx_runtime_1.jsx("h3", { id: "element-install-dependencies", style: sectionTitleStyle, children: "Dependencies" }), jsx_runtime_1.jsx("ul", { style: dependencyListStyle, role: "list", children: dependenciesToReview.map((packageName) => {
|
|
517
|
+
const willInstall = missingPackages.includes(packageName);
|
|
518
|
+
return (jsx_runtime_1.jsxs("li", { style: dependencyRowStyle, children: [
|
|
519
|
+
jsx_runtime_1.jsx("div", { style: dependencyNameStyle, children: packageName }), jsx_runtime_1.jsx("div", { style: willInstall
|
|
520
|
+
? dependencyInstallStatusStyle
|
|
521
|
+
: dependencyInstalledStatusStyle, children: willInstall ? 'Will be installed' : 'Installed' })
|
|
522
|
+
] }, packageName));
|
|
523
|
+
}) })
|
|
524
|
+
] })) : null, jsx_runtime_1.jsxs("div", { style: warningStyle, children: [
|
|
525
|
+
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: warningDescriptionStyle, children: ["This adds executable source code to your project.", usesBrowserDependencyResolution
|
|
526
|
+
? null
|
|
527
|
+
: ' Package lifecycle scripts may also run during installation, with access to your files and the network.'] })
|
|
528
|
+
] }), jsx_runtime_1.jsxs("details", { style: sourceDetailsStyle, children: [
|
|
529
|
+
jsx_runtime_1.jsx("summary", { style: sourceSummaryStyle, children: "Source code" }), jsx_runtime_1.jsx("pre", { style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: makeSourceControlsVisible(request.element.sourceCode) }) })
|
|
530
|
+
] })
|
|
531
|
+
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footerStyle, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
532
|
+
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(Button_1.Button, { disabled: submitting, onClick: cancel, style: cancelStyle, children: "Cancel" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs(ModalButton_1.ModalButton, { autoFocus: mode === 'current-composition', disabled: !canSubmit, onClick: submit, children: [submitting ? 'Installing…' : 'Install', jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: false })
|
|
533
|
+
] })
|
|
534
|
+
] }) })
|
|
228
535
|
] })
|
|
229
|
-
] }));
|
|
536
|
+
] }), (0, portals_1.getPortal)(currentZIndex));
|
|
230
537
|
};
|
|
231
538
|
exports.ElementInstallConfirmation = ElementInstallConfirmation;
|
|
@@ -1,53 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.FixComputedValueModal = void 0;
|
|
37
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const react_1 =
|
|
5
|
+
const react_1 = require("react");
|
|
39
6
|
const colors_1 = require("../helpers/colors");
|
|
40
7
|
const copy_text_1 = require("../helpers/copy-text");
|
|
41
|
-
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
42
|
-
const caret_1 = require("../icons/caret");
|
|
43
8
|
const clipboard_1 = require("../icons/clipboard");
|
|
44
|
-
const
|
|
9
|
+
const CodingAgentButton_1 = require("./CodingAgentButton");
|
|
45
10
|
const InlineAction_1 = require("./InlineAction");
|
|
46
11
|
const ModalFooter_1 = require("./ModalFooter");
|
|
47
12
|
const ModalHeader_1 = require("./ModalHeader");
|
|
48
13
|
const DismissableModal_1 = require("./NewComposition/DismissableModal");
|
|
49
14
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
50
|
-
const SegmentedButton_1 = require("./SegmentedButton");
|
|
51
15
|
const SettingsContext_1 = require("./SettingsContext");
|
|
52
16
|
const panelStyle = {
|
|
53
17
|
borderRadius: 6,
|
|
@@ -93,28 +57,12 @@ const footer = {
|
|
|
93
57
|
flex: 'none',
|
|
94
58
|
justifyContent: 'flex-end',
|
|
95
59
|
};
|
|
96
|
-
const mainSegmentStyle = {
|
|
97
|
-
gap: 6,
|
|
98
|
-
padding: '0 9px',
|
|
99
|
-
};
|
|
100
|
-
const dropdownSegmentStyle = {
|
|
101
|
-
padding: 0,
|
|
102
|
-
width: 20,
|
|
103
|
-
};
|
|
104
|
-
const menuLabel = {
|
|
105
|
-
color: 'inherit',
|
|
106
|
-
fontFamily: 'sans-serif',
|
|
107
|
-
fontSize: 13,
|
|
108
|
-
lineHeight: '16px',
|
|
109
|
-
};
|
|
110
60
|
const FixComputedValueModal = ({ state }) => {
|
|
111
|
-
var _a
|
|
61
|
+
var _a;
|
|
112
62
|
const { codingAgentInfo } = (0, SettingsContext_1.useSettings)();
|
|
113
63
|
const prompt = `/remotion-interactivity ${state.context} make "${state.prop}" interactive`;
|
|
114
64
|
const installCommand = 'npx remotion skills add';
|
|
115
|
-
const
|
|
116
|
-
const defaultCodingAgent = (_b = installedCodingAgents.find((agent) => agent.id === (codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.defaultCodingAgent))) !== null && _b !== void 0 ? _b : installedCodingAgents[0];
|
|
117
|
-
const alternativeCodingAgents = installedCodingAgents.filter((agent) => agent.id !== (defaultCodingAgent === null || defaultCodingAgent === void 0 ? void 0 : defaultCodingAgent.id));
|
|
65
|
+
const hasCodingAgent = ((_a = codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.installedCodingAgents.length) !== null && _a !== void 0 ? _a : 0) > 0;
|
|
118
66
|
const onCopyPrompt = (0, react_1.useCallback)(() => {
|
|
119
67
|
(0, copy_text_1.copyText)(prompt).catch((err) => {
|
|
120
68
|
(0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
|
|
@@ -128,80 +76,6 @@ const FixComputedValueModal = ({ state }) => {
|
|
|
128
76
|
const renderCopyAction = (0, react_1.useCallback)((color) => {
|
|
129
77
|
return jsx_runtime_1.jsx(clipboard_1.ClipboardIcon, { color: color, style: copyIcon });
|
|
130
78
|
}, []);
|
|
131
|
-
const openWithCodingAgent = (0, react_1.useCallback)(async (codingAgentId, codingAgentName) => {
|
|
132
|
-
try {
|
|
133
|
-
const response = await (0, open_in_editor_1.openInCodingAgent)(codingAgentId, codingAgentId === 'copilot' ? null : prompt);
|
|
134
|
-
if (!response.success) {
|
|
135
|
-
(0, NotificationCenter_1.showNotification)(`Could not open ${codingAgentName}`, 2000);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
catch (err) {
|
|
139
|
-
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
140
|
-
}
|
|
141
|
-
}, [prompt]);
|
|
142
|
-
const agentMenuItems = react_1.default.useMemo(() => {
|
|
143
|
-
return alternativeCodingAgents.map((codingAgent) => ({
|
|
144
|
-
id: `fix-computed-value-in-${codingAgent.id}`,
|
|
145
|
-
keyHint: null,
|
|
146
|
-
label: jsx_runtime_1.jsx("span", { style: menuLabel, children: codingAgent.name }),
|
|
147
|
-
leftItem: jsx_runtime_1.jsx(CodingAgentIcon_1.CodingAgentIcon, { codingAgentId: codingAgent.id, size: 18 }),
|
|
148
|
-
onClick: () => {
|
|
149
|
-
openWithCodingAgent(codingAgent.id, codingAgent.nameWithType).catch(() => undefined);
|
|
150
|
-
},
|
|
151
|
-
quickSwitcherLabel: null,
|
|
152
|
-
subMenu: null,
|
|
153
|
-
type: 'item',
|
|
154
|
-
value: `coding-agent-${codingAgent.id}`,
|
|
155
|
-
}));
|
|
156
|
-
}, [alternativeCodingAgents, openWithCodingAgent]);
|
|
157
|
-
const segments = react_1.default.useMemo(() => {
|
|
158
|
-
if (!defaultCodingAgent) {
|
|
159
|
-
return [];
|
|
160
|
-
}
|
|
161
|
-
return [
|
|
162
|
-
{
|
|
163
|
-
ariaLabel: `Open in ${defaultCodingAgent.nameWithType}`,
|
|
164
|
-
buttonId: null,
|
|
165
|
-
disabled: false,
|
|
166
|
-
idleColor: colors_1.LIGHT_TEXT,
|
|
167
|
-
onClick: () => {
|
|
168
|
-
openWithCodingAgent(defaultCodingAgent.id, defaultCodingAgent.nameWithType).catch(() => undefined);
|
|
169
|
-
},
|
|
170
|
-
onPointerDown: null,
|
|
171
|
-
renderContent: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
172
|
-
jsx_runtime_1.jsx(CodingAgentIcon_1.CodingAgentIcon, { codingAgentId: defaultCodingAgent.id, size: 18 }),
|
|
173
|
-
"Open in ", defaultCodingAgent.name] })),
|
|
174
|
-
segmentId: 'default-coding-agent',
|
|
175
|
-
style: mainSegmentStyle,
|
|
176
|
-
title: `Open in ${defaultCodingAgent.nameWithType}`,
|
|
177
|
-
type: 'action',
|
|
178
|
-
},
|
|
179
|
-
...(alternativeCodingAgents.length > 0
|
|
180
|
-
? [
|
|
181
|
-
{
|
|
182
|
-
ariaLabel: 'Open in another coding agent',
|
|
183
|
-
buttonId: null,
|
|
184
|
-
disabled: false,
|
|
185
|
-
idleColor: colors_1.LIGHT_TEXT,
|
|
186
|
-
leaveLeftSpace: true,
|
|
187
|
-
onOpenChange: null,
|
|
188
|
-
renderContent: (color) => jsx_runtime_1.jsx(caret_1.CaretDown, { color: color }),
|
|
189
|
-
segmentId: 'another-coding-agent',
|
|
190
|
-
selectedId: null,
|
|
191
|
-
style: dropdownSegmentStyle,
|
|
192
|
-
title: 'Open in another coding agent',
|
|
193
|
-
type: 'menu',
|
|
194
|
-
values: agentMenuItems,
|
|
195
|
-
},
|
|
196
|
-
]
|
|
197
|
-
: []),
|
|
198
|
-
];
|
|
199
|
-
}, [
|
|
200
|
-
agentMenuItems,
|
|
201
|
-
alternativeCodingAgents.length,
|
|
202
|
-
defaultCodingAgent,
|
|
203
|
-
openWithCodingAgent,
|
|
204
|
-
]);
|
|
205
79
|
return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
|
|
206
80
|
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Fix computed value" }), jsx_runtime_1.jsxs("div", { style: container, children: [state.remotionInteractivitySkillAvailable ? null : (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
207
81
|
jsx_runtime_1.jsx("div", { style: text, children: "First, install the Remotion Agent Skills:" }), jsx_runtime_1.jsxs("div", { style: commandField, children: [
|
|
@@ -215,6 +89,6 @@ const FixComputedValueModal = ({ state }) => {
|
|
|
215
89
|
: 'Then, paste this prompt into your coding agent:' }), jsx_runtime_1.jsxs("div", { style: commandField, children: [
|
|
216
90
|
jsx_runtime_1.jsx("pre", { style: code, children: prompt }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: onCopyPrompt, renderAction: renderCopyAction, title: "Copy prompt" })
|
|
217
91
|
] })
|
|
218
|
-
] }),
|
|
92
|
+
] }), hasCodingAgent ? (jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footer, children: jsx_runtime_1.jsx(CodingAgentButton_1.CodingAgentButton, { label: "Open in", prompt: prompt, size: "compact", style: null }) })) : null] }));
|
|
219
93
|
};
|
|
220
94
|
exports.FixComputedValueModal = FixComputedValueModal;
|
|
@@ -17,7 +17,7 @@ const pushWithMaxSize = (arr, value, maxSize) => {
|
|
|
17
17
|
};
|
|
18
18
|
const FpsCounter = ({ playbackSpeed }) => {
|
|
19
19
|
const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
|
|
20
|
-
const
|
|
20
|
+
const playing = remotion_1.Internals.usePlaying();
|
|
21
21
|
const frame = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
22
22
|
const [marker, rerender] = (0, react_1.useState)({});
|
|
23
23
|
const [fps, setFps] = (0, react_1.useState)(0);
|
|
@@ -4,7 +4,7 @@ exports.FramePersistor = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
6
|
const FramePersistor = () => {
|
|
7
|
-
const
|
|
7
|
+
const playing = remotion_1.Internals.usePlaying();
|
|
8
8
|
const config = (0, remotion_1.useVideoConfig)();
|
|
9
9
|
const frame = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
10
10
|
const setFrame = remotion_1.Internals.useTimelineSetFrame();
|
|
@@ -131,8 +131,9 @@ const InitialCompositionLoader = () => {
|
|
|
131
131
|
}
|
|
132
132
|
setCanvasContent(newCanvas);
|
|
133
133
|
};
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
const navigationWindow = (0, url_state_1.getNavigationWindow)();
|
|
135
|
+
navigationWindow.addEventListener('popstate', onchange);
|
|
136
|
+
return () => navigationWindow.removeEventListener('popstate', onchange);
|
|
136
137
|
}, [
|
|
137
138
|
compositions,
|
|
138
139
|
selectAsset,
|