init commit
This commit is contained in:
3
remotion/node_modules/@remotion/studio/dist/components/UpdateModal/OpenIssueButton.d.ts
generated
vendored
Normal file
3
remotion/node_modules/@remotion/studio/dist/components/UpdateModal/OpenIssueButton.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const OpenIssueButton: React.FC<{
|
||||
link: string;
|
||||
}>;
|
||||
37
remotion/node_modules/@remotion/studio/dist/components/UpdateModal/OpenIssueButton.js
generated
vendored
Normal file
37
remotion/node_modules/@remotion/studio/dist/components/UpdateModal/OpenIssueButton.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.OpenIssueButton = void 0;
|
||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||
const react_1 = require("react");
|
||||
const colors_1 = require("../../helpers/colors");
|
||||
const svgStyle = {
|
||||
width: '11px',
|
||||
height: '11px',
|
||||
};
|
||||
const buttonStyle = {
|
||||
border: 'none',
|
||||
width: '24px',
|
||||
height: '24px',
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
};
|
||||
const OpenIssueButton = ({ link }) => {
|
||||
const [hovered, setHovered] = (0, react_1.useState)(false);
|
||||
const buttonTooltip = `Open GitHub issue in new Tab`;
|
||||
const handleClick = (0, react_1.useCallback)(() => {
|
||||
window.open(link, '_blank');
|
||||
}, [link]);
|
||||
const svgFillColor = (0, react_1.useMemo)(() => {
|
||||
return hovered ? 'white' : colors_1.LIGHT_TEXT;
|
||||
}, [hovered]);
|
||||
const openInEditorSvg = ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: svgFillColor, d: "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z" }) }));
|
||||
const onPointerEnter = (0, react_1.useCallback)(() => {
|
||||
setHovered(true);
|
||||
}, []);
|
||||
const onPointerLeave = (0, react_1.useCallback)(() => {
|
||||
setHovered(false);
|
||||
}, []);
|
||||
return ((0, jsx_runtime_1.jsx)("button", { title: buttonTooltip, type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: buttonStyle, onClick: handleClick, children: openInEditorSvg }));
|
||||
};
|
||||
exports.OpenIssueButton = OpenIssueButton;
|
||||
6
remotion/node_modules/@remotion/studio/dist/components/UpdateModal/UpdateModal.d.ts
generated
vendored
Normal file
6
remotion/node_modules/@remotion/studio/dist/components/UpdateModal/UpdateModal.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import React from 'react';
|
||||
import type { Bug, UpdateInfo } from '../UpdateCheck';
|
||||
export declare const UpdateModal: React.FC<{
|
||||
readonly info: UpdateInfo;
|
||||
readonly knownBugs: Bug[];
|
||||
}>;
|
||||
58
remotion/node_modules/@remotion/studio/dist/components/UpdateModal/UpdateModal.js
generated
vendored
Normal file
58
remotion/node_modules/@remotion/studio/dist/components/UpdateModal/UpdateModal.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UpdateModal = void 0;
|
||||
const jsx_runtime_1 = require("react/jsx-runtime");
|
||||
const react_1 = require("react");
|
||||
const colors_1 = require("../../helpers/colors");
|
||||
const copy_text_1 = require("../../helpers/copy-text");
|
||||
const CopyButton_1 = require("../CopyButton");
|
||||
const KnownBugs_1 = require("../KnownBugs");
|
||||
const ModalHeader_1 = require("../ModalHeader");
|
||||
const DismissableModal_1 = require("../NewComposition/DismissableModal");
|
||||
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
||||
const layout_1 = require("../layout");
|
||||
const container = {
|
||||
padding: 20,
|
||||
paddingTop: 0,
|
||||
};
|
||||
const text = {
|
||||
fontSize: 14,
|
||||
};
|
||||
const title = {
|
||||
paddingTop: 12,
|
||||
paddingBottom: 8,
|
||||
...text,
|
||||
};
|
||||
const code = {
|
||||
background: colors_1.SELECTED_BACKGROUND,
|
||||
padding: '12px 10px',
|
||||
fontSize: 14,
|
||||
marginTop: 10,
|
||||
marginBottom: 10,
|
||||
};
|
||||
const link = {
|
||||
fontWeight: 'bold',
|
||||
color: colors_1.BLUE,
|
||||
textDecoration: 'none',
|
||||
...text,
|
||||
};
|
||||
const commands = {
|
||||
npm: 'npx remotion upgrade',
|
||||
yarn: 'yarn remotion upgrade',
|
||||
pnpm: 'pnpm exec remotion upgrade',
|
||||
bun: 'bun remotion upgrade',
|
||||
unknown: 'npx remotion upgrade',
|
||||
};
|
||||
const UpdateModal = ({ info, knownBugs }) => {
|
||||
const hasKnownBugs = (0, react_1.useMemo)(() => {
|
||||
return knownBugs && (knownBugs === null || knownBugs === void 0 ? void 0 : knownBugs.length) > 0;
|
||||
}, [knownBugs]);
|
||||
const command = commands[info.packageManager];
|
||||
const onClick = (0, react_1.useCallback)(() => {
|
||||
(0, copy_text_1.copyText)(command).catch((err) => {
|
||||
(0, NotificationCenter_1.showNotification)(`Could not copy: ${err.message}`, 2000);
|
||||
});
|
||||
}, [command]);
|
||||
return ((0, jsx_runtime_1.jsxs)(DismissableModal_1.DismissableModal, { children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.ModalHeader, { title: "Update available" }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [hasKnownBugs ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: title, children: ["The currently installed version ", info.currentVersion, " has the following known bugs:"] }), (0, jsx_runtime_1.jsx)(KnownBugs_1.KnownBugs, { bugs: knownBugs }), (0, jsx_runtime_1.jsx)("div", { style: { height: '20px' } }), (0, jsx_runtime_1.jsx)("div", { style: text, children: "To upgrade, run the following command:" })] })) : ((0, jsx_runtime_1.jsx)("div", { style: title, children: "A new update for Remotion is available! Run the following command:" })), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, { children: (0, jsx_runtime_1.jsx)("pre", { onClick: onClick, style: code, children: command }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(CopyButton_1.CopyButton, { textToCopy: command, label: "Copy", labelWhenCopied: "Copied!" })] }), (0, jsx_runtime_1.jsxs)("div", { style: text, children: ["This will upgrade Remotion from ", info.currentVersion, " to", ' ', info.latestVersion, "."] }), (0, jsx_runtime_1.jsxs)("div", { style: text, children: ["Read the", ' ', (0, jsx_runtime_1.jsx)("a", { style: link, target: "_blank", href: "https://github.com/remotion-dev/remotion/releases", children: "Release notes" }), ' ', "to know what", "'s", " new in Remotion."] })] })] }));
|
||||
};
|
||||
exports.UpdateModal = UpdateModal;
|
||||
Reference in New Issue
Block a user