@remotion/cli 4.0.0-alpha7 → 4.0.0-alpha9

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 (106) hide show
  1. package/dist/codemods/update-default-props.d.ts +1 -1
  2. package/dist/codemods/update-default-props.js +0 -1
  3. package/dist/editor/components/CheckboardToggle.js +2 -1
  4. package/dist/editor/components/InlineAction.d.ts +1 -1
  5. package/dist/editor/components/InlineAction.js +6 -3
  6. package/dist/editor/components/LoopToggle.js +2 -1
  7. package/dist/editor/components/Menu/MenuItem.js +1 -1
  8. package/dist/editor/components/Menu/SubMenu.js +1 -1
  9. package/dist/editor/components/MenuBuildIndicator.js +20 -1
  10. package/dist/editor/components/Modals.js +1 -1
  11. package/dist/editor/components/NewComposition/ComboBox.js +19 -4
  12. package/dist/editor/components/NewComposition/InputDragger.js +3 -2
  13. package/dist/editor/components/NewComposition/MenuContent.d.ts +1 -0
  14. package/dist/editor/components/NewComposition/MenuContent.js +11 -3
  15. package/dist/editor/components/OpenEditorButton.d.ts +2 -0
  16. package/dist/editor/components/OpenEditorButton.js +52 -0
  17. package/dist/editor/components/RenderButton.js +5 -1
  18. package/dist/editor/components/RenderModal/CliCopyButton.js +7 -6
  19. package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +3 -2
  20. package/dist/editor/components/RenderModal/MutedSetting.js +3 -2
  21. package/dist/editor/components/RenderModal/OptionExplainer.js +1 -0
  22. package/dist/editor/components/RenderModal/RenderModal.d.ts +3 -1
  23. package/dist/editor/components/RenderModal/RenderModal.js +9 -7
  24. package/dist/editor/components/RenderModal/RenderModalAdvanced.js +0 -2
  25. package/dist/editor/components/RenderModal/RenderModalAudio.js +1 -1
  26. package/dist/editor/components/RenderModal/RenderModalBasic.js +3 -2
  27. package/dist/editor/components/RenderModal/RenderModalData.d.ts +3 -3
  28. package/dist/editor/components/RenderModal/RenderModalData.js +50 -25
  29. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -1
  30. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +5 -4
  31. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +4 -4
  32. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +3 -0
  33. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +6 -2
  34. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +4 -0
  35. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +5 -4
  36. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.d.ts +1 -1
  37. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +4 -4
  38. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +1 -0
  39. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +38 -26
  40. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +4 -2
  41. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +4 -4
  42. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +2 -1
  43. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +7 -7
  44. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +2 -1
  45. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +17 -60
  46. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +2 -1
  47. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +10 -18
  48. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +3 -2
  49. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +6 -19
  50. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +12 -26
  51. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
  52. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +4 -2
  53. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +2 -2
  54. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +2 -1
  55. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +15 -34
  56. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +6 -4
  57. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +17 -10
  58. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +4 -2
  59. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +2 -2
  60. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +4 -2
  61. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +6 -6
  62. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.d.ts +1 -0
  63. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +11 -25
  64. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +2 -1
  65. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +12 -23
  66. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +3 -2
  67. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +12 -12
  68. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +4 -2
  69. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +2 -2
  70. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +2 -0
  71. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +11 -1
  72. package/dist/editor/components/RenderModal/SchemaEditor/local-state.d.ts +16 -0
  73. package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +44 -0
  74. package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +4 -1
  75. package/dist/editor/components/RenderModal/get-render-modal-warnings.js +21 -2
  76. package/dist/editor/components/RenderModal/out-name-checker.js +1 -11
  77. package/dist/editor/components/RenderQueue/actions.d.ts +3 -3
  78. package/dist/editor/components/RightPanel.js +3 -3
  79. package/dist/editor/components/SidebarRenderButton.js +2 -0
  80. package/dist/editor/components/Spinner.d.ts +4 -0
  81. package/dist/editor/components/Spinner.js +42 -0
  82. package/dist/editor/components/Tabs/index.js +12 -14
  83. package/dist/editor/components/Timeline/TimelineSequence.js +2 -2
  84. package/dist/editor/components/TimelineInOutToggle.js +2 -1
  85. package/dist/editor/components/UpdateCheck.js +2 -1
  86. package/dist/editor/helpers/colors.d.ts +2 -0
  87. package/dist/editor/helpers/colors.js +3 -1
  88. package/dist/editor/icons/media-volume.js +2 -1
  89. package/dist/editor/state/modals.d.ts +3 -1
  90. package/dist/get-cli-options.d.ts +1 -1
  91. package/dist/get-input-props.d.ts +1 -1
  92. package/dist/index.d.ts +1 -1
  93. package/dist/list-of-remotion-packages.js +1 -0
  94. package/dist/preview-server/api-types.d.ts +2 -2
  95. package/dist/preview-server/error-overlay/remotion-overlay/HelpLink.js +2 -1
  96. package/dist/preview-server/render-queue/job.d.ts +9 -2
  97. package/dist/preview-server/render-queue/make-retry-payload.js +5 -1
  98. package/dist/preview-server/render-queue/queue.js +0 -1
  99. package/dist/preview-server/routes/update-default-props.d.ts +2 -2
  100. package/dist/preview-server/routes/update-default-props.js +23 -13
  101. package/dist/preview-server/routes.d.ts +2 -1
  102. package/dist/preview-server/start-server.js +1 -1
  103. package/dist/render-flows/render.d.ts +1 -1
  104. package/dist/render-flows/still.d.ts +1 -1
  105. package/package.json +13 -11
  106. package/styles/styles.css +4 -5
