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

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 (166) hide show
  1. package/dist/ansi/ansi-split.d.ts +1 -0
  2. package/dist/ansi/ansi-split.js +16 -3
  3. package/dist/benchmark.js +3 -0
  4. package/dist/color-math.d.ts +2 -0
  5. package/dist/color-math.js +11 -0
  6. package/dist/composition-prompts.d.ts +3 -4
  7. package/dist/composition-prompts.js +0 -1
  8. package/dist/compositions.js +3 -0
  9. package/dist/config/browser.d.ts +1 -3
  10. package/dist/config/browser.js +2 -12
  11. package/dist/config/index.d.ts +11 -2
  12. package/dist/config/index.js +6 -1
  13. package/dist/config/scale.d.ts +2 -1
  14. package/dist/config/user-agent.d.ts +4 -0
  15. package/dist/config/user-agent.js +12 -0
  16. package/dist/download-progress.js +7 -2
  17. package/dist/editor/components/Canvas.js +1 -4
  18. package/dist/editor/components/EditorContexts.js +2 -1
  19. package/dist/editor/components/Menu/MenuSubItem.d.ts +0 -1
  20. package/dist/editor/components/Menu/MenuSubItem.js +1 -2
  21. package/dist/editor/components/ModalContainer.d.ts +2 -0
  22. package/dist/editor/components/ModalContainer.js +12 -3
  23. package/dist/editor/components/Modals.js +1 -1
  24. package/dist/editor/components/NewComposition/InputDragger.d.ts +1 -0
  25. package/dist/editor/components/NewComposition/InputDragger.js +2 -2
  26. package/dist/editor/components/NewComposition/NewCompDuration.js +1 -1
  27. package/dist/editor/components/NewComposition/NewComposition.js +8 -5
  28. package/dist/editor/components/NewComposition/RemInput.d.ts +2 -1
  29. package/dist/editor/components/NewComposition/RemInput.js +3 -2
  30. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +7 -0
  31. package/dist/editor/components/NewComposition/RemInputTypeColor.js +53 -0
  32. package/dist/editor/components/NewComposition/ValidationMessage.js +2 -2
  33. package/dist/editor/components/Notifications/ServerDisconnected.d.ts +0 -4
  34. package/dist/editor/components/Notifications/ServerDisconnected.js +1 -2
  35. package/dist/editor/components/PlaybackRateSelector.d.ts +0 -2
  36. package/dist/editor/components/PlaybackRateSelector.js +5 -6
  37. package/dist/editor/components/Preview.d.ts +0 -1
  38. package/dist/editor/components/Preview.js +4 -4
  39. package/dist/editor/components/PreviewToolbar.js +1 -1
  40. package/dist/editor/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
  41. package/dist/editor/components/QuickSwitcher/algolia-search.d.ts +0 -27
  42. package/dist/editor/components/QuickSwitcher/algolia-search.js +2 -3
  43. package/dist/editor/components/RenderButton.js +9 -2
  44. package/dist/editor/components/RenderModal/CrfSetting.js +1 -1
  45. package/dist/editor/components/RenderModal/EnvInput.js +1 -1
  46. package/dist/editor/components/RenderModal/FrameRangeSetting.js +1 -1
  47. package/dist/editor/components/RenderModal/NumberOfLoopsSetting.js +1 -1
  48. package/dist/editor/components/RenderModal/NumberSetting.js +1 -1
  49. package/dist/editor/components/RenderModal/RenderModal.d.ts +1 -0
  50. package/dist/editor/components/RenderModal/RenderModal.js +20 -11
  51. package/dist/editor/components/RenderModal/RenderModalAudio.js +1 -1
  52. package/dist/editor/components/RenderModal/RenderModalBasic.js +1 -1
  53. package/dist/editor/components/RenderModal/RenderModalData.js +116 -13
  54. package/dist/editor/components/RenderModal/RenderModalInput.js +1 -1
  55. package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.d.ts +1 -2
  56. package/dist/editor/components/RenderModal/RenderModalPicture.js +1 -1
  57. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +1 -1
  58. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +9 -42
  59. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +11 -0
  60. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +55 -0
  61. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +1 -1
  62. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +10 -5
  63. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +14 -0
  64. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +116 -0
  65. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +1 -1
  66. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  67. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +1 -1
  68. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +7 -3
  69. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -1
  70. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +7 -3
  71. package/dist/editor/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -1
  72. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +14 -0
  73. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +10 -0
  74. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +1 -1
  75. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -2
  76. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +1 -1
  77. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +6 -2
  78. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +14 -0
  79. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +10 -0
  80. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +1 -1
  81. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +11 -4
  82. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +1 -1
  83. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +6 -1
  84. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +1 -1
  85. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +33 -17
  86. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +1 -1
  87. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +12 -8
  88. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.d.ts +2 -2
  89. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.js +64 -56
  90. package/dist/editor/components/RenderModal/WarningIndicatorButton.d.ts +6 -0
  91. package/dist/editor/components/RenderModal/WarningIndicatorButton.js +49 -0
  92. package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +11 -0
  93. package/dist/editor/components/RenderModal/get-render-modal-warnings.js +26 -0
  94. package/dist/editor/components/RenderModal/layout.js +0 -1
  95. package/dist/editor/components/RenderModal/out-name-checker.d.ts +0 -1
  96. package/dist/editor/components/RenderModal/out-name-checker.js +3 -3
  97. package/dist/editor/components/RenderQueue/actions.d.ts +0 -2
  98. package/dist/editor/components/RenderQueue/actions.js +10 -11
  99. package/dist/editor/components/RenderQueue/index.js +25 -1
  100. package/dist/editor/components/RenderToolbarIcon.js +25 -10
  101. package/dist/editor/components/SegmentedControl.d.ts +0 -5
  102. package/dist/editor/components/SegmentedControl.js +2 -3
  103. package/dist/editor/components/SizeSelector.d.ts +0 -1
  104. package/dist/editor/components/SizeSelector.js +4 -4
  105. package/dist/editor/components/Splitter/SplitterElement.js +1 -0
  106. package/dist/editor/components/Splitter/SplitterHandle.d.ts +0 -1
  107. package/dist/editor/components/Splitter/SplitterHandle.js +6 -6
  108. package/dist/editor/components/Tabs/index.d.ts +0 -1
  109. package/dist/editor/components/Tabs/index.js +3 -3
  110. package/dist/editor/components/Tabs/vertical.d.ts +0 -5
  111. package/dist/editor/components/Tabs/vertical.js +3 -17
  112. package/dist/editor/components/TimeValue.js +3 -4
  113. package/dist/editor/components/Timeline/TimelineListItem.js +9 -1
  114. package/dist/editor/components/Timeline/imperative-state.d.ts +0 -4
  115. package/dist/editor/components/Timeline/imperative-state.js +13 -13
  116. package/dist/editor/components/Timeline/timeline-scroll-logic.d.ts +0 -1
  117. package/dist/editor/components/Timeline/timeline-scroll-logic.js +5 -6
  118. package/dist/editor/components/ZoomPersistor.d.ts +0 -1
  119. package/dist/editor/components/ZoomPersistor.js +2 -3
  120. package/dist/editor/components/get-zod-if-possible.d.ts +10 -0
  121. package/dist/editor/components/get-zod-if-possible.js +79 -0
  122. package/dist/editor/helpers/calculate-timeline.d.ts +0 -4
  123. package/dist/editor/helpers/colors.d.ts +0 -1
  124. package/dist/editor/helpers/colors.js +3 -3
  125. package/dist/editor/helpers/create-folder-tree.d.ts +0 -1
  126. package/dist/editor/helpers/create-folder-tree.js +3 -4
  127. package/dist/editor/helpers/get-timeline-sequence-sort-key.d.ts +2 -1
  128. package/dist/editor/icons/caret.d.ts +4 -2
  129. package/dist/editor/icons/caret.js +17 -3
  130. package/dist/editor/state/keybindings.d.ts +2 -1
  131. package/dist/editor/state/modals.d.ts +1 -0
  132. package/dist/editor/state/preview-size.d.ts +0 -1
  133. package/dist/editor/state/preview-size.js +3 -4
  134. package/dist/editor/state/sidebar.d.ts +1 -1
  135. package/dist/editor/state/timeline-ref.d.ts +2 -1
  136. package/dist/editor/state/z-index.d.ts +0 -5
  137. package/dist/editor/state/z-index.js +8 -5
  138. package/dist/get-cli-options.js +1 -0
  139. package/dist/get-config-file-name.d.ts +0 -2
  140. package/dist/get-config-file-name.js +7 -7
  141. package/dist/get-render-media-options.js +4 -2
  142. package/dist/index.d.ts +52 -1
  143. package/dist/list-of-remotion-packages.js +1 -0
  144. package/dist/parse-command-line.d.ts +3 -1
  145. package/dist/parse-command-line.js +3 -0
  146. package/dist/preview-server/api-types.d.ts +0 -4
  147. package/dist/preview-server/dev-middleware/middleware.d.ts +0 -1
  148. package/dist/preview-server/dev-middleware/middleware.js +1 -2
  149. package/dist/preview-server/error-overlay/remotion-overlay/Button.d.ts +8 -5
  150. package/dist/preview-server/error-overlay/remotion-overlay/Button.js +5 -4
  151. package/dist/preview-server/hot-middleware/client.js +2 -2
  152. package/dist/preview-server/public-folder.d.ts +0 -5
  153. package/dist/preview-server/public-folder.js +3 -4
  154. package/dist/preview-server/render-queue/job.d.ts +1 -1
  155. package/dist/preview-server/render-queue/make-retry-payload.js +2 -0
  156. package/dist/preview-server/render-queue/queue.d.ts +1 -13
  157. package/dist/preview-server/render-queue/queue.js +13 -9
  158. package/dist/progress-bar.d.ts +1 -12
  159. package/dist/progress-bar.js +4 -15
  160. package/dist/render-flows/render.js +3 -0
  161. package/dist/render-flows/still.js +6 -0
  162. package/dist/select-composition.d.ts +2 -1
  163. package/dist/setup-cache.d.ts +2 -14
  164. package/dist/setup-cache.js +6 -5
  165. package/package.json +10 -8
  166. package/styles/styles.css +6 -0
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
- export declare const commonPlaybackRates: number[];
3
- export declare const getPlaybackRateLabel: (playbackRate: number) => string;
4
2
  export declare const PlaybackRateSelector: React.FC<{
5
3
  playbackRate: number;
6
4
  setPlaybackRate: React.Dispatch<React.SetStateAction<number>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlaybackRateSelector = exports.getPlaybackRateLabel = exports.commonPlaybackRates = void 0;
3
+ exports.PlaybackRateSelector = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
@@ -8,13 +8,12 @@ const Checkmark_1 = require("../icons/Checkmark");
8
8
  const playbackrate_1 = require("../state/playbackrate");
9
9
  const ControlButton_1 = require("./ControlButton");
10
10
  const ComboBox_1 = require("./NewComposition/ComboBox");
11
- exports.commonPlaybackRates = [
11
+ const commonPlaybackRates = [
12
12
  -4, -2, -1, -0.5, -0.25, 0.25, 0.5, 1, 2, 4,
13
13
  ];
14
14
  const getPlaybackRateLabel = (playbackRate) => {
15
15
  return `${playbackRate}x`;
16
16
  };
17
- exports.getPlaybackRateLabel = getPlaybackRateLabel;
18
17
  const accessibilityLabel = 'Change the playback rate';
19
18
  const comboStyle = { width: 80 };
20
19
  const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
@@ -29,10 +28,10 @@ const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
29
28
  type: 'divider',
30
29
  id: 'divider',
31
30
  };
32
- const values = exports.commonPlaybackRates.map((newPlaybackRate) => {
31
+ const values = commonPlaybackRates.map((newPlaybackRate) => {
33
32
  return {
34
33
  id: String(newPlaybackRate),
35
- label: (0, exports.getPlaybackRateLabel)(newPlaybackRate),
34
+ label: getPlaybackRateLabel(newPlaybackRate),
36
35
  onClick: () => {
37
36
  return setPlaybackRate(() => {
38
37
  (0, playbackrate_1.persistPlaybackRate)(newPlaybackRate);
@@ -47,7 +46,7 @@ const PlaybackRateSelector = ({ playbackRate, setPlaybackRate }) => {
47
46
  quickSwitcherLabel: null,
48
47
  };
49
48
  });
50
- const middle = Math.floor(exports.commonPlaybackRates.length / 2);
49
+ const middle = Math.floor(commonPlaybackRates.length / 2);
51
50
  return [...values.slice(0, middle), divider, ...values.slice(middle)];
52
51
  }, [playbackRate, setPlaybackRate]);
53
52
  if (isStill) {
@@ -1,6 +1,5 @@
1
1
  import type { Size } from '@remotion/player';
2
2
  import React from 'react';
3
- export declare const checkerboardSize = 49;
4
3
  export declare const VideoPreview: React.FC<{
5
4
  canvasSize: Size;
6
5
  }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VideoPreview = exports.checkerboardSize = void 0;
3
+ exports.VideoPreview = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const player_1 = require("@remotion/player");
6
6
  const react_1 = require("react");
@@ -8,7 +8,7 @@ const remotion_1 = require("remotion");
8
8
  const checkerboard_background_1 = require("../helpers/checkerboard-background");
9
9
  const checkerboard_1 = require("../state/checkerboard");
10
10
  const preview_size_1 = require("../state/preview-size");
11
- exports.checkerboardSize = 49;
11
+ const checkerboardSize = 49;
12
12
  const containerStyle = (options) => {
13
13
  return {
14
14
  transform: `scale(${options.scale})`,
@@ -20,8 +20,8 @@ const containerStyle = (options) => {
20
20
  position: 'absolute',
21
21
  backgroundColor: (0, checkerboard_background_1.checkerboardBackgroundColor)(options.checkerboard),
22
22
  backgroundImage: (0, checkerboard_background_1.checkerboardBackgroundImage)(options.checkerboard),
23
- backgroundSize: (0, checkerboard_background_1.getCheckerboardBackgroundSize)(exports.checkerboardSize) /* Must be a square */,
24
- backgroundPosition: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(exports.checkerboardSize) /* Must be half of one side of the square */,
23
+ backgroundSize: (0, checkerboard_background_1.getCheckerboardBackgroundSize)(checkerboardSize) /* Must be a square */,
24
+ backgroundPosition: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(checkerboardSize) /* Must be half of one side of the square */,
25
25
  };
26
26
  };
27
27
  const Inner = ({ canvasSize }) => {
@@ -45,6 +45,6 @@ const PreviewToolbar = () => {
45
45
  const { mediaMuted } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
46
46
  const { setMediaMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
47
47
  const [loop, setLoop] = (0, react_1.useState)((0, loop_1.loadLoopOption)());
48
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }), (0, jsx_runtime_1.jsx)(TimelineZoomControls_1.TimelineZoomControls, {})] }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), (0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(PlayPause_1.PlayPause, { loop: loop, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), (0, jsx_runtime_1.jsx)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(RenderToolbarIcon_1.RenderButton, {}), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), (0, jsx_runtime_1.jsx)("div", { style: padding })] }), (0, jsx_runtime_1.jsx)(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), (0, jsx_runtime_1.jsx)(PlaybackRatePersistor_1.PlaybackRatePersistor, {})] }));
48
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)("div", { style: padding }), (0, jsx_runtime_1.jsx)(TimelineZoomControls_1.TimelineZoomControls, {})] }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(SizeSelector_1.SizeSelector, {}), (0, jsx_runtime_1.jsx)(PlaybackRateSelector_1.PlaybackRateSelector, { setPlaybackRate: setPlaybackRate, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(PlayPause_1.PlayPause, { loop: loop, playbackRate: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(LoopToggle_1.LoopToggle, { loop: loop, setLoop: setLoop }), (0, jsx_runtime_1.jsx)(CheckboardToggle_1.CheckboardToggle, {}), (0, jsx_runtime_1.jsx)(TimelineInOutToggle_1.TimelineInOutPointToggle, {}), (0, jsx_runtime_1.jsx)(MuteToggle_1.MuteToggle, { muted: mediaMuted, setMuted: setMediaMuted }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsxs)("div", { style: sideContainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)(FpsCounter_1.FpsCounter, { playbackSpeed: playbackRate }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), (0, jsx_runtime_1.jsx)(RenderToolbarIcon_1.RenderButton, {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 })] }), (0, jsx_runtime_1.jsx)(PlaybackKeyboardShortcutsManager_1.PlaybackKeyboardShortcutsManager, { setPlaybackRate: setPlaybackRate }), (0, jsx_runtime_1.jsx)(PlaybackRatePersistor_1.PlaybackRatePersistor, {})] }));
49
49
  };
