@remotion/cli 4.0.0-alpha13 → 4.0.0-alpha14

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 (224) hide show
  1. package/dist/ansi/ansi-diff.d.ts +1 -1
  2. package/dist/ansi/ansi-regex.d.ts +2 -0
  3. package/dist/ansi/ansi-regex.js +18 -0
  4. package/dist/benchmark.js +29 -14
  5. package/dist/cleanup-before-quit.js +3 -0
  6. package/dist/composition-prompts.d.ts +2 -2
  7. package/dist/compositions.js +8 -7
  8. package/dist/config/concurrency.d.ts +1 -1
  9. package/dist/config/ffmpeg-executable.d.ts +5 -0
  10. package/dist/config/ffmpeg-executable.js +21 -0
  11. package/dist/config/index.d.ts +2 -2
  12. package/dist/config/jpeg-quality.d.ts +1 -1
  13. package/dist/config/jpeg-quality.js +1 -1
  14. package/dist/config/number-of-gif-loops.d.ts +1 -1
  15. package/dist/config/override-webpack.d.ts +1 -1
  16. package/dist/config/quality.d.ts +2 -0
  17. package/dist/config/quality.js +17 -0
  18. package/dist/config/scale.d.ts +1 -1
  19. package/dist/config/user-agent.d.ts +1 -1
  20. package/dist/editor/components/CanvasOrLoading.js +3 -0
  21. package/dist/editor/components/Checkbox.d.ts +1 -0
  22. package/dist/editor/components/Checkbox.js +2 -2
  23. package/dist/editor/components/ClipboardIcon.d.ts +2 -0
  24. package/dist/editor/components/ClipboardIcon.js +12 -0
  25. package/dist/editor/components/CollapsedCompositionSelector.d.ts +4 -0
  26. package/dist/editor/components/CollapsedCompositionSelector.js +39 -0
  27. package/dist/editor/components/CompositionSelectorItem.d.ts +1 -1
  28. package/dist/editor/components/InlineAction.d.ts +1 -1
  29. package/dist/editor/components/Menu/MenuItem.d.ts +2 -2
  30. package/dist/editor/components/Menu/MenuSubItem.d.ts +1 -1
  31. package/dist/editor/components/NewComposition/ComboBox.d.ts +4 -4
  32. package/dist/editor/components/NewComposition/CopyHint.js +1 -1
  33. package/dist/editor/components/NewComposition/InputDragger.d.ts +1 -1
  34. package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
  35. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +2 -1
  36. package/dist/editor/components/NewComposition/RemInputTypeColor.js +1 -1
  37. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  38. package/dist/editor/components/Notifications/NotificationCenter.d.ts +2 -2
  39. package/dist/editor/components/QuickSwitcher/NoResults.d.ts +1 -1
  40. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.d.ts +2 -2
  41. package/dist/editor/components/RenderModal/DataEditor.d.ts +2 -3
  42. package/dist/editor/components/RenderModal/DataEditor.js +14 -5
  43. package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +1 -1
  44. package/dist/editor/components/RenderModal/MutedSetting.js +1 -1
  45. package/dist/editor/components/RenderModal/RenderModal.d.ts +1 -1
  46. package/dist/editor/components/RenderModal/RenderModal.js +2 -2
  47. package/dist/editor/components/RenderModal/RenderModalAdvanced.d.ts +1 -1
  48. package/dist/editor/components/RenderModal/RenderModalAdvanced.js +1 -1
  49. package/dist/editor/components/RenderModal/RenderModalAudio.js +1 -1
  50. package/dist/editor/components/RenderModal/RenderModalData.d.ts +3 -2
  51. package/dist/editor/components/RenderModal/RenderModalData.js +23 -34
  52. package/dist/editor/components/RenderModal/RenderModalGif.js +1 -1
  53. package/dist/editor/components/RenderModal/RenderModalInput.d.ts +1 -1
  54. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -1
  55. package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +1 -1
  56. package/dist/editor/components/RenderModal/SchemaEditor/Fieldset.d.ts +7 -0
  57. package/dist/editor/components/RenderModal/SchemaEditor/Fieldset.js +26 -0
  58. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +0 -1
  59. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +2 -3
  60. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
  61. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +1 -7
  62. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +14 -22
  63. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSeparationLine.d.ts +2 -0
  64. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +11 -0
  65. package/dist/editor/components/RenderModal/SchemaEditor/SchemaVerticalGuide.d.ts +5 -0
  66. package/dist/editor/components/RenderModal/SchemaEditor/SchemaVerticalGuide.js +13 -0
  67. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +1 -1
  68. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +51 -42
  69. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +1 -1
  70. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +5 -5
  71. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +3 -1
  72. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +14 -13
  73. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +1 -1
  74. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +12 -14
  75. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +1 -1
  76. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +9 -15
  77. package/dist/editor/components/RenderModal/SchemaEditor/ZodDefaultEditor.d.ts +1 -1
  78. package/dist/editor/components/RenderModal/SchemaEditor/ZodDefaultEditor.js +2 -2
  79. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +1 -1
  80. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +5 -30
  81. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +0 -1
  82. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +8 -11
  83. package/dist/editor/components/RenderModal/SchemaEditor/ZodFieldValidation.d.ts +7 -0
  84. package/dist/editor/components/RenderModal/SchemaEditor/ZodFieldValidation.js +27 -0
  85. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.d.ts +1 -1
  86. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +3 -3
  87. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +1 -1
  88. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +2 -2
  89. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +1 -1
  90. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +10 -13
  91. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +1 -1
  92. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +39 -45
  93. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +1 -1
  94. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +2 -2
  95. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +2 -1
  96. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +13 -48
  97. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.d.ts +1 -1
  98. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +7 -10
  99. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +1 -1
  100. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +8 -11
  101. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +2 -2
  102. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +21 -21
  103. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +1 -1
  104. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +6 -6
  105. package/dist/editor/components/RenderModal/SchemaEditor/deep-equal.js +3 -0
  106. package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.d.ts +1 -1
  107. package/dist/editor/components/RenderModal/SchemaEditor/get-schema-label.js +3 -3
  108. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +1 -1
  109. package/dist/editor/components/RenderModal/SchemaEditor/local-state.d.ts +10 -5
  110. package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +56 -15
  111. package/dist/editor/components/RenderModal/SchemaEditor/zod-types.d.ts +1 -1
  112. package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +1 -1
  113. package/dist/editor/components/RenderModal/layout.d.ts +0 -1
  114. package/dist/editor/components/RenderModal/layout.js +1 -7
  115. package/dist/editor/components/RenderQueue/actions.d.ts +2 -1
  116. package/dist/editor/components/RenderQueue/actions.js +7 -2
  117. package/dist/editor/components/RenderQueue/context.d.ts +1 -1
  118. package/dist/editor/components/RichTimelineToggle.d.ts +2 -0
  119. package/dist/editor/components/RichTimelineToggle.js +29 -0
  120. package/dist/editor/components/RightPanel.d.ts +1 -1
  121. package/dist/editor/components/RightPanel.js +1 -1
  122. package/dist/editor/components/SegmentedControl.d.ts +1 -1
  123. package/dist/editor/components/SegmentedControl.js +2 -0
  124. package/dist/editor/components/Splitter/SplitterContext.d.ts +3 -3
  125. package/dist/editor/components/Thumbnail.d.ts +8 -0
  126. package/dist/editor/components/Thumbnail.js +76 -0
  127. package/dist/editor/components/Timeline/LoopedIndicator.js +6 -6
  128. package/dist/editor/components/Timeline/TimelineWidthProvider.d.ts +1 -1
  129. package/dist/editor/components/Timeline/TimelineZoomControls.js +1 -1
  130. package/dist/editor/components/Timeline/timeline-state-reducer.d.ts +2 -2
  131. package/dist/editor/components/UpdateCheck.d.ts +1 -1
  132. package/dist/editor/components/UpdateCheck.js +2 -4
  133. package/dist/editor/components/get-zod-if-possible.d.ts +2 -2
  134. package/dist/editor/helpers/client-id.d.ts +1 -1
  135. package/dist/editor/helpers/get-timeline-sequence-sort-key.d.ts +3 -3
  136. package/dist/editor/helpers/persist-open-folders.d.ts +1 -1
  137. package/dist/editor/helpers/render-modal-sections.d.ts +1 -2
  138. package/dist/editor/helpers/use-compact-ui.d.ts +1 -0
  139. package/dist/editor/helpers/use-compact-ui.js +18 -0
  140. package/dist/editor/helpers/use-menu-structure.d.ts +1 -1
  141. package/dist/editor/icons/film.d.ts +3 -0
  142. package/dist/editor/icons/film.js +8 -0
  143. package/dist/editor/icons/plus.d.ts +3 -1
  144. package/dist/editor/icons/plus.js +2 -2
  145. package/dist/editor/icons/timeline.d.ts +3 -0
  146. package/dist/editor/icons/timeline.js +9 -0
  147. package/dist/editor/state/checkerboard.d.ts +1 -1
  148. package/dist/editor/state/editor-zoom-gestures.d.ts +1 -1
  149. package/dist/editor/state/folders.d.ts +1 -1
  150. package/dist/editor/state/highest-z-index.d.ts +1 -1
  151. package/dist/editor/state/in-out.d.ts +2 -2
  152. package/dist/editor/state/keybindings.d.ts +4 -4
  153. package/dist/editor/state/modals.d.ts +4 -4
  154. package/dist/editor/state/preview-size.d.ts +1 -1
  155. package/dist/editor/state/rich-timeline.d.ts +9 -0
  156. package/dist/editor/state/rich-timeline.js +17 -0
  157. package/dist/editor/state/sidebar.d.ts +3 -3
  158. package/dist/editor/state/timeline-ref.d.ts +1 -1
  159. package/dist/event-source-events.d.ts +1 -1
  160. package/dist/file-watcher.d.ts +1 -1
  161. package/dist/get-cli-options.d.ts +1 -1
  162. package/dist/get-composition-id.d.ts +10 -11
  163. package/dist/get-composition-id.js +9 -6
  164. package/dist/get-composition-with-dimension-override.d.ts +4 -4
  165. package/dist/get-composition-with-dimension-override.js +2 -2
  166. package/dist/get-render-media-options.d.ts +8 -0
  167. package/dist/get-render-media-options.js +55 -0
  168. package/dist/index.d.ts +5 -4
  169. package/dist/install.d.ts +2 -0
  170. package/dist/install.js +36 -0
  171. package/dist/is-javascript.d.ts +2 -0
  172. package/dist/is-javascript.js +9 -0
  173. package/dist/log.d.ts +1 -0
  174. package/dist/parse-command-line.d.ts +1 -1
  175. package/dist/preview-server/api-routes.js +2 -0
  176. package/dist/preview-server/api-types.d.ts +5 -4
  177. package/dist/preview-server/dev-middleware/get-paths.d.ts +1 -1
  178. package/dist/preview-server/dev-middleware/is-color-supported.d.ts +1 -0
  179. package/dist/preview-server/dev-middleware/is-color-supported.js +37 -0
  180. package/dist/preview-server/dev-middleware/middleware.d.ts +1 -1
  181. package/dist/preview-server/dev-middleware/range-parser.d.ts +2 -2
  182. package/dist/preview-server/dev-middleware/types.d.ts +1 -1
  183. package/dist/preview-server/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts +1 -1
  184. package/dist/preview-server/error-overlay/react-overlay/effects/proxy-console.d.ts +3 -3
  185. package/dist/preview-server/error-overlay/react-overlay/effects/unhandled-error.d.ts +1 -1
  186. package/dist/preview-server/error-overlay/react-overlay/effects/unhandled-rejection.d.ts +1 -1
  187. package/dist/preview-server/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +1 -1
  188. package/dist/preview-server/error-overlay/react-overlay/utils/get-source-map.js +1 -0
  189. package/dist/preview-server/error-overlay/react-overlay/utils/open-in-editor.d.ts +2 -2
  190. package/dist/preview-server/error-overlay/react-overlay/utils/stack-frame.d.ts +4 -4
  191. package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -1
  192. package/dist/preview-server/error-overlay/remotion-overlay/Overlay.d.ts +2 -2
  193. package/dist/preview-server/error-overlay/remotion-overlay/get-help-link.d.ts +1 -1
  194. package/dist/preview-server/get-package-manager.d.ts +2 -2
  195. package/dist/preview-server/hot-middleware/client.d.ts +1 -1
  196. package/dist/preview-server/hot-middleware/strip-ansi.d.ts +1 -0
  197. package/dist/preview-server/hot-middleware/strip-ansi.js +21 -0
  198. package/dist/preview-server/hot-middleware/types.d.ts +4 -4
  199. package/dist/preview-server/live-events.d.ts +1 -1
  200. package/dist/preview-server/live-events.js +10 -1
  201. package/dist/preview-server/project-info.d.ts +1 -1
  202. package/dist/preview-server/render-queue/job.d.ts +30 -21
  203. package/dist/preview-server/render-queue/process-still.js +1 -2
  204. package/dist/preview-server/routes/update-available.d.ts +3 -0
  205. package/dist/preview-server/routes/update-available.js +9 -0
  206. package/dist/preview-server/routes.d.ts +0 -1
  207. package/dist/preview-server/routes.js +1 -11
  208. package/dist/preview-server/update-available.d.ts +2 -10
  209. package/dist/preview.js +2 -0
  210. package/dist/progress-bar.d.ts +4 -4
  211. package/dist/progress-bar.js +3 -2
  212. package/dist/progress-types.d.ts +4 -4
  213. package/dist/render-flows/render.js +35 -28
  214. package/dist/render-flows/still.d.ts +1 -1
  215. package/dist/render-flows/still.js +23 -10
  216. package/dist/required-chromium-options.d.ts +2 -2
  217. package/dist/server-ready-comment.d.ts +1 -1
  218. package/dist/server-ready-comment.js +2 -2
  219. package/dist/setup-cache.js +10 -0
  220. package/dist/show-compositions-picker.d.ts +1 -1
  221. package/dist/step.d.ts +1 -1
  222. package/dist/studio.js +3 -3
  223. package/dist/truthy.d.ts +1 -1
  224. package/package.json +10 -12
