@remotion/cli 4.0.0-alpha7 → 4.0.0-alpha8

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.
@@ -3,12 +3,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MenuBuildIndicator = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const client_id_1 = require("../helpers/client-id");
7
+ const layout_1 = require("./layout");
8
+ const OpenEditorButton_1 = require("./OpenEditorButton");
9
+ const Spinner_1 = require("./Spinner");
6
10
  const cwd = {
7
11
  fontSize: 13,
8
12
  opacity: 0.8,
13
+ display: 'flex',
14
+ alignItems: 'center',
15
+ justifyContent: 'center',
16
+ };
17
+ const spinnerSize = 14;
18
+ const spinner = {
19
+ position: 'relative',
20
+ width: spinnerSize,
21
+ marginTop: 4,
22
+ };
23
+ const noSpinner = {
24
+ position: 'relative',
25
+ width: spinnerSize,
9
26
  };
10
27
  const MenuBuildIndicator = () => {
11
28
  const [isBuilding, setIsBuilding] = (0, react_1.useState)(false);
29
+ const ctx = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx);
30
+ const showButton = window.remotion_editorName && ctx.type === 'connected';
12
31
  (0, react_1.useEffect)(() => {
13
32
  window.remotion_isBuilding = () => {
14
33
  setIsBuilding(true);
@@ -21,6 +40,6 @@ const MenuBuildIndicator = () => {
21
40
  window.remotion_finishedBuilding = undefined;
22
41
  };
23
42
  }, []);
24
- return ((0, jsx_runtime_1.jsx)("div", { style: cwd, title: window.remotion_cwd, children: isBuilding ? 'Building...' : window.remotion_projectName }));
43
+ return ((0, jsx_runtime_1.jsxs)("div", { style: cwd, title: window.remotion_cwd, children: [showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 2 }) : null, isBuilding ? ((0, jsx_runtime_1.jsx)("div", { style: spinner, children: (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { size: spinnerSize }) })) : ((0, jsx_runtime_1.jsx)("div", { style: noSpinner })), showButton ? (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }) : null, window.remotion_projectName, showButton ? (0, jsx_runtime_1.jsx)(OpenEditorButton_1.OpenEditorButton, {}) : null] }));
25
44
  };
26
45
  exports.MenuBuildIndicator = MenuBuildIndicator;
@@ -16,7 +16,7 @@ const UpdateModal_1 = require("./UpdateModal/UpdateModal");
16
16
  const Modals = () => {
17
17
  const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
18
18
  const canRender = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type === 'connected';
19
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModal, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialOutName: modalContextType.initialOutName, initialScale: modalContextType.initialScale, initialVerbose: modalContextType.initialVerbose, initialRenderType: modalContextType.initialRenderType, initialVideoCodecForAudioTab: modalContextType.initialVideoCodecForAudioTab, initialVideoCodecForVideoTab: modalContextType.initialVideoCodecForVideoTab, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialAudioCodec: modalContextType.initialAudioCodec, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, defaultProps: modalContextType.defaultProps })), modalContextType &&
19
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModal, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialOutName: modalContextType.initialOutName, initialScale: modalContextType.initialScale, initialVerbose: modalContextType.initialVerbose, initialRenderType: modalContextType.initialRenderType, initialVideoCodecForAudioTab: modalContextType.initialVideoCodecForAudioTab, initialVideoCodecForVideoTab: modalContextType.initialVideoCodecForVideoTab, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialAudioCodec: modalContextType.initialAudioCodec, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark })), modalContextType &&
20
20
  canRender &&
21
21
  modalContextType.type === 'render-progress' && ((0, jsx_runtime_1.jsx)(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info })), modalContextType && modalContextType.type === 'quick-switcher' && ((0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode }))] }));
22
22
  };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const OpenEditorButton: React.FC<{}>;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenEditorButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../helpers/colors");