50
50
  exports.PreviewToolbar = PreviewToolbar;
@@ -267,7 +267,7 @@ const QuickSwitcherContent = ({ initialMode, invocationTimestamp }) => {
267
267
  height: 300,
268
268
  };
269
269
  }, [showKeyboardShortcuts]);
270
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsxs)("div", { style: modeSelector, children: [(0, jsx_runtime_1.jsx)("button", { onClick: onCompositionsSelected, style: mode === 'compositions' ? modeActive : modeInactive, type: "button", children: "Compositions" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("button", { onClick: onActionsSelected, style: mode === 'commands' ? modeActive : modeInactive, type: "button", children: "Actions" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("button", { onClick: onDocSearchSelected, style: mode === 'docs' ? modeActive : modeInactive, type: "button", children: "Documentation" })] }), (0, jsx_runtime_1.jsxs)("div", { style: content, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { ref: inputRef, type: "text", style: input, autoFocus: true, status: "ok", value: state.query, onChange: onTextChange, placeholder: "Search compositions..." }), showKeyboardShortcuts ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), " ", (0, jsx_runtime_1.jsx)(AlgoliaCredit_1.AlgoliaCredit, {})] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: results, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: showKeyboardShortcuts ? ((0, jsx_runtime_1.jsx)(KeyboardShortcutsExplainer_1.KeyboardShortcutsExplainer, {})) : showSearchLoadingState ? null : resultsArray.length === 0 ? ((0, jsx_runtime_1.jsx)(NoResults_1.QuickSwitcherNoResults, { mode: mode, query: actualQuery })) : (resultsArray.map((result, i) => {
270
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsxs)("div", { style: modeSelector, children: [(0, jsx_runtime_1.jsx)("button", { onClick: onCompositionsSelected, style: mode === 'compositions' ? modeActive : modeInactive, type: "button", children: "Compositions" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("button", { onClick: onActionsSelected, style: mode === 'commands' ? modeActive : modeInactive, type: "button", children: "Actions" }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("button", { onClick: onDocSearchSelected, style: mode === 'docs' ? modeActive : modeInactive, type: "button", children: "Documentation" })] }), (0, jsx_runtime_1.jsxs)("div", { style: content, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { ref: inputRef, type: "text", style: input, autoFocus: true, status: "ok", value: state.query, onChange: onTextChange, placeholder: "Search compositions...", rightAlign: false }), showKeyboardShortcuts ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }), " ", (0, jsx_runtime_1.jsx)(AlgoliaCredit_1.AlgoliaCredit, {})] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: results, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: showKeyboardShortcuts ? ((0, jsx_runtime_1.jsx)(KeyboardShortcutsExplainer_1.KeyboardShortcutsExplainer, {})) : showSearchLoadingState ? null : resultsArray.length === 0 ? ((0, jsx_runtime_1.jsx)(NoResults_1.QuickSwitcherNoResults, { mode: mode, query: actualQuery })) : (resultsArray.map((result, i) => {
271
271
  return ((0, jsx_runtime_1.jsx)(QuickSwitcherResult_1.QuickSwitcherResult, { selected: selectedIndexRounded === i, result: result }, result.id));
272
272
  })) })] }));