@@ -18,7 +18,7 @@ const ZodOptionalEditor_1 = require("./ZodOptionalEditor");
18
18
  const ZodStaticFileEditor_1 = require("./ZodStaticFileEditor");
19
19
  const ZodStringEditor_1 = require("./ZodStringEditor");
20
20
  const ZodUnionEditor_1 = require("./ZodUnionEditor");
21
- const ZodSwitch = ({ schema, jsonPath, compact, value, setValue, defaultValue, onSave, showSaveButton, onRemove, saving, saveDisabledByParent, }) => {
21
+ const ZodSwitch = ({ schema, jsonPath, value, setValue, defaultValue, onSave, showSaveButton, onRemove, saving, saveDisabledByParent, mayPad, }) => {
22
22
  const def = schema._def;
23
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
24
  const typeName = def.typeName;
@@ -29,64 +29,64 @@ const ZodSwitch = ({ schema, jsonPath, compact, value, setValue, defaultValue, o
29
29
  const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
30
30
  // TODO: (Maybe?) enable saving of inserted input props by cmd+s /ctrl + s (also for JSON view)
31
31
  if (typeName === z.ZodFirstPartyTypeKind.ZodObject) {
32
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
32
+ return ((0, jsx_runtime_1.jsx)(ZodObjectEditor_1.ZodObjectEditor, { setValue: setValue, value: value, defaultValue: defaultValue, jsonPath: jsonPath, schema: schema, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
33
33
  }
34
34
  if (typeName === z.ZodFirstPartyTypeKind.ZodString) {
35
35
  if (value.startsWith(window.remotion_staticBase)) {
36
- return ((0, jsx_runtime_1.jsx)(ZodStaticFileEditor_1.ZodStaticFileEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, compact: compact, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent }));
36
+ return ((0, jsx_runtime_1.jsx)(ZodStaticFileEditor_1.ZodStaticFileEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
37
37
  }
38
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
38
+ return ((0, jsx_runtime_1.jsx)(ZodStringEditor_1.ZodStringEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, onSave: onSave, defaultValue: defaultValue, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
39
39
  }
40
40
  if (typeName === z.ZodFirstPartyTypeKind.ZodDate) {
41
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
41
+ return ((0, jsx_runtime_1.jsx)(ZodDateEditor_1.ZodDateEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, onSave: onSave, defaultValue: defaultValue, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
42
42
  }
43
43
  if (typeName === z.ZodFirstPartyTypeKind.ZodNumber) {
44
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
44
+ return ((0, jsx_runtime_1.jsx)(ZodNumberEditor_1.ZodNumberEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
45
45
  }
46
46
  if (typeName === z.ZodFirstPartyTypeKind.ZodBoolean) {
47
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
47
+ return ((0, jsx_runtime_1.jsx)(ZodBooleanEditor_1.ZodBooleanEditor, { value: value, setValue: setValue, jsonPath: jsonPath, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad, schema: schema }));
48
48
  }
49
49
  if (typeName === z.ZodFirstPartyTypeKind.ZodUndefined) {
50
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'undefined', saving: saving }));
50
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'undefined', saving: saving, mayPad: mayPad }));
51
51
  }
52
52
  if (typeName === z.ZodFirstPartyTypeKind.ZodNull) {
53
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'null', saving: saving }));
53
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'null', saving: saving, mayPad: mayPad }));
54
54
  }
55
55
  if (typeName === z.ZodFirstPartyTypeKind.ZodAny) {
56
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'any (not editable)', saving: saving }));
56
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'any (not editable)', saving: saving, mayPad: mayPad }));
57
57
  }
