@remotion/cli 4.0.0-alpha.217 → 4.0.0-alpha4

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.
Files changed (475) hide show
  1. package/dist/ansi/ansi-diff.d.ts +1 -2
  2. package/dist/ansi/ansi-diff.js +20 -14
  3. package/dist/ansi/ansi-split.d.ts +0 -1
  4. package/dist/ansi/ansi-split.js +3 -16
  5. package/dist/benchmark.js +23 -64
  6. package/dist/composition-prompts.d.ts +4 -3
  7. package/dist/composition-prompts.js +1 -0
  8. package/dist/compositions.js +4 -10
  9. package/dist/config/bitrate.d.ts +2 -2
  10. package/dist/config/bitrate.js +2 -2
  11. package/dist/config/browser.d.ts +3 -1
  12. package/dist/config/browser.js +12 -2
  13. package/dist/config/codec.d.ts +4 -0
  14. package/dist/config/codec.js +21 -1
  15. package/dist/config/image-format.d.ts +3 -5
  16. package/dist/config/image-format.js +10 -32
  17. package/dist/config/index.d.ts +14 -255
  18. package/dist/config/index.js +49 -16
  19. package/dist/config/public-dir.d.ts +1 -1
  20. package/dist/config/scale.d.ts +1 -2
  21. package/dist/determine-image-format.d.ts +4 -5
  22. package/dist/determine-image-format.js +4 -17
  23. package/dist/download-progress.d.ts +2 -2
  24. package/dist/download-progress.js +3 -11
  25. package/dist/editor/components/Canvas.js +0 -3
  26. package/dist/editor/components/CompositionSelector.js +4 -2
  27. package/dist/editor/components/CompositionSelectorItem.d.ts +3 -3
  28. package/dist/editor/components/CompositionSelectorItem.js +6 -24
  29. package/dist/editor/components/CurrentComposition.js +19 -4
  30. package/dist/editor/components/Editor.js +11 -2
  31. package/dist/editor/components/EditorContent.js +1 -1
  32. package/dist/editor/components/EditorContexts.js +86 -10
  33. package/dist/editor/components/GlobalKeybindings.js +0 -4
  34. package/dist/editor/components/InitialCompositionLoader.d.ts +2 -2
  35. package/dist/editor/components/KeyboardShortcutsExplainer.js +4 -5
  36. package/dist/editor/components/Menu/MenuSubItem.d.ts +1 -0
  37. package/dist/editor/components/Menu/MenuSubItem.js +3 -15
  38. package/dist/editor/components/Menu/is-menu-item.d.ts +0 -2
  39. package/dist/editor/components/Menu/is-menu-item.js +1 -3
  40. package/dist/editor/components/Menu/styles.d.ts +0 -4
  41. package/dist/editor/components/Menu/styles.js +4 -13
  42. package/dist/editor/components/MenuToolbar.js +1 -2
  43. package/dist/editor/components/ModalContainer.d.ts +0 -2
  44. package/dist/editor/components/ModalContainer.js +3 -12
  45. package/dist/editor/components/ModalHeader.js +2 -6
  46. package/dist/editor/components/NewComposition/CancelButton.js +0 -3
  47. package/dist/editor/components/NewComposition/ComboBox.js +15 -23
  48. package/dist/editor/components/NewComposition/InputDragger.d.ts +0 -4
  49. package/dist/editor/components/NewComposition/InputDragger.js +7 -12
  50. package/dist/editor/components/NewComposition/MenuContent.js +1 -14
  51. package/dist/editor/components/NewComposition/NewCompDuration.js +2 -2
  52. package/dist/editor/components/NewComposition/NewComposition.js +5 -8
  53. package/dist/editor/components/NewComposition/RemInput.d.ts +2 -14
  54. package/dist/editor/components/NewComposition/RemInput.js +9 -24
  55. package/dist/editor/components/NewComposition/ValidationMessage.d.ts +0 -2
  56. package/dist/editor/components/NewComposition/ValidationMessage.js +8 -18
  57. package/dist/editor/components/Notifications/NotificationCenter.d.ts +0 -1
  58. package/dist/editor/components/Notifications/NotificationCenter.js +1 -11
  59. package/dist/editor/components/Notifications/ServerDisconnected.d.ts +4 -0
  60. package/dist/editor/components/Notifications/ServerDisconnected.js +14 -4
  61. package/dist/editor/components/PlayPause.js +0 -6
  62. package/dist/editor/components/PlaybackKeyboardShortcutsManager.js +0 -3
  63. package/dist/editor/components/PlaybackRateSelector.d.ts +2 -0
  64. package/dist/editor/components/PlaybackRateSelector.js +6 -5
  65. package/dist/editor/components/Preview.d.ts +1 -0
  66. package/dist/editor/components/Preview.js +4 -4
  67. package/dist/editor/components/PreviewToolbar.js +2 -2
  68. package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.js +3 -8
  69. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +2 -4
  70. package/dist/editor/components/QuickSwitcher/algolia-search.d.ts +27 -0
  71. package/dist/editor/components/QuickSwitcher/algolia-search.js +3 -2
  72. package/dist/editor/components/SizeSelector.d.ts +1 -0
  73. package/dist/editor/components/SizeSelector.js +3 -3
  74. package/dist/editor/components/Splitter/SplitterHandle.d.ts +2 -1
  75. package/dist/editor/components/Splitter/SplitterHandle.js +7 -15
  76. package/dist/editor/components/Timeline/MaxTimelineTracks.js +1 -1
  77. package/dist/editor/components/Timeline/Timeline.js +1 -1
  78. package/dist/editor/components/Timeline/TimelineCollapseToggle.d.ts +0 -1
  79. package/dist/editor/components/Timeline/TimelineCollapseToggle.js +5 -4
  80. package/dist/editor/components/Timeline/TimelineListItem.js +1 -2
  81. package/dist/editor/components/Timeline/TimelineScrollable.js +1 -2
  82. package/dist/editor/components/Timeline/TimelineSequence.js +14 -2
  83. package/dist/editor/components/Timeline/TimelineSequenceFrame.js +1 -2
  84. package/dist/editor/components/Timeline/TimelineZoomControls.js +5 -2
  85. package/dist/editor/components/Timeline/imperative-state.d.ts +4 -0
  86. package/dist/editor/components/Timeline/imperative-state.js +13 -13
  87. package/dist/editor/components/Timeline/is-collapsed.js +3 -2
  88. package/dist/editor/components/Timeline/timeline-scroll-logic.d.ts +1 -0
  89. package/dist/editor/components/Timeline/timeline-scroll-logic.js +6 -5
  90. package/dist/editor/components/TimelineInOutToggle.js +0 -3
  91. package/dist/editor/components/TopPanel.d.ts +0 -1
  92. package/dist/editor/components/TopPanel.js +16 -30
  93. package/dist/editor/components/ZoomPersistor.d.ts +1 -0
  94. package/dist/editor/components/ZoomPersistor.js +3 -2
  95. package/dist/editor/components/layout.d.ts +1 -3
  96. package/dist/editor/components/layout.js +7 -9
  97. package/dist/editor/helpers/calculate-timeline.d.ts +4 -0
  98. package/dist/editor/helpers/colors.d.ts +1 -3
  99. package/dist/editor/helpers/colors.js +3 -6
  100. package/dist/editor/helpers/create-folder-tree.d.ts +3 -2
  101. package/dist/editor/helpers/create-folder-tree.js +4 -3
  102. package/dist/editor/helpers/get-timeline-sequence-layout.d.ts +2 -2
  103. package/dist/editor/helpers/get-timeline-sequence-sort-key.d.ts +1 -2
  104. package/dist/editor/helpers/is-composition-still.d.ts +2 -2
  105. package/dist/editor/helpers/is-composition-still.js +0 -3
  106. package/dist/editor/helpers/use-keybinding.d.ts +0 -1
  107. package/dist/editor/helpers/use-keybinding.js +0 -9
  108. package/dist/editor/helpers/use-menu-structure.js +51 -99
  109. package/dist/editor/helpers/validate-new-comp-data.d.ts +2 -2
  110. package/dist/editor/icons/Checkmark.js +1 -1
  111. package/dist/editor/icons/caret.d.ts +1 -4
  112. package/dist/editor/icons/caret.js +1 -17
  113. package/dist/editor/icons/folder.d.ts +2 -6
  114. package/dist/editor/icons/folder.js +4 -4
  115. package/dist/editor/icons/still.d.ts +1 -3
  116. package/dist/editor/icons/still.js +2 -2
  117. package/dist/editor/state/keybindings.d.ts +1 -2
  118. package/dist/editor/state/modals.d.ts +0 -38
  119. package/dist/editor/state/preview-size.d.ts +1 -0
  120. package/dist/editor/state/preview-size.js +4 -3
  121. package/dist/editor/state/sidebar.d.ts +3 -7
  122. package/dist/editor/state/sidebar.js +13 -42
  123. package/dist/editor/state/timeline-ref.d.ts +1 -2
  124. package/dist/editor/state/z-index.d.ts +5 -0
  125. package/dist/editor/state/z-index.js +6 -16
  126. package/dist/event-source-events.d.ts +0 -15
  127. package/dist/event-source.d.ts +0 -2
  128. package/dist/event-source.js +5 -31
  129. package/dist/get-cli-options.d.ts +12 -3
  130. package/dist/get-cli-options.js +60 -7
  131. package/dist/get-composition-id.d.ts +3 -7
  132. package/dist/get-composition-id.js +3 -17
  133. package/dist/get-composition-with-dimension-override.d.ts +4 -5
  134. package/dist/get-composition-with-dimension-override.js +2 -6
  135. package/dist/get-config-file-name.d.ts +2 -0
  136. package/dist/get-config-file-name.js +7 -7
  137. package/dist/get-env.d.ts +1 -1
  138. package/dist/get-env.js +48 -39
  139. package/dist/get-filename.d.ts +1 -5
  140. package/dist/get-filename.js +4 -6
  141. package/dist/get-final-output-codec.d.ts +1 -2
  142. package/dist/get-final-output-codec.js +1 -4
  143. package/dist/get-input-props.d.ts +5 -1
  144. package/dist/get-input-props.js +13 -11
  145. package/dist/image-formats.d.ts +2 -5
  146. package/dist/image-formats.js +6 -16
  147. package/dist/index.d.ts +22 -91
  148. package/dist/index.js +13 -12
  149. package/dist/list-of-remotion-packages.js +0 -1
  150. package/dist/load-config.js +1 -1
  151. package/dist/log.d.ts +0 -14
  152. package/dist/log.js +8 -24
  153. package/dist/parse-command-line.d.ts +5 -5
  154. package/dist/parse-command-line.js +14 -6
  155. package/dist/preview-server/dev-middleware/middleware.d.ts +1 -0
  156. package/dist/preview-server/dev-middleware/middleware.js +2 -1
  157. package/dist/preview-server/error-overlay/remotion-overlay/AskOnDiscord.js +0 -1
  158. package/dist/preview-server/error-overlay/remotion-overlay/Button.d.ts +4 -8
  159. package/dist/preview-server/error-overlay/remotion-overlay/Button.js +8 -12
  160. package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.js +1 -2
  161. package/dist/preview-server/error-overlay/remotion-overlay/HelpLink.js +0 -1
  162. package/dist/preview-server/error-overlay/remotion-overlay/OpenInEditor.js +0 -1
  163. package/dist/preview-server/error-overlay/remotion-overlay/SearchGitHubIssues.js +0 -1
  164. package/dist/preview-server/error-overlay/remotion-overlay/ShortcutHint.js +1 -16
  165. package/dist/preview-server/hot-middleware/client.js +2 -2
  166. package/dist/preview-server/live-events.d.ts +0 -2
  167. package/dist/preview-server/live-events.js +2 -22
  168. package/dist/preview-server/public-folder.d.ts +5 -0
  169. package/dist/preview-server/public-folder.js +4 -3
  170. package/dist/preview-server/routes.d.ts +1 -2
  171. package/dist/preview-server/routes.js +13 -71
  172. package/dist/preview-server/start-server.js +0 -1
  173. package/dist/preview.js +21 -8
  174. package/dist/previewEntry.js +3 -2
  175. package/dist/print-compositions.d.ts +2 -2
  176. package/dist/print-error.js +2 -4
  177. package/dist/print-help.js +8 -4
  178. package/dist/progress-bar.d.ts +37 -17
  179. package/dist/progress-bar.js +41 -102
  180. package/dist/render.js +232 -42
  181. package/dist/select-composition.d.ts +1 -2
  182. package/dist/setup-cache.d.ts +9 -12
  183. package/dist/setup-cache.js +20 -29
  184. package/dist/still.js +130 -25
  185. package/dist/user-passed-output-location.js +7 -2
  186. package/package.json +72 -88
  187. package/styles/styles.css +3 -13
  188. package/dist/codemods/update-default-props.d.ts +0 -5
  189. package/dist/codemods/update-default-props.js +0 -143
  190. package/dist/color-math.d.ts +0 -2
  191. package/dist/color-math.js +0 -11
  192. package/dist/config/jpeg-quality.d.ts +0 -2
  193. package/dist/config/jpeg-quality.js +0 -17
  194. package/dist/convert-entry-point-to-serve-url.d.ts +0 -1
  195. package/dist/convert-entry-point-to-serve-url.js +0 -15
  196. package/dist/editor/components/Checkbox.d.ts +0 -6
  197. package/dist/editor/components/Checkbox.js +0 -42
  198. package/dist/editor/components/CheckerboardProvider.d.ts +0 -4
  199. package/dist/editor/components/CheckerboardProvider.js +0 -24
  200. package/dist/editor/components/CollapsableOptions.d.ts +0 -6
  201. package/dist/editor/components/CollapsableOptions.js +0 -35
  202. package/dist/editor/components/CurrentCompositionSideEffects.d.ts +0 -3
  203. package/dist/editor/components/CurrentCompositionSideEffects.js +0 -51
  204. package/dist/editor/components/InlineAction.d.ts +0 -5
  205. package/dist/editor/components/InlineAction.js +0 -35
  206. package/dist/editor/components/MediaVolumeProvider.d.ts +0 -4
  207. package/dist/editor/components/MediaVolumeProvider.js +0 -25
  208. package/dist/editor/components/Modals.d.ts +0 -2
  209. package/dist/editor/components/Modals.js +0 -23
  210. package/dist/editor/components/ModalsProvider.d.ts +0 -4
  211. package/dist/editor/components/ModalsProvider.js +0 -17
  212. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +0 -7
  213. package/dist/editor/components/NewComposition/RemInputTypeColor.js +0 -53
  214. package/dist/editor/components/NewComposition/RemTextarea.d.ts +0 -7
  215. package/dist/editor/components/NewComposition/RemTextarea.js +0 -92
  216. package/dist/editor/components/PlayerEmitterContext.d.ts +0 -4
  217. package/dist/editor/components/PlayerEmitterContext.js +0 -11
  218. package/dist/editor/components/RenderButton.d.ts +0 -6
  219. package/dist/editor/components/RenderButton.js +0 -80
  220. package/dist/editor/components/RenderModal/CliCopyButton.d.ts +0 -4
  221. package/dist/editor/components/RenderModal/CliCopyButton.js +0 -22
  222. package/dist/editor/components/RenderModal/CrfSetting.d.ts +0 -16
  223. package/dist/editor/components/RenderModal/CrfSetting.js +0 -43
  224. package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.d.ts +0 -8
  225. package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +0 -16
  226. package/dist/editor/components/RenderModal/EnvInput.d.ts +0 -11
  227. package/dist/editor/components/RenderModal/EnvInput.js +0 -74
  228. package/dist/editor/components/RenderModal/FrameRangeSetting.d.ts +0 -8
  229. package/dist/editor/components/RenderModal/FrameRangeSetting.js +0 -42
  230. package/dist/editor/components/RenderModal/GuiRenderStatus.d.ts +0 -5
  231. package/dist/editor/components/RenderModal/GuiRenderStatus.js +0 -78
  232. package/dist/editor/components/RenderModal/InfoBubble.d.ts +0 -5
  233. package/dist/editor/components/RenderModal/InfoBubble.js +0 -115
  234. package/dist/editor/components/RenderModal/InfoTooltip.d.ts +0 -5
  235. package/dist/editor/components/RenderModal/InfoTooltip.js +0 -40
  236. package/dist/editor/components/RenderModal/InlineEyeIcon.d.ts +0 -5
  237. package/dist/editor/components/RenderModal/InlineEyeIcon.js +0 -14
  238. package/dist/editor/components/RenderModal/InlineRemoveButton.d.ts +0 -4
  239. package/dist/editor/components/RenderModal/InlineRemoveButton.js +0 -12
  240. package/dist/editor/components/RenderModal/JpegQualitySetting.d.ts +0 -5
  241. package/dist/editor/components/RenderModal/JpegQualitySetting.js +0 -12
  242. package/dist/editor/components/RenderModal/MutedSetting.d.ts +0 -8
  243. package/dist/editor/components/RenderModal/MutedSetting.js +0 -16
  244. package/dist/editor/components/RenderModal/NumberOfLoopsSetting.d.ts +0 -5
  245. package/dist/editor/components/RenderModal/NumberOfLoopsSetting.js +0 -26
  246. package/dist/editor/components/RenderModal/NumberSetting.d.ts +0 -12
  247. package/dist/editor/components/RenderModal/NumberSetting.js +0 -29
  248. package/dist/editor/components/RenderModal/OptionExplainer.d.ts +0 -5
  249. package/dist/editor/components/RenderModal/OptionExplainer.js +0 -45
  250. package/dist/editor/components/RenderModal/RenderModal.d.ts +0 -35
  251. package/dist/editor/components/RenderModal/RenderModal.js +0 -575
  252. package/dist/editor/components/RenderModal/RenderModalAdvanced.d.ts +0 -26
  253. package/dist/editor/components/RenderModal/RenderModalAdvanced.js +0 -61
  254. package/dist/editor/components/RenderModal/RenderModalAudio.d.ts +0 -17
  255. package/dist/editor/components/RenderModal/RenderModalAudio.js +0 -46
  256. package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +0 -23
  257. package/dist/editor/components/RenderModal/RenderModalBasic.js +0 -79
  258. package/dist/editor/components/RenderModal/RenderModalData.d.ts +0 -9
  259. package/dist/editor/components/RenderModal/RenderModalData.js +0 -210
  260. package/dist/editor/components/RenderModal/RenderModalEnvironmentVariables.d.ts +0 -5
  261. package/dist/editor/components/RenderModal/RenderModalEnvironmentVariables.js +0 -55
  262. package/dist/editor/components/RenderModal/RenderModalGif.d.ts +0 -9
  263. package/dist/editor/components/RenderModal/RenderModalGif.js +0 -19
  264. package/dist/editor/components/RenderModal/RenderModalHr.d.ts +0 -2
  265. package/dist/editor/components/RenderModal/RenderModalHr.js +0 -18
  266. package/dist/editor/components/RenderModal/RenderModalInput.d.ts +0 -10
  267. package/dist/editor/components/RenderModal/RenderModalInput.js +0 -13
  268. package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.d.ts +0 -10
  269. package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.js +0 -118
  270. package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +0 -28
  271. package/dist/editor/components/RenderModal/RenderModalPicture.js +0 -56
  272. package/dist/editor/components/RenderModal/RenderStatusModal.d.ts +0 -4
  273. package/dist/editor/components/RenderModal/RenderStatusModal.js +0 -72
  274. package/dist/editor/components/RenderModal/ScaleSetting.d.ts +0 -5
  275. package/dist/editor/components/RenderModal/ScaleSetting.js +0 -17
  276. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +0 -12
  277. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +0 -39
  278. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEmptyStateGraphic.d.ts +0 -2
  279. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEmptyStateGraphic.js +0 -15
  280. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +0 -11
  281. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +0 -55
  282. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +0 -15
  283. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +0 -40
  284. package/dist/editor/components/RenderModal/SchemaEditor/SchemaResetButton.d.ts +0 -4
  285. package/dist/editor/components/RenderModal/SchemaEditor/SchemaResetButton.js +0 -12
  286. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.d.ts +0 -4
  287. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +0 -12
  288. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +0 -14
  289. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +0 -84
  290. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +0 -13
  291. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +0 -28
  292. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +0 -12
  293. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +0 -27
  294. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +0 -14
  295. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +0 -116
  296. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +0 -14
  297. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +0 -76
  298. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +0 -14
  299. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +0 -55
  300. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +0 -14
  301. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +0 -72
  302. package/dist/editor/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +0 -5
  303. package/dist/editor/components/RenderModal/SchemaEditor/ZodErrorMessages.js +0 -23
  304. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.d.ts +0 -8
  305. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +0 -27
  306. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +0 -14
  307. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +0 -10
  308. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +0 -14
  309. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +0 -88
  310. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +0 -14
  311. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +0 -64
  312. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +0 -14
  313. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +0 -10
  314. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +0 -15
  315. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +0 -52
  316. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +0 -14
  317. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +0 -48
  318. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +0 -14
  319. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -81
  320. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +0 -14
  321. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +0 -49
  322. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.d.ts +0 -2
  323. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.js +0 -158
  324. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.d.ts +0 -2
  325. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.js +0 -21
  326. package/dist/editor/components/RenderModal/SchemaEditor/get-schema-label.d.ts +0 -2
  327. package/dist/editor/components/RenderModal/SchemaEditor/get-schema-label.js +0 -15
  328. package/dist/editor/components/RenderModal/SchemaEditor/zod-types.d.ts +0 -1
  329. package/dist/editor/components/RenderModal/SchemaEditor/zod-types.js +0 -2
  330. package/dist/editor/components/RenderModal/WarningIndicatorButton.d.ts +0 -6
  331. package/dist/editor/components/RenderModal/WarningIndicatorButton.js +0 -49
  332. package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +0 -11
  333. package/dist/editor/components/RenderModal/get-render-modal-warnings.js +0 -26
  334. package/dist/editor/components/RenderModal/human-readable-audio-codecs.d.ts +0 -2
  335. package/dist/editor/components/RenderModal/human-readable-audio-codecs.js +0 -18
  336. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +0 -2
  337. package/dist/editor/components/RenderModal/human-readable-codec.js +0 -36
  338. package/dist/editor/components/RenderModal/layout.d.ts +0 -7
  339. package/dist/editor/components/RenderModal/layout.js +0 -45
  340. package/dist/editor/components/RenderModal/out-name-checker.d.ts +0 -14
  341. package/dist/editor/components/RenderModal/out-name-checker.js +0 -80
  342. package/dist/editor/components/RenderQueue/CircularProgress.d.ts +0 -5
  343. package/dist/editor/components/RenderQueue/CircularProgress.js +0 -18
  344. package/dist/editor/components/RenderQueue/RenderQueueError.d.ts +0 -5
  345. package/dist/editor/components/RenderQueue/RenderQueueError.js +0 -26
  346. package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +0 -5
  347. package/dist/editor/components/RenderQueue/RenderQueueItem.js +0 -40
  348. package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.d.ts +0 -5
  349. package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +0 -22
  350. package/dist/editor/components/RenderQueue/RenderQueueItemStatus.d.ts +0 -5
  351. package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +0 -43
  352. package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.d.ts +0 -5
  353. package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.js +0 -22
  354. package/dist/editor/components/RenderQueue/RenderQueueOutputName.d.ts +0 -5
  355. package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +0 -26
  356. package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.d.ts +0 -5
  357. package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.js +0 -26
  358. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.d.ts +0 -5
  359. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +0 -33
  360. package/dist/editor/components/RenderQueue/RenderQueueRepeat.d.ts +0 -5
  361. package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +0 -22
  362. package/dist/editor/components/RenderQueue/SuccessIcon.d.ts +0 -2
  363. package/dist/editor/components/RenderQueue/SuccessIcon.js +0 -14
  364. package/dist/editor/components/RenderQueue/actions.d.ts +0 -58
  365. package/dist/editor/components/RenderQueue/actions.js +0 -119
  366. package/dist/editor/components/RenderQueue/context.d.ts +0 -18
  367. package/dist/editor/components/RenderQueue/context.js +0 -49
  368. package/dist/editor/components/RenderQueue/index.d.ts +0 -2
  369. package/dist/editor/components/RenderQueue/index.js +0 -43
  370. package/dist/editor/components/RenderQueue/item-style.d.ts +0 -2
  371. package/dist/editor/components/RenderQueue/item-style.js +0 -21
  372. package/dist/editor/components/RenderToolbarIcon.d.ts +0 -2
  373. package/dist/editor/components/RenderToolbarIcon.js +0 -101
  374. package/dist/editor/components/RendersTab.d.ts +0 -6
  375. package/dist/editor/components/RendersTab.js +0 -43
  376. package/dist/editor/components/RightPanel.d.ts +0 -8
  377. package/dist/editor/components/RightPanel.js +0 -76
  378. package/dist/editor/components/SegmentedControl.d.ts +0 -11
  379. package/dist/editor/components/SegmentedControl.js +0 -62
  380. package/dist/editor/components/SetTimelineInOutProvider.d.ts +0 -4
  381. package/dist/editor/components/SetTimelineInOutProvider.js +0 -19
  382. package/dist/editor/components/SidebarCollapserControls.d.ts +0 -2
  383. package/dist/editor/components/SidebarCollapserControls.js +0 -122
  384. package/dist/editor/components/Tabs/index.d.ts +0 -11
  385. package/dist/editor/components/Tabs/index.js +0 -58
  386. package/dist/editor/components/Tabs/vertical.d.ts +0 -7
  387. package/dist/editor/components/Tabs/vertical.js +0 -43
  388. package/dist/editor/components/ZoomGesturesProvider.d.ts +0 -4
  389. package/dist/editor/components/ZoomGesturesProvider.js +0 -24
  390. package/dist/editor/components/get-zod-if-possible.d.ts +0 -10
  391. package/dist/editor/components/get-zod-if-possible.js +0 -79
  392. package/dist/editor/helpers/client-id.d.ts +0 -17
  393. package/dist/editor/helpers/client-id.js +0 -46
  394. package/dist/editor/helpers/convert-env-variables.d.ts +0 -2
  395. package/dist/editor/helpers/convert-env-variables.js +0 -20
  396. package/dist/editor/helpers/prores-labels.d.ts +0 -2
  397. package/dist/editor/helpers/prores-labels.js +0 -25
  398. package/dist/editor/helpers/render-modal-sections.d.ts +0 -10
  399. package/dist/editor/helpers/render-modal-sections.js +0 -32
  400. package/dist/editor/helpers/use-breakpoint.d.ts +0 -1
  401. package/dist/editor/helpers/use-breakpoint.js +0 -17
  402. package/dist/editor/helpers/use-file-existence.d.ts +0 -1
  403. package/dist/editor/helpers/use-file-existence.js +0 -66
  404. package/dist/editor/icons/RenderStillIcon.d.ts +0 -3
  405. package/dist/editor/icons/RenderStillIcon.js +0 -8
  406. package/dist/editor/icons/audio.d.ts +0 -2
  407. package/dist/editor/icons/audio.js +0 -6
  408. package/dist/editor/icons/data.d.ts +0 -2
  409. package/dist/editor/icons/data.js +0 -8
  410. package/dist/editor/icons/file.d.ts +0 -2
  411. package/dist/editor/icons/file.js +0 -6
  412. package/dist/editor/icons/frame.d.ts +0 -2
  413. package/dist/editor/icons/frame.js +0 -6
  414. package/dist/editor/icons/gear.d.ts +0 -2
  415. package/dist/editor/icons/gear.js +0 -6
  416. package/dist/editor/icons/gif.d.ts +0 -2
  417. package/dist/editor/icons/gif.js +0 -6
  418. package/dist/editor/icons/render.d.ts +0 -8
  419. package/dist/editor/icons/render.js +0 -12
  420. package/dist/editor/icons/video.d.ts +0 -5
  421. package/dist/editor/icons/video.js +0 -8
  422. package/dist/ffmpeg.d.ts +0 -2
  423. package/dist/ffmpeg.js +0 -21
  424. package/dist/file-watcher.d.ts +0 -9
  425. package/dist/file-watcher.js +0 -35
  426. package/dist/get-default-out-name.d.ts +0 -5
  427. package/dist/get-default-out-name.js +0 -10
  428. package/dist/preview-server/api-routes.d.ts +0 -4
  429. package/dist/preview-server/api-routes.js +0 -21
  430. package/dist/preview-server/api-types.d.ts +0 -25
  431. package/dist/preview-server/api-types.js +0 -2
  432. package/dist/preview-server/file-existence-watchers.d.ts +0 -13
  433. package/dist/preview-server/file-existence-watchers.js +0 -62
  434. package/dist/preview-server/handler.d.ts +0 -9
  435. package/dist/preview-server/handler.js +0 -34
  436. package/dist/preview-server/parse-body.d.ts +0 -2
  437. package/dist/preview-server/parse-body.js +0 -16
  438. package/dist/preview-server/render-queue/get-default-video-contexts.d.ts +0 -10
  439. package/dist/preview-server/render-queue/get-default-video-contexts.js +0 -13
  440. package/dist/preview-server/render-queue/job.d.ts +0 -138
  441. package/dist/preview-server/render-queue/job.js +0 -2
  442. package/dist/preview-server/render-queue/make-retry-payload.d.ts +0 -3
  443. package/dist/preview-server/render-queue/make-retry-payload.js +0 -91
  444. package/dist/preview-server/render-queue/open-directory-in-finder.d.ts +0 -1
  445. package/dist/preview-server/render-queue/open-directory-in-finder.js +0 -43
  446. package/dist/preview-server/render-queue/process-still.d.ts +0 -8
  447. package/dist/preview-server/render-queue/process-still.js +0 -46
  448. package/dist/preview-server/render-queue/process-video.d.ts +0 -8
  449. package/dist/preview-server/render-queue/process-video.js +0 -63
  450. package/dist/preview-server/render-queue/queue.d.ts +0 -9
  451. package/dist/preview-server/render-queue/queue.js +0 -212
  452. package/dist/preview-server/routes/add-render.d.ts +0 -3
  453. package/dist/preview-server/routes/add-render.js +0 -76
  454. package/dist/preview-server/routes/can-update-default-props.d.ts +0 -4
  455. package/dist/preview-server/routes/can-update-default-props.js +0 -39
  456. package/dist/preview-server/routes/cancel-render.d.ts +0 -3
  457. package/dist/preview-server/routes/cancel-render.js +0 -9
  458. package/dist/preview-server/routes/open-in-file-explorer.d.ts +0 -3
  459. package/dist/preview-server/routes/open-in-file-explorer.js +0 -8
  460. package/dist/preview-server/routes/remove-render.d.ts +0 -3
  461. package/dist/preview-server/routes/remove-render.js +0 -9
  462. package/dist/preview-server/routes/subscribe-to-file-existence.d.ts +0 -3
  463. package/dist/preview-server/routes/subscribe-to-file-existence.js +0 -13
  464. package/dist/preview-server/routes/unsubscribe-from-file-existence.d.ts +0 -3
  465. package/dist/preview-server/routes/unsubscribe-from-file-existence.js +0 -13
  466. package/dist/preview-server/routes/update-default-props.d.ts +0 -3
  467. package/dist/preview-server/routes/update-default-props.js +0 -24
  468. package/dist/progress-types.d.ts +0 -32
  469. package/dist/progress-types.js +0 -17
  470. package/dist/render-flows/render.d.ts +0 -47
  471. package/dist/render-flows/render.js +0 -293
  472. package/dist/render-flows/still.d.ts +0 -29
  473. package/dist/render-flows/still.js +0 -174
  474. package/dist/required-chromium-options.d.ts +0 -3
  475. package/dist/required-chromium-options.js +0 -2
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { z } from 'zod';
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,88 +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
- const isDefault = value === defaultValue;
80
- const reset = (0, react_1.useCallback)(() => {
81
- onValueChange(defaultValue);
82
- }, [defaultValue, onValueChange]);
83
- const save = (0, react_1.useCallback)(() => {
84
- onSave(() => value);
85
- }, [onSave, value]);
86
- 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-start", message: localValue.zodValidation.error.format()._errors[0], type: "error" })] }))] })] }));
87
- };
88
- exports.ZodNumberEditor = ZodNumberEditor;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { z } from 'zod';
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
- }>;
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZodObjectEditor = 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 get_zod_if_possible_1 = require("../../get-zod-if-possible");
8
- const layout_1 = require("../layout");
9
- const SchemaLabel_1 = require("./SchemaLabel");
10
- const ZodSwitch_1 = require("./ZodSwitch");
11
- const container = {
12
- width: '100%',
13
- };
14
- const fullWidth = {
15
- width: '100%',
16
- };
17
- const fieldset = {
18
- borderRadius: 4,
19
- borderColor: colors_1.INPUT_BORDER_COLOR_UNHOVERED,
20
- };
21
- // TODO: First validate locally
22
- const ZodObjectEditor = ({ schema, jsonPath, setValue, value, compact, defaultValue, onSave, showSaveButton, onRemove, }) => {
23
- const z = (0, get_zod_if_possible_1.useZodIfPossible)();
24
- if (!z) {
25
- throw new Error('expected zod');
26
- }
27
- const def = schema._def;
28
- const typeName = def.typeName;
29
- if (typeName !== z.ZodFirstPartyTypeKind.ZodObject) {
30
- throw new Error('expected object');
31
- }
32
- const shape = def.shape();
33
- const keys = Object.keys(shape);
34
- const isRoot = jsonPath.length === 0;
35
- const Element = isRoot ? 'div' : 'fieldset';
36
- const { paddingTop } = layout_1.optionRow;
37
- const style = (0, react_1.useMemo)(() => {
38
- if (isRoot) {
39
- return {};
40
- }
41
- return { paddingTop };
42
- }, [isRoot, paddingTop]);
43
- return ((0, jsx_runtime_1.jsx)("div", { style: style, children: (0, jsx_runtime_1.jsx)("div", { style: fullWidth, children: (0, jsx_runtime_1.jsxs)(Element, { style: fieldset, children: [isRoot ? null : ((0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaFieldsetLabel, { jsonPath: jsonPath, onRemove: onRemove })), (0, jsx_runtime_1.jsx)("div", { style: isRoot ? undefined : container, children: keys.map((key) => {
44
- var _a;
45
- return ((0, jsx_runtime_1.jsx)(ZodSwitch_1.ZodSwitch, { jsonPath: [...jsonPath, key], schema: shape[key], value: value[key],
46
- // In case of null | {a: string, b: string} type, we need to fallback to the default value
47
- defaultValue: ((_a = defaultValue) !== null && _a !== void 0 ? _a : value)[key], setValue: (val) => {
48
- setValue((oldVal) => {
49
- return {
50
- ...oldVal,
51
- [key]: typeof val === 'function' ? val(oldVal[key]) : val,
52
- };
53
- });
54
- }, onSave: (val) => {
55
- onSave((oldVal) => {
56
- return {
57
- ...oldVal,
58
- [key]: typeof val === 'function' ? val(oldVal[key]) : val,
59
- };
60
- });
61
- }, onRemove: null, compact: compact, showSaveButton: showSaveButton }, key));
62
- }) })] }) }) }));
63
- };
64
- exports.ZodObjectEditor = ZodObjectEditor;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import type { z } from 'zod';
3
- import type { JSONPath } from './zod-types';
4
- export declare const ZodOptionalEditor: React.FC<{
5
- showSaveButton: boolean;
6
- jsonPath: JSONPath;
7
- compact: boolean;
8
- value: unknown;
9
- defaultValue: unknown;
10
- schema: z.ZodTypeAny;
11
- setValue: React.Dispatch<React.SetStateAction<unknown>>;
12
- onSave: (updater: (oldNum: unknown) => unknown) => void;
13
- onRemove: null | (() => void);
14
- }>;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZodOptionalEditor = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const ZodOrNullishEditor_1 = require("./ZodOrNullishEditor");
6
- const ZodOptionalEditor = ({ jsonPath, compact, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, }) => {
7
- const { innerType } = schema._def;
8
- return ((0, jsx_runtime_1.jsx)(ZodOrNullishEditor_1.ZodOrNullishEditor, { compact: compact, defaultValue: defaultValue, jsonPath: jsonPath, onRemove: onRemove, onSave: onSave, schema: innerType, setValue: setValue, showSaveButton: showSaveButton, value: value, nullishValue: undefined }));
9
- };
10
- exports.ZodOptionalEditor = ZodOptionalEditor;
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- import type { z } from 'zod';
3
- import type { JSONPath } from './zod-types';
4
- export declare const ZodOrNullishEditor: 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
- nullishValue: null | undefined;
15
- }>;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZodOrNullishEditor = 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 Checkbox_1 = require("../../Checkbox");
8
- const get_zod_if_possible_1 = require("../../get-zod-if-possible");
9
- const layout_1 = require("../../layout");
10
- const create_zod_values_1 = require("./create-zod-values");
11
- const SchemaLabel_1 = require("./SchemaLabel");
12
- const ZodSwitch_1 = require("./ZodSwitch");
13
- const fullWidth = {
14
- width: '100%',
15
- };
16
- const labelStyle = {
17
- fontFamily: 'sans-serif',
18
- fontSize: 14,
19
- color: colors_1.LIGHT_TEXT,
20
- };
21
- const checkBoxWrapper = {
22
- margin: '2px',
23
- display: 'flex',
24
- flexDirection: 'row',
25
- alignItems: 'center',
26
- marginTop: '5px',
27
- };
28
- const ZodOrNullishEditor = ({ jsonPath, compact, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, nullishValue, }) => {
29
- const z = (0, get_zod_if_possible_1.useZodIfPossible)();
30
- if (!z) {
31
- throw new Error('expected zod');
32
- }
33
- const zColor = (0, get_zod_if_possible_1.useZodColorIfPossible)();
34
- const isChecked = value === nullishValue;
35
- const onValueChange = (0, react_1.useCallback)((newValue) => {
36
- setValue(newValue);
37
- }, [setValue]);
38
- const onCheckBoxChange = (0, react_1.useCallback)((e) => {
39
- const val = e.target.checked
40
- ? nullishValue
41
- : (0, create_zod_values_1.createZodValues)(schema, z, zColor);
42
- onValueChange(val);
43
- }, [nullishValue, onValueChange, schema, z, zColor]);
44
- const reset = (0, react_1.useCallback)(() => {
45
- onValueChange(defaultValue);
46
- }, [defaultValue, onValueChange]);
47
- const save = (0, react_1.useCallback)(() => {
48
- onSave(() => value);
49
- }, [onSave, value]);
50
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [value === nullishValue ? ((0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { isDefaultValue: value === defaultValue, jsonPath: jsonPath, onReset: reset, onSave: save, showSaveButton: showSaveButton, compact: compact, onRemove: onRemove })) : ((0, jsx_runtime_1.jsx)("div", { style: fullWidth, children: (0, jsx_runtime_1.jsx)(ZodSwitch_1.ZodSwitch, { value: value, setValue: onValueChange, jsonPath: jsonPath, schema: schema, compact: compact, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove }) })), (0, jsx_runtime_1.jsxs)("div", { style: checkBoxWrapper, children: [(0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: isChecked, onChange: onCheckBoxChange, disabled: false }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("div", { style: labelStyle, children: String(nullishValue) })] })] }));
51
- };
52
- exports.ZodOrNullishEditor = ZodOrNullishEditor;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { z } from 'zod';
3
- import type { JSONPath } from './zod-types';
4
- export declare const ZodStringEditor: 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,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZodStringEditor = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const get_zod_if_possible_1 = require("../../get-zod-if-possible");
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 ZodStringEditor = ({ jsonPath, value, setValue, showSaveButton, defaultValue, schema, compact, onSave, onRemove, }) => {
16
- const z = (0, get_zod_if_possible_1.useZodIfPossible)();
17
- if (!z) {
18
- throw new Error('expected zod');
19
- }
20
- const [localValue, setLocalValue] = (0, react_1.useState)(() => {
21
- return {
22
- value,
23
- zodValidation: schema.safeParse(value),
24
- };
25
- });
26
- const onValueChange = (0, react_1.useCallback)((newValue) => {
27
- const safeParse = schema.safeParse(newValue);
28
- const newLocalState = {
29
- value: newValue,
30
- zodValidation: safeParse,
31
- };
32
- setLocalValue(newLocalState);
33
- if (safeParse.success) {
34
- setValue(newValue);
35
- }
36
- }, [schema, setValue]);
37
- const onChange = (0, react_1.useCallback)((e) => {
38
- onValueChange(e.target.value);
39
- }, [onValueChange]);
40
- const reset = (0, react_1.useCallback)(() => {
41
- onValueChange(defaultValue);
42
- }, [defaultValue, onValueChange]);
43
- const save = (0, react_1.useCallback)(() => {
44
- onSave(() => value);
45
- }, [onSave, value]);
46
- 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.jsx)(RemInput_1.RemotionInput, { value: localValue.value, status: localValue.zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onChange: onChange, 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-start", message: localValue.zodValidation.error.format()._errors[0], type: "error" })] }))] })] }));
47
- };
48
- exports.ZodStringEditor = ZodStringEditor;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { z } from 'zod';
3
- import type { JSONPath } from './zod-types';
4
- export declare const ZodSwitch: React.FC<{
5
- schema: z.ZodTypeAny;
6
- jsonPath: JSONPath;
7
- value: unknown;
8
- defaultValue: unknown;
9
- setValue: React.Dispatch<React.SetStateAction<unknown>>;
10
- onSave: (newValue: (oldVal: unknown) => unknown) => void;
11
- compact: boolean;
12
- showSaveButton: boolean;
13
- onRemove: null | (() => void);
14
- }>;
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZodSwitch = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const get_zod_if_possible_1 = require("../../get-zod-if-possible");
6
- const ZodArrayEditor_1 = require("./ZodArrayEditor");
7
- const ZodBooleanEditor_1 = require("./ZodBooleanEditor");
8
- const ZodColorEditor_1 = require("./ZodColorEditor");
9
- const ZodDateEditor_1 = require("./ZodDateEditor");
10
- const ZodEnumEditor_1 = require("./ZodEnumEditor");
11
- const ZodNonEditableValue_1 = require("./ZodNonEditableValue");
12
- const ZodNullableEditor_1 = require("./ZodNullableEditor");
13
- const ZodNumberEditor_1 = require("./ZodNumberEditor");
14
- const ZodObjectEditor_1 = require("./ZodObjectEditor");
15
- const ZodOptionalEditor_1 = require("./ZodOptionalEditor");
16
- const ZodStringEditor_1 = require("./ZodStringEditor");
17
- const ZodUnionEditor_1 = require("./ZodUnionEditor");
18
- const ZodSwitch = ({ schema, jsonPath, compact, value, setValue, defaultValue, onSave, showSaveButton, onRemove, }) => {
19
- const def = schema._def;
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- const typeName = def.typeName;
22
- const z = (0, get_zod_if_possible_1.useZodIfPossible)();
23
- if (!z) {
24
- throw new Error('expected zod');
25
- }
26
- const zodColor = (0, get_zod_if_possible_1.useZodColorIfPossible)();
27
- // TODO: (Maybe?) enable saving of inserted input props by cmd+s /ctrl + s (also for JSON view)
28
- if (typeName === z.ZodFirstPartyTypeKind.ZodObject) {
29
- return ((0, jsx_runtime_1.jsx)(ZodObjectEditor_1.ZodObjectEditor, { setValue: setValue, value: value, defaultValue: defaultValue, jsonPath: jsonPath, schema: schema, compact: compact, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove }));
30
- }
31
- if (typeName === z.ZodFirstPartyTypeKind.ZodString) {
32
- return ((0, jsx_runtime_1.jsx)(ZodStringEditor_1.ZodStringEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, compact: compact, onSave: onSave, defaultValue: defaultValue, showSaveButton: showSaveButton, onRemove: onRemove }));
33
- }
34
- if (typeName === z.ZodFirstPartyTypeKind.ZodDate) {
35
- return ((0, jsx_runtime_1.jsx)(ZodDateEditor_1.ZodDateEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, compact: compact, onSave: onSave, defaultValue: defaultValue, showSaveButton: showSaveButton, onRemove: onRemove }));
36
- }
37
- if (typeName === z.ZodFirstPartyTypeKind.ZodNumber) {
38
- return ((0, jsx_runtime_1.jsx)(ZodNumberEditor_1.ZodNumberEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, compact: compact, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove }));
39
- }
40
- if (typeName === z.ZodFirstPartyTypeKind.ZodBoolean) {
41
- return ((0, jsx_runtime_1.jsx)(ZodBooleanEditor_1.ZodBooleanEditor, { value: value, setValue: setValue, jsonPath: jsonPath, compact: compact, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove }));
42
- }
43
- if (typeName === z.ZodFirstPartyTypeKind.ZodUndefined) {
44
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'undefined' }));
45
- }
46
- if (typeName === z.ZodFirstPartyTypeKind.ZodNull) {
47
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'null' }));
48
- }
49
- if (typeName === z.ZodFirstPartyTypeKind.ZodAny) {
50
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'any (not editable)' }));
51
- }
52
- if (typeName === z.ZodFirstPartyTypeKind.ZodBigInt) {
53
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'BigInt (not editable)' }));
54
- }
55
- if (typeName === z.ZodFirstPartyTypeKind.ZodUnknown) {
56
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'unknown (not editable)' }));
57
- }
58
- if (typeName === z.ZodFirstPartyTypeKind.ZodArray) {
59
- return ((0, jsx_runtime_1.jsx)(ZodArrayEditor_1.ZodArrayEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, compact: compact, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove }));
60
- }
61
- if (typeName === z.ZodFirstPartyTypeKind.ZodEnum) {
62
- return ((0, jsx_runtime_1.jsx)(ZodEnumEditor_1.ZodEnumEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, compact: compact, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove }));
63
- }
64
- if (typeName === z.ZodFirstPartyTypeKind.ZodEffects) {
65
- if (zodColor &&
66
- schema._def.description === zodColor.ZColorInternals.REMOTION_COLOR_BRAND) {
67
- return ((0, jsx_runtime_1.jsx)(ZodColorEditor_1.ZodColorEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, compact: compact, onSave: onSave, defaultValue: defaultValue, showSaveButton: showSaveButton, onRemove: onRemove }));
68
- }
69
- }
70
- if (typeName === z.ZodFirstPartyTypeKind.ZodUnion) {
71
- return ((0, jsx_runtime_1.jsx)(ZodUnionEditor_1.ZodUnionEditor, { schema: schema, showSaveButton: showSaveButton, jsonPath: jsonPath, compact: compact, value: value, defaultValue: defaultValue, setValue: setValue, onSave: onSave, onRemove: onRemove }));
72
- }
73
- if (typeName === z.ZodFirstPartyTypeKind.ZodOptional) {
74
- return ((0, jsx_runtime_1.jsx)(ZodOptionalEditor_1.ZodOptionalEditor, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, defaultValue: defaultValue, value: value, setValue: setValue, onSave: onSave, onRemove: onRemove, schema: schema }));
75
- }
76
- if (typeName === z.ZodFirstPartyTypeKind.ZodNullable) {
77
- return ((0, jsx_runtime_1.jsx)(ZodNullableEditor_1.ZodNullableEditor, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, defaultValue: defaultValue, value: value, setValue: setValue, onSave: onSave, onRemove: onRemove, schema: schema }));
78
- }
79
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: `${typeName} (not editable)` }));
80
- };
81
- exports.ZodSwitch = ZodSwitch;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import type { z } from 'zod';
3
- import type { JSONPath } from './zod-types';
4
- export declare const ZodUnionEditor: 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,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZodUnionEditor = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const get_zod_if_possible_1 = require("../../get-zod-if-possible");
6
- const ZodNonEditableValue_1 = require("./ZodNonEditableValue");
7
- const ZodOrNullishEditor_1 = require("./ZodOrNullishEditor");
8
- const findNull = (value, zodType) => {
9
- const nullIndex = value.findIndex((v) => v._def.typeName === zodType.ZodFirstPartyTypeKind.ZodNull ||
10
- v._def.typeName === zodType.ZodFirstPartyTypeKind.ZodUndefined);
11
- if (nullIndex === -1) {
12
- return null;
13
- }
14
- const nullishValue = value[nullIndex]._def.typeName === zodType.ZodFirstPartyTypeKind.ZodNull
15
- ? null
16
- : undefined;
17
- const otherSchema = value[nullIndex === 0 ? 1 : 0];
18
- const otherSchemaIsAlsoNullish = otherSchema._def.typeName === zodType.ZodFirstPartyTypeKind.ZodNull ||
19
- otherSchema._def.typeName === zodType.ZodFirstPartyTypeKind.ZodUndefined;
20
- return {
21
- nullIndex,
22
- nullishValue,
23
- otherSchema,
24
- otherSchemaIsAlsoNullish,
25
- };
26
- };
27
- const ZodUnionEditor = ({ jsonPath, compact, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, }) => {
28
- const { options } = schema._def;
29
- const z = (0, get_zod_if_possible_1.useZodIfPossible)();
30
- if (!z) {
31
- throw new Error('expected zod');
32
- }
33
- if (options.length > 2) {
34
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union with more than 2 options not editable', compact: compact, showSaveButton: showSaveButton }));
35
- }
36
- if (options.length < 2) {
37
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union with less than 2 options not editable', compact: compact, showSaveButton: showSaveButton }));
38
- }
39
- const nullResult = findNull(options, z);
40
- if (!nullResult) {
41
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union only editable with 1 value being null', compact: compact, showSaveButton: showSaveButton }));
42
- }
43
- const { otherSchema, nullishValue, otherSchemaIsAlsoNullish } = nullResult;
44
- if (otherSchemaIsAlsoNullish) {
45
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Not editable - both union values are nullish', compact: compact, showSaveButton: showSaveButton }));
46
- }
47
- return ((0, jsx_runtime_1.jsx)(ZodOrNullishEditor_1.ZodOrNullishEditor, { compact: compact, defaultValue: defaultValue, jsonPath: jsonPath, onRemove: onRemove, onSave: onSave, schema: otherSchema, setValue: setValue, showSaveButton: showSaveButton, value: value, nullishValue: nullishValue }));
48
- };
49
- exports.ZodUnionEditor = ZodUnionEditor;
@@ -1,2 +0,0 @@
1
- import type { ZodColorType, ZodType } from '../../get-zod-if-possible';
2
- export declare const createZodValues: (schema: Zod.ZodTypeAny, zodRuntime: ZodType, zColorRuntime: ZodColorType | null) => unknown;