273
273
  };
@@ -1,29 +1,2 @@
1
1
  import type { TQuickSwitcherResult } from './QuickSwitcherResult';
2
- declare type Levels = 'lvl0' | 'lvl1' | 'lvl2' | 'lvl3' | 'lvl4' | 'lvl5' | 'lvl6';
3
- export declare type Match = {
4
- value: string;
5
- matchLevel: 'none' | 'partial' | 'full';
6
- };
7
- declare type DynamicHit = {
8
- type: 'content';
9
- _highlightResult: {
10
- content: Match;
11
- hierarchy: Record<Levels, Match>;
12
- };
13
- } | {
14
- type: Levels;
15
- _highlightResult: {
16
- hierarchy: Record<Levels, Match>;
17
- };
18
- };
19
- declare type Hit = {
20
- url: string;
21
- hierarchy: Record<Levels, string | null>;
22
- objectID: string;
23
- } & DynamicHit;
24
2
  export declare const algoliaSearch: (query: string) => Promise<TQuickSwitcherResult[]>;
25
- export declare const splitMatchIntoTitleAndSubtitle: (match: Hit) => {
26
- title: string;
27
- subtitle: string;
28
- };
29
- export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.splitMatchIntoTitleAndSubtitle = exports.algoliaSearch = void 0;
3
+ exports.algoliaSearch = void 0;
4
4
  const truthy_1 = require("../../../truthy");
5
5
  const ALGOLIA_API_KEY = '3e42dbd4f895fe93ff5cf40d860c4a85';
6
6
  const ALGOLIA_APPLICATION_ID = 'PLSDUOL1CA';