@@ -2,6 +2,6 @@ import type { EnumPath } from '../editor/components/RenderModal/SchemaEditor/ext
2
2
  export declare const updateDefaultProps: ({ input, compositionId, newDefaultProps, enumPaths, }: {
3
3
  input: string;
4
4
  compositionId: string;
5
- newDefaultProps: unknown;
5
+ newDefaultProps: Record<string, unknown>;
6
6
  enumPaths: EnumPath[];
7
7
  }) => Promise<string>;
@@ -86,7 +86,6 @@ const findTerminators = (input, position) => {
86
86
  }
87
87
  return Infinity;
88
88
  };
89
- // TODO: Add more sanity checks
90
89
  const updateDefaultProps = async ({ input, compositionId, newDefaultProps, enumPaths, }) => {
91
90
  const starter = findStarter({ input, compositionId });
92
91
  const START_TOKEN = 'defaultProps={';
@@ -4,6 +4,7 @@ exports.CheckboardToggle = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const truthy_1 = require("../../truthy");
7
+ const colors_1 = require("../helpers/colors");
7
8
  const use_keybinding_1 = require("../helpers/use-keybinding");
8
9
  const checkerboard_1 = require("../state/checkerboard");
9
10
  const ControlButton_1 = require("./ControlButton");
@@ -20,6 +21,6 @@ const CheckboardToggle = () => {
20
21
  return !c;
21
22
  });
22
23
  }, [setCheckerboard]);
23
- return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "game-board-alt", className: "svg-inline--fa fa-game-board-alt fa-w-16", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 16, height: 16 }, children: (0, jsx_runtime_1.jsx)("path", { fill: checkerboard ? 'var(--blue)' : 'white', d: "M480 0H32A32 32 0 0 0 0 32v448a32 32 0 0 0 32 32h448a32 32 0 0 0 32-32V32a32 32 0 0 0-32-32zm-32 256H256v192H64V256h192V64h192z" }) }) }));
24
+ return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "game-board-alt", className: "svg-inline--fa fa-game-board-alt fa-w-16", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: { width: 16, height: 16 }, children: (0, jsx_runtime_1.jsx)("path", { fill: checkerboard ? colors_1.BLUE : 'white', d: "M480 0H32A32 32 0 0 0 0 32v448a32 32 0 0 0 32 32h448a32 32 0 0 0 32-32V32a32 32 0 0 0-32-32zm-32 256H256v192H64V256h192V64h192z" }) }) }));
24
25
  };
25
26
  exports.CheckboardToggle = CheckboardToggle;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export declare type RenderInlineAction = (color: string) => React.ReactNode;
3
3
  export declare const InlineAction: React.FC<{
4
- onClick: React.MouseEventHandler<HTMLButtonElement>;
4
+ onClick: React.MouseEventHandler<HTMLAnchorElement>;
5
5
  disabled?: boolean;
6
6
  renderAction: RenderInlineAction;
7
7
  }>;
@@ -17,15 +17,18 @@ const InlineAction = ({ renderAction, onClick, disabled }) => {
17
17
  const style = (0, react_1.useMemo)(() => {
18
18
  return {
19
19
  border: 'none',
20
- background: (0, colors_1.getBackgroundFromHoverState)({ hovered, selected: false }),
20
+ background: disabled
21
+ ? 'transparent'
22
+ : (0, colors_1.getBackgroundFromHoverState)({ hovered, selected: false }),
21
23
  height: 24,
22
24
  width: 24,
23
25
  display: 'inline-flex',
24
26
  justifyContent: 'center',
25
27
  alignItems: 'center',
26
28
  borderRadius: 3,
29
+ pointerEvents: disabled ? 'none' : 'auto',
27
30
  };
28
- }, [hovered]);
29
- return ((0, jsx_runtime_1.jsx)("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, disabled: disabled, children: renderAction(hovered ? 'white' : colors_1.LIGHT_TEXT) }));
31
+ }, [disabled, hovered]);
32
+ return ((0, jsx_runtime_1.jsx)("a", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, children: renderAction(hovered ? 'white' : colors_1.LIGHT_TEXT) }));
30
33
  };
31
34
  exports.InlineAction = InlineAction;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LoopToggle = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const colors_1 = require("../helpers/colors");
6
7
  const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
7
8
  const loop_1 = require("../state/loop");
8
9
  const ControlButton_1 = require("./ControlButton");
