@remotion/cli 4.0.43 → 4.0.45

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 (81) hide show
  1. package/dist/config/index.d.ts +1 -1
  2. package/dist/config/log.d.ts +1 -1
  3. package/dist/editor/components/AssetSelector.js +19 -3
  4. package/dist/editor/components/AssetSelectorItem.d.ts +6 -4
  5. package/dist/editor/components/AssetSelectorItem.js +48 -23
  6. package/dist/editor/components/Canvas.d.ts +4 -1
  7. package/dist/editor/components/Canvas.js +54 -30
  8. package/dist/editor/components/CanvasOrLoading.js +9 -1
  9. package/dist/editor/components/CompositionSelector.js +8 -6
  10. package/dist/editor/components/CompositionSelectorItem.d.ts +1 -1
  11. package/dist/editor/components/CompositionSelectorItem.js +1 -7
  12. package/dist/editor/components/CurrentCompositionSideEffects.js +15 -4
  13. package/dist/editor/components/DownloadButton.d.ts +0 -0
  14. package/dist/editor/components/DownloadButton.js +1 -0
  15. package/dist/editor/components/EditorContent.js +6 -1
  16. package/dist/editor/components/ExplorerPanel.js +0 -13
  17. package/dist/editor/components/FilePreview.d.ts +9 -0
  18. package/dist/editor/components/FilePreview.js +40 -0
  19. package/dist/editor/components/FramePersistor.d.ts +0 -1
  20. package/dist/editor/components/FramePersistor.js +1 -5
  21. package/dist/editor/components/InitialCompositionLoader.js +68 -18
  22. package/dist/editor/components/LoopToggle.js +0 -5
  23. package/dist/editor/components/MuteToggle.js +0 -5
  24. package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
  25. package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +1 -1
  26. package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
  27. package/dist/editor/components/OptionsPanel.js +7 -7
  28. package/dist/editor/components/PlayPause.js +0 -3
  29. package/dist/editor/components/PlaybackRateSelector.js +3 -1
  30. package/dist/editor/components/Preview.d.ts +8 -0
  31. package/dist/editor/components/Preview.js +97 -30
  32. package/dist/editor/components/PreviewToolbar.js +4 -1
  33. package/dist/editor/components/RenderPreview.d.ts +6 -0
  34. package/dist/editor/components/RenderPreview.js +31 -0
  35. package/dist/editor/components/RenderQueue/RenderQueueCopyToClipboard.js +3 -2
  36. package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +1 -0
  37. package/dist/editor/components/RenderQueue/RenderQueueItem.js +55 -2
  38. package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +2 -1
  39. package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +35 -4
  40. package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.js +3 -2
  41. package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +3 -11
  42. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +2 -1
  43. package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +2 -1
  44. package/dist/editor/components/RenderQueue/index.js +16 -1
  45. package/dist/editor/components/RendersTab.js +9 -1
  46. package/dist/editor/components/SizeSelector.js +24 -0
  47. package/dist/editor/components/StaticFilePreview.d.ts +6 -0
  48. package/dist/editor/components/StaticFilePreview.js +39 -0
  49. package/dist/editor/components/TextViewer.d.ts +4 -0
  50. package/dist/editor/components/TextViewer.js +26 -0
  51. package/dist/editor/components/Timeline/TimelineZoomControls.js +3 -1
  52. package/dist/editor/components/TimelineInOutToggle.js +0 -5
  53. package/dist/editor/components/ZoomPersistor.d.ts +2 -0
  54. package/dist/editor/components/ZoomPersistor.js +35 -7
  55. package/dist/editor/components/layout.d.ts +2 -1
  56. package/dist/editor/components/layout.js +2 -2
  57. package/dist/editor/helpers/checkerboard-background.d.ts +1 -1
  58. package/dist/editor/helpers/colors.d.ts +1 -1
  59. package/dist/editor/helpers/create-folder-tree.d.ts +4 -3
  60. package/dist/editor/helpers/create-folder-tree.js +6 -3
  61. package/dist/editor/helpers/document-title.d.ts +1 -1
  62. package/dist/editor/helpers/document-title.js +14 -8
  63. package/dist/editor/helpers/get-asset-metadata.d.ts +11 -0
  64. package/dist/editor/helpers/get-asset-metadata.js +64 -0
  65. package/dist/editor/helpers/is-current-selected-still.d.ts +4 -3
  66. package/dist/editor/helpers/is-current-selected-still.js +12 -13
  67. package/dist/editor/helpers/persist-open-folders.d.ts +4 -2
  68. package/dist/editor/helpers/persist-open-folders.js +7 -5
  69. package/dist/editor/state/folders.d.ts +4 -2
  70. package/dist/editor/state/folders.js +13 -6
  71. package/dist/get-cli-options.d.ts +2 -2
  72. package/dist/index.d.ts +10 -10
  73. package/dist/log.d.ts +4 -4
  74. package/dist/preview-server/routes.d.ts +5 -3
  75. package/dist/preview-server/routes.js +52 -8
  76. package/dist/preview-server/serve-static.d.ts +6 -1
  77. package/dist/preview-server/serve-static.js +1 -4
  78. package/dist/preview-server/start-server.d.ts +4 -2
  79. package/dist/preview-server/start-server.js +4 -2
  80. package/dist/studio.js +9 -4
  81. package/package.json +8 -8
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RenderQueueItem = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const colors_1 = require("../../helpers/colors");
5
8
  const layout_1 = require("../layout");