@@ -31,7 +31,7 @@ const algoliaSearch = async (query) => {
31
31
  var _a;
32
32
  const entries = Object.values(hit._highlightResult.hierarchy);
33
33
  const result = (_a = entries.find((value) => value.matchLevel === 'full')) !== null && _a !== void 0 ? _a : entries.find((value) => value.matchLevel === 'partial');
34
- const { subtitle, title } = (0, exports.splitMatchIntoTitleAndSubtitle)(hit);
34
+ const { subtitle, title } = splitMatchIntoTitleAndSubtitle(hit);
35
35
  if (!result) {
36
36
  return null;
37
37
  }
@@ -60,4 +60,3 @@ const splitMatchIntoTitleAndSubtitle = (match) => {
60
60
  .join(' • ');
61
61
  return { title, subtitle };
62
62
  };
63
- exports.splitMatchIntoTitleAndSubtitle = splitMatchIntoTitleAndSubtitle;
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RenderButton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const client_1 = require("@remotion/renderer/client");
5
6
  const react_1 = require("react");
7
+ const remotion_1 = require("remotion");
6
8
  const get_default_out_name_1 = require("../../get-default-out-name");
7
9
  const get_default_video_contexts_1 = require("../../preview-server/render-queue/get-default-video-contexts");
8
10
  const render_1 = require("../icons/render");
@@ -17,8 +19,10 @@ const RenderButton = ({ composition, visible }) => {
17
19
  },
18
20
  };
19
21
  }, []);
22
+ const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
20
23
  const isVideo = composition.durationInFrames > 1;
21
24
  const onClick = (0, react_1.useCallback)((e) => {
25
+ var _a;
22
26
  const defaults = window.remotion_renderDefaults;
23
27
  if (!defaults) {
24
28
  throw new Error('expected defaults');
@@ -39,7 +43,9 @@ const RenderButton = ({ composition, visible }) => {
39
43
  initialVerbose: defaults.logLevel === 'verbose',
40
44
  initialOutName: (0, get_default_out_name_1.getDefaultOutLocation)({
41
45
  compositionName: composition.id,
42
- defaultExtension: isVideo ? 'mp4' : 'png',
46
+ defaultExtension: isVideo
47
+ ? defaults.stillImageFormat
48
+ : client_1.BrowserSafeApis.getFileExtensionFromCodec(initialVideoCodec, defaults.audioCodec),
43
49
  type: 'asset',
44
50
  }),
45
51
  initialVideoCodecForAudioTab: initialAudioCodec,
@@ -63,8 +69,9 @@ const RenderButton = ({ composition, visible }) => {
63
69
  initialOpenGlRenderer: defaults.openGlRenderer,
64
70
  initialHeadless: defaults.headless,
65
71
  initialIgnoreCertificateErrors: defaults.ignoreCertificateErrors,
72
+ defaultProps: (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps,
66
73
  });
67
- }, [composition.id, isVideo, setSelectedModal]);
74
+ }, [composition.defaultProps, composition.id, isVideo, props, setSelectedModal]);
68
75
  if (!visible) {
69
76
  return null;
70
77
  }
@@ -33,7 +33,7 @@ const useCrfState = (codec) => {
33
33
  setCrf,
34
34
  minCrf: range[0],
35
35
  maxCrf: range[1],
36
- shouldDisplayOption: range[0] !== range[1],
36
+ shouldDisplayOption: range[0] !== range[1] && client_1.BrowserSafeApis.codecSupportsCrf(codec),
37
37
  };
38
38
  };
39
39
  exports.useCrfState = useCrfState;
@@ -69,6 +69,6 @@ const EnvInput = ({ onEnvKeyChange, onEnvValChange, envKey, envVal, onDelete, in
69
69
  setValueWarningEligible(true);
70
70
  }, []);
71
71
  const isNodeEnvKey = envKey.trim() === 'NODE_ENV';
72
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: isNodeEnvKey || isDuplicate || isKeyMissing ? 'warning' : 'ok', type: "text", placeholder: "Key", style: input, value: envKey, onBlur: makeKeyWarningEligible, autoFocus: autoFocus, onChange: handleKeyChange }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: isValMissing ? 'warning' : 'ok', placeholder: "Value", type: showInPlainText ? 'text' : 'password', style: input, value: envVal, onBlur: makeValueWarningEligible, onChange: handleValueChange }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 }), (0, jsx_runtime_1.jsx)(InlineEyeIcon_1.InlineEyeButton, { enabled: !showInPlainText, onClick: togglePlainText }), (0, jsx_runtime_1.jsx)(InlineRemoveButton_1.InlineRemoveButton, { onClick: handleDelete })] }), isNodeEnvKey ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "NODE_ENV will be overwritten by Remotion during the render process." }) })) : null, isDuplicate ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: `${envKey.toUpperCase()} is already defined.` }) })) : null, isKeyMissing ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "Key is missing." }) })) : null, isValMissing ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "Value is missing." }) })) : null] }));
72
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: isNodeEnvKey || isDuplicate || isKeyMissing ? 'warning' : 'ok', type: "text", placeholder: "Key", style: input, value: envKey, onBlur: makeKeyWarningEligible, autoFocus: autoFocus, onChange: handleKeyChange, rightAlign: false }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: isValMissing ? 'warning' : 'ok', placeholder: "Value", type: showInPlainText ? 'text' : 'password', style: input, value: envVal, onBlur: makeValueWarningEligible, onChange: handleValueChange, rightAlign: false }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1.5 }), (0, jsx_runtime_1.jsx)(InlineEyeIcon_1.InlineEyeButton, { enabled: !showInPlainText, onClick: togglePlainText }), (0, jsx_runtime_1.jsx)(InlineRemoveButton_1.InlineRemoveButton, { onClick: handleDelete })] }), isNodeEnvKey ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "NODE_ENV will be overwritten by Remotion during the render process." }) })) : null, isDuplicate ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: `${envKey.toUpperCase()} is already defined.` }) })) : null, isKeyMissing ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "Key is missing." }) })) : null, isValMissing ? ((0, jsx_runtime_1.jsx)("div", { style: validationStyle, children: (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", type: "warning", message: "Value is missing." }) })) : null] }));
73
73
  };
74
74
  exports.EnvInput = EnvInput;
@@ -37,6 +37,6 @@ const FrameRangeSetting = ({ startFrame, endFrame, setEndFrame, durationInFrames
37
37
  return newEndFrameClamped;
38
38
  });
39
39
  }, [maxEndFrame, minEndFrame, setEndFrame]);
40
- return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Frame range" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: startFrame, onTextChange: onStartFrameChanged, placeholder: `${minStartFrame}-${maxStartFrame}`, onValueChange: onStartFrameChangedDirectly, name: "startFrame", step: 1, min: minStartFrame, max: maxStartFrame, status: "ok" }) }), (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: endFrame, onTextChange: onEndFrameChanged, placeholder: `${minEndFrame}-${maxEndFrame}`, onValueChange: onEndFrameChangedDirectly, name: "endFrame", step: 1, min: minEndFrame, max: maxEndFrame, status: "ok" }) })] })] }));
40
+ return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Frame range" }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.rightRow, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: startFrame, onTextChange: onStartFrameChanged, placeholder: `${minStartFrame}-${maxStartFrame}`, onValueChange: onStartFrameChangedDirectly, name: "startFrame", step: 1, min: minStartFrame, max: maxStartFrame, status: "ok", rightAlign: true }) }), (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: endFrame, onTextChange: onEndFrameChanged, placeholder: `${minEndFrame}-${maxEndFrame}`, onValueChange: onEndFrameChangedDirectly, name: "endFrame", step: 1, min: minEndFrame, max: maxEndFrame, status: "ok", rightAlign: true }) })] })] }));
41
41
  };
42
42
  exports.FrameRangeSetting = FrameRangeSetting;
@@ -21,6 +21,6 @@ const NumberOfLoopsSetting = ({ numberOfGifLoops, setNumberOfGifLoops }) => {
21
21
  return newConcurrencyClamped;
22
22
  });
23
23
  }, [setNumberOfGifLoops]);
