@remotion/studio 4.0.118 → 4.0.120

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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @remotion/studio@4.0.117 build /Users/jonathanburger/remotion/packages/studio
3
+ > @remotion/studio@4.0.118 build /Users/jonathanburger/remotion/packages/studio
4
4
  > tsc -d
5
5
 
@@ -12,6 +12,6 @@ export declare const getInputBorderColor: ({ status, isFocused, isHovered, }: {
12
12
  status: 'error' | 'warning' | 'ok';
13
13
  isFocused: boolean;
14
14
  isHovered: boolean;
15
- }) => "#ff3232" | "hsla(0, 0%, 100%, 0.15)" | "#f1c40f" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)";
15
+ }) => "hsla(0, 0%, 100%, 0.15)" | "#f1c40f" | "rgba(0, 0, 0, 0.6)" | "rgba(255, 255, 255, 0.05)" | "#ff3232";
16
16
  export declare const RemotionInput: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
17
17
  export {};
@@ -33,7 +33,10 @@ const RenderQueueCopyToClipboard = ({ job }) => {
33
33
  }, []);
34
34
  const onClick = (0, react_1.useCallback)((e) => {
35
35
  e.stopPropagation();
36
- (0, actions_1.copyToClipboard)({ outName: job.outName })
36
+ (0, actions_1.copyToClipboard)({
37
+ outName: job.outName,
38
+ binariesDirectory: job.binariesDirectory,
39
+ })
37
40
  .catch((err) => {
38
41
  (0, NotificationCenter_1.sendErrorNotification)(`Could not copy to clipboard: ${err.message}`);
39
42
  })
@@ -46,7 +49,7 @@ const RenderQueueCopyToClipboard = ({ job }) => {
46
49
  id: String(Math.random()),
47
50
  });
48
51
  });
49
- }, [job.outName]);
52
+ }, [job.binariesDirectory, job.outName]);
50
53
  return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { title: "Copy to clipboard", renderAction: renderCopyAction, onClick: onClick }));
51
54
  };
52
55
  exports.RenderQueueCopyToClipboard = RenderQueueCopyToClipboard;
