@remotion/studio 4.0.525 → 4.0.527
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/focus-default-props-path.js +7 -1
- package/dist/api/restart-studio.d.ts +1 -1
- package/dist/api/restart-studio.js +1 -1
- package/dist/components/AgentPrompt.d.ts +6 -0
- package/dist/components/AgentPrompt.js +107 -0
- package/dist/components/AssetFileIcon.js +2 -0
- package/dist/components/AssetSelectorItem.d.ts +1 -23
- package/dist/components/AssetSelectorItem.js +10 -200
- package/dist/components/Canvas.js +109 -44
- package/dist/components/CanvasCaptureDropHandler.js +63 -0
- package/dist/components/CanvasOrLoading.js +10 -2
- package/dist/components/CaptionInspector.js +9 -3
- package/dist/{error-overlay/remotion-overlay → components}/CodeFrame.d.ts +2 -0
- package/dist/components/CodeFrame.js +77 -0
- package/dist/components/CompositionSelectorItem.js +7 -17
- package/dist/components/CurrentAsset.js +6 -4
- package/dist/components/ElementInstallConfirmation.js +69 -38
- package/dist/components/FilePreview.js +4 -0
- package/dist/components/FixComputedValueModal.js +64 -96
- package/dist/components/GenerateWithAgentModal.d.ts +9 -0
- package/dist/components/GenerateWithAgentModal.js +39 -0
- package/dist/components/InitialCompositionLoader.js +1 -1
- package/dist/components/InlineDropdown.js +26 -2
- package/dist/components/InlineEditableTitle.js +3 -0
- package/dist/components/InspectorOpenInEditor.js +8 -4
- package/dist/components/InspectorPanel/CollapsibleInspectorSection.d.ts +7 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSection.js +14 -0
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.d.ts +1 -1
- package/dist/components/InspectorPanel/CollapsibleInspectorSectionHeader.js +20 -8
- package/dist/components/InspectorPanel/CompositionInspector.js +32 -15
- package/dist/components/InspectorPanel/CompositionMetadata.js +7 -0
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +6 -12
- package/dist/components/InspectorPanel/ElementLibraryButton.js +2 -0
- package/dist/components/InspectorPanel/GuideInspector.js +2 -3
- package/dist/components/InspectorPanel/KeyframeSettings.js +5 -6
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +34 -2
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +45 -4
- package/dist/components/InspectorPanel/common.d.ts +4 -0
- package/dist/components/InspectorPanel/common.js +15 -2
- package/dist/components/InspectorPanel/styles.d.ts +0 -3
- package/dist/components/InspectorPanel/styles.js +3 -27
- package/dist/components/InspectorPanel/use-composition-actions.d.ts +2 -0
- package/dist/components/InspectorPanel/use-composition-actions.js +16 -0
- package/dist/components/InspectorPanel/use-inspector-section-expanded.d.ts +1 -0
- package/dist/components/InspectorPanel/use-inspector-section-expanded.js +21 -0
- package/dist/components/InspectorSequenceSection.js +44 -35
- package/dist/components/InspectorSourceLocation.js +4 -0
- package/dist/components/KeyboardShortcutsSettings.js +12 -4
- package/dist/components/LutPreview.d.ts +4 -0
- package/dist/components/LutPreview.js +192 -0
- package/dist/components/MenuBuildIndicator.js +1 -0
- package/dist/components/MenuCompositionName.js +4 -9
- package/dist/components/Modals.js +3 -6
- package/dist/components/ModelsSettings.js +15 -4
- package/dist/components/NewComposition/CancelButton.js +1 -1
- package/dist/components/Notifications/NotificationCenter.d.ts +0 -1
- package/dist/components/Notifications/NotificationCenter.js +1 -22
- package/dist/components/Preview.js +3 -0
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -0
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +4 -9
- package/dist/components/RadioButton.js +1 -0
- package/dist/components/RenderModal/DataEditor.js +4 -1
- package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/scroll-to-default-props-path.js +2 -1
- package/dist/components/RenderModal/WebRenderModal.js +10 -2
- package/dist/components/RenderQueue/CaptionQueueItem.js +5 -2
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +35 -8
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +1 -0
- package/dist/components/RenderQueue/caption-job-types.d.ts +6 -0
- package/dist/components/RenderQueue/index.js +1 -0
- package/dist/components/RendersTab.js +4 -0
- package/dist/components/SelectedOutlineElement.js +6 -0
- package/dist/components/SelectedOutlineSnapIndicators.d.ts +6 -0
- package/dist/components/SelectedOutlineSnapIndicators.js +16 -12
- package/dist/components/SequencePropsSubscriptionProvider.d.ts +3 -0
- package/dist/components/SequencePropsSubscriptionProvider.js +8 -6
- package/dist/components/SettingsButton.js +11 -2
- package/dist/components/SettingsModal.d.ts +1 -2
- package/dist/components/SettingsModal.js +24 -6
- package/dist/components/SettingsModalFooter.js +17 -3
- package/dist/components/SkillsSettings.d.ts +5 -0
- package/dist/components/SkillsSettings.js +29 -26
- package/dist/components/Timeline/Timeline.js +10 -11
- package/dist/components/Timeline/TimelineAssetField.js +81 -51
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +6 -9
- package/dist/components/Timeline/TimelineEffectItem.js +1 -0
- package/dist/components/Timeline/TimelineExpandArrowButton.js +1 -0
- package/dist/components/Timeline/TimelineExpandedRow.js +1 -0
- package/dist/components/Timeline/TimelineFieldLabel.js +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.js +11 -1
- package/dist/components/Timeline/TimelineKeyframeControls.js +16 -1
- package/dist/components/Timeline/TimelineLayerChildren.d.ts +3 -3
- package/dist/components/Timeline/TimelineLayerChildren.js +11 -9
- package/dist/components/Timeline/TimelineLayerEye.d.ts +1 -1
- package/dist/components/Timeline/TimelineLayerEye.js +6 -3
- package/dist/components/Timeline/TimelineList.js +9 -3
- package/dist/components/Timeline/TimelineSchemaField.js +2 -6
- package/dist/components/Timeline/TimelineSelection.d.ts +14 -3
- package/dist/components/Timeline/TimelineSelection.js +91 -49
- package/dist/components/Timeline/TimelineSequence.js +28 -2
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -0
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +2 -0
- package/dist/components/Timeline/TimelineSequenceItem.js +45 -13
- package/dist/components/Timeline/TimelineViewport.d.ts +1 -0
- package/dist/components/Timeline/TimelineViewport.js +10 -1
- package/dist/components/Timeline/TimelineVirtualization.d.ts +3 -3
- package/dist/components/Timeline/delete-selected-timeline-item.js +2 -2
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -2
- package/dist/components/Timeline/get-sequence-context-menu-items.js +143 -46
- package/dist/components/Timeline/normalize-font-weight-for-keyframe.d.ts +1 -0
- package/dist/components/Timeline/normalize-font-weight-for-keyframe.js +19 -0
- package/dist/components/Timeline/split-selected-timeline-item.d.ts +13 -10
- package/dist/components/Timeline/split-selected-timeline-item.js +58 -35
- package/dist/components/Timeline/timeline-display-groups.d.ts +9 -0
- package/dist/components/Timeline/timeline-display-groups.js +66 -0
- package/dist/components/Timeline/use-timeline-asset-drop.js +21 -21
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-expanded-tree.js +1 -2
- package/dist/components/TimelineCombobox.js +1 -0
- package/dist/components/Transcription/TranscriptionModal.js +16 -11
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +1 -1
- package/dist/components/UpdateStatusContext.d.ts +2 -2
- package/dist/components/UpdateStatusContext.js +6 -7
- package/dist/components/UpdatesSettings.js +6 -6
- package/dist/components/WebMcp.js +41 -41
- package/dist/components/asset-context-menu.d.ts +32 -0
- package/dist/components/asset-context-menu.js +242 -0
- package/dist/components/composition-drop-preview.d.ts +9 -2
- package/dist/components/composition-drop-preview.js +7 -4
- package/dist/components/composition-menu-items.d.ts +4 -6
- package/dist/components/composition-menu-items.js +191 -75
- package/dist/components/delete-jsx-nodes-api.d.ts +2 -0
- package/dist/components/{delete-jsx-node-api.js → delete-jsx-nodes-api.js} +5 -5
- package/dist/components/get-open-in-menu-items.d.ts +6 -5
- package/dist/components/get-open-in-menu-items.js +22 -16
- package/dist/components/keyboard-shortcuts.d.ts +4 -4
- package/dist/components/keyboard-shortcuts.js +3 -1
- package/dist/components/public-output-name.d.ts +1 -0
- package/dist/components/public-output-name.js +7 -3
- package/dist/components/selected-outline-order.js +18 -12
- package/dist/components/use-open-in-menu-apps.d.ts +14 -0
- package/dist/components/use-open-in-menu-apps.js +33 -0
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +2 -2
- package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +1 -0
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +3 -3
- package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +5 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +26 -19
- package/dist/esm/{CaptionQueueProcessor-k0yrm3dj.mjs → CaptionQueueProcessor-npa6szn1.mjs} +39 -8
- package/dist/esm/{LazyModels-gfmpcy4h.mjs → LazyModels-nh3c8h9p.mjs} +4 -3
- package/dist/esm/{LazyModels-m1rf06wh.mjs → LazyModels-rr5v8h5y.mjs} +4 -3
- package/dist/esm/{TranscriptionModal-8pvrehg4.mjs → TranscriptionModal-79m5wgcj.mjs} +25 -17
- package/dist/esm/{VideoMattingModal-fefbzgka.mjs → VideoMattingModal-31pew0xj.mjs} +9 -6
- package/dist/esm/index-21hxsfaa.mjs +239 -0
- package/dist/esm/{index-s848rffx.mjs → index-4zen9prq.mjs} +5438 -4686
- package/dist/esm/index-5t2dwxsk.mjs +530 -0
- package/dist/esm/{index-vsxrxfpj.mjs → index-614tdz2q.mjs} +1 -1
- package/dist/esm/{index-0x13f28h.mjs → index-9xxg6218.mjs} +20 -541
- package/dist/esm/{index-hbezgbbq.mjs → index-ac5550e7.mjs} +1 -1
- package/dist/esm/{index-41kqns5c.mjs → index-e855w59j.mjs} +15 -92
- package/dist/esm/{index-tzxb8808.mjs → index-n5gmcvhz.mjs} +8 -8
- package/dist/esm/{index-ggqpre9v.mjs → index-ppspzgn9.mjs} +4963 -4178
- package/dist/esm/{index-jrw61pkj.mjs → index-r0ejh5sy.mjs} +1 -1
- package/dist/esm/index-r1gr3j3a.mjs +80 -0
- package/dist/esm/{index-mww32xc8.mjs → index-s7qa3xbw.mjs} +6 -4
- package/dist/esm/{index-1089795y.mjs → index-vxwg66ar.mjs} +7 -22
- package/dist/esm/index.mjs +13 -6
- package/dist/esm/internals.mjs +10 -7
- package/dist/esm/previewEntry.mjs +10 -7
- package/dist/esm/{resolve-composition-component-location-bt2d6qxq.mjs → resolve-composition-component-location-qrp05g62.mjs} +1 -1
- package/dist/helpers/client-id.d.ts +1 -0
- package/dist/helpers/client-id.js +8 -4
- package/dist/helpers/copy-text.js +1 -16
- package/dist/helpers/cube-lut.d.ts +12 -0
- package/dist/helpers/cube-lut.js +160 -0
- package/dist/helpers/get-preview-file-type.d.ts +1 -1
- package/dist/helpers/get-preview-file-type.js +3 -0
- package/dist/helpers/hoverable.js +2 -1
- package/dist/helpers/open-in-editor.d.ts +5 -2
- package/dist/helpers/open-in-editor.js +13 -5
- package/dist/helpers/settings-tab-availability.d.ts +14 -0
- package/dist/helpers/settings-tab-availability.js +35 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -1
- package/dist/helpers/use-keybinding.d.ts +1 -1
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -2
- package/dist/helpers/use-menu-structure.js +31 -21
- package/dist/icons/lut.d.ts +4 -0
- package/dist/icons/lut.js +6 -0
- package/dist/icons/sparkles.d.ts +4 -0
- package/dist/icons/sparkles.js +6 -0
- package/dist/state/modals.d.ts +17 -2
- package/dist/state/timeline-zoom.js +4 -0
- package/package.json +19 -19
- package/dist/components/delete-jsx-node-api.d.ts +0 -2
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +0 -62
|
@@ -25,6 +25,7 @@ const modals_1 = require("../state/modals");
|
|
|
25
25
|
const AssetAudioVolume_1 = require("./AssetAudioVolume");
|
|
26
26
|
const InlineEditableTitle_1 = require("./InlineEditableTitle");
|
|
27
27
|
const InspectorInfoHeader_1 = require("./InspectorInfoHeader");
|
|
28
|
+
const CollapsibleInspectorSection_1 = require("./InspectorPanel/CollapsibleInspectorSection");
|
|
28
29
|
const common_1 = require("./InspectorPanel/common");
|
|
29
30
|
const InspectorPanelLayout_1 = require("./InspectorPanelLayout");
|
|
30
31
|
const layout_1 = require("./layout");
|
|
@@ -182,6 +183,7 @@ const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStud
|
|
|
182
183
|
displayName: fileName,
|
|
183
184
|
audioStreamIndex: null,
|
|
184
185
|
requestInit: null,
|
|
186
|
+
target: null,
|
|
185
187
|
});
|
|
186
188
|
}, [fileName, mutationsDisabled, setSelectedModal, src]);
|
|
187
189
|
const onTrackMatting = (0, react_1.useCallback)(() => {
|
|
@@ -246,12 +248,12 @@ const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStud
|
|
|
246
248
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
247
249
|
jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: contentSized, minHeight: exports.CURRENT_ASSET_HEIGHT, padding: contentSized
|
|
248
250
|
? `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px 6px`
|
|
249
|
-
: '4px 0', children: jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onClick: onAssetClick, onCommit: onRename, size: contentSized ? 'default' : 'inspector', title: assetName }) }), fileDetails.length > 0 ? (jsx_runtime_1.jsx(
|
|
251
|
+
: '4px 0', children: jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onClick: onAssetClick, onCommit: onRename, size: contentSized ? 'default' : 'inspector', title: assetName }) }), fileDetails.length > 0 ? (jsx_runtime_1.jsx(CollapsibleInspectorSection_1.CollapsibleInspectorSection, { collapsible: true, label: "File", sectionId: "asset-file", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: fileDetails.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.video ? (jsx_runtime_1.jsx(CollapsibleInspectorSection_1.CollapsibleInspectorSection, { collapsible: true, label: "Video", sectionId: "asset-video", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: mediaSections.video.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.audio !== null ? (jsx_runtime_1.jsx(CollapsibleInspectorSection_1.CollapsibleInspectorSection, { collapsible: mediaSections.audio.length > 0, label: "Audio", sectionId: "asset-audio", children: mediaSections.audio.length === 0 ? (jsx_runtime_1.jsx("div", { style: assetEmptyStateStyle, children: "None" })) : (jsx_runtime_1.jsxs("div", { style: assetMetadataStyle, children: [mediaSections.audio.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))), src ? (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: "Average volume", children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: jsx_runtime_1.jsx(AssetAudioVolume_1.AssetAudioVolume, { src: (_d = volumeMetadata === null || volumeMetadata === void 0 ? void 0 : volumeMetadata.src) !== null && _d !== void 0 ? _d : null, waveformSampleRate: volumeMetadata
|
|
250
252
|
? Math.ceil(volumeMetadata.fps *
|
|
251
253
|
get_timeline_max_zoom_1.TIMELINE_FRAME_WIDTH_AT_MAX_ZOOM)
|
|
252
|
-
: null }, (_e = volumeMetadata === null || volumeMetadata === void 0 ? void 0 : volumeMetadata.src) !== null && _e !== void 0 ? _e : src) }) })) : null] })) })) : null, jsx_runtime_1.jsx(
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
: null }, (_e = volumeMetadata === null || volumeMetadata === void 0 ? void 0 : volumeMetadata.src) !== null && _e !== void 0 ? _e : src) }) })) : null] })) })) : null, jsx_runtime_1.jsx(CollapsibleInspectorSection_1.CollapsibleInspectorSection, { collapsible: true, label: "Actions", sectionId: "asset-actions", children: jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [fileManagerAvailable ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: fileManagerDisabled, onClick: onShowInFileManager, renderIcon: (color) => (jsx_runtime_1.jsx(folder_1.ExpandedFolderIcon, { color: color, style: quickActionIconStyle })), children: ["Show in ", fileManagerName] })) : null, src && (mediaMetadata === null || mediaMetadata === void 0 ? void 0 : mediaMetadata.hasAudioTrack) !== false ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: mutationsDisabled, onClick: onTranscribe, renderIcon: (color) => (jsx_runtime_1.jsx(transcription_1.TranscriptionIcon, { color: color, style: quickActionIconStyle })), children: "Transcribe" })) : null, fileType === 'video' ? (jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: mutationsDisabled, onClick: onTrackMatting, renderIcon: (color) => (jsx_runtime_1.jsx(separation_1.SeparationIcon, { color: color, style: quickActionIconStyle })), children: "Separate foreground" })) : null, src ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: false, onClick: onOpenConvert, renderIcon: (color) => (jsx_runtime_1.jsx(remotion_convert_1.RemotionConvertIcon, { color: color, style: quickActionIconStyle })), children: ["Convert",
|
|
255
|
+
jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: convertArrowStyle, children: jsx_runtime_1.jsx("path", { d: "M4 12 12 4M6 4h6v6", fill: "none", stroke: colors_1.CURRENT_COLOR, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) })
|
|
256
|
+
] })) : null, jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: mutationsDisabled, onClick: onDelete, renderIcon: (color) => (jsx_runtime_1.jsx(trash_1.TrashIcon, { color: color, style: quickActionIconStyle })), children: "Delete" })] }) })
|
|
255
257
|
] }));
|
|
256
258
|
};
|
|
257
259
|
exports.AssetInfo = AssetInfo;
|
|
@@ -250,7 +250,8 @@ const ElementLibraryAddConfirmation = ({ displayName, origin, url }) => {
|
|
|
250
250
|
};
|
|
251
251
|
exports.ElementLibraryAddConfirmation = ElementLibraryAddConfirmation;
|
|
252
252
|
const ElementInstallConfirmation = ({ state }) => {
|
|
253
|
-
var _a
|
|
253
|
+
var _a;
|
|
254
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
254
255
|
const { currentPlan, missingPackages, newPlan, onClose, request, sourceIsUnverified, sourceLabel, } = state;
|
|
255
256
|
const sourcePreview = (0, react_1.useMemo)(() => makeSourceControlsVisible(request.element.sourceCode), [request.element.sourceCode]);
|
|
256
257
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
@@ -299,7 +300,7 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
299
300
|
const selectedFolderStack = newCompositionValues.folder.stack;
|
|
300
301
|
const resolvedFolderLocation = (0, use_resolved_stack_1.useResolvedStack)(selectedFolderStack);
|
|
301
302
|
const folderSymbolicatedStack = (0, react_1.useMemo)(() => (0, resolved_stack_to_symbolicated_1.resolvedStackToSymbolicated)(resolvedFolderLocation), [resolvedFolderLocation]);
|
|
302
|
-
const folderCompositionFile = (
|
|
303
|
+
const folderCompositionFile = (_b = folderSymbolicatedStack === null || folderSymbolicatedStack === void 0 ? void 0 : folderSymbolicatedStack.originalFileName) !== null && _b !== void 0 ? _b : null;
|
|
303
304
|
const [newCompositionPlanState, setNewCompositionPlanState] = (0, react_1.useState)({
|
|
304
305
|
folderStack: null,
|
|
305
306
|
type: 'ready',
|
|
@@ -388,7 +389,7 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
388
389
|
? activeNewCompositionPlanState.plan
|
|
389
390
|
: null;
|
|
390
391
|
const selectedPlan = mode === 'current-composition' ? currentPlan : selectedNewCompositionPlan;
|
|
391
|
-
const elementBaseName = (
|
|
392
|
+
const elementBaseName = (_c = request.element.slug.split('/').at(-1)) !== null && _c !== void 0 ? _c : '';
|
|
392
393
|
const [refreshPlan, setRefreshPlan] = (0, react_1.useState)(0);
|
|
393
394
|
const [input, setInput] = (0, react_1.useState)({
|
|
394
395
|
basePlan: selectedPlan,
|
|
@@ -409,25 +410,42 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
409
410
|
});
|
|
410
411
|
}
|
|
411
412
|
const requestedName = input.name;
|
|
412
|
-
const [
|
|
413
|
-
const currentPreparation = (
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
const
|
|
419
|
-
const
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
const existingDestination = (existingInstallation === null || existingInstallation === void 0 ? void 0 : existingInstallation.basePlan) === selectedPlan &&
|
|
423
|
-
(existingInstallation === null || existingInstallation === void 0 ? void 0 : existingInstallation.refresh) === refreshPlan
|
|
424
|
-
? existingInstallation
|
|
425
|
-
: null;
|
|
413
|
+
const [preparations, setPreparations] = (0, react_1.useState)([]);
|
|
414
|
+
const currentPreparation = (_d = preparations.find((preparation) => preparation.basePlan === selectedPlan &&
|
|
415
|
+
preparation.refresh === refreshPlan &&
|
|
416
|
+
preparation.requestedName === requestedName)) !== null && _d !== void 0 ? _d : null;
|
|
417
|
+
const preparedInstallation = (_e = currentPreparation === null || currentPreparation === void 0 ? void 0 : currentPreparation.installation) !== null && _e !== void 0 ? _e : null;
|
|
418
|
+
const planError = (_f = currentPreparation === null || currentPreparation === void 0 ? void 0 : currentPreparation.error) !== null && _f !== void 0 ? _f : null;
|
|
419
|
+
const installationName = (_g = requestedName !== null && requestedName !== void 0 ? requestedName : preparedInstallation === null || preparedInstallation === void 0 ? void 0 : preparedInstallation.name) !== null && _g !== void 0 ? _g : elementBaseName;
|
|
420
|
+
const [existingInstallations, setExistingInstallations] = (0, react_1.useState)([]);
|
|
421
|
+
const existingDestination = (_h = existingInstallations.find((installation) => installation.basePlan === selectedPlan &&
|
|
422
|
+
installation.refresh === refreshPlan)) !== null && _h !== void 0 ? _h : null;
|
|
426
423
|
const overwriteExisting = existingDestination !== null &&
|
|
427
424
|
input.overwritePlan === existingDestination.plan;
|
|
428
425
|
const activePlan = overwriteExisting
|
|
429
426
|
? existingDestination.plan
|
|
430
|
-
: ((
|
|
427
|
+
: ((_j = preparedInstallation === null || preparedInstallation === void 0 ? void 0 : preparedInstallation.plan) !== null && _j !== void 0 ? _j : null);
|
|
428
|
+
const [displayedPlans, setDisplayedPlans] = (0, react_1.useState)([]);
|
|
429
|
+
const rememberedDisplayedPlan = (_k = (_a = displayedPlans.find((displayed) => displayed.basePlan === selectedPlan &&
|
|
430
|
+
displayed.refresh === refreshPlan)) === null || _a === void 0 ? void 0 : _a.plan) !== null && _k !== void 0 ? _k : null;
|
|
431
|
+
const displayedPlan = (_l = activePlan !== null && activePlan !== void 0 ? activePlan : rememberedDisplayedPlan) !== null && _l !== void 0 ? _l : selectedPlan;
|
|
432
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
433
|
+
if (activePlan === null || selectedPlan === null) {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
setDisplayedPlans((previous) => {
|
|
437
|
+
const existing = previous.find((displayed) => displayed.basePlan === selectedPlan &&
|
|
438
|
+
displayed.refresh === refreshPlan);
|
|
439
|
+
if ((existing === null || existing === void 0 ? void 0 : existing.plan) === activePlan) {
|
|
440
|
+
return previous;
|
|
441
|
+
}
|
|
442
|
+
return [
|
|
443
|
+
...previous.filter((displayed) => displayed.basePlan !== selectedPlan ||
|
|
444
|
+
displayed.refresh !== refreshPlan),
|
|
445
|
+
{ basePlan: selectedPlan, refresh: refreshPlan, plan: activePlan },
|
|
446
|
+
];
|
|
447
|
+
});
|
|
448
|
+
}, [activePlan, refreshPlan, selectedPlan]);
|
|
431
449
|
(0, react_1.useEffect)(() => {
|
|
432
450
|
if (selectedPlan === null) {
|
|
433
451
|
return;
|
|
@@ -462,34 +480,44 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
462
480
|
plan: result.plan,
|
|
463
481
|
};
|
|
464
482
|
if (result.plan.expectedFileState.exists) {
|
|
465
|
-
|
|
466
|
-
|
|
483
|
+
setExistingInstallations((previous) => previous.some((installation) => installation.basePlan === selectedPlan &&
|
|
484
|
+
installation.refresh === refreshPlan)
|
|
467
485
|
? previous
|
|
468
|
-
: prepared);
|
|
486
|
+
: [...previous, prepared]);
|
|
469
487
|
if (requestedName === null) {
|
|
470
488
|
candidate = `${elementBaseName}-copy${copyNumber === 1 ? '' : `-${copyNumber}`}`;
|
|
471
489
|
copyNumber++;
|
|
472
490
|
continue;
|
|
473
491
|
}
|
|
474
492
|
}
|
|
475
|
-
|
|
476
|
-
basePlan
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
493
|
+
setPreparations((previous) => [
|
|
494
|
+
...previous.filter((preparation) => preparation.basePlan !== selectedPlan ||
|
|
495
|
+
preparation.refresh !== refreshPlan ||
|
|
496
|
+
preparation.requestedName !== requestedName),
|
|
497
|
+
{
|
|
498
|
+
basePlan: selectedPlan,
|
|
499
|
+
refresh: refreshPlan,
|
|
500
|
+
requestedName,
|
|
501
|
+
installation: prepared,
|
|
502
|
+
error: null,
|
|
503
|
+
},
|
|
504
|
+
]);
|
|
482
505
|
return;
|
|
483
506
|
}
|
|
484
507
|
})().catch((error) => {
|
|
485
508
|
if (!canceled) {
|
|
486
|
-
|
|
487
|
-
basePlan
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
509
|
+
setPreparations((previous) => [
|
|
510
|
+
...previous.filter((preparation) => preparation.basePlan !== selectedPlan ||
|
|
511
|
+
preparation.refresh !== refreshPlan ||
|
|
512
|
+
preparation.requestedName !== requestedName),
|
|
513
|
+
{
|
|
514
|
+
basePlan: selectedPlan,
|
|
515
|
+
refresh: refreshPlan,
|
|
516
|
+
requestedName,
|
|
517
|
+
installation: null,
|
|
518
|
+
error: error instanceof Error ? error.message : String(error),
|
|
519
|
+
},
|
|
520
|
+
]);
|
|
493
521
|
}
|
|
494
522
|
});
|
|
495
523
|
return () => {
|
|
@@ -624,9 +652,12 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
624
652
|
jsx_runtime_1.jsx("dt", { style: sectionTitleStyle, children: "From" }), jsx_runtime_1.jsx("dd", { style: sourceIsUnverified
|
|
625
653
|
? unverifiedRequestSourceStyle
|
|
626
654
|
: requestSourceDescriptionStyle, children: sourceLabel })
|
|
627
|
-
] }),
|
|
628
|
-
|
|
629
|
-
|
|
655
|
+
] }), jsx_runtime_1.jsxs("dl", { style: {
|
|
656
|
+
...requestSourceStyle,
|
|
657
|
+
visibility: displayedPlan === null ? 'hidden' : 'visible',
|
|
658
|
+
}, "aria-hidden": displayedPlan === null, children: [
|
|
659
|
+
jsx_runtime_1.jsx("dt", { style: sectionTitleStyle, children: "Destination" }), jsx_runtime_1.jsx("dd", { style: requestSourceDescriptionStyle, children: (_m = displayedPlan === null || displayedPlan === void 0 ? void 0 : displayedPlan.filePath) !== null && _m !== void 0 ? _m : '\u00A0' })
|
|
660
|
+
] }), jsx_runtime_1.jsxs("div", { style: destinationControlStyle, children: [
|
|
630
661
|
jsx_runtime_1.jsx("div", { style: sectionTitleStyle, children: "Add to" }), jsx_runtime_1.jsx("div", { "aria-label": "Add to", role: "group", style: { marginLeft: 'auto' }, children: jsx_runtime_1.jsx(SegmentedControl_1.SegmentedControl, { items: destinationOptions, needsWrapping: false, size: "medium" }) })
|
|
631
662
|
] }), currentPlan === null ? (jsx_runtime_1.jsxs("div", { style: warningStyle, role: "status", children: [
|
|
632
663
|
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."] })
|
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const colors_1 = require("../helpers/colors");
|
|
8
8
|
const JSONViewer_1 = require("./JSONViewer");
|
|
9
9
|
const layout_1 = require("./layout");
|
|
10
|
+
const LutPreview_1 = require("./LutPreview");
|
|
10
11
|
const TextViewer_1 = require("./TextViewer");
|
|
11
12
|
const msgStyle = {
|
|
12
13
|
fontSize: 13,
|
|
@@ -104,6 +105,9 @@ const FilePreview = ({ fileType, src, currentAsset, assetMetadata }) => {
|
|
|
104
105
|
if (fileType === 'font') {
|
|
105
106
|
return jsx_runtime_1.jsx(FontPreview, { src: src });
|
|
106
107
|
}
|
|
108
|
+
if (fileType === 'lut') {
|
|
109
|
+
return jsx_runtime_1.jsx(LutPreview_1.LutPreview, { src: src }, src);
|
|
110
|
+
}
|
|
107
111
|
if (fileType === 'json') {
|
|
108
112
|
return jsx_runtime_1.jsx(JSONViewer_1.JSONViewer, { src: src });
|
|
109
113
|
}
|
|
@@ -3,19 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FixComputedValueModal = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const resolve_file_source_1 = require("../error-overlay/react-overlay/effects/resolve-file-source");
|
|
7
|
+
const OpenInEditor_1 = require("../error-overlay/remotion-overlay/OpenInEditor");
|
|
8
|
+
const StackFrame_1 = require("../error-overlay/remotion-overlay/StackFrame");
|
|
9
|
+
const client_id_1 = require("../helpers/client-id");
|
|
6
10
|
const colors_1 = require("../helpers/colors");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const copy_1 = require("../icons/copy");
|
|
10
|
-
const skills_1 = require("../icons/skills");
|
|
11
|
-
const CodingAgentButton_1 = require("./CodingAgentButton");
|
|
12
|
-
const InlineAction_1 = require("./InlineAction");
|
|
11
|
+
const open_in_editor_1 = require("../helpers/open-in-editor");
|
|
12
|
+
const AgentPrompt_1 = require("./AgentPrompt");
|
|
13
13
|
const ModalContainer_1 = require("./ModalContainer");
|
|
14
|
-
const ModalFooter_1 = require("./ModalFooter");
|
|
15
14
|
const ModalHeader_1 = require("./ModalHeader");
|
|
16
15
|
const DismissableModal_1 = require("./NewComposition/DismissableModal");
|
|
17
|
-
const
|
|
18
|
-
const SettingsContext_1 = require("./SettingsContext");
|
|
16
|
+
const use_default_editor_info_1 = require("./use-default-editor-info");
|
|
19
17
|
const panelStyle = {
|
|
20
18
|
borderRadius: 6,
|
|
21
19
|
display: 'flex',
|
|
@@ -36,99 +34,69 @@ const text = {
|
|
|
36
34
|
fontSize: 14,
|
|
37
35
|
lineHeight: 1.5,
|
|
38
36
|
};
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
borderRadius: 6,
|
|
43
|
-
boxSizing: 'border-box',
|
|
44
|
-
display: 'flex',
|
|
45
|
-
gap: 8,
|
|
46
|
-
marginTop: 10,
|
|
47
|
-
padding: '8px 8px 8px 10px',
|
|
48
|
-
width: '100%',
|
|
49
|
-
};
|
|
50
|
-
const code = {
|
|
51
|
-
color: colors_1.WHITE,
|
|
52
|
-
flex: 1,
|
|
53
|
-
fontFamily: 'monospace',
|
|
54
|
-
fontSize: 13,
|
|
55
|
-
lineHeight: 1.5,
|
|
56
|
-
margin: 0,
|
|
57
|
-
minWidth: 0,
|
|
58
|
-
overflowWrap: 'anywhere',
|
|
59
|
-
whiteSpace: 'pre-wrap',
|
|
60
|
-
};
|
|
61
|
-
const copyAction = {
|
|
62
|
-
flexShrink: 0,
|
|
37
|
+
const sourcePreviewContainer = {
|
|
38
|
+
marginBottom: 16,
|
|
39
|
+
marginTop: 4,
|
|
63
40
|
};
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
marginRight: 6,
|
|
69
|
-
verticalAlign: 'middle',
|
|
70
|
-
};
|
|
71
|
-
const copyIcon = {
|
|
72
|
-
flexShrink: 0,
|
|
73
|
-
height: 12,
|
|
74
|
-
width: 12,
|
|
75
|
-
};
|
|
76
|
-
const footer = {
|
|
77
|
-
display: 'flex',
|
|
78
|
-
flex: 'none',
|
|
79
|
-
minWidth: 0,
|
|
80
|
-
padding: '12px 16px',
|
|
81
|
-
justifyContent: 'flex-end',
|
|
41
|
+
const sourcePreviewStatus = {
|
|
42
|
+
...text,
|
|
43
|
+
marginBottom: 16,
|
|
44
|
+
marginTop: 10,
|
|
82
45
|
};
|
|
83
46
|
const FixComputedValueModal = ({ state }) => {
|
|
84
47
|
var _a;
|
|
85
|
-
const {
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
(
|
|
102
|
-
|
|
48
|
+
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
49
|
+
const { canOpenInEditor, defaultEditorId, defaultEditorName } = (0, use_default_editor_info_1.useEditorOpening)(previewServerState.type === 'connected');
|
|
50
|
+
const [sourcePreview, setSourcePreview] = (0, react_1.useState)({
|
|
51
|
+
type: 'loading',
|
|
52
|
+
});
|
|
53
|
+
const promptLocation = sourcePreview.type === 'loaded'
|
|
54
|
+
? `${sourcePreview.stack.originalFileName}:${sourcePreview.stack.originalLineNumber}:${sourcePreview.stack.originalColumnNumber}`
|
|
55
|
+
: `${state.location.source}:${state.location.line}:${state.location.column}`;
|
|
56
|
+
const promptDetails = ` ${promptLocation} make "${state.prop}" interactive`;
|
|
57
|
+
const canOpenSourceInEditor = sourcePreview.type === 'loaded' &&
|
|
58
|
+
canOpenInEditor &&
|
|
59
|
+
defaultEditorId !== null &&
|
|
60
|
+
defaultEditorName !== null;
|
|
61
|
+
(0, react_1.useEffect)(() => {
|
|
62
|
+
var _a;
|
|
63
|
+
let cancelled = false;
|
|
64
|
+
setSourcePreview({ type: 'loading' });
|
|
65
|
+
(0, open_in_editor_1.findOriginalPositionInFileAtProperty)({
|
|
66
|
+
originalPosition: state.location,
|
|
67
|
+
property: (_a = state.prop.split('.').at(-1)) !== null && _a !== void 0 ? _a : state.prop,
|
|
68
|
+
})
|
|
69
|
+
.then((position) => {
|
|
70
|
+
return (0, resolve_file_source_1.resolveFileSource)({
|
|
71
|
+
columnNumber: position.column,
|
|
72
|
+
fileName: position.source,
|
|
73
|
+
lineNumber: position.line,
|
|
74
|
+
message: `Computed value "${state.prop}"`,
|
|
75
|
+
}, 1);
|
|
76
|
+
})
|
|
77
|
+
.then((stack) => {
|
|
78
|
+
if (!cancelled) {
|
|
79
|
+
setSourcePreview({ type: 'loaded', stack });
|
|
80
|
+
}
|
|
81
|
+
})
|
|
103
82
|
.catch((err) => {
|
|
104
|
-
(
|
|
83
|
+
if (!cancelled) {
|
|
84
|
+
setSourcePreview({
|
|
85
|
+
type: 'error',
|
|
86
|
+
message: err instanceof Error ? err.message : String(err),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
105
89
|
});
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}, [
|
|
110
|
-
const renderInstallCommandCopyAction = (0, react_1.useCallback)((color) => {
|
|
111
|
-
return (jsx_runtime_1.jsx(copy_1.CopyIcon, { copied: installCommandCopied, color: color, style: copyIcon }));
|
|
112
|
-
}, [installCommandCopied]);
|
|
90
|
+
return () => {
|
|
91
|
+
cancelled = true;
|
|
92
|
+
};
|
|
93
|
+
}, [state.location, state.prop]);
|
|
113
94
|
return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
|
|
114
|
-
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Fix computed value" }), jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
marginTop: state.remotionInteractivitySkillAvailable ? 0 : 16,
|
|
121
|
-
}, children: state.remotionInteractivitySkillAvailable
|
|
122
|
-
? 'Paste this prompt into your coding agent to make this value editable in Studio:'
|
|
123
|
-
: 'Then, paste this prompt into your coding agent:' }), jsx_runtime_1.jsxs("div", { style: commandField, children: [
|
|
124
|
-
jsx_runtime_1.jsxs("pre", { style: code, children: [
|
|
125
|
-
jsx_runtime_1.jsx(skills_1.SkillsIcon, { color: colors_1.BLUE, style: skillsIcon, "aria-hidden": true }), jsx_runtime_1.jsx("span", { style: {
|
|
126
|
-
color: colors_1.BLUE,
|
|
127
|
-
fontFamily: 'inherit',
|
|
128
|
-
fontSize: 'inherit',
|
|
129
|
-
lineHeight: 'inherit',
|
|
130
|
-
}, children: skillName }), promptDetails] }), jsx_runtime_1.jsx(InlineAction_1.InlineAction, { style: copyAction, variant: null, onClick: onCopyPrompt, renderAction: renderPromptCopyAction, title: "Copy prompt" })
|
|
131
|
-
] })
|
|
132
|
-
] }), 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] }));
|
|
95
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Fix computed value" }), jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
96
|
+
jsx_runtime_1.jsx("div", { style: text, children: "This value cannot be interactively edited because it is computed:" }), sourcePreview.type === 'loaded' ? (jsx_runtime_1.jsx("div", { style: sourcePreviewContainer, children: jsx_runtime_1.jsx(StackFrame_1.StackElement, { collapsible: false, defaultFunctionName: null, editorId: canOpenInEditor ? defaultEditorId : null, fontSize: 13, headerAction: canOpenSourceInEditor ? (jsx_runtime_1.jsx(OpenInEditor_1.OpenInEditor, { canHaveKeyboardShortcuts: false, editorId: defaultEditorId, editorName: defaultEditorName, size: "compact", stack: sourcePreview.stack })) : null, horizontalSpacing: 0, isFirst: true, lineNumberWidth: String(Math.max(0, ...((_a = sourcePreview.stack.originalScriptCode) !== null && _a !== void 0 ? _a : []).map((line) => line.lineNumber))).length, s: sourcePreview.stack }) })) : (jsx_runtime_1.jsx("div", { style: sourcePreviewStatus, children: sourcePreview.type === 'loading'
|
|
97
|
+
? 'Loading code preview...'
|
|
98
|
+
: `Could not load code preview: ${sourcePreview.message}` })), jsx_runtime_1.jsx(AgentPrompt_1.AgentPrompt, { availableText: "Use this prompt to make this value editable:", promptDetails: promptDetails, skillId: "remotion-interactivity" })
|
|
99
|
+
] })
|
|
100
|
+
] }));
|
|
133
101
|
};
|
|
134
102
|
exports.FixComputedValueModal = FixComputedValueModal;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateWithAgentModal = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
const format_file_location_1 = require("../helpers/format-file-location");
|
|
7
|
+
const AgentPrompt_1 = require("./AgentPrompt");
|
|
8
|
+
const ModalContainer_1 = require("./ModalContainer");
|
|
9
|
+
const ModalHeader_1 = require("./ModalHeader");
|
|
10
|
+
const DismissableModal_1 = require("./NewComposition/DismissableModal");
|
|
11
|
+
const panelStyle = {
|
|
12
|
+
borderRadius: 6,
|
|
13
|
+
display: 'flex',
|
|
14
|
+
flexDirection: 'column',
|
|
15
|
+
maxHeight: (0, ModalContainer_1.getMaxModalHeight)(800),
|
|
16
|
+
minWidth: 0,
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
width: (0, ModalContainer_1.getMaxModalWidth)(560),
|
|
19
|
+
};
|
|
20
|
+
const container = { padding: 16 };
|
|
21
|
+
const text = {
|
|
22
|
+
color: colors_1.LIGHT_TEXT,
|
|
23
|
+
fontFamily: 'sans-serif',
|
|
24
|
+
fontSize: 14,
|
|
25
|
+
lineHeight: 1.5,
|
|
26
|
+
marginBottom: 16,
|
|
27
|
+
};
|
|
28
|
+
const GenerateWithAgentModal = ({ state, }) => {
|
|
29
|
+
const location = (0, format_file_location_1.formatFileLocation)({
|
|
30
|
+
location: state.location,
|
|
31
|
+
root: window.remotion_cwd,
|
|
32
|
+
});
|
|
33
|
+
return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { panelStyle: panelStyle, children: [
|
|
34
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Generate with agent" }), jsx_runtime_1.jsxs("div", { style: container, children: [
|
|
35
|
+
jsx_runtime_1.jsx("div", { style: text, children: "Ask a coding agent to generate content in this composition." }), jsx_runtime_1.jsx(AgentPrompt_1.AgentPrompt, { availableText: "Start your prompt with:", promptDetails: location ? ` ${location}` : '', skillId: "remotion-markup" })
|
|
36
|
+
] })
|
|
37
|
+
] }));
|
|
38
|
+
};
|
|
39
|
+
exports.GenerateWithAgentModal = GenerateWithAgentModal;
|
|
@@ -13,6 +13,7 @@ const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
|
13
13
|
const noop_1 = require("../helpers/noop");
|
|
14
14
|
const z_index_1 = require("../state/z-index");
|
|
15
15
|
const InlineAction_1 = require("./InlineAction");
|
|
16
|
+
const menu_tree_context_1 = require("./Menu/menu-tree-context");
|
|
16
17
|
const portals_1 = require("./Menu/portals");
|
|
17
18
|
const styles_1 = require("./Menu/styles");
|
|
18
19
|
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
@@ -23,6 +24,7 @@ const container = {
|
|
|
23
24
|
const InlineDropdown = ({ values, getItems, onOpenChange, unhoveredColor, ...props }) => {
|
|
24
25
|
var _a, _b;
|
|
25
26
|
const ref = (0, react_1.useRef)(null);
|
|
27
|
+
const [menuTreeId] = (0, react_1.useState)(menu_tree_context_1.getNextMenuTreeId);
|
|
26
28
|
const [opened, setOpened] = (0, react_1.useState)({ type: 'not-open' });
|
|
27
29
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
28
30
|
const size = player_1.PlayerInternals.useElementSize(ref, {
|
|
@@ -96,9 +98,31 @@ const InlineDropdown = ({ values, getItems, onOpenChange, unhoveredColor, ...pro
|
|
|
96
98
|
setOpened({ type: 'not-open' });
|
|
97
99
|
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
|
|
98
100
|
}, [onOpenChange]);
|
|
101
|
+
(0, react_1.useEffect)(() => {
|
|
102
|
+
if (opened.type === 'not-open') {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const dismissWithoutClickThrough = (event) => {
|
|
106
|
+
if (event.button !== 0) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const target = event.target;
|
|
110
|
+
if ((0, menu_tree_context_1.isNodeInMenuTree)(target, menuTreeId)) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
event.stopPropagation();
|
|
115
|
+
event.stopImmediatePropagation();
|
|
116
|
+
onHide();
|
|
117
|
+
};
|
|
118
|
+
window.addEventListener('pointerdown', dismissWithoutClickThrough, true);
|
|
119
|
+
return () => {
|
|
120
|
+
window.removeEventListener('pointerdown', dismissWithoutClickThrough, true);
|
|
121
|
+
};
|
|
122
|
+
}, [menuTreeId, onHide, opened.type]);
|
|
99
123
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
100
|
-
jsx_runtime_1.jsx("div", { ref: ref, style: container, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, unhoveredColor: opened.type === 'open' ? colors_1.WHITE : unhoveredColor, ...props }) }), portalStyle && opened.type === 'open'
|
|
101
|
-
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: (_b = (_a = opened.values) !== null && _a !== void 0 ? _a : values) !== null && _b !== void 0 ? _b : [], onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
124
|
+
jsx_runtime_1.jsx("div", { ref: ref, style: container, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, unhoveredColor: opened.type === 'open' ? colors_1.WHITE : unhoveredColor, ...props, "aria-expanded": opened.type === 'open' }) }), portalStyle && opened.type === 'open'
|
|
125
|
+
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { "data-remotion-menu-tree-id": menuTreeId, style: portalStyle, onPointerDown: (event) => event.stopPropagation(), children: jsx_runtime_1.jsx(menu_tree_context_1.MenuTreeContext.Provider, { value: menuTreeId, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: (_b = (_a = opened.values) !== null && _a !== void 0 ? _a : values) !== null && _b !== void 0 ? _b : [], onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
102
126
|
: null] }));
|
|
103
127
|
};
|
|
104
128
|
exports.InlineDropdown = InlineDropdown;
|
|
@@ -35,6 +35,8 @@ const titleGridItem = {
|
|
|
35
35
|
minWidth: 0,
|
|
36
36
|
overflow: 'hidden',
|
|
37
37
|
textOverflow: 'ellipsis',
|
|
38
|
+
userSelect: 'none',
|
|
39
|
+
WebkitUserSelect: 'none',
|
|
38
40
|
whiteSpace: 'nowrap',
|
|
39
41
|
};
|
|
40
42
|
const titleInput = {
|
|
@@ -52,6 +54,7 @@ const titleInput = {
|
|
|
52
54
|
outline: 'none',
|
|
53
55
|
overflow: 'hidden',
|
|
54
56
|
padding: 0,
|
|
57
|
+
userSelect: 'text',
|
|
55
58
|
WebkitAppearance: 'none',
|
|
56
59
|
width: '100%',
|
|
57
60
|
};
|
|
@@ -78,14 +78,16 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
|
|
|
78
78
|
]);
|
|
79
79
|
const menuItems = (0, react_1.useMemo)(() => {
|
|
80
80
|
const items = (0, get_open_in_menu_items_1.getOpenInMenuItems)({
|
|
81
|
+
canOpenDesktopApps: canConfigureApps,
|
|
81
82
|
codingAgentInfo,
|
|
82
83
|
editorDisabled: location === null || !canOpenInEditor,
|
|
83
84
|
editorInfo,
|
|
84
85
|
excludeCodingAgentId: null,
|
|
85
86
|
excludeEditorId: defaultEditorId,
|
|
87
|
+
excludeGitSource: defaultOpenInTarget === 'git-source',
|
|
86
88
|
fileManagerDisabled: !(location === null || location === void 0 ? void 0 : location.source) || previewServerState.type !== 'connected',
|
|
87
89
|
folder: locationType === 'folder',
|
|
88
|
-
location,
|
|
90
|
+
gitSourceDisabled: location === null,
|
|
89
91
|
onConfigureApps: configureDefaultApps,
|
|
90
92
|
onOpenInCodingAgent: (codingAgentId, codingAgentName) => {
|
|
91
93
|
openWithCodingAgent(codingAgentId, codingAgentName).catch(() => undefined);
|
|
@@ -112,6 +114,9 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
|
|
|
112
114
|
(0, NotificationCenter_1.showNotification)(`Could not open Git client: ${err.message}`, 2000);
|
|
113
115
|
});
|
|
114
116
|
},
|
|
117
|
+
onOpenInGitSource: () => {
|
|
118
|
+
(0, get_git_menu_item_1.openGitSource)({ folder: locationType === 'folder', location });
|
|
119
|
+
},
|
|
115
120
|
onOpenInTerminal: (terminalId) => {
|
|
116
121
|
if (!(location === null || location === void 0 ? void 0 : location.source) || locationType !== 'folder') {
|
|
117
122
|
return;
|
|
@@ -127,11 +132,10 @@ const InspectorOpenInEditor = ({ contextForAgents = null, label, location, locat
|
|
|
127
132
|
});
|
|
128
133
|
},
|
|
129
134
|
});
|
|
130
|
-
return
|
|
131
|
-
? items.filter((item) => item.id !== 'open-in-github')
|
|
132
|
-
: items;
|
|
135
|
+
return items;
|
|
133
136
|
}, [
|
|
134
137
|
codingAgentInfo,
|
|
138
|
+
canConfigureApps,
|
|
135
139
|
canOpenInEditor,
|
|
136
140
|
configureDefaultApps,
|
|
137
141
|
defaultEditorId,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollapsibleInspectorSection = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const CollapsibleInspectorSectionHeader_1 = require("./CollapsibleInspectorSectionHeader");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
const use_inspector_section_expanded_1 = require("./use-inspector-section-expanded");
|
|
8
|
+
const CollapsibleInspectorSection = ({ children, collapsible, label, sectionId }) => {
|
|
9
|
+
const [expanded, setExpanded] = (0, use_inspector_section_expanded_1.useInspectorSectionExpanded)(sectionId);
|
|
10
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
11
|
+
jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: jsx_runtime_1.jsx(CollapsibleInspectorSectionHeader_1.CollapsibleInspectorSectionHeader, { action: null, expanded: expanded, label: label, onToggle: collapsible ? () => setExpanded(!expanded) : null }) }), jsx_runtime_1.jsx(common_1.InspectorSectionBody, { expanded: !collapsible || expanded, children: children })
|
|
12
|
+
] }));
|
|
13
|
+
};
|
|
14
|
+
exports.CollapsibleInspectorSection = CollapsibleInspectorSection;
|