24
- return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Number of loops" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: numberOfGifLoops, onTextChange: onNumberOfGifLoopsChanged, placeholder: `${min}-`, onValueChange: onNumberOfGifLoopsChangedDirectly, name: "number-of-gif-loops", step: 1, min: min, status: "ok" }) }) })] }));
24
+ return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Number of loops" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: numberOfGifLoops, onTextChange: onNumberOfGifLoopsChanged, placeholder: `${min}-`, onValueChange: onNumberOfGifLoopsChangedDirectly, name: "number-of-gif-loops", step: 1, min: min, status: "ok", rightAlign: true }) }) })] }));
25
25
  };
26
26
  exports.NumberOfLoopsSetting = NumberOfLoopsSetting;
@@ -24,6 +24,6 @@ const NumberSetting = ({ name, value, step, hint, onValueChanged, max, min, form
24
24
  }, [onValueChanged]);
25
25
  return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.label, children: [name, hint ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.25 }), ' ', (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: hint }) })] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: value, name: name.toLowerCase(), onTextChange: onTextChanged, onValueChange: onValueChange, step: step, placeholder: [min, max]
26
26
  .map((f) => (f !== null && f !== undefined ? f : ''))
27
- .join('-'), min: min, max: max, formatter: formatter, status: "ok" }) }) })] }));
27
+ .join('-'), min: min, max: max, formatter: formatter, status: "ok", rightAlign: true }) }) })] }));
28
28
  };
29
29
  exports.NumberSetting = NumberSetting;
@@ -31,4 +31,5 @@ export declare const RenderModal: React.FC<{
31
31
  initialGl: OpenGlRenderer | null;
32
32
  initialIgnoreCertificateErrors: boolean;
33
33
  initialHeadless: boolean;
34
+ defaultProps: unknown;
34
35
  }>;
@@ -57,17 +57,17 @@ const container = {
57
57
  flexDirection: 'row',
58
58
  alignItems: 'center',
59
59
  padding: '12px 16px',
60
- width: '100%',
61
60
  borderBottom: '1px solid black',
62
61
  };
63
62
  const rightPanel = {
64
- height: 600,
65
- width: 650,
66
63
  display: 'flex',
64
+ width: '100%',
65
+ height: 600,
67
66
  };
68
67
  const horizontalLayout = {
69
68
  display: 'flex',
70
69
  flexDirection: 'row',
70
+ overflowY: 'auto',
71
71
  };
72
72
  const leftSidebar = {
73
73
  padding: 12,
@@ -103,7 +103,12 @@ const buttonStyle = {
103
103
  const flexer = {
104
104
  flex: 1,
105
105
  };
106
- const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialVerbose, initialOutName, initialRenderType, initialVideoCodecForAudioTab, initialVideoCodecForVideoTab, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialAudioCodec, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, }) => {
106
+ const outer = {
107
+ width: (0, ModalContainer_1.getMaxModalWidth)(1000),
108
+ height: (0, ModalContainer_1.getMaxModalHeight)(640),
109
+ overflow: 'hidden',
110
+ };
111
+ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialVerbose, initialOutName, initialRenderType, initialVideoCodecForAudioTab, initialVideoCodecForVideoTab, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialAudioCodec, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, defaultProps, }) => {
107
112
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
108
113
  const onQuit = (0, react_1.useCallback)(() => {
109
114
  setSelectedModal(null);
@@ -135,6 +140,8 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
135
140
  disableWebSecurity,
136
141
  ignoreCertificateErrors,
137
142
  gl: openGlOption === 'default' ? null : openGlOption,
143
+ // TODO: Make this configurable at some point (not necessary for V4)
144
+ userAgent: null,
138
145
  };
139
146
  }, [headless, disableWebSecurity, ignoreCertificateErrors, openGlOption]);
140
147
  const [outName, setOutName] = (0, react_1.useState)(() => initialOutName);
@@ -209,7 +216,7 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
209
216
  if (currentComposition === null) {
210
217
  throw new Error('This composition does not exist');
211
218
  }
212
- const [inputProps, setInputProps] = (0, react_1.useState)(() => currentComposition.defaultProps);
219
+ const [inputProps, setInputProps] = (0, react_1.useState)(() => defaultProps);
213
220
  const endFrame = (0, react_1.useMemo)(() => {
214
221
  if (endFrameOrNull === null) {
215
222
  return currentComposition.durationInFrames - 1;
@@ -556,11 +563,13 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
556
563
  triggerIfInputFieldFocused: false,
557
564
  });
558
565
  }, [registerKeybinding, trigger]);
