@remotion/studio-server 4.0.515 → 4.0.517
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/dist/codemods/delete-jsx-node.d.ts +2 -4
- package/dist/codemods/delete-jsx-node.js +2 -13
- package/dist/codemods/duplicate-jsx-node.d.ts +3 -3
- package/dist/codemods/duplicate-jsx-node.js +10 -313
- package/dist/detect-outdated-remotion-skills.js +4 -4
- package/dist/preview-server/hmr-timing.d.ts +5 -0
- package/dist/preview-server/hmr-timing.js +9 -0
- package/dist/preview-server/hot-middleware/index.js +16 -1
- package/dist/preview-server/routes/can-update-sequence-props.js +49 -3
- package/dist/preview-server/routes/delete-jsx-node.js +23 -7
- package/dist/preview-server/routes/download-remote-asset.d.ts +2 -5
- package/dist/preview-server/routes/download-remote-asset.js +8 -70
- package/dist/preview-server/routes/remotion-skills-info.js +11 -1
- package/dist/preview-server/serve-static.d.ts +2 -1
- package/dist/preview-server/serve-static.js +31 -1
- package/dist/routes.js +2 -0
- package/package.json +9 -9
- package/dist/preview-server/routes/delete-effect-keyframe.d.ts +0 -3
- package/dist/preview-server/routes/delete-effect-keyframe.js +0 -89
- package/dist/preview-server/routes/delete-sequence-keyframe.d.ts +0 -3
- package/dist/preview-server/routes/delete-sequence-keyframe.js +0 -82
- package/dist/preview-server/routes/save-props-mutex.d.ts +0 -1
- package/dist/preview-server/routes/save-props-mutex.js +0 -11
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { deleteJsxElementAtPath, findJsxElementPathForDeletion, getJsxElementTagLabel } from '@remotion/studio-codemods';
|
|
2
2
|
import type { SequenceNodePath } from 'remotion';
|
|
3
3
|
export { deleteJsxElementAtPath, findJsxElementPathForDeletion, getJsxElementTagLabel, };
|
|
4
|
-
export declare const deleteJsxNodes: ({ input, nodePaths,
|
|
4
|
+
export declare const deleteJsxNodes: ({ input, nodePaths, }: {
|
|
5
5
|
input: string;
|
|
6
6
|
nodePaths: SequenceNodePath[];
|
|
7
|
-
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
8
7
|
}) => Promise<{
|
|
9
8
|
output: string;
|
|
10
9
|
formatted: boolean;
|
|
@@ -15,10 +14,9 @@ export declare const deleteJsxNodes: ({ input, nodePaths, prettierConfigOverride
|
|
|
15
14
|
newNodePath: SequenceNodePath | null;
|
|
16
15
|
}[];
|
|
17
16
|
}>;
|
|
18
|
-
export declare const deleteJsxNode: ({ input, nodePath,
|
|
17
|
+
export declare const deleteJsxNode: ({ input, nodePath, }: {
|
|
19
18
|
input: string;
|
|
20
19
|
nodePath: SequenceNodePath;
|
|
21
|
-
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
22
20
|
}) => Promise<{
|
|
23
21
|
output: string;
|
|
24
22
|
formatted: boolean;
|
|
@@ -5,24 +5,13 @@ const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
|
5
5
|
Object.defineProperty(exports, "deleteJsxElementAtPath", { enumerable: true, get: function () { return studio_codemods_1.deleteJsxElementAtPath; } });
|
|
6
6
|
Object.defineProperty(exports, "findJsxElementPathForDeletion", { enumerable: true, get: function () { return studio_codemods_1.findJsxElementPathForDeletion; } });
|
|
7
7
|
Object.defineProperty(exports, "getJsxElementTagLabel", { enumerable: true, get: function () { return studio_codemods_1.getJsxElementTagLabel; } });
|
|
8
|
-
const
|
|
9
|
-
const deleteJsxNodes = ({ input, nodePaths, prettierConfigOverride, }) => (0, studio_codemods_1.deleteJsxNodes)({
|
|
8
|
+
const deleteJsxNodes = ({ input, nodePaths, }) => (0, studio_codemods_1.deleteJsxNodes)({
|
|
10
9
|
input,
|
|
11
10
|
nodePaths,
|
|
12
|
-
formatFile: ({ contents, prettierConfigOverride: override }) => (0, format_file_content_1.formatFileContent)({
|
|
13
|
-
input: contents,
|
|
14
|
-
prettierConfigOverride: override,
|
|
15
|
-
}),
|
|
16
|
-
prettierConfigOverride,
|
|
17
11
|
});
|
|
18
12
|
exports.deleteJsxNodes = deleteJsxNodes;
|
|
19
|
-
const deleteJsxNode = ({ input, nodePath,
|
|
13
|
+
const deleteJsxNode = ({ input, nodePath, }) => (0, studio_codemods_1.deleteJsxNode)({
|
|
20
14
|
input,
|
|
21
15
|
nodePath,
|
|
22
|
-
formatFile: ({ contents, prettierConfigOverride: override }) => (0, format_file_content_1.formatFileContent)({
|
|
23
|
-
input: contents,
|
|
24
|
-
prettierConfigOverride: override,
|
|
25
|
-
}),
|
|
26
|
-
prettierConfigOverride,
|
|
27
16
|
});
|
|
28
17
|
exports.deleteJsxNode = deleteJsxNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { duplicateJsxElementAtPath } from '@remotion/studio-codemods';
|
|
2
2
|
import type { SequenceNodePath } from 'remotion';
|
|
3
|
-
export
|
|
3
|
+
export { duplicateJsxElementAtPath };
|
|
4
4
|
export declare const duplicateJsxNode: ({ input, nodePath, prettierConfigOverride, }: {
|
|
5
5
|
input: string;
|
|
6
6
|
nodePath: SequenceNodePath;
|
|
@@ -10,5 +10,5 @@ export declare const duplicateJsxNode: ({ input, nodePath, prettierConfigOverrid
|
|
|
10
10
|
formatted: boolean;
|
|
11
11
|
nodeLabel: string;
|
|
12
12
|
logLine: number;
|
|
13
|
-
nodePathRemappings: SequenceNodePathRemapping[];
|
|
13
|
+
nodePathRemappings: import("@remotion/studio-shared").SequenceNodePathRemapping[];
|
|
14
14
|
}>;
|
|
@@ -1,319 +1,16 @@
|
|
|
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 () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.duplicateJsxNode = exports.duplicateJsxElementAtPath = void 0;
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const delete_jsx_node_1 = require("./delete-jsx-node");
|
|
4
|
+
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
+
Object.defineProperty(exports, "duplicateJsxElementAtPath", { enumerable: true, get: function () { return studio_codemods_1.duplicateJsxElementAtPath; } });
|
|
40
6
|
const format_file_content_1 = require("./format-file-content");
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
7
|
+
const duplicateJsxNode = ({ input, nodePath, prettierConfigOverride, }) => (0, studio_codemods_1.duplicateJsxNode)({
|
|
8
|
+
input,
|
|
9
|
+
nodePath,
|
|
10
|
+
formatFile: ({ contents, prettierConfigOverride: override }) => (0, format_file_content_1.formatFileContent)({
|
|
11
|
+
input: contents,
|
|
12
|
+
prettierConfigOverride: override,
|
|
13
|
+
}),
|
|
14
|
+
prettierConfigOverride,
|
|
49
15
|
});
|
|
50
|
-
const uniquifyNamePropOnClone = (clone) => {
|
|
51
|
-
for (const attr of clone.openingElement.attributes) {
|
|
52
|
-
if (attr.type !== 'JSXAttribute' || attr.name.type !== 'JSXIdentifier') {
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
if (attr.name.name !== 'name') {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
if (!attr.value) {
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
if (attr.value.type === 'StringLiteral') {
|
|
62
|
-
attr.value.value = `${attr.value.value}-copy`;
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (attr.value.type === 'JSXExpressionContainer' &&
|
|
66
|
-
attr.value.expression.type === 'StringLiteral') {
|
|
67
|
-
attr.value.expression.value = `${attr.value.expression.value}-copy`;
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const duplicateInLogicalExpression = (parent, node, clone) => {
|
|
73
|
-
const frag = makeFragment(node, clone);
|
|
74
|
-
if (parent.left === node) {
|
|
75
|
-
parent.left = frag;
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
if (parent.right === node) {
|
|
79
|
-
parent.right = frag;
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
return false;
|
|
83
|
-
};
|
|
84
|
-
const duplicateInConditionalExpression = (parent, node, clone) => {
|
|
85
|
-
const frag = makeFragment(node, clone);
|
|
86
|
-
if (parent.consequent === node) {
|
|
87
|
-
parent.consequent = frag;
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
if (parent.alternate === node) {
|
|
91
|
-
parent.alternate = frag;
|
|
92
|
-
return true;
|
|
93
|
-
}
|
|
94
|
-
return false;
|
|
95
|
-
};
|
|
96
|
-
const duplicateInArrowFunctionExpression = (parent, node, clone) => {
|
|
97
|
-
const frag = makeFragment(node, clone);
|
|
98
|
-
if (parent.body === node) {
|
|
99
|
-
parent.body = frag;
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
return false;
|
|
103
|
-
};
|
|
104
|
-
const duplicateInReturnStatement = (parent, node, clone) => {
|
|
105
|
-
const frag = makeFragment(node, clone);
|
|
106
|
-
if (parent.argument === node) {
|
|
107
|
-
parent.argument = frag;
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
return false;
|
|
111
|
-
};
|
|
112
|
-
const duplicateInCallExpression = (parent, node, clone) => {
|
|
113
|
-
const idx = parent.arguments.indexOf(node);
|
|
114
|
-
if (idx !== -1) {
|
|
115
|
-
parent.arguments.splice(idx + 1, 0, clone);
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
return false;
|
|
119
|
-
};
|
|
120
|
-
const duplicateInOptionalCallExpression = (parent, node, clone) => {
|
|
121
|
-
const idx = parent.arguments.indexOf(node);
|
|
122
|
-
if (idx !== -1) {
|
|
123
|
-
parent.arguments.splice(idx + 1, 0, clone);
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
return false;
|
|
127
|
-
};
|
|
128
|
-
const duplicateInArrayExpression = (parent, node, clone) => {
|
|
129
|
-
const idx = parent.elements.indexOf(node);
|
|
130
|
-
if (idx !== -1) {
|
|
131
|
-
parent.elements.splice(idx + 1, 0, clone);
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
return false;
|
|
135
|
-
};
|
|
136
|
-
const duplicateInAssignmentExpression = (parent, node, clone) => {
|
|
137
|
-
const frag = makeFragment(node, clone);
|
|
138
|
-
if (parent.right === node) {
|
|
139
|
-
parent.right = frag;
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
return false;
|
|
143
|
-
};
|
|
144
|
-
const duplicateInVariableDeclarator = (parent, node, clone) => {
|
|
145
|
-
const frag = makeFragment(node, clone);
|
|
146
|
-
if (parent.init === node) {
|
|
147
|
-
parent.init = frag;
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
|
-
return false;
|
|
151
|
-
};
|
|
152
|
-
const duplicateInExportDefaultDeclaration = (parent, node, clone) => {
|
|
153
|
-
const frag = makeFragment(node, clone);
|
|
154
|
-
if (parent.declaration === node) {
|
|
155
|
-
parent.declaration =
|
|
156
|
-
frag;
|
|
157
|
-
return true;
|
|
158
|
-
}
|
|
159
|
-
return false;
|
|
160
|
-
};
|
|
161
|
-
const duplicateInSequenceExpression = (parent, node, clone) => {
|
|
162
|
-
const idx = parent.expressions.indexOf(node);
|
|
163
|
-
if (idx !== -1) {
|
|
164
|
-
parent.expressions.splice(idx + 1, 0, clone);
|
|
165
|
-
return true;
|
|
166
|
-
}
|
|
167
|
-
return false;
|
|
168
|
-
};
|
|
169
|
-
const duplicateInNewExpression = (parent, node, clone) => {
|
|
170
|
-
const idx = parent.arguments.indexOf(node);
|
|
171
|
-
if (idx !== -1) {
|
|
172
|
-
parent.arguments.splice(idx + 1, 0, clone);
|
|
173
|
-
return true;
|
|
174
|
-
}
|
|
175
|
-
return false;
|
|
176
|
-
};
|
|
177
|
-
const duplicateInExpressionStatement = (parent, node, clone) => {
|
|
178
|
-
const frag = makeFragment(node, clone);
|
|
179
|
-
if (parent.expression === node) {
|
|
180
|
-
parent.expression = frag;
|
|
181
|
-
return true;
|
|
182
|
-
}
|
|
183
|
-
return false;
|
|
184
|
-
};
|
|
185
|
-
const duplicateInParenthesizedExpression = (parent, node, clone) => {
|
|
186
|
-
const frag = makeFragment(node, clone);
|
|
187
|
-
if (parent.expression === node) {
|
|
188
|
-
parent.expression = frag;
|
|
189
|
-
return true;
|
|
190
|
-
}
|
|
191
|
-
return false;
|
|
192
|
-
};
|
|
193
|
-
const duplicateInJSXExpressionContainer = (parent, node, clone) => {
|
|
194
|
-
const frag = makeFragment(node, clone);
|
|
195
|
-
if (parent.expression === node) {
|
|
196
|
-
parent.expression = frag;
|
|
197
|
-
return true;
|
|
198
|
-
}
|
|
199
|
-
return false;
|
|
200
|
-
};
|
|
201
|
-
const duplicateInTSAsExpression = (parent, node, clone) => {
|
|
202
|
-
const frag = makeFragment(node, clone);
|
|
203
|
-
if (parent.expression === node) {
|
|
204
|
-
parent.expression = frag;
|
|
205
|
-
return true;
|
|
206
|
-
}
|
|
207
|
-
return false;
|
|
208
|
-
};
|
|
209
|
-
const duplicateInJSXParentChildren = (parent, node, clone) => {
|
|
210
|
-
const idx = parent.children.indexOf(node);
|
|
211
|
-
if (idx !== -1) {
|
|
212
|
-
parent.children.splice(idx + 1, 0, clone);
|
|
213
|
-
return true;
|
|
214
|
-
}
|
|
215
|
-
return false;
|
|
216
|
-
};
|
|
217
|
-
const insertDuplicateForParent = (parentNode, node, clone) => {
|
|
218
|
-
if (namedTypes.LogicalExpression.check(parentNode)) {
|
|
219
|
-
return duplicateInLogicalExpression(parentNode, node, clone);
|
|
220
|
-
}
|
|
221
|
-
if (namedTypes.ConditionalExpression.check(parentNode)) {
|
|
222
|
-
return duplicateInConditionalExpression(parentNode, node, clone);
|
|
223
|
-
}
|
|
224
|
-
if (namedTypes.ArrowFunctionExpression.check(parentNode)) {
|
|
225
|
-
return duplicateInArrowFunctionExpression(parentNode, node, clone);
|
|
226
|
-
}
|
|
227
|
-
if (namedTypes.ReturnStatement.check(parentNode)) {
|
|
228
|
-
return duplicateInReturnStatement(parentNode, node, clone);
|
|
229
|
-
}
|
|
230
|
-
if (namedTypes.CallExpression.check(parentNode)) {
|
|
231
|
-
return duplicateInCallExpression(parentNode, node, clone);
|
|
232
|
-
}
|
|
233
|
-
if (parentNode.type === 'OptionalCallExpression') {
|
|
234
|
-
return duplicateInOptionalCallExpression(parentNode, node, clone);
|
|
235
|
-
}
|
|
236
|
-
if (namedTypes.ArrayExpression.check(parentNode)) {
|
|
237
|
-
return duplicateInArrayExpression(parentNode, node, clone);
|
|
238
|
-
}
|
|
239
|
-
if (namedTypes.AssignmentExpression.check(parentNode)) {
|
|
240
|
-
return duplicateInAssignmentExpression(parentNode, node, clone);
|
|
241
|
-
}
|
|
242
|
-
if (namedTypes.VariableDeclarator.check(parentNode)) {
|
|
243
|
-
return duplicateInVariableDeclarator(parentNode, node, clone);
|
|
244
|
-
}
|
|
245
|
-
if (namedTypes.ExportDefaultDeclaration.check(parentNode)) {
|
|
246
|
-
return duplicateInExportDefaultDeclaration(parentNode, node, clone);
|
|
247
|
-
}
|
|
248
|
-
if (namedTypes.SequenceExpression.check(parentNode)) {
|
|
249
|
-
return duplicateInSequenceExpression(parentNode, node, clone);
|
|
250
|
-
}
|
|
251
|
-
if (namedTypes.NewExpression.check(parentNode)) {
|
|
252
|
-
return duplicateInNewExpression(parentNode, node, clone);
|
|
253
|
-
}
|
|
254
|
-
if (namedTypes.ExpressionStatement.check(parentNode)) {
|
|
255
|
-
return duplicateInExpressionStatement(parentNode, node, clone);
|
|
256
|
-
}
|
|
257
|
-
if (namedTypes.ParenthesizedExpression.check(parentNode)) {
|
|
258
|
-
return duplicateInParenthesizedExpression(parentNode, node, clone);
|
|
259
|
-
}
|
|
260
|
-
if (namedTypes.JSXExpressionContainer.check(parentNode)) {
|
|
261
|
-
return duplicateInJSXExpressionContainer(parentNode, node, clone);
|
|
262
|
-
}
|
|
263
|
-
if (namedTypes.TSAsExpression.check(parentNode)) {
|
|
264
|
-
return duplicateInTSAsExpression(parentNode, node, clone);
|
|
265
|
-
}
|
|
266
|
-
if (namedTypes.JSXElement.check(parentNode)) {
|
|
267
|
-
return duplicateInJSXParentChildren(parentNode, node, clone);
|
|
268
|
-
}
|
|
269
|
-
if (namedTypes.JSXFragment.check(parentNode)) {
|
|
270
|
-
return duplicateInJSXParentChildren(parentNode, node, clone);
|
|
271
|
-
}
|
|
272
|
-
return false;
|
|
273
|
-
};
|
|
274
|
-
const duplicateJsxElementAtPath = (jsxPath) => {
|
|
275
|
-
const { node, parentPath } = jsxPath;
|
|
276
|
-
if (!parentPath) {
|
|
277
|
-
throw new Error('Cannot duplicate JSX element with no parent');
|
|
278
|
-
}
|
|
279
|
-
const jsxNode = node;
|
|
280
|
-
const clone = (0, types_1.cloneNode)(jsxNode, true);
|
|
281
|
-
uniquifyNamePropOnClone(clone);
|
|
282
|
-
if (insertDuplicateForParent(parentPath.node, jsxNode, clone)) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
jsxPath.replace(makeFragment(jsxNode, clone));
|
|
286
|
-
};
|
|
287
|
-
exports.duplicateJsxElementAtPath = duplicateJsxElementAtPath;
|
|
288
|
-
const duplicateJsxNode = async ({ input, nodePath, prettierConfigOverride, }) => {
|
|
289
|
-
var _a, _b;
|
|
290
|
-
var _c, _d;
|
|
291
|
-
const ast = (0, parse_ast_1.parseAst)(input);
|
|
292
|
-
const capturedNodePaths = (0, get_node_path_remappings_1.captureJsxNodePaths)(ast);
|
|
293
|
-
const jsxPath = (0, delete_jsx_node_1.findJsxElementPathForDeletion)(ast, nodePath);
|
|
294
|
-
if (!jsxPath) {
|
|
295
|
-
throw new Error('Could not find a JSX element at the specified location to duplicate');
|
|
296
|
-
}
|
|
297
|
-
const jsxElement = jsxPath.node;
|
|
298
|
-
const nodeLabel = (0, delete_jsx_node_1.getJsxElementTagLabel)(jsxElement);
|
|
299
|
-
const logLine = (_d = (_c = (_a = jsxElement.openingElement.loc) === null || _a === void 0 ? void 0 : _a.start.line) !== null && _c !== void 0 ? _c : (_b = jsxElement.loc) === null || _b === void 0 ? void 0 : _b.start.line) !== null && _d !== void 0 ? _d : 1;
|
|
300
|
-
(0, exports.duplicateJsxElementAtPath)(jsxPath);
|
|
301
|
-
const finalFile = (0, parse_ast_1.serializeAst)(ast);
|
|
302
|
-
const { output, formatted } = await (0, format_file_content_1.formatFileContent)({
|
|
303
|
-
input: finalFile,
|
|
304
|
-
prettierConfigOverride,
|
|
305
|
-
});
|
|
306
|
-
const { nodePathRemappings } = (0, get_node_path_remappings_1.getNodePathRemappings)({
|
|
307
|
-
ast,
|
|
308
|
-
captured: capturedNodePaths,
|
|
309
|
-
output,
|
|
310
|
-
});
|
|
311
|
-
return {
|
|
312
|
-
output,
|
|
313
|
-
formatted,
|
|
314
|
-
nodeLabel,
|
|
315
|
-
logLine,
|
|
316
|
-
nodePathRemappings,
|
|
317
|
-
};
|
|
318
|
-
};
|
|
319
16
|
exports.duplicateJsxNode = duplicateJsxNode;
|
|
@@ -44,10 +44,10 @@ const getStatusForSkillsDirectory = ({ currentVersion, scope, skillsDirectory, }
|
|
|
44
44
|
}
|
|
45
45
|
const outdatedSkillNames = remotion_skill_names_1.remotionSkillNames.filter((skillName) => {
|
|
46
46
|
const skill = installedSkills.get(skillName);
|
|
47
|
-
return (
|
|
48
|
-
skill.version === null ||
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
return ((skill === null || skill === void 0 ? void 0 : skill.installed) &&
|
|
48
|
+
(skill.version === null ||
|
|
49
|
+
semver_1.default.valid(skill.version) === null ||
|
|
50
|
+
semver_1.default.lt(skill.version, currentVersion)));
|
|
51
51
|
});
|
|
52
52
|
if (outdatedSkillNames.length > 0) {
|
|
53
53
|
return { type: 'outdated', scope, skillsDirectory, outdatedSkillNames };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logHmrTiming = void 0;
|
|
4
|
+
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
const logHmrTiming = ({ detail, logLevel, stage, }) => {
|
|
6
|
+
const detailSuffix = detail ? ` ${detail}` : '';
|
|
7
|
+
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[hmr-timing] epoch=${Date.now()} monotonic=${performance.now().toFixed(3)} stage=${stage}${detailSuffix}`);
|
|
8
|
+
};
|
|
9
|
+
exports.logHmrTiming = logHmrTiming;
|
|
@@ -7,14 +7,23 @@
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.setupWebpackHmr = void 0;
|
|
9
9
|
const renderer_1 = require("@remotion/renderer");
|
|
10
|
+
const hmr_timing_1 = require("../hmr-timing");
|
|
10
11
|
const setupWebpackHmr = (compiler, logLevel, liveEventsServer) => {
|
|
11
12
|
let latestStats = null;
|
|
12
13
|
const publishHmr = (hmrEvent) => {
|
|
13
14
|
liveEventsServer.sendEventToClient({ type: 'hmr', hmrEvent });
|
|
14
15
|
};
|
|
15
16
|
compiler.hooks.invalid.tap('remotion', onInvalid);
|
|
17
|
+
compiler.hooks.watchRun.tap('remotion-hmr-timing', () => {
|
|
18
|
+
(0, hmr_timing_1.logHmrTiming)({ detail: null, logLevel, stage: 'compiler-watch-run' });
|
|
19
|
+
});
|
|
16
20
|
compiler.hooks.done.tap('remotion', onDone);
|
|
17
|
-
function onInvalid() {
|
|
21
|
+
function onInvalid(fileName, changeTime) {
|
|
22
|
+
(0, hmr_timing_1.logHmrTiming)({
|
|
23
|
+
detail: `file=${fileName !== null && fileName !== void 0 ? fileName : 'manual'} changeTime=${changeTime}`,
|
|
24
|
+
logLevel,
|
|
25
|
+
stage: 'compiler-invalid',
|
|
26
|
+
});
|
|
18
27
|
latestStats = null;
|
|
19
28
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Building...');
|
|
20
29
|
publishHmr({
|
|
@@ -22,9 +31,15 @@ const setupWebpackHmr = (compiler, logLevel, liveEventsServer) => {
|
|
|
22
31
|
});
|
|
23
32
|
}
|
|
24
33
|
function onDone(statsResult) {
|
|
34
|
+
(0, hmr_timing_1.logHmrTiming)({
|
|
35
|
+
detail: `reportedBuildDuration=${statsResult.endTime - statsResult.startTime}ms`,
|
|
36
|
+
logLevel,
|
|
37
|
+
stage: 'compiler-done',
|
|
38
|
+
});
|
|
25
39
|
// Keep hold of latest stats so they can be propagated to new clients
|
|
26
40
|
latestStats = statsResult;
|
|
27
41
|
publishStats('built', latestStats, publishHmr);
|
|
42
|
+
(0, hmr_timing_1.logHmrTiming)({ detail: null, logLevel, stage: 'hmr-stats-published' });
|
|
28
43
|
}
|
|
29
44
|
liveEventsServer.addNewClientListener(() => {
|
|
30
45
|
if (latestStats) {
|
|
@@ -775,6 +775,10 @@ const getPropsStatus = (jsxElement, ast, videoConfigValues, assetKeys) => {
|
|
|
775
775
|
const props = {};
|
|
776
776
|
for (const attr of jsxElement.attributes) {
|
|
777
777
|
if (attr.type === 'JSXSpreadAttribute') {
|
|
778
|
+
// The spread may override every prop written before it
|
|
779
|
+
for (const key of Object.keys(props)) {
|
|
780
|
+
props[key] = computedStatus();
|
|
781
|
+
}
|
|
778
782
|
continue;
|
|
779
783
|
}
|
|
780
784
|
if (attr.name.type === 'JSXNamespacedName') {
|
|
@@ -1113,14 +1117,28 @@ const getBorderRadiusShorthandStatus = ({ propValue, ast, videoConfigValues, })
|
|
|
1113
1117
|
}
|
|
1114
1118
|
return computedStatus();
|
|
1115
1119
|
};
|
|
1116
|
-
const getNestedPropStatus = ({ jsxElement, ast, parentKey, childKey, videoConfigValues, allowSpecialValues, }) => {
|
|
1117
|
-
const
|
|
1120
|
+
const getNestedPropStatus = ({ jsxElement, ast, parentKey, childKey, videoConfigValues, allowSpecialValues, lastSpreadIndex, }) => {
|
|
1121
|
+
const attrIndex = jsxElement.attributes.findIndex((a) => a.type !== 'JSXSpreadAttribute' &&
|
|
1118
1122
|
a.name.type !== 'JSXNamespacedName' &&
|
|
1119
1123
|
a.name.name === parentKey);
|
|
1120
|
-
|
|
1124
|
+
const attr = attrIndex === -1
|
|
1125
|
+
? undefined
|
|
1126
|
+
: jsxElement.attributes[attrIndex];
|
|
1127
|
+
if (attrIndex !== -1 && attrIndex < lastSpreadIndex) {
|
|
1128
|
+
// A later spread may replace the whole parent object
|
|
1129
|
+
return computedStatus();
|
|
1130
|
+
}
|
|
1131
|
+
if (!attr) {
|
|
1132
|
+
if (lastSpreadIndex !== -1) {
|
|
1133
|
+
// The spread may provide the parent object
|
|
1134
|
+
return computedStatus();
|
|
1135
|
+
}
|
|
1121
1136
|
// Parent attribute doesn't exist, nested prop can be added
|
|
1122
1137
|
return staticStatus(undefined, null);
|
|
1123
1138
|
}
|
|
1139
|
+
if (!attr.value) {
|
|
1140
|
+
return staticStatus(undefined, null);
|
|
1141
|
+
}
|
|
1124
1142
|
if (attr.value.type !== 'JSXExpressionContainer') {
|
|
1125
1143
|
return computedStatus();
|
|
1126
1144
|
}
|
|
@@ -1210,6 +1228,13 @@ const computeEffectsForJsx = ({ ast, jsxElement, effects, videoConfigValues, })
|
|
|
1210
1228
|
}));
|
|
1211
1229
|
};
|
|
1212
1230
|
const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys, assetKeys, videoConfigValues, }) => {
|
|
1231
|
+
// A JSX spread attribute ({...props}) is invisible to the parser and may
|
|
1232
|
+
// set or override every prop that is not explicitly written after it.
|
|
1233
|
+
// Affected props are treated as computed so the runtime values pass
|
|
1234
|
+
// through untouched and Visual Mode does not offer to edit them.
|
|
1235
|
+
// Attributes written after the last spread win at runtime and can be
|
|
1236
|
+
// parsed as usual.
|
|
1237
|
+
const lastSpreadIndex = jsxElement.attributes.reduce((highest, attr, index) => attr.type === 'JSXSpreadAttribute' ? index : highest, -1);
|
|
1213
1238
|
const allProps = getPropsStatus(jsxElement, ast, videoConfigValues, assetKeys);
|
|
1214
1239
|
const filteredProps = {};
|
|
1215
1240
|
const mixedBorderRadius = hasMixedBorderRadiusRepresentation(jsxElement);
|
|
@@ -1221,6 +1246,14 @@ const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys,
|
|
|
1221
1246
|
continue;
|
|
1222
1247
|
}
|
|
1223
1248
|
if (key === 'children') {
|
|
1249
|
+
const childrenAttrIndex = jsxElement.attributes.findIndex((attr) => attr.type === 'JSXAttribute' &&
|
|
1250
|
+
attr.name.type === 'JSXIdentifier' &&
|
|
1251
|
+
attr.name.name === 'children');
|
|
1252
|
+
if (childrenAttrIndex !== -1 && childrenAttrIndex < lastSpreadIndex) {
|
|
1253
|
+
// A later spread may override the children attribute
|
|
1254
|
+
filteredProps[key] = computedStatus();
|
|
1255
|
+
continue;
|
|
1256
|
+
}
|
|
1224
1257
|
const staticChildrenAttribute = (0, exports.getStaticJsxChildrenAttribute)(jsxElement);
|
|
1225
1258
|
if (staticChildrenAttribute) {
|
|
1226
1259
|
filteredProps[key] = staticStatus(staticChildrenAttribute.value, null);
|
|
@@ -1230,6 +1263,14 @@ const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys,
|
|
|
1230
1263
|
filteredProps[key] = computedStatus();
|
|
1231
1264
|
continue;
|
|
1232
1265
|
}
|
|
1266
|
+
// JSX element children are compiled after any spread and win over
|
|
1267
|
+
// it. Only if the element body is empty may the spread provide the
|
|
1268
|
+
// children.
|
|
1269
|
+
const hasMeaningfulJsxChildren = jsxElementNode.children.some((candidate) => !(candidate.type === 'JSXText' && candidate.value.trim() === ''));
|
|
1270
|
+
if (!hasMeaningfulJsxChildren && lastSpreadIndex !== -1) {
|
|
1271
|
+
filteredProps[key] = computedStatus();
|
|
1272
|
+
continue;
|
|
1273
|
+
}
|
|
1233
1274
|
const staticTextContent = (0, exports.getStaticJsxTextContent)(jsxElementNode);
|
|
1234
1275
|
filteredProps[key] = staticTextContent
|
|
1235
1276
|
? staticStatus(staticTextContent.value, null)
|
|
@@ -1245,11 +1286,16 @@ const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys,
|
|
|
1245
1286
|
childKey: key.slice(dotIndex + 1),
|
|
1246
1287
|
videoConfigValues,
|
|
1247
1288
|
allowSpecialValues: assetKeys.includes(key),
|
|
1289
|
+
lastSpreadIndex,
|
|
1248
1290
|
});
|
|
1249
1291
|
}
|
|
1250
1292
|
else if (key in allProps) {
|
|
1251
1293
|
filteredProps[key] = allProps[key];
|
|
1252
1294
|
}
|
|
1295
|
+
else if (lastSpreadIndex !== -1) {
|
|
1296
|
+
// The spread may provide this prop
|
|
1297
|
+
filteredProps[key] = computedStatus();
|
|
1298
|
+
}
|
|
1253
1299
|
else {
|
|
1254
1300
|
filteredProps[key] = staticStatus(undefined, null);
|
|
1255
1301
|
}
|
|
@@ -7,9 +7,9 @@ const delete_jsx_node_1 = require("../../codemods/delete-jsx-node");
|
|
|
7
7
|
const file_watcher_1 = require("../../file-watcher");
|
|
8
8
|
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
9
9
|
const format_log_file_location_1 = require("../format-log-file-location");
|
|
10
|
+
const hmr_timing_1 = require("../hmr-timing");
|
|
10
11
|
const sequence_node_path_mutation_1 = require("../sequence-node-path-mutation");
|
|
11
12
|
const undo_stack_1 = require("../undo-stack");
|
|
12
|
-
const log_update_1 = require("./log-updates/log-update");
|
|
13
13
|
const source_file_write_queue_1 = require("./source-file-write-queue");
|
|
14
14
|
const getDeletedNodeDescription = (nodeLabels) => {
|
|
15
15
|
if (nodeLabels.length === 1) {
|
|
@@ -21,6 +21,11 @@ const deleteJsxNodeHandler = ({ input: { nodes }, remotionRoot, logLevel }) => {
|
|
|
21
21
|
return (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
|
|
22
22
|
var _a;
|
|
23
23
|
try {
|
|
24
|
+
(0, hmr_timing_1.logHmrTiming)({
|
|
25
|
+
detail: null,
|
|
26
|
+
logLevel,
|
|
27
|
+
stage: 'delete-jsx-node-request-start',
|
|
28
|
+
});
|
|
24
29
|
if (nodes.length === 0) {
|
|
25
30
|
throw new Error('No JSX nodes were specified for deletion');
|
|
26
31
|
}
|
|
@@ -38,7 +43,7 @@ const deleteJsxNodeHandler = ({ input: { nodes }, remotionRoot, logLevel }) => {
|
|
|
38
43
|
action: 'modify',
|
|
39
44
|
});
|
|
40
45
|
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
41
|
-
const { output,
|
|
46
|
+
const { output, nodeLabels, logLines, nodePathRemappings } = await (0, delete_jsx_node_1.deleteJsxNodes)({
|
|
42
47
|
input: fileContents,
|
|
43
48
|
nodePaths: fileItems.map((item) => item.nodePath),
|
|
44
49
|
});
|
|
@@ -47,12 +52,16 @@ const deleteJsxNodeHandler = ({ input: { nodes }, remotionRoot, logLevel }) => {
|
|
|
47
52
|
fileRelativeToRoot,
|
|
48
53
|
fileContents,
|
|
49
54
|
output,
|
|
50
|
-
formatted,
|
|
51
55
|
nodeLabels,
|
|
52
56
|
nodePathRemappings,
|
|
53
57
|
logLine: Math.min(...logLines),
|
|
54
58
|
};
|
|
55
59
|
}));
|
|
60
|
+
(0, hmr_timing_1.logHmrTiming)({
|
|
61
|
+
detail: `files=${updates.length}`,
|
|
62
|
+
logLevel,
|
|
63
|
+
stage: 'delete-jsx-node-codemod-complete',
|
|
64
|
+
});
|
|
56
65
|
const nodePathMutation = (0, sequence_node_path_mutation_1.broadcastSequenceNodePathMutation)(updates.map((update) => ({
|
|
57
66
|
absolutePath: update.absolutePath,
|
|
58
67
|
remappings: update.nodePathRemappings,
|
|
@@ -76,22 +85,29 @@ const deleteJsxNodeHandler = ({ input: { nodes }, remotionRoot, logLevel }) => {
|
|
|
76
85
|
nodePathRemappings: update.nodePathRemappings,
|
|
77
86
|
});
|
|
78
87
|
(0, undo_stack_1.suppressUndoStackInvalidation)(update.absolutePath);
|
|
88
|
+
(0, hmr_timing_1.logHmrTiming)({
|
|
89
|
+
detail: `file=${update.fileRelativeToRoot}`,
|
|
90
|
+
logLevel,
|
|
91
|
+
stage: 'source-file-write-start',
|
|
92
|
+
});
|
|
79
93
|
(0, file_watcher_1.writeFileAndNotifyFileWatchers)({
|
|
80
94
|
file: update.absolutePath,
|
|
81
95
|
content: update.output,
|
|
82
96
|
originatorClientId: undefined,
|
|
83
97
|
metadata: { skipSequencePropsUpdate: true },
|
|
84
98
|
});
|
|
99
|
+
(0, hmr_timing_1.logHmrTiming)({
|
|
100
|
+
detail: `file=${update.fileRelativeToRoot}`,
|
|
101
|
+
logLevel,
|
|
102
|
+
stage: 'source-file-write-complete',
|
|
103
|
+
});
|
|
85
104
|
const locationLabel = (0, format_log_file_location_1.formatLogFileLocation)({
|
|
86
105
|
remotionRoot,
|
|
87
106
|
absolutePath: update.absolutePath,
|
|
88
107
|
line: update.logLine,
|
|
89
108
|
});
|
|
90
109
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `${(0, source_file_write_queue_1.getCodemodTimingPrefix)(logLevel)}${renderer_1.RenderInternals.chalk.blueBright(`${locationLabel}`)} Deleted ${deletedNodeDescription}`);
|
|
91
|
-
|
|
92
|
-
(0, log_update_1.warnAboutPrettierOnce)(logLevel);
|
|
93
|
-
}
|
|
94
|
-
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, `[delete-jsx-node] Wrote ${update.fileRelativeToRoot}${update.formatted ? ' (formatted)' : ''}`);
|
|
110
|
+
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, `[delete-jsx-node] Wrote ${update.fileRelativeToRoot}`);
|
|
95
111
|
}
|
|
96
112
|
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
97
113
|
return {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { type DownloadRemoteAssetRequest, type DownloadRemoteAssetResponse
|
|
1
|
+
import { getRemoteAssetFilename, type DownloadRemoteAssetRequest, type DownloadRemoteAssetResponse } from '@remotion/studio-shared';
|
|
2
2
|
import type { ApiHandler } from '../api-types';
|
|
3
|
-
export
|
|
4
|
-
fileType: ImageFileType;
|
|
5
|
-
url: URL;
|
|
6
|
-
}) => string;
|
|
3
|
+
export { getRemoteAssetFilename };
|
|
7
4
|
export declare const downloadRemoteAssetHandler: ApiHandler<DownloadRemoteAssetRequest, DownloadRemoteAssetResponse>;
|
|
@@ -9,58 +9,9 @@ const node_fs_1 = require("node:fs");
|
|
|
9
9
|
const node_net_1 = require("node:net");
|
|
10
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
11
11
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
12
|
+
Object.defineProperty(exports, "getRemoteAssetFilename", { enumerable: true, get: function () { return studio_shared_1.getRemoteAssetFilename; } });
|
|
12
13
|
const validate_same_origin_1 = require("../validate-same-origin");
|
|
13
|
-
const maxRemoteAssetSize = 50 * 1024 * 1024;
|
|
14
|
-
const remoteAssetDownloadTimeout = 15000;
|
|
15
14
|
const maxRemoteAssetRedirects = 5;
|
|
16
|
-
const remoteAssetAcceptHeader = 'image/png,image/apng,image/jpeg,image/webp,image/bmp,image/gif';
|
|
17
|
-
const extensionsForFileType = {
|
|
18
|
-
png: ['png'],
|
|
19
|
-
apng: ['png', 'apng'],
|
|
20
|
-
jpeg: ['jpg', 'jpeg'],
|
|
21
|
-
webp: ['webp'],
|
|
22
|
-
bmp: ['bmp'],
|
|
23
|
-
gif: ['gif'],
|
|
24
|
-
};
|
|
25
|
-
const safeDecodeURIComponent = (value) => {
|
|
26
|
-
try {
|
|
27
|
-
return decodeURIComponent(value);
|
|
28
|
-
}
|
|
29
|
-
catch (_a) {
|
|
30
|
-
return value;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const sanitizeAssetFilename = (filename) => {
|
|
34
|
-
return Array.from(filename)
|
|
35
|
-
.map((character) => {
|
|
36
|
-
const charCode = character.charCodeAt(0);
|
|
37
|
-
return charCode <= 31 || '<>:"/\\|?*'.includes(character)
|
|
38
|
-
? '-'
|
|
39
|
-
: character;
|
|
40
|
-
})
|
|
41
|
-
.join('')
|
|
42
|
-
.trim()
|
|
43
|
-
.replace(/^[. ]+|[. ]+$/g, '');
|
|
44
|
-
};
|
|
45
|
-
const getRemoteAssetFilename = ({ fileType, url, }) => {
|
|
46
|
-
const basename = safeDecodeURIComponent(node_path_1.default.posix.basename(url.pathname));
|
|
47
|
-
const sanitized = sanitizeAssetFilename(basename);
|
|
48
|
-
const filenameWithoutFallback = sanitized === '' ? 'image' : sanitized;
|
|
49
|
-
const extensions = extensionsForFileType[fileType.type];
|
|
50
|
-
const extension = node_path_1.default
|
|
51
|
-
.extname(filenameWithoutFallback)
|
|
52
|
-
.slice(1)
|
|
53
|
-
.toLowerCase();
|
|
54
|
-
if (extensions.includes(extension)) {
|
|
55
|
-
return filenameWithoutFallback;
|
|
56
|
-
}
|
|
57
|
-
const withoutExtension = extension
|
|
58
|
-
? filenameWithoutFallback.slice(0, -(extension.length + 1))
|
|
59
|
-
: filenameWithoutFallback;
|
|
60
|
-
const safeName = withoutExtension === '' ? 'image' : withoutExtension;
|
|
61
|
-
return `${safeName}.${extensions[0]}`;
|
|
62
|
-
};
|
|
63
|
-
exports.getRemoteAssetFilename = getRemoteAssetFilename;
|
|
64
15
|
const isForbiddenIpv4Address = (address) => {
|
|
65
16
|
const parts = address.split('.').map((part) => Number(part));
|
|
66
17
|
if (parts.length !== 4 ||
|
|
@@ -131,7 +82,7 @@ const fetchRemoteAsset = async ({ signal, url, }) => {
|
|
|
131
82
|
await ensureRemoteUrlIsAllowed(currentUrl);
|
|
132
83
|
const response = await fetch(currentUrl, {
|
|
133
84
|
headers: {
|
|
134
|
-
accept: remoteAssetAcceptHeader,
|
|
85
|
+
accept: studio_shared_1.remoteAssetAcceptHeader,
|
|
135
86
|
},
|
|
136
87
|
redirect: 'manual',
|
|
137
88
|
signal,
|
|
@@ -153,13 +104,13 @@ const fetchRemoteAsset = async ({ signal, url, }) => {
|
|
|
153
104
|
};
|
|
154
105
|
const readRemoteAsset = async ({ response, abort, }) => {
|
|
155
106
|
const contentLength = response.headers.get('content-length');
|
|
156
|
-
if (contentLength !== null && Number(contentLength) > maxRemoteAssetSize) {
|
|
107
|
+
if (contentLength !== null && Number(contentLength) > studio_shared_1.maxRemoteAssetSize) {
|
|
157
108
|
abort();
|
|
158
109
|
throw new Error('Remote asset exceeds the 50MB size limit');
|
|
159
110
|
}
|
|
160
111
|
if (!response.body) {
|
|
161
112
|
const buffer = await response.arrayBuffer();
|
|
162
|
-
if (buffer.byteLength > maxRemoteAssetSize) {
|
|
113
|
+
if (buffer.byteLength > studio_shared_1.maxRemoteAssetSize) {
|
|
163
114
|
throw new Error('Remote asset exceeds the 50MB size limit');
|
|
164
115
|
}
|
|
165
116
|
return new Uint8Array(buffer);
|
|
@@ -176,7 +127,7 @@ const readRemoteAsset = async ({ response, abort, }) => {
|
|
|
176
127
|
continue;
|
|
177
128
|
}
|
|
178
129
|
size += value.byteLength;
|
|
179
|
-
if (size > maxRemoteAssetSize) {
|
|
130
|
+
if (size > studio_shared_1.maxRemoteAssetSize) {
|
|
180
131
|
abort();
|
|
181
132
|
await reader.cancel();
|
|
182
133
|
throw new Error('Remote asset exceeds the 50MB size limit');
|
|
@@ -203,7 +154,7 @@ const downloadRemoteAssetHandler = async ({ input, publicDir, request }) => {
|
|
|
203
154
|
const controller = new AbortController();
|
|
204
155
|
const timeout = setTimeout(() => {
|
|
205
156
|
controller.abort();
|
|
206
|
-
}, remoteAssetDownloadTimeout);
|
|
157
|
+
}, studio_shared_1.remoteAssetDownloadTimeout);
|
|
207
158
|
let contents;
|
|
208
159
|
try {
|
|
209
160
|
const response = await fetchRemoteAsset({
|
|
@@ -231,7 +182,7 @@ const downloadRemoteAssetHandler = async ({ input, publicDir, request }) => {
|
|
|
231
182
|
if (!(0, studio_shared_1.isImageFileType)(fileType)) {
|
|
232
183
|
throw new Error('Remote asset is not a supported image');
|
|
233
184
|
}
|
|
234
|
-
const assetPath = (0,
|
|
185
|
+
const assetPath = (0, studio_shared_1.getRemoteAssetFilename)({ fileType, url });
|
|
235
186
|
const absolutePath = node_path_1.default.join(publicDir, assetPath);
|
|
236
187
|
const relativeToPublicDir = node_path_1.default.relative(publicDir, absolutePath);
|
|
237
188
|
if (relativeToPublicDir.startsWith('..') ||
|
|
@@ -252,20 +203,7 @@ const downloadRemoteAssetHandler = async ({ input, publicDir, request }) => {
|
|
|
252
203
|
(0, node_fs_1.mkdirSync)(node_path_1.default.dirname(absolutePath), { recursive: true });
|
|
253
204
|
(0, node_fs_1.writeFileSync)(absolutePath, contents);
|
|
254
205
|
}
|
|
255
|
-
const element = {
|
|
256
|
-
type: 'asset',
|
|
257
|
-
assetType: fileType.type === 'gif'
|
|
258
|
-
? 'gif'
|
|
259
|
-
: fileType.type === 'apng' ||
|
|
260
|
-
(fileType.type === 'webp' && fileType.animated)
|
|
261
|
-
? 'animated-image'
|
|
262
|
-
: 'image',
|
|
263
|
-
src: assetPath,
|
|
264
|
-
srcType: 'static',
|
|
265
|
-
dimensions: fileType.dimensions,
|
|
266
|
-
durationInFrames: null,
|
|
267
|
-
position: null,
|
|
268
|
-
};
|
|
206
|
+
const element = (0, studio_shared_1.getRemoteAssetElement)({ assetPath, fileType });
|
|
269
207
|
return {
|
|
270
208
|
assetPath,
|
|
271
209
|
sizeInBytes: contents.byteLength,
|
|
@@ -8,15 +8,25 @@ const node_fs_1 = require("node:fs");
|
|
|
8
8
|
const node_os_1 = require("node:os");
|
|
9
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
10
|
const detect_outdated_remotion_skills_1 = require("../../detect-outdated-remotion-skills");
|
|
11
|
+
const remotion_skill_names_1 = require("../../remotion-skill-names");
|
|
11
12
|
const getRemotionSkillsInfo = ({ remotionRoot, homeDirectory = (0, node_os_1.homedir)(), }) => {
|
|
12
13
|
const skillsDirectories = (0, detect_outdated_remotion_skills_1.getRemotionSkillsDirectories)({
|
|
13
14
|
cwd: remotionRoot,
|
|
14
15
|
homeDirectory,
|
|
15
16
|
});
|
|
16
|
-
const
|
|
17
|
+
const skills = remotion_skill_names_1.remotionSkillNames.map((name) => ({
|
|
18
|
+
name,
|
|
19
|
+
installedInProject: (0, node_fs_1.existsSync)(node_path_1.default.join(skillsDirectories.project, name, 'SKILL.md')),
|
|
20
|
+
installedGlobally: (0, node_fs_1.existsSync)(node_path_1.default.join(skillsDirectories.global, name, 'SKILL.md')),
|
|
21
|
+
}));
|
|
22
|
+
const isSkillAvailable = (skillName) => {
|
|
23
|
+
const skill = skills.find(({ name }) => name === skillName);
|
|
24
|
+
return Boolean((skill === null || skill === void 0 ? void 0 : skill.installedInProject) || (skill === null || skill === void 0 ? void 0 : skill.installedGlobally));
|
|
25
|
+
};
|
|
17
26
|
return {
|
|
18
27
|
remotionUpgradeSkillAvailable: isSkillAvailable('remotion-upgrade'),
|
|
19
28
|
remotionInteractivitySkillAvailable: isSkillAvailable('remotion-interactivity'),
|
|
29
|
+
skills,
|
|
20
30
|
};
|
|
21
31
|
};
|
|
22
32
|
exports.getRemotionSkillsInfo = getRemotionSkillsInfo;
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* MIT Licensed
|
|
7
7
|
*/
|
|
8
8
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
9
|
-
export declare const serveStatic: ({ root, path, req, res, allowOutsidePublicFolder, }: {
|
|
9
|
+
export declare const serveStatic: ({ root, path, req, res, allowOutsidePublicFolder, allowRemotionConvertCors, }: {
|
|
10
10
|
root: string;
|
|
11
11
|
path: string;
|
|
12
12
|
req: IncomingMessage;
|
|
13
13
|
res: ServerResponse<IncomingMessage>;
|
|
14
14
|
allowOutsidePublicFolder: boolean;
|
|
15
|
+
allowRemotionConvertCors: boolean;
|
|
15
16
|
}) => Promise<void>;
|
|
@@ -12,7 +12,36 @@ const node_fs_1 = require("node:fs");
|
|
|
12
12
|
const renderer_1 = require("@remotion/renderer");
|
|
13
13
|
const middleware_1 = require("./dev-middleware/middleware");
|
|
14
14
|
const range_parser_1 = require("./dev-middleware/range-parser");
|
|
15
|
-
const
|
|
15
|
+
const remotionConvertOrigins = [
|
|
16
|
+
'https://remotion.dev',
|
|
17
|
+
'https://www.remotion.dev',
|
|
18
|
+
'https://convert.remotion.dev',
|
|
19
|
+
];
|
|
20
|
+
const applyRemotionConvertCorsHeaders = ({ req, res, }) => {
|
|
21
|
+
const { origin } = req.headers;
|
|
22
|
+
if (!origin || !remotionConvertOrigins.includes(origin)) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
res.setHeader('Access-Control-Allow-Origin', origin);
|
|
26
|
+
res.setHeader('Vary', 'Origin, Access-Control-Request-Headers, Access-Control-Request-Private-Network');
|
|
27
|
+
res.setHeader('Access-Control-Allow-Methods', 'GET, HEAD, OPTIONS');
|
|
28
|
+
res.setHeader('Access-Control-Allow-Headers', 'Range, Content-Type');
|
|
29
|
+
res.setHeader('Access-Control-Expose-Headers', 'Accept-Ranges, Content-Length, Content-Range');
|
|
30
|
+
res.setHeader('Access-Control-Max-Age', '600');
|
|
31
|
+
if (req.headers['access-control-request-private-network']) {
|
|
32
|
+
res.setHeader('Access-Control-Allow-Private-Network', 'true');
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
};
|
|
36
|
+
const serveStatic = async function ({ root, path, req, res, allowOutsidePublicFolder, allowRemotionConvertCors, }) {
|
|
37
|
+
const remotionConvertCorsAllowed = allowRemotionConvertCors
|
|
38
|
+
? applyRemotionConvertCorsHeaders({ req, res })
|
|
39
|
+
: false;
|
|
40
|
+
if (req.method === 'OPTIONS' && remotionConvertCorsAllowed) {
|
|
41
|
+
res.statusCode = 204;
|
|
42
|
+
res.end();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
16
45
|
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
17
46
|
// method not allowed
|
|
18
47
|
res.statusCode = 405;
|
|
@@ -43,6 +72,7 @@ const serveStatic = async function ({ root, path, req, res, allowOutsidePublicFo
|
|
|
43
72
|
req,
|
|
44
73
|
res,
|
|
45
74
|
allowOutsidePublicFolder: true,
|
|
75
|
+
allowRemotionConvertCors,
|
|
46
76
|
});
|
|
47
77
|
}
|
|
48
78
|
const isDirectory = lstat.isDirectory();
|
package/dist/routes.js
CHANGED
|
@@ -396,6 +396,7 @@ const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPref
|
|
|
396
396
|
req: request,
|
|
397
397
|
res: response,
|
|
398
398
|
allowOutsidePublicFolder: false,
|
|
399
|
+
allowRemotionConvertCors: true,
|
|
399
400
|
});
|
|
400
401
|
}
|
|
401
402
|
if (url.pathname.startsWith(staticHashPrefix)) {
|
|
@@ -410,6 +411,7 @@ const handleRoutes = ({ staticHash, staticHashPrefix, outputHash, outputHashPref
|
|
|
410
411
|
req: request,
|
|
411
412
|
res: response,
|
|
412
413
|
allowOutsidePublicFolder: false,
|
|
414
|
+
allowRemotionConvertCors: false,
|
|
413
415
|
});
|
|
414
416
|
}
|
|
415
417
|
if (url.pathname.startsWith(outputHashPrefix)) {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/studio-server"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/studio-server",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.517",
|
|
7
7
|
"description": "Run a Remotion Studio with a server backend",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remotion/studio-protocol": "4.0.
|
|
26
|
+
"@remotion/studio-protocol": "4.0.517",
|
|
27
27
|
"@babel/types": "7.24.0",
|
|
28
28
|
"@babel/parser": "7.24.1",
|
|
29
29
|
"@svgr/core": "8.1.0",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"semver": "7.5.3",
|
|
33
33
|
"zod": "4.4.3",
|
|
34
34
|
"prettier": "3.8.1",
|
|
35
|
-
"remotion": "4.0.
|
|
36
|
-
"recast": "0.23.
|
|
37
|
-
"@remotion/bundler": "4.0.
|
|
38
|
-
"@remotion/renderer": "4.0.
|
|
39
|
-
"@remotion/studio-codemods": "4.0.
|
|
40
|
-
"@remotion/studio-shared": "4.0.
|
|
35
|
+
"remotion": "4.0.517",
|
|
36
|
+
"recast": "0.23.21",
|
|
37
|
+
"@remotion/bundler": "4.0.517",
|
|
38
|
+
"@remotion/renderer": "4.0.517",
|
|
39
|
+
"@remotion/studio-codemods": "4.0.517",
|
|
40
|
+
"@remotion/studio-shared": "4.0.517",
|
|
41
41
|
"memfs": "3.4.3",
|
|
42
42
|
"open": "8.4.2"
|
|
43
43
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"ast-types": "0.16.1",
|
|
46
46
|
"react": "19.2.3",
|
|
47
47
|
"@types/semver": "7.5.3",
|
|
48
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
48
|
+
"@remotion/eslint-config-internal": "4.0.517",
|
|
49
49
|
"eslint": "9.19.0",
|
|
50
50
|
"@types/node": "20.12.14",
|
|
51
51
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DeleteEffectKeyframeRequest, DeleteEffectKeyframeResponse } from '@remotion/studio-shared';
|
|
2
|
-
import type { ApiHandler } from '../api-types';
|
|
3
|
-
export declare const deleteEffectKeyframeHandler: ApiHandler<DeleteEffectKeyframeRequest, DeleteEffectKeyframeResponse>;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteEffectKeyframeHandler = void 0;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const renderer_1 = require("@remotion/renderer");
|
|
6
|
-
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
|
-
const parse_ast_1 = require("../../codemods/parse-ast");
|
|
8
|
-
const update_keyframes_1 = require("../../codemods/update-keyframes/update-keyframes");
|
|
9
|
-
const file_watcher_1 = require("../../file-watcher");
|
|
10
|
-
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
11
|
-
const undo_stack_1 = require("../undo-stack");
|
|
12
|
-
const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
|
|
13
|
-
const can_update_effect_props_1 = require("./can-update-effect-props");
|
|
14
|
-
const can_update_sequence_props_1 = require("./can-update-sequence-props");
|
|
15
|
-
const log_effect_update_1 = require("./log-updates/log-effect-update");
|
|
16
|
-
const save_props_mutex_1 = require("./save-props-mutex");
|
|
17
|
-
const deleteEffectKeyframeHandler = ({ input: { fileName, sequenceNodePath, effectIndex, key, frame, schema, clientId, }, remotionRoot, logLevel, }) => (0, save_props_mutex_1.withSavePropsLock)(async () => {
|
|
18
|
-
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[delete-effect-keyframe] Received request for fileName="${fileName}" effectIndex=${effectIndex} key="${key}" frame=${frame}`);
|
|
19
|
-
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
20
|
-
remotionRoot,
|
|
21
|
-
fileName,
|
|
22
|
-
action: 'modify',
|
|
23
|
-
});
|
|
24
|
-
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
25
|
-
const { output, oldValueStrings, newValueStrings, formatted, logLine, effectCallee, } = await (0, update_keyframes_1.updateEffectKeyframes)({
|
|
26
|
-
input: fileContents,
|
|
27
|
-
sequenceNodePath: sequenceNodePath.nodePath,
|
|
28
|
-
effectIndex,
|
|
29
|
-
updates: [
|
|
30
|
-
{
|
|
31
|
-
key,
|
|
32
|
-
operation: {
|
|
33
|
-
type: 'remove',
|
|
34
|
-
frame,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
});
|
|
39
|
-
const oldValueString = oldValueStrings[0];
|
|
40
|
-
const newValueString = newValueStrings[0];
|
|
41
|
-
const undoPropChange = `${key} keyframe restored at frame ${frame}`;
|
|
42
|
-
const redoPropChange = `${key} keyframe deleted at frame ${frame}`;
|
|
43
|
-
(0, undo_stack_1.pushToUndoStack)({
|
|
44
|
-
filePath: absolutePath,
|
|
45
|
-
oldContents: fileContents,
|
|
46
|
-
newContents: null,
|
|
47
|
-
logLevel,
|
|
48
|
-
remotionRoot,
|
|
49
|
-
logLine,
|
|
50
|
-
description: {
|
|
51
|
-
undoMessage: `↩️ ${undoPropChange}`,
|
|
52
|
-
redoMessage: `↪️ ${redoPropChange}`,
|
|
53
|
-
},
|
|
54
|
-
entryType: 'effect-props',
|
|
55
|
-
suppressHmrOnFileRestore: true,
|
|
56
|
-
});
|
|
57
|
-
(0, undo_stack_1.suppressUndoStackInvalidation)(absolutePath);
|
|
58
|
-
(0, watch_ignore_next_change_1.suppressBundlerUpdateForFile)(absolutePath);
|
|
59
|
-
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(absolutePath, output, clientId);
|
|
60
|
-
(0, log_effect_update_1.logEffectUpdate)({
|
|
61
|
-
fileRelativeToRoot,
|
|
62
|
-
line: logLine,
|
|
63
|
-
effectName: effectCallee,
|
|
64
|
-
propKey: key,
|
|
65
|
-
oldValueString,
|
|
66
|
-
newValueString,
|
|
67
|
-
defaultValueString: null,
|
|
68
|
-
formatted,
|
|
69
|
-
logLevel,
|
|
70
|
-
removedProps: [],
|
|
71
|
-
addedProps: [],
|
|
72
|
-
});
|
|
73
|
-
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
74
|
-
const ast = (0, parse_ast_1.parseAst)((0, node_fs_1.readFileSync)(absolutePath, 'utf-8'));
|
|
75
|
-
const jsx = (0, can_update_sequence_props_1.findJsxElementAtNodePath)(ast, sequenceNodePath.nodePath);
|
|
76
|
-
if (!jsx) {
|
|
77
|
-
return {
|
|
78
|
-
canUpdate: false,
|
|
79
|
-
effectIndex,
|
|
80
|
-
reason: 'not-found',
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
return (0, can_update_effect_props_1.computeEffectPropStatus)({
|
|
84
|
-
jsx,
|
|
85
|
-
effectIndex,
|
|
86
|
-
keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
exports.deleteEffectKeyframeHandler = deleteEffectKeyframeHandler;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DeleteSequenceKeyframeRequest, DeleteSequenceKeyframeResponse } from '@remotion/studio-shared';
|
|
2
|
-
import type { ApiHandler } from '../api-types';
|
|
3
|
-
export declare const deleteSequenceKeyframeHandler: ApiHandler<DeleteSequenceKeyframeRequest, DeleteSequenceKeyframeResponse>;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteSequenceKeyframeHandler = void 0;
|
|
4
|
-
const node_fs_1 = require("node:fs");
|
|
5
|
-
const renderer_1 = require("@remotion/renderer");
|
|
6
|
-
const studio_shared_1 = require("@remotion/studio-shared");
|
|
7
|
-
const update_keyframes_1 = require("../../codemods/update-keyframes/update-keyframes");
|
|
8
|
-
const file_watcher_1 = require("../../file-watcher");
|
|
9
|
-
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
10
|
-
const undo_stack_1 = require("../undo-stack");
|
|
11
|
-
const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
|
|
12
|
-
const can_update_sequence_props_1 = require("./can-update-sequence-props");
|
|
13
|
-
const log_update_1 = require("./log-updates/log-update");
|
|
14
|
-
const save_props_mutex_1 = require("./save-props-mutex");
|
|
15
|
-
const deleteSequenceKeyframeHandler = ({ input: { fileName, nodePath, key, frame, schema, clientId }, remotionRoot, logLevel, }) => (0, save_props_mutex_1.withSavePropsLock)(async () => {
|
|
16
|
-
renderer_1.RenderInternals.Log.trace({ indent: false, logLevel }, `[delete-sequence-keyframe] Received request for fileName="${fileName}" key="${key}" frame=${frame}`);
|
|
17
|
-
const { absolutePath, fileRelativeToRoot } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
18
|
-
remotionRoot,
|
|
19
|
-
fileName,
|
|
20
|
-
action: 'modify',
|
|
21
|
-
});
|
|
22
|
-
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
23
|
-
const { output, oldValueStrings, newValueStrings, formatted, logLine } = await (0, update_keyframes_1.updateSequenceKeyframes)({
|
|
24
|
-
input: fileContents,
|
|
25
|
-
nodePath: nodePath.nodePath,
|
|
26
|
-
updates: [
|
|
27
|
-
{
|
|
28
|
-
key,
|
|
29
|
-
operation: {
|
|
30
|
-
type: 'remove',
|
|
31
|
-
frame,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
});
|
|
36
|
-
const oldValueString = oldValueStrings[0];
|
|
37
|
-
const newValueString = newValueStrings[0];
|
|
38
|
-
const undoPropChange = `${key} keyframe restored at frame ${frame}`;
|
|
39
|
-
const redoPropChange = `${key} keyframe deleted at frame ${frame}`;
|
|
40
|
-
(0, undo_stack_1.pushToUndoStack)({
|
|
41
|
-
filePath: absolutePath,
|
|
42
|
-
oldContents: fileContents,
|
|
43
|
-
newContents: null,
|
|
44
|
-
logLevel,
|
|
45
|
-
remotionRoot,
|
|
46
|
-
logLine,
|
|
47
|
-
description: {
|
|
48
|
-
undoMessage: `↩️ ${undoPropChange}`,
|
|
49
|
-
redoMessage: `↪️ ${redoPropChange}`,
|
|
50
|
-
},
|
|
51
|
-
entryType: 'sequence-props',
|
|
52
|
-
suppressHmrOnFileRestore: true,
|
|
53
|
-
});
|
|
54
|
-
(0, undo_stack_1.suppressUndoStackInvalidation)(absolutePath);
|
|
55
|
-
(0, watch_ignore_next_change_1.suppressBundlerUpdateForFile)(absolutePath);
|
|
56
|
-
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(absolutePath, output, clientId);
|
|
57
|
-
(0, log_update_1.logUpdate)({
|
|
58
|
-
fileRelativeToRoot,
|
|
59
|
-
line: logLine,
|
|
60
|
-
key,
|
|
61
|
-
oldValueString,
|
|
62
|
-
newValueString,
|
|
63
|
-
defaultValueString: null,
|
|
64
|
-
formatted,
|
|
65
|
-
logLevel,
|
|
66
|
-
removedProps: [],
|
|
67
|
-
addedProps: [],
|
|
68
|
-
});
|
|
69
|
-
(0, undo_stack_1.printUndoHint)(logLevel);
|
|
70
|
-
const status = (0, can_update_sequence_props_1.computeSequencePropsStatusFromContent)({
|
|
71
|
-
fileContents: output,
|
|
72
|
-
keys: (0, studio_shared_1.getAllSchemaKeys)(schema),
|
|
73
|
-
nodePath: nodePath.nodePath,
|
|
74
|
-
effects: [],
|
|
75
|
-
});
|
|
76
|
-
return {
|
|
77
|
-
canUpdate: true,
|
|
78
|
-
props: status.props,
|
|
79
|
-
results: [{ fileName, nodePath, props: status.props }],
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
exports.deleteSequenceKeyframeHandler = deleteSequenceKeyframeHandler;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const withSavePropsLock: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withSavePropsLock = void 0;
|
|
4
|
-
let chain = Promise.resolve();
|
|
5
|
-
const withSavePropsLock = (fn) => {
|
|
6
|
-
const run = () => fn();
|
|
7
|
-
const next = chain.then(run, run);
|
|
8
|
-
chain = next.then(() => undefined, () => undefined);
|
|
9
|
-
return next;
|
|
10
|
-
};
|
|
11
|
-
exports.withSavePropsLock = withSavePropsLock;
|