@@ -18,6 +19,6 @@ const LoopToggle = ({ loop, setLoop }) => {
18
19
  if (isStill) {
19
20
  return null;
20
21
  }
21
- return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", style: { width: 18, height: 18 }, children: (0, jsx_runtime_1.jsx)("path", { fill: loop ? 'var(--blue)' : 'white', d: "M493.544 181.463c11.956 22.605 18.655 48.4 18.452 75.75C511.339 345.365 438.56 416 350.404 416H192v47.495c0 22.475-26.177 32.268-40.971 17.475l-80-80c-9.372-9.373-9.372-24.569 0-33.941l80-80C166.138 271.92 192 282.686 192 304v48h158.875c52.812 0 96.575-42.182 97.12-94.992.155-15.045-3.17-29.312-9.218-42.046-4.362-9.185-2.421-20.124 4.8-27.284 4.745-4.706 8.641-8.555 11.876-11.786 11.368-11.352 30.579-8.631 38.091 5.571zM64.005 254.992c.545-52.81 44.308-94.992 97.12-94.992H320v47.505c0 22.374 26.121 32.312 40.971 17.465l80-80c9.372-9.373 9.372-24.569 0-33.941l-80-80C346.014 16.077 320 26.256 320 48.545V96H161.596C73.44 96 .661 166.635.005 254.788c-.204 27.35 6.495 53.145 18.452 75.75 7.512 14.202 26.723 16.923 38.091 5.57 3.235-3.231 7.13-7.08 11.876-11.786 7.22-7.16 9.162-18.098 4.8-27.284-6.049-12.735-9.374-27.001-9.219-42.046z" }) }) }));
22
+ return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: accessibilityLabel, "aria-label": accessibilityLabel, onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", style: { width: 18, height: 18 }, children: (0, jsx_runtime_1.jsx)("path", { fill: loop ? colors_1.BLUE : 'white', d: "M493.544 181.463c11.956 22.605 18.655 48.4 18.452 75.75C511.339 345.365 438.56 416 350.404 416H192v47.495c0 22.475-26.177 32.268-40.971 17.475l-80-80c-9.372-9.373-9.372-24.569 0-33.941l80-80C166.138 271.92 192 282.686 192 304v48h158.875c52.812 0 96.575-42.182 97.12-94.992.155-15.045-3.17-29.312-9.218-42.046-4.362-9.185-2.421-20.124 4.8-27.284 4.745-4.706 8.641-8.555 11.876-11.786 11.368-11.352 30.579-8.631 38.091 5.571zM64.005 254.992c.545-52.81 44.308-94.992 97.12-94.992H320v47.505c0 22.374 26.121 32.312 40.971 17.465l80-80c9.372-9.373 9.372-24.569 0-33.941l-80-80C346.014 16.077 320 26.256 320 48.545V96H161.596C73.44 96 .661 166.635.005 254.788c-.204 27.35 6.495 53.145 18.452 75.75 7.512 14.202 26.723 16.923 38.091 5.57 3.235-3.231 7.13-7.08 11.876-11.786 7.22-7.16 9.162-18.098 4.8-27.284-6.049-12.735-9.374-27.001-9.219-42.046z" }) }) }));
22
23
  };
23
24
  exports.LoopToggle = LoopToggle;
@@ -87,7 +87,7 @@ const MenuItem = ({ label: itemName, selected, id, onItemSelected, onItemHovered
87
87
  };
88
88
  }, [size]);
89
89
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { ref: ref, role: "button", tabIndex: tabIndex, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onPointerDown: onPointerDown, onClick: onClick, style: containerStyle, type: "button", className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: itemName }), portalStyle
90
- ? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { className: "css-reset", style: outerStyle, children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onItemQuit, onOutsideClick: onItemQuit, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: onPreviousMenu, onPreviousMenu: onNextMenu, values: menu.items, onHide: onItemQuit, leaveLeftSpace: menu.leaveLeftPadding, preselectIndex: false, topItemCanBeUnselected: true }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
90
+ ? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { className: "css-reset", style: outerStyle, children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onItemQuit, onOutsideClick: onItemQuit, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: onPreviousMenu, onPreviousMenu: onNextMenu, values: menu.items, onHide: onItemQuit, leaveLeftSpace: menu.leaveLeftPadding, preselectIndex: false, topItemCanBeUnselected: true, fixedHeight: null }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
91
91
  : null] }));
92
92
  };
93
93
  exports.MenuItem = MenuItem;
@@ -9,6 +9,6 @@ const SubMenuComponent = ({ portalStyle, subMenuActivated, subMenu, onQuitFullMe
9
9
  return ((0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onEscape: onQuitFullMenu, onOutsideClick: noop_1.noop, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, className: "css-reset", children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: onQuitSubMenu, values: subMenu.items, onHide: noop_1.noop, leaveLeftSpace: subMenu.leaveLeftSpace, preselectIndex: subMenuActivated === 'without-mouse' &&
10
10
  typeof subMenu.preselectIndex === 'number'
11
11
  ? subMenu.preselectIndex
12
- : false, topItemCanBeUnselected: false }) }) }));
12
+ : false, topItemCanBeUnselected: false, fixedHeight: null }) }) }));
13
13
  };
14
14
  exports.SubMenuComponent = SubMenuComponent;
