@remotion/studio 4.0.484 → 4.0.485

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 (76) hide show
  1. package/dist/components/ContextMenu.js +75 -1
  2. package/dist/components/CurrentComposition.js +3 -2
  3. package/dist/components/InlineCompositionName.d.ts +7 -0
  4. package/dist/components/InlineCompositionName.js +58 -0
  5. package/dist/components/InlineEditableTitle.d.ts +7 -0
  6. package/dist/components/InlineEditableTitle.js +129 -0
  7. package/dist/components/InspectorPanel/KeyframeInspector.js +1 -0
  8. package/dist/components/InspectorPanel/SequenceInspectorHeader.js +17 -30
  9. package/dist/components/InspectorPanel/styles.js +2 -2
  10. package/dist/components/InspectorSequenceSection.js +34 -1
  11. package/dist/components/Modals.js +1 -1
  12. package/dist/components/NewComposition/CodemodFooter.d.ts +7 -1
  13. package/dist/components/NewComposition/CodemodFooter.js +17 -12
  14. package/dist/components/NewComposition/DeleteComposition.js +7 -1
  15. package/dist/components/NewComposition/DeleteFolder.js +7 -1
  16. package/dist/components/NewComposition/DuplicateComposition.js +17 -10
  17. package/dist/components/NewComposition/InputAndValidationContainer.d.ts +3 -0
  18. package/dist/components/NewComposition/InputAndValidationContainer.js +15 -0
  19. package/dist/components/NewComposition/NewCompDuration.js +7 -6
  20. package/dist/components/NewComposition/NewComposition.d.ts +5 -1
  21. package/dist/components/NewComposition/NewComposition.js +29 -86
  22. package/dist/components/NewComposition/RenameComposition.js +13 -14
  23. package/dist/components/NewComposition/RenameFolder.js +9 -2
  24. package/dist/components/NewComposition/RenameStaticFile.js +2 -1
  25. package/dist/components/NewComposition/ValidationMessage.js +9 -1
  26. package/dist/components/OptionsPanel.d.ts +0 -3
  27. package/dist/components/OptionsPanel.js +7 -3
  28. package/dist/components/RenderModal/ServerRenderModal.js +4 -3
  29. package/dist/components/RenderModal/WebRenderModal.js +2 -1
  30. package/dist/components/SelectedOutlineElement.js +45 -3
  31. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  32. package/dist/components/SelectedOutlineOverlay.js +15 -3
  33. package/dist/components/Timeline/TimelineDeleteKeybindings.js +34 -1
  34. package/dist/components/Timeline/TimelineExpandedSection.js +1 -0
  35. package/dist/components/Timeline/TimelineInOutPointerHandle.js +2 -1
  36. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +1 -1
  37. package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
  38. package/dist/components/Timeline/TimelinePrimitiveFieldValue.js +4 -0
  39. package/dist/components/Timeline/TimelineSelection.js +1 -0
  40. package/dist/components/Timeline/TimelineSequenceItem.js +19 -101
  41. package/dist/components/Timeline/TimelineSequencePropItem.js +6 -3
  42. package/dist/components/Timeline/TimelineTextContentField.d.ts +12 -0
  43. package/dist/components/Timeline/TimelineTextContentField.js +100 -0
  44. package/dist/components/Timeline/TimelineWidthProvider.js +18 -3
  45. package/dist/components/Timeline/focus-inspector-field.d.ts +16 -0
  46. package/dist/components/Timeline/focus-inspector-field.js +49 -0
  47. package/dist/components/Timeline/split-selected-timeline-item.d.ts +38 -0
  48. package/dist/components/Timeline/split-selected-timeline-item.js +156 -0
  49. package/dist/components/Timeline/timeline-field-display-utils.js +2 -0
  50. package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +1 -0
  51. package/dist/components/Timeline/use-rename-sequence.d.ts +30 -0
  52. package/dist/components/Timeline/use-rename-sequence.js +115 -0
  53. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +2 -1
  54. package/dist/components/Timeline/use-timeline-expanded-tree.js +3 -1
  55. package/dist/components/Timeline/use-timeline-height.js +1 -0
  56. package/dist/components/composition-menu-items.js +3 -0
  57. package/dist/components/folder-menu-items.js +20 -0
  58. package/dist/components/options-sidebar-tabs.d.ts +4 -0
  59. package/dist/components/options-sidebar-tabs.js +5 -0
  60. package/dist/components/selected-outline-types.d.ts +6 -1
  61. package/dist/esm/{chunk-9erwh79m.js → chunk-103pp4n7.js} +6734 -5683
  62. package/dist/esm/internals.mjs +6734 -5683
  63. package/dist/esm/previewEntry.mjs +6649 -5598
  64. package/dist/esm/renderEntry.mjs +1 -1
  65. package/dist/helpers/render-codec-label.d.ts +1 -1
  66. package/dist/helpers/timeline-layout.d.ts +4 -3
  67. package/dist/helpers/timeline-layout.js +3 -1
  68. package/dist/helpers/use-create-composition.d.ts +35 -0
  69. package/dist/helpers/use-create-composition.js +111 -0
  70. package/dist/helpers/use-rename-composition.d.ts +16 -0
  71. package/dist/helpers/use-rename-composition.js +49 -0
  72. package/dist/state/modals.d.ts +3 -0
  73. package/dist/state/timeline-zoom.js +17 -14
  74. package/dist/state/z-index.d.ts +1 -0
  75. package/dist/state/z-index.js +11 -2
  76. package/package.json +12 -12
