@remotion/studio-server 4.0.486 → 4.0.487
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/update-keyframes/update-keyframes.js +2 -49
- package/dist/helpers/parse-keyframe-easing-expression.d.ts +3 -0
- package/dist/helpers/parse-keyframe-easing-expression.js +141 -0
- package/dist/helpers/resolve-composition-component.d.ts +1 -1
- package/dist/helpers/resolve-composition-component.js +6 -2
- package/dist/open-browser-shortcut.d.ts +9 -0
- package/dist/open-browser-shortcut.js +111 -0
- package/dist/preview-server/live-events.d.ts +1 -0
- package/dist/preview-server/live-events.js +10 -7
- package/dist/preview-server/routes/can-update-sequence-props.js +2 -49
- package/dist/preview-server/routes/insert-element.js +3 -0
- package/dist/start-studio.js +17 -4
- package/package.json +6 -6
|
@@ -37,6 +37,7 @@ exports.updateEffectKeyframes = exports.updateEffectKeyframesAst = exports.updat
|
|
|
37
37
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
38
38
|
const recast = __importStar(require("recast"));
|
|
39
39
|
const get_ast_node_path_1 = require("../../helpers/get-ast-node-path");
|
|
40
|
+
const parse_keyframe_easing_expression_1 = require("../../helpers/parse-keyframe-easing-expression");
|
|
40
41
|
const can_update_sequence_props_1 = require("../../preview-server/routes/can-update-sequence-props");
|
|
41
42
|
const format_file_content_1 = require("../format-file-content");
|
|
42
43
|
const parse_ast_1 = require("../parse-ast");
|
|
@@ -225,55 +226,7 @@ const setOptionsProperty = ({ options, propertyName, value, }) => {
|
|
|
225
226
|
options.properties.push(b.objectProperty(b.identifier(propertyName), value));
|
|
226
227
|
};
|
|
227
228
|
const isLinearEasing = (easing) => easing.type === 'linear';
|
|
228
|
-
const getKeyframeEasing = (node) =>
|
|
229
|
-
if (node.type === 'TSAsExpression') {
|
|
230
|
-
return getKeyframeEasing(node.expression);
|
|
231
|
-
}
|
|
232
|
-
if (node.type === 'MemberExpression' &&
|
|
233
|
-
node.object.type === 'Identifier' &&
|
|
234
|
-
node.object.name === 'Easing' &&
|
|
235
|
-
node.property.type === 'Identifier' &&
|
|
236
|
-
node.property.name === 'linear' &&
|
|
237
|
-
node.computed === false) {
|
|
238
|
-
return { type: 'linear' };
|
|
239
|
-
}
|
|
240
|
-
if (node.type !== 'CallExpression' ||
|
|
241
|
-
node.callee.type !== 'MemberExpression' ||
|
|
242
|
-
node.callee.object.type !== 'Identifier' ||
|
|
243
|
-
node.callee.object.name !== 'Easing' ||
|
|
244
|
-
node.callee.property.type !== 'Identifier' ||
|
|
245
|
-
node.callee.computed) {
|
|
246
|
-
return null;
|
|
247
|
-
}
|
|
248
|
-
if (node.callee.property.name === 'spring') {
|
|
249
|
-
if (node.arguments.length > 1) {
|
|
250
|
-
return null;
|
|
251
|
-
}
|
|
252
|
-
const springConfig = node.arguments[0];
|
|
253
|
-
if ((springConfig === null || springConfig === void 0 ? void 0 : springConfig.type) === 'ArgumentPlaceholder' ||
|
|
254
|
-
(springConfig === null || springConfig === void 0 ? void 0 : springConfig.type) === 'JSXNamespacedName' ||
|
|
255
|
-
(springConfig === null || springConfig === void 0 ? void 0 : springConfig.type) === 'SpreadElement') {
|
|
256
|
-
return null;
|
|
257
|
-
}
|
|
258
|
-
return (0, studio_shared_1.parseSpringEasingConfig)(springConfig);
|
|
259
|
-
}
|
|
260
|
-
if (node.callee.property.name !== 'bezier' || node.arguments.length !== 4) {
|
|
261
|
-
return null;
|
|
262
|
-
}
|
|
263
|
-
const values = node.arguments.map((arg) => {
|
|
264
|
-
if (arg.type === 'ArgumentPlaceholder' ||
|
|
265
|
-
arg.type === 'JSXNamespacedName' ||
|
|
266
|
-
arg.type === 'SpreadElement') {
|
|
267
|
-
return null;
|
|
268
|
-
}
|
|
269
|
-
return getNumericValue(arg);
|
|
270
|
-
});
|
|
271
|
-
if (values.some((value) => value === null)) {
|
|
272
|
-
return null;
|
|
273
|
-
}
|
|
274
|
-
const [x1, y1, x2, y2] = values;
|
|
275
|
-
return { type: 'bezier', x1, y1, x2, y2 };
|
|
276
|
-
};
|
|
229
|
+
const getKeyframeEasing = (node) => (0, parse_keyframe_easing_expression_1.parseKeyframeEasingExpression)(node);
|
|
277
230
|
const getKeyframeEasingArray = ({ easingNode, segmentCount, }) => {
|
|
278
231
|
if (segmentCount === 0) {
|
|
279
232
|
return [];
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseKeyframeEasingExpression = void 0;
|
|
4
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
|
+
const getNumericValue = (node) => {
|
|
6
|
+
if (node.type === 'NumericLiteral') {
|
|
7
|
+
return node.value;
|
|
8
|
+
}
|
|
9
|
+
if (node.type === 'UnaryExpression' &&
|
|
10
|
+
(node.operator === '-' || node.operator === '+') &&
|
|
11
|
+
node.argument.type === 'NumericLiteral') {
|
|
12
|
+
return node.operator === '-' ? -node.argument.value : node.argument.value;
|
|
13
|
+
}
|
|
14
|
+
if (node.type === 'TSAsExpression') {
|
|
15
|
+
return getNumericValue(node.expression);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
const getExpressionArgument = (arg) => {
|
|
20
|
+
if (arg === undefined ||
|
|
21
|
+
arg.type === 'ArgumentPlaceholder' ||
|
|
22
|
+
arg.type === 'JSXNamespacedName' ||
|
|
23
|
+
arg.type === 'SpreadElement') {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return arg;
|
|
27
|
+
};
|
|
28
|
+
const getMemberExpressionKeyframeEasing = (name) => {
|
|
29
|
+
if (name === 'linear') {
|
|
30
|
+
return studio_shared_1.LINEAR_KEYFRAME_EASING;
|
|
31
|
+
}
|
|
32
|
+
if (name === 'ease') {
|
|
33
|
+
return studio_shared_1.EASE_KEYFRAME_EASING;
|
|
34
|
+
}
|
|
35
|
+
if (name === 'quad') {
|
|
36
|
+
return studio_shared_1.QUAD_KEYFRAME_EASING;
|
|
37
|
+
}
|
|
38
|
+
if (name === 'cubic') {
|
|
39
|
+
return studio_shared_1.CUBIC_KEYFRAME_EASING;
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
const parseKeyframeEasingExpression = (node) => {
|
|
44
|
+
if (node.type === 'TSAsExpression') {
|
|
45
|
+
return (0, exports.parseKeyframeEasingExpression)(node.expression);
|
|
46
|
+
}
|
|
47
|
+
if (node.type === 'MemberExpression' &&
|
|
48
|
+
node.object.type === 'Identifier' &&
|
|
49
|
+
node.object.name === 'Easing' &&
|
|
50
|
+
node.property.type === 'Identifier' &&
|
|
51
|
+
node.computed === false) {
|
|
52
|
+
return getMemberExpressionKeyframeEasing(node.property.name);
|
|
53
|
+
}
|
|
54
|
+
if (node.type !== 'CallExpression' ||
|
|
55
|
+
node.callee.type !== 'MemberExpression' ||
|
|
56
|
+
node.callee.object.type !== 'Identifier' ||
|
|
57
|
+
node.callee.object.name !== 'Easing' ||
|
|
58
|
+
node.callee.property.type !== 'Identifier' ||
|
|
59
|
+
node.callee.computed) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const propertyName = node.callee.property.name;
|
|
63
|
+
if (propertyName === 'spring') {
|
|
64
|
+
if (node.arguments.length > 1) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
if (node.arguments.length === 0) {
|
|
68
|
+
return (0, studio_shared_1.parseSpringEasingConfig)(undefined);
|
|
69
|
+
}
|
|
70
|
+
const springConfig = getExpressionArgument(node.arguments[0]);
|
|
71
|
+
return springConfig ? (0, studio_shared_1.parseSpringEasingConfig)(springConfig) : null;
|
|
72
|
+
}
|
|
73
|
+
if (propertyName === 'bezier') {
|
|
74
|
+
if (node.arguments.length !== 4) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const values = node.arguments.map((arg) => {
|
|
78
|
+
const expression = getExpressionArgument(arg);
|
|
79
|
+
return expression ? getNumericValue(expression) : null;
|
|
80
|
+
});
|
|
81
|
+
if (values.some((value) => value === null)) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
const [x1, y1, x2, y2] = values;
|
|
85
|
+
return { type: 'bezier', x1, y1, x2, y2 };
|
|
86
|
+
}
|
|
87
|
+
if (propertyName === 'back') {
|
|
88
|
+
if (node.arguments.length > 1) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
if (node.arguments.length === 0) {
|
|
92
|
+
return (0, studio_shared_1.getBackKeyframeEasing)();
|
|
93
|
+
}
|
|
94
|
+
const expression = getExpressionArgument(node.arguments[0]);
|
|
95
|
+
if (!expression) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const s = getNumericValue(expression);
|
|
99
|
+
if (s === null) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return (0, studio_shared_1.getBackKeyframeEasing)(s);
|
|
103
|
+
}
|
|
104
|
+
if (propertyName === 'poly') {
|
|
105
|
+
if (node.arguments.length !== 1) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const expression = getExpressionArgument(node.arguments[0]);
|
|
109
|
+
const n = expression ? getNumericValue(expression) : null;
|
|
110
|
+
return n === null ? null : (0, studio_shared_1.getPolyKeyframeEasing)(n);
|
|
111
|
+
}
|
|
112
|
+
if (propertyName === 'in') {
|
|
113
|
+
if (node.arguments.length !== 1) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
const expression = getExpressionArgument(node.arguments[0]);
|
|
117
|
+
return expression ? (0, exports.parseKeyframeEasingExpression)(expression) : null;
|
|
118
|
+
}
|
|
119
|
+
if (propertyName === 'out') {
|
|
120
|
+
if (node.arguments.length !== 1) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const expression = getExpressionArgument(node.arguments[0]);
|
|
124
|
+
const easing = expression
|
|
125
|
+
? (0, exports.parseKeyframeEasingExpression)(expression)
|
|
126
|
+
: null;
|
|
127
|
+
return easing ? (0, studio_shared_1.getOutKeyframeEasing)(easing) : null;
|
|
128
|
+
}
|
|
129
|
+
if (propertyName === 'inOut') {
|
|
130
|
+
if (node.arguments.length !== 1) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const expression = getExpressionArgument(node.arguments[0]);
|
|
134
|
+
const easing = expression
|
|
135
|
+
? (0, exports.parseKeyframeEasingExpression)(expression)
|
|
136
|
+
: null;
|
|
137
|
+
return (easing === null || easing === void 0 ? void 0 : easing.type) === 'linear' ? easing : null;
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
};
|
|
141
|
+
exports.parseKeyframeEasingExpression = parseKeyframeEasingExpression;
|
|
@@ -29,7 +29,7 @@ export declare const insertJsxElementIntoComposition: ({ remotionRoot, compositi
|
|
|
29
29
|
dimensions: {
|
|
30
30
|
width: number;
|
|
31
31
|
height: number;
|
|
32
|
-
};
|
|
32
|
+
} | null;
|
|
33
33
|
durationInFrames?: number | null | undefined;
|
|
34
34
|
name: string | null;
|
|
35
35
|
position: InsertableCompositionElementPosition | null;
|
|
@@ -583,8 +583,12 @@ const createComponentElement = ({ addPositionStyle, localName, props, position,
|
|
|
583
583
|
const createSequenceWrappedElement = ({ child, dimensions, durationInFrames, name, position, sequenceLocalName, }) => {
|
|
584
584
|
return recast.types.builders.jsxElement(recast.types.builders.jsxOpeningElement(recast.types.builders.jsxIdentifier(sequenceLocalName), [
|
|
585
585
|
...(name === null ? [] : [createStringAttribute('name', name)]),
|
|
586
|
-
|
|
587
|
-
|
|
586
|
+
...(dimensions !== null
|
|
587
|
+
? [
|
|
588
|
+
createNumberAttribute('width', dimensions.width),
|
|
589
|
+
createNumberAttribute('height', dimensions.height),
|
|
590
|
+
]
|
|
591
|
+
: []),
|
|
588
592
|
...(durationInFrames === null
|
|
589
593
|
? []
|
|
590
594
|
: [createNumberAttribute('durationInFrames', durationInFrames)]),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const registerOpenBrowserShortcut: ({ browserArgs, browserFlag, url, logLevel, }: {
|
|
2
|
+
browserArgs: string;
|
|
3
|
+
browserFlag: string;
|
|
4
|
+
url: string;
|
|
5
|
+
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
6
|
+
}) => {
|
|
7
|
+
registered: boolean;
|
|
8
|
+
cleanup: () => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.registerOpenBrowserShortcut = void 0;
|
|
37
|
+
const readline = __importStar(require("node:readline"));
|
|
38
|
+
const renderer_1 = require("@remotion/renderer");
|
|
39
|
+
const maybe_open_browser_1 = require("./maybe-open-browser");
|
|
40
|
+
const live_events_1 = require("./preview-server/live-events");
|
|
41
|
+
const registerOpenBrowserShortcut = ({ browserArgs, browserFlag, url, logLevel, }) => {
|
|
42
|
+
if (!process.stdin.isTTY) {
|
|
43
|
+
return { registered: false, cleanup: () => undefined };
|
|
44
|
+
}
|
|
45
|
+
if (typeof process.stdin.setRawMode !== 'function') {
|
|
46
|
+
return { registered: false, cleanup: () => undefined };
|
|
47
|
+
}
|
|
48
|
+
const wasRaw = process.stdin.isRaw;
|
|
49
|
+
const shouldPauseAfterCleanup = process.stdin.isPaused();
|
|
50
|
+
let cleanedUp = false;
|
|
51
|
+
let isOpeningBrowser = false;
|
|
52
|
+
const cleanup = () => {
|
|
53
|
+
if (cleanedUp) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
cleanedUp = true;
|
|
57
|
+
process.stdin.removeListener('keypress', onKeypress);
|
|
58
|
+
process.removeListener('SIGINT', cleanup);
|
|
59
|
+
process.removeListener('exit', cleanup);
|
|
60
|
+
if (!wasRaw && process.stdin.isTTY) {
|
|
61
|
+
process.stdin.setRawMode(false);
|
|
62
|
+
}
|
|
63
|
+
if (shouldPauseAfterCleanup) {
|
|
64
|
+
process.stdin.pause();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const openStudio = () => {
|
|
68
|
+
if (isOpeningBrowser) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
isOpeningBrowser = true;
|
|
72
|
+
(0, live_events_1.clearPrintPortMessageTimeout)();
|
|
73
|
+
(0, maybe_open_browser_1.maybeOpenBrowser)({
|
|
74
|
+
browserArgs,
|
|
75
|
+
browserFlag,
|
|
76
|
+
shouldOpenBrowser: true,
|
|
77
|
+
url,
|
|
78
|
+
logLevel,
|
|
79
|
+
})
|
|
80
|
+
.then((result) => {
|
|
81
|
+
if (result.didOpenBrowser) {
|
|
82
|
+
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, `Opened ${url} in browser`);
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
.catch((err) => {
|
|
86
|
+
renderer_1.RenderInternals.Log.error({ indent: false, logLevel }, 'Could not open browser:', err);
|
|
87
|
+
})
|
|
88
|
+
.finally(() => {
|
|
89
|
+
isOpeningBrowser = false;
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
function onKeypress(_str, key) {
|
|
93
|
+
if ((key === null || key === void 0 ? void 0 : key.ctrl) && key.name === 'c') {
|
|
94
|
+
cleanup();
|
|
95
|
+
process.kill(process.pid, 'SIGINT');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if ((key === null || key === void 0 ? void 0 : key.meta) || (key === null || key === void 0 ? void 0 : key.ctrl) || (key === null || key === void 0 ? void 0 : key.name) !== 's') {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
openStudio();
|
|
102
|
+
}
|
|
103
|
+
readline.emitKeypressEvents(process.stdin);
|
|
104
|
+
process.stdin.setRawMode(true);
|
|
105
|
+
process.stdin.resume();
|
|
106
|
+
process.stdin.on('keypress', onKeypress);
|
|
107
|
+
process.once('SIGINT', cleanup);
|
|
108
|
+
process.once('exit', cleanup);
|
|
109
|
+
return { registered: true, cleanup };
|
|
110
|
+
};
|
|
111
|
+
exports.registerOpenBrowserShortcut = registerOpenBrowserShortcut;
|
|
@@ -7,6 +7,7 @@ export type LiveEventsServer = {
|
|
|
7
7
|
closeConnections: () => Promise<void>;
|
|
8
8
|
addNewClientListener: (cb: () => void) => () => void;
|
|
9
9
|
};
|
|
10
|
+
export declare const clearPrintPortMessageTimeout: () => void;
|
|
10
11
|
export type InitialUndoRedoState = {
|
|
11
12
|
undoFile: string | null;
|
|
12
13
|
redoFile: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setLiveEventsListener = exports.waitForLiveEventsListener = exports.makeLiveEventsRouter = void 0;
|
|
3
|
+
exports.setLiveEventsListener = exports.waitForLiveEventsListener = exports.makeLiveEventsRouter = exports.clearPrintPortMessageTimeout = void 0;
|
|
4
4
|
const server_ready_1 = require("../server-ready");
|
|
5
5
|
const default_props_watchers_1 = require("./default-props-watchers");
|
|
6
6
|
const file_existence_watchers_1 = require("./file-existence-watchers");
|
|
@@ -9,6 +9,13 @@ const serializeMessage = (message) => {
|
|
|
9
9
|
return `data: ${JSON.stringify(message)}\n\n`;
|
|
10
10
|
};
|
|
11
11
|
let printPortMessageTimeout = null;
|
|
12
|
+
const clearPrintPortMessageTimeout = () => {
|
|
13
|
+
if (printPortMessageTimeout) {
|
|
14
|
+
clearTimeout(printPortMessageTimeout);
|
|
15
|
+
printPortMessageTimeout = null;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
exports.clearPrintPortMessageTimeout = clearPrintPortMessageTimeout;
|
|
12
19
|
const makeLiveEventsRouter = (logLevel, getInitialUndoRedoState) => {
|
|
13
20
|
let clients = [];
|
|
14
21
|
let newClientListeners = [];
|
|
@@ -33,9 +40,7 @@ const makeLiveEventsRouter = (logLevel, getInitialUndoRedoState) => {
|
|
|
33
40
|
};
|
|
34
41
|
clients.push(newClient);
|
|
35
42
|
newClientListeners.forEach((cb) => cb());
|
|
36
|
-
|
|
37
|
-
clearTimeout(printPortMessageTimeout);
|
|
38
|
-
}
|
|
43
|
+
(0, exports.clearPrintPortMessageTimeout)();
|
|
39
44
|
request.on('close', () => {
|
|
40
45
|
(0, default_props_watchers_1.unsubscribeClientDefaultPropsWatchers)(clientId);
|
|
41
46
|
(0, file_existence_watchers_1.unsubscribeClientFileExistenceWatchers)(clientId);
|
|
@@ -43,9 +48,7 @@ const makeLiveEventsRouter = (logLevel, getInitialUndoRedoState) => {
|
|
|
43
48
|
clients = clients.filter((client) => client.id !== clientId);
|
|
44
49
|
// If all clients disconnected, print a comment so user can easily restart it.
|
|
45
50
|
if (clients.length === 0) {
|
|
46
|
-
|
|
47
|
-
clearTimeout(printPortMessageTimeout);
|
|
48
|
-
}
|
|
51
|
+
(0, exports.clearPrintPortMessageTimeout)();
|
|
49
52
|
printPortMessageTimeout = setTimeout(() => {
|
|
50
53
|
(0, server_ready_1.printServerReadyComment)('To restart', logLevel);
|
|
51
54
|
}, 2500);
|
|
@@ -42,6 +42,7 @@ const no_react_1 = require("remotion/no-react");
|
|
|
42
42
|
const parse_ast_1 = require("../../codemods/parse-ast");
|
|
43
43
|
const get_ast_node_path_1 = require("../../helpers/get-ast-node-path");
|
|
44
44
|
const import_agnostic_node_path_1 = require("../../helpers/import-agnostic-node-path");
|
|
45
|
+
const parse_keyframe_easing_expression_1 = require("../../helpers/parse-keyframe-easing-expression");
|
|
45
46
|
const resolve_file_inside_project_1 = require("../../helpers/resolve-file-inside-project");
|
|
46
47
|
const jsx_component_identity_1 = require("../jsx-component-identity");
|
|
47
48
|
const jsx_element_not_found_at_location_error_1 = require("../jsx-element-not-found-at-location-error");
|
|
@@ -200,55 +201,7 @@ const getExtrapolateType = (node) => {
|
|
|
200
201
|
}
|
|
201
202
|
return null;
|
|
202
203
|
};
|
|
203
|
-
const getKeyframeEasing = (node) =>
|
|
204
|
-
if (node.type === 'TSAsExpression') {
|
|
205
|
-
return getKeyframeEasing(node.expression);
|
|
206
|
-
}
|
|
207
|
-
if (node.type === 'MemberExpression' &&
|
|
208
|
-
node.object.type === 'Identifier' &&
|
|
209
|
-
node.object.name === 'Easing' &&
|
|
210
|
-
node.property.type === 'Identifier' &&
|
|
211
|
-
node.property.name === 'linear' &&
|
|
212
|
-
node.computed === false) {
|
|
213
|
-
return { type: 'linear' };
|
|
214
|
-
}
|
|
215
|
-
if (node.type !== 'CallExpression' ||
|
|
216
|
-
node.callee.type !== 'MemberExpression' ||
|
|
217
|
-
node.callee.object.type !== 'Identifier' ||
|
|
218
|
-
node.callee.object.name !== 'Easing' ||
|
|
219
|
-
node.callee.property.type !== 'Identifier' ||
|
|
220
|
-
node.callee.computed) {
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
if (node.callee.property.name === 'spring') {
|
|
224
|
-
if (node.arguments.length > 1) {
|
|
225
|
-
return null;
|
|
226
|
-
}
|
|
227
|
-
const springConfig = node.arguments[0];
|
|
228
|
-
if ((springConfig === null || springConfig === void 0 ? void 0 : springConfig.type) === 'ArgumentPlaceholder' ||
|
|
229
|
-
(springConfig === null || springConfig === void 0 ? void 0 : springConfig.type) === 'JSXNamespacedName' ||
|
|
230
|
-
(springConfig === null || springConfig === void 0 ? void 0 : springConfig.type) === 'SpreadElement') {
|
|
231
|
-
return null;
|
|
232
|
-
}
|
|
233
|
-
return (0, studio_shared_1.parseSpringEasingConfig)(springConfig);
|
|
234
|
-
}
|
|
235
|
-
if (node.callee.property.name !== 'bezier' || node.arguments.length !== 4) {
|
|
236
|
-
return null;
|
|
237
|
-
}
|
|
238
|
-
const values = node.arguments.map((arg) => {
|
|
239
|
-
if (arg.type === 'ArgumentPlaceholder' ||
|
|
240
|
-
arg.type === 'JSXNamespacedName' ||
|
|
241
|
-
arg.type === 'SpreadElement') {
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
return getNumericValue(arg);
|
|
245
|
-
});
|
|
246
|
-
if (values.some((v) => v === null)) {
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
const [x1, y1, x2, y2] = values;
|
|
250
|
-
return { type: 'bezier', x1, y1, x2, y2 };
|
|
251
|
-
};
|
|
204
|
+
const getKeyframeEasing = (node) => (0, parse_keyframe_easing_expression_1.parseKeyframeEasingExpression)(node);
|
|
252
205
|
const getKeyframeEasingArray = ({ easingNode, segments, }) => {
|
|
253
206
|
if (segments === 0) {
|
|
254
207
|
return [];
|
|
@@ -45,6 +45,9 @@ const makeRelativeImportPath = ({ fromFile, toFile, }) => {
|
|
|
45
45
|
return relative;
|
|
46
46
|
};
|
|
47
47
|
const validateDimensions = (dimensions) => {
|
|
48
|
+
if (dimensions === null) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
48
51
|
if (!Number.isFinite(dimensions.width) ||
|
|
49
52
|
!Number.isFinite(dimensions.height) ||
|
|
50
53
|
dimensions.width <= 0 ||
|
package/dist/start-studio.js
CHANGED
|
@@ -11,6 +11,7 @@ const renderer_1 = require("@remotion/renderer");
|
|
|
11
11
|
const file_watcher_1 = require("./file-watcher");
|
|
12
12
|
const get_network_address_1 = require("./get-network-address");
|
|
13
13
|
const maybe_open_browser_1 = require("./maybe-open-browser");
|
|
14
|
+
const open_browser_shortcut_1 = require("./open-browser-shortcut");
|
|
14
15
|
const close_and_restart_1 = require("./preview-server/close-and-restart");
|
|
15
16
|
const get_absolute_public_dir_1 = require("./preview-server/get-absolute-public-dir");
|
|
16
17
|
const live_events_1 = require("./preview-server/live-events");
|
|
@@ -120,14 +121,26 @@ const startStudio = async ({ browserArgs, browserFlag, shouldOpenBrowser, fullEn
|
|
|
120
121
|
}
|
|
121
122
|
(0, server_ready_1.printServerReadyComment)('Server ready', logLevel);
|
|
122
123
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Building...');
|
|
123
|
-
|
|
124
|
+
const studioUrl = `http://localhost:${port}`;
|
|
125
|
+
const openBrowserShortcut = (0, open_browser_shortcut_1.registerOpenBrowserShortcut)({
|
|
124
126
|
browserArgs,
|
|
125
127
|
browserFlag,
|
|
126
|
-
|
|
127
|
-
url: `http://localhost:${port}`,
|
|
128
|
+
url: studioUrl,
|
|
128
129
|
logLevel,
|
|
129
130
|
});
|
|
130
|
-
|
|
131
|
+
try {
|
|
132
|
+
await (0, maybe_open_browser_1.maybeOpenBrowser)({
|
|
133
|
+
browserArgs,
|
|
134
|
+
browserFlag,
|
|
135
|
+
shouldOpenBrowser,
|
|
136
|
+
url: studioUrl,
|
|
137
|
+
logLevel,
|
|
138
|
+
});
|
|
139
|
+
await (0, close_and_restart_1.noOpUntilRestart)();
|
|
140
|
+
}
|
|
141
|
+
finally {
|
|
142
|
+
openBrowserShortcut.cleanup();
|
|
143
|
+
}
|
|
131
144
|
renderer_1.RenderInternals.Log.info({ indent: false, logLevel }, 'Closing server to restart...');
|
|
132
145
|
await liveEventsServer.closeConnections();
|
|
133
146
|
cleanupLiveEventsListener();
|
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.487",
|
|
7
7
|
"description": "Run a Remotion Studio with a server backend",
|
|
8
8
|
"main": "dist",
|
|
9
9
|
"scripts": {
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"@babel/parser": "7.24.1",
|
|
28
28
|
"semver": "7.5.3",
|
|
29
29
|
"prettier": "3.8.1",
|
|
30
|
-
"remotion": "4.0.
|
|
30
|
+
"remotion": "4.0.487",
|
|
31
31
|
"recast": "0.23.11",
|
|
32
|
-
"@remotion/bundler": "4.0.
|
|
33
|
-
"@remotion/renderer": "4.0.
|
|
34
|
-
"@remotion/studio-shared": "4.0.
|
|
32
|
+
"@remotion/bundler": "4.0.487",
|
|
33
|
+
"@remotion/renderer": "4.0.487",
|
|
34
|
+
"@remotion/studio-shared": "4.0.487",
|
|
35
35
|
"memfs": "3.4.3",
|
|
36
36
|
"open": "8.4.2"
|
|
37
37
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"ast-types": "0.16.1",
|
|
40
40
|
"react": "19.2.3",
|
|
41
41
|
"@types/semver": "7.5.3",
|
|
42
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
42
|
+
"@remotion/eslint-config-internal": "4.0.487",
|
|
43
43
|
"eslint": "9.19.0",
|
|
44
44
|
"@types/node": "20.12.14",
|
|
45
45
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|