@@ -3,12 +3,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MenuBuildIndicator = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const client_id_1 = require("../helpers/client-id");
7
+ const layout_1 = require("./layout");
8
+ const OpenEditorButton_1 = require("./OpenEditorButton");
9
+ const Spinner_1 = require("./Spinner");
6
10
  const cwd = {
7
11
  fontSize: 13,
8
12
  opacity: 0.8,
13
+ display: 'flex',
14
+ alignItems: 'center',
15
+ justifyContent: 'center',
16
+ };
17
+ const spinnerSize = 14;
18
+ const spinner = {
19
+ position: 'relative',
20
+ width: spinnerSize,
21
+ marginTop: 4,
22
+ };
23
+ const noSpinner = {
24
+ position: 'relative',
25
+ width: spinnerSize,
9
26
  };
10
27
  const MenuBuildIndicator = () => {
11
28
  const [isBuilding, setIsBuilding] = (0, react_1.useState)(false);
29
+ const ctx = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx);
30
+ const showButton = window.remotion_editorName && ctx.type === 'connected';
12
31
  (0, react_1.useEffect)(() => {
13
32
  window.remotion_isBuilding = () => {
14
33
  setIsBuilding(true);
@@ -21,6 +40,6 @@ const MenuBuildIndicator = () => {
21
40
  window.remotion_finishedBuilding = undefined;
22
41
  };
23
42
  }, []);
24
- return ((0, jsx_runtime_1.jsx)("div", { style: cwd, title: window.remotion_cwd, children: isBuilding ? 'Building...' : window.remotion_projectName }));
43
+ return ((0, jsx_runtime_1.jsxs)("div", { style: cwd, title: window.remotion_cwd, children: [showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }) : null, isBuilding ? ((0, jsx_runtime_1.jsx)("div", { style: spinner, children: (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { size: spinnerSize }) })) : ((0, jsx_runtime_1.jsx)("div", { style: noSpinner })), showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }) : null, window.remotion_projectName, showButton ? (0, jsx_runtime_1.jsx)(OpenEditorButton_1.OpenEditorButton, {}) : null] }));
25
44
  };
26
45
  exports.MenuBuildIndicator = MenuBuildIndicator;
@@ -16,7 +16,7 @@ const UpdateModal_1 = require("./UpdateModal/UpdateModal");
16
16
  const Modals = () => {
17
17
  const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
18
18
  const canRender = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type === 'connected';
19
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModal, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialOutName: modalContextType.initialOutName, initialScale: modalContextType.initialScale, initialVerbose: modalContextType.initialVerbose, initialRenderType: modalContextType.initialRenderType, initialVideoCodecForAudioTab: modalContextType.initialVideoCodecForAudioTab, initialVideoCodecForVideoTab: modalContextType.initialVideoCodecForVideoTab, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialAudioCodec: modalContextType.initialAudioCodec, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, defaultProps: modalContextType.defaultProps })), modalContextType &&
19
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModal, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialOutName: modalContextType.initialOutName, initialScale: modalContextType.initialScale, initialVerbose: modalContextType.initialVerbose, initialRenderType: modalContextType.initialRenderType, initialVideoCodecForAudioTab: modalContextType.initialVideoCodecForAudioTab, initialVideoCodecForVideoTab: modalContextType.initialVideoCodecForVideoTab, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialAudioCodec: modalContextType.initialAudioCodec, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark })), modalContextType &&
20
20
  canRender &&
21
21
  modalContextType.type === 'render-progress' && ((0, jsx_runtime_1.jsx)(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info })), modalContextType && modalContextType.type === 'quick-switcher' && ((0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode }))] }));
22
22
  };
@@ -91,12 +91,27 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
91
91
  current.removeEventListener('click', onClick);
92
92
  };
93
93
  }, [refresh]);
94
+ const spaceToBottom = (0, react_1.useMemo)(() => {
95
+ const margin = 10;
96
+ if (size && opened) {
97
+ return size.windowSize.height - (size.top + size.height) - margin;
98
+ }
99
+ return 0;
100
+ }, [opened, size]);
101
+ const spaceToTop = (0, react_1.useMemo)(() => {
102
+ const margin = 10;
103
+ if (size && opened) {
104
+ return size.top - margin;
105
+ }
106
+ return 0;
107
+ }, [opened, size]);
108
+ const derivedMaxHeight = (0, react_1.useMemo)(() => {
109
+ return spaceToTop > spaceToBottom ? spaceToTop : spaceToBottom;
110
+ }, [spaceToBottom, spaceToTop]);
94
111
  const portalStyle = (0, react_1.useMemo)(() => {
95
112
  if (!opened || !size) {
96
113
  return null;
97
114
  }
98
- const spaceToBottom = size.windowSize.height - (size.top + size.height);
99
- const spaceToTop = size.top;
100
115
  const spaceToRight = size.windowSize.width - (size.left + size.width);
101
116
  const minSpaceToRightRequired = styles_1.MAX_MENU_WIDTH;
102
117
  const verticalLayout = spaceToTop > spaceToBottom ? 'bottom' : 'top';
@@ -119,7 +134,7 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
119
134
  right: size.windowSize.width - size.left - size.width,
120
135
  }),
121
136
  };
