@remotion/studio-server 4.0.525 → 4.0.527
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/apply-codemod-to-file.js +5 -11
- package/dist/codemods/{delete-jsx-node.d.ts → delete-jsx-nodes.d.ts} +1 -10
- package/dist/codemods/delete-jsx-nodes.js +10 -0
- package/dist/codemods/paste-effects.d.ts +15 -1
- package/dist/codemods/paste-effects.js +3 -2
- package/dist/codemods/split-jsx-sequence.d.ts +14 -0
- package/dist/codemods/split-jsx-sequence.js +10 -3
- package/dist/codemods/update-effect-props/update-effect-props.d.ts +36 -1
- package/dist/codemods/update-effect-props/update-effect-props.js +4 -7
- package/dist/codemods/update-keyframes/update-keyframes.d.ts +64 -2
- package/dist/codemods/update-keyframes/update-keyframes.js +5 -6
- package/dist/codemods/update-sequence-props/update-sequence-props.d.ts +13 -1
- package/dist/codemods/update-sequence-props/update-sequence-props.js +3 -3
- package/dist/helpers/resolve-composition-component.d.ts +1 -1
- package/dist/helpers/resolve-composition-component.js +5 -4
- package/dist/index.d.ts +8 -7
- package/dist/index.js +5 -5
- package/dist/preview-server/api-routes.js +4 -2
- package/dist/preview-server/routes/add-effect.js +3 -2
- package/dist/preview-server/routes/apply-codemod.js +4 -3
- package/dist/preview-server/routes/apply-visual-control-change.js +7 -34
- package/dist/preview-server/routes/can-update-default-props.d.ts +1 -1
- package/dist/preview-server/routes/can-update-default-props.js +3 -4
- package/dist/preview-server/routes/can-update-sequence-props.js +34 -1
- package/dist/preview-server/routes/delete-effect.js +3 -2
- package/dist/preview-server/routes/delete-jsx-nodes.d.ts +3 -0
- package/dist/preview-server/routes/{delete-jsx-node.js → delete-jsx-nodes.js} +10 -10
- package/dist/preview-server/routes/duplicate-effect.js +3 -2
- package/dist/preview-server/routes/duplicate-jsx-node.js +4 -8
- package/dist/preview-server/routes/element-install-plan.d.ts +1 -1
- package/dist/preview-server/routes/find-in-file.d.ts +9 -1
- package/dist/preview-server/routes/find-in-file.js +3 -4
- package/dist/preview-server/routes/insert-basic-captions.d.ts +3 -0
- package/dist/preview-server/routes/insert-basic-captions.js +119 -0
- package/dist/preview-server/routes/reorder-effect.js +3 -2
- package/dist/preview-server/routes/reorder-sequence.js +4 -7
- package/dist/preview-server/routes/save-sequence-props.js +3 -2
- package/dist/preview-server/routes/split-jsx-sequence.js +73 -41
- package/dist/preview-server/routes/split-video-from-audio.js +3 -2
- package/dist/preview-server/routes/update-default-props.js +4 -7
- package/dist/preview-server/undo-stack.d.ts +1 -1
- package/dist/start-studio.d.ts +1 -0
- package/dist/start-studio.js +1 -1
- package/package.json +9 -9
- package/dist/canvas-capture/generate-canvas-capture-composition.d.ts +0 -14
- package/dist/canvas-capture/generate-canvas-capture-composition.js +0 -239
- package/dist/codemods/add-effect.d.ts +0 -1
- package/dist/codemods/add-effect.js +0 -8
- package/dist/codemods/apply-visual-control.d.ts +0 -8
- package/dist/codemods/apply-visual-control.js +0 -89
- package/dist/codemods/delete-effect.d.ts +0 -1
- package/dist/codemods/delete-effect.js +0 -6
- package/dist/codemods/delete-jsx-node.js +0 -17
- package/dist/codemods/duplicate-composition.d.ts +0 -2
- package/dist/codemods/duplicate-composition.js +0 -64
- package/dist/codemods/duplicate-effect.d.ts +0 -1
- package/dist/codemods/duplicate-effect.js +0 -6
- package/dist/codemods/duplicate-jsx-node.d.ts +0 -25
- package/dist/codemods/duplicate-jsx-node.js +0 -26
- package/dist/codemods/format-file-content.d.ts +0 -7
- package/dist/codemods/format-file-content.js +0 -80
- package/dist/codemods/format-inline-content.d.ts +0 -18
- package/dist/codemods/format-inline-content.js +0 -78
- package/dist/codemods/recast-mods.d.ts +0 -13
- package/dist/codemods/recast-mods.js +0 -902
- package/dist/codemods/reorder-effect.d.ts +0 -1
- package/dist/codemods/reorder-effect.js +0 -5
- package/dist/codemods/reorder-sequence.d.ts +0 -15
- package/dist/codemods/reorder-sequence.js +0 -17
- package/dist/codemods/simple-diff.d.ts +0 -5
- package/dist/codemods/simple-diff.js +0 -39
- package/dist/codemods/split-video-from-audio.d.ts +0 -12
- package/dist/codemods/split-video-from-audio.js +0 -15
- package/dist/codemods/update-default-props.d.ts +0 -11
- package/dist/codemods/update-default-props.js +0 -16
- package/dist/codemods/update-inline-caption-patches.d.ts +0 -1
- package/dist/codemods/update-inline-caption-patches.js +0 -5
- package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.d.ts +0 -1
- package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.js +0 -7
- package/dist/preview-server/routes/delete-jsx-node.d.ts +0 -3
- package/dist/preview-server/routes/update-public-license.d.ts +0 -11
- package/dist/preview-server/routes/update-public-license.js +0 -97
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { reorderEffect } from '@remotion/studio-codemods';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reorderEffect = void 0;
|
|
4
|
-
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
-
Object.defineProperty(exports, "reorderEffect", { enumerable: true, get: function () { return studio_codemods_1.reorderEffect; } });
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ReorderSequencePosition } from '@remotion/studio-shared';
|
|
2
|
-
import type { SequenceNodePath } from 'remotion';
|
|
3
|
-
export declare const reorderSequence: ({ input, sourceNodePath, targetNodePath, position, prettierConfigOverride, }: {
|
|
4
|
-
input: string;
|
|
5
|
-
sourceNodePath: SequenceNodePath;
|
|
6
|
-
targetNodePath: SequenceNodePath;
|
|
7
|
-
position: ReorderSequencePosition;
|
|
8
|
-
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
9
|
-
}) => Promise<{
|
|
10
|
-
output: string;
|
|
11
|
-
formatted: boolean;
|
|
12
|
-
sequenceLabel: string;
|
|
13
|
-
logLine: number;
|
|
14
|
-
nodePathRemappings: import("@remotion/studio-shared").SequenceNodePathRemapping[];
|
|
15
|
-
}>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reorderSequence = void 0;
|
|
4
|
-
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
-
const format_file_content_1 = require("./format-file-content");
|
|
6
|
-
const reorderSequence = ({ input, sourceNodePath, targetNodePath, position, prettierConfigOverride, }) => (0, studio_codemods_1.reorderSequence)({
|
|
7
|
-
input,
|
|
8
|
-
sourceNodePath,
|
|
9
|
-
targetNodePath,
|
|
10
|
-
position,
|
|
11
|
-
formatFile: ({ contents, prettierConfigOverride: override }) => (0, format_file_content_1.formatFileContent)({
|
|
12
|
-
input: contents,
|
|
13
|
-
prettierConfigOverride: override,
|
|
14
|
-
}),
|
|
15
|
-
prettierConfigOverride,
|
|
16
|
-
});
|
|
17
|
-
exports.reorderSequence = reorderSequence;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.simpleDiff = void 0;
|
|
4
|
-
const findDeletions = ({ oldLines, newLines, }) => {
|
|
5
|
-
const linesChecked = [];
|
|
6
|
-
let totalDeletions = 0;
|
|
7
|
-
for (const line of oldLines) {
|
|
8
|
-
if (linesChecked.includes(line)) {
|
|
9
|
-
continue;
|
|
10
|
-
}
|
|
11
|
-
const timesInNewLines = newLines.filter((l) => l === line).length;
|
|
12
|
-
const timesInOldLines = oldLines.filter((l) => l === line).length;
|
|
13
|
-
const deletions = Math.max(0, timesInOldLines - timesInNewLines);
|
|
14
|
-
totalDeletions += deletions;
|
|
15
|
-
linesChecked.push(line);
|
|
16
|
-
}
|
|
17
|
-
return totalDeletions;
|
|
18
|
-
};
|
|
19
|
-
const findAdditions = ({ oldLines, newLines, }) => {
|
|
20
|
-
const linesChecked = [];
|
|
21
|
-
let totalAdditions = 0;
|
|
22
|
-
for (const line of newLines) {
|
|
23
|
-
if (linesChecked.includes(line)) {
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
const timesInNewLines = newLines.filter((l) => l === line).length;
|
|
27
|
-
const timesInOldLines = oldLines.filter((l) => l === line).length;
|
|
28
|
-
const additions = Math.max(0, timesInNewLines - timesInOldLines);
|
|
29
|
-
totalAdditions += additions;
|
|
30
|
-
linesChecked.push(line);
|
|
31
|
-
}
|
|
32
|
-
return totalAdditions;
|
|
33
|
-
};
|
|
34
|
-
const simpleDiff = ({ oldLines, newLines, }) => {
|
|
35
|
-
const deletions = findDeletions({ oldLines, newLines });
|
|
36
|
-
const additions = findAdditions({ oldLines, newLines });
|
|
37
|
-
return { deletions, additions };
|
|
38
|
-
};
|
|
39
|
-
exports.simpleDiff = simpleDiff;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SequenceNodePath } from 'remotion';
|
|
2
|
-
export declare const splitVideoFromAudio: ({ input, nodePath, prettierConfigOverride, }: {
|
|
3
|
-
input: string;
|
|
4
|
-
nodePath: SequenceNodePath;
|
|
5
|
-
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
6
|
-
}) => Promise<{
|
|
7
|
-
output: string;
|
|
8
|
-
formatted: boolean;
|
|
9
|
-
nodeLabel: string;
|
|
10
|
-
logLine: number;
|
|
11
|
-
nodePathRemappings: import("@remotion/studio-shared").SequenceNodePathRemapping[];
|
|
12
|
-
}>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.splitVideoFromAudio = void 0;
|
|
4
|
-
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
-
const format_file_content_1 = require("./format-file-content");
|
|
6
|
-
const splitVideoFromAudio = ({ input, nodePath, prettierConfigOverride, }) => (0, studio_codemods_1.splitVideoFromAudio)({
|
|
7
|
-
input,
|
|
8
|
-
nodePath,
|
|
9
|
-
formatFile: ({ contents, prettierConfigOverride: override }) => (0, format_file_content_1.formatFileContent)({
|
|
10
|
-
input: contents,
|
|
11
|
-
prettierConfigOverride: override,
|
|
12
|
-
}),
|
|
13
|
-
prettierConfigOverride,
|
|
14
|
-
});
|
|
15
|
-
exports.splitVideoFromAudio = splitVideoFromAudio;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { EnumPath } from '@remotion/studio-shared';
|
|
2
|
-
export { getCompositionDefaultPropsLine } from '@remotion/studio-codemods';
|
|
3
|
-
export declare const updateDefaultProps: ({ input, compositionId, newDefaultProps, enumPaths, }: {
|
|
4
|
-
input: string;
|
|
5
|
-
compositionId: string;
|
|
6
|
-
newDefaultProps: Record<string, unknown>;
|
|
7
|
-
enumPaths: EnumPath[];
|
|
8
|
-
}) => Promise<{
|
|
9
|
-
output: string;
|
|
10
|
-
formatted: boolean;
|
|
11
|
-
}>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateDefaultProps = exports.getCompositionDefaultPropsLine = void 0;
|
|
4
|
-
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
-
const format_inline_content_1 = require("./format-inline-content");
|
|
6
|
-
const studio_codemods_2 = require("@remotion/studio-codemods");
|
|
7
|
-
Object.defineProperty(exports, "getCompositionDefaultPropsLine", { enumerable: true, get: function () { return studio_codemods_2.getCompositionDefaultPropsLine; } });
|
|
8
|
-
const formatInline = ({ inlineContent, linePrefix, endOfLine }) => (0, format_inline_content_1.formatInlineContent)({ inlineContent, linePrefix, endOfLine });
|
|
9
|
-
const updateDefaultProps = ({ input, compositionId, newDefaultProps, enumPaths, }) => (0, studio_codemods_1.updateDefaultProps)({
|
|
10
|
-
input,
|
|
11
|
-
compositionId,
|
|
12
|
-
newDefaultProps,
|
|
13
|
-
enumPaths,
|
|
14
|
-
formatInline,
|
|
15
|
-
});
|
|
16
|
-
exports.updateDefaultProps = updateDefaultProps;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { updateInlineCaptionPatches } from '@remotion/studio-codemods';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateInlineCaptionPatches = void 0;
|
|
4
|
-
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
-
Object.defineProperty(exports, "updateInlineCaptionPatches", { enumerable: true, get: function () { return studio_codemods_1.updateInlineCaptionPatches; } });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ensureRemotionImports, ensureUseCurrentFrameHook, findEnclosingFunctionPath, } from '@remotion/studio-codemods';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findEnclosingFunctionPath = exports.ensureUseCurrentFrameHook = exports.ensureRemotionImports = void 0;
|
|
4
|
-
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
-
Object.defineProperty(exports, "ensureRemotionImports", { enumerable: true, get: function () { return studio_codemods_1.ensureRemotionImports; } });
|
|
6
|
-
Object.defineProperty(exports, "ensureUseCurrentFrameHook", { enumerable: true, get: function () { return studio_codemods_1.ensureUseCurrentFrameHook; } });
|
|
7
|
-
Object.defineProperty(exports, "findEnclosingFunctionPath", { enumerable: true, get: function () { return studio_codemods_1.findEnclosingFunctionPath; } });
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { UpdatePublicLicenseRequest, UpdatePublicLicenseResponse } from '@remotion/studio-shared';
|
|
2
|
-
import type { ApiHandler } from '../api-types';
|
|
3
|
-
export declare const updatePublicLicenseInConfig: ({ configContents, publicLicenseKey, }: {
|
|
4
|
-
configContents: string;
|
|
5
|
-
publicLicenseKey: string;
|
|
6
|
-
}) => string;
|
|
7
|
-
export declare const setPublicLicenseKeyInConfigFile: ({ configFile, publicLicenseKey, }: {
|
|
8
|
-
readonly configFile: string;
|
|
9
|
-
readonly publicLicenseKey: string;
|
|
10
|
-
}) => void;
|
|
11
|
-
export declare const updatePublicLicenseHandler: ApiHandler<UpdatePublicLicenseRequest, UpdatePublicLicenseResponse>;
|
|
@@ -1,97 +0,0 @@
|
|
|
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.updatePublicLicenseHandler = exports.setPublicLicenseKeyInConfigFile = exports.updatePublicLicenseInConfig = void 0;
|
|
37
|
-
const node_fs_1 = require("node:fs");
|
|
38
|
-
const recast = __importStar(require("recast"));
|
|
39
|
-
const parse_ast_1 = require("../../codemods/parse-ast");
|
|
40
|
-
const file_watcher_1 = require("../../file-watcher");
|
|
41
|
-
const updatePublicLicenseInConfig = ({ configContents, publicLicenseKey, }) => {
|
|
42
|
-
const ast = (0, parse_ast_1.parseAst)(configContents);
|
|
43
|
-
recast.types.visit(ast.program, {
|
|
44
|
-
visitExpressionStatement(path) {
|
|
45
|
-
const { expression } = path.node;
|
|
46
|
-
if (expression.type === 'CallExpression' &&
|
|
47
|
-
expression.callee.type === 'MemberExpression' &&
|
|
48
|
-
!expression.callee.computed &&
|
|
49
|
-
expression.callee.object.type === 'Identifier' &&
|
|
50
|
-
expression.callee.object.name === 'Config' &&
|
|
51
|
-
expression.callee.property.type === 'Identifier' &&
|
|
52
|
-
expression.callee.property.name === 'setPublicLicenseKey') {
|
|
53
|
-
path.prune();
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
this.traverse(path);
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
const configWithoutExistingCalls = recast.print(ast, {
|
|
60
|
-
lineTerminator: '\n',
|
|
61
|
-
}).code;
|
|
62
|
-
const separator = configWithoutExistingCalls.endsWith('\n') ? '' : '\n';
|
|
63
|
-
const escapedPublicLicenseKey = publicLicenseKey
|
|
64
|
-
.replaceAll('\\', '\\\\')
|
|
65
|
-
.replaceAll("'", "\\'")
|
|
66
|
-
.replaceAll('\r', '\\r')
|
|
67
|
-
.replaceAll('\n', '\\n')
|
|
68
|
-
.replaceAll('\u2028', '\\u2028')
|
|
69
|
-
.replaceAll('\u2029', '\\u2029');
|
|
70
|
-
return `${configWithoutExistingCalls}${separator}Config.setPublicLicenseKey('${escapedPublicLicenseKey}');\n`;
|
|
71
|
-
};
|
|
72
|
-
exports.updatePublicLicenseInConfig = updatePublicLicenseInConfig;
|
|
73
|
-
const setPublicLicenseKeyInConfigFile = ({ configFile, publicLicenseKey, }) => {
|
|
74
|
-
const configContents = (0, node_fs_1.readFileSync)(configFile, 'utf8');
|
|
75
|
-
(0, file_watcher_1.writeFileAndNotifyFileWatchers)(configFile, (0, exports.updatePublicLicenseInConfig)({ configContents, publicLicenseKey }), undefined);
|
|
76
|
-
};
|
|
77
|
-
exports.setPublicLicenseKeyInConfigFile = setPublicLicenseKeyInConfigFile;
|
|
78
|
-
const updatePublicLicenseHandler = ({ input, configFile }) => {
|
|
79
|
-
if (configFile === null || configFile === undefined) {
|
|
80
|
-
return Promise.resolve({
|
|
81
|
-
success: false,
|
|
82
|
-
reason: 'No Remotion config file was loaded.',
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
if (input.publicLicenseKey.length === 0) {
|
|
86
|
-
return Promise.resolve({
|
|
87
|
-
success: false,
|
|
88
|
-
reason: 'The public license key must not be empty.',
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
(0, exports.setPublicLicenseKeyInConfigFile)({
|
|
92
|
-
configFile,
|
|
93
|
-
publicLicenseKey: input.publicLicenseKey,
|
|
94
|
-
});
|
|
95
|
-
return Promise.resolve({ success: true });
|
|
96
|
-
};
|
|
97
|
-
exports.updatePublicLicenseHandler = updatePublicLicenseHandler;
|