@remotion/cli 4.1.0-alpha2 → 4.1.0-alpha3

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.
@@ -13,5 +13,5 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
13
13
  isFocused: boolean;
14
14
  isHovered: boolean;
15
15
  }) => "hsla(0, 0%, 100%, 0.15)" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232" | "#f1c40f";
16
- export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | "rightAlign" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
16
+ export declare const RemotionInput: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "status" | "rightAlign"> & React.RefAttributes<HTMLInputElement>>;
17
17
  export {};
@@ -4,5 +4,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>
4
4
  status: RemInputStatus;
5
5
  name: string;
6
6
  };
7
- export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
7
+ export declare const RemInputTypeColor: React.ForwardRefExoticComponent<Pick<Props, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "status"> & React.RefAttributes<HTMLInputElement>>;
8
8
  export {};
@@ -3,5 +3,5 @@ type Props = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLTextAreaEleme
3
3
  status: 'error' | 'warning' | 'ok';
4
4
  };
5
5
  export declare const inputBaseStyle: React.CSSProperties;
6
- export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "status" | "key" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
6
+ export declare const RemTextarea: React.ForwardRefExoticComponent<Pick<Props, "key" | "status" | keyof React.InputHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
7
7
  export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { AnyComposition } from 'remotion';
3
+ export declare type State = {
4
+ str: string;
5
+ value: Record<string, unknown>;
6
+ validJSON: true;
7
+ } | {
8
+ str: string;
9
+ validJSON: false;
10
+ error: string;
11
+ };
12
+ export declare type PropsEditType = 'input-props' | 'default-props';
13
+ export declare const RenderModalData: React.FC<{
14
+ composition: AnyComposition;
15
+ inputProps: Record<string, unknown>;
16
+ setInputProps: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
17
+ compact: boolean;
18
+ mayShowSaveButton: boolean;
19
+ propsEditType: PropsEditType;
20
+ }>;
@@ -0,0 +1,288 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.RenderModalData = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_1 = __importStar(require("react"));
29
+ const remotion_1 = require("remotion");
30
+ const client_id_1 = require("../../helpers/client-id");
31
+ const colors_1 = require("../../helpers/colors");
32
+ const get_zod_if_possible_1 = require("../get-zod-if-possible");
33
+ const layout_1 = require("../layout");
34
+ const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
35
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
36
+ const actions_1 = require("../RenderQueue/actions");
37
+ const SegmentedControl_1 = require("../SegmentedControl");
38
+ const get_render_modal_warnings_1 = require("./get-render-modal-warnings");
39
+ const RenderModalJSONPropsEditor_1 = require("./RenderModalJSONPropsEditor");
40
+ const extract_enum_json_paths_1 = require("./SchemaEditor/extract-enum-json-paths");
41
+ const input_props_serialization_1 = require("./SchemaEditor/input-props-serialization");
42
+ const SchemaEditor_1 = require("./SchemaEditor/SchemaEditor");
43
+ const SchemaErrorMessages_1 = require("./SchemaEditor/SchemaErrorMessages");
44
+ const WarningIndicatorButton_1 = require("./WarningIndicatorButton");
45
+ const errorExplanation = {
46
+ fontSize: 14,
47
+ color: colors_1.LIGHT_TEXT,
48
+ fontFamily: 'sans-serif',
49
+ lineHeight: 1.5,
50
+ };
51
+ const explainer = {
52
+ display: 'flex',
53
+ flex: 1,
54
+ flexDirection: 'column',
55
+ padding: '0 12px',
56
+ justifyContent: 'center',
57
+ alignItems: 'center',
58
+ textAlign: 'center',
59
+ };
60
+ const outer = {
61
+ display: 'flex',
62
+ flexDirection: 'column',
63
+ flex: 1,
64
+ overflow: 'hidden',
65
+ };
66
+ const controlContainer = {
67
+ flexDirection: 'column',
68
+ display: 'flex',
69
+ padding: 12,
70
+ borderBottom: `1px solid ${colors_1.BORDER_COLOR}`,
71
+ };
72
+ const tabWrapper = {
73
+ display: 'flex',
74
+ marginBottom: '4px',
75
+ flexDirection: 'row',
76
+ alignItems: 'center',
77
+ };
78
+ const persistanceKey = 'remotion.show-render-modalwarning';
79
+ const parseJSON = (str) => {
80
+ try {
81
+ const value = (0, input_props_serialization_1.deserializeJSONWithCustomFields)(str);
82
+ return { str, value, validJSON: true };
83
+ }
84
+ catch (e) {
85
+ return { str, validJSON: false, error: e.message };
86
+ }
87
+ };
88
+ const getPersistedShowWarningState = () => {
89
+ const val = localStorage.getItem(persistanceKey);
90
+ if (!val) {
91
+ return true;
92
+ }
93
+ return val === 'true';
94
+ };
95
+ const setPersistedShowWarningState = (val) => {
96
+ localStorage.setItem(persistanceKey, String(Boolean(val)));
97
+ };
98
+ const RenderModalData = ({ composition, inputProps, setInputProps, compact, mayShowSaveButton, propsEditType, }) => {
99
+ const [mode, setMode] = (0, react_1.useState)('schema');
100
+ const [valBeforeSafe, setValBeforeSafe] = (0, react_1.useState)(inputProps);
101
+ const [saving, setSaving] = (0, react_1.useState)(false);
102
+ const [showWarning, setShowWarningWithoutPersistance] = (0, react_1.useState)(() => getPersistedShowWarningState());
103
+ const inJSONEditor = mode === 'json';
104
+ const serializedJSON = (0, react_1.useMemo)(() => {
105
+ if (!inJSONEditor) {
106
+ return null;
107
+ }
108
+ const value = inputProps;
109
+ return (0, input_props_serialization_1.serializeJSONWithDate)({
110
+ data: value,
111
+ indent: 2,
112
+ staticBase: window.remotion_staticBase,
113
+ });
114
+ }, [inJSONEditor, inputProps]);
115
+ const cliProps = (0, remotion_1.getInputProps)();
116
+ const [canSaveDefaultPropsObjectState, setCanSaveDefaultProps] = (0, react_1.useState)({
117
+ [composition.id]: get_render_modal_warnings_1.defaultTypeCanSaveState,
118
+ });
119
+ const z = (0, get_zod_if_possible_1.useZodIfPossible)();
120
+ const schema = (0, react_1.useMemo)(() => {
121
+ if (!z) {
122
+ return 'no-zod';
123
+ }
124
+ if (!composition.schema) {
125
+ return z.object({});
126
+ }
127
+ if (!(typeof composition.schema.safeParse === 'function')) {
128
+ throw new Error('A value which is not a Zod schema was passed to `schema`');
129
+ }
130
+ return composition.schema;
131
+ }, [composition.schema, z]);
132
+ const zodValidationResult = (0, react_1.useMemo)(() => {
133
+ if (schema === 'no-zod') {
134
+ return 'no-zod';
135
+ }
136
+ return schema.safeParse(inputProps);
137
+ }, [inputProps, schema]);
138
+ const setShowWarning = (0, react_1.useCallback)((val) => {
139
+ setShowWarningWithoutPersistance((prevVal) => {
140
+ if (typeof val === 'boolean') {
141
+ setPersistedShowWarningState(val);
142
+ return val;
143
+ }
144
+ setPersistedShowWarningState(val(prevVal));
145
+ return val(prevVal);
146
+ });
147
+ }, []);
148
+ const canSaveDefaultProps = (0, react_1.useMemo)(() => {
149
+ return canSaveDefaultPropsObjectState[composition.id]
150
+ ? canSaveDefaultPropsObjectState[composition.id]
151
+ : get_render_modal_warnings_1.defaultTypeCanSaveState;
152
+ }, [canSaveDefaultPropsObjectState, composition.id]);
153
+ const showSaveButton = mayShowSaveButton && canSaveDefaultProps.canUpdate;
154
+ const { fastRefreshes } = (0, react_1.useContext)(remotion_1.Internals.NonceContext);
155
+ (0, react_1.useEffect)(() => {
156
+ (0, actions_1.canUpdateDefaultProps)(composition.id)
157
+ .then((can) => {
158
+ if (can.canUpdate) {
159
+ setCanSaveDefaultProps((prevState) => ({
160
+ ...prevState,
161
+ [composition.id]: {
162
+ canUpdate: true,
163
+ },
164
+ }));
165
+ }
166
+ else {
167
+ setCanSaveDefaultProps((prevState) => ({
168
+ ...prevState,
169
+ [composition.id]: {
170
+ canUpdate: false,
171
+ reason: can.reason,
172
+ determined: true,
173
+ },
174
+ }));
175
+ }
176
+ })
177
+ .catch((err) => {
178
+ setCanSaveDefaultProps((prevState) => ({
179
+ ...prevState,
180
+ [composition.id]: {
181
+ canUpdate: false,
182
+ reason: err.message,
183
+ determined: true,
184
+ },
185
+ }));
186
+ });
187
+ }, [composition.id]);
188
+ const modeItems = (0, react_1.useMemo)(() => {
189
+ return [
190
+ {
191
+ key: 'schema',
192
+ label: 'Schema',
193
+ onClick: () => {
194
+ setMode('schema');
195
+ },
196
+ selected: mode === 'schema',
197
+ },
198
+ {
199
+ key: 'json',
200
+ label: 'JSON',
201
+ onClick: () => {
202
+ setMode('json');
203
+ },
204
+ selected: mode === 'json',
205
+ },
206
+ ];
207
+ }, [mode]);
208
+ const switchToSchema = (0, react_1.useCallback)(() => {
209
+ setMode('schema');
210
+ }, []);
211
+ const onUpdate = (0, react_1.useCallback)(() => {
212
+ if (schema === 'no-zod' || z === null) {
213
+ (0, NotificationCenter_1.sendErrorNotification)('Cannot update default props: No Zod schema');
214
+ return;
215
+ }
216
+ setValBeforeSafe(inputProps);
217
+ (0, actions_1.updateDefaultProps)(composition.id, inputProps, (0, extract_enum_json_paths_1.extractEnumJsonPaths)(schema, z, [])).then((response) => {
218
+ if (!response.success) {
219
+ (0, NotificationCenter_1.sendErrorNotification)('Cannot update default props: ' + response.reason);
220
+ }
221
+ });
222
+ }, [composition.id, inputProps, schema, z]);
223
+ (0, react_1.useEffect)(() => {
224
+ setSaving(false);
225
+ }, [fastRefreshes]);
226
+ const onSave = (0, react_1.useCallback)((updater) => {
227
+ if (schema === 'no-zod' || z === null) {
228
+ (0, NotificationCenter_1.sendErrorNotification)('Cannot update default props: No Zod schema');
229
+ return;
230
+ }
231
+ setSaving(true);
232
+ (0, actions_1.updateDefaultProps)(composition.id, updater(composition.defaultProps), (0, extract_enum_json_paths_1.extractEnumJsonPaths)(schema, z, []))
233
+ .then((response) => {
234
+ if (!response.success) {
235
+ console.log(response.stack);
236
+ (0, NotificationCenter_1.sendErrorNotification)(`Cannot update default props: ${response.reason}. See console for more information.`);
237
+ }
238
+ })
239
+ .catch((err) => {
240
+ (0, NotificationCenter_1.sendErrorNotification)(`Cannot update default props: ${err.message}`);
241
+ setSaving(false);
242
+ });
243
+ }, [composition.defaultProps, composition.id, schema, z]);
244
+ const connectionStatus = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type;
245
+ const warnings = (0, react_1.useMemo)(() => {
246
+ return (0, get_render_modal_warnings_1.getRenderModalWarnings)({
247
+ canSaveDefaultProps,
248
+ cliProps,
249
+ isCustomDateUsed: serializedJSON ? serializedJSON.customDateUsed : false,
250
+ customFileUsed: serializedJSON ? serializedJSON.customFileUsed : false,
251
+ inJSONEditor,
252
+ propsEditType,
253
+ jsMapUsed: serializedJSON ? serializedJSON.mapUsed : false,
254
+ jsSetUsed: serializedJSON ? serializedJSON.setUsed : false,
255
+ });
256
+ }, [
257
+ cliProps,
258
+ canSaveDefaultProps,
259
+ inJSONEditor,
260
+ propsEditType,
261
+ serializedJSON,
262
+ ]);
263
+ if (connectionStatus === 'disconnected') {
264
+ return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "The preview server has disconnected. Reconnect to edit the schema." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
265
+ }
266
+ if (schema === 'no-zod') {
267
+ return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.ZodNotInstalled, {});
268
+ }
269
+ if (!z) {
270
+ throw new Error('expected zod');
271
+ }
272
+ if (zodValidationResult === 'no-zod') {
273
+ throw new Error('expected zod');
274
+ }
275
+ const def = schema._def;
276
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
277
+ const typeName = def.typeName;
278
+ if (typeName === z.ZodFirstPartyTypeKind.ZodAny) {
279
+ return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.NoSchemaDefined, {});
280
+ }
281
+ if (!composition.defaultProps) {
282
+ return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.NoDefaultProps, {});
283
+ }
284
+ return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsxs)("div", { style: controlContainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: tabWrapper, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: modeItems, needsWrapping: false }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), warnings.length > 0 ? ((0, jsx_runtime_1.jsx)(WarningIndicatorButton_1.WarningIndicatorButton, { setShowWarning: setShowWarning, showWarning: showWarning, warningCount: warnings.length })) : null] }), showWarning && warnings.length > 0
285
+ ? warnings.map((warning) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: warning, align: "flex-start", type: "warning" })] }, warning)))
286
+ : null] }), mode === 'schema' ? ((0, jsx_runtime_1.jsx)(SchemaEditor_1.SchemaEditor, { value: inputProps, setValue: setInputProps, schema: schema, zodValidationResult: zodValidationResult, compact: compact, defaultProps: composition.defaultProps, onSave: onSave, showSaveButton: showSaveButton, saving: saving, saveDisabledByParent: !zodValidationResult.success })) : ((0, jsx_runtime_1.jsx)(RenderModalJSONPropsEditor_1.RenderModalJSONPropsEditor, { value: inputProps !== null && inputProps !== void 0 ? inputProps : {}, setValue: setInputProps, zodValidationResult: zodValidationResult, switchToSchema: switchToSchema, onSave: onUpdate, valBeforeSafe: valBeforeSafe, showSaveButton: showSaveButton, serializedJSON: serializedJSON, parseJSON: parseJSON }))] }));
287
+ };
288
+ exports.RenderModalData = RenderModalData;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const SchemaEmptyStateGraphic: React.FC;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SchemaEmptyStateGraphic = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const colors_1 = require("../../../helpers/colors");
6
+ const SchemaEmptyStateGraphic = () => {
7
+ return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: "0 0 334 193", fill: "none", style: {
8
+ border: '1px solid ' + colors_1.INPUT_BORDER_COLOR_HOVERED,
9
+ borderRadius: 10,
10
+ padding: 20,
11
+ maxWidth: 320,
12
+ width: '100%',
13
+ }, xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsxs)("g", { clipPath: "url(#clip0_1_2)", children: [(0, jsx_runtime_1.jsx)("rect", { x: "19", y: "52", width: "315", height: "47", fill: "#2F363D" }), (0, jsx_runtime_1.jsx)("rect", { x: "19.5", y: "52.5", width: "314", height: "46", stroke: "black", strokeOpacity: "0.48" }), (0, jsx_runtime_1.jsx)("path", { d: "M38.2012 80V69.2627H39.6221V73.6719H45.2031V69.2627H46.624V80H45.2031V74.939H39.6221V80H38.2012ZM54.1533 77.4951L55.5156 77.6636C55.3008 78.4595 54.9028 79.0771 54.3218 79.5166C53.7407 79.9561 52.9985 80.1758 52.0952 80.1758C50.9575 80.1758 50.0542 79.8267 49.3853 79.1284C48.7212 78.4253 48.3892 77.4414 48.3892 76.1768C48.3892 74.8682 48.7261 73.8525 49.3999 73.1299C50.0737 72.4072 50.9478 72.0459 52.022 72.0459C53.062 72.0459 53.9116 72.3999 54.5708 73.1079C55.23 73.8159 55.5596 74.812 55.5596 76.0962C55.5596 76.1743 55.5571 76.2915 55.5522 76.4478H49.7515C49.8003 77.3022 50.042 77.9565 50.4766 78.4106C50.9111 78.8647 51.4531 79.0918 52.1025 79.0918C52.5859 79.0918 52.9985 78.9648 53.3403 78.7109C53.6821 78.457 53.9531 78.0518 54.1533 77.4951ZM49.8247 75.3638H54.168C54.1094 74.7095 53.9434 74.2188 53.6699 73.8916C53.25 73.3838 52.7056 73.1299 52.0366 73.1299C51.4312 73.1299 50.9209 73.3325 50.5059 73.7378C50.0957 74.1431 49.8687 74.6851 49.8247 75.3638ZM57.1489 80V69.2627H58.4673V80H57.1489ZM60.4888 80V69.2627H61.8071V80H60.4888ZM63.3672 76.1108C63.3672 74.6704 63.7676 73.6035 64.5684 72.9102C65.2373 72.334 66.0527 72.0459 67.0146 72.0459C68.084 72.0459 68.958 72.3975 69.6367 73.1006C70.3154 73.7988 70.6548 74.7656 70.6548 76.001C70.6548 77.002 70.5034 77.7905 70.2007 78.3667C69.9028 78.938 69.4658 79.3823 68.8896 79.6997C68.3184 80.0171 67.6934 80.1758 67.0146 80.1758C65.9258 80.1758 65.0444 79.8267 64.3706 79.1284C63.7017 78.4302 63.3672 77.4243 63.3672 76.1108ZM64.7222 76.1108C64.7222 77.1069 64.9395 77.854 65.374 78.3521C65.8086 78.8452 66.3555 79.0918 67.0146 79.0918C67.6689 79.0918 68.2134 78.8428 68.6479 78.3447C69.0825 77.8467 69.2998 77.0874 69.2998 76.0669C69.2998 75.105 69.0801 74.3774 68.6406 73.8843C68.2061 73.3862 67.6641 73.1372 67.0146 73.1372C66.3555 73.1372 65.8086 73.3838 65.374 73.877C64.9395 74.3701 64.7222 75.1147 64.7222 76.1108ZM78.4258 80L75.5767 69.2627H77.0342L78.6675 76.3013C78.8433 77.0386 78.9946 77.771 79.1216 78.4985C79.395 77.3511 79.5562 76.6895 79.605 76.5137L81.6484 69.2627H83.3623L84.9004 74.6973C85.2861 76.0449 85.5645 77.312 85.7354 78.4985C85.8721 77.8198 86.0503 77.041 86.27 76.1621L87.9546 69.2627H89.3828L86.4385 80H85.0688L82.8057 71.8188C82.6152 71.1353 82.5029 70.7153 82.4688 70.5591C82.3564 71.0522 82.2515 71.4722 82.1538 71.8188L79.876 80H78.4258ZM89.7783 76.1108C89.7783 74.6704 90.1787 73.6035 90.9795 72.9102C91.6484 72.334 92.4639 72.0459 93.4258 72.0459C94.4951 72.0459 95.3691 72.3975 96.0479 73.1006C96.7266 73.7988 97.0659 74.7656 97.0659 76.001C97.0659 77.002 96.9146 77.7905 96.6118 78.3667C96.314 78.938 95.877 79.3823 95.3008 79.6997C94.7295 80.0171 94.1045 80.1758 93.4258 80.1758C92.3369 80.1758 91.4556 79.8267 90.7817 79.1284C90.1128 78.4302 89.7783 77.4243 89.7783 76.1108ZM91.1333 76.1108C91.1333 77.1069 91.3506 77.854 91.7852 78.3521C92.2197 78.8452 92.7666 79.0918 93.4258 79.0918C94.0801 79.0918 94.6245 78.8428 95.0591 78.3447C95.4937 77.8467 95.7109 77.0874 95.7109 76.0669C95.7109 75.105 95.4912 74.3774 95.0518 73.8843C94.6172 73.3862 94.0752 73.1372 93.4258 73.1372C92.7666 73.1372 92.2197 73.3838 91.7852 73.877C91.3506 74.3701 91.1333 75.1147 91.1333 76.1108ZM98.604 80V72.2217H99.7905V73.4009C100.093 72.8491 100.372 72.4854 100.625 72.3096C100.884 72.1338 101.167 72.0459 101.475 72.0459C101.919 72.0459 102.371 72.1875 102.83 72.4707L102.376 73.6938C102.054 73.5034 101.731 73.4082 101.409 73.4082C101.121 73.4082 100.862 73.4961 100.633 73.6719C100.403 73.8428 100.24 74.082 100.142 74.3896C99.9956 74.8584 99.9224 75.3711 99.9224 75.9277V80H98.604ZM103.584 80V69.2627H104.903V80H103.584ZM112 80V79.0186C111.507 79.79 110.782 80.1758 109.825 80.1758C109.205 80.1758 108.633 80.0049 108.111 79.6631C107.593 79.3213 107.19 78.8452 106.902 78.2349C106.619 77.6196 106.478 76.9141 106.478 76.1182C106.478 75.3418 106.607 74.6387 106.866 74.0088C107.125 73.374 107.513 72.8882 108.03 72.5513C108.548 72.2144 109.126 72.0459 109.766 72.0459C110.235 72.0459 110.652 72.146 111.019 72.3462C111.385 72.5415 111.683 72.7979 111.912 73.1152V69.2627H113.223V80H112ZM107.833 76.1182C107.833 77.1143 108.042 77.8589 108.462 78.3521C108.882 78.8452 109.378 79.0918 109.949 79.0918C110.525 79.0918 111.014 78.8574 111.414 78.3887C111.819 77.915 112.022 77.1948 112.022 76.228C112.022 75.1636 111.817 74.3823 111.407 73.8843C110.997 73.3862 110.491 73.1372 109.891 73.1372C109.305 73.1372 108.814 73.3765 108.418 73.855C108.028 74.3335 107.833 75.0879 107.833 76.1182Z", fill: "white", fillOpacity: "0.72" }), (0, jsx_runtime_1.jsx)("path", { d: "M18.345 34.385L18.107 30.64H19.815L19.584 34.385H18.345ZM20.816 34.385L20.578 30.64H22.293L22.055 34.385H20.816ZM31.8145 40.608C31.5439 40.7807 31.2195 40.9207 30.8415 41.028C30.4635 41.1353 30.0692 41.189 29.6585 41.189C28.7999 41.189 28.1465 40.9673 27.6985 40.524C27.2552 40.076 27.0335 39.488 27.0335 38.76V34.749H25.3885V33.608H27.0335V31.956L28.6015 31.767V33.608H31.0935L30.9185 34.749H28.6015V38.746C28.6015 39.1427 28.6995 39.439 28.8955 39.635C29.0962 39.8263 29.4229 39.922 29.8755 39.922C30.1462 39.922 30.3959 39.8893 30.6245 39.824C30.8532 39.7587 31.0609 39.6747 31.2475 39.572L31.8145 40.608ZM38.0741 33.608V39.852H40.0831V41H34.2941V39.852H36.5061V34.756H34.3641V33.608H38.0741ZM36.9821 29.989C37.2901 29.989 37.5374 30.0823 37.7241 30.269C37.9154 30.4557 38.0111 30.689 38.0111 30.969C38.0111 31.249 37.9154 31.4847 37.7241 31.676C37.5374 31.8673 37.2901 31.963 36.9821 31.963C36.6834 31.963 36.4384 31.8673 36.2471 31.676C36.0557 31.4847 35.9601 31.249 35.9601 30.969C35.9601 30.689 36.0557 30.4557 36.2471 30.269C36.4384 30.0823 36.6834 29.989 36.9821 29.989ZM48.6036 40.608C48.3329 40.7807 48.0086 40.9207 47.6306 41.028C47.2526 41.1353 46.8583 41.189 46.4476 41.189C45.5889 41.189 44.9356 40.9673 44.4876 40.524C44.0443 40.076 43.8226 39.488 43.8226 38.76V34.749H42.1776V33.608H43.8226V31.956L45.3906 31.767V33.608H47.8826L47.7076 34.749H45.3906V38.746C45.3906 39.1427 45.4886 39.439 45.6846 39.635C45.8853 39.8263 46.2119 39.922 46.6646 39.922C46.9353 39.922 47.1849 39.8893 47.4136 39.824C47.6423 39.7587 47.8499 39.6747 48.0366 39.572L48.6036 40.608ZM54.0721 30.64V38.984C54.0721 39.3247 54.1748 39.5673 54.3801 39.712C54.5901 39.852 54.8608 39.922 55.1921 39.922C55.4068 39.922 55.6098 39.8987 55.8011 39.852C55.9925 39.8053 56.1791 39.747 56.3611 39.677L56.7601 40.769C56.5408 40.881 56.2701 40.979 55.9481 41.063C55.6308 41.147 55.2668 41.189 54.8561 41.189C54.1141 41.189 53.5355 40.9813 53.1201 40.566C52.7095 40.146 52.5041 39.572 52.5041 38.844V31.795H50.2711V30.64H54.0721ZM60.5207 37.808C60.5533 38.312 60.6607 38.725 60.8427 39.047C61.0247 39.3643 61.2627 39.5977 61.5567 39.747C61.8553 39.8963 62.182 39.971 62.5367 39.971C62.9007 39.971 63.2367 39.915 63.5447 39.803C63.8527 39.691 64.163 39.5323 64.4757 39.327L65.1547 40.265C64.8093 40.545 64.4057 40.769 63.9437 40.937C63.4817 41.105 62.987 41.189 62.4597 41.189C61.6943 41.189 61.0457 41.0257 60.5137 40.699C59.9863 40.3723 59.585 39.9173 59.3097 39.334C59.0343 38.7507 58.8967 38.0763 58.8967 37.311C58.8967 36.569 59.032 35.9063 59.3027 35.323C59.5733 34.735 59.9607 34.2707 60.4647 33.93C60.9687 33.5847 61.5707 33.412 62.2707 33.412C62.9287 33.412 63.4933 33.5613 63.9647 33.86C64.4407 34.1587 64.807 34.5833 65.0637 35.134C65.325 35.68 65.4557 36.338 65.4557 37.108C65.4557 37.234 65.451 37.36 65.4417 37.486C65.437 37.6073 65.43 37.7147 65.4207 37.808H60.5207ZM62.2847 34.574C61.7947 34.574 61.3887 34.749 61.0667 35.099C60.7493 35.449 60.565 35.995 60.5137 36.737H63.9367C63.9227 36.0417 63.7733 35.5073 63.4887 35.134C63.2087 34.7607 62.8073 34.574 62.2847 34.574ZM68.7122 34.385L68.4742 30.64H70.1822L69.9512 34.385H68.7122ZM71.1832 34.385L70.9452 30.64H72.6602L72.4222 34.385H71.1832ZM77.6947 39.922C77.6947 39.5813 77.8161 39.2897 78.0587 39.047C78.3014 38.7997 78.6001 38.676 78.9547 38.676C79.3141 38.676 79.6127 38.7997 79.8507 39.047C80.0934 39.2897 80.2147 39.5813 80.2147 39.922C80.2147 40.272 80.0934 40.5707 79.8507 40.818C79.6127 41.0653 79.3141 41.189 78.9547 41.189C78.6001 41.189 78.3014 41.0653 78.0587 40.818C77.8161 40.5707 77.6947 40.272 77.6947 39.922ZM77.6947 34.952C77.6947 34.7233 77.7507 34.5133 77.8627 34.322C77.9747 34.1307 78.1264 33.979 78.3177 33.867C78.5091 33.755 78.7214 33.699 78.9547 33.699C79.3141 33.699 79.6127 33.8227 79.8507 34.07C80.0934 34.3127 80.2147 34.6067 80.2147 34.952C80.2147 35.2973 80.0934 35.596 79.8507 35.848C79.6127 36.0953 79.3141 36.219 78.9547 36.219C78.6001 36.219 78.3014 36.0953 78.0587 35.848C77.8161 35.596 77.6947 35.2973 77.6947 34.952Z", fill: "white", fillOpacity: "0.66" }), (0, jsx_runtime_1.jsx)("path", { d: "M18.345 122.385L18.107 118.64H19.815L19.584 122.385H18.345ZM20.816 122.385L20.578 118.64H22.293L22.055 122.385H20.816ZM29.9805 118.465L31.5485 118.64V129H30.1695L30.0575 128.09C29.8055 128.44 29.5045 128.711 29.1545 128.902C28.8045 129.093 28.4125 129.189 27.9785 129.189C27.3439 129.189 26.8212 129.028 26.4105 128.706C25.9999 128.379 25.6942 127.924 25.4935 127.341C25.2975 126.753 25.1995 126.074 25.1995 125.304C25.1995 124.553 25.3162 123.885 25.5495 123.302C25.7829 122.714 26.1165 122.252 26.5505 121.916C26.9845 121.58 27.5072 121.412 28.1185 121.412C28.5059 121.412 28.8535 121.482 29.1615 121.622C29.4695 121.757 29.7425 121.956 29.9805 122.217V118.465ZM28.5315 122.616C28.0042 122.616 27.5935 122.835 27.2995 123.274C27.0055 123.708 26.8585 124.385 26.8585 125.304C26.8585 125.934 26.9192 126.447 27.0405 126.844C27.1619 127.236 27.3369 127.525 27.5655 127.712C27.7942 127.894 28.0695 127.985 28.3915 127.985C28.7462 127.985 29.0542 127.882 29.3155 127.677C29.5769 127.472 29.7985 127.224 29.9805 126.935V123.435C29.7985 123.174 29.5862 122.973 29.3435 122.833C29.1009 122.688 28.8302 122.616 28.5315 122.616ZM35.3371 125.808C35.3697 126.312 35.4771 126.725 35.6591 127.047C35.8411 127.364 36.0791 127.598 36.3731 127.747C36.6717 127.896 36.9984 127.971 37.3531 127.971C37.7171 127.971 38.0531 127.915 38.3611 127.803C38.6691 127.691 38.9794 127.532 39.2921 127.327L39.9711 128.265C39.6257 128.545 39.2221 128.769 38.7601 128.937C38.2981 129.105 37.8034 129.189 37.2761 129.189C36.5107 129.189 35.8621 129.026 35.3301 128.699C34.8027 128.372 34.4014 127.917 34.1261 127.334C33.8507 126.751 33.7131 126.076 33.7131 125.311C33.7131 124.569 33.8484 123.906 34.1191 123.323C34.3897 122.735 34.7771 122.271 35.2811 121.93C35.7851 121.585 36.3871 121.412 37.0871 121.412C37.7451 121.412 38.3097 121.561 38.7811 121.86C39.2571 122.159 39.6234 122.583 39.8801 123.134C40.1414 123.68 40.2721 124.338 40.2721 125.108C40.2721 125.234 40.2674 125.36 40.2581 125.486C40.2534 125.607 40.2464 125.715 40.2371 125.808H35.3371ZM37.1011 122.574C36.6111 122.574 36.2051 122.749 35.8831 123.099C35.5657 123.449 35.3814 123.995 35.3301 124.737H38.7531C38.7391 124.042 38.5897 123.507 38.3051 123.134C38.0251 122.761 37.6237 122.574 37.1011 122.574ZM45.6776 118.64V126.984C45.6776 127.325 45.7803 127.567 45.9856 127.712C46.1956 127.852 46.4663 127.922 46.7976 127.922C47.0123 127.922 47.2153 127.899 47.4066 127.852C47.5979 127.805 47.7846 127.747 47.9666 127.677L48.3656 128.769C48.1463 128.881 47.8756 128.979 47.5536 129.063C47.2363 129.147 46.8723 129.189 46.4616 129.189C45.7196 129.189 45.1409 128.981 44.7256 128.566C44.3149 128.146 44.1096 127.572 44.1096 126.844V119.795H41.8766V118.64H45.6776ZM56.4731 127.187C56.4731 127.476 56.5175 127.689 56.6061 127.824C56.6948 127.955 56.8371 128.053 57.0331 128.118L56.6831 129.182C56.3191 129.14 56.0065 129.04 55.7451 128.881C55.4838 128.722 55.2855 128.482 55.1501 128.16C54.8795 128.501 54.5365 128.757 54.1211 128.93C53.7058 129.103 53.2625 129.189 52.7911 129.189C52.0445 129.189 51.4518 128.979 51.0131 128.559C50.5791 128.134 50.3621 127.579 50.3621 126.893C50.3621 126.114 50.6655 125.514 51.2721 125.094C51.8788 124.674 52.7468 124.464 53.8761 124.464H54.9331V123.981C54.9331 123.505 54.7885 123.162 54.4991 122.952C54.2145 122.742 53.8108 122.637 53.2881 122.637C53.0455 122.637 52.7515 122.67 52.4061 122.735C52.0608 122.796 51.6991 122.891 51.3211 123.022L50.9361 121.916C51.3981 121.743 51.8508 121.617 52.2941 121.538C52.7375 121.454 53.1481 121.412 53.5261 121.412C54.5155 121.412 55.2528 121.631 55.7381 122.07C56.2281 122.509 56.4731 123.115 56.4731 123.89V127.187ZM53.2671 128.034C53.5845 128.034 53.8948 127.95 54.1981 127.782C54.5015 127.614 54.7465 127.378 54.9331 127.075V125.444H54.0651C53.3278 125.444 52.8005 125.568 52.4831 125.815C52.1658 126.058 52.0071 126.394 52.0071 126.823C52.0071 127.215 52.1121 127.516 52.3221 127.726C52.5368 127.931 52.8518 128.034 53.2671 128.034ZM65.6867 121.608L63.1387 129.028C62.9473 129.588 62.7023 130.08 62.4037 130.505C62.105 130.934 61.7223 131.28 61.2557 131.541C60.789 131.802 60.2103 131.963 59.5197 132.024L59.3167 130.848C59.816 130.769 60.2127 130.652 60.5067 130.498C60.8053 130.349 61.041 130.15 61.2137 129.903C61.391 129.656 61.5473 129.355 61.6827 129H61.1507L58.6587 121.608H60.3247L62.1867 127.908L64.0767 121.608H65.6867ZM68.7122 122.385L68.4742 118.64H70.1822L69.9512 122.385H68.7122ZM71.1832 122.385L70.9452 118.64H72.6602L72.4222 122.385H71.1832ZM77.6947 127.922C77.6947 127.581 77.8161 127.29 78.0587 127.047C78.3014 126.8 78.6001 126.676 78.9547 126.676C79.3141 126.676 79.6127 126.8 79.8507 127.047C80.0934 127.29 80.2147 127.581 80.2147 127.922C80.2147 128.272 80.0934 128.571 79.8507 128.818C79.6127 129.065 79.3141 129.189 78.9547 129.189C78.6001 129.189 78.3014 129.065 78.0587 128.818C77.8161 128.571 77.6947 128.272 77.6947 127.922ZM77.6947 122.952C77.6947 122.723 77.7507 122.513 77.8627 122.322C77.9747 122.131 78.1264 121.979 78.3177 121.867C78.5091 121.755 78.7214 121.699 78.9547 121.699C79.3141 121.699 79.6127 121.823 79.8507 122.07C80.0934 122.313 80.2147 122.607 80.2147 122.952C80.2147 123.297 80.0934 123.596 79.8507 123.848C79.6127 124.095 79.3141 124.219 78.9547 124.219C78.6001 124.219 78.3014 124.095 78.0587 123.848C77.8161 123.596 77.6947 123.297 77.6947 122.952Z", fill: "white", fillOpacity: "0.66" }), (0, jsx_runtime_1.jsx)("path", { d: "M6.398 2.282V3.437C6.08067 3.437 5.796 3.46733 5.544 3.528C5.29667 3.58867 5.10533 3.69367 4.97 3.843C4.83933 3.99233 4.788 4.2 4.816 4.466L5.075 7.035C5.12167 7.47367 5.08433 7.83533 4.963 8.12C4.84633 8.4 4.65733 8.617 4.396 8.771C4.13467 8.925 3.815 9.03467 3.437 9.1C3.829 9.16533 4.15567 9.27267 4.417 9.422C4.67833 9.56667 4.865 9.779 4.977 10.059C5.089 10.339 5.12167 10.7077 5.075 11.165L4.816 13.734C4.788 14 4.83933 14.2077 4.97 14.357C5.10533 14.511 5.29667 14.616 5.544 14.672C5.796 14.7327 6.08067 14.763 6.398 14.763V15.918C5.91267 15.918 5.47167 15.8783 5.075 15.799C4.683 15.7243 4.34933 15.5983 4.074 15.421C3.80333 15.2437 3.605 15.0033 3.479 14.7C3.35767 14.4013 3.32033 14.0303 3.367 13.587L3.626 11.172C3.65867 10.8407 3.61433 10.57 3.493 10.36C3.37633 10.1453 3.164 9.98667 2.856 9.884C2.548 9.78133 2.12333 9.73 1.582 9.73V8.47C2.11867 8.47 2.541 8.421 2.849 8.323C3.16167 8.22033 3.37633 8.064 3.493 7.854C3.61433 7.63933 3.65867 7.36633 3.626 7.035L3.367 4.62C3.32033 4.172 3.35767 3.79633 3.479 3.493C3.605 3.18967 3.80333 2.95167 4.074 2.779C4.34933 2.60167 4.683 2.47567 5.075 2.401C5.47167 2.32167 5.91267 2.282 6.398 2.282Z", fill: "white", fillOpacity: "0.66" }), (0, jsx_runtime_1.jsx)("path", { d: "M2.002 177.282C2.48733 177.282 2.926 177.322 3.318 177.401C3.71467 177.476 4.04833 177.602 4.319 177.779C4.59433 177.956 4.795 178.197 4.921 178.5C5.047 178.799 5.08433 179.17 5.033 179.613L4.774 182.035C4.74133 182.366 4.79033 182.639 4.921 182.854C5.05633 183.064 5.28033 183.22 5.593 183.323C5.90567 183.421 6.314 183.47 6.818 183.47V184.73C6.314 184.73 5.90567 184.781 5.593 184.884C5.28033 184.987 5.05633 185.145 4.921 185.36C4.79033 185.57 4.74133 185.841 4.774 186.172L5.033 188.58C5.07967 189.028 5.04 189.404 4.914 189.707C4.79267 190.01 4.59433 190.248 4.319 190.421C4.04833 190.598 3.71467 190.724 3.318 190.799C2.926 190.878 2.48733 190.918 2.002 190.918V189.763C2.31933 189.763 2.60167 189.733 2.849 189.672C3.101 189.616 3.29233 189.511 3.423 189.357C3.55833 189.208 3.612 189 3.584 188.734L3.325 186.165C3.27833 185.708 3.31333 185.339 3.43 185.059C3.55133 184.779 3.74967 184.567 4.025 184.422C4.30033 184.273 4.64567 184.168 5.061 184.107C4.64567 184.042 4.30033 183.932 4.025 183.778C3.74967 183.619 3.55133 183.4 3.43 183.12C3.31333 182.84 3.27833 182.478 3.325 182.035L3.584 179.466C3.612 179.2 3.55833 178.992 3.423 178.843C3.29233 178.694 3.10333 178.589 2.856 178.528C2.60867 178.467 2.324 178.437 2.002 178.437V177.282Z", fill: "white", fillOpacity: "0.66" }), (0, jsx_runtime_1.jsx)("path", { d: "M32.6299 156.166L33.9482 155.99C34.0996 156.737 34.356 157.276 34.7173 157.608C35.0835 157.936 35.5278 158.099 36.0503 158.099C36.6704 158.099 37.1929 157.884 37.6177 157.455C38.0474 157.025 38.2622 156.493 38.2622 155.858C38.2622 155.252 38.0645 154.754 37.6689 154.364C37.2734 153.968 36.7705 153.771 36.1602 153.771C35.9111 153.771 35.6011 153.819 35.23 153.917L35.3765 152.76C35.4644 152.77 35.5352 152.774 35.5889 152.774C36.1504 152.774 36.6558 152.628 37.105 152.335C37.5542 152.042 37.7788 151.59 37.7788 150.98C37.7788 150.497 37.6152 150.096 37.2881 149.779C36.9609 149.461 36.5386 149.303 36.021 149.303C35.5083 149.303 35.0811 149.464 34.7393 149.786C34.3975 150.108 34.1777 150.592 34.0801 151.236L32.7617 151.002C32.9229 150.118 33.2891 149.435 33.8604 148.951C34.4316 148.463 35.1421 148.219 35.9917 148.219C36.5776 148.219 37.1172 148.346 37.6104 148.6C38.1035 148.849 38.4795 149.19 38.7383 149.625C39.002 150.06 39.1338 150.521 39.1338 151.009C39.1338 151.473 39.0093 151.896 38.7603 152.276C38.5112 152.657 38.1426 152.96 37.6543 153.185C38.2891 153.331 38.7822 153.636 39.1338 154.1C39.4854 154.559 39.6611 155.135 39.6611 155.829C39.6611 156.766 39.3193 157.562 38.6357 158.216C37.9521 158.866 37.0879 159.19 36.043 159.19C35.1006 159.19 34.3169 158.91 33.6919 158.348C33.0718 157.787 32.7178 157.059 32.6299 156.166ZM40.9722 153.705C40.9722 152.435 41.1016 151.415 41.3604 150.643C41.624 149.867 42.0122 149.269 42.5249 148.849C43.0425 148.429 43.6919 148.219 44.4731 148.219C45.0493 148.219 45.5547 148.336 45.9893 148.57C46.4238 148.8 46.7827 149.134 47.0659 149.574C47.3491 150.008 47.5713 150.541 47.7324 151.17C47.8936 151.795 47.9741 152.64 47.9741 153.705C47.9741 154.964 47.8447 155.982 47.5859 156.759C47.3271 157.53 46.939 158.128 46.4214 158.553C45.9087 158.973 45.2593 159.183 44.4731 159.183C43.438 159.183 42.625 158.812 42.0342 158.07C41.3262 157.176 40.9722 155.721 40.9722 153.705ZM42.3271 153.705C42.3271 155.467 42.5322 156.642 42.9424 157.228C43.3574 157.809 43.8677 158.099 44.4731 158.099C45.0786 158.099 45.5864 157.806 45.9966 157.22C46.4116 156.634 46.6191 155.462 46.6191 153.705C46.6191 151.937 46.4116 150.763 45.9966 150.182C45.5864 149.601 45.0737 149.31 44.4585 149.31C43.853 149.31 43.3696 149.566 43.0083 150.079C42.5542 150.733 42.3271 151.942 42.3271 153.705Z", fill: "#0B84F3" }), (0, jsx_runtime_1.jsx)("circle", { cx: "33", cy: "165", r: "1", fill: "#0B84F3" }), (0, jsx_runtime_1.jsx)("circle", { cx: "36", cy: "165", r: "1", fill: "#0B84F3" }), (0, jsx_runtime_1.jsx)("circle", { cx: "39", cy: "165", r: "1", fill: "#0B84F3" }), (0, jsx_runtime_1.jsx)("circle", { cx: "42", cy: "165", r: "1", fill: "#0B84F3" }), (0, jsx_runtime_1.jsx)("circle", { cx: "45", cy: "165", r: "1", fill: "#0B84F3" }), (0, jsx_runtime_1.jsx)("circle", { cx: "48", cy: "165", r: "1", fill: "#0B84F3" })] }), (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: "clip0_1_2", children: (0, jsx_runtime_1.jsx)("rect", { width: "334", height: "193", fill: "white" }) }) })] }));
14
+ };
15
+ exports.SchemaEmptyStateGraphic = SchemaEmptyStateGraphic;
@@ -1,2 +1,2 @@
1
1
  import type { Codec } from '@remotion/renderer';