58
58
  if (typeName === z.ZodFirstPartyTypeKind.ZodBigInt) {
59
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'BigInt (not editable)', saving: saving }));
59
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'BigInt (not editable)', saving: saving, mayPad: mayPad }));
60
60
  }
61
61
  if (typeName === z.ZodFirstPartyTypeKind.ZodUnknown) {
62
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'unknown (not editable)', saving: saving }));
62
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'unknown (not editable)', saving: saving, mayPad: mayPad }));
63
63
  }
64
64
  if (typeName === z.ZodFirstPartyTypeKind.ZodArray) {
65
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
65
+ return ((0, jsx_runtime_1.jsx)(ZodArrayEditor_1.ZodArrayEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
66
66
  }
67
67
  if (typeName === z.ZodFirstPartyTypeKind.ZodEnum) {
68
- 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, saving: saving }));
68
+ return ((0, jsx_runtime_1.jsx)(ZodEnumEditor_1.ZodEnumEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving }));
69
69
  }
70
70
  if (typeName === z.ZodFirstPartyTypeKind.ZodEffects) {
71
71
  if (zodTypes &&
72
72
  schema._def.description ===
73
73
  zodTypes.ZodZypesInternals.REMOTION_COLOR_BRAND) {
74
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
74
+ return ((0, jsx_runtime_1.jsx)(ZodColorEditor_1.ZodColorEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, onSave: onSave, defaultValue: defaultValue, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
75
75
  }
76
- return ((0, jsx_runtime_1.jsx)(ZodEffectEditor_1.ZodEffectEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, compact: compact, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving }));
76
+ return ((0, jsx_runtime_1.jsx)(ZodEffectEditor_1.ZodEffectEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, mayPad: mayPad }));
77
77
  }
