@remotion/cli 3.3.78 → 3.3.80
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.
- package/dist/better-opn/index.d.ts +6 -0
- package/dist/better-opn/index.js +202 -0
- package/dist/codemods/update-default-props.d.ts +5 -0
- package/dist/codemods/update-default-props.js +98 -0
- package/dist/editor/components/Checkbox.js +1 -0
- package/dist/editor/components/CollapsedSidebarExpander.d.ts +5 -0
- package/dist/editor/components/CollapsedSidebarExpander.js +40 -0
- package/dist/editor/components/CurrentCompositionSideEffects.js +11 -2
- package/dist/editor/components/InlineAction.js +1 -1
- package/dist/editor/components/Modals.js +3 -3
- package/dist/editor/components/NewComposition/RemTextarea.d.ts +7 -0
- package/dist/editor/components/NewComposition/RemTextarea.js +90 -0
- package/dist/editor/components/RenderButton.d.ts +2 -2
- package/dist/editor/components/RenderButton.js +5 -0
- package/dist/editor/components/RenderModal/CliCopyButton.d.ts +4 -0
- package/dist/editor/components/RenderModal/CliCopyButton.js +22 -0
- package/dist/editor/components/RenderModal/CrfSetting.d.ts +2 -1
- package/dist/editor/components/RenderModal/CrfSetting.js +2 -2
- package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.d.ts +2 -0
- package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +4 -2
- package/dist/editor/components/RenderModal/EnvInput.d.ts +10 -0
- package/dist/editor/components/RenderModal/EnvInput.js +54 -0
- package/dist/editor/components/RenderModal/FrameRangeSetting.js +1 -1
- package/dist/editor/components/RenderModal/{RenderErrorModal.d.ts → GuiRenderStatus.d.ts} +1 -1
- package/dist/editor/components/RenderModal/GuiRenderStatus.js +78 -0
- package/dist/editor/components/RenderModal/InfoBubble.js +16 -12
- package/dist/editor/components/RenderModal/InfoTooltip.d.ts +1 -0
- package/dist/editor/components/RenderModal/InfoTooltip.js +25 -16
- package/dist/editor/components/RenderModal/InlineEyeIcon.d.ts +5 -0
- package/dist/editor/components/RenderModal/InlineEyeIcon.js +38 -0
- package/dist/editor/components/RenderModal/InlineRemoveButton.d.ts +4 -0
- package/dist/editor/components/RenderModal/InlineRemoveButton.js +14 -0
- package/dist/editor/components/RenderModal/JpegQualitySetting.d.ts +5 -0
- package/dist/editor/components/RenderModal/JpegQualitySetting.js +12 -0
- package/dist/editor/components/RenderModal/MutedSetting.d.ts +2 -0
- package/dist/editor/components/RenderModal/MutedSetting.js +4 -2
- package/dist/editor/components/RenderModal/NumberOfLoopsSetting.js +1 -1
- package/dist/editor/components/RenderModal/NumberSetting.js +1 -1
- package/dist/editor/components/RenderModal/OptionExplainer.d.ts +1 -1
- package/dist/editor/components/RenderModal/OptionExplainer.js +26 -2
- package/dist/editor/components/RenderModal/RenderModal.d.ts +6 -1
- package/dist/editor/components/RenderModal/RenderModal.js +52 -9
- package/dist/editor/components/RenderModal/RenderModalAdvanced.d.ts +11 -0
- package/dist/editor/components/RenderModal/RenderModalAdvanced.js +34 -2
- package/dist/editor/components/RenderModal/RenderModalAudio.js +3 -1
- package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +3 -2
- package/dist/editor/components/RenderModal/RenderModalBasic.js +5 -7
- package/dist/editor/components/RenderModal/RenderModalData.d.ts +10 -0
- package/dist/editor/components/RenderModal/RenderModalData.js +55 -0
- package/dist/editor/components/RenderModal/RenderModalEnvironmentVariables.d.ts +5 -0
- package/dist/editor/components/RenderModal/RenderModalEnvironmentVariables.js +52 -0
- package/dist/editor/components/RenderModal/RenderModalInput.d.ts +10 -0
- package/dist/editor/components/RenderModal/RenderModalInput.js +13 -0
- package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.d.ts +8 -0
- package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.js +87 -0
- package/dist/editor/components/RenderModal/RenderModalPicture.js +6 -4
- package/dist/editor/components/RenderModal/RenderStatusModal.d.ts +4 -0
- package/dist/editor/components/RenderModal/{RenderErrorModal.js → RenderStatusModal.js} +21 -14
- package/dist/editor/components/RenderModal/ScaleSetting.js +6 -3
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +12 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +36 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +15 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +43 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaResetButton.d.ts +4 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaResetButton.js +12 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.d.ts +4 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +12 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +70 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +13 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +28 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +12 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +27 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +75 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +51 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +5 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.d.ts +8 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +23 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +89 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +57 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +43 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +14 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +56 -0
- package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.d.ts +2 -0
- package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.js +21 -0
- package/dist/editor/components/RenderModal/SchemaEditor/get-schema-label.d.ts +2 -0
- package/dist/editor/components/RenderModal/SchemaEditor/get-schema-label.js +15 -0
- package/dist/editor/components/RenderModal/SchemaEditor/zod-types.d.ts +1 -0
- package/dist/editor/components/RenderModal/SchemaEditor/zod-types.js +2 -0
- package/dist/editor/components/RenderModal/layout.d.ts +3 -1
- package/dist/editor/components/RenderModal/layout.js +19 -3
- package/dist/editor/components/RenderModal/out-name-checker.d.ts +15 -0
- package/dist/editor/components/RenderModal/out-name-checker.js +79 -0
- package/dist/editor/components/RenderQueue/RenderQueueError.js +3 -3
- package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +18 -2
- package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +4 -2
- package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.js +3 -4
- package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +11 -1
- package/dist/editor/components/RenderQueue/SuccessIcon.d.ts +2 -0
- package/dist/editor/components/RenderQueue/SuccessIcon.js +14 -0
- package/dist/editor/components/RenderQueue/actions.d.ts +11 -2
- package/dist/editor/components/RenderQueue/actions.js +18 -3
- package/dist/editor/components/RenderToolbarIcon.js +5 -0
- package/dist/editor/components/RightPanel.d.ts +2 -0
- package/dist/editor/components/RightPanel.js +43 -0
- package/dist/editor/components/SidebarContent.js +1 -0
- package/dist/editor/helpers/convert-env-variables.d.ts +2 -0
- package/dist/editor/helpers/convert-env-variables.js +20 -0
- package/dist/editor/helpers/get-timeline-sequence-layout.js +1 -1
- package/dist/editor/helpers/render-modal-sections.d.ts +1 -1
- package/dist/editor/helpers/render-modal-sections.js +4 -4
- package/dist/editor/icons/data.d.ts +2 -0
- package/dist/editor/icons/data.js +8 -0
- package/dist/editor/icons/save.d.ts +2 -0
- package/dist/editor/icons/save.js +8 -0
- package/dist/handle-common-errors.js +16 -0
- package/dist/parse-command-line.d.ts +2 -0
- package/dist/preview-server/api-routes.js +2 -0
- package/dist/preview-server/api-types.d.ts +2 -1
- package/dist/preview-server/render-queue/job.d.ts +25 -12
- package/dist/preview-server/render-queue/make-retry-payload.js +11 -1
- package/dist/preview-server/render-queue/open-directory-in-finder.d.ts +1 -1
- package/dist/preview-server/render-queue/open-directory-in-finder.js +10 -1
- package/dist/preview-server/render-queue/process-still.js +4 -10
- package/dist/preview-server/render-queue/process-video.js +4 -10
- package/dist/preview-server/render-queue/queue.js +38 -16
- package/dist/preview-server/routes/add-render.js +7 -0
- package/dist/preview-server/routes/open-in-file-explorer.js +1 -7
- package/dist/preview-server/routes/update-default-props.d.ts +3 -0
- package/dist/preview-server/routes/update-default-props.js +22 -0
- package/dist/preview.js +8 -3
- package/dist/progress-types.d.ts +32 -0
- package/dist/progress-types.js +17 -0
- package/dist/render-flows/render.js +66 -52
- package/dist/render-flows/still.js +18 -18
- package/dist/required-chromium-options.d.ts +3 -0
- package/dist/required-chromium-options.js +2 -0
- package/package.json +7 -7
- package/dist/editor/components/RenderModal/QualitySetting.d.ts +0 -5
- package/dist/editor/components/RenderModal/QualitySetting.js +0 -27
- package/dist/gcp-command.d.ts +0 -1
- package/dist/gcp-command.js +0 -27
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copied from https://github.com/michaellzc/better-opn#readme
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.openBrowser = void 0;
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const open = require("open");
|
|
7
|
+
const normalizeURLToMatch = (target) => {
|
|
8
|
+
// We may encounter URL parse error but want to fallback to default behavior
|
|
9
|
+
try {
|
|
10
|
+
// Url module is deprecated on newer version of NodeJS, only use it when URL class is not supported (like Node 8)
|
|
11
|
+
const URL = typeof global.URL === 'undefined' ? require('url').URL : global.URL;
|
|
12
|
+
const url = new URL(target);
|
|
13
|
+
return url.origin;
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
return target;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
// Copy from
|
|
20
|
+
// https://github.com/facebook/create-react-app/blob/master/packages/react-dev-utils/openBrowser.js#L64
|
|
21
|
+
const startBrowserProcess = async ({ browser, url, args, }) => {
|
|
22
|
+
const tryNewInstance = args.length > 0;
|
|
23
|
+
const shouldTryOpenChromiumWithAppleScript = process.platform === 'darwin' &&
|
|
24
|
+
!tryNewInstance &&
|
|
25
|
+
(typeof browser !== 'string' ||
|
|
26
|
+
browser === 'google chrome' ||
|
|
27
|
+
browser === 'chrome');
|
|
28
|
+
if (shouldTryOpenChromiumWithAppleScript) {
|
|
29
|
+
let appleScriptDenied = false;
|
|
30
|
+
// Will use the first open browser found from list
|
|
31
|
+
const supportedChromiumBrowsers = [
|
|
32
|
+
'Google Chrome',
|
|
33
|
+
'Google Chrome Canary',
|
|
34
|
+
'Microsoft Edge',
|
|
35
|
+
'Brave Browser',
|
|
36
|
+
'Vivaldi',
|
|
37
|
+
'Chromium',
|
|
38
|
+
'Arc',
|
|
39
|
+
];
|
|
40
|
+
const processes = await new Promise((resolve, reject) => {
|
|
41
|
+
(0, child_process_1.exec)('ps cax', (err, stdout) => {
|
|
42
|
+
if (err) {
|
|
43
|
+
reject(err);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
resolve(stdout);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
const browsersToTry = supportedChromiumBrowsers.filter((b) => processes.includes(b));
|
|
51
|
+
for (const chromiumBrowser of browsersToTry) {
|
|
52
|
+
if (appleScriptDenied) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
// Try our best to reuse existing tab
|
|
57
|
+
// on OSX Chromium-based browser with AppleScript
|
|
58
|
+
const appleScript = `
|
|
59
|
+
(*
|
|
60
|
+
Copyright (c) 2015-present, Facebook, Inc.
|
|
61
|
+
This source code is licensed under the MIT license found in the
|
|
62
|
+
LICENSE file in the root directory of this source tree.
|
|
63
|
+
*)
|
|
64
|
+
|
|
65
|
+
property targetTab: null
|
|
66
|
+
property targetTabIndex: -1
|
|
67
|
+
property targetWindow: null
|
|
68
|
+
property theProgram: "${chromiumBrowser}"
|
|
69
|
+
|
|
70
|
+
on run argv
|
|
71
|
+
set theURL to "${encodeURI(url)}"
|
|
72
|
+
set matchURL to "${process.env.OPEN_MATCH_HOST_ONLY === 'true'
|
|
73
|
+
? encodeURI(normalizeURLToMatch(url))
|
|
74
|
+
: encodeURI(url)}"
|
|
75
|
+
|
|
76
|
+
using terms from application "Google Chrome"
|
|
77
|
+
tell application theProgram
|
|
78
|
+
|
|
79
|
+
if (count every window) = 0 then
|
|
80
|
+
make new window
|
|
81
|
+
end if
|
|
82
|
+
|
|
83
|
+
-- 1: Looking for tab running debugger
|
|
84
|
+
-- then, Reload debugging tab if found
|
|
85
|
+
-- then return
|
|
86
|
+
set found to my lookupTabWithUrl(matchURL)
|
|
87
|
+
if found then
|
|
88
|
+
set targetWindow's active tab index to targetTabIndex
|
|
89
|
+
tell targetTab to reload
|
|
90
|
+
tell targetWindow to activate
|
|
91
|
+
set index of targetWindow to 1
|
|
92
|
+
return
|
|
93
|
+
end if
|
|
94
|
+
|
|
95
|
+
-- 2: Looking for Empty tab
|
|
96
|
+
-- In case debugging tab was not found
|
|
97
|
+
-- We try to find an empty tab instead
|
|
98
|
+
set found to my lookupTabWithUrl("chrome://newtab/")
|
|
99
|
+
if found then
|
|
100
|
+
set targetWindow's active tab index to targetTabIndex
|
|
101
|
+
set URL of targetTab to theURL
|
|
102
|
+
tell targetWindow to activate
|
|
103
|
+
return
|
|
104
|
+
end if
|
|
105
|
+
|
|
106
|
+
-- 3: Create new tab
|
|
107
|
+
-- both debugging and empty tab were not found
|
|
108
|
+
-- make a new tab with url
|
|
109
|
+
tell window 1
|
|
110
|
+
activate
|
|
111
|
+
make new tab with properties {URL:theURL}
|
|
112
|
+
end tell
|
|
113
|
+
end tell
|
|
114
|
+
end using terms from
|
|
115
|
+
end run
|
|
116
|
+
|
|
117
|
+
-- Function:
|
|
118
|
+
-- Lookup tab with given url
|
|
119
|
+
-- if found, store tab, index, and window in properties
|
|
120
|
+
-- (properties were declared on top of file)
|
|
121
|
+
on lookupTabWithUrl(lookupUrl)
|
|
122
|
+
using terms from application "Google Chrome"
|
|
123
|
+
tell application theProgram
|
|
124
|
+
-- Find a tab with the given url
|
|
125
|
+
set found to false
|
|
126
|
+
set theTabIndex to -1
|
|
127
|
+
repeat with theWindow in every window
|
|
128
|
+
set theTabIndex to 0
|
|
129
|
+
repeat with theTab in every tab of theWindow
|
|
130
|
+
set theTabIndex to theTabIndex + 1
|
|
131
|
+
if (theTab's URL as string) contains lookupUrl then
|
|
132
|
+
-- assign tab, tab index, and window to properties
|
|
133
|
+
set targetTab to theTab
|
|
134
|
+
set targetTabIndex to theTabIndex
|
|
135
|
+
set targetWindow to theWindow
|
|
136
|
+
set found to true
|
|
137
|
+
exit repeat
|
|
138
|
+
end if
|
|
139
|
+
end repeat
|
|
140
|
+
|
|
141
|
+
if found then
|
|
142
|
+
exit repeat
|
|
143
|
+
end if
|
|
144
|
+
end repeat
|
|
145
|
+
end tell
|
|
146
|
+
end using terms from
|
|
147
|
+
return found
|
|
148
|
+
end lookupTabWithUrl
|
|
149
|
+
`.trim();
|
|
150
|
+
await new Promise((resolve, reject) => {
|
|
151
|
+
const proc = (0, child_process_1.exec)(`osascript -`, (error) => {
|
|
152
|
+
if (error) {
|
|
153
|
+
reject(error);
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
// Ignore errors.
|
|
157
|
+
// It it breaks, it will fallback to `opn` anyway
|
|
158
|
+
resolve();
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
proc.stdin.write(appleScript);
|
|
162
|
+
proc.stdin.end();
|
|
163
|
+
});
|
|
164
|
+
return Promise.resolve(true);
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
const appleScriptError = error.message;
|
|
168
|
+
if (appleScriptError
|
|
169
|
+
.toLowerCase()
|
|
170
|
+
.includes('not authorised to send apple events')) {
|
|
171
|
+
appleScriptDenied = true;
|
|
172
|
+
}
|
|
173
|
+
// Ignore errors.
|
|
174
|
+
// It it breaks, it will fallback to `opn` anyway
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// Fallback to opn
|
|
179
|
+
// (It will always open new tab)
|
|
180
|
+
return open(url, {
|
|
181
|
+
...(browser ? { app: { name: browser, arguments: args } } : {}),
|
|
182
|
+
newInstance: tryNewInstance,
|
|
183
|
+
wait: false,
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
const getBrowserArgs = (browserArgs) => {
|
|
187
|
+
if (browserArgs) {
|
|
188
|
+
return browserArgs.split(' ');
|
|
189
|
+
}
|
|
190
|
+
if (process.env.BROWSER_ARGS) {
|
|
191
|
+
return process.env.BROWSER_ARGS.split(' ');
|
|
192
|
+
}
|
|
193
|
+
return [];
|
|
194
|
+
};
|
|
195
|
+
const openBrowser = ({ url, browserFlag, browserArgs, }) => {
|
|
196
|
+
return startBrowserProcess({
|
|
197
|
+
browser: browserFlag !== null && browserFlag !== void 0 ? browserFlag : process.env.BROWSER,
|
|
198
|
+
url,
|
|
199
|
+
args: getBrowserArgs(browserArgs),
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
exports.openBrowser = openBrowser;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateDefaultProps = void 0;
|
|
4
|
+
const prettier_1 = require("prettier");
|
|
5
|
+
const findStarter = ({ input, compositionId, }) => {
|
|
6
|
+
const format1 = input.indexOf(`id="${compositionId}"`);
|
|
7
|
+
if (format1 > -1) {
|
|
8
|
+
return format1;
|
|
9
|
+
}
|
|
10
|
+
const format2 = input.indexOf(`id='${compositionId}'`);
|
|
11
|
+
if (format2 > -1) {
|
|
12
|
+
return format2;
|
|
13
|
+
}
|
|
14
|
+
const format3 = input.indexOf(`id={'${compositionId}'}`);
|
|
15
|
+
if (format3 > -1) {
|
|
16
|
+
return format3;
|
|
17
|
+
}
|
|
18
|
+
const format4 = input.indexOf(`id={"${compositionId}"}`);
|
|
19
|
+
if (format4 > -1) {
|
|
20
|
+
return format4;
|
|
21
|
+
}
|
|
22
|
+
const format5 = input.indexOf(`id={\`${compositionId}\``);
|
|
23
|
+
if (format5 > -1) {
|
|
24
|
+
return format5;
|
|
25
|
+
}
|
|
26
|
+
throw new Error(`Could not find composition ID ${compositionId} in file`);
|
|
27
|
+
};
|
|
28
|
+
const findEnder = (input, position, maxPosition) => {
|
|
29
|
+
let currentPosition = position;
|
|
30
|
+
while (currentPosition < maxPosition) {
|
|
31
|
+
const next = input.indexOf('}}', currentPosition + 1);
|
|
32
|
+
if (next === -1) {
|
|
33
|
+
throw new Error('Could not find end of defaultProps');
|
|
34
|
+
}
|
|
35
|
+
currentPosition = next;
|
|
36
|
+
const nextChar = input[next + 1];
|
|
37
|
+
if (nextChar === ',') {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
return [position, currentPosition + 1];
|
|
41
|
+
}
|
|
42
|
+
throw new Error('did not find string');
|
|
43
|
+
};
|
|
44
|
+
const findTerminators = (input, position) => {
|
|
45
|
+
const nextComposition = input.indexOf('<Composition', position);
|
|
46
|
+
if (nextComposition > -1) {
|
|
47
|
+
return nextComposition;
|
|
48
|
+
}
|
|
49
|
+
const nextStill = input.indexOf('<Still', position);
|
|
50
|
+
if (nextStill > -1) {
|
|
51
|
+
return nextStill;
|
|
52
|
+
}
|
|
53
|
+
return Infinity;
|
|
54
|
+
};
|
|
55
|
+
const stringifyDefaultProps = (props) => {
|
|
56
|
+
// Don't replace with arrow function
|
|
57
|
+
return JSON.stringify(props, function (key, value) {
|
|
58
|
+
if (this[key] instanceof Date) {
|
|
59
|
+
return `__REMOVEQUOTE__new Date('${new Date(this[key]).toISOString()}')__REMOVEQUOTE__`;
|
|
60
|
+
}
|
|
61
|
+
return value;
|
|
62
|
+
})
|
|
63
|
+
.replace('"__REMOVEQUOTE__', '')
|
|
64
|
+
.replace('__REMOVEQUOTE__"', '');
|
|
65
|
+
};
|
|
66
|
+
// TODO: Add more sanity checks
|
|
67
|
+
// TODO: better error messages
|
|
68
|
+
// TODO: throw if prettier was not found
|
|
69
|
+
const updateDefaultProps = async ({ input, compositionId, newDefaultProps, }) => {
|
|
70
|
+
const starter = findStarter({ input, compositionId });
|
|
71
|
+
const START_TOKEN = 'defaultProps={';
|
|
72
|
+
const start = input.indexOf(START_TOKEN, starter);
|
|
73
|
+
if (start === -1) {
|
|
74
|
+
throw new Error('Could not find defaultProps in <Composition> tag');
|
|
75
|
+
}
|
|
76
|
+
const maxEnd = findTerminators(input, starter);
|
|
77
|
+
const [startPos, endPos] = findEnder(input, start + START_TOKEN.length, maxEnd);
|
|
78
|
+
const newFile = input.substring(0, startPos) +
|
|
79
|
+
stringifyDefaultProps(newDefaultProps) +
|
|
80
|
+
input.substring(endPos);
|
|
81
|
+
const configFilePath = await (0, prettier_1.resolveConfigFile)();
|
|
82
|
+
if (!configFilePath) {
|
|
83
|
+
throw new Error('prettier config file not found');
|
|
84
|
+
}
|
|
85
|
+
const prettierConfig = await (0, prettier_1.resolveConfig)(configFilePath);
|
|
86
|
+
if (!prettierConfig) {
|
|
87
|
+
throw new Error('Prettier config not found');
|
|
88
|
+
}
|
|
89
|
+
const prettified = (0, prettier_1.format)(newFile, {
|
|
90
|
+
...prettierConfig,
|
|
91
|
+
rangeStart: startPos,
|
|
92
|
+
rangeEnd: endPos,
|
|
93
|
+
filepath: 'test.tsx',
|
|
94
|
+
plugins: [],
|
|
95
|
+
});
|
|
96
|
+
return prettified;
|
|
97
|
+
};
|
|
98
|
+
exports.updateDefaultProps = updateDefaultProps;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollapsedSidebarExpander = 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 caret_1 = require("../icons/caret");
|
|
8
|
+
const z_index_1 = require("../state/z-index");
|
|
9
|
+
const CollapsedSidebarExpander = ({ onExpand, direction }) => {
|
|
10
|
+
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
11
|
+
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
12
|
+
const onPointerEnter = (0, react_1.useCallback)(() => {
|
|
13
|
+
setHovered(true);
|
|
14
|
+
}, []);
|
|
15
|
+
const onPointerLeave = (0, react_1.useCallback)(() => {
|
|
16
|
+
setHovered(false);
|
|
17
|
+
}, []);
|
|
18
|
+
const style = (0, react_1.useMemo)(() => {
|
|
19
|
+
return {
|
|
20
|
+
border: 'none',
|
|
21
|
+
borderRight: `${direction === 'right' ? 1 : 0}px solid black`,
|
|
22
|
+
borderLeft: `${direction === 'left' ? 1 : 0}px solid black`,
|
|
23
|
+
cursor: 'pointer',
|
|
24
|
+
color: 'white',
|
|
25
|
+
display: 'flex',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
paddingLeft: direction === 'right' ? 7 : 5,
|
|
29
|
+
paddingRight: direction === 'right' ? 4 : 5,
|
|
30
|
+
backgroundColor: (0, colors_1.getBackgroundFromHoverState)({
|
|
31
|
+
hovered,
|
|
32
|
+
selected: false,
|
|
33
|
+
}),
|
|
34
|
+
appearance: 'none',
|
|
35
|
+
WebkitAppearance: 'none',
|
|
36
|
+
};
|
|
37
|
+
}, [direction, hovered]);
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)("button", { style: style, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, type: "button", role: "button", tabIndex: tabIndex, onClick: onExpand, children: direction === 'right' ? (0, jsx_runtime_1.jsx)(caret_1.CaretRight, {}) : (0, jsx_runtime_1.jsx)(caret_1.CaretLeft, {}) }));
|
|
39
|
+
};
|
|
40
|
+
exports.CollapsedSidebarExpander = CollapsedSidebarExpander;
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CurrentCompositionKeybindings = exports.TitleUpdater = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
+
const client_id_1 = require("../helpers/client-id");
|
|
6
7
|
const use_keybinding_1 = require("../helpers/use-keybinding");
|
|
8
|
+
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
7
9
|
const TitleUpdater = () => {
|
|
8
10
|
const video = remotion_1.Internals.useVideo();
|
|
9
11
|
(0, react_1.useEffect)(() => {
|
|
@@ -19,13 +21,19 @@ exports.TitleUpdater = TitleUpdater;
|
|
|
19
21
|
const CurrentCompositionKeybindings = () => {
|
|
20
22
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
21
23
|
const video = remotion_1.Internals.useVideo();
|
|
24
|
+
const { type } = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx);
|
|
22
25
|
const openRenderModal = (0, react_1.useCallback)(() => {
|
|
23
26
|
if (!video) {
|
|
24
|
-
return
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (type !== 'connected') {
|
|
30
|
+
(0, NotificationCenter_1.sendErrorNotification)('Preview server is offline');
|
|
31
|
+
return;
|
|
25
32
|
}
|
|
26
33
|
const renderButton = document.getElementById('render-modal-button');
|
|
27
34
|
renderButton.click();
|
|
28
|
-
}, [video]);
|
|
35
|
+
}, [type, video]);
|
|
36
|
+
// TODO: Does not work if the left sidebar is collapsed
|
|
29
37
|
(0, react_1.useEffect)(() => {
|
|
30
38
|
const binding = keybindings.registerKeybinding({
|
|
31
39
|
event: 'keydown',
|
|
@@ -33,6 +41,7 @@ const CurrentCompositionKeybindings = () => {
|
|
|
33
41
|
commandCtrlKey: false,
|
|
34
42
|
callback: openRenderModal,
|
|
35
43
|
preventDefault: true,
|
|
44
|
+
triggerIfInputFieldFocused: false,
|
|
36
45
|
});
|
|
37
46
|
return () => {
|
|
38
47
|
binding.unregister();
|
|
@@ -10,14 +10,14 @@ const client_id_1 = require("../helpers/client-id");
|
|
|
10
10
|
const modals_1 = require("../state/modals");
|
|
11
11
|
const NewComposition_1 = __importDefault(require("./NewComposition/NewComposition"));
|
|
12
12
|
const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher"));
|
|
13
|
-
const RenderErrorModal_1 = require("./RenderModal/RenderErrorModal");
|
|
14
13
|
const RenderModal_1 = require("./RenderModal/RenderModal");
|
|
14
|
+
const RenderStatusModal_1 = require("./RenderModal/RenderStatusModal");
|
|
15
15
|
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, initialQuality: modalContextType.initialQuality, 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 })), 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, initialQuality: modalContextType.initialQuality, 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 })), modalContextType &&
|
|
20
20
|
canRender &&
|
|
21
|
-
modalContextType.type === 'render-
|
|
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
|
};
|
|
23
23
|
exports.Modals = Modals;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> & {
|
|
3
|
+
status: 'error' | 'warning' | 'ok';
|
|
4
|
+
};
|
|
5
|
+
export declare const inputBaseStyle: React.CSSProperties;
|
|
6
|
+
export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemTextarea = exports.inputBaseStyle = 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 z_index_1 = require("../../state/z-index");
|
|
8
|
+
const RemInput_1 = require("../NewComposition/RemInput");
|
|
9
|
+
exports.inputBaseStyle = {
|
|
10
|
+
padding: `${RemInput_1.INPUT_HORIZONTAL_PADDING}px 10px`,
|
|
11
|
+
color: 'white',
|
|
12
|
+
borderStyle: 'solid',
|
|
13
|
+
borderWidth: 1,
|
|
14
|
+
fontSize: 14,
|
|
15
|
+
resize: 'vertical',
|
|
16
|
+
};
|
|
17
|
+
const RemTextareaFRFunction = ({ status, ...props }, ref) => {
|
|
18
|
+
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
19
|
+
const [isHovered, setIsHovered] = (0, react_1.useState)(false);
|
|
20
|
+
const inputRef = (0, react_1.useRef)(null);
|
|
21
|
+
const { tabIndex } = (0, z_index_1.useZIndex)();
|
|
22
|
+
(0, react_1.useImperativeHandle)(ref, () => {
|
|
23
|
+
return inputRef.current;
|
|
24
|
+
}, []);
|
|
25
|
+
const style = (0, react_1.useMemo)(() => {
|
|
26
|
+
var _a;
|
|
27
|
+
return {
|
|
28
|
+
backgroundColor: colors_1.INPUT_BACKGROUND,
|
|
29
|
+
...exports.inputBaseStyle,
|
|
30
|
+
width: '100%',
|
|
31
|
+
borderColor: (0, RemInput_1.getInputBorderColor)({ isFocused, isHovered, status }),
|
|
32
|
+
...((_a = props.style) !== null && _a !== void 0 ? _a : {}),
|
|
33
|
+
};
|
|
34
|
+
}, [isFocused, isHovered, props.style, status]);
|
|
35
|
+
(0, react_1.useEffect)(() => {
|
|
36
|
+
if (!inputRef.current) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const { current } = inputRef;
|
|
40
|
+
const onFocus = () => setIsFocused(true);
|
|
41
|
+
const onBlur = () => setIsFocused(false);
|
|
42
|
+
const onMouseEnter = () => setIsHovered(true);
|
|
43
|
+
const onMouseLeave = () => setIsHovered(false);
|
|
44
|
+
const onKeyDown = (e) => {
|
|
45
|
+
if (!inputRef.current) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (inputRef.current !== document.activeElement) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (e.code === 'Tab') {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
// Always match up with value in JSON.stringify(content, null, 2)
|
|
54
|
+
document.execCommand('insertText', false, ' '.repeat(2));
|
|
55
|
+
}
|
|
56
|
+
if (e.code === 'Enter') {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
const { selectionStart, selectionEnd, value } = inputRef.current;
|
|
59
|
+
if (selectionStart !== selectionEnd) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
let prevNewline = selectionStart;
|
|
63
|
+
for (let i = selectionStart - 1; i >= 0; i--) {
|
|
64
|
+
if (value[i] === '\n') {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
prevNewline = i;
|
|
68
|
+
}
|
|
69
|
+
const currentLine = value.substring(prevNewline, selectionStart);
|
|
70
|
+
const trimmed = currentLine.trim();
|
|
71
|
+
const difference = currentLine.length - trimmed.length;
|
|
72
|
+
document.execCommand('insertText', false, '\n' + ' '.repeat(difference));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
current.addEventListener('focus', onFocus);
|
|
76
|
+
current.addEventListener('blur', onBlur);
|
|
77
|
+
current.addEventListener('mouseenter', onMouseEnter);
|
|
78
|
+
current.addEventListener('mouseleave', onMouseLeave);
|
|
79
|
+
current.addEventListener('keydown', onKeyDown);
|
|
80
|
+
return () => {
|
|
81
|
+
current.removeEventListener('focus', onFocus);
|
|
82
|
+
current.removeEventListener('blur', onBlur);
|
|
83
|
+
current.removeEventListener('mouseenter', onMouseEnter);
|
|
84
|
+
current.removeEventListener('mouseleave', onMouseLeave);
|
|
85
|
+
current.removeEventListener('keydown', onKeyDown);
|
|
86
|
+
};
|
|
87
|
+
}, [inputRef]);
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)("textarea", { ref: inputRef, tabIndex: tabIndex, ...props, style: style }));
|
|
89
|
+
};
|
|
90
|
+
exports.RemTextarea = (0, react_1.forwardRef)(RemTextareaFRFunction);
|
|
@@ -58,6 +58,11 @@ const RenderButton = ({ composition, visible }) => {
|
|
|
58
58
|
initialNumberOfGifLoops: defaults.numberOfGifLoops,
|
|
59
59
|
initialDelayRenderTimeout: defaults.delayRenderTimeout,
|
|
60
60
|
initialAudioCodec: defaults.audioCodec,
|
|
61
|
+
initialEnvVariables: window.process.env,
|
|
62
|
+
initialDisableWebSecurity: defaults.disableWebSecurity,
|
|
63
|
+
initialOpenGlRenderer: defaults.openGlRenderer,
|
|
64
|
+
initialHeadless: defaults.headless,
|
|
65
|
+
initialIgnoreCertificateErrors: defaults.ignoreCertificateErrors,
|
|
61
66
|
});
|
|
62
67
|
}, [composition.id, isVideo, setSelectedModal]);
|
|
63
68
|
if (!visible) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CliCopyButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const CliCopyButton = ({ valueToCopy, }) => {
|
|
6
|
+
const iconStyle = {
|
|
7
|
+
width: 16,
|
|
8
|
+
height: 16,
|
|
9
|
+
color: '#a6a8aa',
|
|
10
|
+
verticalAlign: 'sub',
|
|
11
|
+
};
|
|
12
|
+
const clipBoardIcon = ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "clipboard", className: "svg-inline--fa fa-clipboard fa-w-12", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", style: iconStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: "#a6a8aa", d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z" }) }));
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: {
|
|
14
|
+
width: '30px',
|
|
15
|
+
height: '30px',
|
|
16
|
+
border: 'none',
|
|
17
|
+
cursor: 'pointer',
|
|
18
|
+
}, onClick: () => {
|
|
19
|
+
navigator.clipboard.writeText(valueToCopy);
|
|
20
|
+
}, children: clipBoardIcon }));
|
|
21
|
+
};
|
|
22
|
+
exports.CliCopyButton = CliCopyButton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { Codec } from '@remotion/renderer';
|
|
2
|
+
import type { Codec, RemotionOption } from '@remotion/renderer';
|
|
3
3
|
export declare const useCrfState: (codec: Codec) => {
|
|
4
4
|
crf: number;
|
|
5
5
|
setCrf: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
@@ -12,4 +12,5 @@ export declare const CrfSetting: React.FC<{
|
|
|
12
12
|
setCrf: React.Dispatch<React.SetStateAction<number>>;
|
|
13
13
|
min: number;
|
|
14
14
|
max: number;
|
|
15
|
+
option: RemotionOption;
|
|
15
16
|
}>;
|
|
@@ -37,7 +37,7 @@ const useCrfState = (codec) => {
|
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
exports.useCrfState = useCrfState;
|
|
40
|
-
const CrfSetting = ({ crf, setCrf, min, max }) => {
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting, { min: min, max: max, name: "CRF", onValueChanged: setCrf, value: crf, step: 1 }));
|
|
40
|
+
const CrfSetting = ({ crf, setCrf, min, max, option }) => {
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(NumberSetting_1.NumberSetting, { min: min, max: max, name: "CRF", onValueChanged: setCrf, value: crf, step: 1, hint: option }));
|
|
42
42
|
};
|
|
43
43
|
exports.CrfSetting = CrfSetting;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { RemotionOption } from '@remotion/renderer';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
export declare const EnforceAudioTrackSetting: React.FC<{
|
|
3
4
|
enforceAudioTrack: boolean;
|
|
4
5
|
setEnforceAudioTrack: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
6
|
muted: boolean;
|
|
7
|
+
option: RemotionOption;
|
|
6
8
|
}>;
|
|
@@ -4,11 +4,13 @@ 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 InfoBubble_1 = require("./InfoBubble");
|
|
7
8
|
const layout_1 = require("./layout");
|
|
8
|
-
const
|
|
9
|
+
const OptionExplainer_1 = require("./OptionExplainer");
|
|
10
|
+
const EnforceAudioTrackSetting = ({ enforceAudioTrack, muted, setEnforceAudioTrack, option }) => {
|
|
9
11
|
const onEnforceAudioTrackChanged = (0, react_1.useCallback)((e) => {
|
|
10
12
|
setEnforceAudioTrack(e.target.checked);
|
|
11
13
|
}, [setEnforceAudioTrack]);
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.
|
|
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 }) })] }));
|
|
13
15
|
};
|
|
14
16
|
exports.EnforceAudioTrackSetting = EnforceAudioTrackSetting;
|