2
- export declare const humanReadableCodec: (codec: Codec) => "GIF" | "AAC" | "MP3" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
2
+ export declare const humanReadableCodec: (codec: Codec) => "AAC" | "MP3" | "GIF" | "H.264" | "H.264 Matroska" | "H.265" | "ProRes" | "WebM VP8" | "WebM VP9" | "Waveform" | undefined;
@@ -11,5 +11,5 @@ type Range = {
11
11
  type Ranges = Range[] & {
12
12
  type?: string;
13
13
  };
14
- export declare function parseRange(size: number, str: string | string[]): -1 | Ranges | -2;
14
+ export declare function parseRange(size: number, str: string | string[]): -1 | -2 | Ranges;
15
15
  export {};
@@ -0,0 +1 @@
1
+ export declare const previewCommand: (remotionRoot: string, args: string[]) => Promise<void>;
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.previewCommand = void 0;
7
+ const node_crypto_1 = __importDefault(require("node:crypto"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const better_opn_1 = require("./better-opn");
10
+ const chalk_1 = require("./chalk");
11
+ const config_1 = require("./config");
12
+ const convert_entry_point_to_serve_url_1 = require("./convert-entry-point-to-serve-url");
13
+ const entry_point_1 = require("./entry-point");
14
+ const get_env_1 = require("./get-env");
15
+ const get_input_props_1 = require("./get-input-props");
16
+ const get_network_address_1 = require("./get-network-address");
17
+ const log_1 = require("./log");
18
+ const parse_command_line_1 = require("./parse-command-line");
19
+ const get_absolute_public_dir_1 = require("./preview-server/get-absolute-public-dir");
20
+ const live_events_1 = require("./preview-server/live-events");
21
+ const public_folder_1 = require("./preview-server/public-folder");
22
+ const start_server_1 = require("./preview-server/start-server");
23
+ const noop = () => undefined;
24
+ const getShouldOpenBrowser = () => {
25
+ var _a;
26
+ if (parse_command_line_1.parsedCli['no-open']) {
27
+ return {
28
+ shouldOpenBrowser: false,
29
+ reasonForBrowserDecision: '--no-open specified',
30
+ };
31
+ }
32
+ if (((_a = process.env.BROWSER) !== null && _a !== void 0 ? _a : '').toLowerCase() === 'none') {
33
+ return {
34
+ shouldOpenBrowser: false,
35
+ reasonForBrowserDecision: 'env BROWSER=none was set',
36
+ };
37
+ }
38
+ if (config_1.ConfigInternals.getShouldOpenBrowser() === false) {
39
+ return { shouldOpenBrowser: false, reasonForBrowserDecision: 'Config file' };
40
+ }
41
+ return { shouldOpenBrowser: true, reasonForBrowserDecision: 'default' };
42
+ };
43
+ const getPort = () => {
44
+ if (parse_command_line_1.parsedCli.port) {
45
+ return parse_command_line_1.parsedCli.port;
46
+ }
47
+ const serverPort = config_1.ConfigInternals.getServerPort();
48
+ if (serverPort) {
49
+ return serverPort;
50
+ }
51
+ return null;
52
+ };
53
+ const previewCommand = async (remotionRoot, args) => {
54
+ const { file, reason } = (0, entry_point_1.findEntryPoint)(args, remotionRoot);
55
+ log_1.Log.verbose('Entry point:', file, 'reason:', reason);
56
+ if (!file) {
57
+ log_1.Log.error('The preview command requires you to specify a root file. For example');
58
+ log_1.Log.error(' npx remotion preview src/index.ts');
59
+ log_1.Log.error('See https://www.remotion.dev/docs/register-root for more information.');
60
+ process.exit(1);
61
+ }
62
+ const desiredPort = getPort();
63
+ const fullEntryPath = (0, convert_entry_point_to_serve_url_1.convertEntryPointToServeUrl)(file);
64
+ let inputProps = (0, get_input_props_1.getInputProps)((newProps) => {
65
+ (0, live_events_1.waitForLiveEventsListener)().then((listener) => {
66
+ inputProps = newProps;
67
+ listener.sendEventToClient({
68
+ type: 'new-input-props',
69
+ newProps,
70
+ });
71
+ });
72
+ });
73
+ let envVariables = await (0, get_env_1.getEnvironmentVariables)((newEnvVariables) => {
74
+ (0, live_events_1.waitForLiveEventsListener)().then((listener) => {
75
+ envVariables = newEnvVariables;
76
+ listener.sendEventToClient({
77
+ type: 'new-env-variables',
78
+ newEnvVariables,
79
+ });
80
+ });
81
+ });
82
+ const publicDir = (0, get_absolute_public_dir_1.getAbsolutePublicDir)({
83
+ userPassedPublicDir: config_1.ConfigInternals.getPublicDir(),
84
+ remotionRoot,
85
+ });
86
+ const hashPrefix = '/static-';
87
+ const staticHash = `${hashPrefix}${node_crypto_1.default.randomBytes(6).toString('hex')}`;
88
+ (0, public_folder_1.initPublicFolderWatch)({
89
+ publicDir,
90
+ remotionRoot,
91
+ onUpdate: () => {
92
+ (0, live_events_1.waitForLiveEventsListener)().then((listener) => {
93
+ listener.sendEventToClient({
94
+ type: 'new-public-folder',
95
+ files: (0, public_folder_1.getFiles)(),
96
+ });
97
+ });
98
+ },
99
+ staticHash,
100
+ });
101
+ const { port, liveEventsServer } = await (0, start_server_1.startServer)({
102
+ entry: node_path_1.default.resolve(__dirname, 'previewEntry.js'),
103
+ userDefinedComponent: fullEntryPath,
104
+ getCurrentInputProps: () => inputProps,
105
+ getEnvVariables: () => envVariables,
106
+ port: desiredPort,
107
+ maxTimelineTracks: config_1.ConfigInternals.getMaxTimelineTracks(),
108
+ remotionRoot,
109
+ keyboardShortcutsEnabled: config_1.ConfigInternals.getKeyboardShortcutsEnabled(),
110
+ publicDir,
111
+ webpackOverride: config_1.ConfigInternals.getWebpackOverrideFn(),
112
+ poll: config_1.ConfigInternals.getWebpackPolling(),
113
+ userPassedPublicDir: config_1.ConfigInternals.getPublicDir(),
114
+ hash: staticHash,
115
+ hashPrefix,
116
+ });
117
+ (0, live_events_1.setLiveEventsListener)(liveEventsServer);
118
+ const networkAddress = (0, get_network_address_1.getNetworkAddress)();
119
+ if (networkAddress) {
120
+ log_1.Log.info(`Server ready - Local: ${chalk_1.chalk.underline(`http://localhost:${port}`)}, Network: ${chalk_1.chalk.underline(`http://${networkAddress}:${port}`)}`);
121
+ }
122
+ else {
123
+ log_1.Log.info(`Running on http://localhost:${port}`);
124
+ }
125
+ const { reasonForBrowserDecision, shouldOpenBrowser } = getShouldOpenBrowser();
126
+ if (shouldOpenBrowser) {
127
+ await (0, better_opn_1.openBrowser)({
128
+ url: `http://localhost:${port}`,
129
+ browserArgs: parse_command_line_1.parsedCli['browser-args'],
130
+ browserFlag: parse_command_line_1.parsedCli.browser,
131
+ });
132
+ }
133
+ else {
134
+ log_1.Log.verbose(`Not opening browser, reason: ${reasonForBrowserDecision}`);
135
+ }
136
+ await new Promise(noop);
137
+ };
138
+ exports.previewCommand = previewCommand;
@@ -0,0 +1,8 @@
1
+ import type { getCompositions } from '@remotion/renderer';
2
+ declare type Await<T> = T extends PromiseLike<infer U> ? U : T;
3
+ export declare const selectComposition: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<{
4
+ compositionId: string;
5
+ reason: string;
6
+ }>;
7
+ export declare const selectCompositions: (validCompositions: Await<ReturnType<typeof getCompositions>>) => Promise<string[]>;
8
+ export {};
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectCompositions = exports.selectComposition = void 0;
4
+ const composition_prompts_1 = require("./composition-prompts");
5
+ const chalk_1 = require("./chalk");
6
+ const selectComposition = async (validCompositions) => {
7
+ if (validCompositions.length === 1) {
8
+ const onlyComposition = validCompositions[0];
9
+ if (onlyComposition) {
10
+ return {
11
+ compositionId: onlyComposition.id,
12
+ reason: 'Only composition',
13
+ };
14
+ }
15
+ }
16
+ const selectedComposition = (await (0, composition_prompts_1.selectAsync)({
17
+ message: 'Select composition:',
18
+ optionsPerPage: 5,
19
+ type: 'select',
20
+ choices: validCompositions.map((comp) => {
21
+ return {
22
+ value: comp.id,
23
+ title: chalk_1.chalk.bold(comp.id),
24
+ };
25
+ }),
26
+ }));
27
+ return { compositionId: selectedComposition, reason: 'Selected' };
28
+ };
29
+ exports.selectComposition = selectComposition;
30
+ const selectCompositions = async (validCompositions) => {
31
+ if (validCompositions.length === 1) {
32
+ const onlyComposition = validCompositions[0];
33
+ if (onlyComposition) {
34
+ return [onlyComposition.id];
35
+ }
36
+ }
37
+ const selectedComposition = await (0, composition_prompts_1.selectAsync)({
38
+ message: 'Select compositions:',
39
+ optionsPerPage: 5,
40
+ type: 'multiselect',
41
+ min: 1,
42
+ choices: validCompositions.map((comp) => {
43
+ return {
44
+ value: comp.id,
45
+ title: chalk_1.chalk.bold(comp.id),
46
+ };
47
+ }),
48
+ });
49
+ return selectedComposition;
50
+ };
51
+ exports.selectCompositions = selectCompositions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "4.1.0-alpha2",
3
+ "version": "4.1.0-alpha3",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -35,11 +35,11 @@
35
35
  "prompts": "2.4.1",
36
36
  "semver": "7.3.5",
37
37
  "source-map": "0.6.1",
38
- "@remotion/bundler": "4.1.0-alpha2",
39
- "remotion": "4.1.0-alpha2",
40
- "@remotion/player": "4.1.0-alpha2",
41
- "@remotion/media-utils": "4.1.0-alpha2",
42
- "@remotion/renderer": "4.1.0-alpha2"
38
+ "@remotion/bundler": "4.1.0-alpha3",
39
+ "remotion": "4.1.0-alpha3",
40
+ "@remotion/player": "4.1.0-alpha3",
41
+ "@remotion/media-utils": "4.1.0-alpha3",
42
+ "@remotion/renderer": "4.1.0-alpha3"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=16.8.0",
@@ -65,8 +65,8 @@
65
65
  "typescript": "4.9.5",
66
66
  "vitest": "0.31.1",
67
67
  "zod": "^3.21.4",
68
- "@remotion/tailwind": "4.1.0-alpha2",
69
- "@remotion/zod-types": "4.1.0-alpha2"
68
+ "@remotion/tailwind": "4.1.0-alpha3",
69
+ "@remotion/zod-types": "4.1.0-alpha3"
70
70
  },
71
71
  "keywords": [
72
72
  "remotion",