@remotion/cli 4.1.0-alpha5 → 4.1.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.
Files changed (71) hide show
  1. package/dist/benchmark.js +13 -2
  2. package/dist/codemods/stringify-with-path.js +3 -3
  3. package/dist/compositions.js +6 -1
  4. package/dist/config/log.d.ts +1 -1
  5. package/dist/editor/components/CanvasOrLoading.js +20 -1
  6. package/dist/editor/components/CopyButton.js +5 -2
  7. package/dist/editor/components/Editor.js +1 -3
  8. package/dist/editor/components/FramePersistor.d.ts +0 -2
  9. package/dist/editor/components/FramePersistor.js +4 -24
  10. package/dist/editor/components/InitialCompositionLoader.js +1 -22
  11. package/dist/editor/components/NewComposition/RemInput.d.ts +1 -1
  12. package/dist/editor/components/OpenEditorButton.js +5 -2
  13. package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.js +3 -3
  14. package/dist/editor/components/RenderModal/DataEditor.js +3 -3
  15. package/dist/editor/components/RenderModal/RenderModal.js +5 -2
  16. package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +2 -3
  17. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -1
  18. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.js +2 -2
  19. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +1 -1
  20. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
  21. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +0 -1
  22. package/dist/editor/components/RenderQueue/actions.d.ts +1 -1
  23. package/dist/editor/components/RenderQueue/actions.js +12 -4
  24. package/dist/editor/components/SetTimelineInOutProvider.js +5 -4
  25. package/dist/editor/components/SidebarRenderButton.js +3 -1
  26. package/dist/editor/components/Timeline/TimelineDragHandler.js +45 -19
  27. package/dist/editor/components/TimelineInOutToggle.d.ts +2 -1
  28. package/dist/editor/components/TimelineInOutToggle.js +82 -67
  29. package/dist/editor/helpers/is-composition-still.d.ts +1 -1
  30. package/dist/editor/helpers/is-current-selected-still.js +5 -6
  31. package/dist/editor/icons/keys.js +1 -0
  32. package/dist/editor/state/in-out.d.ts +3 -2
  33. package/dist/editor/state/in-out.js +22 -5
  34. package/dist/editor/state/marks.d.ts +3 -2
  35. package/dist/editor/state/marks.js +6 -6
  36. package/dist/error-with-stack-frame.d.ts +19 -0
  37. package/dist/error-with-stack-frame.js +81 -0
  38. package/dist/get-composition-id.d.ts +2 -2
  39. package/dist/get-composition-id.js +7 -4
  40. package/dist/get-composition-with-dimension-override.d.ts +2 -2
  41. package/dist/get-composition-with-dimension-override.js +2 -2
  42. package/dist/handle-common-errors.js +4 -0
  43. package/dist/handle-javascript-error.d.ts +20 -0
  44. package/dist/handle-javascript-error.js +81 -0
  45. package/dist/index.d.ts +3 -3
  46. package/dist/log.d.ts +3 -3
  47. package/dist/parse-command-line.js +1 -1
  48. package/dist/preview-server/error-overlay/remotion-overlay/Button.js +1 -0
  49. package/dist/preview-server/render-queue/job.d.ts +2 -2
  50. package/dist/preview-server/render-queue/make-retry-payload.js +3 -2
  51. package/dist/preview-server/render-queue/open-directory-in-finder.js +11 -5
  52. package/dist/preview-server/render-queue/process-still.js +1 -1
  53. package/dist/preview-server/render-queue/process-video.js +1 -1
  54. package/dist/preview-server/routes/add-render.js +2 -2
  55. package/dist/preview-server/routes/update-default-props.js +2 -2
  56. package/dist/print-compositions.d.ts +2 -2
  57. package/dist/render-flows/render.d.ts +2 -2
  58. package/dist/render-flows/render.js +18 -7
  59. package/dist/render-flows/still.d.ts +2 -2
  60. package/dist/render-flows/still.js +12 -6
  61. package/dist/render.js +6 -1
  62. package/dist/still.js +6 -1
  63. package/dist/symbolicate-error.d.ts +3 -0
  64. package/dist/symbolicate-error.js +24 -0
  65. package/dist/symbolicate-errors.d.ts +7 -0
  66. package/dist/symbolicate-errors.js +90 -0
  67. package/dist/symbolicate-stacktrace.d.ts +28 -0
  68. package/dist/symbolicate-stacktrace.js +135 -0
  69. package/dist/symbolicateable-error.d.ts +16 -0
  70. package/dist/symbolicateable-error.js +18 -0
  71. package/package.json +10 -10