@@ -7,6 +7,7 @@ const get_folder_id_1 = require("../../helpers/get-folder-id");
7
7
  const styles_1 = require("../Menu/styles");
8
8
  const ModalFooter_1 = require("../ModalFooter");
9
9
  const ModalHeader_1 = require("../ModalHeader");
10
+ const actions_1 = require("../RenderQueue/actions");
10
11
  const CodemodFooter_1 = require("./CodemodFooter");
11
12
  const DismissableModal_1 = require("./DismissableModal");
12
13
  const content = {
@@ -32,7 +33,12 @@ const DeleteFolder = ({ folderName, parentName, stack }) => {
32
33
  jsx_runtime_1.jsxs("div", { style: content, children: ["Do you want to delete the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "Folder" }),
33
34
  " with ID ", '"', folderId, '"', "?",
34
35
  jsx_runtime_1.jsx("br", {}),
35
- "The compositions and nested folders inside it will stay in your code."] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete folder`, loadingNotification: 'Deleting folder', successNotification: `Deleted folder ${folderId}`, genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, stack: stack, valid: true, onSuccess: null }) })
36
+ "The compositions and nested folders inside it will stay in your code."] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { errorNotification: `Could not delete folder`, loadingNotification: 'Deleting folder', successNotification: `Deleted folder ${folderId}`, genericSubmitLabel: `Delete`, submitLabel: ({ relativeRootPath }) => `Delete from ${relativeRootPath}`, codemod: codemod, stack: stack, valid: true, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
37
+ codemod,
38
+ dryRun: false,
39
+ signal,
40
+ symbolicatedStack,
41
+ }) }) })
36
42
  ] })
37
43
  ] }));
38
44
  };
@@ -11,9 +11,11 @@ const ModalFooter_1 = require("../ModalFooter");
11
11
  const ModalHeader_1 = require("../ModalHeader");
12
12
  const layout_2 = require("../RenderModal/layout");
13
13
  const ResolveCompositionBeforeModal_1 = require("../RenderModal/ResolveCompositionBeforeModal");
14
+ const actions_1 = require("../RenderQueue/actions");
14
15
  const CodemodFooter_1 = require("./CodemodFooter");
15
16
  const ComboBox_1 = require("./ComboBox");
16
17
  const DismissableModal_1 = require("./DismissableModal");
18
+ const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
17
19
  const InputDragger_1 = require("./InputDragger");
18
20
  const NewCompDuration_1 = require("./NewCompDuration");
19
21
  const RemInput_1 = require("./RemInput");
@@ -183,25 +185,30 @@ const DuplicateCompositionLoaded = ({ initialType }) => {
183
185
  jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
184
186
  jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Type" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: "Type of composition", style: comboBoxStyle, values: typeValues, selectedId: type }) })
185
187
  ] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
186
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
188
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
187
189
  jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
188
190
  jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })
189
191
  ] })) : null] }) })
190
192
  ] }), hadDimensionsDefined ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
191
193
  jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
192
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.jsxs("div", { style: layout_2.rightRow, children: [
193
- jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
194
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })
195
- ] })) : null] })
194
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
195
+ jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
196
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })
197
+ ] })) : null] }) })
196
198
  ] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
197
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.jsxs("div", { style: layout_2.rightRow, children: [
198
- jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
199
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })
200
- ] })) : null] })
199
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
200
+ jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
201
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })
202
+ ] })) : null] }) })
201
203
  ] })
202
204
  ] })) : null, type === 'composition' && hadDurationDefined ? (jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames })) : null, type === 'composition' && hadFpsDefined ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
203
205
  jsx_runtime_1.jsx("div", { style: layout_2.label, children: "FPS" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })
204
- ] })) : null] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Duplicating...', errorNotification: 'Could not duplicate composition', successNotification: `Duplicated ${unresolved.id} as ${newId}`, genericSubmitLabel: 'Duplicate', submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: valid, onSuccess: onDuplicateSuccess }) })
206
+ ] })) : null] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Duplicating...', errorNotification: 'Could not duplicate composition', successNotification: `Duplicated ${unresolved.id} as ${newId}`, genericSubmitLabel: 'Duplicate', submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: valid, onSuccess: onDuplicateSuccess, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
207
+ codemod,
208
+ dryRun: false,
209
+ signal,
210
+ symbolicatedStack,
211
+ }) }) })
205
212
  ] })
206
213
  ] }));
207
214
  };
@@ -0,0 +1,3 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
3
+ export declare const InputAndValidationContainer: React.FC<PropsWithChildren>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InputAndValidationContainer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const container = {
6
+ width: 250,
7
+ minWidth: 0,
8
+ display: 'flex',
9
+ flexDirection: 'column',
10
+ alignItems: 'flex-end',
11
+ };
12
+ const InputAndValidationContainer = ({ children, }) => {
13
+ return jsx_runtime_1.jsx("div", { style: container, children: children });
14
+ };
15
+ exports.InputAndValidationContainer = InputAndValidationContainer;
@@ -6,6 +6,7 @@ const react_1 = require("react");
6
6
  const validate_new_comp_data_1 = require("../../helpers/validate-new-comp-data");
7
7
  const layout_1 = require("../layout");
8
8
  const layout_2 = require("../RenderModal/layout");
9
+ const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
9
10
  const InputDragger_1 = require("./InputDragger");
10
11
  const ValidationMessage_1 = require("./ValidationMessage");
11
12
  const NewCompDuration = ({ durationInFrames, setDurationInFrames }) => {
@@ -17,12 +18,12 @@ const NewCompDuration = ({ durationInFrames, setDurationInFrames }) => {
17
18
  }, [setDurationInFrames]);
18
19
  const compDurationErrMessage = (0, validate_new_comp_data_1.validateCompositionDuration)(durationInFrames);
19
20
  return (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
20
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Duration in frames" }), jsx_runtime_1.jsxs("div", { style: layout_2.rightRow, children: [
21
- jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: durationInFrames, onTextChange: onDurationInFramesChanged, placeholder: "Duration (frames)", name: "durationInFrames", min: 1, step: 1, required: true, status: "ok",
22
- // Hitting Promise.all() limit in Chrome
23
- max: 300000, onValueChange: onDurationChangedDirectly, rightAlign: false }), compDurationErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
24
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compDurationErrMessage, type: "error" })
25
- ] })) : null] })
21
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Duration in frames" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
22
+ jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: durationInFrames, onTextChange: onDurationInFramesChanged, placeholder: "Duration (frames)", name: "durationInFrames", min: 1, step: 1, required: true, status: "ok",
23
+ // Hitting Promise.all() limit in Chrome
24
+ max: 300000, onValueChange: onDurationChangedDirectly, rightAlign: false }), compDurationErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
25
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compDurationErrMessage, type: "error" })
26
+ ] })) : null] }) })
26
27
  ] }));
27
28
  };
28
29
  exports.NewCompDuration = NewCompDuration;
@@ -1,2 +1,6 @@
1
1
  import React from 'react';
2
- export declare const NewComposition: React.FC;
2
+ export declare const NewComposition: React.FC<{
3
+ readonly folderName: string | null;
4
+ readonly parentName: string | null;
5
+ readonly stack: string | null;
6
+ }>;
@@ -4,14 +4,14 @@ exports.NewComposition = 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 url_state_1 = require("../../helpers/url-state");
8
- const validate_new_comp_data_1 = require("../../helpers/validate-new-comp-data");
7
+ const use_create_composition_1 = require("../../helpers/use-create-composition");
9
8
  const layout_1 = require("../layout");
10
9
  const ModalFooter_1 = require("../ModalFooter");
11
10
  const ModalHeader_1 = require("../ModalHeader");
12
11
  const layout_2 = require("../RenderModal/layout");
13
12
  const CodemodFooter_1 = require("./CodemodFooter");
14
13
  const DismissableModal_1 = require("./DismissableModal");
14
+ const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
15
15
  const InputDragger_1 = require("./InputDragger");
16
16
  const NewCompDuration_1 = require("./NewCompDuration");
17
17
  const RemInput_1 = require("./RemInput");
@@ -23,49 +23,9 @@ const content = {
23
23
  fontSize: 13,
24
24
  minWidth: 500,
25
25
  };
26
- const toPascalCase = (value) => {
27
- var _a;
28
- const words = (_a = value.match(/[a-zA-Z0-9]+/g)) !== null && _a !== void 0 ? _a : [];
29
- const candidate = words
30
- .map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`)
31
- .join('');
32
- if (!candidate) {
33
- return 'NewComposition';
34
- }
35
- if (/^[0-9]/.test(candidate)) {
36
- return `Composition${candidate}`;
37
- }
38
- return candidate;
39
- };
40
- const waitForComposition = (compositionId) => {
41
- return new Promise((resolve) => {
42
- const started = Date.now();
43
- const interval = window.setInterval(() => {
44
- var _a;
45
- var _b;
46
- const compositionNames = (_b = (_a = window.remotion_getCompositionNames) === null || _a === void 0 ? void 0 : _a.call(window)) !== null && _b !== void 0 ? _b : [];
47
- if (compositionNames.includes(compositionId) ||
48
- Date.now() - started > 10000) {
49
- window.clearInterval(interval);
50
- resolve();
51
- }
52
- }, 100);
53
- });
54
- };
55
- const getUniqueCompositionName = (compositions) => {
56
- let counter = 1;
57
- while (true) {
58
- const name = counter === 1 ? 'NewComposition' : `NewComposition${counter}`;
59
- const err = (0, validate_new_comp_data_1.validateCompositionName)(name, compositions);
60
- if (!err) {
61
- return name;
62
- }
63
- counter++;
64
- }
65
- };
66
- const NewCompositionLoaded = () => {
26
+ const NewCompositionLoaded = ({ folderName, parentName, stack }) => {
67
27
  const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
68
- const [newId, setName] = (0, react_1.useState)(() => getUniqueCompositionName(compositions));
28
+ const [newId, setName] = (0, react_1.useState)(() => (0, use_create_composition_1.getUniqueCompositionName)(compositions));
69
29
  const [selectedFrameRate, setFrameRate] = (0, react_1.useState)(30);
70
30
  const [size, setSize] = (0, react_1.useState)(() => ({
71
31
  width: 1920,
@@ -113,66 +73,49 @@ const NewCompositionLoaded = () => {
113
73
  const onFpsChange = (0, react_1.useCallback)((newFps) => {
114
74
  setFrameRate(newFps);
115
75
  }, []);
116
- const compNameErrMessage = (0, validate_new_comp_data_1.validateCompositionName)(newId, compositions);
117
- const compWidthErrMessage = (0, validate_new_comp_data_1.validateCompositionDimension)('Width', size.width);
118
- const compHeightErrMessage = (0, validate_new_comp_data_1.validateCompositionDimension)('Height', size.height);
119
- const componentName = toPascalCase(newId);
120
- const valid = compNameErrMessage === null &&
121
- compWidthErrMessage === null &&
122
- compHeightErrMessage === null;
123
- const codemod = (0, react_1.useMemo)(() => {
124
- return {
125
- type: 'new-composition',
126
- newDurationInFrames: Number(durationInFrames),
127
- newFps: Number(selectedFrameRate),
128
- newHeight: Number(size.height),
129
- newWidth: Number(size.width),
130
- newId,
131
- componentName,
132
- componentImportPath: `./${componentName}`,
133
- };
134
- }, [
135
- componentName,
76
+ const { codemod, createComposition, heightValidationMessage: compHeightErrMessage, nameValidationMessage: compNameErrMessage, valid, widthValidationMessage: compWidthErrMessage, } = (0, use_create_composition_1.useCreateComposition)({
77
+ compositions,
136
78
  durationInFrames,
79
+ folderName,
137
80
  newId,
81
+ parentName,
138
82
  selectedFrameRate,
139
- size.height,
140
- size.width,
141
- ]);
142
- const onSuccess = (0, react_1.useCallback)(() => {
143
- waitForComposition(newId).then(() => {
144
- (0, url_state_1.pushUrl)(`/${newId}`);
145
- });
146
- }, [newId]);
83
+ size,
84
+ });
147
85
  const onSubmit = (0, react_1.useCallback)((e) => {
148
86
  e.preventDefault();
149
87
  }, []);
88
+ const folderPath = [parentName, folderName].filter(Boolean).join('/');
150
89
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
151
90
  jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "New composition" }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
152
- jsx_runtime_1.jsxs("div", { style: content, children: [
153
- jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
154
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
91
+ jsx_runtime_1.jsxs("div", { style: content, children: [folderPath ? (jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
92
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Folder" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: folderPath })
93
+ ] })) : null, jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
94
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
155
95
  jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
156
96
  jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })
157
97
  ] })) : null] }) })