7
+ const open_in_editor_1 = require("../helpers/open-in-editor");
8
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
9
+ const svgStyle = {
10
+ width: '11px',
11
+ height: '11px',
12
+ };
13
+ const buttonStyle = {
14
+ border: 'none',
15
+ width: '25px',
16
+ height: '25px',
17
+ };
18
+ const OpenEditorButton = () => {
19
+ const [hovered, setHovered] = (0, react_1.useState)(false);
20
+ const svgFillColor = (0, react_1.useMemo)(() => {
21
+ return hovered ? 'white' : colors_1.LIGHT_TEXT;
22
+ }, [hovered]);
23
+ const handleClick = async () => {
24
+ await (0, open_in_editor_1.openInEditor)({
25
+ originalFileName: `${window.remotion_cwd}`,
26
+ originalLineNumber: 1,
27
+ originalColumnNumber: 1,
28
+ originalFunctionName: null,
29
+ originalScriptCode: null,
30
+ })
31
+ .then((res) => res.json())
32
+ .then(({ success }) => {
33
+ if (!success) {
34
+ (0, NotificationCenter_1.sendErrorNotification)(`Could not open ${window.remotion_editorName}`);
35
+ }
36
+ })
37
+ .catch((err) => {
38
+ console.error(err);
39
+ (0, NotificationCenter_1.sendErrorNotification)(`Could not open ${window.remotion_editorName}`);
40
+ });
41
+ };
42
+ const buttonTooltip = `Open in ${window.remotion_editorName}`;
43
+ const openInEditorSvg = ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 512 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: svgFillColor, d: "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z" }) }));
44
+ const onPointerEnter = (0, react_1.useCallback)(() => {
45
+ setHovered(true);
46
+ }, []);
47
+ const onPointerLeave = (0, react_1.useCallback)(() => {
48
+ setHovered(false);
49
+ }, []);
50
+ return ((0, jsx_runtime_1.jsx)("button", { title: buttonTooltip, type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: buttonStyle, onClick: handleClick, children: openInEditorSvg }));
51
+ };
52
+ exports.OpenEditorButton = OpenEditorButton;
@@ -11,6 +11,7 @@ const get_default_video_contexts_1 = require("../../preview-server/render-queue/
11
11
  const client_id_1 = require("../helpers/client-id");
12
12
  const use_keybinding_1 = require("../helpers/use-keybinding");
13
13
  const render_1 = require("../icons/render");
14
+ const in_out_1 = require("../state/in-out");
14
15
  const modals_1 = require("../state/modals");
15
16
  const layout_1 = require("./layout");
16
17
  const button = {
@@ -23,6 +24,7 @@ const label = {
23
24
  fontSize: 14,
24
25
  };
25
26
  const RenderButton = () => {
27
+ const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
26
28
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
27
29
  const { type } = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx);
28
30
  const connectionStatus = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type;
@@ -93,8 +95,10 @@ const RenderButton = () => {
93
95
  initialHeadless: defaults.headless,
94
96
  initialIgnoreCertificateErrors: defaults.ignoreCertificateErrors,
95
97
  defaultProps: (_c = props[video.id]) !== null && _c !== void 0 ? _c : video.defaultProps,
98
+ inFrameMark: inFrame,
99
+ outFrameMark: outFrame,
96
100
  });
97
- }, [video, setSelectedModal, frame, props]);
101
+ }, [video, setSelectedModal, frame, props, inFrame, outFrame]);
98
102
  if (!video) {
99
103
  return null;
100
104
  }
@@ -17,6 +17,12 @@ const copiedStyle = {
17
17
  alignItems: 'center',
18
18
  justifyContent: 'center',
19
19
  };
20
+ const buttonStyle = {
21
+ width: '30px',
22
+ height: '30px',
23
+ border: 'none',
24
+ cursor: 'pointer',
25
+ };
20
26
  const CliCopyButton = ({ valueToCopy, }) => {
21
27
  const [copied, setCopied] = (0, react_1.useState)(false);
22
28
  const [hovered, setHovered] = (0, react_1.useState)(false);
@@ -42,12 +48,7 @@ const CliCopyButton = ({ valueToCopy, }) => {
42
48
  const to = setTimeout(() => handleClear(), 2000);
43
49
  return () => clearTimeout(to);
44
50
  }, [copied]);
45
- return copied ? ((0, jsx_runtime_1.jsx)("span", { style: copiedStyle, children: checkSvg })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: {
46
- width: '30px',
47
- height: '30px',
48
- border: 'none',
49
- cursor: 'pointer',
50
- }, onClick: () => {
51
+ return copied ? ((0, jsx_runtime_1.jsx)("span", { style: copiedStyle, children: checkSvg })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: buttonStyle, onClick: () => {
51
52
  navigator.clipboard.writeText(valueToCopy);
52
53
  setCopied(true);
53
54
  }, children: clipboardIcon }));
@@ -28,6 +28,7 @@ const link = {
28
28
  maxWidth: 200,
29
29
  color: '#0b84f3',
30
30
  wordWrap: 'break-word',
31
+ textDecoration: 'none',
31
32
  };