78
78
  if (typeName === z.ZodFirstPartyTypeKind.ZodUnion) {
79
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
79
+ return ((0, jsx_runtime_1.jsx)(ZodUnionEditor_1.ZodUnionEditor, { schema: schema, showSaveButton: showSaveButton, jsonPath: jsonPath, value: value, defaultValue: defaultValue, setValue: setValue, onSave: onSave, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
80
80
  }
81
81
  if (typeName === z.ZodFirstPartyTypeKind.ZodOptional) {
82
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
82
+ return ((0, jsx_runtime_1.jsx)(ZodOptionalEditor_1.ZodOptionalEditor, { jsonPath: jsonPath, showSaveButton: showSaveButton, defaultValue: defaultValue, value: value, setValue: setValue, onSave: onSave, onRemove: onRemove, schema: schema, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
83
83
  }
84
84
  if (typeName === z.ZodFirstPartyTypeKind.ZodNullable) {
85
- 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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
85
+ return ((0, jsx_runtime_1.jsx)(ZodNullableEditor_1.ZodNullableEditor, { jsonPath: jsonPath, showSaveButton: showSaveButton, defaultValue: defaultValue, value: value, setValue: setValue, onSave: onSave, onRemove: onRemove, schema: schema, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
86
86
  }
87
87
  if (typeName === z.ZodFirstPartyTypeKind.ZodDefault) {
88
- return ((0, jsx_runtime_1.jsx)(ZodDefaultEditor_1.ZodDefaultEditor, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, defaultValue: defaultValue, value: value, setValue: setValue, onSave: onSave, onRemove: onRemove, schema: schema, saving: saving, saveDisabledByParent: saveDisabledByParent }));
88
+ return ((0, jsx_runtime_1.jsx)(ZodDefaultEditor_1.ZodDefaultEditor, { jsonPath: jsonPath, showSaveButton: showSaveButton, defaultValue: defaultValue, value: value, setValue: setValue, onSave: onSave, onRemove: onRemove, schema: schema, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
89
89
  }
90
- return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { compact: compact, jsonPath: jsonPath, showSaveButton: showSaveButton, label: `${typeName} (not editable)`, saving: saving }));
90
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: `${typeName} (not editable)`, saving: saving, mayPad: mayPad }));
91
91
  };
92
92
  exports.ZodSwitch = ZodSwitch;
@@ -5,7 +5,6 @@ import type { UpdaterFunction } from './ZodSwitch';
5
5
  export declare const ZodUnionEditor: React.FC<{
6
6
  showSaveButton: boolean;
7
7
  jsonPath: JSONPath;
8
- compact: boolean;
9
8
  value: unknown;
10
9
  defaultValue: unknown;
11
10
  schema: z.ZodTypeAny;
@@ -14,4 +13,5 @@ export declare const ZodUnionEditor: React.FC<{
14
13
  onRemove: null | (() => void);
15
14
  saving: boolean;
16
15
  saveDisabledByParent: boolean;
16
+ mayPad: boolean;
17
17
  }>;
@@ -24,26 +24,26 @@ const findNull = (value, zodType) => {
24
24
  otherSchemaIsAlsoNullish,
25
25
  };
26
26
  };
27
- const ZodUnionEditor = ({ jsonPath, compact, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, saving, saveDisabledByParent, }) => {
27
+ const ZodUnionEditor = ({ jsonPath, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, saving, saveDisabledByParent, mayPad, }) => {
28
28
  const { options } = schema._def;
29
29
  const z = (0, get_zod_if_possible_1.useZodIfPossible)();
30
30
  if (!z) {
31
31
  throw new Error('expected zod');
32
32
  }
33
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, saving: saving }));
34
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union with more than 2 options not editable', showSaveButton: showSaveButton, saving: saving, mayPad: mayPad }));
35
35
  }
36
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, saving: saving }));
37
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union with less than 2 options not editable', showSaveButton: showSaveButton, saving: saving, mayPad: mayPad }));
38
38
  }
