@remotion/studio 4.0.497 → 4.0.498
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.js +1 -1
- package/dist/components/ConfigureLicenseModal.d.ts +4 -0
- package/dist/components/ConfigureLicenseModal.js +194 -0
- package/dist/components/Editor.d.ts +0 -1
- package/dist/components/Editor.js +2 -3
- package/dist/components/InspectorPanel/CompositionInspector.js +2 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -4
- package/dist/components/InspectorPanel/use-composition-actions.js +1 -1
- package/dist/components/LicenseKeyValidation.d.ts +17 -0
- package/dist/components/LicenseKeyValidation.js +113 -0
- package/dist/components/Modals.js +2 -1
- package/dist/components/RenderButton.js +0 -1
- package/dist/components/RenderModal/WebRenderModal.js +14 -8
- package/dist/components/SelectedOutlineOverlay.js +1 -1
- package/dist/components/Timeline/MaxTimelineTracks.d.ts +0 -1
- package/dist/components/Timeline/MaxTimelineTracks.js +3 -3
- package/dist/components/Timeline/Timeline.js +9 -8
- package/dist/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/components/Timeline/TimelineSelection.js +1 -1
- package/dist/components/Timeline/TimelineSequence.js +6 -6
- package/dist/components/Timeline/TimelineSequenceItem.js +5 -5
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +8 -0
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +40 -2
- package/dist/components/Timeline/call-update-keyframe-settings.d.ts +17 -0
- package/dist/components/Timeline/call-update-keyframe-settings.js +43 -1
- package/dist/components/Timeline/update-selected-easing.js +26 -23
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +5 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +16 -9
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -1
- package/dist/esm/{chunk-5wj95bdd.js → chunk-7a6q9hk2.js} +2454 -2312
- package/dist/esm/index.mjs +0 -19
- package/dist/esm/internals.mjs +2454 -2312
- package/dist/esm/previewEntry.mjs +2457 -2315
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/interactivity-enabled.d.ts +1 -1
- package/dist/helpers/interactivity-enabled.js +2 -2
- package/dist/helpers/retry-payload.js +0 -1
- package/dist/helpers/use-menu-structure.js +9 -3
- package/dist/state/modals.d.ts +3 -1
- package/dist/visual-controls/VisualControls.js +1 -1
- package/package.json +11 -11
- package/dist/components/RenderModal/WebRenderModalLicense.d.ts +0 -9
- package/dist/components/RenderModal/WebRenderModalLicense.js +0 -189
- package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.d.ts +0 -13
- package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.js +0 -60
|
@@ -30,7 +30,7 @@ const Checkbox = ({ checked, onChange, disabled, name, rounded, variant = 'defau
|
|
|
30
30
|
const bullet = (0, react_1.useMemo)(() => ({
|
|
31
31
|
width: bulletSize,
|
|
32
32
|
height: bulletSize,
|
|
33
|
-
backgroundColor: colors_1.
|
|
33
|
+
backgroundColor: colors_1.WHITE,
|
|
34
34
|
borderRadius: '50%',
|
|
35
35
|
}), [bulletSize]);
|
|
36
36
|
const box = (0, react_1.useMemo)(() => ({
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigureLicenseModal = 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 modals_1 = require("../state/modals");
|
|
8
|
+
const call_api_1 = require("./call-api");
|
|
9
|
+
const Checkbox_1 = require("./Checkbox");
|
|
10
|
+
const layout_1 = require("./layout");
|
|
11
|
+
const LicenseKeyValidation_1 = require("./LicenseKeyValidation");
|
|
12
|
+
const ModalButton_1 = require("./ModalButton");
|
|
13
|
+
const ModalContainer_1 = require("./ModalContainer");
|
|
14
|
+
const ModalFooter_1 = require("./ModalFooter");
|
|
15
|
+
const ModalHeader_1 = require("./ModalHeader");
|
|
16
|
+
const RemInput_1 = require("./NewComposition/RemInput");
|
|
17
|
+
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
18
|
+
const content = {
|
|
19
|
+
padding: 16,
|
|
20
|
+
width: 540,
|
|
21
|
+
maxWidth: 'calc(100vw - 40px)',
|
|
22
|
+
};
|
|
23
|
+
const description = {
|
|
24
|
+
color: colors_1.LIGHT_TEXT,
|
|
25
|
+
fontFamily: 'sans-serif',
|
|
26
|
+
fontSize: 14,
|
|
27
|
+
lineHeight: 1.5,
|
|
28
|
+
margin: 0,
|
|
29
|
+
marginTop: 10,
|
|
30
|
+
};
|
|
31
|
+
const descriptionLink = {
|
|
32
|
+
color: colors_1.WHITE,
|
|
33
|
+
fontFamily: 'sans-serif',
|
|
34
|
+
fontSize: 14,
|
|
35
|
+
lineHeight: '21px',
|
|
36
|
+
};
|
|
37
|
+
const checkboxRow = {
|
|
38
|
+
display: 'flex',
|
|
39
|
+
flexDirection: 'row',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
cursor: 'pointer',
|
|
42
|
+
marginTop: 5,
|
|
43
|
+
marginBottom: 5,
|
|
44
|
+
};
|
|
45
|
+
const checkboxLabel = {
|
|
46
|
+
color: colors_1.LIGHT_TEXT,
|
|
47
|
+
fontFamily: 'sans-serif',
|
|
48
|
+
fontSize: 14,
|
|
49
|
+
lineHeight: '20px',
|
|
50
|
+
cursor: 'pointer',
|
|
51
|
+
userSelect: 'none',
|
|
52
|
+
};
|
|
53
|
+
const inputLabel = {
|
|
54
|
+
color: colors_1.LIGHT_TEXT,
|
|
55
|
+
display: 'block',
|
|
56
|
+
fontFamily: 'sans-serif',
|
|
57
|
+
fontSize: 13,
|
|
58
|
+
lineHeight: '20px',
|
|
59
|
+
marginBottom: 6,
|
|
60
|
+
marginTop: 10,
|
|
61
|
+
};
|
|
62
|
+
const ConfigureLicenseModal = ({ initialPublicLicenseKey }) => {
|
|
63
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
64
|
+
const initialLicenseType = initialPublicLicenseKey === 'free-license'
|
|
65
|
+
? 'free'
|
|
66
|
+
: initialPublicLicenseKey === null
|
|
67
|
+
? null
|
|
68
|
+
: 'company';
|
|
69
|
+
const [licenseType, setLicenseType] = (0, react_1.useState)(initialLicenseType);
|
|
70
|
+
const [companyLicenseKey, setCompanyLicenseKey] = (0, react_1.useState)(initialLicenseType === 'company' ? (initialPublicLicenseKey !== null && initialPublicLicenseKey !== void 0 ? initialPublicLicenseKey : '') : '');
|
|
71
|
+
const [isSubmitting, setIsSubmitting] = (0, react_1.useState)(false);
|
|
72
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
73
|
+
const [isValidatingLicenseKey, setIsValidatingLicenseKey] = (0, react_1.useState)(false);
|
|
74
|
+
const [remoteValidationMessage, setRemoteValidationMessage] = (0, react_1.useState)(null);
|
|
75
|
+
const [licenseKeyDetails, setLicenseKeyDetails] = (0, react_1.useState)(null);
|
|
76
|
+
const dismiss = (0, react_1.useCallback)(() => {
|
|
77
|
+
setSelectedModal(null);
|
|
78
|
+
}, [setSelectedModal]);
|
|
79
|
+
const chooseFreeLicense = (0, react_1.useCallback)(() => {
|
|
80
|
+
setLicenseType('free');
|
|
81
|
+
setError(null);
|
|
82
|
+
}, []);
|
|
83
|
+
const chooseCompanyLicense = (0, react_1.useCallback)(() => {
|
|
84
|
+
setLicenseType('company');
|
|
85
|
+
setError(null);
|
|
86
|
+
}, []);
|
|
87
|
+
const publicLicenseKey = (0, react_1.useMemo)(() => {
|
|
88
|
+
if (licenseType === 'free') {
|
|
89
|
+
return 'free-license';
|
|
90
|
+
}
|
|
91
|
+
if (licenseType === 'company') {
|
|
92
|
+
return companyLicenseKey.trim();
|
|
93
|
+
}
|
|
94
|
+
return '';
|
|
95
|
+
}, [companyLicenseKey, licenseType]);
|
|
96
|
+
const localLicenseKeyValidation = (0, react_1.useMemo)(() => (0, LicenseKeyValidation_1.validateLicenseKey)(companyLicenseKey.trim()), [companyLicenseKey]);
|
|
97
|
+
(0, react_1.useEffect)(() => {
|
|
98
|
+
let cancelled = false;
|
|
99
|
+
setLicenseKeyDetails(null);
|
|
100
|
+
setRemoteValidationMessage(null);
|
|
101
|
+
if (licenseType !== 'company' || !localLicenseKeyValidation.valid) {
|
|
102
|
+
setIsValidatingLicenseKey(false);
|
|
103
|
+
return () => {
|
|
104
|
+
cancelled = true;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
setIsValidatingLicenseKey(true);
|
|
108
|
+
(0, LicenseKeyValidation_1.fetchLicenseKeyDetails)(companyLicenseKey.trim())
|
|
109
|
+
.then((details) => {
|
|
110
|
+
if (cancelled) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
setIsValidatingLicenseKey(false);
|
|
114
|
+
if (details.isValid) {
|
|
115
|
+
setLicenseKeyDetails(details);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
setRemoteValidationMessage('License key is invalid or has been reset');
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
.catch(() => {
|
|
122
|
+
if (cancelled) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
setIsValidatingLicenseKey(false);
|
|
126
|
+
setRemoteValidationMessage('Failed to fetch license key details');
|
|
127
|
+
});
|
|
128
|
+
return () => {
|
|
129
|
+
cancelled = true;
|
|
130
|
+
};
|
|
131
|
+
}, [companyLicenseKey, licenseType, localLicenseKeyValidation.valid]);
|
|
132
|
+
const companyLicenseKeyIsValid = localLicenseKeyValidation.valid &&
|
|
133
|
+
(licenseKeyDetails === null || licenseKeyDetails === void 0 ? void 0 : licenseKeyDetails.isValid) === true &&
|
|
134
|
+
!isValidatingLicenseKey;
|
|
135
|
+
const submit = (0, react_1.useCallback)(async () => {
|
|
136
|
+
if (publicLicenseKey.length === 0) {
|
|
137
|
+
setError(licenseType === null
|
|
138
|
+
? 'Select a license type.'
|
|
139
|
+
: 'Enter your public license key.');
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (licenseType === 'company' && !companyLicenseKeyIsValid) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
setIsSubmitting(true);
|
|
146
|
+
setError(null);
|
|
147
|
+
try {
|
|
148
|
+
const response = await (0, call_api_1.callApi)('/api/update-public-license', {
|
|
149
|
+
publicLicenseKey,
|
|
150
|
+
});
|
|
151
|
+
if (!response.success) {
|
|
152
|
+
setError(response.reason);
|
|
153
|
+
setIsSubmitting(false);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
dismiss();
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
setError(err.message);
|
|
160
|
+
setIsSubmitting(false);
|
|
161
|
+
}
|
|
162
|
+
}, [companyLicenseKeyIsValid, dismiss, licenseType, publicLicenseKey]);
|
|
163
|
+
return (jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { onEscape: dismiss, onOutsideClick: dismiss, children: [
|
|
164
|
+
jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Configure License", onClose: dismiss }), jsx_runtime_1.jsxs("div", { style: content, children: [
|
|
165
|
+
jsx_runtime_1.jsxs("p", { style: description, children: ["Remotion is free if you are an individual or company with a headcount of 3 or less. See", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.dev/license", children: "LICENSE.md" }),
|
|
166
|
+
"."] }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2 }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: chooseFreeLicense, children: [
|
|
167
|
+
jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'free', onChange: chooseFreeLicense, name: "free-license", rounded: true }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: checkboxLabel, children: "I am eligible for the Free License" })
|
|
168
|
+
] }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: chooseCompanyLicense, children: [
|
|
169
|
+
jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'company', onChange: chooseCompanyLicense, name: "company-license", rounded: true }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: checkboxLabel, children: "I need a Company License" })
|
|
170
|
+
] }), licenseType === 'company' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
171
|
+
jsx_runtime_1.jsxs("p", { style: description, children: ["Visit", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.pro/license", children: "remotion.pro/license" }), ' ', "to obtain a license key. Enter the public license key from", ' "License Keys".'] }), jsx_runtime_1.jsxs("label", { style: inputLabel, children: ["Public license key",
|
|
172
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { status: localLicenseKeyValidation.message ||
|
|
173
|
+
remoteValidationMessage ||
|
|
174
|
+
(licenseKeyDetails !== null &&
|
|
175
|
+
!(0, LicenseKeyValidation_1.hasActiveCompanyLicense)(licenseKeyDetails))
|
|
176
|
+
? 'error'
|
|
177
|
+
: 'ok', rightAlign: false, value: companyLicenseKey, onChange: (event) => {
|
|
178
|
+
setCompanyLicenseKey(event.target.value);
|
|
179
|
+
setError(null);
|
|
180
|
+
}, placeholder: "rm_pub_...", autoFocus: true })
|
|
181
|
+
] }), localLicenseKeyValidation.message ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
182
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: localLicenseKeyValidation.message, align: "flex-start", type: "error" })
|
|
183
|
+
] })) : null, remoteValidationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
184
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: remoteValidationMessage, align: "flex-start", type: "error" })
|
|
185
|
+
] })) : null, isValidatingLicenseKey ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
186
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx("p", { style: description, children: "Loading license key details..." })
|
|
187
|
+
] })) : null, licenseKeyDetails ? (jsx_runtime_1.jsx(LicenseKeyValidation_1.LicenseKeyDetailsDisplay, { details: licenseKeyDetails })) : null] })) : null, error ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
188
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1.5 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: error, align: "flex-start", type: "error" })
|
|
189
|
+
] })) : null] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(layout_1.Row, { justify: "flex-end", children: jsx_runtime_1.jsx(ModalButton_1.ModalButton, { onClick: submit, disabled: isSubmitting ||
|
|
190
|
+
publicLicenseKey.length === 0 ||
|
|
191
|
+
(licenseType === 'company' && !companyLicenseKeyIsValid), autoFocus: licenseType !== 'company', children: isSubmitting ? 'Submitting...' : 'Submit and reload' }) }) })
|
|
192
|
+
] }));
|
|
193
|
+
};
|
|
194
|
+
exports.ConfigureLicenseModal = ConfigureLicenseModal;
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Editor =
|
|
36
|
+
exports.Editor = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const player_1 = require("@remotion/player");
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
@@ -63,7 +63,6 @@ const background = {
|
|
|
63
63
|
flexDirection: 'column',
|
|
64
64
|
position: 'absolute',
|
|
65
65
|
};
|
|
66
|
-
exports.BUFFER_STATE_DELAY_IN_MILLISECONDS = (0, studio_runtime_config_1.getStudioBufferStateDelayInMilliseconds)();
|
|
67
66
|
const Editor = ({ Root, readOnlyStudio }) => {
|
|
68
67
|
const [drawElement, setDrawElement] = (0, react_1.useState)(null);
|
|
69
68
|
const size = player_1.PlayerInternals.useElementSize(drawElement, {
|
|
@@ -98,7 +97,7 @@ const Editor = ({ Root, readOnlyStudio }) => {
|
|
|
98
97
|
const editor = (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(timeline_zoom_1.TimelineZoomContext, { children: jsx_runtime_1.jsxs(SequencePropsSubscriptionProvider_1.SequencePropsSubscriptionProvider, { children: [
|
|
99
98
|
jsx_runtime_1.jsxs(remotion_1.Internals.CurrentScaleContext.Provider, { value: value, children: [
|
|
100
99
|
jsx_runtime_1.jsx(ForceSpecificCursor_1.ForceSpecificCursor, {}), jsx_runtime_1.jsx(scale_lock_1.ScaleLockProvider, { children: jsx_runtime_1.jsxs("div", { style: background, children: [
|
|
101
|
-
jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsx(remotion_1.Internals.CanUseRemotionHooksProvider, { children: jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds:
|
|
100
|
+
jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsx(remotion_1.Internals.CanUseRemotionHooksProvider, { children: jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds: (0, studio_runtime_config_1.getStudioBufferStateDelayInMilliseconds)(), onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }) })
|
|
102
101
|
] }) })
|
|
103
102
|
] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
|
|
104
103
|
] }) }) }));
|
|
@@ -94,7 +94,8 @@ const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, setD
|
|
|
94
94
|
};
|
|
95
95
|
const CompositionVisualControlsSection = () => {
|
|
96
96
|
const { handles: visualControlHandles } = (0, react_1.useContext)(VisualControls_1.VisualControlsContext);
|
|
97
|
-
const hasVisualControls = interactivity_enabled_1.
|
|
97
|
+
const hasVisualControls = (0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
|
|
98
|
+
Object.keys(visualControlHandles).length > 0;
|
|
98
99
|
if (!hasVisualControls) {
|
|
99
100
|
return null;
|
|
100
101
|
}
|
|
@@ -44,7 +44,7 @@ const SplitSequenceAction = ({ selection, track }) => {
|
|
|
44
44
|
splitFrame: timelinePosition,
|
|
45
45
|
propStatuses: sequencePropStatuses,
|
|
46
46
|
}), [selection, sequencePropStatuses, timelinePosition, track.sequence]);
|
|
47
|
-
const canSplit = interactivity_enabled_1.
|
|
47
|
+
const canSplit = (0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
|
|
48
48
|
sequencePropStatuses !== undefined &&
|
|
49
49
|
eligibility.canSplit;
|
|
50
50
|
const onSplit = (0, react_1.useCallback)(() => {
|
|
@@ -56,7 +56,7 @@ const SplitSequenceAction = ({ selection, track }) => {
|
|
|
56
56
|
splitFrame: timelinePosition,
|
|
57
57
|
}).catch(() => undefined);
|
|
58
58
|
}, [canSplit, eligibility, timelinePosition]);
|
|
59
|
-
const disabledReason = !interactivity_enabled_1.
|
|
59
|
+
const disabledReason = !(0, interactivity_enabled_1.isStudioInteractivityEnabled)()
|
|
60
60
|
? 'Studio is read-only'
|
|
61
61
|
: sequencePropStatuses === undefined
|
|
62
62
|
? 'Waiting for sequence prop status'
|
|
@@ -73,7 +73,7 @@ const SequenceSourceActions = ({ selection, track, validatedSource }) => {
|
|
|
73
73
|
const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
|
|
74
74
|
const propStatusesForOverride = (0, react_1.useMemo)(() => remotion_1.Internals.getPropStatusesCtx(propStatuses, selection.nodePathInfo.sequenceSubscriptionKey), [propStatuses, selection.nodePathInfo.sequenceSubscriptionKey]);
|
|
75
75
|
const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.useSequenceFreezeFrameMenuItem)({
|
|
76
|
-
clientId: previewServerState.type === 'connected' && interactivity_enabled_1.
|
|
76
|
+
clientId: previewServerState.type === 'connected' && (0, interactivity_enabled_1.isStudioInteractivityEnabled)()
|
|
77
77
|
? previewServerState.clientId
|
|
78
78
|
: null,
|
|
79
79
|
nodePath: selection.nodePathInfo.sequenceSubscriptionKey,
|
|
@@ -84,7 +84,7 @@ const SequenceSourceActions = ({ selection, track, validatedSource }) => {
|
|
|
84
84
|
timelinePosition,
|
|
85
85
|
validatedSource,
|
|
86
86
|
});
|
|
87
|
-
const sourceActionsDisabled = previewServerState.type !== 'connected' || !interactivity_enabled_1.
|
|
87
|
+
const sourceActionsDisabled = previewServerState.type !== 'connected' || !(0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
88
88
|
const onDuplicate = (0, react_1.useCallback)(() => {
|
|
89
89
|
if (sourceActionsDisabled) {
|
|
90
90
|
return;
|
|
@@ -18,7 +18,7 @@ const useCompositionActions = () => {
|
|
|
18
18
|
const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
|
|
19
19
|
const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
|
|
20
20
|
const previewConnected = previewServerState.type === 'connected';
|
|
21
|
-
const previewInteractive = previewConnected && interactivity_enabled_1.
|
|
21
|
+
const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
|
|
22
22
|
const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
23
23
|
const currentComposition = (0, react_1.useMemo)(() => {
|
|
24
24
|
var _a;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type LicenseKeyDetails = {
|
|
3
|
+
readonly isValid: boolean;
|
|
4
|
+
readonly hasActiveSubscription: boolean | null;
|
|
5
|
+
readonly projectName: string;
|
|
6
|
+
readonly projectSlug: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const hasActiveCompanyLicense: (details: LicenseKeyDetails) => boolean;
|
|
9
|
+
export type LicenseKeyValidationResult = {
|
|
10
|
+
readonly valid: boolean;
|
|
11
|
+
readonly message: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare const validateLicenseKey: (key: string) => LicenseKeyValidationResult;
|
|
14
|
+
export declare const fetchLicenseKeyDetails: (licenseKey: string) => Promise<LicenseKeyDetails>;
|
|
15
|
+
export declare const LicenseKeyDetailsDisplay: React.FC<{
|
|
16
|
+
readonly details: LicenseKeyDetails;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LicenseKeyDetailsDisplay = exports.fetchLicenseKeyDetails = exports.validateLicenseKey = exports.hasActiveCompanyLicense = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
const check_circle_filled_1 = require("../icons/check-circle-filled");
|
|
7
|
+
const common_1 = require("./InspectorPanel/common");
|
|
8
|
+
const LICENSE_KEY_LENGTH = 55;
|
|
9
|
+
const LICENSE_KEY_PREFIX = 'rm_pub_';
|
|
10
|
+
const PRO_HOST = 'https://www.remotion.pro';
|
|
11
|
+
const hasActiveCompanyLicense = (details) => {
|
|
12
|
+
return details.hasActiveSubscription === true;
|
|
13
|
+
};
|
|
14
|
+
exports.hasActiveCompanyLicense = hasActiveCompanyLicense;
|
|
15
|
+
const validateLicenseKey = (key) => {
|
|
16
|
+
if (key.length === 0) {
|
|
17
|
+
return { valid: false, message: null };
|
|
18
|
+
}
|
|
19
|
+
if (!key.startsWith(LICENSE_KEY_PREFIX)) {
|
|
20
|
+
return {
|
|
21
|
+
valid: false,
|
|
22
|
+
message: `License key must start with "${LICENSE_KEY_PREFIX}"`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const afterPrefix = key.slice(LICENSE_KEY_PREFIX.length);
|
|
26
|
+
if (!/^[a-zA-Z0-9]*$/.test(afterPrefix)) {
|
|
27
|
+
return {
|
|
28
|
+
valid: false,
|
|
29
|
+
message: 'License key must contain only alphanumeric characters after the prefix',
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (key.length !== LICENSE_KEY_LENGTH) {
|
|
33
|
+
return {
|
|
34
|
+
valid: false,
|
|
35
|
+
message: `License key must be ${LICENSE_KEY_LENGTH} characters long`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return { valid: true, message: null };
|
|
39
|
+
};
|
|
40
|
+
exports.validateLicenseKey = validateLicenseKey;
|
|
41
|
+
const fetchLicenseKeyDetails = async (licenseKey) => {
|
|
42
|
+
const response = await fetch(`${PRO_HOST}/api/validate-license-key`, {
|
|
43
|
+
method: 'POST',
|
|
44
|
+
body: JSON.stringify({
|
|
45
|
+
licenseKey,
|
|
46
|
+
}),
|
|
47
|
+
headers: {
|
|
48
|
+
'Content-Type': 'application/json',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
return response.json();
|
|
52
|
+
};
|
|
53
|
+
exports.fetchLicenseKeyDetails = fetchLicenseKeyDetails;
|
|
54
|
+
const actionStyle = {
|
|
55
|
+
cursor: 'pointer',
|
|
56
|
+
marginLeft: 0,
|
|
57
|
+
marginRight: 0,
|
|
58
|
+
width: '100%',
|
|
59
|
+
};
|
|
60
|
+
const actionContent = {
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
color: 'inherit',
|
|
63
|
+
display: 'flex',
|
|
64
|
+
fontFamily: 'sans-serif',
|
|
65
|
+
fontSize: 13,
|
|
66
|
+
gap: 8,
|
|
67
|
+
lineHeight: '18px',
|
|
68
|
+
minWidth: 0,
|
|
69
|
+
width: '100%',
|
|
70
|
+
};
|
|
71
|
+
const actionText = {
|
|
72
|
+
color: 'inherit',
|
|
73
|
+
flex: 1,
|
|
74
|
+
fontFamily: 'sans-serif',
|
|
75
|
+
fontSize: 13,
|
|
76
|
+
lineHeight: '18px',
|
|
77
|
+
minWidth: 0,
|
|
78
|
+
overflow: 'hidden',
|
|
79
|
+
textOverflow: 'ellipsis',
|
|
80
|
+
whiteSpace: 'nowrap',
|
|
81
|
+
};
|
|
82
|
+
const actionLabel = {
|
|
83
|
+
color: 'inherit',
|
|
84
|
+
flexShrink: 0,
|
|
85
|
+
fontFamily: 'sans-serif',
|
|
86
|
+
fontSize: 13,
|
|
87
|
+
lineHeight: '18px',
|
|
88
|
+
};
|
|
89
|
+
const inactiveLicenseText = {
|
|
90
|
+
...actionText,
|
|
91
|
+
color: colors_1.FAIL_COLOR,
|
|
92
|
+
};
|
|
93
|
+
const iconStyle = {
|
|
94
|
+
width: 14,
|
|
95
|
+
height: 14,
|
|
96
|
+
flexShrink: 0,
|
|
97
|
+
};
|
|
98
|
+
const ErrorIcon = () => {
|
|
99
|
+
return (jsx_runtime_1.jsx("svg", { style: iconStyle, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.FAIL_COLOR, d: "M0 160V352L160 512H352L512 352V160L352 0H160L0 160zm353.9 32l-17 17-47 47 47 47 17 17L320 353.9l-17-17-47-47-47 47-17 17L158.1 320l17-17 47-47-47-47-17-17L192 158.1l17 17 47 47 47-47 17-17L353.9 192z" }) }));
|
|
100
|
+
};
|
|
101
|
+
const LicenseKeyDetailsDisplay = ({ details }) => {
|
|
102
|
+
const projectUrl = `${PRO_HOST}/projects/${details.projectSlug}`;
|
|
103
|
+
const usageUrl = `${projectUrl}/usage#client-renders-usage`;
|
|
104
|
+
const hasActiveLicense = (0, exports.hasActiveCompanyLicense)(details);
|
|
105
|
+
return (jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => window.open(usageUrl, '_blank', 'noopener,noreferrer'), renderIcon: (color) => (jsx_runtime_1.jsx(check_circle_filled_1.CheckCircleFilled, { style: { ...iconStyle, fill: color } })), style: actionStyle, title: "View license usage", children: jsx_runtime_1.jsxs("span", { style: actionContent, children: [
|
|
106
|
+
jsx_runtime_1.jsxs("span", { style: actionText, children: ["Belongs to ", details.projectName] }), jsx_runtime_1.jsx("span", { style: actionLabel, children: "View usage" })
|
|
107
|
+
] }) }), jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => window.open(projectUrl, '_blank', 'noopener,noreferrer'), renderIcon: (color) => hasActiveLicense ? (jsx_runtime_1.jsx(check_circle_filled_1.CheckCircleFilled, { style: { ...iconStyle, fill: color } })) : (jsx_runtime_1.jsx(ErrorIcon, {})), style: actionStyle, title: "Manage Company License", children: jsx_runtime_1.jsxs("span", { style: actionContent, children: [
|
|
108
|
+
jsx_runtime_1.jsx("span", { style: hasActiveLicense ? actionText : inactiveLicenseText, children: hasActiveLicense
|
|
109
|
+
? 'Active Company License'
|
|
110
|
+
: 'No active Company License' }), jsx_runtime_1.jsx("span", { style: actionLabel, children: "Manage" })
|
|
111
|
+
] }) })] }));
|
|
112
|
+
};
|
|
113
|
+
exports.LicenseKeyDetailsDisplay = LicenseKeyDetailsDisplay;
|
|
@@ -10,6 +10,7 @@ const client_id_1 = require("../helpers/client-id");
|
|
|
10
10
|
const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
|
|
11
11
|
const modals_1 = require("../state/modals");
|
|
12
12
|
const AskAiModal_1 = require("./AskAiModal");
|
|
13
|
+
const ConfigureLicenseModal_1 = require("./ConfigureLicenseModal");
|
|
13
14
|
const ConfirmationDialog_1 = require("./ConfirmationDialog");
|
|
14
15
|
const EffectPickerModal_1 = require("./EffectPickerModal");
|
|
15
16
|
const InstallPackage_1 = require("./InstallPackage");
|
|
@@ -33,7 +34,7 @@ const Modals = ({ readOnlyStudio }) => {
|
|
|
33
34
|
const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
34
35
|
const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
|
|
35
36
|
'connected';
|
|
36
|
-
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
37
|
+
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'configure-license' && (jsx_runtime_1.jsx(ConfigureLicenseModal_1.ConfigureLicenseModal, { initialPublicLicenseKey: modalContextType.initialPublicLicenseKey })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
|
|
37
38
|
modalContextType.type === 'server-render' &&
|
|
38
39
|
(canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
|
|
39
40
|
};
|
|
@@ -281,7 +281,6 @@ const RenderButton = ({ readOnlyStudio, size: controlSize = 'default' }) => {
|
|
|
281
281
|
inFrameMark: inFrame,
|
|
282
282
|
outFrameMark: outFrame,
|
|
283
283
|
initialLogLevel: defaults.logLevel,
|
|
284
|
-
initialLicenseKey: defaults.publicLicenseKey,
|
|
285
284
|
initialStillImageFormat: defaults.stillImageFormat,
|
|
286
285
|
initialScale: defaults.scale,
|
|
287
286
|
initialDelayRenderTimeout: defaults.delayRenderTimeout,
|
|
@@ -32,7 +32,6 @@ const use_encodable_video_codecs_1 = require("./use-encodable-video-codecs");
|
|
|
32
32
|
const WebRenderModalAdvanced_1 = require("./WebRenderModalAdvanced");
|
|
33
33
|
const WebRenderModalAudio_1 = require("./WebRenderModalAudio");
|
|
34
34
|
const WebRenderModalBasic_1 = require("./WebRenderModalBasic");
|
|
35
|
-
const WebRenderModalLicense_1 = require("./WebRenderModalLicense");
|
|
36
35
|
const WebRenderModalPicture_1 = require("./WebRenderModalPicture");
|
|
37
36
|
const invalidCharacters = ['?', '*', '+', ':', '%'];
|
|
38
37
|
const isValidStillExtension = (extension, stillImageFormat) => {
|
|
@@ -80,7 +79,7 @@ const validateOutnameForStill = ({ outName, stillImageFormat, }) => {
|
|
|
80
79
|
// TODO: Shortcut: Shift + R
|
|
81
80
|
// TODO: Apply defaultCodec
|
|
82
81
|
// TODO: Apply defaultOutName
|
|
83
|
-
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel,
|
|
82
|
+
const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark, initialLogLevel, initialStillImageFormat, initialDefaultOutName, initialScale, initialDelayRenderTimeout, initialMediaCacheSizeInBytes, initialContainer, initialVideoCodec, initialAudioCodec, initialAudioBitrate, initialVideoBitrate, initialHardwareAcceleration, initialKeyframeIntervalInSeconds, initialTransparent, initialMuted, initialPageResponsiveness, }) => {
|
|
84
83
|
var _a;
|
|
85
84
|
const context = (0, react_1.useContext)(ResolveCompositionBeforeModal_1.ResolvedCompositionContext);
|
|
86
85
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -89,6 +88,11 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
89
88
|
if (!context) {
|
|
90
89
|
throw new Error('Should not be able to render without resolving comp first');
|
|
91
90
|
}
|
|
91
|
+
const renderDefaults = window.remotion_renderDefaults;
|
|
92
|
+
if (!renderDefaults) {
|
|
93
|
+
throw new Error('Render defaults are not available');
|
|
94
|
+
}
|
|
95
|
+
const { publicLicenseKey } = renderDefaults;
|
|
92
96
|
const { resolved: { result: resolvedComposition }, unresolved: unresolvedComposition, } = context;
|
|
93
97
|
const [isVideo] = (0, react_1.useState)(() => {
|
|
94
98
|
return typeof resolvedComposition.durationInFrames === 'undefined'
|
|
@@ -123,7 +127,6 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
123
127
|
const [transparent, setTransparent] = (0, react_1.useState)(initialTransparent !== null && initialTransparent !== void 0 ? initialTransparent : false);
|
|
124
128
|
const [muted, setMuted] = (0, react_1.useState)(initialMuted !== null && initialMuted !== void 0 ? initialMuted : false);
|
|
125
129
|
const [scale, setScale] = (0, react_1.useState)(initialScale !== null && initialScale !== void 0 ? initialScale : 1);
|
|
126
|
-
const [licenseKey, setLicenseKey] = (0, react_1.useState)(initialLicenseKey);
|
|
127
130
|
const [pageResponsiveness, setPageResponsiveness] = (0, react_1.useState)(initialPageResponsiveness !== null && initialPageResponsiveness !== void 0 ? initialPageResponsiveness : 'medium');
|
|
128
131
|
const encodableAudioCodecs = (0, use_encodable_audio_codecs_1.useEncodableAudioCodecs)(container);
|
|
129
132
|
const encodableVideoCodecs = (0, use_encodable_video_codecs_1.useEncodableVideoCodecs)(container);
|
|
@@ -335,7 +338,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
335
338
|
delayRenderTimeout,
|
|
336
339
|
mediaCacheSizeInBytes,
|
|
337
340
|
logLevel,
|
|
338
|
-
licenseKey,
|
|
341
|
+
licenseKey: publicLicenseKey,
|
|
339
342
|
scale,
|
|
340
343
|
}, compositionRef);
|
|
341
344
|
}
|
|
@@ -361,7 +364,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
361
364
|
delayRenderTimeout,
|
|
362
365
|
mediaCacheSizeInBytes,
|
|
363
366
|
logLevel,
|
|
364
|
-
licenseKey,
|
|
367
|
+
licenseKey: publicLicenseKey,
|
|
365
368
|
scale,
|
|
366
369
|
pageResponsiveness,
|
|
367
370
|
}, compositionRef);
|
|
@@ -388,7 +391,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
388
391
|
delayRenderTimeout,
|
|
389
392
|
mediaCacheSizeInBytes,
|
|
390
393
|
logLevel,
|
|
391
|
-
|
|
394
|
+
publicLicenseKey,
|
|
392
395
|
container,
|
|
393
396
|
effectiveVideoCodec,
|
|
394
397
|
effectiveAudioCodec,
|
|
@@ -422,14 +425,17 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
|
|
|
422
425
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(audio_1.AudioIcon, { style: render_modals_1.icon }) }),
|
|
423
426
|
"Audio"] })) : null, jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [
|
|
424
427
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(gear_1.GearIcon, { style: render_modals_1.icon }) }),
|
|
425
|
-
"Other"] }), jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected:
|
|
428
|
+
"Other"] }), jsx_runtime_1.jsxs(vertical_1.VerticalTab, { style: render_modals_1.horizontalTab, selected: false, onClick: () => setSelectedModal({
|
|
429
|
+
type: 'configure-license',
|
|
430
|
+
initialPublicLicenseKey: publicLicenseKey,
|
|
431
|
+
}), children: [
|
|
426
432
|
jsx_runtime_1.jsx("div", { style: render_modals_1.iconContainer, children: jsx_runtime_1.jsx(certificate_1.CertificateIcon, { style: render_modals_1.icon }) }),
|
|
427
433
|
"License"] })
|
|
428
434
|
] }), jsx_runtime_1.jsx("div", { style: render_modals_1.optionsPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? (jsx_runtime_1.jsx(WebRenderModalBasic_1.WebRenderModalBasic, { renderMode: renderMode, resolvedComposition: resolvedComposition, imageFormat: imageFormat, setStillFormat: setStillFormat, frame: frame, onFrameChanged: onFrameChanged, onFrameSetDirectly: onFrameSetDirectly, container: container, setContainerFormat: setContainerFormat, setCodec: setCodecWithContainer, encodableVideoCodecs: encodableVideoCodecs, effectiveVideoCodec: effectiveVideoCodec, startFrame: finalStartFrame, setStartFrame: setStartFrame, endFrame: finalEndFrame, setEndFrame: setEndFrame, outName: outName, onOutNameChange: onOutNameChange, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message, logLevel: logLevel, setLogLevel: setLogLevel })) : tab === 'data' ? (jsx_runtime_1.jsx(DataEditor_1.DataEditor, { defaultProps: inputProps, setDefaultProps: setInputProps, unresolvedComposition: unresolvedComposition, propsEditType: "input-props", canSaveDefaultProps: {
|
|
429
435
|
canUpdate: false,
|
|
430
436
|
reason: 'render dialogue',
|
|
431
437
|
determined: false,
|
|
432
|
-
} })) : tab === 'picture' ? (jsx_runtime_1.jsx(WebRenderModalPicture_1.WebRenderModalPicture, { renderMode: renderMode, videoBitrate: videoBitrate, setVideoBitrate: setVideoBitrate, keyframeIntervalInSeconds: keyframeIntervalInSeconds, setKeyframeIntervalInSeconds: setKeyframeIntervalInSeconds, transparent: transparent, setTransparent: setTransparent, scale: scale, setScale: setScale, compositionWidth: resolvedComposition.width, compositionHeight: resolvedComposition.height })) : tab === 'audio' ? (jsx_runtime_1.jsx(WebRenderModalAudio_1.WebRenderModalAudio, { renderMode: renderMode, muted: muted, setMuted: setMuted, audioCodec: audioCodec, setAudioCodec: setAudioCodec, audioBitrate: audioBitrate, setAudioBitrate: setAudioBitrate, container: container, encodableCodecs: encodableAudioCodecs, effectiveAudioCodec: effectiveAudioCodec })) : tab === 'advanced' ? (jsx_runtime_1.jsx(WebRenderModalAdvanced_1.WebRenderModalAdvanced, { renderMode: renderMode, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, mediaCacheSizeInBytes: mediaCacheSizeInBytes, setMediaCacheSizeInBytes: setMediaCacheSizeInBytes, hardwareAcceleration: hardwareAcceleration, setHardwareAcceleration: setHardwareAcceleration, pageResponsiveness: pageResponsiveness, setPageResponsiveness: setPageResponsiveness })) :
|
|
438
|
+
} })) : tab === 'picture' ? (jsx_runtime_1.jsx(WebRenderModalPicture_1.WebRenderModalPicture, { renderMode: renderMode, videoBitrate: videoBitrate, setVideoBitrate: setVideoBitrate, keyframeIntervalInSeconds: keyframeIntervalInSeconds, setKeyframeIntervalInSeconds: setKeyframeIntervalInSeconds, transparent: transparent, setTransparent: setTransparent, scale: scale, setScale: setScale, compositionWidth: resolvedComposition.width, compositionHeight: resolvedComposition.height })) : tab === 'audio' ? (jsx_runtime_1.jsx(WebRenderModalAudio_1.WebRenderModalAudio, { renderMode: renderMode, muted: muted, setMuted: setMuted, audioCodec: audioCodec, setAudioCodec: setAudioCodec, audioBitrate: audioBitrate, setAudioBitrate: setAudioBitrate, container: container, encodableCodecs: encodableAudioCodecs, effectiveAudioCodec: effectiveAudioCodec })) : tab === 'advanced' ? (jsx_runtime_1.jsx(WebRenderModalAdvanced_1.WebRenderModalAdvanced, { renderMode: renderMode, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, mediaCacheSizeInBytes: mediaCacheSizeInBytes, setMediaCacheSizeInBytes: setMediaCacheSizeInBytes, hardwareAcceleration: hardwareAcceleration, setHardwareAcceleration: setHardwareAcceleration, pageResponsiveness: pageResponsiveness, setPageResponsiveness: setPageResponsiveness })) : null })
|
|
433
439
|
] })
|
|
434
440
|
] }));
|
|
435
441
|
};
|
|
@@ -398,7 +398,7 @@ const SelectedOutlineOverlay = ({ compositionHeight, compositionWidth, scale, tr
|
|
|
398
398
|
selectItem(item, interaction, undefined, { reveal: true });
|
|
399
399
|
}, [selectItem]);
|
|
400
400
|
const outlineTargets = (0, react_1.useMemo)(() => {
|
|
401
|
-
if (!interactivity_enabled_1.
|
|
401
|
+
if (!(0, interactivity_enabled_1.isStudioInteractivityEnabled)() || !editorShowOutlines) {
|
|
402
402
|
return [];
|
|
403
403
|
}
|
|
404
404
|
const selectedSequenceKeys = (0, selected_outline_measurement_1.getSelectedSequenceKeys)(selectedItems);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MaxTimelineTracksReached = exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT =
|
|
3
|
+
exports.MaxTimelineTracksReached = exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const colors_1 = require("../../helpers/colors");
|
|
6
6
|
const studio_runtime_config_1 = require("../../helpers/studio-runtime-config");
|
|
7
7
|
const timeline_layout_1 = require("../../helpers/timeline-layout");
|
|
8
|
-
exports.MAX_TIMELINE_TRACKS = (0, studio_runtime_config_1.getStudioMaxTimelineTracks)();
|
|
9
8
|
exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = 24;
|
|
10
9
|
const container = {
|
|
11
10
|
height: exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT,
|
|
@@ -18,6 +17,7 @@ const container = {
|
|
|
18
17
|
paddingLeft: timeline_layout_1.TIMELINE_PADDING + 5,
|
|
19
18
|
};
|
|
20
19
|
const MaxTimelineTracksReached = () => {
|
|
21
|
-
|
|
20
|
+
const maxTimelineTracks = (0, studio_runtime_config_1.getStudioMaxTimelineTracks)();
|
|
21
|
+
return (jsx_runtime_1.jsxs("div", { style: container, children: ["Limited display to ", maxTimelineTracks, " tracks to sustain performance.", '', "You can change this by setting Config.setMaxTimelineTracks() in your remotion.config.ts file."] }));
|
|
22
22
|
};
|
|
23
23
|
exports.MaxTimelineTracksReached = MaxTimelineTracksReached;
|