122
- }, [opened, size]);
137
+ }, [opened, size, spaceToBottom, spaceToTop]);
123
138
  const selected = values.find((v) => v.id === selectedId);
124
139
  const style = (0, react_1.useMemo)(() => {
125
140
  return {
@@ -138,7 +153,7 @@ const Combobox = ({ values, selectedId, style: customStyle, title }) => {
138
153
  };
139
154
  }, [customStyle, hovered, opened]);
140
155
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { ref: ref, title: title, tabIndex: tabIndex, type: "button", style: style, className: is_menu_item_1.MENU_INITIATOR_CLASSNAME, children: [selected ? ((0, jsx_runtime_1.jsx)("div", { title: typeof selected.label === 'string' ? selected.label : undefined, style: label, children: selected === null || selected === void 0 ? void 0 : selected.label })) : null, (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), " ", (0, jsx_runtime_1.jsx)(caret_1.CaretDown, {})] }), portalStyle
141
- ? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { style: styles_1.fullScreenOverlay, children: (0, jsx_runtime_1.jsx)("div", { style: styles_1.outerPortal, className: "css-reset", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((v) => selected && v.id === selected.id), topItemCanBeUnselected: false }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
156
+ ? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { style: styles_1.fullScreenOverlay, children: (0, jsx_runtime_1.jsx)("div", { style: styles_1.outerPortal, className: "css-reset", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: values, onHide: onHide, leaveLeftSpace: true, preselectIndex: values.findIndex((v) => selected && v.id === selected.id), topItemCanBeUnselected: false, fixedHeight: derivedMaxHeight }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
142
157
  : null] }));
143
158
  };
144
159
  exports.Combobox = Combobox;
@@ -4,6 +4,7 @@ exports.InputDragger = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
+ const colors_1 = require("../../helpers/colors");
7
8
  const noop_1 = require("../../helpers/noop");
8
9
  const input_dragger_click_lock_1 = require("../../state/input-dragger-click-lock");
9
10
  const z_index_1 = require("../../state/z-index");
@@ -19,9 +20,9 @@ const InputDragger = ({ onValueChange, min: _min, max: _max, step: _step, value,
19
20
  };
20
21
  }, []);
21
22
  const span = (0, react_1.useMemo)(() => ({
22
- borderBottom: '1px dotted var(--blue)',
23
+ borderBottom: '1px dotted ' + colors_1.BLUE,
23
24
  paddingBottom: 1,
24
- color: 'var(--blue)',
25
+ color: colors_1.BLUE,
25
26
  cursor: 'ew-resize',
26
27
  userSelect: 'none',
27
28
  fontSize: 13,
@@ -8,4 +8,5 @@ export declare const MenuContent: React.FC<{
8
8
  leaveLeftSpace: boolean;
9
9
  preselectIndex: false | number;
10
10
  topItemCanBeUnselected: boolean;
11
+ fixedHeight: number | null;
11
12
  }>;
@@ -19,9 +19,8 @@ const container = {
19
19
  overflowX: 'hidden',
20
20
  minWidth: 200,
21
21
  maxWidth: styles_1.MAX_MENU_WIDTH,
22
- maxHeight: 600,
23
22
  };
24
- const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMenu, leaveLeftSpace, topItemCanBeUnselected, }) => {
23
+ const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMenu, leaveLeftSpace, topItemCanBeUnselected, fixedHeight, }) => {
25
24
  const keybindings = (0, use_keybinding_1.useKeybinding)();
26
25
  const containerRef = (0, react_1.useRef)(null);
27
26
  const [subMenuActivated, setSubMenuActivated] = (0, react_1.useState)(false);
@@ -107,6 +106,15 @@ const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMen
107
106
  }
108
107
  setSubMenuActivated('without-mouse');
109
108
  }, [onNextMenu, selectedItem, values]);