158
98
  ] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
159
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.jsxs("div", { style: layout_2.rightRow, children: [
160
- jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
161
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })
162
- ] })) : null] })
99
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Width" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
100
+ jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.width, placeholder: "Width", onTextChange: onWidthChanged, name: "width", step: 2, min: 2, required: true, status: "ok", formatter: (w) => `${w}px`, max: 100000000, onValueChange: onWidthDirectlyChanged, rightAlign: false }), compWidthErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
101
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })
102
+ ] })) : null] }) })
163
103
  ] }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
164
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.jsxs("div", { style: layout_2.rightRow, children: [
165
- jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
166
- jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })
167
- ] })) : null] })
104
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Height" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
105
+ jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: size.height, onTextChange: onHeightChanged, placeholder: "Height", name: "height", step: 2, required: true, formatter: (h) => `${h}px`, min: 2, status: "ok", max: 100000000, onValueChange: onHeightDirectlyChanged, rightAlign: false }), compHeightErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
106
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })
107
+ ] })) : null] }) })
168
108
  ] }), jsx_runtime_1.jsx(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, setDurationInFrames: setDurationInFrames }), jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
169
109
  jsx_runtime_1.jsx("div", { style: layout_2.label, children: "FPS" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: "number", value: selectedFrameRate, onTextChange: onTextFpsChange, placeholder: "Frame rate (fps)", name: "fps", min: 1, required: true, status: "ok", max: 240, step: 0.01, onValueChange: onFpsChange, rightAlign: false }) })