559
- return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${compositionId}` }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: flexer }), (0, jsx_runtime_1.jsxs)(Button_1.Button, { autoFocus: true, onClick: trigger, disabled: renderDisabled, style: {
560
- ...buttonStyle,
561
- backgroundColor: outnameValidation.valid
562
- ? 'var(--blue)'
563
- : 'var(--blue-disabled)',
564
- }, children: [state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...', (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftSidebar, children: [shownTabs.includes('general') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: icon }) }), "General"] })) : null, shownTabs.includes('data') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: icon }) }), "Input Props"] })) : null, shownTabs.includes('picture') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: icon }) }), "Picture"] })) : null, shownTabs.includes('audio') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(audio_1.AudioIcon, { style: icon }) }), "Audio"] })) : null, shownTabs.includes('gif') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'gif', onClick: () => setTab('gif'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gif_1.GifIcon, { style: icon }) }), "GIF"] })) : null, shownTabs.includes('advanced') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gear_1.GearIcon, { style: icon }) }), "Other"] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: rightPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? ((0, jsx_runtime_1.jsx)(RenderModalBasic_1.RenderModalBasic, { codec: codec, currentComposition: currentComposition, frame: frame, imageFormatOptions: imageFormatOptions, outName: outName, proResProfile: proResProfile, renderMode: renderMode, setVideoCodec: setCodec, setFrame: setFrame, setOutName: setOutName, setProResProfile: setProResProfile, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message })) : tab === 'picture' ? ((0, jsx_runtime_1.jsx)(RenderModalPicture_1.RenderModalPicture, { renderMode: renderMode, scale: scale, setScale: setScale, pixelFormat: pixelFormat, setPixelFormat: setPixelFormat, imageFormatOptions: imageFormatOptions, crf: crf, setCrf: setCrf, customTargetVideoBitrate: customTargetVideoBitrate, maxCrf: maxCrf, minCrf: minCrf, jpegQuality: jpegQuality, qualityControlType: qualityControlType, setJpegQuality: setJpegQuality, setCustomTargetVideoBitrateValue: setCustomTargetVideoBitrateValue, setQualityControl: setQualityControl, shouldDisplayCrfOption: shouldDisplayCrfOption, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat })) : tab === 'audio' ? ((0, jsx_runtime_1.jsx)(RenderModalAudio_1.RenderModalAudio, { muted: muted, renderMode: renderMode, setMuted: setMuted, codec: codec, audioCodec: audioCodec, setAudioCodec: setAudioCodec, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrackState: setEnforceAudioTrackState, customTargetAudioBitrate: customTargetAudioBitrate, setCustomTargetAudioBitrateValue: setCustomTargetAudioBitrateValue, setShouldHaveCustomTargetAudioBitrate: setShouldHaveCustomTargetAudioBitrate, shouldHaveCustomTargetAudioBitrate: shouldHaveCustomTargetAudioBitrate })) : tab === 'gif' ? ((0, jsx_runtime_1.jsx)(RenderModalGif_1.RenderModalGif, { everyNthFrame: everyNthFrame, limitNumberOfGifLoops: limitNumberOfGifLoops, numberOfGifLoopsSetting: numberOfGifLoopsSetting, setEveryNthFrameSetting: setEveryNthFrameSetting, setLimitNumberOfGifLoops: setLimitNumberOfGifLoops, setNumberOfGifLoopsSetting: setNumberOfGifLoopsSetting })) : tab === 'data' ? ((0, jsx_runtime_1.jsx)(RenderModalData_1.RenderModalData, { inputProps: inputProps, setInputProps: setInputProps, composition: currentComposition, compact: false, mayShowSaveButton: false })) : ((0, jsx_runtime_1.jsx)(RenderModalAdvanced_1.RenderModalAdvanced, { concurrency: concurrency, maxConcurrency: maxConcurrency, minConcurrency: minConcurrency, renderMode: renderMode, setConcurrency: setConcurrency, setVerboseLogging: setVerboseLogging, verbose: verbose, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, disallowParallelEncoding: disallowParallelEncoding, setDisallowParallelEncoding: setDisallowParallelEncoding, setDisableWebSecurity: setDisableWebSecurity, setIgnoreCertificateErrors: setIgnoreCertificateErrors, setHeadless: setHeadless, headless: headless, ignoreCertificateErrors: ignoreCertificateErrors, disableWebSecurity: disableWebSecurity, openGlOption: openGlOption, setOpenGlOption: setOpenGlOption, setEnvVariables: setEnvVariables, envVariables: envVariables })) })] })] }));
566
+ return ((0, jsx_runtime_1.jsx)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: (0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${compositionId}` }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: flexer }), (0, jsx_runtime_1.jsxs)(Button_1.Button, { autoFocus: true, onClick: trigger, disabled: renderDisabled, style: {
567
+ ...buttonStyle,
568
+ backgroundColor: outnameValidation.valid
569
+ ? 'var(--blue)'
570
+ : 'var(--blue-disabled)',
571
+ }, children: [state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...', (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftSidebar, children: [shownTabs.includes('general') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: icon }) }), "General"] })) : null, shownTabs.includes('data') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: icon }) }), "Input Props"] })) : null, shownTabs.includes('picture') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: icon }) }), "Picture"] })) : null, shownTabs.includes('audio') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(audio_1.AudioIcon, { style: icon }) }), "Audio"] })) : null, shownTabs.includes('gif') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'gif', onClick: () => setTab('gif'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gif_1.GifIcon, { style: icon }) }), "GIF"] })) : null, shownTabs.includes('advanced') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gear_1.GearIcon, { style: icon }) }), "Other"] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: rightPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? ((0, jsx_runtime_1.jsx)(RenderModalBasic_1.RenderModalBasic, { codec: codec, currentComposition: currentComposition, frame: frame, imageFormatOptions: imageFormatOptions, outName: outName, proResProfile: proResProfile, renderMode: renderMode, setVideoCodec: setCodec, setFrame: setFrame, setOutName: setOutName, setProResProfile: setProResProfile, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame, validationMessage: outnameValidation.valid
572
+ ? null
573
+ : outnameValidation.error.message })) : tab === 'picture' ? ((0, jsx_runtime_1.jsx)(RenderModalPicture_1.RenderModalPicture, { renderMode: renderMode, scale: scale, setScale: setScale, pixelFormat: pixelFormat, setPixelFormat: setPixelFormat, imageFormatOptions: imageFormatOptions, crf: crf, setCrf: setCrf, customTargetVideoBitrate: customTargetVideoBitrate, maxCrf: maxCrf, minCrf: minCrf, jpegQuality: jpegQuality, qualityControlType: qualityControlType, setJpegQuality: setJpegQuality, setCustomTargetVideoBitrateValue: setCustomTargetVideoBitrateValue, setQualityControl: setQualityControl, shouldDisplayCrfOption: shouldDisplayCrfOption, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat })) : tab === 'audio' ? ((0, jsx_runtime_1.jsx)(RenderModalAudio_1.RenderModalAudio, { muted: muted, renderMode: renderMode, setMuted: setMuted, codec: codec, audioCodec: audioCodec, setAudioCodec: setAudioCodec, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrackState: setEnforceAudioTrackState, customTargetAudioBitrate: customTargetAudioBitrate, setCustomTargetAudioBitrateValue: setCustomTargetAudioBitrateValue, setShouldHaveCustomTargetAudioBitrate: setShouldHaveCustomTargetAudioBitrate, shouldHaveCustomTargetAudioBitrate: shouldHaveCustomTargetAudioBitrate })) : tab === 'gif' ? ((0, jsx_runtime_1.jsx)(RenderModalGif_1.RenderModalGif, { everyNthFrame: everyNthFrame, limitNumberOfGifLoops: limitNumberOfGifLoops, numberOfGifLoopsSetting: numberOfGifLoopsSetting, setEveryNthFrameSetting: setEveryNthFrameSetting, setLimitNumberOfGifLoops: setLimitNumberOfGifLoops, setNumberOfGifLoopsSetting: setNumberOfGifLoopsSetting })) : tab === 'data' ? ((0, jsx_runtime_1.jsx)(RenderModalData_1.RenderModalData, { inputProps: inputProps, setInputProps: setInputProps, composition: currentComposition, compact: false, mayShowSaveButton: false })) : ((0, jsx_runtime_1.jsx)(RenderModalAdvanced_1.RenderModalAdvanced, { concurrency: concurrency, maxConcurrency: maxConcurrency, minConcurrency: minConcurrency, renderMode: renderMode, setConcurrency: setConcurrency, setVerboseLogging: setVerboseLogging, verbose: verbose, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, disallowParallelEncoding: disallowParallelEncoding, setDisallowParallelEncoding: setDisallowParallelEncoding, setDisableWebSecurity: setDisableWebSecurity, setIgnoreCertificateErrors: setIgnoreCertificateErrors, setHeadless: setHeadless, headless: headless, ignoreCertificateErrors: ignoreCertificateErrors, disableWebSecurity: disableWebSecurity, openGlOption: openGlOption, setOpenGlOption: setOpenGlOption, setEnvVariables: setEnvVariables, envVariables: envVariables })) })] })] }) }));
565
574
  };
566
575
  exports.RenderModal = RenderModal;
@@ -41,6 +41,6 @@ const RenderModalAudio = ({ muted, setMuted, renderMode, enforceAudioTrack, setE
41
41
  };
42
42
  });
43
43
  }, [codec, setAudioCodec]);
