@revideo/vite-plugin 0.4.6-alpha.1017 → 0.4.7-alpha.1022
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.
- package/lib/index.js +40 -22
- package/lib/openInExplorer.js +38 -39
- package/lib/partials/assets.d.ts +5 -3
- package/lib/partials/assets.js +49 -46
- package/lib/partials/corsProxy.d.ts +24 -22
- package/lib/partials/corsProxy.js +175 -151
- package/lib/partials/editor.d.ts +8 -5
- package/lib/partials/editor.js +65 -58
- package/lib/partials/ffmpegExporter.d.ts +25 -0
- package/lib/partials/ffmpegExporter.js +132 -0
- package/lib/partials/ffmpegExporter.js.map +1 -0
- package/lib/partials/imageExporter.d.ts +5 -3
- package/lib/partials/imageExporter.js +54 -42
- package/lib/partials/meta.d.ts +1 -1
- package/lib/partials/meta.js +61 -52
- package/lib/partials/metrics.d.ts +1 -1
- package/lib/partials/metrics.js +10 -10
- package/lib/partials/projects.d.ts +11 -7
- package/lib/partials/projects.js +73 -69
- package/lib/partials/scenes.d.ts +1 -1
- package/lib/partials/scenes.js +25 -23
- package/lib/partials/settings.d.ts +1 -1
- package/lib/partials/settings.js +67 -62
- package/lib/partials/webgl.d.ts +7 -7
- package/lib/partials/webgl.js +87 -79
- package/lib/plugins.d.ts +76 -76
- package/lib/plugins.js +4 -4
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils.d.ts +3 -3
- package/lib/utils.js +47 -40
- package/lib/versions.d.ts +4 -4
- package/lib/versions.js +28 -23
- package/package.json +4 -4
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault =
|
|
3
|
+
(this && this.__importDefault) ||
|
|
4
|
+
function (mod) {
|
|
5
|
+
return mod && mod.__esModule ? mod : {default: mod};
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, '__esModule', {value: true});
|
|
6
8
|
exports.corsProxyPlugin = void 0;
|
|
7
|
-
const follow_redirects_1 = __importDefault(require(
|
|
9
|
+
const follow_redirects_1 = __importDefault(require('follow-redirects'));
|
|
8
10
|
/**
|
|
9
11
|
* This module provides the proxy located at
|
|
10
12
|
* /cors-proxy/...
|
|
@@ -22,69 +24,78 @@ const follow_redirects_1 = __importDefault(require("follow-redirects"));
|
|
|
22
24
|
* same host as the main app.
|
|
23
25
|
*/
|
|
24
26
|
function corsProxyPlugin(config) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
setupEnvVarsForProxy(config);
|
|
28
|
+
return {
|
|
29
|
+
name: 'revideo:cors-proxy',
|
|
30
|
+
configureServer(server) {
|
|
31
|
+
if (config !== false && config !== undefined) {
|
|
32
|
+
motionCanvasCorsProxy(
|
|
33
|
+
server.middlewares,
|
|
34
|
+
config === true ? {} : config,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
};
|
|
34
39
|
}
|
|
35
40
|
exports.corsProxyPlugin = corsProxyPlugin;
|
|
36
41
|
function setupEnvVarsForProxy(config) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
// Define Keys for Env Var
|
|
43
|
+
const prefix = 'VITE_MC_PROXY_';
|
|
44
|
+
const isEnabledKey = prefix + 'ENABLED';
|
|
45
|
+
const allowList = prefix + 'ALLOW_LIST';
|
|
46
|
+
if (config === true) {
|
|
47
|
+
config = {}; // Use Default values
|
|
48
|
+
}
|
|
49
|
+
process.env[isEnabledKey] = String(!!config); // 'true' or 'false'
|
|
50
|
+
if (config) {
|
|
51
|
+
// These values are only configured if the Proxy is enabled
|
|
52
|
+
// You cannot access them via import.meta.env if the Proxy
|
|
53
|
+
// is set to false
|
|
54
|
+
process.env[allowList] = JSON.stringify(config.allowListHosts ?? []);
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
function motionCanvasCorsProxy(middleware, config) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
// Set the default config if no config was provided
|
|
59
|
+
config.allowedMimeTypes ??= ['image/*', 'video/*'];
|
|
60
|
+
config.allowListHosts ??= [];
|
|
61
|
+
// Check the Mime Types to have a correct structure (left/right)
|
|
62
|
+
// not having them in the correct format would crash the Middleware
|
|
63
|
+
// further down below
|
|
64
|
+
if ((config.allowedMimeTypes ?? []).some(e => e.split('/').length !== 2)) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
"Invalid config for Proxy:\nAll Entries must have the following format:\n 'left/right' where left may be '*'",
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
middleware.use((req, res, next) => {
|
|
70
|
+
if (!req.url || !req.url.startsWith('/cors-proxy/')) {
|
|
71
|
+
// url does not start with /cors-proxy/, so this
|
|
72
|
+
// middleware does not care about it
|
|
73
|
+
return next();
|
|
61
74
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return tryGetResource(res, sourceUrl, config).catch(error => {
|
|
85
|
-
writeError(error, res);
|
|
86
|
-
});
|
|
75
|
+
// For now, only allow GET Requests
|
|
76
|
+
if (req.method !== 'GET') {
|
|
77
|
+
return writeError('Only GET Requests are allowed', res, 405);
|
|
78
|
+
}
|
|
79
|
+
let sourceUrl;
|
|
80
|
+
try {
|
|
81
|
+
sourceUrl = extractDestination(req.url);
|
|
82
|
+
} catch (err) {
|
|
83
|
+
return writeError(err, res);
|
|
84
|
+
}
|
|
85
|
+
if (
|
|
86
|
+
!isReceivedUrlInAllowedHosts(sourceUrl.hostname, config.allowListHosts)
|
|
87
|
+
) {
|
|
88
|
+
return writeError(
|
|
89
|
+
`Blocked by Proxy: ${sourceUrl.hostname} is not on Hosts Allowlist`,
|
|
90
|
+
res,
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
// Get the resource, do some checks. Throws an Error
|
|
94
|
+
// if the checks fail. The catch then writes an Error
|
|
95
|
+
return tryGetResource(res, sourceUrl, config).catch(error => {
|
|
96
|
+
writeError(error, res);
|
|
87
97
|
});
|
|
98
|
+
});
|
|
88
99
|
}
|
|
89
100
|
/**
|
|
90
101
|
* Unwrap the destination from the URL.
|
|
@@ -98,32 +109,34 @@ function motionCanvasCorsProxy(middleware, config) {
|
|
|
98
109
|
* @returns The URL that needs to be called.
|
|
99
110
|
*/
|
|
100
111
|
function extractDestination(url) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
const withoutPrefix = url.replace('/cors-proxy/', '');
|
|
113
|
+
const asUrl = new URL(decodeURIComponent(withoutPrefix));
|
|
114
|
+
if (asUrl.protocol !== 'http:' && asUrl.protocol !== 'https:') {
|
|
115
|
+
throw new Error('Only supported protocols are http and https');
|
|
116
|
+
}
|
|
117
|
+
return asUrl;
|
|
107
118
|
}
|
|
108
119
|
/**
|
|
109
120
|
* A simple Error Helper that will write an Error and close the response.
|
|
110
121
|
*/
|
|
111
122
|
function writeError(message, res, statusCode = 400) {
|
|
112
|
-
|
|
113
|
-
|
|
123
|
+
res.writeHead(statusCode, message);
|
|
124
|
+
res.end();
|
|
114
125
|
}
|
|
115
126
|
/**
|
|
116
127
|
* Check if the Proxy is allowed to get the requested resource based on the
|
|
117
128
|
* host.
|
|
118
129
|
*/
|
|
119
130
|
function isReceivedUrlInAllowedHosts(hostname, allowListHosts) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
if (!allowListHosts || allowListHosts.length === 0) {
|
|
132
|
+
// if the allowListHosts is just the predefinedAllowlist, the user has not
|
|
133
|
+
// set any additional hosts. In this case, allow any hostname
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
// Check if the hostname is any of the values set in allowListHosts
|
|
137
|
+
return allowListHosts.some(
|
|
138
|
+
e => e.toLowerCase().trim() === hostname.toLowerCase().trim(),
|
|
139
|
+
);
|
|
127
140
|
}
|
|
128
141
|
/**
|
|
129
142
|
* Check if the Proxy is allowed to get the requested resource based on the
|
|
@@ -133,87 +146,98 @@ function isReceivedUrlInAllowedHosts(hostname, allowListHosts) {
|
|
|
133
146
|
* Also handles catch-All Declarations like `image/*`.
|
|
134
147
|
*/
|
|
135
148
|
function isResultOfAllowedResourceType(foundMimeType, allowedMimeTypes) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
149
|
+
if (!allowedMimeTypes || allowedMimeTypes.length === 0) {
|
|
150
|
+
return true; // no filters set
|
|
151
|
+
}
|
|
152
|
+
if (foundMimeType.split('/').length !== 2) {
|
|
153
|
+
return false; // invalid mime structure
|
|
154
|
+
}
|
|
155
|
+
const [leftSegment, rightSegment] = foundMimeType
|
|
156
|
+
.split('/')
|
|
157
|
+
.map(e => e.trim().toLowerCase());
|
|
158
|
+
// Get all Segments where the left Part is identical between foundMimeType and
|
|
159
|
+
// allowedMimeType.
|
|
160
|
+
const leftSegmentMatches = allowedMimeTypes.filter(
|
|
161
|
+
e => e.trim().toLowerCase().split('/')[0] === leftSegment,
|
|
162
|
+
);
|
|
163
|
+
if (leftSegmentMatches.length === 0) {
|
|
164
|
+
// No matches at all, not even catchall - resource is rejected.
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
// This just gets the right part of the MIME Types from the
|
|
168
|
+
// configured allowList, e.g. "image/png" -> png
|
|
169
|
+
const rightSegmentOfLeftSegmentMatches = leftSegmentMatches.map(
|
|
170
|
+
e => e.split('/')[1],
|
|
171
|
+
);
|
|
172
|
+
// if an exact match or a catchall is found, the resource is allowed to be
|
|
173
|
+
// proxied.
|
|
174
|
+
return rightSegmentOfLeftSegmentMatches.some(
|
|
175
|
+
e => e === '*' || e === rightSegment,
|
|
176
|
+
);
|
|
158
177
|
}
|
|
159
178
|
/**
|
|
160
179
|
* Requests a remote resource with the help of axios
|
|
161
180
|
* May throw a string in case of a bad mime-type or missing headers
|
|
162
181
|
*/
|
|
163
182
|
async function tryGetResource(res, sourceUrl, config) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
catch (err) {
|
|
185
|
-
rej(err);
|
|
183
|
+
// Turn this callback into a Promise to avoid additional nesting
|
|
184
|
+
const result = await new Promise((res, rej) => {
|
|
185
|
+
try {
|
|
186
|
+
// We check what protocol was used and decide if we use http or https
|
|
187
|
+
const request = (
|
|
188
|
+
sourceUrl.protocol.startsWith('https')
|
|
189
|
+
? follow_redirects_1.default.https
|
|
190
|
+
: follow_redirects_1.default.http
|
|
191
|
+
).get(sourceUrl, data => {
|
|
192
|
+
res(data);
|
|
193
|
+
});
|
|
194
|
+
request.on('error', err => {
|
|
195
|
+
if (err.code && err.code === 'ENOTFOUND') {
|
|
196
|
+
// This is a bit hacky, but this basically returns as a
|
|
197
|
+
// 404 instead of crashing the Node Server with ENOTFOUND
|
|
198
|
+
res({statusCode: 404});
|
|
199
|
+
} else {
|
|
200
|
+
rej(err);
|
|
186
201
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
202
|
+
});
|
|
203
|
+
} catch (err) {
|
|
204
|
+
rej(err);
|
|
190
205
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
206
|
+
});
|
|
207
|
+
if (!result.statusCode || result.statusCode >= 300) {
|
|
208
|
+
throw 'Unexpected Status: ' + result.statusCode ?? 'NO_STATUS';
|
|
209
|
+
}
|
|
210
|
+
const contentType = result.headers['content-type'];
|
|
211
|
+
const contentLength = result.headers['content-length'];
|
|
212
|
+
if (!contentType) {
|
|
213
|
+
throw 'Proxied Response does not contain a Content Type';
|
|
214
|
+
}
|
|
215
|
+
if (!contentLength) {
|
|
216
|
+
throw 'Proxied Response does not contain a Content Length';
|
|
217
|
+
}
|
|
218
|
+
if (
|
|
219
|
+
!isResultOfAllowedResourceType(
|
|
220
|
+
contentType.toString(),
|
|
221
|
+
config.allowedMimeTypes ?? [],
|
|
222
|
+
)
|
|
223
|
+
) {
|
|
224
|
+
throw 'Proxied response has blocked content-type: ' + contentType;
|
|
225
|
+
}
|
|
226
|
+
// Prepare Response
|
|
227
|
+
for (const key in result.headers) {
|
|
228
|
+
const header = result.headers[key];
|
|
229
|
+
if (header === undefined) {
|
|
230
|
+
console.warn('Proxy: Received Header is empty. Skipping…');
|
|
231
|
+
continue;
|
|
195
232
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (header === undefined) {
|
|
206
|
-
console.warn('Proxy: Received Header is empty. Skipping…');
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
res.setHeader(key, header);
|
|
210
|
-
}
|
|
211
|
-
res.addListener('error', () => {
|
|
212
|
-
console.log('Proxy: Connection Reset');
|
|
213
|
-
});
|
|
214
|
-
res.setHeader('x-proxy-destination', sourceUrl.toString());
|
|
215
|
-
// Don't store on the server, just immediately pass on the
|
|
216
|
-
// received chunks
|
|
217
|
-
result.pipe(res);
|
|
233
|
+
res.setHeader(key, header);
|
|
234
|
+
}
|
|
235
|
+
res.addListener('error', () => {
|
|
236
|
+
console.log('Proxy: Connection Reset');
|
|
237
|
+
});
|
|
238
|
+
res.setHeader('x-proxy-destination', sourceUrl.toString());
|
|
239
|
+
// Don't store on the server, just immediately pass on the
|
|
240
|
+
// received chunks
|
|
241
|
+
result.pipe(res);
|
|
218
242
|
}
|
|
219
|
-
//# sourceMappingURL=corsProxy.js.map
|
|
243
|
+
//# sourceMappingURL=corsProxy.js.map
|
package/lib/partials/editor.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {Plugin} from 'vite';
|
|
2
|
+
import {Projects} from '../utils';
|
|
3
3
|
interface EditorPluginConfig {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
editor: string;
|
|
5
|
+
projects: Projects;
|
|
6
6
|
}
|
|
7
|
-
export declare function editorPlugin({
|
|
7
|
+
export declare function editorPlugin({
|
|
8
|
+
editor,
|
|
9
|
+
projects,
|
|
10
|
+
}: EditorPluginConfig): Plugin;
|
|
8
11
|
export {};
|
package/lib/partials/editor.js
CHANGED
|
@@ -1,72 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __importDefault =
|
|
3
|
+
(this && this.__importDefault) ||
|
|
4
|
+
function (mod) {
|
|
5
|
+
return mod && mod.__esModule ? mod : {default: mod};
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, '__esModule', {value: true});
|
|
6
8
|
exports.editorPlugin = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require(
|
|
8
|
-
const path_1 = __importDefault(require(
|
|
9
|
-
function editorPlugin({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
const fs_1 = __importDefault(require('fs'));
|
|
10
|
+
const path_1 = __importDefault(require('path'));
|
|
11
|
+
function editorPlugin({editor, projects}) {
|
|
12
|
+
const editorPath = path_1.default.dirname(require.resolve(editor));
|
|
13
|
+
const editorFile = fs_1.default.readFileSync(
|
|
14
|
+
path_1.default.resolve(editorPath, 'editor.html'),
|
|
15
|
+
);
|
|
16
|
+
const htmlParts = editorFile
|
|
17
|
+
.toString()
|
|
18
|
+
.replace(
|
|
19
|
+
'{{style}}',
|
|
20
|
+
`/@fs/${path_1.default.resolve(editorPath, 'style.css')}`,
|
|
21
|
+
)
|
|
22
|
+
.split('{{source}}');
|
|
23
|
+
const createHtml = src => htmlParts[0] + src + htmlParts[1];
|
|
24
|
+
const resolvedEditorId = '\0virtual:editor';
|
|
25
|
+
return {
|
|
26
|
+
name: 'revideo:editor',
|
|
27
|
+
async load(id) {
|
|
28
|
+
const [, query] = id.split('?');
|
|
29
|
+
if (id.startsWith(resolvedEditorId)) {
|
|
30
|
+
if (projects.list.length === 1) {
|
|
31
|
+
/* language=typescript */
|
|
32
|
+
return `\
|
|
26
33
|
import {editor} from '${editor}';
|
|
27
34
|
import project from '${projects.list[0].url}?project';
|
|
28
35
|
editor(project);
|
|
29
36
|
`;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
}
|
|
38
|
+
if (query) {
|
|
39
|
+
const params = new URLSearchParams(query);
|
|
40
|
+
const name = params.get('project');
|
|
41
|
+
if (name && projects.lookup.has(name)) {
|
|
42
|
+
/* language=typescript */
|
|
43
|
+
return `\
|
|
37
44
|
import {editor} from '${editor}';
|
|
38
45
|
import project from '${projects.lookup.get(name).url}?project';
|
|
39
46
|
editor(project);
|
|
40
47
|
`;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/* language=typescript */
|
|
51
|
+
return `\
|
|
45
52
|
import {index} from '${editor}';
|
|
46
53
|
index(${JSON.stringify(projects.list)});
|
|
47
54
|
`;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
configureServer(server) {
|
|
58
|
+
server.middlewares.use((req, res, next) => {
|
|
59
|
+
if (req.url) {
|
|
60
|
+
const url = new URL(req.url, `http://${req.headers.host}`);
|
|
61
|
+
if (url.pathname === '/') {
|
|
62
|
+
res.setHeader('Content-Type', 'text/html');
|
|
63
|
+
res.end(createHtml('/@id/__x00__virtual:editor'));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const name = url.pathname.slice(1);
|
|
67
|
+
if (name && projects.lookup.has(name)) {
|
|
68
|
+
res.setHeader('Content-Type', 'text/html');
|
|
69
|
+
res.end(createHtml(`/@id/__x00__virtual:editor?project=${name}`));
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
next();
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
};
|
|
70
77
|
}
|
|
71
78
|
exports.editorPlugin = editorPlugin;
|
|
72
|
-
//# sourceMappingURL=editor.js.map
|
|
79
|
+
//# sourceMappingURL=editor.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Plugin, WebSocketServer } from 'vite';
|
|
2
|
+
interface ExporterPluginConfig {
|
|
3
|
+
output: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function ffmpegExporterPlugin({ output }: ExporterPluginConfig): Plugin;
|
|
6
|
+
/**
|
|
7
|
+
* A simple bridge between the FFmpegExporterServer and FFmpegExporterClient.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This class lets the client exporter invoke methods on the server and receive
|
|
11
|
+
* responses using a simple Promise-based API.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FFmpegBridge {
|
|
14
|
+
private readonly ws;
|
|
15
|
+
private readonly config;
|
|
16
|
+
private process;
|
|
17
|
+
constructor(ws: WebSocketServer, config: ExporterPluginConfig);
|
|
18
|
+
private handleMessage;
|
|
19
|
+
private respondSuccess;
|
|
20
|
+
private respondError;
|
|
21
|
+
private videoFrameExtractors;
|
|
22
|
+
private handleVideoFrameMessage;
|
|
23
|
+
private handleRenderFinished;
|
|
24
|
+
}
|
|
25
|
+
export {};
|