170
110
  ] })
171
- ] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: "Creating composition...", errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: null, valid: valid, onSuccess: onSuccess, fallbackToRootFile: true }) })
111
+ ] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: "Creating composition...", errorNotification: "Could not create composition", successNotification: `Created ${newId}`, genericSubmitLabel: "Add to root file", submitLabel: ({ relativeRootPath }) => `Add to ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => createComposition({
112
+ signal,
113
+ symbolicatedStack,
114
+ }), fallbackToRootFile: true }) })
172
115
  ] })
173
116
  ] }));
174
117
  };
175
- const NewComposition = () => {
176
- return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { children: jsx_runtime_1.jsx(NewCompositionLoaded, {}) }));
118
+ const NewComposition = ({ folderName, parentName, stack }) => {
119
+ return (jsx_runtime_1.jsx(DismissableModal_1.DismissableModal, { children: jsx_runtime_1.jsx(NewCompositionLoaded, { folderName: folderName, parentName: parentName, stack: stack }) }));
177
120
  };
178
121
  exports.NewComposition = NewComposition;
@@ -4,7 +4,7 @@ exports.RenameComposition = 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 validate_new_comp_data_1 = require("../../helpers/validate-new-comp-data");
7
+ const use_rename_composition_1 = require("../../helpers/use-rename-composition");
8
8
  const layout_1 = require("../layout");
9
9
  const ModalFooter_1 = require("../ModalFooter");
10
10
  const ModalHeader_1 = require("../ModalHeader");
@@ -12,6 +12,7 @@ const layout_2 = require("../RenderModal/layout");
12
12
  const ResolveCompositionBeforeModal_1 = require("../RenderModal/ResolveCompositionBeforeModal");
13
13
  const CodemodFooter_1 = require("./CodemodFooter");
14
14
  const DismissableModal_1 = require("./DismissableModal");
15
+ const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
15
16
  const RemInput_1 = require("./RemInput");
16
17
  const ValidationMessage_1 = require("./ValidationMessage");
17
18
  const content = {
@@ -43,28 +44,26 @@ const RenameCompositionLoaded = () => {
43
44
  const onNameChange = (0, react_1.useCallback)((e) => {
44
45
  setName(e.target.value);
45
46
  }, []);
46
- const compNameErrMessage = newId === resolved.result.id
47
- ? null
48
- : (0, validate_new_comp_data_1.validateCompositionName)(newId, compositions);
49
- const valid = compNameErrMessage === null && resolved.result.id !== newId;
50
- const codemod = (0, react_1.useMemo)(() => {
51
- return {
52
- type: 'rename-composition',
53
- idToRename: resolved.result.id,
54
- newId,
55
- };
56
- }, [newId, resolved.result.id]);
47
+ const { codemod, renameComposition, valid, validationMessage: compNameErrMessage, } = (0, use_rename_composition_1.useRenameComposition)({
48
+ compositions,
49
+ currentId: resolved.result.id,
50
+ newId,
51
+ });
57
52
  const onSubmit = (0, react_1.useCallback)((e) => {
58
53
  e.preventDefault();
59
54
  }, []);
60
55
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
61
56
  jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${resolved.result.id}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
62
57
  jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
63
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
58
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "ID" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
64
59
  jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newId, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Composition ID", status: "ok", rightAlign: true }), compNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
65
60
  jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })
66
61
  ] })) : null] }) })
67
- ] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming...', errorNotification: 'Could not rename composition', successNotification: `Renamed to ${newId}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: valid, onSuccess: null }) })
62
+ ] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming...', errorNotification: 'Could not rename composition', successNotification: `Renamed to ${newId}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: compositionStack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => renameComposition({
63
+ newCompositionId: newId,
64
+ signal,
65
+ symbolicatedStack,
66
+ }) }) })
68
67
  ] })
