@remotion/studio 4.0.423 → 4.0.424
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/FastRefreshProvider.js +1 -1
- package/dist/ResolveCompositionConfigInStudio.js +1 -1
- package/dist/Studio.js +6 -4
- package/dist/api/create-composition.js +2 -2
- package/dist/api/focus-default-props-path.d.ts +1 -1
- package/dist/api/get-zod-schema-from-primitive.d.ts +3 -2
- package/dist/api/get-zod-schema-from-primitive.js +3 -4
- package/dist/api/helpers/calc-new-props.d.ts +2 -2
- package/dist/api/play.d.ts +1 -1
- package/dist/api/toggle.d.ts +1 -1
- package/dist/components/AskAiModal.js +3 -1
- package/dist/components/AssetSelector.js +21 -58
- package/dist/components/AssetSelectorItem.js +15 -9
- package/dist/components/AudioWaveform.js +5 -4
- package/dist/components/AudioWaveformBar.js +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Canvas.js +2 -1
- package/dist/components/CanvasIfSizeIsAvailable.js +1 -1
- package/dist/components/CanvasOrLoading.js +12 -6
- package/dist/components/CheckboardToggle.js +1 -1
- package/dist/components/Checkbox.js +3 -1
- package/dist/components/CheckerboardProvider.js +1 -1
- package/dist/components/CompSelectorRef.js +1 -1
- package/dist/components/CompositionContextButton.js +2 -2
- package/dist/components/CompositionSelector.js +4 -3
- package/dist/components/CompositionSelectorItem.js +6 -3
- package/dist/components/ContextMenu.js +3 -2
- package/dist/components/ControlButton.d.ts +1 -1
- package/dist/components/ControlButton.js +1 -1
- package/dist/components/CopyButton.js +3 -2
- package/dist/components/CurrentAsset.d.ts +3 -0
- package/dist/components/CurrentAsset.js +113 -0
- package/dist/components/CurrentComposition.js +3 -2
- package/dist/components/Editor.js +6 -1
- package/dist/components/EditorContent.js +6 -1
- package/dist/components/EditorContexts.js +3 -1
- package/dist/components/EditorGuides/Guide.js +1 -1
- package/dist/components/EditorGuides/index.js +2 -2
- package/dist/components/EditorRuler/Ruler.js +1 -1
- package/dist/components/EditorRuler/index.js +3 -1
- package/dist/components/ExplorerPanel.js +4 -1
- package/dist/components/FilePreview.js +8 -6
- package/dist/components/FpsCounter.js +1 -1
- package/dist/components/FullscreenToggle.js +1 -1
- package/dist/components/GlobalPropsEditorUpdateButton.js +3 -1
- package/dist/components/InitialCompositionLoader.d.ts +1 -2
- package/dist/components/InitialCompositionLoader.js +3 -3
- package/dist/components/InlineAction.js +1 -1
- package/dist/components/InlineDropdown.js +3 -2
- package/dist/components/InstallPackage.js +19 -9
- package/dist/components/InstallablePackage.js +5 -3
- package/dist/components/JSONViewer.js +1 -1
- package/dist/components/KeyboardShortcutsExplainer.js +91 -1
- package/dist/components/KnownBugs.js +4 -2
- package/dist/components/LoopToggle.js +1 -1
- package/dist/components/MediaVolumeProvider.js +1 -1
- package/dist/components/Menu/MenuDivider.js +1 -1
- package/dist/components/Menu/MenuItem.js +3 -2
- package/dist/components/Menu/MenuSubItem.js +4 -2
- package/dist/components/Menu/SubMenu.js +1 -1
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/MenuToolbar.js +5 -3
- package/dist/components/MobilePanel.d.ts +1 -1
- package/dist/components/MobilePanel.js +2 -1
- package/dist/components/ModalButton.js +1 -1
- package/dist/components/ModalContainer.js +1 -1
- package/dist/components/ModalFooter.js +1 -1
- package/dist/components/ModalHeader.js +3 -1
- package/dist/components/Modals.js +2 -2
- package/dist/components/ModalsProvider.js +1 -1
- package/dist/components/MuteToggle.js +1 -1
- package/dist/components/NewComposition/CancelButton.js +1 -1
- package/dist/components/NewComposition/CodemodFooter.js +5 -2
- package/dist/components/NewComposition/ComboBox.js +6 -2
- package/dist/components/NewComposition/DeleteComposition.js +10 -2
- package/dist/components/NewComposition/DiffPreview.js +5 -3
- package/dist/components/NewComposition/DismissableModal.js +1 -1
- package/dist/components/NewComposition/DuplicateComposition.js +28 -3
- package/dist/components/NewComposition/InputDragger.d.ts +1 -1
- package/dist/components/NewComposition/InputDragger.js +2 -2
- package/dist/components/NewComposition/MenuContent.js +3 -3
- package/dist/components/NewComposition/NewCompDuration.js +7 -2
- package/dist/components/NewComposition/RemInput.d.ts +2 -2
- package/dist/components/NewComposition/RemInput.js +2 -2
- package/dist/components/NewComposition/RemInputTypeColor.js +1 -1
- package/dist/components/NewComposition/RemTextarea.js +1 -1
- package/dist/components/NewComposition/RenameComposition.js +11 -2
- package/dist/components/NewComposition/ValidationMessage.js +4 -2
- package/dist/components/NoRegisterRoot.js +4 -1
- package/dist/components/Notifications/ColorDot.js +1 -1
- package/dist/components/Notifications/Notification.js +1 -1
- package/dist/components/Notifications/NotificationCenter.js +2 -2
- package/dist/components/Notifications/ServerDisconnected.js +2 -1
- package/dist/components/OpenEditorButton.js +2 -2
- package/dist/components/OptionsPanel.js +7 -4
- package/dist/components/OverrideInputProps.js +7 -2
- package/dist/components/PlayPause.js +3 -1
- package/dist/components/PlaybackRateSelector.js +2 -2
- package/dist/components/Preview.js +8 -8
- package/dist/components/PreviewToolbar.js +11 -1
- package/dist/components/QuickSwitcher/AlgoliaCredit.js +1 -1
- package/dist/components/QuickSwitcher/NoResults.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcher.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +12 -3
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +6 -3
- package/dist/components/RefreshCompositionOverlay.js +1 -1
- package/dist/components/RenderButton.js +26 -9
- package/dist/components/RenderModal/CliCopyButton.js +3 -3
- package/dist/components/RenderModal/ClientRenderProgress.js +16 -14
- package/dist/components/RenderModal/CrfSetting.d.ts +1 -2
- package/dist/components/RenderModal/CrfSetting.js +1 -1
- package/dist/components/RenderModal/DataEditor.js +15 -8
- package/dist/components/RenderModal/EnforceAudioTrackSetting.js +5 -1
- package/dist/components/RenderModal/EnvInput.js +4 -1
- package/dist/components/RenderModal/FrameRangeSetting.js +5 -1
- package/dist/components/RenderModal/GuiRenderStatus.js +15 -10
- package/dist/components/RenderModal/InfoBubble.js +3 -2
- package/dist/components/RenderModal/InfoTooltip.js +3 -2
- package/dist/components/RenderModal/InlineEyeIcon.js +2 -2
- package/dist/components/RenderModal/InlineRemoveButton.js +2 -2
- package/dist/components/RenderModal/JpegQualitySetting.js +1 -1
- package/dist/components/RenderModal/MultiRangeSlider.js +3 -1
- package/dist/components/RenderModal/MutedSetting.js +5 -1
- package/dist/components/RenderModal/NumberOfLoopsSetting.js +3 -1
- package/dist/components/RenderModal/NumberSetting.js +6 -2
- package/dist/components/RenderModal/OptionExplainer.js +14 -1
- package/dist/components/RenderModal/OptionExplainerBubble.js +1 -1
- package/dist/components/RenderModal/RenderModalAdvanced.js +66 -7
- package/dist/components/RenderModal/RenderModalAudio.js +21 -4
- package/dist/components/RenderModal/RenderModalBasic.js +18 -3
- package/dist/components/RenderModal/RenderModalEnvironmentVariables.js +5 -3
- package/dist/components/RenderModal/RenderModalGif.js +6 -1
- package/dist/components/RenderModal/RenderModalHr.js +1 -1
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +5 -2
- package/dist/components/RenderModal/RenderModalOutputName.js +8 -1
- package/dist/components/RenderModal/RenderModalPicture.js +30 -3
- package/dist/components/RenderModal/RenderStatusModal.js +8 -2
- package/dist/components/RenderModal/ResolveCompositionBeforeModal.js +6 -3
- package/dist/components/RenderModal/ScaleSetting.js +3 -2
- package/dist/components/RenderModal/SchemaEditor/Fieldset.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +4 -4
- package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +31 -6
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
- package/dist/components/RenderModal/SchemaEditor/SchemaResetButton.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/SchemaSaveButton.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +9 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaVerticalGuide.js +3 -1
- package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +9 -5
- package/dist/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +3 -1
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +8 -2
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +5 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDefaultEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +6 -4
- package/dist/components/RenderModal/SchemaEditor/ZodEffectEditor.js +3 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +4 -2
- package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +6 -4
- package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +8 -2
- package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.js +8 -6
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +3 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNullableEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +5 -1
- package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +6 -5
- package/dist/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +4 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +8 -5
- package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +5 -1
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +24 -24
- package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +5 -1
- package/dist/components/RenderModal/SchemaEditor/ZodTupleEditor.js +9 -5
- package/dist/components/RenderModal/SchemaEditor/ZodTupleItemEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodUnionEditor.js +5 -5
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.d.ts +2 -2
- package/dist/components/RenderModal/SchemaEditor/extract-enum-json-paths.d.ts +4 -4
- package/dist/components/RenderModal/SchemaEditor/local-state.js +1 -1
- package/dist/components/RenderModal/SeparateAudioOption.js +7 -2
- package/dist/components/RenderModal/ServerRenderModal.js +27 -5
- package/dist/components/RenderModal/WarningIndicatorButton.js +4 -2
- package/dist/components/RenderModal/WebRenderModal.js +29 -6
- package/dist/components/RenderModal/WebRenderModalAdvanced.js +11 -4
- package/dist/components/RenderModal/WebRenderModalAudio.js +12 -2
- package/dist/components/RenderModal/WebRenderModalBasic.js +23 -5
- package/dist/components/RenderModal/WebRenderModalLicense.js +24 -2
- package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.js +12 -1
- package/dist/components/RenderModal/WebRenderModalPicture.js +8 -1
- package/dist/components/RenderModal/WebRendererExperimentalBadge.js +3 -1
- package/dist/components/RenderModal/get-default-codecs.d.ts +7 -8
- package/dist/components/RenderModal/human-readable-audio-codecs.d.ts +1 -2
- package/dist/components/RenderModal/human-readable-codec.d.ts +1 -2
- package/dist/components/RenderModal/human-readable-loglevel.d.ts +1 -2
- package/dist/components/RenderModal/out-name-checker.d.ts +4 -5
- package/dist/components/RenderModal/quality-options.js +1 -1
- package/dist/components/RenderPreview.js +4 -4
- package/dist/components/RenderQueue/CircularProgress.js +1 -1
- package/dist/components/RenderQueue/ClientRenderQueueProcessor.js +0 -1
- package/dist/components/RenderQueue/RenderQueueCancelledMessage.js +1 -1
- package/dist/components/RenderQueue/RenderQueueCopyToClipboard.js +2 -2
- package/dist/components/RenderQueue/RenderQueueDownloadItem.js +2 -2
- package/dist/components/RenderQueue/RenderQueueError.js +1 -1
- package/dist/components/RenderQueue/RenderQueueItem.js +4 -1
- package/dist/components/RenderQueue/RenderQueueItemCancelButton.js +2 -2
- package/dist/components/RenderQueue/RenderQueueItemStatus.js +8 -8
- package/dist/components/RenderQueue/RenderQueueOpenInFolder.js +2 -2
- package/dist/components/RenderQueue/RenderQueueOutputName.js +1 -1
- package/dist/components/RenderQueue/RenderQueueProgressMessage.js +4 -2
- package/dist/components/RenderQueue/RenderQueueRemoveItem.js +2 -2
- package/dist/components/RenderQueue/RenderQueueRepeat.js +2 -2
- package/dist/components/RenderQueue/RenderQueueSavingMessage.js +1 -1
- package/dist/components/RenderQueue/SuccessIcon.js +1 -1
- package/dist/components/RenderQueue/actions.d.ts +21 -24
- package/dist/components/RenderQueue/client-side-render-types.d.ts +0 -1
- package/dist/components/RenderQueue/context.js +2 -2
- package/dist/components/RenderQueue/index.js +10 -5
- package/dist/components/RendersTab.js +3 -1
- package/dist/components/ResetZoomButton.js +1 -1
- package/dist/components/RunningCalculateMetadata.js +5 -1
- package/dist/components/SegmentedControl.js +3 -3
- package/dist/components/SetTimelineInOutProvider.js +1 -1
- package/dist/components/ShowGuidesProvider.js +1 -1
- package/dist/components/ShowRulersProvider.js +1 -1
- package/dist/components/SidebarCollapserControls.js +5 -3
- package/dist/components/SidebarRenderButton.js +2 -2
- package/dist/components/SizeSelector.js +2 -2
- package/dist/components/Spinner.js +6 -4
- package/dist/components/Splitter/SplitterContainer.js +1 -1
- package/dist/components/Splitter/SplitterElement.js +3 -1
- package/dist/components/Splitter/SplitterHandle.js +1 -1
- package/dist/components/StaticFilePreview.js +5 -5
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Tabs/vertical.js +1 -1
- package/dist/components/TextViewer.js +1 -1
- package/dist/components/TimeValue.js +3 -1
- package/dist/components/Timeline/LoopedIndicator.js +4 -2
- package/dist/components/Timeline/LoopedTimelineIndicators.js +5 -4
- package/dist/components/Timeline/MaxTimelineTracks.js +1 -1
- package/dist/components/Timeline/Timeline.js +5 -1
- package/dist/components/Timeline/TimelineCollapseToggle.js +2 -2
- package/dist/components/Timeline/TimelineDragHandler.js +5 -3
- package/dist/components/Timeline/TimelineInOutPointer.js +2 -2
- package/dist/components/Timeline/TimelineInOutPointerHandle.js +2 -2
- package/dist/components/Timeline/TimelineLayerEye.js +3 -3
- package/dist/components/Timeline/TimelineList.js +3 -2
- package/dist/components/Timeline/TimelineListItem.js +3 -1
- package/dist/components/Timeline/TimelineScrollable.js +1 -1
- package/dist/components/Timeline/TimelineSequence.js +6 -6
- package/dist/components/Timeline/TimelineSequenceFrame.js +1 -1
- package/dist/components/Timeline/TimelineSlider.d.ts +1 -1
- package/dist/components/Timeline/TimelineSlider.js +6 -3
- package/dist/components/Timeline/TimelineSliderHandle.js +1 -1
- package/dist/components/Timeline/TimelineStack/index.js +5 -2
- package/dist/components/Timeline/TimelineTimeIndicators.js +5 -5
- package/dist/components/Timeline/TimelineTracks.js +6 -4
- package/dist/components/Timeline/TimelineVideoInfo.js +1 -1
- package/dist/components/Timeline/TimelineWidthProvider.js +1 -1
- package/dist/components/Timeline/TimelineZoomControls.js +3 -1
- package/dist/components/Timeline/timeline-scroll-logic.d.ts +1 -1
- package/dist/components/Timeline/timeline-scroll-logic.js +12 -8
- package/dist/components/TimelineInOutToggle.js +11 -7
- package/dist/components/TopPanel.js +5 -1
- package/dist/components/UpdateCheck.js +2 -2
- package/dist/components/UpdateModal/OpenIssueButton.js +2 -2
- package/dist/components/UpdateModal/UpdateModal.js +8 -1
- package/dist/components/VisualControls/ClickableFileName.js +1 -1
- package/dist/components/VisualControls/VisualControlHandle.js +3 -1
- package/dist/components/VisualControls/VisualControlHandleHeader.js +1 -1
- package/dist/components/VisualControls/VisualControlsContent.js +3 -2
- package/dist/components/ZoomGesturesProvider.js +1 -1
- package/dist/components/call-api.d.ts +1 -1
- package/dist/components/get-zod-if-possible.d.ts +3 -3
- package/dist/components/get-zod-if-possible.js +9 -9
- package/dist/components/layout.js +4 -4
- package/dist/components/use-static-files.d.ts +6 -0
- package/dist/components/use-static-files.js +63 -0
- package/dist/error-overlay/react-overlay/utils/parser.d.ts +1 -1
- package/dist/error-overlay/remotion-overlay/AskOnDiscord.js +1 -1
- package/dist/error-overlay/remotion-overlay/CalculateMetadataErrorExplainer.js +2 -1
- package/dist/error-overlay/remotion-overlay/CodeFrame.js +6 -4
- package/dist/error-overlay/remotion-overlay/CompositionIdListItem.js +1 -1
- package/dist/error-overlay/remotion-overlay/CompositionIdsDropdown.js +8 -3
- package/dist/error-overlay/remotion-overlay/DismissButton.js +1 -1
- package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +19 -4
- package/dist/error-overlay/remotion-overlay/ErrorLoader.js +8 -4
- package/dist/error-overlay/remotion-overlay/ErrorMessage.js +2 -1
- package/dist/error-overlay/remotion-overlay/ErrorTitle.js +7 -1
- package/dist/error-overlay/remotion-overlay/HelpLink.js +1 -1
- package/dist/error-overlay/remotion-overlay/OpenInEditor.js +1 -1
- package/dist/error-overlay/remotion-overlay/Overlay.js +2 -2
- package/dist/error-overlay/remotion-overlay/Retry.js +1 -1
- package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +1 -1
- package/dist/error-overlay/remotion-overlay/ShortcutHint.js +2 -1
- package/dist/error-overlay/remotion-overlay/StackFrame.js +6 -2
- package/dist/error-overlay/remotion-overlay/Symbolicating.js +3 -1
- package/dist/error-overlay/remotion-overlay/carets.d.ts +1 -1
- package/dist/error-overlay/remotion-overlay/carets.js +2 -2
- package/dist/error-overlay/remotion-overlay/index.js +2 -2
- package/dist/esm/{chunk-112w480k.js → chunk-3g77e2p9.js} +4021 -19452
- package/dist/esm/internals.mjs +4021 -19452
- package/dist/esm/previewEntry.mjs +4052 -19483
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/client-id.js +1 -1
- package/dist/helpers/color-math.d.ts +1 -2
- package/dist/helpers/create-folder-tree.d.ts +2 -2
- package/dist/helpers/document-title.js +2 -2
- package/dist/helpers/editor-ruler.d.ts +3 -3
- package/dist/helpers/extract-frames.d.ts +1 -1
- package/dist/helpers/pick-color.js +5 -1
- package/dist/helpers/presets-labels.d.ts +1 -2
- package/dist/helpers/prores-labels.d.ts +1 -2
- package/dist/helpers/render-modal-sections.d.ts +1 -2
- package/dist/helpers/timeline-layout.d.ts +1 -1
- package/dist/helpers/use-asset-drag-events.d.ts +1 -1
- package/dist/helpers/use-menu-structure.d.ts +1 -1
- package/dist/helpers/use-menu-structure.js +11 -11
- package/dist/helpers/use-studio-canvas-dimensions.d.ts +1 -1
- package/dist/helpers/validate-new-comp-data.d.ts +2 -3
- package/dist/hot-middleware-client/client.d.ts +1 -1
- package/dist/hot-middleware-client/process-update.d.ts +8 -2
- package/dist/hot-middleware-client/process-update.js +2 -1
- package/dist/icons/Checkmark.js +1 -1
- package/dist/icons/audio.js +1 -1
- package/dist/icons/caret.js +3 -3
- package/dist/icons/certificate.d.ts +1 -1
- package/dist/icons/certificate.js +1 -1
- package/dist/icons/check-circle-filled.js +1 -1
- package/dist/icons/clipboard.js +1 -1
- package/dist/icons/data.js +1 -1
- package/dist/icons/ellipsis.js +1 -1
- package/dist/icons/file.js +1 -1
- package/dist/icons/folder.js +3 -3
- package/dist/icons/frame.js +1 -1
- package/dist/icons/gear.js +1 -1
- package/dist/icons/gif.js +1 -1
- package/dist/icons/jump-to-start.js +1 -1
- package/dist/icons/keys.js +3 -3
- package/dist/icons/media-volume.js +2 -2
- package/dist/icons/minus.js +1 -1
- package/dist/icons/pause.js +1 -1
- package/dist/icons/play.js +1 -1
- package/dist/icons/plus.js +1 -1
- package/dist/icons/render.js +1 -1
- package/dist/icons/step-back.js +1 -1
- package/dist/icons/step-forward.js +1 -1
- package/dist/icons/still.js +1 -1
- package/dist/icons/timelineInOutPointer.js +2 -2
- package/dist/icons/video.js +1 -1
- package/dist/index.js +16 -16
- package/dist/internals.d.ts +1 -1
- package/dist/previewEntry.js +2 -2
- package/dist/renderEntry.js +10 -8
- package/dist/state/folders.js +1 -1
- package/dist/state/highest-z-index.js +1 -1
- package/dist/state/in-out.js +4 -3
- package/dist/state/keybindings.js +1 -1
- package/dist/state/preview-size.js +1 -1
- package/dist/state/sidebar.js +1 -1
- package/dist/state/timeline-zoom.js +1 -1
- package/dist/state/z-index.js +2 -1
- package/dist/visual-controls/VisualControls.js +1 -1
- package/dist/visual-controls/get-current-edited-value.js +2 -1
- package/package.json +13 -12
|
@@ -10,8 +10,8 @@ const icon = {
|
|
|
10
10
|
};
|
|
11
11
|
const SchemaResetButton = ({ onClick }) => {
|
|
12
12
|
const renderAction = (0, react_1.useCallback)((color) => {
|
|
13
|
-
return (
|
|
13
|
+
return (jsx_runtime_1.jsx("svg", { style: icon, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: color, d: "M48.5 224H40c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H48.5z" }) }));
|
|
14
14
|
}, []);
|
|
15
|
-
return
|
|
15
|
+
return jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick });
|
|
16
16
|
};
|
|
17
17
|
exports.SchemaResetButton = SchemaResetButton;
|
|
@@ -11,8 +11,8 @@ const icon = {
|
|
|
11
11
|
};
|
|
12
12
|
const SchemaSaveButton = ({ onClick, disabled }) => {
|
|
13
13
|
const renderAction = (0, react_1.useCallback)((color) => {
|
|
14
|
-
return (
|
|
14
|
+
return (jsx_runtime_1.jsx("svg", { style: icon, viewBox: "0 0 448 512", children: 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" }) }));
|
|
15
15
|
}, [disabled]);
|
|
16
|
-
return (
|
|
16
|
+
return (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, disabled: disabled }));
|
|
17
17
|
};
|
|
18
18
|
exports.SchemaSaveButton = SchemaSaveButton;
|
|
@@ -14,7 +14,7 @@ const line = {
|
|
|
14
14
|
borderBottom: '1px solid ' + colors_1.LINE_COLOR,
|
|
15
15
|
};
|
|
16
16
|
const SchemaSeparationLine = () => {
|
|
17
|
-
return
|
|
17
|
+
return jsx_runtime_1.jsx("div", { style: line });
|
|
18
18
|
};
|
|
19
19
|
exports.SchemaSeparationLine = SchemaSeparationLine;
|
|
20
20
|
const arraySeparationLine = {
|
|
@@ -73,20 +73,24 @@ const SchemaArrayItemSeparationLine = ({ onChange, index, schema, isLast, showAd
|
|
|
73
73
|
const onInnerMouseLeave = (0, react_1.useCallback)(() => {
|
|
74
74
|
setInnerHovered(false);
|
|
75
75
|
}, []);
|
|
76
|
-
return (
|
|
76
|
+
return (jsx_runtime_1.jsxs("div", { style: {
|
|
77
77
|
display: 'flex',
|
|
78
78
|
flexDirection: 'row',
|
|
79
79
|
height: exports.VERTICAL_GUIDE_HEIGHT,
|
|
80
|
-
}, children: [
|
|
80
|
+
}, children: [
|
|
81
|
+
jsx_runtime_1.jsxs("div", { style: {
|
|
81
82
|
flex: 1,
|
|
82
83
|
position: 'relative',
|
|
83
84
|
display: 'flex',
|
|
84
85
|
flexDirection: 'column',
|
|
85
86
|
alignItems: 'flex-end',
|
|
86
|
-
}, children: [showAddButton && (
|
|
87
|
+
}, children: [showAddButton && (jsx_runtime_1.jsx("div", { style: dynamicAddButtonStyle, onPointerEnter: onOuterMouseEnter, onPointerLeave: onOuterMouseLeave, children: jsx_runtime_1.jsx("div", { onClick: onAdd, style: inner, onPointerEnter: onInnerMouseEnter, onPointerLeave: onInnerMouseLeave, children: jsx_runtime_1.jsx(plus_1.Plus, { color: innerHovered ? 'white' : colors_1.LIGHT_TEXT, style: { height: exports.VERTICAL_GUIDE_HEIGHT / 2 } }) }) })), jsx_runtime_1.jsx("div", { style: arraySeparationLine })
|
|
88
|
+
] }), isLast ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
89
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: {
|
|
87
90
|
...layout_2.fieldSetText,
|
|
88
91
|
alignItems: 'center',
|
|
89
92
|
display: 'flex',
|
|
90
|
-
}, children: ']' })
|
|
93
|
+
}, children: ']' })
|
|
94
|
+
] })) : null] }));
|
|
91
95
|
};
|
|
92
96
|
exports.SchemaArrayItemSeparationLine = SchemaArrayItemSeparationLine;
|
|
@@ -26,6 +26,8 @@ const SchemaVerticalGuide = ({ isRoot, children }) => {
|
|
|
26
26
|
position: 'absolute',
|
|
27
27
|
};
|
|
28
28
|
}, [isRoot]);
|
|
29
|
-
return (
|
|
29
|
+
return (jsx_runtime_1.jsxs("div", { style: outer, children: [
|
|
30
|
+
jsx_runtime_1.jsx("div", { style: inner }), jsx_runtime_1.jsx("div", { style: flex, children: children })
|
|
31
|
+
] }));
|
|
30
32
|
};
|
|
31
33
|
exports.SchemaVerticalGuide = SchemaVerticalGuide;
|
|
@@ -70,16 +70,20 @@ const ZodArrayEditor = ({ schema, jsonPath, setValue, defaultValue, value, onSav
|
|
|
70
70
|
const isDefaultValue = (0, react_1.useMemo)(() => {
|
|
71
71
|
return (0, deep_equal_1.deepEqual)(localValue.value, defaultValue);
|
|
72
72
|
}, [defaultValue, localValue]);
|
|
73
|
-
return (
|
|
73
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [
|
|
74
|
+
jsx_runtime_1.jsx("div", { style: {
|
|
74
75
|
display: 'flex',
|
|
75
76
|
flexDirection: 'row',
|
|
76
|
-
}, children:
|
|
77
|
+
}, children: jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { onReset: reset, isDefaultValue: isDefaultValue, jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, onSave: () => {
|
|
77
78
|
onSave(() => localValue.value, false, false);
|
|
78
|
-
}, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, valid: localValue.zodValidation.success, handleClick: () => setExpanded(!expanded) }) }), expanded ? (
|
|
79
|
+
}, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, valid: localValue.zodValidation.success, handleClick: () => setExpanded(!expanded) }) }), expanded ? (jsx_runtime_1.jsx(RevisionContextProvider, { children: jsx_runtime_1.jsxs(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [localValue.value.map((child, i) => {
|
|
79
80
|
var _a;
|
|
80
81
|
return (
|
|
81
82
|
// eslint-disable-next-line react/no-array-index-key
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [
|
|
84
|
+
jsx_runtime_1.jsx(ZodArrayItemEditor_1.ZodArrayItemEditor, { onChange: onChange, value: child, def: def, index: i, jsonPath: jsonPath, defaultValue: (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue[i]) !== null && _a !== void 0 ? _a : (0, create_zod_values_1.createZodValues)(def.type, z, zodTypes), onSave: onSave, showSaveButton: showSaveButton, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad, mayRemove: true }), jsx_runtime_1.jsx(SchemaSeparationLine_1.SchemaArrayItemSeparationLine, { schema: schema, index: i, onChange: onChange, isLast: i === localValue.value.length - 1, showAddButton: true })
|
|
85
|
+
] }, `${i}${localValue.keyStabilityRevision}`));
|
|
86
|
+
}), value.length === 0 ? (jsx_runtime_1.jsx(SchemaSeparationLine_1.SchemaArrayItemSeparationLine, { schema: schema, index: 0, onChange: onChange, isLast: true, showAddButton: true })) : null] }) })) : null, jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })
|
|
87
|
+
] }));
|
|
84
88
|
};
|
|
85
89
|
exports.ZodArrayEditor = ZodArrayEditor;
|
|
@@ -28,6 +28,6 @@ const ZodArrayItemEditor = ({ def, onChange, jsonPath, index, value, defaultValu
|
|
|
28
28
|
...oldV.slice(index + 1),
|
|
29
29
|
], false, false);
|
|
30
30
|
}, [index, onSaveObject]);
|
|
31
|
-
return (
|
|
31
|
+
return (jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { jsonPath: newJsonPath, schema: def.type, value: value, setValue: setValue, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: mayRemove ? onRemove : null, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }) }));
|
|
32
32
|
};
|
|
33
33
|
exports.ZodArrayItemEditor = ZodArrayItemEditor;
|
|
@@ -23,6 +23,8 @@ const ZodBooleanEditor = ({ schema, jsonPath, value, setValue, onSave, defaultVa
|
|
|
23
23
|
const save = (0, react_1.useCallback)(() => {
|
|
24
24
|
onSave(() => value, false, false);
|
|
25
25
|
}, [onSave, value]);
|
|
26
|
-
return (
|
|
26
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [
|
|
27
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, isDefaultValue: localValue.value === defaultValue, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, valid: true, saveDisabledByParent: saveDisabledByParent, suffix: null }), jsx_runtime_1.jsx("div", { style: fullWidth, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { name: jsonPath.join('.'), checked: localValue.value, onChange: onToggle, disabled: false }) })
|
|
28
|
+
] }));
|
|
27
29
|
};
|
|
28
30
|
exports.ZodBooleanEditor = ZodBooleanEditor;
|
|
@@ -64,8 +64,14 @@ const ZodColorEditor = ({ jsonPath, value, setValue, showSaveButton, defaultValu
|
|
|
64
64
|
const newColor = (0, color_math_1.colorWithNewOpacity)(localValue.value, Math.round((Number(newValue) / 100) * 255), zodTypes);
|
|
65
65
|
onValueChange(() => newColor, false, false);
|
|
66
66
|
}, [localValue.value, onValueChange, zodTypes]);
|
|
67
|
-
return (
|
|
67
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [
|
|
68
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, isDefaultValue: localValue.value === defaultValue, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, valid: localValue.zodValidation.success, saveDisabledByParent: saveDisabledByParent, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
|
|
69
|
+
jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
|
|
70
|
+
jsx_runtime_1.jsx("div", { style: colorPicker, children: jsx_runtime_1.jsx(RemInputTypeColor_1.RemInputTypeColor, { type: "color", style: {
|
|
68
71
|
height: 39,
|
|
69
|
-
}, value: rgb, onChange: onChange, className: "__remotion_color_picker", status: status, name: jsonPath.join('.') }) }),
|
|
72
|
+
}, value: rgb, onChange: onChange, className: "__remotion_color_picker", status: status, name: jsonPath.join('.') }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1, block: true }), jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: localValue.value, status: status, placeholder: jsonPath.join('.'), onChange: onTextChange, rightAlign: false }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), 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 })
|
|
73
|
+
] }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })
|
|
74
|
+
] })
|
|
75
|
+
] }));
|
|
70
76
|
};
|
|
71
77
|
exports.ZodColorEditor = ZodColorEditor;
|
|
@@ -57,6 +57,10 @@ const ZodDateEditor = ({ jsonPath, value, setValue, showSaveButton, defaultValue
|
|
|
57
57
|
const save = (0, react_1.useCallback)(() => {
|
|
58
58
|
onSave(() => value, false, false);
|
|
59
59
|
}, [onSave, value]);
|
|
60
|
-
return (
|
|
60
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [
|
|
61
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, isDefaultValue: localValue.value.getTime() === defaultValue.getTime(), jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, valid: localValue.zodValidation.success, saveDisabledByParent: saveDisabledByParent, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
|
|
62
|
+
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 }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx("div", { style: explainer, children: "Date is in local format" }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })
|
|
63
|
+
] })
|
|
64
|
+
] }));
|
|
61
65
|
};
|
|
62
66
|
exports.ZodDateEditor = ZodDateEditor;
|
|
@@ -5,6 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const ZodSwitch_1 = require("./ZodSwitch");
|
|
6
6
|
const ZodDefaultEditor = ({ jsonPath, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, saving, saveDisabledByParent, mayPad, }) => {
|
|
7
7
|
const { innerType } = schema._def;
|
|
8
|
-
return (
|
|
8
|
+
return (jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { defaultValue: defaultValue, jsonPath: jsonPath, onRemove: onRemove, onSave: onSave, schema: innerType, setValue: setValue, showSaveButton: showSaveButton, value: value, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
9
9
|
};
|
|
10
10
|
exports.ZodDefaultEditor = ZodDefaultEditor;
|
|
@@ -32,7 +32,7 @@ const ZodDiscriminatedUnionEditor = ({ schema, setValue, showSaveButton, saving,
|
|
|
32
32
|
label: option,
|
|
33
33
|
id: option,
|
|
34
34
|
keyHint: null,
|
|
35
|
-
leftItem: option === value[typedSchema.discriminator] ?
|
|
35
|
+
leftItem: option === value[typedSchema.discriminator] ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
36
36
|
onClick: () => {
|
|
37
37
|
const val = (0, create_zod_values_1.createZodValues)(typedSchema.optionsMap.get(option), z, zodTypes);
|
|
38
38
|
setLocalValue(() => val, false, false);
|
|
@@ -57,8 +57,10 @@ const ZodDiscriminatedUnionEditor = ({ schema, setValue, showSaveButton, saving,
|
|
|
57
57
|
const discriminatedUnionReplacement = (0, react_1.useMemo)(() => {
|
|
58
58
|
return {
|
|
59
59
|
discriminator: typedSchema.discriminator,
|
|
60
|
-
markup: (
|
|
61
|
-
|
|
60
|
+
markup: (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: true, children: [
|
|
61
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, isDefaultValue: localValue.value[typedSchema.discriminator] ===
|
|
62
|
+
defaultValue[typedSchema.discriminator], jsonPath: [...jsonPath, typedSchema.discriminator], onRemove: onRemove, onReset: reset, onSave: save, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, suffix: null, valid: localValue.zodValidation.success }), jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: "Select type", values: comboBoxValues, selectedId: value[typedSchema.discriminator] })
|
|
63
|
+
] }, 'replacement')),
|
|
62
64
|
};
|
|
63
65
|
}, [
|
|
64
66
|
comboBoxValues,
|
|
@@ -76,7 +78,7 @@ const ZodDiscriminatedUnionEditor = ({ schema, setValue, showSaveButton, saving,
|
|
|
76
78
|
typedSchema.discriminator,
|
|
77
79
|
value,
|
|
78
80
|
]);
|
|
79
|
-
return (
|
|
81
|
+
return (jsx_runtime_1.jsx(ZodObjectEditor_1.ZodObjectEditor
|
|
80
82
|
// Re-render the object editor when the discriminator changes
|
|
81
83
|
, { jsonPath: jsonPath, mayPad: mayPad, savedValue: defaultValue, onRemove: onRemove, onSave: onSave, saveDisabledByParent: saveDisabledByParent, saving: saving, schema: typedSchema.optionsMap.get(value[typedSchema.discriminator]), setValue: setLocalValue, showSaveButton: showSaveButton, unsavedValue: value, discriminatedUnionReplacement: discriminatedUnionReplacement }, value[typedSchema.discriminator]));
|
|
82
84
|
};
|
|
@@ -26,6 +26,8 @@ const ZodEffectEditor = ({ schema, jsonPath, value, setValue: updateValue, defau
|
|
|
26
26
|
if (typeName !== z.ZodFirstPartyTypeKind.ZodEffects) {
|
|
27
27
|
throw new Error('expected effect');
|
|
28
28
|
}
|
|
29
|
-
return (
|
|
29
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [
|
|
30
|
+
jsx_runtime_1.jsx("div", { style: fullWidth, children: jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { value: value, setValue: onChange, jsonPath: jsonPath, schema: def.schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: !localValue.zodValidation.success, mayPad: false }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })
|
|
31
|
+
] }));
|
|
30
32
|
};
|
|
31
33
|
exports.ZodEffectEditor = ZodEffectEditor;
|
|
@@ -37,7 +37,7 @@ const ZodEnumEditor = ({ schema, jsonPath, setValue, defaultValue, value, onSave
|
|
|
37
37
|
label: option,
|
|
38
38
|
id: option,
|
|
39
39
|
keyHint: null,
|
|
40
|
-
leftItem: option === value ?
|
|
40
|
+
leftItem: option === value ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
41
41
|
onClick: (id) => {
|
|
42
42
|
setLocalValue(() => id, false, false);
|
|
43
43
|
},
|
|
@@ -50,6 +50,8 @@ const ZodEnumEditor = ({ schema, jsonPath, setValue, defaultValue, value, onSave
|
|
|
50
50
|
const save = (0, react_1.useCallback)(() => {
|
|
51
51
|
onSave(() => value, false, false);
|
|
52
52
|
}, [onSave, value]);
|
|
53
|
-
return (
|
|
53
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: true, success: localValue.zodValidation.success, children: [
|
|
54
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, onSave: save, showSaveButton: showSaveButton, isDefaultValue: localValue.value === defaultValue, onReset: reset, jsonPath: jsonPath, onRemove: onRemove, saving: saving, valid: localValue.zodValidation.success, saveDisabledByParent: !localValue.zodValidation.success, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })
|
|
55
|
+
] }));
|
|
54
56
|
};
|
|
55
57
|
exports.ZodEnumEditor = ZodEnumEditor;
|
|
@@ -37,12 +37,14 @@ const ZodErrorMessages = ({ zodValidationResult, viewTab }) => {
|
|
|
37
37
|
};
|
|
38
38
|
}, []);
|
|
39
39
|
if (viewTab === 'json') {
|
|
40
|
-
return (
|
|
41
|
-
return (
|
|
40
|
+
return (jsx_runtime_1.jsx("div", { children: zodValidationResult.error.errors.map((error) => {
|
|
41
|
+
return (jsx_runtime_1.jsxs("div", { style: style, children: [
|
|
42
|
+
jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: triangleStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), error.path.length === 0 ? 'Root' : error.path.join('.'), ":", ' ', error.message] }, error.path.join('.')));
|
|
42
43
|
}) }));
|
|
43
44
|
}
|
|
44
|
-
return (
|
|
45
|
-
return (
|
|
45
|
+
return (jsx_runtime_1.jsx("div", { children: zodValidationResult.error.errors.map((error) => {
|
|
46
|
+
return (jsx_runtime_1.jsxs("div", { style: style, children: ["-", ' ', jsx_runtime_1.jsx("code", { style: code, children: error.path.length === 0 ? 'Root' : error.path.join('.') }),
|
|
47
|
+
": ", error.message] }, error.path.join('.')));
|
|
46
48
|
}) }));
|
|
47
49
|
};
|
|
48
50
|
exports.ZodErrorMessages = ZodErrorMessages;
|
|
@@ -20,8 +20,14 @@ const ZodFieldValidation = ({ localValue, path }) => {
|
|
|
20
20
|
if (localValue.zodValidation.success) {
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
|
-
return (
|
|
23
|
+
return (jsx_runtime_1.jsxs("div", { style: legend, children: [
|
|
24
|
+
jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: localValue.zodValidation.error.format()._errors[0], type: "error" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InfoBubble_1.InfoBubble, { title: "Zod validation failure", children: jsx_runtime_1.jsxs("div", { style: stackTrace, children: [
|
|
25
|
+
jsx_runtime_1.jsx("div", { style: stackTraceLabel, children: "Zod Validation has failed:" }), localValue.zodValidation.error.errors.map((error, index) => (
|
|
24
26
|
// eslint-disable-next-line react/no-array-index-key
|
|
25
|
-
|
|
27
|
+
jsx_runtime_1.jsxs("div", { style: stackTraceLabel, children: ["Type: ", error.code, " ",
|
|
28
|
+
jsx_runtime_1.jsx("br", {}),
|
|
29
|
+
"Message: ", error.message, jsx_runtime_1.jsx("br", {}),
|
|
30
|
+
"Path: ", path.join('.')] }, index)))] }) }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 })
|
|
31
|
+
] }));
|
|
26
32
|
};
|
|
27
33
|
exports.ZodFieldValidation = ZodFieldValidation;
|
|
@@ -83,16 +83,18 @@ const ZodMatrixEditor = ({ schema, jsonPath, setValue, defaultValue, value, onSa
|
|
|
83
83
|
return acc;
|
|
84
84
|
}, []);
|
|
85
85
|
}, [localValue.value, dimensions]);
|
|
86
|
-
return (
|
|
86
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [
|
|
87
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { onReset: reset, isDefaultValue: isDefaultValue, jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, onSave: () => {
|
|
87
88
|
onSave(() => localValue.value, false, false);
|
|
88
|
-
}, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, valid: localValue.zodValidation.success, handleClick: () => setExpanded(!expanded) }), expanded ? (
|
|
89
|
-
return (
|
|
89
|
+
}, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, valid: localValue.zodValidation.success, handleClick: () => setExpanded(!expanded) }), expanded ? (jsx_runtime_1.jsx(RevisionContextProvider, { children: jsx_runtime_1.jsxs(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [chunkedItems.map((row, rowIndex) => {
|
|
90
|
+
return (jsx_runtime_1.jsx(react_1.default.Fragment
|
|
90
91
|
// eslint-disable-next-line react/no-array-index-key
|
|
91
|
-
, { children:
|
|
92
|
+
, { children: jsx_runtime_1.jsx("div", { style: rowStyle, children: row.map((item, _index) => {
|
|
92
93
|
var _a;
|
|
93
94
|
const actualIndex = rowIndex * dimensions + _index;
|
|
94
|
-
return (
|
|
95
|
+
return (jsx_runtime_1.jsx("div", { style: { flex: 1 }, children: jsx_runtime_1.jsx(ZodArrayItemEditor_1.ZodArrayItemEditor, { onChange: onChange, value: item, def: def, index: actualIndex, jsonPath: jsonPath, defaultValue: (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue[actualIndex]) !== null && _a !== void 0 ? _a : (0, create_zod_values_1.createZodValues)(def.type, z, zodTypes), onSave: onSave, showSaveButton: showSaveButton, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad, mayRemove: false }) }, `${_index}${localValue.keyStabilityRevision}`));
|
|
95
96
|
}) }) }, `${rowIndex}${localValue.keyStabilityRevision}`));
|
|
96
|
-
}), value.length === 0 ? (
|
|
97
|
+
}), value.length === 0 ? (jsx_runtime_1.jsx(SchemaSeparationLine_1.SchemaArrayItemSeparationLine, { schema: schema, index: 0, onChange: onChange, isLast: true, showAddButton: true })) : null] }) })) : null, jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })
|
|
98
|
+
] }));
|
|
97
99
|
};
|
|
98
100
|
exports.ZodMatrixEditor = ZodMatrixEditor;
|
|
@@ -22,6 +22,8 @@ const wideEmptyLabel = {
|
|
|
22
22
|
const ZonNonEditableValue = ({ jsonPath, label, showSaveButton, saving, mayPad }) => {
|
|
23
23
|
const save = (0, react_1.useCallback)(() => undefined, []);
|
|
24
24
|
const reset = (0, react_1.useCallback)(() => undefined, []);
|
|
25
|
-
return (
|
|
25
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: true, children: [
|
|
26
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, isDefaultValue: true, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: null, saving: saving, valid: true, saveDisabledByParent: true, suffix: null }), jsx_runtime_1.jsx("div", { style: fullWidth, children: jsx_runtime_1.jsx("em", { style: wideEmptyLabel, children: label }) })
|
|
27
|
+
] }));
|
|
26
28
|
};
|
|
27
29
|
exports.ZonNonEditableValue = ZonNonEditableValue;
|
|
@@ -5,6 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const ZodOrNullishEditor_1 = require("./ZodOrNullishEditor");
|
|
6
6
|
const ZodNullableEditor = ({ jsonPath, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, saving, saveDisabledByParent, mayPad, }) => {
|
|
7
7
|
const { innerType } = schema._def;
|
|
8
|
-
return (
|
|
8
|
+
return (jsx_runtime_1.jsx(ZodOrNullishEditor_1.ZodOrNullishEditor, { defaultValue: defaultValue, jsonPath: jsonPath, onRemove: onRemove, onSave: onSave, schema: schema, innerSchema: innerType, setValue: setValue, showSaveButton: showSaveButton, value: value, nullishValue: null, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
9
9
|
};
|
|
10
10
|
exports.ZodNullableEditor = ZodNullableEditor;
|
|
@@ -64,6 +64,10 @@ const ZodNumberEditor = ({ jsonPath, value, schema, setValue, onSave, defaultVal
|
|
|
64
64
|
const save = (0, react_1.useCallback)(() => {
|
|
65
65
|
onSave(() => value, false, false);
|
|
66
66
|
}, [onSave, value]);
|
|
67
|
-
return (
|
|
67
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [
|
|
68
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, isDefaultValue: isDefault, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, valid: localValue.zodValidation.success, saveDisabledByParent: saveDisabledByParent, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
|
|
69
|
+
jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: 'number', value: localValue.value, style: fullWidth, status: localValue.zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onTextChange: onTextChange, onValueChange: onNumberChange, min: getMinValue(schema), max: getMaxValue(schema), step: getStep(schema), rightAlign: false }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })
|
|
70
|
+
] })
|
|
71
|
+
] }));
|
|
68
72
|
};
|
|
69
73
|
exports.ZodNumberEditor = ZodNumberEditor;
|
|
@@ -71,16 +71,17 @@ const ZodObjectEditor = ({ schema, jsonPath, setValue, unsavedValue, savedValue,
|
|
|
71
71
|
const suffix = (0, react_1.useMemo)(() => {
|
|
72
72
|
return expanded ? ' {' : ' {...}';
|
|
73
73
|
}, [expanded]);
|
|
74
|
-
return (
|
|
74
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: !isRoot && mayPad, success: localValue.zodValidation.success, children: [isRoot ? null : (jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { isDefaultValue: isDefaultValue, onReset: reset, jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, onSave: () => {
|
|
75
75
|
onSave(() => {
|
|
76
76
|
return localValue.value;
|
|
77
77
|
}, false, false);
|
|
78
|
-
}, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, valid: localValue.zodValidation.success, handleClick: () => setExpanded(!expanded) })), expanded ? (
|
|
78
|
+
}, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, valid: localValue.zodValidation.success, handleClick: () => setExpanded(!expanded) })), expanded ? (jsx_runtime_1.jsx(RevisionContextProvider, { children: jsx_runtime_1.jsx(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: isRoot, children: keys.map((key, i) => {
|
|
79
79
|
if (discriminatedUnionReplacement &&
|
|
80
80
|
key === discriminatedUnionReplacement.discriminator) {
|
|
81
81
|
return discriminatedUnionReplacement.markup;
|
|
82
82
|
}
|
|
83
|
-
return (
|
|
83
|
+
return (jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [
|
|
84
|
+
jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { mayPad: true, jsonPath: [...jsonPath, key], schema: shape[key], value: localValue.value[key],
|
|
84
85
|
// In case of null | {a: string, b: string} type, we need to fallback to the default value
|
|
85
86
|
defaultValue: (savedValue !== null && savedValue !== void 0 ? savedValue : unsavedValue)[key], setValue: (val, forceApply) => {
|
|
86
87
|
onChange((oldVal) => {
|
|
@@ -100,7 +101,7 @@ const ZodObjectEditor = ({ schema, jsonPath, setValue, unsavedValue, savedValue,
|
|
|
100
101
|
: val,
|
|
101
102
|
};
|
|
102
103
|
}, forceApply, false);
|
|
103
|
-
}, onRemove: null, showSaveButton: showSaveButton, saving: saving, saveDisabledByParent: saveDisabledByParent }), i === keys.length - 1 ? null :
|
|
104
|
-
}) }) })) : null, isRoot || !expanded ? null :
|
|
104
|
+
}, onRemove: null, showSaveButton: showSaveButton, saving: saving, saveDisabledByParent: saveDisabledByParent }), i === keys.length - 1 ? null : jsx_runtime_1.jsx(SchemaSeparationLine_1.SchemaSeparationLine, {})] }, key));
|
|
105
|
+
}) }) })) : null, isRoot || !expanded ? null : jsx_runtime_1.jsx("div", { style: layout_1.fieldsetLabel, children: '}' })] }));
|
|
105
106
|
};
|
|
106
107
|
exports.ZodObjectEditor = ZodObjectEditor;
|
|
@@ -5,6 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const ZodOrNullishEditor_1 = require("./ZodOrNullishEditor");
|
|
6
6
|
const ZodOptionalEditor = ({ jsonPath, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, saving, saveDisabledByParent, mayPad, }) => {
|
|
7
7
|
const { innerType } = schema._def;
|
|
8
|
-
return (
|
|
8
|
+
return (jsx_runtime_1.jsx(ZodOrNullishEditor_1.ZodOrNullishEditor, { defaultValue: defaultValue, jsonPath: jsonPath, onRemove: onRemove, onSave: onSave, schema: schema, setValue: setValue, showSaveButton: showSaveButton, value: value, nullishValue: undefined, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad, innerSchema: innerType }));
|
|
9
9
|
};
|
|
10
10
|
exports.ZodOptionalEditor = ZodOptionalEditor;
|
|
@@ -45,6 +45,9 @@ const ZodOrNullishEditor = ({ jsonPath, schema, setValue, onSave, defaultValue,
|
|
|
45
45
|
const save = (0, react_1.useCallback)(() => {
|
|
46
46
|
onSave(() => value, false, false);
|
|
47
47
|
}, [onSave, value]);
|
|
48
|
-
return (
|
|
48
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [localValue.value === nullishValue ? (jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, isDefaultValue: localValue.value === defaultValue, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, valid: localValue.zodValidation.success, saveDisabledByParent: saveDisabledByParent, suffix: null })) : (jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { value: localValue.value, setValue: setLocalValue, jsonPath: jsonPath, schema: innerSchema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: false })), jsx_runtime_1.jsxs("div", { style: checkBoxWrapper, children: [
|
|
49
|
+
jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: isChecked, onChange: onCheckBoxChange, disabled: false, name: jsonPath.join('.') }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: labelStyle, children: String(nullishValue) })
|
|
50
|
+
] })
|
|
51
|
+
] }));
|
|
49
52
|
};
|
|
50
53
|
exports.ZodOrNullishEditor = ZodOrNullishEditor;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ZodStaticFileEditor = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const get_static_files_1 = require("../../../api/get-static-files");
|
|
7
6
|
const Checkmark_1 = require("../../../icons/Checkmark");
|
|
8
7
|
const ComboBox_1 = require("../../NewComposition/ComboBox");
|
|
9
8
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
9
|
+
const use_static_files_1 = require("../../use-static-files");
|
|
10
10
|
const Fieldset_1 = require("./Fieldset");
|
|
11
11
|
const SchemaLabel_1 = require("./SchemaLabel");
|
|
12
12
|
const ZodFieldValidation_1 = require("./ZodFieldValidation");
|
|
@@ -31,14 +31,15 @@ const ZodStaticFileEditor = ({ schema, jsonPath, setValue, defaultValue, value,
|
|
|
31
31
|
throw new Error('expected enum');
|
|
32
32
|
}
|
|
33
33
|
const isRoot = jsonPath.length === 0;
|
|
34
|
+
const staticFiles = (0, use_static_files_1.useStaticFiles)();
|
|
34
35
|
const comboBoxValues = (0, react_1.useMemo)(() => {
|
|
35
|
-
return
|
|
36
|
+
return staticFiles.map((option) => {
|
|
36
37
|
return {
|
|
37
38
|
value: option.src,
|
|
38
39
|
label: option.name,
|
|
39
40
|
id: option.src,
|
|
40
41
|
keyHint: null,
|
|
41
|
-
leftItem: option.src === value ?
|
|
42
|
+
leftItem: option.src === value ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
42
43
|
onClick: (id) => {
|
|
43
44
|
setLocalValue(() => id, false, false);
|
|
44
45
|
},
|
|
@@ -47,10 +48,12 @@ const ZodStaticFileEditor = ({ schema, jsonPath, setValue, defaultValue, value,
|
|
|
47
48
|
type: 'item',
|
|
48
49
|
};
|
|
49
50
|
});
|
|
50
|
-
}, [setLocalValue, value]);
|
|
51
|
+
}, [setLocalValue, staticFiles, value]);
|
|
51
52
|
const save = (0, react_1.useCallback)(() => {
|
|
52
53
|
onSave(() => value);
|
|
53
54
|
}, [onSave, value]);
|
|
54
|
-
return (
|
|
55
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [
|
|
56
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, onSave: save, showSaveButton: showSaveButton, isDefaultValue: localValue.value === defaultValue, onReset: reset, jsonPath: jsonPath, onRemove: onRemove, saving: saving, valid: localValue.zodValidation.success, saveDisabledByParent: saveDisabledByParent, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: localValue.value, title: value }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })
|
|
57
|
+
] }));
|
|
55
58
|
};
|
|
56
59
|
exports.ZodStaticFileEditor = ZodStaticFileEditor;
|
|
@@ -29,6 +29,10 @@ const ZodStringEditor = ({ jsonPath, value, setValue, showSaveButton, defaultVal
|
|
|
29
29
|
const save = (0, react_1.useCallback)(() => {
|
|
30
30
|
onSave(() => value, false, false);
|
|
31
31
|
}, [onSave, value]);
|
|
32
|
-
return (
|
|
32
|
+
return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, success: false, children: [
|
|
33
|
+
jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, isDefaultValue: localValue.value === defaultValue, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, valid: localValue.zodValidation.success, saveDisabledByParent: saveDisabledByParent, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
|
|
34
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: localValue.value, status: localValue.zodValidation ? 'ok' : 'error', placeholder: jsonPath.join('.'), onChange: onChange, rightAlign: false, name: jsonPath.join('.') }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })
|
|
35
|
+
] })
|
|
36
|
+
] }));
|
|
33
37
|
};
|
|
34
38
|
exports.ZodStringEditor = ZodStringEditor;
|