@remotion/studio-server 4.0.526 → 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 +3 -2
- 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 +6 -3
- package/dist/index.js +5 -4
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- 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 -3
- package/dist/preview-server/undo-stack.d.ts +1 -1
- package/package.json +8 -8
- 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 -1
- package/dist/codemods/reorder-sequence.js +0 -5
- 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 -1
- package/dist/codemods/split-video-from-audio.js +0 -5
- package/dist/codemods/update-default-props.d.ts +0 -1
- package/dist/codemods/update-default-props.js +0 -6
- 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
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.applyCodemodToFile = exports.resolveFilePathFromSymbolicatedStack = void 0;
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
|
-
const
|
|
5
|
+
const codemods_1 = require("@remotion/codemods");
|
|
6
6
|
const resolve_file_inside_project_1 = require("../helpers/resolve-file-inside-project");
|
|
7
7
|
const can_update_default_props_1 = require("../preview-server/routes/can-update-default-props");
|
|
8
|
+
const { parseAndApplyCodemod } = codemods_1.CodemodsInternals;
|
|
8
9
|
const resolveFilePathFromSymbolicatedStack = (remotionRoot, stack) => {
|
|
9
10
|
if (!stack.originalFileName) {
|
|
10
11
|
throw new Error('Could not determine the file where this composition is defined');
|
|
@@ -23,7 +24,7 @@ exports.resolveFilePathFromSymbolicatedStack = resolveFilePathFromSymbolicatedSt
|
|
|
23
24
|
const applyCodemodToFile = ({ filePath, codeMod, }) => {
|
|
24
25
|
(0, can_update_default_props_1.checkIfTypeScriptFile)(filePath);
|
|
25
26
|
const input = (0, node_fs_1.readFileSync)(filePath, 'utf-8');
|
|
26
|
-
const { newContents } =
|
|
27
|
+
const { newContents } = parseAndApplyCodemod({
|
|
27
28
|
codeMod,
|
|
28
29
|
input,
|
|
29
30
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { deleteJsxElementAtPath, findJsxElementPathForDeletion, getJsxElementTagLabel } from '@remotion/studio-codemods';
|
|
2
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
3
|
export { deleteJsxElementAtPath, findJsxElementPathForDeletion, getJsxElementTagLabel, };
|
|
4
4
|
export declare const deleteJsxNodes: ({ input, nodePaths, }: {
|
|
5
5
|
input: string;
|
|
@@ -11,12 +11,3 @@ export declare const deleteJsxNodes: ({ input, nodePaths, }: {
|
|
|
11
11
|
logLines: number[];
|
|
12
12
|
nodePathRemappings: import("@remotion/studio-shared").SequenceNodePathRemapping[];
|
|
13
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,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteJsxNodes = exports.getJsxElementTagLabel = exports.findJsxElementPathForDeletion = exports.deleteJsxElementAtPath = void 0;
|
|
4
|
+
const codemods_1 = require("@remotion/codemods");
|
|
5
|
+
const { deleteJsxElementAtPath, deleteJsxNodes: deleteJsxNodesCodemod, findJsxElementPathForDeletion, getJsxElementTagLabel, } = codemods_1.CodemodsInternals;
|
|
6
|
+
const deleteJsxNodes = ({ input, nodePaths, }) => deleteJsxNodesCodemod({
|
|
7
|
+
input,
|
|
8
|
+
nodePaths,
|
|
9
|
+
});
|
|
10
|
+
exports.deleteJsxNodes = deleteJsxNodes;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
declare const pasteEffectsCodemod: ({ effects, input, insertAtIndices, prettierConfigOverride, targetSequenceNodePath, type, }: {
|
|
2
|
+
effects: import("@remotion/studio-shared").EffectClipboardSnapshot[];
|
|
3
|
+
input: string;
|
|
4
|
+
insertAtIndices: number[] | null;
|
|
5
|
+
targetSequenceNodePath: import("remotion").SequenceNodePath;
|
|
6
|
+
type: import("@remotion/studio-shared").EffectClipboardPasteType;
|
|
7
|
+
} & {
|
|
8
|
+
formatFile?: import("@remotion/codemods").FormatEffectFile | undefined;
|
|
9
|
+
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
output: string;
|
|
12
|
+
formatted: boolean;
|
|
13
|
+
effectLabels: string[];
|
|
14
|
+
logLine: number;
|
|
15
|
+
}>;
|
|
2
16
|
type PasteEffectsInput = Parameters<typeof pasteEffectsCodemod>[0] & {
|
|
3
17
|
readonly targetFileName: string;
|
|
4
18
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pasteEffects = void 0;
|
|
4
|
-
const
|
|
5
|
-
const pasteEffects
|
|
4
|
+
const codemods_1 = require("@remotion/codemods");
|
|
5
|
+
const { pasteEffects: pasteEffectsCodemod } = codemods_1.CodemodsInternals;
|
|
6
|
+
const pasteEffects = (input) => pasteEffectsCodemod(input);
|
|
6
7
|
exports.pasteEffects = pasteEffects;
|
|
@@ -11,3 +11,17 @@ export declare const splitJsxSequence: ({ input, nodePath, sequenceKeys, splitFr
|
|
|
11
11
|
logLine: number;
|
|
12
12
|
nodePathRemappings: import("@remotion/studio-shared").SequenceNodePathRemapping[];
|
|
13
13
|
}>;
|
|
14
|
+
export declare const splitJsxSequences: ({ input, splits, prettierConfigOverride, }: {
|
|
15
|
+
input: string;
|
|
16
|
+
splits: {
|
|
17
|
+
nodePath: SequenceNodePath;
|
|
18
|
+
sequenceKeys: string[];
|
|
19
|
+
splitFrame: number;
|
|
20
|
+
}[];
|
|
21
|
+
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
22
|
+
}) => Promise<{
|
|
23
|
+
output: string;
|
|
24
|
+
nodeLabels: string[];
|
|
25
|
+
logLines: number[];
|
|
26
|
+
nodePathRemappings: import("@remotion/studio-shared").SequenceNodePathRemapping[];
|
|
27
|
+
}>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.splitJsxSequence = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
3
|
+
exports.splitJsxSequences = exports.splitJsxSequence = void 0;
|
|
4
|
+
const codemods_1 = require("@remotion/codemods");
|
|
5
|
+
const { splitJsxSequence: splitJsxSequenceCodemod, splitJsxSequences: splitJsxSequencesCodemod, } = codemods_1.CodemodsInternals;
|
|
6
|
+
const splitJsxSequence = ({ input, nodePath, sequenceKeys, splitFrame, prettierConfigOverride, }) => splitJsxSequenceCodemod({
|
|
6
7
|
input,
|
|
7
8
|
nodePath,
|
|
8
9
|
sequenceKeys,
|
|
@@ -10,3 +11,9 @@ const splitJsxSequence = ({ input, nodePath, sequenceKeys, splitFrame, prettierC
|
|
|
10
11
|
prettierConfigOverride,
|
|
11
12
|
});
|
|
12
13
|
exports.splitJsxSequence = splitJsxSequence;
|
|
14
|
+
const splitJsxSequences = ({ input, splits, prettierConfigOverride, }) => splitJsxSequencesCodemod({
|
|
15
|
+
input,
|
|
16
|
+
splits,
|
|
17
|
+
prettierConfigOverride,
|
|
18
|
+
});
|
|
19
|
+
exports.splitJsxSequences = splitJsxSequences;
|
|
@@ -1,3 +1,38 @@
|
|
|
1
1
|
import type { JSXAttribute } from '@babel/types';
|
|
2
|
-
|
|
2
|
+
import { type EffectArrayElement, type EffectPropUpdate, type PropDelta, type UpdateEffectPropsResult } from '@remotion/codemods';
|
|
3
|
+
export type { EffectArrayElement, EffectPropUpdate, PropDelta, UpdateEffectPropsResult, };
|
|
4
|
+
export declare const enumerateEffectArrayElements: (arr: import("@babel/types").ArrayExpression) => EffectArrayElement[], findEffectCallExpression: ({ attr, effectIndex, }: {
|
|
5
|
+
attr: JSXAttribute;
|
|
6
|
+
effectIndex: number;
|
|
7
|
+
}) => {
|
|
8
|
+
kind: "ok";
|
|
9
|
+
call: import("@babel/types").CallExpression;
|
|
10
|
+
callee: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "error";
|
|
13
|
+
reason: "not-call-expression" | "not-found";
|
|
14
|
+
}, updateEffectProps: ({ effectIndex, input, prettierConfigOverride, schema, sequenceNodePath, update, }: {
|
|
15
|
+
effectIndex: number;
|
|
16
|
+
input: string;
|
|
17
|
+
schema: import("remotion").InteractivitySchema;
|
|
18
|
+
sequenceNodePath: import("remotion").SequenceNodePath;
|
|
19
|
+
update: EffectPropUpdate;
|
|
20
|
+
} & {
|
|
21
|
+
formatFile?: import("@remotion/codemods").FormatEffectFile | undefined;
|
|
22
|
+
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
23
|
+
}) => Promise<UpdateEffectPropsResult>, updateEffectPropsAst: ({ effectIndex, input, prettierConfigOverride, schema, sequenceNodePath, update, }: {
|
|
24
|
+
effectIndex: number;
|
|
25
|
+
input: string;
|
|
26
|
+
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
27
|
+
schema: import("remotion").InteractivitySchema;
|
|
28
|
+
sequenceNodePath: import("remotion").SequenceNodePath;
|
|
29
|
+
update: EffectPropUpdate;
|
|
30
|
+
}) => {
|
|
31
|
+
serialized: string;
|
|
32
|
+
oldValueString: string;
|
|
33
|
+
newValueString: string;
|
|
34
|
+
logLine: number;
|
|
35
|
+
effectCallee: string;
|
|
36
|
+
removedProps: PropDelta[];
|
|
37
|
+
};
|
|
3
38
|
export declare const findEffectsAttr: (attrs: readonly unknown[]) => JSXAttribute | null;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findEffectsAttr = exports.updateEffectPropsAst = exports.updateEffectProps = exports.findEffectCallExpression = exports.enumerateEffectArrayElements = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "findEffectCallExpression", { enumerable: true, get: function () { return studio_codemods_2.findEffectCallExpression; } });
|
|
8
|
-
Object.defineProperty(exports, "updateEffectProps", { enumerable: true, get: function () { return studio_codemods_2.updateEffectProps; } });
|
|
9
|
-
Object.defineProperty(exports, "updateEffectPropsAst", { enumerable: true, get: function () { return studio_codemods_2.updateEffectPropsAst; } });
|
|
4
|
+
const codemods_1 = require("@remotion/codemods");
|
|
5
|
+
({ enumerateEffectArrayElements: exports.enumerateEffectArrayElements, findEffectCallExpression: exports.findEffectCallExpression, updateEffectProps: exports.updateEffectProps, updateEffectPropsAst: exports.updateEffectPropsAst } = codemods_1.CodemodsInternals);
|
|
6
|
+
const { findEffectsAttr: findEffectsAttrCodemod } = codemods_1.CodemodsInternals;
|
|
10
7
|
const findEffectsAttr = (attrs) => {
|
|
11
|
-
return (
|
|
8
|
+
return findEffectsAttrCodemod(attrs);
|
|
12
9
|
};
|
|
13
10
|
exports.findEffectsAttr = findEffectsAttr;
|
|
@@ -1,5 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { type EffectKeyframeUpdate, type IntroducedKeyframeIdentifiers, type KeyframeOperation, type SequenceKeyframeUpdate } from '@remotion/codemods';
|
|
2
|
+
export type { EffectKeyframeUpdate, IntroducedKeyframeIdentifiers, KeyframeOperation, SequenceKeyframeUpdate, };
|
|
3
|
+
export declare const updateEffectKeyframesAst: ({ input, sequenceNodePath, effectIndex, updates, schema, prettierConfigOverride, videoConfigValues, }: {
|
|
4
|
+
input: string;
|
|
5
|
+
sequenceNodePath: import("remotion").SequenceNodePath;
|
|
6
|
+
effectIndex: number;
|
|
7
|
+
updates: EffectKeyframeUpdate[];
|
|
8
|
+
schema?: import("remotion").InteractivitySchema | undefined;
|
|
9
|
+
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
10
|
+
videoConfigValues: import("remotion").VideoConfigValues | null;
|
|
11
|
+
}) => {
|
|
12
|
+
serialized: string;
|
|
13
|
+
oldValueStrings: string[];
|
|
14
|
+
newValueStrings: string[];
|
|
15
|
+
logLine: number;
|
|
16
|
+
effectCallee: string;
|
|
17
|
+
updatedSequenceNodePath: import("remotion").SequenceNodePath;
|
|
18
|
+
}, updateSequenceKeyframesAst: ({ input, nodePath, updates, schema, prettierConfigOverride, videoConfigValues, }: {
|
|
19
|
+
input: string;
|
|
20
|
+
nodePath: import("remotion").SequenceNodePath;
|
|
21
|
+
updates: SequenceKeyframeUpdate[];
|
|
22
|
+
schema?: import("remotion").InteractivitySchema | undefined;
|
|
23
|
+
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
24
|
+
videoConfigValues: import("remotion").VideoConfigValues | null;
|
|
25
|
+
}) => {
|
|
26
|
+
serialized: string;
|
|
27
|
+
oldValueStrings: string[];
|
|
28
|
+
newValueStrings: string[];
|
|
29
|
+
logLine: number;
|
|
30
|
+
updatedNodePath: import("remotion").SequenceNodePath;
|
|
31
|
+
};
|
|
32
|
+
declare const updateEffectKeyframesCodemod: ({ input, sequenceNodePath, effectIndex, updates, schema, prettierConfigOverride, videoConfigValues, }: {
|
|
33
|
+
input: string;
|
|
34
|
+
sequenceNodePath: import("remotion").SequenceNodePath;
|
|
35
|
+
effectIndex: number;
|
|
36
|
+
updates: EffectKeyframeUpdate[];
|
|
37
|
+
schema?: import("remotion").InteractivitySchema | undefined;
|
|
38
|
+
formatFile?: import("@remotion/codemods").FormatKeyframesFile | undefined;
|
|
39
|
+
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
40
|
+
videoConfigValues: import("remotion").VideoConfigValues | null;
|
|
41
|
+
}) => Promise<{
|
|
42
|
+
output: string;
|
|
43
|
+
formatted: boolean;
|
|
44
|
+
oldValueStrings: string[];
|
|
45
|
+
newValueStrings: string[];
|
|
46
|
+
logLine: number;
|
|
47
|
+
effectCallee: string;
|
|
48
|
+
updatedSequenceNodePath: import("remotion").SequenceNodePath;
|
|
49
|
+
}>, updateSequenceKeyframesCodemod: ({ input, nodePath, updates, schema, prettierConfigOverride, videoConfigValues, }: {
|
|
50
|
+
input: string;
|
|
51
|
+
nodePath: import("remotion").SequenceNodePath;
|
|
52
|
+
updates: SequenceKeyframeUpdate[];
|
|
53
|
+
schema?: import("remotion").InteractivitySchema | undefined;
|
|
54
|
+
formatFile?: import("@remotion/codemods").FormatKeyframesFile | undefined;
|
|
55
|
+
prettierConfigOverride?: Record<string, unknown> | null | undefined;
|
|
56
|
+
videoConfigValues: import("remotion").VideoConfigValues | null;
|
|
57
|
+
}) => Promise<{
|
|
58
|
+
output: string;
|
|
59
|
+
formatted: boolean;
|
|
60
|
+
oldValueStrings: string[];
|
|
61
|
+
newValueStrings: string[];
|
|
62
|
+
logLine: number;
|
|
63
|
+
updatedNodePath: import("remotion").SequenceNodePath;
|
|
64
|
+
}>;
|
|
3
65
|
type UpdateSequenceKeyframesInput = Omit<Parameters<typeof updateSequenceKeyframesCodemod>[0], 'formatFile'>;
|
|
4
66
|
type UpdateEffectKeyframesInput = Omit<Parameters<typeof updateEffectKeyframesCodemod>[0], 'formatFile'>;
|
|
5
67
|
export declare const updateSequenceKeyframes: (input: UpdateSequenceKeyframesInput) => Promise<{
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateEffectKeyframes = exports.updateSequenceKeyframes = exports.updateSequenceKeyframesAst = exports.updateEffectKeyframesAst = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const updateSequenceKeyframes = (input) => (0, studio_codemods_1.updateSequenceKeyframes)(input);
|
|
4
|
+
const codemods_1 = require("@remotion/codemods");
|
|
5
|
+
({ updateEffectKeyframesAst: exports.updateEffectKeyframesAst, updateSequenceKeyframesAst: exports.updateSequenceKeyframesAst } = codemods_1.CodemodsInternals);
|
|
6
|
+
const { updateEffectKeyframes: updateEffectKeyframesCodemod, updateSequenceKeyframes: updateSequenceKeyframesCodemod, } = codemods_1.CodemodsInternals;
|
|
7
|
+
const updateSequenceKeyframes = (input) => updateSequenceKeyframesCodemod(input);
|
|
9
8
|
exports.updateSequenceKeyframes = updateSequenceKeyframes;
|
|
10
|
-
const updateEffectKeyframes = (input) => (
|
|
9
|
+
const updateEffectKeyframes = (input) => updateEffectKeyframesCodemod(input);
|
|
11
10
|
exports.updateEffectKeyframes = updateEffectKeyframes;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import type { File } from '@babel/types';
|
|
2
|
-
import { type RemovedProp, type SequencePropsNodeUpdate, type SequencePropsNodeUpdateResult, type SequencePropUpdate
|
|
2
|
+
import { type RemovedProp, type SequencePropsNodeUpdate, type SequencePropsNodeUpdateResult, type SequencePropUpdate } from '@remotion/codemods';
|
|
3
3
|
import type { InteractivitySchema, SequenceNodePath, VideoConfigValues } from 'remotion';
|
|
4
|
+
declare const updateSequencePropsAst: ({ input, nodePath, updates, schema, videoConfigValues, }: {
|
|
5
|
+
input: string;
|
|
6
|
+
nodePath: SequenceNodePath;
|
|
7
|
+
updates: SequencePropUpdate[];
|
|
8
|
+
schema: InteractivitySchema;
|
|
9
|
+
videoConfigValues: VideoConfigValues | null;
|
|
10
|
+
}) => {
|
|
11
|
+
serialized: string;
|
|
12
|
+
oldValueStrings: string[];
|
|
13
|
+
logLine: number;
|
|
14
|
+
removedProps: RemovedProp[];
|
|
15
|
+
};
|
|
4
16
|
export { type RemovedProp, type SequencePropsNodeUpdate, type SequencePropsNodeUpdateResult, type SequencePropUpdate, updateSequencePropsAst, };
|
|
5
17
|
type PrettierConfigOverride = Record<string, unknown> | null;
|
|
6
18
|
type UpdateMultipleSequencePropsResult = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateSequenceProps = exports.updateMultipleSequenceProps = exports.updateSequencePropsAst = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const codemods_1 = require("@remotion/codemods");
|
|
5
|
+
const { updateMultipleSequenceProps: updateMultipleSequencePropsCodemod, updateSequencePropsAst, } = codemods_1.CodemodsInternals;
|
|
6
6
|
const updateMultipleSequenceProps = ({ input, changes, prettierConfigOverride, ast: providedAst, }) => {
|
|
7
7
|
return Promise.resolve().then(() => {
|
|
8
|
-
const { output, results, ast } = (
|
|
8
|
+
const { output, results, ast } = updateMultipleSequencePropsCodemod({
|
|
9
9
|
input,
|
|
10
10
|
changes,
|
|
11
11
|
ast: providedAst,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ResolvedCompositionComponent, type ResolvedCompositionComponentWithFile } from '@remotion/
|
|
1
|
+
import { type ResolvedCompositionComponent, type ResolvedCompositionComponentWithFile } from '@remotion/codemods';
|
|
2
2
|
import type { InsertableCompositionElement, InsertableCompositionElementPosition, SequenceNodePathRemapping } from '@remotion/studio-shared';
|
|
3
3
|
import type { SequenceNodePath } from 'remotion';
|
|
4
4
|
export type { ResolvedCompositionComponent, ResolvedCompositionComponentWithFile, };
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.insertJsxElementIntoComposition = exports.resolveCompositionComponent = exports.resolveCompositionComponentWithFile = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
const
|
|
9
|
+
const codemods_1 = require("@remotion/codemods");
|
|
10
10
|
const svg_to_jsx_1 = require("./svg-to-jsx");
|
|
11
|
+
const { insertJsxElementIntoComposition: insertJsxElementIntoCompositionCodemod, resolveCompositionComponent: resolveCompositionComponentCodemod, resolveCompositionComponentWithFile: resolveCompositionComponentWithFileCodemod, } = codemods_1.CodemodsInternals;
|
|
11
12
|
const makeCodemodEnvironment = (remotionRoot, sourceFileOverrides) => ({
|
|
12
13
|
dirname: node_path_1.default.dirname,
|
|
13
14
|
extname: node_path_1.default.extname,
|
|
@@ -27,13 +28,13 @@ const makeCodemodEnvironment = (remotionRoot, sourceFileOverrides) => ({
|
|
|
27
28
|
rootDir: remotionRoot,
|
|
28
29
|
svgMarkupToJsx: svg_to_jsx_1.svgMarkupToJsx,
|
|
29
30
|
});
|
|
30
|
-
const resolveCompositionComponentWithFile = ({ remotionRoot, compositionFile, compositionId, }) => (
|
|
31
|
+
const resolveCompositionComponentWithFile = ({ remotionRoot, compositionFile, compositionId, }) => resolveCompositionComponentWithFileCodemod({
|
|
31
32
|
compositionFile,
|
|
32
33
|
compositionId,
|
|
33
34
|
environment: makeCodemodEnvironment(remotionRoot, null),
|
|
34
35
|
});
|
|
35
36
|
exports.resolveCompositionComponentWithFile = resolveCompositionComponentWithFile;
|
|
36
|
-
const resolveCompositionComponent = ({ remotionRoot, compositionFile, compositionId, }) => (
|
|
37
|
+
const resolveCompositionComponent = ({ remotionRoot, compositionFile, compositionId, }) => resolveCompositionComponentCodemod({
|
|
37
38
|
compositionFile,
|
|
38
39
|
compositionId,
|
|
39
40
|
environment: makeCodemodEnvironment(remotionRoot, null),
|
|
@@ -41,7 +42,7 @@ const resolveCompositionComponent = ({ remotionRoot, compositionFile, compositio
|
|
|
41
42
|
exports.resolveCompositionComponent = resolveCompositionComponent;
|
|
42
43
|
const insertJsxElementIntoComposition = ({ remotionRoot, compositionFile, compositionId, element, from, prettierConfigOverride, wrapInSequence = null, sourceFileOverrides, }) => {
|
|
43
44
|
var _a;
|
|
44
|
-
return (
|
|
45
|
+
return insertJsxElementIntoCompositionCodemod({
|
|
45
46
|
compositionFile,
|
|
46
47
|
compositionId,
|
|
47
48
|
element,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RecastCodemod } from '@remotion/studio-shared';
|
|
1
2
|
export { ApiRoutes, CopyStillToClipboardRequest, getDefaultOutLocation, OpenInFileExplorerRequest, } from '@remotion/studio-shared';
|
|
2
3
|
export type { AggregateRenderProgress, BundlingState, CopyingState, DownloadProgress, HotMiddlewareOptions, JobProgressCallback, ModuleMap, PackageManager, ProjectInfo, RenderingProgressInput, RenderJob, RenderJobWithCleanup, RequiredChromiumOptions, StitchingProgressInput, UiOpenGlOptions, } from '@remotion/studio-shared';
|
|
3
4
|
import { AnsiDiff } from './ansi-diff';
|
|
@@ -90,14 +91,16 @@ export declare const StudioServerInternals: {
|
|
|
90
91
|
}) | undefined) => string;
|
|
91
92
|
parseAndApplyCodemod: ({ input, codeMod, }: {
|
|
92
93
|
input: string;
|
|
93
|
-
codeMod:
|
|
94
|
+
codeMod: RecastCodemod;
|
|
94
95
|
}) => {
|
|
95
96
|
newContents: string;
|
|
96
|
-
changesMade:
|
|
97
|
+
changesMade: {
|
|
98
|
+
description: string;
|
|
99
|
+
}[];
|
|
97
100
|
};
|
|
98
101
|
applyCodemodToFile: ({ filePath, codeMod, }: {
|
|
99
102
|
filePath: string;
|
|
100
|
-
codeMod:
|
|
103
|
+
codeMod: RecastCodemod;
|
|
101
104
|
}) => Promise<string>;
|
|
102
105
|
updateDefaultProps: ({ input, compositionId, newDefaultProps, enumPaths, }: {
|
|
103
106
|
input: string;
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,10 @@ exports.StudioServerInternals = exports.remotionSkillNames = exports.parseRemoti
|
|
|
4
4
|
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
5
|
const studio_shared_2 = require("@remotion/studio-shared");
|
|
6
6
|
Object.defineProperty(exports, "getDefaultOutLocation", { enumerable: true, get: function () { return studio_shared_2.getDefaultOutLocation; } });
|
|
7
|
-
const
|
|
7
|
+
const codemods_1 = require("@remotion/codemods");
|
|
8
8
|
const ansi_diff_1 = require("./ansi-diff");
|
|
9
9
|
const client_render_queue_1 = require("./client-render-queue");
|
|
10
10
|
const apply_codemod_to_file_1 = require("./codemods/apply-codemod-to-file");
|
|
11
|
-
const update_default_props_1 = require("./codemods/update-default-props");
|
|
12
11
|
const detect_outdated_remotion_skills_1 = require("./detect-outdated-remotion-skills");
|
|
13
12
|
Object.defineProperty(exports, "detectOutdatedRemotionSkills", { enumerable: true, get: function () { return detect_outdated_remotion_skills_1.detectOutdatedRemotionSkills; } });
|
|
14
13
|
Object.defineProperty(exports, "parseRemotionSkillVersion", { enumerable: true, get: function () { return detect_outdated_remotion_skills_1.parseRemotionSkillVersion; } });
|
|
@@ -25,6 +24,8 @@ const update_available_1 = require("./preview-server/update-available");
|
|
|
25
24
|
const remotion_skill_names_1 = require("./remotion-skill-names");
|
|
26
25
|
Object.defineProperty(exports, "remotionSkillNames", { enumerable: true, get: function () { return remotion_skill_names_1.remotionSkillNames; } });
|
|
27
26
|
const start_studio_1 = require("./start-studio");
|
|
27
|
+
const { updateDefaultProps } = codemods_1.CodemodsInternals;
|
|
28
|
+
const parseAndApplyCodemod = ({ input, codeMod, }) => codemods_1.CodemodsInternals.parseAndApplyCodemod({ input, codeMod });
|
|
28
29
|
exports.StudioServerInternals = {
|
|
29
30
|
startStudio: start_studio_1.startStudio,
|
|
30
31
|
getRemotionVersion: update_available_1.getRemotionVersion,
|
|
@@ -42,9 +43,9 @@ exports.StudioServerInternals = {
|
|
|
42
43
|
setFileWatcherRegistry: file_watcher_1.setFileWatcherRegistry,
|
|
43
44
|
AnsiDiff: ansi_diff_1.AnsiDiff,
|
|
44
45
|
formatBytes: studio_shared_1.formatBytes,
|
|
45
|
-
parseAndApplyCodemod
|
|
46
|
+
parseAndApplyCodemod,
|
|
46
47
|
applyCodemodToFile: apply_codemod_to_file_1.applyCodemodToFile,
|
|
47
|
-
updateDefaultProps
|
|
48
|
+
updateDefaultProps,
|
|
48
49
|
getInstalledDependencies: get_installed_dependencies_1.getInstalledDependencies,
|
|
49
50
|
getInstalledDependenciesWithVersions: get_installed_dependencies_1.getInstalledDependenciesWithVersions,
|
|
50
51
|
getInstallCommand: install_command_1.getInstallCommand,
|
|
@@ -16,13 +16,14 @@ const copy_render_output_to_asset_1 = require("./routes/copy-render-output-to-as
|
|
|
16
16
|
const default_coding_agent_1 = require("./routes/default-coding-agent");
|
|
17
17
|
const default_editor_1 = require("./routes/default-editor");
|
|
18
18
|
const delete_effect_1 = require("./routes/delete-effect");
|
|
19
|
-
const
|
|
19
|
+
const delete_jsx_nodes_1 = require("./routes/delete-jsx-nodes");
|
|
20
20
|
const delete_keyframes_1 = require("./routes/delete-keyframes");
|
|
21
21
|
const delete_static_file_1 = require("./routes/delete-static-file");
|
|
22
22
|
const download_remote_asset_1 = require("./routes/download-remote-asset");
|
|
23
23
|
const duplicate_effect_1 = require("./routes/duplicate-effect");
|
|
24
24
|
const duplicate_jsx_node_1 = require("./routes/duplicate-jsx-node");
|
|
25
25
|
const find_in_file_1 = require("./routes/find-in-file");
|
|
26
|
+
const insert_basic_captions_1 = require("./routes/insert-basic-captions");
|
|
26
27
|
const insert_element_1 = require("./routes/insert-element");
|
|
27
28
|
const insert_jsx_element_1 = require("./routes/insert-jsx-element");
|
|
28
29
|
const install_remotion_skill_1 = require("./routes/install-remotion-skill");
|
|
@@ -107,10 +108,11 @@ exports.allApiRoutes = {
|
|
|
107
108
|
'/api/batch-update-keyframe-settings': batch_update_keyframe_settings_1.batchUpdateKeyframeSettingsHandler,
|
|
108
109
|
'/api/delete-effect': delete_effect_1.deleteEffectHandler,
|
|
109
110
|
'/api/paste-effects': paste_effects_1.pasteEffectsHandler,
|
|
110
|
-
'/api/delete-jsx-
|
|
111
|
+
'/api/delete-jsx-nodes': delete_jsx_nodes_1.deleteJsxNodesHandler,
|
|
111
112
|
'/api/duplicate-jsx-node': duplicate_jsx_node_1.duplicateJsxNodeHandler,
|
|
112
113
|
'/api/split-jsx-sequence': split_jsx_sequence_1.splitJsxSequenceHandler,
|
|
113
114
|
'/api/split-video-from-audio': split_video_from_audio_1.splitVideoFromAudioHandler,
|
|
115
|
+
'/api/insert-basic-captions': insert_basic_captions_1.insertBasicCaptionsHandler,
|
|
114
116
|
'/api/update-available': update_available_1.handleUpdate,
|
|
115
117
|
'/api/release-notes': release_notes_1.getReleaseNotesHandler,
|
|
116
118
|
'/api/remotion-skills-info': remotion_skills_info_1.remotionSkillsInfoHandler,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addEffectHandler = void 0;
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
|
+
const codemods_1 = require("@remotion/codemods");
|
|
5
6
|
const renderer_1 = require("@remotion/renderer");
|
|
6
|
-
const add_effect_1 = require("../../codemods/add-effect");
|
|
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");
|
|
@@ -11,6 +11,7 @@ const undo_stack_1 = require("../undo-stack");
|
|
|
11
11
|
const formatting_1 = require("./log-updates/formatting");
|
|
12
12
|
const log_update_1 = require("./log-updates/log-update");
|
|
13
13
|
const source_file_write_queue_1 = require("./source-file-write-queue");
|
|
14
|
+
const { addEffect } = codemods_1.CodemodsInternals;
|
|
14
15
|
const addEffectHandler = ({ input: { fileName, sequenceNodePath, effectName, effectImportPath, effectConfig, clientId, }, remotionRoot, logLevel, }) => {
|
|
15
16
|
return (0, source_file_write_queue_1.withSourceFileWriteQueue)(async () => {
|
|
16
17
|
try {
|
|
@@ -21,7 +22,7 @@ const addEffectHandler = ({ input: { fileName, sequenceNodePath, effectName, eff
|
|
|
21
22
|
action: 'modify',
|
|
22
23
|
});
|
|
23
24
|
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
24
|
-
const { output, formatted, effectLabel, nodeLabel, logLine } = await
|
|
25
|
+
const { output, formatted, effectLabel, nodeLabel, logLine } = await addEffect({
|
|
25
26
|
input: fileContents,
|
|
26
27
|
sequenceNodePath: sequenceNodePath.nodePath,
|
|
27
28
|
effectName,
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.applyCodemodHandler = exports.getCodemodLogMessage = exports.formatNewCompositionFile = void 0;
|
|
7
7
|
const node_fs_1 = require("node:fs");
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const codemods_1 = require("@remotion/codemods");
|
|
9
10
|
const renderer_1 = require("@remotion/renderer");
|
|
10
|
-
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
11
11
|
const apply_codemod_to_file_1 = require("../../codemods/apply-codemod-to-file");
|
|
12
12
|
const file_watcher_1 = require("../../file-watcher");
|
|
13
13
|
const format_log_file_location_1 = require("../format-log-file-location");
|
|
@@ -15,7 +15,8 @@ const project_info_1 = require("../project-info");
|
|
|
15
15
|
const undo_stack_1 = require("../undo-stack");
|
|
16
16
|
const can_update_default_props_1 = require("./can-update-default-props");
|
|
17
17
|
const source_file_write_queue_1 = require("./source-file-write-queue");
|
|
18
|
-
const
|
|
18
|
+
const { makeNewCompositionComponentSource, simpleDiff } = codemods_1.CodemodsInternals;
|
|
19
|
+
const formatNewCompositionFile = (codemod) => makeNewCompositionComponentSource(codemod);
|
|
19
20
|
exports.formatNewCompositionFile = formatNewCompositionFile;
|
|
20
21
|
const getFolderPath = (parentName, folderName) => {
|
|
21
22
|
return parentName ? `${parentName}/${folderName}` : folderName;
|
|
@@ -187,7 +188,7 @@ const applyCodemodHandler = ({ input: { codemod, dryRun, symbolicatedStack, undo
|
|
|
187
188
|
filePath,
|
|
188
189
|
codeMod: codemod,
|
|
189
190
|
});
|
|
190
|
-
const diff =
|
|
191
|
+
const diff = simpleDiff({
|
|
191
192
|
oldLines: input.split('\n'),
|
|
192
193
|
newLines: formatted.split('\n'),
|
|
193
194
|
});
|
|
@@ -35,8 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.applyVisualControlHandler = void 0;
|
|
37
37
|
const node_fs_1 = require("node:fs");
|
|
38
|
+
const codemods_1 = require("@remotion/codemods");
|
|
38
39
|
const renderer_1 = require("@remotion/renderer");
|
|
39
|
-
const studio_codemods_1 = require("@remotion/studio-codemods");
|
|
40
40
|
const recast = __importStar(require("recast"));
|
|
41
41
|
const parse_ast_1 = require("../../codemods/parse-ast");
|
|
42
42
|
const file_watcher_1 = require("../../file-watcher");
|
|
@@ -46,6 +46,7 @@ const live_events_1 = require("../live-events");
|
|
|
46
46
|
const undo_stack_1 = require("../undo-stack");
|
|
47
47
|
const watch_ignore_next_change_1 = require("../watch-ignore-next-change");
|
|
48
48
|
const source_file_write_queue_1 = require("./source-file-write-queue");
|
|
49
|
+
const { applyVisualControl } = codemods_1.CodemodsInternals;
|
|
49
50
|
const getVisualControlChangeLine = (file, changeId) => {
|
|
50
51
|
let line = 1;
|
|
51
52
|
recast.types.visit(file.program, {
|
|
@@ -77,7 +78,7 @@ const applyVisualControlHandler = ({ input: { fileName, changes }, remotionRoot,
|
|
|
77
78
|
const fileContents = (0, node_fs_1.readFileSync)(absolutePath, 'utf-8');
|
|
78
79
|
const ast = (0, parse_ast_1.parseAst)(fileContents);
|
|
79
80
|
const logLine = changes.length > 0 ? getVisualControlChangeLine(ast, changes[0].id) : 1;
|
|
80
|
-
const { newContents: output, changesMade } =
|
|
81
|
+
const { newContents: output, changesMade } = applyVisualControl({
|
|
81
82
|
input: fileContents,
|
|
82
83
|
transformation: {
|
|
83
84
|
type: 'apply-visual-control',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CanUpdateDefaultPropsResponse } from '@remotion/studio-shared';
|
|
2
|
-
export
|
|
2
|
+
export declare const computeCanUpdateDefaultPropsFromContent: (content: string, compositionId: string) => CanUpdateDefaultPropsResponse;
|
|
3
3
|
export declare const checkIfTypeScriptFile: (file: string) => void;
|
|
4
4
|
export declare const computeCanUpdateDefaultProps: ({ compositionId, remotionRoot, entryPoint, }: {
|
|
5
5
|
compositionId: string;
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.computeCanUpdateDefaultProps = exports.checkIfTypeScriptFile = exports.computeCanUpdateDefaultPropsFromContent = void 0;
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
|
-
const
|
|
5
|
+
const codemods_1 = require("@remotion/codemods");
|
|
6
6
|
const project_info_1 = require("../project-info");
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "computeCanUpdateDefaultPropsFromContent", { enumerable: true, get: function () { return studio_codemods_2.computeCanUpdateDefaultPropsFromContent; } });
|
|
7
|
+
({ computeCanUpdateDefaultPropsFromContent: exports.computeCanUpdateDefaultPropsFromContent } = codemods_1.CodemodsInternals);
|
|
9
8
|
const checkIfTypeScriptFile = (file) => {
|
|
10
9
|
if (!file.endsWith('.tsx') &&
|
|
11
10
|
!file.endsWith('.ts') &&
|
|
@@ -23,7 +22,7 @@ const computeCanUpdateDefaultProps = async ({ compositionId, remotionRoot, entry
|
|
|
23
22
|
}
|
|
24
23
|
(0, exports.checkIfTypeScriptFile)(projectInfo.rootFile);
|
|
25
24
|
const input = (0, node_fs_1.readFileSync)(projectInfo.rootFile, 'utf-8');
|
|
26
|
-
const result = (0,
|
|
25
|
+
const result = (0, exports.computeCanUpdateDefaultPropsFromContent)(input, compositionId);
|
|
27
26
|
return {
|
|
28
27
|
result,
|
|
29
28
|
rootFile: projectInfo.rootFile,
|
|
@@ -257,6 +257,22 @@ const getInterpolateOutputOption = (node) => {
|
|
|
257
257
|
}
|
|
258
258
|
return null;
|
|
259
259
|
};
|
|
260
|
+
const getInterpolateOutputType = (node) => {
|
|
261
|
+
if (node.type === 'StringLiteral') {
|
|
262
|
+
if (node.value === 'font-weight' ||
|
|
263
|
+
node.value === 'scale' ||
|
|
264
|
+
node.value === 'translate' ||
|
|
265
|
+
node.value === 'rotate' ||
|
|
266
|
+
node.value === 'transform-origin') {
|
|
267
|
+
return node.value;
|
|
268
|
+
}
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
if (node.type === 'TSAsExpression') {
|
|
272
|
+
return getInterpolateOutputType(node.expression);
|
|
273
|
+
}
|
|
274
|
+
return null;
|
|
275
|
+
};
|
|
260
276
|
const getKeyframeEasing = (node) => (0, parse_keyframe_easing_expression_1.parseKeyframeEasingExpression)(node);
|
|
261
277
|
const getKeyframeEasingArray = ({ easingNode, segments, }) => {
|
|
262
278
|
if (segments === 0) {
|
|
@@ -376,6 +392,13 @@ const getInterpolationMetadata = (interpolationFunction, callExpression, keyfram
|
|
|
376
392
|
output = parsedOutput;
|
|
377
393
|
continue;
|
|
378
394
|
}
|
|
395
|
+
if (key === 'outputType') {
|
|
396
|
+
if (interpolationFunction === 'interpolateColors' ||
|
|
397
|
+
getInterpolateOutputType(value) === null) {
|
|
398
|
+
return null;
|
|
399
|
+
}
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
379
402
|
return null;
|
|
380
403
|
}
|
|
381
404
|
return {
|
|
@@ -1279,7 +1302,7 @@ const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys,
|
|
|
1279
1302
|
}
|
|
1280
1303
|
const dotIndex = key.indexOf('.');
|
|
1281
1304
|
if (dotIndex !== -1) {
|
|
1282
|
-
|
|
1305
|
+
const status = getNestedPropStatus({
|
|
1283
1306
|
jsxElement,
|
|
1284
1307
|
ast,
|
|
1285
1308
|
parentKey: key.slice(0, dotIndex),
|
|
@@ -1288,6 +1311,16 @@ const computeSequenceOnlyPropsRecord = ({ jsxElement, jsxElementNode, ast, keys,
|
|
|
1288
1311
|
allowSpecialValues: assetKeys.includes(key),
|
|
1289
1312
|
lastSpreadIndex,
|
|
1290
1313
|
});
|
|
1314
|
+
filteredProps[key] =
|
|
1315
|
+
key === 'style.translate' &&
|
|
1316
|
+
((status.status === 'static' &&
|
|
1317
|
+
typeof status.codeValue === 'string' &&
|
|
1318
|
+
status.codeValue.includes('%')) ||
|
|
1319
|
+
(status.status === 'keyframed' &&
|
|
1320
|
+
status.keyframes.some((keyframe) => typeof keyframe.value === 'string' &&
|
|
1321
|
+
keyframe.value.includes('%'))))
|
|
1322
|
+
? computedStatus()
|
|
1323
|
+
: status;
|
|
1291
1324
|
}
|
|
1292
1325
|
else if (key in allProps) {
|
|
1293
1326
|
filteredProps[key] = allProps[key];
|