@remotion/cli 4.0.10 → 4.0.11

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 (31) hide show
  1. package/dist/codemods/stringify-with-path.js +23 -18
  2. package/dist/config/log.d.ts +1 -1
  3. package/dist/editor/components/KeyboardShortcutsExplainer.js +1 -1
  4. package/dist/editor/components/RenderModal/DataEditor.d.ts +2 -0
  5. package/dist/editor/components/RenderModal/DataEditor.js +9 -4
  6. package/dist/editor/components/RenderModal/RenderModal.js +2 -1
  7. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +1 -1
  8. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +26 -0
  9. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +2 -1
  10. package/dist/editor/components/RightPanel.js +45 -12
  11. package/dist/editor/helpers/colors.d.ts +1 -1
  12. package/dist/preview-server/error-overlay/remotion-overlay/Button.js +0 -1
  13. package/dist/preview-server/routes/update-default-props.js +1 -2
  14. package/dist/render-flows/render.js +1 -1
  15. package/package.json +8 -8
  16. package/dist/cloudrun-command.d.ts +0 -1
  17. package/dist/cloudrun-command.js +0 -27
  18. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +0 -14
  19. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +0 -42
  20. package/dist/error-with-stack-frame.d.ts +0 -19
  21. package/dist/error-with-stack-frame.js +0 -81
  22. package/dist/handle-javascript-error.d.ts +0 -20
  23. package/dist/handle-javascript-error.js +0 -81
  24. package/dist/symbolicate-error.d.ts +0 -3
  25. package/dist/symbolicate-error.js +0 -24
  26. package/dist/symbolicate-errors.d.ts +0 -7
  27. package/dist/symbolicate-errors.js +0 -90
  28. package/dist/symbolicate-stacktrace.d.ts +0 -28
  29. package/dist/symbolicate-stacktrace.js +0 -135
  30. package/dist/symbolicateable-error.d.ts +0 -16
  31. package/dist/symbolicateable-error.js +0 -18
@@ -13,24 +13,29 @@ const doesMatchPath = (path1, enumPaths) => {
13
13
  return item === p[index];
14
14
  }));
15
15
  };
16
- const stringifyDefaultProps = ({ props, enumPaths, }) => JSON.stringify(props, replacerWithPath(function (key, value, path) {
17
- /* Don't replace with arrow function */ const item = this[key];
18
- if (item instanceof Date) {
19
- return `__REMOVEQUOTE__new Date('${item.toISOString()}')__REMOVEQUOTE__`;
20
- }
21
- if (typeof item === 'string' && doesMatchPath(path, enumPaths)) {
22
- return `${item}__ADD_AS_CONST__`;
23
- }
24
- if (typeof item === 'string' && item.startsWith(remotion_1.Internals.FILE_TOKEN)) {
25
- return `__REMOVEQUOTE____WRAP_IN_STATIC_FILE_START__${decodeURIComponent(item.replace(remotion_1.Internals.FILE_TOKEN, ''))}__WRAP_IN_STATIC_FILE_END____REMOVEQUOTE__`;
26
- }
27
- return value;
28
- }))
29
- .replace(/"__REMOVEQUOTE__/g, '')
30
- .replace(/__REMOVEQUOTE__"/g, '')
31
- .replace(/__ADD_AS_CONST__"/g, '" as const')
32
- .replace(/__WRAP_IN_STATIC_FILE_START__/g, 'staticFile("')
33
- .replace(/__WRAP_IN_STATIC_FILE_END__/g, '")');
16
+ const stringifyDefaultProps = ({ props, enumPaths, }) => {
17
+ return JSON.stringify(props, replacerWithPath(function (key, value, path) {
18
+ /* Don't replace with arrow function! This function uses `this` */
19
+ const item = this[key];
20
+ if (typeof item === 'string' && doesMatchPath(path, enumPaths)) {
21
+ return `${item}__ADD_AS_CONST__`;
22
+ }
23
+ if (typeof item === 'string' && item.startsWith(remotion_1.Internals.FILE_TOKEN)) {
24
+ return `__REMOVEQUOTE____WRAP_IN_STATIC_FILE_START__${decodeURIComponent(item.replace(remotion_1.Internals.FILE_TOKEN, ''))}__WRAP_IN_STATIC_FILE_END____REMOVEQUOTE__`;
25
+ }
26
+ if (typeof item === 'string' && item.startsWith(remotion_1.Internals.DATE_TOKEN)) {
27
+ return `__REMOVEQUOTE____WRAP_IN_DATE_START__${decodeURIComponent(item.replace(remotion_1.Internals.DATE_TOKEN, ''))}__WRAP_IN_DATE_END____REMOVEQUOTE__`;
28
+ }
29
+ return value;
30
+ }))
31
+ .replace(/"__REMOVEQUOTE__/g, '')
32
+ .replace(/__REMOVEQUOTE__"/g, '')
33
+ .replace(/__ADD_AS_CONST__"/g, '" as const')
34
+ .replace(/__WRAP_IN_STATIC_FILE_START__/g, 'staticFile("')
35
+ .replace(/__WRAP_IN_STATIC_FILE_END__/g, '")')
36
+ .replace(/__WRAP_IN_DATE_START__/g, 'new Date("')
37
+ .replace(/__WRAP_IN_DATE_END__/g, '")');
38
+ };
34
39
  exports.stringifyDefaultProps = stringifyDefaultProps;
35
40
  function replacerWithPath(replacer) {
36
41
  const m = new Map();
@@ -1 +1 @@
1
- export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn", setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
1
+ export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error", setLogLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
@@ -52,6 +52,6 @@ const li = {
52
52
  fontSize: 14,
53
53
  };
54
54
  const KeyboardShortcutsExplainer = () => {
55
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? ((0, jsx_runtime_1.jsxs)("div", { style: keyboardShortcutsDisabled, children: ["Keyboard shortcuts disabled either due to:", (0, jsx_runtime_1.jsxs)("ul", { style: ul, children: [(0, jsx_runtime_1.jsx)("li", { style: li, children: "a) --disable-keyboard-shortcuts being passed" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: "b) Config.setKeyboardShortcutsEnabled(false) being set or" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: " c) a Remotion version mismatch." })] })] })) : null, (0, jsx_runtime_1.jsxs)(layout_1.Row, { style: container, children: [(0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second back" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Previous frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Space" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Next frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second forward" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "A" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to beginning" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "E" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to end" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reverse playback" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "L" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Speed up" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Enter" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause & return to playback start" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Sidebar" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "B" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle left sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle right sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "G" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle both sidebars" })] }), (0, jsx_runtime_1.jsx)("br", {})] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 8 }), (0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Navigation" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "N" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "New composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "R" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Render composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "T" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle checkerboard transparency" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "?" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Show keyboard shortcuts" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Quick Switcher" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback range" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "I" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set In Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "O" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set Out Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "X" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Clear In/Out Points" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Zoom" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "+" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom in" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "-" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom out" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "0" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reset zoom" })] })] })] })] }));
55
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? ((0, jsx_runtime_1.jsxs)("div", { style: keyboardShortcutsDisabled, children: ["Keyboard shortcuts disabled either due to:", (0, jsx_runtime_1.jsxs)("ul", { style: ul, children: [(0, jsx_runtime_1.jsx)("li", { style: li, children: "a) --disable-keyboard-shortcuts being passed" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: "b) Config.setKeyboardShortcutsEnabled(false) being set or" }), (0, jsx_runtime_1.jsx)("li", { style: li, children: " c) a Remotion version mismatch." })] })] })) : null, (0, jsx_runtime_1.jsxs)(layout_1.Row, { style: container, children: [(0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second back" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowLeft, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Previous frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Space" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Next frame" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ShiftIcon, {}) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: (0, jsx_runtime_1.jsx)(keys_1.ArrowRight, {}) })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "1 second forward" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "A" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to beginning" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "E" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Jump to end" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reverse playback" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "L" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Play / Speed up" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "Enter" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Pause & return to playback start" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Sidebar" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "B" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle left sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "J" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle right sidebar" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "G" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle both sidebars" })] }), (0, jsx_runtime_1.jsx)("br", {})] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 8 }), (0, jsx_runtime_1.jsxs)(layout_1.Column, { children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: "Navigation" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "N" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "New composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "R" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Render composition" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "T" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Toggle checkerboard transparency" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "?" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Show keyboard shortcuts" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "K" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Quick Switcher" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Playback range" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "I" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set In Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "O" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Set Out Point" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "X" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Clear In/Out Points" })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Zoom" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "+" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom in" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "-" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Zoom out" })] }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)("div", { style: left, children: (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "0" }) }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Reset zoom" })] }), ' ', (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("div", { style: title, children: "Props Editor" }), (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("kbd", { style: key, children: ShortcutHint_1.cmdOrCtrlCharacter }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.3 }), (0, jsx_runtime_1.jsx)("kbd", { style: key, children: "S" })] }), (0, jsx_runtime_1.jsx)("div", { style: right, children: "Save" })] })] })] })] }));
56
56
  };