44
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' && audioCodecOptions(codec).length >= 2 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Audio Codec" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: audioCodecOptions(codec), selectedId: audioCodec, title: "AudioCodec" }) })] })) : null, renderMode === 'video' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MutedSetting_1.MutedSetting, { enforceAudioTrack: enforceAudioTrack, muted: muted, setMuted: setMuted, hint: client_1.BrowserSafeApis.options.muteOption }), (0, jsx_runtime_1.jsx)(EnforceAudioTrackSetting_1.EnforceAudioTrackSetting, { muted: muted, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrack: setEnforceAudioTrackState, option: client_1.BrowserSafeApis.options.enforceAudioOption }), (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {})] })), renderMode === 'still' ? null : ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Custom audio bitrate" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: shouldHaveCustomTargetAudioBitrate, onChange: onShouldHaveTargetAudioBitrateChanged }) })] })), shouldHaveCustomTargetAudioBitrate && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Target audio bitrate" }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.audioBitrateOption }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { style: layout_1.input, value: customTargetAudioBitrate, onChange: onTargetAudioBitrateChanged, status: "ok" }) }) })] })) : null] }));
44
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'video' && audioCodecOptions(codec).length >= 2 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Audio Codec" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: audioCodecOptions(codec), selectedId: audioCodec, title: "AudioCodec" }) })] })) : null, renderMode === 'video' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MutedSetting_1.MutedSetting, { enforceAudioTrack: enforceAudioTrack, muted: muted, setMuted: setMuted, hint: client_1.BrowserSafeApis.options.muteOption }), (0, jsx_runtime_1.jsx)(EnforceAudioTrackSetting_1.EnforceAudioTrackSetting, { muted: muted, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrack: setEnforceAudioTrackState, option: client_1.BrowserSafeApis.options.enforceAudioOption }), (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {})] })), renderMode === 'still' ? null : ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Custom audio bitrate" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: shouldHaveCustomTargetAudioBitrate, onChange: onShouldHaveTargetAudioBitrateChanged }) })] })), shouldHaveCustomTargetAudioBitrate && renderMode !== 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Target audio bitrate" }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.audioBitrateOption }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { style: layout_1.input, value: customTargetAudioBitrate, onChange: onTargetAudioBitrateChanged, status: "ok", rightAlign: true }) }) })] })) : null] }));
45
45
  };
46
46
  exports.RenderModalAudio = RenderModalAudio;
@@ -74,6 +74,6 @@ const RenderModalBasic = ({ renderMode, imageFormatOptions, outName, codec, setV
74
74
  const onValueChange = (0, react_1.useCallback)((e) => {
75
75
  setOutName(e.target.value);
76
76
  }, [setOutName]);
77
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: true }) })] })) : ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.label, children: ["Codec", (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.videoCodecOption }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: videoCodecOptions, selectedId: codec, title: "Codec" }) })] })), renderMode === 'still' && currentComposition.durationInFrames > 1 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Frame" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: frame, onTextChange: onFrameChanged, placeholder: `0-${currentComposition.durationInFrames - 1}`, onValueChange: onFrameSetDirectly, name: "frame", step: 1, min: 0, status: "ok", max: currentComposition.durationInFrames - 1 }) }) })] })) : null, renderMode === 'video' && codec === 'prores' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "ProRes profile" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: proResProfile, selectedId: proResProfile, values: proResProfileOptions }) })] })) : null, renderMode === 'still' ? null : ((0, jsx_runtime_1.jsx)(FrameRangeSetting_1.FrameRangeSetting, { durationInFrames: currentComposition.durationInFrames, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame })), (0, jsx_runtime_1.jsx)(RenderModalInput_1.RenderModalInput, { existence: existence, inputStyle: layout_1.input, outName: outName, onValueChange: onValueChange, validationMessage: validationMessage })] }));
77
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: true }) })] })) : ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.label, children: ["Codec", (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: client_1.BrowserSafeApis.options.videoCodecOption }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: videoCodecOptions, selectedId: codec, title: "Codec" }) })] })), renderMode === 'still' && currentComposition.durationInFrames > 1 ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Frame" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(RemInput_1.RightAlignInput, { children: (0, jsx_runtime_1.jsx)(InputDragger_1.InputDragger, { value: frame, onTextChange: onFrameChanged, placeholder: `0-${currentComposition.durationInFrames - 1}`, onValueChange: onFrameSetDirectly, name: "frame", step: 1, min: 0, status: "ok", max: currentComposition.durationInFrames - 1, rightAlign: true }) }) })] })) : null, renderMode === 'video' && codec === 'prores' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "ProRes profile" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: proResProfile, selectedId: proResProfile, values: proResProfileOptions }) })] })) : null, renderMode === 'still' ? null : ((0, jsx_runtime_1.jsx)(FrameRangeSetting_1.FrameRangeSetting, { durationInFrames: currentComposition.durationInFrames, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame })), (0, jsx_runtime_1.jsx)(RenderModalInput_1.RenderModalInput, { existence: existence, inputStyle: layout_1.input, outName: outName, onValueChange: onValueChange, validationMessage: validationMessage })] }));
78
78
  };
79
79
  exports.RenderModalBasic = RenderModalBasic;
@@ -1,16 +1,59 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.RenderModalData = void 0;
4
27
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
28
+ const react_1 = __importStar(require("react"));
6
29
  const remotion_1 = require("remotion");
30
+ const client_id_1 = require("../../helpers/client-id");
7
31
  const colors_1 = require("../../helpers/colors");
8
- const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
32
+ const get_zod_if_possible_1 = require("../get-zod-if-possible");
9
33
  const layout_1 = require("../layout");
34
+ const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
10
35
  const actions_1 = require("../RenderQueue/actions");
11
36
  const SegmentedControl_1 = require("../SegmentedControl");
37
+ const get_render_modal_warnings_1 = require("./get-render-modal-warnings");
12
38
  const RenderModalJSONInputPropsEditor_1 = require("./RenderModalJSONInputPropsEditor");
13
39
  const SchemaEditor_1 = require("./SchemaEditor/SchemaEditor");