109
+ const containerWithHeight = (0, react_1.useMemo)(() => {
110
+ if (fixedHeight === null) {
111
+ return { ...container, maxHeight: 600 };
112
+ }
113
+ return {
114
+ ...container,
115
+ maxHeight: fixedHeight,
116
+ };
117
+ }, [fixedHeight]);
110
118
  (0, react_1.useEffect)(() => {
111
119
  const escapeBinding = keybindings.registerKeybinding({
112
120
  event: 'keydown',
@@ -216,7 +224,7 @@ const MenuContent = ({ onHide, values, preselectIndex, onNextMenu, onPreviousMen
216
224
  current.addEventListener('pointerleave', onPointerLeave);
217
225
  return () => current.removeEventListener('pointerleave', onPointerLeave);
218
226
  }, [onHide, subMenuActivated]);
219
- return ((0, jsx_runtime_1.jsx)("div", { ref: containerRef, style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: values.map((item) => {
227
+ return ((0, jsx_runtime_1.jsx)("div", { ref: containerRef, style: containerWithHeight, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: values.map((item) => {
220
228
  if (item.type === 'divider') {
221
229
  return (0, jsx_runtime_1.jsx)(MenuDivider_1.MenuDivider, {}, item.id);
222
230
  }
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const OpenEditorButton: React.FC<{}>;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenEditorButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../helpers/colors");
7
+ const open_in_editor_1 = require("../helpers/open-in-editor");
8
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
9
+ const svgStyle = {
10
+ width: '11px',
11
+ height: '11px',
12
+ };
13
+ const buttonStyle = {
14
+ border: 'none',
15
+ width: '25px',
16
+ height: '25px',
17
+ };
18
+ const OpenEditorButton = () => {
19
+ const [hovered, setHovered] = (0, react_1.useState)(false);
20
+ const svgFillColor = (0, react_1.useMemo)(() => {
21
+ return hovered ? 'white' : colors_1.LIGHT_TEXT;
22
+ }, [hovered]);
23
+ const handleClick = async () => {
24
+ await (0, open_in_editor_1.openInEditor)({
25
+ originalFileName: `${window.remotion_cwd}`,
26
+ originalLineNumber: 1,
27
+ originalColumnNumber: 1,
28
+ originalFunctionName: null,
29
+ originalScriptCode: null,
30
+ })
31
+ .then((res) => res.json())
32
+ .then(({ success }) => {
33
+ if (!success) {
34
+ (0, NotificationCenter_1.sendErrorNotification)(`Could not open ${window.remotion_editorName}`);
35
+ }
36
+ })
37
+ .catch((err) => {
38
+ console.error(err);
39
+ (0, NotificationCenter_1.sendErrorNotification)(`Could not open ${window.remotion_editorName}`);
40
+ });
41
+ };
42
+ const buttonTooltip = `Open in ${window.remotion_editorName}`;
43
+ const openInEditorSvg = ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: svgFillColor, d: "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z" }) }));
44
+ const onPointerEnter = (0, react_1.useCallback)(() => {
45
+ setHovered(true);
46
+ }, []);
47
+ const onPointerLeave = (0, react_1.useCallback)(() => {
48
+ setHovered(false);
49
+ }, []);
50
+ return ((0, jsx_runtime_1.jsx)("button", { title: buttonTooltip, type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: buttonStyle, onClick: handleClick, children: openInEditorSvg }));
51
+ };
52
+ exports.OpenEditorButton = OpenEditorButton;
@@ -11,6 +11,7 @@ const get_default_video_contexts_1 = require("../../preview-server/render-queue/
11
11
  const client_id_1 = require("../helpers/client-id");
12
12
  const use_keybinding_1 = require("../helpers/use-keybinding");
13
13
  const render_1 = require("../icons/render");
14
+ const in_out_1 = require("../state/in-out");
14
15
  const modals_1 = require("../state/modals");
15
16
  const layout_1 = require("./layout");
16
17
  const button = {
@@ -23,6 +24,7 @@ const label = {
23
24
  fontSize: 14,
24
25
  };
25
26
  const RenderButton = () => {
27
+ const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
26
28
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
27
29
  const { type } = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx);
28
30
  const connectionStatus = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type;
@@ -93,8 +95,10 @@ const RenderButton = () => {
93
95
  initialHeadless: defaults.headless,
94
96
  initialIgnoreCertificateErrors: defaults.ignoreCertificateErrors,
95
97
  defaultProps: (_c = props[video.id]) !== null && _c !== void 0 ? _c : video.defaultProps,
98
+ inFrameMark: inFrame,
99
+ outFrameMark: outFrame,
96
100
  });
97
- }, [video, setSelectedModal, frame, props]);
101
+ }, [video, setSelectedModal, frame, props, inFrame, outFrame]);
98
102
  if (!video) {
99
103
  return null;
100
104
  }
@@ -17,6 +17,12 @@ const copiedStyle = {
17
17
  alignItems: 'center',
18
18
  justifyContent: 'center',
19
19
  };
20
+ const buttonStyle = {
21
+ width: '30px',
22
+ height: '30px',
23
+ border: 'none',
24
+ cursor: 'pointer',
25
+ };
20
26
  const CliCopyButton = ({ valueToCopy, }) => {
21
27
  const [copied, setCopied] = (0, react_1.useState)(false);
22
28
  const [hovered, setHovered] = (0, react_1.useState)(false);
@@ -42,12 +48,7 @@ const CliCopyButton = ({ valueToCopy, }) => {
42
48
  const to = setTimeout(() => handleClear(), 2000);
43
49
  return () => clearTimeout(to);
44
50
  }, [copied]);
45
- return copied ? ((0, jsx_runtime_1.jsx)("span", { style: copiedStyle, children: checkSvg })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: {
46
- width: '30px',
47
- height: '30px',
48
- border: 'none',
49
- cursor: 'pointer',
50
- }, onClick: () => {
51
+ return copied ? ((0, jsx_runtime_1.jsx)("span", { style: copiedStyle, children: checkSvg })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: buttonStyle, onClick: () => {
51
52
  navigator.clipboard.writeText(valueToCopy);
52
53
  setCopied(true);
53
54
  }, children: clipboardIcon }));
@@ -4,13 +4,14 @@ exports.EnforceAudioTrackSetting = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const Checkbox_1 = require("../Checkbox");
7
+ const layout_1 = require("../layout");
7
8
  const InfoBubble_1 = require("./InfoBubble");
8
- const layout_1 = require("./layout");
9
+ const layout_2 = require("./layout");
9
10
  const OptionExplainer_1 = require("./OptionExplainer");
10
11
  const EnforceAudioTrackSetting = ({ enforceAudioTrack, muted, setEnforceAudioTrack, option }) => {
11
12
  const onEnforceAudioTrackChanged = (0, react_1.useCallback)((e) => {
12
13
  setEnforceAudioTrack(e.target.checked);
13
14
  }, [setEnforceAudioTrack]);
14
- return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.label, children: ["Enforce Audio Track", (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: option }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { disabled: muted && !enforceAudioTrack, checked: enforceAudioTrack, onChange: onEnforceAudioTrackChanged }) })] }));
15
+ return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.label, children: ["Enforce Audio Track", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: option }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { disabled: muted && !enforceAudioTrack, checked: enforceAudioTrack, onChange: onEnforceAudioTrackChanged }) })] }));
15
16
  };