69
68
  ] }));
70
69
  };
@@ -10,8 +10,10 @@ const layout_1 = require("../layout");
10
10
  const ModalFooter_1 = require("../ModalFooter");
11
11
  const ModalHeader_1 = require("../ModalHeader");
12
12
  const layout_2 = require("../RenderModal/layout");
13
+ const actions_1 = require("../RenderQueue/actions");
13
14
  const CodemodFooter_1 = require("./CodemodFooter");
14
15
  const DismissableModal_1 = require("./DismissableModal");
16
+ const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
15
17
  const RemInput_1 = require("./RemInput");
16
18
  const ValidationMessage_1 = require("./ValidationMessage");
17
19
  const content = {
@@ -56,11 +58,16 @@ const RenameFolder = ({ folderName, parentName, stack }) => {
56
58
  return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { children: [
57
59
  jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${folderId}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
58
60
  jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
59
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
61
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
60
62
  jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, placeholder: "Folder name", status: "ok", rightAlign: true }), folderNameErrMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
61
63
  jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: folderNameErrMessage, type: "error" })
62
64
  ] })) : null] }) })
63
- ] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming folder...', errorNotification: 'Could not rename folder', successNotification: `Renamed folder to ${newName}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null }) })
65
+ ] }) }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(CodemodFooter_1.CodemodFooter, { loadingNotification: 'Renaming folder...', errorNotification: 'Could not rename folder', successNotification: `Renamed folder to ${newName}`, genericSubmitLabel: 'Rename', submitLabel: ({ relativeRootPath }) => `Modify ${relativeRootPath}`, codemod: codemod, stack: stack, valid: valid, onSuccess: null, applyCodemod: ({ signal, symbolicatedStack }) => (0, actions_1.applyCodemod)({
66
+ codemod,
67
+ dryRun: false,
68
+ signal,
69
+ symbolicatedStack,
70
+ }) }) })
64
71
  ] })