@@ -82,8 +82,9 @@ export declare const subscribeToFileExistenceWatcher: ({ file, clientId, }: {
82
82
  export declare const openInFileExplorer: ({ directory }: {
83
83
  directory: string;
84
84
  }) => Promise<void>;
85
- export declare const copyToClipboard: ({ outName }: {
85
+ export declare const copyToClipboard: ({ outName, binariesDirectory, }: {
86
86
  outName: string;
87
+ binariesDirectory: string | null;
87
88
  }) => Promise<void>;
88
89
  export declare const removeRenderJob: (job: RenderJob) => Promise<undefined>;
89
90
  export declare const cancelRenderJob: (job: RenderJob) => Promise<import("@remotion/studio-shared").CancelRenderResponse>;
@@ -140,9 +140,10 @@ const openInFileExplorer = ({ directory }) => {
140
140
  return callApi('/api/open-in-file-explorer', body);
141
141
  };
142
142
  exports.openInFileExplorer = openInFileExplorer;
143
- const copyToClipboard = ({ outName }) => {
143
+ const copyToClipboard = ({ outName, binariesDirectory, }) => {
144
144
  const body = {
145
145
  outName,
146
+ binariesDirectory,
146
147
  };
147
148
  return callApi('/api/copy-still-to-clipboard', body);
148
149
  };
@@ -4,7 +4,8 @@ exports.MaxTimelineTracksReached = exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = e
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const studio_shared_1 = require("@remotion/studio-shared");
6
6
  const timeline_layout_1 = require("../../helpers/timeline-layout");
7
- exports.MAX_TIMELINE_TRACKS = typeof process.env.MAX_TIMELINE_TRACKS === 'undefined'
7
+ exports.MAX_TIMELINE_TRACKS = typeof process.env.MAX_TIMELINE_TRACKS === 'undefined' ||
8
+ process.env.MAX_TIMELINE_TRACKS === null
8
9
  ? studio_shared_1.DEFAULT_TIMELINE_TRACKS
9
10
  : Number(process.env.MAX_TIMELINE_TRACKS);
10
11
  exports.MAX_TIMELINE_TRACKS_NOTICE_HEIGHT = 24;
@@ -0,0 +1 @@
1
+ export declare const handleUploadFile: (file: File, assetPath: string) => Promise<void>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleUploadFile = void 0;
4
+ const NotificationCenter_1 = require("./Notifications/NotificationCenter");
5
+ const handleUploadFile = async (file, assetPath) => {
6
+ var _a, _b, _c, _d;
7
+ if (!file) {
8
+ (_a = NotificationCenter_1.notificationCenter.current) === null || _a === void 0 ? void 0 : _a.addNotification({
9
+ content: `Please select a file first!`,
10
+ created: Date.now(),
11
+ duration: 3000,
12
+ id: String(Math.random()),
13
+ });
14
+ return;
15
+ }
16
+ const formData = new FormData();
17
+ formData.append('file', file);
18
+ formData.append('assetPath', assetPath);
19
+ try {
20
+ const response = await fetch('/api/add-asset', {
21
+ method: 'POST',
22
+ body: formData,
23
+ });
24
+ if (response.ok) {
25
+ (_b = NotificationCenter_1.notificationCenter.current) === null || _b === void 0 ? void 0 : _b.addNotification({
26
+ content: `File uploaded successfully`,
27
+ created: Date.now(),
28
+ duration: 3000,
29
+ id: String(Math.random()),
30
+ });
31
+ }
32
+ else {
33
+ const jsonResponse = await response.json();
34
+ (_c = NotificationCenter_1.notificationCenter.current) === null || _c === void 0 ? void 0 : _c.addNotification({
35
+ content: `Upload failed: ${jsonResponse.error}`,
36
+ created: Date.now(),
37
+ duration: 3000,
38
+ id: String(Math.random()),
39
+ });
40
+ }
41
+ }
42
+ catch (error) {
43
+ (_d = NotificationCenter_1.notificationCenter.current) === null || _d === void 0 ? void 0 : _d.addNotification({
44
+ content: `Error during upload: ${error}`,
45
+ created: Date.now(),
46
+ duration: 3000,
47
+ id: String(Math.random()),
48
+ });
49
+ }
50
+ };
51
+ exports.handleUploadFile = handleUploadFile;
@@ -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;
@@ -23,4 +23,4 @@ export declare const TIMELINE_TRACK_SEPARATOR = "rgba(0, 0, 0, 0.3)";
23
23
  export declare const getBackgroundFromHoverState: ({ selected, hovered, }: {
24
24
  selected: boolean;
25
25
  hovered: boolean;
26
- }) => "transparent" | "hsla(0, 0%, 100%, 0.25)" | "hsla(0, 0%, 100%, 0.15)" | "rgba(255, 255, 255, 0.06)";
26
+ }) => "transparent" | "rgba(255, 255, 255, 0.06)" | "hsla(0, 0%, 100%, 0.15)" | "hsla(0, 0%, 100%, 0.25)";
@@ -0,0 +1 @@
1
+ export declare const useMobileLayout: () => boolean;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMobileLayout = void 0;
4
+ const use_el_size_1 = require("./use-el-size");
5
+ const useMobileLayout = () => {
6
+ var _a;
7
+ const containerSize = (0, use_el_size_1.useElementSize)(typeof document === 'undefined' ? null : document.body);
8
+ return ((_a = containerSize === null || containerSize === void 0 ? void 0 : containerSize.width) !== null && _a !== void 0 ? _a : Infinity) < 900;
9
+ };
10
+ exports.useMobileLayout = useMobileLayout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Codec } from '@remotion/renderer';
3
2
  import type { RenderType } from '../components/RenderModal/RenderModalAdvanced';
4
3
  type Section = 'general' | 'picture' | 'advanced' | 'data' | 'gif' | 'audio';
@@ -0,0 +1,5 @@
1
+ export type Size = {
2
+ width: number;
3
+ height: number;
4
+ };
5
+ export declare const useElementSize: (ref: HTMLElement | null) => Size | null;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useElementSize = void 0;
4
+ const react_1 = require("react");
5
+ const useElementSize = (ref) => {
6
+ const [size, setSize] = (0, react_1.useState)(null);
7
+ const observer = (0, react_1.useMemo)(() => {
8
+ if (typeof ResizeObserver === 'undefined') {
9
+ return;
10
+ }
11
+ return new ResizeObserver((entries) => {
12
+ setSize({
13
+ width: entries[0].contentRect.width,
14
+ height: entries[0].contentRect.height,
15
+ });
16
+ });
17
+ }, []);
18
+ const updateSize = (0, react_1.useCallback)(() => {
19
+ if (ref === null) {
20
+ return;
21
+ }
22
+ const rect = ref.getClientRects();
23
+ setSize({
24
+ width: rect[0].width,
25
+ height: rect[0].height,
26
+ });
27
+ }, [ref]);
28
+ (0, react_1.useEffect)(() => {
29
+ updateSize();
30
+ if (!observer) {
31
+ return;
32
+ }
33
+ if (ref) {
34
+ observer.observe(ref);
35
+ }
36
+ return () => {
37
+ if (ref) {
38
+ observer.unobserve(ref);
39
+ }
40
+ };
41
+ }, [observer, ref, updateSize]);
42
+ return size;
43
+ };
44
+ exports.useElementSize = useElementSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/studio",
3
- "version": "4.0.118",
3
+ "version": "4.0.120",
4
4
  "description": "Remotion Editor",
5
5
  "main": "dist",
6
6
  "sideEffects": false,
@@ -18,11 +18,11 @@
18
18
  "memfs": "3.4.3",
19
19
  "source-map": "0.7.3",
20
20
  "open": "^8.4.2",
21
- "remotion": "4.0.118",
22
- "@remotion/player": "4.0.118",
23
- "@remotion/media-utils": "4.0.118",
24
- "@remotion/studio-shared": "4.0.118",
25
- "@remotion/renderer": "4.0.118"
21
+ "remotion": "4.0.120",
22
+ "@remotion/player": "4.0.120",
23
+ "@remotion/media-utils": "4.0.120",
24
+ "@remotion/renderer": "4.0.120",
25
+ "@remotion/studio-shared": "4.0.120"
26
26
  },
27
27
  "devDependencies": {
28
28
  "react": "18.2.0",
@@ -40,7 +40,7 @@
40
40
  "prettier-plugin-organize-imports": "3.2.4",
41
41
  "vitest": "0.31.1",
42
42
  "zod": "^3.22.3",
43
- "@remotion/zod-types": "4.0.118"
43
+ "@remotion/zod-types": "4.0.120"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"