57
57
  exports.KeyboardShortcutsExplainer = KeyboardShortcutsExplainer;
@@ -17,4 +17,6 @@ export declare const DataEditor: React.FC<{
17
17
  setInputProps: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
18
18
  mayShowSaveButton: boolean;
19
19
  propsEditType: PropsEditType;
20
+ saving: boolean;
21
+ setSaving: React.Dispatch<React.SetStateAction<boolean>>;
20
22
  }>;
@@ -87,9 +87,8 @@ const getPersistedShowWarningState = () => {
87
87
  const setPersistedShowWarningState = (val) => {
88
88
  localStorage.setItem(persistanceKey, String(Boolean(val)));
89
89
  };
90
- const DataEditor = ({ unresolvedComposition, inputProps, setInputProps, mayShowSaveButton, propsEditType, }) => {
90
+ const DataEditor = ({ unresolvedComposition, inputProps, setInputProps, mayShowSaveButton, propsEditType, saving, setSaving, }) => {
91
91
  const [mode, setMode] = (0, react_1.useState)('schema');
92
- const [saving, setSaving] = (0, react_1.useState)(false);
93
92
  const [showWarning, setShowWarningWithoutPersistance] = (0, react_1.useState)(() => getPersistedShowWarningState());
94
93
  const inJSONEditor = mode === 'json';
95
94
  const serializedJSON = (0, react_1.useMemo)(() => {
@@ -221,7 +220,7 @@ const DataEditor = ({ unresolvedComposition, inputProps, setInputProps, mayShowS
221
220
  }, [unresolvedComposition.id, inputProps, schema, z]);
222
221
  (0, react_1.useEffect)(() => {
223
222
  setSaving(false);
224
- }, [fastRefreshes]);
223
+ }, [fastRefreshes, setSaving]);
225
224
  const onSave = (0, react_1.useCallback)((updater) => {
226
225
  var _a;
227
226
  if (schema === 'no-zod' || schema === 'no-schema' || z === null) {
@@ -240,7 +239,13 @@ const DataEditor = ({ unresolvedComposition, inputProps, setInputProps, mayShowS
240
239
  (0, NotificationCenter_1.sendErrorNotification)(`Cannot update default props: ${err.message}`);
241
240
  setSaving(false);
242
241
  });
243
- }, [unresolvedComposition.defaultProps, unresolvedComposition.id, schema, z]);
242
+ }, [
243
+ schema,
244
+ z,
245
+ setSaving,
246
+ unresolvedComposition.id,
247
+ unresolvedComposition.defaultProps,
248
+ ]);
244
249
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
245
250
  const warnings = (0, react_1.useMemo)(() => {
246
251
  return (0, get_render_modal_warnings_1.getRenderModalWarnings)({
@@ -118,6 +118,7 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
118
118
  const isMounted = (0, react_1.useRef)(true);
119
119
  const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
120
120
  const [unclampedFrame, setFrame] = (0, react_1.useState)(() => initialFrame);
121
+ const [saving, setSaving] = (0, react_1.useState)(false);
121
122
  const [stillImageFormat, setStillImageFormat] = (0, react_1.useState)(() => initialStillImageFormat);
122
123
  const [videoImageFormat, setVideoImageFormat] = (0, react_1.useState)(() => initialVideoImageFormat);
123
124
  const [concurrency, setConcurrency] = (0, react_1.useState)(() => initialConcurrency);
@@ -584,7 +585,7 @@ const RenderModal = ({ initialFrame, initialVideoImageFormat, initialStillImageF
584
585
  return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsx)(ModalHeader_1.NewCompHeader, { title: `Render ${resolvedComposition.id}` }), (0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: renderTabOptions, needsWrapping: false }), (0, jsx_runtime_1.jsx)("div", { style: flexer }), (0, jsx_runtime_1.jsxs)(Button_1.Button, { autoFocus: true, onClick: trigger, disabled: renderDisabled, style: {
585
586
  ...buttonStyle,
586
587
  backgroundColor: outnameValidation.valid ? colors_1.BLUE : colors_1.BLUE_DISABLED,
587
- }, children: [state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...', (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftSidebar, children: [shownTabs.includes('general') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: icon }) }), "General"] })) : null, shownTabs.includes('data') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: icon }) }), "Input Props"] })) : null, shownTabs.includes('picture') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: icon }) }), "Picture"] })) : null, shownTabs.includes('audio') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(audio_1.AudioIcon, { style: icon }) }), "Audio"] })) : null, shownTabs.includes('gif') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'gif', onClick: () => setTab('gif'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gif_1.GifIcon, { style: icon }) }), "GIF"] })) : null, shownTabs.includes('advanced') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gear_1.GearIcon, { style: icon }) }), "Other"] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: rightPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? ((0, jsx_runtime_1.jsx)(RenderModalBasic_1.RenderModalBasic, { codec: codec, resolvedComposition: resolvedComposition, frame: frame, imageFormatOptions: imageFormatOptions, outName: outName, proResProfile: proResProfile, renderMode: renderMode, setVideoCodec: setCodec, setFrame: setFrame, setOutName: setOutName, setProResProfile: setProResProfile, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message })) : tab === 'picture' ? ((0, jsx_runtime_1.jsx)(RenderModalPicture_1.RenderModalPicture, { renderMode: renderMode, scale: scale, setScale: setScale, pixelFormat: pixelFormat, setPixelFormat: setPixelFormat, imageFormatOptions: imageFormatOptions, crf: crf, setCrf: setCrf, customTargetVideoBitrate: customTargetVideoBitrate, maxCrf: maxCrf, minCrf: minCrf, jpegQuality: jpegQuality, qualityControlType: qualityControlType, setJpegQuality: setJpegQuality, setCustomTargetVideoBitrateValue: setCustomTargetVideoBitrateValue, setQualityControl: setQualityControl, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat, shouldDisplayQualityControlPicker: supportsBothQualityControls })) : tab === 'audio' ? ((0, jsx_runtime_1.jsx)(RenderModalAudio_1.RenderModalAudio, { muted: muted, renderMode: renderMode, setMuted: setMuted, codec: codec, audioCodec: audioCodec, setAudioCodec: setAudioCodec, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrackState: setEnforceAudioTrackState, customTargetAudioBitrate: customTargetAudioBitrate, setCustomTargetAudioBitrateValue: setCustomTargetAudioBitrateValue, setShouldHaveCustomTargetAudioBitrate: setShouldHaveCustomTargetAudioBitrate, shouldHaveCustomTargetAudioBitrate: shouldHaveCustomTargetAudioBitrate })) : tab === 'gif' ? ((0, jsx_runtime_1.jsx)(RenderModalGif_1.RenderModalGif, { everyNthFrame: everyNthFrame, limitNumberOfGifLoops: limitNumberOfGifLoops, numberOfGifLoopsSetting: numberOfGifLoopsSetting, setEveryNthFrameSetting: setEveryNthFrameSetting, setLimitNumberOfGifLoops: setLimitNumberOfGifLoops, setNumberOfGifLoopsSetting: setNumberOfGifLoopsSetting })) : tab === 'data' ? ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { inputProps: inputProps, setInputProps: setInputProps, unresolvedComposition: unresolvedComposition, mayShowSaveButton: false, propsEditType: "input-props" })) : ((0, jsx_runtime_1.jsx)(RenderModalAdvanced_1.RenderModalAdvanced, { concurrency: concurrency, maxConcurrency: maxConcurrency, minConcurrency: minConcurrency, renderMode: renderMode, setConcurrency: setConcurrency, setVerboseLogging: setVerboseLogging, verbose: verbose, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, disallowParallelEncoding: disallowParallelEncoding, setDisallowParallelEncoding: setDisallowParallelEncoding, setDisableWebSecurity: setDisableWebSecurity, setIgnoreCertificateErrors: setIgnoreCertificateErrors, setHeadless: setHeadless, headless: headless, ignoreCertificateErrors: ignoreCertificateErrors, disableWebSecurity: disableWebSecurity, openGlOption: openGlOption, setOpenGlOption: setOpenGlOption, setEnvVariables: setEnvVariables, envVariables: envVariables })) })] })] }));
588
+ }, children: [state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...', (0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "\u21B5", cmdOrCtrl: true })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: horizontalLayout, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftSidebar, children: [shownTabs.includes('general') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'general', onClick: () => setTab('general'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(file_1.FileIcon, { style: icon }) }), "General"] })) : null, shownTabs.includes('data') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'data', onClick: () => setTab('data'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(data_1.DataIcon, { style: icon }) }), "Input Props"] })) : null, shownTabs.includes('picture') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'picture', onClick: () => setTab('picture'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(frame_1.PicIcon, { style: icon }) }), "Picture"] })) : null, shownTabs.includes('audio') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'audio', onClick: () => setTab('audio'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(audio_1.AudioIcon, { style: icon }) }), "Audio"] })) : null, shownTabs.includes('gif') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'gif', onClick: () => setTab('gif'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gif_1.GifIcon, { style: icon }) }), "GIF"] })) : null, shownTabs.includes('advanced') ? ((0, jsx_runtime_1.jsxs)(vertical_1.VerticalTab, { style: horizontalTab, selected: tab === 'advanced', onClick: () => setTab('advanced'), children: [(0, jsx_runtime_1.jsx)("div", { style: iconContainer, children: (0, jsx_runtime_1.jsx)(gear_1.GearIcon, { style: icon }) }), "Other"] })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: rightPanel, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: tab === 'general' ? ((0, jsx_runtime_1.jsx)(RenderModalBasic_1.RenderModalBasic, { codec: codec, resolvedComposition: resolvedComposition, frame: frame, imageFormatOptions: imageFormatOptions, outName: outName, proResProfile: proResProfile, renderMode: renderMode, setVideoCodec: setCodec, setFrame: setFrame, setOutName: setOutName, setProResProfile: setProResProfile, endFrame: endFrame, setEndFrame: setEndFrame, setStartFrame: setStartFrame, startFrame: startFrame, validationMessage: outnameValidation.valid ? null : outnameValidation.error.message })) : tab === 'picture' ? ((0, jsx_runtime_1.jsx)(RenderModalPicture_1.RenderModalPicture, { renderMode: renderMode, scale: scale, setScale: setScale, pixelFormat: pixelFormat, setPixelFormat: setPixelFormat, imageFormatOptions: imageFormatOptions, crf: crf, setCrf: setCrf, customTargetVideoBitrate: customTargetVideoBitrate, maxCrf: maxCrf, minCrf: minCrf, jpegQuality: jpegQuality, qualityControlType: qualityControlType, setJpegQuality: setJpegQuality, setCustomTargetVideoBitrateValue: setCustomTargetVideoBitrateValue, setQualityControl: setQualityControl, videoImageFormat: videoImageFormat, stillImageFormat: stillImageFormat, shouldDisplayQualityControlPicker: supportsBothQualityControls })) : tab === 'audio' ? ((0, jsx_runtime_1.jsx)(RenderModalAudio_1.RenderModalAudio, { muted: muted, renderMode: renderMode, setMuted: setMuted, codec: codec, audioCodec: audioCodec, setAudioCodec: setAudioCodec, enforceAudioTrack: enforceAudioTrack, setEnforceAudioTrackState: setEnforceAudioTrackState, customTargetAudioBitrate: customTargetAudioBitrate, setCustomTargetAudioBitrateValue: setCustomTargetAudioBitrateValue, setShouldHaveCustomTargetAudioBitrate: setShouldHaveCustomTargetAudioBitrate, shouldHaveCustomTargetAudioBitrate: shouldHaveCustomTargetAudioBitrate })) : tab === 'gif' ? ((0, jsx_runtime_1.jsx)(RenderModalGif_1.RenderModalGif, { everyNthFrame: everyNthFrame, limitNumberOfGifLoops: limitNumberOfGifLoops, numberOfGifLoopsSetting: numberOfGifLoopsSetting, setEveryNthFrameSetting: setEveryNthFrameSetting, setLimitNumberOfGifLoops: setLimitNumberOfGifLoops, setNumberOfGifLoopsSetting: setNumberOfGifLoopsSetting })) : tab === 'data' ? ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { inputProps: inputProps, setInputProps: setInputProps, unresolvedComposition: unresolvedComposition, mayShowSaveButton: false, propsEditType: "input-props", saving: saving, setSaving: setSaving })) : ((0, jsx_runtime_1.jsx)(RenderModalAdvanced_1.RenderModalAdvanced, { concurrency: concurrency, maxConcurrency: maxConcurrency, minConcurrency: minConcurrency, renderMode: renderMode, setConcurrency: setConcurrency, setVerboseLogging: setVerboseLogging, verbose: verbose, delayRenderTimeout: delayRenderTimeout, setDelayRenderTimeout: setDelayRenderTimeout, disallowParallelEncoding: disallowParallelEncoding, setDisallowParallelEncoding: setDisallowParallelEncoding, setDisableWebSecurity: setDisableWebSecurity, setIgnoreCertificateErrors: setIgnoreCertificateErrors, setHeadless: setHeadless, headless: headless, ignoreCertificateErrors: ignoreCertificateErrors, disableWebSecurity: disableWebSecurity, openGlOption: openGlOption, setOpenGlOption: setOpenGlOption, setEnvVariables: setEnvVariables, envVariables: envVariables })) })] })] }));
588
589
  };
589
590
  const RenderModalWithLoader = (props) => {
590
591
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { AnyZodObject, z } from 'zod';
3
3
  export declare const SchemaEditor: React.FC<{
4
4
  schema: AnyZodObject;
5
- value: unknown;
5
+ value: Record<string, unknown>;
6
6
  setValue: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
7
7
  zodValidationResult: z.SafeParseReturnType<unknown, unknown>;
8
8
  defaultProps: Record<string, unknown>;
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchemaEditor = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const use_keybinding_1 = require("../../../helpers/use-keybinding");
6
7
  const get_zod_if_possible_1 = require("../../get-zod-if-possible");
7
8
  const is_menu_item_1 = require("../../Menu/is-menu-item");
9
+ const deep_equal_1 = require("./deep-equal");
8
10
  const SchemaErrorMessages_1 = require("./SchemaErrorMessages");
9
11
  const ZodObjectEditor_1 = require("./ZodObjectEditor");
10
12
  const scrollable = {
@@ -13,10 +15,34 @@ const scrollable = {
13
15
  overflowY: 'auto',
14
16
  };
15
17
  const SchemaEditor = ({ schema, value, setValue, zodValidationResult, defaultProps, onSave, showSaveButton, saving, saveDisabledByParent, }) => {
18
+ const keybindings = (0, use_keybinding_1.useKeybinding)();
16
19
  const z = (0, get_zod_if_possible_1.useZodIfPossible)();
17
20
  if (!z) {
18
21
  throw new Error('expected zod');
19
22
  }
23
+ const hasChanged = (0, react_1.useMemo)(() => {
24
+ return !(0, deep_equal_1.deepEqual)(defaultProps, value);
25
+ }, [defaultProps, value]);
26
+ const onQuickSave = (0, react_1.useCallback)(() => {
27
+ if (hasChanged && showSaveButton) {
28
+ onSave(() => {
29
+ return value;
30
+ });
31
+ }
32
+ }, [hasChanged, onSave, showSaveButton, value]);
33
+ (0, react_1.useEffect)(() => {
34
+ const save = keybindings.registerKeybinding({
35
+ event: 'keydown',
36
+ key: 's',
37
+ commandCtrlKey: true,
38
+ callback: onQuickSave,
39
+ preventDefault: true,
40
+ triggerIfInputFieldFocused: true,
41
+ });
42
+ return () => {
43
+ save.unregister();
44
+ };
45
+ }, [keybindings, onQuickSave, onSave]);
20
46
  const def = schema._def;
21
47
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
48
  const typeName = def.typeName;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchemaSaveButton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const colors_1 = require("../../../helpers/colors");
6
7
  const InlineAction_1 = require("../../InlineAction");
7
8
  const icon = {
8
9
  height: 14,
@@ -10,7 +11,7 @@ const icon = {
10
11
  };
11
12
  const SchemaSaveButton = ({ onClick, disabled }) => {
12
13
  const renderAction = (0, react_1.useCallback)((color) => {
13
- return ((0, jsx_runtime_1.jsx)("svg", { style: icon, viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { fill: disabled ? 'grey' : color, d: "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V173.3c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32H64zm0 96c0-17.7 14.3-32 32-32H288c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V128zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z" }) }));
14
+ return ((0, jsx_runtime_1.jsx)("svg", { style: icon, viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { fill: disabled ? colors_1.LIGHT_TEXT : color, d: "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V173.3c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32H64zm0 96c0-17.7 14.3-32 32-32H288c17.7 0 32 14.3 32 32v64c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V128zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z" }) }));
14
15
  }, [disabled]);
15
16
  return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick, disabled: disabled }));
16
17
  };
@@ -4,8 +4,10 @@ exports.RightPanel = exports.rightSidebarTabs = exports.persistSelectedPanel = v
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
+ const ShortcutHint_1 = require("../../preview-server/error-overlay/remotion-overlay/ShortcutHint");
7
8
  const colors_1 = require("../helpers/colors");
8
9
  const DataEditor_1 = require("./RenderModal/DataEditor");
10
+ const deep_equal_1 = require("./RenderModal/SchemaEditor/deep-equal");
9
11
  const RenderQueue_1 = require("./RenderQueue");
10
12
  const RendersTab_1 = require("./RendersTab");
11
13
  const Tabs_1 = require("./Tabs");
@@ -16,17 +18,10 @@ const container = {
16
18
  display: 'flex',
17
19
  flexDirection: 'column',
18
20
  };
19
- const PropsEditor = ({ composition }) => {
20
- const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
21
- const setInputProps = (0, react_1.useCallback)((newProps) => {
22
- updateProps({
23
- id: composition.id,
24
- defaultProps: composition.defaultProps,
25
- newProps,
26
- });
27
- }, [composition.defaultProps, composition.id, updateProps]);
28
- const actualProps = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {}; }, [composition.defaultProps, composition.id, props]);
29
- return ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props" }, composition.id));
21
+ const circle = {
22
+ width: 8,
23
+ height: 8,
24
+ borderRadius: 4,
30
25
  };
31
26
  const localStorageKey = 'remotion.sidebarPanel';
32
27
  const getSelectedPanel = () => {
@@ -45,6 +40,8 @@ const persistSelectedPanel = (panel) => {
45
40
  exports.persistSelectedPanel = persistSelectedPanel;
46
41
  exports.rightSidebarTabs = (0, react_1.createRef)();
47
42
  const RightPanel = () => {
43
+ const { props, updateProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
44
+ const [saving, setSaving] = (0, react_1.useState)(false);
48
45
  const [panel, setPanel] = (0, react_1.useState)(() => getSelectedPanel());
49
46
  const onCompositionsSelected = (0, react_1.useCallback)(() => {
50
47
  setPanel('input-props');
@@ -63,6 +60,14 @@ const RightPanel = () => {
63
60
  };
64
61
  }, []);
65
62
  const { compositions, currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
63
+ const circleStyle = (0, react_1.useMemo)(() => {
64
+ const onTabColor = saving ? colors_1.LIGHT_TEXT : 'white';
65
+ return {
66
+ ...circle,
67
+ backgroundColor: panel === 'input-props' ? onTabColor : colors_1.LIGHT_TEXT,
68
+ cursor: 'help',
69
+ };
70
+ }, [panel, saving]);
66
71
  const composition = (0, react_1.useMemo)(() => {
67
72
  for (const comp of compositions) {
68
73
  if (comp.id === currentComposition) {
@@ -71,9 +76,37 @@ const RightPanel = () => {
71
76
  }
72
77
  return null;
73
78
  }, [compositions, currentComposition]);
79
+ const saveToolTip = (0, react_1.useMemo)(() => {
80
+ return process.env.KEYBOARD_SHORTCUTS_ENABLED
81
+ ? `Save using ${ShortcutHint_1.cmdOrCtrlCharacter}+S`
82
+ : 'There are unsaved changes';
83
+ }, []);
84
+ const setInputProps = (0, react_1.useCallback)((newProps) => {
85
+ if (composition === null) {
86
+ return;
87
+ }
88
+ updateProps({
89
+ id: composition.id,
90
+ defaultProps: composition.defaultProps,
91
+ newProps,
92
+ });
93
+ }, [composition, updateProps]);
94
+ const actualProps = (0, react_1.useMemo)(() => {
95
+ var _a, _b;
96
+ if (composition === null) {
97
+ return {};
98
+ }
99
+ return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {};
100
+ }, [composition, props]);
101
+ const unsavedChangesExist = (0, react_1.useMemo)(() => {
102
+ if (composition === null || composition.defaultProps === undefined) {
103
+ return false;
104
+ }
105
+ return !(0, deep_equal_1.deepEqual)(composition.defaultProps, actualProps);
106
+ }, [actualProps, composition]);
74
107
  if (composition === null) {
75
108
  return null;
76
109
  }
77
- return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: panel === 'input-props', onClick: onCompositionsSelected, children: "Props" }), (0, jsx_runtime_1.jsx)(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })] }) }), panel === 'renders' ? ((0, jsx_runtime_1.jsx)(RenderQueue_1.RenderQueue, {})) : ((0, jsx_runtime_1.jsx)(PropsEditor, { composition: composition }))] }));
110
+ return ((0, jsx_runtime_1.jsxs)("div", { style: container, className: "css-reset", children: [(0, jsx_runtime_1.jsx)("div", { style: tabsContainer, children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { children: [(0, jsx_runtime_1.jsxs)(Tabs_1.Tab, { selected: panel === 'input-props', onClick: onCompositionsSelected, style: { justifyContent: 'space-between' }, children: ["Props", unsavedChangesExist ? ((0, jsx_runtime_1.jsx)("div", { title: saveToolTip, style: circleStyle })) : null] }), (0, jsx_runtime_1.jsx)(RendersTab_1.RendersTab, { onClick: onRendersSelected, selected: panel === 'renders' })] }) }), panel === 'renders' ? ((0, jsx_runtime_1.jsx)(RenderQueue_1.RenderQueue, {})) : ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props", saving: saving, setSaving: setSaving }, composition.id))] }));
78
111
  };
79
112
  exports.RightPanel = RightPanel;
@@ -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)" | "rgba(255, 255, 255, 0.06)" | "hsla(0, 0%, 100%, 0.25)";
19
+ }) => "transparent" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)" | "rgba(255, 255, 255, 0.06)";
@@ -13,7 +13,6 @@ const button = {
13
13
  fontSize: 14,
14
14
  color: 'white',
15
15
  flexDirection: 'row',
16
- display: 'flex',
17
16
  };
