@remotion/cli 3.3.84 → 3.3.87
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/package.json +6 -6
- package/dist/cloudrun-command.d.ts +0 -1
- package/dist/cloudrun-command.js +0 -27
- package/dist/codemods/update-default-props.d.ts +0 -5
- package/dist/codemods/update-default-props.js +0 -143
- package/dist/color-math.d.ts +0 -1
- package/dist/color-math.js +0 -12
- package/dist/config/jpeg-quality.d.ts +0 -2
- package/dist/config/jpeg-quality.js +0 -17
- package/dist/convert-entry-point-to-serve-url.d.ts +0 -1
- package/dist/convert-entry-point-to-serve-url.js +0 -15
- package/dist/editor/components/Checkbox.d.ts +0 -6
- package/dist/editor/components/Checkbox.js +0 -42
- package/dist/editor/components/CheckerboardProvider.d.ts +0 -4
- package/dist/editor/components/CheckerboardProvider.js +0 -24
- package/dist/editor/components/CollapsableOptions.d.ts +0 -6
- package/dist/editor/components/CollapsableOptions.js +0 -35
- package/dist/editor/components/CurrentCompositionSideEffects.d.ts +0 -3
- package/dist/editor/components/CurrentCompositionSideEffects.js +0 -51
- package/dist/editor/components/InlineAction.d.ts +0 -5
- package/dist/editor/components/InlineAction.js +0 -35
- package/dist/editor/components/MediaVolumeProvider.d.ts +0 -4
- package/dist/editor/components/MediaVolumeProvider.js +0 -25
- package/dist/editor/components/Modals.d.ts +0 -2
- package/dist/editor/components/Modals.js +0 -23
- package/dist/editor/components/ModalsProvider.d.ts +0 -4
- package/dist/editor/components/ModalsProvider.js +0 -17
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +0 -7
- package/dist/editor/components/NewComposition/RemInputTypeColor.js +0 -53
- package/dist/editor/components/NewComposition/RemTextarea.d.ts +0 -7
- package/dist/editor/components/NewComposition/RemTextarea.js +0 -92
- package/dist/editor/components/PlayerEmitterContext.d.ts +0 -4
- package/dist/editor/components/PlayerEmitterContext.js +0 -11
- package/dist/editor/components/RenderButton.d.ts +0 -6
- package/dist/editor/components/RenderButton.js +0 -76
- package/dist/editor/components/RenderModal/CliCopyButton.d.ts +0 -4
- package/dist/editor/components/RenderModal/CliCopyButton.js +0 -22
- package/dist/editor/components/RenderModal/CrfSetting.d.ts +0 -16
- package/dist/editor/components/RenderModal/CrfSetting.js +0 -43
- package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.d.ts +0 -8
- package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +0 -16
- package/dist/editor/components/RenderModal/EnvInput.d.ts +0 -11
- package/dist/editor/components/RenderModal/EnvInput.js +0 -74
- package/dist/editor/components/RenderModal/FrameRangeSetting.d.ts +0 -8
- package/dist/editor/components/RenderModal/FrameRangeSetting.js +0 -42
- package/dist/editor/components/RenderModal/GuiRenderStatus.d.ts +0 -5
- package/dist/editor/components/RenderModal/GuiRenderStatus.js +0 -78
- package/dist/editor/components/RenderModal/InfoBubble.d.ts +0 -5
- package/dist/editor/components/RenderModal/InfoBubble.js +0 -115
- package/dist/editor/components/RenderModal/InfoTooltip.d.ts +0 -5
- package/dist/editor/components/RenderModal/InfoTooltip.js +0 -40
- package/dist/editor/components/RenderModal/InlineEyeIcon.d.ts +0 -5
- package/dist/editor/components/RenderModal/InlineEyeIcon.js +0 -14
- package/dist/editor/components/RenderModal/InlineRemoveButton.d.ts +0 -4
- package/dist/editor/components/RenderModal/InlineRemoveButton.js +0 -12
- package/dist/editor/components/RenderModal/JpegQualitySetting.d.ts +0 -5
- package/dist/editor/components/RenderModal/JpegQualitySetting.js +0 -12
- package/dist/editor/components/RenderModal/MutedSetting.d.ts +0 -8
- package/dist/editor/components/RenderModal/MutedSetting.js +0 -16
- package/dist/editor/components/RenderModal/NumberOfLoopsSetting.d.ts +0 -5
- package/dist/editor/components/RenderModal/NumberOfLoopsSetting.js +0 -26
- package/dist/editor/components/RenderModal/NumberSetting.d.ts +0 -12
- package/dist/editor/components/RenderModal/NumberSetting.js +0 -29
- package/dist/editor/components/RenderModal/OptionExplainer.d.ts +0 -5
- package/dist/editor/components/RenderModal/OptionExplainer.js +0 -45
- package/dist/editor/components/RenderModal/RenderModal.d.ts +0 -34
- package/dist/editor/components/RenderModal/RenderModal.js +0 -576
- package/dist/editor/components/RenderModal/RenderModalAdvanced.d.ts +0 -26
- package/dist/editor/components/RenderModal/RenderModalAdvanced.js +0 -61
- package/dist/editor/components/RenderModal/RenderModalAudio.d.ts +0 -17
- package/dist/editor/components/RenderModal/RenderModalAudio.js +0 -46
- package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +0 -23
- package/dist/editor/components/RenderModal/RenderModalBasic.js +0 -79
- package/dist/editor/components/RenderModal/RenderModalData.d.ts +0 -9
- package/dist/editor/components/RenderModal/RenderModalData.js +0 -136
- package/dist/editor/components/RenderModal/RenderModalEnvironmentVariables.d.ts +0 -5
- package/dist/editor/components/RenderModal/RenderModalEnvironmentVariables.js +0 -55
- package/dist/editor/components/RenderModal/RenderModalGif.d.ts +0 -9
- package/dist/editor/components/RenderModal/RenderModalGif.js +0 -19
- package/dist/editor/components/RenderModal/RenderModalHr.d.ts +0 -2
- package/dist/editor/components/RenderModal/RenderModalHr.js +0 -18
- package/dist/editor/components/RenderModal/RenderModalInput.d.ts +0 -10
- package/dist/editor/components/RenderModal/RenderModalInput.js +0 -13
- package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.d.ts +0 -11
- package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.js +0 -118
- package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +0 -28
- package/dist/editor/components/RenderModal/RenderModalPicture.js +0 -56
- package/dist/editor/components/RenderModal/RenderStatusModal.d.ts +0 -4
- package/dist/editor/components/RenderModal/RenderStatusModal.js +0 -72
- package/dist/editor/components/RenderModal/ScaleSetting.d.ts +0 -5
- package/dist/editor/components/RenderModal/ScaleSetting.js +0 -17
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +0 -12
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +0 -35
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEmptyStateGraphic.d.ts +0 -2
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEmptyStateGraphic.js +0 -15
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +0 -11
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +0 -55
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +0 -15
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +0 -40
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaResetButton.d.ts +0 -4
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaResetButton.js +0 -12
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.d.ts +0 -4
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +0 -12
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +0 -79
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +0 -13
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +0 -28
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +0 -12
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +0 -27
- package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +0 -108
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +0 -76
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +0 -51
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +0 -68
- package/dist/editor/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +0 -5
- package/dist/editor/components/RenderModal/SchemaEditor/ZodErrorMessages.js +0 -23
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.d.ts +0 -8
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +0 -27
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +0 -10
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +0 -89
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +0 -60
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +0 -10
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +0 -15
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +0 -44
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +0 -43
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -77
- package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +0 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +0 -45
- package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.d.ts +0 -2
- package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.js +0 -153
- package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.d.ts +0 -2
- package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.js +0 -21
- package/dist/editor/components/RenderModal/SchemaEditor/get-schema-label.d.ts +0 -2
- package/dist/editor/components/RenderModal/SchemaEditor/get-schema-label.js +0 -15
- package/dist/editor/components/RenderModal/SchemaEditor/zod-types.d.ts +0 -1
- package/dist/editor/components/RenderModal/SchemaEditor/zod-types.js +0 -2
- package/dist/editor/components/RenderModal/human-readable-audio-codecs.d.ts +0 -2
- package/dist/editor/components/RenderModal/human-readable-audio-codecs.js +0 -18
- package/dist/editor/components/RenderModal/human-readable-codec.d.ts +0 -2
- package/dist/editor/components/RenderModal/human-readable-codec.js +0 -36
- package/dist/editor/components/RenderModal/layout.d.ts +0 -7
- package/dist/editor/components/RenderModal/layout.js +0 -45
- package/dist/editor/components/RenderModal/out-name-checker.d.ts +0 -14
- package/dist/editor/components/RenderModal/out-name-checker.js +0 -80
- package/dist/editor/components/RenderQueue/CircularProgress.d.ts +0 -5
- package/dist/editor/components/RenderQueue/CircularProgress.js +0 -18
- package/dist/editor/components/RenderQueue/RenderQueueError.d.ts +0 -5
- package/dist/editor/components/RenderQueue/RenderQueueError.js +0 -26
- package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +0 -5
- package/dist/editor/components/RenderQueue/RenderQueueItem.js +0 -40
- package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.d.ts +0 -5
- package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +0 -22
- package/dist/editor/components/RenderQueue/RenderQueueItemStatus.d.ts +0 -5
- package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +0 -43
- package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.d.ts +0 -5
- package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.js +0 -22
- package/dist/editor/components/RenderQueue/RenderQueueOutputName.d.ts +0 -5
- package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +0 -26
- package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.d.ts +0 -5
- package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.js +0 -26
- package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.d.ts +0 -5
- package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +0 -33
- package/dist/editor/components/RenderQueue/RenderQueueRepeat.d.ts +0 -5
- package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +0 -22
- package/dist/editor/components/RenderQueue/SuccessIcon.d.ts +0 -2
- package/dist/editor/components/RenderQueue/SuccessIcon.js +0 -14
- package/dist/editor/components/RenderQueue/actions.d.ts +0 -58
- package/dist/editor/components/RenderQueue/actions.js +0 -119
- package/dist/editor/components/RenderQueue/context.d.ts +0 -18
- package/dist/editor/components/RenderQueue/context.js +0 -49
- package/dist/editor/components/RenderQueue/index.d.ts +0 -2
- package/dist/editor/components/RenderQueue/index.js +0 -43
- package/dist/editor/components/RenderQueue/item-style.d.ts +0 -2
- package/dist/editor/components/RenderQueue/item-style.js +0 -21
- package/dist/editor/components/RenderToolbarIcon.d.ts +0 -2
- package/dist/editor/components/RenderToolbarIcon.js +0 -99
- package/dist/editor/components/RendersTab.d.ts +0 -6
- package/dist/editor/components/RendersTab.js +0 -43
- package/dist/editor/components/RightPanel.d.ts +0 -8
- package/dist/editor/components/RightPanel.js +0 -76
- package/dist/editor/components/SegmentedControl.d.ts +0 -11
- package/dist/editor/components/SegmentedControl.js +0 -62
- package/dist/editor/components/SetTimelineInOutProvider.d.ts +0 -4
- package/dist/editor/components/SetTimelineInOutProvider.js +0 -19
- package/dist/editor/components/SidebarCollapserControls.d.ts +0 -2
- package/dist/editor/components/SidebarCollapserControls.js +0 -122
- package/dist/editor/components/Tabs/index.d.ts +0 -11
- package/dist/editor/components/Tabs/index.js +0 -58
- package/dist/editor/components/Tabs/vertical.d.ts +0 -7
- package/dist/editor/components/Tabs/vertical.js +0 -43
- package/dist/editor/components/ZoomGesturesProvider.d.ts +0 -4
- package/dist/editor/components/ZoomGesturesProvider.js +0 -24
- package/dist/editor/helpers/client-id.d.ts +0 -17
- package/dist/editor/helpers/client-id.js +0 -46
- package/dist/editor/helpers/convert-env-variables.d.ts +0 -2
- package/dist/editor/helpers/convert-env-variables.js +0 -20
- package/dist/editor/helpers/prores-labels.d.ts +0 -2
- package/dist/editor/helpers/prores-labels.js +0 -25
- package/dist/editor/helpers/render-modal-sections.d.ts +0 -10
- package/dist/editor/helpers/render-modal-sections.js +0 -32
- package/dist/editor/helpers/use-breakpoint.d.ts +0 -1
- package/dist/editor/helpers/use-breakpoint.js +0 -17
- package/dist/editor/helpers/use-file-existence.d.ts +0 -1
- package/dist/editor/helpers/use-file-existence.js +0 -66
- package/dist/editor/icons/RenderStillIcon.d.ts +0 -3
- package/dist/editor/icons/RenderStillIcon.js +0 -8
- package/dist/editor/icons/audio.d.ts +0 -2
- package/dist/editor/icons/audio.js +0 -6
- package/dist/editor/icons/data.d.ts +0 -2
- package/dist/editor/icons/data.js +0 -8
- package/dist/editor/icons/file.d.ts +0 -2
- package/dist/editor/icons/file.js +0 -6
- package/dist/editor/icons/frame.d.ts +0 -2
- package/dist/editor/icons/frame.js +0 -6
- package/dist/editor/icons/gear.d.ts +0 -2
- package/dist/editor/icons/gear.js +0 -6
- package/dist/editor/icons/gif.d.ts +0 -2
- package/dist/editor/icons/gif.js +0 -6
- package/dist/editor/icons/render.d.ts +0 -8
- package/dist/editor/icons/render.js +0 -12
- package/dist/editor/icons/video.d.ts +0 -5
- package/dist/editor/icons/video.js +0 -8
- package/dist/ffmpeg.d.ts +0 -2
- package/dist/ffmpeg.js +0 -21
- package/dist/file-watcher.d.ts +0 -9
- package/dist/file-watcher.js +0 -35
- package/dist/get-default-out-name.d.ts +0 -5
- package/dist/get-default-out-name.js +0 -10
- package/dist/preview-server/api-routes.d.ts +0 -4
- package/dist/preview-server/api-routes.js +0 -21
- package/dist/preview-server/api-types.d.ts +0 -25
- package/dist/preview-server/api-types.js +0 -2
- package/dist/preview-server/file-existence-watchers.d.ts +0 -13
- package/dist/preview-server/file-existence-watchers.js +0 -62
- package/dist/preview-server/handler.d.ts +0 -9
- package/dist/preview-server/handler.js +0 -34
- package/dist/preview-server/parse-body.d.ts +0 -2
- package/dist/preview-server/parse-body.js +0 -16
- package/dist/preview-server/render-queue/get-default-video-contexts.d.ts +0 -10
- package/dist/preview-server/render-queue/get-default-video-contexts.js +0 -13
- package/dist/preview-server/render-queue/job.d.ts +0 -138
- package/dist/preview-server/render-queue/job.js +0 -2
- package/dist/preview-server/render-queue/make-retry-payload.d.ts +0 -3
- package/dist/preview-server/render-queue/make-retry-payload.js +0 -89
- package/dist/preview-server/render-queue/open-directory-in-finder.d.ts +0 -1
- package/dist/preview-server/render-queue/open-directory-in-finder.js +0 -43
- package/dist/preview-server/render-queue/process-still.d.ts +0 -8
- package/dist/preview-server/render-queue/process-still.js +0 -46
- package/dist/preview-server/render-queue/process-video.d.ts +0 -8
- package/dist/preview-server/render-queue/process-video.js +0 -63
- package/dist/preview-server/render-queue/queue.d.ts +0 -9
- package/dist/preview-server/render-queue/queue.js +0 -205
- package/dist/preview-server/routes/add-render.d.ts +0 -3
- package/dist/preview-server/routes/add-render.js +0 -76
- package/dist/preview-server/routes/can-update-default-props.d.ts +0 -4
- package/dist/preview-server/routes/can-update-default-props.js +0 -39
- package/dist/preview-server/routes/cancel-render.d.ts +0 -3
- package/dist/preview-server/routes/cancel-render.js +0 -9
- package/dist/preview-server/routes/open-in-file-explorer.d.ts +0 -3
- package/dist/preview-server/routes/open-in-file-explorer.js +0 -8
- package/dist/preview-server/routes/remove-render.d.ts +0 -3
- package/dist/preview-server/routes/remove-render.js +0 -9
- package/dist/preview-server/routes/subscribe-to-file-existence.d.ts +0 -3
- package/dist/preview-server/routes/subscribe-to-file-existence.js +0 -13
- package/dist/preview-server/routes/unsubscribe-from-file-existence.d.ts +0 -3
- package/dist/preview-server/routes/unsubscribe-from-file-existence.js +0 -13
- package/dist/preview-server/routes/update-default-props.d.ts +0 -3
- package/dist/preview-server/routes/update-default-props.js +0 -24
- package/dist/progress-types.d.ts +0 -32
- package/dist/progress-types.js +0 -17
- package/dist/render-flows/render.d.ts +0 -47
- package/dist/render-flows/render.js +0 -290
- package/dist/render-flows/still.d.ts +0 -29
- package/dist/render-flows/still.js +0 -168
- package/dist/required-chromium-options.d.ts +0 -3
- package/dist/required-chromium-options.js +0 -2
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZodBooleanEditor = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const Checkbox_1 = require("../../Checkbox");
|
|
7
|
-
const layout_1 = require("../layout");
|
|
8
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
9
|
-
const fullWidth = {
|
|
10
|
-
width: '100%',
|
|
11
|
-
};
|
|
12
|
-
const ZodBooleanEditor = ({ jsonPath, value, setValue, onSave, compact, defaultValue, onRemove, showSaveButton, }) => {
|
|
13
|
-
const onValueChange = (0, react_1.useCallback)((newValue) => {
|
|
14
|
-
setValue(newValue);
|
|
15
|
-
}, [setValue]);
|
|
16
|
-
const onChange = (0, react_1.useCallback)((e) => {
|
|
17
|
-
onValueChange(e.target.checked);
|
|
18
|
-
}, [onValueChange]);
|
|
19
|
-
const reset = (0, react_1.useCallback)(() => {
|
|
20
|
-
onValueChange(defaultValue);
|
|
21
|
-
}, [defaultValue, onValueChange]);
|
|
22
|
-
const save = (0, react_1.useCallback)(() => {
|
|
23
|
-
onSave(() => value);
|
|
24
|
-
}, [onSave, value]);
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: compact ? layout_1.narrowOption : layout_1.optionRow, children: [(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)(Checkbox_1.Checkbox, { checked: value, onChange: onChange, disabled: false }) })] }));
|
|
26
|
-
};
|
|
27
|
-
exports.ZodBooleanEditor = ZodBooleanEditor;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { z } from 'remotion';
|
|
3
|
-
import type { JSONPath } from './zod-types';
|
|
4
|
-
export declare const ZodColorEditor: React.FC<{
|
|
5
|
-
schema: z.ZodTypeAny;
|
|
6
|
-
jsonPath: JSONPath;
|
|
7
|
-
value: string;
|
|
8
|
-
defaultValue: string;
|
|
9
|
-
setValue: React.Dispatch<React.SetStateAction<string>>;
|
|
10
|
-
onSave: (updater: (oldNum: unknown) => string) => void;
|
|
11
|
-
onRemove: null | (() => void);
|
|
12
|
-
compact: boolean;
|
|
13
|
-
showSaveButton: boolean;
|
|
14
|
-
}>;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZodColorEditor = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
|
-
const color_math_1 = require("../../../../color-math");
|
|
8
|
-
const layout_1 = require("../../layout");
|
|
9
|
-
const InputDragger_1 = require("../../NewComposition/InputDragger");
|
|
10
|
-
const RemInput_1 = require("../../NewComposition/RemInput");
|
|
11
|
-
const RemInputTypeColor_1 = require("../../NewComposition/RemInputTypeColor");
|
|
12
|
-
const ValidationMessage_1 = require("../../NewComposition/ValidationMessage");
|
|
13
|
-
const layout_2 = require("../layout");
|
|
14
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
15
|
-
const fullWidth = {
|
|
16
|
-
width: '100%',
|
|
17
|
-
};
|
|
18
|
-
const ZodColorEditor = ({ jsonPath, value, setValue, showSaveButton, defaultValue, schema, compact, onSave, onRemove, }) => {
|
|
19
|
-
const [localValue, setLocalValue] = (0, react_1.useState)(() => {
|
|
20
|
-
return {
|
|
21
|
-
value,
|
|
22
|
-
zodValidation: schema.safeParse(value),
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
const onValueChange = (0, react_1.useCallback)((newValue) => {
|
|
26
|
-
const safeParse = schema.safeParse(newValue);
|
|
27
|
-
const newLocalState = {
|
|
28
|
-
value: newValue,
|
|
29
|
-
zodValidation: safeParse,
|
|
30
|
-
};
|
|
31
|
-
setLocalValue(newLocalState);
|
|
32
|
-
if (safeParse.success) {
|
|
33
|
-
setValue(newValue);
|
|
34
|
-
}
|
|
35
|
-
}, [schema, setValue]);
|
|
36
|
-
const { a, b, g, r } = localValue.zodValidation.success
|
|
37
|
-
? remotion_1.Internals.parseColor(localValue.value)
|
|
38
|
-
: { a: 1, b: 0, g: 0, r: 0 };
|
|
39
|
-
const onChange = (0, react_1.useCallback)((e) => {
|
|
40
|
-
const newColor = (0, color_math_1.colorWithNewOpacity)(e.target.value, Math.round(a));
|
|
41
|
-
const safeParse = schema.safeParse(newColor);
|
|
42
|
-
const newLocalState = {
|
|
43
|
-
value: newColor,
|
|
44
|
-
zodValidation: safeParse,
|
|
45
|
-
};
|
|
46
|
-
setLocalValue(newLocalState);
|
|
47
|
-
if (safeParse.success) {
|
|
48
|
-
setValue(newColor);
|
|
49
|
-
}
|
|
50
|
-
}, [a, schema, setValue]);
|
|
51
|
-
const onTextChange = (0, react_1.useCallback)((e) => {
|
|
52
|
-
const newValue = e.target.value;
|
|
53
|
-
const safeParse = schema.safeParse(newValue);
|
|
54
|
-
const newLocalState = {
|
|
55
|
-
value: newValue,
|
|
56
|
-
zodValidation: safeParse,
|
|
57
|
-
};
|
|
58
|
-
setLocalValue(newLocalState);
|
|
59
|
-
if (safeParse.success) {
|
|
60
|
-
setValue(newValue);
|
|
61
|
-
}
|
|
62
|
-
}, [schema, setValue]);
|
|
63
|
-
const reset = (0, react_1.useCallback)(() => {
|
|
64
|
-
onValueChange(defaultValue);
|
|
65
|
-
}, [defaultValue, onValueChange]);
|
|
66
|
-
const save = (0, react_1.useCallback)(() => {
|
|
67
|
-
onSave(() => value);
|
|
68
|
-
}, [onSave, value]);
|
|
69
|
-
const rgb = `#${r.toString(16).padStart(2, '0')}${g
|
|
70
|
-
.toString(16)
|
|
71
|
-
.padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
|
|
72
|
-
const status = localValue.zodValidation.success ? 'ok' : 'error';
|
|
73
|
-
const colorPicker = (0, react_1.useMemo)(() => {
|
|
74
|
-
return {
|
|
75
|
-
height: 39,
|
|
76
|
-
width: 45,
|
|
77
|
-
display: 'inline-block',
|
|
78
|
-
};
|
|
79
|
-
}, []);
|
|
80
|
-
const onOpacityChange = (0, react_1.useCallback)((newValue) => {
|
|
81
|
-
const newColor = (0, color_math_1.colorWithNewOpacity)(localValue.value, Math.round((Number(newValue) / 100) * 255));
|
|
82
|
-
const safeParse = schema.safeParse(newColor);
|
|
83
|
-
const newLocalState = {
|
|
84
|
-
value: newColor,
|
|
85
|
-
zodValidation: safeParse,
|
|
86
|
-
};
|
|
87
|
-
setLocalValue(newLocalState);
|
|
88
|
-
if (safeParse.success) {
|
|
89
|
-
setValue(newColor);
|
|
90
|
-
}
|
|
91
|
-
}, [localValue.value, schema, setValue]);
|
|
92
|
-
const onOpacityValueChange = (0, react_1.useCallback)((newValue) => {
|
|
93
|
-
const newColor = (0, color_math_1.colorWithNewOpacity)(localValue.value, Math.round((Number(newValue) / 100) * 255));
|
|
94
|
-
const safeParse = schema.safeParse(newColor);
|
|
95
|
-
const newLocalState = {
|
|
96
|
-
value: String(newColor),
|
|
97
|
-
zodValidation: safeParse,
|
|
98
|
-
};
|
|
99
|
-
setLocalValue(newLocalState);
|
|
100
|
-
if (safeParse.success) {
|
|
101
|
-
setValue(newColor);
|
|
102
|
-
}
|
|
103
|
-
}, [localValue.value, schema, setValue]);
|
|
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
|
-
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, 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
|
-
};
|
|
108
|
-
exports.ZodColorEditor = ZodColorEditor;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { z } from 'remotion';
|
|
3
|
-
import type { JSONPath } from './zod-types';
|
|
4
|
-
export declare const ZodDateEditor: React.FC<{
|
|
5
|
-
schema: z.ZodTypeAny;
|
|
6
|
-
jsonPath: JSONPath;
|
|
7
|
-
value: Date;
|
|
8
|
-
defaultValue: Date;
|
|
9
|
-
setValue: React.Dispatch<React.SetStateAction<Date>>;
|
|
10
|
-
onSave: (updater: (oldNum: unknown) => Date) => void;
|
|
11
|
-
onRemove: null | (() => void);
|
|
12
|
-
compact: boolean;
|
|
13
|
-
showSaveButton: boolean;
|
|
14
|
-
}>;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZodDateEditor = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const colors_1 = require("../../../helpers/colors");
|
|
7
|
-
const layout_1 = require("../../layout");
|
|
8
|
-
const RemInput_1 = require("../../NewComposition/RemInput");
|
|
9
|
-
const ValidationMessage_1 = require("../../NewComposition/ValidationMessage");
|
|
10
|
-
const layout_2 = require("../layout");
|
|
11
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
12
|
-
const fullWidth = {
|
|
13
|
-
width: '100%',
|
|
14
|
-
};
|
|
15
|
-
const explainer = {
|
|
16
|
-
fontFamily: 'sans-serif',
|
|
17
|
-
fontSize: 12,
|
|
18
|
-
color: colors_1.VERY_LIGHT_TEXT,
|
|
19
|
-
marginBottom: layout_1.SPACING_UNIT,
|
|
20
|
-
};
|
|
21
|
-
// This will do 2 things:
|
|
22
|
-
// - Make the calendar icon white
|
|
23
|
-
// Turn the input popup a dark mode input
|
|
24
|
-
const inputStyle = {
|
|
25
|
-
colorScheme: 'dark',
|
|
26
|
-
};
|
|
27
|
-
const formatDate = (date) => {
|
|
28
|
-
// Get the year, month, day, hours, minutes, seconds, and milliseconds
|
|
29
|
-
const year = date.getFullYear();
|
|
30
|
-
const month = date.getMonth() + 1; // Month is zero-indexed, so we add 1
|
|
31
|
-
const day = date.getDate();
|
|
32
|
-
const hours = date.getHours();
|
|
33
|
-
const minutes = date.getMinutes();
|
|
34
|
-
const seconds = date.getSeconds();
|
|
35
|
-
const milliseconds = date.getMilliseconds();
|
|
36
|
-
// Format the date as a string
|
|
37
|
-
const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${day
|
|
38
|
-
.toString()
|
|
39
|
-
.padStart(2, '0')}T${hours.toString().padStart(2, '0')}:${minutes
|
|
40
|
-
.toString()
|
|
41
|
-
.padStart(2, '0')}:${seconds.toString().padStart(2, '0')}.${milliseconds
|
|
42
|
-
.toString()
|
|
43
|
-
.padStart(3, '0')}`;
|
|
44
|
-
return formattedDate;
|
|
45
|
-
};
|
|
46
|
-
const ZodDateEditor = ({ jsonPath, value, setValue, showSaveButton, defaultValue, schema, compact, onSave, onRemove, }) => {
|
|
47
|
-
const [localValue, setLocalValue] = (0, react_1.useState)(() => {
|
|
48
|
-
return {
|
|
49
|
-
value,
|
|
50
|
-
zodValidation: schema.safeParse(value),
|
|
51
|
-
};
|
|
52
|
-
});
|
|
53
|
-
const onValueChange = (0, react_1.useCallback)((newValue) => {
|
|
54
|
-
const safeParse = schema.safeParse(newValue);
|
|
55
|
-
const newLocalState = {
|
|
56
|
-
value: newValue,
|
|
57
|
-
zodValidation: safeParse,
|
|
58
|
-
};
|
|
59
|
-
setLocalValue(newLocalState);
|
|
60
|
-
if (safeParse.success) {
|
|
61
|
-
setValue(newValue);
|
|
62
|
-
}
|
|
63
|
-
}, [schema, setValue]);
|
|
64
|
-
const onChange = (0, react_1.useCallback)((e) => {
|
|
65
|
-
// React does not support e.target.valueAsDate :(
|
|
66
|
-
onValueChange(new Date(e.target.value));
|
|
67
|
-
}, [onValueChange]);
|
|
68
|
-
const reset = (0, react_1.useCallback)(() => {
|
|
69
|
-
onValueChange(defaultValue);
|
|
70
|
-
}, [defaultValue, onValueChange]);
|
|
71
|
-
const save = (0, react_1.useCallback)(() => {
|
|
72
|
-
onSave(() => value);
|
|
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, 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
|
-
};
|
|
76
|
-
exports.ZodDateEditor = ZodDateEditor;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { z } from 'remotion';
|
|
3
|
-
import type { JSONPath } from './zod-types';
|
|
4
|
-
export declare const ZodEffectEditor: React.FC<{
|
|
5
|
-
schema: z.ZodTypeAny;
|
|
6
|
-
jsonPath: JSONPath;
|
|
7
|
-
value: unknown;
|
|
8
|
-
setValue: (value: unknown) => void;
|
|
9
|
-
compact: boolean;
|
|
10
|
-
defaultValue: unknown;
|
|
11
|
-
onSave: (updater: (oldState: unknown) => unknown) => void;
|
|
12
|
-
showSaveButton: boolean;
|
|
13
|
-
onRemove: null | (() => void);
|
|
14
|
-
}>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZodEffectEditor = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
|
-
const colors_1 = require("../../../helpers/colors");
|
|
8
|
-
const ValidationMessage_1 = require("../../NewComposition/ValidationMessage");
|
|
9
|
-
const ZodSwitch_1 = require("./ZodSwitch");
|
|
10
|
-
const fullWidth = {
|
|
11
|
-
width: '100%',
|
|
12
|
-
};
|
|
13
|
-
const ZodEffectEditor = ({ schema, jsonPath, value, setValue: updateValue, compact, defaultValue, onSave, onRemove, showSaveButton, }) => {
|
|
14
|
-
const [localValue, setLocalValue] = (0, react_1.useState)(() => {
|
|
15
|
-
return {
|
|
16
|
-
value,
|
|
17
|
-
zodValidation: schema.safeParse(value),
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
const def = schema._def;
|
|
21
|
-
const typeName = def.typeName;
|
|
22
|
-
if (typeName !== remotion_1.z.ZodFirstPartyTypeKind.ZodEffects) {
|
|
23
|
-
throw new Error('expected effect');
|
|
24
|
-
}
|
|
25
|
-
const onChange = (0, react_1.useCallback)((newValue) => {
|
|
26
|
-
setLocalValue(() => {
|
|
27
|
-
const safeParse = schema.safeParse(newValue);
|
|
28
|
-
if (safeParse.success) {
|
|
29
|
-
updateValue(() => newValue);
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
value: newValue,
|
|
33
|
-
zodValidation: safeParse,
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
}, [schema, updateValue]);
|
|
37
|
-
const container = (0, react_1.useMemo)(() => {
|
|
38
|
-
if (!localValue.zodValidation.success) {
|
|
39
|
-
return {
|
|
40
|
-
border: `1px solid ${colors_1.FAIL_COLOR}`,
|
|
41
|
-
borderRadius: 4,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
border: 'none',
|
|
46
|
-
padding: 0,
|
|
47
|
-
};
|
|
48
|
-
}, [localValue.zodValidation.success]);
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)("fieldset", { style: container, children: [(0, jsx_runtime_1.jsx)("div", { style: fullWidth, children: (0, jsx_runtime_1.jsx)(ZodSwitch_1.ZodSwitch, { value: value, setValue: onChange, jsonPath: jsonPath, schema: def.schema, compact: compact, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove }) }), !localValue.zodValidation.success && ((0, jsx_runtime_1.jsx)("legend", { children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: localValue.zodValidation.error.format()._errors[0], type: "error" }) }))] }));
|
|
50
|
-
};
|
|
51
|
-
exports.ZodEffectEditor = ZodEffectEditor;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { z } from 'remotion';
|
|
3
|
-
import type { JSONPath } from './zod-types';
|
|
4
|
-
export declare const ZodEnumEditor: React.FC<{
|
|
5
|
-
schema: z.ZodTypeAny;
|
|
6
|
-
jsonPath: JSONPath;
|
|
7
|
-
value: string;
|
|
8
|
-
defaultValue: string;
|
|
9
|
-
setValue: React.Dispatch<React.SetStateAction<string>>;
|
|
10
|
-
onSave: (updater: (oldState: string) => string) => void;
|
|
11
|
-
compact: boolean;
|
|
12
|
-
showSaveButton: boolean;
|
|
13
|
-
onRemove: null | (() => void);
|
|
14
|
-
}>;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZodEnumEditor = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
|
-
const Checkmark_1 = require("../../../icons/Checkmark");
|
|
8
|
-
const layout_1 = require("../../layout");
|
|
9
|
-
const ComboBox_1 = require("../../NewComposition/ComboBox");
|
|
10
|
-
const ValidationMessage_1 = require("../../NewComposition/ValidationMessage");
|
|
11
|
-
const layout_2 = require("../layout");
|
|
12
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
13
|
-
const container = {
|
|
14
|
-
width: '100%',
|
|
15
|
-
};
|
|
16
|
-
const ZodEnumEditor = ({ schema, jsonPath, compact, setValue: updateValue, defaultValue, value, onSave, showSaveButton, onRemove, }) => {
|
|
17
|
-
const [localValue, setLocalValue] = (0, react_1.useState)(() => {
|
|
18
|
-
return {
|
|
19
|
-
value,
|
|
20
|
-
zodValidation: schema.safeParse(value),
|
|
21
|
-
revision: 0,
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
const def = schema._def;
|
|
25
|
-
const typeName = def.typeName;
|
|
26
|
-
if (typeName !== remotion_1.z.ZodFirstPartyTypeKind.ZodEnum) {
|
|
27
|
-
throw new Error('expected enum');
|
|
28
|
-
}
|
|
29
|
-
const isRoot = jsonPath.length === 0;
|
|
30
|
-
const onChange = (0, react_1.useCallback)((updater) => {
|
|
31
|
-
setLocalValue((oldLocalState) => {
|
|
32
|
-
const newValue = updater(oldLocalState.value);
|
|
33
|
-
const safeParse = schema.safeParse(newValue);
|
|
34
|
-
if (safeParse.success) {
|
|
35
|
-
updateValue(updater);
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
value: newValue,
|
|
39
|
-
zodValidation: safeParse,
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
}, [schema, updateValue]);
|
|
43
|
-
const reset = (0, react_1.useCallback)(() => {
|
|
44
|
-
onChange(() => defaultValue);
|
|
45
|
-
}, [defaultValue, onChange]);
|
|
46
|
-
const comboBoxValues = (0, react_1.useMemo)(() => {
|
|
47
|
-
return def.values.map((option) => {
|
|
48
|
-
return {
|
|
49
|
-
value: option,
|
|
50
|
-
label: option,
|
|
51
|
-
id: option,
|
|
52
|
-
keyHint: null,
|
|
53
|
-
leftItem: option === value ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
|
|
54
|
-
onClick: (id) => {
|
|
55
|
-
onChange(() => id);
|
|
56
|
-
},
|
|
57
|
-
quickSwitcherLabel: null,
|
|
58
|
-
subMenu: null,
|
|
59
|
-
type: 'item',
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
}, [def.values, onChange, value]);
|
|
63
|
-
const save = (0, react_1.useCallback)(() => {
|
|
64
|
-
onSave(() => value);
|
|
65
|
-
}, [onSave, value]);
|
|
66
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: compact ? layout_2.narrowOption : layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { onSave: save, showSaveButton: showSaveButton, isDefaultValue: value === defaultValue, compact: compact, onReset: reset, jsonPath: jsonPath, onRemove: onRemove }), (0, jsx_runtime_1.jsx)("div", { style: isRoot ? undefined : container, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value }) }), !localValue.zodValidation.success && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: localValue.zodValidation.error.format()._errors[0], type: "error" })] }))] }));
|
|
67
|
-
};
|
|
68
|
-
exports.ZodEnumEditor = ZodEnumEditor;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZodErrorMessages = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const colors_1 = require("../../../helpers/colors");
|
|
6
|
-
const label = {
|
|
7
|
-
fontSize: 14,
|
|
8
|
-
color: colors_1.LIGHT_TEXT,
|
|
9
|
-
fontFamily: 'sans-serif',
|
|
10
|
-
};
|
|
11
|
-
const code = {
|
|
12
|
-
...label,
|
|
13
|
-
fontFamily: 'monospace',
|
|
14
|
-
};
|
|
15
|
-
const ZodErrorMessages = ({ zodValidationResult }) => {
|
|
16
|
-
if (zodValidationResult.success) {
|
|
17
|
-
throw new Error('Expected error');
|
|
18
|
-
}
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: zodValidationResult.error.errors.map((error) => {
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: label, children: ["-", ' ', (0, jsx_runtime_1.jsx)("code", { style: code, children: error.path.length === 0 ? 'Root' : error.path.join('.') }), ": ", error.message] }, error.path.join('.')));
|
|
21
|
-
}) }));
|
|
22
|
-
};
|
|
23
|
-
exports.ZodErrorMessages = ZodErrorMessages;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZonNonEditableValue = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const colors_1 = require("../../../helpers/colors");
|
|
7
|
-
const layout_1 = require("../layout");
|
|
8
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
9
|
-
const fullWidth = {
|
|
10
|
-
width: '100%',
|
|
11
|
-
};
|
|
12
|
-
const emptyLabel = {
|
|
13
|
-
width: '100%',
|
|
14
|
-
color: colors_1.VERY_LIGHT_TEXT,
|
|
15
|
-
fontFamily: 'sans-serif',
|
|
16
|
-
fontSize: 14,
|
|
17
|
-
};
|
|
18
|
-
const wideEmptyLabel = {
|
|
19
|
-
...emptyLabel,
|
|
20
|
-
lineHeight: '37px',
|
|
21
|
-
};
|
|
22
|
-
const ZonNonEditableValue = ({ jsonPath, label, compact, showSaveButton }) => {
|
|
23
|
-
const save = (0, react_1.useCallback)(() => undefined, []);
|
|
24
|
-
const reset = (0, react_1.useCallback)(() => undefined, []);
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: compact ? layout_1.narrowOption : layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { isDefaultValue: true, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, compact: compact, onRemove: null }), (0, jsx_runtime_1.jsx)("div", { style: fullWidth, children: (0, jsx_runtime_1.jsx)("em", { style: compact ? emptyLabel : wideEmptyLabel, children: label }) })] }));
|
|
26
|
-
};
|
|
27
|
-
exports.ZonNonEditableValue = ZonNonEditableValue;
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}>;
|
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { z } from 'remotion';
|
|
3
|
-
import type { JSONPath } from './zod-types';
|
|
4
|
-
export declare const ZodNumberEditor: React.FC<{
|
|
5
|
-
schema: z.ZodTypeAny;
|
|
6
|
-
jsonPath: JSONPath;
|
|
7
|
-
value: number;
|
|
8
|
-
setValue: React.Dispatch<React.SetStateAction<number>>;
|
|
9
|
-
compact: boolean;
|
|
10
|
-
defaultValue: number;
|
|
11
|
-
onSave: (updater: (oldNum: unknown) => number) => void;
|
|
12
|
-
onRemove: null | (() => void);
|
|
13
|
-
showSaveButton: boolean;
|
|
14
|
-
}>;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZodNumberEditor = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const layout_1 = require("../../layout");
|
|
7
|
-
const InputDragger_1 = require("../../NewComposition/InputDragger");
|
|
8
|
-
const ValidationMessage_1 = require("../../NewComposition/ValidationMessage");
|
|
9
|
-
const layout_2 = require("../layout");
|
|
10
|
-
const SchemaLabel_1 = require("./SchemaLabel");
|
|
11
|
-
const fullWidth = {
|
|
12
|
-
width: '100%',
|
|
13
|
-
};
|
|
14
|
-
const getMinValue = (schema) => {
|
|
15
|
-
const minCheck = schema._def.checks.find((c) => c.kind === 'min');
|
|
16
|
-
if (!minCheck) {
|
|
17
|
-
return -Infinity;
|
|
18
|
-
}
|
|
19
|
-
if (minCheck.kind !== 'min') {
|
|
20
|
-
throw new Error('Expected min check');
|
|
21
|
-
}
|
|
22
|
-
if (!minCheck.inclusive) {
|
|
23
|
-
return -Infinity;
|
|
24
|
-
}
|
|
25
|
-
return minCheck.value;
|
|
26
|
-
};
|
|
27
|
-
const getMaxValue = (schema) => {
|
|
28
|
-
const maxCheck = schema._def.checks.find((c) => c.kind === 'max');
|
|
29
|
-
if (!maxCheck) {
|
|
30
|
-
return Infinity;
|
|
31
|
-
}
|
|
32
|
-
if (maxCheck.kind !== 'max') {
|
|
33
|
-
throw new Error('Expected max check');
|
|
34
|
-
}
|
|
35
|
-
if (!maxCheck.inclusive) {
|
|
36
|
-
return Infinity;
|
|
37
|
-
}
|
|
38
|
-
return maxCheck.value;
|
|
39
|
-
};
|
|
40
|
-
const getStep = (schema) => {
|
|
41
|
-
const multipleStep = schema._def.checks.find((c) => c.kind === 'multipleOf');
|
|
42
|
-
if (!multipleStep) {
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
if (multipleStep.kind !== 'multipleOf') {
|
|
46
|
-
throw new Error('Expected multipleOf check');
|
|
47
|
-
}
|
|
48
|
-
return multipleStep.value;
|
|
49
|
-
};
|
|
50
|
-
const ZodNumberEditor = ({ jsonPath, value, schema, setValue, onSave, compact, defaultValue, onRemove, showSaveButton, }) => {
|
|
51
|
-
const [localValue, setLocalValue] = (0, react_1.useState)(() => {
|
|
52
|
-
return {
|
|
53
|
-
value: String(value),
|
|
54
|
-
zodValidation: schema.safeParse(value),
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
const onChange = (0, react_1.useCallback)((newValue) => {
|
|
58
|
-
const safeParse = schema.safeParse(Number(newValue));
|
|
59
|
-
const newLocalState = {
|
|
60
|
-
value: newValue,
|
|
61
|
-
zodValidation: safeParse,
|
|
62
|
-
};
|
|
63
|
-
setLocalValue(newLocalState);
|
|
64
|
-
if (safeParse.success) {
|
|
65
|
-
setValue(Number(newValue));
|
|
66
|
-
}
|
|
67
|
-
}, [schema, setValue]);
|
|
68
|
-
const onValueChange = (0, react_1.useCallback)((newValue) => {
|
|
69
|
-
const safeParse = schema.safeParse(newValue);
|
|
70
|
-
const newLocalState = {
|
|
71
|
-
value: String(newValue),
|
|
72
|
-
zodValidation: safeParse,
|
|
73
|
-
};
|
|
74
|
-
setLocalValue(newLocalState);
|
|
75
|
-
if (safeParse.success) {
|
|
76
|
-
setValue(newValue);
|
|
77
|
-
}
|
|
78
|
-
}, [schema, setValue]);
|
|
79
|
-
// TODO: Error message does not align well
|
|
80
|
-
const isDefault = value === defaultValue;
|
|
81
|
-
const reset = (0, react_1.useCallback)(() => {
|
|
82
|
-
onValueChange(defaultValue);
|
|
83
|
-
}, [defaultValue, onValueChange]);
|
|
84
|
-
const save = (0, react_1.useCallback)(() => {
|
|
85
|
-
onSave(() => value);
|
|
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), 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
|
-
};
|
|
89
|
-
exports.ZodNumberEditor = ZodNumberEditor;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { z } from 'remotion';
|
|
3
|
-
import type { JSONPath } from './zod-types';
|
|
4
|
-
export declare const ZodObjectEditor: React.FC<{
|
|
5
|
-
schema: z.ZodTypeAny;
|
|
6
|
-
jsonPath: JSONPath;
|
|
7
|
-
value: unknown;
|
|
8
|
-
defaultValue: unknown;
|
|
9
|
-
setValue: React.Dispatch<React.SetStateAction<unknown>>;
|
|
10
|
-
compact: boolean;
|
|
11
|
-
onSave: (updater: (oldVal: Record<string, unknown>) => Record<string, unknown>) => void;
|
|
12
|
-
showSaveButton: boolean;
|
|
13
|
-
onRemove: null | (() => void);
|
|
14
|
-
}>;
|