@remotion/studio 4.0.518 → 4.0.519
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/components/AppLaunchButton.d.ts +16 -0
- package/dist/components/AppLaunchButton.js +90 -0
- package/dist/components/AssetSelector.js +7 -6
- package/dist/components/AssetSelectorItem.d.ts +12 -0
- package/dist/components/AssetSelectorItem.js +180 -62
- package/dist/components/Button.js +20 -7
- package/dist/components/Canvas.js +109 -78
- package/dist/components/CanvasOrLoading.js +7 -7
- package/dist/components/CodingAgentButton.d.ts +7 -0
- package/dist/components/CodingAgentButton.js +59 -0
- package/dist/components/CompositionContextButton.d.ts +1 -0
- package/dist/components/CompositionContextButton.js +6 -3
- package/dist/components/CompositionSelector.js +15 -10
- package/dist/components/CompositionSelectorItem.js +16 -23
- package/dist/components/ConfigureLicenseModal.js +4 -48
- package/dist/components/CurrentAsset.js +1 -1
- package/dist/components/ElementInstallConfirmation.d.ts +20 -7
- package/dist/components/ElementInstallConfirmation.js +325 -32
- package/dist/components/FixComputedValueModal.js +5 -131
- package/dist/components/InitialCompositionLoader.js +3 -2
- package/dist/components/InspectorOpenInEditor.js +48 -33
- package/dist/components/InspectorPanel/CompositionInspector.js +35 -3
- package/dist/components/InspectorPanel/CompositionInspectorHeader.js +22 -14
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +1 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +10 -5
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/common.js +1 -0
- package/dist/components/InspectorPanel/styles.js +1 -0
- package/dist/components/InspectorSequenceSection.js +8 -3
- package/dist/components/InspectorSourceLocation.js +5 -1
- package/dist/components/KnownBugs.d.ts +1 -1
- package/dist/components/KnownBugs.js +1 -1
- package/dist/components/LicenseExplanation.d.ts +2 -0
- package/dist/components/LicenseExplanation.js +63 -0
- package/dist/components/MenuToolbar.js +7 -1
- package/dist/components/Modals.js +1 -2
- package/dist/components/NewComposition/InputDragger.js +29 -2
- package/dist/components/NewComposition/NewCompDuration.js +1 -1
- package/dist/components/NewComposition/NewComposition.d.ts +23 -0
- package/dist/components/NewComposition/NewComposition.js +217 -80
- package/dist/components/{UpdateModal/OpenIssueButton.js → OpenIssueButton.js} +1 -1
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +2 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +21 -13
- package/dist/components/RenderQueue/actions.d.ts +1 -0
- package/dist/components/RenderQueue/actions.js +5 -1
- package/dist/components/SelectedOutlineCanvasRotation.js +27 -1
- package/dist/components/SelectedOutlineElement.js +2 -1
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +2 -2
- package/dist/components/SelectedOutlineOverlay.d.ts +3 -1
- package/dist/components/SelectedOutlineOverlay.js +21 -26
- package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
- package/dist/components/SelectedOutlinePolygon.js +12 -4
- package/dist/components/SelectedOutlineRenderer.js +88 -21
- package/dist/components/SettingsContext.js +2 -1
- package/dist/components/SettingsModal.d.ts +1 -1
- package/dist/components/SettingsModal.js +19 -3
- package/dist/components/SidebarRenderButton.d.ts +1 -0
- package/dist/components/SidebarRenderButton.js +14 -5
- package/dist/components/Timeline/SequencePropsObserver.js +29 -14
- package/dist/components/Timeline/TimelineKeyframeControls.js +3 -1
- package/dist/components/Timeline/TimelineRowChrome.js +4 -2
- package/dist/components/Timeline/TimelineSequence.js +40 -8
- package/dist/components/Timeline/TimelineSequenceItem.js +34 -1
- package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -0
- package/dist/components/Timeline/TimelineStack/get-stack.js +35 -3
- package/dist/components/Timeline/duplicate-selected-timeline-item.js +23 -25
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -0
- package/dist/components/Timeline/get-sequence-context-menu-items.js +34 -1
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -0
- package/dist/components/Timeline/sequence-props-subscription-store.js +22 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +7 -0
- package/dist/components/TimelineCombobox.js +1 -0
- package/dist/components/UpdateCheck.d.ts +0 -8
- package/dist/components/UpdateCheck.js +7 -54
- package/dist/components/UpdateStatusContext.d.ts +18 -0
- package/dist/components/UpdateStatusContext.js +74 -0
- package/dist/components/UpdatesSettings.d.ts +2 -0
- package/dist/components/UpdatesSettings.js +251 -0
- package/dist/components/WebMcp.js +3 -3
- package/dist/components/get-open-in-menu-items.d.ts +4 -0
- package/dist/components/get-open-in-menu-items.js +28 -24
- package/dist/components/root-composition-menu-items.d.ts +4 -1
- package/dist/components/root-composition-menu-items.js +38 -1
- package/dist/components/selected-outline-geometry.d.ts +21 -2
- package/dist/components/selected-outline-geometry.js +16 -5
- package/dist/components/selected-outline-measurement.d.ts +40 -1
- package/dist/components/selected-outline-measurement.js +239 -1
- package/dist/components/selected-outline-order.d.ts +12 -0
- package/dist/components/selected-outline-order.js +251 -0
- package/dist/components/selected-outline-types.d.ts +15 -2
- package/dist/components/selected-outline-uv.js +106 -3
- package/dist/components/use-configure-default-apps.d.ts +1 -0
- package/dist/components/use-configure-default-apps.js +24 -0
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +5 -6
- package/dist/error-overlay/remotion-overlay/CopyStackTrace.js +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +47 -18
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js +5 -4
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +48 -76
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -2
- package/dist/error-overlay/remotion-overlay/StackFrame.js +13 -8
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +1 -1
- package/dist/esm/{chunk-7prjt5n5.js → chunk-1fkq5bfq.js} +15439 -11610
- package/dist/esm/chunk-6jf1natv.js +25 -0
- package/dist/esm/{chunk-4bxz1d3g.js → chunk-je0h1bgt.js} +1 -28
- package/dist/esm/chunk-m0jqdbkr.js +14571 -0
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/internals.mjs +32140 -13755
- package/dist/esm/previewEntry.mjs +35408 -17021
- package/dist/esm/renderEntry.mjs +6 -3
- package/dist/helpers/can-show-updates.d.ts +5 -0
- package/dist/helpers/can-show-updates.js +7 -0
- package/dist/helpers/colors.d.ts +0 -3
- package/dist/helpers/colors.js +2 -5
- package/dist/helpers/create-folder-tree.d.ts +5 -0
- package/dist/helpers/create-folder-tree.js +24 -1
- package/dist/helpers/get-asset-metadata.js +1 -1
- package/dist/helpers/get-box-quads-polyfill-internals.d.ts +82 -0
- package/dist/helpers/get-box-quads-polyfill-internals.js +2403 -0
- package/dist/helpers/get-box-quads-ponyfill.d.ts +10 -0
- package/dist/helpers/get-box-quads-ponyfill.js +23 -0
- package/dist/helpers/get-git-menu-item.d.ts +5 -0
- package/dist/helpers/get-git-menu-item.js +15 -1
- package/dist/helpers/hoverable.js +10 -5
- package/dist/helpers/open-in-editor.js +51 -1
- package/dist/helpers/preview-server-events.js +3 -0
- package/dist/helpers/timeline-layout.d.ts +0 -1
- package/dist/helpers/timeline-layout.js +1 -5
- package/dist/helpers/url-state.d.ts +1 -0
- package/dist/helpers/url-state.js +12 -5
- package/dist/renderEntry.js +2 -0
- package/dist/state/folders.d.ts +3 -0
- package/dist/state/folders.js +40 -1
- package/dist/state/modals.d.ts +1 -6
- package/package.json +17 -14
- package/dist/components/UpdateModal/UpdateModal.d.ts +0 -6
- package/dist/components/UpdateModal/UpdateModal.js +0 -104
- /package/dist/components/{UpdateModal/OpenIssueButton.d.ts → OpenIssueButton.d.ts} +0 -0
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const colors_1 = require("../helpers/colors");
|
|
7
7
|
const layout_1 = require("./layout");
|
|
8
|
+
const LicenseExplanation_1 = require("./LicenseExplanation");
|
|
8
9
|
const LicenseKeyValidation_1 = require("./LicenseKeyValidation");
|
|
9
10
|
const RemInput_1 = require("./NewComposition/RemInput");
|
|
10
11
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
@@ -28,16 +29,12 @@ const description = {
|
|
|
28
29
|
lineHeight: 1.5,
|
|
29
30
|
margin: 0,
|
|
30
31
|
};
|
|
31
|
-
const
|
|
32
|
-
color: colors_1.
|
|
32
|
+
const externalDescriptionLink = {
|
|
33
|
+
color: colors_1.BLUE,
|
|
33
34
|
fontFamily: 'sans-serif',
|
|
34
35
|
fontSize: 14,
|
|
35
36
|
lineHeight: '21px',
|
|
36
37
|
};
|
|
37
|
-
const externalDescriptionLink = {
|
|
38
|
-
...descriptionLink,
|
|
39
|
-
color: colors_1.BLUE,
|
|
40
|
-
};
|
|
41
38
|
const externalLinkIndicator = {
|
|
42
39
|
display: 'inline-block',
|
|
43
40
|
height: 12,
|
|
@@ -45,32 +42,6 @@ const externalLinkIndicator = {
|
|
|
45
42
|
verticalAlign: -2,
|
|
46
43
|
width: 12,
|
|
47
44
|
};
|
|
48
|
-
const licenseExplanation = {
|
|
49
|
-
display: 'flex',
|
|
50
|
-
flexDirection: 'column',
|
|
51
|
-
gap: 12,
|
|
52
|
-
};
|
|
53
|
-
const licenseExplanationRow = {
|
|
54
|
-
display: 'flex',
|
|
55
|
-
alignItems: 'center',
|
|
56
|
-
gap: 12,
|
|
57
|
-
};
|
|
58
|
-
const people = {
|
|
59
|
-
display: 'grid',
|
|
60
|
-
gridTemplateColumns: 'repeat(4, 9px)',
|
|
61
|
-
gap: 3,
|
|
62
|
-
flexShrink: 0,
|
|
63
|
-
};
|
|
64
|
-
const person = {
|
|
65
|
-
display: 'block',
|
|
66
|
-
height: 24,
|
|
67
|
-
overflow: 'visible',
|
|
68
|
-
width: 9,
|
|
69
|
-
};
|
|
70
|
-
const PersonIcon = ({ handsUp, opacity }) => {
|
|
71
|
-
return (jsx_runtime_1.jsxs("svg", { "aria-hidden": "true", opacity: opacity, style: person, viewBox: "0 0 192 512", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
72
|
-
jsx_runtime_1.jsx("path", { fill: colors_1.LIGHT_TEXT, d: "M128 64a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM32 64A64 64 0 1 1 160 64 64 64 0 1 1 32 64zm0 128l0 128 128 0 0-128-128 0zM0 160l192 0 0 192-32 0 0 160-32 0 0-160-64 0 0 160-32 0 0-160-32 0 0-192z" }), handsUp ? (jsx_runtime_1.jsx("path", { d: "M10.667 192 0 -32 M181.333 192 192 -32", fill: "none", stroke: colors_1.LIGHT_TEXT, strokeWidth: "32" })) : null] }));
|
|
73
|
-
};
|
|
74
45
|
const freeLicenseMessage = {
|
|
75
46
|
...description,
|
|
76
47
|
marginBottom: 5,
|
|
@@ -199,22 +170,7 @@ const LicenseSettings = () => {
|
|
|
199
170
|
});
|
|
200
171
|
const displayedError = error !== null && error !== void 0 ? error : settingsError;
|
|
201
172
|
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs("div", { style: content, children: [
|
|
202
|
-
jsx_runtime_1.jsxs("div", {
|
|
203
|
-
jsx_runtime_1.jsxs("div", { style: licenseExplanationRow, children: [
|
|
204
|
-
jsx_runtime_1.jsxs("div", { style: people, children: [
|
|
205
|
-
jsx_runtime_1.jsx(PersonIcon, { handsUp: true, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: true, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: true, opacity: 1 })
|
|
206
|
-
] }), jsx_runtime_1.jsx("p", { style: description, children: "Remotion is free to use if you are an individual or company of 3 or less." })
|
|
207
|
-
] }), jsx_runtime_1.jsxs("div", { style: licenseExplanationRow, children: [
|
|
208
|
-
jsx_runtime_1.jsxs("div", { style: people, children: [
|
|
209
|
-
jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 })
|
|
210
|
-
] }), jsx_runtime_1.jsxs("p", { style: description, children: ["If used in an organization with 4+ people, you need a", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.pro/license", children: "Company License" }),
|
|
211
|
-
"."] })
|
|
212
|
-
] }), jsx_runtime_1.jsxs("div", { style: licenseExplanationRow, children: [
|
|
213
|
-
jsx_runtime_1.jsxs("div", { style: people, children: [
|
|
214
|
-
jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 1 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 0.3 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 0.3 }), jsx_runtime_1.jsx(PersonIcon, { handsUp: false, opacity: 0.3 })
|
|
215
|
-
] }), jsx_runtime_1.jsx("p", { style: description, children: "The total headcount matters, not the amount of people using Remotion." })
|
|
216
|
-
] })
|
|
217
|
-
] }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2 }), jsx_runtime_1.jsxs("div", { "aria-label": "License type", role: "radiogroup", children: [
|
|
173
|
+
jsx_runtime_1.jsx(LicenseExplanation_1.LicenseExplanation, {}), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2 }), jsx_runtime_1.jsxs("div", { "aria-label": "License type", role: "radiogroup", children: [
|
|
218
174
|
jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: licenseType === 'free', onClick: toggleFreeLicense, children: "I am eligible for the Free License" }), licenseType === 'free' ? (jsx_runtime_1.jsx("p", { style: freeLicenseMessage, children: "That's it! Enjoy Remotion." })) : null, jsx_runtime_1.jsx(RadioButton_1.RadioButton, { checked: licenseType === 'company', onClick: toggleCompanyLicense, children: "I need a Company License" }), licenseType === 'company' ? (jsx_runtime_1.jsxs("div", { style: companyLicenseContent, children: [
|
|
219
175
|
jsx_runtime_1.jsxs("p", { style: description, children: ["Visit", ' ', jsx_runtime_1.jsxs("a", { style: externalDescriptionLink, href: "https://remotion.pro/license", target: "_blank", rel: "noopener noreferrer", children: ["remotion.pro/license",
|
|
220
176
|
jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: externalLinkIndicator, children: jsx_runtime_1.jsx("path", { d: "M4 12 12 4M6 4h6v6", fill: "none", stroke: colors_1.BLUE, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) })
|
|
@@ -215,7 +215,7 @@ const AssetInfo = ({ assetName, contentSized = false, onAssetClick, readOnlyStud
|
|
|
215
215
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
216
216
|
jsx_runtime_1.jsx(InspectorInfoHeader_1.InspectorInfoHeader, { contentSized: contentSized, minHeight: exports.CURRENT_ASSET_HEIGHT, padding: contentSized
|
|
217
217
|
? `0 ${InspectorPanelLayout_1.INSPECTOR_PANEL_HORIZONTAL_PADDING}px 6px`
|
|
218
|
-
: '4px 0', children: jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onClick: onAssetClick, onCommit: onRename, size: contentSized ? 'default' : 'inspector', title: assetName }) }), fileDetails.length > 0 ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "File", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: fileDetails.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.video ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Video", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: mediaSections.video.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.audio !== null ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Audio", children: mediaSections.audio.length === 0 ? (jsx_runtime_1.jsx("div", { style: assetEmptyStateStyle, children: "None" })) : (jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: mediaSections.audio.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) })) })) : null, jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [src ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: false, onClick: onOpenConvert, renderIcon: (color) => (jsx_runtime_1.jsx(remotion_convert_1.RemotionConvertIcon, { color: color, style: quickActionIconStyle })), children: ["Convert",
|
|
218
|
+
: '4px 0', children: jsx_runtime_1.jsx(InlineEditableTitle_1.InlineEditableTitle, { value: fileName, canRename: canRename, getInitialSelection: use_rename_static_file_1.getStaticFileRenameSelection, onClick: onAssetClick, onCommit: onRename, size: contentSized ? 'default' : 'inspector', title: assetName }) }), fileDetails.length > 0 ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "File", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: fileDetails.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.video ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Video", children: jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: mediaSections.video.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) }) })) : null, mediaSections && mediaSections.audio !== null ? (jsx_runtime_1.jsx(common_1.InspectorSection, { header: "Audio", children: mediaSections.audio.length === 0 ? (jsx_runtime_1.jsx("div", { style: assetEmptyStateStyle, children: "None" })) : (jsx_runtime_1.jsx("div", { style: assetMetadataStyle, children: mediaSections.audio.map((detail) => (jsx_runtime_1.jsx(common_1.InspectorDetailRow, { label: detail.label, children: jsx_runtime_1.jsx("span", { style: assetMetadataValueStyle, children: detail.value }) }, detail.label))) })) })) : null, jsx_runtime_1.jsx(common_1.InspectorSectionHeader, { children: "Actions" }), jsx_runtime_1.jsxs(common_1.InspectorQuickActionsSection, { children: [src ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: false, onClick: onOpenConvert, renderIcon: (color) => (jsx_runtime_1.jsx(remotion_convert_1.RemotionConvertIcon, { color: color, style: quickActionIconStyle })), children: ["Convert",
|
|
219
219
|
jsx_runtime_1.jsx("svg", { "aria-hidden": "true", viewBox: "0 0 16 16", style: convertArrowStyle, children: jsx_runtime_1.jsx("path", { d: "M4 12 12 4M6 4h6v6", fill: "none", stroke: colors_1.CURRENT_COLOR, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) })
|
|
220
220
|
] })) : null, fileManagerAvailable ? (jsx_runtime_1.jsxs(common_1.InspectorQuickAction, { disabled: fileManagerDisabled, onClick: onShowInFileManager, renderIcon: (color) => (jsx_runtime_1.jsx(folder_1.ExpandedFolderIcon, { color: color, style: quickActionIconStyle })), children: ["Show in ", fileManagerName] })) : null, jsx_runtime_1.jsx(common_1.InspectorQuickAction, { disabled: mutationsDisabled, onClick: onDelete, renderIcon: (color) => (jsx_runtime_1.jsx(trash_1.TrashIcon, { color: color, style: quickActionIconStyle })), children: "Delete" })] })
|
|
221
221
|
] }));
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
+
import type { ElementInstallExpectedFileState, ElementInstallRequest } from '@remotion/studio-shared';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
export declare const ElementLibraryAddConfirmation: React.FC<{
|
|
3
4
|
readonly displayName: string | null;
|
|
4
5
|
readonly origin: string;
|
|
5
6
|
readonly url: string;
|
|
6
7
|
}>;
|
|
7
|
-
|
|
8
|
-
readonly
|
|
9
|
-
readonly sourceLabel: string;
|
|
10
|
-
readonly sourceIsUnverified: boolean;
|
|
11
|
-
readonly compositionId: string;
|
|
8
|
+
type ElementInstallPlan = {
|
|
9
|
+
readonly compositionFile: string;
|
|
12
10
|
readonly filePath: string;
|
|
13
|
-
readonly
|
|
11
|
+
readonly expectedFileState: ElementInstallExpectedFileState;
|
|
12
|
+
};
|
|
13
|
+
type CurrentCompositionMetadata = {
|
|
14
|
+
readonly durationInFrames: number;
|
|
15
|
+
readonly fps: number;
|
|
16
|
+
readonly height: number;
|
|
17
|
+
readonly width: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const ElementInstallConfirmation: React.FC<{
|
|
20
|
+
readonly currentCompositionMetadata: CurrentCompositionMetadata | null;
|
|
21
|
+
readonly currentPlan: ElementInstallPlan | null;
|
|
14
22
|
readonly dependenciesToReview: string[];
|
|
15
23
|
readonly missingPackages: string[];
|
|
16
|
-
readonly
|
|
24
|
+
readonly newPlan: ElementInstallPlan;
|
|
25
|
+
readonly onClose: () => void;
|
|
26
|
+
readonly request: ElementInstallRequest;
|
|
27
|
+
readonly sourceIsUnverified: boolean;
|
|
28
|
+
readonly sourceLabel: string;
|
|
17
29
|
readonly usesBrowserDependencyResolution: boolean;
|
|
18
30
|
}>;
|
|
31
|
+
export {};
|
|
@@ -2,8 +2,30 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ElementInstallConfirmation = exports.ElementLibraryAddConfirmation = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const studio_protocol_1 = require("@remotion/studio-protocol");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const react_dom_1 = require("react-dom");
|
|
8
|
+
const remotion_1 = require("remotion");
|
|
9
|
+
const ShortcutHint_1 = require("../error-overlay/remotion-overlay/ShortcutHint");
|
|
5
10
|
const colors_1 = require("../helpers/colors");
|
|
11
|
+
const hoverable_1 = require("../helpers/hoverable");
|
|
12
|
+
const resolved_stack_to_symbolicated_1 = require("../helpers/resolved-stack-to-symbolicated");
|
|
13
|
+
const use_create_composition_1 = require("../helpers/use-create-composition");
|
|
14
|
+
const validate_new_comp_data_1 = require("../helpers/validate-new-comp-data");
|
|
15
|
+
const z_index_1 = require("../state/z-index");
|
|
16
|
+
const Button_1 = require("./Button");
|
|
17
|
+
const element_install_api_1 = require("./element-install-api");
|
|
18
|
+
const import_assets_1 = require("./import-assets");
|
|
19
|
+
const layout_1 = require("./layout");
|
|
20
|
+
const portals_1 = require("./Menu/portals");
|
|
21
|
+
const ModalButton_1 = require("./ModalButton");
|
|
22
|
+
const ModalContainer_1 = require("./ModalContainer");
|
|
23
|
+
const ModalFooter_1 = require("./ModalFooter");
|
|
24
|
+
const ModalHeader_1 = require("./ModalHeader");
|
|
25
|
+
const NewComposition_1 = require("./NewComposition/NewComposition");
|
|
6
26
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
27
|
+
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
28
|
+
const use_resolved_stack_1 = require("./Timeline/use-resolved-stack");
|
|
7
29
|
const container = {
|
|
8
30
|
display: 'flex',
|
|
9
31
|
flexDirection: 'column',
|
|
@@ -13,6 +35,13 @@ const container = {
|
|
|
13
35
|
fontSize: 13,
|
|
14
36
|
lineHeight: 1.5,
|
|
15
37
|
};
|
|
38
|
+
const dialogContent = {
|
|
39
|
+
...container,
|
|
40
|
+
padding: 16,
|
|
41
|
+
width: 'min(640px, calc(100vw - 40px))',
|
|
42
|
+
maxHeight: 'min(720px, calc(100vh - 140px))',
|
|
43
|
+
overflowY: 'auto',
|
|
44
|
+
};
|
|
16
45
|
const sectionStyle = {
|
|
17
46
|
display: 'flex',
|
|
18
47
|
flexDirection: 'column',
|
|
@@ -34,7 +63,7 @@ const metadataStyle = {
|
|
|
34
63
|
};
|
|
35
64
|
const metadataRowStyle = {
|
|
36
65
|
display: 'grid',
|
|
37
|
-
gridTemplateColumns: '
|
|
66
|
+
gridTemplateColumns: '120px minmax(0, 1fr)',
|
|
38
67
|
alignItems: 'baseline',
|
|
39
68
|
gap: 12,
|
|
40
69
|
};
|
|
@@ -172,6 +201,44 @@ const sourceCodeStyle = {
|
|
|
172
201
|
fontSize: 'inherit',
|
|
173
202
|
lineHeight: 'inherit',
|
|
174
203
|
};
|
|
204
|
+
const destinationControlStyle = {
|
|
205
|
+
display: 'flex',
|
|
206
|
+
alignItems: 'center',
|
|
207
|
+
justifyContent: 'space-between',
|
|
208
|
+
gap: 16,
|
|
209
|
+
};
|
|
210
|
+
const destinationOptionsStyle = {
|
|
211
|
+
display: 'flex',
|
|
212
|
+
overflow: 'hidden',
|
|
213
|
+
border: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
214
|
+
borderRadius: 4,
|
|
215
|
+
};
|
|
216
|
+
const destinationOptionStyle = {
|
|
217
|
+
appearance: 'none',
|
|
218
|
+
border: 0,
|
|
219
|
+
cursor: 'default',
|
|
220
|
+
fontFamily: 'sans-serif',
|
|
221
|
+
fontSize: 11,
|
|
222
|
+
fontWeight: 400,
|
|
223
|
+
lineHeight: 1.5,
|
|
224
|
+
padding: '2px 7px',
|
|
225
|
+
};
|
|
226
|
+
const getDestinationOptionStyle = ({ disabled, selected, }) => ({
|
|
227
|
+
...destinationOptionStyle,
|
|
228
|
+
opacity: disabled ? 0.5 : 1,
|
|
229
|
+
...(0, hoverable_1.hoverableStyle)({
|
|
230
|
+
idleBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
|
|
231
|
+
hoverBackground: selected ? colors_1.INPUT_BACKGROUND : colors_1.TRANSPARENT,
|
|
232
|
+
idleColor: selected ? colors_1.WHITE : colors_1.LIGHT_TEXT,
|
|
233
|
+
hoverColor: disabled ? colors_1.LIGHT_TEXT : colors_1.WHITE,
|
|
234
|
+
}),
|
|
235
|
+
});
|
|
236
|
+
const footerStyle = {
|
|
237
|
+
minWidth: 0,
|
|
238
|
+
};
|
|
239
|
+
const cancelStyle = {
|
|
240
|
+
minWidth: 90,
|
|
241
|
+
};
|
|
175
242
|
const makeSourceControlsVisible = (sourceCode) => {
|
|
176
243
|
return sourceCode.replace(/[\u200b-\u200f\u202a-\u202e\u2066-\u2069\ufeff]/g, (character) => {
|
|
177
244
|
var _a;
|
|
@@ -195,37 +262,263 @@ const ElementLibraryAddConfirmation = ({ displayName, origin, url }) => {
|
|
|
195
262
|
] }));
|
|
196
263
|
};
|
|
197
264
|
exports.ElementLibraryAddConfirmation = ElementLibraryAddConfirmation;
|
|
198
|
-
const ElementInstallConfirmation = ({
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
265
|
+
const ElementInstallConfirmation = ({ currentCompositionMetadata, currentPlan, dependenciesToReview, missingPackages, newPlan, onClose, request, sourceIsUnverified, sourceLabel, usesBrowserDependencyResolution, }) => {
|
|
266
|
+
var _a, _b;
|
|
267
|
+
const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
268
|
+
const { currentZIndex } = (0, z_index_1.useZIndex)();
|
|
269
|
+
const [mode, setMode] = (0, react_1.useState)(currentPlan === null ? 'new-composition' : 'current-composition');
|
|
270
|
+
const [submitting, setSubmitting] = (0, react_1.useState)(false);
|
|
271
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
272
|
+
const [newCompositionValues, setNewCompositionValues] = (0, react_1.useState)(() => {
|
|
273
|
+
var _a, _b, _c, _d, _e;
|
|
274
|
+
const elementComponentName = (_a = studio_protocol_1.StudioProtocolInternals.getElementComponentNameFromSourceCode(request.element.sourceCode)) !== null && _a !== void 0 ? _a : 'Element';
|
|
275
|
+
const baseName = `${elementComponentName}Composition`;
|
|
276
|
+
let candidate = baseName;
|
|
277
|
+
let suffix = 2;
|
|
278
|
+
while ((0, validate_new_comp_data_1.validateCompositionName)(candidate, compositions) !== null) {
|
|
279
|
+
candidate = `${baseName}${suffix}`;
|
|
280
|
+
suffix++;
|
|
281
|
+
}
|
|
282
|
+
const size = (_b = request.element.dimensions) !== null && _b !== void 0 ? _b : (currentCompositionMetadata === null
|
|
283
|
+
? { width: 1920, height: 1080 }
|
|
284
|
+
: {
|
|
285
|
+
width: currentCompositionMetadata.width,
|
|
286
|
+
height: currentCompositionMetadata.height,
|
|
287
|
+
});
|
|
288
|
+
return {
|
|
289
|
+
durationInFrames: (_d = (_c = request.element.durationInFrames) !== null && _c !== void 0 ? _c : currentCompositionMetadata === null || currentCompositionMetadata === void 0 ? void 0 : currentCompositionMetadata.durationInFrames) !== null && _d !== void 0 ? _d : 150,
|
|
290
|
+
folder: { folderName: null, parentName: null, stack: null },
|
|
291
|
+
fps: (_e = currentCompositionMetadata === null || currentCompositionMetadata === void 0 ? void 0 : currentCompositionMetadata.fps) !== null && _e !== void 0 ? _e : 30,
|
|
292
|
+
id: candidate,
|
|
293
|
+
size,
|
|
294
|
+
};
|
|
295
|
+
});
|
|
296
|
+
const selectedFolderStack = newCompositionValues.folder.stack;
|
|
297
|
+
const resolvedFolderLocation = (0, use_resolved_stack_1.useResolvedStack)(selectedFolderStack);
|
|
298
|
+
const folderSymbolicatedStack = (0, react_1.useMemo)(() => (0, resolved_stack_to_symbolicated_1.resolvedStackToSymbolicated)(resolvedFolderLocation), [resolvedFolderLocation]);
|
|
299
|
+
const folderCompositionFile = (_a = folderSymbolicatedStack === null || folderSymbolicatedStack === void 0 ? void 0 : folderSymbolicatedStack.originalFileName) !== null && _a !== void 0 ? _a : null;
|
|
300
|
+
const [newCompositionPlanState, setNewCompositionPlanState] = (0, react_1.useState)({
|
|
301
|
+
folderStack: null,
|
|
302
|
+
type: 'ready',
|
|
303
|
+
plan: newPlan,
|
|
304
|
+
});
|
|
305
|
+
(0, react_1.useEffect)(() => {
|
|
306
|
+
if (selectedFolderStack === null) {
|
|
307
|
+
setNewCompositionPlanState({
|
|
308
|
+
folderStack: null,
|
|
309
|
+
type: 'ready',
|
|
310
|
+
plan: newPlan,
|
|
311
|
+
});
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
if (!(0, use_resolved_stack_1.hasResolvedStack)(selectedFolderStack)) {
|
|
315
|
+
setNewCompositionPlanState({
|
|
316
|
+
folderStack: selectedFolderStack,
|
|
317
|
+
type: 'loading',
|
|
318
|
+
});
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
if (folderCompositionFile === null) {
|
|
322
|
+
setNewCompositionPlanState({
|
|
323
|
+
folderStack: selectedFolderStack,
|
|
324
|
+
type: 'error',
|
|
325
|
+
reason: 'Could not determine where the new composition should be created.',
|
|
326
|
+
});
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
let canceled = false;
|
|
330
|
+
setNewCompositionPlanState({
|
|
331
|
+
folderStack: selectedFolderStack,
|
|
332
|
+
type: 'loading',
|
|
333
|
+
});
|
|
334
|
+
(0, element_install_api_1.prepareElementInstall)({
|
|
335
|
+
destination: {
|
|
336
|
+
type: 'new-composition',
|
|
337
|
+
compositionFile: folderCompositionFile,
|
|
338
|
+
},
|
|
339
|
+
element: request.element,
|
|
340
|
+
})
|
|
341
|
+
.then((result) => {
|
|
342
|
+
if (canceled) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
setNewCompositionPlanState(result.success
|
|
346
|
+
? {
|
|
347
|
+
folderStack: selectedFolderStack,
|
|
348
|
+
type: 'ready',
|
|
349
|
+
plan: result.plan,
|
|
350
|
+
}
|
|
351
|
+
: {
|
|
352
|
+
folderStack: selectedFolderStack,
|
|
353
|
+
type: 'error',
|
|
354
|
+
reason: result.reason,
|
|
355
|
+
});
|
|
356
|
+
})
|
|
357
|
+
.catch((error) => {
|
|
358
|
+
if (!canceled) {
|
|
359
|
+
setNewCompositionPlanState({
|
|
360
|
+
folderStack: selectedFolderStack,
|
|
361
|
+
type: 'error',
|
|
362
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
return () => {
|
|
367
|
+
canceled = true;
|
|
368
|
+
};
|
|
369
|
+
}, [folderCompositionFile, newPlan, request.element, selectedFolderStack]);
|
|
370
|
+
const { createComposition, heightValidationMessage, nameValidationMessage, valid: newCompositionValuesAreValid, widthValidationMessage, } = (0, use_create_composition_1.useCreateComposition)({
|
|
371
|
+
canvasCapture: null,
|
|
372
|
+
compositions,
|
|
373
|
+
durationInFrames: newCompositionValues.durationInFrames,
|
|
374
|
+
folderName: newCompositionValues.folder.folderName,
|
|
375
|
+
newId: newCompositionValues.id,
|
|
376
|
+
parentName: newCompositionValues.folder.parentName,
|
|
377
|
+
selectedFrameRate: newCompositionValues.fps,
|
|
378
|
+
size: newCompositionValues.size,
|
|
379
|
+
});
|
|
380
|
+
const activeNewCompositionPlanState = newCompositionPlanState.folderStack === selectedFolderStack
|
|
381
|
+
? newCompositionPlanState
|
|
382
|
+
: null;
|
|
383
|
+
const selectedNewCompositionPlan = (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'ready'
|
|
384
|
+
? activeNewCompositionPlanState.plan
|
|
385
|
+
: null;
|
|
386
|
+
const selectedPlan = mode === 'current-composition' ? currentPlan : selectedNewCompositionPlan;
|
|
387
|
+
const folderTargetIsReady = selectedFolderStack === null ||
|
|
388
|
+
((0, use_resolved_stack_1.hasResolvedStack)(selectedFolderStack) && folderCompositionFile !== null);
|
|
389
|
+
const canSubmit = !submitting &&
|
|
390
|
+
(mode === 'current-composition'
|
|
391
|
+
? currentPlan !== null
|
|
392
|
+
: newCompositionValuesAreValid &&
|
|
393
|
+
folderTargetIsReady &&
|
|
394
|
+
selectedNewCompositionPlan !== null);
|
|
395
|
+
const submit = (0, react_1.useCallback)(async () => {
|
|
396
|
+
if (!canSubmit) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
setSubmitting(true);
|
|
400
|
+
if (mode === 'new-composition') {
|
|
401
|
+
if (selectedNewCompositionPlan === null) {
|
|
402
|
+
setSubmitting(false);
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
const created = await createComposition({
|
|
406
|
+
signal: new AbortController().signal,
|
|
407
|
+
symbolicatedStack: selectedFolderStack === null ? null : folderSymbolicatedStack,
|
|
408
|
+
});
|
|
409
|
+
if (!created.success) {
|
|
410
|
+
(0, NotificationCenter_1.showNotification)(`Could not create composition: ${created.reason}`, 4000);
|
|
411
|
+
setSubmitting(false);
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
await (0, import_assets_1.insertElement)({
|
|
415
|
+
compositionFile: selectedNewCompositionPlan.compositionFile,
|
|
416
|
+
compositionId: newCompositionValues.id,
|
|
417
|
+
element: request.element,
|
|
418
|
+
expectedFileState: selectedNewCompositionPlan.expectedFileState,
|
|
419
|
+
from: null,
|
|
420
|
+
overwriteExisting: selectedNewCompositionPlan.expectedFileState.exists,
|
|
421
|
+
position: null,
|
|
422
|
+
});
|
|
423
|
+
onClose();
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
if (currentPlan === null) {
|
|
427
|
+
setSubmitting(false);
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
await (0, import_assets_1.insertElement)({
|
|
431
|
+
compositionFile: request.compositionFile,
|
|
432
|
+
compositionId: request.compositionId,
|
|
433
|
+
element: request.element,
|
|
434
|
+
expectedFileState: currentPlan.expectedFileState,
|
|
435
|
+
from: request.from,
|
|
436
|
+
overwriteExisting: currentPlan.expectedFileState.exists,
|
|
437
|
+
position: request.position,
|
|
438
|
+
});
|
|
439
|
+
onClose();
|
|
440
|
+
}, [
|
|
441
|
+
canSubmit,
|
|
442
|
+
createComposition,
|
|
443
|
+
currentPlan,
|
|
444
|
+
folderSymbolicatedStack,
|
|
445
|
+
mode,
|
|
446
|
+
newCompositionValues.id,
|
|
447
|
+
onClose,
|
|
448
|
+
request,
|
|
449
|
+
selectedFolderStack,
|
|
450
|
+
selectedNewCompositionPlan,
|
|
451
|
+
]);
|
|
452
|
+
const cancel = (0, react_1.useCallback)(() => {
|
|
453
|
+
if (!submitting) {
|
|
454
|
+
onClose();
|
|
455
|
+
}
|
|
456
|
+
}, [onClose, submitting]);
|
|
457
|
+
const onSubmit = (0, react_1.useCallback)((event) => {
|
|
458
|
+
event.preventDefault();
|
|
459
|
+
submit();
|
|
460
|
+
}, [submit]);
|
|
461
|
+
return (0, react_dom_1.createPortal)(jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { onOutsideClick: cancel, onEscape: cancel, children: [
|
|
462
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Install Element", onClose: cancel }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
|
|
463
|
+
jsx_runtime_1.jsxs("div", { style: dialogContent, children: [
|
|
464
|
+
jsx_runtime_1.jsxs("div", { style: destinationControlStyle, children: [
|
|
465
|
+
jsx_runtime_1.jsx("div", { style: sectionTitleStyle, children: "Add to" }), jsx_runtime_1.jsxs("div", { "aria-label": "Installation destination", role: "group", style: destinationOptionsStyle, children: [
|
|
466
|
+
jsx_runtime_1.jsx("button", { "aria-pressed": mode === 'current-composition', className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, disabled: currentPlan === null, onClick: () => setMode('current-composition'), style: getDestinationOptionStyle({
|
|
467
|
+
disabled: currentPlan === null,
|
|
468
|
+
selected: mode === 'current-composition',
|
|
469
|
+
}), type: "button", children: "Current composition" }), jsx_runtime_1.jsx("button", { "aria-pressed": mode === 'new-composition', className: `${hoverable_1.HOVERABLE_CLASS_NAME} ${hoverable_1.FOCUS_VISIBLE_ONLY_CLASS_NAME}`, onClick: () => {
|
|
470
|
+
setMode('new-composition');
|
|
471
|
+
requestAnimationFrame(() => {
|
|
472
|
+
var _a;
|
|
473
|
+
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
474
|
+
});
|
|
475
|
+
}, style: {
|
|
476
|
+
...getDestinationOptionStyle({
|
|
477
|
+
disabled: false,
|
|
478
|
+
selected: mode === 'new-composition',
|
|
479
|
+
}),
|
|
480
|
+
borderLeft: `1px solid ${colors_1.WHITE_ALPHA_12}`,
|
|
481
|
+
}, type: "button", children: "New composition" })
|
|
482
|
+
] })
|
|
483
|
+
] }), currentPlan === null ? (jsx_runtime_1.jsxs("div", { style: warningStyle, role: "status", children: [
|
|
484
|
+
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."] })
|
|
485
|
+
] })) : null, mode === 'new-composition' ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-label": "New composition settings", children: [
|
|
486
|
+
jsx_runtime_1.jsx(NewComposition_1.NewCompositionFields, { heightValidationMessage: heightValidationMessage, inputRef: inputRef, nameValidationMessage: nameValidationMessage, setValues: setNewCompositionValues, values: newCompositionValues, widthValidationMessage: widthValidationMessage }), (activeNewCompositionPlanState === null || activeNewCompositionPlanState === void 0 ? void 0 : activeNewCompositionPlanState.type) === 'error' ? (jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: activeNewCompositionPlanState.reason, type: "error" })) : null] })) : null, jsx_runtime_1.jsxs("dl", { style: metadataStyle, "aria-label": "Installation details", children: [
|
|
487
|
+
jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
488
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Element" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: request.element.displayName })
|
|
489
|
+
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
490
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Request source" }), jsx_runtime_1.jsx("dd", { style: sourceIsUnverified
|
|
491
|
+
? unverifiedSourceStyle
|
|
492
|
+
: metadataDescriptionStyle, children: sourceLabel })
|
|
493
|
+
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
494
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Composition" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: jsx_runtime_1.jsx("code", { style: codeStyle, children: mode === 'current-composition'
|
|
495
|
+
? request.compositionId
|
|
496
|
+
: newCompositionValues.id }) })
|
|
497
|
+
] }), jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
498
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "Destination" }), jsx_runtime_1.jsx("dd", { style: metadataDescriptionStyle, children: jsx_runtime_1.jsx("code", { style: codeStyle, children: (_b = selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.filePath) !== null && _b !== void 0 ? _b : 'Reviewing destination…' }) })
|
|
499
|
+
] }), (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.expectedFileState.exists) ? (jsx_runtime_1.jsxs("div", { style: metadataRowStyle, children: [
|
|
500
|
+
jsx_runtime_1.jsx("dt", { style: metadataTermStyle, children: "File change" }), jsx_runtime_1.jsx("dd", { style: overwriteStyle, children: "Replace existing source file" })
|
|
501
|
+
] })) : null] }), dependenciesToReview.length > 0 ? (jsx_runtime_1.jsxs("section", { style: sectionStyle, "aria-labelledby": "element-install-dependencies", children: [
|
|
502
|
+
jsx_runtime_1.jsx("h3", { id: "element-install-dependencies", style: sectionTitleStyle, children: "Dependencies" }), jsx_runtime_1.jsx("ul", { style: dependencyListStyle, role: "list", children: dependenciesToReview.map((packageName) => {
|
|
503
|
+
const willInstall = missingPackages.includes(packageName);
|
|
504
|
+
return (jsx_runtime_1.jsxs("li", { style: dependencyRowStyle, children: [
|
|
505
|
+
jsx_runtime_1.jsx("div", { style: dependencyNameStyle, children: packageName }), jsx_runtime_1.jsx("div", { style: willInstall
|
|
506
|
+
? dependencyInstallStatusStyle
|
|
507
|
+
: dependencyInstalledStatusStyle, children: willInstall ? 'Will be installed' : 'Installed' })
|
|
508
|
+
] }, packageName));
|
|
509
|
+
}) })
|
|
510
|
+
] })) : null, jsx_runtime_1.jsxs("div", { style: warningStyle, children: [
|
|
511
|
+
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: warningIconStyle }), jsx_runtime_1.jsxs("p", { style: warningDescriptionStyle, children: ["This adds executable source code to your project.", usesBrowserDependencyResolution
|
|
512
|
+
? null
|
|
513
|
+
: ' Package lifecycle scripts may also run during installation, with access to your files and the network.'] })
|
|
514
|
+
] }), jsx_runtime_1.jsxs("details", { style: sourceDetailsStyle, children: [
|
|
515
|
+
jsx_runtime_1.jsx("summary", { style: sourceSummaryStyle, children: "Source code" }), jsx_runtime_1.jsx("pre", { style: sourceCodeBlockStyle, children: jsx_runtime_1.jsx("code", { style: sourceCodeStyle, children: makeSourceControlsVisible(request.element.sourceCode) }) })
|
|
516
|
+
] })
|
|
517
|
+
] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { style: footerStyle, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
518
|
+
jsx_runtime_1.jsx(layout_1.Flex, {}), jsx_runtime_1.jsx(Button_1.Button, { disabled: submitting, onClick: cancel, style: cancelStyle, children: "Cancel" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs(ModalButton_1.ModalButton, { autoFocus: mode === 'current-composition', disabled: !canSubmit, onClick: submit, children: [submitting ? 'Installing…' : 'Install', jsx_runtime_1.jsx(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: false })
|
|
519
|
+
] })
|
|
520
|
+
] }) })
|
|
228
521
|
] })
|
|
229
|
-
] }));
|
|
522
|
+
] }), (0, portals_1.getPortal)(currentZIndex));
|
|
230
523
|
};
|
|
231
524
|
exports.ElementInstallConfirmation = ElementInstallConfirmation;
|