@@ -9,7 +9,6 @@ const get_left_of_timeline_slider_1 = require("../../helpers/get-left-of-timelin
9
9
  const timeline_layout_1 = require("../../helpers/timeline-layout");
10
10
  const in_out_1 = require("../../state/in-out");
11
11
  const timeline_zoom_1 = require("../../state/timeline-zoom");
12
- const FramePersistor_1 = require("../FramePersistor");
13
12
  const is_menu_item_1 = require("../Menu/is-menu-item");
14
13
  const timeline_refs_1 = require("./timeline-refs");
15
14
  const timeline_scroll_logic_1 = require("./timeline-scroll-logic");
@@ -17,6 +16,7 @@ const TimelineInOutPointer_1 = require("./TimelineInOutPointer");
17
16
  const TimelineInOutPointerHandle_1 = require("./TimelineInOutPointerHandle");
18
17
  const TimelineSlider_1 = require("./TimelineSlider");
19
18
  const TimelineWidthProvider_1 = require("./TimelineWidthProvider");
19
+ const TimelineInOutToggle_1 = require("../TimelineInOutToggle");
20
20
  const inner = {
21
21
  overflowY: 'auto',
22
22
  overflowX: 'hidden',
@@ -50,6 +50,7 @@ const Inner = () => {
50
50
  triggerOnWindowResize: true,
51
51
  shouldApplyCssTransforms: true,
52
52
  });
53
+ const setFrame = remotion_1.Internals.useTimelineSetFrame();
53
54
  const [inOutDragging, setInOutDragging] = (0, react_1.useState)({
54
55
  dragging: false,
55
56
  });
@@ -254,11 +255,12 @@ const Inner = () => {
254
255
  width,
255
256
  extrapolate: 'clamp',
256
257
  });
257
- (0, FramePersistor_1.persistCurrentFrame)(frame);
258
+ remotion_1.Internals.persistCurrentFrame(frame, videoConfig.id);
259
+ setFrame((c) => ({ ...c, [videoConfig.id]: frame }));
258
260
  if (dragging.wasPlaying) {
259
261
  play();
260
262
  }
261
- }, [dragging, left, play, videoConfig, width]);
263
+ }, [dragging, left, play, videoConfig, setFrame, width]);
262
264
  const onPointerUpInOut = (0, react_1.useCallback)((e) => {
263
265
  if (!videoConfig) {
264
266
  return;
@@ -277,29 +279,53 @@ const Inner = () => {
277
279
  });
278
280
  if (inOutDragging.dragging === 'in') {
279
281
  if (frame < 1) {
280
- return setInAndOutFrames((prev) => ({
281
- ...prev,
282
- inFrame: null,
283
- }));
282
+ return setInAndOutFrames((prev) => {
283
+ var _a;
284
+ return ({
285
+ ...prev,
286
+ [videoConfig.id]: {
287
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
288
+ inFrame: null,
289
+ },
290
+ });
291
+ });
284
292
  }
285
293
  const maxFrame = outFrame === null ? Infinity : outFrame - 1;
286
- setInAndOutFrames((prev) => ({
287
- ...prev,
288
- inFrame: Math.min(maxFrame, frame),
289
- }));
294
+ setInAndOutFrames((prev) => {
295
+ var _a;
296
+ return ({
297
+ ...prev,
298
+ [videoConfig.id]: {
299
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
300
+ inFrame: Math.min(maxFrame, frame),
301
+ },
302
+ });
303
+ });
290
304
  }
291
305
  else {
292
306
  if (frame > videoConfig.durationInFrames - 2) {
293
- return setInAndOutFrames((prev) => ({
294
- ...prev,
295
- outFrame: null,
296
- }));
307
+ return setInAndOutFrames((prev) => {
308
+ var _a;
309
+ return ({
310
+ ...prev,
311
+ [videoConfig.id]: {
312
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
313
+ outFrame: null,
314
+ },
315
+ });
316
+ });
297
317
  }
298
318
  const minFrame = inFrame === null ? -Infinity : inFrame + 1;
299
- setInAndOutFrames((prev) => ({
300
- ...prev,
301
- outFrame: Math.max(minFrame, frame),
302
- }));
319
+ setInAndOutFrames((prev) => {
320
+ var _a;
321
+ return ({
322
+ ...prev,
323
+ [videoConfig.id]: {
324
+ ...((_a = prev[videoConfig.id]) !== null && _a !== void 0 ? _a : TimelineInOutToggle_1.defaultInOutValue),
325
+ outFrame: Math.max(minFrame, frame),
326
+ },
327
+ });
328
+ });
303
329
  }
304
330
  }, [
305
331
  inFrame,
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
+ import type { InOutValue } from '../state/in-out';
2
3
  export declare const inOutHandles: React.RefObject<{
3
4
  inMarkClick: (e: KeyboardEvent | null) => void;
4
5
  outMarkClick: (e: KeyboardEvent | null) => void;
5
6
  clearMarks: () => void;
6
- setMarks: (marks: [number | null, number | null]) => void;
7
7
  }>;
8
+ export declare const defaultInOutValue: InOutValue;
8
9
  export declare const TimelineInOutPointToggle: React.FC;
@@ -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
  }
@@ -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;
@@ -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" }) }));
@@ -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
  };
