@remotion/cli 4.1.0-alpha1 → 4.1.0-alpha11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/benchmark.js +16 -7
  2. package/dist/chalk/index.d.ts +2 -1
  3. package/dist/codemods/stringify-with-path.js +24 -19
  4. package/dist/compositions.js +9 -4
  5. package/dist/config/index.d.ts +24 -0
  6. package/dist/config/index.js +19 -1
  7. package/dist/editor/components/Canvas.js +4 -4
  8. package/dist/editor/components/CanvasOrLoading.js +20 -1
  9. package/dist/editor/components/CopyButton.js +5 -2
  10. package/dist/editor/components/Editor.js +1 -3
  11. package/dist/editor/components/FramePersistor.d.ts +0 -2
  12. package/dist/editor/components/FramePersistor.js +4 -24
  13. package/dist/editor/components/FullscreenToggle.d.ts +2 -0
  14. package/dist/editor/components/FullscreenToggle.js +25 -0
  15. package/dist/editor/components/GlobalKeybindings.js +1 -1
  16. package/dist/editor/components/InitialCompositionLoader.js +1 -22
  17. package/dist/editor/components/KeyboardShortcutsExplainer.js +1 -1
  18. package/dist/editor/components/NewComposition/InputDragger.js +13 -1
  19. package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
  20. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  21. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  22. package/dist/editor/components/OpenEditorButton.js +5 -2
  23. package/dist/editor/components/PlayPause.js +4 -4
  24. package/dist/editor/components/PlaybackRateSelector.js +1 -1
  25. package/dist/editor/components/PreviewToolbar.js +3 -1
  26. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +3 -3
  27. package/dist/editor/components/RenderModal/DataEditor.d.ts +2 -0
  28. package/dist/editor/components/RenderModal/DataEditor.js +13 -10
  29. package/dist/editor/components/RenderModal/FrameRangeSetting.js +9 -25
  30. package/dist/editor/components/RenderModal/MultiRangeSlider.d.ts +12 -0
  31. package/dist/editor/components/RenderModal/MultiRangeSlider.js +50 -0
  32. package/dist/editor/components/RenderModal/RenderModal.js +7 -3
  33. package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +2 -3
  34. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -2
  35. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.js +10 -11
  36. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +2 -2
  37. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +26 -0
  38. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
  39. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -2
  40. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +2 -1
  41. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +7 -7
  42. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +1 -1
  43. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +1 -1
  44. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  45. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  46. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +2 -2
  47. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  48. package/dist/editor/components/RenderModal/SchemaEditor/ZodFieldValidation.js +1 -1
  49. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
  50. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  51. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +29 -10
  52. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +2 -2
  53. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  54. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  55. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -1
  56. package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +9 -3
  57. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  58. package/dist/editor/components/RenderQueue/actions.d.ts +1 -1
  59. package/dist/editor/components/RenderQueue/actions.js +12 -4
  60. package/dist/editor/components/RightPanel.js +45 -12
  61. package/dist/editor/components/SetTimelineInOutProvider.js +5 -4
  62. package/dist/editor/components/SidebarRenderButton.js +3 -1
  63. package/dist/editor/components/Timeline/TimelineDragHandler.js +45 -19
  64. package/dist/editor/components/TimelineInOutToggle.d.ts +2 -1
  65. package/dist/editor/components/TimelineInOutToggle.js +82 -67
  66. package/dist/editor/helpers/colors.d.ts +1 -1
  67. package/dist/editor/helpers/is-composition-still.d.ts +1 -1
  68. package/dist/editor/helpers/is-current-selected-still.js +5 -6
  69. package/dist/editor/helpers/use-menu-structure.js +25 -1
  70. package/dist/editor/icons/keys.js +1 -0
  71. package/dist/editor/state/canvas-ref.d.ts +2 -0
  72. package/dist/editor/state/canvas-ref.js +5 -0
  73. package/dist/editor/state/in-out.d.ts +3 -2
  74. package/dist/editor/state/in-out.js +22 -5
  75. package/dist/editor/state/marks.d.ts +3 -2
  76. package/dist/editor/state/marks.js +6 -6
  77. package/dist/get-composition-id.d.ts +6 -6
  78. package/dist/get-composition-id.js +13 -6
  79. package/dist/get-composition-with-dimension-override.d.ts +6 -6
  80. package/dist/get-composition-with-dimension-override.js +3 -3
  81. package/dist/handle-common-errors.js +8 -0
  82. package/dist/index.d.ts +13 -7
  83. package/dist/index.js +5 -2
  84. package/dist/log.d.ts +6 -1
  85. package/dist/parse-command-line.js +1 -1
  86. package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
  87. package/dist/preview-server/dev-middleware/setup-hooks.js +1 -1
  88. package/dist/preview-server/render-queue/job.d.ts +2 -2
  89. package/dist/preview-server/render-queue/make-retry-payload.js +3 -2
  90. package/dist/preview-server/render-queue/open-directory-in-finder.js +11 -5
  91. package/dist/preview-server/render-queue/process-still.js +1 -1
  92. package/dist/preview-server/render-queue/process-video.js +1 -1
  93. package/dist/preview-server/routes/add-render.js +2 -2
  94. package/dist/preview-server/routes/update-default-props.js +1 -2
  95. package/dist/print-compositions.d.ts +2 -2
  96. package/dist/print-error.js +6 -3
  97. package/dist/progress-bar.js +2 -5
  98. package/dist/render-flows/render.d.ts +2 -2
  99. package/dist/render-flows/render.js +31 -22
  100. package/dist/render-flows/still.d.ts +2 -2
  101. package/dist/render-flows/still.js +20 -14
  102. package/dist/render.js +6 -1
  103. package/dist/setup-cache.js +1 -1
  104. package/dist/still.js +6 -1
  105. package/package.json +11 -11
  106. package/styles/styles.css +53 -0
  107. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +0 -14
  108. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +0 -42
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimelineInOutPointToggle = exports.inOutHandles = void 0;
3
+ exports.TimelineInOutPointToggle = exports.defaultInOutValue = exports.inOutHandles = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
@@ -10,7 +10,6 @@ const is_current_selected_still_1 = require("../helpers/is-current-selected-stil
10
10
  const use_keybinding_1 = require("../helpers/use-keybinding");
11
11
  const timelineInOutPointer_1 = require("../icons/timelineInOutPointer");
12
12
  const in_out_1 = require("../state/in-out");
13
- const marks_1 = require("../state/marks");
14
13
  const ControlButton_1 = require("./ControlButton");
15
14
  const getTooltipText = (pointType, key) => [
16
15
  `Mark ${pointType}`,
@@ -24,19 +23,22 @@ const style = {
24
23
  height: 16,
25
24
  };
26
25
  exports.inOutHandles = (0, react_1.createRef)();
26
+ exports.defaultInOutValue = { inFrame: null, outFrame: null };
27
27
  const TimelineInOutPointToggle = () => {
28
28
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
29
29
  const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
30
30
  const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
31
- const { currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
32
31
  const isStill = (0, is_current_selected_still_1.useIsStill)();
33
32
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
34
33
  const keybindings = (0, use_keybinding_1.useKeybinding)();
35
- const onInOutClear = (0, react_1.useCallback)(() => {
36
- setInAndOutFrames(() => {
34
+ const onInOutClear = (0, react_1.useCallback)((composition) => {
35
+ setInAndOutFrames((prev) => {
37
36
  return {
38
- inFrame: null,
39
- outFrame: null,
37
+ ...prev,
38
+ [composition]: {
39
+ inFrame: null,
40
+ outFrame: null,
41
+ },
40
42
  };
41
43
  });
42
44
  }, [setInAndOutFrames]);
@@ -45,35 +47,51 @@ const TimelineInOutPointToggle = () => {
45
47
  return null;
46
48
  }
47
49
  if (e === null || e === void 0 ? void 0 : e.shiftKey) {
48
- setInAndOutFrames((f) => {
50
+ setInAndOutFrames((prev) => {
51
+ var _a;
49
52
  return {
50
- ...f,
51
- inFrame: null,
53
+ ...prev,
54
+ [videoConfig.id]: {
55
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
56
+ inFrame: null,
57
+ },
52
58
  };
53
59
  });
54
60
  return null;
55
61
  }
56
62
  setInAndOutFrames((prev) => {
57
- const biggestPossible = prev.outFrame === null ? Infinity : prev.outFrame - 1;
63
+ var _a, _b, _c, _d, _e;
64
+ const prevOut = (_a = prev[videoConfig.id]) === null || _a === void 0 ? void 0 : _a.outFrame;
65
+ const biggestPossible = prevOut === undefined || prevOut === null ? Infinity : prevOut - 1;
58
66
  const selected = Math.min(timelinePosition, biggestPossible);
59
67
  if (selected === 0) {
60
68
  return {
61
69
  ...prev,
62
- inFrame: null,
70
+ [videoConfig.id]: {
71
+ ...((_b = prev[videoConfig.id]) !== null && _b !== void 0 ? _b : exports.defaultInOutValue),
72
+ inFrame: null,
73
+ },
63
74
  };
64
75
  }
65
- if (prev.inFrame !== null) {
76
+ const prevIn = (_c = prev[videoConfig.id]) === null || _c === void 0 ? void 0 : _c.inFrame;
77
+ if (prevIn !== null && prevIn !== undefined) {
66
78
  // Disable if already at this position
67
- if (prev.inFrame === selected) {
79
+ if (prevIn === selected) {
68
80
  return {
69
81
  ...prev,
70
- inFrame: null,
82
+ [videoConfig.id]: {
83
+ ...((_d = prev[videoConfig.id]) !== null && _d !== void 0 ? _d : exports.defaultInOutValue),
84
+ inFrame: null,
85
+ },
71
86
  };
72
87
  }
73
88
  }
74
89
  return {
75
90
  ...prev,
76
- inFrame: selected,
91
+ [videoConfig.id]: {
92
+ ...((_e = prev[videoConfig.id]) !== null && _e !== void 0 ? _e : exports.defaultInOutValue),
93
+ inFrame: selected,
94
+ },
77
95
  };
78
96
  });
79
97
  }, [setInAndOutFrames, timelinePosition, videoConfig]);
@@ -83,9 +101,13 @@ const TimelineInOutPointToggle = () => {
83
101
  }
84
102
  e.preventDefault();
85
103
  setInAndOutFrames((f) => {
104
+ var _a;
86
105
  return {
87
106
  ...f,
88
- inFrame: null,
107
+ [videoConfig.id]: {
108
+ ...((_a = f[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
109
+ inFrame: null,
110
+ },
89
111
  };
90
112
  });
91
113
  }, [setInAndOutFrames, videoConfig]);
@@ -95,9 +117,13 @@ const TimelineInOutPointToggle = () => {
95
117
  }
96
118
  e === null || e === void 0 ? void 0 : e.preventDefault();
97
119
  setInAndOutFrames((f) => {
120
+ var _a;
98
121
  return {
99
122
  ...f,
100
- outFrame: null,
123
+ [videoConfig.id]: {
124
+ ...((_a = f[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
125
+ outFrame: null,
126
+ },
101
127
  };
102
128
  });
103
129
  }, [setInAndOutFrames, videoConfig]);
@@ -107,37 +133,59 @@ const TimelineInOutPointToggle = () => {
107
133
  }
108
134
  if (e === null || e === void 0 ? void 0 : e.shiftKey) {
109
135
  setInAndOutFrames((f) => {
136
+ var _a;
110
137
  return {
111
138
  ...f,
112
- outFrame: null,
139
+ [videoConfig.id]: {
140
+ ...((_a = f[videoConfig.id]) !== null && _a !== void 0 ? _a : exports.defaultInOutValue),
141
+ outFrame: null,
142
+ },
113
143
  };
114
144
  });
115
145
  return;
116
146
  }
117
147
  setInAndOutFrames((prev) => {
118
- const smallestPossible = prev.inFrame === null ? -Infinity : prev.inFrame + 1;
148
+ var _a, _b, _c, _d, _e;
149
+ const prevInFrame = (_a = prev[videoConfig.id]) === null || _a === void 0 ? void 0 : _a.inFrame;
150
+ const smallestPossible = prevInFrame === null || prevInFrame === undefined
151
+ ? -Infinity
152
+ : prevInFrame + 1;
119
153
  const selected = Math.max(timelinePosition, smallestPossible);
120
154
  if (selected === videoConfig.durationInFrames - 1) {
121
155
  return {
122
156
  ...prev,
123
- outFrame: null,
157
+ [videoConfig.id]: {
158
+ ...((_b = prev[videoConfig.id]) !== null && _b !== void 0 ? _b : exports.defaultInOutValue),
159
+ outFrame: null,
160
+ },
124
161
  };
125
162
  }
126
- if (prev.outFrame !== null) {
127
- if (prev.outFrame === selected) {
163
+ const prevOut = (_c = prev[videoConfig.id]) === null || _c === void 0 ? void 0 : _c.outFrame;
164
+ if (prevOut !== null && prevOut !== undefined) {
165
+ if (prevOut === selected) {
128
166
  return {
129
167
  ...prev,
130
- outFrame: null,
168
+ [videoConfig.id]: {
169
+ ...((_d = prev[videoConfig.id]) !== null && _d !== void 0 ? _d : exports.defaultInOutValue),
170
+ outFrame: null,
171
+ },
131
172
  };
132
173
  }
133
174
  }
134
175
  return {
135
176
  ...prev,
136
- outFrame: selected,
177
+ [videoConfig.id]: {
178
+ ...((_e = prev[videoConfig.id]) !== null && _e !== void 0 ? _e : exports.defaultInOutValue),
179
+ outFrame: selected,
180
+ },
137
181
  };
138
182
  });
139
183
  }, [setInAndOutFrames, timelinePosition, videoConfig]);
184
+ const confId = videoConfig === null || videoConfig === void 0 ? void 0 : videoConfig.id;
140
185
  (0, react_1.useEffect)(() => {
186
+ if (!confId) {
187
+ return;
188
+ }
141
189
  const iKey = keybindings.registerKeybinding({
142
190
  event: 'keypress',
143
191
  key: 'i',
@@ -162,7 +210,7 @@ const TimelineInOutPointToggle = () => {
162
210
  event: 'keypress',
163
211
  key: 'x',
164
212
  callback: () => {
165
- onInOutClear();
213
+ onInOutClear(confId);
166
214
  },
167
215
  commandCtrlKey: false,
168
216
  preventDefault: true,
@@ -173,52 +221,19 @@ const TimelineInOutPointToggle = () => {
173
221
  iKey.unregister();
174
222
  xKey.unregister();
175
223
  };
176
- }, [keybindings, onInMark, onInOutClear, onOutMark]);
177
- (0, react_1.useEffect)(() => {
178
- if (!currentComposition || !videoConfig) {
179
- return;
180
- }
181
- (0, marks_1.persistMarks)(currentComposition, videoConfig.durationInFrames, [
182
- inFrame,
183
- outFrame,
184
- ]);
185
- }, [currentComposition, inFrame, outFrame, videoConfig]);
186
- // If duration changes and it goes out of range, we reset
187
- (0, react_1.useEffect)(() => {
188
- if (outFrame === null) {
189
- return;
190
- }
191
- if (!videoConfig) {
192
- return;
193
- }
194
- if (outFrame >= videoConfig.durationInFrames - 1) {
195
- onInOutClear();
196
- }
197
- }, [onInOutClear, outFrame, videoConfig]);
198
- (0, react_1.useEffect)(() => {
199
- if (inFrame === null) {
200
- return;
201
- }
202
- if (!videoConfig) {
203
- return;
204
- }
205
- if (inFrame >= videoConfig.durationInFrames - 1) {
206
- onInOutClear();
207
- }
208
- }, [onInOutClear, inFrame, videoConfig]);
224
+ }, [confId, keybindings, onInMark, onInOutClear, onOutMark]);
209
225
  (0, react_1.useImperativeHandle)(exports.inOutHandles, () => {
210
226
  return {
211
- clearMarks: onInOutClear,
227
+ clearMarks: () => {
228
+ if (!confId) {
229
+ return;
230
+ }
231
+ onInOutClear(confId);
232
+ },
212
233
  inMarkClick: onInMark,
213
234
  outMarkClick: onOutMark,
214
- setMarks: ([newInFrame, newOutFrame]) => {
215
- setInAndOutFrames({
216
- inFrame: newInFrame,
217
- outFrame: newOutFrame,
218
- });
219
- },
220
235
  };
221
- }, [onInMark, onInOutClear, onOutMark, setInAndOutFrames]);
236
+ }, [confId, onInMark, onInOutClear, onOutMark]);
222
237
  if (isStill) {
223
238
  return null;
224
239
  }
@@ -16,4 +16,4 @@ export declare const BLUE_DISABLED = "#284f73";
16
16
  export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
17
17
  selected: boolean;
18
18
  hovered: boolean;
19
- }) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)";
19
+ }) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "rgba(255, 255, 255, 0.06)" | "hsla(0, 0%, 100%, 0.25)";
@@ -1,3 +1,3 @@
1
1
  export declare const isCompositionStill: (comp: {
2
- durationInFrames: number;
2
+ durationInFrames: number | undefined;
3
3
  } | null) => boolean;
@@ -13,16 +13,15 @@ const useIsStill = () => {
13
13
  };
14
14
  exports.useIsStill = useIsStill;
15
15
  const useDimensions = () => {
16
- const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
17
- const selected = (0, react_1.useMemo)(() => compositions.find((c) => c.id === currentComposition), [compositions, currentComposition]);
16
+ const config = remotion_1.Internals.useUnsafeVideoConfig();
18
17
  return (0, react_1.useMemo)(() => {
19
- if (!selected) {
18
+ if (!config) {
20
19
  return null;
21
20
  }
22
21
  return {
23
- width: selected.width,
24
- height: selected.height,
22
+ width: config.width,
23
+ height: config.height,
25
24
  };
26
- }, [selected]);
25
+ }, [config]);
27
26
  };
28
27
  exports.useDimensions = useDimensions;
@@ -11,6 +11,7 @@ const NotificationCenter_1 = require("../components/Notifications/NotificationCe
11
11
  const SizeSelector_1 = require("../components/SizeSelector");
12
12
  const TimelineInOutToggle_1 = require("../components/TimelineInOutToggle");
13
13
  const Checkmark_1 = require("../icons/Checkmark");
14
+ const canvas_ref_1 = require("../state/canvas-ref");
14
15
  const checkerboard_1 = require("../state/checkerboard");
15
16
  const editor_zoom_gestures_1 = require("../state/editor-zoom-gestures");
16
17
  const modals_1 = require("../state/modals");
@@ -36,6 +37,7 @@ const useMenuStructure = (closeMenu) => {
36
37
  const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
37
38
  const { setSidebarCollapsedState, sidebarCollapsedStateLeft, sidebarCollapsedStateRight, } = (0, react_1.useContext)(sidebar_1.SidebarContext);
38
39
  const sizes = (0, SizeSelector_1.getUniqueSizes)(size);
40
+ const isFullscreenSupported = document.fullscreenEnabled || document.webkitFullscreenEnabled;
39
41
  const structure = (0, react_1.useMemo)(() => {
40
42
  const struct = [
41
43
  {
@@ -474,7 +476,28 @@ const useMenuStructure = (closeMenu) => {
474
476
  value: 'clear-marks',
475
477
  quickSwitcherLabel: 'Timeline: Clear In and Out Mark',
476
478
  },
477
- ],
479
+ {
480
+ id: 'fullscreen-divider',
481
+ type: 'divider',
482
+ },
483
+ isFullscreenSupported
484
+ ? {
485
+ id: 'fullscreen',
486
+ keyHint: null,
487
+ label: 'Fullscreen',
488
+ leftItem: null,
489
+ onClick: () => {
490
+ var _a;
491
+ closeMenu();
492
+ (_a = canvas_ref_1.canvasRef.current) === null || _a === void 0 ? void 0 : _a.requestFullscreen();
493
+ },
494
+ subMenu: null,
495
+ type: 'item',
496
+ value: 'fullscreen',
497
+ quickSwitcherLabel: 'Go Fullscreen',
498
+ }
499
+ : null,
500
+ ].filter(remotion_1.Internals.truthy),
478
501
  },
479
502
  'EyeDropper' in window
480
503
  ? {
@@ -639,6 +662,7 @@ const useMenuStructure = (closeMenu) => {
639
662
  sidebarCollapsedStateLeft,
640
663
  sidebarCollapsedStateRight,
641
664
  checkerboard,
665
+ isFullscreenSupported,
642
666
  closeMenu,
643
667
  setSelectedModal,
644
668
  type,
@@ -4,6 +4,7 @@ exports.ArrowRight = exports.ArrowLeft = exports.ShiftIcon = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const iconStyle = {
6
6
  width: 10,
7
+ display: 'inline',
7
8
  };
8
9
  const ShiftIcon = () => {
9
10
  return ((0, jsx_runtime_1.jsx)("svg", { style: iconStyle, viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M48.048 304h73.798v128c0 26.51 21.49 48 48 48h108.308c26.51 0 48-21.49 48-48V304h73.789c42.638 0 64.151-51.731 33.941-81.941l-175.943-176c-18.745-18.745-49.137-18.746-67.882 0l-175.952 176C-16.042 252.208 5.325 304 48.048 304zM224 80l176 176H278.154v176H169.846V256H48L224 80z" }) }));
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const canvasRef: import("react").RefObject<HTMLDivElement>;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.canvasRef = void 0;
4
+ const react_1 = require("react");
5
+ exports.canvasRef = (0, react_1.createRef)();
@@ -1,12 +1,13 @@
1
1
  import type React from 'react';
2
- export type TimelineInOutContextValue = {
2
+ export type InOutValue = {
3
3
  inFrame: number | null;
4
4
  outFrame: number | null;
5
5
  };
6
+ export type TimelineInOutContextValue = Record<string, InOutValue>;
6
7
  export type SetTimelineInOutContextValue = {
7
8
  setInAndOutFrames: (u: React.SetStateAction<TimelineInOutContextValue>) => void;
8
9
  };
9
10
  export declare const TimelineInOutContext: React.Context<TimelineInOutContextValue>;
10
11
  export declare const SetTimelineInOutContext: React.Context<SetTimelineInOutContextValue>;
11
- export declare const useTimelineInOutFramePosition: () => TimelineInOutContextValue;
12
+ export declare const useTimelineInOutFramePosition: () => InOutValue;
12
13
  export declare const useTimelineSetInOutFramePosition: () => SetTimelineInOutContextValue;
@@ -2,18 +2,35 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useTimelineSetInOutFramePosition = exports.useTimelineInOutFramePosition = exports.SetTimelineInOutContext = exports.TimelineInOutContext = void 0;
4
4
  const react_1 = require("react");
5
- exports.TimelineInOutContext = (0, react_1.createContext)({
6
- inFrame: null,
7
- outFrame: null,
8
- });
5
+ const remotion_1 = require("remotion");
6
+ exports.TimelineInOutContext = (0, react_1.createContext)({});
9
7
  exports.SetTimelineInOutContext = (0, react_1.createContext)({
10
8
  setInAndOutFrames: () => {
11
9
  throw new Error('default');
12
10
  },
13
11
  });
14
12
  const useTimelineInOutFramePosition = () => {
13
+ var _a, _b, _c, _d;
14
+ const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
15
15
  const state = (0, react_1.useContext)(exports.TimelineInOutContext);
16
- return state;
16
+ if (!videoConfig) {
17
+ return { inFrame: null, outFrame: null };
18
+ }
19
+ const maxFrame = videoConfig.durationInFrames - 1;
20
+ const actualInFrame = (_b = (_a = state[videoConfig.id]) === null || _a === void 0 ? void 0 : _a.inFrame) !== null && _b !== void 0 ? _b : null;
21
+ const actualOutFrame = (_d = (_c = state[videoConfig.id]) === null || _c === void 0 ? void 0 : _c.outFrame) !== null && _d !== void 0 ? _d : null;
22
+ return {
23
+ inFrame: actualInFrame === null
24
+ ? null
25
+ : actualInFrame >= maxFrame
26
+ ? null
27
+ : actualInFrame,
28
+ outFrame: actualOutFrame === null
29
+ ? null
30
+ : actualOutFrame >= maxFrame
31
+ ? null
32
+ : actualOutFrame,
33
+ };
17
34
  };
18
35
  exports.useTimelineInOutFramePosition = useTimelineInOutFramePosition;
19
36
  const useTimelineSetInOutFramePosition = () => {
@@ -1,2 +1,3 @@
1
- export declare const persistMarks: (comp: string, durationInFrames: number, marks: [number | null, number | null]) => void;
2
- export declare const loadMarks: (comp: string, durationInFrames: number) => [number | null, number | null];
1
+ import type { TimelineInOutContextValue } from './in-out';
2
+ export declare const persistMarks: (marks: TimelineInOutContextValue) => void;
3
+ export declare const loadMarks: () => TimelineInOutContextValue;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadMarks = exports.persistMarks = void 0;
4
- const localStorageKey = (comp, durationInFrames) => `remotion.editor.marks.${comp}.${durationInFrames}`;
5
- const persistMarks = (comp, durationInFrames, marks) => {
6
- localStorage.setItem(localStorageKey(comp, durationInFrames), JSON.stringify(marks));
4
+ const localStorageKey = () => `remotion.editor.marksv2`;
5
+ const persistMarks = (marks) => {
6
+ localStorage.setItem(localStorageKey(), JSON.stringify(marks));
7
7
  };
8
8
  exports.persistMarks = persistMarks;
9
- const loadMarks = (comp, durationInFrames) => {
10
- const item = localStorage.getItem(localStorageKey(comp, durationInFrames));
9
+ const loadMarks = () => {
10
+ const item = localStorage.getItem(localStorageKey());
11
11
  if (item === null) {
12
- return [null, null];
12
+ return {};
13
13
  }
14
14
  return JSON.parse(item);
15
15
  };
@@ -1,9 +1,9 @@
1
- import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, RemotionServer } from '@remotion/renderer';
2
- import type { AnyCompMetadata } from 'remotion';
3
- export declare const getCompositionId: ({ args, compositionIdFromUi, inputProps, puppeteerInstance, envVariables, timeoutInMilliseconds, chromiumOptions, port, browserExecutable, serveUrlOrWebpackUrl, verbose, indent, server, }: {
1
+ import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, LogLevel, RemotionServer } from '@remotion/renderer';
2
+ import type { VideoConfig } from 'remotion';
3
+ export declare const getCompositionId: ({ args, compositionIdFromUi, serializedInputPropsWithCustomSchema, puppeteerInstance, envVariables, timeoutInMilliseconds, chromiumOptions, port, browserExecutable, serveUrlOrWebpackUrl, logLevel, indent, server, }: {
4
4
  args: string[];
5
5
  compositionIdFromUi: string | null;
6
- inputProps: Record<string, unknown>;
6
+ serializedInputPropsWithCustomSchema: string;
7
7
  puppeteerInstance: HeadlessBrowser | undefined;
8
8
  envVariables: Record<string, string>;
9
9
  timeoutInMilliseconds: number;
@@ -11,12 +11,12 @@ export declare const getCompositionId: ({ args, compositionIdFromUi, inputProps,
11
11
  port: number | null;
12
12
  browserExecutable: BrowserExecutable;
13
13
  serveUrlOrWebpackUrl: string;
14
- verbose: boolean;
14
+ logLevel: LogLevel;
15
15
  indent: boolean;
16
16
  server: RemotionServer;
17
17
  }) => Promise<{
18
18
  compositionId: string;
19
19
  reason: string;
20
- config: AnyCompMetadata;
20
+ config: VideoConfig;
21
21
  argsAfterComposition: string[];
22
22
  }>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCompositionId = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
+ const format_bytes_1 = require("./format-bytes");
5
6
  const log_1 = require("./log");
6
7
  const show_compositions_picker_1 = require("./show-compositions-picker");
7
8
  const getCompName = ({ cliArgs, compositionIdFromUi, }) => {
@@ -15,15 +16,15 @@ const getCompName = ({ cliArgs, compositionIdFromUi, }) => {
15
16
  const [compName, ...remainingArgs] = cliArgs;
16
17
  return { compName, remainingArgs, reason: 'Passed as argument' };
17
18
  };
18
- const getCompositionId = async ({ args, compositionIdFromUi, inputProps, puppeteerInstance, envVariables, timeoutInMilliseconds, chromiumOptions, port, browserExecutable, serveUrlOrWebpackUrl, verbose, indent, server, }) => {
19
+ const getCompositionId = async ({ args, compositionIdFromUi, serializedInputPropsWithCustomSchema, puppeteerInstance, envVariables, timeoutInMilliseconds, chromiumOptions, port, browserExecutable, serveUrlOrWebpackUrl, logLevel, indent, server, }) => {
19
20
  const { compName, remainingArgs, reason: compReason, } = getCompName({
20
21
  cliArgs: args,
21
22
  compositionIdFromUi,
22
23
  });
23
24
  if (compName) {
24
- const config = await renderer_1.RenderInternals.internalSelectComposition({
25
+ const { metadata: config, propsSize } = await renderer_1.RenderInternals.internalSelectComposition({
25
26
  id: compName,
26
- inputProps,
27
+ serializedInputPropsWithCustomSchema,
27
28
  puppeteerInstance,
28
29
  envVariables,
29
30
  timeoutInMilliseconds,
@@ -31,11 +32,17 @@ const getCompositionId = async ({ args, compositionIdFromUi, inputProps, puppete
31
32
  browserExecutable,
32
33
  chromiumOptions,
33
34
  port,
34
- verbose,
35
+ logLevel,
35
36
  server,
36
37
  indent,
37
38
  onBrowserLog: null,
38
39
  });
40
+ if (propsSize > 10000000) {
41
+ log_1.Log.warnAdvanced({
42
+ indent,
43
+ logLevel,
44
+ }, `The props of your composition are large (${(0, format_bytes_1.formatBytes)(propsSize)}). This may cause slowdown.`);
45
+ }
39
46
  if (!config) {
40
47
  throw new Error(`Cannot find composition with ID "${compName}"`);
41
48
  }
@@ -48,18 +55,18 @@ const getCompositionId = async ({ args, compositionIdFromUi, inputProps, puppete
48
55
  }
49
56
  if (!process.env.CI) {
50
57
  const comps = await renderer_1.RenderInternals.internalGetCompositions({
51
- inputProps,
52
58
  puppeteerInstance,
53
59
  envVariables,
54
60
  timeoutInMilliseconds,
55
61
  chromiumOptions,
56
62
  port,
57
63
  browserExecutable,
58
- verbose,
64
+ logLevel,
59
65
  indent,
60
66
  server,
61
67
  serveUrlOrWebpackUrl,
62
68
  onBrowserLog: null,
69
+ serializedInputPropsWithCustomSchema,
63
70
  });
64
71
  const { compositionId, reason } = await (0, show_compositions_picker_1.showSingleCompositionsPicker)(comps);
65
72
  if (compositionId && typeof compositionId === 'string') {
@@ -1,6 +1,6 @@
1
- import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, RemotionServer } from '@remotion/renderer';
2
- import type { AnyCompMetadata } from 'remotion';
3
- export declare const getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, inputProps, verbose, server, }: {
1
+ import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, LogLevel, RemotionServer } from '@remotion/renderer';
2
+ import type { VideoConfig } from 'remotion';
3
+ export declare const getCompositionWithDimensionOverride: ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, }: {
4
4
  height: number | null;
5
5
  width: number | null;
6
6
  args: string[];
@@ -13,12 +13,12 @@ export declare const getCompositionWithDimensionOverride: ({ height, width, args
13
13
  browserExecutable: BrowserExecutable | null;
14
14
  serveUrlOrWebpackUrl: string;
15
15
  indent: boolean;
16
- verbose: boolean;
17
- inputProps: Record<string, unknown>;
16
+ logLevel: LogLevel;
17
+ serializedInputPropsWithCustomSchema: string;
18
18
  server: RemotionServer;
19
19
  }) => Promise<{
20
20
  compositionId: string;
21
21
  reason: string;
22
- config: AnyCompMetadata;
22
+ config: VideoConfig;
23
23
  argsAfterComposition: string[];
24
24
  }>;
@@ -2,17 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCompositionWithDimensionOverride = void 0;
4
4
  const get_composition_id_1 = require("./get-composition-id");
5
- const getCompositionWithDimensionOverride = async ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, inputProps, verbose, server, }) => {
5
+ const getCompositionWithDimensionOverride = async ({ height, width, args, compositionIdFromUi, chromiumOptions, envVariables, port, puppeteerInstance, timeoutInMilliseconds, browserExecutable, serveUrlOrWebpackUrl, indent, serializedInputPropsWithCustomSchema, logLevel, server, }) => {
6
6
  const returnValue = await (0, get_composition_id_1.getCompositionId)({
7
7
  args,
8
8
  compositionIdFromUi,
9
9
  indent,
10
10
  serveUrlOrWebpackUrl,
11
- verbose,
11
+ logLevel,
12
12
  browserExecutable,
13
13
  chromiumOptions,
14
14
  envVariables,
15
- inputProps,
15
+ serializedInputPropsWithCustomSchema,
16
16
  port,
17
17
  puppeteerInstance,
18
18
  timeoutInMilliseconds,
@@ -48,5 +48,13 @@ const handleCommonError = async (err, logLevel) => {
48
48
  log_1.Log.info(' Oftentimes, this happens if the component is missing the `export` keyword');
49
49
  log_1.Log.info(' or if the component was renamed and the import statement not properly adjusted.');
50
50
  }
51
+ if (err.message.includes('GLIBC_')) {
52
+ log_1.Log.info('💡 Remotion requires at least Libc 2.35.');
53
+ log_1.Log.info('💡 Get help for this issue: https://github.com/remotion-dev/remotion/issues/2439');
54
+ }
55
+ if (err.message.includes('EBADF')) {
56
+ log_1.Log.info('💡 This error might be fixed by changing your Node version:');
57
+ log_1.Log.info(' https://github.com/remotion-dev/remotion/issues/2452');
58
+ }
51
59
  };
52
60
  exports.handleCommonError = handleCommonError;