@remotion/studio-server 4.0.537 → 4.0.539
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/ansi-diff.js +3 -19
- package/dist/better-opn/index.d.ts +4 -2
- package/dist/canvas-capture/generate-canvas-capture-composition.d.ts +14 -0
- package/dist/canvas-capture/generate-canvas-capture-composition.js +239 -0
- package/dist/codemods/add-effect.d.ts +1 -0
- package/dist/codemods/add-effect.js +8 -0
- package/dist/codemods/apply-codemod-to-file.d.ts +7 -0
- package/dist/codemods/apply-codemod-to-file.js +171 -0
- package/dist/codemods/apply-visual-control.d.ts +8 -0
- package/dist/codemods/apply-visual-control.js +89 -0
- package/dist/codemods/delete-effect.d.ts +1 -0
- package/dist/codemods/delete-effect.js +6 -0
- package/dist/codemods/delete-jsx-node.d.ts +22 -0
- package/dist/codemods/delete-jsx-node.js +17 -0
- package/dist/codemods/delete-jsx-nodes.d.ts +13 -0
- package/dist/codemods/delete-jsx-nodes.js +10 -0
- package/dist/codemods/duplicate-composition.d.ts +2 -0
- package/dist/codemods/duplicate-composition.js +64 -0
- package/dist/codemods/duplicate-effect.d.ts +1 -0
- package/dist/codemods/duplicate-effect.js +6 -0
- package/dist/codemods/duplicate-jsx-node.d.ts +25 -0
- package/dist/codemods/duplicate-jsx-node.js +26 -0
- package/dist/codemods/effect-param-expression.d.ts +2 -2
- package/dist/codemods/format-file-content.d.ts +7 -0
- package/dist/codemods/format-file-content.js +80 -0
- package/dist/codemods/format-inline-content.d.ts +18 -0
- package/dist/codemods/format-inline-content.js +78 -0
- package/dist/codemods/get-node-path-remappings.d.ts +1 -12
- package/dist/codemods/get-node-path-remappings.js +1 -51
- package/dist/codemods/insert-video-layers.d.ts +11 -0
- package/dist/codemods/insert-video-layers.js +5 -0
- package/dist/codemods/paste-effects.d.ts +2 -15
- package/dist/codemods/recast-mods.d.ts +13 -0
- package/dist/codemods/recast-mods.js +902 -0
- package/dist/codemods/reorder-effect.d.ts +1 -0
- package/dist/codemods/reorder-effect.js +5 -0
- package/dist/codemods/reorder-sequence.d.ts +1 -0
- package/dist/codemods/reorder-sequence.js +5 -0
- package/dist/codemods/simple-diff.d.ts +5 -0
- package/dist/codemods/simple-diff.js +39 -0
- package/dist/codemods/split-jsx-sequence.d.ts +27 -0
- package/dist/codemods/split-jsx-sequence.js +19 -0
- package/dist/codemods/split-video-from-audio.d.ts +1 -0
- package/dist/codemods/split-video-from-audio.js +5 -0
- package/dist/codemods/update-default-props.d.ts +1 -0
- package/dist/codemods/update-default-props.js +6 -0
- package/dist/codemods/update-effect-props/update-effect-props.d.ts +2 -2
- package/dist/codemods/update-inline-caption-patches.d.ts +1 -0
- package/dist/codemods/update-inline-caption-patches.js +5 -0
- package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.d.ts +1 -0
- package/dist/codemods/update-keyframes/ensure-imports-and-frame-hook.js +7 -0
- package/dist/codemods/update-keyframes/update-keyframes.d.ts +3 -3
- package/dist/codemods/update-nested-prop.d.ts +1 -1
- package/dist/detect-outdated-remotion-skills.d.ts +3 -3
- package/dist/figma/figma-to-svg.d.ts +1 -1
- package/dist/file-watcher.d.ts +1 -1
- package/dist/helpers/coding-agent-registry.d.ts +3 -3
- package/dist/helpers/css-shorthand-properties.d.ts +8 -7
- package/dist/helpers/custom-editor.d.ts +2 -2
- package/dist/helpers/editor-registry.d.ts +2 -2
- package/dist/helpers/get-ast-node-path.d.ts +2 -1
- package/dist/helpers/import-agnostic-node-path.js +22 -13
- package/dist/helpers/open-in-app.d.ts +3 -3
- package/dist/helpers/open-in-editor.d.ts +2 -2
- package/dist/helpers/package-manager-spawn-options.d.ts +1 -1
- package/dist/helpers/read-source-file.d.ts +4 -0
- package/dist/helpers/read-source-file.js +14 -0
- package/dist/helpers/recently-used-apps.d.ts +2 -2
- package/dist/helpers/resolve-composition-component.d.ts +2 -2
- package/dist/helpers/resolve-editor.d.ts +3 -3
- package/dist/helpers/terminal-artwork.d.ts +4 -4
- package/dist/helpers/video-config-values.d.ts +4 -0
- package/dist/helpers/video-config-values.js +11 -3
- package/dist/index.d.ts +39 -100
- package/dist/index.js +1 -1
- package/dist/maybe-open-browser.d.ts +2 -1
- package/dist/open-browser-shortcut.d.ts +9 -0
- package/dist/open-browser-shortcut.js +121 -0
- package/dist/preview-server/api-types.d.ts +1 -1
- package/dist/preview-server/dev-middleware/index.d.ts +2 -1
- package/dist/preview-server/dev-middleware/middleware.d.ts +1 -1
- package/dist/preview-server/dev-middleware/middleware.js +14 -17
- package/dist/preview-server/element-install-state.d.ts +1 -1
- package/dist/preview-server/get-package-manager.d.ts +3 -2
- package/dist/preview-server/handler.d.ts +4 -4
- package/dist/preview-server/hmr-timing.d.ts +2 -1
- package/dist/preview-server/hot-middleware/index.d.ts +2 -1
- package/dist/preview-server/hot-middleware/types.d.ts +2 -0
- package/dist/preview-server/hot-middleware/types.js +2 -0
- package/dist/preview-server/jsx-component-identity.d.ts +4 -3
- package/dist/preview-server/live-events.d.ts +3 -2
- package/dist/preview-server/public-folder.js +11 -2
- package/dist/preview-server/routes/add-keyframes.d.ts +2 -1
- package/dist/preview-server/routes/app-icon.d.ts +1 -1
- package/dist/preview-server/routes/apply-codemod.d.ts +4 -0
- package/dist/preview-server/routes/apply-codemod.js +272 -0
- package/dist/preview-server/routes/apply-visual-control-change.js +1 -4
- package/dist/preview-server/routes/batch-update-keyframe-settings.d.ts +2 -1
- package/dist/preview-server/routes/can-update-default-props.d.ts +2 -1
- package/dist/preview-server/routes/can-update-effect-props.d.ts +2 -6
- package/dist/preview-server/routes/can-update-sequence-props.d.ts +17 -13
- package/dist/preview-server/routes/can-update-sequence-props.js +21 -25
- package/dist/preview-server/routes/delete-jsx-node.d.ts +3 -0
- package/dist/preview-server/routes/delete-jsx-node.js +126 -0
- package/dist/preview-server/routes/delete-jsx-nodes.d.ts +3 -0
- package/dist/preview-server/routes/delete-jsx-nodes.js +137 -0
- package/dist/preview-server/routes/delete-keyframes.d.ts +4 -6
- package/dist/preview-server/routes/delete-keyframes.js +4 -66
- package/dist/preview-server/routes/duplicate-jsx-node.d.ts +3 -0
- package/dist/preview-server/routes/duplicate-jsx-node.js +118 -0
- package/dist/preview-server/routes/element-install-plan.d.ts +3 -3
- package/dist/preview-server/routes/find-in-file.d.ts +2 -9
- package/dist/preview-server/routes/insert-element.js +1 -4
- package/dist/preview-server/routes/insert-jsx-element.d.ts +3 -0
- package/dist/preview-server/routes/insert-jsx-element.js +231 -0
- package/dist/preview-server/routes/insert-video-layers.d.ts +3 -0
- package/dist/preview-server/routes/insert-video-layers.js +68 -0
- package/dist/preview-server/routes/install-dependency.d.ts +2 -14
- package/dist/preview-server/routes/log-updates/log-effect-update.d.ts +2 -1
- package/dist/preview-server/routes/log-updates/log-update.d.ts +3 -2
- package/dist/preview-server/routes/move-keyframes.d.ts +2 -1
- package/dist/preview-server/routes/open-in-editor.d.ts +2 -2
- package/dist/preview-server/routes/remotion-skills-info.d.ts +1 -1
- package/dist/preview-server/routes/save-multiple-effect-props.js +25 -8
- package/dist/preview-server/routes/save-sequence-props.d.ts +2 -2
- package/dist/preview-server/routes/source-file-write-queue.d.ts +3 -2
- package/dist/preview-server/routes/split-jsx-sequence.d.ts +3 -0
- package/dist/preview-server/routes/split-jsx-sequence.js +117 -0
- package/dist/preview-server/routes/subscribe-to-sequence-props.js +55 -34
- package/dist/preview-server/routes/update-public-license.d.ts +11 -0
- package/dist/preview-server/routes/update-public-license.js +97 -0
- package/dist/preview-server/routes/wrap-jsx-node.d.ts +3 -0
- package/dist/preview-server/routes/wrap-jsx-node.js +97 -0
- package/dist/preview-server/sequence-node-path-mutation.d.ts +2 -6
- package/dist/preview-server/sequence-props-watchers.d.ts +7 -5
- package/dist/preview-server/sequence-props-watchers.js +7 -2
- package/dist/preview-server/serve-static.d.ts +1 -1
- package/dist/preview-server/serve-static.js +18 -1
- package/dist/preview-server/start-server.d.ts +3 -3
- package/dist/preview-server/studio-protocol/handle-discovery.d.ts +1 -1
- package/dist/preview-server/studio-protocol/handle-element-library.d.ts +1 -1
- package/dist/preview-server/studio-protocol/handle-install.d.ts +1 -1
- package/dist/preview-server/studio-protocol/handle-license-key.d.ts +1 -1
- package/dist/preview-server/studio-protocol/origin-policy.d.ts +2 -2
- package/dist/preview-server/studio-protocol/protocol-response.d.ts +1 -1
- package/dist/preview-server/undo-stack.d.ts +3 -3
- package/dist/preview-server/undo-stack.js +9 -0
- package/dist/preview-server/update-available.d.ts +3 -2
- package/dist/preview-server/validate-same-origin.js +2 -1
- package/dist/remotion-skill-names.d.ts +1 -1
- package/dist/routes.d.ts +4 -4
- package/dist/server-ready.d.ts +2 -1
- package/dist/start-studio.d.ts +3 -3
- package/dist/studio-shortcuts.d.ts +3 -3
- package/package.json +10 -10
package/dist/ansi-diff.js
CHANGED
|
@@ -5,15 +5,10 @@ const studio_shared_1 = require("@remotion/studio-shared");
|
|
|
5
5
|
const CLEAR_LINE = Buffer.from([0x1b, 0x5b, 0x30, 0x4b]);
|
|
6
6
|
const NEWLINE = Buffer.from('\n');
|
|
7
7
|
class AnsiDiff {
|
|
8
|
-
x;
|
|
9
|
-
y;
|
|
10
|
-
width;
|
|
11
|
-
height;
|
|
12
|
-
_buffer;
|
|
13
|
-
_out;
|
|
14
|
-
_lines;
|
|
15
|
-
finished;
|
|
16
8
|
constructor(opts) {
|
|
9
|
+
this._push = (buf) => {
|
|
10
|
+
this._out.push(buf);
|
|
11
|
+
};
|
|
17
12
|
this.x = 0;
|
|
18
13
|
this.y = 0;
|
|
19
14
|
this.width = (opts === null || opts === void 0 ? void 0 : opts.width) || Infinity;
|
|
@@ -133,9 +128,6 @@ class AnsiDiff {
|
|
|
133
128
|
this.x = x;
|
|
134
129
|
this.y = y;
|
|
135
130
|
}
|
|
136
|
-
_push = (buf) => {
|
|
137
|
-
this._out.push(buf);
|
|
138
|
-
};
|
|
139
131
|
}
|
|
140
132
|
exports.AnsiDiff = AnsiDiff;
|
|
141
133
|
function same(a, b) {
|
|
@@ -148,14 +140,6 @@ function top(list) {
|
|
|
148
140
|
return list.length ? list[list.length - 1] : null;
|
|
149
141
|
}
|
|
150
142
|
class Line {
|
|
151
|
-
y;
|
|
152
|
-
width;
|
|
153
|
-
parts;
|
|
154
|
-
height;
|
|
155
|
-
remainder;
|
|
156
|
-
raw;
|
|
157
|
-
length;
|
|
158
|
-
newline;
|
|
159
143
|
constructor(str, y, nl, term) {
|
|
160
144
|
this.y = y;
|
|
161
145
|
this.width = term.width;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
declare const supportedChromiumBrowsers: readonly ['Google Chrome', 'Google Chrome Canary', 'Microsoft Edge', 'Brave Browser', 'Vivaldi', 'Chromium', 'Arc'];
|
|
1
2
|
export declare const getChromiumBrowsersToTry: (processes: string) => ("Arc" | "Brave Browser" | "Chromium" | "Google Chrome" | "Google Chrome Canary" | "Microsoft Edge" | "Vivaldi")[];
|
|
2
|
-
export declare const getFocusBrowserTabAppleScript: (chromiumBrowser:
|
|
3
|
-
export declare const getFocusBrowserTabByOriginAppleScript: (chromiumBrowser:
|
|
3
|
+
export declare const getFocusBrowserTabAppleScript: (chromiumBrowser: (typeof supportedChromiumBrowsers)[number]) => string;
|
|
4
|
+
export declare const getFocusBrowserTabByOriginAppleScript: (chromiumBrowser: (typeof supportedChromiumBrowsers)[number]) => string;
|
|
4
5
|
export declare const focusBrowserTab: ({ url }: {
|
|
5
6
|
url: string;
|
|
6
7
|
}) => Promise<boolean>;
|
|
@@ -14,3 +15,4 @@ export declare const openBrowser: ({ url, browserFlag, browserArgs, }: {
|
|
|
14
15
|
browserFlag: string | undefined;
|
|
15
16
|
browserArgs: string | undefined;
|
|
16
17
|
}) => Promise<boolean | import("child_process").ChildProcess>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CanvasCaptureData } from '@remotion/studio-shared';
|
|
2
|
+
export declare const generateCanvasCaptureComposition: ({ componentName, compositionId, data, durationInFrames, fps, height, keyframeFps, videoFileName, videoHeight, videoWidth, width, }: {
|
|
3
|
+
readonly componentName: string;
|
|
4
|
+
readonly compositionId: string;
|
|
5
|
+
readonly data: CanvasCaptureData;
|
|
6
|
+
readonly durationInFrames: number;
|
|
7
|
+
readonly fps: number;
|
|
8
|
+
readonly height: number;
|
|
9
|
+
readonly keyframeFps: number;
|
|
10
|
+
readonly videoFileName: string;
|
|
11
|
+
readonly videoHeight: number;
|
|
12
|
+
readonly videoWidth: number;
|
|
13
|
+
readonly width: number;
|
|
14
|
+
}) => string;
|
|
@@ -0,0 +1,239 @@
|
|
|
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.generateCanvasCaptureComposition = void 0;
|
|
37
|
+
const recast = __importStar(require("recast"));
|
|
38
|
+
const customCursorRegex = /^\s*url\(/;
|
|
39
|
+
const collapseMouseMovementsByFrame = ({ data, keyframeFps, }) => {
|
|
40
|
+
const movements = [];
|
|
41
|
+
for (const movement of data.mouseMovements) {
|
|
42
|
+
if (movement.canvasX === null || movement.canvasY === null) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const framedMovement = {
|
|
46
|
+
...movement,
|
|
47
|
+
frame: Math.ceil(movement.timeInSeconds * keyframeFps),
|
|
48
|
+
};
|
|
49
|
+
const previous = movements.at(-1);
|
|
50
|
+
if ((previous === null || previous === void 0 ? void 0 : previous.frame) === framedMovement.frame) {
|
|
51
|
+
movements[movements.length - 1] = framedMovement;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
movements.push(framedMovement);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return movements;
|
|
58
|
+
};
|
|
59
|
+
const getCursorName = (cursor) => {
|
|
60
|
+
var _a;
|
|
61
|
+
if (customCursorRegex.test(cursor)) {
|
|
62
|
+
return 'custom';
|
|
63
|
+
}
|
|
64
|
+
return ((_a = cursor.split(',').at(-1)) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) || 'default';
|
|
65
|
+
};
|
|
66
|
+
const serialize = (value) => {
|
|
67
|
+
if (typeof value === 'string') {
|
|
68
|
+
return recast.prettyPrint(recast.types.builders.stringLiteral(value), {
|
|
69
|
+
quote: 'single',
|
|
70
|
+
}).code;
|
|
71
|
+
}
|
|
72
|
+
return JSON.stringify(value);
|
|
73
|
+
};
|
|
74
|
+
const serializeArray = (values, indentation) => {
|
|
75
|
+
const items = values.map(serialize);
|
|
76
|
+
const inline = `[${items.join(', ')}]`;
|
|
77
|
+
if (indentation * 2 + inline.length + 1 <= 80) {
|
|
78
|
+
return inline;
|
|
79
|
+
}
|
|
80
|
+
const lines = [];
|
|
81
|
+
const numeric = values.every((value) => typeof value === 'number');
|
|
82
|
+
for (const item of items) {
|
|
83
|
+
const previous = lines.at(-1);
|
|
84
|
+
if (numeric &&
|
|
85
|
+
previous &&
|
|
86
|
+
(indentation + 1) * 2 + previous.length + item.length + 2 <= 80) {
|
|
87
|
+
lines[lines.length - 1] = `${previous} ${item},`;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
lines.push(`${item},`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return [
|
|
94
|
+
'[',
|
|
95
|
+
...lines.map((line) => `${'\t'.repeat(indentation + 1)}${line}`),
|
|
96
|
+
`${'\t'.repeat(indentation)}]`,
|
|
97
|
+
].join('\n');
|
|
98
|
+
};
|
|
99
|
+
const generateCanvasCaptureComposition = ({ componentName, compositionId, data, durationInFrames, fps, height, keyframeFps, videoFileName, videoHeight, videoWidth, width, }) => {
|
|
100
|
+
var _a;
|
|
101
|
+
const movements = collapseMouseMovementsByFrame({ data, keyframeFps });
|
|
102
|
+
if (movements.length === 0) {
|
|
103
|
+
throw new Error('The Canvas Capture does not contain cursor movements');
|
|
104
|
+
}
|
|
105
|
+
const cursorKeyframes = movements.reduce((keyframes, movement) => {
|
|
106
|
+
var _a;
|
|
107
|
+
const value = getCursorName(movement.cursor);
|
|
108
|
+
if (((_a = keyframes.at(-1)) === null || _a === void 0 ? void 0 : _a.value) !== value) {
|
|
109
|
+
keyframes.push({ frame: movement.frame, value });
|
|
110
|
+
}
|
|
111
|
+
return keyframes;
|
|
112
|
+
}, []);
|
|
113
|
+
const positionKeyframes = [];
|
|
114
|
+
for (const movement of movements) {
|
|
115
|
+
const previous = positionKeyframes.at(-1);
|
|
116
|
+
if (previous !== undefined && movement.frame - previous.frame > 1) {
|
|
117
|
+
positionKeyframes.push({
|
|
118
|
+
frame: movement.frame - 1,
|
|
119
|
+
value: previous.value,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
positionKeyframes.push({
|
|
123
|
+
frame: movement.frame,
|
|
124
|
+
value: `${movement.canvasX}px ${movement.canvasY}px`,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
const scaleKeyframes = [
|
|
128
|
+
{ frame: 0, value: data.captureMetadata.density },
|
|
129
|
+
...data.pointerClicks.map((click) => ({
|
|
130
|
+
frame: Math.ceil(click.timeInSeconds * keyframeFps),
|
|
131
|
+
value: click.type === 'pointer-down'
|
|
132
|
+
? data.captureMetadata.density * 0.9
|
|
133
|
+
: data.captureMetadata.density,
|
|
134
|
+
})),
|
|
135
|
+
].reduce((keyframes, keyframe) => {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
if (((_a = keyframes.at(-1)) === null || _a === void 0 ? void 0 : _a.frame) === keyframe.frame) {
|
|
138
|
+
keyframes[keyframes.length - 1] = keyframe;
|
|
139
|
+
}
|
|
140
|
+
else if (((_b = keyframes.at(-1)) === null || _b === void 0 ? void 0 : _b.value) !== keyframe.value) {
|
|
141
|
+
keyframes.push(keyframe);
|
|
142
|
+
}
|
|
143
|
+
return keyframes;
|
|
144
|
+
}, []);
|
|
145
|
+
const customCursor = (_a = movements.find((movement) => customCursorRegex.test(movement.cursor))) === null || _a === void 0 ? void 0 : _a.cursor;
|
|
146
|
+
const cursorProp = cursorKeyframes.length === 1
|
|
147
|
+
? `cursor={${serialize(cursorKeyframes[0].value)}}`
|
|
148
|
+
: `cursor={interpolate(
|
|
149
|
+
frame,
|
|
150
|
+
${serializeArray(cursorKeyframes.map((keyframe) => keyframe.frame), 5)},
|
|
151
|
+
${serializeArray(cursorKeyframes.map((keyframe) => keyframe.value), 5)},
|
|
152
|
+
{
|
|
153
|
+
easing: Easing.step1,
|
|
154
|
+
extrapolateLeft: 'clamp',
|
|
155
|
+
extrapolateRight: 'clamp',
|
|
156
|
+
},
|
|
157
|
+
)}`;
|
|
158
|
+
const scale = scaleKeyframes.length === 1
|
|
159
|
+
? serialize(scaleKeyframes[0].value)
|
|
160
|
+
: `interpolate(
|
|
161
|
+
frame,
|
|
162
|
+
${serializeArray(scaleKeyframes.map((keyframe) => keyframe.frame), 6)},
|
|
163
|
+
${serializeArray(scaleKeyframes.map((keyframe) => keyframe.value), 6)},
|
|
164
|
+
{
|
|
165
|
+
easing: Easing.step1,
|
|
166
|
+
extrapolateLeft: 'clamp',
|
|
167
|
+
extrapolateRight: 'clamp',
|
|
168
|
+
},
|
|
169
|
+
)`;
|
|
170
|
+
const translate = positionKeyframes.length === 1
|
|
171
|
+
? serialize(positionKeyframes[0].value)
|
|
172
|
+
: `interpolate(
|
|
173
|
+
frame,
|
|
174
|
+
${serializeArray(positionKeyframes.map((keyframe) => keyframe.frame), 6)},
|
|
175
|
+
${serializeArray(positionKeyframes.map((keyframe) => keyframe.value), 6)},
|
|
176
|
+
{
|
|
177
|
+
extrapolateLeft: 'clamp',
|
|
178
|
+
extrapolateRight: 'clamp',
|
|
179
|
+
},
|
|
180
|
+
)`;
|
|
181
|
+
const previewComponentName = componentName.endsWith('Composition')
|
|
182
|
+
? `${componentName.slice(0, -'Composition'.length)}Preview`
|
|
183
|
+
: `${componentName}Preview`;
|
|
184
|
+
return `import {MacOSCursor} from '@remotion/mac-cursors';
|
|
185
|
+
import {Video} from '@remotion/media';
|
|
186
|
+
import {
|
|
187
|
+
AbsoluteFill,
|
|
188
|
+
Composition,
|
|
189
|
+
Easing,
|
|
190
|
+
interpolate,
|
|
191
|
+
staticFile,
|
|
192
|
+
useCurrentFrame,
|
|
193
|
+
} from 'remotion';
|
|
194
|
+
|
|
195
|
+
export const ${previewComponentName} = () => {
|
|
196
|
+
const frame = useCurrentFrame();
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
<AbsoluteFill
|
|
200
|
+
style={{
|
|
201
|
+
width: ${videoWidth},
|
|
202
|
+
height: ${videoHeight},
|
|
203
|
+
}}
|
|
204
|
+
>
|
|
205
|
+
<Video
|
|
206
|
+
src={staticFile(${serialize(videoFileName)})}
|
|
207
|
+
style={{
|
|
208
|
+
position: 'absolute',
|
|
209
|
+
}}
|
|
210
|
+
/>
|
|
211
|
+
<MacOSCursor
|
|
212
|
+
${cursorProp}
|
|
213
|
+
${customCursor === undefined ? '' : `\t\t\t\tcustomCursor={${serialize(customCursor)}}\n`} style={{
|
|
214
|
+
position: 'absolute',
|
|
215
|
+
left: 0,
|
|
216
|
+
top: 0,
|
|
217
|
+
scale: ${scale},
|
|
218
|
+
translate: ${translate},
|
|
219
|
+
}}
|
|
220
|
+
/>
|
|
221
|
+
</AbsoluteFill>
|
|
222
|
+
);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export const ${componentName} = () => {
|
|
226
|
+
return (
|
|
227
|
+
<Composition
|
|
228
|
+
id={${serialize(compositionId)}}
|
|
229
|
+
component={${previewComponentName}}
|
|
230
|
+
width={${width}}
|
|
231
|
+
height={${height}}
|
|
232
|
+
fps={${fps}}
|
|
233
|
+
durationInFrames={${durationInFrames}}
|
|
234
|
+
/>
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
`;
|
|
238
|
+
};
|
|
239
|
+
exports.generateCanvasCaptureComposition = generateCanvasCaptureComposition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { addEffect, assertValidEffect, ensureEffectImport, makeConfigObjectExpression, } from '@remotion/studio-codemods';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeConfigObjectExpression = exports.ensureEffectImport = exports.assertValidEffect = exports.addEffect = void 0;
|
|
4
|
+
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
+
Object.defineProperty(exports, "addEffect", { enumerable: true, get: function () { return studio_codemods_1.addEffect; } });
|
|
6
|
+
Object.defineProperty(exports, "assertValidEffect", { enumerable: true, get: function () { return studio_codemods_1.assertValidEffect; } });
|
|
7
|
+
Object.defineProperty(exports, "ensureEffectImport", { enumerable: true, get: function () { return studio_codemods_1.ensureEffectImport; } });
|
|
8
|
+
Object.defineProperty(exports, "makeConfigObjectExpression", { enumerable: true, get: function () { return studio_codemods_1.makeConfigObjectExpression; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CodemodResult } from '@remotion/codemods';
|
|
2
|
+
import type { RecastCodemod, SymbolicatedStackFrame } from '@remotion/studio-shared';
|
|
3
|
+
export declare const resolveFilePathFromSymbolicatedStack: (remotionRoot: string, stack: SymbolicatedStackFrame) => string;
|
|
4
|
+
export declare const applyCodemodToFile: ({ filePath, codeMod, }: {
|
|
5
|
+
filePath: string;
|
|
6
|
+
codeMod: RecastCodemod;
|
|
7
|
+
}) => Promise<CodemodResult>;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.applyCodemodToFile = exports.resolveFilePathFromSymbolicatedStack = void 0;
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const promises_1 = require("node:fs/promises");
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const codemods_1 = require("@remotion/codemods");
|
|
11
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
12
|
+
const resolve_file_inside_project_1 = require("../helpers/resolve-file-inside-project");
|
|
13
|
+
const can_update_default_props_1 = require("../preview-server/routes/can-update-default-props");
|
|
14
|
+
const resolveFilePathFromSymbolicatedStack = (remotionRoot, stack) => {
|
|
15
|
+
if (!stack.originalFileName) {
|
|
16
|
+
throw new Error('Could not determine the file where this composition is defined');
|
|
17
|
+
}
|
|
18
|
+
const { absolutePath } = (0, resolve_file_inside_project_1.resolveFileInsideProject)({
|
|
19
|
+
remotionRoot,
|
|
20
|
+
fileName: stack.originalFileName,
|
|
21
|
+
action: 'apply codemod to',
|
|
22
|
+
});
|
|
23
|
+
if (!(0, node_fs_1.existsSync)(absolutePath)) {
|
|
24
|
+
throw new Error(`File not found: ${stack.originalFileName}`);
|
|
25
|
+
}
|
|
26
|
+
return absolutePath;
|
|
27
|
+
};
|
|
28
|
+
exports.resolveFilePathFromSymbolicatedStack = resolveFilePathFromSymbolicatedStack;
|
|
29
|
+
const applyCodemodToFile = async ({ filePath, codeMod, }) => {
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
|
+
(0, can_update_default_props_1.checkIfTypeScriptFile)(filePath);
|
|
32
|
+
const input = await (0, promises_1.readFile)(filePath, 'utf-8');
|
|
33
|
+
const options = {
|
|
34
|
+
project: { files: { [filePath]: input }, rootDir: node_path_1.default.dirname(filePath) },
|
|
35
|
+
compositionFile: filePath,
|
|
36
|
+
};
|
|
37
|
+
if (codeMod.type === 'apply-visual-control') {
|
|
38
|
+
return (0, codemods_1.updateVisualControls)({
|
|
39
|
+
...options,
|
|
40
|
+
filePath,
|
|
41
|
+
changes: codeMod.changes,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (codeMod.type === 'new-composition') {
|
|
45
|
+
const componentFilePath = node_path_1.default.join(node_path_1.default.dirname(filePath), `${codeMod.componentName}.tsx`);
|
|
46
|
+
if ((0, node_fs_1.existsSync)(componentFilePath)) {
|
|
47
|
+
throw new Error(`Cannot create ${componentFilePath} because it already exists`);
|
|
48
|
+
}
|
|
49
|
+
const composition = {
|
|
50
|
+
...options,
|
|
51
|
+
compositionId: codeMod.newId,
|
|
52
|
+
component: {
|
|
53
|
+
filePath: componentFilePath,
|
|
54
|
+
importName: codeMod.componentName,
|
|
55
|
+
importPath: codeMod.componentImportPath,
|
|
56
|
+
},
|
|
57
|
+
metadata: {
|
|
58
|
+
width: codeMod.newWidth,
|
|
59
|
+
height: codeMod.newHeight,
|
|
60
|
+
fps: codeMod.newFps,
|
|
61
|
+
durationInFrames: codeMod.newDurationInFrames,
|
|
62
|
+
},
|
|
63
|
+
folder: codeMod.folderName === null
|
|
64
|
+
? undefined
|
|
65
|
+
: { name: codeMod.folderName, parentName: codeMod.parentName },
|
|
66
|
+
};
|
|
67
|
+
if (codeMod.canvasCapture !== null) {
|
|
68
|
+
return (0, codemods_1.addCanvasCaptureComposition)({
|
|
69
|
+
...composition,
|
|
70
|
+
capture: codeMod.canvasCapture,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const result = (0, codemods_1.addComposition)(composition);
|
|
74
|
+
return {
|
|
75
|
+
...result,
|
|
76
|
+
changes: [
|
|
77
|
+
...result.changes,
|
|
78
|
+
{
|
|
79
|
+
filePath: componentFilePath,
|
|
80
|
+
previousContents: null,
|
|
81
|
+
nextContents: codeMod.asset === null
|
|
82
|
+
? (0, studio_shared_1.emptyCompositionComponent)(codeMod.componentName)
|
|
83
|
+
: (0, studio_shared_1.assetCompositionComponent)({
|
|
84
|
+
asset: codeMod.asset,
|
|
85
|
+
componentName: codeMod.componentName,
|
|
86
|
+
}),
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (codeMod.type === 'rename-composition') {
|
|
92
|
+
return (0, codemods_1.renameComposition)({
|
|
93
|
+
...options,
|
|
94
|
+
compositionId: codeMod.idToRename,
|
|
95
|
+
newId: codeMod.newId,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (codeMod.type === 'delete-composition') {
|
|
99
|
+
return (0, codemods_1.deleteComposition)({ ...options, compositionId: codeMod.idToDelete });
|
|
100
|
+
}
|
|
101
|
+
if (codeMod.type === 'duplicate-composition' ||
|
|
102
|
+
codeMod.type === 'update-composition-metadata') {
|
|
103
|
+
const metadata = {
|
|
104
|
+
width: (_a = codeMod.newWidth) !== null && _a !== void 0 ? _a : undefined,
|
|
105
|
+
height: (_b = codeMod.newHeight) !== null && _b !== void 0 ? _b : undefined,
|
|
106
|
+
fps: codeMod.type === 'duplicate-composition' && codeMod.tag === 'Still'
|
|
107
|
+
? undefined
|
|
108
|
+
: ((_c = codeMod.newFps) !== null && _c !== void 0 ? _c : undefined),
|
|
109
|
+
durationInFrames: codeMod.type === 'duplicate-composition' && codeMod.tag === 'Still'
|
|
110
|
+
? undefined
|
|
111
|
+
: ((_d = codeMod.newDurationInFrames) !== null && _d !== void 0 ? _d : undefined),
|
|
112
|
+
};
|
|
113
|
+
const result = codeMod.type === 'duplicate-composition'
|
|
114
|
+
? (0, codemods_1.duplicateComposition)({
|
|
115
|
+
...options,
|
|
116
|
+
compositionId: codeMod.idToDuplicate,
|
|
117
|
+
newId: codeMod.newId,
|
|
118
|
+
tag: codeMod.tag,
|
|
119
|
+
metadata,
|
|
120
|
+
})
|
|
121
|
+
: (0, codemods_1.updateCompositionMetadata)({
|
|
122
|
+
...options,
|
|
123
|
+
compositionId: codeMod.idToUpdate,
|
|
124
|
+
metadata,
|
|
125
|
+
});
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
if (codeMod.type === 'move-composition-or-folder') {
|
|
129
|
+
const target = codeMod.destination;
|
|
130
|
+
const destination = target.type === 'root'
|
|
131
|
+
? target
|
|
132
|
+
: target.type === 'folder'
|
|
133
|
+
? {
|
|
134
|
+
type: 'folder',
|
|
135
|
+
folder: { name: target.folderName, parentName: target.parentName },
|
|
136
|
+
}
|
|
137
|
+
: {
|
|
138
|
+
type: target.type,
|
|
139
|
+
target: target.target.type === 'composition'
|
|
140
|
+
? target.target
|
|
141
|
+
: {
|
|
142
|
+
type: 'folder',
|
|
143
|
+
name: target.target.folderName,
|
|
144
|
+
parentName: target.target.parentName,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
const result = codeMod.source.type === 'composition'
|
|
148
|
+
? (0, codemods_1.moveComposition)({
|
|
149
|
+
...options,
|
|
150
|
+
compositionId: codeMod.source.compositionId,
|
|
151
|
+
destination,
|
|
152
|
+
})
|
|
153
|
+
: (0, codemods_1.moveFolder)({
|
|
154
|
+
...options,
|
|
155
|
+
folder: {
|
|
156
|
+
name: codeMod.source.folderName,
|
|
157
|
+
parentName: codeMod.source.parentName,
|
|
158
|
+
},
|
|
159
|
+
destination,
|
|
160
|
+
});
|
|
161
|
+
return result;
|
|
162
|
+
}
|
|
163
|
+
const folder = { name: codeMod.folderName, parentName: codeMod.parentName };
|
|
164
|
+
const folderResult = codeMod.type === 'new-folder'
|
|
165
|
+
? (0, codemods_1.addFolder)({ ...options, folder })
|
|
166
|
+
: codeMod.type === 'rename-folder'
|
|
167
|
+
? (0, codemods_1.renameFolder)({ ...options, folder, newName: codeMod.newName })
|
|
168
|
+
: (0, codemods_1.unwrapFolder)({ ...options, folder });
|
|
169
|
+
return folderResult;
|
|
170
|
+
};
|
|
171
|
+
exports.applyCodemodToFile = applyCodemodToFile;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { File } from '@babel/types';
|
|
2
|
+
import { type ApplyVisualControlCodemod } from '@remotion/studio-shared';
|
|
3
|
+
import type { ApplyCodeModReturnType, Change } from './recast-mods';
|
|
4
|
+
export declare const applyVisualControl: ({ file, transformation, changesMade, }: {
|
|
5
|
+
file: File;
|
|
6
|
+
transformation: ApplyVisualControlCodemod;
|
|
7
|
+
changesMade: Change[];
|
|
8
|
+
}) => ApplyCodeModReturnType;
|
|
@@ -0,0 +1,89 @@
|
|
|
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.applyVisualControl = void 0;
|
|
37
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
38
|
+
const recast = __importStar(require("recast"));
|
|
39
|
+
const parse_ast_1 = require("./parse-ast");
|
|
40
|
+
const expectString = (node) => {
|
|
41
|
+
if (node.type === 'StringLiteral') {
|
|
42
|
+
return node.value;
|
|
43
|
+
}
|
|
44
|
+
if (node.type === 'TemplateLiteral') {
|
|
45
|
+
if (node.expressions.length > 0) {
|
|
46
|
+
throw new Error('applyVisualControl() must use a static identifier, the string may not be dynamic.');
|
|
47
|
+
}
|
|
48
|
+
return node.quasis[0].value.raw;
|
|
49
|
+
}
|
|
50
|
+
throw new Error('Expected a string literal');
|
|
51
|
+
};
|
|
52
|
+
const applyVisualControl = ({ file, transformation, changesMade, }) => {
|
|
53
|
+
recast.types.visit(file.program, {
|
|
54
|
+
visitCallExpression(path) {
|
|
55
|
+
const { node } = path;
|
|
56
|
+
if (node.type !== 'CallExpression') {
|
|
57
|
+
throw new Error('Expected a call expression');
|
|
58
|
+
}
|
|
59
|
+
if (node.callee.type !== 'Identifier') {
|
|
60
|
+
return this.traverse(path);
|
|
61
|
+
}
|
|
62
|
+
if (node.callee.name !== 'visualControl') {
|
|
63
|
+
return this.traverse(path);
|
|
64
|
+
}
|
|
65
|
+
const firstArgument = node.arguments[0];
|
|
66
|
+
const str = expectString(firstArgument);
|
|
67
|
+
for (const change of transformation.changes) {
|
|
68
|
+
if (change.id !== str) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
let parsed;
|
|
72
|
+
if (change.newValueIsUndefined) {
|
|
73
|
+
parsed = (0, parse_ast_1.parseAst)('a = undefined').program
|
|
74
|
+
.body[0].expression.right;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
parsed = (0, parse_ast_1.parseAst)(`a = ${(0, studio_shared_1.stringifyDefaultProps)({ props: JSON.parse(change.newValueSerialized), enumPaths: change.enumPaths })}`).program.body[0].expression.right;
|
|
78
|
+
}
|
|
79
|
+
node.arguments[1] = parsed;
|
|
80
|
+
changesMade.push({
|
|
81
|
+
description: `Applied visual control ${change.id}`,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return this.traverse(path);
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return { newAst: file, changesMade };
|
|
88
|
+
};
|
|
89
|
+
exports.applyVisualControl = applyVisualControl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { deleteEffect, deleteEffects, type EffectDeletionTarget, } from '@remotion/studio-codemods';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteEffects = exports.deleteEffect = void 0;
|
|
4
|
+
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
+
Object.defineProperty(exports, "deleteEffect", { enumerable: true, get: function () { return studio_codemods_1.deleteEffect; } });
|
|
6
|
+
Object.defineProperty(exports, "deleteEffects", { enumerable: true, get: function () { return studio_codemods_1.deleteEffects; } });
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { deleteJsxElementAtPath, findJsxElementPathForDeletion, getJsxElementTagLabel } from '@remotion/studio-codemods';
|
|
2
|
+
import type { SequenceNodePath } from 'remotion';
|
|
3
|
+
export { deleteJsxElementAtPath, findJsxElementPathForDeletion, getJsxElementTagLabel, };
|
|
4
|
+
export declare const deleteJsxNodes: ({ input, nodePaths, }: {
|
|
5
|
+
input: string;
|
|
6
|
+
nodePaths: SequenceNodePath[];
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
output: string;
|
|
9
|
+
formatted: boolean;
|
|
10
|
+
nodeLabels: string[];
|
|
11
|
+
logLines: number[];
|
|
12
|
+
nodePathRemappings: import("@remotion/studio-shared").SequenceNodePathRemapping[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare const deleteJsxNode: ({ input, nodePath, }: {
|
|
15
|
+
input: string;
|
|
16
|
+
nodePath: SequenceNodePath;
|
|
17
|
+
}) => Promise<{
|
|
18
|
+
output: string;
|
|
19
|
+
formatted: boolean;
|
|
20
|
+
nodeLabel: string;
|
|
21
|
+
logLine: number;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteJsxNode = exports.deleteJsxNodes = exports.getJsxElementTagLabel = exports.findJsxElementPathForDeletion = exports.deleteJsxElementAtPath = void 0;
|
|
4
|
+
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
5
|
+
Object.defineProperty(exports, "deleteJsxElementAtPath", { enumerable: true, get: function () { return studio_codemods_1.deleteJsxElementAtPath; } });
|
|
6
|
+
Object.defineProperty(exports, "findJsxElementPathForDeletion", { enumerable: true, get: function () { return studio_codemods_1.findJsxElementPathForDeletion; } });
|
|
7
|
+
Object.defineProperty(exports, "getJsxElementTagLabel", { enumerable: true, get: function () { return studio_codemods_1.getJsxElementTagLabel; } });
|
|
8
|
+
const deleteJsxNodes = ({ input, nodePaths, }) => (0, studio_codemods_1.deleteJsxNodes)({
|
|
9
|
+
input,
|
|
10
|
+
nodePaths,
|
|
11
|
+
});
|
|
12
|
+
exports.deleteJsxNodes = deleteJsxNodes;
|
|
13
|
+
const deleteJsxNode = ({ input, nodePath, }) => (0, studio_codemods_1.deleteJsxNode)({
|
|
14
|
+
input,
|
|
15
|
+
nodePath,
|
|
16
|
+
});
|
|
17
|
+
exports.deleteJsxNode = deleteJsxNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SequenceNodePath } from 'remotion';
|
|
2
|
+
declare const deleteJsxElementAtPath: (jsxPath: import("ast-types/lib/node-path").NodePath<N, V>) => void, findJsxElementPathForDeletion: (ast: import("@babel/types").File, nodePath: SequenceNodePath) => import("ast-types/lib/node-path").NodePath<N, V> | null, getJsxElementTagLabel: (element: import("@babel/types").JSXElement) => string;
|
|
3
|
+
export { deleteJsxElementAtPath, findJsxElementPathForDeletion, getJsxElementTagLabel, };
|
|
4
|
+
export declare const deleteJsxNodes: ({ input, nodePaths, }: {
|
|
5
|
+
input: string;
|
|
6
|
+
nodePaths: SequenceNodePath[];
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
output: string;
|
|
9
|
+
formatted: boolean;
|
|
10
|
+
nodeLabels: string[];
|
|
11
|
+
logLines: number[];
|
|
12
|
+
nodePathRemappings: import("@remotion/studio-shared").SequenceNodePathRemapping[];
|
|
13
|
+
}>;
|