16
17
  exports.EnforceAudioTrackSetting = EnforceAudioTrackSetting;
@@ -4,13 +4,14 @@ exports.MutedSetting = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const Checkbox_1 = require("../Checkbox");
7
+ const layout_1 = require("../layout");
7
8
  const InfoBubble_1 = require("./InfoBubble");
8
- const layout_1 = require("./layout");
9
+ const layout_2 = require("./layout");
9
10
  const OptionExplainer_1 = require("./OptionExplainer");
10
11
  const MutedSetting = ({ muted, setMuted, enforceAudioTrack, hint }) => {
11
12
  const onMutedChanged = (0, react_1.useCallback)((e) => {
12
13
  setMuted(e.target.checked);
13
14
  }, [setMuted]);
14
- return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.label, children: ["Muted", (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 }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: muted, disabled: enforceAudioTrack && !muted, onChange: onMutedChanged }) })] }));
15
+ return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.label, children: ["Muted", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (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 }) })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.25 }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: muted, disabled: enforceAudioTrack && !muted, onChange: onMutedChanged }) })] }));
15
16
  };
16
17
  exports.MutedSetting = MutedSetting;
@@ -28,6 +28,7 @@ const link = {
28
28
  maxWidth: 200,
29
29
  color: '#0b84f3',
30
30
  wordWrap: 'break-word',
31
+ textDecoration: 'none',
31
32
  };
32
33
  const infoRow = {
33
34
  ...padding,
@@ -31,5 +31,7 @@ export declare const RenderModal: React.FC<{
31
31
  initialGl: OpenGlRenderer | null;
32
32
  initialIgnoreCertificateErrors: boolean;
33
33
  initialHeadless: boolean;
34
- defaultProps: unknown;
34
+ defaultProps: Record<string, unknown>;
35
+ inFrameMark: number | null;
36
+ outFrameMark: number | null;
35
37
  }>;
@@ -16,6 +16,7 @@ const file_1 = require("../../icons/file");
16
16
  const frame_1 = require("../../icons/frame");
17
17
  const gear_1 = require("../../icons/gear");
18
18
  const gif_1 = require("../../icons/gif");
19
+ const colors_1 = require("../../helpers/colors");
19
20
  const modals_1 = require("../../state/modals");
20
21
  const sidebar_1 = require("../../state/sidebar");
21
22
  const is_menu_item_1 = require("../Menu/is-menu-item");
@@ -97,7 +98,7 @@ const icon = {
97
98
  height: 20,
98
99
  };
99
100
  const buttonStyle = {
100
- backgroundColor: 'var(--blue)',
101
+ backgroundColor: colors_1.BLUE,
101
102
  color: 'white',
102
103
  };
103
104
  const flexer = {
@@ -108,7 +109,7 @@ const outer = {
108
109
  height: (0, ModalContainer_1.getMaxModalHeight)(640),
109
110
  overflow: 'hidden',
110
111
  };
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, }) => {
112
+ 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, inFrameMark, outFrameMark, }) => {
112
113
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
113
114
  const onQuit = (0, react_1.useCallback)(() => {
114
115
  setSelectedModal(null);
@@ -145,8 +146,8 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
145
146
  };
146
147
  }, [headless, disableWebSecurity, ignoreCertificateErrors, openGlOption]);
147
148
  const [outName, setOutName] = (0, react_1.useState)(() => initialOutName);
148
- const [endFrameOrNull, setEndFrame] = (0, react_1.useState)(() => null);
149
- const [startFrameOrNull, setStartFrame] = (0, react_1.useState)(() => null);
149
+ const [endFrameOrNull, setEndFrame] = (0, react_1.useState)(() => outFrameMark !== null && outFrameMark !== void 0 ? outFrameMark : null);
150
+ const [startFrameOrNull, setStartFrame] = (0, react_1.useState)(() => inFrameMark !== null && inFrameMark !== void 0 ? inFrameMark : null);
150
151
  const [proResProfileSetting, setProResProfile] = (0, react_1.useState)(() => initialProResProfile);
151
152
  const [pixelFormat, setPixelFormat] = (0, react_1.useState)(() => initialPixelFormat);
152
153
  const [preferredQualityControlType, setQualityControl] = (0, react_1.useState)(() => initialVideoBitrate === null ? 'crf' : 'bitrate');