32
33
  const infoRow = {
33
34
  ...padding,
@@ -32,4 +32,6 @@ export declare const RenderModal: React.FC<{
32
32
  initialIgnoreCertificateErrors: boolean;
33
33
  initialHeadless: boolean;
34
34
  defaultProps: unknown;
35
+ inFrameMark: number | null;
36
+ outFrameMark: number | null;
35
37
  }>;
@@ -108,7 +108,7 @@ const outer = {
108
108
  height: (0, ModalContainer_1.getMaxModalHeight)(640),
109
109
  overflow: 'hidden',
110
110
  };
111
- const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialVerbose, initialOutName, initialRenderType, initialVideoCodecForAudioTab, initialVideoCodecForVideoTab, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialAudioCodec, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, defaultProps, }) => {
111
+ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, initialStillImageFormat, initialJpegQuality, initialScale, initialVerbose, initialOutName, initialRenderType, initialVideoCodecForAudioTab, initialVideoCodecForVideoTab, initialConcurrency, maxConcurrency, minConcurrency, initialMuted, initialEnforceAudioTrack, initialProResProfile, initialPixelFormat, initialVideoBitrate, initialAudioBitrate, initialEveryNthFrame, initialNumberOfGifLoops, initialDelayRenderTimeout, initialAudioCodec, initialEnvVariables, initialDisableWebSecurity, initialGl, initialHeadless, initialIgnoreCertificateErrors, defaultProps, inFrameMark, outFrameMark, }) => {
112
112
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
113
113
  const onQuit = (0, react_1.useCallback)(() => {
114
114
  setSelectedModal(null);
@@ -145,8 +145,8 @@ const RenderModal = ({ compositionId, initialFrame, initialVideoImageFormat, ini
145
145
  };
146
146
  }, [headless, disableWebSecurity, ignoreCertificateErrors, openGlOption]);
147
147
  const [outName, setOutName] = (0, react_1.useState)(() => initialOutName);
148
- const [endFrameOrNull, setEndFrame] = (0, react_1.useState)(() => null);
149
- const [startFrameOrNull, setStartFrame] = (0, react_1.useState)(() => null);
148
+ const [endFrameOrNull, setEndFrame] = (0, react_1.useState)(() => outFrameMark !== null && outFrameMark !== void 0 ? outFrameMark : null);
149
+ const [startFrameOrNull, setStartFrame] = (0, react_1.useState)(() => inFrameMark !== null && inFrameMark !== void 0 ? inFrameMark : null);
150
150
  const [proResProfileSetting, setProResProfile] = (0, react_1.useState)(() => initialProResProfile);
151
151
  const [pixelFormat, setPixelFormat] = (0, react_1.useState)(() => initialPixelFormat);
152
152
  const [preferredQualityControlType, setQualityControl] = (0, react_1.useState)(() => initialVideoBitrate === null ? 'crf' : 'bitrate');
@@ -27,11 +27,11 @@ exports.RenderModalData = void 0;
27
27
  const jsx_runtime_1 = require("react/jsx-runtime");
28
28
  const react_1 = __importStar(require("react"));
29
29
  const remotion_1 = require("remotion");
30
- const colors_1 = require("../../helpers/colors");
31
- const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
32
30
  const client_id_1 = require("../../helpers/client-id");
31
+ const colors_1 = require("../../helpers/colors");
33
32
  const get_zod_if_possible_1 = require("../get-zod-if-possible");
34
33
  const layout_1 = require("../layout");
34
+ const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
35
35
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
36
36
  const actions_1 = require("../RenderQueue/actions");
37
37
  const SegmentedControl_1 = require("../SegmentedControl");
@@ -113,10 +113,8 @@ const RenderModalData = ({ composition, inputProps, setInputProps, compact, mayS
113
113
  });
114
114
  }, [inJSONEditor, inputProps]);
115
115
  const cliProps = (0, remotion_1.getInputProps)();