40
+ const SchemaErrorMessages_1 = require("./SchemaEditor/SchemaErrorMessages");
41
+ const WarningIndicatorButton_1 = require("./WarningIndicatorButton");
42
+ const errorExplanation = {
43
+ fontSize: 14,
44
+ color: colors_1.LIGHT_TEXT,
45
+ fontFamily: 'sans-serif',
46
+ lineHeight: 1.5,
47
+ };
48
+ const explainer = {
49
+ display: 'flex',
50
+ flex: 1,
51
+ flexDirection: 'column',
52
+ padding: '0 12px',
53
+ justifyContent: 'center',
54
+ alignItems: 'center',
55
+ textAlign: 'center',
56
+ };
14
57
  const outer = {
15
58
  display: 'flex',
16
59
  flexDirection: 'column',
@@ -27,26 +70,58 @@ const tabWrapper = {
27
70
  display: 'flex',
28
71
  marginBottom: '4px',
29
72
  flexDirection: 'row',
73
+ alignItems: 'center',
30
74
  };
31
- const spacer = {
32
- flex: 1,
75
+ const persistanceKey = 'remotion.show-render-modalwarning';
76
+ const getPersistedShowWarningState = () => {
77
+ const val = localStorage.getItem(persistanceKey);
78
+ if (!val) {
79
+ return true;
80
+ }
81
+ return val === 'true';
82
+ };
83
+ const setPersistedShowWarningState = (val) => {
84
+ localStorage.setItem(persistanceKey, String(Boolean(val)));
33
85
  };
34
86
  const RenderModalData = ({ composition, inputProps, setInputProps, compact, mayShowSaveButton }) => {
35
87
  const [mode, setMode] = (0, react_1.useState)('schema');
36
88
  const [valBeforeSafe, setValBeforeSafe] = (0, react_1.useState)(inputProps);
37
- const zodValidationResult = (0, react_1.useMemo)(() => {
38
- return composition.schema.safeParse(inputProps);
39
- }, [composition.schema, inputProps]);
89
+ const [showWarning, setShowWarningWithoutPersistance] = (0, react_1.useState)(() => getPersistedShowWarningState());
40
90
  const cliProps = (0, remotion_1.getInputProps)();
41
91
  const [canSaveDefaultProps, setCanSaveDefaultProps] = (0, react_1.useState)({
42
92
  canUpdate: false,
43
93
  reason: 'Loading...',
44
94
  determined: false,
45
95
  });
46
- const showSaveButton = mayShowSaveButton && canSaveDefaultProps.canUpdate;
47
- // TODO: Disable if Preview Server is disconnected
48
- // TODO: Update if root file is updated
49
- // TODO: Segment the state for different compositions
96
+ const z = (0, get_zod_if_possible_1.useZodIfPossible)();
97
+ const schema = (0, react_1.useMemo)(() => {
98
+ if (!z) {
99
+ return 'no-zod';
100
+ }
101
+ if (!composition.schema) {
102
+ return z.any();
103
+ }
104
+ if (!(typeof composition.schema.safeParse === 'function')) {
105
+ throw new Error('A value which is not a Zod schema was passed to `schema`');
106
+ }
107
+ return composition.schema;
108
+ }, [composition.schema, z]);
109
+ const zodValidationResult = (0, react_1.useMemo)(() => {
110
+ if (schema === 'no-zod') {
111
+ return 'no-zod';
112
+ }
113
+ return schema.safeParse(inputProps);
114
+ }, [inputProps, schema]);
115
+ const setShowWarning = (0, react_1.useCallback)((val) => {
116
+ setShowWarningWithoutPersistance((prevVal) => {
117
+ if (typeof val === 'boolean') {
118
+ setPersistedShowWarningState(val);
119
+ return val;
120
+ }
121
+ setPersistedShowWarningState(val(prevVal));
122
+ return val(prevVal);
123
+ });
124
+ }, []);
50
125
  (0, react_1.useEffect)(() => {
51
126
  (0, actions_1.canUpdateDefaultProps)(composition.id)
52
127
  .then((can) => {
@@ -101,7 +176,35 @@ const RenderModalData = ({ composition, inputProps, setInputProps, compact, mayS
101
176
  const onSave = (0, react_1.useCallback)((updater) => {
102
177
  (0, actions_1.updateDefaultProps)(composition.id, updater(composition.defaultProps));
103
178
  }, [composition.defaultProps, composition.id]);
104
- return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsxs)("div", { style: controlContainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: tabWrapper, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: modeItems, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: spacer })] }), Object.keys(cliProps).length > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: "The data that was passed using --props takes priority over the data you enter here.", align: "flex-start", type: "warning" })] })) : null, canSaveDefaultProps.canUpdate === false &&
105
- canSaveDefaultProps.determined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: `Can't save default props: ${canSaveDefaultProps.reason}`, align: "flex-start", type: "warning" })] })) : null] }), mode === 'schema' ? ((0, jsx_runtime_1.jsx)(SchemaEditor_1.SchemaEditor, { value: inputProps, setValue: setInputProps, schema: composition.schema, zodValidationResult: zodValidationResult, compact: compact, defaultProps: composition.defaultProps, onSave: onSave, showSaveButton: showSaveButton })) : ((0, jsx_runtime_1.jsx)(RenderModalJSONInputPropsEditor_1.RenderModalJSONInputPropsEditor, { value: inputProps !== null && inputProps !== void 0 ? inputProps : {}, setValue: setInputProps, zodValidationResult: zodValidationResult, switchToSchema: switchToSchema, onSave: onUpdate, valBeforeSafe: valBeforeSafe, showSaveButton: showSaveButton }))] }));
179
+ const connectionStatus = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type;
180
+ const warnings = (0, react_1.useMemo)(() => {
181
+ return (0, get_render_modal_warnings_1.getRenderModalWarnings)({ canSaveDefaultProps, cliProps });
182
+ }, [canSaveDefaultProps, cliProps]);
183
+ if (connectionStatus === 'disconnected') {
184
+ return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "The preview server has disconnected. Reconnect to edit the schema." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
185
+ }
186
+ if (schema === 'no-zod') {
187
+ // TODO: Make nicer modal for Zod
188
+ return (0, jsx_runtime_1.jsx)("div", { children: "Install zod" });
189
+ }
190
+ if (!z) {
191
+ throw new Error('expected zod');
192
+ }
193
+ if (zodValidationResult === 'no-zod') {
194
+ throw new Error('expected zod');
195
+ }
196
+ const def = schema._def;
197
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
198
+ const typeName = def.typeName;
199
+ if (typeName === z.ZodFirstPartyTypeKind.ZodAny) {
200
+ return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.NoSchemaDefined, {});
201
+ }
202
+ if (!composition.defaultProps) {
203
+ return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.NoDefaultProps, {});
204
+ }
205
+ const showSaveButton = mayShowSaveButton && canSaveDefaultProps.canUpdate;
206
+ return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsxs)("div", { style: controlContainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: tabWrapper, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: modeItems, needsWrapping: false }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), warnings.length > 0 ? ((0, jsx_runtime_1.jsx)(WarningIndicatorButton_1.WarningIndicatorButton, { setShowWarning: setShowWarning, showWarning: showWarning, warningCount: warnings.length })) : null] }), showWarning && warnings.length > 0
207
+ ? warnings.map((warning) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: warning, align: "flex-start", type: "warning" })] }, warning)))
208
+ : null] }), mode === 'schema' ? ((0, jsx_runtime_1.jsx)(SchemaEditor_1.SchemaEditor, { value: inputProps, setValue: setInputProps, schema: schema, zodValidationResult: zodValidationResult, compact: compact, defaultProps: composition.defaultProps, onSave: onSave, showSaveButton: showSaveButton })) : ((0, jsx_runtime_1.jsx)(RenderModalJSONInputPropsEditor_1.RenderModalJSONInputPropsEditor, { value: inputProps !== null && inputProps !== void 0 ? inputProps : {}, setValue: setInputProps, zodValidationResult: zodValidationResult, switchToSchema: switchToSchema, onSave: onUpdate, valBeforeSafe: valBeforeSafe, showSaveButton: showSaveButton }))] }));
106
209
  };
107
210
  exports.RenderModalData = RenderModalData;
@@ -8,6 +8,6 @@ const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
8
8
  const layout_2 = require("./layout");
9
9
  // eslint-disable-next-line react/function-component-definition
10
10
  function RenderModalInput({ existence, inputStyle, outName, onValueChange, validationMessage, }) {
11
- return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(layout_1.Column, { children: (0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Output name" }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: validationMessage ? 'error' : existence ? 'warning' : 'ok', style: inputStyle, type: "text", value: outName, onChange: onValueChange }), validationMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: validationMessage, type: 'error' })] })) : existence ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: "Will be overwritten", type: 'warning' })] })) : null] }) })] }));
11
+ return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(layout_1.Column, { children: (0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Output name" }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: validationMessage ? 'error' : existence ? 'warning' : 'ok', style: inputStyle, type: "text", value: outName, onChange: onValueChange, rightAlign: true }), validationMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: validationMessage, type: 'error' })] })) : existence ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: "Will be overwritten", type: 'warning' })] })) : null] }) })] }));
12
12
  }
13
13
  exports.RenderModalInput = RenderModalInput;
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
- import type { z } from 'remotion';
3
2
  export declare const RenderModalJSONInputPropsEditor: React.FC<{
4
3
  value: unknown;
5
4
  setValue: React.Dispatch<React.SetStateAction<unknown>>;
6
- zodValidationResult: z.SafeParseReturnType<unknown, unknown>;
5
+ zodValidationResult: Zod.SafeParseReturnType<unknown, unknown>;
7
6
  switchToSchema: () => void;
8
7
  onSave: () => void;
9
8
  valBeforeSafe: unknown;