@@ -0,0 +1,19 @@
1
+ import type { Page, SymbolicatedStackFrame } from '@remotion/renderer';
2
+ export declare class ErrorWithStackFrame extends Error {
3
+ symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
4
+ frame: number | null;
5
+ name: string;
6
+ delayRenderCall: SymbolicatedStackFrame[] | null;
7
+ constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }: {
8
+ message: string;
9
+ symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
10
+ frame: number | null;
11
+ name: string;
12
+ delayRenderCall: SymbolicatedStackFrame[] | null;
13
+ });
14
+ }
15
+ export declare const handleJavascriptException: ({ page, onError, frame, }: {
16
+ page: Page;
17
+ frame: number | null;
18
+ onError: (err: Error) => void;
19
+ }) => () => void;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleJavascriptException = exports.ErrorWithStackFrame = void 0;
4
+ const remotion_1 = require("remotion");
5
+ const renderer_1 = require("@remotion/renderer");
6
+ const log_1 = require("./log");
7
+ class ErrorWithStackFrame extends Error {
8
+ constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }) {
9
+ super(message);
10
+ this.symbolicatedStackFrames = symbolicatedStackFrames;
11
+ this.frame = frame;
12
+ this.name = name;
13
+ this.delayRenderCall = delayRenderCall;
14
+ }
15
+ }
16
+ exports.ErrorWithStackFrame = ErrorWithStackFrame;
17
+ const cleanUpErrorMessage = (exception) => {
18
+ var _a, _b, _c, _d;
19
+ let errorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
20
+ if (!errorMessage) {
21
+ return null;
22
+ }
23
+ const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
24
+ const prefix = `${errorType}: `;
25
+ if (errorMessage.startsWith(prefix)) {
26
+ errorMessage = errorMessage.substring(prefix.length);
27
+ }
28
+ const frames = (_d = (_c = exception.exceptionDetails.stackTrace) === null || _c === void 0 ? void 0 : _c.callFrames.length) !== null && _d !== void 0 ? _d : 0;
29
+ const split = errorMessage.split('\n');
30
+ return split.slice(0, Math.max(1, split.length - frames)).join('\n');
31
+ };
32
+ const removeDelayRenderStack = (message) => {
33
+ const index = message.indexOf(remotion_1.Internals.DELAY_RENDER_CALLSTACK_TOKEN);
34
+ if (index === -1) {
35
+ return message;
36
+ }
37
+ return message.substring(0, index);
38
+ };
39
+ const callFrameToStackFrame = (callFrame) => {
40
+ return {
41
+ columnNumber: callFrame.columnNumber,
42
+ fileName: callFrame.url,
43
+ functionName: callFrame.functionName,
44
+ lineNumber: callFrame.lineNumber,
45
+ };
46
+ };
47
+ const handleJavascriptException = ({ page, onError, frame, }) => {
48
+ const client = page._client();
49
+ const handler = (exception) => {
50
+ var _a, _b, _c;
51
+ const rawErrorMessage = (_a = exception.exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description;
52
+ const cleanErrorMessage = cleanUpErrorMessage(exception);
53
+ if (!cleanErrorMessage) {
54
+ log_1.Log.error(exception);
55
+ const err = new Error(rawErrorMessage);
56
+ err.stack = rawErrorMessage;
57
+ onError(err);
58
+ return;
59
+ }
60
+ if (!exception.exceptionDetails.stackTrace) {
61
+ const err = new Error(removeDelayRenderStack(cleanErrorMessage));
62
+ err.stack = rawErrorMessage;
63
+ onError(err);
64
+ return;
65
+ }
66
+ const errorType = (_b = exception.exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className;
67
+ const symbolicatedErr = new renderer_1.RenderInternals.SymbolicateableError({
68
+ message: removeDelayRenderStack(cleanErrorMessage),
69
+ stackFrame: exception.exceptionDetails.stackTrace.callFrames.map((f) => callFrameToStackFrame(f)),
70
+ frame,
71
+ name: errorType,
72
+ stack: (_c = exception.exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description,
73
+ });
74
+ onError(symbolicatedErr);
75
+ };
76
+ client.on('Runtime.exceptionThrown', handler);
77
+ return () => {
78
+ client.off('Runtime.exceptionThrown', handler);
79
+ };
80
+ };
81
+ exports.handleJavascriptException = handleJavascriptException;
@@ -1,9 +1,9 @@
1
1
  import type { BrowserExecutable, ChromiumOptions, HeadlessBrowser, LogLevel, RemotionServer } from '@remotion/renderer';
2
2
  import type { VideoConfig } from 'remotion';
3
- export declare const getCompositionId: ({ args, compositionIdFromUi, inputProps, puppeteerInstance, envVariables, timeoutInMilliseconds, chromiumOptions, port, browserExecutable, serveUrlOrWebpackUrl, logLevel, indent, server, }: {
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;