@remotion/studio 4.0.179 → 4.0.181

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 +0,0 @@
1
- export declare const handleUploadFile: (file: File, assetPath: string) => Promise<void>;
@@ -1,32 +0,0 @@
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
- if (!file) {
7
- (0, NotificationCenter_1.showNotification)('Please select a file first!', 3000);
8
- return;
9
- }
10
- try {
11
- const url = new URL('/api/add-asset', window.location.origin);
12
- url.search = new URLSearchParams({
13
- folder: assetPath,
14
- file: file.name,
15
- }).toString();
16
- const response = await fetch(url, {
17
- method: 'POST',
18
- body: file,
19
- });
20
- if (response.ok) {
21
- (0, NotificationCenter_1.showNotification)(`Added ${file.name} to ${assetPath}`, 3000);
22
- }
23
- else {
24
- const jsonResponse = await response.json();
25
- (0, NotificationCenter_1.showNotification)(`Upload failed: ${jsonResponse.error}`, 3000);
26
- }
27
- }
28
- catch (error) {
29
- (0, NotificationCenter_1.showNotification)(`Error during upload: ${error}`, 3000);
30
- }
31
- };
32
- exports.handleUploadFile = handleUploadFile;