6
9
  const RenderQueueCopyToClipboard_1 = require("./RenderQueueCopyToClipboard");
7
10
  const RenderQueueError_1 = require("./RenderQueueError");
@@ -35,7 +38,57 @@ const subtitle = {
35
38
  display: 'flex',
36
39
  overflow: 'hidden',
37
40
  };
38
- const RenderQueueItem = ({ job }) => {
39
- return ((0, jsx_runtime_1.jsxs)(layout_1.Row, { style: container, align: "center", children: [(0, jsx_runtime_1.jsx)(RenderQueueItemStatus_1.RenderQueueItemStatus, { job: job }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsxs)("div", { style: right, children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: job.compositionId }), (0, jsx_runtime_1.jsx)("div", { style: subtitle, children: job.status === 'done' ? ((0, jsx_runtime_1.jsx)(RenderQueueOutputName_1.RenderQueueOutputName, { job: job })) : job.status === 'failed' ? ((0, jsx_runtime_1.jsx)(RenderQueueError_1.RenderQueueError, { job: job })) : job.status === 'running' ? ((0, jsx_runtime_1.jsx)(RenderQueueProgressMessage_1.RenderQueueProgressMessage, { job: job })) : null })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, RenderQueueCopyToClipboard_1.supportsCopyingToClipboard)(job) ? ((0, jsx_runtime_1.jsx)(RenderQueueCopyToClipboard_1.RenderQueueCopyToClipboard, { job: job })) : null, job.status === 'done' || job.status === 'failed' ? ((0, jsx_runtime_1.jsx)(RenderQueueRepeat_1.RenderQueueRepeatItem, { job: job })) : null, job.status === 'running' ? ((0, jsx_runtime_1.jsx)(RenderQueueItemCancelButton_1.RenderQueueCancelButton, { job: job })) : ((0, jsx_runtime_1.jsx)(RenderQueueRemoveItem_1.RenderQueueRemoveItem, { job: job })), job.status === 'done' ? (0, jsx_runtime_1.jsx)(RenderQueueOpenInFolder_1.RenderQueueOpenInFinderItem, { job: job }) : null] }));
41
+ const SELECTED_CLASSNAME = '__remotion_selected_classname';
42
+ const RenderQueueItem = ({ job, selected }) => {
43
+ const [hovered, setHovered] = (0, react_1.useState)(false);
44
+ const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
45
+ const onPointerEnter = (0, react_1.useCallback)(() => {
46
+ setHovered(true);
47
+ }, []);
48
+ const onPointerLeave = (0, react_1.useCallback)(() => {
49
+ setHovered(false);
50
+ }, []);
51
+ const isHoverable = job.status === 'done';
52
+ const containerStyle = (0, react_1.useMemo)(() => {
53
+ return {
54
+ ...container,
55
+ backgroundColor: (0, colors_1.getBackgroundFromHoverState)({
56
+ hovered: isHoverable && hovered,
57
+ selected,
58
+ }),
59
+ userSelect: 'none',
60
+ };
61
+ }, [hovered, isHoverable, selected]);
62
+ const scrollCurrentIntoView = (0, react_1.useCallback)(() => {
63
+ var _a;
64
+ (_a = document
65
+ .querySelector(`.${SELECTED_CLASSNAME}`)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth' });
66
+ }, []);
67
+ const onClick = (0, react_1.useCallback)(() => {
68
+ if (job.status !== 'done') {
69
+ return;
70
+ }
71
+ setCanvasContent((c) => {
72
+ const isAlreadySelected = c && c.type === 'output' && c.path === `/${job.outName}`;
73
+ if (isAlreadySelected && !selected) {
74
+ scrollCurrentIntoView();
75
+ return c;
76
+ }
77
+ return { type: 'output', path: `/${job.outName}` };
78
+ });
79
+ window.history.pushState({}, 'Studio', `/outputs/${job.outName}`);
80
+ }, [
81
+ job.outName,
82
+ job.status,
83
+ scrollCurrentIntoView,
84
+ selected,
85
+ setCanvasContent,
86
+ ]);
87
+ (0, react_1.useEffect)(() => {
88
+ if (selected) {
89
+ scrollCurrentIntoView();
90
+ }
91
+ }, [scrollCurrentIntoView, selected]);
92
+ return ((0, jsx_runtime_1.jsxs)(layout_1.Row, { onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: containerStyle, align: "center", onClick: onClick, className: selected ? SELECTED_CLASSNAME : undefined, children: [(0, jsx_runtime_1.jsx)(RenderQueueItemStatus_1.RenderQueueItemStatus, { job: job }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsxs)("div", { style: right, children: [(0, jsx_runtime_1.jsx)("div", { style: title, children: job.compositionId }), (0, jsx_runtime_1.jsx)("div", { style: subtitle, children: job.status === 'done' ? ((0, jsx_runtime_1.jsx)(RenderQueueOutputName_1.RenderQueueOutputName, { job: job })) : job.status === 'failed' ? ((0, jsx_runtime_1.jsx)(RenderQueueError_1.RenderQueueError, { job: job })) : job.status === 'running' ? ((0, jsx_runtime_1.jsx)(RenderQueueProgressMessage_1.RenderQueueProgressMessage, { job: job })) : null })] }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, RenderQueueCopyToClipboard_1.supportsCopyingToClipboard)(job) ? ((0, jsx_runtime_1.jsx)(RenderQueueCopyToClipboard_1.RenderQueueCopyToClipboard, { job: job })) : null, job.status === 'done' || job.status === 'failed' ? ((0, jsx_runtime_1.jsx)(RenderQueueRepeat_1.RenderQueueRepeatItem, { job: job })) : null, job.status === 'running' ? ((0, jsx_runtime_1.jsx)(RenderQueueItemCancelButton_1.RenderQueueCancelButton, { job: job })) : ((0, jsx_runtime_1.jsx)(RenderQueueRemoveItem_1.RenderQueueRemoveItem, { job: job })), job.status === 'done' ? (0, jsx_runtime_1.jsx)(RenderQueueOpenInFolder_1.RenderQueueOpenInFinderItem, { job: job }) : null] }));
40
93
  };
41
94
  exports.RenderQueueItem = RenderQueueItem;
@@ -7,7 +7,8 @@ const InlineAction_1 = require("../InlineAction");
7
7
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
8
8
  const actions_1 = require("./actions");
9
9
  const RenderQueueCancelButton = ({ job }) => {
10
- const onClick = (0, react_1.useCallback)(() => {
10
+ const onClick = (0, react_1.useCallback)((e) => {
11
+ e.stopPropagation();
11
12
  (0, actions_1.cancelRenderJob)(job).catch((err) => {
12
13
  (0, NotificationCenter_1.sendErrorNotification)(`Could not cancel job: ${err.message}`);
13
14
  });
@@ -1,8 +1,31 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.RenderQueueItemStatus = void 0;
4
27
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
28
+ const react_1 = __importStar(require("react"));
6
29
  const colors_1 = require("../../helpers/colors");
7
30
  const modals_1 = require("../../state/modals");
8
31
  const CircularProgress_1 = require("./CircularProgress");
@@ -19,7 +42,15 @@ const invisibleStyle = {
19
42
  };
20
43
  const RenderQueueItemStatus = ({ job }) => {
21
44
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
22
- const openProgress = (0, react_1.useCallback)(() => {
45
+ const [hovered, setHovered] = react_1.default.useState(false);
46
+ const onPointerEnter = (0, react_1.useCallback)(() => {
47
+ setHovered(true);
48
+ }, []);
49
+ const onPointerLeave = (0, react_1.useCallback)(() => {
50
+ setHovered(false);
51
+ }, []);
52
+ const onClick = (0, react_1.useCallback)((e) => {
53
+ e.stopPropagation();
23
54
  setSelectedModal({
24
55
  type: 'render-progress',
25
56
  jobId: job.id,
@@ -32,11 +63,11 @@ const RenderQueueItemStatus = ({ job }) => {
32
63
  return ((0, jsx_runtime_1.jsx)("svg", { style: iconStyle, viewBox: "0 0 512 512", children: (0, jsx_runtime_1.jsx)("path", { fill: colors_1.LIGHT_TEXT, d: "M256 512C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" }) }));
33
64
  }
34
65
  if (job.status === 'done') {
35
- return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: invisibleStyle, onClick: openProgress, children: (0, jsx_runtime_1.jsx)("svg", { style: iconStyle, viewBox: "0 0 512 512", children: (0, jsx_runtime_1.jsx)("path", { fill: colors_1.LIGHT_TEXT, d: "M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM369 209L241 337l-17 17-17-17-64-64-17-17L160 222.1l17 17 47 47L335 175l17-17L385.9 192l-17 17z" }) }) }));
66
+ return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: invisibleStyle, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { style: iconStyle, viewBox: "0 0 512 512", children: (0, jsx_runtime_1.jsx)("path", { fill: hovered ? 'white' : colors_1.LIGHT_TEXT, d: "M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM369 209L241 337l-17 17-17-17-64-64-17-17L160 222.1l17 17 47 47L335 175l17-17L385.9 192l-17 17z" }) }) }));
36
67
  }
37
68
  if (job.status === 'running') {
38
69
  // Add a minimum progress to avoid the progress bar from disappearing
39
- return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: invisibleStyle, onClick: openProgress, children: (0, jsx_runtime_1.jsx)(CircularProgress_1.CircularProgress, { progress: Math.max(0.07, job.progress.value) }) }));
70
+ return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: invisibleStyle, onClick: onClick, children: (0, jsx_runtime_1.jsx)(CircularProgress_1.CircularProgress, { progress: Math.max(0.07, job.progress.value) }) }));
40
71
  }
