@remotion/cli 3.3.83 → 3.3.84
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/editor/components/NewComposition/RemInputTypeColor.d.ts +0 -1
- package/dist/editor/components/NewComposition/RemInputTypeColor.js +3 -3
- package/dist/editor/components/RenderButton.js +4 -1
- package/dist/editor/components/RenderModal/CrfSetting.js +1 -1
- package/dist/editor/components/RenderModal/EnvInput.js +1 -1
- package/dist/editor/components/RenderModal/FrameRangeSetting.js +1 -1
- package/dist/editor/components/RenderModal/NumberOfLoopsSetting.js +1 -1
- package/dist/editor/components/RenderModal/NumberSetting.js +1 -1
- package/dist/editor/components/RenderModal/RenderModal.js +18 -9
- package/dist/editor/components/RenderModal/RenderModalAudio.js +1 -1
- package/dist/editor/components/RenderModal/RenderModalBasic.js +1 -1
- package/dist/editor/components/RenderModal/RenderModalData.js +30 -1
- package/dist/editor/components/RenderModal/RenderModalInput.js +1 -1
- package/dist/editor/components/RenderModal/RenderModalPicture.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +3 -40
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +11 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +55 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +10 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +10 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +8 -0
- package/dist/editor/components/RenderModal/layout.js +0 -1
- package/dist/editor/components/RenderModal/out-name-checker.d.ts +0 -1
- package/dist/editor/components/RenderModal/out-name-checker.js +3 -3
- package/dist/editor/components/RenderQueue/actions.d.ts +0 -2
- package/dist/editor/components/RenderQueue/actions.js +10 -11
- package/dist/editor/components/RenderQueue/index.js +25 -1
- package/dist/editor/components/RenderToolbarIcon.js +21 -8
- package/dist/editor/components/SegmentedControl.d.ts +0 -5
- package/dist/editor/components/SegmentedControl.js +2 -3
- package/dist/editor/components/Splitter/SplitterElement.js +1 -0
- package/dist/editor/components/Tabs/index.d.ts +0 -1
- package/dist/editor/components/Tabs/index.js +3 -3
- package/dist/editor/components/Tabs/vertical.d.ts +0 -5
- package/dist/editor/components/Tabs/vertical.js +3 -17
- package/dist/editor/components/TimeValue.js +3 -4
- package/dist/editor/components/Timeline/TimelineListItem.js +9 -1
- package/dist/preview-server/api-types.d.ts +0 -4
- package/dist/preview-server/render-queue/job.d.ts +1 -1
- package/dist/preview-server/render-queue/queue.d.ts +1 -13
- package/dist/preview-server/render-queue/queue.js +6 -9
- package/package.json +6 -6
|
@@ -3,6 +3,5 @@ import type { RemInputStatus } from './RemInput';
|
|
|
3
3
|
declare type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> & {
|
|
4
4
|
status: RemInputStatus;
|
|
5
5
|
};
|
|
6
|
-
export declare const inputBaseStyle: React.CSSProperties;
|
|
7
6
|
export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
8
7
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RemInputTypeColor =
|
|
3
|
+
exports.RemInputTypeColor = void 0;
|
|
4
4
|
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 z_index_1 = require("../../state/z-index");
|
|
8
8
|
const RemInput_1 = require("./RemInput");
|
|
9
|
-
|
|
9
|
+
const inputBaseStyle = {
|
|
10
10
|
padding: 0,
|
|
11
11
|
borderStyle: 'solid',
|
|
12
12
|
borderWidth: 1,
|
|
@@ -20,7 +20,7 @@ const RemInputTypeColorForwardRef = ({ status, ...props }, ref) => {
|
|
|
20
20
|
var _a;
|
|
21
21
|
return {
|
|
22
22
|
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
23
|
-
...
|
|
23
|
+
...inputBaseStyle,
|
|
24
24
|
borderColor: (0, RemInput_1.getInputBorderColor)({ isFocused, isHovered, status }),
|
|
25
25
|
...((_a = props.style) !== null && _a !== void 0 ? _a : {}),
|
|
26
26
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RenderButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const client_1 = require("@remotion/renderer/client");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const get_default_out_name_1 = require("../../get-default-out-name");
|
|
7
8
|
const get_default_video_contexts_1 = require("../../preview-server/render-queue/get-default-video-contexts");
|
|
@@ -39,7 +40,9 @@ const RenderButton = ({ composition, visible }) => {
|
|
|
39
40
|
initialVerbose: defaults.logLevel === 'verbose',
|
|
40
41
|
initialOutName: (0, get_default_out_name_1.getDefaultOutLocation)({
|
|
41
42
|
compositionName: composition.id,
|
|
42
|
-
defaultExtension: isVideo
|
|
43
|
+
defaultExtension: isVideo
|
|
44
|
+
? defaults.stillImageFormat
|
|
45
|
+
: client_1.BrowserSafeApis.getFileExtensionFromCodec(initialVideoCodec, defaults.audioCodec),
|
|
43
46
|
type: 'asset',
|
|
44
47
|
}),
|
|
45
48
|
initialVideoCodecForAudioTab: initialAudioCodec,
|
|
@@ -33,7 +33,7 @@ const useCrfState = (codec) => {
|
|
|
33
33
|
setCrf,
|
|
34
34
|
minCrf: range[0],
|
|
35
35
|
maxCrf: range[1],
|
|
36
|
-
shouldDisplayOption: range[0] !== range[1],
|
|
36
|
+
shouldDisplayOption: range[0] !== range[1] && client_1.BrowserSafeApis.codecSupportsCrf(codec),
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
exports.useCrfState = useCrfState;
|
|
@@ -69,6 +69,6 @@ const EnvInput = ({ onEnvKeyChange, onEnvValChange, envKey, envVal, onDelete, in
|
|
|
69
69
|
setValueWarningEligible(true);
|
|
70
70
|
}, []);
|
|
71
71
|
const isNodeEnvKey = envKey.trim() === 'NODE_ENV';
|
|
72
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: isNodeEnvKey || isDuplicate || isKeyMissing ? 'warning' : 'ok', type: "text", placeholder: "Key", style: input, value: envKey, onBlur: makeKeyWarningEligible, autoFocus: autoFocus, onChange: handleKeyChange }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: isValMissing ? 'warning' : 'ok', placeholder: "Value", type: showInPlainText ? 'text' : 'password', style: input, value: envVal, onBlur: makeValueWarningEligible, onChange: handleValueChange }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 }), (0, jsx_runtime_1.jsx)(InlineEyeIcon_1.InlineEyeButton, { enabled: !showInPlainText, onClick: togglePlainText }), (0, jsx_runtime_1.jsx)(InlineRemoveButton_1.InlineRemoveButton, { onClick: handleDelete })] }), isNodeEnvKey ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "NODE_ENV will be overwritten by Remotion during the render process." }) })) : null, isDuplicate ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: `${envKey.toUpperCase()} is already defined.` }) })) : null, isKeyMissing ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "Key is missing." }) })) : null, isValMissing ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "Value is missing." }) })) : null] }));
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: isNodeEnvKey || isDuplicate || isKeyMissing ? 'warning' : 'ok', type: "text", placeholder: "Key", style: input, value: envKey, onBlur: makeKeyWarningEligible, autoFocus: autoFocus, onChange: handleKeyChange, rightAlign: false }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: isValMissing ? 'warning' : 'ok', placeholder: "Value", type: showInPlainText ? 'text' : 'password', style: input, value: envVal, onBlur: makeValueWarningEligible, onChange: handleValueChange, rightAlign: false }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 }), (0, jsx_runtime_1.jsx)(InlineEyeIcon_1.InlineEyeButton, { enabled: !showInPlainText, onClick: togglePlainText }), (0, jsx_runtime_1.jsx)(InlineRemoveButton_1.InlineRemoveButton, { onClick: handleDelete })] }), isNodeEnvKey ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "NODE_ENV will be overwritten by Remotion during the render process." }) })) : null, isDuplicate ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: `${envKey.toUpperCase()} is already defined.` }) })) : null, isKeyMissing ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "Key is missing." }) })) : null, isValMissing ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "Value is missing." }) })) : null] }));
|
|
73
73
|
};
|
|
74
74
|
exports.EnvInput = EnvInput;
|
|
@@ -37,6 +37,6 @@ const FrameRangeSetting = ({ startFrame, endFrame, setEndFrame, durationInFrames
|
|
|
37
37
|
return newEndFrameClamped;
|
|
38
38
|
});
|
|
39
39
|
}, [maxEndFrame, minEndFrame, setEndFrame]);
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Frame range" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: startFrame, onTextChange: onStartFrameChanged, placeholder: `${minStartFrame}-${maxStartFrame}`, onValueChange: onStartFrameChangedDirectly, name: "startFrame", step: 1, min: minStartFrame, max: maxStartFrame, status: "ok" }) }), (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: endFrame, onTextChange: onEndFrameChanged, placeholder: `${minEndFrame}-${maxEndFrame}`, onValueChange: onEndFrameChangedDirectly, name: "endFrame", step: 1, min: minEndFrame, max: maxEndFrame, status: "ok" }) })] })] }));
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Frame range" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: startFrame, onTextChange: onStartFrameChanged, placeholder: `${minStartFrame}-${maxStartFrame}`, onValueChange: onStartFrameChangedDirectly, name: "startFrame", step: 1, min: minStartFrame, max: maxStartFrame, status: "ok", rightAlign: true }) }), (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: endFrame, onTextChange: onEndFrameChanged, placeholder: `${minEndFrame}-${maxEndFrame}`, onValueChange: onEndFrameChangedDirectly, name: "endFrame", step: 1, min: minEndFrame, max: maxEndFrame, status: "ok", rightAlign: true }) })] })] }));
|
|
41
41
|
};
|
|
42
42
|
exports.FrameRangeSetting = FrameRangeSetting;
|
|
@@ -21,6 +21,6 @@ const NumberOfLoopsSetting = ({ numberOfGifLoops, setNumberOfGifLoops }) => {
|
|
|
21
21
|
return newConcurrencyClamped;
|
|
22
22
|
});
|
|
23
23
|
}, [setNumberOfGifLoops]);
|
|
24
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Number of loops" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: numberOfGifLoops, onTextChange: onNumberOfGifLoopsChanged, placeholder: `${min}-`, onValueChange: onNumberOfGifLoopsChangedDirectly, name: "number-of-gif-loops", step: 1, min: min, status: "ok" }) }) })] }));
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Number of loops" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: numberOfGifLoops, onTextChange: onNumberOfGifLoopsChanged, placeholder: `${min}-`, onValueChange: onNumberOfGifLoopsChangedDirectly, name: "number-of-gif-loops", step: 1, min: min, status: "ok", rightAlign: true }) }) })] }));
|
|
25
25
|
};
|
|
26
26
|
exports.NumberOfLoopsSetting = NumberOfLoopsSetting;
|
|
@@ -24,6 +24,6 @@ const NumberSetting = ({ name, value, step, hint, onValueChanged, max, min, form
|
|
|
24
24
|
}, [onValueChanged]);
|
|
25
25
|
return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.label, children: [name, hint ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.25 }), ' ', (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: hint }) })] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: value, name: name.toLowerCase(), onTextChange: onTextChanged, onValueChange: onValueChange, step: step, placeholder: [min, max]
|
|
26
26
|
.map((f) => (f !== null && f !== undefined ? f : ''))
|
|
27
|
-
.join('-'), min: min, max: max, formatter: formatter, status: "ok" }) }) })] }));
|
|
27
|
+
.join('-'), min: min, max: max, formatter: formatter, status: "ok", rightAlign: true }) }) })] }));
|
|
28
28
|
};
|
|
29
29
|
exports.NumberSetting = NumberSetting;
|
|
@@ -57,17 +57,17 @@ const container = {
|
|
|
57
57
|
flexDirection: 'row',
|
|
58
58
|
alignItems: 'center',
|
|
59
59
|
padding: '12px 16px',
|
|
60
|
-
width: '100%',
|
|
61
60
|
borderBottom: '1px solid black',
|
|
62
61
|
};
|
|
63
62
|
const rightPanel = {
|
|
64
|
-
height: 600,
|
|
65
|
-
width: 650,
|
|
66
63
|
display: 'flex',
|
|
64
|
+
width: '100%',
|
|
65
|
+
height: 600,
|
|
67
66
|
};
|
|
68
67
|
const horizontalLayout = {
|
|
69
68
|
display: 'flex',
|
|
70
69
|
flexDirection: 'row',
|
|
70
|
+
overflowY: 'auto',
|
|
71
71
|
};
|
|
72
72
|
const leftSidebar = {
|
|
73
73
|
padding: 12,
|
|
@@ -103,6 +103,11 @@ const buttonStyle = {
|
|
|
103
103
|
const flexer = {
|
|
104
104
|
flex: 1,
|
|
105
105
|
};
|
|
106
|
+
const outer = {
|
|
107
|
+
width: (0, ModalContainer_1.getMaxModalWidth)(1000),
|
|
108
|
+
height: (0, ModalContainer_1.getMaxModalHeight)(640),
|
|
109
|
+
overflow: 'hidden',
|
|
110
|
+
};
|
|
106
111
|
// TODO: Copy edited props from Props editor to Render modal
|
|
107
112
|
const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialVerbose, initialOutName, initialRenderType, initialVideoCodecForAudioTab, initialVideoCodecForVideoTab, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialAudioCodec, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, }) => {
|
|
108
113
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -136,6 +141,8 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
136
141
|
disableWebSecurity,
|
|
137
142
|
ignoreCertificateErrors,
|
|
138
143
|
gl: openGlOption === 'default' ? null : openGlOption,
|
|
144
|
+
// TODO: Make this configurable at some point (not necessary for V4)
|
|
145
|
+
userAgent: null,
|
|
139
146
|
};
|
|
140
147
|
}, [headless, disableWebSecurity, ignoreCertificateErrors, openGlOption]);
|
|
141
148
|
const [outName, setOutName] = (0, react_1.useState)(() => initialOutName);
|
|
@@ -557,11 +564,13 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
|
|
|
557
564
|
triggerIfInputFieldFocused: false,
|
|
558
565
|
});
|
|
559
566
|
}, [registerKeybinding, trigger]);
|
|
560
|
-
return ((0, jsx_runtime_1.
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
567
|
+
return ((0, jsx_runtime_1.jsx)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: (0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${compositionId}` }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: flexer }), (0, jsx_runtime_1.jsxs)(Button_1.Button, { autoFocus: true, onClick: trigger, disabled: renderDisabled, style: {
|
|
568
|
+
...buttonStyle,
|
|
569
|
+
backgroundColor: outnameValidation.valid
|
|
570
|
+
? 'var(--blue)'
|
|
571
|
+
: 'var(--blue-disabled)',
|
|
572
|
+
}, children: [state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...', (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftSidebar, children: [shownTabs.includes('general') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: icon }) }), "General"] })) : null, shownTabs.includes('data') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: icon }) }), "Input Props"] })) : null, shownTabs.includes('picture') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: icon }) }), "Picture"] })) : null, shownTabs.includes('audio') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(audio_1.AudioIcon, { style: icon }) }), "Audio"] })) : null, shownTabs.includes('gif') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'gif', onClick: () => setTab('gif'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gif_1.GifIcon, { style: icon }) }), "GIF"] })) : null, shownTabs.includes('advanced') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gear_1.GearIcon, { style: icon }) }), "Other"] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: rightPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? ((0, jsx_runtime_1.jsx)(RenderModalBasic_1.RenderModalBasic, { codec: codec, currentComposition: currentComposition, frame: frame, imageFormatOptions: imageFormatOptions, outName: outName, proResProfile: proResProfile, renderMode: renderMode, setVideoCodec: setCodec, setFrame: setFrame, setOutName: setOutName, setProResProfile: setProResProfile, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame, validationMessage: outnameValidation.valid
|
|
573
|
+
? null
|
|
574
|
+
: outnameValidation.error.message })) : tab === 'picture' ? ((0, jsx_runtime_1.jsx)(RenderModalPicture_1.RenderModalPicture, { renderMode: renderMode, scale: scale, setScale: setScale, pixelFormat: pixelFormat, setPixelFormat: setPixelFormat, imageFormatOptions: imageFormatOptions, crf: crf, setCrf: setCrf, customTargetVideoBitrate: customTargetVideoBitrate, maxCrf: maxCrf, minCrf: minCrf, jpegQuality: jpegQuality, qualityControlType: qualityControlType, setJpegQuality: setJpegQuality, setCustomTargetVideoBitrateValue: setCustomTargetVideoBitrateValue, setQualityControl: setQualityControl, shouldDisplayCrfOption: shouldDisplayCrfOption, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat })) : tab === 'audio' ? ((0, jsx_runtime_1.jsx)(RenderModalAudio_1.RenderModalAudio, { muted: muted, renderMode: renderMode, setMuted: setMuted, codec: codec, audioCodec: audioCodec, setAudioCodec: setAudioCodec, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrackState: setEnforceAudioTrackState, customTargetAudioBitrate: customTargetAudioBitrate, setCustomTargetAudioBitrateValue: setCustomTargetAudioBitrateValue, setShouldHaveCustomTargetAudioBitrate: setShouldHaveCustomTargetAudioBitrate, shouldHaveCustomTargetAudioBitrate: shouldHaveCustomTargetAudioBitrate })) : tab === 'gif' ? ((0, jsx_runtime_1.jsx)(RenderModalGif_1.RenderModalGif, { everyNthFrame: everyNthFrame, limitNumberOfGifLoops: limitNumberOfGifLoops, numberOfGifLoopsSetting: numberOfGifLoopsSetting, setEveryNthFrameSetting: setEveryNthFrameSetting, setLimitNumberOfGifLoops: setLimitNumberOfGifLoops, setNumberOfGifLoopsSetting: setNumberOfGifLoopsSetting })) : tab === 'data' ? ((0, jsx_runtime_1.jsx)(RenderModalData_1.RenderModalData, { inputProps: inputProps, setInputProps: setInputProps, composition: currentComposition, compact: false, mayShowSaveButton: false })) : ((0, jsx_runtime_1.jsx)(RenderModalAdvanced_1.RenderModalAdvanced, { concurrency: concurrency, maxConcurrency: maxConcurrency, minConcurrency: minConcurrency, renderMode: renderMode, setConcurrency: setConcurrency, setVerboseLogging: setVerboseLogging, verbose: verbose, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, disallowParallelEncoding: disallowParallelEncoding, setDisallowParallelEncoding: setDisallowParallelEncoding, setDisableWebSecurity: setDisableWebSecurity, setIgnoreCertificateErrors: setIgnoreCertificateErrors, setHeadless: setHeadless, headless: headless, ignoreCertificateErrors: ignoreCertificateErrors, disableWebSecurity: disableWebSecurity, openGlOption: openGlOption, setOpenGlOption: setOpenGlOption, setEnvVariables: setEnvVariables, envVariables: envVariables })) })] })] }) }));
|
|
566
575
|
};
|
|
567
576
|
exports.RenderModal = RenderModal;
|
|
@@ -41,6 +41,6 @@ const RenderModalAudio = ({ muted, setMuted, renderMode, enforceAudioTrack, setE
|
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
}, [codec, setAudioCodec]);
|
|
44
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' && audioCodecOptions(codec).length >= 2 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Audio Codec" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: audioCodecOptions(codec), selectedId: audioCodec, title: "AudioCodec" }) })] })) : null, renderMode === 'video' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MutedSetting_1.MutedSetting, { enforceAudioTrack: enforceAudioTrack, muted: muted, setMuted: setMuted, hint: client_1.BrowserSafeApis.options.muteOption }), (0, jsx_runtime_1.jsx)(EnforceAudioTrackSetting_1.EnforceAudioTrackSetting, { muted: muted, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrack: setEnforceAudioTrackState, option: client_1.BrowserSafeApis.options.enforceAudioOption }), (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {})] })), renderMode === 'still' ? null : ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Custom audio bitrate" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: shouldHaveCustomTargetAudioBitrate, onChange: onShouldHaveTargetAudioBitrateChanged }) })] })), shouldHaveCustomTargetAudioBitrate && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Target audio bitrate" }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.audioBitrateOption }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { style: layout_1.input, value: customTargetAudioBitrate, onChange: onTargetAudioBitrateChanged, status: "ok" }) }) })] })) : null] }));
|
|
44
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' && audioCodecOptions(codec).length >= 2 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Audio Codec" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: audioCodecOptions(codec), selectedId: audioCodec, title: "AudioCodec" }) })] })) : null, renderMode === 'video' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MutedSetting_1.MutedSetting, { enforceAudioTrack: enforceAudioTrack, muted: muted, setMuted: setMuted, hint: client_1.BrowserSafeApis.options.muteOption }), (0, jsx_runtime_1.jsx)(EnforceAudioTrackSetting_1.EnforceAudioTrackSetting, { muted: muted, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrack: setEnforceAudioTrackState, option: client_1.BrowserSafeApis.options.enforceAudioOption }), (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {})] })), renderMode === 'still' ? null : ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Custom audio bitrate" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: shouldHaveCustomTargetAudioBitrate, onChange: onShouldHaveTargetAudioBitrateChanged }) })] })), shouldHaveCustomTargetAudioBitrate && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Target audio bitrate" }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.audioBitrateOption }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { style: layout_1.input, value: customTargetAudioBitrate, onChange: onTargetAudioBitrateChanged, status: "ok", rightAlign: true }) }) })] })) : null] }));
|
|
45
45
|
};
|
|
46
46
|
exports.RenderModalAudio = RenderModalAudio;
|
|
@@ -74,6 +74,6 @@ const RenderModalBasic = ({ renderMode, imageFormatOptions, outName, codec, setV
|
|
|
74
74
|
const onValueChange = (0, react_1.useCallback)((e) => {
|
|
75
75
|
setOutName(e.target.value);
|
|
76
76
|
}, [setOutName]);
|
|
77
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: true }) })] })) : ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.label, children: ["Codec", (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.videoCodecOption }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: videoCodecOptions, selectedId: codec, title: "Codec" }) })] })), renderMode === 'still' && currentComposition.durationInFrames > 1 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Frame" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: frame, onTextChange: onFrameChanged, placeholder: `0-${currentComposition.durationInFrames - 1}`, onValueChange: onFrameSetDirectly, name: "frame", step: 1, min: 0, status: "ok", max: currentComposition.durationInFrames - 1 }) }) })] })) : null, renderMode === 'video' && codec === 'prores' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "ProRes profile" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: proResProfile, selectedId: proResProfile, values: proResProfileOptions }) })] })) : null, renderMode === 'still' ? null : ((0, jsx_runtime_1.jsx)(FrameRangeSetting_1.FrameRangeSetting, { durationInFrames: currentComposition.durationInFrames, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame })), (0, jsx_runtime_1.jsx)(RenderModalInput_1.RenderModalInput, { existence: existence, inputStyle: layout_1.input, outName: outName, onValueChange: onValueChange, validationMessage: validationMessage })] }));
|
|
77
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: true }) })] })) : ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.label, children: ["Codec", (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.videoCodecOption }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: videoCodecOptions, selectedId: codec, title: "Codec" }) })] })), renderMode === 'still' && currentComposition.durationInFrames > 1 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Frame" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: frame, onTextChange: onFrameChanged, placeholder: `0-${currentComposition.durationInFrames - 1}`, onValueChange: onFrameSetDirectly, name: "frame", step: 1, min: 0, status: "ok", max: currentComposition.durationInFrames - 1, rightAlign: true }) }) })] })) : null, renderMode === 'video' && codec === 'prores' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "ProRes profile" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: proResProfile, selectedId: proResProfile, values: proResProfileOptions }) })] })) : null, renderMode === 'still' ? null : ((0, jsx_runtime_1.jsx)(FrameRangeSetting_1.FrameRangeSetting, { durationInFrames: currentComposition.durationInFrames, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame })), (0, jsx_runtime_1.jsx)(RenderModalInput_1.RenderModalInput, { existence: existence, inputStyle: layout_1.input, outName: outName, onValueChange: onValueChange, validationMessage: validationMessage })] }));
|
|
78
78
|
};
|
|
79
79
|
exports.RenderModalBasic = RenderModalBasic;
|
|
@@ -6,11 +6,28 @@ const react_1 = require("react");
|
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
7
|
const colors_1 = require("../../helpers/colors");
|
|
8
8
|
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
9
|
+
const client_id_1 = require("../../helpers/client-id");
|
|
9
10
|
const layout_1 = require("../layout");
|
|
10
11
|
const actions_1 = require("../RenderQueue/actions");
|
|
11
12
|
const SegmentedControl_1 = require("../SegmentedControl");
|
|
12
13
|
const RenderModalJSONInputPropsEditor_1 = require("./RenderModalJSONInputPropsEditor");
|
|
13
14
|
const SchemaEditor_1 = require("./SchemaEditor/SchemaEditor");
|
|
15
|
+
const SchemaErrorMessages_1 = require("./SchemaEditor/SchemaErrorMessages");
|
|
16
|
+
const errorExplanation = {
|
|
17
|
+
fontSize: 14,
|
|
18
|
+
color: colors_1.LIGHT_TEXT,
|
|
19
|
+
fontFamily: 'sans-serif',
|
|
20
|
+
lineHeight: 1.5,
|
|
21
|
+
};
|
|
22
|
+
const explainer = {
|
|
23
|
+
display: 'flex',
|
|
24
|
+
flex: 1,
|
|
25
|
+
flexDirection: 'column',
|
|
26
|
+
padding: '0 12px',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
textAlign: 'center',
|
|
30
|
+
};
|
|
14
31
|
const outer = {
|
|
15
32
|
display: 'flex',
|
|
16
33
|
flexDirection: 'column',
|
|
@@ -44,7 +61,6 @@ const RenderModalData = ({ composition, inputProps, setInputProps, compact, mayS
|
|
|
44
61
|
determined: false,
|
|
45
62
|
});
|
|
46
63
|
const showSaveButton = mayShowSaveButton && canSaveDefaultProps.canUpdate;
|
|
47
|
-
// TODO: Disable if Preview Server is disconnected
|
|
48
64
|
// TODO: Update if root file is updated
|
|
49
65
|
// TODO: Segment the state for different compositions
|
|
50
66
|
(0, react_1.useEffect)(() => {
|
|
@@ -101,6 +117,19 @@ const RenderModalData = ({ composition, inputProps, setInputProps, compact, mayS
|
|
|
101
117
|
const onSave = (0, react_1.useCallback)((updater) => {
|
|
102
118
|
(0, actions_1.updateDefaultProps)(composition.id, updater(composition.defaultProps));
|
|
103
119
|
}, [composition.defaultProps, composition.id]);
|
|
120
|
+
const connectionStatus = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type;
|
|
121
|
+
if (connectionStatus === 'disconnected') {
|
|
122
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "The preview server has disconnected. Reconnect to edit the schema." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
|
|
123
|
+
}
|
|
124
|
+
const def = composition.schema._def;
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
|
+
const typeName = def.typeName;
|
|
127
|
+
if (typeName === remotion_1.z.ZodFirstPartyTypeKind.ZodAny) {
|
|
128
|
+
return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.NoSchemaDefined, {});
|
|
129
|
+
}
|
|
130
|
+
if (!composition.defaultProps) {
|
|
131
|
+
return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.NoDefaultProps, {});
|
|
132
|
+
}
|
|
104
133
|
return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsxs)("div", { style: controlContainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: tabWrapper, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: modeItems, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: spacer })] }), Object.keys(cliProps).length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: "The data that was passed using --props takes priority over the data you enter here.", align: "flex-start", type: "warning" })] })) : null, canSaveDefaultProps.canUpdate === false &&
|
|
105
134
|
canSaveDefaultProps.determined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: `Can't save default props: ${canSaveDefaultProps.reason}`, align: "flex-start", type: "warning" })] })) : null] }), mode === 'schema' ? ((0, jsx_runtime_1.jsx)(SchemaEditor_1.SchemaEditor, { value: inputProps, setValue: setInputProps, schema: composition.schema, zodValidationResult: zodValidationResult, compact: compact, defaultProps: composition.defaultProps, onSave: onSave, showSaveButton: showSaveButton })) : ((0, jsx_runtime_1.jsx)(RenderModalJSONInputPropsEditor_1.RenderModalJSONInputPropsEditor, { value: inputProps !== null && inputProps !== void 0 ? inputProps : {}, setValue: setInputProps, zodValidationResult: zodValidationResult, switchToSchema: switchToSchema, onSave: onUpdate, valBeforeSafe: valBeforeSafe, showSaveButton: showSaveButton }))] }));
|
|
106
135
|
};
|
|
@@ -8,6 +8,6 @@ const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
|
8
8
|
const layout_2 = require("./layout");
|
|
9
9
|
// eslint-disable-next-line react/function-component-definition
|
|
10
10
|
function RenderModalInput({ existence, inputStyle, outName, onValueChange, validationMessage, }) {
|
|
11
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(layout_1.Column, { children: (0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Output name" }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: validationMessage ? 'error' : existence ? 'warning' : 'ok', style: inputStyle, type: "text", value: outName, onChange: onValueChange }), validationMessage ? ((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, { align: "flex-end", message: validationMessage, type: 'error' })] })) : existence ? ((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, { align: "flex-end", message: "Will be overwritten", type: 'warning' })] })) : null] }) })] }));
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(layout_1.Column, { children: (0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Output name" }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: validationMessage ? 'error' : existence ? 'warning' : 'ok', style: inputStyle, type: "text", value: outName, onChange: onValueChange, rightAlign: true }), validationMessage ? ((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, { align: "flex-end", message: validationMessage, type: 'error' })] })) : existence ? ((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, { align: "flex-end", message: "Will be overwritten", type: 'warning' })] })) : null] }) })] }));
|
|
12
12
|
}
|
|
13
13
|
exports.RenderModalInput = RenderModalInput;
|
|
@@ -51,6 +51,6 @@ const RenderModalPicture = ({ renderMode, scale, setScale, pixelFormat, setPixel
|
|
|
51
51
|
}, [setCustomTargetVideoBitrateValue]);
|
|
52
52
|
return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Image Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: false }) })] })) : null, renderMode === 'video' && videoImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsx)(JpegQualitySetting_1.JpegQualitySetting, { jpegQuality: jpegQuality, setJpegQuality: setJpegQuality })), renderMode === 'still' && stillImageFormat === 'jpeg' && ((0, jsx_runtime_1.jsx)(JpegQualitySetting_1.JpegQualitySetting, { jpegQuality: jpegQuality, setJpegQuality: setJpegQuality })), renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Quality control" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: qualityControlOptions, needsWrapping: true }) })] })) : null, shouldDisplayCrfOption &&
|
|
53
53
|
qualityControlType === 'crf' &&
|
|
54
|
-
renderMode !== 'still' ? ((0, jsx_runtime_1.jsx)(CrfSetting_1.CrfSetting, { crf: crf, min: minCrf, max: maxCrf, setCrf: setCrf, option: client_1.BrowserSafeApis.options.crfOption })) : null, qualityControlType === 'bitrate' && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Target video bitrate" }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.videoBitrate }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { style: layout_1.input, value: customTargetVideoBitrate, onChange: onTargetVideoBitrateChanged, status: "ok" }) }) })] })) : null, renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, (0, jsx_runtime_1.jsx)(ScaleSetting_1.ScaleSetting, { scale: scale, setScale: setScale }), renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Pixel format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: pixelFormatOptions, selectedId: pixelFormat, title: "Pixel Format" }) })] })) : null] }));
|
|
54
|
+
renderMode !== 'still' ? ((0, jsx_runtime_1.jsx)(CrfSetting_1.CrfSetting, { crf: crf, min: minCrf, max: maxCrf, setCrf: setCrf, option: client_1.BrowserSafeApis.options.crfOption })) : null, qualityControlType === 'bitrate' && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Target video bitrate" }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.videoBitrate }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { style: layout_1.input, value: customTargetVideoBitrate, onChange: onTargetVideoBitrateChanged, status: "ok", rightAlign: true }) }) })] })) : null, renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, (0, jsx_runtime_1.jsx)(ScaleSetting_1.ScaleSetting, { scale: scale, setScale: setScale }), renderMode === 'video' ? (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}) : null, renderMode === 'video' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Pixel format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: pixelFormatOptions, selectedId: pixelFormat, title: "Pixel Format" }) })] })) : null] }));
|
|
55
55
|
};
|
|
56
56
|
exports.RenderModalPicture = RenderModalPicture;
|
|
@@ -4,39 +4,15 @@ exports.SchemaEditor = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
-
const Button_1 = require("../../../../preview-server/error-overlay/remotion-overlay/Button");
|
|
8
|
-
const colors_1 = require("../../../helpers/colors");
|
|
9
|
-
const layout_1 = require("../../layout");
|
|
10
7
|
const is_menu_item_1 = require("../../Menu/is-menu-item");
|
|
11
|
-
const
|
|
12
|
-
const ZodErrorMessages_1 = require("./ZodErrorMessages");
|
|
8
|
+
const SchemaErrorMessages_1 = require("./SchemaErrorMessages");
|
|
13
9
|
const ZodObjectEditor_1 = require("./ZodObjectEditor");
|
|
14
|
-
const errorExplanation = {
|
|
15
|
-
fontSize: 14,
|
|
16
|
-
color: colors_1.LIGHT_TEXT,
|
|
17
|
-
fontFamily: 'sans-serif',
|
|
18
|
-
lineHeight: 1.5,
|
|
19
|
-
};
|
|
20
|
-
const codeSnippet = {
|
|
21
|
-
fontSize: 14,
|
|
22
|
-
color: 'var(--blue)',
|
|
23
|
-
fontFamily: 'monospace',
|
|
24
|
-
};
|
|
25
10
|
const scrollable = {
|
|
26
11
|
padding: '8px 12px',
|
|
27
12
|
display: 'flex',
|
|
28
13
|
flexDirection: 'column',
|
|
29
14
|
overflowY: 'auto',
|
|
30
15
|
};
|
|
31
|
-
const explainer = {
|
|
32
|
-
display: 'flex',
|
|
33
|
-
flex: 1,
|
|
34
|
-
flexDirection: 'column',
|
|
35
|
-
padding: '0 12px',
|
|
36
|
-
justifyContent: 'center',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
textAlign: 'center',
|
|
39
|
-
};
|
|
40
16
|
const SchemaEditor = ({ schema, value, setValue, zodValidationResult, compact, defaultProps, onSave, showSaveButton, }) => {
|
|
41
17
|
const def = schema._def;
|
|
42
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -44,25 +20,12 @@ const SchemaEditor = ({ schema, value, setValue, zodValidationResult, compact, d
|
|
|
44
20
|
const reset = (0, react_1.useCallback)(() => {
|
|
45
21
|
setValue(defaultProps);
|
|
46
22
|
}, [defaultProps, setValue]);
|
|
47
|
-
const openDocs = (0, react_1.useCallback)(() => {
|
|
48
|
-
window.open(
|
|
49
|
-
// TODO: Make sure to update this link when we release v4
|
|
50
|
-
'https://v4.remotion.dev/docs/parametrized-rendering#define-a-schema-');
|
|
51
|
-
}, []);
|
|
52
|
-
if (typeName === remotion_1.z.ZodFirstPartyTypeKind.ZodAny) {
|
|
53
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(SchemaEmptyStateGraphic_1.SchemaEmptyStateGraphic, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Make the props of this composition interactively editable by adding a", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "schema" }), " prop to the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: '<Composition>' }), " component."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openDocs, children: "Learn how" })] }));
|
|
54
|
-
}
|
|
55
23
|
if (!zodValidationResult.success) {
|
|
56
|
-
if (defaultProps === undefined) {
|
|
57
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["The schema can not be edited because the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), " prop in the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: '<Composition>' }), " does not exist."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Fix the schema by adding a", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), " prop to your composition."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openDocs, children: "Learn more" })] }));
|
|
58
|
-
}
|
|
59
24
|
const defaultPropsValid = schema.safeParse(defaultProps);
|
|
60
25
|
if (!defaultPropsValid.success) {
|
|
61
|
-
|
|
62
|
-
// TODO: Does not react to when schema is updated
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["The schema can not be edited because the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), " prop in the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: '<Composition>' }), " is not valid:"] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ZodErrorMessages_1.ZodErrorMessages, { zodValidationResult: zodValidationResult }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Fix the schema by changing the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), " prop in your composition so it does not give a type error."] })] }));
|
|
26
|
+
return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.InvalidDefaultProps, { zodValidationResult: zodValidationResult });
|
|
64
27
|
}
|
|
65
|
-
return ((0, jsx_runtime_1.
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.InvalidSchema, { reset: reset, zodValidationResult: zodValidationResult }));
|
|
66
29
|
}
|
|
67
30
|
if (typeName === remotion_1.z.ZodFirstPartyTypeKind.ZodObject) {
|
|
68
31
|
return ((0, jsx_runtime_1.jsx)("div", { style: scrollable, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: (0, jsx_runtime_1.jsx)(ZodObjectEditor_1.ZodObjectEditor, { value: value, setValue: setValue, jsonPath: [], schema: schema, compact: compact, defaultValue: defaultProps, onSave: onSave, showSaveButton: showSaveButton, onRemove: null }) }));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { z } from 'remotion';
|
|
3
|
+
export declare const NoSchemaDefined: () => JSX.Element;
|
|
4
|
+
export declare const NoDefaultProps: () => JSX.Element;
|
|
5
|
+
export declare const InvalidDefaultProps: React.FC<{
|
|
6
|
+
zodValidationResult: z.SafeParseReturnType<unknown, unknown>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const InvalidSchema: React.FC<{
|
|
9
|
+
zodValidationResult: z.SafeParseReturnType<unknown, unknown>;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidSchema = exports.InvalidDefaultProps = exports.NoDefaultProps = exports.NoSchemaDefined = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Button_1 = require("../../../../preview-server/error-overlay/remotion-overlay/Button");
|
|
6
|
+
const colors_1 = require("../../../helpers/colors");
|
|
7
|
+
const layout_1 = require("../../layout");
|
|
8
|
+
const SchemaEmptyStateGraphic_1 = require("./SchemaEmptyStateGraphic");
|
|
9
|
+
const ZodErrorMessages_1 = require("./ZodErrorMessages");
|
|
10
|
+
const explainer = {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flex: 1,
|
|
13
|
+
flexDirection: 'column',
|
|
14
|
+
padding: '0 12px',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
textAlign: 'center',
|
|
18
|
+
};
|
|
19
|
+
const errorExplanation = {
|
|
20
|
+
fontSize: 14,
|
|
21
|
+
color: colors_1.LIGHT_TEXT,
|
|
22
|
+
fontFamily: 'sans-serif',
|
|
23
|
+
lineHeight: 1.5,
|
|
24
|
+
};
|
|
25
|
+
const codeSnippet = {
|
|
26
|
+
fontSize: 14,
|
|
27
|
+
color: 'var(--blue)',
|
|
28
|
+
fontFamily: 'monospace',
|
|
29
|
+
};
|
|
30
|
+
const errorContainer = {
|
|
31
|
+
padding: '8px 12px',
|
|
32
|
+
overflowY: 'auto',
|
|
33
|
+
};
|
|
34
|
+
const openDocs = () => {
|
|
35
|
+
window.open(
|
|
36
|
+
// TODO: Make sure to update this link when we release v4
|
|
37
|
+
'https://v4.remotion.dev/docs/parametrized-rendering#define-a-schema-');
|
|
38
|
+
};
|
|
39
|
+
const NoSchemaDefined = () => {
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(SchemaEmptyStateGraphic_1.SchemaEmptyStateGraphic, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Make the props of this composition interactively editable by adding a", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "schema" }), " prop to the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: '<Composition>' }), " component."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openDocs, children: "Learn how" })] }));
|
|
41
|
+
};
|
|
42
|
+
exports.NoSchemaDefined = NoSchemaDefined;
|
|
43
|
+
const NoDefaultProps = () => {
|
|
44
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["The schema can not be edited because the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), " prop in the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: '<Composition>' }), " does not exist."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Fix the schema by adding a ", (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), ' ', "prop to your composition."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openDocs, children: "Learn more" })] }));
|
|
45
|
+
};
|
|
46
|
+
exports.NoDefaultProps = NoDefaultProps;
|
|
47
|
+
const InvalidDefaultProps = ({ zodValidationResult }) => {
|
|
48
|
+
// TODO: Does not react to when schema is updated
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: errorContainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["The schema can not be edited because the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), " prop in the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: '<Composition>' }), " is not valid:"] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ZodErrorMessages_1.ZodErrorMessages, { zodValidationResult: zodValidationResult }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Fix the schema by changing the", ' ', (0, jsx_runtime_1.jsx)("code", { style: codeSnippet, children: "defaultProps" }), " prop in your composition so it does not give a type error."] })] }));
|
|
50
|
+
};
|
|
51
|
+
exports.InvalidDefaultProps = InvalidDefaultProps;
|
|
52
|
+
const InvalidSchema = ({ zodValidationResult, reset }) => {
|
|
53
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: errorContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "The data does not satisfy the schema:" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ZodErrorMessages_1.ZodErrorMessages, { zodValidationResult: zodValidationResult }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "Fix the schema using the JSON editor." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Alternatively, reset the data to the ", (0, jsx_runtime_1.jsx)("code", { children: "defaultProps" }), " that you have defined."] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: reset, children: "Reset props" })] }));
|
|
54
|
+
};
|
|
55
|
+
exports.InvalidSchema = InvalidSchema;
|
|
@@ -103,6 +103,6 @@ const ZodColorEditor = ({ jsonPath, value, setValue, showSaveButton, defaultValu
|
|
|
103
103
|
}, [localValue.value, schema, setValue]);
|
|
104
104
|
return ((0, jsx_runtime_1.jsxs)("div", { style: compact ? layout_2.narrowOption : layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { compact: compact, isDefaultValue: value === defaultValue, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: onRemove }), (0, jsx_runtime_1.jsxs)("div", { style: fullWidth, children: [(0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: colorPicker, children: (0, jsx_runtime_1.jsx)(RemInputTypeColor_1.RemInputTypeColor, { type: "color", style: {
|
|
105
105
|
height: 39,
|
|
106
|
-
}, value: rgb, onChange: onChange, className: "__remotion_color_picker", status: status }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1, block: true }), (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: localValue.value, status: status, placeholder: jsonPath.join('.'), onChange: onTextChange }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { onTextChange: onOpacityChange, onValueChange: onOpacityValueChange, status: status, value: (a / 255) * 100, min: 0, max: 100, step: 1, formatter: (v) => `${Math.round(Number(v))}
|
|
106
|
+
}, value: rgb, onChange: onChange, className: "__remotion_color_picker", status: status }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1, block: true }), (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: localValue.value, status: status, placeholder: jsonPath.join('.'), onChange: onTextChange, rightAlign: false }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { onTextChange: onOpacityChange, onValueChange: onOpacityValueChange, status: status, value: (a / 255) * 100, min: 0, max: 100, step: 1, formatter: (v) => `${Math.round(Number(v))}%`, rightAlign: false })] }), !localValue.zodValidation.success && ((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, { align: "flex-end", message: localValue.zodValidation.error.format()._errors[0], type: "error" })] }))] })] }));
|
|
107
107
|
};
|
|
108
108
|
exports.ZodColorEditor = ZodColorEditor;
|
|
@@ -71,6 +71,6 @@ const ZodDateEditor = ({ jsonPath, value, setValue, showSaveButton, defaultValue
|
|
|
71
71
|
const save = (0, react_1.useCallback)(() => {
|
|
72
72
|
onSave(() => value);
|
|
73
73
|
}, [onSave, value]);
|
|
74
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: compact ? layout_2.narrowOption : layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { compact: compact, isDefaultValue: value.getTime() === defaultValue.getTime(), jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: onRemove }), (0, jsx_runtime_1.jsxs)("div", { style: fullWidth, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: formatDate(localValue.value), type: "datetime-local", status: localValue.zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onChange: onChange, style: inputStyle }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)("div", { style: explainer, children: "Date is in local format" }), !localValue.zodValidation.success && ((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, { align: "flex-end", message: localValue.zodValidation.error.format()._errors[0], type: "error" })] }))] })] }));
|
|
74
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: compact ? layout_2.narrowOption : layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { compact: compact, isDefaultValue: value.getTime() === defaultValue.getTime(), jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: onRemove }), (0, jsx_runtime_1.jsxs)("div", { style: fullWidth, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: formatDate(localValue.value), type: "datetime-local", status: localValue.zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onChange: onChange, style: inputStyle, rightAlign: false }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)("div", { style: explainer, children: "Date is in local format" }), !localValue.zodValidation.success && ((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, { align: "flex-end", message: localValue.zodValidation.error.format()._errors[0], type: "error" })] }))] })] }));
|
|
75
75
|
};
|
|
76
76
|
exports.ZodDateEditor = ZodDateEditor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { z } from 'remotion';
|
|
3
|
+
import type { JSONPath } from './zod-types';
|
|
4
|
+
export declare const ZodNullableEditor: React.FC<{
|
|
5
|
+
showSaveButton: boolean;
|
|
6
|
+
jsonPath: JSONPath;
|
|
7
|
+
compact: boolean;
|
|
8
|
+
value: unknown;
|
|
9
|
+
defaultValue: unknown;
|
|
10
|
+
schema: z.ZodTypeAny;
|
|
11
|
+
setValue: React.Dispatch<React.SetStateAction<unknown>>;
|
|
12
|
+
onSave: (updater: (oldNum: unknown) => unknown) => void;
|
|
13
|
+
onRemove: null | (() => void);
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZodNullableEditor = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ZodOrNullishEditor_1 = require("./ZodOrNullishEditor");
|
|
6
|
+
const ZodNullableEditor = ({ jsonPath, compact, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, }) => {
|
|
7
|
+
const { innerType } = schema._def;
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(ZodOrNullishEditor_1.ZodOrNullishEditor, { compact: compact, defaultValue: defaultValue, jsonPath: jsonPath, onRemove: onRemove, onSave: onSave, schema: innerType, setValue: setValue, showSaveButton: showSaveButton, value: value, nullishValue: null }));
|
|
9
|
+
};
|
|
10
|
+
exports.ZodNullableEditor = ZodNullableEditor;
|
|
@@ -84,6 +84,6 @@ const ZodNumberEditor = ({ jsonPath, value, schema, setValue, onSave, compact, d
|
|
|
84
84
|
const save = (0, react_1.useCallback)(() => {
|
|
85
85
|
onSave(() => value);
|
|
86
86
|
}, [onSave, value]);
|
|
87
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: compact ? layout_2.narrowOption : layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { isDefaultValue: isDefault, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, compact: compact, onRemove: onRemove }), (0, jsx_runtime_1.jsxs)("div", { style: fullWidth, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: 'number', value: localValue.value, style: fullWidth, status: localValue.zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onTextChange: onChange, onValueChange: onValueChange, min: getMinValue(schema), max: getMaxValue(schema), step: getStep(schema) }), !localValue.zodValidation.success && ((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, { align: "flex-end", message: localValue.zodValidation.error.format()._errors[0], type: "error" })] }))] })] }));
|
|
87
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: compact ? layout_2.narrowOption : layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { isDefaultValue: isDefault, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, compact: compact, onRemove: onRemove }), (0, jsx_runtime_1.jsxs)("div", { style: fullWidth, children: [(0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { type: 'number', value: localValue.value, style: fullWidth, status: localValue.zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onTextChange: onChange, onValueChange: onValueChange, min: getMinValue(schema), max: getMaxValue(schema), step: getStep(schema), rightAlign: false }), !localValue.zodValidation.success && ((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, { align: "flex-end", message: localValue.zodValidation.error.format()._errors[0], type: "error" })] }))] })] }));
|
|
88
88
|
};
|
|
89
89
|
exports.ZodNumberEditor = ZodNumberEditor;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { z } from 'remotion';
|
|
3
|
+
import type { JSONPath } from './zod-types';
|
|
4
|
+
export declare const ZodOptionalEditor: React.FC<{
|
|
5
|
+
showSaveButton: boolean;
|
|
6
|
+
jsonPath: JSONPath;
|
|
7
|
+
compact: boolean;
|
|
8
|
+
value: unknown;
|
|
9
|
+
defaultValue: unknown;
|
|
10
|
+
schema: z.ZodTypeAny;
|
|
11
|
+
setValue: React.Dispatch<React.SetStateAction<unknown>>;
|
|
12
|
+
onSave: (updater: (oldNum: unknown) => unknown) => void;
|
|
13
|
+
onRemove: null | (() => void);
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZodOptionalEditor = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ZodOrNullishEditor_1 = require("./ZodOrNullishEditor");
|
|
6
|
+
const ZodOptionalEditor = ({ jsonPath, compact, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, }) => {
|
|
7
|
+
const { innerType } = schema._def;
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(ZodOrNullishEditor_1.ZodOrNullishEditor, { compact: compact, defaultValue: defaultValue, jsonPath: jsonPath, onRemove: onRemove, onSave: onSave, schema: innerType, setValue: setValue, showSaveButton: showSaveButton, value: value, nullishValue: undefined }));
|
|
9
|
+
};
|
|
10
|
+
exports.ZodOptionalEditor = ZodOptionalEditor;
|
|
@@ -30,7 +30,6 @@ const ZodOrNullishEditor = ({ jsonPath, compact, schema, setValue, onSave, defau
|
|
|
30
30
|
setValue(newValue);
|
|
31
31
|
}, [setValue]);
|
|
32
32
|
const onCheckBoxChange = (0, react_1.useCallback)((e) => {
|
|
33
|
-
console.log({ schema, newVal: (0, create_zod_values_1.createZodValues)(schema) });
|
|
34
33
|
const val = e.target.checked ? nullishValue : (0, create_zod_values_1.createZodValues)(schema);
|
|
35
34
|
onValueChange(val);
|
|
36
35
|
}, [nullishValue, onValueChange, schema]);
|
|
@@ -40,6 +39,6 @@ const ZodOrNullishEditor = ({ jsonPath, compact, schema, setValue, onSave, defau
|
|
|
40
39
|
const save = (0, react_1.useCallback)(() => {
|
|
41
40
|
onSave(() => value);
|
|
42
41
|
}, [onSave, value]);
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [value ===
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [value === nullishValue ? ((0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { isDefaultValue: value === defaultValue, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, compact: compact, onRemove: onRemove })) : ((0, jsx_runtime_1.jsx)("div", { style: fullWidth, children: (0, jsx_runtime_1.jsx)(ZodSwitch_1.ZodSwitch, { value: value, setValue: onValueChange, jsonPath: jsonPath, schema: schema, compact: compact, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove }) })), (0, jsx_runtime_1.jsxs)("div", { style: checkBoxWrapper, children: [(0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: isChecked, onChange: onCheckBoxChange, disabled: false }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: labelStyle, children: String(nullishValue) })] })] }));
|
|
44
43
|
};
|
|
45
44
|
exports.ZodOrNullishEditor = ZodOrNullishEditor;
|