18
17
  const ButtonRefForwardFunction = ({ children, onClick, title, disabled, style, id, autoFocus, buttonContainerStyle, }, ref) => {
19
18
  const combined = (0, react_1.useMemo)(() => {
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateDefaultPropsHandler = void 0;
4
4
  const node_fs_1 = require("node:fs");
5
- const remotion_1 = require("remotion");
6
5
  const update_default_props_1 = require("../../codemods/update-default-props");
7
6
  const project_info_1 = require("../project-info");
8
7
  const can_update_default_props_1 = require("./can-update-default-props");
@@ -16,7 +15,7 @@ const updateDefaultPropsHandler = async ({ input: { compositionId, defaultProps,
16
15
  const updated = await (0, update_default_props_1.updateDefaultProps)({
17
16
  compositionId,
18
17
  input: (0, node_fs_1.readFileSync)(projectInfo.videoFile, 'utf-8'),
19
- newDefaultProps: remotion_1.Internals.deserializeJSONWithCustomFields(defaultProps),
18
+ newDefaultProps: JSON.parse(defaultProps),
20
19
  enumPaths,
21
20
  });
22
21
  (0, node_fs_1.writeFileSync)(projectInfo.videoFile, updated);
@@ -278,7 +278,7 @@ const renderVideoFlow = async ({ remotionRoot, fullEntryPoint, indent, logLevel,
278
278
  proResProfile,
279
279
  jpegQuality: jpegQuality !== null && jpegQuality !== void 0 ? jpegQuality : renderer_1.RenderInternals.DEFAULT_JPEG_QUALITY,
280
280
  chromiumOptions,
281
- timeoutInMilliseconds: config_1.ConfigInternals.getCurrentPuppeteerTimeout(),
281
+ timeoutInMilliseconds: puppeteerTimeout,
282
282
  scale,
283
283
  port,
284
284
  numberOfGifLoops,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "4.0.10",
3
+ "version": "4.0.11",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -35,11 +35,11 @@
35
35
  "prompts": "2.4.1",
36
36
  "semver": "7.5.3",
37
37
  "source-map": "0.6.1",
38
- "@remotion/bundler": "4.0.10",
39
- "@remotion/media-utils": "4.0.10",
40
- "@remotion/player": "4.0.10",
41
- "remotion": "4.0.10",
42
- "@remotion/renderer": "4.0.10"
38
+ "@remotion/bundler": "4.0.11",
39
+ "@remotion/player": "4.0.11",
40
+ "@remotion/media-utils": "4.0.11",
41
+ "remotion": "4.0.11",
42
+ "@remotion/renderer": "4.0.11"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=16.8.0",
@@ -65,8 +65,8 @@
65
65
  "typescript": "4.9.5",
66
66
  "vitest": "0.31.1",
67
67
  "zod": "^3.21.4",
68
- "@remotion/zod-types": "4.0.10",
69
- "@remotion/tailwind": "4.0.10"
68
+ "@remotion/tailwind": "4.0.11",
69
+ "@remotion/zod-types": "4.0.11"
70
70
  },
71
71
  "keywords": [
72
72
  "remotion",
@@ -1 +0,0 @@
1
- export declare const cloudrunCommand: (remotionRoot: string, args: string[]) => Promise<never>;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cloudrunCommand = void 0;
4
- const log_1 = require("./log");
5
- const get_package_manager_1 = require("./preview-server/get-package-manager");
6
- const update_available_1 = require("./preview-server/update-available");
7
- const cloudrunCommand = async (remotionRoot, args) => {
8
- try {
9
- const path = require.resolve('@remotion/cloudrun', {
10
- paths: [remotionRoot],
11
- });
12
- const { CloudrunInternals } = require(path);
13
- await CloudrunInternals.executeCommand(args, remotionRoot);
14
- process.exit(0);
15
- }
16
- catch (err) {
17
- const manager = (0, get_package_manager_1.getPackageManager)(remotionRoot, undefined);
18
- const installCommand = manager === 'unknown' ? 'npm i' : manager.installCommand;
19
- log_1.Log.error(err);
20
- log_1.Log.error('Remotion CloudRun is not installed.');
21
- log_1.Log.info('');
22
- log_1.Log.info('You can install it using:');
23
- log_1.Log.info(`${installCommand} @remotion/cloudrun@${(0, update_available_1.getRemotionVersion)()}`);
24
- process.exit(1);
25
- }
26
- };
27
- exports.cloudrunCommand = cloudrunCommand;
@@ -1,14 +0,0 @@
1
- export type SerializedJSONWithCustomFields = {
2
- serializedString: string;
3
- customDateUsed: boolean;
4
- customFileUsed: boolean;
5
- mapUsed: boolean;
6
- setUsed: boolean;
7
- };
8
- export declare const FILE_TOKEN = "remotion-file:";
9
- export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
10
- data: unknown;
11
- indent: number | undefined;
12
- staticBase: string;
13
- }) => SerializedJSONWithCustomFields;
14
- export declare const deserializeJSONWithCustomFields: (data: string) => any;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeJSONWithCustomFields = exports.serializeJSONWithDate = exports.FILE_TOKEN = void 0;
4
- const DATE_TOKEN = 'remotion-date:';
5
- exports.FILE_TOKEN = 'remotion-file:';
6
- const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
7
- let customDateUsed = false;
8
- let customFileUsed = false;
9
- let mapUsed = false;
10
- let setUsed = false;
11
- const serializedString = JSON.stringify(data, function (key, value) {
12
- const item = this[key];
13
- if (item instanceof Date) {
14
- customDateUsed = true;
15
- return `${DATE_TOKEN}${item.toISOString()}`;
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
- }
25
- if (typeof item === 'string' && item.startsWith(staticBase)) {
26
- customFileUsed = true;
27
- return `${exports.FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
28
- }
29
- return value;
30
- }, indent);
31
- return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
32
- };
33
- exports.serializeJSONWithDate = serializeJSONWithDate;
34
- const deserializeJSONWithCustomFields = (data) => {
35
- return JSON.parse(data, (_, value) => {
36
- if (typeof value === 'string' && value.startsWith(DATE_TOKEN)) {
37
- return new Date(value.replace(DATE_TOKEN, ''));
38
- }
39
- return value;
40
- });
41
- };
42
- exports.deserializeJSONWithCustomFields = deserializeJSONWithCustomFields;
@@ -1,19 +0,0 @@
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;
@@ -1,81 +0,0 @@
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,20 +0,0 @@
1
- import type { Page } from '../browser/BrowserPage';
2
- import type { SymbolicatedStackFrame } from '../symbolicate-stacktrace';
3
- export declare class ErrorWithStackFrame extends Error {
4
- symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
5
- frame: number | null;
6
- name: string;
7
- delayRenderCall: SymbolicatedStackFrame[] | null;
8
- constructor({ message, symbolicatedStackFrames, frame, name, delayRenderCall, }: {
9
- message: string;
10
- symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
11
- frame: number | null;
12
- name: string;
13
- delayRenderCall: SymbolicatedStackFrame[] | null;
14
- });
15
- }
16
- export declare const handleJavascriptException: ({ page, onError, frame, }: {
17
- page: Page;
18
- frame: number | null;
19
- onError: (err: Error) => void;
20
- }) => () => void;
@@ -1,81 +0,0 @@
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 symbolicateable_error_1 = require("./symbolicateable-error");
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 symbolicateable_error_1.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,3 +0,0 @@
1
- import { ErrorWithStackFrame } from './handle-javascript-exception';
2
- import type { SymbolicateableError } from './symbolicateable-error';
3
- export declare const symbolicateError: (symbolicateableError: SymbolicateableError) => Promise<ErrorWithStackFrame>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.symbolicateError = void 0;
4
- const symbolicate_stacktrace_1 = require("../symbolicate-stacktrace");
5
- const handle_javascript_exception_1 = require("./handle-javascript-exception");
6
- const truthy_1 = require("./truthy");
7
- const symbolicateError = async (symbolicateableError) => {
8
- const { delayRenderCall, stackFrame } = symbolicateableError;
9
- const [mainErrorFrames, delayRenderFrames] = await Promise.all([
10
- stackFrame ? (0, symbolicate_stacktrace_1.symbolicateStackTraceFromRemoteFrames)(stackFrame) : null,
11
- delayRenderCall
12
- ? (0, symbolicate_stacktrace_1.symbolicateStackTraceFromRemoteFrames)(delayRenderCall)
13
- : null,
14
- ].filter(truthy_1.truthy));
15
- const symbolicatedErr = new handle_javascript_exception_1.ErrorWithStackFrame({
16
- message: symbolicateableError.message,
17
- symbolicatedStackFrames: mainErrorFrames,
18
- frame: symbolicateableError.frame,
19
- name: symbolicateableError.name,
20
- delayRenderCall: delayRenderFrames,
21
- });
22
- return symbolicatedErr;
23
- };
24
- exports.symbolicateError = symbolicateError;
@@ -1,7 +0,0 @@
1
- import type { SymbolicatedStackFrame, UnsymbolicatedStackFrame } from '@remotion/renderer';
2
- import type { SourceMapConsumer } from 'source-map';
3
- import { ErrorWithStackFrame } from './error-with-stack-frame';
4
- export declare const symbolicateError: (symbolicateableError: SymbolicateableError) => Promise<ErrorWithStackFrame>;
5
- export declare const symbolicateStackTraceFromRemoteFrames: (frames: UnsymbolicatedStackFrame[]) => Promise<SymbolicatedStackFrame[]>;
6
- export declare const getSourceMapFromRemoteFile: (fileName: string) => Promise<any>;
7
- export declare const symbolicateFromSources: (frames: UnsymbolicatedStackFrame[], mapValues: Record<string, SourceMapConsumer | null>) => SymbolicatedStackFrame[];
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.symbolicateFromSources = exports.getSourceMapFromRemoteFile = exports.symbolicateStackTraceFromRemoteFrames = exports.symbolicateError = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- const truthy_1 = require("./truthy");
6
- const error_with_stack_frame_1 = require("./error-with-stack-frame");
7
- const symbolicateError = async (symbolicateableError) => {
8
- const { delayRenderCall, stackFrame } = symbolicateableError;
9
- const [mainErrorFrames, delayRenderFrames] = await Promise.all([
10
- stackFrame ? (0, exports.symbolicateStackTraceFromRemoteFrames)(stackFrame) : null,
11
- delayRenderCall
12
- ? (0, exports.symbolicateStackTraceFromRemoteFrames)(delayRenderCall)
13
- : null,
14
- ].filter(truthy_1.truthy));
15
- const symbolicatedErr = new error_with_stack_frame_1.ErrorWithStackFrame({
16
- message: symbolicateableError.message,
17
- symbolicatedStackFrames: mainErrorFrames,
18
- frame: symbolicateableError.frame,
19
- name: symbolicateableError.name,
20
- delayRenderCall: delayRenderFrames,
21
- });
22
- return symbolicatedErr;
23
- };
24
- exports.symbolicateError = symbolicateError;
25
- const symbolicateStackTraceFromRemoteFrames = async (frames) => {
26
- const uniqueFileNames = [
27
- ...new Set(frames
28
- .map((f) => f.fileName)
29
- .filter((f) => f.startsWith('http://') || f.startsWith('https://'))
30
- .filter(truthy_1.truthy)),
31
- ];
32
- const maps = await Promise.all(uniqueFileNames.map((fileName) => {
33
- return (0, exports.getSourceMapFromRemoteFile)(fileName);
34
- }));
35
- const mapValues = {};
36
- for (let i = 0; i < uniqueFileNames.length; i++) {
37
- mapValues[uniqueFileNames[i]] = maps[i];
38
- }
39
- return (0, exports.symbolicateFromSources)(frames, mapValues);
40
- };
41
- exports.symbolicateStackTraceFromRemoteFrames = symbolicateStackTraceFromRemoteFrames;
42
- const getSourceMapFromRemoteFile = async (fileName) => {
43
- const fileContents = await renderer_1.RenderInternals.fetchUrl(fileName);
44
- return renderer_1.RenderInternals.getSourceMap(fileName, fileContents, 'remote');
45
- };
46
- exports.getSourceMapFromRemoteFile = getSourceMapFromRemoteFile;
47
- const symbolicateFromSources = (frames, mapValues) => {
48
- return frames
49
- .map((frame) => {
50
- const map = mapValues[frame.fileName];
51
- if (!map) {
52
- return null;
53
- }
54
- return symbolicateStackFrame(frame, map);
55
- })
56
- .filter(truthy_1.truthy);
57
- };
58
- exports.symbolicateFromSources = symbolicateFromSources;
59
- const symbolicateStackFrame = (frame, map) => {
60
- const pos = getOriginalPosition(map, frame.lineNumber, frame.columnNumber);
61
- const hasSource = pos.source ? map.sourceContentFor(pos.source, false) : null;
62
- const scriptCode = hasSource && pos.line
63
- ? getLinesAround(pos.line, 3, hasSource.split('\n'))
64
- : null;
65
- return {
66
- originalColumnNumber: pos.column,
67
- originalFileName: pos.source,
68
- originalFunctionName: frame.functionName,
69
- originalLineNumber: pos.line,
70
- originalScriptCode: scriptCode,
71
- };
72
- };
73
- const getOriginalPosition = (source_map, line, column) => {
74
- const result = source_map.originalPositionFor({
75
- line,
76
- column,
77
- });
78
- return { line: result.line, column: result.column, source: result.source };
79
- };
80
- function getLinesAround(line, count, lines) {
81
- const result = [];
82
- for (let index = Math.max(0, line - 1 - count) + 1; index <= Math.min(lines.length - 1, line - 1 + count); ++index) {
83
- result.push({
84
- lineNumber: index + 1,
85
- content: lines[index],
86
- highlight: index + 1 === line,
87
- });
88
- }
89
- return result;
90
- }
@@ -1,28 +0,0 @@
1
- import type { BasicSourceMapConsumer, IndexedSourceMapConsumer } from 'source-map';
2
- import { SourceMapConsumer } from 'source-map';
3
- import type { UnsymbolicatedStackFrame } from './parse-browser-error-stack';
4
- type ScriptLine = {
5
- lineNumber: number;
6
- content: string;
7
- highlight: boolean;
8
- };
9
- export type SymbolicatedStackFrame = {
10
- originalFunctionName: string | null;
11
- originalFileName: string | null;
12
- originalLineNumber: number | null;
13
- originalColumnNumber: number | null;
14
- originalScriptCode: ScriptLine[] | null;
15
- };
16
- export declare const symbolicateStackTraceFromRemoteFrames: (frames: UnsymbolicatedStackFrame[]) => Promise<SymbolicatedStackFrame[]>;
17
- export declare const symbolicateFromSources: (frames: UnsymbolicatedStackFrame[], mapValues: Record<string, SourceMapConsumer | null>) => SymbolicatedStackFrame[];
18
- export declare const symbolicateStackFrame: (frame: UnsymbolicatedStackFrame, map: SourceMapConsumer) => {
19
- originalColumnNumber: number | null;
20
- originalFileName: string | null;
21
- originalFunctionName: any;
22
- originalLineNumber: number | null;
23
- originalScriptCode: ScriptLine[] | null;
24
- };
25
- export declare const getSourceMapFromRemoteFile: (fileName: string) => Promise<SourceMapConsumer | null>;
26
- export declare const getSourceMapFromLocalFile: (fileName: string) => Promise<SourceMapConsumer | null>;
27
- export type AnySourceMapConsumer = BasicSourceMapConsumer | IndexedSourceMapConsumer;
28
- export {};
@@ -1,135 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getSourceMapFromLocalFile = exports.getSourceMapFromRemoteFile = exports.symbolicateStackFrame = exports.symbolicateFromSources = exports.symbolicateStackTraceFromRemoteFrames = void 0;
7
- const fs_1 = require("fs");
8
- const path_1 = __importDefault(require("path"));
9
- const source_map_1 = require("source-map");
10
- const read_file_1 = require("./assets/read-file");
11
- const truthy_1 = require("./truthy");
12
- function extractSourceMapUrl(fileContents) {
13
- const regex = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;
14
- let match = null;
15
- for (;;) {
16
- const next = regex.exec(fileContents);
17
- if (next === null || next === undefined) {
18
- break;
19
- }
20
- match = next;
21
- }
22
- if (!(match === null || match === void 0 ? void 0 : match[1])) {
23
- return null;
24
- }
25
- return match[1].toString();
26
- }
27
- const getSourceMap = async (filePath, fileContents, type) => {
28
- const sm = extractSourceMapUrl(fileContents);
29
- if (sm === null) {
30
- return null;
31
- }
32
- if (sm.indexOf('data:') === 0) {
33
- const base64 = /^data:application\/json;([\w=:"-]+;)*base64,/;
34
- const match2 = sm.match(base64);
35
- if (!match2) {
36
- throw new Error('Sorry, non-base64 inline source-map encoding is not supported.');
37
- }
38
- const converted = window.atob(sm.substring(match2[0].length));
39
- return new source_map_1.SourceMapConsumer(JSON.parse(converted));
40
- }
41
- if (type === 'local') {
42
- // Find adjacent file: bundle.js -> bundle.js.map
43
- const newFilePath = path_1.default.join(path_1.default.dirname(filePath), sm);
44
- return new source_map_1.SourceMapConsumer((0, fs_1.readFileSync)(newFilePath, 'utf8'));
45
- }
46
- const index = filePath.lastIndexOf('/');
47
- const url = filePath.substring(0, index + 1) + sm;
48
- const obj = await fetchUrl(url);
49
- return new source_map_1.SourceMapConsumer(obj);
50
- };
51
- const fetchUrl = async (url) => {
52
- const res = await (0, read_file_1.readFile)(url);
53
- return new Promise((resolve, reject) => {
54
- let downloaded = '';
55
- res.on('data', (d) => {
56
- downloaded += d;
57
- });
58
- res.on('end', () => {
59
- resolve(downloaded);
60
- });
61
- res.on('error', (err) => reject(err));
62
- });
63
- };
64
- function getLinesAround(line, count, lines) {
65
- const result = [];
66
- for (let index = Math.max(0, line - 1 - count) + 1; index <= Math.min(lines.length - 1, line - 1 + count); ++index) {
67
- result.push({
68
- lineNumber: index + 1,
69
- content: lines[index],
70
- highlight: index + 1 === line,
71
- });
72
- }
73
- return result;
74
- }
75
- const getOriginalPosition = (source_map, line, column) => {
76
- const result = source_map.originalPositionFor({
77
- line,
78
- column,
79
- });
80
- return { line: result.line, column: result.column, source: result.source };
81
- };
82
- const symbolicateStackTraceFromRemoteFrames = async (frames) => {
83
- const uniqueFileNames = [
84
- ...new Set(frames
85
- .map((f) => f.fileName)
86
- .filter((f) => f.startsWith('http://') || f.startsWith('https://'))
87
- .filter(truthy_1.truthy)),
88
- ];
89
- const maps = await Promise.all(uniqueFileNames.map((fileName) => {
90
- return (0, exports.getSourceMapFromRemoteFile)(fileName);
91
- }));
92
- const mapValues = {};
93
- for (let i = 0; i < uniqueFileNames.length; i++) {
94
- mapValues[uniqueFileNames[i]] = maps[i];
95
- }
96
- return (0, exports.symbolicateFromSources)(frames, mapValues);
97
- };
98
- exports.symbolicateStackTraceFromRemoteFrames = symbolicateStackTraceFromRemoteFrames;
99
- const symbolicateFromSources = (frames, mapValues) => {
100
- return frames
101
- .map((frame) => {
102
- const map = mapValues[frame.fileName];
103
- if (!map) {
104
- return null;
105
- }
106
- return (0, exports.symbolicateStackFrame)(frame, map);
107
- })
108
- .filter(truthy_1.truthy);
109
- };
110
- exports.symbolicateFromSources = symbolicateFromSources;
111
- const symbolicateStackFrame = (frame, map) => {
112
- const pos = getOriginalPosition(map, frame.lineNumber, frame.columnNumber);
113
- const hasSource = pos.source ? map.sourceContentFor(pos.source, false) : null;
114
- const scriptCode = hasSource && pos.line
115
- ? getLinesAround(pos.line, 3, hasSource.split('\n'))
116
- : null;
117
- return {
118
- originalColumnNumber: pos.column,
119
- originalFileName: pos.source,
120
- originalFunctionName: frame.functionName,
121
- originalLineNumber: pos.line,
122
- originalScriptCode: scriptCode,
123
- };
124
- };
125
- exports.symbolicateStackFrame = symbolicateStackFrame;
126
- const getSourceMapFromRemoteFile = async (fileName) => {
127
- const fileContents = await fetchUrl(fileName);
128
- return getSourceMap(fileName, fileContents, 'remote');
129
- };
130
- exports.getSourceMapFromRemoteFile = getSourceMapFromRemoteFile;
131
- const getSourceMapFromLocalFile = (fileName) => {
132
- const fileContents = (0, fs_1.readFileSync)(fileName, 'utf8');
133
- return getSourceMap(fileName, fileContents, 'local');
134
- };
135
- exports.getSourceMapFromLocalFile = getSourceMapFromLocalFile;
@@ -1,16 +0,0 @@
1
- /**
2
- * A symbolicateable error is an error that can be symolicated by fetching the original sources. By throwing a symbolicateable error, Remotion CLI will attempt to symplicate it
3
- */
4
- import type { UnsymbolicatedStackFrame } from '../parse-browser-error-stack';
5
- export declare class SymbolicateableError extends Error {
6
- stackFrame: UnsymbolicatedStackFrame[] | null;
7
- delayRenderCall: UnsymbolicatedStackFrame[] | null;
8
- frame: number | null;
9
- constructor({ message, stack, stackFrame, frame, name, }: {
10
- message: string;
11
- stack: string | undefined;
12
- frame: number | null;
13
- name: string;
14
- stackFrame: UnsymbolicatedStackFrame[] | null;
15
- });
16
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- /**
3
- * A symbolicateable error is an error that can be symolicated by fetching the original sources. By throwing a symbolicateable error, Remotion CLI will attempt to symplicate it
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SymbolicateableError = void 0;
7
- const delay_render_embedded_stack_1 = require("../delay-render-embedded-stack");
8
- class SymbolicateableError extends Error {
9
- constructor({ message, stack, stackFrame, frame, name, }) {
10
- super(message);
11
- this.stack = stack;
12
- this.stackFrame = stackFrame;
13
- this.frame = frame;
14
- this.name = name;
15
- this.delayRenderCall = stack ? (0, delay_render_embedded_stack_1.parseDelayRenderEmbeddedStack)(stack) : null;
16
- }
17
- }
18
- exports.SymbolicateableError = SymbolicateableError;