41
72
  throw new Error('Unknown job status');
42
73
  };
@@ -7,8 +7,9 @@ const folder_1 = require("../../icons/folder");
7
7
  const InlineAction_1 = require("../InlineAction");
8
8
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
9
9
  const actions_1 = require("./actions");
10
- const RenderQueueOpenInFinderItem = ({ job, }) => {
11
- const onClick = (0, react_1.useCallback)(() => {
10
+ const RenderQueueOpenInFinderItem = ({ job }) => {
11
+ const onClick = (0, react_1.useCallback)((e) => {
12
+ e.stopPropagation();
12
13
  (0, actions_1.openInFileExplorer)({ directory: job.outName }).catch((err) => {
13
14
  (0, NotificationCenter_1.sendErrorNotification)(`Could not open file: ${err.message}`);
14
15
  });
@@ -3,24 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RenderQueueOutputName = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const NotificationCenter_1 = require("../Notifications/NotificationCenter");
7
- const actions_1 = require("./actions");
8
6
  const item_style_1 = require("./item-style");
9
7
  const RenderQueueOutputName = ({ job }) => {
10
- const onClick = (0, react_1.useCallback)(() => {
11
- if (job.deletedOutputLocation)
12
- return;
13
- (0, actions_1.openInFileExplorer)({ directory: job.outName }).catch((err) => {
14
- (0, NotificationCenter_1.sendErrorNotification)(err.message);
15
- });
16
- }, [job]);
17
8
  const style = (0, react_1.useMemo)(() => {
18
9
  return {
19
10
  ...item_style_1.renderQueueItemSubtitleStyle,
20
- cursor: job.deletedOutputLocation ? 'inherit' : 'pointer',
21
11
  textDecoration: job.deletedOutputLocation ? 'line-through' : 'none',
12
+ color: item_style_1.renderQueueItemSubtitleStyle.color,
13
+ cursor: 'inherit',
22
14
  };
23
15
  }, [job.deletedOutputLocation]);
24
- return ((0, jsx_runtime_1.jsx)("button", { onClick: onClick, type: "button", style: style, disabled: job.deletedOutputLocation, title: job.deletedOutputLocation ? 'File was deleted' : job.outName, children: job.outName }));
16
+ return ((0, jsx_runtime_1.jsx)("span", { style: style, title: job.deletedOutputLocation ? 'File was deleted' : job.outName, children: job.outName }));
25
17
  };
26
18
  exports.RenderQueueOutputName = RenderQueueOutputName;
@@ -7,7 +7,8 @@ const InlineAction_1 = require("../InlineAction");
7
7
  const NotificationCenter_1 = require("../Notifications/NotificationCenter");
8
8
  const actions_1 = require("./actions");
9
9
  const RenderQueueRemoveItem = ({ job }) => {
10
- const onClick = (0, react_1.useCallback)(() => {
10
+ const onClick = (0, react_1.useCallback)((e) => {
11
+ e.stopPropagation();
11
12
  (0, actions_1.removeRenderJob)(job)
12
13
  .then(() => {
13
14
  var _a;
@@ -8,7 +8,8 @@ const modals_1 = require("../../state/modals");
8
8
  const InlineAction_1 = require("../InlineAction");
9
9
  const RenderQueueRepeatItem = ({ job }) => {
10
10
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
11
- const onClick = (0, react_1.useCallback)(() => {
11
+ const onClick = (0, react_1.useCallback)((e) => {
12
+ e.stopPropagation();
12
13
  const retryPayload = (0, make_retry_payload_1.makeRetryPayload)(job);
13
14
  setSelectedModal(retryPayload);
14
15
  }, [job, setSelectedModal]);
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.RenderQueue = void 0;
27
27
  const jsx_runtime_1 = require("react/jsx-runtime");
28
28
  const react_1 = __importStar(require("react"));
29
+ const remotion_1 = require("remotion");
29
30
  const client_id_1 = require("../../helpers/client-id");
30
31
  const colors_1 = require("../../helpers/colors");
31
32
  const layout_1 = require("../layout");
@@ -59,6 +60,7 @@ const renderQueue = {
59
60
  const RenderQueue = () => {
60
61
  const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
61
62
  const { jobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
63
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
62
64
  const previousJobCount = react_1.default.useRef(jobs.length);
63
65
  const jobCount = jobs.length;
64
66
  const divRef = react_1.default.useRef(null);
@@ -75,6 +77,19 @@ const RenderQueue = () => {
75
77
  }
76
78
  previousJobCount.current = jobCount;
77
79
  }, [jobCount]);
80
+ const selectedJob = (0, react_1.useMemo)(() => {
81
+ let selectedIndex = -1;
82
+ for (let i = 0; i < jobs.length; i++) {
83
+ const job = jobs[i];
84
+ if (canvasContent &&
85
+ canvasContent.type === 'output' &&
86
+ canvasContent.path === `/${job.outName}` &&
87
+ job.status === 'done') {
88
+ selectedIndex = i;
89
+ }
90
+ }
91
+ return selectedIndex;
92
+ }, [canvasContent, jobs]);
78
93
  if (connectionStatus === 'disconnected') {
79
94
  return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "The studio server has disconnected." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
80
95
  }
@@ -82,7 +97,7 @@ const RenderQueue = () => {
82
97
  return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "No renders in the queue." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
83
98
  }
84
99
  return ((0, jsx_runtime_1.jsx)("div", { ref: divRef, style: renderQueue, className: ['css-reset', is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME].join(' '), children: jobs.map((j, index) => {
85
- return ((0, jsx_runtime_1.jsx)("div", { style: index === jobs.length - 1 ? undefined : separatorStyle, children: (0, jsx_runtime_1.jsx)(RenderQueueItem_1.RenderQueueItem, { job: j }) }, j.id));
100
+ return ((0, jsx_runtime_1.jsx)("div", { style: index === jobs.length - 1 ? undefined : separatorStyle, children: (0, jsx_runtime_1.jsx)(RenderQueueItem_1.RenderQueueItem, { selected: selectedJob === index, job: j }) }, j.id));
86
101
  }) }));
87
102
  };
88
103
  exports.RenderQueue = RenderQueue;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RendersTab = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
6
7
  const colors_1 = require("../helpers/colors");
7
8
  const layout_1 = require("./layout");
8
9
  const context_1 = require("./RenderQueue/context");
@@ -26,8 +27,15 @@ const badge = {
26
27
  };
27
28
  const RendersTab = ({ selected, onClick }) => {
28
29
  const { jobs } = (0, react_1.useContext)(context_1.RenderQueueContext);
30
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
29
31
  const failedJobs = jobs.filter((j) => j.status === 'failed').length;
30
32
  const jobCount = jobs.length;
33
+ const isActuallySelected = (0, react_1.useMemo)(() => {
34
+ if (!canvasContent || canvasContent.type !== 'composition') {
35
+ return true;
36
+ }
37
+ return selected;
38
+ }, [canvasContent, selected]);
31
39
  const badgeStyle = (0, react_1.useMemo)(() => {
32
40
  return {
33
41
  ...badge,
@@ -38,6 +46,6 @@ const RendersTab = ({ selected, onClick }) => {
38
46
  borderColor: colors_1.LIGHT_TEXT,
39
47
  };
40
48
  }, [failedJobs]);
41
- return ((0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: selected, onClick: onClick, children: (0, jsx_runtime_1.jsxs)("div", { style: row, children: ["Renders", jobCount > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)("div", { style: badgeStyle, children: jobCount })] })) : null] }) }));
49
+ return ((0, jsx_runtime_1.jsx)(Tabs_1.Tab, { selected: isActuallySelected, onClick: onClick, children: (0, jsx_runtime_1.jsxs)("div", { style: row, children: ["Renders", jobCount > 0 ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Flex, {}), (0, jsx_runtime_1.jsx)("div", { style: badgeStyle, children: jobCount })] })) : null] }) }));
42
50
  };
43
51
  exports.RendersTab = RendersTab;
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SizeSelector = exports.getUniqueSizes = exports.getPreviewSizeLabel = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
6
7
  const Checkmark_1 = require("../icons/Checkmark");
7
8
  const preview_size_1 = require("../state/preview-size");
8
9
  const ControlButton_1 = require("./ControlButton");
9
10
  const ComboBox_1 = require("./NewComposition/ComboBox");
11
+ const Preview_1 = require("./Preview");
10
12
  const commonPreviewSizes = [
11
13
  {
12
14
  size: 'auto',
@@ -65,13 +67,32 @@ const getUniqueSizes = (size) => {
65
67
  });
66
68
  };
67
69
  exports.getUniqueSizes = getUniqueSizes;
70
+ const zoomableFileTypes = ['video', 'image'];
68
71
  const SizeSelector = () => {
69
72
  const { size, setSize } = (0, react_1.useContext)(preview_size_1.PreviewSizeContext);
73
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
70
74
  const style = (0, react_1.useMemo)(() => {
71
75
  return {
72
76
  padding: ControlButton_1.CONTROL_BUTTON_PADDING,
73
77
  };
74
78
  }, []);
79
+ const zoomable = (0, react_1.useMemo)(() => {
80
+ if (!canvasContent) {
81
+ return null;
82
+ }
83
+ if (canvasContent.type === 'composition') {
84
+ return true;
85
+ }
86
+ if (canvasContent.type === 'asset' &&
87
+ zoomableFileTypes.includes((0, Preview_1.getPreviewFileType)(canvasContent.asset))) {
88
+ return true;
89
+ }
90
+ if (canvasContent.type === 'output' &&
91
+ zoomableFileTypes.includes((0, Preview_1.getPreviewFileType)(canvasContent.path))) {
92
+ return true;
93
+ }
94
+ return false;
95
+ }, [canvasContent]);
75
96
  const items = (0, react_1.useMemo)(() => {
76
97
  return (0, exports.getUniqueSizes)(size).map((newSize) => {
77
98
  return {
@@ -91,6 +112,9 @@ const SizeSelector = () => {
91
112
  };
92
113
  });
93
114
  }, [setSize, size]);
115
+ if (!zoomable) {
116
+ return null;
117
+ }
94
118
  return ((0, jsx_runtime_1.jsx)("div", { style: style, "aria-label": accessibilityLabel, children: (0, jsx_runtime_1.jsx)(ComboBox_1.Combobox, { title: accessibilityLabel, style: comboStyle, selectedId: String(size.size), values: items }) }));
95
119
  };
96
120
  exports.SizeSelector = SizeSelector;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { AssetMetadata } from '../helpers/get-asset-metadata';
3
+ export declare const StaticFilePreview: React.FC<{
4
+ currentAsset: string;
5
+ assetMetadata: AssetMetadata | null;
6
+ }>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StaticFilePreview = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
7
+ const client_id_1 = require("../helpers/client-id");
8
+ const colors_1 = require("../helpers/colors");
9
+ const FilePreview_1 = require("./FilePreview");
10
+ const Preview_1 = require("./Preview");
11
+ const msgStyle = {
12
+ fontSize: 13,
13
+ color: 'white',
14
+ fontFamily: 'sans-serif',
15
+ display: 'flex',
16
+ justifyContent: 'center',
17
+ };
18
+ const errMsgStyle = {
19
+ ...msgStyle,
20
+ color: colors_1.LIGHT_TEXT,
21
+ };
22
+ const StaticFilePreview = ({ currentAsset, assetMetadata }) => {
23
+ const fileType = (0, Preview_1.getPreviewFileType)(currentAsset);
24
+ const staticFileSrc = (0, remotion_1.staticFile)(currentAsset);
25
+ const staticFiles = (0, remotion_1.getStaticFiles)();
26
+ const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
27
+ const exists = staticFiles.find((file) => file.name === currentAsset);
28
+ if (connectionStatus === 'disconnected') {
29
+ return (0, jsx_runtime_1.jsx)("div", { style: errMsgStyle, children: "Studio server disconnected" });
30
+ }
31
+ if (!exists) {
32
+ return ((0, jsx_runtime_1.jsxs)("div", { style: errMsgStyle, children: [currentAsset, " does not exist in your public folder."] }));
33
+ }
34
+ if (!currentAsset) {
35
+ return null;
36
+ }
37
+ return ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { currentAsset: currentAsset, fileType: fileType, src: staticFileSrc, assetMetadata: assetMetadata }));
38
+ };
39
+ exports.StaticFilePreview = StaticFilePreview;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const TextViewer: React.FC<{
3
+ src: string;
4
+ }>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TextViewer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const textStyle = {
7
+ margin: 14,
8
+ fontFamily: 'monospace',
9
+ flex: 1,
10
+ color: 'white',
11
+ whiteSpace: 'pre-wrap',
12
+ };
13
+ const TextViewer = ({ src }) => {
14
+ const [txt, setTxt] = (0, react_1.useState)('');
15
+ (0, react_1.useEffect)(() => {
16
+ fetch(src).then(async (res) => {
17
+ if (!res.ok || !res.body) {
18
+ return;
19
+ }
20
+ const text = await res.text();
21
+ setTxt(text);
22
+ });
23
+ }, [src]);
24
+ return (0, jsx_runtime_1.jsxs)("div", { style: textStyle, children: [txt, " "] });
25
+ };
26
+ exports.TextViewer = TextViewer;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TimelineZoomControls = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const remotion_1 = require("remotion");
6
7
  const is_current_selected_still_1 = require("../../helpers/is-current-selected-still");
7
8
  const minus_1 = require("../../icons/minus");
8
9
  const plus_1 = require("../../icons/plus");
@@ -24,6 +25,7 @@ const iconStyle = {
24
25
  width: 14,
25
26
  };
26
27
  const TimelineZoomControls = () => {
28
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
27
29
  const { setZoom, zoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
28
30
  const { tabIndex } = (0, z_index_1.useZIndex)();
29
31
  const onMinusClicked = (0, react_1.useCallback)(() => {
@@ -36,7 +38,7 @@ const TimelineZoomControls = () => {
36
38
  setZoom(() => Number(e.target.value));
37
39
  }, [setZoom]);
38
40
  const isStill = (0, is_current_selected_still_1.useIsStill)();
39
- if (isStill) {
41
+ if (isStill || canvasContent === null || canvasContent.type === 'asset') {
40
42
  return null;
41
43
  }
42
44
  return ((0, jsx_runtime_1.jsxs)("div", { style: container, children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { onClick: onMinusClicked, style: buttonStyle, title: "Zoom out timeline", role: 'ControlButton', type: "button", disabled: timeline_zoom_1.TIMELINE_MIN_ZOOM === zoom, children: (0, jsx_runtime_1.jsx)(minus_1.Minus, { style: iconStyle }) }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)("input", { title: `Timeline zoom (${zoom}x)`, alt: `Timeline zoom (${zoom}x)`, type: 'range', min: timeline_zoom_1.TIMELINE_MIN_ZOOM, step: 0.1, value: zoom, max: timeline_zoom_1.TIMELINE_MAX_ZOOM, onChange: onChange, className: "__remotion-timeline-slider", tabIndex: tabIndex }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { onClick: onPlusClicked, style: buttonStyle, title: "Zoom in timeline", role: 'button', type: "button", disabled: timeline_zoom_1.TIMELINE_MAX_ZOOM === zoom, children: (0, jsx_runtime_1.jsx)(plus_1.Plus, { color: "currentcolor", style: iconStyle }) })] }));
@@ -6,7 +6,6 @@ const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const truthy_1 = require("../../truthy");
8
8
  const colors_1 = require("../helpers/colors");
9
- const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
10
9
  const use_keybinding_1 = require("../helpers/use-keybinding");
11
10
  const timelineInOutPointer_1 = require("../icons/timelineInOutPointer");
12
11
  const in_out_1 = require("../state/in-out");
@@ -28,7 +27,6 @@ const TimelineInOutPointToggle = () => {
28
27
  const timelinePosition = remotion_1.Internals.Timeline.useTimelinePosition();
29
28
  const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
30
29
  const { setInAndOutFrames } = (0, in_out_1.useTimelineSetInOutFramePosition)();
31
- const isStill = (0, is_current_selected_still_1.useIsStill)();
32
30
  const videoConfig = remotion_1.Internals.useUnsafeVideoConfig();
33
31
  const keybindings = (0, use_keybinding_1.useKeybinding)();
34
32
  const onInOutClear = (0, react_1.useCallback)((composition) => {
@@ -234,9 +232,6 @@ const TimelineInOutPointToggle = () => {
234
232
  outMarkClick: onOutMark,
235
233
  };
236
234
  }, [confId, onInMark, onInOutClear, onOutMark]);
237
- if (isStill) {
238
- return null;
239
- }
240
235
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: getTooltipText('In', 'I'), "aria-label": getTooltipText('In', 'I'), onClick: (e) => onInMark(e), onContextMenu: clearInMark, disabled: !videoConfig || timelinePosition === 0, children: (0, jsx_runtime_1.jsx)(timelineInOutPointer_1.TimelineInPointer, { color: inFrame === null ? 'white' : colors_1.BLUE, style: style }) }), (0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: getTooltipText('Out', 'O'), "aria-label": getTooltipText('Out', 'O'), onClick: onOutMark, onContextMenu: clearOutMark, disabled: !videoConfig || timelinePosition === videoConfig.durationInFrames - 1, children: (0, jsx_runtime_1.jsx)(timelineInOutPointer_1.TimelineOutPointer, { color: outFrame === null ? 'white' : colors_1.BLUE, style: style }) })] }));
241
236
  };
