@remotion/studio 4.0.137 → 4.0.139

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 (138) hide show
  1. package/.eslintrc +33 -33
  2. package/.turbo/turbo-build.log +1 -2
  3. package/dist/components/AssetSelectorItem.d.ts +8 -8
  4. package/dist/components/AssetSelectorItem.js +8 -2
  5. package/dist/components/Canvas.js +1 -1
  6. package/dist/components/CanvasOrLoading.js +1 -1
  7. package/dist/components/CheckerboardProvider.d.ts +1 -1
  8. package/dist/components/CompositionSelectorItem.js +1 -1
  9. package/dist/components/ContextMenu.js +1 -1
  10. package/dist/components/CopyButton.js +1 -1
  11. package/dist/components/Editor.d.ts +2 -2
  12. package/dist/components/Editor.js +1 -1
  13. package/dist/components/EditorContent.d.ts +5 -5
  14. package/dist/components/EditorContent.js +1 -1
  15. package/dist/components/FilePreview.js +1 -1
  16. package/dist/components/Menu/MenuSubItem.js +2 -2
  17. package/dist/components/MenuBuildIndicator.js +1 -1
  18. package/dist/components/MenuToolbar.js +1 -1
  19. package/dist/components/ModalHeader.js +1 -1
  20. package/dist/components/Modals.d.ts +1 -1
  21. package/dist/components/Modals.js +1 -1
  22. package/dist/components/NewComposition/CodemodFooter.js +1 -1
  23. package/dist/components/NewComposition/ComboBox.js +1 -1
  24. package/dist/components/NewComposition/DeleteComposition.d.ts +1 -1
  25. package/dist/components/NewComposition/DeleteComposition.js +4 -1
  26. package/dist/components/NewComposition/DuplicateComposition.d.ts +1 -1
  27. package/dist/components/NewComposition/DuplicateComposition.js +7 -4
  28. package/dist/components/NewComposition/MenuContent.js +1 -1
  29. package/dist/components/NewComposition/NewCompDuration.js +4 -4
  30. package/dist/components/NewComposition/RenameComposition.d.ts +1 -1
  31. package/dist/components/NewComposition/RenameComposition.js +6 -3
  32. package/dist/components/Notifications/ServerDisconnected.js +1 -1
  33. package/dist/components/PlayPause.d.ts +3 -3
  34. package/dist/components/PlayPause.js +1 -1
  35. package/dist/components/PreviewToolbar.js +2 -2
  36. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +3 -3
  37. package/dist/components/RenderButton.js +1 -0
  38. package/dist/components/RenderModal/DataEditor.js +4 -4
  39. package/dist/components/RenderModal/EnforceAudioTrackSetting.js +1 -1
  40. package/dist/components/RenderModal/EnvInput.js +1 -1
  41. package/dist/components/RenderModal/FrameRangeSetting.js +1 -1
  42. package/dist/components/RenderModal/MutedSetting.js +1 -1
  43. package/dist/components/RenderModal/NumberSetting.js +2 -2
  44. package/dist/components/RenderModal/OptionExplainer.js +1 -1
  45. package/dist/components/RenderModal/RenderModal.d.ts +41 -39
  46. package/dist/components/RenderModal/RenderModal.js +11 -9
  47. package/dist/components/RenderModal/RenderModalAdvanced.js +2 -2
  48. package/dist/components/RenderModal/RenderModalAudio.js +3 -3
  49. package/dist/components/RenderModal/RenderModalBasic.js +3 -3
  50. package/dist/components/RenderModal/RenderModalGif.js +1 -1
  51. package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +2 -2
  52. package/dist/components/RenderModal/RenderModalOutputName.js +1 -1
  53. package/dist/components/RenderModal/RenderModalPicture.js +2 -2
  54. package/dist/components/RenderModal/RenderStatusModal.js +1 -1
  55. package/dist/components/RenderModal/ResolveCompositionBeforeModal.js +1 -1
  56. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +2 -2
  57. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -1
  58. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -1
  59. package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +1 -1
  60. package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +3 -3
  61. package/dist/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +1 -1
  62. package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +1 -1
  63. package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
  64. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +1 -1
  65. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +3 -3
  66. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +1 -1
  67. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +2 -2
  68. package/dist/components/RenderModal/SchemaEditor/ZodDefaultEditor.d.ts +1 -1
  69. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.d.ts +1 -1
  70. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +3 -3
  71. package/dist/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +1 -1
  72. package/dist/components/RenderModal/SchemaEditor/ZodEffectEditor.js +1 -1
  73. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -1
  74. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +2 -2
  75. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +1 -1
  76. package/dist/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +1 -1
  77. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +1 -1
  78. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  79. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +1 -1
  80. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +2 -2
  81. package/dist/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +1 -1
  82. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +1 -1
  83. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +2 -2
  84. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.d.ts +1 -1
  85. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +2 -2
  86. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +1 -1
  87. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +2 -2
  88. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.d.ts +1 -1
  89. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +2 -2
  90. package/dist/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +1 -1
  91. package/dist/components/RenderModal/SeparateAudioOption.js +2 -2
  92. package/dist/components/RenderQueue/RenderQueueRepeat.d.ts +1 -1
  93. package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
  94. package/dist/components/RenderQueue/index.js +2 -2
  95. package/dist/components/RendersTab.js +1 -1
  96. package/dist/components/SidebarRenderButton.d.ts +2 -2
  97. package/dist/components/SidebarRenderButton.js +9 -1
  98. package/dist/components/Splitter/SplitterContainer.d.ts +7 -6
  99. package/dist/components/Splitter/SplitterContainer.js +3 -3
  100. package/dist/components/TimeValue.js +1 -1
  101. package/dist/components/Timeline/Timeline.js +2 -2
  102. package/dist/components/Timeline/TimelineDragHandler.js +2 -2
  103. package/dist/components/Timeline/TimelineSlider.js +2 -2
  104. package/dist/components/Timeline/TimelineStack/index.js +3 -2
  105. package/dist/components/Timeline/TimelineTimeIndicators.js +1 -1
  106. package/dist/components/Timeline/TimelineTracks.js +1 -1
  107. package/dist/components/Timeline/timeline-scroll-logic.js +1 -1
  108. package/dist/components/UpdateModal/UpdateModal.js +1 -1
  109. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +2 -2
  110. package/dist/error-overlay/remotion-overlay/StackFrame.js +1 -1
  111. package/dist/helpers/get-location-of-sequence.d.ts +1 -1
  112. package/dist/helpers/retry-payload.js +3 -0
  113. package/dist/helpers/use-menu-structure.js +2 -2
  114. package/dist/previewEntry.js +1 -1
  115. package/dist/state/modals.d.ts +2 -0
  116. package/dist/state/sidebar.d.ts +1 -1
  117. package/package.json +10 -10
  118. package/tsconfig.tsbuildinfo +1 -1
  119. package/dist/components/NewComposition/CopyHint.d.ts +0 -2
  120. package/dist/components/NewComposition/CopyHint.js +0 -30
  121. package/dist/components/NewComposition/NewCompAspectRatio.d.ts +0 -7
  122. package/dist/components/NewComposition/NewCompAspectRatio.js +0 -20
  123. package/dist/components/NewComposition/NewCompCode.d.ts +0 -9
  124. package/dist/components/NewComposition/NewCompCode.js +0 -67
  125. package/dist/components/NewComposition/NewComposition.d.ts +0 -7
  126. package/dist/components/NewComposition/NewComposition.js +0 -163
  127. package/dist/components/NewComposition/ToggleAspectRatio.d.ts +0 -5
  128. package/dist/components/NewComposition/ToggleAspectRatio.js +0 -26
  129. package/dist/components/NewComposition/new-comp-layout.d.ts +0 -3
  130. package/dist/components/NewComposition/new-comp-layout.js +0 -12
  131. package/dist/components/PlayerEmitterContext.d.ts +0 -4
  132. package/dist/components/PlayerEmitterContext.js +0 -11
  133. package/dist/components/RenderModal/RenderModalInput.d.ts +0 -12
  134. package/dist/components/RenderModal/RenderModalInput.js +0 -13
  135. package/dist/icons/lock.d.ts +0 -4
  136. package/dist/icons/lock.js +0 -12
  137. package/dist/state/aspect-ratio-locked.d.ts +0 -2
  138. package/dist/state/aspect-ratio-locked.js +0 -16
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const CopyHint: React.FC;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CopyHint = 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 style = {
8
- fontSize: 12,
9
- color: colors_1.LIGHT_TEXT,
10
- };
11
- const CopyHint = () => {
12
- const [projectInfo, setProjectInfo] = (0, react_1.useState)(null);
13
- (0, react_1.useEffect)(() => {
14
- fetch(`/api/project-info`)
15
- .then((res) => res.json())
16
- .then((res) => {
17
- setProjectInfo(res);
18
- })
19
- .catch((err) => {
20
- // eslint-disable-next-line no-console
21
- console.log('Error fetching info about the project', err);
22
- setProjectInfo(null);
23
- });
24
- }, []);
25
- if (!(projectInfo === null || projectInfo === void 0 ? void 0 : projectInfo.rootFile)) {
26
- return null;
27
- }
28
- return ((0, jsx_runtime_1.jsxs)("div", { style: style, children: ["Copy this into ", (0, jsx_runtime_1.jsx)("br", {}), " your", ' ', (0, jsx_runtime_1.jsx)("span", { style: style, title: projectInfo.rootFile, children: projectInfo.relativeRootFile }), ' ', "file."] }));
29
- };
30
- exports.CopyHint = CopyHint;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export declare const NewCompAspectRatio: React.FC<{
3
- width: number;
4
- height: number;
5
- aspectRatioLocked: number | null;
6
- setAspectRatioLocked: (newOption: boolean) => void;
7
- }>;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NewCompAspectRatio = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const new_comp_layout_1 = require("./new-comp-layout");
6
- const render_aspect_ratio_1 = require("./render-aspect-ratio");
7
- const ToggleAspectRatio_1 = require("./ToggleAspectRatio");
8
- const GUIDE_HEIGHT = 55;
9
- const GUIDE_WIDTH = 10;
10
- const container = {
11
- display: 'flex',
12
- flexDirection: 'row',
13
- marginLeft: 10,
14
- alignItems: 'center',
15
- };
16
- const NewCompAspectRatio = ({ width, height, aspectRatioLocked, setAspectRatioLocked }) => {
17
- const pixels = Number(width) * Number(height);
18
- return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)("svg", { width: GUIDE_WIDTH, height: GUIDE_HEIGHT, children: (0, jsx_runtime_1.jsx)("path", { d: `M 0 0 L ${GUIDE_WIDTH} 0 L ${GUIDE_WIDTH} ${GUIDE_HEIGHT} L 0 ${GUIDE_HEIGHT}`, fill: "transparent", strokeWidth: "2", stroke: "rgba(255, 255, 255, 0.2)" }) }), (0, jsx_runtime_1.jsx)(ToggleAspectRatio_1.ToggleAspectRatio, { aspectRatioLocked: Boolean(aspectRatioLocked), setAspectRatioLocked: setAspectRatioLocked }), pixels > 0 ? ((0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.rightLabel, children: ["Aspect ratio ", (0, render_aspect_ratio_1.aspectRatio)(Number(width), Number(height))] })) : null] }) }));
19
- };
20
- exports.NewCompAspectRatio = NewCompAspectRatio;
@@ -1,9 +0,0 @@
1
- export declare const getNewCompositionCode: ({ type, height, width, fps, durationInFrames, name, raw, }: {
2
- type: 'still' | 'composition';
3
- height: number;
4
- width: number;
5
- fps: number;
6
- durationInFrames: number;
7
- name: string;
8
- raw: boolean;
9
- }) => string | (string | import("react/jsx-runtime").JSX.Element | (string | import("react/jsx-runtime").JSX.Element)[])[];
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNewCompositionCode = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const strColor = '#9ECBFF';
6
- const consColor = '#79B8FF';
7
- const propColor = '#B392F0';
8
- const keywordColor = '#F97583';
9
- const cssReset = {
10
- fontFamily: 'monospace',
11
- };
12
- const makeProperty = (key, val, type, raw) => {
13
- if (raw) {
14
- return makePropertyRaw(key, val, type);
15
- }
16
- return [
17
- ` `,
18
- (0, jsx_runtime_1.jsx)("span", { style: { ...cssReset, color: propColor }, children: key }, key + 'key'),
19
- (0, jsx_runtime_1.jsx)("span", { style: { ...cssReset, color: keywordColor }, children: '=' }, key + 'equal'),
20
- type === 'string'
21
- ? [
22
- (0, jsx_runtime_1.jsxs)("span", { style: { ...cssReset, color: strColor }, children: ['"', val, '"'] }, key + 'value'),
23
- ]
24
- : [
25
- '{',
26
- (0, jsx_runtime_1.jsx)("span", { style: {
27
- ...cssReset,
28
- color: typeof val === 'number' ? consColor : strColor,
29
- }, children: val }, key + 'value'),
30
- '}',
31
- ],
32
- (0, jsx_runtime_1.jsx)("br", {}, key + 'br'),
33
- ];
34
- };
35
- const makePropertyRaw = (key, val, type) => {
36
- return [
37
- ` `,
38
- key,
39
- '=',
40
- type === 'string' ? ['"' + val + '"'].join('') : ['{', val, '}'].join(''),
41
- '\n',
42
- ].join('');
43
- };
44
- const getNewCompositionCode = ({ type, height, width, fps, durationInFrames, name, raw, }) => {
45
- const compName = type === 'still' ? 'Still' : 'Composition';
46
- const props = [
47
- ...makeProperty('id', name, 'string', raw),
48
- ...makeProperty('component', name, 'const', raw),
49
- ...(type === 'composition'
50
- ? makeProperty('durationInFrames', durationInFrames, 'const', raw)
51
- : []),
52
- ...makeProperty('height', height, 'const', raw),
53
- ...makeProperty('width', width, 'const', raw),
54
- ...(type === 'composition' ? makeProperty('fps', fps, 'const', raw) : []),
55
- ];
56
- if (raw) {
57
- return ['<', compName, '\n', ...props, '/>'].join('');
58
- }
59
- return [
60
- `<`,
61
- (0, jsx_runtime_1.jsx)("span", { style: { ...cssReset, color: '#79B8FF' }, children: compName }, "compname"),
62
- (0, jsx_runtime_1.jsx)("br", {}, "linebr1"),
63
- ...props,
64
- '/>',
65
- ];
66
- };
67
- exports.getNewCompositionCode = getNewCompositionCode;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { CompType } from '../../state/modals';
3
- declare const DuplicateComposition: React.FC<{
4
- initialCompType: CompType;
5
- compositionId: string;
6
- }>;
7
- export default DuplicateComposition;
@@ -1,163 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_1 = require("react");
5
- const remotion_1 = require("remotion");
6
- const validate_new_comp_data_1 = require("../../helpers/validate-new-comp-data");
7
- const Checkmark_1 = require("../../icons/Checkmark");
8
- const aspect_ratio_locked_1 = require("../../state/aspect-ratio-locked");
9
- const modals_1 = require("../../state/modals");
10
- const layout_1 = require("../layout");
11
- const ModalContainer_1 = require("../ModalContainer");
12
- const ModalHeader_1 = require("../ModalHeader");
13
- const ComboBox_1 = require("./ComboBox");
14
- const InputDragger_1 = require("./InputDragger");
15
- const new_comp_layout_1 = require("./new-comp-layout");
16
- const NewCompAspectRatio_1 = require("./NewCompAspectRatio");
17
- const NewCompDuration_1 = require("./NewCompDuration");
18
- const RemInput_1 = require("./RemInput");
19
- const ValidationMessage_1 = require("./ValidationMessage");
20
- const left = {
21
- padding: 12,
22
- paddingBottom: 80,
23
- paddingRight: 12,
24
- flex: 1,
25
- fontSize: 13,
26
- };
27
- const comboBoxStyle = {
28
- width: new_comp_layout_1.inputArea.width,
29
- };
30
- const commonFrameRates = [24, 25, 29.97, 30, 48, 50];
31
- const DuplicateComposition = (props) => {
32
- const { initialCompType } = props;
33
- const [selectedFrameRate, setFrameRate] = (0, react_1.useState)(String(commonFrameRates[0]));
34
- const { compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
35
- const [type, setType] = (0, react_1.useState)(initialCompType);
36
- const [name, setName] = (0, react_1.useState)('MyComp');
37
- const [size, setSize] = (0, react_1.useState)({
38
- width: '1280',
39
- height: '720',
40
- });
41
- const panelContent = (0, react_1.useMemo)(() => {
42
- return {
43
- flexDirection: 'row',
44
- display: 'flex',
45
- width: (0, ModalContainer_1.getMaxModalWidth)(600),
46
- height: type === 'composition'
47
- ? (0, ModalContainer_1.getMaxModalHeight)(490)
48
- : (0, ModalContainer_1.getMaxModalHeight)(340),
49
- overflow: 'hidden',
50
- };
51
- }, [type]);
52
- const [lockedAspectRatio, setLockedAspectRatio] = (0, react_1.useState)((0, aspect_ratio_locked_1.loadAspectRatioOption)() ? Number(size.width) / Number(size.height) : null);
53
- const [durationInFrames, setDurationInFrames] = (0, react_1.useState)('150');
54
- const setAspectRatioLocked = (0, react_1.useCallback)((option) => {
55
- (0, aspect_ratio_locked_1.persistAspectRatioOption)(option);
56
- setLockedAspectRatio(option ? Number(size.width) / Number(size.height) : null);
57
- }, [size.height, size.width]);
58
- const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
59
- const onQuit = (0, react_1.useCallback)(() => {
60
- setSelectedModal(null);
61
- }, [setSelectedModal]);
62
- const onTypeChanged = (0, react_1.useCallback)((newType) => {
63
- setType(newType);
64
- }, []);
65
- const onWidthChanged = (0, react_1.useCallback)((newValue) => {
66
- setSize((s) => {
67
- const { height } = s;
68
- const newWidth = Number(newValue);
69
- return {
70
- height: lockedAspectRatio === null
71
- ? height
72
- : String(Math.ceil(newWidth / lockedAspectRatio / 2) * 2),
73
- width: String(newWidth),
74
- };
75
- });
76
- }, [lockedAspectRatio]);
77
- const onWidthDirectlyChanged = (0, react_1.useCallback)((newWidth) => {
78
- setSize((s) => {
79
- const { height } = s;
80
- return {
81
- height: lockedAspectRatio === null
82
- ? height
83
- : String(Math.ceil(newWidth / lockedAspectRatio / 2) * 2),
84
- width: String(newWidth),
85
- };
86
- });
87
- }, [lockedAspectRatio]);
88
- const onHeightDirectlyChanged = (0, react_1.useCallback)((newHeight) => {
89
- setSize((s) => {
90
- const { width } = s;
91
- return {
92
- width: lockedAspectRatio === null
93
- ? width
94
- : String(Math.ceil((newHeight / 2) * lockedAspectRatio) * 2),
95
- height: String(newHeight),
96
- };
97
- });
98
- }, [lockedAspectRatio]);
99
- const onHeightChanged = (0, react_1.useCallback)((newValue) => {
100
- setSize((s) => {
101
- const { width } = s;
102
- const newHeight = Number(newValue);
103
- return {
104
- width: lockedAspectRatio === null
105
- ? width
106
- : String(Math.ceil((newHeight / 2) * lockedAspectRatio) * 2),
107
- height: String(newHeight),
108
- };
109
- });
110
- }, [lockedAspectRatio]);
111
- const onNameChange = (0, react_1.useCallback)((e) => {
112
- setName(e.target.value);
113
- }, []);
114
- const onFpsChange = (0, react_1.useCallback)((newFps) => {
115
- setFrameRate(String(newFps));
116
- }, []);
117
- const items = (0, react_1.useMemo)(() => {
118
- return commonFrameRates.map((frameRate) => {
119
- return {
120
- id: String(frameRate),
121
- label: `${frameRate}fps`,
122
- onClick: () => onFpsChange(frameRate),
123
- type: 'item',
124
- value: frameRate,
125
- keyHint: null,
126
- leftItem: String(frameRate) === selectedFrameRate ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null,
127
- subMenu: null,
128
- quickSwitcherLabel: null,
129
- };
130
- });
131
- }, [onFpsChange, selectedFrameRate]);
132
- const compNameErrMessage = (0, validate_new_comp_data_1.validateCompositionName)(name, compositions);
133
- const compWidthErrMessage = (0, validate_new_comp_data_1.validateCompositionDimension)('Width', size.width);
134
- const compHeightErrMessage = (0, validate_new_comp_data_1.validateCompositionDimension)('Height', size.height);
135
- const typeValues = (0, react_1.useMemo)(() => {
136
- return [
137
- {
138
- id: 'composition',
139
- keyHint: null,
140
- label: '<Composition />',
141
- leftItem: null,
142
- onClick: () => onTypeChanged('composition'),
143
- subMenu: null,
144
- type: 'item',
145
- value: 'composition',
146
- quickSwitcherLabel: null,
147
- },
148
- {
149
- id: 'still',
150
- keyHint: null,
151
- label: '<Still />',
152
- leftItem: null,
153
- onClick: () => onTypeChanged('still'),
154
- subMenu: null,
155
- type: 'item',
156
- value: 'still',
157
- quickSwitcherLabel: null,
158
- },
159
- ];
160
- }, [onTypeChanged]);
161
- return ((0, jsx_runtime_1.jsxs)(ModalContainer_1.ModalContainer, { onOutsideClick: onQuit, onEscape: onQuit, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: "Duplicate composition" }), (0, jsx_runtime_1.jsx)("div", { style: panelContent, children: (0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 3 }), (0, jsx_runtime_1.jsxs)("form", { children: [(0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Type" }), (0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.inputArea, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Type of composition", style: comboBoxStyle, values: typeValues, selectedId: type }) })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Name" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { value: name, onChange: onNameChange, type: "text", placeholder: "Composition name", status: "ok", rightAlign: false }), compNameErrMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compNameErrMessage, type: "error" })] })) : null] })] })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Width" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, 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 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compWidthErrMessage, type: "error" })] })) : null] })] }) }) }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("label", { children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Height" }), (0, jsx_runtime_1.jsxs)("div", { style: new_comp_layout_1.inputArea, children: [(0, 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 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: compHeightErrMessage, type: "error" })] })) : null] })] }) })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(NewCompAspectRatio_1.NewCompAspectRatio, { width: Number(size.width), height: Number(size.height), aspectRatioLocked: lockedAspectRatio, setAspectRatioLocked: setAspectRatioLocked }) })] }), (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), type === 'composition' ? ((0, jsx_runtime_1.jsx)(NewCompDuration_1.NewCompDuration, { durationInFrames: durationInFrames, fps: selectedFrameRate, setDurationInFrames: setDurationInFrames })) : null, (0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", {}), type === 'composition' ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", {}), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsxs)("label", { children: [(0, jsx_runtime_1.jsx)("div", { style: new_comp_layout_1.leftLabel, children: "Framerate" }), (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: "Framerate", style: comboBoxStyle, values: items, selectedId: selectedFrameRate })] })] })) : null] })] }) })] }));
162
- };
163
- exports.default = DuplicateComposition;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare const ToggleAspectRatio: React.FC<{
3
- aspectRatioLocked: boolean;
4
- setAspectRatioLocked: (option: boolean) => void;
5
- }>;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ToggleAspectRatio = 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 lock_1 = require("../../icons/lock");
8
- const buttonStyle = {
9
- backgroundColor: colors_1.BACKGROUND,
10
- border: 'none',
11
- position: 'absolute',
12
- paddingLeft: 2,
13
- paddingRight: 2,
14
- marginLeft: 3,
15
- };
16
- const iconStyle = {
17
- width: 10,
18
- color: 'white',
19
- };
20
- const ToggleAspectRatio = ({ aspectRatioLocked, setAspectRatioLocked }) => {
21
- const onClick = (0, react_1.useCallback)(() => {
22
- setAspectRatioLocked(!aspectRatioLocked);
23
- }, [aspectRatioLocked, setAspectRatioLocked]);
24
- return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClick, style: buttonStyle, children: aspectRatioLocked ? ((0, jsx_runtime_1.jsx)(lock_1.LockIcon, { style: iconStyle })) : ((0, jsx_runtime_1.jsx)(lock_1.UnlockIcon, { style: iconStyle })) }));
25
- };
26
- exports.ToggleAspectRatio = ToggleAspectRatio;
@@ -1,3 +0,0 @@
1
- import type React from 'react';
2
- export declare const inputArea: React.CSSProperties;
3
- export declare const rightLabel: React.CSSProperties;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rightLabel = exports.inputArea = void 0;
4
- const colors_1 = require("../../helpers/colors");
5
- exports.inputArea = {
6
- width: 190,
7
- };
8
- exports.rightLabel = {
9
- fontSize: 13,
10
- color: colors_1.LIGHT_TEXT,
11
- marginLeft: 10,
12
- };
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare const PlayerEmitterContext: React.FC<{
3
- children: React.ReactNode;
4
- }>;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlayerEmitterContext = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const player_1 = require("@remotion/player");
6
- const react_1 = require("react");
7
- const PlayerEmitterContext = ({ children }) => {
8
- const [emitter] = (0, react_1.useState)(() => new player_1.PlayerInternals.PlayerEmitter());
9
- return ((0, jsx_runtime_1.jsx)(player_1.PlayerInternals.PlayerEventEmitterContext.Provider, { value: emitter, children: children }));
10
- };
11
- exports.PlayerEmitterContext = PlayerEmitterContext;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import type { RenderType } from './RenderModalAdvanced';
3
- type Props = {
4
- existence: boolean;
5
- inputStyle: React.CSSProperties;
6
- outName: string;
7
- onValueChange: React.ChangeEventHandler<HTMLInputElement>;
8
- validationMessage: string | null;
9
- renderType: RenderType;
10
- };
11
- export declare function RenderModalInput({ existence, inputStyle, outName, onValueChange, validationMessage, renderType, }: Props): import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RenderModalInput = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const layout_1 = require("../layout");
6
- const RemInput_1 = require("../NewComposition/RemInput");
7
- const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
8
- const layout_2 = require("./layout");
9
- // eslint-disable-next-line react/function-component-definition
10
- function RenderModalInput({ existence, inputStyle, outName, onValueChange, validationMessage, renderType, }) {
11
- return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsx)(layout_1.Column, { children: (0, jsx_runtime_1.jsx)("div", { style: layout_2.label, children: renderType === 'sequence' ? 'Folder name' : 'Output name' }) }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(RemInput_1.RemotionInput, { status: validationMessage ? 'error' : existence ? 'warning' : 'ok', style: inputStyle, type: "text", value: outName, onChange: onValueChange, rightAlign: true }), validationMessage ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: validationMessage, type: 'error' })] })) : existence ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1, block: true }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { align: "flex-end", message: "Will be overwritten", type: 'warning' })] })) : null] }) })] }));
12
- }
13
- exports.RenderModalInput = RenderModalInput;
@@ -1,4 +0,0 @@
1
- import type { SVGProps } from 'react';
2
- import React from 'react';
3
- export declare const LockIcon: React.FC<SVGProps<SVGSVGElement>>;
4
- export declare const UnlockIcon: React.FC<SVGProps<SVGSVGElement>>;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnlockIcon = exports.LockIcon = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const LockIcon = (props) => {
6
- return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 448 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" }) }));
7
- };
8
- exports.LockIcon = LockIcon;
9
- const UnlockIcon = (props) => {
10
- return ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 448 512", ...props, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" }) }));
11
- };
12
- exports.UnlockIcon = UnlockIcon;
@@ -1,2 +0,0 @@
1
- export declare const persistAspectRatioOption: (option: boolean) => void;
2
- export declare const loadAspectRatioOption: () => boolean;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadAspectRatioOption = exports.persistAspectRatioOption = void 0;
4
- const aspectRatioLocalStorageKey = 'aspectRatio';
5
- const persistAspectRatioOption = (option) => {
6
- localStorage.setItem(aspectRatioLocalStorageKey, String(option));
7
- };
8
- exports.persistAspectRatioOption = persistAspectRatioOption;
9
- const loadAspectRatioOption = () => {
10
- const item = localStorage.getItem(aspectRatioLocalStorageKey);
11
- if (item === null) {
12
- return true;
13
- }
14
- return item !== 'false';
15
- };
16
- exports.loadAspectRatioOption = loadAspectRatioOption;