65
72
  ] }));
66
73
  };
@@ -15,6 +15,7 @@ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
15
15
  const layout_2 = require("../RenderModal/layout");
16
16
  const use_static_files_1 = require("../use-static-files");
17
17
  const DismissableModal_1 = require("./DismissableModal");
18
+ const InputAndValidationContainer_1 = require("./InputAndValidationContainer");
18
19
  const RemInput_1 = require("./RemInput");
19
20
  const ValidationMessage_1 = require("./ValidationMessage");
20
21
  const content = {
@@ -115,7 +116,7 @@ const RenameStaticFileModal = ({ relativePath }) => {
115
116
  return (jsx_runtime_1.jsxs(DismissableModal_1.DismissableModal, { children: [
116
117
  jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: `Rename ${relativePath}` }), jsx_runtime_1.jsxs("form", { onSubmit: onSubmit, children: [
117
118
  jsx_runtime_1.jsx("div", { style: content, children: jsx_runtime_1.jsxs("div", { style: layout_2.optionRow, children: [
118
- jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs("div", { children: [
119
+ jsx_runtime_1.jsx("div", { style: layout_2.label, children: "Name" }), jsx_runtime_1.jsx("div", { style: layout_2.rightRow, children: jsx_runtime_1.jsxs(InputAndValidationContainer_1.InputAndValidationContainer, { children: [
119
120
  jsx_runtime_1.jsx(RemInput_1.RemotionInput, { ref: inputRef, value: newName, onChange: onNameChange, type: "text", autoFocus: true, autoComplete: "off", "data-1p-ignore": true, placeholder: "Asset name", status: validationMessage ? 'error' : 'ok', rightAlign: true }), validationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
120
121
  jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: validationMessage, type: "error" })
121
122
  ] })) : null] }) })
@@ -20,12 +20,20 @@ const compactStyle = {
20
20
  height: 10,
21
21
  };
22
22
  const container = {
23
+ width: '100%',
23
24
  maxWidth: 500,
25
+ minWidth: 0,
26
+ };
27
+ const row = {
28
+ minWidth: 0,
24
29
  };
25
30
  const label = {
26
31
  fontSize: 13,
27
32
  color: 'white',
28
33
  fontFamily: 'sans-serif',
34
+ minWidth: 0,
35
+ whiteSpace: 'normal',
36
+ overflowWrap: 'anywhere',
29
37
  };
30
38
  const compactLabel = {
31
39
  ...label,
@@ -40,7 +48,7 @@ const ValidationMessage = ({ message, align, type, action, size = 'default' }) =
40
48
  fill: type === 'warning' ? colors_1.WARNING_COLOR : colors_1.FAIL_COLOR,
41
49
  };
42
50
  }, [iconStyle, type]);
43
- return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", justify: align, children: [
51
+ return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs(layout_1.Row, { align: "center", justify: align, style: row, children: [
44
52
  jsx_runtime_1.jsx(exports.WarningTriangle, { style: finalStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: size === 'compact' ? 0.75 : 1 }), jsx_runtime_1.jsx("div", { style: labelStyle, children: message }), action ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
45
53
  jsx_runtime_1.jsx(layout_1.Spacing, { x: size === 'compact' ? 0.75 : 1 }), action] })) : null] }) }));