242
237
  exports.TimelineInOutPointToggle = TimelineInOutPointToggle;
@@ -1,3 +1,5 @@
1
1
  import type React from 'react';
2
+ import type { CanvasContent } from 'remotion';
2
3
  export declare const getZoomForComposition: (composition: string) => number;
4
+ export declare const deriveCanvasContentFromUrl: () => CanvasContent | null;
3
5
  export declare const ZoomPersistor: React.FC;
@@ -1,30 +1,58 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZoomPersistor = exports.getZoomForComposition = void 0;
3
+ exports.ZoomPersistor = exports.deriveCanvasContentFromUrl = exports.getZoomForComposition = void 0;
4
4
  const react_1 = require("react");
5
5
  const remotion_1 = require("remotion");
6
6
  const timeline_zoom_1 = require("../state/timeline-zoom");
7
- const FramePersistor_1 = require("./FramePersistor");
8
7
  const makeKey = (composition) => {
9
8
  return `remotion.zoom.${composition}`;
10
9
  };
11
10
  const persistCurrentZoom = (zoom) => {
12
- const currentComposition = (0, FramePersistor_1.getCurrentCompositionFromUrl)();
13
- if (!currentComposition) {
11
+ const currentComposition = (0, exports.deriveCanvasContentFromUrl)();
12
+ if (!currentComposition || currentComposition.type !== 'composition') {
14
13
  return;
15
14
  }
16
- localStorage.setItem(makeKey(currentComposition), String(zoom));
15
+ localStorage.setItem(makeKey(currentComposition.compositionId), String(zoom));
17
16
  };
18
17
  const getZoomForComposition = (composition) => {
19
18
  const zoom = localStorage.getItem(makeKey(composition));
20
19
  return zoom ? Number(zoom) : 0;
21
20
  };
22
21
  exports.getZoomForComposition = getZoomForComposition;
22
+ const deriveCanvasContentFromUrl = () => {
23
+ const substrings = window.location.pathname.split('/').filter(Boolean);
24
+ const lastPart = substrings[substrings.length - 1];
25
+ if (substrings[0] === 'assets') {
26
+ return {
27
+ type: 'asset',
28
+ asset: decodeURIComponent(window.location.pathname.substring('/assets/'.length)),
29
+ };
30
+ }
31
+ if (substrings[0] === 'outputs') {
32
+ return {
33
+ type: 'output',
34
+ path: decodeURIComponent(window.location.pathname.substring('/outputs/'.length)),
35
+ };
36
+ }
37
+ if (lastPart) {
38
+ return {
39
+ type: 'composition',
40
+ compositionId: lastPart,
41
+ };
42
+ }
43
+ return null;
44
+ };
45
+ exports.deriveCanvasContentFromUrl = deriveCanvasContentFromUrl;
23
46
  const ZoomPersistor = () => {
24
47
  const [playing] = remotion_1.Internals.Timeline.usePlayingState();
25
48
  const { zoom } = (0, react_1.useContext)(timeline_zoom_1.TimelineZoomCtx);
26
- const { currentComposition } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
27
- const isActive = currentComposition === (0, FramePersistor_1.getCurrentCompositionFromUrl)();
49
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
50
+ const urlState = (0, exports.deriveCanvasContentFromUrl)();
51
+ const isActive = urlState &&
52
+ urlState.type === 'composition' &&
53
+ canvasContent &&
54
+ canvasContent.type === 'composition' &&
55
+ urlState.compositionId === canvasContent.compositionId;
28
56
  (0, react_1.useEffect)(() => {
29
57
  if (!isActive) {
30
58
  return;
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from 'react';
1
2
  import React from 'react';
2
3
  export declare const SPACING_UNIT = 8;
3
4
  export declare const Spacing: React.FC<{
@@ -15,7 +16,7 @@ export declare const Row: React.FC<{
15
16
  flex?: number;
16
17
  className?: string;
17
18
  children: React.ReactNode;
18
- }>;
19
+ } & HTMLAttributes<HTMLDivElement>>;
19
20
  export declare const Column: React.FC<{
20
21
  justify?: 'center';
21
22
  align?: 'center';
@@ -19,7 +19,7 @@ exports.Spacing = Spacing;
19
19
  const flexCss = { flex: 1 };
20
20
  const Flex = ({ children }) => (0, jsx_runtime_1.jsx)("div", { style: flexCss, children: children });
21
21
  exports.Flex = Flex;
22
- const Row = ({ children, justify, className, align, flex, style = {} }) => {
22
+ const Row = ({ children, justify, className, align, flex, style = {}, ...other }) => {
23
23
  const finalStyle = (0, react_1.useMemo)(() => {
24
24
  return {
25
25
  ...style,
@@ -30,7 +30,7 @@ const Row = ({ children, justify, className, align, flex, style = {} }) => {
30
30
  flex: flex !== null && flex !== void 0 ? flex : undefined,
31
31
  };
32
32
  }, [align, flex, justify, style]);
33
- return ((0, jsx_runtime_1.jsx)("div", { className: className, style: finalStyle, children: children }));
33
+ return ((0, jsx_runtime_1.jsx)("div", { className: className, style: finalStyle, ...other, children: children }));
34
34
  };
35
35
  exports.Row = Row;
36
36
  const Column = ({ children, justify, className, align, style = {} }) => {
@@ -1,4 +1,4 @@
1
1
  export declare const getCheckerboardBackgroundSize: (size: number) => string;
2
2
  export declare const getCheckerboardBackgroundPos: (size: number) => string;
3
- export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "white" | "black";
3
+ export declare const checkerboardBackgroundColor: (checkerboard: boolean) => "black" | "white";
4
4
  export declare const checkerboardBackgroundImage: (checkerboard: boolean) => "\n linear-gradient(\n 45deg,\n rgba(0, 0, 0, 0.1) 25%,\n transparent 25%\n ),\n linear-gradient(135deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%),\n linear-gradient(135deg, transparent 75%, rgba(0, 0, 0, 0.1) 75%)\n " | undefined;
@@ -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" | "rgba(255, 255, 255, 0.06)" | "hsla(0, 0%, 100%, 0.15)" | "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)";
@@ -2,13 +2,14 @@ import type { AnyComposition, StaticFile, TFolder } from 'remotion';
2
2
  import type { CompositionSelectorItemType } from '../components/CompositionSelectorItem';
3
3
  export type AssetFolder = {
4
4
  name: string;
5
- items: Structure;
5
+ items: AssetStructure;
6
+ expanded: boolean;
6
7
  };
7
- export type Structure = {
8
+ export type AssetStructure = {
8
9
  files: StaticFile[];
9
10
  folders: AssetFolder[];
10
11
  };
11
- export declare const buildAssetFolderStructure: (files: StaticFile[]) => Structure;
12
+ export declare const buildAssetFolderStructure: (files: StaticFile[], parentFolderName: string | null, foldersExpanded: Record<string, boolean>) => AssetStructure;
12
13
  export declare const splitParentIntoNameAndParent: (name: string | null) => {
13
14
  name: string | null;
14
15
  parent: string | null;