116
- const [canSaveDefaultProps, setCanSaveDefaultProps] = (0, react_1.useState)({
117
- canUpdate: false,
118
- reason: 'Loading...',
119
- determined: false,
116
+ const [canSaveDefaultPropsObjectState, setCanSaveDefaultProps] = (0, react_1.useState)({
117
+ [composition.id]: get_render_modal_warnings_1.defaultTypeCanSaveState,
120
118
  });
121
119
  const z = (0, get_zod_if_possible_1.useZodIfPossible)();
122
120
  const schema = (0, react_1.useMemo)(() => {
@@ -147,30 +145,44 @@ const RenderModalData = ({ composition, inputProps, setInputProps, compact, mayS
147
145
  return val(prevVal);
148
146
  });
149
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]);
150
153
  const showSaveButton = mayShowSaveButton && canSaveDefaultProps.canUpdate;
151
154
  const { fastRefreshes } = (0, react_1.useContext)(remotion_1.Internals.NonceContext);
152
155
  (0, react_1.useEffect)(() => {
153
156
  (0, actions_1.canUpdateDefaultProps)(composition.id)
154
157
  .then((can) => {
155
158
  if (can.canUpdate) {
156
- setCanSaveDefaultProps({
157
- canUpdate: true,
158
- });
159
+ setCanSaveDefaultProps((prevState) => ({
160
+ ...prevState,
161
+ [composition.id]: {
162
+ canUpdate: true,
163
+ },
164
+ }));
159
165
  }
160
166
  else {
161
- setCanSaveDefaultProps({
162
- canUpdate: false,
163
- reason: can.reason,
164
- determined: true,
165
- });
167
+ setCanSaveDefaultProps((prevState) => ({
168
+ ...prevState,
169
+ [composition.id]: {
170
+ canUpdate: false,
171
+ reason: can.reason,
172
+ determined: true,
173
+ },
174
+ }));
166
175
  }
167
176
  })
168
177
  .catch((err) => {
169
- setCanSaveDefaultProps({
170
- canUpdate: false,
171
- reason: err.message,
172
- determined: true,
173
- });
178
+ setCanSaveDefaultProps((prevState) => ({
179
+ ...prevState,
180
+ [composition.id]: {
181
+ canUpdate: false,
182
+ reason: err.message,
183
+ determined: true,
184
+ },
185
+ }));
174
186
  });
175
187
  }, [composition.id]);
176
188
  const modeItems = (0, react_1.useMemo)(() => {
@@ -227,10 +239,12 @@ const RenderModalData = ({ composition, inputProps, setInputProps, compact, mayS
227
239
  customFileUsed: serializedJSON ? serializedJSON.customFileUsed : false,
228
240
  inJSONEditor,
229
241
  propsEditType,
242
+ jsMapUsed: serializedJSON ? serializedJSON.mapUsed : false,
243
+ jsSetUsed: serializedJSON ? serializedJSON.setUsed : false,
230
244
  });
231
245
  }, [
232
- canSaveDefaultProps,
233
246
  cliProps,
247
+ canSaveDefaultProps,
234
248
  inJSONEditor,
235
249
  propsEditType,
236
250
  serializedJSON,
@@ -2,6 +2,8 @@ export declare type SerializedJSONWithCustomFields = {
2
2
  serializedString: string;
3
3
  customDateUsed: boolean;
4
4
  customFileUsed: boolean;
5
+ mapUsed: boolean;
6
+ setUsed: boolean;
5
7
  };
6
8
  export declare const FILE_TOKEN = "remotion-file:";
7
9
  export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
@@ -6,19 +6,29 @@ exports.FILE_TOKEN = 'remotion-file:';
6
6
  const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
7
7
  let customDateUsed = false;
8
8
  let customFileUsed = false;
9
+ let mapUsed = false;
10
+ let setUsed = false;
9
11
  const serializedString = JSON.stringify(data, function (key, value) {
10
12
  const item = this[key];
11
13
  if (item instanceof Date) {
12
14
  customDateUsed = true;
13
15
  return `${DATE_TOKEN}${item.toISOString()}`;
14
16
  }
17
+ if (item instanceof Map) {
18
+ mapUsed = true;
19
+ return value;
20
+ }
21
+ if (item instanceof Set) {
22
+ setUsed = true;
23
+ return value;
24
+ }
15
25
  if (typeof item === 'string' && item.startsWith(staticBase)) {
16
26
  customFileUsed = true;
17
27
  return `${exports.FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
18
28
  }
19
29
  return value;
20
30
  }, indent);
21
- return { serializedString, customDateUsed, customFileUsed };
31
+ return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
22
32
  };
23
33
  exports.serializeJSONWithDate = serializeJSONWithDate;
24
34
  const deserializeJSONWithCustomFields = (data) => {
@@ -6,11 +6,14 @@ export declare type TypeCanSaveState = {
6
6
  reason: string;
7
7
  determined: boolean;
8
8
  };
9
- export declare const getRenderModalWarnings: ({ cliProps, canSaveDefaultProps, isCustomDateUsed, customFileUsed, inJSONEditor, propsEditType, }: {
9
+ export declare const defaultTypeCanSaveState: TypeCanSaveState;
10
+ export declare const getRenderModalWarnings: ({ cliProps, canSaveDefaultProps, isCustomDateUsed, customFileUsed, jsMapUsed, jsSetUsed, inJSONEditor, propsEditType, }: {
10
11
  cliProps: unknown;
11
12
  canSaveDefaultProps: TypeCanSaveState;
12
13
  isCustomDateUsed: boolean;
13
14
  customFileUsed: boolean;
15
+ jsMapUsed: boolean;
16
+ jsSetUsed: boolean;
14
17
  inJSONEditor: boolean;
15
18
  propsEditType: PropsEditType;
16
19
  }) => string[];
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRenderModalWarnings = void 0;
3
+ exports.getRenderModalWarnings = exports.defaultTypeCanSaveState = void 0;
4
4
  const truthy_1 = require("../../../truthy");
5
+ exports.defaultTypeCanSaveState = {
6
+ canUpdate: false,
7
+ reason: 'Loading...',
8
+ determined: false,
9
+ };
5
10
  const getInputPropsWarning = ({ cliProps, propsEditType, }) => {
6
11
  if (Object.keys(cliProps).length > 0 &&
7
12
  propsEditType === 'default-props') {
@@ -30,12 +35,26 @@ const staticFileUsed = (used, inJSONEditor) => {
30
35
  }
31
36
  return null;
32
37
  };
33
- const getRenderModalWarnings = ({ cliProps, canSaveDefaultProps, isCustomDateUsed, customFileUsed, inJSONEditor, propsEditType, }) => {
38
+ const mapUsed = (used, inJSONEditor) => {
39
+ if (used && inJSONEditor) {
40
+ return 'A `Map` was used in the schema which can not be serialized to JSON.';
41
+ }
42
+ return null;
43
+ };
44
+ const setUsed = (used, inJSONEditor) => {
45
+ if (used && inJSONEditor) {
46
+ return 'A `Set` was used in the schema which can not be serialized to JSON.';
47
+ }
48
+ return null;
49
+ };
50
+ const getRenderModalWarnings = ({ cliProps, canSaveDefaultProps, isCustomDateUsed, customFileUsed, jsMapUsed, jsSetUsed, inJSONEditor, propsEditType, }) => {
34
51
  return [
35
52
  getInputPropsWarning({ cliProps, propsEditType }),
36
53
  getCannotSaveDefaultProps(canSaveDefaultProps),
37
54
  customDateUsed(isCustomDateUsed, inJSONEditor),
38
55
  staticFileUsed(customFileUsed, inJSONEditor),
56
+ mapUsed(jsMapUsed, inJSONEditor),
57
+ setUsed(jsSetUsed, inJSONEditor),
39
58
  ].filter(truthy_1.truthy);
40
59
  };
41
60
  exports.getRenderModalWarnings = getRenderModalWarnings;
@@ -72,6 +72,8 @@ const SidebarRenderButton = ({ composition, visible }) => {
72
72
  initialHeadless: defaults.headless,
73
73
  initialIgnoreCertificateErrors: defaults.ignoreCertificateErrors,
74
74
  defaultProps: (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps,
75
+ inFrameMark: null,
76
+ outFrameMark: null,
75
77
  });
76
78
  }, [composition.defaultProps, composition.id, isVideo, props, setSelectedModal]);
77
79
  const renderAction = (0, react_1.useCallback)((color) => {
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const Spinner: React.FC<{
3
+ size: number;
4
+ }>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Spinner = 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 viewBox = 100;
8
+ const lines = 6;
9
+ const className = '__remotion_spinner_line';
10
+ const remotionSpinnerAnimation = '__remotion_spinner_animation';
11
+ // Generated from https://github.com/remotion-dev/template-next/commit/9282c93f7c51ada31a42e18a94680fa09a14eee3
12
+ const translated = 'M 44 0 L 50 0 a 6 6 0 0 1 6 6 L 56 26 a 6 6 0 0 1 -6 6 L 50 32 a 6 6 0 0 1 -6 -6 L 44 6 a 6 6 0 0 1 6 -6 Z';
13
+ const totalDuration = 0.5;
14
+ const Spinner = ({ size }) => {
15
+ const style = (0, react_1.useMemo)(() => {
16
+ return {
17
+ width: size,
18
+ height: size,
19
+ };
20
+ }, [size]);
21
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("style", { type: "text/css", children: `
22
+ @keyframes ${remotionSpinnerAnimation} {
23
+ 0% {
24
+ opacity: 1;
25
+ }
26
+ 100% {
27
+ opacity: 0.15;
28
+ }
29
+ }
30
+
31
+ .${className} {
32
+ animation: ${remotionSpinnerAnimation} ${totalDuration}s linear infinite;
33
+ }
34
+ ` }), (0, jsx_runtime_1.jsx)("svg", { style: style, viewBox: `0 0 ${viewBox} ${viewBox}`, children: new Array(lines).fill(true).map((_, index) => {
35
+ return ((0, jsx_runtime_1.jsx)("path", { className: className, style: {
36
+ rotate: `${(index * Math.PI * 2) / lines}rad`,
37
+ transformOrigin: 'center center',
38
+ animationDelay: `${index * (totalDuration / lines) - totalDuration}s`,
39
+ }, d: translated, fill: colors_1.LIGHT_TEXT }, index));
40
+ }) })] }));
41
+ };
42
+ exports.Spinner = Spinner;
@@ -36,6 +36,8 @@ export declare type RenderModalState = {
36
36
  minConcurrency: number;
37
37
  maxConcurrency: number;
38
38
  defaultProps: unknown;
39
+ inFrameMark: number | null;
40
+ outFrameMark: number | null;
39
41
  };
40
42
  export declare type ModalState = {
41
43
  type: 'new-comp';
@@ -45,6 +45,8 @@ const makeRetryPayload = (job) => {
45
45
  initialHeadless: job.chromiumOptions.headless,
46
46
  initialIgnoreCertificateErrors: job.chromiumOptions.ignoreCertificateErrors,
47
47
  defaultProps: job.inputProps,
48
+ inFrameMark: null,
49
+ outFrameMark: null,
48
50
  };
49
51
  }
50
52
  if (job.type === 'video') {
@@ -84,6 +86,8 @@ const makeRetryPayload = (job) => {
84
86
  initialHeadless: job.chromiumOptions.headless,
85
87
  initialIgnoreCertificateErrors: job.chromiumOptions.ignoreCertificateErrors,
86
88
  defaultProps: job.inputProps,
89
+ inFrameMark: job.startFrame,
90
+ outFrameMark: job.endFrame,
87
91
  };
88
92
  }
89
93
  throw new Error(`Job ${JSON.stringify(job)} Not implemented`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "4.0.0-alpha7",
3
+ "version": "4.0.0-alpha8",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -28,16 +28,16 @@
28
28
  "author": "Jonny Burger <jonny@remotion.dev>",
29
29
  "license": "SEE LICENSE IN LICENSE.md",
30
30
  "dependencies": {
31
- "@remotion/bundler": "4.0.0-alpha7",
32
- "@remotion/media-utils": "4.0.0-alpha7",
33
- "@remotion/player": "4.0.0-alpha7",
34
- "@remotion/renderer": "4.0.0-alpha7",
31
+ "@remotion/bundler": "4.0.0-alpha8",
32
+ "@remotion/media-utils": "4.0.0-alpha8",
33
+ "@remotion/player": "4.0.0-alpha8",
34
+ "@remotion/renderer": "4.0.0-alpha8",
35
35
  "dotenv": "9.0.2",
36
36
  "memfs": "3.4.3",
37
37
  "minimist": "1.2.6",
38
38
  "open": "^8.4.2",
39
39
  "prompts": "2.4.1",
40
- "remotion": "4.0.0-alpha7",
40
+ "remotion": "4.0.0-alpha8",
41
41
  "semver": "7.3.5",
42
42
  "source-map": "0.6.1"
43
43
  },
@@ -56,7 +56,7 @@
56
56
  "@types/semver": "^7.3.4",
57
57
  "@typescript-eslint/eslint-plugin": "5.18.0",
58
58
  "@typescript-eslint/parser": "5.18.0",
59
- "@remotion/zod-types": "4.0.0-alpha7",
59
+ "@remotion/zod-types": "4.0.0-alpha8",
60
60
  "eslint": "8.25.0",
61
61
  "eslint-plugin-10x": "1.5.2",
62
62
  "eslint-plugin-react": "7.29.4",