46
54
  };
@@ -1,9 +1,6 @@
1
1
  import React from 'react';
2
2
  type OptionsSidebarPanel = 'inspector' | 'renders';
3
3
  export declare const persistSelectedOptionsSidebarPanel: (panel: OptionsSidebarPanel) => void;
4
- export declare const optionsSidebarTabs: React.RefObject<{
5
- selectRendersPanel: () => void;
6
- } | null>;
7
4
  export declare const OptionsPanel: React.FC<{
8
5
  readonly readOnlyStudio: boolean;
9
6
  }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OptionsPanel = exports.optionsSidebarTabs = exports.persistSelectedOptionsSidebarPanel = void 0;
3
+ exports.OptionsPanel = exports.persistSelectedOptionsSidebarPanel = 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");
@@ -10,6 +10,7 @@ const show_browser_rendering_1 = require("../helpers/show-browser-rendering");
10
10
  const get_zod_if_possible_1 = require("./get-zod-if-possible");
11
11
  const InspectorPanel_1 = require("./InspectorPanel");
12
12
  const NotificationCenter_1 = require("./Notifications/NotificationCenter");
13
+ const options_sidebar_tabs_1 = require("./options-sidebar-tabs");
13
14
  const deep_equal_1 = require("./RenderModal/SchemaEditor/deep-equal");
14
15
  const extract_enum_json_paths_1 = require("./RenderModal/SchemaEditor/extract-enum-json-paths");
15
16
  const SchemaResetButton_1 = require("./RenderModal/SchemaEditor/SchemaResetButton");
@@ -35,7 +36,6 @@ const persistSelectedOptionsSidebarPanel = (panel) => {
35
36
  localStorage.setItem(localStorageKey, panel);
36
37
  };
37
38
  exports.persistSelectedOptionsSidebarPanel = persistSelectedOptionsSidebarPanel;
