@remotion/animation-utils 4.0.142 → 4.0.144
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/esm/index.mjs +643 -646
- package/dist/transformation-helpers/interpolate-styles/utils.js +2 -2
- package/package.json +4 -6
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/test/interpolate-styles.test.d.ts +0 -1
- package/dist/esm/test/make-transform.test.d.ts +0 -1
- package/dist/esm/transformation-helpers/interpolate-styles/constants.d.ts +0 -3
- package/dist/esm/transformation-helpers/interpolate-styles/index.d.ts +0 -8
- package/dist/esm/transformation-helpers/interpolate-styles/utils.d.ts +0 -41
- package/dist/esm/transformation-helpers/make-transform/index.d.ts +0 -4
- package/dist/esm/transformation-helpers/make-transform/is-unit-with-string.d.ts +0 -1
- package/dist/esm/transformation-helpers/make-transform/transform-functions.d.ts +0 -46
- package/dist/esm/type.d.ts +0 -31
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getColorMatchers = exports.breakDownValueIntoUnitNumberAndFunctions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
6
|
function call(...args) {
|
|
7
7
|
return '\\(\\s*(' + args.join(')\\s*,\\s*(') + ')\\s*\\)';
|
|
@@ -93,7 +93,7 @@ const classifyArgsOfFunction = (value) => {
|
|
|
93
93
|
};
|
|
94
94
|
const isColorValue = (value) => {
|
|
95
95
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
96
|
-
if (Object.keys(
|
|
96
|
+
if (Object.keys(no_react_1.NoReactInternals.colorNames).includes(value)) {
|
|
97
97
|
return true;
|
|
98
98
|
}
|
|
99
99
|
const matchers = getColorMatchers();
|
package/package.json
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"name": "Chetan Karwa",
|
|
5
5
|
"email": "cbkarwa@gmail.com"
|
|
6
6
|
},
|
|
7
|
-
"version": "4.0.
|
|
7
|
+
"version": "4.0.144",
|
|
8
8
|
"description": "A set of animation utilities for Remotion",
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
10
|
"module": "./dist/index.mjs",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"remotion": "4.0.
|
|
13
|
+
"remotion": "4.0.144"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
"prettier-plugin-organize-imports": "3.2.4",
|
|
29
29
|
"eslint": "8.56.0",
|
|
30
30
|
"@jonny/eslint-config": "3.0.281",
|
|
31
|
-
"vitest": "0.31.1"
|
|
32
|
-
"rollup": "^2.70.1"
|
|
31
|
+
"vitest": "0.31.1"
|
|
33
32
|
},
|
|
34
33
|
"exports": {
|
|
35
34
|
"./package.json": "./package.json",
|
|
@@ -48,11 +47,10 @@
|
|
|
48
47
|
"animation-utils"
|
|
49
48
|
],
|
|
50
49
|
"scripts": {
|
|
51
|
-
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
52
50
|
"formatting": "prettier src --check",
|
|
53
51
|
"lint": "eslint src --ext ts,tsx",
|
|
54
52
|
"watch": "tsc -w",
|
|
55
|
-
"build": "tsc -d &&
|
|
53
|
+
"build": "tsc -d && bun bundle.ts",
|
|
56
54
|
"test": "vitest --run"
|
|
57
55
|
}
|
|
58
56
|
}
|
package/dist/esm/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { InterpolateOptions } from 'remotion';
|
|
3
|
-
import type { Style } from '../../type';
|
|
4
|
-
/**
|
|
5
|
-
* @description A function that interpolates between two styles based on an input range.
|
|
6
|
-
* @see [Documentation](https://www.remotion.dev/docs/animation-utils/interpolate-styles)
|
|
7
|
-
*/
|
|
8
|
-
export declare const interpolateStyles: (input: number, inputRange: number[], outputStylesRange: Style[], options?: InterpolateOptions) => import("react").CSSProperties;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ColorMatchers, CSSPropertiesValue } from '../../type';
|
|
2
|
-
declare function getColorMatchers(): ColorMatchers;
|
|
3
|
-
declare const breakDownValueIntoUnitNumberAndFunctions: (value: CSSPropertiesValue) => ({
|
|
4
|
-
color: string;
|
|
5
|
-
function?: undefined;
|
|
6
|
-
number?: undefined;
|
|
7
|
-
unit?: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
function: {
|
|
10
|
-
name: string;
|
|
11
|
-
values: ({
|
|
12
|
-
number: number;
|
|
13
|
-
unit: string;
|
|
14
|
-
} | {
|
|
15
|
-
number: number;
|
|
16
|
-
unit?: undefined;
|
|
17
|
-
} | {
|
|
18
|
-
unit: string;
|
|
19
|
-
number?: undefined;
|
|
20
|
-
})[];
|
|
21
|
-
};
|
|
22
|
-
color?: undefined;
|
|
23
|
-
number?: undefined;
|
|
24
|
-
unit?: undefined;
|
|
25
|
-
} | {
|
|
26
|
-
number: number;
|
|
27
|
-
unit: string;
|
|
28
|
-
color?: undefined;
|
|
29
|
-
function?: undefined;
|
|
30
|
-
} | {
|
|
31
|
-
number: number;
|
|
32
|
-
color?: undefined;
|
|
33
|
-
function?: undefined;
|
|
34
|
-
unit?: undefined;
|
|
35
|
-
} | {
|
|
36
|
-
unit: string;
|
|
37
|
-
color?: undefined;
|
|
38
|
-
function?: undefined;
|
|
39
|
-
number?: undefined;
|
|
40
|
-
})[];
|
|
41
|
-
export { breakDownValueIntoUnitNumberAndFunctions, getColorMatchers };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { TransformFunctionReturnType } from '../../type';
|
|
2
|
-
import { matrix, matrix3d, perspective, rotate, rotate3d, rotateX, rotateY, rotateZ, scale, scale3d, scaleX, scaleY, scaleZ, skew, skewX, skewY, translate, translate3d, translateX, translateY, translateZ } from './transform-functions';
|
|
3
|
-
export declare function makeTransform(transforms: TransformFunctionReturnType[]): string;
|
|
4
|
-
export { matrix, matrix3d, perspective, rotate, rotate3d, rotateX, rotateY, rotateZ, scale, scale3d, scaleX, scaleY, scaleZ, skew, skewX, skewY, translate, translate3d, translateX, translateY, translateZ, };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isUnitWithString: (input: unknown, units: readonly string[]) => boolean;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { AngleUnit, AngleUnitString, LengthPercentageUnit, LengthPercentageUnitString, LengthUnit, LengthUnitString } from '../../type';
|
|
2
|
-
declare function matrix(a: number, b: number, c: number, d: number, tx: number, ty: number): string;
|
|
3
|
-
declare function matrix3d(a1: number, b1: number, c1: number, d1: number, a2: number, b2: number, c2: number, d2: number, a3: number, b3: number, c3: number, d3: number, a4: number, b4: number, c4: number, d4: number): string;
|
|
4
|
-
declare function perspective(length: LengthPercentageUnitString): string;
|
|
5
|
-
declare function perspective(length: number, unit?: LengthUnit): string;
|
|
6
|
-
declare function rotate(angle: AngleUnitString): string;
|
|
7
|
-
declare function rotate(angle: number, unit?: AngleUnit): string;
|
|
8
|
-
declare function rotate3d(x: number, y: number, z: number, angle: number): string;
|
|
9
|
-
declare function rotate3d(x: number, y: number, z: number, angle: AngleUnitString): string;
|
|
10
|
-
declare function rotate3d(x: number, y: number, z: number, angle: number, unit?: AngleUnit): string;
|
|
11
|
-
declare function rotateX(angle: AngleUnitString): string;
|
|
12
|
-
declare function rotateX(angle: number, unit?: AngleUnit): string;
|
|
13
|
-
declare function rotateY(angle: AngleUnitString): string;
|
|
14
|
-
declare function rotateY(angle: number, unit?: AngleUnit): string;
|
|
15
|
-
declare function rotateZ(angle: AngleUnitString): string;
|
|
16
|
-
declare function rotateZ(angle: number, unit?: AngleUnit): string;
|
|
17
|
-
declare function scale(x: number, y?: number): string;
|
|
18
|
-
declare function scale3d(x: number, y: number, z: number): string;
|
|
19
|
-
declare function scaleX(x: number): string;
|
|
20
|
-
declare function scaleY(y: number): string;
|
|
21
|
-
declare function scaleZ(z: number): string;
|
|
22
|
-
declare function skew(angle: number): string;
|
|
23
|
-
declare function skew(angle: AngleUnitString): string;
|
|
24
|
-
declare function skew(angle: AngleUnitString, angle2: AngleUnitString): string;
|
|
25
|
-
declare function skew(angle: number, unit: AngleUnit): string;
|
|
26
|
-
declare function skew(angleX: number, angleY: number): string;
|
|
27
|
-
declare function skew(angleX: number, unitX: AngleUnit, angleY: number, unitY: AngleUnit): string;
|
|
28
|
-
declare function skewX(angle: AngleUnitString): string;
|
|
29
|
-
declare function skewX(angle: number, unit?: AngleUnit): string;
|
|
30
|
-
declare function skewY(angle: AngleUnitString): string;
|
|
31
|
-
declare function skewY(angle: number, unit?: AngleUnit): string;
|
|
32
|
-
declare function translate(x: LengthPercentageUnitString): string;
|
|
33
|
-
declare function translate(x: number): string;
|
|
34
|
-
declare function translate(x: number, y: number): string;
|
|
35
|
-
declare function translate(x: LengthPercentageUnitString, y: LengthPercentageUnitString): string;
|
|
36
|
-
declare function translate(translation: number, unit: LengthPercentageUnit): string;
|
|
37
|
-
declare function translate(x: number, unitX: LengthPercentageUnit, y: number, unitY: LengthPercentageUnit): string;
|
|
38
|
-
declare function translate3d(x: LengthPercentageUnitString | number, y: LengthPercentageUnitString | number, z: LengthPercentageUnitString | number): string;
|
|
39
|
-
declare function translate3d(x: number, unitX: LengthPercentageUnit, y: number, unitY: LengthPercentageUnit, z: number, unitZ: LengthUnit): string;
|
|
40
|
-
declare function translateX(x: LengthPercentageUnitString): string;
|
|
41
|
-
declare function translateX(x: number, unit?: LengthPercentageUnit): string;
|
|
42
|
-
declare function translateY(y: LengthPercentageUnitString): string;
|
|
43
|
-
declare function translateY(y: number, unit?: LengthPercentageUnit): string;
|
|
44
|
-
declare function translateZ(z: LengthUnitString): string;
|
|
45
|
-
declare function translateZ(z: number, unit?: LengthUnit): string;
|
|
46
|
-
export { matrix, matrix3d, perspective, rotate, rotate3d, rotateX, rotateY, rotateZ, scale, scale3d, scaleX, scaleY, scaleZ, skew, skewX, skewY, translate, translate3d, translateX, translateY, translateZ, };
|
package/dist/esm/type.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { breakDownValueIntoUnitNumberAndFunctions } from './transformation-helpers/interpolate-styles/utils';
|
|
3
|
-
import type { matrix, matrix3d, perspective, rotate, rotate3d, rotateX, rotateY, rotateZ, scale, scale3d, scaleX, scaleY, scaleZ, skew, skewX, skewY, translate, translate3d, translateX, translateY, translateZ } from './transformation-helpers/make-transform';
|
|
4
|
-
export declare const lengthUnits: readonly ["px", "em", "rem", "pt", "cap", "ch", "ex", "ic", "lh", "rlh", "vmax", "vmin", "vb", "vi", "cqw", "vh", "vw", "cqh", "cqi", "cqb", "cqmin", "cqmax", "cm", "mm", "Q", "in", "pc"];
|
|
5
|
-
export declare const angleUnits: readonly ["rad", "deg", "grad", "turn"];
|
|
6
|
-
export declare const lengthPercentageUnits: readonly ["%", "px", "em", "rem", "pt", "cap", "ch", "ex", "ic", "lh", "rlh", "vmax", "vmin", "vb", "vi", "cqw", "vh", "vw", "cqh", "cqi", "cqb", "cqmin", "cqmax", "cm", "mm", "Q", "in", "pc"];
|
|
7
|
-
type LengthUnit = (typeof lengthUnits)[number];
|
|
8
|
-
type AngleUnit = (typeof angleUnits)[number];
|
|
9
|
-
type LengthPercentageUnit = (typeof lengthPercentageUnits)[number];
|
|
10
|
-
export type LengthUnitString = `${number}${LengthUnit}`;
|
|
11
|
-
export type LengthPercentageUnitString = `${number}${LengthPercentageUnit}`;
|
|
12
|
-
export type AngleUnitString = `${number}${AngleUnit}`;
|
|
13
|
-
type TransformFunctionReturnType = ReturnType<typeof matrix | typeof matrix3d | typeof perspective | typeof rotate | typeof rotate3d | typeof rotateX | typeof rotateY | typeof rotateZ | typeof scale | typeof scale3d | typeof scaleX | typeof scaleY | typeof scaleZ | typeof skew | typeof skewX | typeof skewY | typeof translate | typeof translate3d | typeof translateX | typeof translateY | typeof translateZ>;
|
|
14
|
-
type MatcherType = RegExp | undefined;
|
|
15
|
-
type ColorMatchers = {
|
|
16
|
-
rgb: MatcherType;
|
|
17
|
-
rgba: MatcherType;
|
|
18
|
-
hsl: MatcherType;
|
|
19
|
-
hsla: MatcherType;
|
|
20
|
-
hex3: MatcherType;
|
|
21
|
-
hex4: MatcherType;
|
|
22
|
-
hex5: MatcherType;
|
|
23
|
-
hex6: MatcherType;
|
|
24
|
-
hex8: MatcherType;
|
|
25
|
-
};
|
|
26
|
-
type Style = React.CSSProperties;
|
|
27
|
-
type CSSPropertiesKey = keyof Style;
|
|
28
|
-
type CSSPropertiesValue = Style[CSSPropertiesKey];
|
|
29
|
-
type UnitNumberAndFunctions = ReturnType<typeof breakDownValueIntoUnitNumberAndFunctions>;
|
|
30
|
-
type UnitNumberAndFunction = UnitNumberAndFunctions[0];
|
|
31
|
-
export type { AngleUnit, CSSPropertiesKey, CSSPropertiesValue, ColorMatchers, LengthPercentageUnit, LengthUnit, Style, TransformFunctionReturnType, UnitNumberAndFunction, };
|