@@ -218,6 +219,9 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
218
219
  if (renderMode === 'video') {
219
220
  return enforceAudioTrackState;
220
221
  }
222
+ if (renderMode === 'audio') {
223
+ return enforceAudioTrackState;
224
+ }
221
225
  return false;
222
226
  }, [enforceAudioTrackState, renderMode]);
223
227
  const proResProfile = (0, react_1.useMemo)(() => {
@@ -587,9 +591,7 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
587
591
  }, [registerKeybinding, trigger]);
588
592
  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: {
589
593
  ...buttonStyle,
590
- backgroundColor: outnameValidation.valid
591
- ? 'var(--blue)'
592
- : 'var(--blue-disabled)',
594
+ backgroundColor: outnameValidation.valid ? colors_1.BLUE : colors_1.BLUE_DISABLED,
593
595
  }, 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
594
596
  ? null
595
597
  : 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, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat, shouldDisplayQualityControlPicker: supportsBothQualityControls })) : 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, propsEditType: "input-props" })) : ((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 })) })] })] }) }));
@@ -51,10 +51,8 @@ const RenderModalAdvanced = ({ renderMode, maxConcurrency, minConcurrency, setCo
51
51
  });
52
52
  }, [extendedOpenGlOptions, openGlOption, setOpenGlOption]);
53
53
  return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: [renderMode === 'still' ? null : ((0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting, { min: minConcurrency, max: maxConcurrency, step: 1, name: "Concurrency", formatter: (w) => `${w}x`, onValueChanged: setConcurrency, value: concurrency })), (0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting
54
- // TODO: Should be right aligned
55
54
  // Also appears in packages/renderer/src/validate-puppeteer-timeout.ts
56
55
  , {
57
- // TODO: Should be right aligned
58
56
  // Also appears in packages/renderer/src/validate-puppeteer-timeout.ts
59
57
  min: 7000, max: 900000, name: "delayRender() timeout", onValueChanged: setDelayRenderTimeout, formatter: (w) => `${w}ms`, step: 1000, value: delayRenderTimeout }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "No parallel encoding" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: disallowParallelEncoding, onChange: onDisallowParallelEncodingChanged }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Verbose logging" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: verbose, onChange: onVerboseLoggingChanged }) })] }), (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Disable web security" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: disableWebSecurity, onChange: onDisableWebSecurityChanged }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Ignore certificate errors " }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: ignoreCertificateErrors, onChange: onIgnoreCertificatErrors }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "Headless mode" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: headless, onChange: onHeadless }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_1.label, children: "OpenGL render backend" }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { values: openGlOptions, selectedId: openGlOption, title: "OpenGl option" }) })] }), (0, jsx_runtime_1.jsx)(RenderModalHr_1.RenderModalHr, {}), (0, jsx_runtime_1.jsx)(RenderModalEnvironmentVariables_1.RenderModalEnvironmentVariables, { envVariables: envVariables, setEnvVariables: setEnvVariables })] }));
60
58
  };
@@ -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", rightAlign: true }) }) })] })) : 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.jsx)(MutedSetting_1.MutedSetting, { enforceAudioTrack: enforceAudioTrack, muted: muted, setMuted: setMuted, hint: client_1.BrowserSafeApis.options.muteOption })) : null, (renderMode === 'video' || renderMode === 'audio') && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(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;
@@ -7,6 +7,7 @@ const react_1 = require("react");
7
7
  const prores_labels_1 = require("../../helpers/prores-labels");
8
8
  const use_file_existence_1 = require("../../helpers/use-file-existence");
9
9
  const Checkmark_1 = require("../../icons/Checkmark");
10
+ const layout_1 = require("../layout");
10
11
  const ComboBox_1 = require("../NewComposition/ComboBox");
11
12
  const InputDragger_1 = require("../NewComposition/InputDragger");
12
13
  const RemInput_1 = require("../NewComposition/RemInput");
@@ -14,7 +15,7 @@ const SegmentedControl_1 = require("../SegmentedControl");
14
15
  const FrameRangeSetting_1 = require("./FrameRangeSetting");
15
16
  const human_readable_codec_1 = require("./human-readable-codec");
16
17
  const InfoBubble_1 = require("./InfoBubble");
17
- const layout_1 = require("./layout");
18
+ const layout_2 = require("./layout");
18
19
  const OptionExplainer_1 = require("./OptionExplainer");
19
20
  const RenderModalInput_1 = require("./RenderModalInput");
20
21
  const container = {
@@ -74,6 +75,6 @@ const RenderModalBasic = ({ renderMode, imageFormatOptions, outName, codec, setV
74
75
  const onValueChange = (0, react_1.useCallback)((e) => {
75
76
  setOutName(e.target.value);
76
77
  }, [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, 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
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [renderMode === 'still' ? ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Format" }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: imageFormatOptions, needsWrapping: true }) })] })) : ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.label, children: ["Codec", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (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_2.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_2.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "Frame" }), (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: 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_2.optionRow, children: [(0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: "ProRes profile" }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.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_2.input, outName: outName, onValueChange: onValueChange, validationMessage: validationMessage })] }));
78
79
  };
79
80
  exports.RenderModalBasic = RenderModalBasic;