38
- exports.optionsSidebarTabs = (0, react_1.createRef)();
39
39
  const OptionsPanel = ({ readOnlyStudio }) => {
40
40
  const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
41
41
  const renderingAvailable = !readOnlyStudio || show_browser_rendering_1.SHOW_BROWSER_RENDERING;
@@ -57,8 +57,12 @@ const OptionsPanel = ({ readOnlyStudio }) => {
57
57
  setPanel('renders');
58
58
  (0, exports.persistSelectedOptionsSidebarPanel)('renders');
59
59
  }, []);
60
- (0, react_1.useImperativeHandle)(exports.optionsSidebarTabs, () => {
60
+ (0, react_1.useImperativeHandle)(options_sidebar_tabs_1.optionsSidebarTabs, () => {
61
61
  return {
62
+ selectInspectorPanel: () => {
63
+ setPanel('inspector');
64
+ (0, exports.persistSelectedOptionsSidebarPanel)('inspector');
65
+ },
62
66
  selectRendersPanel: () => {
63
67
  setPanel('renders');
64
68
  (0, exports.persistSelectedOptionsSidebarPanel)('renders');
@@ -27,6 +27,7 @@ const is_menu_item_1 = require("../Menu/is-menu-item");
27
27
  const ModalHeader_1 = require("../ModalHeader");
28
28
  const DismissableModal_1 = require("../NewComposition/DismissableModal");
29
29
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
30
+ const options_sidebar_tabs_1 = require("../options-sidebar-tabs");
30
31
  const OptionsPanel_1 = require("../OptionsPanel");
31
32
  const actions_1 = require("../RenderQueue/actions");
32
33
  const SegmentedControl_1 = require("../SegmentedControl");
@@ -365,7 +366,7 @@ const RenderModal = ({ readOnlyStudio, initialFrame, initialVideoImageFormat, in
365
366
  var _a;
366
367
  setSidebarCollapsedState({ left: null, right: 'expanded' });
367
368
  (0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
368
- (_a = OptionsPanel_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
369
+ (_a = options_sidebar_tabs_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
369
370
  dispatchIfMounted({ type: 'start' });
370
371
  (0, actions_1.addStillRenderJob)({
371
372
  compositionId: resolvedComposition.id,
@@ -438,7 +439,7 @@ const RenderModal = ({ readOnlyStudio, initialFrame, initialVideoImageFormat, in
438
439
  var _a;
439
440
  setSidebarCollapsedState({ left: null, right: 'expanded' });
440
441
  (0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
441
- (_a = OptionsPanel_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
442
+ (_a = options_sidebar_tabs_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
442
443
  dispatchIfMounted({ type: 'start' });
443
444
  (0, actions_1.addVideoRenderJob)({
444
445
  compositionId: resolvedComposition.id,
@@ -548,7 +549,7 @@ const RenderModal = ({ readOnlyStudio, initialFrame, initialVideoImageFormat, in
548
549
  var _a;
549
550
  setSidebarCollapsedState({ left: null, right: 'expanded' });
550
551
  (0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
551
- (_a = OptionsPanel_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
552
+ (_a = options_sidebar_tabs_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
552
553
  dispatchIfMounted({ type: 'start' });
553
554
  (0, actions_1.addSequenceRenderJob)({
554
555
  compositionId: resolvedComposition.id,
@@ -18,6 +18,7 @@ const Button_1 = require("../Button");
18
18
  const is_menu_item_1 = require("../Menu/is-menu-item");
19
19
  const ModalHeader_1 = require("../ModalHeader");
20
20
  const DismissableModal_1 = require("../NewComposition/DismissableModal");
21
+ const options_sidebar_tabs_1 = require("../options-sidebar-tabs");
21
22
  const OptionsPanel_1 = require("../OptionsPanel");
22
23
  const context_1 = require("../RenderQueue/context");
23
24
  const SegmentedControl_1 = require("../SegmentedControl");
@@ -369,7 +370,7 @@ const WebRenderModal = ({ initialFrame, defaultProps, inFrameMark, outFrameMark,
369
370
  }
370
371
  setSidebarCollapsedState({ left: null, right: 'expanded' });
371
372
  (0, OptionsPanel_1.persistSelectedOptionsSidebarPanel)('renders');
372
- (_a = OptionsPanel_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
373
+ (_a = options_sidebar_tabs_1.optionsSidebarTabs.current) === null || _a === void 0 ? void 0 : _a.selectRendersPanel();
373
374
  setSelectedModal(null);
374
375
  }, [
375
376
  renderMode,