@remotion/studio 4.0.396 → 4.0.398
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/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox.js +14 -2
- package/dist/components/Modals.js +1 -1
- package/dist/components/PreviewToolbar.js +2 -3
- package/dist/components/RenderButton.d.ts +4 -1
- package/dist/components/RenderButton.js +253 -5
- package/dist/components/RenderModal/WebRenderModal.js +17 -3
- package/dist/components/RenderModal/WebRenderModalAudio.d.ts +5 -0
- package/dist/components/RenderModal/WebRenderModalAudio.js +14 -0
- package/dist/components/RenderModal/WebRenderModalBasic.d.ts +5 -5
- package/dist/components/RenderModal/WebRenderModalLicense.d.ts +9 -0
- package/dist/components/RenderModal/WebRenderModalLicense.js +130 -0
- package/dist/components/RenderModal/WebRendererExperimentalBadge.d.ts +1 -0
- package/dist/components/RenderModal/WebRendererExperimentalBadge.js +33 -0
- package/dist/esm/{chunk-khjn7st6.js → chunk-qrhc345b.js} +2493 -1810
- package/dist/esm/internals.mjs +2493 -1810
- package/dist/esm/previewEntry.mjs +2524 -1841
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/inject-css.js +0 -1
- package/dist/helpers/should-show-render-button.d.ts +1 -0
- package/dist/helpers/should-show-render-button.js +11 -0
- package/dist/helpers/use-menu-structure.js +19 -1
- package/dist/icons/certificate.d.ts +1 -0
- package/dist/icons/certificate.js +6 -0
- package/dist/icons/render.d.ts +0 -3
- package/dist/icons/render.js +1 -5
- package/dist/state/modals.d.ts +1 -0
- package/package.json +9 -9
- package/dist/components/WebRender/TriggerWebRender.d.ts +0 -1
- package/dist/components/WebRender/TriggerWebRender.js +0 -56
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebRenderModalLicense = exports.row = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../../helpers/colors");
|
|
7
|
+
const Checkbox_1 = require("../Checkbox");
|
|
8
|
+
const RemInput_1 = require("../NewComposition/RemInput");
|
|
9
|
+
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
10
|
+
const layout_1 = require("../layout");
|
|
11
|
+
exports.row = {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
paddingLeft: 16,
|
|
15
|
+
paddingRight: 16,
|
|
16
|
+
};
|
|
17
|
+
const tabContainer = {
|
|
18
|
+
flex: 1,
|
|
19
|
+
};
|
|
20
|
+
const descriptionStyle = {
|
|
21
|
+
color: colors_1.LIGHT_TEXT,
|
|
22
|
+
fontSize: 14,
|
|
23
|
+
fontFamily: 'sans-serif',
|
|
24
|
+
paddingLeft: 16,
|
|
25
|
+
paddingRight: 16,
|
|
26
|
+
paddingTop: 16,
|
|
27
|
+
paddingBottom: 8,
|
|
28
|
+
lineHeight: 1.5,
|
|
29
|
+
};
|
|
30
|
+
const paddedDescriptionStyle = {
|
|
31
|
+
color: colors_1.LIGHT_TEXT,
|
|
32
|
+
fontSize: 14,
|
|
33
|
+
fontFamily: 'sans-serif',
|
|
34
|
+
padding: 9,
|
|
35
|
+
border: '1px solid ' + colors_1.INPUT_BORDER_COLOR_UNHOVERED,
|
|
36
|
+
borderRadius: 8,
|
|
37
|
+
lineHeight: 1.5,
|
|
38
|
+
marginLeft: 16,
|
|
39
|
+
marginRight: 16,
|
|
40
|
+
};
|
|
41
|
+
const descriptionLink = {
|
|
42
|
+
color: 'white',
|
|
43
|
+
fontSize: 14,
|
|
44
|
+
};
|
|
45
|
+
const checkboxLabel = {
|
|
46
|
+
fontSize: 14,
|
|
47
|
+
lineHeight: '40px',
|
|
48
|
+
color: colors_1.LIGHT_TEXT,
|
|
49
|
+
flex: 1,
|
|
50
|
+
fontFamily: 'sans-serif',
|
|
51
|
+
cursor: 'pointer',
|
|
52
|
+
userSelect: 'none',
|
|
53
|
+
};
|
|
54
|
+
const inputStyle = {
|
|
55
|
+
minWidth: 250,
|
|
56
|
+
};
|
|
57
|
+
const justifyCenter = {
|
|
58
|
+
display: 'flex',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
gap: 10,
|
|
61
|
+
flex: 1,
|
|
62
|
+
};
|
|
63
|
+
const codeStyle = {
|
|
64
|
+
fontSize: 14,
|
|
65
|
+
fontFamily: 'monospace',
|
|
66
|
+
color: colors_1.BLUE,
|
|
67
|
+
};
|
|
68
|
+
const codeLine = {
|
|
69
|
+
fontSize: 14,
|
|
70
|
+
fontFamily: 'monospace',
|
|
71
|
+
color: colors_1.LIGHT_TEXT,
|
|
72
|
+
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
73
|
+
padding: 6,
|
|
74
|
+
borderRadius: 3,
|
|
75
|
+
marginTop: 6,
|
|
76
|
+
overflowX: 'auto',
|
|
77
|
+
maxWidth: '100%',
|
|
78
|
+
};
|
|
79
|
+
const codeLineSmall = {
|
|
80
|
+
...codeLine,
|
|
81
|
+
fontSize: 11,
|
|
82
|
+
};
|
|
83
|
+
const LICENSE_KEY_LENGTH = 55;
|
|
84
|
+
const LICENSE_KEY_PREFIX = 'rm_pub_';
|
|
85
|
+
const validateLicenseKey = (key) => {
|
|
86
|
+
if (key.length === 0) {
|
|
87
|
+
return { valid: false, message: null };
|
|
88
|
+
}
|
|
89
|
+
if (!key.startsWith(LICENSE_KEY_PREFIX)) {
|
|
90
|
+
return {
|
|
91
|
+
valid: false,
|
|
92
|
+
message: `License key must start with "${LICENSE_KEY_PREFIX}"`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const afterPrefix = key.slice(LICENSE_KEY_PREFIX.length);
|
|
96
|
+
if (!/^[a-zA-Z0-9]*$/.test(afterPrefix)) {
|
|
97
|
+
return {
|
|
98
|
+
valid: false,
|
|
99
|
+
message: 'License key must contain only alphanumeric characters after the prefix',
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (key.length !== LICENSE_KEY_LENGTH) {
|
|
103
|
+
return {
|
|
104
|
+
valid: false,
|
|
105
|
+
message: `License key must be ${LICENSE_KEY_LENGTH} characters long`,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return { valid: true, message: null };
|
|
109
|
+
};
|
|
110
|
+
const WebRenderModalLicense = ({ licenseKey, setLicenseKey, initialPublicLicenseKey, }) => {
|
|
111
|
+
const onFreeLicenseChange = (0, react_1.useCallback)(() => {
|
|
112
|
+
setLicenseKey('free-license');
|
|
113
|
+
}, [setLicenseKey]);
|
|
114
|
+
const onCompanyLicenseChange = (0, react_1.useCallback)(() => {
|
|
115
|
+
setLicenseKey(initialPublicLicenseKey !== null && initialPublicLicenseKey !== void 0 ? initialPublicLicenseKey : '');
|
|
116
|
+
}, [initialPublicLicenseKey, setLicenseKey]);
|
|
117
|
+
const onLicenseKeyChange = (0, react_1.useCallback)((e) => {
|
|
118
|
+
setLicenseKey(e.target.value);
|
|
119
|
+
}, [setLicenseKey]);
|
|
120
|
+
const licenseValidation = (0, react_1.useMemo)(() => {
|
|
121
|
+
if (licenseKey === null || licenseKey === 'free-license') {
|
|
122
|
+
return { valid: true, message: null };
|
|
123
|
+
}
|
|
124
|
+
return validateLicenseKey(licenseKey);
|
|
125
|
+
}, [licenseKey]);
|
|
126
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: tabContainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: descriptionStyle, children: ["Remotion is free if you are an individual or company with a headcount of 3 or less. See", ' ', (0, jsx_runtime_1.jsx)("a", { style: descriptionLink, href: "https://remotion.dev/license", children: "LICENSE.md" }), "."] }), (0, jsx_runtime_1.jsx)("div", { style: exports.row, children: (0, jsx_runtime_1.jsxs)("div", { style: justifyCenter, children: [(0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: licenseKey === 'free-license', onChange: onFreeLicenseChange, name: "free-license", rounded: true }), (0, jsx_runtime_1.jsxs)("div", { style: checkboxLabel, onClick: onFreeLicenseChange, children: ["I am eligible for the Free License, ", "don't", " print a warning"] })] }) }), licenseKey === 'free-license' ? ((0, jsx_runtime_1.jsxs)("div", { style: paddedDescriptionStyle, children: ["Enjoy Remotion! Add the following to", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeStyle, children: "remotion.config.ts" }), " to persist this setting:", (0, jsx_runtime_1.jsx)("div", { style: codeLine, children: "Config.setPublicLicenseKey('free-license');" })] })) : null, (0, jsx_runtime_1.jsx)("div", { style: exports.row, children: (0, jsx_runtime_1.jsxs)("div", { style: justifyCenter, children: [(0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: licenseKey !== 'free-license' && licenseKey !== null, onChange: onCompanyLicenseChange, name: "company-license", rounded: true }), (0, jsx_runtime_1.jsx)("div", { style: checkboxLabel, onClick: onCompanyLicenseChange, children: "I have a Company License" })] }) }), licenseKey !== 'free-license' && licenseKey !== null ? ((0, jsx_runtime_1.jsxs)("div", { style: paddedDescriptionStyle, children: ["Add your public license from", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.pro/dashboard", target: "_blank", style: descriptionLink, children: "remotion.pro" }), ' ', "key below.", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: licenseKey, onChange: onLicenseKeyChange, placeholder: "remotion.pro public license key (starts with rm_pub_)", status: licenseValidation.valid || licenseKey.length === 0
|
|
127
|
+
? 'ok'
|
|
128
|
+
: 'error', rightAlign: false, style: inputStyle, autoFocus: true }), licenseValidation.message ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: licenseValidation.message, align: "flex-start", type: "error" })] })) : null, licenseValidation.valid && licenseKey.length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), "Add the following to", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeStyle, children: "remotion.config.ts" }), " to persist this setting:", (0, jsx_runtime_1.jsx)("div", { style: codeLineSmall, children: "Config.setPublicLicenseKey('" + licenseKey + "');" })] })) : null] })) : null, licenseKey === null ? ((0, jsx_runtime_1.jsxs)("div", { style: descriptionStyle, children: ["If you are not eligible for the free license, you need to obtain a", ' ', (0, jsx_runtime_1.jsx)("a", { style: descriptionLink, target: "_blank", href: "https://remotion.pro/license", children: "Company License" }), "."] })) : null] }));
|
|
129
|
+
};
|
|
130
|
+
exports.WebRenderModalLicense = WebRenderModalLicense;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WebRendererExperimentalBadge: React.FC;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebRendererExperimentalBadge = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../../helpers/colors");
|
|
6
|
+
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
7
|
+
const row = {
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexDirection: 'row',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
};
|
|
13
|
+
const text = {
|
|
14
|
+
fontSize: 14,
|
|
15
|
+
fontFamily: 'sans-serif',
|
|
16
|
+
color: colors_1.LIGHT_TEXT,
|
|
17
|
+
};
|
|
18
|
+
const icon = {
|
|
19
|
+
width: 14,
|
|
20
|
+
height: 14,
|
|
21
|
+
flexShrink: 0,
|
|
22
|
+
fill: colors_1.WARNING_COLOR,
|
|
23
|
+
marginRight: 8,
|
|
24
|
+
};
|
|
25
|
+
const link = {
|
|
26
|
+
color: 'inherit',
|
|
27
|
+
textDecoration: 'underline',
|
|
28
|
+
fontSize: 14,
|
|
29
|
+
};
|
|
30
|
+
const WebRendererExperimentalBadge = () => {
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: row, children: [(0, jsx_runtime_1.jsx)(ValidationMessage_1.WarningTriangle, { type: "warning", style: icon }), (0, jsx_runtime_1.jsxs)("div", { style: text, children: ["The Remotion Web Renderer is experimental.", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://github.com/remotion-dev/remotion/issues/5913", target: "_blank", rel: "noopener noreferrer", style: link, children: "Track progress on GitHub" }), ' ', "and discuss in the", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.dev/discord", target: "_blank", rel: "noopener noreferrer", style: link, children: "#web-renderer" }), ' ', "channel on Discord."] })] }));
|
|
32
|
+
};
|
|
33
|
+
exports.WebRendererExperimentalBadge = WebRendererExperimentalBadge;
|