@remotion/studio 4.0.522 → 4.0.523
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/AssetAudioVolume.d.ts +5 -0
- package/dist/components/AssetAudioVolume.js +33 -0
- package/dist/components/Canvas.js +5 -6
- package/dist/components/CaptionInspector.js +74 -20
- package/dist/components/CheckboardToggle.js +8 -6
- 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 +287 -135
- package/dist/components/FixComputedValueModal.js +38 -8
- package/dist/components/FullscreenToggle.js +9 -8
- package/dist/components/GlobalKeybindings.js +50 -49
- package/dist/components/HighlightedElementSource.d.ts +5 -0
- package/dist/components/HighlightedElementSource.js +78 -0
- 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 +64 -1
- package/dist/components/InstallPackage.js +4 -5
- package/dist/components/KeyboardShortcutsSettings.js +212 -33
- package/dist/components/MenuToolbar.js +7 -5
- 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/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/NewFolder.js +11 -8
- package/dist/components/NewComposition/RenameFolder.js +17 -10
- package/dist/components/OptionalPackageModal.d.ts +11 -0
- package/dist/components/OptionalPackageModal.js +155 -0
- package/dist/components/PlayPause.js +4 -8
- package/dist/components/PlaybackKeyboardShortcutsManager.js +3 -6
- package/dist/components/PreviewToolbarOverflowButton.js +11 -2
- 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 +129 -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/RenderQueueItem.js +3 -3
- package/dist/components/RenderQueue/VideoMattingQueueItem.d.ts +6 -0
- package/dist/components/RenderQueue/VideoMattingQueueItem.js +129 -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/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 +49 -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 +10 -11
- package/dist/components/SizeSelector.js +10 -2
- package/dist/components/SkillsSettings.js +2 -3
- package/dist/components/SnappingToggle.js +5 -2
- 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 +2 -42
- 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/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/use-asset-timeline-context-menu.d.ts +2 -0
- package/dist/components/Timeline/use-asset-timeline-context-menu.js +52 -0
- package/dist/components/TimelineInOutToggle.js +20 -17
- 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/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 +177 -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/esm/CaptionQueueProcessor-k0yrm3dj.mjs +211 -0
- package/dist/esm/HighlightedElementSource-jfc66k4p.mjs +1236 -0
- package/dist/esm/LazyModels-2trdm224.mjs +11 -0
- package/dist/esm/LazyModels-fjb5ckaq.mjs +11 -0
- package/dist/esm/TranscriptionModal-916jqhry.mjs +1011 -0
- package/dist/esm/VideoMattingModal-2tm79s9b.mjs +374 -0
- package/dist/esm/VideoMattingQueueProcessor-t1hgm2rm.mjs +109 -0
- package/dist/esm/index-1x7bsdh6.mjs +261 -0
- package/dist/esm/index-3hgr6gjx.mjs +41 -0
- package/dist/esm/index-5qddp5h7.mjs +36 -0
- package/dist/esm/index-5zrb1ft4.mjs +39 -0
- package/dist/esm/index-6cvm9a65.mjs +45923 -0
- package/dist/esm/index-7tt71e8n.mjs +36 -0
- package/dist/esm/index-9x6e1dq0.mjs +428 -0
- package/dist/esm/index-cw0pnpg5.mjs +50 -0
- package/dist/esm/index-czwvnn9g.mjs +35 -0
- package/dist/esm/index-hy4xcgty.mjs +1366 -0
- package/dist/esm/{chunk-je0h1bgt.js → index-jg13hf2g.mjs} +3 -1
- package/dist/esm/{chunk-6jf1natv.js → index-rcv7qkt5.mjs} +18 -1
- package/dist/esm/index-sgtmgc4h.mjs +423 -0
- package/dist/esm/index-te66vvrp.mjs +142 -0
- package/dist/esm/index-v4tr1bft.mjs +20 -0
- package/dist/esm/index-x7t2y7ws.mjs +54194 -0
- package/dist/esm/index-xhe2m2qr.mjs +1146 -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 +3 -3
- package/dist/esm/{chunk-m0jqdbkr.js → resolve-composition-component-location-14148845.mjs} +1 -1
- 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-tomorrow.d.ts +1 -0
- package/dist/helpers/prism-tomorrow.js +151 -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-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 +58 -13
- 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/transcription.d.ts +4 -0
- package/dist/icons/transcription.js +7 -0
- package/dist/icons/upload.js +1 -1
- package/dist/state/modals.d.ts +14 -2
- package/package.json +34 -20
- package/dist/components/UpdateCheck.d.ts +0 -1
- package/dist/components/UpdateCheck.js +0 -79
- package/dist/esm/chunk-3netyjd9.js +0 -99793
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.ElementInstallConfirmation = exports.ElementLibraryAddConfirmation = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -7,7 +40,6 @@ const react_1 = require("react");
|
|
|
7
40
|
const react_dom_1 = require("react-dom");
|
|
8
41
|
const remotion_1 = require("remotion");
|
|
9
42
|
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
10
|
-
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
11
43
|
const colors_1 = require("../helpers/colors");
|
|
12
44
|
const hoverable_1 = require("../helpers/hoverable");
|
|
13
45
|
const resolved_stack_to_symbolicated_1 = require("../helpers/resolved-stack-to-symbolicated");
|
|
@@ -18,20 +50,25 @@ const Button_1 = require("./Button");
|
|
|
18
50
|
const element_install_api_1 = require("./element-install-api");
|
|
19
51
|
const import_assets_1 = require("./import-assets");
|
|
20
52
|
const layout_1 = require("./layout");
|
|
53
|
+
const is_menu_item_1 = require("./Menu/is-menu-item");
|
|
21
54
|
const portals_1 = require("./Menu/portals");
|
|
22
55
|
const ModalButton_1 = require("./ModalButton");
|
|
23
56
|
const ModalContainer_1 = require("./ModalContainer");
|
|
24
57
|
const ModalFooter_1 = require("./ModalFooter");
|
|
25
58
|
const ModalHeader_1 = require("./ModalHeader");
|
|
26
59
|
const NewComposition_1 = require("./NewComposition/NewComposition");
|
|
60
|
+
const RemInput_1 = require("./NewComposition/RemInput");
|
|
27
61
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
28
62
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
63
|
+
const RadioButton_1 = require("./RadioButton");
|
|
64
|
+
const SegmentedControl_1 = require("./SegmentedControl");
|
|
29
65
|
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
66
|
+
const HighlightedElementSource = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./HighlightedElementSource'))));
|
|
30
67
|
const container = {
|
|
31
68
|
display: 'flex',
|
|
32
69
|
flexDirection: 'column',
|
|
33
70
|
gap: 20,
|
|
34
|
-
color: colors_1.
|
|
71
|
+
color: colors_1.LIGHT_TEXT,
|
|
35
72
|
fontFamily: 'sans-serif',
|
|
36
73
|
fontSize: 13,
|
|
37
74
|
lineHeight: 1.5,
|
|
@@ -50,7 +87,7 @@ const sectionStyle = {
|
|
|
50
87
|
};
|
|
51
88
|
const sectionTitleStyle = {
|
|
52
89
|
margin: 0,
|
|
53
|
-
color: colors_1.
|
|
90
|
+
color: colors_1.LIGHT_TEXT,
|
|
54
91
|
fontFamily: 'sans-serif',
|
|
55
92
|
fontSize: 13,
|
|
56
93
|
fontWeight: 600,
|
|
@@ -78,7 +115,7 @@ const metadataTermStyle = {
|
|
|
78
115
|
const metadataDescriptionStyle = {
|
|
79
116
|
margin: 0,
|
|
80
117
|
minWidth: 0,
|
|
81
|
-
color: colors_1.
|
|
118
|
+
color: colors_1.LIGHT_TEXT,
|
|
82
119
|
fontFamily: 'sans-serif',
|
|
83
120
|
fontSize: 13,
|
|
84
121
|
fontWeight: 400,
|
|
@@ -121,10 +158,12 @@ const dependencyListStyle = {
|
|
|
121
158
|
margin: 0,
|
|
122
159
|
padding: 0,
|
|
123
160
|
listStyleType: 'none',
|
|
161
|
+
textAlign: 'right',
|
|
162
|
+
minWidth: 0,
|
|
124
163
|
};
|
|
125
164
|
const dependencyNameStyle = {
|
|
126
165
|
minWidth: 0,
|
|
127
|
-
color: colors_1.
|
|
166
|
+
color: colors_1.LIGHT_TEXT,
|
|
128
167
|
fontFamily: 'sans-serif',
|
|
129
168
|
fontSize: 13,
|
|
130
169
|
lineHeight: 1.5,
|
|
@@ -137,9 +176,9 @@ const warningStyle = {
|
|
|
137
176
|
minWidth: 0,
|
|
138
177
|
};
|
|
139
178
|
const warningIconStyle = {
|
|
140
|
-
width:
|
|
141
|
-
height:
|
|
142
|
-
marginTop:
|
|
179
|
+
width: 14,
|
|
180
|
+
height: 14,
|
|
181
|
+
marginTop: 2,
|
|
143
182
|
flexShrink: 0,
|
|
144
183
|
fill: colors_1.WARNING_COLOR,
|
|
145
184
|
};
|
|
@@ -152,10 +191,6 @@ const warningDescriptionStyle = {
|
|
|
152
191
|
fontWeight: 400,
|
|
153
192
|
lineHeight: 1.5,
|
|
154
193
|
};
|
|
155
|
-
const installWarningDescriptionStyle = {
|
|
156
|
-
...warningDescriptionStyle,
|
|
157
|
-
color: colors_1.WHITE,
|
|
158
|
-
};
|
|
159
194
|
const browseElementsStyle = {
|
|
160
195
|
color: 'inherit',
|
|
161
196
|
fontFamily: 'inherit',
|
|
@@ -171,22 +206,32 @@ const sourceDetailsStyle = {
|
|
|
171
206
|
};
|
|
172
207
|
const sourceSummaryStyle = {
|
|
173
208
|
cursor: 'default',
|
|
174
|
-
|
|
209
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
210
|
+
idleBackground: colors_1.TRANSPARENT,
|
|
211
|
+
hoverBackground: colors_1.TRANSPARENT,
|
|
212
|
+
idleColor: colors_1.LIGHT_TEXT,
|
|
213
|
+
hoverColor: colors_1.WHITE,
|
|
214
|
+
}),
|
|
175
215
|
fontFamily: 'sans-serif',
|
|
176
216
|
fontSize: 13,
|
|
177
217
|
fontWeight: 500,
|
|
178
218
|
lineHeight: 1.5,
|
|
179
219
|
};
|
|
180
|
-
const
|
|
220
|
+
const sourceCodeContainerStyle = {
|
|
181
221
|
marginTop: 10,
|
|
182
|
-
|
|
183
|
-
maxHeight: 240,
|
|
184
|
-
overflow: 'auto',
|
|
185
|
-
padding: 12,
|
|
222
|
+
overflow: 'hidden',
|
|
186
223
|
border: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
187
224
|
borderRadius: 6,
|
|
225
|
+
};
|
|
226
|
+
const sourceCodeBlockStyle = {
|
|
188
227
|
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
189
|
-
|
|
228
|
+
margin: 0,
|
|
229
|
+
border: 0,
|
|
230
|
+
borderRadius: 0,
|
|
231
|
+
maxWidth: 'none',
|
|
232
|
+
maxHeight: 240,
|
|
233
|
+
overflow: 'auto',
|
|
234
|
+
padding: 12,
|
|
190
235
|
fontFamily: 'monospace',
|
|
191
236
|
fontSize: 12,
|
|
192
237
|
lineHeight: 1.5,
|
|
@@ -206,36 +251,6 @@ const destinationControlStyle = {
|
|
|
206
251
|
rowGap: 10,
|
|
207
252
|
flexWrap: 'wrap',
|
|
208
253
|
};
|
|
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
254
|
const footerStyle = {
|
|
240
255
|
minWidth: 0,
|
|
241
256
|
};
|
|
@@ -267,8 +282,9 @@ const ElementLibraryAddConfirmation = ({ displayName, origin, url }) => {
|
|
|
267
282
|
};
|
|
268
283
|
exports.ElementLibraryAddConfirmation = ElementLibraryAddConfirmation;
|
|
269
284
|
const ElementInstallConfirmation = ({ state }) => {
|
|
270
|
-
var _a;
|
|
285
|
+
var _a, _b, _c, _d, _e, _f;
|
|
271
286
|
const { currentPlan, missingPackages, newPlan, onClose, request, sourceIsUnverified, sourceLabel, } = state;
|
|
287
|
+
const sourcePreview = (0, react_1.useMemo)(() => makeSourceControlsVisible(request.element.sourceCode), [request.element.sourceCode]);
|
|
272
288
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
273
289
|
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
274
290
|
const currentCompositionMetadata = config === null ||
|
|
@@ -281,15 +297,12 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
281
297
|
height: config.height,
|
|
282
298
|
width: config.width,
|
|
283
299
|
};
|
|
284
|
-
const usesBrowserDependencyResolution = (0, browser_studio_operations_1.getBrowserStudioOperations)() !== null;
|
|
285
300
|
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
286
301
|
const [mode, setMode] = (0, react_1.useState)(currentPlan === null || request.source.type === 'browser-studio-link'
|
|
287
302
|
? 'new-composition'
|
|
288
303
|
: 'current-composition');
|
|
289
304
|
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
290
305
|
const inputRef = (0, react_1.useRef)(null);
|
|
291
|
-
const currentDestinationRef = (0, react_1.useRef)(null);
|
|
292
|
-
const newDestinationRef = (0, react_1.useRef)(null);
|
|
293
306
|
const [newCompositionValues, setNewCompositionValues] = (0, react_1.useState)(() => {
|
|
294
307
|
var _a, _b, _c, _d, _e;
|
|
295
308
|
const elementComponentName = (_a = studio_protocol_1.StudioProtocolInternals.getElementComponentNameFromSourceCode(request.element.sourceCode)) !== null && _a !== void 0 ? _a : 'Element';
|
|
@@ -353,6 +366,7 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
353
366
|
type: 'loading',
|
|
354
367
|
});
|
|
355
368
|
(0, element_install_api_1.prepareElementInstall)({
|
|
369
|
+
installationName: null,
|
|
356
370
|
destination: {
|
|
357
371
|
type: 'new-composition',
|
|
358
372
|
compositionFile: folderCompositionFile,
|
|
@@ -405,25 +419,151 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
405
419
|
? activeNewCompositionPlanState.plan
|
|
406
420
|
: null;
|
|
407
421
|
const selectedPlan = mode === 'current-composition' ? currentPlan : selectedNewCompositionPlan;
|
|
422
|
+
const elementBaseName = (_b = request.element.slug.split('/').at(-1)) !== null && _b !== void 0 ? _b : '';
|
|
423
|
+
const [refreshPlan, setRefreshPlan] = (0, react_1.useState)(0);
|
|
424
|
+
const [input, setInput] = (0, react_1.useState)({
|
|
425
|
+
basePlan: selectedPlan,
|
|
426
|
+
baseName: elementBaseName,
|
|
427
|
+
refresh: refreshPlan,
|
|
428
|
+
name: null,
|
|
429
|
+
overwritePlan: null,
|
|
430
|
+
});
|
|
431
|
+
if (input.basePlan !== selectedPlan ||
|
|
432
|
+
input.baseName !== elementBaseName ||
|
|
433
|
+
input.refresh !== refreshPlan) {
|
|
434
|
+
setInput({
|
|
435
|
+
basePlan: selectedPlan,
|
|
436
|
+
baseName: elementBaseName,
|
|
437
|
+
refresh: refreshPlan,
|
|
438
|
+
name: null,
|
|
439
|
+
overwritePlan: null,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
const requestedName = input.name;
|
|
443
|
+
const [preparation, setPreparation] = (0, react_1.useState)(null);
|
|
444
|
+
const currentPreparation = (preparation === null || preparation === void 0 ? void 0 : preparation.basePlan) === selectedPlan &&
|
|
445
|
+
(preparation === null || preparation === void 0 ? void 0 : preparation.refresh) === refreshPlan &&
|
|
446
|
+
(preparation === null || preparation === void 0 ? void 0 : preparation.requestedName) === requestedName
|
|
447
|
+
? preparation
|
|
448
|
+
: null;
|
|
449
|
+
const preparedInstallation = (_c = currentPreparation === null || currentPreparation === void 0 ? void 0 : currentPreparation.installation) !== null && _c !== void 0 ? _c : null;
|
|
450
|
+
const planError = (_d = currentPreparation === null || currentPreparation === void 0 ? void 0 : currentPreparation.error) !== null && _d !== void 0 ? _d : null;
|
|
451
|
+
const installationName = (_e = requestedName !== null && requestedName !== void 0 ? requestedName : preparedInstallation === null || preparedInstallation === void 0 ? void 0 : preparedInstallation.name) !== null && _e !== void 0 ? _e : elementBaseName;
|
|
452
|
+
const [existingInstallation, setExistingInstallation] = (0, react_1.useState)(null);
|
|
453
|
+
const existingDestination = (existingInstallation === null || existingInstallation === void 0 ? void 0 : existingInstallation.basePlan) === selectedPlan &&
|
|
454
|
+
(existingInstallation === null || existingInstallation === void 0 ? void 0 : existingInstallation.refresh) === refreshPlan
|
|
455
|
+
? existingInstallation
|
|
456
|
+
: null;
|
|
457
|
+
const overwriteExisting = existingDestination !== null &&
|
|
458
|
+
input.overwritePlan === existingDestination.plan;
|
|
459
|
+
const activePlan = overwriteExisting
|
|
460
|
+
? existingDestination.plan
|
|
461
|
+
: ((_f = preparedInstallation === null || preparedInstallation === void 0 ? void 0 : preparedInstallation.plan) !== null && _f !== void 0 ? _f : null);
|
|
462
|
+
const [createdComposition, setCreatedComposition] = (0, react_1.useState)(null);
|
|
463
|
+
const creationKey = JSON.stringify(newCompositionValues);
|
|
464
|
+
const compositionAlreadyCreated = createdComposition === creationKey;
|
|
465
|
+
(0, react_1.useEffect)(() => {
|
|
466
|
+
if (selectedPlan === null) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
let canceled = false;
|
|
470
|
+
(async () => {
|
|
471
|
+
let candidate = requestedName !== null && requestedName !== void 0 ? requestedName : elementBaseName;
|
|
472
|
+
let copyNumber = 1;
|
|
473
|
+
while (true) {
|
|
474
|
+
const result = await (0, element_install_api_1.prepareElementInstall)({
|
|
475
|
+
installationName: candidate,
|
|
476
|
+
destination: mode === 'current-composition'
|
|
477
|
+
? {
|
|
478
|
+
type: 'current-composition',
|
|
479
|
+
compositionFile: request.compositionFile,
|
|
480
|
+
compositionId: request.compositionId,
|
|
481
|
+
}
|
|
482
|
+
: {
|
|
483
|
+
type: 'new-composition',
|
|
484
|
+
compositionFile: selectedPlan.compositionFile,
|
|
485
|
+
},
|
|
486
|
+
element: request.element,
|
|
487
|
+
});
|
|
488
|
+
if (canceled)
|
|
489
|
+
return;
|
|
490
|
+
if (!result.success)
|
|
491
|
+
throw new Error(result.reason);
|
|
492
|
+
const prepared = {
|
|
493
|
+
basePlan: selectedPlan,
|
|
494
|
+
name: candidate,
|
|
495
|
+
refresh: refreshPlan,
|
|
496
|
+
plan: result.plan,
|
|
497
|
+
};
|
|
498
|
+
if (result.plan.expectedFileState.exists) {
|
|
499
|
+
setExistingInstallation((previous) => (previous === null || previous === void 0 ? void 0 : previous.basePlan) === selectedPlan &&
|
|
500
|
+
previous.refresh === refreshPlan
|
|
501
|
+
? previous
|
|
502
|
+
: prepared);
|
|
503
|
+
if (requestedName === null) {
|
|
504
|
+
candidate = `${elementBaseName}-copy${copyNumber === 1 ? '' : `-${copyNumber}`}`;
|
|
505
|
+
copyNumber++;
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
setPreparation({
|
|
510
|
+
basePlan: selectedPlan,
|
|
511
|
+
refresh: refreshPlan,
|
|
512
|
+
requestedName,
|
|
513
|
+
installation: prepared,
|
|
514
|
+
error: null,
|
|
515
|
+
});
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
})().catch((error) => {
|
|
519
|
+
if (!canceled) {
|
|
520
|
+
setPreparation({
|
|
521
|
+
basePlan: selectedPlan,
|
|
522
|
+
refresh: refreshPlan,
|
|
523
|
+
requestedName,
|
|
524
|
+
installation: null,
|
|
525
|
+
error: error instanceof Error ? error.message : String(error),
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
return () => {
|
|
530
|
+
canceled = true;
|
|
531
|
+
};
|
|
532
|
+
}, [
|
|
533
|
+
elementBaseName,
|
|
534
|
+
requestedName,
|
|
535
|
+
mode,
|
|
536
|
+
refreshPlan,
|
|
537
|
+
request,
|
|
538
|
+
selectedPlan,
|
|
539
|
+
]);
|
|
540
|
+
const installationNameError = installationName.length > 0
|
|
541
|
+
? (planError !== null && planError !== void 0 ? planError : (requestedName !== null && (activePlan === null || activePlan === void 0 ? void 0 : activePlan.expectedFileState.exists)
|
|
542
|
+
? 'Name already taken.'
|
|
543
|
+
: null))
|
|
544
|
+
: null;
|
|
408
545
|
const folderTargetIsReady = selectedFolderStack === null ||
|
|
409
546
|
((0, use_resolved_stack_1.hasResolvedStack)(selectedFolderStack) && folderCompositionFile !== null);
|
|
410
547
|
const title = `Install ${request.element.displayName}${request.element.displayName.endsWith(' Element') ? '' : ' Element'}`;
|
|
411
548
|
const canSubmit = !submitting &&
|
|
549
|
+
(overwriteExisting ||
|
|
550
|
+
(planError === null &&
|
|
551
|
+
studio_protocol_1.StudioProtocolInternals.makeElementFileNameFromSlug(installationName) === `${installationName}.element.tsx` &&
|
|
552
|
+
(activePlan !== null
|
|
553
|
+
? !activePlan.expectedFileState.exists
|
|
554
|
+
: requestedName !== null))) &&
|
|
412
555
|
(mode === 'current-composition'
|
|
413
556
|
? currentPlan !== null
|
|
414
|
-
: newCompositionValuesAreValid &&
|
|
557
|
+
: (newCompositionValuesAreValid || compositionAlreadyCreated) &&
|
|
415
558
|
folderTargetIsReady &&
|
|
416
559
|
selectedNewCompositionPlan !== null);
|
|
417
560
|
const submit = (0, react_1.useCallback)(async () => {
|
|
418
|
-
|
|
561
|
+
var _a, _b;
|
|
562
|
+
if (!canSubmit || selectedPlan === null) {
|
|
419
563
|
return;
|
|
420
564
|
}
|
|
421
565
|
setSubmitting(true);
|
|
422
|
-
if (mode === 'new-composition') {
|
|
423
|
-
if (selectedNewCompositionPlan === null) {
|
|
424
|
-
setSubmitting(false);
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
566
|
+
if (mode === 'new-composition' && !compositionAlreadyCreated) {
|
|
427
567
|
const created = await createComposition({
|
|
428
568
|
signal: new AbortController().signal,
|
|
429
569
|
symbolicatedStack: selectedFolderStack === null ? null : folderSymbolicatedStack,
|
|
@@ -433,115 +573,127 @@ const ElementInstallConfirmation = ({ state }) => {
|
|
|
433
573
|
setSubmitting(false);
|
|
434
574
|
return;
|
|
435
575
|
}
|
|
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;
|
|
576
|
+
setCreatedComposition(creationKey);
|
|
447
577
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
578
|
+
const installed = await (0, import_assets_1.insertElement)({
|
|
579
|
+
installationName: overwriteExisting
|
|
580
|
+
? ((_a = existingDestination === null || existingDestination === void 0 ? void 0 : existingDestination.name) !== null && _a !== void 0 ? _a : installationName)
|
|
581
|
+
: installationName,
|
|
582
|
+
compositionFile: mode === 'new-composition'
|
|
583
|
+
? selectedPlan.compositionFile
|
|
584
|
+
: request.compositionFile,
|
|
585
|
+
compositionId: mode === 'new-composition'
|
|
586
|
+
? newCompositionValues.id
|
|
587
|
+
: request.compositionId,
|
|
455
588
|
element: request.element,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
589
|
+
// The insert operation revalidates this even if the name preflight is pending.
|
|
590
|
+
expectedFileState: (_b = activePlan === null || activePlan === void 0 ? void 0 : activePlan.expectedFileState) !== null && _b !== void 0 ? _b : { exists: false },
|
|
591
|
+
from: mode === 'new-composition' ? null : request.from,
|
|
592
|
+
overwriteExisting,
|
|
593
|
+
position: mode === 'new-composition' ? null : request.position,
|
|
460
594
|
});
|
|
461
|
-
|
|
595
|
+
if (installed)
|
|
596
|
+
onClose();
|
|
597
|
+
else {
|
|
598
|
+
setSubmitting(false);
|
|
599
|
+
setRefreshPlan((value) => value + 1);
|
|
600
|
+
}
|
|
462
601
|
}, [
|
|
602
|
+
activePlan,
|
|
603
|
+
existingDestination,
|
|
604
|
+
compositionAlreadyCreated,
|
|
605
|
+
creationKey,
|
|
606
|
+
installationName,
|
|
607
|
+
overwriteExisting,
|
|
463
608
|
canSubmit,
|
|
464
609
|
createComposition,
|
|
465
|
-
currentPlan,
|
|
466
610
|
folderSymbolicatedStack,
|
|
467
611
|
mode,
|
|
468
612
|
newCompositionValues.id,
|
|
469
613
|
onClose,
|
|
470
614
|
request,
|
|
471
615
|
selectedFolderStack,
|
|
472
|
-
|
|
616
|
+
selectedPlan,
|
|
473
617
|
]);
|
|
474
618
|
const cancel = (0, react_1.useCallback)(() => {
|
|
475
619
|
if (!submitting) {
|
|
476
620
|
onClose();
|
|
477
621
|
}
|
|
478
622
|
}, [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]);
|
|
623
|
+
const destinationOptions = (0, react_1.useMemo)(() => [
|
|
624
|
+
{
|
|
625
|
+
key: 'current-composition',
|
|
626
|
+
label: 'Current composition',
|
|
627
|
+
selected: mode === 'current-composition',
|
|
628
|
+
onClick: currentPlan === null ? null : () => setMode('current-composition'),
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
key: 'new-composition',
|
|
632
|
+
label: 'New composition',
|
|
633
|
+
selected: mode === 'new-composition',
|
|
634
|
+
onClick: () => {
|
|
635
|
+
setMode('new-composition');
|
|
636
|
+
requestAnimationFrame(() => {
|
|
637
|
+
var _a;
|
|
638
|
+
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
639
|
+
});
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
], [currentPlan, mode]);
|
|
501
643
|
const onSubmit = (0, react_1.useCallback)((event) => {
|
|
502
644
|
event.preventDefault();
|
|
503
645
|
submit();
|
|
504
646
|
}, [submit]);
|
|
505
647
|
return (0, react_dom_1.createPortal)(jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { ariaLabelledBy: elementInstallTitleId, onOutsideClick: cancel, onEscape: cancel, children: [
|
|
506
648
|
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: [
|
|
649
|
+
jsx_runtime_1.jsxs("div", { style: dialogContent, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [
|
|
508
650
|
jsx_runtime_1.jsxs("dl", { style: requestSourceStyle, "aria-label": "Request source", children: [
|
|
509
651
|
jsx_runtime_1.jsx("dt", { style: sectionTitleStyle, children: "From" }), jsx_runtime_1.jsx("dd", { style: sourceIsUnverified
|
|
510
652
|
? unverifiedRequestSourceStyle
|
|
511
653
|
: 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
|
-
] })
|
|
654
|
+
] }), activePlan ? (jsx_runtime_1.jsxs("dl", { style: requestSourceStyle, children: [
|
|
655
|
+
jsx_runtime_1.jsx("dt", { style: sectionTitleStyle, children: "Destination" }), jsx_runtime_1.jsx("dd", { style: requestSourceDescriptionStyle, children: activePlan.filePath })
|
|
656
|
+
] })) : null, jsx_runtime_1.jsxs("div", { style: destinationControlStyle, children: [
|
|
657
|
+
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
658
|
] }), 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,
|
|
659
|
+
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."] })
|
|
660
|
+
] })) : null, mode === 'new-composition' ? (jsx_runtime_1.jsxs("section", { style: { ...sectionStyle, marginInline: -16 }, "aria-label": "New composition settings", children: [
|
|
661
|
+
jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { 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: [
|
|
662
|
+
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: {
|
|
663
|
+
...sectionStyle,
|
|
664
|
+
paddingLeft: 28,
|
|
665
|
+
maxWidth: 320,
|
|
666
|
+
minWidth: 0,
|
|
667
|
+
}, children: [
|
|
668
|
+
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) => {
|
|
669
|
+
const name = event.target.value;
|
|
670
|
+
setInput((previous) => ({
|
|
671
|
+
...previous,
|
|
672
|
+
name,
|
|
673
|
+
overwritePlan: null,
|
|
674
|
+
}));
|
|
675
|
+
} }), 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: [
|
|
676
|
+
jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: overwriteExisting, disabled: submitting, onClick: () => setInput((previous) => ({
|
|
677
|
+
...previous,
|
|
678
|
+
overwritePlan: existingDestination.plan,
|
|
679
|
+
})), children: "Replace existing" }), jsx_runtime_1.jsx("p", { style: {
|
|
680
|
+
...warningDescriptionStyle,
|
|
681
|
+
paddingLeft: 28,
|
|
682
|
+
overflowWrap: 'anywhere',
|
|
683
|
+
}, children: existingDestination.plan.filePath }), overwriteExisting ? (jsx_runtime_1.jsx("p", { style: { ...overwriteStyle, paddingLeft: 28 }, children: "Overwrites customizations for all usages." })) : null] })
|
|
684
|
+
] })) : !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
685
|
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
686
|
] })) : 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.'] })
|
|
687
|
+
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
688
|
] }), 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:
|
|
689
|
+
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(react_1.Suspense, { fallback: sourcePreview, children: jsx_runtime_1.jsx(HighlightedElementSource, { source: sourcePreview }) }) }) }) })
|
|
542
690
|
] })
|
|
543
691
|
] }), 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
|
|
692
|
+
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
|
|
693
|
+
? 'Installing…'
|
|
694
|
+
: overwriteExisting
|
|
695
|
+
? 'Replace and insert'
|
|
696
|
+
: 'Install', jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: false })
|
|
545
697
|
] })
|
|
546
698
|
] }) })
|
|
547
699
|
] })
|