@remotion/cli 4.1.0-alpha1 → 4.1.0-alpha10
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/benchmark.js +16 -7
- package/dist/chalk/index.d.ts +2 -1
- package/dist/codemods/stringify-with-path.js +24 -19
- package/dist/compositions.js +9 -4
- package/dist/config/index.d.ts +24 -0
- package/dist/config/index.js +19 -1
- package/dist/editor/components/AssetSelector.d.ts +2 -0
- package/dist/editor/components/AssetSelector.js +30 -0
- package/dist/editor/components/AssetSelectorItem.d.ts +6 -0
- package/dist/editor/components/AssetSelectorItem.js +109 -0
- package/dist/editor/components/Canvas.js +4 -4
- package/dist/editor/components/CanvasOrLoading.js +20 -1
- package/dist/editor/components/CopyButton.js +5 -2
- package/dist/editor/components/Editor.js +1 -3
- package/dist/editor/components/ExplorerPanel.d.ts +8 -0
- package/dist/editor/components/ExplorerPanel.js +67 -0
- package/dist/editor/components/FramePersistor.d.ts +0 -2
- package/dist/editor/components/FramePersistor.js +4 -24
- package/dist/editor/components/FullscreenToggle.d.ts +2 -0
- package/dist/editor/components/FullscreenToggle.js +25 -0
- package/dist/editor/components/GlobalKeybindings.js +1 -1
- package/dist/editor/components/InitialCompositionLoader.js +1 -22
- package/dist/editor/components/KeyboardShortcutsExplainer.js +1 -1
- package/dist/editor/components/NewComposition/InputDragger.js +13 -1
- package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
- package/dist/editor/components/OpenEditorButton.js +5 -2
- package/dist/editor/components/OptionsPanel.d.ts +8 -0
- package/dist/editor/components/OptionsPanel.js +79 -0
- package/dist/editor/components/PlayPause.js +4 -4
- package/dist/editor/components/PlaybackRateSelector.js +1 -1
- package/dist/editor/components/PreviewToolbar.js +3 -1
- package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +3 -3
- package/dist/editor/components/RenderModal/DataEditor.d.ts +2 -0
- package/dist/editor/components/RenderModal/DataEditor.js +13 -10
- package/dist/editor/components/RenderModal/FrameRangeSetting.js +9 -25
- package/dist/editor/components/RenderModal/MultiRangeSlider.d.ts +12 -0
- package/dist/editor/components/RenderModal/MultiRangeSlider.js +50 -0
- package/dist/editor/components/RenderModal/RenderModal.js +7 -3
- package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +2 -3
- package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -2
- package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.js +10 -11
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +26 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -2
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +2 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +7 -7
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
- 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/ZodEffectEditor.js +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodFieldValidation.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +29 -10
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -1
- package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +9 -3
- package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
- package/dist/editor/components/RenderQueue/actions.d.ts +1 -1
- package/dist/editor/components/RenderQueue/actions.js +12 -4
- package/dist/editor/components/RightPanel.js +45 -12
- package/dist/editor/components/SetTimelineInOutProvider.js +5 -4
- package/dist/editor/components/SidebarRenderButton.js +3 -1
- package/dist/editor/components/Timeline/TimelineDragHandler.js +45 -19
- package/dist/editor/components/TimelineInOutToggle.d.ts +2 -1
- package/dist/editor/components/TimelineInOutToggle.js +82 -67
- package/dist/editor/helpers/is-composition-still.d.ts +1 -1
- package/dist/editor/helpers/is-current-selected-still.js +5 -6
- package/dist/editor/helpers/use-menu-structure.js +25 -1
- package/dist/editor/icons/keys.js +1 -0
- package/dist/editor/state/canvas-ref.d.ts +2 -0
- package/dist/editor/state/canvas-ref.js +5 -0
- package/dist/editor/state/in-out.d.ts +3 -2
- package/dist/editor/state/in-out.js +22 -5
- package/dist/editor/state/marks.d.ts +3 -2
- package/dist/editor/state/marks.js +6 -6
- package/dist/error-with-stack-frame.d.ts +19 -0
- package/dist/error-with-stack-frame.js +81 -0
- package/dist/get-composition-id.d.ts +6 -6
- package/dist/get-composition-id.js +13 -6
- package/dist/get-composition-with-dimension-override.d.ts +6 -6
- package/dist/get-composition-with-dimension-override.js +3 -3
- package/dist/handle-common-errors.js +8 -0
- package/dist/handle-javascript-error.d.ts +20 -0
- package/dist/handle-javascript-error.js +81 -0
- package/dist/index.d.ts +13 -7
- package/dist/index.js +5 -2
- package/dist/log.d.ts +6 -1
- package/dist/parse-command-line.js +1 -1
- package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
- package/dist/preview-server/dev-middleware/setup-hooks.js +1 -1
- package/dist/preview-server/render-queue/job.d.ts +2 -2
- package/dist/preview-server/render-queue/make-retry-payload.js +3 -2
- package/dist/preview-server/render-queue/open-directory-in-finder.js +11 -5
- package/dist/preview-server/render-queue/process-still.js +1 -1
- package/dist/preview-server/render-queue/process-video.js +1 -1
- package/dist/preview-server/routes/add-render.js +2 -2
- package/dist/preview-server/routes/update-default-props.js +1 -2
- package/dist/print-compositions.d.ts +2 -2
- package/dist/print-error.js +6 -3
- package/dist/progress-bar.js +2 -5
- package/dist/render-flows/render.d.ts +2 -2
- package/dist/render-flows/render.js +31 -22
- package/dist/render-flows/still.d.ts +2 -2
- package/dist/render-flows/still.js +20 -14
- package/dist/render.js +6 -1
- package/dist/setup-cache.js +1 -1
- package/dist/still.js +6 -1
- package/dist/symbolicate-error.d.ts +3 -0
- package/dist/symbolicate-error.js +24 -0
- package/dist/symbolicate-errors.d.ts +7 -0
- package/dist/symbolicate-errors.js +90 -0
- package/dist/symbolicate-stacktrace.d.ts +28 -0
- package/dist/symbolicate-stacktrace.js +135 -0
- package/dist/symbolicateable-error.d.ts +16 -0
- package/dist/symbolicateable-error.js +18 -0
- package/package.json +11 -11
- package/styles/styles.css +53 -0
|
@@ -118,6 +118,7 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
|
|
|
118
118
|
const isMounted = (0, react_1.useRef)(true);
|
|
119
119
|
const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
|
|
120
120
|
const [unclampedFrame, setFrame] = (0, react_1.useState)(() => initialFrame);
|
|
121
|
+
const [saving, setSaving] = (0, react_1.useState)(false);
|
|
121
122
|
const [stillImageFormat, setStillImageFormat] = (0, react_1.useState)(() => initialStillImageFormat);
|
|
122
123
|
const [videoImageFormat, setVideoImageFormat] = (0, react_1.useState)(() => initialVideoImageFormat);
|
|
123
124
|
const [concurrency, setConcurrency] = (0, react_1.useState)(() => initialConcurrency);
|
|
@@ -567,7 +568,7 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
|
|
|
567
568
|
}
|
|
568
569
|
}, [onClickStill, onClickVideo, renderDisabled, renderMode]);
|
|
569
570
|
(0, react_1.useEffect)(() => {
|
|
570
|
-
registerKeybinding({
|
|
571
|
+
const enter = registerKeybinding({
|
|
571
572
|
callback() {
|
|
572
573
|
trigger();
|
|
573
574
|
},
|
|
@@ -575,13 +576,16 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
|
|
|
575
576
|
key: 'Enter',
|
|
576
577
|
event: 'keydown',
|
|
577
578
|
preventDefault: true,
|
|
578
|
-
triggerIfInputFieldFocused:
|
|
579
|
+
triggerIfInputFieldFocused: true,
|
|
579
580
|
});
|
|
581
|
+
return () => {
|
|
582
|
+
enter.unregister();
|
|
583
|
+
};
|
|
580
584
|
}, [registerKeybinding, trigger]);
|
|
581
585
|
return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${resolvedComposition.id}` }), (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: {
|
|
582
586
|
...buttonStyle,
|
|
583
587
|
backgroundColor: outnameValidation.valid ? colors_1.BLUE : colors_1.BLUE_DISABLED,
|
|
584
|
-
}, 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, resolvedComposition: resolvedComposition, 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 ? null : 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, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat, shouldDisplayQualityControlPicker: supportsBothQualityControls })) : 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)(DataEditor_1.DataEditor, { inputProps: inputProps, setInputProps: setInputProps, unresolvedComposition: unresolvedComposition, mayShowSaveButton: false, propsEditType: "input-props" })) : ((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 })) })] })] }));
|
|
588
|
+
}, 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, resolvedComposition: resolvedComposition, 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 ? null : 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, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat, shouldDisplayQualityControlPicker: supportsBothQualityControls })) : 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)(DataEditor_1.DataEditor, { inputProps: inputProps, setInputProps: setInputProps, unresolvedComposition: unresolvedComposition, mayShowSaveButton: false, propsEditType: "input-props", saving: saving, setSaving: setSaving })) : ((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 })) })] })] }));
|
|
585
589
|
};
|
|
586
590
|
const RenderModalWithLoader = (props) => {
|
|
587
591
|
const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Codec, ProResProfile } from '@remotion/renderer';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type {
|
|
4
|
-
import type { AnyZodObject } from 'zod';
|
|
3
|
+
import type { VideoConfig } from 'remotion';
|
|
5
4
|
import type { SegmentedControlItem } from '../SegmentedControl';
|
|
6
5
|
import type { RenderType } from './RenderModalAdvanced';
|
|
7
6
|
export declare const RenderModalBasic: React.FC<{
|
|
@@ -14,7 +13,7 @@ export declare const RenderModalBasic: React.FC<{
|
|
|
14
13
|
setProResProfile: React.Dispatch<React.SetStateAction<ProResProfile>>;
|
|
15
14
|
frame: number;
|
|
16
15
|
setFrame: React.Dispatch<React.SetStateAction<number>>;
|
|
17
|
-
resolvedComposition:
|
|
16
|
+
resolvedComposition: VideoConfig;
|
|
18
17
|
setOutName: (value: React.SetStateAction<string>) => void;
|
|
19
18
|
setEndFrame: React.Dispatch<React.SetStateAction<number | null>>;
|
|
20
19
|
startFrame: number;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { SerializedJSONWithCustomFields } from 'remotion';
|
|
2
3
|
import type { z } from 'zod';
|
|
3
|
-
import type { SerializedJSONWithCustomFields } from './SchemaEditor/input-props-serialization';
|
|
4
4
|
export type EditType = 'inputProps' | 'defaultProps';
|
|
5
5
|
export declare const RenderModalJSONPropsEditor: React.FC<{
|
|
6
6
|
value: unknown;
|
|
7
7
|
setValue: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
|
|
8
8
|
onSave: () => void;
|
|
9
|
-
valBeforeSafe: unknown;
|
|
10
9
|
showSaveButton: boolean;
|
|
11
10
|
serializedJSON: SerializedJSONWithCustomFields | null;
|
|
12
11
|
defaultProps: Record<string, unknown>;
|
|
@@ -26,13 +26,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.RenderModalJSONPropsEditor = void 0;
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
|
+
const remotion_1 = require("remotion");
|
|
29
30
|
const Button_1 = require("../../../preview-server/error-overlay/remotion-overlay/Button");
|
|
30
31
|
const colors_1 = require("../../helpers/colors");
|
|
31
32
|
const use_keybinding_1 = require("../../helpers/use-keybinding");
|
|
32
33
|
const layout_1 = require("../layout");
|
|
33
34
|
const RemTextarea_1 = require("../NewComposition/RemTextarea");
|
|
34
35
|
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
35
|
-
const
|
|
36
|
+
const deep_equal_1 = require("./SchemaEditor/deep-equal");
|
|
36
37
|
const ZodErrorMessages_1 = require("./SchemaEditor/ZodErrorMessages");
|
|
37
38
|
const style = {
|
|
38
39
|
fontFamily: 'monospace',
|
|
@@ -46,7 +47,7 @@ const scrollable = {
|
|
|
46
47
|
};
|
|
47
48
|
const parseJSON = (str, schema) => {
|
|
48
49
|
try {
|
|
49
|
-
const value =
|
|
50
|
+
const value = remotion_1.Internals.deserializeJSONWithCustomFields(str);
|
|
50
51
|
const zodValidation = schema.safeParse(value);
|
|
51
52
|
return { str, value, validJSON: true, zodValidation };
|
|
52
53
|
}
|
|
@@ -54,7 +55,7 @@ const parseJSON = (str, schema) => {
|
|
|
54
55
|
return { str, validJSON: false, error: e.message };
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
|
-
const RenderModalJSONPropsEditor = ({ setValue, value, defaultProps, onSave,
|
|
58
|
+
const RenderModalJSONPropsEditor = ({ setValue, value, defaultProps, onSave, showSaveButton, serializedJSON, schema, }) => {
|
|
58
59
|
if (serializedJSON === null) {
|
|
59
60
|
throw new Error('expecting serializedJSON to be defined');
|
|
60
61
|
}
|
|
@@ -92,8 +93,8 @@ const RenderModalJSONPropsEditor = ({ setValue, value, defaultProps, onSave, val
|
|
|
92
93
|
}
|
|
93
94
|
}, [schema, setValue]);
|
|
94
95
|
const hasChanged = (0, react_1.useMemo)(() => {
|
|
95
|
-
return
|
|
96
|
-
}, [
|
|
96
|
+
return !(0, deep_equal_1.deepEqual)(value, defaultProps);
|
|
97
|
+
}, [defaultProps, value]);
|
|
97
98
|
const onQuickSave = (0, react_1.useCallback)(() => {
|
|
98
99
|
if (hasChanged) {
|
|
99
100
|
onSave();
|
|
@@ -117,9 +118,9 @@ const RenderModalJSONPropsEditor = ({ setValue, value, defaultProps, onSave, val
|
|
|
117
118
|
};
|
|
118
119
|
}, [keybindings, onQuickSave, onSave]);
|
|
119
120
|
const reset = (0, react_1.useCallback)(() => {
|
|
120
|
-
setLocalValue(parseJSON(serializedJSON.serializedString, schema));
|
|
121
121
|
setValue(defaultProps);
|
|
122
|
-
|
|
122
|
+
setLocalValue(parseJSON(JSON.stringify(defaultProps, null, 2), schema));
|
|
123
|
+
}, [defaultProps, schema, setValue]);
|
|
123
124
|
const textAreaStyle = (0, react_1.useMemo)(() => {
|
|
124
125
|
const fail = !localValue.validJSON || !localValue.zodValidation.success;
|
|
125
126
|
if (!fail) {
|
|
@@ -130,10 +131,8 @@ const RenderModalJSONPropsEditor = ({ setValue, value, defaultProps, onSave, val
|
|
|
130
131
|
borderColor: colors_1.FAIL_COLOR,
|
|
131
132
|
};
|
|
132
133
|
}, [localValue]);
|
|
133
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: scrollable, children: [(0, jsx_runtime_1.jsx)(RemTextarea_1.RemTextarea, { onChange: onChange, value: localValue.str, status: localValue.validJSON ? 'ok' : 'error', style: textAreaStyle }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), localValue.validJSON === false ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: localValue.error, type: "error" })) : localValue.zodValidation.success === false ? ((0, jsx_runtime_1.jsx)(ZodErrorMessages_1.ZodErrorMessages, { zodValidationResult: localValue.zodValidation, viewTab: "json" })) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { disabled: !localValue.validJSON ||
|
|
134
|
-
!(localValue.validJSON && !localValue.zodValidation.success), onClick: reset, children: "Reset" }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(Button_1.Button, { disabled: !localValue.validJSON, onClick: onPretty, children: "Format" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onSave, disabled: !(localValue.validJSON && localValue.zodValidation.success) ||
|
|
134
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: scrollable, children: [(0, jsx_runtime_1.jsx)(RemTextarea_1.RemTextarea, { onChange: onChange, value: localValue.str, status: localValue.validJSON ? 'ok' : 'error', style: textAreaStyle }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), localValue.validJSON === false ? ((0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: localValue.error, type: "error" })) : localValue.zodValidation.success === false ? ((0, jsx_runtime_1.jsx)(ZodErrorMessages_1.ZodErrorMessages, { zodValidationResult: localValue.zodValidation, viewTab: "json" })) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { disabled: !(hasChanged || !localValue.validJSON), onClick: reset, children: "Reset" }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(Button_1.Button, { disabled: !localValue.validJSON, onClick: onPretty, children: "Format" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), showSaveButton ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onSave, disabled: !(localValue.validJSON && localValue.zodValidation.success) ||
|
|
135
135
|
!localValue.validJSON ||
|
|
136
|
-
!hasChanged
|
|
137
|
-
!showSaveButton, children: "Save" })] })] }));
|
|
136
|
+
!hasChanged, children: "Save" })) : null] })] }));
|
|
138
137
|
};
|
|
139
138
|
exports.RenderModalJSONPropsEditor = RenderModalJSONPropsEditor;
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import type { AnyZodObject, z } from 'zod';
|
|
3
3
|
export declare const SchemaEditor: React.FC<{
|
|
4
4
|
schema: AnyZodObject;
|
|
5
|
-
value: unknown
|
|
5
|
+
value: Record<string, unknown>;
|
|
6
6
|
setValue: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
|
|
7
7
|
zodValidationResult: z.SafeParseReturnType<unknown, unknown>;
|
|
8
8
|
defaultProps: Record<string, unknown>;
|
|
9
|
-
onSave: (updater: (oldState: unknown) => unknown) => void;
|
|
9
|
+
onSave: (updater: (oldState: Record<string, unknown>) => Record<string, unknown>) => void;
|
|
10
10
|
showSaveButton: boolean;
|
|
11
11
|
saving: boolean;
|
|
12
12
|
saveDisabledByParent: boolean;
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SchemaEditor = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const use_keybinding_1 = require("../../../helpers/use-keybinding");
|
|
6
7
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
7
8
|
const is_menu_item_1 = require("../../Menu/is-menu-item");
|
|
9
|
+
const deep_equal_1 = require("./deep-equal");
|
|
8
10
|
const SchemaErrorMessages_1 = require("./SchemaErrorMessages");
|
|
9
11
|
const ZodObjectEditor_1 = require("./ZodObjectEditor");
|
|
10
12
|
const scrollable = {
|
|
@@ -13,10 +15,34 @@ const scrollable = {
|
|
|
13
15
|
overflowY: 'auto',
|
|
14
16
|
};
|
|
15
17
|
const SchemaEditor = ({ schema, value, setValue, zodValidationResult, defaultProps, onSave, showSaveButton, saving, saveDisabledByParent, }) => {
|
|
18
|
+
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
16
19
|
const z = (0, get_zod_if_possible_1.useZodIfPossible)();
|
|
17
20
|
if (!z) {
|
|
18
21
|
throw new Error('expected zod');
|
|
19
22
|
}
|
|
23
|
+
const hasChanged = (0, react_1.useMemo)(() => {
|
|
24
|
+
return !(0, deep_equal_1.deepEqual)(defaultProps, value);
|
|
25
|
+
}, [defaultProps, value]);
|
|
26
|
+
const onQuickSave = (0, react_1.useCallback)(() => {
|
|
27
|
+
if (hasChanged && showSaveButton) {
|
|
28
|
+
onSave(() => {
|
|
29
|
+
return value;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}, [hasChanged, onSave, showSaveButton, value]);
|
|
33
|
+
(0, react_1.useEffect)(() => {
|
|
34
|
+
const save = keybindings.registerKeybinding({
|
|
35
|
+
event: 'keydown',
|
|
36
|
+
key: 's',
|
|
37
|
+
commandCtrlKey: true,
|
|
38
|
+
callback: onQuickSave,
|
|
39
|
+
preventDefault: true,
|
|
40
|
+
triggerIfInputFieldFocused: true,
|
|
41
|
+
});
|
|
42
|
+
return () => {
|
|
43
|
+
save.unregister();
|
|
44
|
+
};
|
|
45
|
+
}, [keybindings, onQuickSave, onSave]);
|
|
20
46
|
const def = schema._def;
|
|
21
47
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
48
|
const typeName = def.typeName;
|
|
@@ -32,9 +32,7 @@ const errorContainer = {
|
|
|
32
32
|
overflowY: 'auto',
|
|
33
33
|
};
|
|
34
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-');
|
|
35
|
+
window.open('https://www.remotion.dev/docs/parameterized-rendering#define-a-schema-');
|
|
38
36
|
};
|
|
39
37
|
const ZodNotInstalled = () => {
|
|
40
38
|
return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: errorExplanation, children: ["Install ", (0, jsx_runtime_1.jsx)("code", { style: styles_1.inlineCodeSnippet, children: "zod" }), " as a dependency to interactively control the props of the 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 how" })] }));
|
|
@@ -9,7 +9,6 @@ const InlineRemoveButton_1 = require("../InlineRemoveButton");
|
|
|
9
9
|
const get_schema_label_1 = require("./get-schema-label");
|
|
10
10
|
const SchemaResetButton_1 = require("./SchemaResetButton");
|
|
11
11
|
const SchemaSaveButton_1 = require("./SchemaSaveButton");
|
|
12
|
-
const colors_2 = require("../../../helpers/colors");
|
|
13
12
|
const compactStyles = {
|
|
14
13
|
fontSize: 15,
|
|
15
14
|
color: colors_1.LIGHT_TEXT,
|
|
@@ -24,7 +23,7 @@ const SchemaLabel = ({ jsonPath, isDefaultValue, onReset, onSave, showSaveButton
|
|
|
24
23
|
return {
|
|
25
24
|
fontFamily: 'monospace',
|
|
26
25
|
fontSize: 14,
|
|
27
|
-
color: valid ? colors_1.LIGHT_TEXT :
|
|
26
|
+
color: valid ? colors_1.LIGHT_TEXT : colors_1.FAIL_COLOR,
|
|
28
27
|
lineHeight: '24px',
|
|
29
28
|
};
|
|
30
29
|
}, [valid]);
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SchemaSaveButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../../../helpers/colors");
|
|
6
7
|
const InlineAction_1 = require("../../InlineAction");
|
|
7
8
|
const icon = {
|
|
8
9
|
height: 14,
|
|
@@ -10,7 +11,7 @@ const icon = {
|
|
|
10
11
|
};
|
|
11
12
|
const SchemaSaveButton = ({ onClick, disabled }) => {
|
|
12
13
|
const renderAction = (0, react_1.useCallback)((color) => {
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)("svg", { style: icon, viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { fill: disabled ?
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)("svg", { style: icon, viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { fill: disabled ? colors_1.LIGHT_TEXT : color, d: "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V173.3c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32H64zm0 96c0-17.7 14.3-32 32-32H288c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V128zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z" }) }));
|
|
14
15
|
}, [disabled]);
|
|
15
16
|
return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, disabled: disabled }));
|
|
16
17
|
};
|
|
@@ -26,19 +26,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.ZodArrayEditor = void 0;
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
|
+
const plus_1 = require("../../../icons/plus");
|
|
29
30
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
31
|
+
const InlineAction_1 = require("../../InlineAction");
|
|
32
|
+
const layout_1 = require("../layout");
|
|
30
33
|
const create_zod_values_1 = require("./create-zod-values");
|
|
31
34
|
const deep_equal_1 = require("./deep-equal");
|
|
32
|
-
const local_state_1 = require("./local-state");
|
|
33
|
-
const ZodArrayItemEditor_1 = require("./ZodArrayItemEditor");
|
|
34
35
|
const Fieldset_1 = require("./Fieldset");
|
|
35
|
-
const
|
|
36
|
-
const
|
|
36
|
+
const local_state_1 = require("./local-state");
|
|
37
|
+
const SchemaLabel_1 = require("./SchemaLabel");
|
|
37
38
|
const SchemaSeparationLine_1 = require("./SchemaSeparationLine");
|
|
38
|
-
const
|
|
39
|
-
const
|
|
39
|
+
const SchemaVerticalGuide_1 = require("./SchemaVerticalGuide");
|
|
40
|
+
const ZodArrayItemEditor_1 = require("./ZodArrayItemEditor");
|
|
40
41
|
const ZodFieldValidation_1 = require("./ZodFieldValidation");
|
|
41
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
42
42
|
const ZodArrayEditor = ({ schema, jsonPath, setValue, defaultValue, value, onSave, showSaveButton, onRemove, saving, saveDisabledByParent, mayPad, }) => {
|
|
43
43
|
const { localValue, onChange, RevisionContextProvider, reset } = (0, local_state_1.useLocalState)({
|
|
44
44
|
value,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { z } from 'zod';
|
|
2
3
|
import type { JSONPath } from './zod-types';
|
|
3
4
|
import type { UpdaterFunction } from './ZodSwitch';
|
|
4
|
-
import type { z } from 'zod';
|
|
5
5
|
export declare const ZodBooleanEditor: React.FC<{
|
|
6
6
|
schema: z.ZodTypeAny;
|
|
7
7
|
jsonPath: JSONPath;
|
|
@@ -4,9 +4,9 @@ exports.ZodBooleanEditor = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const Checkbox_1 = require("../../Checkbox");
|
|
7
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
8
7
|
const Fieldset_1 = require("./Fieldset");
|
|
9
8
|
const local_state_1 = require("./local-state");
|
|
9
|
+
const SchemaLabel_1 = require("./SchemaLabel");
|
|
10
10
|
const fullWidth = {
|
|
11
11
|
width: '100%',
|
|
12
12
|
};
|
|
@@ -9,9 +9,9 @@ const layout_1 = require("../../layout");
|
|
|
9
9
|
const InputDragger_1 = require("../../NewComposition/InputDragger");
|
|
10
10
|
const RemInput_1 = require("../../NewComposition/RemInput");
|
|
11
11
|
const RemInputTypeColor_1 = require("../../NewComposition/RemInputTypeColor");
|
|
12
|
+
const Fieldset_1 = require("./Fieldset");
|
|
12
13
|
const local_state_1 = require("./local-state");
|
|
13
14
|
const SchemaLabel_1 = require("./SchemaLabel");
|
|
14
|
-
const Fieldset_1 = require("./Fieldset");
|
|
15
15
|
const ZodFieldValidation_1 = require("./ZodFieldValidation");
|
|
16
16
|
const fullWidth = {
|
|
17
17
|
width: '100%',
|
|
@@ -6,9 +6,9 @@ const react_1 = require("react");
|
|
|
6
6
|
const colors_1 = require("../../../helpers/colors");
|
|
7
7
|
const layout_1 = require("../../layout");
|
|
8
8
|
const RemInput_1 = require("../../NewComposition/RemInput");
|
|
9
|
+
const Fieldset_1 = require("./Fieldset");
|
|
9
10
|
const local_state_1 = require("./local-state");
|
|
10
11
|
const SchemaLabel_1 = require("./SchemaLabel");
|
|
11
|
-
const Fieldset_1 = require("./Fieldset");
|
|
12
12
|
const ZodFieldValidation_1 = require("./ZodFieldValidation");
|
|
13
13
|
const fullWidth = {
|
|
14
14
|
width: '100%',
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ZodEffectEditor = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
6
|
-
const local_state_1 = require("./local-state");
|
|
7
|
-
const ZodSwitch_1 = require("./ZodSwitch");
|
|
8
6
|
const Fieldset_1 = require("./Fieldset");
|
|
7
|
+
const local_state_1 = require("./local-state");
|
|
9
8
|
const ZodFieldValidation_1 = require("./ZodFieldValidation");
|
|
9
|
+
const ZodSwitch_1 = require("./ZodSwitch");
|
|
10
10
|
const fullWidth = {
|
|
11
11
|
width: '100%',
|
|
12
12
|
};
|
|
@@ -6,9 +6,9 @@ const react_1 = require("react");
|
|
|
6
6
|
const Checkmark_1 = require("../../../icons/Checkmark");
|
|
7
7
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
8
8
|
const ComboBox_1 = require("../../NewComposition/ComboBox");
|
|
9
|
+
const Fieldset_1 = require("./Fieldset");
|
|
9
10
|
const local_state_1 = require("./local-state");
|
|
10
11
|
const SchemaLabel_1 = require("./SchemaLabel");
|
|
11
|
-
const Fieldset_1 = require("./Fieldset");
|
|
12
12
|
const ZodFieldValidation_1 = require("./ZodFieldValidation");
|
|
13
13
|
const container = {
|
|
14
14
|
width: '100%',
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ZodFieldValidation = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ValidationMessage_1 = require("../../NewComposition/ValidationMessage");
|
|
6
5
|
const layout_1 = require("../../layout");
|
|
6
|
+
const ValidationMessage_1 = require("../../NewComposition/ValidationMessage");
|
|
7
7
|
const InfoBubble_1 = require("../InfoBubble");
|
|
8
8
|
const legend = {
|
|
9
9
|
display: 'flex',
|
|
@@ -4,8 +4,8 @@ exports.ZonNonEditableValue = 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
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
8
7
|
const Fieldset_1 = require("./Fieldset");
|
|
8
|
+
const SchemaLabel_1 = require("./SchemaLabel");
|
|
9
9
|
const fullWidth = {
|
|
10
10
|
width: '100%',
|
|
11
11
|
};
|
|
@@ -4,9 +4,9 @@ exports.ZodNumberEditor = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const InputDragger_1 = require("../../NewComposition/InputDragger");
|
|
7
|
+
const Fieldset_1 = require("./Fieldset");
|
|
7
8
|
const local_state_1 = require("./local-state");
|
|
8
9
|
const SchemaLabel_1 = require("./SchemaLabel");
|
|
9
|
-
const Fieldset_1 = require("./Fieldset");
|
|
10
10
|
const ZodFieldValidation_1 = require("./ZodFieldValidation");
|
|
11
11
|
const fullWidth = {
|
|
12
12
|
width: '100%',
|
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.ZodObjectEditor = void 0;
|
|
7
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const react_2 = __importDefault(require("react"));
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
10
29
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
30
|
+
const layout_1 = require("../layout");
|
|
31
|
+
const deep_equal_1 = require("./deep-equal");
|
|
13
32
|
const Fieldset_1 = require("./Fieldset");
|
|
33
|
+
const local_state_1 = require("./local-state");
|
|
34
|
+
const SchemaLabel_1 = require("./SchemaLabel");
|
|
14
35
|
const SchemaSeparationLine_1 = require("./SchemaSeparationLine");
|
|
15
|
-
const layout_1 = require("../layout");
|
|
16
36
|
const SchemaVerticalGuide_1 = require("./SchemaVerticalGuide");
|
|
17
|
-
const
|
|
18
|
-
const deep_equal_1 = require("./deep-equal");
|
|
37
|
+
const ZodSwitch_1 = require("./ZodSwitch");
|
|
19
38
|
const ZodObjectEditor = ({ schema, jsonPath, setValue, value, defaultValue, onSave, showSaveButton, onRemove, saving, saveDisabledByParent, mayPad, }) => {
|
|
20
39
|
const z = (0, get_zod_if_possible_1.useZodIfPossible)();
|
|
21
40
|
if (!z) {
|
|
@@ -43,7 +62,7 @@ const ZodObjectEditor = ({ schema, jsonPath, setValue, value, defaultValue, onSa
|
|
|
43
62
|
return localValue.value;
|
|
44
63
|
}, false, false);
|
|
45
64
|
}, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, valid: localValue.zodValidation.success })), (0, jsx_runtime_1.jsx)(RevisionContextProvider, { children: (0, jsx_runtime_1.jsx)(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: isRoot, children: keys.map((key, i) => {
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(ZodSwitch_1.ZodSwitch, { mayPad: true, jsonPath: [...jsonPath, key], schema: shape[key], value: localValue.value[key],
|
|
47
66
|
// In case of null | {a: string, b: string} type, we need to fallback to the default value
|
|
48
67
|
defaultValue: (defaultValue !== null && defaultValue !== void 0 ? defaultValue : value)[key], setValue: (val, forceApply) => {
|
|
49
68
|
onChange((oldVal) => {
|
|
@@ -8,10 +8,10 @@ const Checkbox_1 = require("../../Checkbox");
|
|
|
8
8
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
9
9
|
const layout_1 = require("../../layout");
|
|
10
10
|
const create_zod_values_1 = require("./create-zod-values");
|
|
11
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
12
|
-
const ZodSwitch_1 = require("./ZodSwitch");
|
|
13
11
|
const Fieldset_1 = require("./Fieldset");
|
|
14
12
|
const local_state_1 = require("./local-state");
|
|
13
|
+
const SchemaLabel_1 = require("./SchemaLabel");
|
|
14
|
+
const ZodSwitch_1 = require("./ZodSwitch");
|
|
15
15
|
const labelStyle = {
|
|
16
16
|
fontFamily: 'sans-serif',
|
|
17
17
|
fontSize: 14,
|
|
@@ -7,9 +7,9 @@ const remotion_1 = require("remotion");
|
|
|
7
7
|
const Checkmark_1 = require("../../../icons/Checkmark");
|
|
8
8
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
9
9
|
const ComboBox_1 = require("../../NewComposition/ComboBox");
|
|
10
|
+
const Fieldset_1 = require("./Fieldset");
|
|
10
11
|
const local_state_1 = require("./local-state");
|
|
11
12
|
const SchemaLabel_1 = require("./SchemaLabel");
|
|
12
|
-
const Fieldset_1 = require("./Fieldset");
|
|
13
13
|
const ZodFieldValidation_1 = require("./ZodFieldValidation");
|
|
14
14
|
const container = {
|
|
15
15
|
width: '100%',
|
|
@@ -5,9 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
7
7
|
const RemInput_1 = require("../../NewComposition/RemInput");
|
|
8
|
+
const Fieldset_1 = require("./Fieldset");
|
|
8
9
|
const local_state_1 = require("./local-state");
|
|
9
10
|
const SchemaLabel_1 = require("./SchemaLabel");
|
|
10
|
-
const Fieldset_1 = require("./Fieldset");
|
|
11
11
|
const ZodFieldValidation_1 = require("./ZodFieldValidation");
|
|
12
12
|
const fullWidth = {
|
|
13
13
|
width: '100%',
|
|
@@ -27,7 +27,6 @@ const ZodSwitch = ({ schema, jsonPath, value, setValue, defaultValue, onSave, sh
|
|
|
27
27
|
throw new Error('expected zod');
|
|
28
28
|
}
|
|
29
29
|
const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
|
|
30
|
-
// TODO: (Maybe?) enable saving of inserted input props by cmd+s /ctrl + s (also for JSON view)
|
|
31
30
|
if (typeName === z.ZodFirstPartyTypeKind.ZodObject) {
|
|
32
31
|
return ((0, jsx_runtime_1.jsx)(ZodObjectEditor_1.ZodObjectEditor, { setValue: setValue, value: value, defaultValue: defaultValue, jsonPath: jsonPath, schema: schema, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
33
32
|
}
|
|
@@ -11,16 +11,22 @@ const useLocalState = ({ value, schema, setValue, defaultValue, }) => {
|
|
|
11
11
|
const parentRevision = (0, react_1.useContext)(RevisionContext).childResetRevision;
|
|
12
12
|
const [resetRevision, setResetRevision] = (0, react_1.useState)(0);
|
|
13
13
|
const [localValue, setLocalValue] = (0, react_1.useState)(() => {
|
|
14
|
-
return {
|
|
14
|
+
return {
|
|
15
|
+
[parentRevision]: {
|
|
16
|
+
value,
|
|
17
|
+
keyStabilityRevision: 0,
|
|
18
|
+
zodValidation: schema.safeParse(value),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
15
21
|
});
|
|
16
22
|
const currentLocalValue = (0, react_1.useMemo)(() => {
|
|
17
23
|
var _a;
|
|
18
24
|
return ((_a = localValue[parentRevision]) !== null && _a !== void 0 ? _a : {
|
|
19
25
|
value: defaultValue,
|
|
20
26
|
keyStabilityRevision: 0,
|
|
21
|
-
zodValidation: schema.safeParse(
|
|
27
|
+
zodValidation: schema.safeParse(defaultValue),
|
|
22
28
|
});
|
|
23
|
-
}, [defaultValue, localValue, parentRevision, schema
|
|
29
|
+
}, [defaultValue, localValue, parentRevision, schema]);
|
|
24
30
|
const stateRef = (0, react_1.useRef)(currentLocalValue);
|
|
25
31
|
stateRef.current = currentLocalValue;
|
|
26
32
|
const onChange = (0, react_1.useCallback)(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Codec } from '@remotion/renderer';
|
|
2
|
-
export declare const humanReadableCodec: (codec: Codec) => "
|
|
2
|
+
export declare const humanReadableCodec: (codec: Codec) => "AAC" | "MP3" | "GIF" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
|
|
@@ -56,5 +56,5 @@ export declare const openInFileExplorer: ({ directory }: {
|
|
|
56
56
|
export declare const removeRenderJob: (job: RenderJob) => Promise<undefined>;
|
|
57
57
|
export declare const cancelRenderJob: (job: RenderJob) => Promise<import("../../../preview-server/render-queue/job").CancelRenderResponse>;
|
|
58
58
|
export declare const updateAvailable: (signal: AbortSignal) => Promise<import("../../../preview-server/render-queue/job").UpdateAvailableResponse>;
|
|
59
|
-
export declare const updateDefaultProps: (compositionId: string, defaultProps:
|
|
59
|
+
export declare const updateDefaultProps: (compositionId: string, defaultProps: Record<string, unknown>, enumPaths: EnumPath[]) => Promise<import("../../../preview-server/render-queue/job").UpdateDefaultPropsResponse>;
|
|
60
60
|
export declare const canUpdateDefaultProps: (compositionId: string) => Promise<import("../../../preview-server/render-queue/job").CanUpdateDefaultPropsResponse>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.canUpdateDefaultProps = exports.updateDefaultProps = exports.updateAvailable = exports.cancelRenderJob = exports.removeRenderJob = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addStillRenderJob = void 0;
|
|
4
|
-
const
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
5
|
const callApi = (endpoint, body, signal) => {
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
7
7
|
fetch(endpoint, {
|
|
@@ -39,7 +39,11 @@ const addStillRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, f
|
|
|
39
39
|
chromiumOptions,
|
|
40
40
|
delayRenderTimeout,
|
|
41
41
|
envVariables,
|
|
42
|
-
|
|
42
|
+
serializedInputPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
|
|
43
|
+
data: inputProps,
|
|
44
|
+
staticBase: window.remotion_staticBase,
|
|
45
|
+
indent: undefined,
|
|
46
|
+
}).serializedString,
|
|
43
47
|
});
|
|
44
48
|
};
|
|
45
49
|
exports.addStillRenderJob = addStillRenderJob;
|
|
@@ -70,7 +74,11 @@ const addVideoRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, s
|
|
|
70
74
|
disallowParallelEncoding,
|
|
71
75
|
chromiumOptions,
|
|
72
76
|
envVariables,
|
|
73
|
-
|
|
77
|
+
serializedInputPropsWithCustomSchema: remotion_1.Internals.serializeJSONWithDate({
|
|
78
|
+
data: inputProps,
|
|
79
|
+
staticBase: window.remotion_staticBase,
|
|
80
|
+
indent: undefined,
|
|
81
|
+
}).serializedString,
|
|
74
82
|
});
|
|
75
83
|
};
|
|
76
84
|
exports.addVideoRenderJob = addVideoRenderJob;
|
|
@@ -112,7 +120,7 @@ exports.updateAvailable = updateAvailable;
|
|
|
112
120
|
const updateDefaultProps = (compositionId, defaultProps, enumPaths) => {
|
|
113
121
|
return callApi('/api/update-default-props', {
|
|
114
122
|
compositionId,
|
|
115
|
-
defaultProps:
|
|
123
|
+
defaultProps: remotion_1.Internals.serializeJSONWithDate({
|
|
116
124
|
data: defaultProps,
|
|
117
125
|
indent: undefined,
|
|
118
126
|
staticBase: window.remotion_staticBase,
|