@remotion/studio 4.0.522 → 4.0.524
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/install-package.js +4 -2
- package/dist/components/ActionTooltip.d.ts +9 -0
- package/dist/components/ActionTooltip.js +143 -0
- package/dist/components/AssetAudioVolume.d.ts +5 -0
- package/dist/components/AssetAudioVolume.js +33 -0
- package/dist/components/Canvas.js +8 -8
- package/dist/components/CaptionInspector.js +74 -20
- package/dist/components/CheckboardToggle.js +9 -10
- package/dist/components/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/CompositionContextButton.js +4 -1
- package/dist/components/CompositionSelectorItem.js +2 -2
- package/dist/components/ConfigureLicenseModal.js +1 -1
- package/dist/components/CurrentAsset.js +40 -6
- package/dist/components/EditorContexts.js +3 -1
- package/dist/components/ElementInstallConfirmation.js +254 -137
- package/dist/components/FixComputedValueModal.js +38 -8
- package/dist/components/FullscreenToggle.js +8 -10
- package/dist/components/GlobalKeybindings.js +107 -49
- package/dist/components/InspectorPanel/MultiSequenceField.d.ts +12 -0
- package/dist/components/InspectorPanel/MultiSequenceField.js +131 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.d.ts +8 -0
- package/dist/components/InspectorPanel/MultiSequenceInspector.js +102 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.d.ts +9 -0
- package/dist/components/InspectorPanel/MultiSequenceNumberField.js +88 -0
- package/dist/components/InspectorPanel.js +4 -0
- package/dist/components/InspectorSequenceSection.js +69 -6
- package/dist/components/InstallPackage.js +4 -5
- package/dist/components/KeyboardShortcutsSettings.js +212 -33
- package/dist/components/LazySyntaxHighlightedSource.d.ts +4 -0
- package/dist/components/LazySyntaxHighlightedSource.js +43 -0
- package/dist/components/LoopToggle.js +8 -2
- package/dist/components/MenuToolbar.js +11 -7
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/Modals.js +3 -1
- package/dist/components/ModelManager.d.ts +16 -0
- package/dist/components/ModelManager.js +200 -0
- package/dist/components/ModelsSettings.d.ts +2 -0
- package/dist/components/ModelsSettings.js +133 -0
- package/dist/components/MuteToggle.d.ts +1 -0
- package/dist/components/MuteToggle.js +16 -6
- package/dist/components/NewComposition/DismissableModal.d.ts +1 -0
- package/dist/components/NewComposition/DismissableModal.js +2 -2
- package/dist/components/NewComposition/InputDragger.d.ts +2 -2
- package/dist/components/NewComposition/InputDragger.js +6 -6
- package/dist/components/NewComposition/NewComposition.d.ts +1 -0
- package/dist/components/NewComposition/NewComposition.js +5 -4
- package/dist/components/NewComposition/NewFolder.js +9 -8
- package/dist/components/NewComposition/RenameComposition.js +3 -2
- package/dist/components/NewComposition/RenameFolder.js +15 -10
- package/dist/components/NewComposition/SlugPreview.d.ts +7 -0
- package/dist/components/NewComposition/SlugPreview.js +18 -0
- package/dist/components/OptionalPackageModal.d.ts +11 -0
- package/dist/components/OptionalPackageModal.js +155 -0
- package/dist/components/OutlineToggle.js +16 -10
- package/dist/components/PlayPause.js +11 -9
- package/dist/components/PlaybackKeyboardShortcutsManager.d.ts +2 -0
- package/dist/components/PlaybackKeyboardShortcutsManager.js +39 -7
- package/dist/components/PlaybackRateSelector.js +2 -2
- package/dist/components/PreviewToolbar.js +1 -1
- package/dist/components/PreviewToolbarOverflowButton.js +19 -4
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +5 -2
- package/dist/components/RadioButton.d.ts +1 -0
- package/dist/components/RadioButton.js +2 -2
- package/dist/components/RenderButton.js +5 -1
- package/dist/components/RenderModal/NumberSetting.d.ts +6 -1
- package/dist/components/RenderModal/NumberSetting.js +2 -2
- package/dist/components/RenderModal/RenderModalBasic.js +1 -1
- package/dist/components/RenderModal/RenderModalOutputName.d.ts +3 -1
- package/dist/components/RenderModal/RenderModalOutputName.js +4 -4
- package/dist/components/RenderModal/SeparateAudioOption.js +1 -1
- package/dist/components/RenderModal/WebRenderModalBasic.js +1 -1
- package/dist/components/RenderQueue/CaptionQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/CaptionQueueItem.js +130 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/CaptionQueueProcessor.js +110 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/CaptionQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -1
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueItem.js +3 -3
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -1
- package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +130 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.d.ts +1 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessor.js +105 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.d.ts +2 -0
- package/dist/components/RenderQueue/VideoMattingQueueProcessorLoader.js +54 -0
- package/dist/components/RenderQueue/caption-job-types.d.ts +47 -0
- package/dist/components/RenderQueue/caption-job-types.js +7 -0
- package/dist/components/RenderQueue/context.d.ts +16 -0
- package/dist/components/RenderQueue/context.js +224 -11
- package/dist/components/RenderQueue/index.js +34 -10
- package/dist/components/RenderQueue/item-style.d.ts +1 -0
- package/dist/components/RenderQueue/item-style.js +2 -1
- package/dist/components/RenderQueue/load-model-for-job.d.ts +11 -0
- package/dist/components/RenderQueue/load-model-for-job.js +14 -0
- package/dist/components/RenderQueue/video-matting-job-types.d.ts +38 -0
- package/dist/components/RenderQueue/video-matting-job-types.js +5 -0
- package/dist/components/RendersTab.js +4 -4
- package/dist/components/RulersAndGuidesToggle.js +7 -1
- package/dist/components/SegmentedControl.d.ts +2 -2
- package/dist/components/SegmentedControl.js +38 -13
- package/dist/components/SelectedOutlinePolygon.js +8 -2
- package/dist/components/SettingsButton.d.ts +4 -0
- package/dist/components/SettingsButton.js +51 -0
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +3 -1
- package/dist/components/ShowOutlinesProvider.js +12 -0
- package/dist/components/SidebarCollapserControls.js +17 -21
- package/dist/components/SizeSelector.js +12 -4
- package/dist/components/SkillsSettings.js +2 -3
- package/dist/components/SnappingToggle.js +9 -8
- package/dist/components/StudioSettings.js +32 -18
- package/dist/components/SyntaxHighlightedSource.d.ts +5 -0
- package/dist/components/SyntaxHighlightedSource.js +78 -0
- package/dist/components/Tabs/vertical.d.ts +1 -0
- package/dist/components/Tabs/vertical.js +2 -2
- package/dist/components/TimeValue.js +2 -3
- package/dist/components/Timeline/SequencePropsObserver.js +4 -0
- package/dist/components/Timeline/Timeline.js +49 -81
- package/dist/components/Timeline/TimelineClipboardKeybindings.js +2 -4
- package/dist/components/Timeline/TimelineDeleteKeybindings.js +3 -18
- package/dist/components/Timeline/TimelineDragHandler.js +2 -2
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +1 -0
- package/dist/components/Timeline/TimelineLayerChildren.js +12 -9
- package/dist/components/Timeline/TimelineRowChrome.js +11 -3
- package/dist/components/Timeline/TimelineSchemaField.js +8 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +2 -0
- package/dist/components/Timeline/TimelineSelection.js +55 -2
- package/dist/components/Timeline/TimelineSequence.js +75 -17
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +0 -1
- package/dist/components/Timeline/TimelineSequenceItem.js +208 -111
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +23 -3
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +73 -25
- package/dist/components/Timeline/TimelineTimeIndicators.js +1 -0
- package/dist/components/Timeline/TimelineZoomControls.js +2 -1
- package/dist/components/Timeline/timeline-field-display-utils.js +8 -5
- package/dist/components/Timeline/use-asset-timeline-context-menu.d.ts +2 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
- package/dist/components/TimelineCombobox.d.ts +1 -0
- package/dist/components/TimelineCombobox.js +8 -4
- package/dist/components/TimelineInOutToggle.js +14 -18
- package/dist/components/Transcription/LazyModels.d.ts +1 -0
- package/dist/components/Transcription/LazyModels.js +5 -0
- package/dist/components/Transcription/Models.d.ts +6 -0
- package/dist/components/Transcription/Models.js +18 -0
- package/dist/components/Transcription/TranscriptionModal.d.ts +3 -0
- package/dist/components/Transcription/TranscriptionModal.js +428 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.d.ts +5 -0
- package/dist/components/Transcription/TranscriptionModalWithOptionalWhisper.js +48 -0
- package/dist/components/Transcription/caption-output-name.d.ts +2 -0
- package/dist/components/Transcription/caption-output-name.js +10 -0
- package/dist/components/Transcription/resample-media-to-16-khz.d.ts +6 -0
- package/dist/components/Transcription/resample-media-to-16-khz.js +82 -0
- package/dist/components/Transcription/whisper-languages.d.ts +2 -0
- package/dist/components/Transcription/whisper-languages.js +104 -0
- package/dist/components/Transcription/whisper-webgpu-capability.d.ts +2 -0
- package/dist/components/Transcription/whisper-webgpu-capability.js +7 -0
- package/dist/components/UndoRedoButtons.js +13 -38
- package/dist/components/UpdatesSettings.js +8 -12
- package/dist/components/VideoMatting/LazyModels.d.ts +1 -0
- package/dist/components/VideoMatting/LazyModels.js +5 -0
- package/dist/components/VideoMatting/Models.d.ts +6 -0
- package/dist/components/VideoMatting/Models.js +18 -0
- package/dist/components/VideoMatting/VideoMattingModal.d.ts +3 -0
- package/dist/components/VideoMatting/VideoMattingModal.js +207 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.d.ts +5 -0
- package/dist/components/VideoMatting/VideoMattingModalWithOptionalPackage.js +46 -0
- package/dist/components/VideoMatting/video-matting-capability.d.ts +2 -0
- package/dist/components/VideoMatting/video-matting-capability.js +7 -0
- package/dist/components/WebMcp.js +439 -22
- package/dist/components/handle-drop.js +3 -2
- package/dist/components/import-assets.d.ts +3 -2
- package/dist/components/import-assets.js +5 -9
- package/dist/components/keyboard-shortcuts.d.ts +17 -1
- package/dist/components/keyboard-shortcuts.js +191 -89
- package/dist/components/public-output-name.d.ts +5 -0
- package/dist/components/public-output-name.js +60 -0
- package/dist/components/use-model-cache-status.d.ts +7 -0
- package/dist/components/use-model-cache-status.js +35 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +29 -18
- package/dist/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
- package/dist/esm/LazyModels-hc33szyn.mjs +11 -0
- package/dist/esm/LazyModels-sg40rjw6.mjs +11 -0
- package/dist/esm/SyntaxHighlightedSource-3xks91rz.mjs +1236 -0
- package/dist/esm/TranscriptionModal-3ctnxpt6.mjs +1011 -0
- package/dist/esm/VideoMattingModal-b0r7e60n.mjs +374 -0
- package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
- package/dist/esm/index-1b9skrrd.mjs +142 -0
- package/dist/esm/index-2j3d1g81.mjs +261 -0
- package/dist/esm/index-5zrb1ft4.mjs +39 -0
- package/dist/esm/index-7tt71e8n.mjs +36 -0
- package/dist/esm/index-9qtvmwtx.mjs +1366 -0
- package/dist/esm/index-9x6e1dq0.mjs +428 -0
- package/dist/esm/index-c37kme2v.mjs +46209 -0
- package/dist/esm/index-cw0pnpg5.mjs +50 -0
- package/dist/esm/index-e3zwf3e7.mjs +36 -0
- package/dist/esm/index-er3mh6em.mjs +54688 -0
- package/dist/esm/{chunk-je0h1bgt.js → index-k426ye99.mjs} +4 -1
- package/dist/esm/index-q2epbw93.mjs +423 -0
- package/dist/esm/index-q5xv20xx.mjs +41 -0
- package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
- package/dist/esm/index-v4tr1bft.mjs +20 -0
- package/dist/esm/index-wbmp5srk.mjs +35 -0
- package/dist/esm/index-yfrysr5f.mjs +1154 -0
- package/dist/esm/index.mjs +45 -933
- package/dist/esm/internals.mjs +13 -114393
- package/dist/esm/previewEntry.mjs +387 -115050
- package/dist/esm/renderEntry.mjs +5 -5
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-bt2d6qxq.mjs} +1 -1
- package/dist/helpers/colors.d.ts +1 -0
- package/dist/helpers/colors.js +4 -3
- package/dist/helpers/drag-aware-double-click.d.ts +2 -1
- package/dist/helpers/drag-aware-double-click.js +12 -1
- package/dist/helpers/get-asset-metadata.d.ts +1 -0
- package/dist/helpers/get-asset-metadata.js +4 -0
- package/dist/helpers/hoverable.js +8 -0
- package/dist/helpers/inject-css.js +2 -0
- package/dist/helpers/optional-package-dependencies.d.ts +3 -0
- package/dist/helpers/optional-package-dependencies.js +24 -0
- package/dist/helpers/pointer-session.d.ts +6 -0
- package/dist/helpers/pointer-session.js +36 -14
- package/dist/helpers/prism-vsc-dark-plus.d.ts +1 -0
- package/dist/helpers/prism-vsc-dark-plus.js +305 -0
- package/dist/helpers/sequence-node-path-mutations.js +11 -0
- package/dist/helpers/slugify-name.d.ts +1 -0
- package/dist/helpers/slugify-name.js +14 -0
- package/dist/helpers/studio-runtime-config.d.ts +1 -0
- package/dist/helpers/studio-runtime-config.js +6 -1
- package/dist/helpers/use-create-composition.d.ts +1 -0
- package/dist/helpers/use-create-composition.js +12 -7
- package/dist/helpers/use-keybinding.d.ts +9 -3
- package/dist/helpers/use-keybinding.js +8 -9
- package/dist/helpers/use-keyboard-shortcut-label.d.ts +2 -0
- package/dist/helpers/use-keyboard-shortcut-label.js +15 -0
- package/dist/helpers/use-menu-structure.js +59 -14
- package/dist/helpers/use-rename-composition.d.ts +1 -0
- package/dist/helpers/use-rename-composition.js +11 -5
- package/dist/icons/input-props.d.ts +1 -1
- package/dist/icons/input-props.js +2 -2
- package/dist/icons/models.d.ts +4 -0
- package/dist/icons/models.js +7 -0
- package/dist/icons/separation.d.ts +4 -0
- package/dist/icons/separation.js +7 -0
- package/dist/icons/skills.js +1 -1
- package/dist/icons/transcription.d.ts +4 -0
- package/dist/icons/transcription.js +7 -0
- package/dist/icons/upload.js +1 -1
- package/dist/renderEntry.js +2 -2
- package/dist/state/modals.d.ts +14 -2
- package/package.json +35 -21
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-3netyjd9.js +0 -99793
|
@@ -7,7 +7,6 @@ const react_1 = require("react");
|
|
|
7
7
|
const react_dom_1 = require("react-dom");
|
|
8
8
|
const remotion_1 = require("remotion");
|
|
9
9
|
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
10
|
-
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
11
10
|
const colors_1 = require("../helpers/colors");
|
|
12
11
|
const hoverable_1 = require("../helpers/hoverable");
|
|
13
12
|
const resolved_stack_to_symbolicated_1 = require("../helpers/resolved-stack-to-symbolicated");
|
|
@@ -18,20 +17,25 @@ const Button_1 = require("./Button");
|
|
|
18
17
|
const element_install_api_1 = require("./element-install-api");
|
|
19
18
|
const import_assets_1 = require("./import-assets");
|
|
20
19
|
const layout_1 = require("./layout");
|
|
20
|
+
const LazySyntaxHighlightedSource_1 = require("./LazySyntaxHighlightedSource");
|
|
21
|
+
const is_menu_item_1 = require("./Menu/is-menu-item");
|
|
21
22
|
const portals_1 = require("./Menu/portals");
|
|
22
23
|
const ModalButton_1 = require("./ModalButton");
|
|
23
24
|
const ModalContainer_1 = require("./ModalContainer");
|
|
24
25
|
const ModalFooter_1 = require("./ModalFooter");
|
|
25
26
|
const ModalHeader_1 = require("./ModalHeader");
|
|
26
27
|
const NewComposition_1 = require("./NewComposition/NewComposition");
|
|
28
|
+
const RemInput_1 = require("./NewComposition/RemInput");
|
|
27
29
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
28
30
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
31
|
+
const RadioButton_1 = require("./RadioButton");
|
|
32
|
+
const SegmentedControl_1 = require("./SegmentedControl");
|
|
29
33
|
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
30
34
|
const container = {
|
|
31
35
|
display: 'flex',
|
|
32
36
|
flexDirection: 'column',
|
|
33
37
|
gap: 20,
|
|
34
|
-
color: colors_1.
|
|
38
|
+
color: colors_1.LIGHT_TEXT,
|
|
35
39
|
fontFamily: 'sans-serif',
|
|
36
40
|
fontSize: 13,
|
|
37
41
|
lineHeight: 1.5,
|
|
@@ -50,7 +54,7 @@ const sectionStyle = {
|
|
|
50
54
|
};
|
|
51
55
|
const sectionTitleStyle = {
|
|
52
56
|
margin: 0,
|
|
53
|
-
color: colors_1.
|
|
57
|
+
color: colors_1.LIGHT_TEXT,
|
|
54
58
|
fontFamily: 'sans-serif',
|
|
55
59
|
fontSize: 13,
|
|
56
60
|
fontWeight: 600,
|
|
@@ -78,7 +82,7 @@ const metadataTermStyle = {
|
|
|
78
82
|
const metadataDescriptionStyle = {
|
|
79
83
|
margin: 0,
|
|
80
84
|
minWidth: 0,
|
|
81
|
-
color: colors_1.
|
|
85
|
+
color: colors_1.LIGHT_TEXT,
|
|
82
86
|
fontFamily: 'sans-serif',
|
|
83
87
|
fontSize: 13,
|
|
84
88
|
fontWeight: 400,
|
|
@@ -121,10 +125,12 @@ const dependencyListStyle = {
|
|
|
121
125
|
margin: 0,
|
|
122
126
|
padding: 0,
|
|
123
127
|
listStyleType: 'none',
|
|
128
|
+
textAlign: 'right',
|
|
129
|
+
minWidth: 0,
|
|
124
130
|
};
|
|
125
131
|
const dependencyNameStyle = {
|
|
126
132
|
minWidth: 0,
|
|
127
|
-
color: colors_1.
|
|
133
|
+
color: colors_1.LIGHT_TEXT,
|
|
128
134
|
fontFamily: 'sans-serif',
|
|
129
135
|
fontSize: 13,
|
|
130
136
|
lineHeight: 1.5,
|
|
@@ -137,9 +143,9 @@ const warningStyle = {
|
|
|
137
143
|
minWidth: 0,
|
|
138
144
|
};
|
|
139
145
|
const warningIconStyle = {
|
|
140
|
-
width:
|
|
141
|
-
height:
|
|
142
|
-
marginTop:
|
|
146
|
+
width: 14,
|
|
147
|
+
height: 14,
|
|
148
|
+
marginTop: 2,
|
|
143
149
|
flexShrink: 0,
|
|
144
150
|
fill: colors_1.WARNING_COLOR,
|
|
145
151
|
};
|
|
@@ -152,10 +158,6 @@ const warningDescriptionStyle = {
|
|
|
152
158
|
fontWeight: 400,
|
|
153
159
|
lineHeight: 1.5,
|
|
154
160
|
};
|
|
155
|
-
const installWarningDescriptionStyle = {
|
|
156
|
-
...warningDescriptionStyle,
|
|
157
|
-
color: colors_1.WHITE,
|
|
158
|
-
};
|
|
159
161
|
const browseElementsStyle = {
|
|
160
162
|
color: 'inherit',
|
|
161
163
|
fontFamily: 'inherit',
|
|
@@ -171,22 +173,32 @@ const sourceDetailsStyle = {
|
|
|
171
173
|
};
|
|
172
174
|
const sourceSummaryStyle = {
|
|
173
175
|
cursor: 'default',
|
|
174
|
-
|
|
176
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
177
|
+
idleBackground: colors_1.TRANSPARENT,
|
|
178
|
+
hoverBackground: colors_1.TRANSPARENT,
|
|
179
|
+
idleColor: colors_1.LIGHT_TEXT,
|
|
180
|
+
hoverColor: colors_1.WHITE,
|
|
181
|
+
}),
|
|
175
182
|
fontFamily: 'sans-serif',
|
|
176
183
|
fontSize: 13,
|
|
177
184
|
fontWeight: 500,
|
|
178
185
|
lineHeight: 1.5,
|
|
179
186
|
};
|
|
180
|
-
const
|
|
187
|
+
const sourceCodeContainerStyle = {
|
|
181
188
|
marginTop: 10,
|
|
182
|
-
|
|
183
|
-
maxHeight: 240,
|
|
184
|
-
overflow: 'auto',
|
|
185
|
-
padding: 12,
|
|
189
|
+
overflow: 'hidden',
|
|
186
190
|
border: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
187
191
|
borderRadius: 6,
|
|
192
|
+
};
|
|
193
|
+
const sourceCodeBlockStyle = {
|
|
188
194
|
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
189
|
-
|
|
195
|
+
margin: 0,
|
|
196
|
+
border: 0,
|
|
197
|
+
borderRadius: 0,
|
|
198
|
+
maxWidth: 'none',
|
|
199
|
+
maxHeight: 240,
|
|
200
|
+
overflow: 'auto',
|
|
201
|
+
padding: 12,
|
|
190
202
|
fontFamily: 'monospace',
|
|
191
203
|
fontSize: 12,
|
|
192
204
|
lineHeight: 1.5,
|
|
@@ -206,36 +218,6 @@ const destinationControlStyle = {
|
|
|
206
218
|
rowGap: 10,
|
|
207
219
|
flexWrap: 'wrap',
|
|
208
220
|
};
|
|
209
|
-
const destinationOptionsStyle = {
|
|
210
|
-
display: 'flex',
|
|
211
|
-
overflow: 'hidden',
|
|
212
|
-
maxWidth: '100%',
|
|
213
|
-
marginLeft: 'auto',
|
|
214
|
-
border: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
215
|
-
borderRadius: 4,
|
|
216
|
-
};
|
|
217
|
-
const destinationOptionStyle = {
|
|
218
|
-
appearance: 'none',
|
|
219
|
-
minHeight: 26,
|
|
220
|
-
border: 0,
|
|
221
|
-
cursor: 'default',
|
|
222
|
-
fontFamily: 'sans-serif',
|
|
223
|
-
fontSize: 12,
|
|
224
|
-
fontWeight: 400,
|
|
225
|
-
lineHeight: '18px',
|
|
226
|
-
padding: '4px 8px',
|
|
227
|
-
whiteSpace: 'nowrap',
|
|
228
|
-
};
|
|
229
|
-
const getDestinationOptionStyle = ({ disabled, selected, }) => ({
|
|
230
|
-
...destinationOptionStyle,
|
|
231
|
-
opacity: disabled ? 0.5 : 1,
|
|
232
|
-
...(0, hoverable_1.hoverableStyle)({
|
|
233
|
-
idleBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
|
|
234
|
-
hoverBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
|
|
235
|
-
idleColor: selected ? colors_1.WHITE : colors_1.LIGHT_TEXT,
|
|
236
|
-
hoverColor: disabled ? colors_1.LIGHT_TEXT : colors_1.WHITE,
|
|
237
|
-
}),
|
|
238
|
-
});
|
|
239
221
|
const footerStyle = {
|
|
240
222
|
minWidth: 0,
|
|
241
223
|
};
|
|
@@ -267,8 +249,9 @@ const ElementLibraryAddConfirmation = ({ displayName, origin, url }) => {
|
|
|
267
249
|
};
|
|
268
250
|
exports.ElementLibraryAddConfirmation = ElementLibraryAddConfirmation;
|
|
269
251
|
const ElementInstallConfirmation = ({ state }) => {
|
|
270
|
-
var _a;
|
|
252
|
+
var _a, _b, _c, _d, _e, _f;
|
|
271
253
|
const { currentPlan, missingPackages, newPlan, onClose, request, sourceIsUnverified, sourceLabel, } = state;
|
|
254
|
+
const sourcePreview = (0, react_1.useMemo)(() => makeSourceControlsVisible(request.element.sourceCode), [request.element.sourceCode]);
|
|
272
255
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
273
256
|
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
274
257
|
const currentCompositionMetadata = config === null ||
|
|
@@ -281,15 +264,12 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
281
264
|
height: config.height,
|
|
282
265
|
width: config.width,
|
|
283
266
|
};
|
|
284
|
-
const usesBrowserDependencyResolution = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
285
267
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
286
268
|
const [mode, setMode] = (0, react_1.useState)(currentPlan === null || request.source.type === 'browser-studio-link'
|
|
287
269
|
? 'new-composition'
|
|
288
270
|
: 'current-composition');
|
|
289
271
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
290
272
|
const inputRef = (0, react_1.useRef)(null);
|
|
291
|
-
const currentDestinationRef = (0, react_1.useRef)(null);
|
|
292
|
-
const newDestinationRef = (0, react_1.useRef)(null);
|
|
293
273
|
const [newCompositionValues, setNewCompositionValues] = (0, react_1.useState)(() => {
|
|
294
274
|
var _a, _b, _c, _d, _e;
|
|
295
275
|
const elementComponentName = (_a = studio_protocol_1.StudioProtocolInternals.getElementComponentNameFromSourceCode(request.element.sourceCode)) !== null && _a !== void 0 ? _a : 'Element';
|
|
@@ -353,6 +333,7 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
353
333
|
type: 'loading',
|
|
354
334
|
});
|
|
355
335
|
(0, element_install_api_1.prepareElementInstall)({
|
|
336
|
+
installationName: null,
|
|
356
337
|
destination: {
|
|
357
338
|
type: 'new-composition',
|
|
358
339
|
compositionFile: folderCompositionFile,
|
|
@@ -388,7 +369,7 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
388
369
|
canceled = true;
|
|
389
370
|
};
|
|
390
371
|
}, [folderCompositionFile, newPlan, request.element, selectedFolderStack]);
|
|
391
|
-
const { createComposition, heightValidationMessage, nameValidationMessage, valid: newCompositionValuesAreValid, widthValidationMessage, } = (0, use_create_composition_1.useCreateComposition)({
|
|
372
|
+
const { compositionId: newCompositionId, createComposition, heightValidationMessage, nameValidationMessage, valid: newCompositionValuesAreValid, widthValidationMessage, } = (0, use_create_composition_1.useCreateComposition)({
|
|
392
373
|
canvasCapture: null,
|
|
393
374
|
compositions,
|
|
394
375
|
durationInFrames: newCompositionValues.durationInFrames,
|
|
@@ -405,25 +386,151 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
405
386
|
? activeNewCompositionPlanState.plan
|
|
406
387
|
: null;
|
|
407
388
|
const selectedPlan = mode === 'current-composition' ? currentPlan : selectedNewCompositionPlan;
|
|
389
|
+
const elementBaseName = (_b = request.element.slug.split('/').at(-1)) !== null && _b !== void 0 ? _b : '';
|
|
390
|
+
const [refreshPlan, setRefreshPlan] = (0, react_1.useState)(0);
|
|
391
|
+
const [input, setInput] = (0, react_1.useState)({
|
|
392
|
+
basePlan: selectedPlan,
|
|
393
|
+
baseName: elementBaseName,
|
|
394
|
+
refresh: refreshPlan,
|
|
395
|
+
name: null,
|
|
396
|
+
overwritePlan: null,
|
|
397
|
+
});
|
|
398
|
+
if (input.basePlan !== selectedPlan ||
|
|
399
|
+
input.baseName !== elementBaseName ||
|
|
400
|
+
input.refresh !== refreshPlan) {
|
|
401
|
+
setInput({
|
|
402
|
+
basePlan: selectedPlan,
|
|
403
|
+
baseName: elementBaseName,
|
|
404
|
+
refresh: refreshPlan,
|
|
405
|
+
name: null,
|
|
406
|
+
overwritePlan: null,
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
const requestedName = input.name;
|
|
410
|
+
const [preparation, setPreparation] = (0, react_1.useState)(null);
|
|
411
|
+
const currentPreparation = (preparation === null || preparation === void 0 ? void 0 : preparation.basePlan) === selectedPlan &&
|
|
412
|
+
(preparation === null || preparation === void 0 ? void 0 : preparation.refresh) === refreshPlan &&
|
|
413
|
+
(preparation === null || preparation === void 0 ? void 0 : preparation.requestedName) === requestedName
|
|
414
|
+
? preparation
|
|
415
|
+
: null;
|
|
416
|
+
const preparedInstallation = (_c = currentPreparation === null || currentPreparation === void 0 ? void 0 : currentPreparation.installation) !== null && _c !== void 0 ? _c : null;
|
|
417
|
+
const planError = (_d = currentPreparation === null || currentPreparation === void 0 ? void 0 : currentPreparation.error) !== null && _d !== void 0 ? _d : null;
|
|
418
|
+
const installationName = (_e = requestedName !== null && requestedName !== void 0 ? requestedName : preparedInstallation === null || preparedInstallation === void 0 ? void 0 : preparedInstallation.name) !== null && _e !== void 0 ? _e : elementBaseName;
|
|
419
|
+
const [existingInstallation, setExistingInstallation] = (0, react_1.useState)(null);
|
|
420
|
+
const existingDestination = (existingInstallation === null || existingInstallation === void 0 ? void 0 : existingInstallation.basePlan) === selectedPlan &&
|
|
421
|
+
(existingInstallation === null || existingInstallation === void 0 ? void 0 : existingInstallation.refresh) === refreshPlan
|
|
422
|
+
? existingInstallation
|
|
423
|
+
: null;
|
|
424
|
+
const overwriteExisting = existingDestination !== null &&
|
|
425
|
+
input.overwritePlan === existingDestination.plan;
|
|
426
|
+
const activePlan = overwriteExisting
|
|
427
|
+
? existingDestination.plan
|
|
428
|
+
: ((_f = preparedInstallation === null || preparedInstallation === void 0 ? void 0 : preparedInstallation.plan) !== null && _f !== void 0 ? _f : null);
|
|
429
|
+
const [createdComposition, setCreatedComposition] = (0, react_1.useState)(null);
|
|
430
|
+
const creationKey = JSON.stringify(newCompositionValues);
|
|
431
|
+
const compositionAlreadyCreated = createdComposition === creationKey;
|
|
432
|
+
(0, react_1.useEffect)(() => {
|
|
433
|
+
if (selectedPlan === null) {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
let canceled = false;
|
|
437
|
+
(async () => {
|
|
438
|
+
let candidate = requestedName !== null && requestedName !== void 0 ? requestedName : elementBaseName;
|
|
439
|
+
let copyNumber = 1;
|
|
440
|
+
while (true) {
|
|
441
|
+
const result = await (0, element_install_api_1.prepareElementInstall)({
|
|
442
|
+
installationName: candidate,
|
|
443
|
+
destination: mode === 'current-composition'
|
|
444
|
+
? {
|
|
445
|
+
type: 'current-composition',
|
|
446
|
+
compositionFile: request.compositionFile,
|
|
447
|
+
compositionId: request.compositionId,
|
|
448
|
+
}
|
|
449
|
+
: {
|
|
450
|
+
type: 'new-composition',
|
|
451
|
+
compositionFile: selectedPlan.compositionFile,
|
|
452
|
+
},
|
|
453
|
+
element: request.element,
|
|
454
|
+
});
|
|
455
|
+
if (canceled)
|
|
456
|
+
return;
|
|
457
|
+
if (!result.success)
|
|
458
|
+
throw new Error(result.reason);
|
|
459
|
+
const prepared = {
|
|
460
|
+
basePlan: selectedPlan,
|
|
461
|
+
name: candidate,
|
|
462
|
+
refresh: refreshPlan,
|
|
463
|
+
plan: result.plan,
|
|
464
|
+
};
|
|
465
|
+
if (result.plan.expectedFileState.exists) {
|
|
466
|
+
setExistingInstallation((previous) => (previous === null || previous === void 0 ? void 0 : previous.basePlan) === selectedPlan &&
|
|
467
|
+
previous.refresh === refreshPlan
|
|
468
|
+
? previous
|
|
469
|
+
: prepared);
|
|
470
|
+
if (requestedName === null) {
|
|
471
|
+
candidate = `${elementBaseName}-copy${copyNumber === 1 ? '' : `-${copyNumber}`}`;
|
|
472
|
+
copyNumber++;
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
setPreparation({
|
|
477
|
+
basePlan: selectedPlan,
|
|
478
|
+
refresh: refreshPlan,
|
|
479
|
+
requestedName,
|
|
480
|
+
installation: prepared,
|
|
481
|
+
error: null,
|
|
482
|
+
});
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
})().catch((error) => {
|
|
486
|
+
if (!canceled) {
|
|
487
|
+
setPreparation({
|
|
488
|
+
basePlan: selectedPlan,
|
|
489
|
+
refresh: refreshPlan,
|
|
490
|
+
requestedName,
|
|
491
|
+
installation: null,
|
|
492
|
+
error: error instanceof Error ? error.message : String(error),
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
return () => {
|
|
497
|
+
canceled = true;
|
|
498
|
+
};
|
|
499
|
+
}, [
|
|
500
|
+
elementBaseName,
|
|
501
|
+
requestedName,
|
|
502
|
+
mode,
|
|
503
|
+
refreshPlan,
|
|
504
|
+
request,
|
|
505
|
+
selectedPlan,
|
|
506
|
+
]);
|
|
507
|
+
const installationNameError = installationName.length > 0
|
|
508
|
+
? (planError !== null && planError !== void 0 ? planError : (requestedName !== null && (activePlan === null || activePlan === void 0 ? void 0 : activePlan.expectedFileState.exists)
|
|
509
|
+
? 'Name already taken.'
|
|
510
|
+
: null))
|
|
511
|
+
: null;
|
|
408
512
|
const folderTargetIsReady = selectedFolderStack === null ||
|
|
409
513
|
((0, use_resolved_stack_1.hasResolvedStack)(selectedFolderStack) && folderCompositionFile !== null);
|
|
410
514
|
const title = `Install ${request.element.displayName}${request.element.displayName.endsWith(' Element') ? '' : ' Element'}`;
|
|
411
515
|
const canSubmit = !submitting &&
|
|
516
|
+
(overwriteExisting ||
|
|
517
|
+
(planError === null &&
|
|
518
|
+
studio_protocol_1.StudioProtocolInternals.makeElementFileNameFromSlug(installationName) === `${installationName}.element.tsx` &&
|
|
519
|
+
(activePlan !== null
|
|
520
|
+
? !activePlan.expectedFileState.exists
|
|
521
|
+
: requestedName !== null))) &&
|
|
412
522
|
(mode === 'current-composition'
|
|
413
523
|
? currentPlan !== null
|
|
414
|
-
: newCompositionValuesAreValid &&
|
|
524
|
+
: (newCompositionValuesAreValid || compositionAlreadyCreated) &&
|
|
415
525
|
folderTargetIsReady &&
|
|
416
526
|
selectedNewCompositionPlan !== null);
|
|
417
527
|
const submit = (0, react_1.useCallback)(async () => {
|
|
418
|
-
|
|
528
|
+
var _a, _b;
|
|
529
|
+
if (!canSubmit || selectedPlan === null) {
|
|
419
530
|
return;
|
|
420
531
|
}
|
|
421
532
|
setSubmitting(true);
|
|
422
|
-
if (mode === 'new-composition') {
|
|
423
|
-
if (selectedNewCompositionPlan === null) {
|
|
424
|
-
setSubmitting(false);
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
533
|
+
if (mode === 'new-composition' && !compositionAlreadyCreated) {
|
|
427
534
|
const created = await createComposition({
|
|
428
535
|
signal: new AbortController().signal,
|
|
429
536
|
symbolicatedStack: selectedFolderStack === null ? null : folderSymbolicatedStack,
|
|
@@ -433,115 +540,125 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
433
540
|
setSubmitting(false);
|
|
434
541
|
return;
|
|
435
542
|
}
|
|
436
|
-
|
|
437
|
-
compositionFile: selectedNewCompositionPlan.compositionFile,
|
|
438
|
-
compositionId: newCompositionValues.id,
|
|
439
|
-
element: request.element,
|
|
440
|
-
expectedFileState: selectedNewCompositionPlan.expectedFileState,
|
|
441
|
-
from: null,
|
|
442
|
-
overwriteExisting: selectedNewCompositionPlan.expectedFileState.exists,
|
|
443
|
-
position: null,
|
|
444
|
-
});
|
|
445
|
-
onClose();
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
if (currentPlan === null) {
|
|
449
|
-
setSubmitting(false);
|
|
450
|
-
return;
|
|
543
|
+
setCreatedComposition(creationKey);
|
|
451
544
|
}
|
|
452
|
-
await (0, import_assets_1.insertElement)({
|
|
453
|
-
|
|
454
|
-
|
|
545
|
+
const installed = await (0, import_assets_1.insertElement)({
|
|
546
|
+
installationName: overwriteExisting
|
|
547
|
+
? ((_a = existingDestination === null || existingDestination === void 0 ? void 0 : existingDestination.name) !== null && _a !== void 0 ? _a : installationName)
|
|
548
|
+
: installationName,
|
|
549
|
+
compositionFile: mode === 'new-composition'
|
|
550
|
+
? selectedPlan.compositionFile
|
|
551
|
+
: request.compositionFile,
|
|
552
|
+
compositionId: mode === 'new-composition' ? newCompositionId : request.compositionId,
|
|
455
553
|
element: request.element,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
554
|
+
// The insert operation revalidates this even if the name preflight is pending.
|
|
555
|
+
expectedFileState: (_b = activePlan === null || activePlan === void 0 ? void 0 : activePlan.expectedFileState) !== null && _b !== void 0 ? _b : { exists: false },
|
|
556
|
+
from: mode === 'new-composition' ? null : request.from,
|
|
557
|
+
overwriteExisting,
|
|
558
|
+
position: mode === 'new-composition' ? null : request.position,
|
|
460
559
|
});
|
|
461
|
-
|
|
560
|
+
if (installed)
|
|
561
|
+
onClose();
|
|
562
|
+
else {
|
|
563
|
+
setSubmitting(false);
|
|
564
|
+
setRefreshPlan((value) => value + 1);
|
|
565
|
+
}
|
|
462
566
|
}, [
|
|
567
|
+
activePlan,
|
|
568
|
+
existingDestination,
|
|
569
|
+
compositionAlreadyCreated,
|
|
570
|
+
creationKey,
|
|
571
|
+
installationName,
|
|
572
|
+
overwriteExisting,
|
|
463
573
|
canSubmit,
|
|
464
574
|
createComposition,
|
|
465
|
-
currentPlan,
|
|
466
575
|
folderSymbolicatedStack,
|
|
467
576
|
mode,
|
|
468
|
-
|
|
577
|
+
newCompositionId,
|
|
469
578
|
onClose,
|
|
470
579
|
request,
|
|
471
580
|
selectedFolderStack,
|
|
472
|
-
|
|
581
|
+
selectedPlan,
|
|
473
582
|
]);
|
|
474
583
|
const cancel = (0, react_1.useCallback)(() => {
|
|
475
584
|
if (!submitting) {
|
|
476
585
|
onClose();
|
|
477
586
|
}
|
|
478
587
|
}, [onClose, submitting]);
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
: '
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
});
|
|
500
|
-
}, [currentPlan, mode]);
|
|
588
|
+
const destinationOptions = (0, react_1.useMemo)(() => [
|
|
589
|
+
{
|
|
590
|
+
key: 'current-composition',
|
|
591
|
+
label: 'Current composition',
|
|
592
|
+
selected: mode === 'current-composition',
|
|
593
|
+
onClick: currentPlan === null ? null : () => setMode('current-composition'),
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
key: 'new-composition',
|
|
597
|
+
label: 'New composition',
|
|
598
|
+
selected: mode === 'new-composition',
|
|
599
|
+
onClick: () => {
|
|
600
|
+
setMode('new-composition');
|
|
601
|
+
requestAnimationFrame(() => {
|
|
602
|
+
var _a;
|
|
603
|
+
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
604
|
+
});
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
], [currentPlan, mode]);
|
|
501
608
|
const onSubmit = (0, react_1.useCallback)((event) => {
|
|
502
609
|
event.preventDefault();
|
|
503
610
|
submit();
|
|
504
611
|
}, [submit]);
|
|
505
612
|
return (0, react_dom_1.createPortal)(jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { ariaLabelledBy: elementInstallTitleId, onOutsideClick: cancel, onEscape: cancel, children: [
|
|
506
613
|
jsx_runtime_1.jsx("div", { id: elementInstallTitleId, children: jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: title, onClose: cancel }) }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
507
|
-
jsx_runtime_1.jsxs("div", { style: dialogContent, children: [
|
|
614
|
+
jsx_runtime_1.jsxs("div", { style: dialogContent, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
|
|
508
615
|
jsx_runtime_1.jsxs("dl", { style: requestSourceStyle, "aria-label": "Request source", children: [
|
|
509
616
|
jsx_runtime_1.jsx("dt", { style: sectionTitleStyle, children: "From" }), jsx_runtime_1.jsx("dd", { style: sourceIsUnverified
|
|
510
617
|
? unverifiedRequestSourceStyle
|
|
511
618
|
: requestSourceDescriptionStyle, children: sourceLabel })
|
|
512
|
-
] }), jsx_runtime_1.jsxs("
|
|
513
|
-
jsx_runtime_1.jsx("
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
selected: mode === 'current-composition',
|
|
517
|
-
}), tabIndex: mode === 'current-composition' ? 0 : -1, type: "button", children: "Current composition" }), jsx_runtime_1.jsx("button", { ref: newDestinationRef, "aria-checked": mode === 'new-composition', className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: () => {
|
|
518
|
-
setMode('new-composition');
|
|
519
|
-
requestAnimationFrame(() => {
|
|
520
|
-
var _a;
|
|
521
|
-
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
522
|
-
});
|
|
523
|
-
}, role: "radio", style: {
|
|
524
|
-
...getDestinationOptionStyle({
|
|
525
|
-
disabled: false,
|
|
526
|
-
selected: mode === 'new-composition',
|
|
527
|
-
}),
|
|
528
|
-
borderLeft: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
529
|
-
}, tabIndex: mode === 'new-composition' ? 0 : -1, type: "button", children: "New composition" })
|
|
530
|
-
] })
|
|
619
|
+
] }), activePlan ? (jsx_runtime_1.jsxs("dl", { style: requestSourceStyle, children: [
|
|
620
|
+
jsx_runtime_1.jsx("dt", { style: sectionTitleStyle, children: "Destination" }), jsx_runtime_1.jsx("dd", { style: requestSourceDescriptionStyle, children: activePlan.filePath })
|
|
621
|
+
] })) : null, jsx_runtime_1.jsxs("div", { style: destinationControlStyle, children: [
|
|
622
|
+
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" }) })
|
|
531
623
|
] }), currentPlan === null ? (jsx_runtime_1.jsxs("div", { style: warningStyle, role: "status", children: [
|
|
532
|
-
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style:
|
|
533
|
-
] })) : null, mode === 'new-composition' ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-label": "New composition settings", children: [
|
|
534
|
-
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,
|
|
624
|
+
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."] })
|
|
625
|
+
] })) : null, mode === 'new-composition' ? (jsx_runtime_1.jsxs("section", { style: { ...sectionStyle, marginInline: -16 }, "aria-label": "New composition settings", children: [
|
|
626
|
+
jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { compositionId: newCompositionId, heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: compositionAlreadyCreated ? null : 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.jsx("section", { style: sectionStyle, "aria-label": "Element implementation", children: existingDestination ? (jsx_runtime_1.jsxs("div", { role: "radiogroup", "aria-label": "Existing Element file", style: sectionStyle, children: [
|
|
627
|
+
jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: !overwriteExisting, disabled: submitting, onClick: () => setInput((previous) => ({ ...previous, overwritePlan: null })), children: "Create a copy" }), !overwriteExisting ? (jsx_runtime_1.jsxs("div", { style: {
|
|
628
|
+
...sectionStyle,
|
|
629
|
+
paddingLeft: 28,
|
|
630
|
+
maxWidth: 320,
|
|
631
|
+
minWidth: 0,
|
|
632
|
+
}, children: [
|
|
633
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { rightAlign: false, status: installationNameError ? 'error' : 'ok', id: "element-install-name", name: "installationName", "aria-label": "Installation name", placeholder: "New name", value: installationName, disabled: submitting, onChange: (event) => {
|
|
634
|
+
const name = event.target.value;
|
|
635
|
+
setInput((previous) => ({
|
|
636
|
+
...previous,
|
|
637
|
+
name,
|
|
638
|
+
overwritePlan: null,
|
|
639
|
+
}));
|
|
640
|
+
} }), installationNameError ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: installationNameError, type: "error" })) : null] })) : null, jsx_runtime_1.jsxs("div", { style: sectionStyle, children: [
|
|
641
|
+
jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: overwriteExisting, disabled: submitting, onClick: () => setInput((previous) => ({
|
|
642
|
+
...previous,
|
|
643
|
+
overwritePlan: existingDestination.plan,
|
|
644
|
+
})), children: "Replace existing" }), jsx_runtime_1.jsx("p", { style: {
|
|
645
|
+
...warningDescriptionStyle,
|
|
646
|
+
paddingLeft: 28,
|
|
647
|
+
overflowWrap: 'anywhere',
|
|
648
|
+
}, children: existingDestination.plan.filePath }), overwriteExisting ? (jsx_runtime_1.jsx("p", { style: { ...overwriteStyle, paddingLeft: 28 }, children: "Overwrites customizations for all usages." })) : null] })
|
|
649
|
+
] })) : !activePlan && planError ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: planError, type: "error" })) : null }), missingPackages.length > 0 ? (jsx_runtime_1.jsxs("section", { style: requestSourceStyle, "aria-labelledby": "element-install-dependencies", children: [
|
|
535
650
|
jsx_runtime_1.jsx("h3", { id: "element-install-dependencies", style: sectionTitleStyle, children: "Packages to install" }), jsx_runtime_1.jsx("ul", { style: dependencyListStyle, role: "list", children: missingPackages.map((packageName) => (jsx_runtime_1.jsx("li", { style: dependencyNameStyle, children: packageName }, packageName))) })
|
|
536
651
|
] })) : null, jsx_runtime_1.jsxs("div", { style: warningStyle, children: [
|
|
537
|
-
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.
|
|
538
|
-
? null
|
|
539
|
-
: ' Package lifecycle scripts may also run during installation.'] })
|
|
652
|
+
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsx("p", { style: warningDescriptionStyle, children: "Installed code can access your files and network." })
|
|
540
653
|
] }), jsx_runtime_1.jsxs("details", { style: sourceDetailsStyle, children: [
|
|
541
|
-
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:
|
|
654
|
+
jsx_runtime_1.jsx("summary", { className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: sourceSummaryStyle, children: "Source code" }), jsx_runtime_1.jsx("div", { style: sourceCodeContainerStyle, children: jsx_runtime_1.jsx("pre", { className: `language-tsx ${is_menu_item_1.HORIZONTAL_SCROLLBAR_CLASSNAME} ${is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: jsx_runtime_1.jsx(LazySyntaxHighlightedSource_1.LazySyntaxHighlightedSource, { source: sourcePreview }) }) }) })
|
|
542
655
|
] })
|
|
543
656
|
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footerStyle, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
544
|
-
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
|
|
657
|
+
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
|
|
658
|
+
? 'Installing…'
|
|
659
|
+
: overwriteExisting
|
|
660
|
+
? 'Replace and insert'
|
|
661
|
+
: 'Install', jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: false })
|
|
545
662
|
] })
|
|
546
663
|
] }) })
|
|
547
664
|
] })
|