39
39
  const nullResult = findNull(options, z);
40
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, saving: saving }));
41
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union only editable with 1 value being null', showSaveButton: showSaveButton, saving: saving, mayPad: mayPad }));
42
42
  }
43
43
  const { otherSchema, nullishValue, otherSchemaIsAlsoNullish } = nullResult;
44
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, saving: saving }));
45
+ return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Not editable - both union values are nullish', showSaveButton: showSaveButton, saving: saving, mayPad: mayPad }));
46
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, saving: saving, saveDisabledByParent: saveDisabledByParent }));
47
+ return ((0, jsx_runtime_1.jsx)(ZodOrNullishEditor_1.ZodOrNullishEditor, { defaultValue: defaultValue, jsonPath: jsonPath, onRemove: onRemove, onSave: onSave, schema: schema, innerSchema: otherSchema, setValue: setValue, showSaveButton: showSaveButton, value: value, nullishValue: nullishValue, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
48
48
  };
49
49
  exports.ZodUnionEditor = ZodUnionEditor;
@@ -6,6 +6,9 @@ function deepEqual(a, b) {
6
6
  if (a === b) {
7
7
  return true;
8
8
  }
9
+ if (a instanceof Date && b instanceof Date) {
10
+ return a.getTime() === b.getTime();
11
+ }
9
12
  if (typeof a !== 'object' ||
10
13
  a === null ||
11
14
  typeof b !== 'object' ||
@@ -1,3 +1,3 @@
1
1
  import type { ZodType } from '../../get-zod-if-possible';
2
- export declare type EnumPath = (string | number)[];
2
+ export type EnumPath = (string | number)[];
3
3
  export declare const extractEnumJsonPaths: (schema: Zod.ZodTypeAny, zodRuntime: ZodType, currentPath: (string | number)[]) => (string | number)[][];
@@ -6,10 +6,10 @@ const getSchemaLabel = (jsonPath) => {
6
6
  if (typeof lastKey === 'number') {
7
7
  const secondLastKey = jsonPath[jsonPath.length - 2];
8
8
  if (typeof secondLastKey === 'undefined') {
9
- return `[${lastKey}]`;
9
+ return `[${lastKey}]:`;
10
10
  }
11
- return `${(0, exports.getSchemaLabel)(jsonPath.slice(0, jsonPath.length - 1))}[${lastKey}]`;
11
+ return `${lastKey}:`;
12
12
  }
13
- return lastKey;
13
+ return `${lastKey}:`;
14
14
  };
15
15
  exports.getSchemaLabel = getSchemaLabel;
@@ -1,4 +1,4 @@
1
- export declare type SerializedJSONWithCustomFields = {
1
+ export type SerializedJSONWithCustomFields = {
2
2
  serializedString: string;
3
3
  customDateUsed: boolean;
4
4
  customFileUsed: boolean;
@@ -1,16 +1,21 @@
1
+ import React from 'react';
1
2
  import type { z } from 'zod';
2
3
  import type { UpdaterFunction } from './ZodSwitch';
3
- declare type LocalState<T> = {
4
+ export type LocalState<T> = {
4
5
  value: T;
5
6
  zodValidation: z.SafeParseReturnType<unknown, unknown>;
6
- revision: number;
7
+ keyStabilityRevision: number;
7
8
  };
8
- export declare const useLocalState: <T>({ value, schema, setValue, }: {
9
+ export declare const useLocalState: <T>({ value, schema, setValue, defaultValue, }: {
9
10
  value: T;
10
11
  schema: z.ZodTypeAny;
11
12
  setValue: UpdaterFunction<T>;
13
+ defaultValue: T;
12
14
  }) => {
13
15
  localValue: LocalState<T>;
14
- onChange: (updater: (oldV: T) => T, forceApply: boolean) => void;
16
+ onChange: (updater: (oldV: T) => T, forceApply: boolean, increment: boolean) => void;
17
+ reset: () => void;
18
+ RevisionContextProvider: ({ children }: {
19
+ children: React.ReactNode;
20
+ }) => JSX.Element;
15
21
  };
16
- export {};
@@ -1,19 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLocalState = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
5
  const react_1 = require("react");
5
6
  const deep_equal_1 = require("./deep-equal");
6
- const useLocalState = ({ value, schema, setValue, }) => {
7
+ const RevisionContext = (0, react_1.createContext)({
8
+ childResetRevision: 0,
9
+ });
10
+ const useLocalState = ({ value, schema, setValue, defaultValue, }) => {
11
+ const parentRevision = (0, react_1.useContext)(RevisionContext).childResetRevision;
12
+ const [resetRevision, setResetRevision] = (0, react_1.useState)(0);
7
13
  const [localValue, setLocalValue] = (0, react_1.useState)(() => {
8
- return {
9
- value,
10
- zodValidation: schema.safeParse(value),
11
- revision: 0,
12
- };
14
+ return {};
13
15
  });
14
- const stateRef = (0, react_1.useRef)(localValue);
15
- stateRef.current = localValue;
16
- const onChange = (0, react_1.useCallback)((updater, forceApply) => {
16
+ const currentLocalValue = (0, react_1.useMemo)(() => {
17
+ var _a;
18
+ return ((_a = localValue[parentRevision]) !== null && _a !== void 0 ? _a : {
19
+ value: defaultValue,
20
+ keyStabilityRevision: 0,
21
+ zodValidation: schema.safeParse(value),
22
+ });
23
+ }, [defaultValue, localValue, parentRevision, schema, value]);
24
+ const stateRef = (0, react_1.useRef)(currentLocalValue);
25
+ stateRef.current = currentLocalValue;
26
+ const onChange = (0, react_1.useCallback)(
27
+ // Increment is to regenerate `key` attributes in array items,
28
+ // so should increment when changing array items
29
+ (updater, forceApply, increment) => {
17
30
  const newValue = updater(stateRef.current.value);
18
31
  const isSame = (0, deep_equal_1.deepEqual)(newValue, stateRef.current.value);
19
32
  if (isSame) {
@@ -21,18 +34,46 @@ const useLocalState = ({ value, schema, setValue, }) => {
21
34
  }
22
35
  const safeParse = schema.safeParse(newValue);
23
36
  if (safeParse.success || forceApply) {
24
- setValue(updater, forceApply);
37
+ setValue(updater, forceApply, increment);
25
38
  }
26
- setLocalValue((oldLocalState) => {
39
+ setLocalValue(() => {
27
40
  const newState = {
28
- revision: oldLocalState.revision + 1,
41
+ keyStabilityRevision: currentLocalValue.keyStabilityRevision + (increment ? 1 : 0),
29
42
  value: newValue,
30
43
  zodValidation: safeParse,
31
44
  };
32
45
  stateRef.current = newState;
33
- return newState;
46
+ return {
47
+ ...localValue,
48
+ [parentRevision]: newState,
49
+ };
34
50
  });
35
- }, [schema, setValue]);
36
- return { localValue, onChange };
51
+ }, [
52
+ currentLocalValue.keyStabilityRevision,
53
+ localValue,
54
+ parentRevision,
55
+ schema,
56
+ setValue,
57
+ ]);
58
+ const contextValue = (0, react_1.useMemo)(() => {
59
+ return {
60
+ childResetRevision: resetRevision,
61
+ };
62
+ }, [resetRevision]);
63
+ const reset = (0, react_1.useCallback)(() => {
64
+ // Only need to do key stability for arrays, but
65
+ // since user is not editing right now, should be fine
66
+ onChange(() => defaultValue, true, true);
67
+ setResetRevision((old) => old + 1);
68
+ }, [defaultValue, onChange]);
69
+ const RevisionContextProvider = (0, react_1.useCallback)(({ children }) => {
70
+ return ((0, jsx_runtime_1.jsx)(RevisionContext.Provider, { value: contextValue, children: children }));
71
+ }, [contextValue]);
72
+ return {
73
+ localValue: currentLocalValue,
74
+ onChange,
75
+ reset,
76
+ RevisionContextProvider,
77
+ };
37
78
  };
38
79
  exports.useLocalState = useLocalState;
@@ -1 +1 @@
1
- export declare type JSONPath = (string | number)[];
1
+ export type JSONPath = (string | number)[];
@@ -1,5 +1,5 @@
1
1
  import type { PropsEditType } from './DataEditor';
2
- export declare type TypeCanSaveState = {
2
+ export type TypeCanSaveState = {
3
3
  canUpdate: true;
4
4
  } | {
5
5
  canUpdate: false;
@@ -1,6 +1,5 @@
1
1
  import type React from 'react';
2
2
  export declare const optionRow: React.CSSProperties;
3
- export declare const narrowOption: React.CSSProperties;
4
3
  export declare const label: React.CSSProperties;
5
4
  export declare const rightRow: React.CSSProperties;
6
5
  export declare const input: React.CSSProperties;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fieldsetLabel = exports.input = exports.rightRow = exports.label = exports.narrowOption = exports.optionRow = void 0;
3
+ exports.fieldsetLabel = exports.input = exports.rightRow = exports.label = exports.optionRow = void 0;
4
4
  const colors_1 = require("../../helpers/colors");
5
5
  exports.optionRow = {
6
6
  display: 'flex',
@@ -11,10 +11,6 @@ exports.optionRow = {
11
11
  paddingTop: 8,
12
12
  paddingBottom: 8,
13
13
  };
14
- exports.narrowOption = {
15
- display: 'flex',
16
- flexDirection: 'column',
17
- };
18
14
  exports.label = {
19
15
  width: 170,
20
16
  fontSize: 15,
@@ -38,8 +34,6 @@ exports.input = {
38
34
  exports.fieldsetLabel = {
39
35
  color: colors_1.LIGHT_TEXT,
40
36
  fontSize: 14,
41
- paddingLeft: 5,
42
- paddingRight: 5,
43
37
  display: 'flex',
44
38
  flexDirection: 'row',
45
39
  fontFamily: 'monospace',
@@ -6,7 +6,7 @@ export declare const addStillRenderJob: ({ compositionId, outName, imageFormat,
6
6
  compositionId: string;
7
7
  outName: string;
8
8
  imageFormat: StillImageFormat;
9
- jpegQuality: number | null;
9
+ jpegQuality: number;
10
10
  frame: number;
11
11
  scale: number;
12
12
  verbose: boolean;
@@ -55,5 +55,6 @@ export declare const openInFileExplorer: ({ directory }: {
55
55
  }) => Promise<void>;
56
56
  export declare const removeRenderJob: (job: RenderJob) => Promise<undefined>;
57
57
  export declare const cancelRenderJob: (job: RenderJob) => Promise<import("../../../preview-server/render-queue/job").CancelRenderResponse>;
58
+ export declare const updateAvailable: (signal: AbortSignal) => Promise<import("../../../preview-server/render-queue/job").UpdateAvailableResponse>;
58
59
  export declare const updateDefaultProps: (compositionId: string, defaultProps: unknown, enumPaths: EnumPath[]) => Promise<import("../../../preview-server/render-queue/job").UpdateDefaultPropsResponse>;
59
60
  export declare const canUpdateDefaultProps: (compositionId: string) => Promise<import("../../../preview-server/render-queue/job").CanUpdateDefaultPropsResponse>;
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.canUpdateDefaultProps = exports.updateDefaultProps = exports.cancelRenderJob = exports.removeRenderJob = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addStillRenderJob = void 0;
3
+ exports.canUpdateDefaultProps = exports.updateDefaultProps = exports.updateAvailable = exports.cancelRenderJob = exports.removeRenderJob = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addStillRenderJob = void 0;
4
4
  const input_props_serialization_1 = require("../RenderModal/SchemaEditor/input-props-serialization");
5
- const callApi = (endpoint, body) => {
5
+ const callApi = (endpoint, body, signal) => {
6
6
  return new Promise((resolve, reject) => {
7
7
  fetch(endpoint, {
8
8
  method: 'post',
9
9
  headers: {
10
10
  'content-type': 'application/json',
11
11
  },
12
+ signal,
12
13
  body: JSON.stringify(body),
13
14
  })
14
15
  .then((res) => res.json())
@@ -104,6 +105,10 @@ const cancelRenderJob = (job) => {
104
105
  });
105
106
  };
106
107
  exports.cancelRenderJob = cancelRenderJob;
108
+ const updateAvailable = (signal) => {
109
+ return callApi('/api/update-available', {}, signal);
110
+ };
111
+ exports.updateAvailable = updateAvailable;
107
112
  const updateDefaultProps = (compositionId, defaultProps, enumPaths) => {
108
113
  return callApi('/api/update-default-props', {
109
114
  compositionId,
@@ -5,7 +5,7 @@ declare global {
5
5
  remotion_initialRenderQueue: RenderJob[];
6
6
  }
7
7
  }
8
- declare type RenderQueueContextType = {
8
+ type RenderQueueContextType = {
9
9
  jobs: RenderJob[];
10
10
  };
11
11
  export declare const RenderQueueContext: React.Context<RenderQueueContextType>;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const RichTimelineToggle: React.FC;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RichTimelineToggle = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
7
+ const timeline_1 = require("../icons/timeline");
8
+ const rich_timeline_1 = require("../state/rich-timeline");
9
+ const ControlButton_1 = require("./ControlButton");
10
+ const tooltip = 'Enable rich timeline. Go to remotion.dev/docs/timeline for more information.';
11
+ const RichTimelineToggle = () => {
12
+ const { richTimeline, setRichTimeline } = (0, react_1.useContext)(rich_timeline_1.RichTimelineContext);
13
+ const isStill = (0, is_current_selected_still_1.useIsStill)();
14
+ const onClick = (0, react_1.useCallback)(() => {
15
+ setRichTimeline((c) => {
16
+ (0, rich_timeline_1.persistRichTimelineOption)(!c);
17
+ return !c;
18
+ });
19
+ }, [setRichTimeline]);
20
+ if (isStill) {
21
+ return null;
22
+ }
23
+ return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: tooltip, "aria-label": tooltip, onClick: onClick, children: (0, jsx_runtime_1.jsx)(timeline_1.TimelineIcon, { style: {
24
+ width: 16,
25
+ height: 16,
26
+ color: richTimeline ? 'var(--blue)' : 'white',
27
+ } }) }));
28
+ };
29
+ exports.RichTimelineToggle = RichTimelineToggle;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type SidebarPanel = 'input-props' | 'renders';
2
+ type SidebarPanel = 'input-props' | 'renders';
3
3
  export declare const persistSelectedPanel: (panel: SidebarPanel) => void;
4
4
  export declare const rightSidebarTabs: React.RefObject<{
5
5
  selectRendersPanel: () => void;
@@ -26,7 +26,7 @@ const PropsEditor = ({ composition }) => {
26
26
  });
27
27
  }, [composition.defaultProps, composition.id, updateProps]);
28
28
  const actualProps = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {}; }, [composition.defaultProps, composition.id, props]);
29
- return ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, compact: true, mayShowSaveButton: true, propsEditType: "default-props" }, composition.id));
29
+ return ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props" }, composition.id));
30
30
  };
31
31
  const localStorageKey = 'remotion.sidebarPanel';
32
32
  const getSelectedPanel = () => {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export declare type SegmentedControlItem = {
2
+ export type SegmentedControlItem = {
3
3
  label: React.ReactNode;
4
4
  onClick: () => void;
5
5
  key: string;
@@ -21,6 +21,8 @@ const item = {
21
21
  cursor: 'pointer',
22
22
  appearance: 'none',
23
23
  border: 'none',
24
+ flex: 1,
25
+ justifyContent: 'center',
24
26
  };
25
27
  const SegmentedControl = ({ items, needsWrapping }) => {
26
28
  const controlStyle = (0, react_1.useMemo)(() => {
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- export declare type SplitterDragState = false | {
2
+ export type SplitterDragState = false | {
3
3
  x: number;
4
4
  y: number;
5
5
  };
6
- export declare type SplitterOrientation = 'horizontal' | 'vertical';
7
- export declare type TSplitterContext = {
6
+ export type SplitterOrientation = 'horizontal' | 'vertical';
7
+ export type TSplitterContext = {
8
8
  flexValue: number;
9
9
  setFlexValue: React.Dispatch<React.SetStateAction<number>>;
10
10
  domRect: DOMRect | DOMRectReadOnly | null;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { TComposition } from 'remotion';
3
+ export declare const Thumbnail: React.FC<{
4
+ composition: TComposition<unknown>;
5
+ targetHeight: number;
6
+ targetWidth: number;
7
+ frameToDisplay: number;
8
+ }>;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Thumbnail = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const checkerboard_background_1 = require("../helpers/checkerboard-background");
8
+ const checkerboard_1 = require("../state/checkerboard");
9
+ const Thumbnail = ({ composition, targetHeight, targetWidth, frameToDisplay }) => {
10
+ const { height, width } = composition;
11
+ const heightRatio = targetHeight / height;
12
+ const widthRatio = targetWidth / width;
13
+ const ratio = Math.min(heightRatio, widthRatio);
14
+ const scale = ratio;
15
+ const actualWidth = width * scale;
16
+ const actualHeight = height * scale;
17
+ const correction = 0 - (1 - scale) / 2;
18
+ const xCorrection = correction * width;
19
+ const yCorrection = correction * height;
20
+ const [thumbnailId] = (0, react_1.useState)(() => String((0, remotion_1.random)(null)));
21
+ const { checkerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
22
+ const container = (0, react_1.useMemo)(() => {
23
+ return {
24
+ width: targetWidth,
25
+ height: targetHeight,
26
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
27
+ display: 'flex',
28
+ justifyContent: 'center',
29
+ alignItems: 'center',
30
+ };
31
+ }, [targetHeight, targetWidth]);
32
+ const outer = (0, react_1.useMemo)(() => {
33
+ return {
34
+ width: actualWidth,
35
+ height: actualHeight,
36
+ backgroundColor: (0, checkerboard_background_1.checkerboardBackgroundColor)(checkerboard),
37
+ backgroundImage: (0, checkerboard_background_1.checkerboardBackgroundImage)(checkerboard),
38
+ backgroundPosition: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(25),
39
+ backgroundSize: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(25),
40
+ };
41
+ }, [actualHeight, actualWidth, checkerboard]);
42
+ const inner = (0, react_1.useMemo)(() => {
43
+ return {
44
+ width,
45
+ height,
46
+ transform: `scale(${scale}) `,
47
+ overflow: 'hidden',
48
+ marginLeft: xCorrection,
49
+ marginTop: yCorrection,
50
+ display: 'flex',
51
+ color: 'black',
52
+ };
53
+ }, [height, scale, width, xCorrection, yCorrection]);
54
+ const timelineState = (0, react_1.useMemo)(() => {
55
+ return {
56
+ playing: false,
57
+ frame: frameToDisplay,
58
+ rootId: thumbnailId,
59
+ imperativePlaying: {
60
+ current: false,
61
+ },
62
+ playbackRate: 1,
63
+ setPlaybackRate: () => {
64
+ throw new Error('thumbnail');
65
+ },
66
+ audioAndVideoTags: { current: [] },
67
+ };
68
+ }, [frameToDisplay, thumbnailId]);
69
+ const props = (0, react_1.useMemo)(() => {
70
+ var _a;
71
+ return (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {};
72
+ }, [composition.defaultProps]);
73
+ const ThumbnailComponent = composition.component;
74
+ return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)("div", { style: outer, children: (0, jsx_runtime_1.jsx)("div", { style: inner, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.TimelineContext.Provider, { value: timelineState, children: (0, jsx_runtime_1.jsx)(ThumbnailComponent, { ...props }) }) }) }) }) }));
75
+ };
76
+ exports.Thumbnail = Thumbnail;
@@ -10,21 +10,21 @@ const width = {
10
10
  position: 'relative',
11
11
  };
12
12
  const icon = {
13
- height: 12,
14
- width: 12,
13
+ height: 14,
14
+ width: 14,
15
15
  };
16
16
  const Icon = () => ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "repeat", className: "svg-inline--fa fa-repeat fa-w-16", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: icon, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M512 256c0 88.224-71.775 160-160 160H170.067l34.512 32.419c9.875 9.276 10.119 24.883.539 34.464l-10.775 10.775c-9.373 9.372-24.568 9.372-33.941 0l-92.686-92.686c-9.373-9.373-9.373-24.568 0-33.941l92.686-92.686c9.373-9.373 24.568-9.373 33.941 0l10.775 10.775c9.581 9.581 9.337 25.187-.539 34.464L170.067 352H352c52.935 0 96-43.065 96-96 0-13.958-2.996-27.228-8.376-39.204-4.061-9.039-2.284-19.626 4.723-26.633l12.183-12.183c11.499-11.499 30.965-8.526 38.312 5.982C505.814 205.624 512 230.103 512 256zM72.376 295.204C66.996 283.228 64 269.958 64 256c0-52.935 43.065-96 96-96h181.933l-34.512 32.419c-9.875 9.276-10.119 24.883-.539 34.464l10.775 10.775c9.373 9.372 24.568 9.372 33.941 0l92.686-92.686c9.373-9.373 9.373-24.568 0-33.941l-92.686-92.686c-9.373-9.373-24.568-9.373-33.941 0L306.882 29.12c-9.581 9.581-9.337 25.187.539 34.464L341.933 96H160C71.775 96 0 167.776 0 256c0 25.897 6.186 50.376 17.157 72.039 7.347 14.508 26.813 17.481 38.312 5.982l12.183-12.183c7.008-7.008 8.786-17.595 4.724-26.634z" }) }));
17
17
  const topLine = {
18
18
  top: 0,
19
- height: 10,
19
+ height: 5,
20
20
  width: 1,
21
- background: 'linear-gradient(to top, transparent, rgba(255, 255, 255, 0.7))',
21
+ background: 'white',
22
22
  };
23
23
  const bottomLine = {
24
24
  top: 0,
25
- height: 10,
25
+ height: 5,
26
26
  width: 1,
27
- background: 'linear-gradient(to top, rgba(255, 255, 255, 0.7), transparent)',
27
+ background: 'white',
28
28
  };
29
29
  const topContainer = {
30
30
  justifyContent: 'flex-start',